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

Version Description

Download this release

Release Info

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

Code changes from version 1.6.4 to 1.7.10

Files changed (57) hide show
  1. Submissions.html.php +0 -858
  2. Submissions.php +0 -384
  3. Theme_functions.php +0 -171
  4. Themes_function.html.php +0 -328
  5. admin/controllers/FMControllerBlocked_ips_fmc.php +146 -0
  6. admin/controllers/FMControllerFeatured_plugins_fmc.php +49 -0
  7. admin/controllers/FMControllerFormMakerEditCSS_fmc.php +98 -0
  8. admin/controllers/FMControllerFormMakerPreview_fmc.php +43 -0
  9. admin/controllers/FMControllerFormcontactwdcaptcha.php +43 -0
  10. admin/controllers/FMControllerFormcontactwindow.php +43 -0
  11. admin/controllers/FMControllerFromeditcountryinpopup_fmc.php +43 -0
  12. admin/controllers/FMControllerFrommapeditinpopup_fmc.php +43 -0
  13. admin/controllers/FMControllerGenerete_csv_fmc.php +43 -0
  14. admin/controllers/FMControllerGenerete_xml_fmc.php +43 -0
  15. admin/controllers/FMControllerLicensing_fmc.php +49 -0
  16. admin/controllers/FMControllerManage_fmc.php +982 -0
  17. admin/controllers/FMControllerShow_matrix_fmc.php +43 -0
  18. admin/controllers/FMControllerSubmissions_fmc.php +761 -0
  19. admin/controllers/FMControllerThemes_fmc.php +190 -0
  20. admin/controllers/FMControllerUninstall_fmc.php +57 -0
  21. admin/controllers/FMControllerWidget_fmc.php +61 -0
  22. admin/models/FMModelBlocked_ips_fmc.php +73 -0
  23. admin/models/FMModelFeatured_plugins_fmc.php +30 -0
  24. admin/models/FMModelFormMakerEditCSS_fmc.php +42 -0
  25. admin/models/FMModelFormMakerPreview_fmc.php +42 -0
  26. admin/models/FMModelFormcontactwdcaptcha.php +31 -0
  27. admin/models/FMModelFormcontactwindow.php +36 -0
  28. admin/models/FMModelFromeditcountryinpopup_fmc.php +31 -0
  29. admin/models/FMModelFrommapeditinpopup_fmc.php +31 -0
  30. admin/models/FMModelGenerete_csv_fmc.php +262 -0
  31. admin/models/FMModelGenerete_xml_fmc.php +260 -0
  32. admin/models/FMModelLicensing_fmc.php +30 -0
  33. admin/models/FMModelManage_fmc.php +1830 -0
  34. admin/models/FMModelShow_matrix_fmc.php +31 -0
  35. admin/models/FMModelSubmissions_fmc.php +591 -0
  36. admin/models/FMModelThemes_fmc.php +88 -0
  37. admin/models/FMModelUninstall_fmc.php +52 -0
  38. admin/models/FMModelWidget_fmc.php +38 -0
  39. admin/views/FMViewBlocked_ips_fmc.php +148 -0
  40. admin/views/FMViewFeatured_plugins_fmc.php +171 -0
  41. admin/views/FMViewFormMakerEditCSS_fmc.php +83 -0
  42. admin/views/FMViewFormMakerPreview_fmc.php +477 -0
  43. admin/views/FMViewFormcontactwdcaptcha.php +93 -0
  44. admin/views/FMViewFormcontactwindow.php +113 -0
  45. admin/views/FMViewFromeditcountryinpopup_fmc.php +141 -0
  46. admin/views/FMViewFrommapeditinpopup_fmc.php +64 -0
  47. admin/views/FMViewGenerete_csv_fmc.php +69 -0
  48. admin/views/FMViewGenerete_xml_fmc.php +67 -0
  49. admin/views/FMViewLicensing_fmc.php +54 -0
  50. admin/views/FMViewManage_fmc.php +3785 -0
  51. admin/views/FMViewShow_matrix_fmc.php +127 -0
  52. admin/views/FMViewSubmissions_fmc.php +2767 -0
  53. admin/views/FMViewThemes_fmc.php +208 -0
  54. admin/views/FMViewUninstall_fmc.php +119 -0
  55. admin/views/FMViewWidget_fmc.php +83 -0
  56. contact-form-maker.php +412 -0
  57. contact_form.php +0 -906
Submissions.html.php DELETED
@@ -1,858 +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
- ?>
21
- <style>
22
- .calendar .button {
23
- display: table-cell !important;
24
- }
25
- </style>
26
- <script type="text/javascript">
27
- function tableOrdering(order, dir, task) {
28
- var form = document.admin_form;
29
- form.filter_order2.value = order;
30
- form.filter_order_Dir2.value = dir;
31
- submitform(task);
32
- }
33
- function ordering(name, as_or_desc) {
34
- alert('This option is disabled in free version. If you need this functionality, you need to buy the commercial version.');
35
- }
36
- function renderColumns() {
37
- allTags = document.getElementsByTagName('*');
38
-
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
- else
54
- allTags[curTag].style.display = '';
55
- }
56
- }
57
- }
58
-
59
- function clickLabChB(label, ChB) {
60
- document.forms.admin_form.hide_label_list.value = document.forms.admin_form.hide_label_list.value.replace('@' + label + '@', '');
61
- if (document.forms.admin_form.hide_label_list.value == '') document.getElementById('ChBAll').checked = true;
62
-
63
- if (!(ChB.checked)) {
64
- document.forms.admin_form.hide_label_list.value += '@' + label + '@';
65
- document.getElementById('ChBAll').checked = false;
66
- }
67
- renderColumns();
68
- }
69
-
70
-
71
- function clickLabChBAll(ChBAll) {
72
- <?php
73
- if (isset($labels)) {
74
- $templabels = array_merge(array(
75
- 'submitid',
76
- 'submitdate',
77
- 'submitterip'
78
- ), $labels_id);
79
- $label_titles = array_merge(array(
80
- 'ID',
81
- 'Submit date',
82
- "Submitter's IP Address"
83
- ), $label_titles);
84
- }
85
- ?>
86
-
87
- if (ChBAll.checked) {
88
- document.forms.admin_form.hide_label_list.value = '';
89
-
90
- for (i = 0; i <= ChBAll.form.length; i++)
91
- if (typeof(ChBAll.form[i]) != "undefined")
92
- if (ChBAll.form[i].type == "checkbox")
93
- ChBAll.form[i].checked = true;
94
- }
95
- else {
96
- document.forms.admin_form.hide_label_list.value = '@<?php echo implode($templabels, '@@') ?>@';
97
-
98
- for (i = 0; i <= ChBAll.form.length; i++)
99
- if (typeof(ChBAll.form[i]) != "undefined")
100
- if (ChBAll.form[i].type == "checkbox")
101
- ChBAll.form[i].checked = false;
102
- }
103
-
104
- renderColumns();
105
- }
106
-
107
- function remove_all() {
108
- document.getElementById('startdate').value = '';
109
- document.getElementById('enddate').value = '';
110
- document.getElementById('ip_search').value = '';
111
- <?php
112
- $n = count($rows);
113
-
114
- for ($i = 0; $i < count($labels); $i++) {
115
- echo "document.getElementById('" . $form_id . '_' . $labels_id[$i] . "_search').value='';
116
- ";
117
- }
118
- ?>
119
- }
120
-
121
- function show_hide_filter() {
122
- if (document.getElementById('fields_filter').style.display == "none") {
123
- document.getElementById('fields_filter').style.display = '';
124
- document.getElementById('filter_img').src = '<?php echo plugins_url('images/filter_hide.png', __FILE__) ?>';
125
- }
126
- else {
127
- document.getElementById('fields_filter').style.display = "none";
128
- document.getElementById('filter_img').src = '<?php echo plugins_url('images/filter_show.png', __FILE__) ?>';
129
- }
130
- }
131
- function submit_del(href_in) {
132
- document.getElementById('admin_form').action = href_in;
133
- document.getElementById('admin_form').submit();
134
- }
135
- <!--
136
- function submitbutton(pressbutton) {
137
- var form = document.adminForm;
138
- if (pressbutton == 'cancel_theme') {
139
- submitform(pressbutton);
140
- return;
141
- }
142
-
143
- if (document.getElementById('title').value == '') {
144
- alert('The theme must have a title')
145
- return;
146
- }
147
- submitform(pressbutton);
148
- }
149
-
150
-
151
- function submitform(pressbutton) {
152
- document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
153
- document.getElementById('adminForm').submit();
154
- }
155
- //-->
156
-
157
- function change_width() {
158
- width = parseInt(document.getElementById('width').value) + 45 + parseInt(document.getElementById('border_width').value);
159
- height = 550;
160
-
161
- document.getElementById('spider_calendar_preview').href = "http://localhost/wordpress/wp-content/plugins/spider-calendar/preview.php?TB_iframe=1&tbWidth=" + width + "&tbHeight=" + height;
162
- }
163
-
164
-
165
- var thickDims, tbWidth, tbHeight;
166
- jQuery(document).ready(function ($) {
167
-
168
- thickDims = function () {
169
- var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
170
-
171
- w = (tbWidth && tbWidth < W - 90) ? tbWidth : W - 200;
172
- h = (tbHeight && tbHeight < H - 60) ? tbHeight : H - 200;
173
-
174
- if (tbWindow.size()) {
175
- tbWindow.width(w).height(h);
176
- $('#TB_iframeContent').width(w).height(h - 27);
177
- tbWindow.css({'margin-left':'-' + parseInt((w / 2), 10) + 'px'});
178
- if (typeof document.body.style.maxWidth != 'undefined')
179
- tbWindow.css({'top':(H - h) / 2, 'margin-top':'0'});
180
- }
181
- };
182
-
183
- thickDims();
184
- $(window).resize(function () {
185
- thickDims()
186
- });
187
-
188
- $('a.thickbox-preview').click(function () {
189
- tb_click.call(this);
190
-
191
- var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text;
192
-
193
- if (tbWidth = href.match(/&tbWidth=[0-9]+/))
194
- tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
195
- else
196
- tbWidth = $(window).width() - 90;
197
-
198
- if (tbHeight = href.match(/&tbHeight=[0-9]+/))
199
- tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
200
- else
201
- tbHeight = $(window).height() - 60;
202
-
203
- if (alink.length) {
204
- url = alink.attr('href') || '';
205
- text = alink.attr('title') || '';
206
- link = '&nbsp; <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
207
- } else {
208
- text = $(this).attr('title') || '';
209
- link = '&nbsp; <span class="tb-theme-preview-link">' + text + '</span>';
210
- }
211
-
212
- $('#TB_title').css({'background-color':'#222', 'color':'#dfdfdf'});
213
- $('#TB_closeAjaxWindow').css({'float':'left'});
214
- $('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
215
-
216
- $('#TB_iframeContent').width('100%');
217
- thickDims();
218
-
219
- return false;
220
- });
221
-
222
- // Theme details
223
- $('.theme-detail').click(function () {
224
- $(this).siblings('.themedetaildiv').toggle();
225
- return false;
226
- });
227
-
228
- });
229
-
230
-
231
- </script>
232
-
233
- <style>
234
-
235
- .reports {
236
- border: 1px solid #DEDEDE;
237
- border-radius: 11px;
238
- background-color: #F0F0F0;
239
- text-align: center;
240
- width: 100px;
241
- }
242
-
243
- .bordered {
244
- border-radius: 8px
245
- }
246
-
247
- .simple_table {
248
- background-color: transparent;
249
- !important
250
- }
251
- </style>
252
- <?php
253
- if (isset($labels)) {
254
- ?>
255
- <div id="sbox-overlay"
256
- 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;"
257
- onclick="toggleChBDiv(false)"></div>
258
- <div
259
- 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"
260
- id="ChBDiv">
261
-
262
- <form action="#">
263
- <p style="font-weight:bold; font-size:18px;margin-top: 0px;">
264
- Select Columns
265
- </p>
266
-
267
- <input type="checkbox" <?php if ($lists['hide_label_list'] === '')
268
- echo 'checked="checked"' ?> onclick="clickLabChBAll(this)" id="ChBAll"/>All</br>
269
-
270
- <?php
271
-
272
- foreach ($templabels as $key => $curlabel) {
273
- if (strpos($lists['hide_label_list'], '@' . $curlabel . '@') === FALSE)
274
- echo '<input type="checkbox" checked="checked" onclick="clickLabChB(\'' . $curlabel . '\', this)" />' . stripslashes($label_titles[$key]) . '<br />';
275
- else
276
- echo '<input type="checkbox" onclick="clickLabChB(\'' . $curlabel . '\', this)" />' . stripslashes($label_titles[$key]) . '<br />';
277
- }
278
-
279
-
280
- ?>
281
- <br/>
282
-
283
- <div style="text-align:center;">
284
- <input type="button" onclick="toggleChBDiv(false);" value="Done"/>
285
- </div>
286
- </form>
287
- </div>
288
-
289
- <?php } ?>
290
- <div style="font-size:14px; font-weight:bold">
291
- <a href="http://web-dorado.com/wordpress-form-maker-guide-2.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
292
- <br />
293
- This section allows you to view and manage form submissions.
294
- <a href="http://web-dorado.com/wordpress-form-maker-guide-6.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
295
- </div>
296
- <form action="admin.php?page=contact_form_Submits" method="post" id="admin_form" name="admin_form">
297
- <input type="hidden" name="option" value="com_formmaker">
298
- <input type="hidden" name="task" value="submits">
299
- <input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if (isset($_POST['asc_or_desc']))
300
- echo esc_html($_POST['asc_or_desc']) ?>">
301
- <input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by']))
302
- echo esc_html($_POST['order_by']) ?>">
303
- <br/>
304
- <table width="95%">
305
- <tr>
306
- <td colspan="11">
307
- <div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
308
- <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="ration:none;">
309
- <img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="www.web-dorado.com" width="215">
310
- </a>
311
- </div>
312
- </td>
313
- </tr>
314
- <tr style="line-height:inherit !important;">
315
- <td align="left" width="300"> Select a form:
316
- <select name="form_id" id="form_id"
317
- onchange="if(document.getElementById('startdate'))remove_all();document.admin_form.submit();">
318
- <option value="0" selected="selected"> Select a Form</option>
319
- <?php
320
- $option = 'com_formmaker';
321
-
322
- // $form_id=$mainframe-> getUserStateFromRequest( $option.'form_id', 'form_id','id','cmd' );
323
- if ($forms)
324
- for ($i = 0, $n = count($forms); $i < $n; $i++) {
325
- $form = $forms[$i];
326
- if ($form_id == $form->id) {
327
- echo "<option value='" . $form->id . "' selected='selected'>" . $form->title . "</option>";
328
- $form_title = $form->title;
329
- }
330
- else
331
- echo "<option value='" . $form->id . "' >" . $form->title . "</option>";
332
- }
333
- ?>
334
- </select>
335
- </td>
336
- <?php if (isset($form_id) and $form_id > 0): ?>
337
- <td class="reports"><strong>Entries</strong><br/><?php echo $total_entries; ?></td>
338
- <td class="reports"><strong>Views</strong><br/><?php echo $total_views ?></td>
339
- <td class="reports"><strong>Conversion Rate</strong><br/><?php if ($total_views)
340
- echo round((($total_entries / $total_views) * 100), 2) . '%';
341
- else echo '0%' ?></td>
342
- <td style="font-size:36px;text-align:center;line-height: initial;">
343
- <?php echo $form_title ?>
344
- </td>
345
- <td style="text-align:right;" width="300">
346
- Export to
347
- <input type="button" value="CSV"
348
- onclick="alert('This option is disabled in free version. If you need this functionality, you need to buy the commercial version.');"/>&nbsp;
349
- <input type="button" value="XML"
350
- onclick="alert('This option is disabled in free version. If you need this functionality, you need to buy the commercial version.');"/>
351
- </td>
352
-
353
- </tr>
354
-
355
- <tr>
356
-
357
- <td colspan=5>
358
- <br/>
359
- <input type="hidden" name="hide_label_list" value="<?php echo $lists['hide_label_list']; ?>"/>
360
- <img src="<?php echo plugins_url("images/filter_show.png", __FILE__) ?>" width="40"
361
- style="vertical-align:bottom; cursor:pointer" onclick="show_hide_filter()" title="Search by fields"
362
- id="filter_img"/>
363
- <input type="button"
364
- onclick="alert('This option is disabled in free version. If you need this functionality, you need to buy the commercial version.');"
365
- value="Go"/>
366
- <input type="button" onclick="remove_all();this.form.submit();" value="Reset"/>
367
- </td>
368
- <td align="right">
369
- <br/><br/>
370
- <?php if (isset($labels))
371
- echo '<input type="button" onclick="alert(\'This option is disabled in free version. If you need this functionality, you need to buy the commercial version.\');" value="Add/Remove Columns" />'; ?>
372
- </td>
373
- </tr>
374
-
375
- <?php else: echo '<td><br /><br /><br /></td></tr>'; endif; ?>
376
- </table>
377
- <?php print_html_nav($pageNav['total'], $pageNav['limit']);
378
- ?>
379
- <div style="border-radius: 3px 3px 3px 3px;border: 1px solid #F0F0F0; overflow-x:auto; width:95%; ">
380
- <table class="wp-list-table widefat fixed posts" style="width:100%; table-layout: inherit !important;">
381
- <thead>
382
- <tr>
383
- <th width="3%"><?php echo '#'; ?></th>
384
-
385
- <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input type="checkbox"></th>
386
- <?php
387
-
388
-
389
- ?>
390
- <th width="4%" scope="col" id="submitid_fc" class="submitid_fc <?php if ($sort["sortid_by"] == "group_id")
391
- echo $sort["custom_style"];
392
- else echo $sort["default_style"]; ?>" <?php if (!(strpos($lists['hide_label_list'], '@submitid@') === FALSE))
393
- echo 'style="display:none;"';?>><a href="javascript:ordering('group_id',<?php if ($sort["sortid_by"] == "group_id")
394
- echo $sort["1_or_2"];
395
- else echo "1"; ?>)"><span>ID</span><span class="sorting-indicator"></span></a></th><?php
396
- ?>
397
- <th width="210px" scope="col" id="submitdate_fc" class="submitdate_fc <?php if ($sort["sortid_by"] == "date")
398
- echo $sort["custom_style"];
399
- else echo $sort["default_style"]; ?>" <?php if (!(strpos($lists['hide_label_list'], '@submitdate@') === FALSE))
400
- echo 'style="display:none;"';?>><a href="javascript:ordering('date',<?php if ($sort["sortid_by"] == "date")
401
- echo $sort["1_or_2"];
402
- else echo "1"; ?>)"><span>Submit date</span><span class="sorting-indicator"></span></a></th><?php
403
- ?>
404
- <th scope="col" id="submitterip_fc" class="submitterip_fc <?php if ($sort["sortid_by"] == "ip")
405
- echo $sort["custom_style"];
406
- else echo $sort["default_style"]; ?>" <?php if (!(strpos($lists['hide_label_list'], '@submitterip@') === FALSE))
407
- echo 'style="display:none;"';?>><a href="javascript:ordering('ip',<?php if ($sort["sortid_by"] == "ip")
408
- echo $sort["1_or_2"];
409
- else echo "1"; ?>)"><span>Submitter's IP Address</span><span class="sorting-indicator"></span></a></th><?php
410
-
411
-
412
-
413
- $n = count($rows);
414
-
415
-
416
- for ($i = 0; $i < count($labels); $i++) {
417
- if (strpos($lists['hide_label_list'], '@' . $labels_id[$i] . '@') === FALSE)
418
- $styleStr = '';
419
- else $styleStr = 'display:none;';
420
- if ($sorted_labels_type[$i] == 'type_address'
421
- )
422
- switch ($label_titles_copy[$i]) {
423
- case 'Street Line':
424
- $field_title = __('Street Address', 'form_maker');
425
- break;
426
- case 'Street Line2':
427
- $field_title = __('Street Address Line 2', 'form_maker');
428
- break;
429
- case 'City':
430
- $field_title = __('City', 'form_maker');
431
- break;
432
- case 'State':
433
- $field_title = __('State / Province / Region', 'form_maker');
434
- break;
435
- case 'Postal':
436
- $field_title = __('Postal / Zip Code', 'form_maker');
437
- break;
438
- case 'Country':
439
- $field_title = __('Country', 'form_maker');
440
- break;
441
- default :
442
- $field_title = stripslashes($label_titles_copy[$i]);
443
- break;
444
- }
445
- else
446
- $field_title = stripslashes($label_titles_copy[$i]);
447
- ?>
448
-
449
- <th style="<?php echo $styleStr; ?>" id="<?php echo $labels_id[$i] . '_fc';?>"
450
- class="<?php echo $labels_id[$i] . '_fc'; if ($sort["sortid_by"] == $labels_id[$i] . "_field")
451
- echo $sort["custom_style"] . '"';
452
- else echo $sort["default_style"] . '"'; ?> "><a
453
- href="javascript:ordering('<?php echo $labels_id[$i] . "_field"; ?>',<?php if ($sort["sortid_by"] == $labels_id[$i] . "_field")
454
- echo $sort["1_or_2"];
455
- else echo "1"; ?>)"><span><?php echo $field_title ?></span><span class="sorting-indicator"></span></a></th>
456
-
457
- <?php
458
- }
459
- ?>
460
- <th style="width:80px">Edit</th>
461
- <th style="width:80px"><a href="javascript:submit_del('admin.php?page=contact_form_Submits&task=remov_cheched')">Delete</a>
462
- </th>
463
- </tr>
464
- <tr id="fields_filter" style="display:none">
465
- <th width="3%"></th>
466
- <th width="3%"></th>
467
- <th width="4%" class="submitid_fc" <?php if (!(strpos($lists['hide_label_list'], '@submitid@') === FALSE))
468
- echo 'style="display:none;"';?> ></th>
469
- <th width="150" class="submitdate_fc"
470
- style="margin:inherit; <?php if (!(strpos($lists['hide_label_list'], '@submitdate@') === FALSE))
471
- echo 'display:none;';?>">
472
- <table align="center" style="margin:auto" class="simple_table">
473
- <tr class="simple_table">
474
- <td class="simple_table" style="text-align:left">From:</td>
475
- <td style="text-align:center" class="simple_table"><input class="inputbox" type="text" name="startdate"
476
- id="startdate" size="15" maxlength="15"
477
- value="<?php echo $lists['startdate'];?>"/></td>
478
- <td style="text-align:center" class="simple_table"><input type="reset" style="width:22px" class="button"
479
- value="..."
480
- onclick="return showCalendar('startdate','%Y-%m-%d');"/>
481
- </td>
482
- </tr>
483
- <tr class="simple_table">
484
- <td style="text-align:left" class="simple_table">To:</td>
485
- <td style="text-align:center" class="simple_table"><input class="inputbox" type="text" name="enddate"
486
- id="enddate" size="15" maxlength="15"
487
- value="<?php echo $lists['enddate'];?>"/></td>
488
- <td style="text-align:center" class="simple_table"><input type="reset" style="width:22px" class="button"
489
- value="..."
490
- onclick="return showCalendar('enddate','%Y-%m-%d');"/>
491
- </td>
492
- </tr>
493
- </table>
494
- </th>
495
- <th width="100" class="submitterip_fc" <?php if (!(strpos($lists['hide_label_list'], '@submitterip@') === FALSE))
496
- echo 'style="display:none;"';?>>
497
- <input type="text" name="ip_search" id="ip_search" value="<?php echo $lists['ip_search']; ?>"
498
- onChange="alert('This option is disabled in free version. If you need this functionality, you need to buy the commercial version.');"/>
499
- </th>
500
- <?php
501
- $n = count($rows);
502
- $ka_fielderov_search = FALSE;
503
-
504
- if ($lists['ip_search'] || $lists['startdate'] || $lists['enddate']) {
505
- $ka_fielderov_search = TRUE;
506
- }
507
-
508
- for ($i = 0; $i < count($labels); $i++) {
509
- if (strpos($lists['hide_label_list'], '@' . $labels_id[$i] . '@') === FALSE)
510
- $styleStr = '';
511
- else
512
- $styleStr = 'style="display:none;"';
513
- if (!$ka_fielderov_search)
514
- if ($lists[$form_id . '_' . $labels_id[$i] . '_search']) {
515
- $ka_fielderov_search = TRUE;
516
- }
517
- if ($sorted_labels_type[$i] != 'type_mark_map')
518
- 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="alert(\'This option is disabled in free version. If you need this functionality, you need to buy the commercial version.\');" >' . '</th>';
519
- else
520
- echo '<th class="' . $labels_id[$i] . '_fc" ' . $styleStr . '>' . '</th>';
521
- }
522
- ?>
523
- <th></th>
524
- <th></th>
525
- </tr>
526
- </thead>
527
- <?php
528
- $k = 0;
529
- $m = count($labels);
530
- $group_id_s = array();
531
- $l = 0;
532
- if (count($rows_ord) > 0 and $m)
533
- for ($i = 0; $i < count($rows_ord); $i++) {
534
- $row = $rows_ord[$i];
535
- if (!in_array($row->group_id, $group_id_s)) {
536
- array_push($group_id_s, $row->group_id);
537
- }
538
- }
539
- for ($www = 0, $qqq = count($group_id_s); $www < $qqq; $www++) {
540
- $i = $group_id_s[$www];
541
- $temp = array();
542
- for ($j = 0; $j < $n; $j++) {
543
- $row = $rows[$j];
544
- if ($row->group_id == $i) {
545
- array_push($temp, $row);
546
- }
547
- }
548
- $f = $temp[0];
549
- $date = $f->date;
550
- $ip = $f->ip;
551
- // $checked = JHTML::_('grid.id', $www, $group_id_s[$www]);
552
- $link = "admin.php?page=contact_form_Submits&task=edit_submit&id=" . $f->group_id;
553
- ?>
554
-
555
- <tr class="<?php echo "row$k"; ?>">
556
-
557
- <td><?php echo $www + 1;?></td>
558
-
559
- <th style="text-align:center" class="check-column"><input type="checkbox" name="post[]"
560
- value="<?php echo $f->group_id; ?>"></th>
561
-
562
- <?php
563
-
564
- if (strpos($lists['hide_label_list'], '@submitid@') === FALSE)
565
- echo '<td class="submitid_fc"><a href="' . $link . '" >' . $f->group_id . '</a></td>';
566
- else
567
- echo '<td class="submitid_fc" style="display:none;"><a href="' . $link . '" >' . $f->group_id . '</a></td>';
568
-
569
- if (strpos($lists['hide_label_list'], '@submitdate@') === FALSE)
570
- echo '<td class="submitdate_fc"><a href="' . $link . '" >' . $date . '</a></td>';
571
- else
572
- echo '<td class="submitdate_fc" style="display:none;"><a href="' . $link . '" >' . $date . '</a></td>';
573
-
574
- if (strpos($lists['hide_label_list'], '@submitterip@') === FALSE)
575
- echo '<td class="submitterip_fc"><a href="' . $link . '" >' . $ip . '</a></td>';
576
- else
577
- echo '<td class="submitterip_fc" style="display:none;"><a href="' . $link . '" >' . $ip . '</a></td>';
578
-
579
-
580
-
581
- //print_r($temp);
582
- $ttt = count($temp);
583
- for ($h = 0; $h < $m; $h++) {
584
- $not_label = TRUE;
585
- for ($g = 0; $g < $ttt; $g++) {
586
- $t = $temp[$g];
587
- if (strpos($lists['hide_label_list'], '@' . $labels_id[$h] . '@') === FALSE)
588
- $styleStr = '';
589
- else $styleStr = 'style="display:none;"';
590
- if ($t->element_label == $labels_id[$h]) {
591
- if (strpos($t->element_value, "***map***")) {
592
- $map_params = explode('***map***', $t->element_value);
593
- $longit = $map_params[0];
594
- $latit = $map_params[1];
595
- echo '<td align="center" class="' . $labels_id[$h] . '_fc" ' . $styleStr . '><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></td>";
596
- }
597
- else if (strpos($t->element_value, "*@@url@@*")) {
598
- $new_file = str_replace("*@@url@@*", '', str_replace("***br***", '<br>', $t->element_value));
599
- $new_filename = explode('/', $new_file);
600
- echo '<td class="' . $labels_id[$h] . '_fc" ' . $styleStr . '><a target="_blank" href="' . $new_file . '">' . $new_filename[count($new_filename) - 1] . "</td>";
601
- }
602
- else
603
- echo '<td class="' . $labels_id[$h] . '_fc" ' . $styleStr . '><pre style="font-family:inherit">' . str_replace("***br***", '<br>', $t->element_value) . '</pre></td>';
604
- $not_label = FALSE;
605
- }
606
- }
607
- if ($not_label)
608
- echo '<td class="' . $labels_id[$h] . '_fc" ' . $styleStr . '></td>';
609
- }
610
- ?>
611
- <td><a
612
- href="javascript:submit_del('admin.php?page=contact_form_Submits&task=edit_submit&id=<?php echo $f->group_id; ?>')">Edit</a>
613
- </td>
614
- <td><a
615
- href="javascript:submit_del('admin.php?page=contact_form_Submits&task=remove_submit&id=<?php echo $f->group_id; ?>')">Delete</a>
616
- </td>
617
- </tr>
618
-
619
- <?php
620
-
621
-
622
- $k = 1 - $k;
623
- }
624
-
625
- ?>
626
-
627
- </table>
628
- </div>
629
-
630
-
631
- <?php
632
- foreach ($sorted_labels_type as $key => $label_type) {
633
- if ($label_type == "type_checkbox" || $label_type == "type_radio" || $label_type == "type_own_select" || $label_type == "type_country") {
634
- ?>
635
- <br/>
636
- <br/>
637
-
638
- <strong><?php echo stripslashes($label_titles_copy[$key]); ?></strong>
639
- <br/>
640
- <br/>
641
-
642
- <?php
643
-
644
- $query = "SELECT element_value FROM " . $wpdb->prefix . "formmaker_submits " . $where_choices . " AND element_label='" . $labels_id[$key] . "'";
645
- $choices = $wpdb->get_results($query);
646
- $colors = array(
647
- '#2CBADE',
648
- '#FE6400'
649
- );
650
- $choices_labels = array();
651
- $choices_count = array();
652
- $all = count($choices);
653
- $unanswered = 0;
654
- foreach ($choices as $key => $choice) {
655
- if ($choice->element_value == '') {
656
- $unanswered++;
657
- }
658
- else {
659
- if (!in_array($choice->element_value, $choices_labels)) {
660
- array_push($choices_labels, $choice->element_value);
661
- array_push($choices_count, 0);
662
- }
663
- $choices_count[array_search($choice->element_value, $choices_labels)]++;
664
- }
665
- }
666
- array_multisort($choices_count, SORT_DESC, $choices_labels);
667
- ?>
668
- <table width="95%" style="width:95%" class="wp-list-table widefat fixed posts">
669
- <thead>
670
- <tr>
671
- <th width="20%">Choices</th>
672
- <th>Percentage</th>
673
- <th width="10%">Count</th>
674
- </tr>
675
- </thead>
676
- <?php
677
- foreach ($choices_labels as $key => $choices_label) {
678
- ?>
679
- <tr>
680
- <td><?php echo str_replace("***br***", '<br>', $choices_label)?></td>
681
- <td>
682
- <div class="bordered"
683
- style="width:<?php echo ($choices_count[$key] / ($all - $unanswered)) * 100; ?>%; height:18px; background-color:<?php echo $colors[$key % 2]; ?>"></div>
684
- </td>
685
- <td><?php echo $choices_count[$key]?></td>
686
- </tr>
687
- <?php
688
- }
689
-
690
- if ($unanswered) {
691
- ?>
692
- <tr>
693
- <td colspan="2" align="right">Unanswered</th>
694
- <td><strong><?php echo $unanswered;?></strong></th>
695
- </tr>
696
-
697
- <?php
698
- }
699
- ?>
700
- <tr>
701
- <td colspan="2" align="right"><strong>Total</strong></th>
702
- <td><strong><?php echo $all;?></strong></th>
703
- </tr>
704
-
705
- </table>
706
- <?php
707
- }
708
- }
709
- ?>
710
-
711
-
712
-
713
- <input type="hidden" name="boxchecked" value="0">
714
-
715
- <input type="hidden" name="filter_order2" value="<?php echo $lists['order']; ?>"/>
716
-
717
- <input type="hidden" name="filter_order_Dir2" value="<?php echo $lists['order_Dir']; ?>"/>
718
-
719
- </form>
720
-
721
- <script>
722
- <?php if ($ka_fielderov_search) { ?>
723
- document.getElementById('fields_filter').style.display = '';
724
- <?php
725
- }?>
726
- </script>
727
-
728
- <?php
729
- }
730
-
731
- function html_editSubmit($rows, $labels_id, $labels_name, $labels_type) {
732
- ?>
733
-
734
- <script language="javascript" type="text/javascript">
735
-
736
- function submitbutton(pressbutton) {
737
- var form = document.adminForm;
738
-
739
- if (pressbutton == 'cancel_submit') {
740
- submitform(pressbutton);
741
- return;
742
- }
743
-
744
- submitform(pressbutton);
745
- }
746
- function submitform(pressbutton) {
747
-
748
- document.getElementById('adminForm').action = document.getElementById('adminForm').action + '&task=' + pressbutton;
749
- document.getElementById('adminForm').submit();
750
- }
751
- </script>
752
- <table width="90%">
753
- <tbody>
754
- <tr>
755
- <td colspan="11">
756
- <div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
757
- <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="text-decoration:none;">
758
- <img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="www.web-dorado.com" width="215">
759
- </a>
760
- </div>
761
- </td>
762
- </tr>
763
- <tr>
764
- <td width="100%"><h2>Edit Submission</h2></td>
765
- <td align="right"><input type="button" onclick="submitbutton('save_submit')" value="Save"
766
- class="button-secondary action"></td>
767
- <td align="right"><input type="button" onclick="submitbutton('appply_submit')" value="Apply"
768
- class="button-secondary action"></td>
769
- <td align="right"><input type="button" onclick="submitbutton('cancel')" value="Cancel"
770
- class="button-secondary action"></td>
771
- </tr>
772
- </tbody>
773
- </table>
774
- <form action="admin.php?page=contact_form_Submits&id=<?php echo (int)$_GET['id']; ?>" method="post" id="adminForm"
775
- name="adminForm">
776
- <table class="admintable">
777
- <tr>
778
- <td class="key">
779
- <label for="ID">ID: </label>
780
- </td>
781
- <td>
782
- <?php echo $rows[0]->group_id;?>
783
- </td>
784
- </tr>
785
-
786
- <tr>
787
- <td class="key">
788
- <label for="Date">Date:
789
- </label>
790
- </td>
791
- <td>
792
- <?php echo $rows[0]->date;?>
793
- </td>
794
- </tr>
795
- <tr>
796
- <td class="key">
797
- <label for="IP">IP:</label>
798
- </td>
799
- <td>
800
- <?php echo $rows[0]->ip;?>
801
- </td>
802
- </tr>
803
-
804
- <?php
805
- foreach ($labels_id as $key => $label_id) {
806
- 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') {
807
- $element_value = '';
808
- foreach ($rows as $row) {
809
- if ($row->element_label == $label_id) {
810
- $element_value = $row->element_value;
811
- break;
812
- }
813
- }
814
- if ($labels_type[$key] != 'type_checkbox')
815
- echo ' <tr>
816
- <td class="key">
817
- <label for="title">
818
- ' . $labels_name[$key] . '
819
- </label>
820
- </td>
821
- <td >
822
- <input type="text" name="submission_' . $label_id . '" id="submission_' . $label_id . '" value="' . str_replace("*@@url@@*", '', $element_value) . '" size="80" />
823
- </td>
824
- </tr>
825
- ';
826
- else {
827
- $choices = explode('***br***', $element_value);
828
- $choices = array_slice($choices, 0, count($choices) - 1);
829
- echo ' <tr>
830
- <td class="key" rowspan="' . count($choices) . '">
831
- <label for="title">
832
- ' . $labels_name[$key] . '
833
- </label>
834
- </td>';
835
- foreach ($choices as $choice_key => $choice)
836
- echo '
837
- <td >
838
- <input type="text" name="submission_' . $label_id . '_' . $choice_key . '" id="submission_' . $label_id . '_' . $choice_key . '" value="' . $choice . '" size="80" />
839
- </td>
840
- </tr>
841
- ';
842
- }
843
- }
844
- }
845
-
846
- ?>
847
- </table>
848
- <input type="hidden" name="option" value="com_formmaker"/>
849
- <input type="hidden" name="id" value="<?php echo $rows[0]->group_id?>"/>
850
- <input type="hidden" name="form_id" value="<?php echo $rows[0]->form_id?>"/>
851
- <input type="hidden" name="date" value="<?php echo $rows[0]->date?>"/>
852
- <input type="hidden" name="ip" value="<?php echo $rows[0]->ip?>"/>
853
- <input type="hidden" name="task" value="save_submit"/>
854
- </form>
855
- <?php
856
- }
857
-
858
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Submissions.php DELETED
@@ -1,384 +0,0 @@
1
- <?php
2
-
3
- if (!current_user_can('manage_options')) {
4
- die('Access Denied');
5
- }
6
- function show_submits() {
7
- global $wpdb;
8
- ///////////////////////////////////////////////////////////////////////////// PAGE NAVI ///////////////////////////////////////////////////
9
- $sort["default_style"] = "manage-column column-autor sortable desc";
10
- if (isset($_POST['page_number'])) {
11
- if ($_POST['asc_or_desc']) {
12
- $sort["sortid_by"] = esc_html($_POST['order_by']);
13
- if ($_POST['asc_or_desc'] == 1) {
14
- $sort["custom_style"] = "manage-column column-title sorted asc";
15
- $sort["1_or_2"] = "2";
16
- $order = "ORDER BY " . $sort["sortid_by"] . " ASC";
17
- }
18
- else {
19
- $sort["custom_style"] = "manage-column column-title sorted desc";
20
- $sort["1_or_2"] = "1";
21
- $order = "ORDER BY " . $sort["sortid_by"] . " DESC";
22
- }
23
- }
24
- else {
25
- $sort["sortid_by"] = "";
26
- }
27
- if ($_POST['page_number']) {
28
- $limit = ((int)$_POST['page_number'] - 1) * 20;
29
- }
30
- else {
31
- $limit = 0;
32
- }
33
- }
34
- else {
35
- $sort["sortid_by"] = "";
36
- $limit = 0;
37
- }
38
- ///////////////////////////////////////////////////////////////// END PAGE NAVI ///////////////////////////////////////////////
39
- $query = "SELECT `id`,`title` FROM " . $wpdb->prefix . "formmaker WHERE `id` IN(" . get_option('contact_form_forms') . ") ORDER BY `title`";
40
- $forms = $wpdb->get_results($query);
41
- //$task = JRequest::getCmd('task');
42
- if (isset($_POST['form_id'])) {
43
- $form_id = (int)$_POST['form_id'];
44
- if ($form_id) {
45
- $query = "SELECT id FROM " . $wpdb->prefix . "formmaker where id=" . $form_id;
46
- $exists = $wpdb->get_var($query);
47
- }
48
- else {
49
- $exists = "";
50
- }
51
- }
52
- else {
53
- $form_id = "";
54
- $exists = "";
55
- }
56
- if (!$exists)
57
- $form_id = 0;
58
- if (isset($_POST['order_by']) && $_POST['order_by'] != "")
59
- $filter_order = esc_html($_POST['order_by']);
60
- else
61
- $filter_order = 'id';
62
- if (isset($_POST['asc_or_desc'])) {
63
- if ($_POST['asc_or_desc'] == 1)
64
- $filter_order_Dir = " ASC";
65
- else
66
- $filter_order_Dir = " DESC";
67
- }
68
- else {
69
- $filter_order_Dir = "";
70
- }
71
- if (isset($_POST['search_submits'])) {
72
- $search_submits = esc_html($_POST['search_submits']);
73
- $search_submits = strtolower($search_submits);
74
- }
75
- else {
76
- $search_submits = "";
77
- }
78
- if (isset($_POST['ip_search'])) {
79
- $ip_search = esc_html($_POST['ip_search']);
80
- $ip_search = strtolower($ip_search);
81
- }
82
- else {
83
- $ip_search = "";
84
- }
85
- $where = array();
86
- $where_choices = array();
87
- if (isset($_POST['startdate'])) {
88
- $lists['startdate'] = esc_html($_POST['startdate']);
89
- }
90
- else {
91
- $lists['startdate'] = "";
92
- }
93
- if (isset($_POST['enddate'])) {
94
- $lists['enddate'] = esc_html($_POST['enddate']);
95
- }
96
- else {
97
- $lists['enddate'] = "";
98
- }
99
- if (isset($_POST['hide_label_list'])) {
100
- $lists['hide_label_list'] = esc_html($_POST['hide_label_list']);
101
- }
102
- else {
103
- $lists['hide_label_list'] = "";
104
- }
105
- /*if ($form_id=="")
106
- if($forms)
107
- $form_id=$forms[0]->id;*/
108
- $where[] = 'form_id="' . $form_id . '"';
109
- $where = (count($where) ? ' WHERE ' . implode(' AND ', $where) : '');
110
- if ($filter_order == 'id' or $filter_order == 'title' or $filter_order == 'mail') {
111
- $orderby = ' ORDER BY `date` desc';
112
- }
113
- else if (!strpos($filter_order, "_field")) {
114
- $orderby = ' ORDER BY ' . $filter_order . ' ' . $filter_order_Dir . '';
115
- }
116
- $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_submits" . $where;
117
- $rows = $wpdb->get_results($query);
118
- $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id='" . $form_id . "'";
119
- $rowsc = $wpdb->get_results($query);
120
- //$orderby=$order;
121
- $where_labels = array();
122
- $n = count($rowsc);
123
- $labels = array();
124
- for ($i = 0; $i < $n; $i++) {
125
- $row = $rowsc[$i];
126
- if (!in_array($row->element_label, $labels)) {
127
- array_push($labels, $row->element_label);
128
- }
129
- }
130
- $sorted_labels_type = array();
131
- $sorted_labels_id = array();
132
- $sorted_labels = array();
133
- $label_titles = array();
134
- if ($labels) {
135
- $label_id = array();
136
- $label_order = array();
137
- $label_order_original = array();
138
- $label_type = array();
139
- $this_form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'");
140
- $label_all = explode('#****#', $this_form->label_order);
141
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
142
- foreach ($label_all as $key => $label_each) {
143
- $label_id_each = explode('#**id**#', $label_each);
144
- array_push($label_id, $label_id_each[0]);
145
- $label_order_each = explode('#**label**#', $label_id_each[1]);
146
- array_push($label_order_original, $label_order_each[0]);
147
- $ptn = "/[^a-zA-Z0-9_]/";
148
- $rpltxt = "";
149
- $label_temp = preg_replace($ptn, $rpltxt, $label_order_each[0]);
150
- array_push($label_order, $label_temp);
151
- array_push($label_type, $label_order_each[1]);
152
- }
153
- foreach ($label_id as $key => $label)
154
- if (in_array($label, $labels)) {
155
- array_push($sorted_labels_type, $label_type[$key]);
156
- array_push($sorted_labels, $label_order[$key]);
157
- array_push($sorted_labels_id, $label);
158
- array_push($label_titles, $label_order_original[$key]);
159
- $search_temp = $_POST[$form_id . '_' . $label . '_search'];
160
- $search_temp = strtolower($search_temp);
161
- $lists[$form_id . '_' . $label . '_search'] = $search_temp;
162
- if ($search_temp) {
163
- $where_labels[] = '(group_id in (SELECT group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE element_label=' . $label . '))';
164
- }
165
- }
166
- }
167
- $where_labels = (count($where_labels) ? ' ' . implode(' AND ', $where_labels) : '');
168
- if ($where_labels)
169
- $where = $where . ' AND ' . $where_labels;
170
- $rows_ord = array();
171
- if (strpos($filter_order, "_field")) {
172
- $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";
173
- if ($wpdb->query($query)) {
174
- echo "database error";
175
- }
176
- $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;
177
- $rows_ord = $wpdb->get_results($query);
178
- }
179
- $query = 'SELECT group_id, date, ip FROM ' . $wpdb->prefix . 'formmaker_submits' . $where . ' group by group_id ' . $orderby;
180
- $group_ids = $wpdb->get_results($query);
181
- $total = count($group_ids);
182
- $query = 'SELECT count(distinct group_id) FROM ' . $wpdb->prefix . 'formmaker_submits where form_id ="' . $form_id . '"';
183
- $total_entries = $wpdb->get_var($query);
184
- if (count($rows_ord) != 0) {
185
- $group_ids = $rows_ord;
186
- $total = count($rows_ord);
187
- $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 ";
188
- $rows_ord = $wpdb->get_results($query);
189
- }
190
- $where2 = array();
191
- $where_choices = $where;
192
- for ($i = $limit; $i < $limit + 20; $i++) {
193
- if ($i < $total)
194
- $where2 [] = "group_id='" . $group_ids[$i]->group_id . "'";
195
- }
196
- $where2 = (count($where2) ? ' AND ( ' . implode(' OR ', $where2) . ' )' : '');
197
- $where = $where . $where2;
198
- $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_submits " . $where . " " . $orderby . '';
199
- $rows = $wpdb->get_results($query);
200
- $pageNav['total'] = $total;
201
- $pageNav['limit'] = $limit / 20 + 1;
202
- $query = 'SELECT `views` FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="' . $form_id . '"';
203
- $total_views = $wpdb->get_var($query);
204
- $lists['order_Dir'] = $filter_order_Dir;
205
- $lists['order'] = $filter_order;
206
- // search filter
207
- $lists['search_submits'] = $search_submits;
208
- $lists['ip_search'] = $ip_search;
209
- if (count($rows_ord) == 0)
210
- $rows_ord = $rows;
211
- // display function
212
- 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);
213
- }
214
-
215
- function remov_submit($id) {
216
- global $wpdb;
217
- $query = "DELETE FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "'";
218
- if ($wpdb->query($query)) {
219
- ?>
220
- <div class="updated"><p><strong>Item Deleted.</strong></p></div>
221
- <?php
222
- }
223
- else {
224
- ?>
225
- <div id="message" class="error"><p>Form Maker Submission Not Deleted</p></div>
226
- <?php
227
- }
228
- }
229
-
230
- function remov_cheched_submission() {
231
- global $wpdb;
232
- $cid = $_POST['post'];
233
- if (count($cid)) {
234
- $cids = esc_html(implode(',', $cid));
235
- // Create sql statement
236
- $query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_submits' . ' WHERE group_id IN ( ' . $cids . ' )';
237
- if ($wpdb->query($query)) {
238
- ?>
239
- <div class="updated"><p><strong>Items Deleted.</strong></p></div>
240
- <?php
241
- }
242
- else {
243
- ?>
244
- <div id="message" class="error"><p>Form Maker Submissions Not Deleted</p></div>
245
- <?php
246
- }
247
- }
248
- else {
249
- ?>
250
- <div id="message" class="error"><p>Submissions Not Selected</p></div>
251
- <?php
252
- }
253
- }
254
-
255
- function editSubmit($id) {
256
- global $wpdb;
257
- $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id=" . $id;
258
- $rows = $wpdb->get_results($query);
259
- $form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id=" . $rows[0]->form_id);
260
- $label_id = array();
261
- $label_order_original = array();
262
- $label_type = array();
263
- $label_all = explode('#****#', $form->label_order);
264
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
265
- foreach ($label_all as $key => $label_each) {
266
- $label_id_each = explode('#**id**#', $label_each);
267
- array_push($label_id, $label_id_each[0]);
268
- $label_oder_each = explode('#**label**#', $label_id_each[1]);
269
- array_push($label_order_original, $label_oder_each[0]);
270
- array_push($label_type, $label_oder_each[1]);
271
- }
272
- // display function
273
- html_editSubmit($rows, $label_id, $label_order_original, $label_type);
274
- }
275
-
276
- function save_submit($id) {
277
- global $wpdb;
278
- $id = (int)$_POST['id'];
279
- $date = esc_html($_POST['date']);
280
- $ip = esc_html($_POST['ip']);
281
- $form_id = $wpdb->get_var("SELECT form_id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "'");
282
- $form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'");
283
- $label_id = array();
284
- $label_order_original = array();
285
- $label_type = array();
286
- $label_all = explode('#****#', $form->label_order);
287
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
288
- foreach ($label_all as $key => $label_each) {
289
- $label_id_each = explode('#**id**#', $label_each);
290
- array_push($label_id, $label_id_each[0]);
291
- $label_oder_each = explode('#**label**#', $label_id_each[1]);
292
- array_push($label_order_original, $label_oder_each[0]);
293
- array_push($label_type, $label_oder_each[1]);
294
- }
295
- foreach ($label_id as $key => $label_id_1) {
296
- $element_value = $_POST["submission_" . $label_id_1];
297
- if (isset($_POST["submission_" . $label_id_1])) {
298
- $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
299
- $result = $wpdb->get_var($query);
300
- if ($label_type[$key] == 'type_file_upload')
301
- if ($element_value)
302
- $element_value = $element_value . "*@@url@@*";
303
- if ($result) {
304
- //$query = "UPDATE ".$wpdb->prefix."formmaker_submits SET `element_value`='".$element_value."' WHERE group_id='".$id."' AND element_label='".$label_id_1."'";
305
- $wpdb->update($wpdb->prefix . "formmaker_submits", array(
306
- 'element_value' => stripslashes($element_value),
307
- ), array(
308
- 'group_id' => $id,
309
- 'element_label' => $label_id_1
310
- ), array(
311
- '%s',
312
- ), array(
313
- '%d',
314
- '%s'
315
- ));
316
- }
317
- else {
318
- $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
319
- 'form_id' => $form_id,
320
- 'element_label' => $label_id_1,
321
- 'element_value' => stripslashes($element_value),
322
- 'group_id' => $id,
323
- 'date' => $date,
324
- 'ip' => $ip
325
- ), array(
326
- '%d',
327
- '%s',
328
- '%s',
329
- '%d',
330
- '%s',
331
- '%s'
332
- ));
333
- }
334
- }
335
- else {
336
- $element_value_ch = $_POST["submission_" . $label_id_1 . '_0'];
337
- if (isset($_POST["submission_" . $label_id_1 . '_0'])) {
338
- for ($z = 0; $z < 21; $z++) {
339
- $element_value_ch = $_POST["submission_" . $label_id_1 . '_' . $z];
340
- if (isset($element_value_ch))
341
- $element_value = $element_value . $element_value_ch . '***br***';
342
- else
343
- break;
344
- }
345
- $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
346
- $result = $wpdb->get_var($query);
347
- if ($result) {
348
- $query = "UPDATE " . $wpdb->prefix . "formmaker_submits SET `element_value`='" . $element_value . "' WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
349
- $wpdb->update($wpdb->prefix . "formmaker_submits", array(
350
- 'element_value' => stripslashes($element_value),
351
- ), array(
352
- 'group_id' => $id,
353
- 'element_label' => $label_id_1
354
- ), array(
355
- '%s',
356
- ), array(
357
- '%d',
358
- '%s'
359
- ));
360
- }
361
- else {
362
- $query = "INSERT INTO " . $wpdb->prefix . "formmaker_submits (form_id, element_label, element_value, group_id, date, ip) VALUES('" . $form_id . "', '" . $label_id_1 . "', '" . $element_value . "','" . $id . "', '" . $date . "', '" . $ip . "')";
363
- $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
364
- 'form_id' => $form_id,
365
- 'element_label' => $label_id_1,
366
- 'element_value' => stripslashes($element_value),
367
- 'group_id' => $id,
368
- 'date' => $date,
369
- 'ip' => $ip
370
- ), array(
371
- '%d',
372
- '%s',
373
- '%s',
374
- '%d',
375
- '%s',
376
- '%s'
377
- ));
378
- }
379
- }
380
- }
381
- }
382
- }
383
-
384
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Theme_functions.php DELETED
@@ -1,171 +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";
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
- $sort["default_style"] = "manage-column column-autor sortable desc";
16
- if (isset($_POST['page_number'])) {
17
- if ($_POST['asc_or_desc']) {
18
- $sort["sortid_by"] = esc_html($_POST['order_by']);
19
- if ($_POST['asc_or_desc'] == 1) {
20
- $sort["custom_style"] = "manage-column column-title sorted asc";
21
- $sort["1_or_2"] = "2";
22
- $order = "ORDER BY " . $sort["sortid_by"] . " ASC";
23
- }
24
- else {
25
- $sort["custom_style"] = "manage-column column-title sorted desc";
26
- $sort["1_or_2"] = "1";
27
- $order = "ORDER BY " . $sort["sortid_by"] . " DESC";
28
- }
29
- }
30
- else {
31
- $sort["sortid_by"] = "";
32
- }
33
- if ($_POST['page_number']) {
34
- $limit = ((int)$_POST['page_number'] - 1) * 20;
35
- }
36
- else {
37
- $limit = 0;
38
- }
39
- }
40
- else {
41
- $sort["sortid_by"] = "";
42
- $limit = 0;
43
- }
44
- if (isset($_POST['search_events_by_title'])) {
45
- $search_tag = esc_html($_POST['search_events_by_title']);
46
- }
47
- else {
48
- $search_tag = "";
49
- }
50
- if ($search_tag) {
51
- $where = ' WHERE title LIKE "%' . $search_tag . '%"';
52
- }
53
- else {
54
- $where = "";
55
- }
56
- if ($order == "")
57
- $order = "ORDER BY `title` ASC";
58
- if (get_option('contact_form_themes') != '') {
59
- if ($where) {
60
- $where .= ' AND `id` IN (' . get_option('contact_form_themes') . ')';
61
- }
62
- else {
63
- $where .= ' WHERE `id` IN (' . get_option('contact_form_themes') . ')';
64
- }
65
- }
66
- else {
67
- if ($where) {
68
- $where .= ' AND `id` IN (0)';
69
- }
70
- else {
71
- $where .= ' WHERE `id` IN (0)';
72
- }
73
- }
74
- // get the total number of records
75
- $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_themes" . $where;
76
- $total = $wpdb->get_var($query);
77
- $pageNav['total'] = $total;
78
- $pageNav['limit'] = $limit / 20 + 1;
79
- $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_themes" . $where . " " . $order . " " . " LIMIT " . $limit . ",20";
80
- $rows = $wpdb->get_results($query);
81
- html_show_theme($rows, $pageNav, $sort);
82
- }
83
-
84
- function save_theme() {
85
- global $wpdb;
86
- $save_or_no = $wpdb->insert($wpdb->prefix . 'formmaker_themes', array(
87
- 'id' => NULL,
88
- 'title' => $_POST["title"],
89
- 'css' => stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST["css"])),
90
- ), array(
91
- '%d',
92
- '%s',
93
- '%s'
94
- ));
95
- if (!$save_or_no) {
96
- ?>
97
- <div class="updated"><p><strong><?php _e('Error. Please install plugin again'); ?></strong></p></div>
98
- <?php
99
- return FALSE;
100
- }
101
- if (get_option('contact_form_themes', '')) {
102
- $xxxxxxx = get_option('contact_form_themes', '') . ',' . $wpdb->get_var("SELECT MAX(`id`) FROM " . $wpdb->prefix . "formmaker_themes");
103
- }
104
- else {
105
- $xxxxxxx = get_option('contact_form_themes', '') . $wpdb->get_var("SELECT MAX(`id`) FROM " . $wpdb->prefix . "formmaker_themes");
106
- }
107
- update_option('contact_form_themes', $xxxxxxx);
108
- ?>
109
- <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
110
- <?php
111
-
112
- return TRUE;
113
- }
114
-
115
- function apply_theme($id) {
116
- global $wpdb;
117
- $save_or_no = $wpdb->update($wpdb->prefix . 'formmaker_themes', array(
118
- 'title' => $_POST["title"],
119
- 'css' => stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST["css"])),
120
- ), array('id' => $id), array(
121
- '%s',
122
- '%s'
123
- ));
124
- ?>
125
- <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
126
- <?php
127
-
128
- return TRUE;
129
- }
130
-
131
- function edit_theme($id) {
132
- global $wpdb;
133
- $row = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker_themes WHERE id='" . $id . "'");
134
- html_edit_theme($row, $id);
135
- }
136
-
137
- function remove_theme($id) {
138
- global $wpdb;
139
- if ($wpdb->get_var("SELECT `default` FROM " . $wpdb->prefix . "formmaker_themes WHERE id='" . $id . "'")) {
140
- ?>
141
- <div class="updated"><p><strong><?php _e("You can't delete default theme"); ?></strong></p></div>
142
- <?php
143
- return;
144
- }
145
- $sql_remov_tag = "DELETE FROM " . $wpdb->prefix . "formmaker_themes WHERE id='" . $id . "'";
146
- if (!$wpdb->query($sql_remov_tag)) {
147
- ?>
148
- <div id="message" class="error"><p>Spider Video Player Theme Not Deleted</p></div>
149
- <?php
150
- }
151
- else {
152
- ?>
153
- <div class="updated"><p><strong><?php _e('Item Deleted.'); ?></strong></p></div>
154
- <?php
155
- }
156
- }
157
-
158
- function default_theme($id) {
159
- global $wpdb;
160
- $ids_for = $wpdb->get_col("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`=1");
161
- for ($i = 0; $i < count($ids_for); $i++) {
162
- $savedd = $wpdb->update($wpdb->prefix . 'formmaker_themes', array(
163
- 'default' => 0,
164
- ), array('id' => $ids_for[$i]), array('%d'));
165
- }
166
- $savedd = $wpdb->update($wpdb->prefix . 'formmaker_themes', array(
167
- 'default' => 1,
168
- ), array('id' => $id), array('%d'));
169
- }
170
-
171
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Themes_function.html.php DELETED
@@ -1,328 +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
- <tr>
33
- <td colspan="11">
34
- <div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
35
- <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="text-decoration:none;">
36
- <img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="www.web-dorado.com" width="215">
37
- </a>
38
- </div>
39
- </td>
40
- </tr>
41
- <tr>
42
- <td width="100%"><h2>Adding New Theme</h2></td>
43
- <td align="right"><input type="button" onclick="submitbutton('Save')" value="Save" class="button-secondary action">
44
- </td>
45
- <td align="right"><input type="button" onclick="submitbutton('Apply')" value="Apply"
46
- class="button-secondary action"></td>
47
- <td align="right"><input type="button" onclick="window.location.href='admin.php?page=contact_form_Themes'"
48
- value="Cancel" class="button-secondary action"></td>
49
- </tr>
50
- </table>
51
- <form action="admin.php?page=contact_form_Themes" method="post" id="adminForm" name="adminForm">
52
- <table class="admintable">
53
-
54
-
55
- <tr>
56
- <td class="key">
57
- <label for="title">
58
- Title of theme:
59
- </label>
60
- </td>
61
- <td>
62
- <input type="text" name="title" id="title" size="80"/>
63
- </td>
64
- </tr>
65
- <tr>
66
- <td class="key">
67
- <label for="title">
68
- Css:
69
- </label>
70
- </td>
71
- <td>
72
- <textarea name="css" id="css" rows=30 cols=100><?php echo $def_theme->css ?></textarea>
73
- </td>
74
- </tr>
75
- </table>
76
- <input type="hidden" name="option" value="com_formmaker"/>
77
- <input type="hidden" name="task" value=""/>
78
- </form>
79
-
80
-
81
-
82
-
83
-
84
- <?php
85
- }
86
-
87
- function html_show_theme($rows, $pageNav, $sort) {
88
- global $wpdb;
89
- ?>
90
- <script language="javascript">
91
- function ordering(name, as_or_desc) {
92
- document.getElementById('asc_or_desc').value = as_or_desc;
93
- document.getElementById('order_by').value = name;
94
- document.getElementById('admin_form').submit();
95
- }
96
- function doNothing() {
97
- var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
98
- if (keyCode == 13) {
99
-
100
-
101
- if (!e) var e = window.event;
102
-
103
- e.cancelBubble = true;
104
- e.returnValue = false;
105
-
106
- if (e.stopPropagation) {
107
- e.stopPropagation();
108
- e.preventDefault();
109
- }
110
- }
111
- }
112
- </script>
113
- <div style="font-size:14px; font-weight:bold">
114
- <a href="http://web-dorado.com/wordpress-form-maker-guide-2.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
115
- <br />
116
- This section allows you to edit form themes.
117
- <a href="http://web-dorado.com/wordpress-form-maker-guide-2.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
118
- </div>
119
- <form method="post" onkeypress="doNothing()" action="admin.php?page=contact_form_Themes" id="admin_form"
120
- name="admin_form">
121
- <table cellspacing="10" width="95%">
122
-
123
-
124
- <tr>
125
- <td style="width:80px">
126
- <?php echo "<h2>" . 'Themes' . "</h2>"; ?>
127
- </td>
128
-
129
- <td style="width:90px; text-align:right;"><p class="submit" style="padding:0px; text-align:left"><input
130
- type="button" value="Add a Theme" name="custom_parametrs"
131
- onclick="window.location.href='admin.php?page=contact_form_Themes&task=add_theme'"/></p></td>
132
- <td style="text-align:right;font-size:16px;padding:20px; padding-right:50px">
133
-
134
- </td>
135
- <td colspan="11">
136
- <div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
137
- <a href="http://web-dorado.com/files/fromContactForm.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" width="215">
140
- </a>
141
- </td>
142
- </tr>
143
- </table>
144
- <?php
145
- if (isset($_POST['serch_or_not'])) {
146
- if ($_POST['serch_or_not'] == "search") {
147
- $serch_value = $_POST['search_events_by_title'];
148
- }
149
- else {
150
- $serch_value = "";
151
- }
152
- }
153
- else {
154
- $serch_value = "";
155
- }
156
- $serch_fields = '<div class="alignleft actions" style="width:180px;">
157
- <label for="search_events_by_title" style="font-size:14px">Title: </label>
158
- <input type="text" name="search_events_by_title" value="' . $serch_value . '" id="search_events_by_title" onchange="clear_serch_texts()">
159
- </div>
160
- <div class="alignleft actions">
161
- <input type="button" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\'; document.getElementById(\'serch_or_not\').value=\'search\';
162
- document.getElementById(\'admin_form\').submit();" class="button-secondary action">
163
- <input type="button" value="Reset" onclick="window.location.href=\'admin.php?page=contact_form_Themes\'" class="button-secondary action">
164
- </div>';
165
- print_html_nav($pageNav['total'], $pageNav['limit'], $serch_fields);
166
-
167
- ?>
168
- <table class="wp-list-table widefat fixed pages" style="width:95%">
169
- <thead>
170
- <TR>
171
- <th scope="col" id="id" class="<?php if ($sort["sortid_by"] == "id")
172
- echo $sort["custom_style"];
173
- else echo $sort["default_style"]; ?>" style=" width:120px"><a
174
- href="javascript:ordering('id',<?php if ($sort["sortid_by"] == "id")
175
- echo $sort["1_or_2"];
176
- else echo "1"; ?>)"><span>ID</span><span class="sorting-indicator"></span></a></th>
177
- <th scope="col" id="title" class="<?php if ($sort["sortid_by"] == "title")
178
- echo $sort["custom_style"];
179
- else echo $sort["default_style"]; ?>" style=""><a
180
- href="javascript:ordering('title',<?php if ($sort["sortid_by"] == "title")
181
- echo $sort["1_or_2"];
182
- else echo "1"; ?>)"><span>Title</span><span class="sorting-indicator"></span></a></th>
183
- <th>Default</th>
184
- <th style="width:80px">Edit</th>
185
- <th style="width:80px">Delete</th>
186
- </TR>
187
- </thead>
188
- <tbody>
189
- <?php for ($i = 0; $i < count($rows); $i++) { ?>
190
- <tr>
191
- <td><?php echo $rows[$i]->id; ?></td>
192
- <td><a
193
- href="admin.php?page=contact_form_Themes&task=edit_theme&id=<?php echo $rows[$i]->id?>"><?php echo $rows[$i]->title; ?></a>
194
- </td>
195
- <td><a <?php if (!$rows[$i]->default)
196
- echo 'style="color:#C00"'; ?>
197
- href="admin.php?page=contact_form_Themes&task=default&id=<?php echo $rows[$i]->id?>"><?php if ($rows[$i]->default)
198
- echo "Default";
199
- else echo "Not Default"; ?></a></td>
200
- <td><a href="admin.php?page=contact_form_Themes&task=edit_theme&id=<?php echo $rows[$i]->id?>">Edit</a></td>
201
- <td><a href="admin.php?page=contact_form_Themes&task=remove_theme&id=<?php echo $rows[$i]->id?>">Delete</a></td>
202
- </tr>
203
- <?php } ?>
204
- </tbody>
205
- </table>
206
- <input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if (isset($_POST['asc_or_desc']))
207
- echo esc_html($_POST['asc_or_desc']);?>"/>
208
- <input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by']))
209
- echo esc_html($_POST['order_by']);?>"/>
210
-
211
- <?php
212
- ?>
213
-
214
-
215
- </form>
216
- <?php
217
- }
218
-
219
- function html_edit_theme($row, $id) {
220
- ?>
221
-
222
-
223
- <script>
224
-
225
- function submitbutton(pressbutton) {
226
-
227
- var form = document.adminForm;
228
-
229
- if (pressbutton == 'cancel_themes') {
230
- submitform(pressbutton);
231
- return;
232
- }
233
- if (form.title.value == "") {
234
- alert('Set Theme title');
235
- return;
236
- }
237
-
238
- submitform(pressbutton);
239
- }
240
- function submitform(pressbutton) {
241
- document.getElementById("adminForm").action = document.getElementById("adminForm").action + "&task=" + pressbutton;
242
- document.getElementById("adminForm").submit();
243
- }
244
-
245
- </script>
246
-
247
-
248
-
249
-
250
-
251
-
252
-
253
-
254
-
255
-
256
-
257
-
258
-
259
-
260
-
261
-
262
-
263
-
264
-
265
-
266
- <table width="90%">
267
- <tr>
268
- <td colspan="11">
269
- <div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
270
- <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank"
271
- style="color:red; text-decoration:none;">
272
- <img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="www.web-dorado.com" width="215">
273
- </a>
274
- </div>
275
- </td>
276
- </tr>
277
- <tr>
278
- <td width="100%"><h2>Theme <?php echo htmlspecialchars($row->title)?></h2></td>
279
- <td align="right"><input type="button" onclick="submitbutton('Save')" value="Save" class="button-secondary action">
280
- </td>
281
- <td align="right"><input type="button" onclick="submitbutton('Apply')" value="Apply"
282
- class="button-secondary action"></td>
283
- <td align="right"><input type="button" onclick="window.location.href='admin.php?page=contact_form_Themes'"
284
- value="Cancel" class="button-secondary action"></td>
285
- </tr>
286
- </table>
287
- <form action="admin.php?page=contact_form_Themes&id=<?php echo $id; ?>" method="post" id="adminForm" name="adminForm">
288
- <table class="admintable">
289
-
290
-
291
- <tr>
292
- <td class="key">
293
- <label for="title">
294
- Title of theme:
295
- </label>
296
- </td>
297
- <td>
298
- <input type="text" name="title" id="title" value="<?php echo htmlspecialchars($row->title) ?>" size="80"/>
299
- </td>
300
- </tr>
301
- <tr>
302
- <td class="key">
303
- <label for="title">
304
- Css:
305
- </label>
306
- </td>
307
- <td>
308
- <textarea name="css" id="css" rows=30 cols=100><?php echo htmlspecialchars($row->css) ?></textarea>
309
- </td>
310
- </tr>
311
- </table>
312
- <input type="hidden" name="option" value="com_formmaker"/>
313
- <input type="hidden" name="id" value="<?php echo $row->id?>"/>
314
- <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>"/>
315
- <input type="hidden" name="task" value=""/>
316
- </form>
317
-
318
-
319
- <?php
320
- }
321
-
322
- function cheched($row, $y) {
323
- if ($row == $y) {
324
- echo'checked="checked"';
325
- }
326
- }
327
-
328
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/controllers/FMControllerBlocked_ips_fmc.php ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerBlocked_ips_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = WDW_FMC_Library::get('task');
23
+ $id = WDW_FMC_Library::get('current_id', 0);
24
+ $message = WDW_FMC_Library::get('message');
25
+ echo WDW_FMC_Library::message_id($message);
26
+ // $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
27
+ // $id = ((isset($_POST['current_id'])) ? esc_html($_POST['current_id']) : 0);
28
+ if (method_exists($this, $task)) {
29
+ $this->$task($id);
30
+ }
31
+ else {
32
+ $this->display();
33
+ }
34
+ }
35
+
36
+ public function display() {
37
+ require_once WD_FMC_DIR . "/admin/models/FMModelBlocked_ips_fmc.php";
38
+ $model = new FMModelBlocked_ips_fmc();
39
+
40
+ require_once WD_FMC_DIR . "/admin/views/FMViewBlocked_ips_fmc.php";
41
+ $view = new FMViewBlocked_ips_fmc($model);
42
+ $view->display();
43
+ }
44
+
45
+ public function save() {
46
+ $message = $this->save_db();
47
+ // $this->display();
48
+ $page = WDW_FMC_Library::get('page');
49
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
50
+ }
51
+
52
+ public function save_db() {
53
+ global $wpdb;
54
+ $id = (isset($_POST['current_id']) ? (int) $_POST['current_id'] : 0);
55
+ $ip = (isset($_POST['ip']) ? esc_html(stripslashes($_POST['ip'])) : '');
56
+ if ($id != 0) {
57
+ $save = $wpdb->update($wpdb->prefix . 'formmaker_blocked', array(
58
+ 'ip' => $ip,
59
+ ), array('id' => $id));
60
+ }
61
+ else {
62
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker_blocked', array(
63
+ 'ip' => $ip,
64
+ ), array(
65
+ '%s',
66
+ ));
67
+ }
68
+ if ($save !== FALSE) {
69
+ $message = 1;
70
+ }
71
+ else {
72
+ $message = 2;
73
+ }
74
+ }
75
+
76
+ public function save_all() {
77
+ global $wpdb;
78
+ $flag = FALSE;
79
+ $ips_id_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_blocked');
80
+ foreach ($ips_id_col as $ip_id) {
81
+ if (isset($_POST['ip' . $ip_id])) {
82
+ $ip = esc_html(stripslashes($_POST['ip' . $ip_id]));
83
+ if ($ip == '') {
84
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $ip_id));
85
+ }
86
+ else {
87
+ $flag = TRUE;
88
+ $wpdb->update($wpdb->prefix . 'formmaker_blocked', array(
89
+ 'ip' => $ip,
90
+ ), array('id' => $ip_id));
91
+ }
92
+ }
93
+ }
94
+ if ($flag) {
95
+ $message = 1;
96
+ }
97
+ // $this->display();
98
+ $page = WDW_FMC_Library::get('page');
99
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
100
+ }
101
+
102
+ public function delete($id) {
103
+ global $wpdb;
104
+ $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $id);
105
+ if ($wpdb->query($query)) {
106
+ $message = 3;
107
+ }
108
+ else {
109
+ $message = 2;
110
+ }
111
+ // $this->display();
112
+ $page = WDW_FMC_Library::get('page');
113
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
114
+ }
115
+
116
+ public function delete_all() {
117
+ global $wpdb;
118
+ $flag = FALSE;
119
+ $ips_id_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_blocked');
120
+ foreach ($ips_id_col as $ip_id) {
121
+ if (isset($_POST['check_' . $ip_id])) {
122
+ $flag = TRUE;
123
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $ip_id));
124
+ }
125
+ }
126
+ if ($flag) {
127
+ $message = 5;
128
+ }
129
+ else {
130
+ $message = 2;
131
+ }
132
+ // $this->display();
133
+ $page = WDW_FMC_Library::get('page');
134
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
135
+ }
136
+
137
+ ////////////////////////////////////////////////////////////////////////////////////////
138
+ // Getters & Setters //
139
+ ////////////////////////////////////////////////////////////////////////////////////////
140
+ ////////////////////////////////////////////////////////////////////////////////////////
141
+ // Private Methods //
142
+ ////////////////////////////////////////////////////////////////////////////////////////
143
+ ////////////////////////////////////////////////////////////////////////////////////////
144
+ // Listeners //
145
+ ////////////////////////////////////////////////////////////////////////////////////////
146
+ }
admin/controllers/FMControllerFeatured_plugins_fmc.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerFeatured_plugins_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
23
+ if (method_exists($this, $task)) {
24
+ $this->$task($id);
25
+ }
26
+ else {
27
+ $this->display();
28
+ }
29
+ }
30
+
31
+ public function display() {
32
+ require_once WD_FMC_DIR . "/admin/models/FMModelFeatured_plugins_fmc.php";
33
+ $model = new FMModelFeatured_plugins_fmc();
34
+
35
+ require_once WD_FMC_DIR . "/admin/views/FMViewFeatured_plugins_fmc.php";
36
+ $view = new FMViewFeatured_plugins_fmc($model);
37
+ $view->display();
38
+ }
39
+
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Getters & Setters //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
+ ////////////////////////////////////////////////////////////////////////////////////////
44
+ // Private Methods //
45
+ ////////////////////////////////////////////////////////////////////////////////////////
46
+ ////////////////////////////////////////////////////////////////////////////////////////
47
+ // Listeners //
48
+ ////////////////////////////////////////////////////////////////////////////////////////
49
+ }
admin/controllers/FMControllerFormMakerEditCSS_fmc.php ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerFormMakerEditCSS_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
23
+ $id = ((isset($_POST['current_id'])) ? esc_html($_POST['current_id']) : 0);
24
+ if (method_exists($this, $task)) {
25
+ $this->$task($id);
26
+ }
27
+ else {
28
+ $this->display();
29
+ }
30
+ }
31
+
32
+ public function display() {
33
+ require_once WD_FMC_DIR . "/admin/models/FMModelFormMakerEditCSS_fmc.php";
34
+ $model = new FMModelFormMakerEditCSS_fmc();
35
+
36
+ require_once WD_FMC_DIR . "/admin/views/FMViewFormMakerEditCSS_fmc.php";
37
+ $view = new FMViewFormMakerEditCSS_fmc($model);
38
+ $view->display();
39
+ }
40
+
41
+ public function save() {
42
+ $this->update_db();
43
+ }
44
+
45
+ public function apply() {
46
+ $this->update_db();
47
+ $this->display();
48
+ }
49
+
50
+ public function save_as_new() {
51
+ $this->insert_db();
52
+ }
53
+
54
+ public function insert_db() {
55
+ global $wpdb;
56
+ $title = (isset($_POST['title']) ? esc_html(stripslashes( $_POST['title'])) : '');
57
+ $css = (isset($_POST['css']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['css'])) : '');
58
+ $default = (isset($_POST['default']) ? esc_html(stripslashes( $_POST['default'])) : 0);
59
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker_themes', array(
60
+ 'title' => $title,
61
+ 'css' => $css,
62
+ 'default' => $default,
63
+ ), array(
64
+ '%s',
65
+ '%s',
66
+ '%d',
67
+ ));
68
+ }
69
+
70
+ public function update_db() {
71
+ global $wpdb;
72
+ $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes( $_POST['current_id'])) : 0);
73
+ $title = (isset($_POST['title']) ? esc_html(stripslashes( $_POST['title'])) : '');
74
+ $css = (isset($_POST['css']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['css'])) : '');
75
+ $default = (isset($_POST['default']) ? esc_html(stripslashes( $_POST['default'])) : 0);
76
+ $save = $wpdb->update($wpdb->prefix . 'formmaker_themes', array(
77
+ 'title' => $title,
78
+ 'css' => $css,
79
+ 'default' => $default,
80
+ ), array('id' => $id));
81
+ if ($save !== FALSE) {
82
+ echo WDW_FMC_Library::message('Item Succesfully Saved.', 'updated');
83
+ }
84
+ else {
85
+ echo WDW_FMC_Library::message('Error. Please install plugin again.', 'error');
86
+ }
87
+ }
88
+
89
+ ////////////////////////////////////////////////////////////////////////////////////////
90
+ // Getters & Setters //
91
+ ////////////////////////////////////////////////////////////////////////////////////////
92
+ ////////////////////////////////////////////////////////////////////////////////////////
93
+ // Private Methods //
94
+ ////////////////////////////////////////////////////////////////////////////////////////
95
+ ////////////////////////////////////////////////////////////////////////////////////////
96
+ // Listeners //
97
+ ////////////////////////////////////////////////////////////////////////////////////////
98
+ }
admin/controllers/FMControllerFormMakerPreview_fmc.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerFormMakerPreview_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FMC_DIR . "/admin/models/FMModelFormMakerPreview_fmc.php";
27
+ $model = new FMModelFormMakerPreview_fmc();
28
+
29
+ require_once WD_FMC_DIR . "/admin/views/FMViewFormMakerPreview_fmc.php";
30
+ $view = new FMViewFormMakerPreview_fmc($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
+ }
admin/controllers/FMControllerFormcontactwdcaptcha.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerFormcontactwdcaptcha {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FMC_DIR . "/admin/models/FMModelFormcontactwdcaptcha.php";
27
+ $model = new FMModelFormcontactwdcaptcha();
28
+
29
+ require_once WD_FMC_DIR . "/admin/views/FMViewFormcontactwdcaptcha.php";
30
+ $view = new FMViewFormcontactwdcaptcha($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
+ }
admin/controllers/FMControllerFormcontactwindow.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerFormcontactwindow {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FMC_DIR . "/admin/models/FMModelFormcontactwindow.php";
27
+ $model = new FMModelFormcontactwindow();
28
+
29
+ require_once WD_FMC_DIR . "/admin/views/FMViewFormcontactwindow.php";
30
+ $view = new FMViewFormcontactwindow($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
+ }
admin/controllers/FMControllerFromeditcountryinpopup_fmc.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_FMC_DIR . "/admin/models/FMModelFromeditcountryinpopup.php";
27
+ $model = new FMModelFromeditcountryinpopup();
28
+
29
+ require_once WD_FMC_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_fmc.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_FMC_DIR . "/admin/models/FMModelFrommapeditinpopup.php";
27
+ $model = new FMModelFrommapeditinpopup();
28
+
29
+ require_once WD_FMC_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_fmc.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_FMC_DIR . "/admin/models/FMModelGenerete_csv.php";
27
+ $model = new FMModelGenerete_csv();
28
+
29
+ require_once WD_FMC_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_fmc.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_FMC_DIR . "/admin/models/FMModelGenerete_xml.php";
27
+ $model = new FMModelGenerete_xml();
28
+
29
+ require_once WD_FMC_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_fmc.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerLicensing_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
23
+ if (method_exists($this, $task)) {
24
+ $this->$task($id);
25
+ }
26
+ else {
27
+ $this->display();
28
+ }
29
+ }
30
+
31
+ public function display() {
32
+ require_once WD_FMC_DIR . "/admin/models/FMModelLicensing_fmc.php";
33
+ $model = new FMModelLicensing_fmc();
34
+
35
+ require_once WD_FMC_DIR . "/admin/views/FMViewLicensing_fmc.php";
36
+ $view = new FMViewLicensing_fmc($model);
37
+ $view->display();
38
+ }
39
+
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Getters & Setters //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
+ ////////////////////////////////////////////////////////////////////////////////////////
44
+ // Private Methods //
45
+ ////////////////////////////////////////////////////////////////////////////////////////
46
+ ////////////////////////////////////////////////////////////////////////////////////////
47
+ // Listeners //
48
+ ////////////////////////////////////////////////////////////////////////////////////////
49
+ }
admin/controllers/FMControllerManage_fmc.php ADDED
@@ -0,0 +1,982 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerManage_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ // $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
23
+ // $id = ((isset($_POST['current_id'])) ? esc_html($_POST['current_id']) : 0);
24
+ $task = WDW_FMC_Library::get('task');
25
+ $id = WDW_FMC_Library::get('current_id', 0);
26
+ $message = WDW_FMC_Library::get('message');
27
+ echo WDW_FMC_Library::message_id($message);
28
+ if (method_exists($this, $task)) {
29
+ $this->$task($id);
30
+ }
31
+ else {
32
+ $this->display();
33
+ }
34
+ }
35
+
36
+ public function display() {
37
+ require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
38
+ $model = new FMModelManage_fmc();
39
+
40
+ require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
41
+ $view = new FMViewManage_fmc($model);
42
+ $view->display();
43
+ }
44
+
45
+ public function add() {
46
+ require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
47
+ $model = new FMModelManage_fmc();
48
+
49
+ require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
50
+ $view = new FMViewManage_fmc($model);
51
+ $view->edit(0);
52
+ }
53
+
54
+ public function edit() {
55
+ require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
56
+ $model = new FMModelManage_fmc();
57
+
58
+ require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
59
+ $view = new FMViewManage_fmc($model);
60
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
61
+ $id = WDW_FMC_Library::get('current_id', 0);
62
+ $view->edit($id);
63
+ }
64
+
65
+ public function edit_old() {
66
+ require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
67
+ $model = new FMModelManage_fmc();
68
+
69
+ require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
70
+ $view = new FMViewManage_fmc($model);
71
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
72
+ $id = WDW_FMC_Library::get('current_id', 0);
73
+ // var_dump('s');
74
+ $view->edit_old($id);
75
+ }
76
+
77
+ public function form_options_old() {
78
+ if (!isset($_GET['task'])) {
79
+ $this->save_db();
80
+ }
81
+ require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
82
+ $model = new FMModelManage_fmc();
83
+
84
+ require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
85
+ $view = new FMViewManage_fmc($model);
86
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
87
+ global $wpdb;
88
+ $id = WDW_FMC_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
89
+ $view->form_options_old($id);
90
+ }
91
+
92
+ public function save_options_old() {
93
+ $message = $this->save_db_options_old();
94
+ // $this->edit_old();
95
+ $page = WDW_FMC_Library::get('page');
96
+ $current_id = WDW_FMC_Library::get('current_id', 0);
97
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit_old', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
98
+ }
99
+
100
+ public function apply_options_old() {
101
+ $message = $this->save_db_options_old();
102
+ require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
103
+ $model = new FMModelManage_fmc();
104
+
105
+ require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
106
+ $view = new FMViewManage_fmc($model);
107
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
108
+ // $view->form_options_old($id);
109
+ $page = WDW_FMC_Library::get('page');
110
+ $current_id = WDW_FMC_Library::get('current_id', 0);
111
+ $fieldset_id = WDW_FMC_Library::get('fieldset_id', 'general');
112
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'form_options_old', 'current_id' => $current_id, 'message' => $message, 'fieldset_id' => $fieldset_id), admin_url('admin.php')));
113
+ }
114
+
115
+ public function save_db_options_old() {
116
+ $javascript = "// Before the form is loaded.
117
+ function before_load() {
118
+
119
+ }
120
+ // Before form submit.
121
+ function before_submit() {
122
+
123
+ }
124
+ // Before form reset.
125
+ function before_reset() {
126
+
127
+ }";
128
+ global $wpdb;
129
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
130
+ $id = WDW_FMC_Library::get('current_id', 0);
131
+ $mail = (isset($_POST['mail']) ? esc_html(stripslashes($_POST['mail'])) : '');
132
+ $theme = (isset($_POST['theme']) ? esc_html(stripslashes($_POST['theme'])) : 1);
133
+ $javascript = (isset($_POST['javascript']) ? stripslashes($_POST['javascript']) : $javascript);
134
+ $script1 = (isset($_POST['script1']) ? esc_html(stripslashes($_POST['script1'])) : '');
135
+ $script2 = (isset($_POST['script2']) ? esc_html(stripslashes($_POST['script2'])) : '');
136
+ $script_user1 = (isset($_POST['script_user1']) ? esc_html(stripslashes($_POST['script_user1'])) : '');
137
+ $script_user2 = (isset($_POST['script_user2']) ? esc_html(stripslashes($_POST['script_user2'])) : '');
138
+ $submit_text = (isset($_POST['submit_text']) ? stripslashes($_POST['submit_text']) : '');
139
+ $url = (isset($_POST['url']) ? esc_html(stripslashes($_POST['url'])) : '');
140
+ $script_mail = (isset($_POST['script_mail']) ? stripslashes($_POST['script_mail']) : '%all%');
141
+ $script_mail_user = (isset($_POST['script_mail_user']) ? stripslashes($_POST['script_mail_user']) : '%all%');
142
+ $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
143
+ $tax = (isset($_POST['tax']) ? esc_html(stripslashes($_POST['tax'])) : 0);
144
+ $payment_currency = (isset($_POST['payment_currency']) ? stripslashes($_POST['payment_currency']) : '');
145
+ $paypal_email = (isset($_POST['paypal_email']) ? esc_html(stripslashes($_POST['paypal_email'])) : '');
146
+ $checkout_mode = (isset($_POST['checkout_mode']) ? esc_html(stripslashes($_POST['checkout_mode'])) : 'testmode');
147
+ $paypal_mode = (isset($_POST['paypal_mode']) ? esc_html(stripslashes($_POST['paypal_mode'])) : 0);
148
+ $from_mail = (isset($_POST['from_mail']) ? esc_html(stripslashes($_POST['from_mail'])) : '');
149
+ $from_name = (isset($_POST['from_name']) ? esc_html(stripslashes($_POST['from_name'])) : '');
150
+ if (isset($_POST['submit_text_type'])) {
151
+ $submit_text_type = esc_html(stripslashes($_POST['submit_text_type']));
152
+ if ($submit_text_type == 5) {
153
+ $article_id = (isset($_POST['page_name']) ? esc_html(stripslashes($_POST['page_name'])) : 0);
154
+ }
155
+ else {
156
+ $article_id = (isset($_POST['post_name']) ? esc_html(stripslashes($_POST['post_name'])) : 0);
157
+ }
158
+ }
159
+ else {
160
+ $submit_text_type = 0;
161
+ $article_id = 0;
162
+ }
163
+ $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
164
+ 'mail' => $mail,
165
+ 'theme' => $theme,
166
+ 'javascript' => $javascript,
167
+ 'submit_text' => $submit_text,
168
+ 'url' => $url,
169
+ 'submit_text_type' => $submit_text_type,
170
+ 'script_mail' => $script_mail,
171
+ 'script_mail_user' => $script_mail_user,
172
+ 'article_id' => $article_id,
173
+ 'paypal_mode' => $paypal_mode,
174
+ 'checkout_mode' => $checkout_mode,
175
+ 'paypal_email' => $paypal_email,
176
+ 'payment_currency' => $payment_currency,
177
+ 'tax' => $tax,
178
+ 'from_mail' => $from_mail,
179
+ 'from_name' => $from_name,
180
+ ), array('id' => $id));
181
+ if ($save !== FALSE) {
182
+ return 8;
183
+ }
184
+ else {
185
+ return 2;
186
+ }
187
+ }
188
+
189
+ public function cancel_options_old() {
190
+ $this->edit_old();
191
+ }
192
+
193
+ public function form_layout() {
194
+ if (!isset($_GET['task'])) {
195
+ $this->save_db();
196
+ }
197
+ require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
198
+ $model = new FMModelManage_fmc();
199
+
200
+ require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
201
+ $view = new FMViewManage_fmc($model);
202
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
203
+ global $wpdb;
204
+ $id = WDW_FMC_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
205
+ $view->form_layout($id);
206
+ }
207
+
208
+ public function save_layout() {
209
+ $message = $this->save_db_layout();
210
+ // $this->edit();
211
+ $page = WDW_FMC_Library::get('page');
212
+ $current_id = WDW_FMC_Library::get('current_id', 0);
213
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
214
+ }
215
+
216
+ public function apply_layout() {
217
+ $message = $this->save_db_layout();
218
+ require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
219
+ $model = new FMModelManage_fmc();
220
+
221
+ require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
222
+ $view = new FMViewManage_fmc($model);
223
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
224
+ $page = WDW_FMC_Library::get('page');
225
+ $current_id = WDW_FMC_Library::get('current_id', 0);
226
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'form_layout', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
227
+ // $view->form_layout($id);
228
+ }
229
+
230
+ public function save_db_layout() {
231
+ global $wpdb;
232
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
233
+ $id = WDW_FMC_Library::get('current_id', 0);
234
+ $custom_front = (isset($_POST['custom_front']) ? stripslashes($_POST['custom_front']) : '');
235
+ $autogen_layout = (isset($_POST['autogen_layout']) ? 1 : 0);
236
+ $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
237
+ 'custom_front' => $custom_front,
238
+ 'autogen_layout' => $autogen_layout
239
+ ), array('id' => $id));
240
+ if ($save !== FALSE) {
241
+ return 1;
242
+ }
243
+ else {
244
+ return 2;
245
+ }
246
+ }
247
+
248
+ public function form_options() {
249
+ if (!isset($_GET['task'])) {
250
+ $this->save_db();
251
+ }
252
+ require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
253
+ $model = new FMModelManage_fmc();
254
+
255
+ require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
256
+ $view = new FMViewManage_fmc($model);
257
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
258
+ global $wpdb;
259
+ $id = WDW_FMC_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
260
+ $view->form_options($id);
261
+ }
262
+
263
+ public function save_options() {
264
+ $message = $this->save_db_options();
265
+ // $this->edit();
266
+ $page = WDW_FMC_Library::get('page');
267
+ $current_id = WDW_FMC_Library::get('current_id', 0);
268
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
269
+ }
270
+
271
+ public function apply_options() {
272
+ $message = $this->save_db_options();
273
+ require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
274
+ $model = new FMModelManage_fmc();
275
+
276
+ require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
277
+ $view = new FMViewManage_fmc($model);
278
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
279
+ // $view->form_options($id);
280
+ $page = WDW_FMC_Library::get('page');
281
+ $current_id = WDW_FMC_Library::get('current_id', 0);
282
+ $fieldset_id = WDW_FMC_Library::get('fieldset_id', 'general');
283
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'form_options', 'current_id' => $current_id, 'message' => $message, 'fieldset_id' => $fieldset_id), admin_url('admin.php')));
284
+ }
285
+
286
+ public function cancel_options() {
287
+ $this->edit();
288
+ }
289
+
290
+ public function save_db_options() {
291
+ $javascript = "// Before the form is loaded.
292
+ function before_load() {
293
+
294
+ }
295
+ // Before form submit.
296
+ function before_submit() {
297
+
298
+ }
299
+ // Before form reset.
300
+ function before_reset() {
301
+
302
+ }";
303
+ global $wpdb;
304
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
305
+ $id = WDW_FMC_Library::get('current_id', 0);
306
+ $published = (isset($_POST['published']) ? esc_html(stripslashes($_POST['published'])) : 1);
307
+ $savedb = (isset($_POST['savedb']) ? esc_html(stripslashes($_POST['savedb'])) : 1);
308
+ $theme = ((isset($_POST['theme']) && (esc_html($_POST['theme']) != 0)) ? esc_html(stripslashes($_POST['theme'])) : $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker_themes"));
309
+ $requiredmark = (isset($_POST['requiredmark']) ? esc_html(stripslashes($_POST['requiredmark'])) : '*');
310
+ $sendemail = (isset($_POST['sendemail']) ? esc_html(stripslashes($_POST['sendemail'])) : 1);
311
+ $mail = (isset($_POST['mail']) ? esc_html(stripslashes($_POST['mail'])) : '');
312
+ $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']) ? 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
+ $condition = (isset($_POST['condition']) ? esc_html(stripslashes($_POST['condition'])) : '');
326
+ $mail_cc = (isset($_POST['mail_cc']) ? esc_html(stripslashes($_POST['mail_cc'])) : '');
327
+ $mail_cc_user = (isset($_POST['mail_cc_user']) ? esc_html(stripslashes($_POST['mail_cc_user'])) : '');
328
+ $mail_bcc = (isset($_POST['mail_bcc']) ? esc_html(stripslashes($_POST['mail_bcc'])) : '');
329
+ $mail_bcc_user = (isset($_POST['mail_bcc_user']) ? esc_html(stripslashes($_POST['mail_bcc_user'])) : '');
330
+ $mail_subject = (isset($_POST['mail_subject']) ? esc_html(stripslashes($_POST['mail_subject'])) : '');
331
+ $mail_subject_user = (isset($_POST['mail_subject_user']) ? esc_html(stripslashes($_POST['mail_subject_user'])) : '');
332
+ $mail_mode = (isset($_POST['mail_mode']) ? esc_html(stripslashes($_POST['mail_mode'])) : 1);
333
+ $mail_mode_user = (isset($_POST['mail_mode_user']) ? esc_html(stripslashes($_POST['mail_mode_user'])) : 1);
334
+ $mail_attachment = (isset($_POST['mail_attachment']) ? esc_html(stripslashes($_POST['mail_attachment'])) : 1);
335
+ $mail_attachment_user = (isset($_POST['mail_attachment_user']) ? esc_html(stripslashes($_POST['mail_attachment_user'])) : 1);
336
+ $script_mail_user = (isset($_POST['script_mail_user']) ? stripslashes($_POST['script_mail_user']) : '%all%');
337
+ $submit_text = (isset($_POST['submit_text']) ? stripslashes($_POST['submit_text']) : '');
338
+ $url = (isset($_POST['url']) ? esc_html(stripslashes($_POST['url'])) : '');
339
+ $tax = (isset($_POST['tax']) ? esc_html(stripslashes($_POST['tax'])) : 0);
340
+ $payment_currency = (isset($_POST['payment_currency']) ? stripslashes($_POST['payment_currency']) : '');
341
+ $paypal_email = (isset($_POST['paypal_email']) ? esc_html(stripslashes($_POST['paypal_email'])) : '');
342
+ $checkout_mode = (isset($_POST['checkout_mode']) ? esc_html(stripslashes($_POST['checkout_mode'])) : 'testmode');
343
+ $paypal_mode = (isset($_POST['paypal_mode']) ? esc_html(stripslashes($_POST['paypal_mode'])) : 0);
344
+ $javascript = (isset($_POST['javascript']) ? stripslashes($_POST['javascript']) : $javascript);
345
+ $send_to = '';
346
+ for ($i = 0; $i < 20; $i++) {
347
+ if (isset($_POST['send_to' . $i])) {
348
+ $send_to .= '*' . esc_html(stripslashes($_POST['send_to' . $i])) . '*';
349
+ }
350
+ }
351
+ if (isset($_POST['submit_text_type'])) {
352
+ $submit_text_type = esc_html(stripslashes($_POST['submit_text_type']));
353
+ if ($submit_text_type == 5) {
354
+ $article_id = (isset($_POST['page_name']) ? esc_html(stripslashes($_POST['page_name'])) : 0);
355
+ }
356
+ else {
357
+ $article_id = (isset($_POST['post_name']) ? esc_html(stripslashes($_POST['post_name'])) : 0);
358
+ }
359
+ }
360
+ else {
361
+ $submit_text_type = 0;
362
+ $article_id = 0;
363
+ }
364
+ $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
365
+ 'published' => $published,
366
+ 'savedb' => $savedb,
367
+ 'theme' => $theme,
368
+ 'requiredmark' => $requiredmark,
369
+ 'sendemail' => $sendemail,
370
+ 'mail' => $mail,
371
+ 'from_mail' => $from_mail,
372
+ 'from_name' => $from_name,
373
+ 'reply_to' => $reply_to,
374
+ 'script_mail' => $script_mail,
375
+ 'mail_from_user' => $mail_from_user,
376
+ 'mail_from_name_user' => $mail_from_name_user,
377
+ 'reply_to_user' => $reply_to_user,
378
+ 'condition' => $condition,
379
+ 'mail_cc' => $mail_cc,
380
+ 'mail_cc_user' => $mail_cc_user,
381
+ 'mail_bcc' => $mail_bcc,
382
+ 'mail_bcc_user' => $mail_bcc_user,
383
+ 'mail_subject' => $mail_subject,
384
+ 'mail_subject_user' => $mail_subject_user,
385
+ 'mail_mode' => $mail_mode,
386
+ 'mail_mode_user' => $mail_mode_user,
387
+ 'mail_attachment' => $mail_attachment,
388
+ 'mail_attachment_user' => $mail_attachment_user,
389
+ 'script_mail_user' => $script_mail_user,
390
+ 'submit_text' => $submit_text,
391
+ 'url' => $url,
392
+ 'submit_text_type' => $submit_text_type,
393
+ 'article_id' => $article_id,
394
+ 'tax' => $tax,
395
+ 'payment_currency' => $payment_currency,
396
+ 'paypal_email' => $paypal_email,
397
+ 'checkout_mode' => $checkout_mode,
398
+ 'paypal_mode' => $paypal_mode,
399
+ 'javascript' => $javascript,
400
+ 'send_to' => $send_to,
401
+ ), array('id' => $id));
402
+ if ($save !== FALSE) {
403
+ return 8;
404
+ }
405
+ else {
406
+ return 2;
407
+ }
408
+ }
409
+
410
+ public function save_as_copy_old() {
411
+ $message = $this->save_db_as_copy_old();
412
+ // $this->display();
413
+ $page = WDW_FMC_Library::get('page');
414
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
415
+ }
416
+
417
+ public function save_old() {
418
+ $message = $this->save_db_old();
419
+ // $this->display();
420
+ $page = WDW_FMC_Library::get('page');
421
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
422
+ }
423
+
424
+ public function apply_old() {
425
+ global $wpdb;
426
+ $message = $this->save_db_old();
427
+ // $this->edit_old();
428
+ $id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
429
+ $current_id = WDW_FMC_Library::get('current_id', $id);
430
+ $page = WDW_FMC_Library::get('page');
431
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit_old', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
432
+ }
433
+
434
+ public function save_db_old() {
435
+ global $wpdb;
436
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
437
+ $id = WDW_FMC_Library::get('current_id', 0);
438
+ $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
439
+ $form = (isset($_POST['form']) ? stripslashes($_POST['form']) : '');
440
+ $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
441
+ $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
442
+ $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
443
+ $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
444
+ $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
445
+ $show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
446
+ $show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
447
+ $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
448
+ $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
449
+ $recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
450
+
451
+ $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
452
+ 'title' => $title,
453
+ 'form' => $form,
454
+ 'form_front' => $form_front,
455
+ 'counter' => $counter,
456
+ 'label_order' => $label_order,
457
+ 'label_order_current' => $label_order_current,
458
+ 'pagination' => $pagination,
459
+ 'show_title' => $show_title,
460
+ 'show_numbers' => $show_numbers,
461
+ 'public_key' => $public_key,
462
+ 'private_key' => $private_key,
463
+ 'recaptcha_theme' => $recaptcha_theme,
464
+ ), array('id' => $id));
465
+ if ($save !== FALSE) {
466
+ return 1;
467
+ }
468
+ else {
469
+ return 2;
470
+ }
471
+ }
472
+
473
+ public function save_db_as_copy_old() {
474
+ global $wpdb;
475
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
476
+ $id = WDW_FMC_Library::get('current_id', 0);
477
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
478
+ $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
479
+ $form = (isset($_POST['form']) ? stripslashes($_POST['form']) : '');
480
+ $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
481
+ $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
482
+ $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
483
+ $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
484
+ $show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
485
+ $show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
486
+ $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
487
+ $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
488
+ $recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
489
+
490
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
491
+ 'title' => $title,
492
+ 'mail' => $row->mail,
493
+ 'form' => $form,
494
+ 'form_front' => $form_front,
495
+ 'theme' => $row->theme,
496
+ 'counter' => $counter,
497
+ 'label_order' => $label_order,
498
+ 'pagination' => $pagination,
499
+ 'show_title' => $show_title,
500
+ 'show_numbers' => $show_numbers,
501
+ 'public_key' => $public_key,
502
+ 'private_key' => $private_key,
503
+ 'recaptcha_theme' => $recaptcha_theme,
504
+ 'javascript' => $row->javascript,
505
+ 'script1' => $row->script1,
506
+ 'script2' => $row->script2,
507
+ 'script_user1' => $row->script_user1,
508
+ 'script_user2' => $row->script_user2,
509
+ 'submit_text' => $row->submit_text,
510
+ 'url' => $row->url,
511
+ 'article_id' => $row->article_id,
512
+ 'submit_text_type' => $row->submit_text_type,
513
+ 'script_mail' => $row->script_mail,
514
+ 'script_mail_user' => $row->script_mail_user,
515
+ 'paypal_mode' => $row->paypal_mode,
516
+ 'checkout_mode' => $row->checkout_mode,
517
+ 'paypal_email' => $row->paypal_email,
518
+ 'payment_currency' => $row->payment_currency,
519
+ 'tax' => $row->tax,
520
+ 'label_order_current' => $row->label_order_current,
521
+ 'from_mail' => $row->from_mail,
522
+ 'from_name' => $row->from_name,
523
+ 'reply_to_user' => $row->reply_to_user,
524
+ 'mail_from_name_user' => $row->mail_from_name_user,
525
+ 'mail_from_user' => $row->mail_from_user,
526
+ 'custom_front' => $row->custom_front,
527
+ 'autogen_layout' => $row->autogen_layout,
528
+ 'send_to' => $row->send_to,
529
+ 'reply_to' => $row->reply_to,
530
+ 'requiredmark' => $row->requiredmark,
531
+ 'sendemail' => $row->sendemail,
532
+ 'savedb' => $row->savedb,
533
+ 'form_fields' => $row->form_fields,
534
+ 'published' => $row->published
535
+ ), array(
536
+ '%s',
537
+ '%s',
538
+ '%s',
539
+ '%s',
540
+ '%d',
541
+ '%d',
542
+ '%s',
543
+ '%s',
544
+ '%s',
545
+ '%s',
546
+ '%s',
547
+ '%s',
548
+ '%s',
549
+ '%s',
550
+ '%s',
551
+ '%s',
552
+ '%s',
553
+ '%s',
554
+ '%s',
555
+ '%s',
556
+ '%s',
557
+ '%d',
558
+ '%s',
559
+ '%s',
560
+ '%d',
561
+ '%s',
562
+ '%s',
563
+ '%s',
564
+ '%s',
565
+ '%s',
566
+ '%s',
567
+ '%s',
568
+ '%s',
569
+ '%s',
570
+ '%s',
571
+ '%s',
572
+ '%d',
573
+ '%s',
574
+ '%s',
575
+ '%s',
576
+ '%d',
577
+ '%d',
578
+ '%s',
579
+ '%d'
580
+ ));
581
+ $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
582
+ update_option('contact_form_forms', ((get_option('contact_form_forms')) ? (get_option('contact_form_forms')) . ',' . $id : $id));
583
+ $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
584
+ 'form_id' => $id,
585
+ 'views' => 0
586
+ ), array(
587
+ '%d',
588
+ '%d'
589
+ ));
590
+ if ($save !== FALSE) {
591
+ return 1;
592
+ }
593
+ else {
594
+ return 2;
595
+ }
596
+ }
597
+
598
+ public function save_as_copy() {
599
+ $message = $this->save_db_as_copy();
600
+ // $this->display();
601
+ $page = WDW_FMC_Library::get('page');
602
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
603
+ }
604
+
605
+ public function save() {
606
+ $message = $this->save_db();
607
+ // $this->display();
608
+ $page = WDW_FMC_Library::get('page');
609
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
610
+ }
611
+
612
+ public function apply() {
613
+ $message = $this->save_db();
614
+ // $this->edit();
615
+ global $wpdb;
616
+ $id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
617
+ $current_id = WDW_FMC_Library::get('current_id', $id);
618
+ $page = WDW_FMC_Library::get('page');
619
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
620
+ }
621
+
622
+ public function save_db() {
623
+ global $wpdb;
624
+ $javascript = "// before form is load
625
+ function before_load() {
626
+ }
627
+ // before form submit
628
+ function before_submit() {
629
+ }
630
+ // before form reset
631
+ function before_reset() {
632
+ }";
633
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
634
+ $id = WDW_FMC_Library::get('current_id', 0);
635
+ $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
636
+ $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
637
+ $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
638
+ $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
639
+ $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
640
+ $show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
641
+ $show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
642
+ $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
643
+ $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
644
+ $recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
645
+ $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
646
+ $form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
647
+
648
+ if ($id != 0) {
649
+ $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
650
+ 'title' => $title,
651
+ 'form_front' => $form_front,
652
+ 'counter' => $counter,
653
+ 'label_order' => $label_order,
654
+ 'label_order_current' => $label_order_current,
655
+ 'pagination' => $pagination,
656
+ 'show_title' => $show_title,
657
+ 'show_numbers' => $show_numbers,
658
+ 'public_key' => $public_key,
659
+ 'private_key' => $private_key,
660
+ 'recaptcha_theme' => $recaptcha_theme,
661
+ 'form_fields' => $form_fields,
662
+ ), array('id' => $id));
663
+ }
664
+ else {
665
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
666
+ 'title' => $title,
667
+ 'mail' => '',
668
+ 'form_front' => $form_front,
669
+ 'theme' => $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE css LIKE '%.wdform_section%'"),
670
+ 'counter' => $counter,
671
+ 'label_order' => $label_order,
672
+ 'pagination' => $pagination,
673
+ 'show_title' => $show_title,
674
+ 'show_numbers' => $show_numbers,
675
+ 'public_key' => $public_key,
676
+ 'private_key' => $private_key,
677
+ 'recaptcha_theme' => $recaptcha_theme,
678
+ 'javascript' => $javascript,
679
+ 'submit_text' => '',
680
+ 'url' => '',
681
+ 'article_id' => 0,
682
+ 'submit_text_type' => 0,
683
+ 'script_mail' => '%all%',
684
+ 'script_mail_user' => '%all%',
685
+ 'label_order_current' => $label_order_current,
686
+ 'tax' => 0,
687
+ 'payment_currency' => '',
688
+ 'paypal_email' => '',
689
+ 'checkout_mode' => 'testmode',
690
+ 'paypal_mode' => 0,
691
+ 'published' => 1,
692
+ 'form_fields' => $form_fields,
693
+ 'savedb' => 1,
694
+ 'sendemail' => 1,
695
+ 'requiredmark' => '*',
696
+ 'from_mail' => '',
697
+ 'from_name' => '',
698
+ 'reply_to' => '',
699
+ 'send_to' => '',
700
+ 'autogen_layout' => 1,
701
+ 'custom_front' => '',
702
+ 'mail_from_user' => '',
703
+ 'mail_from_name_user' => '',
704
+ 'reply_to_user' => '',
705
+ 'condition' => '',
706
+ 'mail_cc' => '',
707
+ 'mail_cc_user' => '',
708
+ 'mail_bcc' => '',
709
+ 'mail_bcc_user' => '',
710
+ 'mail_subject' => '',
711
+ 'mail_subject_user' => '',
712
+ 'mail_mode' => 1,
713
+ 'mail_mode_user' => 1,
714
+ 'mail_attachment' => 1,
715
+ 'mail_attachment_user' => 1,
716
+ ), array(
717
+ '%s',
718
+ '%s',
719
+ '%s',
720
+ '%d',
721
+ '%d',
722
+ '%s',
723
+ '%s',
724
+ '%s',
725
+ '%s',
726
+ '%s',
727
+ '%s',
728
+ '%s',
729
+ '%s',
730
+ '%s',
731
+ '%s',
732
+ '%d',
733
+ '%d',
734
+ '%s',
735
+ '%s',
736
+ '%s',
737
+ '%s',
738
+ '%s',
739
+ '%s',
740
+ '%s',
741
+ '%d',
742
+ '%d',
743
+ '%s',
744
+ '%d',
745
+ '%d',
746
+ '%s',
747
+ '%s',
748
+ '%s',
749
+ '%s',
750
+ '%s',
751
+ '%d',
752
+ '%s',
753
+ '%s',
754
+ '%s',
755
+ '%s',
756
+ '%s',
757
+ '%s',
758
+ '%s',
759
+ '%s',
760
+ '%s',
761
+ '%s',
762
+ '%s',
763
+ '%d',
764
+ '%d',
765
+ '%d',
766
+ '%d',
767
+ ));
768
+ $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
769
+ update_option('contact_form_forms', ((get_option('contact_form_forms')) ? (get_option('contact_form_forms')) . ',' . $id : $id));
770
+ // $_POST['current_id'] = $id;
771
+ $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
772
+ 'form_id' => $id,
773
+ 'views' => 0
774
+ ), array(
775
+ '%d',
776
+ '%d'
777
+ ));
778
+ }
779
+ if ($save !== FALSE) {
780
+ return 1;
781
+ }
782
+ else {
783
+ return 2;
784
+ }
785
+ }
786
+
787
+ public function save_db_as_copy() {
788
+ global $wpdb;
789
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
790
+ $id = WDW_FMC_Library::get('current_id', 0);
791
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
792
+ $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
793
+ $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
794
+ $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
795
+ $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
796
+ $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
797
+ $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
798
+ $show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
799
+ $show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
800
+ $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
801
+ $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
802
+ $recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
803
+ $form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
804
+
805
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
806
+ 'title' => $title,
807
+ 'mail' => $row->mail,
808
+ 'form_front' => $form_front,
809
+ 'theme' => $row->theme,
810
+ 'counter' => $counter,
811
+ 'label_order' => $label_order,
812
+ 'pagination' => $pagination,
813
+ 'show_title' => $show_title,
814
+ 'show_numbers' => $show_numbers,
815
+ 'public_key' => $public_key,
816
+ 'private_key' => $private_key,
817
+ 'recaptcha_theme' => $recaptcha_theme,
818
+ 'javascript' => $row->javascript,
819
+ 'submit_text' => $row->submit_text,
820
+ 'url' => $row->url,
821
+ 'article_id' => $row->article_id,
822
+ 'submit_text_type' => $row->submit_text_type,
823
+ 'script_mail' => $row->script_mail,
824
+ 'script_mail_user' => $row->script_mail_user,
825
+ 'label_order_current' => $label_order_current,
826
+ 'tax' => $row->tax,
827
+ 'payment_currency' => $row->payment_currency,
828
+ 'paypal_email' => $row->paypal_email,
829
+ 'checkout_mode' => $row->checkout_mode,
830
+ 'paypal_mode' => $row->paypal_mode,
831
+ 'published' => $row->published,
832
+ 'form_fields' => $form_fields,
833
+ 'savedb' => $row->savedb,
834
+ 'sendemail' => $row->sendemail,
835
+ 'requiredmark' => $row->requiredmark,
836
+ 'from_mail' => $row->from_mail,
837
+ 'from_name' => $row->from_name,
838
+ 'reply_to' => $row->reply_to,
839
+ 'send_to' => $row->send_to,
840
+ 'autogen_layout' => $row->autogen_layout,
841
+ 'custom_front' => $row->custom_front,
842
+ 'mail_from_user' => $row->mail_from_user,
843
+ 'mail_from_name_user' => $row->mail_from_name_user,
844
+ 'reply_to_user' => $row->reply_to_user,
845
+ 'condition' => $row->condition,
846
+ 'mail_cc' => $row->mail_cc,
847
+ 'mail_cc_user' => $row->mail_cc_user,
848
+ 'mail_bcc' => $row->mail_bcc,
849
+ 'mail_bcc_user' => $row->mail_bcc_user,
850
+ 'mail_subject' => $row->mail_subject,
851
+ 'mail_subject_user' => $row->mail_subject_user,
852
+ 'mail_mode' => $row->mail_mode,
853
+ 'mail_mode_user' => $row->mail_mode_user,
854
+ 'mail_attachment' => $row->mail_attachment,
855
+ 'mail_attachment_user' => $row->mail_attachment_user,
856
+ ), array(
857
+ '%s',
858
+ '%s',
859
+ '%s',
860
+ '%d',
861
+ '%d',
862
+ '%s',
863
+ '%s',
864
+ '%s',
865
+ '%s',
866
+ '%s',
867
+ '%s',
868
+ '%s',
869
+ '%s',
870
+ '%s',
871
+ '%s',
872
+ '%d',
873
+ '%d',
874
+ '%s',
875
+ '%s',
876
+ '%s',
877
+ '%s',
878
+ '%s',
879
+ '%s',
880
+ '%s',
881
+ '%d',
882
+ '%d',
883
+ '%s',
884
+ '%d',
885
+ '%d',
886
+ '%s',
887
+ '%s',
888
+ '%s',
889
+ '%s',
890
+ '%s',
891
+ '%d',
892
+ '%s',
893
+ '%s',
894
+ '%s',
895
+ '%s',
896
+ '%s',
897
+ '%s',
898
+ '%s',
899
+ '%s',
900
+ '%s',
901
+ '%s',
902
+ '%s',
903
+ '%d',
904
+ '%d',
905
+ '%d',
906
+ '%d',
907
+ ));
908
+ $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
909
+ update_option('contact_form_forms', ((get_option('contact_form_forms')) ? (get_option('contact_form_forms')) . ',' . $id : $id));
910
+ $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
911
+ 'form_id' => $id,
912
+ 'views' => 0
913
+ ), array(
914
+ '%d',
915
+ '%d'
916
+ ));
917
+ if ($save !== FALSE) {
918
+ return 1;
919
+ }
920
+ else {
921
+ return 2;
922
+ }
923
+ }
924
+
925
+ public function delete($id) {
926
+ global $wpdb;
927
+ $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id);
928
+ if ($wpdb->query($query)) {
929
+ $arr = explode(',', get_option('contact_form_forms'));
930
+ $arr = array_diff($arr, array($id));
931
+ $arr = implode(',', $arr);
932
+ update_option('contact_form_forms', $arr);
933
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $id));
934
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $id));
935
+ $message = 3;
936
+ }
937
+ else {
938
+ $message = 2;
939
+ }
940
+ // $this->display();
941
+ $page = WDW_FMC_Library::get('page');
942
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
943
+ }
944
+
945
+ public function delete_all() {
946
+ global $wpdb;
947
+ $flag = FALSE;
948
+ $isDefault = FALSE;
949
+ $form_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker');
950
+ foreach ($form_ids_col as $form_id) {
951
+ if (isset($_POST['check_' . $form_id])) {
952
+ $flag = TRUE;
953
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
954
+ $arr = explode(',', get_option('contact_form_forms'));
955
+ $arr = array_diff($arr, array($form_id));
956
+ $arr = implode(',', $arr);
957
+ update_option('contact_form_forms', $arr);
958
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $form_id));
959
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $form_id));
960
+ }
961
+ }
962
+ if ($flag) {
963
+ $message = 5;
964
+ }
965
+ else {
966
+ $message = 6;
967
+ }
968
+ // $this->display();
969
+ $page = WDW_FMC_Library::get('page');
970
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
971
+ }
972
+
973
+ ////////////////////////////////////////////////////////////////////////////////////////
974
+ // Getters & Setters //
975
+ ////////////////////////////////////////////////////////////////////////////////////////
976
+ ////////////////////////////////////////////////////////////////////////////////////////
977
+ // Private Methods //
978
+ ////////////////////////////////////////////////////////////////////////////////////////
979
+ ////////////////////////////////////////////////////////////////////////////////////////
980
+ // Listeners //
981
+ ////////////////////////////////////////////////////////////////////////////////////////
982
+ }
admin/controllers/FMControllerShow_matrix_fmc.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_FMC_DIR . "/admin/models/FMModelShow_matrix.php";
27
+ $model = new FMModelShow_matrix();
28
+
29
+ require_once WD_FMC_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_fmc.php ADDED
@@ -0,0 +1,761 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerSubmissions_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
23
+ $id = ((isset($_POST['current_id'])) ? esc_html($_POST['current_id']) : 0);
24
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
25
+ if (method_exists($this, $task)) {
26
+ $this->$task($id);
27
+ }
28
+ else {
29
+ $this->display($form_id);
30
+ }
31
+ }
32
+
33
+ public function display($form_id) {
34
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
35
+ require_once WD_FMC_DIR . "/admin/models/FMModelSubmissions_fmc.php";
36
+ $model = new FMModelSubmissions_fmc();
37
+
38
+ require_once WD_FMC_DIR . "/admin/views/FMViewSubmissions_fmc.php";
39
+ $view = new FMViewSubmissions_fmc($model);
40
+ $view->display($form_id);
41
+ }
42
+
43
+ public function show_stats() {
44
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
45
+ require_once WD_FMC_DIR . "/admin/models/FMModelSubmissions_fmc.php";
46
+ $model = new FMModelSubmissions_fmc();
47
+
48
+ require_once WD_FMC_DIR . "/admin/views/FMViewSubmissions_fmc.php";
49
+ $view = new FMViewSubmissions_fmc($model);
50
+ $view->show_stats($form_id);
51
+ }
52
+
53
+ public function edit() {
54
+ global $wpdb;
55
+ $new_form = false;
56
+ require_once WD_FMC_DIR . "/admin/models/FMModelSubmissions_fmc.php";
57
+ $model = new FMModelSubmissions_fmc();
58
+
59
+ require_once WD_FMC_DIR . "/admin/views/FMViewSubmissions_fmc.php";
60
+ $view = new FMViewSubmissions_fmc($model);
61
+ $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
62
+
63
+ $form_id = $wpdb->get_var("SELECT form_id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "'");
64
+ $theme_id = $wpdb->get_var("SELECT theme FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'");
65
+ $css = $wpdb->get_var("SELECT css FROM " . $wpdb->prefix . "formmaker_themes WHERE id='" . $theme_id . "'");
66
+
67
+ if (strpos($css,'.wdform_section') > -1) {
68
+ $new_form = true;
69
+ }
70
+ if ($new_form == false) {
71
+ $view->edit($id);
72
+ }
73
+ else {
74
+ $view->new_edit($id);
75
+ }
76
+ }
77
+
78
+ public function save() {
79
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
80
+ $this->save_db();
81
+ $this->display($form_id);
82
+ }
83
+
84
+ public function apply() {
85
+ $this->save_db();
86
+ $this->edit();
87
+ }
88
+
89
+ public function save_db() {
90
+ global $wpdb;
91
+ $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes( $_POST['current_id'])) : 0);
92
+ $group_id = $id;
93
+ $date = esc_html($_POST['date']);
94
+ $ip = esc_html($_POST['ip']);
95
+ $form_id = $wpdb->get_var("SELECT form_id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "'");
96
+ $form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'");
97
+ $label_id = array();
98
+ $label_order_original = array();
99
+ $label_type = array();
100
+ $old = false;
101
+ $form_currency = '$';
102
+
103
+ if (strpos($form->label_order, 'type_paypal_')) {
104
+ $form->label_order = $form->label_order."0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
105
+ }
106
+ $label_all = explode('#****#', $form->label_order);
107
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
108
+ foreach ($label_all as $key => $label_each) {
109
+ $label_id_each = explode('#**id**#', $label_each);
110
+ array_push($label_id, $label_id_each[0]);
111
+ $label_oder_each = explode('#**label**#', $label_id_each[1]);
112
+ array_push($label_order_original, $label_oder_each[0]);
113
+ array_push($label_type, $label_oder_each[1]);
114
+ }
115
+
116
+ if(isset($form->form))
117
+ $old = true;
118
+
119
+ if($old == false || ($old == true && $form->form=='')) {
120
+
121
+ foreach($label_type as $key => $type) {
122
+
123
+ $value='';
124
+ if($type=="type_submit_reset" or $type=="type_map" or $type=="type_editor" or $type=="type_captcha" or $type=="type_recaptcha" or $type=="type_button" or $type=="type_paypal_total")
125
+ continue;
126
+
127
+ $i=$label_id[$key];
128
+ $id = 'form_id_temp';
129
+ switch ($type) {
130
+
131
+ case 'type_text':
132
+ case 'type_password':
133
+ case 'type_textarea':
134
+ case "type_submitter_mail":
135
+ case "type_date":
136
+ case "type_own_select":
137
+ case "type_country":
138
+ case "type_number": {
139
+ $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
140
+ break;
141
+ }
142
+ case "type_wdeditor": {
143
+ $value = (isset($_POST['wdform_'.$i.'_wd_editor'.$id]) ? $_POST['wdform_'.$i.'_wd_editor'.$id] : NULL);
144
+ break;
145
+ }
146
+ case "type_mark_map": {
147
+ $long = (isset($_POST['wdform_'.$i."_long".$id]) ? $_POST['wdform_'.$i."_long".$id] : NULL);
148
+ $lat = (isset($_POST['wdform_'.$i."_lat".$id]) ? $_POST['wdform_'.$i."_lat".$id] : NULL);
149
+ if($long and $lat)
150
+ $value = $long . '***map***' . $lat;
151
+
152
+ break;
153
+ }
154
+
155
+ case "type_date_fields": {
156
+ $day = (isset($_POST['wdform_'.$i."_day".$id]) ? $_POST['wdform_'.$i."_day".$id] : NULL);
157
+ $month = (isset($_POST['wdform_'.$i."_month".$id]) ? $_POST['wdform_'.$i."_month".$id] : NULL);
158
+ $year = (isset($_POST['wdform_'.$i."_year".$id]) ? $_POST['wdform_'.$i."_year".$id] : NULL);
159
+ if($day or $month or $year)
160
+ $value = $day . '-' . $month . '-' . $year;
161
+ break;
162
+ }
163
+
164
+ case "type_time": {
165
+ $ss = (isset($_POST['wdform_'.$i."_ss".$id]) ? $_POST['wdform_'.$i."_ss".$id] : NULL);
166
+ $hh = (isset($_POST['wdform_'.$i."_hh".$id]) ? $_POST['wdform_'.$i."_hh".$id] : NULL);
167
+ $mm = (isset($_POST['wdform_'.$i."_mm".$id]) ? $_POST['wdform_'.$i."_mm".$id] : NULL);
168
+
169
+ if(isset($ss))
170
+ $value = $hh .':'. $mm .':' . $ss;
171
+ else
172
+ $value = $hh .':' . $mm;
173
+
174
+ $am_pm = (isset($_POST['wdform_'.$i."_am_pm".$id]) ? $_POST['wdform_'.$i."_am_pm".$id] : NULL);
175
+ if(isset($am_pm))
176
+ $value = $value . ' ' . $am_pm;
177
+
178
+ break;
179
+ }
180
+
181
+ case "type_phone": {
182
+ $first = (isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : NULL);
183
+ $last = (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : NULL);
184
+ if($first or $last)
185
+ $value = $first . ' ' . $last;
186
+
187
+ break;
188
+ }
189
+
190
+ case "type_name": {
191
+
192
+ $element_title = (isset($_POST['wdform_'.$i."_element_title".$id]) ? $_POST['wdform_'.$i."_element_title".$id] : NULL);
193
+ $element_first = (isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : NULL);
194
+ $element_last = (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : NULL);
195
+ $element_middle = (isset($_POST['wdform_'.$i."_element_middle".$id]) ? $_POST['wdform_'.$i."_element_middle".$id] : NULL);
196
+
197
+ if(isset($element_title))
198
+ $value = $element_title . '@@@' . $element_first . '@@@' . $element_last . '@@@' . $element_middle;
199
+ else
200
+ $value = $element_first . '@@@' . $element_last;
201
+
202
+ break;
203
+ }
204
+
205
+ case "type_file_upload": {
206
+ break;
207
+ }
208
+
209
+ case 'type_address': {
210
+ $value='*#*#*#';
211
+ $element = (isset($_POST['wdform_'.$i."_street1".$id]) ? $_POST['wdform_'.$i."_street1".$id] : NULL);
212
+ if($element) {
213
+ $value = $element;
214
+ break;
215
+ }
216
+
217
+ $element = (isset($_POST['wdform_'.$i."_street2".$id]) ? $_POST['wdform_'.$i."_street2".$id] : NULL);
218
+ if($element) {
219
+ $value = $element;
220
+ break;
221
+ }
222
+
223
+ $element = (isset($_POST['wdform_'.$i."_city".$id]) ? $_POST['wdform_'.$i."_city".$id] : NULL);
224
+ if(isset($element)) {
225
+ $value = $element;
226
+ break;
227
+ }
228
+
229
+ $element = (isset($_POST['wdform_'.$i."_state".$id]) ? $_POST['wdform_'.$i."_state".$id] : NULL);
230
+ if(isset($element)) {
231
+ $value = $element;
232
+ break;
233
+ }
234
+
235
+ $element = (isset($_POST['wdform_'.$i."_postal".$id]) ? $_POST['wdform_'.$i."_postal".$id] : NULL);
236
+ if(isset($element)) {
237
+ $value = $element;
238
+ break;
239
+ }
240
+
241
+ $element = (isset($_POST['wdform_'.$i."_country".$id]) ? $_POST['wdform_'.$i."_country".$id] : NULL);
242
+ if(isset($element)) {
243
+ $value = $element;
244
+ break;
245
+ }
246
+
247
+ break;
248
+ }
249
+
250
+ case "type_hidden": {
251
+ $value = (isset($_POST[$label_order_original[$key]]) ? $_POST[$label_order_original[$key]] : NULL);
252
+ break;
253
+ }
254
+
255
+ case "type_radio": {
256
+ $element = (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL);
257
+ if(isset($element)) {
258
+ $value = $element;
259
+ break;
260
+ }
261
+
262
+ $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
263
+ break;
264
+ }
265
+
266
+ case "type_checkbox": {
267
+ $start=-1;
268
+ $value='';
269
+ for($j=0; $j<100; $j++) {
270
+
271
+ $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
272
+
273
+ if(isset($element)) {
274
+ $start = $j;
275
+ break;
276
+ }
277
+ }
278
+
279
+ $other_element_id=-1;
280
+ $is_other = (isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : NULL);
281
+ if($is_other == "yes") {
282
+ $other_element_id = (isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : NULL);
283
+ }
284
+
285
+ if($start!=-1) {
286
+ for($j=$start; $j<100; $j++) {
287
+ $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
288
+ if(isset($element))
289
+ if($j == $other_element_id) {
290
+ $value = $value . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL) . '***br***';
291
+ }
292
+ else
293
+ $value = $value . (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL) . '***br***';
294
+ }
295
+ }
296
+
297
+ break;
298
+ }
299
+
300
+ case "type_paypal_price": {
301
+ $value=0;
302
+ if((isset($_POST['wdform_'.$i."_element_dollars".$id]) ? $_POST['wdform_'.$i."_element_dollars".$id] : NULL))
303
+ $value = (isset($_POST['wdform_'.$i."_element_dollars".$id]) ? $_POST['wdform_'.$i."_element_dollars".$id] : NULL);
304
+
305
+ $value = (int) preg_replace('/\D/', '', $value);
306
+
307
+ if((isset($_POST['wdform_'.$i."_element_cents".$id]) ? $_POST['wdform_'.$i."_element_cents".$id] : NULL))
308
+ $value = $value . '.' . ( preg_replace('/\D/', '', (isset($_POST['wdform_'.$i."_element_cents".$id]) ? $_POST['wdform_'.$i."_element_cents".$id] : NULL)));
309
+
310
+
311
+ $value = $value;
312
+ break;
313
+ }
314
+
315
+ case "type_paypal_select": {
316
+
317
+ if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
318
+ $value = (isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL) . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL) . $form_currency;
319
+ else
320
+ $value = '';
321
+
322
+ $element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
323
+ if(isset($element_quantity) && $value!='')
324
+ $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : NULL) . ': ' . (isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL);
325
+
326
+
327
+ for($k=0; $k<50; $k++) {
328
+ $temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
329
+ if(isset($temp_val) && $value!='') {
330
+ $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_property_label".$id]) ? $_POST['wdform_'.$i."_element_property_label".$id] : NULL) . ': ' . (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL) . '***property***';
331
+ }
332
+ }
333
+
334
+ break;
335
+ }
336
+
337
+ case "type_paypal_radio": {
338
+
339
+ if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
340
+ $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL) . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL) . $form_currency;
341
+ else
342
+ $value='';
343
+
344
+
345
+ $element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
346
+ if(isset($element_quantity) && $value!='')
347
+ $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : NULL) . ': ' . (isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL) . '***quantity***';
348
+
349
+
350
+ for($k=0; $k<50; $k++) {
351
+ $temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
352
+ if(isset($temp_val) && $value!='') {
353
+
354
+ $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_property_label".$id]) ? $_POST['wdform_'.$i."_element_property_label".$id] : NULL) . ': ' . (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL) . '***property***';
355
+ }
356
+ }
357
+
358
+ break;
359
+ }
360
+
361
+ case "type_paypal_shipping": {
362
+
363
+ if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
364
+ $value = (isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL) . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL) . $form_currency;
365
+ else
366
+ $value='';
367
+ $value = (isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL) . ' - ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
368
+
369
+ $paypal['shipping'] = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
370
+
371
+ break;
372
+ }
373
+
374
+ case "type_paypal_checkbox": {
375
+ $start=-1;
376
+ $value='';
377
+ for($j=0; $j<100; $j++) {
378
+
379
+ $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
380
+
381
+ if(isset($element)) {
382
+ $start=$j;
383
+ break;
384
+ }
385
+ }
386
+
387
+ $other_element_id = -1;
388
+ $is_other = (isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : NULL);
389
+ if($is_other=="yes") {
390
+ $other_element_id = (isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : NULL);
391
+ }
392
+
393
+ if($start!=-1) {
394
+ for($j=$start; $j<100; $j++) {
395
+ $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
396
+ if(isset($element))
397
+ if($j==$other_element_id) {
398
+ $value = $value . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL) . '***br***';
399
+
400
+ }
401
+ else {
402
+
403
+ $value = $value . (isset($_POST['wdform_'.$i."_element".$id.$j."_label"]) ? $_POST['wdform_'.$i."_element".$id.$j."_label"] : NULL) . ' - ' . ((isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL) == '' ? '0' : (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL)) . $form_currency . '***br***';
404
+
405
+ }
406
+ }
407
+
408
+ $element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
409
+ if(isset($element_quantity))
410
+ $value .= (isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : NULL) . ': '. (isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL) . '***quantity***';
411
+
412
+ for($k=0; $k<50; $k++) {
413
+ $temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
414
+ if(isset($temp_val)) {
415
+
416
+ $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_property_label".$id]) ? $_POST['wdform_'.$i."_element_property_label".$id] : NULL) . ': ' . (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL) . '***property***';
417
+ }
418
+ }
419
+
420
+ }
421
+
422
+
423
+ break;
424
+ }
425
+
426
+ case "type_star_rating": {
427
+
428
+ if((isset($_POST['wdform_'.$i."_selected_star_amount".$id]) ? $_POST['wdform_'.$i."_selected_star_amount".$id] : NULL) == "")
429
+ $selected_star_amount = 0;
430
+ else {
431
+ $selected_star_amount = (isset($_POST['wdform_'.$i."_selected_star_amount".$id]) ? $_POST['wdform_'.$i."_selected_star_amount".$id] : NULL);
432
+ }
433
+ $value = $selected_star_amount . '/' . (isset($_POST['wdform_'.$i."_star_amount".$id]) ? $_POST['wdform_'.$i."_star_amount".$id] : NULL);
434
+ break;
435
+ }
436
+
437
+ case "type_scale_rating": {
438
+
439
+ $value = (isset($_POST['wdform_'.$i."_scale_radio".$id]) ? $_POST['wdform_'.$i."_scale_radio".$id] : 0) . '/' . (isset($_POST['wdform_'.$i."_scale_amount".$id]) ? $_POST['wdform_'.$i."_scale_amount".$id] : NULL);
440
+ break;
441
+ }
442
+
443
+ case "type_spinner": {
444
+ $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
445
+
446
+ break;
447
+ }
448
+
449
+ case "type_slider": {
450
+ $value = (isset($_POST['wdform_'.$i."_slider_value".$id]) ? $_POST['wdform_'.$i."_slider_value".$id] : NULL);
451
+
452
+ break;
453
+ }
454
+ case "type_range": {
455
+ $value = (isset($_POST['wdform_'.$i."_element".$id.'0']) ? $_POST['wdform_'.$i."_element".$id.'0'] : NULL) . '-' . (isset($_POST['wdform_'.$i."_element".$id.'1']) ? $_POST['wdform_'.$i."_element".$id.'1'] : NULL);
456
+
457
+ break;
458
+ }
459
+ case "type_grading": {
460
+ $value ="";
461
+ $items = explode(":",(isset($_POST['wdform_'.$i."_hidden_item".$id]) ? $_POST['wdform_'.$i."_hidden_item".$id] : NULL));
462
+ for($k=0; $k<sizeof($items)-1; $k++)
463
+ $value .= (isset($_POST['wdform_'.$i."_element".$id.'_'.$k]) ? $_POST['wdform_'.$i."_element".$id.'_'.$k] : NULL) . ':';
464
+
465
+ $value .= (isset($_POST['wdform_'.$i."_hidden_item".$id]) ? $_POST['wdform_'.$i."_hidden_item".$id] : NULL) . '***grading***';
466
+
467
+ break;
468
+ }
469
+
470
+ case "type_matrix": {
471
+
472
+ $rows_of_matrix = explode("***",(isset($_POST['wdform_'.$i."_hidden_row".$id]) ? $_POST['wdform_'.$i."_hidden_row".$id] : NULL));
473
+ $rows_count = sizeof($rows_of_matrix)-1;
474
+ $column_of_matrix = explode("***",(isset($_POST['wdform_'.$i."_hidden_column".$id]) ? $_POST['wdform_'.$i."_hidden_column".$id] : NULL));
475
+ $columns_count = sizeof($column_of_matrix)-1;
476
+
477
+
478
+ if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "radio") {
479
+ $input_value="";
480
+
481
+ for($k=1; $k<=$rows_count; $k++)
482
+ $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k]) ? $_POST['wdform_'.$i."_input_element".$id.$k] : 0) ."***";
483
+
484
+ }
485
+ if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "checkbox") {
486
+ $input_value="";
487
+
488
+ for($k=1; $k<=$rows_count; $k++)
489
+ for($j=1; $j<=$columns_count; $j++)
490
+ $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j] : 0) . "***";
491
+ }
492
+
493
+ if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "text") {
494
+ $input_value="";
495
+ for($k=1; $k<=$rows_count; $k++)
496
+ for($j=1; $j<=$columns_count; $j++)
497
+ $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j] : NULL) . "***";
498
+ }
499
+
500
+ if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "select") {
501
+ $input_value="";
502
+ for($k=1; $k<=$rows_count; $k++)
503
+ for($j=1; $j<=$columns_count; $j++)
504
+ $input_value .= (isset($_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j] : NULL) . "***";
505
+ }
506
+
507
+ $value = $rows_count . (isset($_POST['wdform_'.$i."_hidden_row".$id]) ? $_POST['wdform_'.$i."_hidden_row".$id] : NULL) . '***' . $columns_count . (isset($_POST['wdform_'.$i."_hidden_column".$id]) ? $_POST['wdform_'.$i."_hidden_column".$id] : NULL) . '***' . (isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) . '***' . $input_value . '***matrix***';
508
+
509
+ break;
510
+ }
511
+
512
+ }
513
+
514
+ if($type == "type_address")
515
+ if($value == '*#*#*#')
516
+ continue;
517
+
518
+
519
+ if($value) {
520
+ $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $group_id . "' AND element_label='" . $i . "'";
521
+ $result = $wpdb->get_var($query);
522
+
523
+ if($result) {
524
+ $save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
525
+ 'element_value' => stripslashes($value),
526
+ ), array(
527
+ 'group_id' => $group_id,
528
+ 'element_label' => $i
529
+ ), array(
530
+ '%s',
531
+ ), array(
532
+ '%d',
533
+ '%s'
534
+ ));
535
+ }
536
+ else {
537
+
538
+ $save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
539
+ 'form_id' => $form_id,
540
+ 'element_label' => $i,
541
+ 'element_value' => stripslashes($value),
542
+ 'group_id' => $group_id,
543
+ 'date' => $date,
544
+ 'ip' => $ip
545
+ ), array(
546
+ '%d',
547
+ '%s',
548
+ '%s',
549
+ '%d',
550
+ '%s',
551
+ '%s'
552
+ )
553
+ );
554
+
555
+
556
+ }
557
+ }
558
+
559
+
560
+
561
+ }
562
+ }
563
+
564
+ else {
565
+
566
+ foreach ($label_id as $key => $label_id_1) {
567
+ $element_value = (isset($_POST["submission_" . $label_id_1]) ? esc_html(stripslashes($_POST["submission_" . $label_id_1])) : " ");
568
+ if (isset($_POST["submission_" . $label_id_1])) {
569
+ $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
570
+ $result = $wpdb->get_var($query);
571
+ if ($label_type[$key] == 'type_file_upload')
572
+ if ($element_value)
573
+ $element_value = $element_value . "*@@url@@*";
574
+ if ($result) {
575
+ $save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
576
+ 'element_value' => stripslashes($element_value),
577
+ ), array(
578
+ 'group_id' => $id,
579
+ 'element_label' => $label_id_1
580
+ ), array(
581
+ '%s',
582
+ ), array(
583
+ '%d',
584
+ '%s'
585
+ ));
586
+ }
587
+ else {
588
+ $save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
589
+ 'form_id' => $form_id,
590
+ 'element_label' => $label_id_1,
591
+ 'element_value' => stripslashes($element_value),
592
+ 'group_id' => $id,
593
+ 'date' => $date,
594
+ 'ip' => $ip
595
+ ), array(
596
+ '%d',
597
+ '%s',
598
+ '%s',
599
+ '%d',
600
+ '%s',
601
+ '%s'
602
+ )
603
+ );
604
+ }
605
+ }
606
+ else {
607
+ $element_value_ch = (isset($_POST["submission_" . $label_id_1 . '_0']) ? esc_html(stripslashes($_POST["submission_" . $label_id_1 . '_0'])) : " ");
608
+ if (isset($_POST["submission_" . $label_id_1 . '_0'])) {
609
+ for ($z = 0; $z < 21; $z++) {
610
+ $element_value_ch = $_POST["submission_" . $label_id_1 . '_' . $z];
611
+ if (isset($element_value_ch))
612
+ $element_value = $element_value . $element_value_ch . '***br***';
613
+ else
614
+ break;
615
+ }
616
+ $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
617
+ $result = $wpdb->get_var($query);
618
+ if ($result) {
619
+ $query = "UPDATE " . $wpdb->prefix . "formmaker_submits SET `element_value`='" . stripslashes($element_value) . "' WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
620
+ $save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
621
+ 'element_value' => stripslashes($element_value),
622
+ ), array(
623
+ 'group_id' => $id,
624
+ 'element_label' => $label_id_1
625
+ ), array(
626
+ '%s',
627
+ ), array(
628
+ '%d',
629
+ '%s'
630
+ ));
631
+ }
632
+ else {
633
+ $query = "INSERT INTO " . $wpdb->prefix . "formmaker_submits (form_id, element_label, element_value, group_id, date, ip) VALUES('" . $form_id . "', '" . $label_id_1 . "', '" . stripslashes($element_value) . "','" . $id . "', '" . $date . "', '" . $ip . "')";
634
+ $save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
635
+ 'form_id' => $form_id,
636
+ 'element_label' => $label_id_1,
637
+ 'element_value' => stripslashes($element_value),
638
+ 'group_id' => $id,
639
+ 'date' => $date,
640
+ 'ip' => $ip
641
+ ), array(
642
+ '%d',
643
+ '%s',
644
+ '%s',
645
+ '%d',
646
+ '%s',
647
+ '%s'
648
+ )
649
+ );
650
+ }
651
+ }
652
+ }
653
+ }
654
+ }
655
+ if ($save !== FALSE) {
656
+ echo WDW_FMC_Library::message('Submission Succesfully Saved.', 'updated');
657
+ }
658
+ else {
659
+ echo WDW_FMC_Library::message('Error. Please install plugin again.', 'error');
660
+ }
661
+ }
662
+
663
+ public function delete($id) {
664
+ global $wpdb;
665
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
666
+ $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id="%d"', $id);
667
+ if ($wpdb->query($query)) {
668
+ echo WDW_FMC_Library::message('Item Succesfully Deleted.', 'updated');
669
+ }
670
+ else {
671
+ echo WDW_FMC_Library::message('Error. Please install plugin again.', 'error');
672
+ }
673
+ $this->display($form_id);
674
+ }
675
+
676
+ public function delete_all() {
677
+ global $wpdb;
678
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
679
+ $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
680
+ if (count($cid)) {
681
+ $cids = implode(',', $cid);
682
+ $query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )';
683
+ if ($wpdb->query($query)) {
684
+ echo WDW_FMC_Library::message('Items Succesfully Deleted.', 'updated');
685
+ }
686
+ else {
687
+ echo WDW_FMC_Library::message('Error. Please install plugin again.', 'error');
688
+ }
689
+ }
690
+ else {
691
+ echo WDW_FMC_Library::message('You must select at least one item.', 'error');
692
+ }
693
+ $this->display($form_id);
694
+ }
695
+
696
+ public function block_ip() {
697
+ global $wpdb;
698
+ $flag = FALSE;
699
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
700
+ $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
701
+ if (count($cid)) {
702
+ $cids = implode(',', $cid);
703
+ $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( '. $cids .' )';
704
+ $rows = $wpdb->get_results($query);
705
+ foreach ($rows as $row) {
706
+ $ips = $wpdb->get_var($wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $row->ip));
707
+ $flag = TRUE;
708
+ if (!$ips) {
709
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker_blocked', array(
710
+ 'ip' => $row->ip,
711
+ ), array(
712
+ '%s',
713
+ ));
714
+ }
715
+ }
716
+ }
717
+ if ($flag) {
718
+ echo WDW_FMC_Library::message('IPs Succesfully Blocked.', 'updated');
719
+ }
720
+ else {
721
+ echo WDW_FMC_Library::message('You must select at least one item.', 'error');
722
+ }
723
+ $this->display($form_id);
724
+ }
725
+
726
+ public function unblock_ip() {
727
+ global $wpdb;
728
+ $flag = FALSE;
729
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
730
+ $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
731
+ if (count($cid)) {
732
+ $cids = implode(',', $cid);
733
+ $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( '. $cids .' )';
734
+ $rows = $wpdb->get_results($query);
735
+ foreach ($rows as $row) {
736
+ $flag = TRUE;
737
+ $ips = $wpdb->get_var($wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $row->ip));
738
+ if ($ips) {
739
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $ips));
740
+ }
741
+ }
742
+ }
743
+ if ($flag) {
744
+ echo WDW_FMC_Library::message('IPs Succesfully Unblocked.', 'updated');
745
+ }
746
+ else {
747
+ echo WDW_FMC_Library::message('You must select at least one item.', 'error');
748
+ }
749
+ $this->display($form_id);
750
+ }
751
+
752
+ ////////////////////////////////////////////////////////////////////////////////////////
753
+ // Getters & Setters //
754
+ ////////////////////////////////////////////////////////////////////////////////////////
755
+ ////////////////////////////////////////////////////////////////////////////////////////
756
+ // Private Methods //
757
+ ////////////////////////////////////////////////////////////////////////////////////////
758
+ ////////////////////////////////////////////////////////////////////////////////////////
759
+ // Listeners //
760
+ ////////////////////////////////////////////////////////////////////////////////////////
761
+ }
admin/controllers/FMControllerThemes_fmc.php ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerThemes_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = WDW_FMC_Library::get('task');
23
+ $id = WDW_FMC_Library::get('current_id', 0);
24
+ $message = WDW_FMC_Library::get('message');
25
+ echo WDW_FMC_Library::message_id($message);
26
+ // $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
27
+ // $id = ((isset($_POST['current_id'])) ? esc_html($_POST['current_id']) : 0);
28
+ if (method_exists($this, $task)) {
29
+ $this->$task($id);
30
+ }
31
+ else {
32
+ $this->display();
33
+ }
34
+ }
35
+
36
+ public function display() {
37
+ require_once WD_FMC_DIR . "/admin/models/FMModelThemes_fmc.php";
38
+ $model = new FMModelThemes_fmc();
39
+
40
+ require_once WD_FMC_DIR . "/admin/views/FMViewThemes_fmc.php";
41
+ $view = new FMViewThemes_fmc($model);
42
+ $view->display();
43
+ }
44
+
45
+ public function add() {
46
+ require_once WD_FMC_DIR . "/admin/models/FMModelThemes_fmc.php";
47
+ $model = new FMModelThemes_fmc();
48
+
49
+ require_once WD_FMC_DIR . "/admin/views/FMViewThemes_fmc.php";
50
+ $view = new FMViewThemes_fmc($model);
51
+ $view->edit(0, FALSE);
52
+ }
53
+
54
+ public function edit() {
55
+ require_once WD_FMC_DIR . "/admin/models/FMModelThemes_fmc.php";
56
+ $model = new FMModelThemes_fmc();
57
+
58
+ require_once WD_FMC_DIR . "/admin/views/FMViewThemes_fmc.php";
59
+ $view = new FMViewThemes_fmc($model);
60
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
61
+ $id = WDW_FMC_Library::get('current_id', 0);
62
+ $view->edit($id, FALSE);
63
+ }
64
+
65
+ public function save() {
66
+ $message = $this->save_db();
67
+ // $this->display();
68
+ $page = WDW_FMC_Library::get('page');
69
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
70
+ }
71
+
72
+ public function apply() {
73
+ $message = $this->save_db();
74
+ global $wpdb;
75
+ // if (!isset($_POST['current_id']) || (esc_html($_POST['current_id']) == 0) || (esc_html($_POST['current_id']) == '')) {
76
+
77
+ // }
78
+ $id = (int) $wpdb->get_var('SELECT MAX(`id`) FROM ' . $wpdb->prefix . 'formmaker_themes');
79
+ $current_id = WDW_FMC_Library::get('current_id', $id);
80
+ $page = WDW_FMC_Library::get('page');
81
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
82
+ // $this->edit();
83
+ }
84
+
85
+ public function save_db() {
86
+ global $wpdb;
87
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes( $_POST['current_id'])) : 0);
88
+ $id = (int) WDW_FMC_Library::get('current_id', 0);
89
+ $title = (isset($_POST['title']) ? esc_html(stripslashes( $_POST['title'])) : '');
90
+ $css = (isset($_POST['css']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['css'])) : '');
91
+ $default = (isset($_POST['default']) ? esc_html(stripslashes( $_POST['default'])) : 0);
92
+ if ($id != 0) {
93
+ $save = $wpdb->update($wpdb->prefix . 'formmaker_themes', array(
94
+ 'title' => $title,
95
+ 'css' => $css,
96
+ 'default' => $default,
97
+ ), array('id' => $id));
98
+ }
99
+ else {
100
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker_themes', array(
101
+ 'title' => $title,
102
+ 'css' => $css,
103
+ 'default' => $default,
104
+ ), array(
105
+ '%s',
106
+ '%s',
107
+ '%d',
108
+ ));
109
+ }
110
+ if ($save !== FALSE) {
111
+ return 1;
112
+ }
113
+ else {
114
+ return 2;
115
+ }
116
+ }
117
+
118
+ public function delete($id) {
119
+ global $wpdb;
120
+ $isDefault = $wpdb->get_var($wpdb->prepare('SELECT default FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
121
+ if ($isDefault) {
122
+ $message = 4;
123
+ }
124
+ else {
125
+ $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id);
126
+ if ($wpdb->query($query)) {
127
+ $message = 3;
128
+ }
129
+ else {
130
+ $message = 2;
131
+ }
132
+ }
133
+ // $this->display();
134
+ $page = WDW_FMC_Library::get('page');
135
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
136
+ }
137
+
138
+ public function delete_all() {
139
+ global $wpdb;
140
+ $flag = FALSE;
141
+ $isDefault = FALSE;
142
+ $theme_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_themes');
143
+ foreach ($theme_ids_col as $theme_id) {
144
+ if (isset($_POST['check_' . $theme_id])) {
145
+ $isDefault = $wpdb->get_var($wpdb->prepare('SELECT default FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $theme_id));
146
+ if ($isDefault) {
147
+ $message = 4;
148
+ }
149
+ else {
150
+ $flag = TRUE;
151
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $theme_id));
152
+ }
153
+ }
154
+ }
155
+ if ($flag) {
156
+ $message = 5;
157
+ }
158
+ else {
159
+ $message = 6;
160
+ }
161
+ // $this->display();
162
+ $page = WDW_FMC_Library::get('page');
163
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
164
+ }
165
+
166
+ public function setdefault($id) {
167
+ global $wpdb;
168
+ $wpdb->update($wpdb->prefix . 'formmaker_themes', array('default' => 0), array('default' => 1));
169
+ $save = $wpdb->update($wpdb->prefix . 'formmaker_themes', array('default' => 1), array('id' => $id));
170
+ if ($save !== FALSE) {
171
+ $message = 7;
172
+ }
173
+ else {
174
+ $message = 2;
175
+ }
176
+ // $this->display();
177
+ $page = WDW_FMC_Library::get('page');
178
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
179
+ }
180
+
181
+ ////////////////////////////////////////////////////////////////////////////////////////
182
+ // Getters & Setters //
183
+ ////////////////////////////////////////////////////////////////////////////////////////
184
+ ////////////////////////////////////////////////////////////////////////////////////////
185
+ // Private Methods //
186
+ ////////////////////////////////////////////////////////////////////////////////////////
187
+ ////////////////////////////////////////////////////////////////////////////////////////
188
+ // Listeners //
189
+ ////////////////////////////////////////////////////////////////////////////////////////
190
+ }
admin/controllers/FMControllerUninstall_fmc.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerUninstall_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
23
+ if (method_exists($this, $task)) {
24
+ $this->$task();
25
+ }
26
+ else {
27
+ $this->display();
28
+ }
29
+ }
30
+
31
+ public function display() {
32
+ require_once WD_FMC_DIR . "/admin/models/FMModelUninstall_fmc.php";
33
+ $model = new FMModelUninstall_fmc();
34
+
35
+ require_once WD_FMC_DIR . "/admin/views/FMViewUninstall_fmc.php";
36
+ $view = new FMViewUninstall_fmc($model);
37
+ $view->display();
38
+ }
39
+
40
+ public function uninstall() {
41
+ require_once WD_FMC_DIR . "/admin/models/FMModelUninstall_fmc.php";
42
+ $model = new FMModelUninstall_fmc();
43
+
44
+ require_once WD_FMC_DIR . "/admin/views/FMViewUninstall_fmc.php";
45
+ $view = new FMViewUninstall_fmc($model);
46
+ $view->uninstall();
47
+ }
48
+ ////////////////////////////////////////////////////////////////////////////////////////
49
+ // Getters & Setters //
50
+ ////////////////////////////////////////////////////////////////////////////////////////
51
+ ////////////////////////////////////////////////////////////////////////////////////////
52
+ // Private Methods //
53
+ ////////////////////////////////////////////////////////////////////////////////////////
54
+ ////////////////////////////////////////////////////////////////////////////////////////
55
+ // Listeners //
56
+ ////////////////////////////////////////////////////////////////////////////////////////
57
+ }
admin/controllers/FMControllerWidget_fmc.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerWidget_fmc extends WP_Widget {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $view;
14
+ private $model;
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ // Constructor & Destructor //
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct() {
19
+ $widget_ops = array(
20
+ 'classname' => 'form_maker_widget',
21
+ 'description' => 'Add Contact Form Maker widget.'
22
+ );
23
+ // Widget Control Settings.
24
+ $control_ops = array('id_base' => 'form_maker_widget');
25
+ // Create the widget.
26
+ $this->WP_Widget('form_maker_widget', 'Contact Form Maker', $widget_ops, $control_ops);
27
+ require_once WD_FMC_DIR . "/admin/models/FMModelWidget_fmc.php";
28
+ $this->model = new FMModelWidget_fmc();
29
+
30
+ require_once WD_FMC_DIR . "/admin/views/FMViewWidget_fmc.php";
31
+ $this->view = new FMViewWidget_fmc($this->model);
32
+ }
33
+ ////////////////////////////////////////////////////////////////////////////////////////
34
+ // Public Methods //
35
+ ////////////////////////////////////////////////////////////////////////////////////////
36
+
37
+ public function widget($args, $instance) {
38
+ $this->view->widget($args, $instance);
39
+ }
40
+
41
+ public function form( $instance ) {
42
+ $this->view->form($instance, parent::get_field_id('title'), parent::get_field_name('title'), parent::get_field_id('form_id'), parent::get_field_name('form_id'));
43
+ }
44
+
45
+ // Update Settings.
46
+ public function update($new_instance, $old_instance) {
47
+ $instance['title'] = $new_instance['title'];
48
+ $instance['form_id'] = $new_instance['form_id'];
49
+ return $instance;
50
+ }
51
+
52
+ ////////////////////////////////////////////////////////////////////////////////////////
53
+ // Getters & Setters //
54
+ ////////////////////////////////////////////////////////////////////////////////////////
55
+ ////////////////////////////////////////////////////////////////////////////////////////
56
+ // Private Methods //
57
+ ////////////////////////////////////////////////////////////////////////////////////////
58
+ ////////////////////////////////////////////////////////////////////////////////////////
59
+ // Listeners //
60
+ ////////////////////////////////////////////////////////////////////////////////////////
61
+ }
admin/models/FMModelBlocked_ips_fmc.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelBlocked_ips_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function get_rows_data() {
22
+ global $wpdb;
23
+ $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE `ip` LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
24
+ $asc_or_desc = ((isset($_POST['asc_or_desc'])) ? esc_html($_POST['asc_or_desc']) : 'desc');
25
+ $order_by = ' ORDER BY ' . ((isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') ? esc_html($_POST['order_by']) : 'id') . ' ' . $asc_or_desc;
26
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
27
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
28
+ }
29
+ else {
30
+ $limit = 0;
31
+ }
32
+ $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_blocked " . $where . $order_by . " LIMIT " . $limit . ",20";
33
+ $rows = $wpdb->get_results($query);
34
+ return $rows;
35
+ }
36
+
37
+ public function get_row_data($id) {
38
+ global $wpdb;
39
+ if ($id != 0) {
40
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $id));
41
+ }
42
+ else {
43
+ $row->id = 0;
44
+ $row->ip = '';
45
+ }
46
+ return $row;
47
+ }
48
+
49
+ public function page_nav() {
50
+ global $wpdb;
51
+ $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE `ip` LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
52
+ $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_blocked " . $where;
53
+ $total = $wpdb->get_var($query);
54
+ $page_nav['total'] = $total;
55
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
56
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
57
+ }
58
+ else {
59
+ $limit = 0;
60
+ }
61
+ $page_nav['limit'] = (int) ($limit / 20 + 1);
62
+ return $page_nav;
63
+ }
64
+ ////////////////////////////////////////////////////////////////////////////////////////
65
+ // Getters & Setters //
66
+ ////////////////////////////////////////////////////////////////////////////////////////
67
+ ////////////////////////////////////////////////////////////////////////////////////////
68
+ // Private Methods //
69
+ ////////////////////////////////////////////////////////////////////////////////////////
70
+ ////////////////////////////////////////////////////////////////////////////////////////
71
+ // Listeners //
72
+ ////////////////////////////////////////////////////////////////////////////////////////
73
+ }
admin/models/FMModelFeatured_plugins_fmc.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelFeatured_plugins_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ ////////////////////////////////////////////////////////////////////////////////////////
22
+ // Getters & Setters //
23
+ ////////////////////////////////////////////////////////////////////////////////////////
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ // Private Methods //
26
+ ////////////////////////////////////////////////////////////////////////////////////////
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ // Listeners //
29
+ ////////////////////////////////////////////////////////////////////////////////////////
30
+ }
admin/models/FMModelFormMakerEditCSS_fmc.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelFormMakerEditCSS_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ public function get_theme_row($id) {
23
+ global $wpdb;
24
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
25
+ return $row;
26
+ }
27
+
28
+ /*public function get_form($form_id) {
29
+ global $wpdb;
30
+ $form = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
31
+ return $form;
32
+ }*/
33
+ ////////////////////////////////////////////////////////////////////////////////////////
34
+ // Getters & Setters //
35
+ ////////////////////////////////////////////////////////////////////////////////////////
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ // Private Methods //
38
+ ////////////////////////////////////////////////////////////////////////////////////////
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ // Listeners //
41
+ ////////////////////////////////////////////////////////////////////////////////////////
42
+ }
admin/models/FMModelFormMakerPreview_fmc.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelFormMakerPreview_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ public function get_theme_css($id) {
23
+ global $wpdb;
24
+ $css = $wpdb->get_var($wpdb->prepare('SELECT css FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
25
+ return $css;
26
+ }
27
+
28
+ public function get_form($form_id) {
29
+ global $wpdb;
30
+ $form = $wpdb->get_var($wpdb->prepare('SELECT form_front FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
31
+ return $form;
32
+ }
33
+ ////////////////////////////////////////////////////////////////////////////////////////
34
+ // Getters & Setters //
35
+ ////////////////////////////////////////////////////////////////////////////////////////
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ // Private Methods //
38
+ ////////////////////////////////////////////////////////////////////////////////////////
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ // Listeners //
41
+ ////////////////////////////////////////////////////////////////////////////////////////
42
+ }
admin/models/FMModelFormcontactwdcaptcha.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelFormcontactwdcaptcha {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Getters & Setters //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ ////////////////////////////////////////////////////////////////////////////////////////
26
+ // Private Methods //
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ ////////////////////////////////////////////////////////////////////////////////////////
29
+ // Listeners //
30
+ ////////////////////////////////////////////////////////////////////////////////////////
31
+ }
admin/models/FMModelFormcontactwindow.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelFormcontactwindow {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ public function get_form_data() {
23
+ global $wpdb;
24
+ $row = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE `id` IN(" . get_option('contact_form_forms', 0) . ") order by `title`");
25
+ return $row;
26
+ }
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ // Getters & Setters //
29
+ ////////////////////////////////////////////////////////////////////////////////////////
30
+ ////////////////////////////////////////////////////////////////////////////////////////
31
+ // Private Methods //
32
+ ////////////////////////////////////////////////////////////////////////////////////////
33
+ ////////////////////////////////////////////////////////////////////////////////////////
34
+ // Listeners //
35
+ ////////////////////////////////////////////////////////////////////////////////////////
36
+ }
admin/models/FMModelFromeditcountryinpopup_fmc.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_fmc.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_fmc.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_fmc.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_fmc.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelLicensing_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ ////////////////////////////////////////////////////////////////////////////////////////
22
+ // Getters & Setters //
23
+ ////////////////////////////////////////////////////////////////////////////////////////
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ // Private Methods //
26
+ ////////////////////////////////////////////////////////////////////////////////////////
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ // Listeners //
29
+ ////////////////////////////////////////////////////////////////////////////////////////
30
+ }
admin/models/FMModelManage_fmc.php ADDED
@@ -0,0 +1,1830 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelManage_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function get_rows_data() {
22
+ global $wpdb;
23
+ $where = 'WHERE `id` IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')';
24
+ $where .= ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? ' AND title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
25
+ $asc_or_desc = ((isset($_POST['asc_or_desc'])) ? esc_html($_POST['asc_or_desc']) : 'asc');
26
+ $order_by = ' ORDER BY ' . ((isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') ? esc_html($_POST['order_by']) : 'id') . ' ' . $asc_or_desc;
27
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
28
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
29
+ }
30
+ else {
31
+ $limit = 0;
32
+ }
33
+ $query = "SELECT * FROM " . $wpdb->prefix . "formmaker " . $where . $order_by . " LIMIT " . $limit . ",20";
34
+ $rows = $wpdb->get_results($query);
35
+ return $rows;
36
+ }
37
+
38
+ public function get_row_data($id) {
39
+ global $wpdb;
40
+ if ($id != 0) {
41
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
42
+ }
43
+ else {
44
+ $row = new stdClass();
45
+ $row->id = 0;
46
+ $row->title = '';
47
+ $row->mail = '';
48
+ $row->form = '';
49
+ $row->form_front = '';
50
+ $row->theme = 0;
51
+ $row->javascript = '';
52
+ $row->submit_text = '';
53
+ $row->url = '';
54
+ $row->submit_text_type = 0;
55
+ $row->script1 = '';
56
+ $row->script2 = '';
57
+ $row->script_user1 = '';
58
+ $row->script_user2 = '';
59
+ $row->counter = 0;
60
+ $row->label_order = '';
61
+ $row->article_id = '';
62
+ $row->pagination = '';
63
+ $row->show_title = '';
64
+ $row->show_numbers = '';
65
+ $row->public_key = '';
66
+ $row->private_key = '';
67
+ $row->recaptcha_theme = '';
68
+ $row->from_name = '';
69
+ $row->from_mail = '';
70
+ $row->label_order_current = '';
71
+ $row->script_mail_user = '';
72
+ $row->script_mail = '';
73
+ $row->tax = 0;
74
+ $row->payment_currency = '$';
75
+ $row->paypal_email = '';
76
+ $row->checkout_mode = 'testmode';
77
+ $row->paypal_mode = 0;
78
+
79
+ $row->published = 1;
80
+ $row->form_fields = '';
81
+ $row->savedb = 1;
82
+ $row->sendemail = 1;
83
+ $row->requiredmark = '*';
84
+ $row->reply_to = 0;
85
+ $row->send_to = 0;
86
+ $row->autogen_layout = 1;
87
+ $row->custom_front = '';
88
+ $row->mail_from_user = '';
89
+ $row->mail_from_name_user = '';
90
+ $row->reply_to_user = '';
91
+ }
92
+ return $row;
93
+ }
94
+
95
+ public function get_row_data_new($id) {
96
+ global $wpdb;
97
+ if ($id != 0) {
98
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
99
+ $labels2 = array();
100
+ $label_id = array();
101
+ $label_order_original = array();
102
+ $label_type = array();
103
+ $label_all = explode('#****#', $row->label_order);
104
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
105
+ foreach($label_all as $key => $label_each) {
106
+ $label_id_each=explode('#**id**#',$label_each);
107
+ array_push($label_id, $label_id_each[0]);
108
+ $label_oder_each=explode('#**label**#', $label_id_each[1]);
109
+ array_push($label_order_original, addslashes($label_oder_each[0]));
110
+ array_push($label_type, $label_oder_each[1]);
111
+ }
112
+ $labels2['id'] = '"' . implode('","', $label_id) . '"';
113
+ $labels2['label'] = '"' . implode('","', $label_order_original) . '"';
114
+ $labels2['type'] = '"' . implode('","', $label_type) . '"';
115
+ $ids = array();
116
+ $types = array();
117
+ $labels = array();
118
+ $paramss = array();
119
+ $fields = explode('*:*new_field*:*', $row->form_fields);
120
+ $fields = array_slice($fields, 0, count($fields) - 1);
121
+ foreach ($fields as $field) {
122
+ $temp=explode('*:*id*:*',$field);
123
+ array_push($ids, $temp[0]);
124
+ $temp=explode('*:*type*:*',$temp[1]);
125
+ array_push($types, $temp[0]);
126
+ $temp=explode('*:*w_field_label*:*',$temp[1]);
127
+ array_push($labels, $temp[0]);
128
+ array_push($paramss, $temp[1]);
129
+ }
130
+ $form = $row->form_front;
131
+ foreach ($ids as $ids_key => $id) {
132
+ $label = $labels[$ids_key];
133
+ $type = $types[$ids_key];
134
+ $params = $paramss[$ids_key];
135
+ if (strpos($form, '%'.$id.' - '.$label.'%')) {
136
+ $rep = '';
137
+ $param = array();
138
+ $param['attributes'] = '';
139
+ switch ($type) {
140
+ case 'type_section_break': {
141
+ $params_names = array('w_editor');
142
+ $temp = $params;
143
+ foreach ($params_names as $params_name) {
144
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
145
+ $param[$params_name] = $temp[0];
146
+ $temp = $temp[1];
147
+ }
148
+ $rep ='<div id="wdform_field'.$id.'" type="type_section_break" class="wdform_field_section_break"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">custom_'.$id.'</span><div id="'.$id.'_element_sectionform_id_temp" align="left" class="wdform_section_break">'.html_entity_decode($param['w_editor']).'</div></div>';
149
+ break;
150
+ }
151
+ case 'type_editor': {
152
+ $params_names = array('w_editor');
153
+ $temp = $params;
154
+ foreach ($params_names as $params_name ) {
155
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
156
+ $param[$params_name] = $temp[0];
157
+ $temp = $temp[1];
158
+ }
159
+ $rep ='<div id="wdform_field'.$id.'" type="type_editor" class="wdform_field" style="display: table-cell;">'.html_entity_decode($param['w_editor']).'</div><span id="'.$id.'_element_labelform_id_temp" style="display: none;">custom_'.$id.'</span>';
160
+ break;
161
+ }
162
+ case 'type_send_copy': {
163
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_required');
164
+ $temp = $params;
165
+ foreach ($params_names as $params_name ) {
166
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
167
+ $param[$params_name] = $temp[0];
168
+ $temp = $temp[1];
169
+ }
170
+ if ($temp) {
171
+ $temp = explode('*:*w_attr_name*:*', $temp);
172
+ $attrs = array_slice($temp, 0, count($temp) - 1);
173
+ foreach ($attrs as $attr) {
174
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
175
+ }
176
+ }
177
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
178
+ $input_active = ($param['w_first_val'] == 'true' ? "checked='checked'" : "");
179
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
180
+ $rep = '<div id="wdform_field'.$id.'" type="type_send_copy" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" style="display: '.$param['w_field_label_pos'].'"><input type="hidden" value="type_send_copy" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="checkbox" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" onclick="set_checked(&quot;'.$id.'&quot;,&quot;&quot;,&quot;form_id_temp&quot;)" '.$input_active.' '.$param['attributes'].'></div></div>';
181
+ break;
182
+ }
183
+ case 'type_text': {
184
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique');
185
+ $temp = $params;
186
+ foreach ($params_names as $params_name) {
187
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
188
+ $param[$params_name] = $temp[0];
189
+ $temp = $temp[1];
190
+ }
191
+ if ($temp) {
192
+ $temp = explode('*:*w_attr_name*:*', $temp);
193
+ $attrs = array_slice($temp, 0, count($temp) - 1);
194
+ foreach ($attrs as $attr) {
195
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
196
+ }
197
+ }
198
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
199
+ $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
200
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
201
+ $rep = '<div id="wdform_field'.$id.'" type="type_text" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" style="display: '.$param['w_field_label_pos'].'"><input type="hidden" value="type_text" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><input type="text" class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" onfocus="delete_value(&quot;'.$id.'_elementform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_elementform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_elementform_id_temp&quot;)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].'></div></div>';
202
+ break;
203
+ }
204
+ case 'type_number': {
205
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique', 'w_class');
206
+ $temp = $params;
207
+ foreach ($params_names as $params_name) {
208
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
209
+ $param[$params_name] = $temp[0];
210
+ $temp = $temp[1];
211
+ }
212
+ if ($temp) {
213
+ $temp = explode('*:*w_attr_name*:*', $temp);
214
+ $attrs = array_slice($temp, 0, count($temp) - 1);
215
+ foreach ($attrs as $attr) {
216
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
217
+ }
218
+ }
219
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
220
+ $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
221
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
222
+ $rep = '<div id="wdform_field'.$id.'" type="type_number" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'"><input type="hidden" value="type_number" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><input type="text" class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" onkeypress="return check_isnum(event)" onfocus="delete_value(&quot;'.$id.'_elementform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_elementform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_elementform_id_temp&quot;)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].'></div></div>';
223
+ break;
224
+ }
225
+ case 'type_password': {
226
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_required', 'w_unique', 'w_class');
227
+ $temp = $params;
228
+ foreach ($params_names as $params_name) {
229
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
230
+ $param[$params_name] = $temp[0];
231
+ $temp = $temp[1];
232
+ }
233
+ if ($temp) {
234
+ $temp = explode('*:*w_attr_name*:*', $temp);
235
+ $attrs = array_slice($temp, 0, count($temp) - 1);
236
+ foreach ($attrs as $attr) {
237
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
238
+ }
239
+ }
240
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
241
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
242
+ $rep = '<div id="wdform_field'.$id.'" type="type_password" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'"><input type="hidden" value="type_password" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><input type="password" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" style="width: '.$param['w_size'].'px;" '.$param['attributes'].'></div></div>';
243
+ break;
244
+ }
245
+ case 'type_textarea': {
246
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size_w', 'w_size_h', 'w_first_val', 'w_title', 'w_required', 'w_unique', 'w_class');
247
+ $temp = $params;
248
+ foreach ($params_names as $params_name) {
249
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
250
+ $param[$params_name] = $temp[0];
251
+ $temp = $temp[1];
252
+ }
253
+ if ($temp) {
254
+ $temp = explode('*:*w_attr_name*:*', $temp);
255
+ $attrs = array_slice($temp, 0, count($temp) - 1);
256
+ foreach ($attrs as $attr) {
257
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
258
+ }
259
+ }
260
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
261
+ $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
262
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
263
+ $rep = '<div id="wdform_field'.$id.'" type="type_textarea" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display:'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;vertical-align:top;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><input type="hidden" value="type_textarea" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><textarea class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" title="'.$param['w_title'].'" onfocus="delete_value(&quot;'.$id.'_elementform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_elementform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_elementform_id_temp&quot;)" style="width: '.$param['w_size_w'].'px; height: '.$param['w_size_h'].'px;" '.$param['attributes'].'>'.$param['w_first_val'].'</textarea></div></div>';
264
+ break;
265
+ }
266
+ case 'type_wdeditor': {
267
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size_w', 'w_size_h', 'w_title', 'w_required', 'w_class');
268
+ $temp = $params;
269
+ foreach ($params_names as $params_name) {
270
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
271
+ $param[$params_name] = $temp[0];
272
+ $temp = $temp[1];
273
+ }
274
+ if ($temp) {
275
+ $temp = explode('*:*w_attr_name*:*', $temp);
276
+ $attrs = array_slice($temp, 0, count($temp) - 1);
277
+ foreach ($attrs as $attr) {
278
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
279
+ }
280
+ }
281
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
282
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
283
+ $rep = '<div id="wdform_field'.$id.'" type="type_wdeditor" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display:'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><input type="hidden" value="type_wdeditor" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp">
284
+ <input class="" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" type="hidden" value="" title="'.$param['w_title'].'" style="width: '.$param['w_size_w'].'px; height: '.$param['w_size_h'].'px;" '.$param['attributes'].'><span style="color: red; font-style: italic;">Editor doesn\'t display in back end</span></div></div>';
285
+ break;
286
+ }
287
+ case 'type_phone': {
288
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_mini_labels', 'w_required', 'w_unique', 'w_class');
289
+ $temp = $params;
290
+ foreach ($params_names as $params_name) {
291
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
292
+ $param[$params_name] = $temp[0];
293
+ $temp = $temp[1];
294
+ }
295
+ if ($temp) {
296
+ $temp = explode('*:*w_attr_name*:*', $temp);
297
+ $attrs = array_slice($temp, 0, count($temp) - 1);
298
+ foreach ($attrs as $attr) {
299
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
300
+ }
301
+ }
302
+ $w_first_val = explode('***', $param['w_first_val']);
303
+ $w_title = explode('***', $param['w_title']);
304
+ $w_mini_labels = explode('***', $param['w_mini_labels']);
305
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
306
+ $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
307
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
308
+ $rep = '<div id="wdform_field'.$id.'" type="type_phone" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_phone" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><div id="'.$id.'_table_name" style="display: table;"><div id="'.$id.'_tr_name1" style="display: table-row;"><div id="'.$id.'_td_name_input_first" style="display: table-cell;"><input type="text" class="'.$input_active.'" id="'.$id.'_element_firstform_id_temp" name="'.$id.'_element_firstform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'" onfocus="delete_value(&quot;'.$id.'_element_firstform_id_temp&quot;)"onblur="return_value(&quot;'.$id.'_element_firstform_id_temp&quot;)"onchange="change_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" onkeypress="return check_isnum(event)"style="width: 50px;" '.$param['attributes'].'><span class="wdform_line" style="margin: 0px 4px; padding: 0px;">-</span></div><div id="'.$id.'_td_name_input_last" style="display: table-cell;"><input type="text" class="'.$input_active.'" id="'.$id.'_element_lastform_id_temp" name="'.$id.'_element_lastform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'" onfocus="delete_value(&quot;'.$id.'_element_lastform_id_temp&quot;)"onblur="return_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" onkeypress="return check_isnum(event)"style="width: '.$param['w_size'].'px;" '.$param['attributes'].'></div></div><div id="'.$id.'_tr_name2" style="display: table-row;"><div id="'.$id.'_td_name_label_first" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_area_code">'.$w_mini_labels[0].'</label></div><div id="'.$id.'_td_name_label_last" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_phone_number">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
309
+ break;
310
+ }
311
+ case 'type_name': {
312
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class');
313
+ $temp = $params;
314
+ foreach ($params_names as $params_name) {
315
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
316
+ $param[$params_name] = $temp[0];
317
+ $temp = $temp[1];
318
+ }
319
+ if ($temp) {
320
+ $temp = explode('*:*w_attr_name*:*', $temp);
321
+ $attrs = array_slice($temp, 0, count($temp) - 1);
322
+ foreach ($attrs as $attr) {
323
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
324
+ }
325
+ }
326
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
327
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
328
+ $w_first_val = explode('***', $param['w_first_val']);
329
+ $w_title = explode('***', $param['w_title']);
330
+ $w_mini_labels = explode('***', $param['w_mini_labels']);
331
+ if ($param['w_name_format'] == 'normal') {
332
+ $w_name_format = '<div id="'.$id.'_td_name_input_first" style="display: table-cell;"><input type="text" class="'.($w_first_val[0]==$w_title[0] ? "input_deactive" : "input_active").'" id="'.$id.'_element_firstform_id_temp" name="'.$id.'_element_firstform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'" onfocus="delete_value(&quot;'.$id.'_element_firstform_id_temp&quot;)"onblur="return_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" style="margin-right: 10px; width: '.$param['w_size'].'px;"'.$param['attributes'].'></div><div id="'.$id.'_td_name_input_last" style="display: table-cell;"><input type="text" class="'.($w_first_val[1]==$w_title[1] ? "input_deactive" : "input_active").'" id="'.$id.'_element_lastform_id_temp" name="'.$id.'_element_lastform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'" onfocus="delete_value(&quot;'.$id.'_element_lastform_id_temp&quot;)"onblur="return_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" style="margin-right: 10px; width: '.$param['w_size'].'px;" '.$param['attributes'].'></div>';
333
+ $w_name_format_mini_labels = '<div id="'.$id.'_tr_name2" style="display: table-row;"><div id="'.$id.'_td_name_label_first" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_first">'.$w_mini_labels[1].'</label></div><div id="'.$id.'_td_name_label_last" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_last">'.$w_mini_labels[2].'</label></div></div>';
334
+ }
335
+ else {
336
+ $w_name_format = '<div id="'.$id.'_td_name_input_title" style="display: table-cell;"><input type="text" class="'.($w_first_val[0]==$w_title[0] ? "input_deactive" : "input_active").'" id="'.$id.'_element_titleform_id_temp" name="'.$id.'_element_titleform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'" onfocus="delete_value(&quot;'.$id.'_element_titleform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_titleform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_titleform_id_temp&quot;)" style="margin: 0px 10px 0px 0px; width: 40px;"></div><div id="'.$id.'_td_name_input_first" style="display: table-cell;"><input type="text" class="'.($w_first_val[1]==$w_title[1] ? "input_deactive" : "input_active").'" id="'.$id.'_element_firstform_id_temp" name="'.$id.'_element_firstform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'" onfocus="delete_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" style="margin-right: 10px; width: '.$param['w_size'].'px;"></div><div id="'.$id.'_td_name_input_last" style="display: table-cell;"><input type="text" class="'.($w_first_val[2]==$w_title[2] ? "input_deactive" : "input_active").'" id="'.$id.'_element_lastform_id_temp" name="'.$id.'_element_lastform_id_temp" value="'.$w_first_val[2].'" title="'.$w_title[2].'" onfocus="delete_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" style="margin-right: 10px; width: '.$param['w_size'].'px;"></div><div id="'.$id.'_td_name_input_middle" style="display: table-cell;"><input type="text" class="'.($w_first_val[3]==$w_title[3] ? "input_deactive" : "input_active").'" id="'.$id.'_element_middleform_id_temp" name="'.$id.'_element_middleform_id_temp" value="'.$w_first_val[3].'" title="'.$w_title[3].'" onfocus="delete_value(&quot;'.$id.'_element_middleform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_middleform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_middleform_id_temp&quot;)" style="width: '.$param['w_size'].'px;"></div>';
337
+ $w_name_format_mini_labels ='<div id="'.$id.'_tr_name2" style="display: table-row;"><div id="'.$id.'_td_name_label_title" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_title">'.$w_mini_labels[0].'</label></div><div id="'.$id.'_td_name_label_first" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_first">'.$w_mini_labels[1].'</label></div><div id="'.$id.'_td_name_label_last" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_last">'.$w_mini_labels[2].'</label></div><div id="'.$id.'_td_name_label_middle" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_middle">'.$w_mini_labels[3].'</label></div></div>';
338
+ }
339
+ $rep = '<div id="wdform_field'.$id.'" type="type_name" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_name" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><div id="'.$id.'_table_name" cellpadding="0" cellspacing="0" style="display: table;"><div id="'.$id.'_tr_name1" style="display: table-row;">'.$w_name_format.' </div>'.$w_name_format_mini_labels.' </div></div></div>';
340
+ break;
341
+ }
342
+ case 'type_address': {
343
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_mini_labels', 'w_disabled_fields', 'w_required', 'w_class');
344
+ $temp = $params;
345
+ foreach ($params_names as $params_name) {
346
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
347
+ $param[$params_name] = $temp[0];
348
+ $temp = $temp[1];
349
+ }
350
+ if ($temp) {
351
+ $temp = explode('*:*w_attr_name*:*', $temp);
352
+ $attrs = array_slice($temp, 0, count($temp) - 1);
353
+ foreach ($attrs as $attr) {
354
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
355
+ }
356
+ }
357
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
358
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
359
+ $w_mini_labels = explode('***', $param['w_mini_labels']);
360
+ $w_disabled_fields = explode('***', $param['w_disabled_fields']);
361
+ $hidden_inputs = '';
362
+ $labels_for_id = array('street1', 'street2', 'city', 'state', 'postal', 'country');
363
+ foreach ($w_disabled_fields as $key => $w_disabled_field) {
364
+ if ($key != 6) {
365
+ if ($w_disabled_field == 'yes') {
366
+ $hidden_inputs .= '<input type="hidden" id="'.$id.'_'.$labels_for_id[$key].'form_id_temp" value="'.$w_mini_labels[$key].'" id_for_label="'.($id+$key).'">';
367
+ }
368
+ }
369
+ }
370
+ $address_fields = '';
371
+ $g = 0;
372
+ if (isset($w_disabled_fields[0]) && $w_disabled_fields[0] == 'no') {
373
+ $g += 2;
374
+ $address_fields .= '<span style="float: left; width: 100%; padding-bottom: 8px; display: block;"><input type="text" id="'.$id.'_street1form_id_temp" name="'.$id.'_street1form_id_temp" onchange="change_value(&quot;'.$id.'_street1form_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].'><label class="mini_label" id="'.$id.'_mini_label_street1" style="display: block;">'.$w_mini_labels[0].'</label></span>';
375
+ }
376
+ if (isset($w_disabled_fields[1]) && $w_disabled_fields[1] == 'no') {
377
+ $g += 2;
378
+ $address_fields .= '<span style="float: left; width: 100%; padding-bottom: 8px; display: block;"><input type="text" id="'.$id.'_street2form_id_temp" name="'.($id+1).'_street2form_id_temp" onchange="change_value(&quot;'.$id.'_street2form_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].'><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_street2">'.$w_mini_labels[1].'</label></span>';
379
+ }
380
+ if (isset($w_disabled_fields[2]) && $w_disabled_fields[2] == 'no') {
381
+ $g++;
382
+ $address_fields .= '<span style="float: left; width: 48%; padding-bottom: 8px;"><input type="text" id="'.$id.'_cityform_id_temp" name="'.($id+2).'_cityform_id_temp" onchange="change_value(&quot;'.$id.'_cityform_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].'><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_city">'.$w_mini_labels[2].'</label></span>';
383
+ }
384
+ if (isset($w_disabled_fields[3]) && $w_disabled_fields[3] == 'no') {
385
+ $g++;
386
+ if (isset($w_disabled_fields[5]) && isset($w_disabled_fields[6]) && $w_disabled_fields[5] == 'yes' && $w_disabled_fields[6] == 'yes') {
387
+ $address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><select type="text" id="'.$id.'_stateform_id_temp" name="'.($id+3).'_stateform_id_temp" onchange="change_value(&quot;'.$id.'_stateform_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].'><option value=""></option><option value="Alabama">Alabama</option><option value="Alaska">Alaska</option><option value="Arizona">Arizona</option><option value="Arkansas">Arkansas</option><option value="California">California</option><option value="Colorado">Colorado</option><option value="Connecticut">Connecticut</option><option value="Delaware">Delaware</option><option value="Florida">Florida</option><option value="Georgia">Georgia</option><option value="Hawaii">Hawaii</option><option value="Idaho">Idaho</option><option value="Illinois">Illinois</option><option value="Indiana">Indiana</option><option value="Iowa">Iowa</option><option value="Kansas">Kansas</option><option value="Kentucky">Kentucky</option><option value="Louisiana">Louisiana</option><option value="Maine">Maine</option><option value="Maryland">Maryland</option><option value="Massachusetts">Massachusetts</option><option value="Michigan">Michigan</option><option value="Minnesota">Minnesota</option><option value="Mississippi">Mississippi</option><option value="Missouri">Missouri</option><option value="Montana">Montana</option><option value="Nebraska">Nebraska</option><option value="Nevada">Nevada</option><option value="New Hampshire">New Hampshire</option><option value="New Jersey">New Jersey</option><option value="New Mexico">New Mexico</option><option value="New York">New York</option><option value="North Carolina">North Carolina</option><option value="North Dakota">North Dakota</option><option value="Ohio">Ohio</option><option value="Oklahoma">Oklahoma</option><option value="Oregon">Oregon</option><option value="Pennsylvania">Pennsylvania</option><option value="Rhode Island">Rhode Island</option><option value="South Carolina">South Carolina</option><option value="South Dakota">South Dakota</option><option value="Tennessee">Tennessee</option><option value="Texas">Texas</option><option value="Utah">Utah</option><option value="Vermont">Vermont</option><option value="Virginia">Virginia</option><option value="Washington">Washington</option><option value="West Virginia">West Virginia</option><option value="Wisconsin">Wisconsin</option><option value="Wyoming">Wyoming</option></select><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_state">'.$w_mini_labels[3].'</label></span>';
388
+ }
389
+ else {
390
+ $address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><input type="text" id="'.$id.'_stateform_id_temp" name="'.($id+3).'_stateform_id_temp" onchange="change_value(&quot;'.$id.'_stateform_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].'><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_state">'.$w_mini_labels[3].'</label></span>';
391
+ }
392
+ }
393
+ if (isset($w_disabled_fields[4]) && $w_disabled_fields[4] == 'no') {
394
+ $g++;
395
+ $address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><input type="text" id="'.$id.'_postalform_id_temp" name="'.($id+4).'_postalform_id_temp" onchange="change_value(&quot;'.$id.'_postalform_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].'><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_postal">'.$w_mini_labels[4].'</label></span>';
396
+ }
397
+ if (isset($w_disabled_fields[5]) && $w_disabled_fields[5] == 'no') {
398
+ $g++;
399
+ $address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><select type="text" id="'.$id.'_countryform_id_temp" name="'.($id+5).'_countryform_id_temp" onchange="change_value(&quot;'.$id.'_countryform_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].'><option value=""></option><option value="Afghanistan">Afghanistan</option><option value="Albania">Albania</option><option value="Algeria">Algeria</option><option value="Andorra">Andorra</option><option value="Angola">Angola</option><option value="Antigua and Barbuda">Antigua and Barbuda</option><option value="Argentina">Argentina</option><option value="Armenia">Armenia</option><option value="Australia">Australia</option><option value="Austria">Austria</option><option value="Azerbaijan">Azerbaijan</option><option value="Bahamas">Bahamas</option><option value="Bahrain">Bahrain</option><option value="Bangladesh">Bangladesh</option><option value="Barbados">Barbados</option><option value="Belarus">Belarus</option><option value="Belgium">Belgium</option><option value="Belize">Belize</option><option value="Benin">Benin</option><option value="Bhutan">Bhutan</option><option value="Bolivia">Bolivia</option><option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option><option value="Botswana">Botswana</option><option value="Brazil">Brazil</option><option value="Brunei">Brunei</option><option value="Bulgaria">Bulgaria</option><option value="Burkina Faso">Burkina Faso</option><option value="Burundi">Burundi</option><option value="Cambodia">Cambodia</option><option value="Cameroon">Cameroon</option><option value="Canada">Canada</option><option value="Cape Verde">Cape Verde</option><option value="Central African Republic">Central African Republic</option><option value="Chad">Chad</option><option value="Chile">Chile</option><option value="China">China</option><option value="Colombi">Colombi</option><option value="Comoros">Comoros</option><option value="Congo (Brazzaville)">Congo (Brazzaville)</option><option value="Congo">Congo</option><option value="Costa Rica">Costa Rica</option><option value="Cote d\'Ivoire">Cote d\'Ivoire</option><option value="Croatia">Croatia</option><option value="Cuba">Cuba</option><option value="Cyprus">Cyprus</option><option value="Czech Republic">Czech Republic</option><option value="Denmark">Denmark</option><option value="Djibouti">Djibouti</option><option value="Dominica">Dominica</option><option value="Dominican Republic">Dominican Republic</option><option value="East Timor (Timor Timur)">East Timor (Timor Timur)</option><option value="Ecuador">Ecuador</option><option value="Egypt">Egypt</option><option value="El Salvador">El Salvador</option><option value="Equatorial Guinea">Equatorial Guinea</option><option value="Eritrea">Eritrea</option><option value="Estonia">Estonia</option><option value="Ethiopia">Ethiopia</option><option value="Fiji">Fiji</option><option value="Finland">Finland</option><option value="France">France</option><option value="Gabon">Gabon</option><option value="Gambia, The">Gambia, The</option><option value="Georgia">Georgia</option><option value="Germany">Germany</option><option value="Ghana">Ghana</option><option value="Greece">Greece</option><option value="Grenada">Grenada</option><option value="Guatemala">Guatemala</option><option value="Guinea">Guinea</option><option value="Guinea-Bissau">Guinea-Bissau</option><option value="Guyana">Guyana</option><option value="Haiti">Haiti</option><option value="Honduras">Honduras</option><option value="Hungary">Hungary</option><option value="Iceland">Iceland</option><option value="India">India</option><option value="Indonesia">Indonesia</option><option value="Iran">Iran</option><option value="Iraq">Iraq</option><option value="Ireland">Ireland</option><option value="Israel">Israel</option><option value="Italy">Italy</option><option value="Jamaica">Jamaica</option><option value="Japan">Japan</option><option value="Jordan">Jordan</option><option value="Kazakhstan">Kazakhstan</option><option value="Kenya">Kenya</option><option value="Kiribati">Kiribati</option><option value="Korea, North">Korea, North</option><option value="Korea, South">Korea, South</option><option value="Kuwait">Kuwait</option><option value="Kyrgyzstan">Kyrgyzstan</option><option value="Laos">Laos</option><option value="Latvia">Latvia</option><option value="Lebanon">Lebanon</option><option value="Lesotho">Lesotho</option><option value="Liberia">Liberia</option><option value="Libya">Libya</option><option value="Liechtenstein">Liechtenstein</option><option value="Lithuania">Lithuania</option><option value="Luxembourg">Luxembourg</option><option value="Macedonia">Macedonia</option><option value="Madagascar">Madagascar</option><option value="Malawi">Malawi</option><option value="Malaysia">Malaysia</option><option value="Maldives">Maldives</option><option value="Mali">Mali</option><option value="Malta">Malta</option><option value="Marshall Islands">Marshall Islands</option><option value="Mauritania">Mauritania</option><option value="Mauritius">Mauritius</option><option value="Mexico">Mexico</option><option value="Micronesia">Micronesia</option><option value="Moldova">Moldova</option><option value="Monaco">Monaco</option><option value="Mongolia">Mongolia</option><option value="Morocco">Morocco</option><option value="Mozambique">Mozambique</option><option value="Myanmar">Myanmar</option><option value="Namibia">Namibia</option><option value="Nauru">Nauru</option><option value="Nepa">Nepa</option><option value="Netherlands">Netherlands</option><option value="New Zealand">New Zealand</option><option value="Nicaragua">Nicaragua</option><option value="Niger">Niger</option><option value="Nigeria">Nigeria</option><option value="Norway">Norway</option><option value="Oman">Oman</option><option value="Pakistan">Pakistan</option><option value="Palau">Palau</option><option value="Panama">Panama</option><option value="Papua New Guinea">Papua New Guinea</option><option value="Paraguay">Paraguay</option><option value="Peru">Peru</option><option value="Philippines">Philippines</option><option value="Poland">Poland</option><option value="Portugal">Portugal</option><option value="Qatar">Qatar</option><option value="Romania">Romania</option><option value="Russia">Russia</option><option value="Rwanda">Rwanda</option><option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option><option value="Saint Lucia">Saint Lucia</option><option value="Saint Vincent">Saint Vincent</option><option value="Samoa">Samoa</option><option value="San Marino">San Marino</option><option value="Sao Tome and Principe">Sao Tome and Principe</option><option value="Saudi Arabia">Saudi Arabia</option><option value="Senegal">Senegal</option><option value="Serbia and Montenegro">Serbia and Montenegro</option><option value="Seychelles">Seychelles</option><option value="Sierra Leone">Sierra Leone</option><option value="Singapore">Singapore</option><option value="Slovakia">Slovakia</option><option value="Slovenia">Slovenia</option><option value="Solomon Islands">Solomon Islands</option><option value="Somalia">Somalia</option><option value="South Africa">South Africa</option><option value="Spain">Spain</option><option value="Sri Lanka">Sri Lanka</option><option value="Sudan">Sudan</option><option value="Suriname">Suriname</option><option value="Swaziland">Swaziland</option><option value="Sweden">Sweden</option><option value="Switzerland">Switzerland</option><option value="Syria">Syria</option><option value="Taiwan">Taiwan</option><option value="Tajikistan">Tajikistan</option><option value="Tanzania">Tanzania</option><option value="Thailand">Thailand</option><option value="Togo">Togo</option><option value="Tonga">Tonga</option><option value="Trinidad and Tobago">Trinidad and Tobago</option><option value="Tunisia">Tunisia</option><option value="Turkey">Turkey</option><option value="Turkmenistan">Turkmenistan</option><option value="Tuvalu">Tuvalu</option><option value="Uganda">Uganda</option><option value="Ukraine">Ukraine</option><option value="United Arab Emirates">United Arab Emirates</option><option value="United Kingdom">United Kingdom</option><option value="United States">United States</option><option value="Uruguay">Uruguay</option><option value="Uzbekistan">Uzbekistan</option><option value="Vanuatu">Vanuatu</option><option value="Vatican City">Vatican City</option><option value="Venezuela">Venezuela</option><option value="Vietnam">Vietnam</option><option value="Yemen">Yemen</option><option value="Zambia">Zambia</option><option value="Zimbabwe">Zimbabwe</option></select><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_country">'.$w_mini_labels[5].'</span>';
400
+ }
401
+ $rep = '<div id="wdform_field'.$id.'" type="type_address" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="vertical-align: top; display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_address" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" name="'.$id.'_disable_fieldsform_id_temp" id="'.$id.'_disable_fieldsform_id_temp" street1="'.(isset($w_disabled_fields[0]) ? $w_disabled_fields[0] : '').'" street2="'.(isset($w_disabled_fields[1]) ? $w_disabled_fields[1] : '').'" city="'.(isset($w_disabled_fields[2]) ? $w_disabled_fields[2] : '').'" state="'.(isset($w_disabled_fields[3]) ? $w_disabled_fields[3] : '').'" postal="'.(isset($w_disabled_fields[4]) ? $w_disabled_fields[4] : '').'" country="'.(isset($w_disabled_fields[5]) ? $w_disabled_fields[5] : '').'" us_states="'.(isset($w_disabled_fields[6]) ? $w_disabled_fields[6] : '').'"><div id="'.$id.'_div_address" style="width: '.$param['w_size'].'px;">'.$address_fields.$hidden_inputs.'</div></div></div>';
402
+ break;
403
+ }
404
+ case 'type_submitter_mail': {
405
+ $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique', 'w_class');
406
+ $temp=$params;
407
+ foreach($params_names as $params_name )
408
+ {
409
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
410
+ $param[$params_name] = $temp[0];
411
+ $temp=$temp[1];
412
+ }
413
+
414
+ if($temp)
415
+ {
416
+ $temp =explode('*:*w_attr_name*:*',$temp);
417
+ $attrs = array_slice($temp,0, count($temp)-1);
418
+ foreach($attrs as $attr)
419
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
420
+ }
421
+
422
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
423
+ $input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
424
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
425
+
426
+ $rep ='<div id="wdform_field'.$id.'" type="type_submitter_mail" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_submitter_mail" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><input type="text" class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" onfocus="delete_value(&quot;'.$id.'_elementform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_elementform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_elementform_id_temp&quot;)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].'></div></div>';
427
+ break;
428
+ }
429
+ case 'type_checkbox':
430
+ {
431
+ $params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num','w_class');
432
+ $temp=$params;
433
+ foreach($params_names as $params_name )
434
+ {
435
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
436
+ $param[$params_name] = $temp[0];
437
+ $temp=$temp[1];
438
+ }
439
+
440
+ if($temp)
441
+ {
442
+ $temp =explode('*:*w_attr_name*:*',$temp);
443
+ $attrs = array_slice($temp,0, count($temp)-1);
444
+ foreach($attrs as $attr)
445
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
446
+ }
447
+
448
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
449
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
450
+ $param['w_choices'] = explode('***',$param['w_choices']);
451
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
452
+
453
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
454
+ {
455
+ if($choices_checked=='true')
456
+ $param['w_choices_checked'][$key]='checked="checked"';
457
+ else
458
+ $param['w_choices_checked'][$key]='';
459
+ }
460
+
461
+ $rep='<div id="wdform_field'.$id.'" type="type_checkbox" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_checkbox" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_rowcol'].'" name="'.$id.'_rowcol_numform_id_temp" id="'.$id.'_rowcol_numform_id_temp"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;" '.($param['w_flow']=='hor' ? 'for_hor="'.$id.'_hor"' : '').'>';
462
+
463
+ if($param['w_flow']=='hor')
464
+ {
465
+ $j = 0;
466
+ for($i=0; $i<(int)$param['w_rowcol']; $i++)
467
+ {
468
+ $rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
469
+
470
+ for($l=0; $l<=(int)(count($param['w_choices'])/$param['w_rowcol']); $l++)
471
+ {
472
+ if($j >= count($param['w_choices'])%$param['w_rowcol'] && $l==(int)(count($param['w_choices'])/$param['w_rowcol']))
473
+ continue;
474
+
475
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
476
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="checkbox" value="'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" other="1" onclick="if(set_checked(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$l+$i).'&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].'><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'">'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
477
+ else
478
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="checkbox" value="'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" onclick="set_checked(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$l+$i).'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].'><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'">'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
479
+ }
480
+
481
+ $j++;
482
+ $rep.='</div>';
483
+
484
+ }
485
+
486
+ }
487
+ else
488
+ {
489
+ for($i=0; $i<(int)(count($param['w_choices'])/$param['w_rowcol']); $i++)
490
+ {
491
+ $rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
492
+
493
+ if(count($param['w_choices']) > (int)$param['w_rowcol'])
494
+ for($l=0; $l<$param['w_rowcol']; $l++)
495
+ {
496
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
497
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" other="1" onclick="if(set_checked(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
498
+ else
499
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" onclick="set_checked(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
500
+ }
501
+ else
502
+ for($l=0; $l<count($param['w_choices']); $l++)
503
+ {
504
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
505
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" other="1" onclick="if(set_checked(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
506
+ else
507
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" onclick="set_checked(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
508
+ }
509
+
510
+ $rep.='</div>';
511
+ }
512
+
513
+ if(count($param['w_choices'])%$param['w_rowcol']!=0)
514
+ {
515
+ $rep.='<div id="'.$id.'_element_tr'.((int)(count($param['w_choices'])/(int)$param['w_rowcol'])).'" style="display: table-row;">';
516
+
517
+ for($k=0; $k<count($param['w_choices'])%$param['w_rowcol']; $k++)
518
+ {
519
+ $l = count($param['w_choices']) - count($param['w_choices'])%$param['w_rowcol'] + $k;
520
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$l)
521
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="checkbox" value="'.$param['w_choices'][$l].'" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp'.$l.'" other="1" onclick="if(set_checked(&quot;'.$id.'&quot;,&quot;'.$l.'&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$l.'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
522
+ else
523
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="checkbox" value="'.$param['w_choices'][$l].'" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp'.$l.'" onclick="set_checked(&quot;'.$id.'&quot;,&quot;'.$l.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$l.'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
524
+ }
525
+
526
+ $rep.='</div>';
527
+ }
528
+
529
+
530
+
531
+ }
532
+ $rep.='</div></div></div></div>';
533
+ break;
534
+ }
535
+ case 'type_radio':
536
+ {
537
+
538
+ $params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num','w_class');
539
+ $temp=$params;
540
+ foreach($params_names as $params_name )
541
+ {
542
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
543
+ $param[$params_name] = $temp[0];
544
+ $temp=$temp[1];
545
+ }
546
+
547
+ if($temp)
548
+ {
549
+ $temp =explode('*:*w_attr_name*:*',$temp);
550
+ $attrs = array_slice($temp,0, count($temp)-1);
551
+ foreach($attrs as $attr)
552
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
553
+ }
554
+
555
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
556
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
557
+ $param['w_choices'] = explode('***',$param['w_choices']);
558
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
559
+
560
+
561
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
562
+ {
563
+ if($choices_checked=='true')
564
+ $param['w_choices_checked'][$key]='checked="checked"';
565
+ else
566
+ $param['w_choices_checked'][$key]='';
567
+ }
568
+
569
+ $rep='<div id="wdform_field'.$id.'" type="type_radio" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_radio" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_rowcol'].'" name="'.$id.'_rowcol_numform_id_temp" id="'.$id.'_rowcol_numform_id_temp"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;" '.($param['w_flow']=='hor' ? 'for_hor="'.$id.'_hor"' : '').'>';
570
+
571
+
572
+ if($param['w_flow']=='hor')
573
+ {
574
+ $j = 0;
575
+ for($i=0; $i<(int)$param['w_rowcol']; $i++)
576
+ {
577
+ $rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
578
+
579
+ for($l=0; $l<=(int)(count($param['w_choices'])/$param['w_rowcol']); $l++)
580
+ {
581
+ if($j >= count($param['w_choices'])%$param['w_rowcol'] && $l==(int)(count($param['w_choices'])/$param['w_rowcol']))
582
+ continue;
583
+
584
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
585
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp" other="1" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$l+$i).'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].'><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'">'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
586
+ else
587
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$l+$i).'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].'><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'">'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
588
+ }
589
+
590
+ $j++;
591
+ $rep.='</div>';
592
+
593
+ }
594
+
595
+ }
596
+ else
597
+ {
598
+ for($i=0; $i<(int)(count($param['w_choices'])/$param['w_rowcol']); $i++)
599
+ {
600
+ $rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
601
+
602
+ if(count($param['w_choices']) > (int)$param['w_rowcol'])
603
+ for($l=0; $l<$param['w_rowcol']; $l++)
604
+ {
605
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
606
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" other="1" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
607
+ else
608
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
609
+ }
610
+ else
611
+ for($l=0; $l<count($param['w_choices']); $l++)
612
+ {
613
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
614
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" other="1" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
615
+ else
616
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
617
+ }
618
+
619
+ $rep.='</div>';
620
+ }
621
+
622
+ if(count($param['w_choices'])%$param['w_rowcol']!=0)
623
+ {
624
+ $rep.='<div id="'.$id.'_element_tr'.((int)(count($param['w_choices'])/(int)$param['w_rowcol'])).'" style="display: table-row;">';
625
+
626
+ for($k=0; $k<count($param['w_choices'])%$param['w_rowcol']; $k++)
627
+ {
628
+ $l = count($param['w_choices']) - count($param['w_choices'])%$param['w_rowcol'] + $k;
629
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$l)
630
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][$l].'" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp" other="1" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$l.'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$l.'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
631
+ else
632
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][$l].'" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$l.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$l.'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
633
+ }
634
+
635
+ $rep.='</div>';
636
+ }
637
+
638
+ }
639
+
640
+
641
+
642
+ $rep.='</div></div></div></div>';
643
+
644
+ break;
645
+ }
646
+ case 'type_own_select':
647
+ {
648
+ $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_checked', 'w_choices_disabled','w_required','w_class');
649
+ $temp=$params;
650
+ foreach($params_names as $params_name )
651
+ {
652
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
653
+ $param[$params_name] = $temp[0];
654
+ $temp=$temp[1];
655
+ }
656
+
657
+ if($temp)
658
+ {
659
+ $temp =explode('*:*w_attr_name*:*',$temp);
660
+ $attrs = array_slice($temp,0, count($temp)-1);
661
+ foreach($attrs as $attr)
662
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
663
+ }
664
+
665
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
666
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
667
+ $param['w_choices'] = explode('***',$param['w_choices']);
668
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
669
+ $param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
670
+
671
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
672
+ {
673
+ if($choices_checked=='true')
674
+ $param['w_choices_checked'][$key]='selected="selected"';
675
+ else
676
+ $param['w_choices_checked'][$key]='';
677
+ }
678
+
679
+ $rep='<div id="wdform_field'.$id.'" type="type_own_select" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; "><input type="hidden" value="type_own_select" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><select id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" onchange="set_select(this)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].'>';
680
+ foreach($param['w_choices'] as $key => $choice)
681
+ {
682
+ if($param['w_choices_disabled'][$key]=="true")
683
+ $choice_value='';
684
+ else
685
+ $choice_value=$choice;
686
+ $rep.='<option id="'.$id.'_option'.$key.'" value="'.$choice_value.'" onselect="set_select(&quot;'.$id.'_option'.$key.'&quot;)" '.$param['w_choices_checked'][$key].'>'.$choice.'</option>';
687
+ }
688
+ $rep.='</select></div></div>';
689
+ break;
690
+ }
691
+
692
+ case 'type_country':
693
+ {
694
+ $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_countries','w_required','w_class');
695
+ $temp=$params;
696
+ foreach($params_names as $params_name )
697
+ {
698
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
699
+ $param[$params_name] = $temp[0];
700
+ $temp=$temp[1];
701
+ }
702
+
703
+ if($temp)
704
+ {
705
+ $temp =explode('*:*w_attr_name*:*',$temp);
706
+ $attrs = array_slice($temp,0, count($temp)-1);
707
+ foreach($attrs as $attr)
708
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
709
+ }
710
+
711
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
712
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
713
+ $param['w_countries'] = explode('***',$param['w_countries']);
714
+
715
+ $rep='<div id="wdform_field'.$id.'" type="type_country" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; "><input type="hidden" value="type_country" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><select id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" style="width: '.$param['w_size'].'px;" '.$param['attributes'].'>';
716
+ foreach($param['w_countries'] as $key => $choice)
717
+ {
718
+ $choice_value=$choice;
719
+ $rep.='<option value="'.$choice_value.'">'.$choice.'</option>';
720
+ }
721
+ $rep.='</select></div></div>';
722
+ break;
723
+ }
724
+
725
+ case 'type_time':
726
+ {
727
+ $params_names=array('w_field_label_size','w_field_label_pos','w_time_type','w_am_pm','w_sec','w_hh','w_mm','w_ss','w_mini_labels','w_required','w_class');
728
+ $temp=$params;
729
+ foreach($params_names as $params_name )
730
+ {
731
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
732
+ $param[$params_name] = $temp[0];
733
+ $temp=$temp[1];
734
+ }
735
+
736
+ if($temp)
737
+ {
738
+ $temp =explode('*:*w_attr_name*:*',$temp);
739
+ $attrs = array_slice($temp,0, count($temp)-1);
740
+ foreach($attrs as $attr)
741
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
742
+ }
743
+
744
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
745
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
746
+
747
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
748
+
749
+
750
+ if($param['w_sec']=='1')
751
+ {
752
+ $w_sec = '<div align="center" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;">&nbsp;:&nbsp;</span></div><div id="'.$id.'_td_time_input3" style="width: 32px; display: table-cell;"><input type="text" value="'.$param['w_ss'].'" class="time_box" id="'.$id.'_ssform_id_temp" name="'.$id.'_ssform_id_temp" onkeypress="return check_second(event, &quot;'.$id.'_ssform_id_temp&quot;)" onkeyup="change_second(&quot;'.$id.'_ssform_id_temp&quot;)" onblur="add_0(&quot;'.$id.'_ssform_id_temp&quot;)" '.$param['attributes'].'></div>';
753
+ $w_sec_label='<div style="display: table-cell;"></div><div id="'.$id.'_td_time_label3" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_ss">'.$w_mini_labels[2].'</label></div>';
754
+ }
755
+ else
756
+ {
757
+ $w_sec = '';
758
+ $w_sec_label='';
759
+ }
760
+
761
+ if($param['w_time_type']=='12')
762
+ {
763
+ if($param['w_am_pm']=='am')
764
+ {
765
+ $am_ = "selected=\"selected\"";
766
+ $pm_ = "";
767
+ }
768
+ else
769
+ {
770
+ $am_ = "";
771
+ $pm_ = "selected=\"selected\"";
772
+
773
+ }
774
+
775
+ $w_time_type = '<div id="'.$id.'_am_pm_select" class="td_am_pm_select" style="display: table-cell;"><select class="am_pm_select" name="'.$id.'_am_pmform_id_temp" id="'.$id.'_am_pmform_id_temp" onchange="set_sel_am_pm(this)" '.$param['attributes'].'><option value="am" '.$am_.'>AM</option><option value="pm" '.$pm_.'>PM</option></select></div>';
776
+
777
+ $w_time_type_label = '<div id="'.$id.'_am_pm_label" class="td_am_pm_select" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_am_pm">'.$w_mini_labels[3].'</label></div>';
778
+
779
+ }
780
+ else
781
+ {
782
+ $w_time_type='';
783
+ $w_time_type_label = '';
784
+ }
785
+
786
+
787
+ $rep ='<div id="wdform_field'.$id.'" type="type_time" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_time" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><div id="'.$id.'_table_time" style="display: table;"><div id="'.$id.'_tr_time1" style="display: table-row;"><div id="'.$id.'_td_time_input1" style="width: 32px; display: table-cell;"><input type="text" value="'.$param['w_hh'].'" class="time_box" id="'.$id.'_hhform_id_temp" name="'.$id.'_hhform_id_temp" onkeypress="return check_hour(event, &quot;'.$id.'_hhform_id_temp&quot;, &quot;23&quot;)" onkeyup="change_hour(event, &quot;'.$id.'_hhform_id_temp&quot;,&quot;23&quot;)" onblur="add_0(&quot;'.$id.'_hhform_id_temp&quot;)" '.$param['attributes'].'></div><div align="center" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;">&nbsp;:&nbsp;</span></div><div id="'.$id.'_td_time_input2" style="width: 32px; display: table-cell;"><input type="text" value="'.$param['w_mm'].'" class="time_box" id="'.$id.'_mmform_id_temp" name="'.$id.'_mmform_id_temp" onkeypress="return check_minute(event, &quot;'.$id.'_mmform_id_temp&quot;)" onkeyup="change_minute(event, &quot;'.$id.'_mmform_id_temp&quot;)" onblur="add_0(&quot;'.$id.'_mmform_id_temp&quot;)" '.$param['attributes'].'></div>'.$w_sec.$w_time_type.'</div><div id="'.$id.'_tr_time2" style="display: table-row;"><div id="'.$id.'_td_time_label1" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_hh">'.$w_mini_labels[0].'</label></div><div style="display: table-cell;"></div><div id="'.$id.'_td_time_label2" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_mm">'.$w_mini_labels[1].'</label></div>'.$w_sec_label.$w_time_type_label.'</div></div></div></div>';
788
+
789
+ break;
790
+ }
791
+ case 'type_date':
792
+ {
793
+ $params_names=array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val');
794
+ $temp=$params;
795
+ foreach($params_names as $params_name )
796
+ {
797
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
798
+ $param[$params_name] = $temp[0];
799
+ $temp=$temp[1];
800
+ }
801
+
802
+ if($temp)
803
+ {
804
+ $temp =explode('*:*w_attr_name*:*',$temp);
805
+ $attrs = array_slice($temp,0, count($temp)-1);
806
+ foreach($attrs as $attr)
807
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
808
+ }
809
+
810
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
811
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
812
+
813
+
814
+
815
+ $rep ='<div id="wdform_field'.$id.'" type="type_date" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_date" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="text" value="'.$param['w_date'].'" class="wdform-date" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" maxlength="10" size="10" onchange="change_value(&quot;'.$id.'_elementform_id_temp&quot;)" '.$param['attributes'].'><input id="'.$id.'_buttonform_id_temp" class="button" type="reset" value="'.$param['w_but_val'].'" format="'.$param['w_format'].'" src="templates/bluestork/images/system/calendar.png" alt="calendario" '.$param['attributes'].' onclick="return showCalendar(&quot;'.$id.'_elementform_id_temp&quot; , &quot;'.$param['w_format'].'&quot;)"></div></div>';
816
+
817
+ break;
818
+ }
819
+ case 'type_date_fields':
820
+ {
821
+ $params_names=array('w_field_label_size','w_field_label_pos','w_day','w_month','w_year','w_day_type','w_month_type','w_year_type','w_day_label','w_month_label','w_year_label','w_day_size','w_month_size','w_year_size','w_required','w_class','w_from','w_to','w_divider');
822
+
823
+ $temp=$params;
824
+ foreach($params_names as $params_name )
825
+ {
826
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
827
+ $param[$params_name] = $temp[0];
828
+ $temp=$temp[1];
829
+ }
830
+
831
+ if($temp)
832
+ {
833
+ $temp =explode('*:*w_attr_name*:*',$temp);
834
+ $attrs = array_slice($temp,0, count($temp)-1);
835
+ foreach($attrs as $attr)
836
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
837
+ }
838
+
839
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
840
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
841
+
842
+
843
+ if($param['w_day_type']=="SELECT")
844
+ {
845
+
846
+
847
+ $w_day_type = '<select id="'.$id.'_dayform_id_temp" name="'.$id.'_dayform_id_temp" onchange="set_select(this)" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].'><option value=""></option>';
848
+ for($k=0; $k<=31; $k++)
849
+ {
850
+ if($k<10)
851
+ {
852
+ if($param['w_day']=='0'.$k)
853
+ $selected = "selected=\"selected\"";
854
+ else
855
+ $selected = "";
856
+
857
+ $w_day_type .= '<option value="0'.$k.'" '.$selected.'>0'.$k.'</option>';
858
+ }
859
+ else
860
+ {
861
+ if($param['w_day']==''.$k)
862
+ $selected = "selected=\"selected\"";
863
+ else
864
+ $selected = "";
865
+
866
+ $w_day_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
867
+ }
868
+
869
+
870
+
871
+ }
872
+ $w_day_type .= '</select>';
873
+ }
874
+ else
875
+ {
876
+ $w_day_type = '<input type="text" value="'.$param['w_day'].'" id="'.$id.'_dayform_id_temp" name="'.$id.'_dayform_id_temp" onchange="change_value(&quot;'.$id.'_dayform_id_temp&quot;)" onkeypress="return check_day(event, &quot;'.$id.'_dayform_id_temp&quot;)" onblur="if (this.value==&quot;0&quot;) this.value=""; else add_0(&quot;'.$id.'_dayform_id_temp&quot;)" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].'>';
877
+ }
878
+
879
+ if($param['w_month_type']=="SELECT")
880
+ {
881
+
882
+ $w_month_type = '<select id="'.$id.'_monthform_id_temp" name="'.$id.'_monthform_id_temp" onchange="set_select(this)" style="width: '.$param['w_month_size'].'px;" '.$param['attributes'].'><option value=""></option><option value="01" '.($param['w_month']=="01" ? "selected=\"selected\"": "").' ><!--repstart-->January<!--repend--></option><option value="02" '.($param['w_month']=="02" ? "selected=\"selected\"": "").'><!--repstart-->February<!--repend--></option><option value="03" '.($param['w_month']=="03"? "selected=\"selected\"": "").'><!--repstart-->March<!--repend--></option><option value="04" '.($param['w_month']=="04" ? "selected=\"selected\"": "").' ><!--repstart-->April<!--repend--></option><option value="05" '.($param['w_month']=="05" ? "selected=\"selected\"": "").' ><!--repstart-->May<!--repend--></option><option value="06" '.($param['w_month']=="06" ? "selected=\"selected\"": "").' ><!--repstart-->June<!--repend--></option><option value="07" '.($param['w_month']=="07" ? "selected=\"selected\"": "").' ><!--repstart-->July<!--repend--></option><option value="08" '.($param['w_month']=="08" ? "selected=\"selected\"": "").' ><!--repstart-->August<!--repend--></option><option value="09" '.($param['w_month']=="09" ? "selected=\"selected\"": "").' ><!--repstart-->September<!--repend--></option><option value="10" '.($param['w_month']=="10" ? "selected=\"selected\"": "").' ><!--repstart-->October<!--repend--></option><option value="11" '.($param['w_month']=="11" ? "selected=\"selected\"": "").'><!--repstart-->November<!--repend--></option><option value="12" '.($param['w_month']=="12" ? "selected=\"selected\"": "").' ><!--repstart-->December<!--repend--></option></select>';
883
+
884
+ }
885
+ else
886
+ {
887
+ $w_month_type = '<input type="text" value="'.$param['w_month'].'" id="'.$id.'_monthform_id_temp" name="'.$id.'_monthform_id_temp" onkeypress="return check_month(event, &quot;'.$id.'_monthform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_monthform_id_temp&quot;)" onblur="if (this.value==&quot;0&quot;) this.value=""; else add_0(&quot;'.$id.'_monthform_id_temp&quot;)" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].'>';
888
+
889
+ }
890
+
891
+ if($param['w_year_type']=="SELECT")
892
+ {
893
+ $w_year_type = '<select id="'.$id.'_yearform_id_temp" name="'.$id.'_yearform_id_temp" onchange="set_select(this)" from="'.$param['w_from'].'" to="'.$param['w_to'].'" style="width: '.$param['w_year_size'].'px;" '.$param['attributes'].'><option value=""></option>';
894
+ for($k=$param['w_to']; $k>=$param['w_from']; $k--)
895
+ {
896
+ if($param['w_year']==$k)
897
+ $selected = "selected=\"selected\"";
898
+ else
899
+ $selected = "";
900
+
901
+ $w_year_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
902
+ }
903
+ $w_year_type .= '</select>';
904
+
905
+ }
906
+ else
907
+ {
908
+ $w_year_type = '<input type="text" value="'.$param['w_year'].'" id="'.$id.'_yearform_id_temp" name="'.$id.'_yearform_id_temp" onchange="change_year(&quot;'.$id.'_yearform_id_temp&quot;)" onkeypress="return check_year1(event, &quot;'.$id.'_yearform_id_temp&quot;)" onblur="check_year2(&quot;'.$id.'_yearform_id_temp&quot;)" from="'.$param['w_from'].'" to="'.$param['w_to'].'" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].'>';
909
+ }
910
+
911
+
912
+ $rep ='<div id="wdform_field'.$id.'" type="type_date_fields" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_date_fields" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><div id="'.$id.'_table_date" style="display: table;"><div id="'.$id.'_tr_date1" style="display: table-row;"><div id="'.$id.'_td_date_input1" style="display: table-cell;">
913
+ '.$w_day_type.'
914
+
915
+ </div><div id="'.$id.'_td_date_separator1" style="display: table-cell;"><span id="'.$id.'_separator1" class="wdform_separator">'.$param['w_divider'].'</span></div><div id="'.$id.'_td_date_input2" style="display: table-cell;">'.$w_month_type.'</div><div id="'.$id.'_td_date_separator2" style="display: table-cell;"><span id="'.$id.'_separator2" class="wdform_separator">'.$param['w_divider'].'</span></div><div id="'.$id.'_td_date_input3" style="display: table-cell;">'.$w_year_type.'</div></div><div id="'.$id.'_tr_date2" style="display: table-row;"><div id="'.$id.'_td_date_label1" style="display: table-cell;"><label class="mini_label" id="'.$id.'_day_label">'.$param['w_day_label'].'</label></div><div style="display: table-cell;"></div><div id="'.$id.'_td_date_label2" style="display: table-cell;"><label class="mini_label" id="'.$id.'_month_label">'.$param['w_month_label'].'</label></div><div style="display: table-cell;"></div><div id="'.$id.'_td_date_label3" style="display: table-cell;"><label class="mini_label" id="'.$id.'_year_label">'.$param['w_year_label'].'</label></div></div></div></div></div>';
916
+
917
+ break;
918
+ }
919
+ case 'type_file_upload':
920
+ {
921
+ $params_names=array('w_field_label_size','w_field_label_pos','w_destination','w_extension','w_max_size','w_required','w_multiple','w_class');
922
+ $temp=$params;
923
+ foreach($params_names as $params_name )
924
+ {
925
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
926
+ $param[$params_name] = $temp[0];
927
+ if (isset($temp[1])) {
928
+ $temp = $temp[1];
929
+ }
930
+ else {
931
+ $temp = '';
932
+ }
933
+ }
934
+
935
+ if($temp)
936
+ {
937
+ $temp =explode('*:*w_attr_name*:*',$temp);
938
+ $attrs = array_slice($temp,0, count($temp)-1);
939
+ foreach($attrs as $attr)
940
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
941
+ }
942
+
943
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
944
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
945
+ $multiple = ($param['w_multiple']=="yes" ? "multiple='multiple'" : "");
946
+
947
+ $rep ='<div id="wdform_field'.$id.'" type="type_file_upload" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_file_upload" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="***max_sizeskizb'.$id.'***'.$param['w_max_size'].'***max_sizeverj'.$id.'***" id="'.$id.'_max_size" name="'.$id.'_max_size"><input type="hidden" value="***destinationskizb'.$id.'***'.$param['w_destination'].'***destinationverj'.$id.'***" id="'.$id.'_destination" name="'.$id.'_destination"><input type="hidden" value="***extensionskizb'.$id.'***'.$param['w_extension'].'***extensionverj'.$id.'***" id="'.$id.'_extension" name="'.$id.'_extension"><input type="file" class="file_upload" id="'.$id.'_elementform_id_temp" name="'.$id.'_fileform_id_temp" '.$multiple.' '.$param['attributes'].'/></div></div>';
948
+
949
+ break;
950
+ }
951
+ case 'type_captcha':
952
+ {
953
+ $params_names=array('w_field_label_size','w_field_label_pos','w_digit','w_class');
954
+ $temp=$params;
955
+ foreach($params_names as $params_name )
956
+ {
957
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
958
+ $param[$params_name] = $temp[0];
959
+ $temp=$temp[1];
960
+ }
961
+
962
+ if($temp)
963
+ {
964
+ $temp =explode('*:*w_attr_name*:*',$temp);
965
+ $attrs = array_slice($temp,0, count($temp)-1);
966
+ foreach($attrs as $attr)
967
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
968
+ }
969
+
970
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
971
+
972
+ $rep ='<div id="wdform_field'.$id.'" type="type_captcha" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display:'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_captcha" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div style="display: table;"><div style="display: table-row;"><div valign="middle" style="display: table-cell;"><img type="captcha" digit="'.$param['w_digit'].'" src="' . add_query_arg(array('action' => 'formcontactwdcaptcha', 'digit' => $param['w_digit'], 'i' => 'form_id_temp'), admin_url('admin-ajax.php')) . '" id="_wd_captchaform_id_temp" class="captcha_img" onclick="captcha_refresh(&quot;_wd_captcha&quot;,&quot;form_id_temp&quot;)" '.$param['attributes'].'></div><div valign="middle" style="display: table-cell;"><div class="captcha_refresh" id="_element_refreshform_id_temp" onclick="captcha_refresh(&quot;_wd_captcha&quot;,&quot;form_id_temp&quot;)" '.$param['attributes'].'></div></div></div><div style="display: table-row;"><div style="display: table-cell;"><input type="text" class="captcha_input" id="_wd_captcha_inputform_id_temp" name="captcha_input" style="width: '.($param['w_digit']*10+15).'px;" '.$param['attributes'].'></div></div></div></div></div>';
973
+
974
+ break;
975
+ }
976
+ case 'type_recaptcha':
977
+ {
978
+ $params_names=array('w_field_label_size','w_field_label_pos','w_public','w_private','w_theme','w_class');
979
+ $temp=$params;
980
+ foreach($params_names as $params_name )
981
+ {
982
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
983
+ $param[$params_name] = $temp[0];
984
+ $temp=$temp[1];
985
+ }
986
+
987
+ if($temp)
988
+ {
989
+ $temp =explode('*:*w_attr_name*:*',$temp);
990
+ $attrs = array_slice($temp,0, count($temp)-1);
991
+ foreach($attrs as $attr)
992
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
993
+ }
994
+
995
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
996
+
997
+ $rep ='<div id="wdform_field'.$id.'" type="type_recaptcha" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_recaptcha" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div id="wd_recaptchaform_id_temp" public_key="'.$param['w_public'].'" private_key="'.$param['w_private'].'" theme="'.$param['w_theme'].'" '.$param['attributes'].'><span style="color: red; font-style: italic;">Recaptcha doesn\'t display in back end</span></div></div></div>';
998
+
999
+ break;
1000
+ }
1001
+
1002
+ case 'type_hidden':
1003
+ {
1004
+ $params_names=array('w_name','w_value');
1005
+ $temp=$params;
1006
+ foreach($params_names as $params_name )
1007
+ {
1008
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1009
+ $param[$params_name] = $temp[0];
1010
+ $temp=$temp[1];
1011
+ }
1012
+
1013
+ if($temp)
1014
+ {
1015
+ $temp =explode('*:*w_attr_name*:*',$temp);
1016
+ $attrs = array_slice($temp,0, count($temp)-1);
1017
+ foreach($attrs as $attr)
1018
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1019
+ }
1020
+ $param['w_name'] = str_replace('&nbsp;','',$param['w_name']);
1021
+ $rep ='<div id="wdform_field'.$id.'" type="type_hidden" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" style="display: table-cell;"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">'.$param['w_name'].'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" style="display: table-cell;"><input type="hidden" value="'.$param['w_value'].'" id="'.$id.'_elementform_id_temp" name="'.$param['w_name'].'" '.$param['attributes'].'><input type="hidden" value="type_hidden" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"></div></div>';
1022
+
1023
+ break;
1024
+ }
1025
+ case 'type_mark_map':
1026
+ {
1027
+ $params_names=array('w_field_label_size','w_field_label_pos','w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class');
1028
+ $temp=$params;
1029
+ foreach($params_names as $params_name )
1030
+ {
1031
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1032
+ $param[$params_name] = $temp[0];
1033
+ $temp=$temp[1];
1034
+ }
1035
+
1036
+ if($temp)
1037
+ {
1038
+ $temp =explode('*:*w_attr_name*:*',$temp);
1039
+ $attrs = array_slice($temp,0, count($temp)-1);
1040
+ foreach($attrs as $attr)
1041
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1042
+ }
1043
+
1044
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1045
+
1046
+ $rep ='<div id="wdform_field'.$id.'" type="type_mark_map" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="vertical-align: top; display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_mark_map" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div id="'.$id.'_elementform_id_temp" long0="'.$param['w_long'].'" lat0="'.$param['w_lat'].'" zoom="'.$param['w_zoom'].'" info0="'.$param['w_info'].'" center_x="'.$param['w_center_x'].'" center_y="'.$param['w_center_y'].'" style="width: '.$param['w_width'].'px; height: '.$param['w_height'].'px;" '.$param['attributes'].'></div></div></div> ';
1047
+
1048
+ break;
1049
+ }
1050
+
1051
+ case 'type_map':
1052
+ {
1053
+ $params_names=array('w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class');
1054
+ $temp=$params;
1055
+ foreach($params_names as $params_name )
1056
+ {
1057
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1058
+ $param[$params_name] = $temp[0];
1059
+ $temp=$temp[1];
1060
+ }
1061
+
1062
+ if($temp)
1063
+ {
1064
+ $temp =explode('*:*w_attr_name*:*',$temp);
1065
+ $attrs = array_slice($temp,0, count($temp)-1);
1066
+ foreach($attrs as $attr)
1067
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1068
+ }
1069
+
1070
+ $marker='';
1071
+
1072
+ $param['w_long'] = explode('***',$param['w_long']);
1073
+ $param['w_lat'] = explode('***',$param['w_lat']);
1074
+ $param['w_info'] = explode('***',$param['w_info']);
1075
+ foreach($param['w_long'] as $key => $w_long )
1076
+ {
1077
+ $marker.='long'.$key.'="'.$w_long.'" lat'.$key.'="'.$param['w_lat'][$key].'" info'.$key.'="'.$param['w_info'][$key].'"';
1078
+ }
1079
+
1080
+ $rep ='<div id="wdform_field'.$id.'" type="type_map" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><input type="hidden" value="type_map" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div id="'.$id.'_elementform_id_temp" zoom="'.$param['w_zoom'].'" center_x="'.$param['w_center_x'].'" center_y="'.$param['w_center_y'].'" style="width: '.$param['w_width'].'px; height: '.$param['w_height'].'px;" '.$marker.' '.$param['attributes'].'></div></div></div>';
1081
+
1082
+ break;
1083
+ }
1084
+ case 'type_paypal_price':
1085
+ {
1086
+
1087
+ $params_names=array('w_field_label_size','w_field_label_pos','w_first_val','w_title', 'w_mini_labels','w_size','w_required','w_hide_cents','w_class','w_range_min','w_range_max');
1088
+ $temp=$params;
1089
+ foreach($params_names as $params_name )
1090
+ {
1091
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1092
+ $param[$params_name] = $temp[0];
1093
+ $temp=$temp[1];
1094
+ }
1095
+
1096
+ if($temp)
1097
+ {
1098
+ $temp =explode('*:*w_attr_name*:*',$temp);
1099
+ $attrs = array_slice($temp,0, count($temp)-1);
1100
+ foreach($attrs as $attr)
1101
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1102
+ }
1103
+
1104
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1105
+ $input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
1106
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1107
+ $hide_cents = ($param['w_hide_cents']=="yes" ? "none;" : "table-cell;");
1108
+
1109
+
1110
+ $w_first_val = explode('***',$param['w_first_val']);
1111
+ $w_title = explode('***',$param['w_title']);
1112
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
1113
+
1114
+ $rep ='<div id="wdform_field'.$id.'" type="type_paypal_price" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required"style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_paypal_price" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_range_min'].'" name="'.$id.'_range_minform_id_temp" id="'.$id.'_range_minform_id_temp"><input type="hidden" value="'.$param['w_range_max'].'" name="'.$id.'_range_maxform_id_temp" id="'.$id.'_range_maxform_id_temp"><div id="'.$id.'_table_price" style="display: table;"><div id="'.$id.'_tr_price1" style="display: table-row;"><div id="'.$id.'_td_name_currency" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;"><!--repstart-->&nbsp;$&nbsp;<!--repend--></span></div><div id="'.$id.'_td_name_dollars" style="display: table-cell;"><input type="text" class="'.$input_active.'" id="'.$id.'_element_dollarsform_id_temp" name="'.$id.'_element_dollarsform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'"onfocus="delete_value(&quot;'.$id.'_element_dollarsform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_dollarsform_id_temp&quot;)"onchange="change_value(&quot;'.$id.'_element_dollarsform_id_temp&quot;)" onkeypress="return check_isnum(event)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].'></div><div id="'.$id.'_td_name_divider" style="display: '.$hide_cents.';"><span class="wdform_colon" style="vertical-align: middle;">&nbsp;.&nbsp;</span></div><div id="'.$id.'_td_name_cents" style="display: '.$hide_cents.'"><input type="text" class="'.$input_active.'" id="'.$id.'_element_centsform_id_temp" name="'.$id.'_element_centsform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'"onfocus="delete_value(&quot;'.$id.'_element_centsform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_centsform_id_temp&quot;); add_0(&quot;'.$id.'_element_centsform_id_temp&quot;)"onchange="change_value(&quot;'.$id.'_element_centsform_id_temp&quot;)" onkeypress="return check_isnum_interval(event,&quot;'.$id.'_element_centsform_id_temp&quot;,0,99)"style="width: 30px;" '.$param['attributes'].'></div></div><div id="'.$id.'_tr_price2" style="display: table-row;"><div style="display: table-cell;"><label class="mini_label"></label></div><div align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_dollars">'.$w_mini_labels[0].'</label></div><div id="'.$id.'_td_name_label_divider" style="display: '.$hide_cents.'"><label class="mini_label"></label></div><div align="left" id="'.$id.'_td_name_label_cents" style="display: '.$hide_cents.'"><label class="mini_label" id="'.$id.'_mini_label_cents">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
1115
+ break;
1116
+ }
1117
+
1118
+ case 'type_paypal_select':
1119
+ {
1120
+ $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_price','w_choices_checked', 'w_choices_disabled','w_required','w_quantity', 'w_quantity_value','w_class','w_property','w_property_values');
1121
+ $temp=$params;
1122
+ foreach($params_names as $params_name )
1123
+ {
1124
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1125
+ $param[$params_name] = $temp[0];
1126
+ $temp=$temp[1];
1127
+ }
1128
+
1129
+ if($temp)
1130
+ {
1131
+ $temp =explode('*:*w_attr_name*:*',$temp);
1132
+ $attrs = array_slice($temp,0, count($temp)-1);
1133
+ foreach($attrs as $attr)
1134
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1135
+ }
1136
+
1137
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1138
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1139
+ $param['w_choices'] = explode('***',$param['w_choices']);
1140
+
1141
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1142
+
1143
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1144
+
1145
+ $param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
1146
+ $param['w_property'] = explode('***',$param['w_property']);
1147
+ $param['w_property_values'] = explode('***',$param['w_property_values']);
1148
+
1149
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
1150
+ {
1151
+ if($choices_checked=='true')
1152
+ $param['w_choices_checked'][$key]='selected="selected"';
1153
+ else
1154
+ $param['w_choices_checked'][$key]='';
1155
+ }
1156
+
1157
+
1158
+ $rep='<div id="wdform_field'.$id.'" type="type_paypal_select" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; "><input type="hidden" value="type_paypal_select" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><select id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" onchange="set_select(this)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].'>';
1159
+ foreach($param['w_choices'] as $key => $choice)
1160
+ {
1161
+ if($param['w_choices_disabled'][$key]=="true")
1162
+ $choice_value='';
1163
+ else
1164
+ $choice_value=$param['w_choices_price'][$key];
1165
+ $rep.='<option id="'.$id.'_option'.$key.'" value="'.$choice_value.'" onselect="set_select(&quot;'.$id.'_option'.$key.'&quot;)" '.$param['w_choices_checked'][$key].'>'.$choice.'</option>';
1166
+ }
1167
+ $rep.='</select><div id="'.$id.'_divform_id_temp">';
1168
+ if($param['w_quantity']=="yes")
1169
+ $rep.='<span id="'.$id.'_element_quantity_spanform_id_temp" style="margin-right: 15px;"><label class="mini_label" id="'.$id.'_element_quantity_label_form_id_temp" style="margin-right: 5px;"><!--repstart-->Quantity<!--repend--></label><input type="text" value="'.$param['w_quantity_value'].'" id="'.$id.'_element_quantityform_id_temp" name="'.$id.'_element_quantityform_id_temp" onkeypress="return check_isnum(event)" onchange="change_value(&quot;'.$id.'_element_quantityform_id_temp&quot;, this.value)" style="width: 30px; margin: 2px 0px;"></span>';
1170
+ if($param['w_property'][0])
1171
+ foreach($param['w_property'] as $key => $property)
1172
+ {
1173
+
1174
+ $rep.='
1175
+ <span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
1176
+
1177
+ <label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
1178
+ <select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;">';
1179
+ $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
1180
+ $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
1181
+ foreach($param['w_property_values'][$key] as $subkey => $property_value)
1182
+ {
1183
+ $rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
1184
+ }
1185
+ $rep.='</select></span>';
1186
+ }
1187
+
1188
+ $rep.='</div></div></div>';
1189
+ break;
1190
+ }
1191
+
1192
+ case 'type_paypal_checkbox':
1193
+ {
1194
+
1195
+ $params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_class','w_property','w_property_values','w_quantity','w_quantity_value');
1196
+ $temp=$params;
1197
+ foreach($params_names as $params_name )
1198
+ {
1199
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1200
+ $param[$params_name] = $temp[0];
1201
+ $temp=$temp[1];
1202
+ }
1203
+
1204
+ if($temp)
1205
+ {
1206
+ $temp =explode('*:*w_attr_name*:*',$temp);
1207
+ $attrs = array_slice($temp,0, count($temp)-1);
1208
+ foreach($attrs as $attr)
1209
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1210
+ }
1211
+
1212
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1213
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1214
+ $param['w_choices'] = explode('***',$param['w_choices']);
1215
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1216
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1217
+ $param['w_property'] = explode('***',$param['w_property']);
1218
+ $param['w_property_values'] = explode('***',$param['w_property_values']);
1219
+
1220
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
1221
+ {
1222
+ if($choices_checked=='true')
1223
+ $param['w_choices_checked'][$key]='checked="checked"';
1224
+ else
1225
+ $param['w_choices_checked'][$key]='';
1226
+ }
1227
+
1228
+ $rep='<div id="wdform_field'.$id.'" type="type_paypal_checkbox" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_paypal_checkbox" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
1229
+
1230
+ if($param['w_flow']=='hor')
1231
+ {
1232
+ $rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
1233
+ foreach($param['w_choices'] as $key => $choice)
1234
+ {
1235
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key)
1236
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="checkbox" other="1" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp'.$key.'" value="'.$param['w_choices_price'][$key].'" onclick="if(set_checked(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div>';
1237
+ else
1238
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="checkbox" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp'.$key.'" value="'.$param['w_choices_price'][$key].'" onclick="set_checked(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div>';
1239
+ }
1240
+ $rep.= '</div>';
1241
+ }
1242
+ else
1243
+ {
1244
+ $rep.= '<div id="'.$id.'_table_little" style="display: table-row-group;">';
1245
+ foreach($param['w_choices'] as $key => $choice)
1246
+ {
1247
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key)
1248
+ $rep.='<div id="'.$id.'_element_tr'.$key.'" style="display: table-row;"><div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="checkbox" value="'.$param['w_choices_price'][$key].'" other="1" id="'.$id.'_elementform_id_temp'.$key.'" onclick="if(set_checked(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" name="'.$id.'_elementform_id_temp'.$key.'" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div></div>';
1249
+ else
1250
+ $rep.='<div id="'.$id.'_element_tr'.$key.'" style="display: table-row;"><div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="checkbox" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp'.$key.'" value="'.$param['w_choices_price'][$key].'" onclick="set_checked(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div></div>'; }
1251
+ $rep.= '</div>';
1252
+ }
1253
+ $rep.='</div></div>';
1254
+
1255
+ $rep.='<div id="'.$id.'_divform_id_temp">';
1256
+ if($param['w_quantity']=="yes")
1257
+ $rep.='<span id="'.$id.'_element_quantity_spanform_id_temp" style="margin-right: 15px;"><label class="mini_label" id="'.$id.'_element_quantity_label_form_id_temp" style="margin-right: 5px;"><!--repstart-->Quantity<!--repend--></label><input type="text" value="'.$param['w_quantity_value'].'" id="'.$id.'_element_quantityform_id_temp" name="'.$id.'_element_quantityform_id_temp" onkeypress="return check_isnum(event)" onchange="change_value(&quot;'.$id.'_element_quantityform_id_temp&quot;, this.value)" style="width: 30px; margin: 2px 0px;"></span>';
1258
+ if($param['w_property'][0])
1259
+ foreach($param['w_property'] as $key => $property)
1260
+ {
1261
+ $rep.='
1262
+ <span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
1263
+
1264
+ <label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
1265
+ <select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;">';
1266
+ $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
1267
+ $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
1268
+ foreach($param['w_property_values'][$key] as $subkey => $property_value)
1269
+ {
1270
+ $rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
1271
+ }
1272
+ $rep.='</select></span>';
1273
+ }
1274
+
1275
+ $rep.='</div></div></div>';
1276
+ break;
1277
+ }
1278
+ case 'type_paypal_radio':
1279
+ {
1280
+
1281
+ $params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_class','w_property','w_property_values','w_quantity','w_quantity_value');
1282
+ $temp=$params;
1283
+ foreach($params_names as $params_name )
1284
+ {
1285
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1286
+ $param[$params_name] = $temp[0];
1287
+ $temp=$temp[1];
1288
+ }
1289
+
1290
+ if($temp)
1291
+ {
1292
+ $temp =explode('*:*w_attr_name*:*',$temp);
1293
+ $attrs = array_slice($temp,0, count($temp)-1);
1294
+ foreach($attrs as $attr)
1295
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1296
+ }
1297
+
1298
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1299
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1300
+ $param['w_choices'] = explode('***',$param['w_choices']);
1301
+
1302
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1303
+
1304
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1305
+
1306
+ $param['w_property'] = explode('***',$param['w_property']);
1307
+ $param['w_property_values'] = explode('***',$param['w_property_values']);
1308
+
1309
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
1310
+ {
1311
+ if($choices_checked=='true')
1312
+ $param['w_choices_checked'][$key]='checked="checked"';
1313
+ else
1314
+ $param['w_choices_checked'][$key]='';
1315
+ }
1316
+
1317
+ $rep='<div id="wdform_field'.$id.'" type="type_paypal_radio" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_paypal_radio" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
1318
+
1319
+ if($param['w_flow']=='hor')
1320
+ {
1321
+ $rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
1322
+ foreach($param['w_choices'] as $key => $choice)
1323
+ {
1324
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key)
1325
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" other="1" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div>';
1326
+ else
1327
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div>';
1328
+ }
1329
+ $rep.= '</div>';
1330
+ }
1331
+ else
1332
+ {
1333
+ $rep.= '<div id="'.$id.'_table_little" style="display: table-row-group;">';
1334
+ foreach($param['w_choices'] as $key => $choice)
1335
+ {
1336
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key)
1337
+ $rep.='<div id="'.$id.'_element_tr'.$key.'" style="display: table-row;"><div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices_price'][$key].'" other="1" id="'.$id.'_elementform_id_temp'.$key.'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" name="'.$id.'_elementform_id_temp" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div></div>';
1338
+ else
1339
+ $rep.='<div id="'.$id.'_element_tr'.$key.'" style="display: table-row;"><div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div></div>'; }
1340
+ $rep.= '</div>';
1341
+ }
1342
+ $rep.='</div></div>';
1343
+
1344
+ $rep.='<div id="'.$id.'_divform_id_temp">';
1345
+ if($param['w_quantity']=="yes")
1346
+ $rep.='<span id="'.$id.'_element_quantity_spanform_id_temp" style="margin-right: 15px;"><label class="mini_label" id="'.$id.'_element_quantity_label_form_id_temp" style="margin-right: 5px;"><!--repstart-->Quantity<!--repend--></label><input type="text" value="'.$param['w_quantity_value'].'" id="'.$id.'_element_quantityform_id_temp" name="'.$id.'_element_quantityform_id_temp" onkeypress="return check_isnum(event)" onchange="change_value(&quot;'.$id.'_element_quantityform_id_temp&quot;, this.value)" style="width: 30px; margin: 2px 0px;"></span>';
1347
+ if($param['w_property'][0])
1348
+ foreach($param['w_property'] as $key => $property)
1349
+ {
1350
+ $rep.='
1351
+ <span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
1352
+
1353
+ <label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
1354
+ <select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;">';
1355
+ $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
1356
+ $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
1357
+ foreach($param['w_property_values'][$key] as $subkey => $property_value)
1358
+ {
1359
+ $rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
1360
+ }
1361
+ $rep.='</select></span>';
1362
+ }
1363
+
1364
+ $rep.='</div></div></div>';
1365
+
1366
+ break;
1367
+ }
1368
+ case 'type_paypal_shipping':
1369
+ {
1370
+
1371
+ $params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_class');
1372
+ $temp=$params;
1373
+ foreach($params_names as $params_name )
1374
+ {
1375
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1376
+ $param[$params_name] = $temp[0];
1377
+ $temp=$temp[1];
1378
+ }
1379
+
1380
+ if($temp)
1381
+ {
1382
+ $temp =explode('*:*w_attr_name*:*',$temp);
1383
+ $attrs = array_slice($temp,0, count($temp)-1);
1384
+ foreach($attrs as $attr)
1385
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1386
+ }
1387
+
1388
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1389
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1390
+ $param['w_choices'] = explode('***',$param['w_choices']);
1391
+
1392
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1393
+
1394
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1395
+
1396
+
1397
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
1398
+ {
1399
+ if($choices_checked=='true')
1400
+ $param['w_choices_checked'][$key]='checked="checked"';
1401
+ else
1402
+ $param['w_choices_checked'][$key]='';
1403
+ }
1404
+
1405
+ $rep='<div id="wdform_field'.$id.'" type="type_paypal_shipping" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_paypal_shipping" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
1406
+
1407
+ if($param['w_flow']=='hor')
1408
+ {
1409
+ $rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
1410
+ foreach($param['w_choices'] as $key => $choice)
1411
+ {
1412
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key)
1413
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" other="1" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div>';
1414
+ else
1415
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div>';
1416
+ }
1417
+ $rep.= '</div>';
1418
+ }
1419
+ else
1420
+ {
1421
+ $rep.= '<div id="'.$id.'_table_little" style="display: table-row-group;">';
1422
+ foreach($param['w_choices'] as $key => $choice)
1423
+ {
1424
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key)
1425
+ $rep.='<div id="'.$id.'_element_tr'.$key.'" style="display: table-row;"><div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices_price'][$key].'" other="1" id="'.$id.'_elementform_id_temp'.$key.'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" name="'.$id.'_elementform_id_temp" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div></div>';
1426
+ else
1427
+ $rep.='<div id="'.$id.'_element_tr'.$key.'" style="display: table-row;"><div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div></div>'; }
1428
+ $rep.= '</div>';
1429
+ }
1430
+ $rep.='</div></div>';
1431
+
1432
+ $rep.='</div></div>';
1433
+
1434
+ break;
1435
+ }
1436
+ case 'type_paypal_total':
1437
+ {
1438
+ $params_names=array('w_field_label_size','w_field_label_pos','w_class');
1439
+ $temp=$params;
1440
+ foreach($params_names as $params_name )
1441
+ {
1442
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1443
+ $param[$params_name] = $temp[0];
1444
+ $temp=$temp[1];
1445
+ }
1446
+
1447
+ if($temp)
1448
+ {
1449
+ $temp =explode('*:*w_attr_name*:*',$temp);
1450
+ $attrs = array_slice($temp,0, count($temp)-1);
1451
+ foreach($attrs as $attr)
1452
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1453
+ }
1454
+
1455
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1456
+
1457
+
1458
+
1459
+ $rep='<div id="wdform_field'.$id.'" type="type_paypal_total" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_paypal_total" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div id="'.$id.'paypal_totalform_id_temp" class="wdform_paypal_total paypal_totalform_id_temp"><input type="hidden" value="" name="'.$id.'_paypal_totalform_id_temp" class="input_paypal_totalform_id_temp"><div id="'.$id.'div_totalform_id_temp" class="div_totalform_id_temp" style="margin-bottom: 10px;"><!--repstart-->$300<!--repend--></div><div id="'.$id.'paypal_productsform_id_temp" class="paypal_productsform_id_temp" style="border-spacing: 2px;"><div style="border-spacing: 2px;"><!--repstart-->product 1 $100<!--repend--></div><div style="border-spacing: 2px;"><!--repstart-->product 2 $200<!--repend--></div></div><div id="'.$id.'paypal_taxform_id_temp" class="paypal_taxform_id_temp" style="border-spacing: 2px; margin-top: 7px;"></div></div></div></div>';
1460
+
1461
+
1462
+ break;
1463
+ }
1464
+
1465
+ case 'type_star_rating':
1466
+ {
1467
+ $params_names=array('w_field_label_size','w_field_label_pos','w_field_label_col','w_star_amount','w_required','w_class');
1468
+ $temp=$params;
1469
+ foreach($params_names as $params_name )
1470
+ {
1471
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1472
+ $param[$params_name] = $temp[0];
1473
+ $temp=$temp[1];
1474
+ }
1475
+
1476
+ if($temp)
1477
+ {
1478
+ $temp =explode('*:*w_attr_name*:*',$temp);
1479
+ $attrs = array_slice($temp,0, count($temp)-1);
1480
+ foreach($attrs as $attr)
1481
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1482
+ }
1483
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1484
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1485
+
1486
+
1487
+ $images = '';
1488
+ for($i=0; $i<$param['w_star_amount']; $i++)
1489
+ {
1490
+ $images .= '<img id="'.$id.'_star_'.$i.'" src="' . WD_FMC_URL . '/images/star.png" onmouseover="change_src('.$i.','.$id.',&quot;form_id_temp&quot;)" onmouseout="reset_src('.$i.','.$id.')" onclick="select_star_rating('.$i.','.$id.', &quot;form_id_temp&quot;)">';
1491
+ }
1492
+
1493
+ $rep ='<div id="wdform_field'.$id.'" type="type_star_rating" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_star_rating" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_star_amount'].'" id="'.$id.'_star_amountform_id_temp" name="'.$id.'_star_amountform_id_temp"><input type="hidden" value="'.$param['w_field_label_col'].'" name="'.$id.'_star_colorform_id_temp" id="'.$id.'_star_colorform_id_temp"><div id="'.$id.'_elementform_id_temp" class="wdform_stars" '.$param['attributes'].'>'.$images.'</div></div></div>';
1494
+
1495
+
1496
+ break;
1497
+ }
1498
+ case 'type_scale_rating':
1499
+ {
1500
+ $params_names=array('w_field_label_size','w_field_label_pos','w_mini_labels','w_scale_amount','w_required','w_class');
1501
+ $temp=$params;
1502
+ foreach($params_names as $params_name )
1503
+ {
1504
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1505
+ $param[$params_name] = $temp[0];
1506
+ $temp=$temp[1];
1507
+ }
1508
+
1509
+ if($temp)
1510
+ {
1511
+ $temp =explode('*:*w_attr_name*:*',$temp);
1512
+ $attrs = array_slice($temp,0, count($temp)-1);
1513
+ foreach($attrs as $attr)
1514
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1515
+ }
1516
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1517
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1518
+
1519
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
1520
+
1521
+ $numbers = '';
1522
+ for($i=1; $i<=$param['w_scale_amount']; $i++)
1523
+ {
1524
+ $numbers .= '<div id="'.$id.'_scale_td1_'.$i.'form_id_temp" style="text-align: center; display: table-cell;"><span>'.$i.'</span></div>';
1525
+ }
1526
+
1527
+
1528
+ $radio_buttons = '';
1529
+ for($k=1; $k<=$param['w_scale_amount']; $k++)
1530
+ {
1531
+ $radio_buttons .= '<div id="'.$id.'_scale_td2_'.$k.'form_id_temp" style="display: table-cell;"><input id="'.$id.'_scale_radioform_id_temp_'.$k.'" name="'.$id.'_scale_radioform_id_temp" value="'.$k.'" type="radio"></div>';
1532
+ }
1533
+
1534
+ $rep ='<div id="wdform_field'.$id.'" type="type_scale_rating" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; vertical-align: top; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_scale_rating" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_scale_amount'].'" id="'.$id.'_scale_amountform_id_temp" name="'.$id.'_scale_amountform_id_temp"><div id="'.$id.'_elementform_id_temp" style="float: left;" '.$param['attributes'].'><label class="mini_label" id="'.$id.'_mini_label_worst" style="position: relative; top: 6px; font-size: 11px; display: inline-table;">'.$w_mini_labels[0].'</label><div id="'.$id.'_scale_tableform_id_temp" style="display: inline-table;"><div id="'.$id.'_scale_tr1form_id_temp" style="display: table-row;">'.$numbers.'</div><div id="'.$id.'_scale_tr2form_id_temp" style="display: table-row;">'.$radio_buttons.'</div></div><label class="mini_label" id="'.$id.'_mini_label_best" style="position: relative; top: 6px; font-size: 11px; display: inline-table;">'.$w_mini_labels[1].'</label></div></div></div>';
1535
+
1536
+ break;
1537
+ }
1538
+ case 'type_spinner':
1539
+ {
1540
+ $params_names=array('w_field_label_size','w_field_label_pos','w_field_width','w_field_min_value','w_field_max_value', 'w_field_step', 'w_field_value', 'w_required','w_class');
1541
+ $temp=$params;
1542
+ foreach($params_names as $params_name ) {
1543
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1544
+ $param[$params_name] = $temp[0];
1545
+ $temp=$temp[1];
1546
+ }
1547
+ if($temp) {
1548
+ $temp =explode('*:*w_attr_name*:*',$temp);
1549
+ $attrs = array_slice($temp,0, count($temp)-1);
1550
+ foreach($attrs as $attr)
1551
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1552
+ }
1553
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1554
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1555
+ $rep ='<div id="wdform_field'.$id.'" type="type_spinner" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_spinner" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_field_width'].'" name="'.$id.'_spinner_widthform_id_temp" id="'.$id.'_spinner_widthform_id_temp"><input type="hidden" value="'.$param['w_field_min_value'].'" id="'.$id.'_min_valueform_id_temp" name="'.$id.'_min_valueform_id_temp"><input type="hidden" value="'.$param['w_field_max_value'].'" name="'.$id.'_max_valueform_id_temp" id="'.$id.'_max_valueform_id_temp"><input type="hidden" value="'.$param['w_field_step'].'" name="'.$id.'_stepform_id_temp" id="'.$id.'_stepform_id_temp"><input type="" value="'.($param['w_field_value']!= 'null' ? $param['w_field_value'] : '').'" name="'.$id.'_elementform_id_temp" id="'.$id.'_elementform_id_temp" onkeypress="return check_isnum_or_minus(event)" style="width: '.$param['w_field_width'].'px;" '.$param['attributes'].'></div></div>';
1556
+ break;
1557
+ }
1558
+ case 'type_slider': {
1559
+ $params_names=array('w_field_label_size','w_field_label_pos','w_field_width','w_field_min_value','w_field_max_value', 'w_field_value', 'w_required','w_class');
1560
+ $temp=$params;
1561
+ foreach($params_names as $params_name ) {
1562
+ $temp = explode('*:*'.$params_name.'*:*',$temp);
1563
+ $param[$params_name] = $temp[0];
1564
+ $temp=$temp[1];
1565
+ }
1566
+ if ($temp) {
1567
+ $temp = explode('*:*w_attr_name*:*', $temp);
1568
+ $attrs = array_slice($temp,0, count($temp)-1);
1569
+ foreach($attrs as $attr) {
1570
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
1571
+ }
1572
+ }
1573
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1574
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1575
+ $rep ='<div id="wdform_field'.$id.'" type="type_slider" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; vertical-align: top; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_slider" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_field_width'].'" name="'.$id.'_slider_widthform_id_temp" id="'.$id.'_slider_widthform_id_temp"><input type="hidden" value="'.$param['w_field_min_value'].'" id="'.$id.'_slider_min_valueform_id_temp" name="'.$id.'_slider_min_valueform_id_temp"><input type="hidden" value="'.$param['w_field_max_value'].'" id="'.$id.'_slider_max_valueform_id_temp" name="'.$id.'_slider_max_valueform_id_temp"><input type="hidden" value="'.$param['w_field_value'].'" id="'.$id.'_slider_valueform_id_temp" name="'.$id.'_slider_valueform_id_temp"><div id="'.$id.'_slider_tableform_id_temp"><div><div id="'.$id.'_slider_td1form_id_temp"><div name="'.$id.'_elementform_id_temp" id="'.$id.'_elementform_id_temp" style="width: '.$param['w_field_width'].'px;" '.$param['attributes'].'"></div></div></div><div><div align="left" id="'.$id.'_slider_td2form_id_temp" style="display: inline-table; width: 33.3%; text-align: left;"><span id="'.$id.'_element_minform_id_temp" class="label">'.$param['w_field_min_value'].'</span></div><div align="right" id="'.$id.'_slider_td3form_id_temp" style="display: inline-table; width: 33.3%; text-align: center;"><span id="'.$id.'_element_valueform_id_temp" class="label">'.$param['w_field_value'].'</span></div><div align="right" id="'.$id.'_slider_td4form_id_temp" style="display: inline-table; width: 33.3%; text-align: right;"><span id="'.$id.'_element_maxform_id_temp" class="label">'.$param['w_field_max_value'].'</span></div></div></div></div></div>';
1576
+ break;
1577
+ }
1578
+ case 'type_range': {
1579
+ $params_names = array('w_field_label_size','w_field_label_pos','w_field_range_width','w_field_range_step','w_field_value1', 'w_field_value2', 'w_mini_labels', 'w_required','w_class');
1580
+ $temp = $params;
1581
+ foreach ($params_names as $params_name ) {
1582
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
1583
+ $param[$params_name] = $temp[0];
1584
+ $temp = $temp[1];
1585
+ }
1586
+ if ($temp) {
1587
+ $temp = explode('*:*w_attr_name*:*', $temp);
1588
+ $attrs = array_slice($temp, 0, count($temp) - 1);
1589
+ foreach($attrs as $attr) {
1590
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1591
+ }
1592
+ }
1593
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1594
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1595
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
1596
+ $rep ='<div id="wdform_field'.$id.'" type="type_range" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_range" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_field_range_width'].'" name="'.$id.'_range_widthform_id_temp" id="'.$id.'_range_widthform_id_temp"><input type="hidden" value="'.$param['w_field_range_step'].'" name="'.$id.'_range_stepform_id_temp" id="'.$id.'_range_stepform_id_temp"><div id="'.$id.'_elemet_table_littleform_id_temp" style="display: table;"><div style="display: table-row;"><div valign="middle" align="left" style="display: table-cell;"><input type="" value="'.($param['w_field_value1']!= 'null' ? $param['w_field_value1'] : '').'" name="'.$id.'_elementform_id_temp0" id="'.$id.'_elementform_id_temp0" onkeypress="return check_isnum_or_minus(event)" style="width: '.$param['w_field_range_width'].'px;" '.$param['attributes'].'></div><div valign="middle" align="left" style="display: table-cell; padding-left: 4px;"><input type="" value="'.($param['w_field_value2']!= 'null' ? $param['w_field_value2'] : '').'" name="'.$id.'_elementform_id_temp1" id="'.$id.'_elementform_id_temp1" onkeypress="return check_isnum_or_minus(event)" style="width: '.$param['w_field_range_width'].'px;" '.$param['attributes'].'></div></div><div style="display: table-row;"><div valign="top" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_from">'.$w_mini_labels[0].'</label></div><div valign="top" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_to">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
1597
+ break;
1598
+ }
1599
+ case 'type_grading': {
1600
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_items', 'w_total', 'w_required', 'w_class');
1601
+ $temp = $params;
1602
+ foreach($params_names as $params_name) {
1603
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
1604
+ $param[$params_name] = $temp[0];
1605
+ $temp = $temp[1];
1606
+ }
1607
+ if ($temp) {
1608
+ $temp = explode('*:*w_attr_name*:*', $temp);
1609
+ $attrs = array_slice($temp, 0, count($temp) - 1);
1610
+ foreach ($attrs as $attr) {
1611
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1612
+ }
1613
+ }
1614
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
1615
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
1616
+ $w_items = explode('***', $param['w_items']);
1617
+ $grading_items = '';
1618
+ for ($i = 0; $i < count($w_items); $i++) {
1619
+ $grading_items .= '<div id="'.$id.'_element_div'.$i.'" class="grading"><input id="'.$id.'_elementform_id_temp_'.$i.'" name="'.$id.'_elementform_id_temp_'.$i.'" onkeypress="return check_isnum_or_minus(event)" value="" size="5" onkeyup="sum_grading_values('.$id.',&quot;form_id_temp&quot;)" onchange="sum_grading_values('.$id.',&quot;form_id_temp&quot;)" '.$param['attributes'].'><label id="'.$id.'_label_elementform_id_temp'.$i.'" class="ch-rad-label">'.$w_items[$i].'</label></div>';
1620
+ }
1621
+ $rep ='<div id="wdform_field'.$id.'" type="type_grading" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; vertical-align: top; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_grading" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_total'].'" name="'.$id.'_grading_totalform_id_temp" id="'.$id.'_grading_totalform_id_temp"><div id="'.$id.'_elementform_id_temp">'.$grading_items.'<div id="'.$id.'_element_total_divform_id_temp" class="grading_div">Total:<span id="'.$id.'_sum_elementform_id_temp" name="'.$id.'_sum_elementform_id_temp">0</span>/<span id="'.$id.'_total_elementform_id_temp" name="'.$id.'_total_elementform_id_temp">'.$param['w_total'].'</span><span id="'.$id.'_text_elementform_id_temp" name="'.$id.'_text_elementform_id_temp"></span></div></div></div></div>';
1622
+ break;
1623
+ }
1624
+ case 'type_matrix': {
1625
+ $params_names=array('w_field_label_size','w_field_label_pos', 'w_field_input_type', 'w_rows', 'w_columns', 'w_required','w_class');
1626
+ $temp = $params;
1627
+ foreach ($params_names as $params_name) {
1628
+ $temp = explode('*:*'.$params_name.'*:*',$temp);
1629
+ $param[$params_name] = $temp[0];
1630
+ $temp = $temp[1];
1631
+ }
1632
+ if ($temp) {
1633
+ $temp = explode('*:*w_attr_name*:*', $temp);
1634
+ $attrs = array_slice($temp, 0, count($temp) - 1);
1635
+ foreach ($attrs as $attr) {
1636
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1637
+ }
1638
+ }
1639
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1640
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1641
+ $w_rows = explode('***',$param['w_rows']);
1642
+ $w_columns = explode('***',$param['w_columns']);
1643
+ $column_labels = '';
1644
+ for ($i = 1; $i < count($w_columns); $i++) {
1645
+ $column_labels .= '<div id="'.$id.'_element_td0_'.$i.'" class="matrix_" style="display: table-cell;"><label id="'.$id.'_label_elementform_id_temp0_'.$i.'" name="'.$id.'_label_elementform_id_temp0_'.$i.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$i.'" value="'.$w_columns[$i].'">'.$w_columns[$i].'</label></div>';
1646
+ }
1647
+ $rows_columns = '';
1648
+ for ($i = 1; $i < count($w_rows); $i++) {
1649
+ $rows_columns .= '<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;"><div id="'.$id.'_element_td'.$i.'_0" class="matrix_" style="display: table-cell;"><label id="'.$id.'_label_elementform_id_temp'.$i.'_0" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$i.'" value="'.$w_rows[$i].'">'.$w_rows[$i].'</label></div>';
1650
+ for ($k = 1; $k < count($w_columns); $k++) {
1651
+ if($param['w_field_input_type']=='radio') {
1652
+ $rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" align="center" size="14" type="radio" name="'.$id.'_input_elementform_id_temp'.$i.'" value="'.$i.'_'.$k.'"></div>';
1653
+ }
1654
+ elseif ($param['w_field_input_type']=='checkbox') {
1655
+ $rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" align="center" size="14" type="checkbox" name="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" value="1"></div>';
1656
+ }
1657
+ elseif ($param['w_field_input_type']=='text') {
1658
+ $rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" align="center" size="14" type="text" name="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" value=""></div>';
1659
+ }
1660
+ elseif ($param['w_field_input_type']=='select') {
1661
+ $rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><select id="'.$id.'_select_yes_noform_id_temp'.$i.'_'.$k.'" name="'.$id.'_select_yes_noform_id_temp'.$i.'_'.$k.'"><option value=""> </option><option value="yes">Yes</option><option value="no">No</option></select></div>';
1662
+ }
1663
+ }
1664
+ $rows_columns .= '</div>';
1665
+ }
1666
+ $rep ='<div id="wdform_field'.$id.'" type="type_matrix" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_matrix" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_field_input_type'].'" name="'.$id.'_input_typeform_id_temp" id="'.$id.'_input_typeform_id_temp"><div id="'.$id.'_elementform_id_temp" style="display: table;" '.$param['attributes'].'><div id="'.$id.'_table_little" style="display: table-row-group;"><div id="'.$id.'_element_tr0" style="display: table-row;"><div id="'.$id.'_element_td0_0" style="display: table-cell;"></div>'.$column_labels.'</div>'.$rows_columns.'</div></div></div></div>';
1667
+ break;
1668
+ }
1669
+ case 'type_submit_reset': {
1670
+ $params_names=array('w_submit_title','w_reset_title','w_class','w_act');
1671
+ $temp=$params;
1672
+ foreach ($params_names as $params_name) {
1673
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1674
+ $param[$params_name] = $temp[0];
1675
+ $temp=$temp[1];
1676
+ }
1677
+ if ($temp) {
1678
+ $temp = explode('*:*w_attr_name*:*',$temp);
1679
+ $attrs = array_slice($temp,0, count($temp)-1);
1680
+ foreach ($attrs as $attr) {
1681
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1682
+ }
1683
+ }
1684
+ $param['w_act'] = ($param['w_act']=="false" ? 'style="display: none;"' : "");
1685
+ $rep='<div id="wdform_field'.$id.'" type="type_submit_reset" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">type_submit_reset_'.$id.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><input type="hidden" value="type_submit_reset" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><button type="button" class="button-submit" id="'.$id.'_element_submitform_id_temp" value="'.$param['w_submit_title'].'" onclick="check_required(&quot;submit&quot;, &quot;form_id_temp&quot;);" '.$param['attributes'].'>'.$param['w_submit_title'].'</button><button type="button" class="button-reset" id="'.$id.'_element_resetform_id_temp" value="'.$param['w_reset_title'].'" onclick="check_required(&quot;reset&quot;);" '.$param['w_act'].' '.$param['attributes'].'>'.$param['w_reset_title'].'</button></div></div>';
1686
+ break;
1687
+ }
1688
+ case 'type_button': {
1689
+ $params_names=array('w_title','w_func','w_class');
1690
+ $temp=$params;
1691
+ foreach($params_names as $params_name) {
1692
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1693
+ $param[$params_name] = $temp[0];
1694
+ $temp=$temp[1];
1695
+ }
1696
+ if ($temp) {
1697
+ $temp = explode('*:*w_attr_name*:*',$temp);
1698
+ $attrs = array_slice($temp,0, count($temp)-1);
1699
+ foreach($attrs as $attr) {
1700
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1701
+ }
1702
+ }
1703
+ $param['w_title'] = explode('***',$param['w_title']);
1704
+ $param['w_func'] = explode('***',$param['w_func']);
1705
+ $rep.='<div id="wdform_field'.$id.'" type="type_button" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">button_'.$id.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><input type="hidden" value="type_button" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp">';
1706
+ foreach ($param['w_title'] as $key => $title) {
1707
+ $rep.='<button type="button" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp'.$key.'" value="'.$title.'" onclick="'.$param['w_func'][$key].'" '.$param['attributes'].'>'.$title.'</button>';
1708
+ }
1709
+ $rep .= '</div></div>';
1710
+ break;
1711
+ }
1712
+ }
1713
+ // Arrows.
1714
+ switch ($type) {
1715
+ case 'type_section_break': {
1716
+ $rep =$rep.'<div id="wdform_arrows'.$id.'" class="wdform_arrows_section"><div id="X_'.$id.'" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/delete_el.png" title="Remove the field" onclick="remove_section_break(&quot;'.$id.'&quot;)"></div><div id="edit_'.$id.'" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/edit.png" title="Edit the field" onclick="edit(&quot;'.$id.'&quot;)"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">custom_'.$id.'</span></div><div id="dublicate_'.$id.'" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/dublicate.png" title="Dublicate the field" onclick="dublicate(&quot;'.$id.'&quot;)"></div></div>';
1717
+ break;
1718
+ }
1719
+ case 'type_send_copy':
1720
+ case 'type_captcha':
1721
+ case 'type_recaptcha': {
1722
+ $rep =$rep.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" style="display: table-cell;"><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/delete_el.png" title="Remove the field" onclick="remove_row(&quot;'.$id.'&quot;)"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/left.png" title="Move the field to the left" onclick="left_row(&quot;'.$id.'&quot;)"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/up.png" title="Move the field up" onclick="up_row(&quot;'.$id.'&quot;)"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/down.png" title="Move the field down" onclick="down_row(&quot;'.$id.'&quot;)"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/right.png" title="Move the field to the right" onclick="right_row(&quot;'.$id.'&quot;)"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/edit.png" title="Edit the field" onclick="edit(&quot;'.$id.'&quot;)"></div><div id="dublicate_'.$id.'" valign="middle" class="element_toolbar"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/page_up.png" title="Move the field to the upper page" onclick="page_up(&quot;'.$id.'&quot;)"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/page_down.png" title="Move the field to the lower page" onclick="page_down(&quot;'.$id.'&quot;)"></div></div>';
1723
+ break;
1724
+ }
1725
+ default: {
1726
+ $rep =$rep.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" style="display: table-cell;"><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/delete_el.png" title="Remove the field" onclick="remove_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;delete_el&quot;)" onmouseout="chnage_icons_src(this,&quot;delete_el&quot;)"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/left.png" title="Move the field to the left" onclick="left_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;left&quot;)" onmouseout="chnage_icons_src(this,&quot;left&quot;)"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/up.png" title="Move the field up" onclick="up_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;up&quot;)" onmouseout="chnage_icons_src(this,&quot;up&quot;)"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/down.png" title="Move the field down" onclick="down_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;down&quot;)" onmouseout="chnage_icons_src(this,&quot;down&quot;)"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/right.png" title="Move the field to the right" onclick="right_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;right&quot;)" onmouseout="chnage_icons_src(this,&quot;right&quot;)"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/edit.png" title="Edit the field" onclick="edit(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;edit&quot;)" onmouseout="chnage_icons_src(this,&quot;edit&quot;)"></div><div id="dublicate_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/dublicate.png" title="Dublicate the field" onclick="dublicate(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;dublicate&quot;)" onmouseout="chnage_icons_src(this,&quot;dublicate&quot;)"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/page_up.png" title="Move the field to the upper page" onclick="page_up(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;page_up&quot;)" onmouseout="chnage_icons_src(this,&quot;page_up&quot;)"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/page_down.png" title="Move the field to the lower page" onclick="page_down(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;page_down&quot;)" onmouseout="chnage_icons_src(this,&quot;page_down&quot;)"></div></div>';
1727
+ break;
1728
+ }
1729
+ }
1730
+ $form = str_replace('%' . $id . ' - ' . $labels[$ids_key] . '%', $rep, $form);
1731
+ $row->form_front = $form;
1732
+ }
1733
+ }
1734
+ }
1735
+ else {
1736
+ $row = new stdClass();
1737
+ $row->id = 0;
1738
+ $row->title = '';
1739
+ $row->mail = '';
1740
+ $row->form = '';
1741
+ $row->form_front = '';
1742
+ $row->theme = 0;
1743
+ $row->javascript = '';
1744
+ $row->submit_text = '';
1745
+ $row->url = '';
1746
+ $row->submit_text_type = 0;
1747
+ $row->script1 = '';
1748
+ $row->script2 = '';
1749
+ $row->script_user1 = '';
1750
+ $row->script_user2 = '';
1751
+ $row->counter = 0;
1752
+ $row->label_order = '';
1753
+ $row->article_id = '';
1754
+ $row->pagination = '';
1755
+ $row->show_title = '';
1756
+ $row->show_numbers = '';
1757
+ $row->public_key = '';
1758
+ $row->private_key = '';
1759
+ $row->recaptcha_theme = '';
1760
+ $row->from_name = '';
1761
+ $row->from_mail = '';
1762
+ $row->label_order_current = '';
1763
+ $row->script_mail_user = '';
1764
+ $row->script_mail = '';
1765
+ $row->tax = 0;
1766
+ $row->payment_currency = '$';
1767
+ $row->paypal_email = '';
1768
+ $row->checkout_mode = 'testmode';
1769
+ $row->paypal_mode = 0;
1770
+
1771
+ $row->published = 1;
1772
+ $row->form_fields = '';
1773
+ $row->savedb = 1;
1774
+ $row->sendemail = 1;
1775
+ $row->requiredmark = '*';
1776
+ $row->reply_to = 0;
1777
+ $row->send_to = 0;
1778
+ $row->autogen_layout = 1;
1779
+ $row->custom_front = '';
1780
+ $row->mail_from_user = '';
1781
+ $row->mail_from_name_user = '';
1782
+ $row->reply_to_user = '';
1783
+
1784
+ $row->condition = '';
1785
+ $row->mail_cc = '';
1786
+ $row->mail_cc_user = '';
1787
+ $row->mail_bcc = '';
1788
+ $row->mail_bcc_user = '';
1789
+ $row->mail_subject = '';
1790
+ $row->mail_subject_user = '';
1791
+ $row->mail_mode = 1;
1792
+ $row->mail_mode_user = 1;
1793
+ $row->mail_attachment = 1;
1794
+ $row->mail_attachment_user = 1;
1795
+ }
1796
+ return $row;
1797
+ }
1798
+
1799
+ public function get_theme_rows_data($old = '') {
1800
+ global $wpdb;
1801
+ $rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_themes WHERE css " . ($old ? 'NOT' : '') . " LIKE '%.wdform_section%' ORDER BY title");
1802
+ return $rows;
1803
+ }
1804
+
1805
+ public function page_nav() {
1806
+ global $wpdb;
1807
+ $where = 'WHERE `id` IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')';
1808
+ $where .= ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? ' AND title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
1809
+ $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker " . $where;
1810
+ $total = $wpdb->get_var($query);
1811
+ $page_nav['total'] = $total;
1812
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
1813
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
1814
+ }
1815
+ else {
1816
+ $limit = 0;
1817
+ }
1818
+ $page_nav['limit'] = (int) ($limit / 20 + 1);
1819
+ return $page_nav;
1820
+ }
1821
+ ////////////////////////////////////////////////////////////////////////////////////////
1822
+ // Getters & Setters //
1823
+ ////////////////////////////////////////////////////////////////////////////////////////
1824
+ ////////////////////////////////////////////////////////////////////////////////////////
1825
+ // Private Methods //
1826
+ ////////////////////////////////////////////////////////////////////////////////////////
1827
+ ////////////////////////////////////////////////////////////////////////////////////////
1828
+ // Listeners //
1829
+ ////////////////////////////////////////////////////////////////////////////////////////
1830
+ }
admin/models/FMModelShow_matrix_fmc.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_fmc.php ADDED
@@ -0,0 +1,591 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class FMModelSubmissions_fmc {
3
+ ////////////////////////////////////////////////////////////////////////////////////////
4
+ // Events //
5
+ ////////////////////////////////////////////////////////////////////////////////////////
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ // Constants //
8
+ ////////////////////////////////////////////////////////////////////////////////////////
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ // Variables //
11
+ ////////////////////////////////////////////////////////////////////////////////////////
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ // Constructor & Destructor //
14
+ ////////////////////////////////////////////////////////////////////////////////////////
15
+ public function __construct() {
16
+ }
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ // Public Methods //
19
+ ////////////////////////////////////////////////////////////////////////////////////////
20
+ public function check_ip($ip) {
21
+ global $wpdb;
22
+ $ip = $wpdb->get_var($wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $ip));
23
+ return $ip;
24
+ }
25
+
26
+ public function get_form_titles() {
27
+ global $wpdb;
28
+ $query = "SELECT id, title FROM " . $wpdb->prefix . "formmaker WHERE `id` IN(" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ") order by title";
29
+ $forms = $wpdb->get_results($query);
30
+ return $forms;
31
+ }
32
+
33
+ public function get_statistics($form_id) {
34
+ global $wpdb;
35
+ $statistics = array();
36
+ $query = $wpdb->prepare('SELECT count(distinct group_id) FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id ="%d"', $form_id);
37
+ $statistics["total_entries"] = $wpdb->get_var($query);
38
+ $query = $wpdb->prepare('SELECT `views` FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $form_id);
39
+ $statistics["total_views"] = $wpdb->get_var($query);
40
+ if ($statistics["total_views"]) {
41
+ $statistics["conversion_rate"] = round((($statistics["total_entries"] / $statistics["total_views"]) * 100), 2) . '%';
42
+ }
43
+ else {
44
+ $statistics["conversion_rate"] = '0%';
45
+ }
46
+ return $statistics;
47
+ }
48
+
49
+ public function get_labels_parameters($form_id) {
50
+ global $wpdb;
51
+ $labels = array();
52
+ $labels_id = array();
53
+ $sorted_labels_id = array();
54
+ $label_names = array();
55
+ $label_types = array();
56
+ $sorted_label_types = array();
57
+ $label_names_original = array();
58
+ $labels_parameters = array();
59
+ $join_query = array();
60
+ $join_where = array();
61
+ $rows_ord = array();
62
+ $join = '';
63
+ for ($i = 0; $i < 8; $i++) {
64
+ array_push($labels_parameters, NULL);
65
+ }
66
+ $sorted_label_names = array();
67
+ $sorted_label_names_original = array();
68
+ $where_labels = array();
69
+ $where2 = array();
70
+ $order_by = (isset($_POST['order_by']) ? esc_html(stripslashes($_POST['order_by'])) : 'group_id');
71
+ $asc_or_desc = ((isset($_POST['asc_or_desc'])) ? esc_html(stripslashes($_POST['asc_or_desc'])) : 'desc');
72
+ $limit = ((isset($_POST['page_number'])) ? ((int) $_POST['page_number'] - 1) * 20 : 0);
73
+ $lists['hide_label_list'] = ((isset($_POST['hide_label_list'])) ? esc_html(stripslashes($_POST['hide_label_list'])) : '');
74
+ $lists['startdate'] = ((isset($_POST['startdate'])) ? esc_html(stripslashes($_POST['startdate'])) : '');
75
+ $lists['enddate'] = ((isset($_POST['enddate'])) ? esc_html(stripslashes($_POST['enddate'])) : '');
76
+ $lists['ip_search'] = ((isset($_POST['ip_search'])) ? esc_html(stripslashes($_POST['ip_search'])) : '');
77
+ if ($lists['ip_search']) {
78
+ $where[] = 'ip LIKE "%' . $lists['ip_search'] . '%"';
79
+ }
80
+ if ($lists['startdate'] != '') {
81
+ $where[] = " `date`>='" . $lists['startdate'] . " 00:00:00' ";
82
+ }
83
+ if ($lists['enddate'] != '') {
84
+ $where[] = " `date`<='" . $lists['enddate'] . " 23:59:59' ";
85
+ }
86
+ $where[] = 'form_id=' . $form_id . '';
87
+ $where = (count($where) ? ' ' . implode(' AND ', $where) : '');
88
+ if ($order_by == 'group_id' or $order_by == 'date' or $order_by == 'ip') {
89
+ $orderby = ' ORDER BY ' . $order_by . ' ' . $asc_or_desc . '';
90
+ }
91
+ else {
92
+ $orderby = "";
93
+ }
94
+ if ($form_id) {
95
+ for($i = 0; $i < 8; $i++) {
96
+ array_pop($labels_parameters);
97
+ }
98
+ $query = "SELECT distinct element_label FROM " . $wpdb->prefix . "formmaker_submits WHERE ". $where;
99
+ $results = $wpdb->get_results($query);
100
+ for ($i = 0; $i < count($results); $i++) {
101
+ array_push($labels, $results[$i]->element_label);
102
+ }
103
+ $form = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='%d'", $form_id));
104
+ if (strpos($form->label_order, 'type_paypal_')) {
105
+ $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#****#";
106
+ }
107
+ $form_labels = explode('#****#', $form->label_order);
108
+ $form_labels = array_slice($form_labels, 0, count($form_labels) - 1);
109
+ foreach ($form_labels as $key => $form_label) {
110
+ $label_id = explode('#**id**#', $form_label);
111
+ array_push($labels_id, $label_id[0]);
112
+ $label_name_type = explode('#**label**#', $label_id[1]);
113
+ array_push($label_names_original, $label_name_type[0]);
114
+ $ptn = "/[^a-zA-Z0-9_]/";
115
+ $rpltxt = "";
116
+ $label_name = preg_replace($ptn, $rpltxt, $label_name_type[0]);
117
+ array_push($label_names, $label_name);
118
+ array_push($label_types, $label_name_type[1]);
119
+ }
120
+ foreach ($labels_id as $key => $label_id) {
121
+ if (in_array($label_id, $labels)) {
122
+ if (!in_array($label_id, $sorted_labels_id)) {
123
+ array_push($sorted_labels_id, $label_id);
124
+ }
125
+ array_push($sorted_label_names, $label_names[$key]);
126
+ array_push($sorted_label_types, $label_types[$key]);
127
+ array_push($sorted_label_names_original, $label_names_original[$key]);
128
+ if (isset($_POST[$form_id . '_' . $label_id . '_search'])) {
129
+ $search_temp = esc_html($_POST[$form_id . '_' . $label_id . '_search']);
130
+ }
131
+ else {
132
+ $search_temp = '';
133
+ }
134
+ $search_temp = strtolower($search_temp);
135
+ $lists[$form_id . '_' . $label_id . '_search'] = $search_temp;
136
+ if ($search_temp) {
137
+ $join_query[] = 'search';
138
+ $join_where[] = array('label' => $label_id, 'search' => $search_temp);
139
+ }
140
+ }
141
+ }
142
+ if (strpos($order_by, "_field")) {
143
+ if (in_array(str_replace("_field", "", $order_by), $labels)) {
144
+ $join_query[] = 'sort';
145
+ $join_where[] = array('label'=>str_replace("_field", "", $order_by));
146
+ }
147
+ }
148
+ $cols = 'group_id';
149
+ if ($order_by == 'date' or $order_by == 'ip') {
150
+ $cols = 'group_id, date, ip';
151
+ }
152
+ switch (count($join_query)) {
153
+ case 0:
154
+ $join = 'SELECT distinct group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE '. $where;
155
+ break;
156
+ case 1:
157
+ if ($join_query[0] == 'sort') {
158
+ $join = 'SELECT group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE ' . $where . ' AND element_label="' . $join_where[0]['label'] . '" ';
159
+ $join_count = 'SELECT count(group_id) FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="' . $form_id . '" AND element_label="' . $join_where[0]['label'] . '" ';
160
+ $orderby = ' ORDER BY `element_value` ' . $asc_or_desc;
161
+ }
162
+ else {
163
+ $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;
164
+ }
165
+ break;
166
+ default:
167
+ $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 ';
168
+ for ($key = 1; $key < count($join_query); $key++) {
169
+ if ($join_query[$key] == 'sort') {
170
+ $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 ';
171
+ $orderby = ' ORDER BY t' . $key . '.`element_value` ' . $asc_or_desc . '';
172
+ }
173
+ else {
174
+ $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 ';
175
+ }
176
+ }
177
+ break;
178
+ }
179
+ $pos = strpos($join, 'SELECT t.group_id');
180
+ if ($pos === FALSE) {
181
+ $query = str_replace(array('SELECT group_id','SELECT distinct group_id'), array('SELECT count(distinct group_id)','SELECT count(distinct group_id)'), $join);
182
+ }
183
+ else {
184
+ $query = str_replace('SELECT t.group_id', 'SELECT count(t.group_id)', $join);
185
+ }
186
+ $total = $wpdb->get_var($query);
187
+ $query = $join . ' ' . $orderby . ' limit ' . $limit . ', 20 ';
188
+ $results = $wpdb->get_results($query);
189
+ for ($i = 0; $i < count($results); $i++) {
190
+ array_push($rows_ord, $results[$i]->group_id);
191
+ }
192
+ $where2 = array();
193
+ $where2[] = "group_id='0'";
194
+ foreach ($rows_ord as $rows_ordd) {
195
+ $where2[] = "group_id='" . $rows_ordd . "'";
196
+ }
197
+ $where2 = (count($where2) ? ' WHERE ' . implode( ' OR ', $where2 ) . '' : '' );
198
+ $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits ' . $where2;
199
+ $rows = $wpdb->get_results($query);
200
+ $group_ids = $rows_ord;
201
+ $lists['total'] = $total;
202
+ $lists['limit'] = (int) ($limit / 20 + 1);
203
+ $where_choices = $where;
204
+ array_push($labels_parameters, $sorted_labels_id);
205
+ array_push($labels_parameters, $sorted_label_types);
206
+ array_push($labels_parameters, $lists);
207
+ array_push($labels_parameters, $sorted_label_names);
208
+ array_push($labels_parameters, $sorted_label_names_original);
209
+ array_push($labels_parameters, $rows);
210
+ array_push($labels_parameters, $group_ids);
211
+ array_push($labels_parameters, $where_choices);
212
+ }
213
+ return $labels_parameters;
214
+ }
215
+
216
+ public function get_type_address($sorted_label_type, $sorted_label_name_original) {
217
+ if ($sorted_label_type == 'type_address') {
218
+ switch ($sorted_label_name_original) {
219
+ case 'Street Line':
220
+ $field_title = __('Street Address', 'form_maker');
221
+ break;
222
+ case 'Street Line2':
223
+ $field_title = __('Street Address Line 2', 'form_maker');
224
+ break;
225
+ case 'City':
226
+ $field_title = __('City', 'form_maker');
227
+ break;
228
+ case 'State':
229
+ $field_title = __('State / Province / Region', 'form_maker');
230
+ break;
231
+ case 'Postal':
232
+ $field_title = __('Postal / Zip Code', 'form_maker');
233
+ break;
234
+ case 'Country':
235
+ $field_title = __('Country', 'form_maker');
236
+ break;
237
+ default :
238
+ $field_title = stripslashes($sorted_label_name_original);
239
+ break;
240
+ }
241
+ }
242
+ else {
243
+ $field_title = stripslashes($sorted_label_name_original);
244
+ }
245
+ return $field_title;
246
+ }
247
+
248
+ public function hide_or_not($hide_strings,$hide_string) {
249
+ if (strpos($hide_string,'@') === FALSE) {
250
+ if (strpos($hide_strings, '@' . $hide_string . '@') === FALSE) {
251
+ $style = '';
252
+ }
253
+ else {
254
+ $style = 'style="display:none"';
255
+ }
256
+ }
257
+ else {
258
+ if (strpos($hide_strings, $hide_string) === FALSE) {
259
+ $style = '';
260
+ }
261
+ else {
262
+ $style = 'style="display:none"';
263
+ }
264
+ }
265
+ return $style;
266
+ }
267
+
268
+ public function sort_group_ids($sorted_label_names_count, $group_ids) {
269
+ $count_labe = $sorted_label_names_count;
270
+ $group_id_s = array();
271
+ $l = 0;
272
+ if (count($group_ids) > 0 and $count_labe) {
273
+ for ($i = 0; $i < count($group_ids); $i++) {
274
+ if (!in_array($group_ids[$i], $group_id_s)) {
275
+ array_push($group_id_s, $group_ids[$i]);
276
+ }
277
+ }
278
+ }
279
+ return $group_id_s;
280
+ }
281
+
282
+ public function array_for_group_id($group, $rows) {
283
+ $i = $group;
284
+ $count_rows = count($rows);
285
+ $temp = array();
286
+ for ($j = 0; $j < $count_rows; $j++) {
287
+ $row = $rows[$j];
288
+ if ($row->group_id == $i) {
289
+ array_push($temp, $row);
290
+ }
291
+ }
292
+ return $temp;
293
+ }
294
+
295
+ public function check_radio_type($sorted_label_type) {
296
+ 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") {
297
+ return TRUE;
298
+ }
299
+ else {
300
+ return FALSE;
301
+ }
302
+ }
303
+
304
+ public function statistic_for_radio($where_choices, $sorted_label_id) {
305
+ global $wpdb;
306
+ $choices_params = array();
307
+ $query = "SELECT element_value FROM " . $wpdb->prefix . "formmaker_submits WHERE " . $where_choices . " AND element_label='" . $sorted_label_id . "'";
308
+ $choices = $wpdb->get_results($query);
309
+ $colors = array(
310
+ '#2CBADE',
311
+ '#FE6400'
312
+ );
313
+ $choices_labels = array();
314
+ $choices_count = array();
315
+ $all = count($choices);
316
+ $unanswered = 0;
317
+ foreach ($choices as $key => $choice) {
318
+ if ($choice->element_value == '') {
319
+ $unanswered++;
320
+ }
321
+ else {
322
+ if (!in_array($choice->element_value, $choices_labels)) {
323
+ array_push($choices_labels, $choice->element_value);
324
+ array_push($choices_count, 0);
325
+ }
326
+ $choices_count[array_search($choice->element_value, $choices_labels)]++;
327
+ }
328
+ }
329
+ array_multisort($choices_count, SORT_DESC, $choices_labels);
330
+ array_push($choices_params, $choices_count);
331
+ array_push($choices_params, $choices_labels);
332
+ array_push($choices_params, $unanswered);
333
+ array_push($choices_params, $all);
334
+ array_push($choices_params, $colors);
335
+ return $choices_params;
336
+ }
337
+
338
+ public function get_data_of_group_id($id) {
339
+ global $wpdb;
340
+ $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id=" . $id;
341
+ $rows = $wpdb->get_results($query);
342
+ $form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id=" . $rows[0]->form_id);
343
+ $params = array();
344
+ $label_id = array();
345
+ $label_order_original = array();
346
+ $label_type = array();
347
+ $ispaypal = strpos($form->label_order, 'type_paypal_');
348
+ if ($form->paypal_mode == 1) {
349
+ if ($ispaypal) {
350
+ $form->label_order = $form->label_order."0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
351
+ }
352
+ }
353
+ $label_all = explode('#****#', $form->label_order);
354
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
355
+ foreach ($label_all as $key => $label_each) {
356
+ $label_id_each = explode('#**id**#', $label_each);
357
+ array_push($label_id, $label_id_each[0]);
358
+ $label_oder_each = explode('#**label**#', $label_id_each[1]);
359
+ array_push($label_order_original, $label_oder_each[0]);
360
+ array_push($label_type, $label_oder_each[1]);
361
+ }
362
+ /*$theme_id = $wpdb->get_var("SELECT theme FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form->id . "'");*/
363
+ $css = $wpdb->get_var("SELECT css FROM " . $wpdb->prefix . "formmaker_themes");
364
+ array_push($params, $rows);
365
+ array_push($params, $label_id);
366
+ array_push($params, $label_order_original);
367
+ array_push($params, $label_type);
368
+ array_push($params, $ispaypal);
369
+ array_push($params, $form);
370
+ array_push($params, $css);
371
+ return $params;
372
+ }
373
+
374
+ public function check_type_for_edit_function($label_type) {
375
+ 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') {
376
+ return TRUE;
377
+ }
378
+ else {
379
+ return FALSE;
380
+ }
381
+ }
382
+
383
+ public function check_for_submited_label($rows, $label_id) {
384
+ foreach ($rows as $row) {
385
+ if ($row->element_label == $label_id) {
386
+ $element_value = $row->element_value;
387
+ break;
388
+ }
389
+ else {
390
+ $element_value = 'continue';
391
+ }
392
+ }
393
+ return $element_value;
394
+ }
395
+
396
+ public function view_for_star_rating($element_value, $element_label) {
397
+ $view_star_rating_array = array();
398
+ $new_filename = str_replace("***star_rating***", '', $element_value);
399
+ $stars = "";
400
+ $new_filename=explode('***', $new_filename);
401
+ for ($j = 0; $j < $new_filename[1]; $j++) {
402
+ $stars .= '<img id="' . $element_label . '_star_' . $j . '" src="' . WD_FMC_URL . '/images/star_' . $new_filename[2] . '.png" /> ';
403
+ }
404
+ for ($k = $new_filename[1]; $k < $new_filename[0]; $k++) {
405
+ $stars .= '<img id="' . $element_label . '_star_' . $k . '" src="' . WD_FMC_URL . '/images/star.png" /> ';
406
+ }
407
+ array_push($view_star_rating_array, $stars);
408
+ return $view_star_rating_array;
409
+ }
410
+
411
+ public function view_for_grading($element_value) {
412
+ $view_grading_array = array();
413
+ $new_filename = str_replace("***grading***", '', $element_value);
414
+ $grading = explode(":", $new_filename);
415
+ $items_count = sizeof($grading) - 1;
416
+ $items = "";
417
+ $total = "";
418
+ for ($k = 0; $k < $items_count / 2; $k++) {
419
+ $items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . "</br>";
420
+ $total += $grading[$k];
421
+ }
422
+ $items .= "Total: " . $total;
423
+ array_push($view_grading_array, $items);
424
+ return $view_grading_array;
425
+ }
426
+
427
+ public function images_for_star_rating($element_value, $label_id) {
428
+ $edit_stars = "";
429
+ $star_rating_array = array();
430
+ $element_value1 = str_replace("***star_rating***", '', $element_value);
431
+ $stars_value = explode('***', $element_value1);
432
+ for ($j = 0; $j < $stars_value[1]; $j++) {
433
+ $edit_stars .= '<img id="'.$label_id.'_star_'.$j.'" onclick="edit_star_rating('.$j.','.$label_id.')" src="' . WD_FMC_URL . '/images/star_'.$stars_value[2].'.png" /> ';
434
+ }
435
+ for( $k=$stars_value[1];$k<$stars_value[0];$k++) {
436
+ $edit_stars .= '<img id="'.$label_id.'_star_'.$k.'" onclick="edit_star_rating('.$k.','.$label_id.')" src="' . WD_FMC_URL . '/images/star.png" /> ';
437
+ }
438
+ array_push($star_rating_array, $edit_stars);
439
+ array_push($star_rating_array, $stars_value);
440
+ return $star_rating_array;
441
+ }
442
+
443
+ public function params_for_scale_rating($element_value, $label_id) {
444
+ $scale_rating_array = array();
445
+ $scale_radio = explode('/', $element_value);
446
+ $scale_value = $scale_radio[0];
447
+ $scale = '<table><tr>';
448
+ for ($k = 1; $k <= $scale_radio[1]; $k++) {
449
+ $scale .= '<td style="text-align:center"><span>' . $k . '</span></td>';
450
+ }
451
+ $scale .= '<tr></tr>';
452
+ for ($l = 1; $l <= $scale_radio[1]; $l++) {
453
+ if ($l == $scale_radio[0]) {
454
+ $checked = "checked";
455
+ }
456
+ else {
457
+ $checked = "";
458
+ }
459
+ $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>';
460
+ }
461
+ $scale .= '</tr></table>';
462
+ array_push($scale_rating_array, $scale);
463
+ array_push($scale_rating_array, $scale_radio);
464
+ array_push($scale_rating_array, $checked);
465
+ return $scale_rating_array;
466
+ }
467
+
468
+ public function params_for_type_range($element_value, $label_id) {
469
+ $range_value = explode('-', $element_value);
470
+ $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"/>';
471
+ return $range;
472
+ }
473
+
474
+ public function params_for_type_grading($element_value, $label_id) {
475
+ $type_grading_array = array();
476
+ $element_value1 = str_replace("***grading***", '', $element_value);
477
+ $garding_value = explode(':', $element_value1);
478
+ $items_count = sizeof($garding_value) - 1;
479
+ $garding = "";
480
+ $sum = "";
481
+ for ($k = 0; $k < $items_count/2; $k++) {
482
+ $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>';
483
+ $sum += $garding_value[$k];
484
+ }
485
+ array_push($type_grading_array, $garding);
486
+ array_push($type_grading_array, $garding_value);
487
+ array_push($type_grading_array, $sum);
488
+ array_push($type_grading_array, $items_count);
489
+ array_push($type_grading_array, $element_value1);
490
+ return $type_grading_array;
491
+ }
492
+
493
+ public function params_for_type_matrix($element_value, $label_id) {
494
+ $type_matrix_array = array();
495
+ $new_filename = str_replace("***matrix***", '', $element_value);
496
+ $matrix_value = explode('***', $new_filename);
497
+ $matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
498
+ $mat_rows = $matrix_value[0];
499
+ $mat_columns = $matrix_value[$mat_rows + 1];
500
+ $matrix = "<table>";
501
+ $matrix .= '<tr><td></td>';
502
+ for ($k = 1; $k <= $mat_columns; $k++) {
503
+ $matrix .= '<td style="background-color:#BBBBBB; padding:5px; border:1px; ">'.$matrix_value[$mat_rows+1+$k].'</td>';
504
+ }
505
+ $matrix .= '</tr>';
506
+ $aaa = Array();
507
+ $var_checkbox = 1;
508
+ $selected_value = "";
509
+ $selected_value_yes = "";
510
+ $selected_value_no = "";
511
+ for ($k = 1; $k <= $mat_rows; $k++) {
512
+ $matrix .= '<tr><td style="background-color:#BBBBBB; padding:5px; border:1px;">'.$matrix_value[$k].'</td>';
513
+ if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
514
+ if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
515
+ $checked = "";
516
+ $aaa[1] = "";
517
+ }
518
+ else {
519
+ $aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
520
+ }
521
+ for ($l = 1; $l <= $mat_columns; $l++) {
522
+ if ($aaa[1] == $l) {
523
+ $checked = 'checked';
524
+ }
525
+ else {
526
+ $checked = "";
527
+ }
528
+ $index = "'" . $k . '_' . $l . "'";
529
+ $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>';
530
+ }
531
+ }
532
+ else {
533
+ if ($matrix_value[$mat_rows+$mat_columns+2] == "checkbox") {
534
+ for ($l = 1; $l <= $mat_columns; $l++) {
535
+ if ($matrix_value[$mat_rows + $mat_columns + 2 + $var_checkbox] == 1) {
536
+ $checked = 'checked';
537
+ }
538
+ else {
539
+ $checked = '';
540
+ }
541
+ $index = "'".$k.'_'.$l."'";
542
+ $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>';
543
+ $var_checkbox++;
544
+ }
545
+ }
546
+ else {
547
+ if ($matrix_value[$mat_rows + $mat_columns + 2] == "text") {
548
+ for ($l = 1; $l <= $mat_columns; $l++) {
549
+ $text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
550
+ $index = "'".$k.'_'.$l."'";
551
+ $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>';
552
+ $var_checkbox++;
553
+ }
554
+ }
555
+ else {
556
+ for ($l = 1; $l <= $mat_columns; $l++) {
557
+ $selected_text = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox];
558
+ if ($selected_text == 'yes') {
559
+ $selected_value_yes = 'selected';
560
+ $selected_value_no = '';
561
+ $selected_value = '';
562
+ }
563
+ else {
564
+ if ($selected_text=='no') {
565
+ $selected_value_yes ='';
566
+ $selected_value_no ='selected';
567
+ $selected_value ='';
568
+ }
569
+ else {
570
+ $selected_value_yes = '';
571
+ $selected_value_no ='';
572
+ $selected_value ='selected';
573
+ }
574
+ }
575
+ $index = "'".$k.'_'.$l."'";
576
+ $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>';
577
+ $var_checkbox++;
578
+ }
579
+ }
580
+ }
581
+ }
582
+ $matrix .= '</tr>';
583
+ }
584
+ $matrix .= '</table>';
585
+ array_push($type_matrix_array, $matrix);
586
+ array_push($type_matrix_array, $new_filename);
587
+ return $type_matrix_array;
588
+ }
589
+ }
590
+
591
+ ?>
admin/models/FMModelThemes_fmc.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelThemes_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function get_rows_data() {
22
+ global $wpdb;
23
+ $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
24
+ $asc_or_desc = ((isset($_POST['asc_or_desc'])) ? esc_html($_POST['asc_or_desc']) : 'asc');
25
+ $order_by = ' ORDER BY ' . ((isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') ? esc_html($_POST['order_by']) : 'id') . ' ' . $asc_or_desc;
26
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
27
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
28
+ }
29
+ else {
30
+ $limit = 0;
31
+ }
32
+ $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_themes " . $where . $order_by . " LIMIT " . $limit . ",20";
33
+ $rows = $wpdb->get_results($query);
34
+ return $rows;
35
+ }
36
+
37
+ public function get_row_data($id, $reset) {
38
+ global $wpdb;
39
+ if ($id != 0) {
40
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
41
+ if ($reset) {
42
+ if (!$row->default) {
43
+ $row_id = $row->id;
44
+ $row_title = $row->title;
45
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes WHERE default="%d"', 1));
46
+ $row->id = $row_id;
47
+ $row->title = $row_title;
48
+ $row->default = FALSE;
49
+ }
50
+ else {
51
+ $row->css = '';
52
+ }
53
+ }
54
+ }
55
+ else {
56
+ $row->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_fmc.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelUninstall_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function delete_db_tables() {
22
+ global $wpdb;
23
+ $true_or_false_forms = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
24
+ if ($true_or_false_forms) {
25
+ $wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker WHERE `id` IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
26
+ $wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_submits WHERE `form_id` IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
27
+ $wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_views WHERE `form_id` IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
28
+ delete_option('contact_form_forms');
29
+ }
30
+ else {
31
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker");
32
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_submits");
33
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_views");
34
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_themes");
35
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_sessions");
36
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_blocked");
37
+ delete_option('contact_form_forms');
38
+ delete_option("wd_form_maker_version");
39
+ delete_option('formmaker_cureent_version');
40
+ delete_option('form_maker_pro_active');
41
+ }
42
+ }
43
+ ////////////////////////////////////////////////////////////////////////////////////////
44
+ // Getters & Setters //
45
+ ////////////////////////////////////////////////////////////////////////////////////////
46
+ ////////////////////////////////////////////////////////////////////////////////////////
47
+ // Private Methods //
48
+ ////////////////////////////////////////////////////////////////////////////////////////
49
+ ////////////////////////////////////////////////////////////////////////////////////////
50
+ // Listeners //
51
+ ////////////////////////////////////////////////////////////////////////////////////////
52
+ }
admin/models/FMModelWidget_fmc.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelWidget_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ public function get_gallery_rows_data() {
23
+ global $wpdb;
24
+ $query = "SELECT * FROM " . $wpdb->prefix . "formmaker order by `title`";
25
+ $rows = $wpdb->get_results($query);
26
+ return $rows;
27
+ }
28
+
29
+ ////////////////////////////////////////////////////////////////////////////////////////
30
+ // Getters & Setters //
31
+ ////////////////////////////////////////////////////////////////////////////////////////
32
+ ////////////////////////////////////////////////////////////////////////////////////////
33
+ // Private Methods //
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ ////////////////////////////////////////////////////////////////////////////////////////
36
+ // Listeners //
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ }
admin/views/FMViewBlocked_ips_fmc.php ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewBlocked_ips_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ // Constructor & Destructor //
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct($model) {
19
+ $this->model = $model;
20
+ }
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ $rows_data = $this->model->get_rows_data();
27
+ $page_nav = $this->model->page_nav();
28
+ $search_value = ((isset($_POST['search_value'])) ? esc_html(stripslashes($_POST['search_value'])) : '');
29
+ $asc_or_desc = ((isset($_POST['asc_or_desc'])) ? esc_html(stripslashes($_POST['asc_or_desc'])) : 'desc');
30
+ $order_by = (isset($_POST['order_by']) ? esc_html(stripslashes($_POST['order_by'])) : 'id');
31
+ $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
32
+ $ids_string = '';
33
+ ?>
34
+ <div id="fm_blocked_ips_message" style="width: 99%; display: none;"></div>
35
+ <div style="clear: both; float: left; width: 99%;">
36
+ <div style="float:left; font-size: 14px; font-weight: bold;">
37
+ This section allows you to block IPs.
38
+ <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-form-maker-guide-2.html">Read More in User Manual</a>
39
+ </div>
40
+ <div style="float: right; text-align: right;">
41
+ <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/files/fromContactForm.php">
42
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FMC_URL . '/images/wd_logo.png'; ?>" />
43
+ </a>
44
+ </div>
45
+ </div>
46
+ <form onkeypress="spider_doNothing(event)" class="wrap" id="blocked_ips" method="post" action="admin.php?page=blocked_ips_fmc" style="float: left; width: 99%;">
47
+ <span class="block_icon"></span>
48
+ <h2>Blocked IPs</h2>
49
+ <div class="buttons_div">
50
+ <input class="button-primary" type="submit" value="Save" onclick="spider_set_input_value('task', 'save_all');" />
51
+ <input class="button-secondary" type="submit" value="Delete" onclick="if (confirm('Do you want to unblock selected IPs?')) {
52
+ spider_set_input_value('task', 'delete_all');
53
+ } else {
54
+ return false;
55
+ }" />
56
+ </div>
57
+ <div class="tablenav top">
58
+ <?php
59
+ WDW_FMC_Library::search('IP', $search_value, 'blocked_ips');
60
+ WDW_FMC_Library::html_page_nav($page_nav['total'], $page_nav['limit'], 'blocked_ips');
61
+ ?>
62
+ </div>
63
+ <table class="wp-list-table widefat fixed pages">
64
+ <thead>
65
+ <tr>
66
+ <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin: 0;" /></th>
67
+ <th class="table_small_col <?php if ($order_by == 'id') {echo $order_class;} ?>">
68
+ <a onclick="spider_set_input_value('task', '');
69
+ spider_set_input_value('order_by', 'id');
70
+ spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html(stripslashes($_POST['order_by'])) == 'id') && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc') ? 'desc' : 'asc'); ?>');
71
+ spider_form_submit(event, 'blocked_ips')" href="">
72
+ <span>ID</span><span class="sorting-indicator"></span></th>
73
+ </a>
74
+ <th class="<?php if ($order_by == 'ip') {echo $order_class;} ?>">
75
+ <a onclick="spider_set_input_value('task', '');
76
+ spider_set_input_value('order_by', 'ip');
77
+ spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html(stripslashes($_POST['order_by'])) == 'ip') && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc') ? 'desc' : 'asc'); ?>');
78
+ spider_form_submit(event, 'blocked_ips')" href="">
79
+ <span>IP</span><span class="sorting-indicator"></span>
80
+ </a>
81
+ </th>
82
+ <th class="table_big_col">Edit</th>
83
+ <th class="table_big_col">Delete</th>
84
+ </tr>
85
+ <tr id="tr">
86
+ <th></th>
87
+ <th></th>
88
+ <th class="edit_input"><input type="text" class="input_th" id="ip" name="ip" onkeypress="return spider_check_isnum(event)"></th>
89
+ <th class="table_big_col">
90
+ <a class="add_tag_th button-primary button button-small" onclick="if (spider_check_required('ip', 'IP')) {return false;}
91
+ spider_set_input_value('task', 'save');
92
+ spider_set_input_value('current_id', '');
93
+ spider_form_submit(event, 'blocked_ips')" href="">Add IP</a>
94
+ </th>
95
+ <th></th>
96
+ </tr>
97
+ </thead>
98
+ <tbody id="tbody_arr">
99
+ <?php
100
+ if ($rows_data) {
101
+ foreach ($rows_data as $row_data) {
102
+ $alternate = (!isset($alternate) || $alternate == 'class="alternate"') ? '' : 'class="alternate"';
103
+ ?>
104
+ <tr id="tr_<?php echo $row_data->id; ?>" <?php echo $alternate; ?>>
105
+ <td class="table_small_col check-column" id="td_check_<?php echo $row_data->id; ?>" >
106
+ <input id="check_<?php echo $row_data->id; ?>" name="check_<?php echo $row_data->id; ?>" type="checkbox" />
107
+ </td>
108
+ <td class="table_small_col" id="td_id_<?php echo $row_data->id; ?>" ><?php echo $row_data->id; ?></td>
109
+ <td id="td_ip_<?php echo $row_data->id; ?>" >
110
+ <a class="pointer" id="ip<?php echo $row_data->id; ?>"
111
+ onclick="spider_edit_ip(<?php echo $row_data->id; ?>)"
112
+ title="Edit"><?php echo $row_data->ip; ?></a>
113
+ </td>
114
+ <td class="table_big_col" id="td_edit_<?php echo $row_data->id; ?>">
115
+ <a onclick="spider_edit_ip(<?php echo $row_data->id; ?>)">Edit</a>
116
+ </td>
117
+ <td class="table_big_col" id="td_delete_<?php echo $row_data->id; ?>">
118
+ <a onclick="spider_set_input_value('task', 'delete');
119
+ spider_set_input_value('current_id', <?php echo $row_data->id; ?>);
120
+ spider_form_submit(event, 'blocked_ips')" href="">Delete</a>
121
+ </td>
122
+ </tr>
123
+ <?php
124
+ $ids_string .= $row_data->id . ',';
125
+ }
126
+ }
127
+ ?>
128
+ </tbody>
129
+ </table>
130
+ <input id="task" name="task" type="hidden" value="" />
131
+ <input id="current_id" name="current_id" type="hidden" value="" />
132
+ <input id="ids_string" name="ids_string" type="hidden" value="<?php echo $ids_string; ?>" />
133
+ <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="<?php echo $asc_or_desc; ?>" />
134
+ <input id="order_by" name="order_by" type="hidden" value="<?php echo $order_by; ?>" />
135
+ </form>
136
+ <?php
137
+ }
138
+
139
+ ////////////////////////////////////////////////////////////////////////////////////////
140
+ // Getters & Setters //
141
+ ////////////////////////////////////////////////////////////////////////////////////////
142
+ ////////////////////////////////////////////////////////////////////////////////////////
143
+ // Private Methods //
144
+ ////////////////////////////////////////////////////////////////////////////////////////
145
+ ////////////////////////////////////////////////////////////////////////////////////////
146
+ // Listeners //
147
+ ////////////////////////////////////////////////////////////////////////////////////////
148
+ }
admin/views/FMViewFeatured_plugins_fmc.php ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewFeatured_plugins_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ ?>
27
+ <div id="main_featured_plugins_page">
28
+ <table align="center" width="90%" style="margin-top: 0px;border-bottom: rgb(111, 111, 111) solid 2px;">
29
+ <tr>
30
+ <td colspan="2" style="height: 70px;"><h3 style="margin: 0px;font-family:Segoe UI;padding-bottom: 15px;color: rgb(111, 111, 111); font-size:18pt;">Featured Plugins</h3></td>
31
+ <td></td>
32
+ </tr>
33
+ </table>
34
+ <form method="post">
35
+ <ul id="featured-plugins-list">
36
+ <li class="photo-gallery">
37
+ <div class="product">
38
+ <div class="title">
39
+ <strong class="heading">Photo Gallery</strong>
40
+ <p>WordPress Photo Gallery plugin</p>
41
+ </div>
42
+ </div>
43
+ <div class="description">
44
+ <p>Photo Gallery is a fully responsive WordPress Gallery plugin with advanced functionality.
45
+ It allows having different image galleries for your posts and pages, as well as different widgets.</p>
46
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-photo-gallery-plugin.html" class="download">Download</a>
47
+ </div>
48
+ </li>
49
+ <li class="spider-calendar">
50
+ <div class="product">
51
+ <div class="title">
52
+ <strong class="heading">Spider Calendar</strong>
53
+ <p>WordPress event calendar plugin</p>
54
+ </div>
55
+ </div>
56
+ <div class="description">
57
+ <p>Spider Event Calendar is a highly configurable product which allows you to have multiple organized events.</p>
58
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-calendar.html" class="download">Download</a>
59
+ </div>
60
+ </li>
61
+ <li class="catalog">
62
+ <div class="product">
63
+ <div class="title">
64
+ <strong class="heading">Spider Catalog</strong>
65
+ <p>WordPress product catalog plugin</p>
66
+ </div>
67
+ </div>
68
+ <div class="description">
69
+ <p>Spider Catalog for WordPress is a convenient tool for organizing the products represented on your website into catalogs.</p>
70
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-catalog.html" class="download">Download</a>
71
+ </div>
72
+ </li>
73
+ <li class="player">
74
+ <div class="product">
75
+ <div class="title">
76
+ <strong class="heading">Video Player</strong>
77
+ <p>WordPress Video player plugin</p>
78
+ </div>
79
+ </div>
80
+ <div class="description">
81
+ <p>Spider Video Player for WordPress is a Flash & HTML5 video player plugin that allows you to easily add videos to your website with the possibility</p>
82
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-player.html" class="download">Download</a>
83
+ </div>
84
+ </li>
85
+ <li class="contacts">
86
+ <div class="product">
87
+ <div class="title">
88
+ <strong class="heading">Spider Contacts</strong>
89
+ <p>Wordpress staff list plugin</p>
90
+ </div>
91
+ </div>
92
+ <div class="description">
93
+ <p>Spider Contacts helps you to display information about the group of people more intelligible, effective and convenient.</p>
94
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-contacts-plugin.html" class="download">Download</a>
95
+ </div>
96
+ </li>
97
+ <li class="facebook">
98
+ <div class="product">
99
+ <div class="title">
100
+ <strong class="heading">Spider Facebook</strong>
101
+ <p>WordPress Facebook plugin</p>
102
+ </div>
103
+ </div>
104
+ <div class="description">
105
+ <p>Spider Facebook is a WordPress integration tool for Facebook.It includes all the available Facebook social plugins and widgets to be added to your web</p>
106
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-facebook.html" class="download">Download</a>
107
+ </div>
108
+ </li>
109
+ <li class="twitter-widget">
110
+ <div class="product">
111
+ <div class="title">
112
+ <strong class="heading">Widget Twitter</strong>
113
+ <p>WordPress Widget Twitter plugin</p>
114
+ </div>
115
+ </div>
116
+ <div class="description">
117
+ <p>The Widget Twitter plugin lets you to fully integrate your WordPress site with your Twitter account.</p>
118
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-twitter-integration-plugin.html" class="download">Download</a>
119
+ </div>
120
+ </li>
121
+ <li class="faq">
122
+ <div class="product">
123
+ <div class="title">
124
+ <strong class="heading">Spider FAQ</strong>
125
+ <p>WordPress FAQ Plugin</p>
126
+ </div>
127
+ </div>
128
+ <div class="description">
129
+ <p>The Spider FAQ WordPress plugin is for creating an FAQ (Frequently Asked Questions) section for your website.</p>
130
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-faq-plugin.html" class="download">Download</a>
131
+ </div>
132
+ </li>
133
+ <li class="zoom">
134
+ <div class="product">
135
+ <div class="title">
136
+ <strong class="heading">Zoom</strong>
137
+ <p>WordPress text zoom plugin</p>
138
+ </div>
139
+ </div>
140
+ <div class="description">
141
+ <p>Zoom enables site users to resize the predefined areas of the web site.</p>
142
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-zoom.html" class="download">Download</a>
143
+ </div>
144
+ </li>
145
+ <li class="flash-calendar">
146
+ <div class="product">
147
+ <div class="title">
148
+ <strong class="heading">Flash Calendar</strong>
149
+ <p>WordPress flash calendar plugin</p>
150
+ </div>
151
+ </div>
152
+ <div class="description">
153
+ <p>Spider Flash Calendar is a highly configurable Flash calendar plugin which allows you to have multiple organized events.</p>
154
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-events-calendar.html" class="download">Download</a>
155
+ </div>
156
+ </li>
157
+ </ul>
158
+ </form>
159
+ </div >
160
+ <?php
161
+ }
162
+ ////////////////////////////////////////////////////////////////////////////////////////
163
+ // Getters & Setters //
164
+ ////////////////////////////////////////////////////////////////////////////////////////
165
+ ////////////////////////////////////////////////////////////////////////////////////////
166
+ // Private Methods //
167
+ ////////////////////////////////////////////////////////////////////////////////////////
168
+ ////////////////////////////////////////////////////////////////////////////////////////
169
+ // Listeners //
170
+ ////////////////////////////////////////////////////////////////////////////////////////
171
+ }
admin/views/FMViewFormMakerEditCSS_fmc.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewFormMakerEditCSS_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ $theme_id = ((isset($_GET['id'])) ? esc_html(stripslashes($_GET['id'])) : '');
27
+ $form_id = ((isset($_GET['form_id'])) ? esc_html(stripslashes($_GET['form_id'])) : 0);
28
+ $row = $this->model->get_theme_row($theme_id);
29
+ wp_print_scripts('jquery');
30
+ ?>
31
+ <link media="all" type="text/css" href="<?php echo get_admin_url(); ?>load-styles.php?c=1&amp;dir=ltr&amp;load=admin-bar,dashicons,wp-admin,buttons,wp-auth-check" rel="stylesheet">
32
+ <link media="all" type="text/css" href="<?php echo get_admin_url(); ?>css/colors<?php echo ((get_bloginfo('version') < '3.8') ? '-fresh' : ''); ?>.min.css" id="colors-css" rel="stylesheet">
33
+ <link media="all" type="text/css" href="<?php echo WD_FMC_URL . '/css/form_maker_tables.css'; ?>" rel="stylesheet">
34
+ <script src="<?php echo WD_FMC_URL . '/js/form_maker_admin.js'; ?>" type="text/javascript"></script>
35
+
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_fmc.php ADDED
@@ -0,0 +1,477 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewFormMakerPreview_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ $form_id = ((isset($_GET['form_id'])) ? esc_html(stripslashes($_GET['form_id'])) : 0);
27
+ $form = (($form_id) ? $this->model->get_form($form_id) : '');
28
+ wp_print_scripts('jquery');
29
+ wp_print_scripts('jquery-ui-widget');
30
+ wp_print_scripts('jquery-ui-slider');
31
+ wp_print_scripts('jquery-ui-spinner');
32
+ ?>
33
+ <script src="https://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
34
+ <script src="<?php echo WD_FMC_URL . '/js/if_gmap_front_end.js'; ?>" type="text/javascript"></script>
35
+ <script src="<?php echo WD_FMC_URL . '/js/calendar/calendar.js'; ?>" type="text/javascript"></script>
36
+ <script src="<?php echo WD_FMC_URL . '/js/calendar/calendar_function.js'; ?>" type="text/javascript"></script>
37
+ <link media="all" type="text/css" href="<?php echo WD_FMC_URL . '/css/calendar-jos.css'; ?>" rel="stylesheet">
38
+ <link media="all" type="text/css" href="<?php echo WD_FMC_URL . '/css/jquery-ui-1.10.3.custom.css'; ?>" rel="stylesheet">
39
+ <link media="all" type="text/css" href="<?php echo WD_FMC_URL . '/css/jquery-ui-spinner.css'; ?>" rel="stylesheet">
40
+ <?php
41
+ if (isset($_GET['test_theme'])) {
42
+ wp_print_scripts('jquery-effects-shake');
43
+ wp_register_script('main_div_front_end', WD_FMC_URL . '/js/main_div_front_end.js', array(), get_option("wd_form_maker_version"));
44
+ $theme_id = esc_html(stripslashes($_GET['test_theme']));
45
+ require_once (WD_FMC_DIR . '/frontend/controllers/FMControllerForm_maker_fmc.php');
46
+ $controller = new FMControllerForm_maker_fmc();
47
+ echo $controller->execute($form_id, $theme_id);
48
+ die();
49
+ }
50
+ $theme_id = ((isset($_GET['id'])) ? esc_html(stripslashes($_GET['id'])) : '');
51
+ $css = $this->model->get_theme_css($theme_id);
52
+ $id = 'form_id_temp';
53
+ ?>
54
+ <script src="<?php echo WD_FMC_URL . '/js/main_front_end.js'; ?>"></script>
55
+ <style>
56
+ <?php
57
+ echo str_replace('[SITE_ROOT]', WD_FMC_URL, $css);
58
+ ?>
59
+ </style>
60
+ <div id="form_id_temppages" class="wdform_page_navigation" show_title="" show_numbers="" type=""></div>
61
+ <form id="form_preview"><?php echo $form; ?></form>
62
+ <?php
63
+ if ($form) { // Preview from options page.
64
+ die();
65
+ }
66
+ ?>
67
+ <input type="hidden" id="counter<?php echo $id; ?>" value="" name="counter<?php echo $id; ?>" />
68
+ <script>
69
+ var fmc_plugin_url = "<?php echo WD_FMC_URL; ?>";
70
+ /*JURI_ROOT = '<?php echo WD_FMC_URL . '/js' ?>';*/
71
+ document.getElementById('form_preview').innerHTML = window.parent.document.getElementById('take').innerHTML;
72
+ document.getElementById('form_id_temppages').setAttribute('show_title', window.parent.document.getElementById('pages').getAttribute('show_title'));
73
+ document.getElementById('form_id_temppages').setAttribute('show_numbers', window.parent.document.getElementById('pages').getAttribute('show_numbers'));
74
+ document.getElementById('form_id_temppages').setAttribute('type', window.parent.document.getElementById('pages').getAttribute('type'));
75
+ document.getElementById('counterform_id_temp').value = window.parent.gen;
76
+ form_view_count<?php echo $id ?>= 0;
77
+ for (i = 1; i <= 30; i++) {
78
+ if (document.getElementById('<?php echo $id ?>form_view' + i)) {
79
+ form_view_count<?php echo $id ?>++;
80
+ form_view_max<?php echo $id ?>= i;
81
+ document.getElementById('<?php echo $id ?>form_view' + i).parentNode.removeAttribute('style');
82
+ }
83
+ }
84
+ refresh_first();
85
+ if (form_view_count<?php echo $id ?>> 1) {
86
+ for (i = 1; i <= form_view_max<?php echo $id ?>; i++) {
87
+ if (document.getElementById('<?php echo $id ?>form_view' + i)) {
88
+ first_form_view<?php echo $id ?>= i;
89
+ break;
90
+ }
91
+ }
92
+ generate_page_nav(first_form_view<?php echo $id ?>, '<?php echo $id ?>', form_view_count<?php echo $id ?>, form_view_max<?php echo $id ?>);
93
+ }
94
+ function remove_add_(id) {
95
+ attr_name = new Array();
96
+ attr_value = new Array();
97
+ var input = document.getElementById(id);
98
+ atr = input.attributes;
99
+ for (v = 0; v < 30; v++)
100
+ if (atr[v]) {
101
+ if (atr[v].name.indexOf("add_") == 0) {
102
+ attr_name.push(atr[v].name.replace('add_', ''));
103
+ attr_value.push(atr[v].value);
104
+ input.removeAttribute(atr[v].name);
105
+ v--;
106
+ }
107
+ }
108
+ for (v = 0; v < attr_name.length; v++) {
109
+ input.setAttribute(attr_name[v], attr_value[v])
110
+ }
111
+ }
112
+ function refresh_first() {
113
+ n = window.parent.gen;
114
+ for (i = 0; i < n; i++) {
115
+ if (document.getElementById(i)) {
116
+ for (z = 0; z < document.getElementById(i).childNodes.length; z++) {
117
+ if (document.getElementById(i).childNodes[z].nodeType == 3) {
118
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
119
+ }
120
+ }
121
+ if (document.getElementById(i).getAttribute('type') == "type_map") {
122
+ if_gmap_init(i);
123
+ for (q = 0; q < 20; q++) {
124
+ if (document.getElementById(i + "_elementform_id_temp").getAttribute("long" + q)) {
125
+ w_long = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("long" + q));
126
+ w_lat = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("lat" + q));
127
+ w_info = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("info" + q));
128
+ add_marker_on_map(i, q, w_long, w_lat, w_info, false);
129
+ }
130
+ }
131
+ }
132
+ if (document.getElementById(i).getAttribute('type') == "type_mark_map") {
133
+ if_gmap_init(i);
134
+ w_long = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("long" + 0));
135
+ w_lat = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("lat" + 0));
136
+ w_info = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("info" + 0));
137
+ add_marker_on_map(i, 0, w_long, w_lat, w_info, true);
138
+ }
139
+ if (document.getElementById(i).getAttribute('type') == "type_captcha" || document.getElementById(i).getAttribute('type') == "type_recaptcha") {
140
+ if (document.getElementById(i).childNodes[10]) {
141
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
142
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
143
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
144
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
145
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
146
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
147
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
148
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
149
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
150
+ }
151
+ else {
152
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
153
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
154
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
155
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
156
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
157
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
158
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
159
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
160
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
161
+ }
162
+ continue;
163
+ }
164
+ if (document.getElementById(i).getAttribute('type') == "type_section_break") {
165
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
166
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
167
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
168
+ continue;
169
+ }
170
+ if (document.getElementById(i).childNodes[10]) {
171
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
172
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
173
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
174
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
175
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
176
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
177
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
178
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
179
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
180
+ }
181
+ else {
182
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
183
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
184
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
185
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
186
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
187
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
188
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
189
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
190
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
191
+ }
192
+ }
193
+ }
194
+ for (i = 0; i <= n; i++) {
195
+ if (document.getElementById(i)) {
196
+ type = document.getElementById(i).getAttribute("type");
197
+ switch (type) {
198
+ case "type_text":
199
+ case "type_number":
200
+ case "type_password":
201
+ case "type_submitter_mail":
202
+ case "type_own_select":
203
+ case "type_country":
204
+ case "type_hidden":
205
+ case "type_map": {
206
+ remove_add_(i + "_elementform_id_temp");
207
+ break;
208
+ }
209
+ case "type_submit_reset": {
210
+ remove_add_(i + "_element_submitform_id_temp");
211
+ if (document.getElementById(i + "_element_resetform_id_temp")) {
212
+ remove_add_(i + "_element_resetform_id_temp");
213
+ }
214
+ break;
215
+ }
216
+
217
+ case "type_captcha": {
218
+ remove_add_("_wd_captchaform_id_temp");
219
+ remove_add_("_element_refreshform_id_temp");
220
+ remove_add_("_wd_captcha_inputform_id_temp");
221
+ break;
222
+ }
223
+ case "type_recaptcha": {
224
+ remove_add_("wd_recaptchaform_id_temp");
225
+ break;
226
+ }
227
+ case "type_file_upload": {
228
+ remove_add_(i + "_elementform_id_temp");
229
+ break;
230
+ }
231
+ case "type_textarea": {
232
+ remove_add_(i + "_elementform_id_temp");
233
+ break;
234
+ }
235
+ case "type_name": {
236
+ if (document.getElementById(i + "_element_titleform_id_temp")) {
237
+ remove_add_(i + "_element_titleform_id_temp");
238
+ remove_add_(i + "_element_firstform_id_temp");
239
+ remove_add_(i + "_element_lastform_id_temp");
240
+ remove_add_(i + "_element_middleform_id_temp");
241
+ }
242
+ else {
243
+ remove_add_(i + "_element_firstform_id_temp");
244
+ remove_add_(i + "_element_lastform_id_temp");
245
+
246
+ }
247
+ break;
248
+ }
249
+ case "type_phone": {
250
+ remove_add_(i + "_element_firstform_id_temp");
251
+ remove_add_(i + "_element_lastform_id_temp");
252
+ break;
253
+ }
254
+ case "type_address": {
255
+ if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('street1')=='no')
256
+ remove_add_(i+"_street1form_id_temp");
257
+ if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('street2')=='no')
258
+ remove_add_(i+"_street2form_id_temp");
259
+ if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('city')=='no')
260
+ remove_add_(i+"_cityform_id_temp");
261
+ if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('state')=='no')
262
+ remove_add_(i+"_stateform_id_temp");
263
+ if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('postal')=='no')
264
+ remove_add_(i+"_postalform_id_temp");
265
+ if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('country')=='no')
266
+ remove_add_(i+"_countryform_id_temp");
267
+ break;
268
+ }
269
+ case "type_checkbox":
270
+ case "type_radio": {
271
+ is = true;
272
+ for (j = 0; j < 100; j++) {
273
+ if (document.getElementById(i + "_elementform_id_temp" + j)) {
274
+ remove_add_(i + "_elementform_id_temp" + j);
275
+ }
276
+ }
277
+ break;
278
+ }
279
+ case "type_button": {
280
+ for (j = 0; j < 100; j++) {
281
+ if (document.getElementById(i + "_elementform_id_temp" + j)) {
282
+ remove_add_(i + "_elementform_id_temp" + j);
283
+ }
284
+ }
285
+ break;
286
+ }
287
+ case "type_time": {
288
+ if (document.getElementById(i + "_ssform_id_temp")) {
289
+ remove_add_(i + "_ssform_id_temp");
290
+ remove_add_(i + "_mmform_id_temp");
291
+ remove_add_(i + "_hhform_id_temp");
292
+ }
293
+ else {
294
+ remove_add_(i + "_mmform_id_temp");
295
+ remove_add_(i + "_hhform_id_temp");
296
+ }
297
+ break;
298
+ }
299
+ case "type_date": {
300
+ remove_add_(i + "_elementform_id_temp");
301
+ remove_add_(i + "_buttonform_id_temp");
302
+ break;
303
+ }
304
+ case "type_date_fields": {
305
+ remove_add_(i + "_dayform_id_temp");
306
+ remove_add_(i + "_monthform_id_temp");
307
+ remove_add_(i + "_yearform_id_temp");
308
+ break;
309
+ }
310
+ case "type_star_rating": {
311
+ remove_add_(i+"_elementform_id_temp");
312
+ break;
313
+ }
314
+ case "type_scale_rating": {
315
+ remove_add_(i+"_elementform_id_temp");
316
+ break;
317
+ }
318
+ case "type_spinner": {
319
+ remove_add_(i+"_elementform_id_temp");
320
+ var spinner_value = document.getElementById(i+"_elementform_id_temp").getAttribute( "aria-valuenow" );
321
+ var spinner_min_value = document.getElementById(i+"_min_valueform_id_temp").value;
322
+ var spinner_max_value = document.getElementById(i+"_max_valueform_id_temp").value;
323
+ var spinner_step = document.getElementById(i+"_stepform_id_temp").value;
324
+ jQuery( "#"+i+"_elementform_id_temp" ).removeClass( "ui-spinner-input" )
325
+ .prop( "disabled", false )
326
+ .removeAttr( "autocomplete" )
327
+ .removeAttr( "role" )
328
+ .removeAttr( "aria-valuemin" )
329
+ .removeAttr( "aria-valuemax" )
330
+ .removeAttr( "aria-valuenow" );
331
+ span_ui= document.getElementById(i+"_elementform_id_temp").parentNode;
332
+ span_ui.parentNode.appendChild(document.getElementById(i+"_elementform_id_temp"));
333
+ span_ui.parentNode.removeChild(span_ui);
334
+ jQuery("#"+i+"_elementform_id_temp")[0].spin = null;
335
+ spinner = jQuery( "#"+i+"_elementform_id_temp" ).spinner();
336
+ spinner.spinner( "value", spinner_value );
337
+ jQuery( "#"+i+"_elementform_id_temp" ).spinner({ min: spinner_min_value});
338
+ jQuery( "#"+i+"_elementform_id_temp" ).spinner({ max: spinner_max_value});
339
+ jQuery( "#"+i+"_elementform_id_temp" ).spinner({ step: spinner_step});
340
+ break;
341
+ }
342
+ case "type_slider": {
343
+ remove_add_(i+"_elementform_id_temp");
344
+ var slider_value = document.getElementById(i+"_slider_valueform_id_temp").value;
345
+ var slider_min_value = document.getElementById(i+"_slider_min_valueform_id_temp").value;
346
+ var slider_max_value = document.getElementById(i+"_slider_max_valueform_id_temp").value;
347
+ var slider_element_value = document.getElementById( i+"_element_valueform_id_temp" );
348
+ var slider_value_save = document.getElementById( i+"_slider_valueform_id_temp" );
349
+ document.getElementById(i+"_elementform_id_temp").innerHTML = "";
350
+ document.getElementById(i+"_elementform_id_temp").removeAttribute( "class" );
351
+ document.getElementById(i+"_elementform_id_temp").removeAttribute( "aria-disabled" );
352
+ jQuery("#"+i+"_elementform_id_temp")[0].slide = null;
353
+ jQuery( "#"+i+"_elementform_id_temp").slider({
354
+ range: "min",
355
+ value: eval(slider_value),
356
+ min: eval(slider_min_value),
357
+ max: eval(slider_max_value),
358
+ slide: function( event, ui ) {
359
+ slider_element_value.innerHTML = "" + ui.value ;
360
+ slider_value_save.value = "" + ui.value;
361
+
362
+ }
363
+ });
364
+ break;
365
+ }
366
+ case "type_range": {
367
+ remove_add_(i+"_elementform_id_temp0");
368
+ remove_add_(i+"_elementform_id_temp1");
369
+ var spinner_value0 = document.getElementById(i+"_elementform_id_temp0").getAttribute( "aria-valuenow" );
370
+ var spinner_step = document.getElementById(i+"_range_stepform_id_temp").value;
371
+ jQuery( "#"+i+"_elementform_id_temp0" ).removeClass( "ui-spinner-input" )
372
+ .prop( "disabled", false )
373
+ .removeAttr( "autocomplete" )
374
+ .removeAttr( "role" )
375
+ .removeAttr( "aria-valuenow" );
376
+ span_ui= document.getElementById(i+"_elementform_id_temp0").parentNode;
377
+ span_ui.parentNode.appendChild(document.getElementById(i+"_elementform_id_temp0"));
378
+ span_ui.parentNode.removeChild(span_ui);
379
+ jQuery("#"+i+"_elementform_id_temp0")[0].spin = null;
380
+ jQuery("#"+i+"_elementform_id_temp1")[0].spin = null;
381
+ spinner0 = jQuery( "#"+i+"_elementform_id_temp0" ).spinner();
382
+ spinner0.spinner( "value", spinner_value0 );
383
+ jQuery( "#"+i+"_elementform_id_temp0" ).spinner({ step: spinner_step});
384
+ var spinner_value1 = document.getElementById(i+"_elementform_id_temp1").getAttribute( "aria-valuenow" );
385
+ jQuery( "#"+i+"_elementform_id_temp1" ).removeClass( "ui-spinner-input" )
386
+ .prop( "disabled", false )
387
+ .removeAttr( "autocomplete" )
388
+ .removeAttr( "role" )
389
+ .removeAttr( "aria-valuenow" );
390
+ span_ui1= document.getElementById(i+"_elementform_id_temp1").parentNode;
391
+ span_ui1.parentNode.appendChild(document.getElementById(i+"_elementform_id_temp1"));
392
+ span_ui1.parentNode.removeChild(span_ui1);
393
+ spinner1 = jQuery( "#"+i+"_elementform_id_temp1" ).spinner();
394
+ spinner1.spinner( "value", spinner_value1 );
395
+ jQuery( "#"+i+"_elementform_id_temp1" ).spinner({ step: spinner_step});
396
+ break;
397
+ }
398
+ case "type_grading": {
399
+ for (k=0; k<100; k++) {
400
+ if (document.getElementById(i+"_elementform_id_temp"+k)) {
401
+ remove_add_(i+"_elementform_id_temp"+k);
402
+ }
403
+ }
404
+ break;
405
+ }
406
+ case "type_matrix": {
407
+ remove_add_(i+"_elementform_id_temp");
408
+ break;
409
+ }
410
+ }
411
+ }
412
+ }
413
+ for (t = 1; t <= form_view_max<?php echo $id ?>; t++) {
414
+ if (document.getElementById('form_id_tempform_view' + t)) {
415
+ form_view_element = document.getElementById('form_id_tempform_view' + t);
416
+ remove_whitespace(form_view_element);
417
+ xy = form_view_element.childNodes.length - 2;
418
+ for (z = 0; z <= xy; z++) {
419
+ if (form_view_element.childNodes[z]) {
420
+ if (form_view_element.childNodes[z].nodeType != 3) {
421
+ if (!form_view_element.childNodes[z].id) {
422
+ del = true;
423
+ GLOBAL_tr = form_view_element.childNodes[z];
424
+ //////////////////////////////////////////////////////////////////////////////////////////
425
+ for (x = 0; x < GLOBAL_tr.firstChild.childNodes.length; x++) {
426
+ table = GLOBAL_tr.firstChild.childNodes[x];
427
+ tbody = table.firstChild;
428
+ if (tbody.childNodes.length) {
429
+ del = false;
430
+ }
431
+ }
432
+ if (del) {
433
+ form_view_element.removeChild(form_view_element.childNodes[z]);
434
+ }
435
+ }
436
+ }
437
+ }
438
+ }
439
+ }
440
+ }
441
+ for (i = 1; i <= window.parent.form_view_max; i++) {
442
+ if (document.getElementById('form_id_tempform_view' + i)) {
443
+ document.getElementById('form_id_tempform_view' + i).parentNode.removeChild(document.getElementById('form_id_tempform_view_img' + i));
444
+ document.getElementById('form_id_tempform_view' + i).removeAttribute('style');
445
+ }
446
+ }
447
+ }
448
+ function remove_whitespace(node) {
449
+ var ttt;
450
+ for (ttt = 0; ttt < node.childNodes.length; ttt++) {
451
+ if (node.childNodes[ttt] && node.childNodes[ttt].nodeType == '3' && !/\S/.test(node.childNodes[ttt].nodeValue)) {
452
+ node.removeChild(node.childNodes[ttt]);
453
+ ttt--;
454
+ }
455
+ else {
456
+ if (node.childNodes[ttt].childNodes.length) {
457
+ remove_whitespace(node.childNodes[ttt]);
458
+ }
459
+ }
460
+ }
461
+ return;
462
+ }
463
+ </script>
464
+ <?php
465
+ die();
466
+ }
467
+
468
+ ////////////////////////////////////////////////////////////////////////////////////////
469
+ // Getters & Setters //
470
+ ////////////////////////////////////////////////////////////////////////////////////////
471
+ ////////////////////////////////////////////////////////////////////////////////////////
472
+ // Private Methods //
473
+ ////////////////////////////////////////////////////////////////////////////////////////
474
+ ////////////////////////////////////////////////////////////////////////////////////////
475
+ // Listeners //
476
+ ////////////////////////////////////////////////////////////////////////////////////////
477
+ }
admin/views/FMViewFormcontactwdcaptcha.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewFormcontactwdcaptcha {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ if (isset($_GET['action']) && esc_html($_GET['action']) == 'formcontactwdcaptcha') {
27
+ $i = (isset($_GET["i"]) ? esc_html($_GET["i"]) : '');
28
+ $r2 = (isset($_GET["r2"]) ? (int) $_GET["r2"] : 0);
29
+ $rrr = (isset($_GET["rrr"]) ? (int) $_GET["rrr"] : 0);
30
+ $randNum = 0 + $r2 + $rrr;
31
+ $digit = (isset($_GET["digit"]) ? (int) $_GET["digit"] : 6);
32
+ $cap_width = $digit * 10 + 15;
33
+ $cap_height = 26;
34
+ $cap_quality = 100;
35
+ $cap_length_min = $digit;
36
+ $cap_length_max = $digit;
37
+ $cap_digital = 1;
38
+ $cap_latin_char = 1;
39
+ function code_generic($_length, $_digital = 1, $_latin_char = 1) {
40
+ $dig = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
41
+ $lat = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');
42
+ $main = array();
43
+ if ($_digital) {
44
+ $main = array_merge($main, $dig);
45
+ }
46
+ if ($_latin_char) {
47
+ $main = array_merge($main, $lat);
48
+ }
49
+ shuffle($main);
50
+ $pass = substr(implode('', $main), 0, $_length);
51
+ return $pass;
52
+ }
53
+ $l = rand($cap_length_min, $cap_length_max);
54
+ $code = code_generic($l, $cap_digital, $cap_latin_char);
55
+ if (session_id() == '' || (function_exists('session_status') && (session_status() == PHP_SESSION_NONE))) {
56
+ @session_start();
57
+ }
58
+ $_SESSION[$i . '_wd_captcha_code'] = $code;
59
+ $canvas = imagecreatetruecolor($cap_width, $cap_height);
60
+ $c = imagecolorallocate($canvas, rand(150, 255), rand(150, 255), rand(150, 255));
61
+ imagefilledrectangle($canvas, 0, 0, $cap_width, $cap_height, $c);
62
+ $count = strlen($code);
63
+ $color_text = imagecolorallocate($canvas, 0, 0, 0);
64
+ for ($it = 0; $it < $count; $it++) {
65
+ $letter = $code[$it];
66
+ imagestring($canvas, 6, (10 * $it + 10), $cap_height / 4, $letter, $color_text);
67
+ }
68
+ for ($c = 0; $c < 150; $c++) {
69
+ $x = rand(0, $cap_width - 1);
70
+ $y = rand(0, 29);
71
+ $col = '0x' . rand(0, 9) . '0' . rand(0, 9) . '0' . rand(0, 9) . '0';
72
+ imagesetpixel($canvas, $x, $y, $col);
73
+ }
74
+ header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
75
+ header('Cache-Control: no-store, no-cache, must-revalidate');
76
+ header('Cache-Control: post-check=0, pre-check=0', FALSE);
77
+ header('Pragma: no-cache');
78
+ header('Content-Type: image/jpeg');
79
+ imagejpeg($canvas, NULL, $cap_quality);
80
+ }
81
+ die('');
82
+ }
83
+
84
+ ////////////////////////////////////////////////////////////////////////////////////////
85
+ // Getters & Setters //
86
+ ////////////////////////////////////////////////////////////////////////////////////////
87
+ ////////////////////////////////////////////////////////////////////////////////////////
88
+ // Private Methods //
89
+ ////////////////////////////////////////////////////////////////////////////////////////
90
+ ////////////////////////////////////////////////////////////////////////////////////////
91
+ // Listeners //
92
+ ////////////////////////////////////////////////////////////////////////////////////////
93
+ }
admin/views/FMViewFormcontactwindow.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewFormcontactwindow {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ $rows = $this->model->get_form_data();
27
+ ?>
28
+ <html xmlns="http://www.w3.org/1999/xhtml">
29
+ <head>
30
+ <title>Contact Form Maker</title>
31
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
32
+ <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
33
+ <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/mctabs.js"></script>
34
+ <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
35
+
36
+ <?php
37
+ wp_print_scripts('jquery');
38
+ ?>
39
+ <base target="_self">
40
+ </head>
41
+ <body id="link" onLoad="tinyMCEPopup.executeOnLoad('init();');document.body.style.display='';" dir="ltr" class="forceColors">
42
+ <div class="tabs" role="tablist" tabindex="-1">
43
+ <ul>
44
+ <li id="display_tab" class="current" role="tab" tabindex="0">
45
+ <span>
46
+ <a href="javascript:mcTabs.displayTab('display_tab','display_panel');" onMouseDown="return false;" tabindex="-1">Contact Form Maker</a>
47
+ </span>
48
+ </li>
49
+ </ul>
50
+ </div>
51
+ <style>
52
+ .panel_wrapper {
53
+ height: 170px !important;
54
+ }
55
+ </style>
56
+ <div class="panel_wrapper">
57
+ <div id="display_panel" class="panel current">
58
+ <table>
59
+ <tr>
60
+ <td style="vertical-align: middle; text-align: left;">Select a Form</td>
61
+ <td style="vertical-align: middle; text-align: left;">
62
+ <select name="form_maker_id" id="form_maker_id" style="width: 230px; text-align: left;">
63
+ <option value="- Select Form -" selected="selected">- Select a Form -</option>
64
+ <?php
65
+ foreach ($rows as $row) {
66
+ ?>
67
+ <option value="<?php echo $row->id; ?>"><?php echo $row->title; ?></option>
68
+ <?php
69
+ }
70
+ ?>
71
+ </select>
72
+ </td>
73
+ </tr>
74
+ </table>
75
+ </div>
76
+ </div>
77
+ <div class="mceActionPanel">
78
+ <div style="float: left;">
79
+ <input type="button" id="cancel" name="cancel" value="Cancel" onClick="tinyMCEPopup.close();"/>
80
+ </div>
81
+ <div style="float: right;">
82
+ <input type="submit" id="insert" name="insert" value="Insert" onClick="form_maker_insert_shortcode();"/>
83
+ </div>
84
+ </div>
85
+ <script type="text/javascript">
86
+ function form_maker_insert_shortcode() {
87
+ if (document.getElementById('form_maker_id').value == '- Select Form -') {
88
+ tinyMCEPopup.close();
89
+ }
90
+ else {
91
+ var tagtext;
92
+ tagtext = '[wd_contact_form id="' + document.getElementById('form_maker_id').value + '"]';
93
+ window.tinyMCE.execCommand('mceInsertContent', false, tagtext);
94
+ tinyMCEPopup.close();
95
+ }
96
+ }
97
+ </script>
98
+ </body>
99
+ </html>
100
+ <?php
101
+ die();
102
+ }
103
+
104
+ ////////////////////////////////////////////////////////////////////////////////////////
105
+ // Getters & Setters //
106
+ ////////////////////////////////////////////////////////////////////////////////////////
107
+ ////////////////////////////////////////////////////////////////////////////////////////
108
+ // Private Methods //
109
+ ////////////////////////////////////////////////////////////////////////////////////////
110
+ ////////////////////////////////////////////////////////////////////////////////////////
111
+ // Listeners //
112
+ ////////////////////////////////////////////////////////////////////////////////////////
113
+ }
admin/views/FMViewFromeditcountryinpopup_fmc.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_FMC_URL . '/images/save.png'; ?>" onClick="save_list()" />
36
+ <img title="Cancel" style=" cursor: pointer; vertical-align: middle;" src="<?php echo WD_FMC_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_fmc.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_FMC_URL . '/js/main_front_end.js'; ?>"></script>
30
+ <script src="<?php echo WD_FMC_URL . '/js/if_gmap_back_end.js'; ?>"></script>
31
+ <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
32
+ <table style="margin:0px; padding:0px">
33
+ <tr>
34
+ <td><b>Address:</b></td>
35
+ <td><input type="text" id="addrval0" style="border:0px; background:none" size="80" readonly/></td>
36
+ </tr>
37
+ <tr>
38
+ <td><b>Longitude:</b></td>
39
+ <td><input type="text" id="longval0" style="border:0px; background:none" size="80" readonly/></td>
40
+ </tr>
41
+ <tr>
42
+ <td><b>Latitude:</b></td>
43
+ <td><input type="text" id="latval0" style="border:0px; background:none" size="80" readonly/></td>
44
+ </tr>
45
+ </table>
46
+ <div id="0_elementform_id_temp" long="<?php echo $long ?>" center_x="<?php echo $long ?>" center_y="<?php echo $lat ?>" lat="<?php echo $lat ?>" zoom="8" info="" style="width:600px; height:400px; "></div>
47
+ <script>
48
+ if_gmap_init("0");
49
+ add_marker_on_map(0, 0, "<?php echo $long; ?>", "<?php echo $lat; ?>", "");
50
+ </script>
51
+ <?php
52
+ die();
53
+ }
54
+
55
+ ////////////////////////////////////////////////////////////////////////////////////////
56
+ // Getters & Setters //
57
+ ////////////////////////////////////////////////////////////////////////////////////////
58
+ ////////////////////////////////////////////////////////////////////////////////////////
59
+ // Private Methods //
60
+ ////////////////////////////////////////////////////////////////////////////////////////
61
+ ////////////////////////////////////////////////////////////////////////////////////////
62
+ // Listeners //
63
+ ////////////////////////////////////////////////////////////////////////////////////////
64
+ }
admin/views/FMViewGenerete_csv_fmc.php 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_fmc.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_fmc.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewLicensing_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ ?>
27
+ <div style="width:99%">
28
+ <p>This plugin is the non-commercial version of the Contact Form Maker. Use of this plugin is free. You can add not more than 7 fields. The limitation is on the some types of the fields (File Upload, Map and Paypal). If you want to use those fields, you are required to purchase a license. </p>
29
+ <br/>
30
+ <a href="http://web-dorado.com/files/fromContactForm.php" class="button-primary" target="_blank">Purchase a License</a>
31
+ <br/><br/>
32
+ <p>After the purchasing the commercial version follow this steps:</p>
33
+ <ol>
34
+ <li>Deactivate Contact Form Maker Plugin.</li>
35
+ <li>Delete Contact Form Maker Plugin.</li>
36
+ <li>Install the downloaded commercial version of the plugin.</li>
37
+ </ol>
38
+ <br/>
39
+ <p>If you enjoy using Contact Form Maker and find it useful, please consider making a donation. Your donation will help encourage and support the plugin's continued development and better user support.</p>
40
+ <br/>
41
+ <a href="http://web-dorado.com/files/donate_redirect.php" target="_blank"><img src="<?php echo WD_FMC_URL . '/images/btn_donateCC_LG.gif'; ?>" /></a>
42
+ </div>
43
+ <?php
44
+ }
45
+ ////////////////////////////////////////////////////////////////////////////////////////
46
+ // Getters & Setters //
47
+ ////////////////////////////////////////////////////////////////////////////////////////
48
+ ////////////////////////////////////////////////////////////////////////////////////////
49
+ // Private Methods //
50
+ ////////////////////////////////////////////////////////////////////////////////////////
51
+ ////////////////////////////////////////////////////////////////////////////////////////
52
+ // Listeners //
53
+ ////////////////////////////////////////////////////////////////////////////////////////
54
+ }
admin/views/FMViewManage_fmc.php ADDED
@@ -0,0 +1,3785 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewManage_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ // Constructor & Destructor //
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct($model) {
19
+ $this->model = $model;
20
+ }
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ $rows_data = $this->model->get_rows_data();
27
+ $page_nav = $this->model->page_nav();
28
+ $search_value = ((isset($_POST['search_value'])) ? esc_html($_POST['search_value']) : '');
29
+ $search_select_value = ((isset($_POST['search_select_value'])) ? (int) $_POST['search_select_value'] : 0);
30
+ $asc_or_desc = ((isset($_POST['asc_or_desc'])) ? esc_html($_POST['asc_or_desc']) : 'asc');
31
+ $order_by = (isset($_POST['order_by']) ? esc_html($_POST['order_by']) : 'id');
32
+ $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
33
+ $ids_string = '';
34
+ ?>
35
+ <div style="clear: both; float: left; width: 99%;">
36
+ <div style="float:left; font-size: 14px; font-weight: bold;">
37
+ This section allows you to create, edit forms.
38
+ <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-form-maker-guide-2.html">Read More in User Manual</a>
39
+ </div>
40
+ <div style="float: right; text-align: right;">
41
+ <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/files/fromContactForm.php">
42
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FMC_URL . '/images/wd_logo.png'; ?>" />
43
+ </a>
44
+ </div>
45
+ </div>
46
+ <form onkeypress="spider_doNothing(event)" class="wrap" id="manage_form" method="post" action="admin.php?page=manage_fmc" style="float: left; width: 99%;">
47
+ <span class="form_maker_icon"></span>
48
+ <h2>
49
+ Contact Form Maker
50
+ <a href="" class="add-new-h2" onclick="spider_set_input_value('task', 'add');
51
+ spider_form_submit(event, 'manage_form')">Add new</a>
52
+ </h2>
53
+ <div class="tablenav top">
54
+ <?php
55
+ WDW_FMC_Library::search('Title', $search_value, 'manage_form');
56
+ WDW_FMC_Library::html_page_nav($page_nav['total'], $page_nav['limit'], 'manage_form');
57
+ ?>
58
+ </div>
59
+ <table class="wp-list-table widefat fixed pages">
60
+ <thead>
61
+ <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin:0;"/></th>
62
+ <th class="table_small_col <?php if ($order_by == 'id') { echo $order_class; } ?>">
63
+ <a onclick="spider_set_input_value('task', '');
64
+ spider_set_input_value('order_by', 'id');
65
+ spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html($_POST['order_by']) == 'id') && esc_html($_POST['asc_or_desc']) == 'asc') ? 'desc' : 'asc'); ?>');
66
+ spider_form_submit(event, 'manage_form')" href="">
67
+ <span>ID</span><span class="sorting-indicator"></span></a>
68
+ </th>
69
+ <th class="<?php if ($order_by == 'title') { echo $order_class; } ?>">
70
+ <a onclick="spider_set_input_value('task', '');
71
+ spider_set_input_value('order_by', 'title');
72
+ spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html($_POST['order_by']) == 'title') && esc_html($_POST['asc_or_desc']) == 'asc') ? 'desc' : 'asc'); ?>');
73
+ spider_form_submit(event, 'manage_form')" href="">
74
+ <span>Title</span><span class="sorting-indicator"></span></a>
75
+ </th>
76
+ <th class="<?php if ($order_by == 'mail') { echo $order_class; } ?>">
77
+ <a onclick="spider_set_input_value('task', '');
78
+ spider_set_input_value('order_by', 'mail');
79
+ spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html($_POST['order_by']) == 'mail') && esc_html($_POST['asc_or_desc']) == 'asc') ? 'desc' : 'asc'); ?>');
80
+ spider_form_submit(event, 'manage_form')" href="">
81
+ <span>Email to send submissions to</span><span class="sorting-indicator"></span></a>
82
+ </th>
83
+ <th class="table_big_col" style="width: 140px;">Shortcode</th>
84
+ <th class="table_big_col">Edit</th>
85
+ <th class="table_big_col"><a title="Delete selected items" href="" onclick="if (confirm('Do you want to delete selected items?')) {
86
+ spider_set_input_value('task', 'delete_all');
87
+ spider_form_submit(event, 'manage_form');
88
+ } else {
89
+ return false;
90
+ }">Delete</a></th>
91
+ </thead>
92
+ <tbody id="tbody_arr">
93
+ <?php
94
+ if ($rows_data) {
95
+ foreach ($rows_data as $row_data) {
96
+ $alternate = (!isset($alternate) || $alternate == 'class="alternate"') ? '' : 'class="alternate"';
97
+ $old = '';
98
+ if (isset($row_data->form) && ($row_data->form != '')) {
99
+ $old = '_old';
100
+ }
101
+ ?>
102
+ <tr id="tr_<?php echo $row_data->id; ?>" <?php echo $alternate; ?>>
103
+ <td class="table_small_col check-column">
104
+ <input id="check_<?php echo $row_data->id; ?>" name="check_<?php echo $row_data->id; ?>" type="checkbox"/>
105
+ </td>
106
+ <td class="table_small_col"><?php echo $row_data->id; ?></td>
107
+ <td>
108
+ <a onclick="spider_set_input_value('task', 'edit<?php echo $old; ?>');
109
+ spider_set_input_value('current_id', '<?php echo $row_data->id; ?>');
110
+ spider_form_submit(event, 'manage_form')" href="" title="Edit"><?php echo $row_data->title; ?></a>
111
+ </td>
112
+ <td><?php echo $row_data->mail; ?></td>
113
+ <td class="table_big_col" style="padding-left: 0; padding-right: 0; width: 140px;">
114
+ <input type="text" value='[wd_contact_form id="<?php echo $row_data->id; ?>"]' onclick="spider_select_value(this)" size="12" readonly="readonly" style="padding-left: 1px; padding-right: 1px;width: 139px;"/>
115
+ </td>
116
+ <td class="table_big_col">
117
+ <a onclick="spider_set_input_value('task', 'edit<?php echo $old; ?>');
118
+ spider_set_input_value('current_id', '<?php echo $row_data->id; ?>');
119
+ spider_form_submit(event, 'manage_form')" href="">Edit</a>
120
+ </td>
121
+ <td class="table_big_col">
122
+ <a onclick="spider_set_input_value('task', 'delete');
123
+ spider_set_input_value('current_id', '<?php echo $row_data->id; ?>');
124
+ spider_form_submit(event, 'manage_form')" href="">Delete</a>
125
+ </td>
126
+ </tr>
127
+ <?php
128
+ $ids_string .= $row_data->id . ',';
129
+ }
130
+ }
131
+ ?>
132
+ </tbody>
133
+ </table>
134
+ <input id="task" name="task" type="hidden" value=""/>
135
+ <input id="current_id" name="current_id" type="hidden" value=""/>
136
+ <input id="ids_string" name="ids_string" type="hidden" value="<?php echo $ids_string; ?>"/>
137
+ <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="asc"/>
138
+ <input id="order_by" name="order_by" type="hidden" value="<?php echo $order_by; ?>"/>
139
+ </form>
140
+ <?php
141
+ }
142
+
143
+ public function edit($id) {
144
+ // header("X-XSS-Protection: 0");
145
+ $row = $this->model->get_row_data_new($id);
146
+ $themes = $this->model->get_theme_rows_data();
147
+ $labels = array();
148
+ $label_id = array();
149
+ $label_order_original = array();
150
+ $label_type = array();
151
+ $label_all = explode('#****#', $row->label_order);
152
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
153
+ foreach ($label_all as $key => $label_each) {
154
+ $label_id_each = explode('#**id**#', $label_each);
155
+ array_push($label_id, $label_id_each[0]);
156
+ $label_oder_each = explode('#**label**#', $label_id_each[1]);
157
+ array_push($label_order_original, addslashes($label_oder_each[0]));
158
+ array_push($label_type, $label_oder_each[1]);
159
+ }
160
+ $labels['id'] = '"' . implode('","', $label_id) . '"';
161
+ $labels['label'] = '"' . implode('","', $label_order_original) . '"';
162
+ $labels['type'] = '"' . implode('","', $label_type) . '"';
163
+ $page_title = (($id != 0) ? 'Edit form ' . $row->title : 'Create new form');
164
+ ?>
165
+ <script type="text/javascript">
166
+ var fmc_plugin_url = "<?php echo WD_FMC_URL; ?>";
167
+ </script>
168
+ <script src="<?php echo WD_FMC_URL . '/js/formmaker_div_free.js'; ?>" type="text/javascript"></script>
169
+ <script type="text/javascript">
170
+ form_view = 1;
171
+ form_view_count = 1;
172
+ form_view_max = 1;
173
+ function submitbutton() {
174
+ <?php
175
+ if ($id) {
176
+ ?>
177
+ if (!document.getElementById('araqel') || (document.getElementById('araqel').value == '0')) {
178
+ alert('Please wait while page loading.');
179
+ return false;
180
+ }
181
+ <?php
182
+ }
183
+ ?>
184
+ tox = '';
185
+ form_fields = '';
186
+ document.getElementById('take').style.display = "none";
187
+ document.getElementById('page_bar').style.display = "none";
188
+ document.getElementById('saving').style.display = "block";
189
+ remove_whitespace(document.getElementById('take'));
190
+ l_id_array = [<?php echo $labels['id']?>];
191
+ l_label_array = [<?php echo $labels['label']?>];
192
+ l_type_array = [<?php echo $labels['type']?>];
193
+ l_id_removed = [];
194
+ for (x = 0; x < l_id_array.length; x++) {
195
+ l_id_removed[l_id_array[x]] = true;
196
+ }
197
+ for (t = 1; t <= form_view_max; t++) {
198
+ if (document.getElementById('form_id_tempform_view' + t)) {
199
+ wdform_page = document.getElementById('form_id_tempform_view' + t);
200
+ remove_whitespace(wdform_page);
201
+ n = wdform_page.childNodes.length - 2;
202
+ for (q = 0; q <= n; q++) {
203
+ if (!wdform_page.childNodes[q].getAttribute("wdid")) {
204
+ wdform_section = wdform_page.childNodes[q];
205
+ for (x = 0; x < wdform_section.childNodes.length; x++) {
206
+ wdform_column = wdform_section.childNodes[x];
207
+ if (wdform_column.firstChild) {
208
+ for (y=0; y < wdform_column.childNodes.length; y++) {
209
+ is_in_old = false;
210
+ wdform_row = wdform_column.childNodes[y];
211
+ if (wdform_row.nodeType == 3) {
212
+ continue;
213
+ }
214
+ wdid = wdform_row.getAttribute("wdid");
215
+ if (!wdid) {
216
+ continue;
217
+ }
218
+ l_id = wdid;
219
+ l_label = document.getElementById(wdid + '_element_labelform_id_temp').innerHTML;
220
+ l_label = l_label.replace(/(\r\n|\n|\r)/gm," ");
221
+ wdtype = wdform_row.firstChild.getAttribute('type');
222
+ for (z = 0; z < l_id_array.length; z++) {
223
+ if (l_id_array[z] == wdid) {
224
+ if (l_type_array[z] == "type_address") {
225
+ if (document.getElementById(l_id + "_mini_label_street1")) {
226
+ l_id_removed[l_id_array[z]] = false;
227
+ }
228
+ if (document.getElementById(l_id + "_mini_label_street2")) {
229
+ l_id_removed[parseInt(l_id_array[z]) + 1] = false;
230
+ }
231
+ if (document.getElementById(l_id + "_mini_label_city")) {
232
+ l_id_removed[parseInt(l_id_array[z]) + 2] = false;
233
+ }
234
+ if (document.getElementById(l_id + "_mini_label_state")) {
235
+ l_id_removed[parseInt(l_id_array[z]) + 3] = false;
236
+ }
237
+ if (document.getElementById(l_id+"_mini_label_postal")) {
238
+ l_id_removed[parseInt(l_id_array[z]) + 4] = false;
239
+ }
240
+ if (document.getElementById(l_id+"_mini_label_country")) {
241
+ l_id_removed[parseInt(l_id_array[z]) + 5] = false;
242
+ }
243
+ z = z + 5;
244
+ }
245
+ else {
246
+ l_id_removed[l_id] = false;
247
+ }
248
+ }
249
+ }
250
+ if (wdtype == "type_address") {
251
+ addr_id = parseInt(wdid);
252
+ id_for_country = addr_id;
253
+ if (document.getElementById(id_for_country + "_mini_label_street1")) {
254
+ tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_street1").innerHTML + '#**label**#type_address#****#';
255
+ addr_id++;
256
+ }
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
+ alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
360
+ for (x = 0; x < 14; x++) {
361
+ document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FMC_URL . '/images/'; ?>" + alltypes[x] + ".png";
362
+ }
363
+ if (document.getElementById('formMakerDiv').style.display == 'block') {
364
+ jQuery('#formMakerDiv').slideToggle(200);
365
+ }
366
+ else {
367
+ jQuery('#formMakerDiv').slideToggle(400);
368
+ }
369
+ if (document.getElementById('formMakerDiv').offsetWidth) {
370
+ document.getElementById('formMakerDiv1').style.width = (document.getElementById('formMakerDiv').offsetWidth - 60) + 'px';
371
+ }
372
+ if (document.getElementById('formMakerDiv1').style.display == 'block') {
373
+ jQuery('#formMakerDiv1').slideToggle(200);
374
+ }
375
+ else {
376
+ jQuery('#formMakerDiv1').slideToggle(400);
377
+ }
378
+ document.getElementById('when_edit').style.display = 'none';
379
+ }
380
+
381
+ function enable2() {
382
+ alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
383
+ for (x = 0; x < 14; x++) {
384
+ document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FMC_URL . '/images/'; ?>" + alltypes[x] + ".png";
385
+ }
386
+ if (document.getElementById('formMakerDiv').style.display == 'block') {
387
+ jQuery('#formMakerDiv').slideToggle(200);
388
+ }
389
+ else {
390
+ jQuery('#formMakerDiv').slideToggle(400);
391
+ }
392
+ if (document.getElementById('formMakerDiv').offsetWidth) {
393
+ document.getElementById('formMakerDiv1').style.width = (document.getElementById('formMakerDiv').offsetWidth - 60) + 'px';
394
+ }
395
+ if (document.getElementById('formMakerDiv1').style.display == 'block') {
396
+ jQuery('#formMakerDiv1').slideToggle(200);
397
+ }
398
+ else {
399
+ jQuery('#formMakerDiv1').slideToggle(400);
400
+ }
401
+ document.getElementById('when_edit').style.display = 'block';
402
+ if (document.getElementById('field_types').offsetWidth) {
403
+ document.getElementById('when_edit').style.width = document.getElementById('field_types').offsetWidth + 'px';
404
+ }
405
+ if (document.getElementById('field_types').offsetHeight) {
406
+ document.getElementById('when_edit').style.height = document.getElementById('field_types').offsetHeight + 'px';
407
+ }
408
+ }
409
+ </script>
410
+ <div style="clear: both; float: left; width: 99%;">
411
+ <div style="float:left; font-size: 14px; font-weight: bold;">
412
+ This section allows you to add fields to your form.
413
+ <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>
414
+ </div>
415
+ <div style="float: right; text-align: right;">
416
+ <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/files/fromContactForm.php">
417
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FMC_URL . '/images/wd_logo.png'; ?>" />
418
+ </a>
419
+ </div>
420
+ </div>
421
+ <form class="wrap" id="manage_form" method="post" action="admin.php?page=manage_fmc" style="float: left; width: 99%;">
422
+ <h2><?php echo $page_title; ?></h2>
423
+ <div style="float: right; margin: 0 5px 0 0;">
424
+ <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"/>
425
+ <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"/>
426
+ <?php
427
+ if ($id) {
428
+ ?>
429
+ <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"/>
430
+ <?php
431
+ }
432
+ ?>
433
+ <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"/>
434
+ <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"/>
435
+ <input class="button-secondary" type="submit" onclick="spider_set_input_value('task', 'cancel')" value="Cancel"/>
436
+ </div>
437
+
438
+ <div class="formmaker_table" width="100%">
439
+ <div style="float: left; text-align: center;"><br />
440
+ <span class="cfm_logo cfm_black">Contact</span>
441
+ <span class="cfm_logo cfm_white">Form</span>
442
+ <span class="cfm_logo cfm_black">Maker</span><br /><br />
443
+ <img src="<?php echo WD_FMC_URL . '/images/logo.png'; ?>" />
444
+ </div>
445
+ <div style="float:right">
446
+ <span style="font-size: 16.76pt; font-family: tahoma; color: #FFFFFF; vertical-align: middle;">Form title:&nbsp;&nbsp;</span>
447
+ <input id="title" name="title" class="form_maker_title" value="<?php echo $row->title; ?>"/>
448
+ <br />
449
+ <img src="<?php echo WD_FMC_URL . '/images/formoptions.png'; ?>" onclick="if (spider_check_required('title', 'Form title') || !submitbutton()) {return false;}; spider_set_input_value('task', 'form_options'); spider_form_submit(event, 'manage_form');" style="cursor: pointer; margin: 10px 0 10px 10px; float: right;"/>
450
+ <br /><br /><br />
451
+ <img src="<?php echo WD_FMC_URL . '/images/addanewfield.png'; ?>" onclick=" enable(); Enable(); " style="cursor: pointer; margin:10px 0 10px 10px; float: right;"/>
452
+ </div>
453
+ </div>
454
+
455
+ <div id="formMakerDiv" onclick="close_window()"></div>
456
+ <div id="formMakerDiv1" style="padding-top: 20px;" align="center">
457
+ <table border="0" width="100%" cellpadding="0" cellspacing="0" height="100%" style="border: 6px #00aeef solid; background-color: #FFF;">
458
+ <tr>
459
+ <td style="padding:0px">
460
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
461
+ <tr valign="top">
462
+ <td width="15%" height="100%" style="border-right: dotted black 1px;" id="field_types">
463
+ <div id="when_edit" style="display: none;"></div>
464
+ <table border="0" cellpadding="0" cellspacing="3" width="100%">
465
+ <tr>
466
+ <td align="center" onClick="addRow('customHTML')" style="cursor:pointer" id="table_editor" class="field_buttons">
467
+ <img src="<?php echo WD_FMC_URL . '/images/customHTML.png'; ?>" style="margin:5px" id="img_customHTML"/>
468
+ </td>
469
+ <td align="center" onClick="addRow('text')" style="cursor:pointer" id="table_text" class="field_buttons">
470
+ <img src="<?php echo WD_FMC_URL . '/images/text.png'; ?>" style="margin:5px" id="img_text"/>
471
+ </td>
472
+ </tr>
473
+ <tr>
474
+ <td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_checkbox" class="field_buttons">
475
+ <img src="<?php echo WD_FMC_URL . '/images/checkbox.png'; ?>" style="margin:5px" id="img_checkbox"/>
476
+ </td>
477
+ <td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_radio" class="field_buttons">
478
+ <img src="<?php echo WD_FMC_URL . '/images/radio.png'; ?>" style="margin:5px" id="img_radio"/>
479
+ </td>
480
+ </tr>
481
+ <tr>
482
+ <td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" class="field_buttons" id="table_survey">
483
+ <img src="<?php echo WD_FMC_URL . '/images/survey.png'; ?>" style="margin:5px" id="img_survey"/>
484
+ </td>
485
+ <td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_time_and_date" class="field_buttons">
486
+ <img src="<?php echo WD_FMC_URL . '/images/time_and_date.png'; ?>" style="margin:5px" id="img_time_and_date"/>
487
+ </td>
488
+ </tr>
489
+ <tr>
490
+ <td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_select" class="field_buttons">
491
+ <img src="<?php echo WD_FMC_URL . '/images/select.png'; ?>" style="margin:5px" id="img_select"/>
492
+ </td>
493
+ <td align="center" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_file_upload" class="field_buttons"
494
+ onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')">
495
+ <img src="<?php echo WD_FMC_URL . '/images/file_upload.png'; ?>" style="margin:5px" id="img_file_upload" />
496
+ </td>
497
+ </tr>
498
+ <tr>
499
+ <td align="center" onClick="addRow('section_break')" style="cursor:pointer" id="table_section_break" class="field_buttons">
500
+ <img src="<?php echo WD_FMC_URL . '/images/section_break.png'; ?>" style="margin:5px" id="img_section_break"/>
501
+ </td>
502
+ <td align="center" onClick="addRow('page_break')" style="cursor:pointer" id="table_page_break" class="field_buttons">
503
+ <img src="<?php echo WD_FMC_URL . '/images/page_break.png'; ?>" style="margin:5px" id="img_page_break"/>
504
+ </td>
505
+ </tr>
506
+ <tr>
507
+ <td align="center" id="table_map" class="field_buttons" onClick="addRow('map')">
508
+ <img src="<?php echo WD_FMC_URL . '/images/map.png'; ?>" style="margin:5px" id="img_map" />
509
+ </td>
510
+ <td align="center" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_paypal" class="field_buttons"
511
+ onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')">
512
+ <img src="<?php echo WD_FMC_URL . '/images/paypal.png'; ?>" style="margin:5px" id="img_paypal" />
513
+ </td>
514
+ </tr>
515
+ <tr>
516
+ <td align="center" onClick="addRow('captcha')" style="cursor:pointer" id="table_captcha" class="field_buttons">
517
+ <img src="<?php echo WD_FMC_URL . '/images/captcha.png'; ?>" style="margin:5px" id="img_captcha"/>
518
+ </td>
519
+ <td align="center" onClick="addRow('button')" id="table_button" class="field_buttons">
520
+ <img src="<?php echo WD_FMC_URL . '/images/button.png'; ?>" style="margin:5px" id="img_button"/>
521
+ </td>
522
+ </tr>
523
+ </table>
524
+ </td>
525
+ <td width="35%" height="100%" align="left">
526
+ <div id="edit_table" style="padding:0px; overflow-y:scroll; height:575px"></div>
527
+ </td>
528
+ <td align="center" valign="top" style="background: url("<?php echo WD_FMC_URL . '/images/border2.png'; ?>") repeat-y;">&nbsp;</td>
529
+ <td style="padding:15px">
530
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
531
+ <tr>
532
+ <td align="right">
533
+ <input type="radio" value="end" name="el_pos" checked="checked" id="pos_end" onclick="Disable()"/>
534
+ At The End
535
+ <input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
536
+ At The Beginning
537
+ <input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
538
+ Before
539
+ <select style="width: 100px; margin-left: 5px;" id="sel_el_pos" onclick="change_before()" disabled="disabled"></select>
540
+ <img alt="ADD" title="add" style="cursor:pointer; vertical-align:middle; margin:5px" src="<?php echo WD_FMC_URL . '/images/save.png'; ?>" onClick="add(0)"/>
541
+ <img alt="CANCEL" title="cancel" style="cursor: pointer; vertical-align:middle; margin:5px" src="<?php echo WD_FMC_URL . '/images/cancel_but.png'; ?>" onClick="close_window()"/>
542
+ <hr style=" margin-bottom:10px" />
543
+ </td>
544
+ </tr>
545
+ <tr height="100%" valign="top">
546
+ <td id="show_table"></td>
547
+ </tr>
548
+ </table>
549
+ </td>
550
+ </tr>
551
+ </table>
552
+ </td>
553
+ </tr>
554
+ </table>
555
+ <input type="hidden" id="old" />
556
+ <input type="hidden" id="old_selected" />
557
+ <input type="hidden" id="element_type" />
558
+ <input type="hidden" id="editing_id" />
559
+ <input type="hidden" value="<?php echo WD_FMC_URL; ?>" id="form_plugins_url" />
560
+ <div id="main_editor" style="position: absolute; display: none; z-index: 140;">
561
+ <?php
562
+ if (user_can_richedit()) {
563
+ wp_editor('', 'form_maker_editor', array('teeny' => FALSE, 'textarea_name' => 'form_maker_editor', 'media_buttons' => FALSE, 'textarea_rows' => 5));
564
+ }
565
+ else {
566
+ ?>
567
+ <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>
568
+ <?php
569
+ }
570
+ ?>
571
+ </div>
572
+ </div>
573
+ <?php
574
+ if (!function_exists('the_editor')) {
575
+ ?>
576
+ <iframe id="tinymce" style="display: none;"></iframe>
577
+ <?php
578
+ }
579
+ ?>
580
+ <br /><br />
581
+ <fieldset>
582
+ <legend><h2 style="color: #00aeef;">Form</h2></legend>
583
+ <div id="saving" style="display:none;">
584
+ <div id="saving_text">Saving</div>
585
+ <div id="fadingBarsG">
586
+ <div id="fadingBarsG_1" class="fadingBarsG"></div>
587
+ <div id="fadingBarsG_2" class="fadingBarsG"></div>
588
+ <div id="fadingBarsG_3" class="fadingBarsG"></div>
589
+ <div id="fadingBarsG_4" class="fadingBarsG"></div>
590
+ <div id="fadingBarsG_5" class="fadingBarsG"></div>
591
+ <div id="fadingBarsG_6" class="fadingBarsG"></div>
592
+ <div id="fadingBarsG_7" class="fadingBarsG"></div>
593
+ <div id="fadingBarsG_8" class="fadingBarsG"></div>
594
+ </div>
595
+ </div>
596
+ <?php
597
+ if ($id) {
598
+ ?>
599
+ <div style="margin: 8px; display: table; width: 100%;" id="page_bar">
600
+ <div id="page_navigation" style="display: table-row;">
601
+ <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>
602
+ <div align="left" id="edit_page_navigation" style="display: table-cell; vertical-align: middle;"></div>
603
+ </div>
604
+ </div>
605
+ <div id="take" class="main">
606
+ <?php
607
+ echo $row->form_front;
608
+ ?>
609
+ </div>
610
+ <?php
611
+ }
612
+ else {
613
+ ?>
614
+ <div style="margin:8px; display:table; width:100%" id="page_bar">
615
+ <div id="page_navigation" style="display:table-row">
616
+ <div align="center" id="pages" show_title="false" show_numbers="true" type="none" style="display:table-cell; width:90%"></div>
617
+ <div align="left" id="edit_page_navigation" style="display:table-cell; vertical-align: middle;"></div>
618
+ </div>
619
+ </div>
620
+ <div id="take" class="main">
621
+ <div class="wdform-page-and-images" style="display:table; border-top:0px solid black;">
622
+ <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">
623
+ <div class="wdform_section"><div class="wdform_column"></div></div>
624
+ <div valign="top" class="wdform_footer" style="width: 100%;">
625
+ <div style="width: 100%;">
626
+ <div style="width: 100%; display: table;">
627
+ <div style="display: table-row-group;">
628
+ <div id="form_id_temppage_nav1" style="display: table-row;"></div>
629
+ </div>
630
+ </div>
631
+ </div>
632
+ </div>
633
+ </div>
634
+ <div id="form_id_tempform_view_img1" style="float: right;">
635
+ <div>
636
+ <img src="<?php echo WD_FMC_URL . '/images/minus.png'; ?>" title="Show or hide the page" class="page_toolbar" onClick="show_or_hide('1')" onMouseOver="chnage_icons_src(this,'minus')" onmouseout="chnage_icons_src(this,'minus')" id="show_page_img_1"/>
637
+ <img src="<?php echo WD_FMC_URL . '/images/page_delete.png'; ?>" title="Delete the page" class="page_toolbar" onClick="remove_page('1')" onMouseOver="chnage_icons_src(this,'page_delete')" onmouseout="chnage_icons_src(this,'page_delete')"/>
638
+ <img src="<?php echo WD_FMC_URL . '/images/page_delete_all.png'; ?>" title="Delete the page with fields" class="page_toolbar" onClick="remove_page_all('1')" onMouseOver="chnage_icons_src(this,'page_delete_all')" onmouseout="chnage_icons_src(this,'page_delete_all')"/>
639
+ <img src="<?php echo WD_FMC_URL . '/images/page_edit.png'; ?>" title="Edit the page" class="page_toolbar" onClick="edit_page_break('1')" onMouseOver="chnage_icons_src(this,'page_edit')" onmouseout="chnage_icons_src(this,'page_edit')"/>
640
+ </div>
641
+ </div>
642
+ </div>
643
+ </div>
644
+ <?php
645
+ }
646
+ ?>
647
+ </fieldset>
648
+ <input type="hidden" name="form_front" id="form_front" />
649
+ <input type="hidden" name="form_fields" id="form_fields" />
650
+ <input type="hidden" name="pagination" id="pagination" />
651
+ <input type="hidden" name="show_title" id="show_title" />
652
+ <input type="hidden" name="show_numbers" id="show_numbers" />
653
+ <input type="hidden" name="public_key" id="public_key" />
654
+ <input type="hidden" name="private_key" id="private_key" />
655
+ <input type="hidden" name="recaptcha_theme" id="recaptcha_theme" />
656
+ <input type="hidden" id="label_order" name="label_order" value="<?php echo $row->label_order; ?>" />
657
+ <input type="hidden" id="label_order_current" name="label_order_current" value="<?php echo $row->label_order_current; ?>" />
658
+ <input type="hidden" name="counter" id="counter" value="<?php echo $row->counter; ?>" />
659
+ <input type="hidden" id="araqel" value="0" />
660
+ <?php
661
+ if ($id) {
662
+ ?>
663
+ <script type="text/javascript">
664
+ function formOnload() {
665
+ // Enable maps.
666
+ for (t = 0; t < <?php echo $row->counter; ?>; t++) {
667
+ if (document.getElementById(t + "_typeform_id_temp")) {
668
+ if (document.getElementById(t + "_typeform_id_temp").value == "type_map" || document.getElementById(t + "_typeform_id_temp").value == "type_mark_map") {
669
+ if_gmap_init(t);
670
+ for (q = 0; q < 20; q++) {
671
+ if (document.getElementById(t + "_elementform_id_temp").getAttribute("long" + q)) {
672
+ w_long = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("long" + q));
673
+ w_lat = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("lat" + q));
674
+ w_info = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("info" + q));
675
+ add_marker_on_map(t, q, w_long, w_lat, w_info, false);
676
+ }
677
+ }
678
+ }
679
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_date") {
680
+ // Calendar.setup({
681
+ // inputField:t + "_elementform_id_temp",
682
+ // ifFormat:document.getElementById(t + "_buttonform_id_temp").getAttribute('format'),
683
+ // button:t + "_buttonform_id_temp",
684
+ // align:"Tl",
685
+ // singleClick:true,
686
+ // firstDay:0
687
+ // });
688
+ }
689
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_name") {
690
+ var myu = t;
691
+ jQuery(document).ready(function () {
692
+ jQuery("#" + myu + "_mini_label_first").click(function () {
693
+ if (jQuery(this).children('input').length == 0) {
694
+ var first = "<input type='text' id='first' class='first' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
695
+ jQuery(this).html(first);
696
+ jQuery("input.first").focus();
697
+ jQuery("input.first").blur(function () {
698
+ var id_for_blur = document.getElementById('first').parentNode.id.split('_');
699
+ var value = jQuery(this).val();
700
+ jQuery("#" + id_for_blur[0] + "_mini_label_first").text(value);
701
+ });
702
+ }
703
+ });
704
+ jQuery("label#" + myu + "_mini_label_last").click(function () {
705
+ if (jQuery(this).children('input').length == 0) {
706
+ var last = "<input type='text' id='last' class='last' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
707
+ jQuery(this).html(last);
708
+ jQuery("input.last").focus();
709
+ jQuery("input.last").blur(function () {
710
+ var id_for_blur = document.getElementById('last').parentNode.id.split('_');
711
+ var value = jQuery(this).val();
712
+ jQuery("#" + id_for_blur[0] + "_mini_label_last").text(value);
713
+ });
714
+ }
715
+ });
716
+ jQuery("label#" + myu + "_mini_label_title").click(function () {
717
+ if (jQuery(this).children('input').length == 0) {
718
+ var title_ = "<input type='text' id='title_' class='title_' style='outline:none; border:none; background:none; width:50px;' value=\"" + jQuery(this).text() + "\">";
719
+ jQuery(this).html(title_);
720
+ jQuery("input.title_").focus();
721
+ jQuery("input.title_").blur(function () {
722
+ var id_for_blur = document.getElementById('title_').parentNode.id.split('_');
723
+ var value = jQuery(this).val();
724
+ jQuery("#" + id_for_blur[0] + "_mini_label_title").text(value);
725
+ });
726
+ }
727
+ });
728
+ jQuery("label#" + myu + "_mini_label_middle").click(function () {
729
+ if (jQuery(this).children('input').length == 0) {
730
+ var middle = "<input type='text' id='middle' class='middle' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
731
+ jQuery(this).html(middle);
732
+ jQuery("input.middle").focus();
733
+ jQuery("input.middle").blur(function () {
734
+ var id_for_blur = document.getElementById('middle').parentNode.id.split('_');
735
+ var value = jQuery(this).val();
736
+ jQuery("#" + id_for_blur[0] + "_mini_label_middle").text(value);
737
+ });
738
+ }
739
+ });
740
+ });
741
+ }
742
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_phone") {
743
+ var myu = t;
744
+ jQuery(document).ready(function () {
745
+ jQuery("label#" + myu + "_mini_label_area_code").click(function () {
746
+ if (jQuery(this).children('input').length == 0) {
747
+ 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() + "\">";
748
+ jQuery(this).html(area_code);
749
+ jQuery("input.area_code").focus();
750
+ jQuery("input.area_code").blur(function () {
751
+ var id_for_blur = document.getElementById('area_code').parentNode.id.split('_');
752
+ var value = jQuery(this).val();
753
+ jQuery("#" + id_for_blur[0] + "_mini_label_area_code").text(value);
754
+ });
755
+ }
756
+ });
757
+ jQuery("label#" + myu + "_mini_label_phone_number").click(function () {
758
+ if (jQuery(this).children('input').length == 0) {
759
+ var phone_number = "<input type='text' id='phone_number' class='phone_number' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
760
+ jQuery(this).html(phone_number);
761
+ jQuery("input.phone_number").focus();
762
+ jQuery("input.phone_number").blur(function () {
763
+ var id_for_blur = document.getElementById('phone_number').parentNode.id.split('_');
764
+ var value = jQuery(this).val();
765
+ jQuery("#" + id_for_blur[0] + "_mini_label_phone_number").text(value);
766
+ });
767
+ }
768
+ });
769
+ });
770
+ }
771
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_date_fields") {
772
+ var myu = t;
773
+ jQuery(document).ready(function () {
774
+ jQuery("label#" + myu + "_day_label").click(function () {
775
+ if (jQuery(this).children('input').length == 0) {
776
+ var day = "<input type='text' id='day' class='day' size='8' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
777
+ jQuery(this).html(day);
778
+ jQuery("input.day").focus();
779
+ jQuery("input.day").blur(function () {
780
+ var id_for_blur = document.getElementById('day').parentNode.id.split('_');
781
+ var value = jQuery(this).val();
782
+ jQuery("#" + id_for_blur[0] + "_day_label").text(value);
783
+ });
784
+ }
785
+ });
786
+ jQuery("label#" + myu + "_month_label").click(function () {
787
+ if (jQuery(this).children('input').length == 0) {
788
+ var month = "<input type='text' id='month' class='month' size='8' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
789
+ jQuery(this).html(month);
790
+ jQuery("input.month").focus();
791
+ jQuery("input.month").blur(function () {
792
+ var id_for_blur = document.getElementById('month').parentNode.id.split('_');
793
+ var value = jQuery(this).val();
794
+ jQuery("#" + id_for_blur[0] + "_month_label").text(value);
795
+ });
796
+ }
797
+ });
798
+ jQuery("label#" + myu + "_year_label").click(function () {
799
+ if (jQuery(this).children('input').length == 0) {
800
+ var year = "<input type='text' id='year' class='year' size='8' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
801
+ jQuery(this).html(year);
802
+ jQuery("input.year").focus();
803
+ jQuery("input.year").blur(function () {
804
+ var id_for_blur = document.getElementById('year').parentNode.id.split('_');
805
+ var value = jQuery(this).val();
806
+ jQuery("#" + id_for_blur[0] + "_year_label").text(value);
807
+ });
808
+ }
809
+ });
810
+ });
811
+ }
812
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_time") {
813
+ var myu = t;
814
+ jQuery(document).ready(function () {
815
+ jQuery("label#" + myu + "_mini_label_hh").click(function () {
816
+ if (jQuery(this).children('input').length == 0) {
817
+ var hh = "<input type='text' id='hh' class='hh' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
818
+ jQuery(this).html(hh);
819
+ jQuery("input.hh").focus();
820
+ jQuery("input.hh").blur(function () {
821
+ var id_for_blur = document.getElementById('hh').parentNode.id.split('_');
822
+ var value = jQuery(this).val();
823
+ jQuery("#" + id_for_blur[0] + "_mini_label_hh").text(value);
824
+ });
825
+ }
826
+ });
827
+ jQuery("label#" + myu + "_mini_label_mm").click(function () {
828
+ if (jQuery(this).children('input').length == 0) {
829
+ var mm = "<input type='text' id='mm' class='mm' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
830
+ jQuery(this).html(mm);
831
+ jQuery("input.mm").focus();
832
+ jQuery("input.mm").blur(function () {
833
+ var id_for_blur = document.getElementById('mm').parentNode.id.split('_');
834
+ var value = jQuery(this).val();
835
+ jQuery("#" + id_for_blur[0] + "_mini_label_mm").text(value);
836
+ });
837
+ }
838
+ });
839
+ jQuery("label#" + myu + "_mini_label_ss").click(function () {
840
+ if (jQuery(this).children('input').length == 0) {
841
+ var ss = "<input type='text' id='ss' class='ss' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
842
+ jQuery(this).html(ss);
843
+ jQuery("input.ss").focus();
844
+ jQuery("input.ss").blur(function () {
845
+ var id_for_blur = document.getElementById('ss').parentNode.id.split('_');
846
+ var value = jQuery(this).val();
847
+ jQuery("#" + id_for_blur[0] + "_mini_label_ss").text(value);
848
+ });
849
+ }
850
+ });
851
+ jQuery("label#" + myu + "_mini_label_am_pm").click(function () {
852
+ if (jQuery(this).children('input').length == 0) {
853
+ 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() + "\">";
854
+ jQuery(this).html(am_pm);
855
+ jQuery("input.am_pm").focus();
856
+ jQuery("input.am_pm").blur(function () {
857
+ var id_for_blur = document.getElementById('am_pm').parentNode.id.split('_');
858
+ var value = jQuery(this).val();
859
+ jQuery("#" + id_for_blur[0] + "_mini_label_am_pm").text(value);
860
+ });
861
+ }
862
+ });
863
+ });
864
+ }
865
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_paypal_price") {
866
+ var myu = t;
867
+ jQuery(document).ready(function () {
868
+ jQuery("#" + myu + "_mini_label_dollars").click(function () {
869
+ if (jQuery(this).children('input').length == 0) {
870
+ var dollars = "<input type='text' id='dollars' class='dollars' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
871
+ jQuery(this).html(dollars);
872
+ jQuery("input.dollars").focus();
873
+ jQuery("input.dollars").blur(function () {
874
+ var id_for_blur = document.getElementById('dollars').parentNode.id.split('_');
875
+ var value = jQuery(this).val();
876
+ jQuery("#" + id_for_blur[0] + "_mini_label_dollars").text(value);
877
+ });
878
+ }
879
+ });
880
+ jQuery("label#" + myu + "_mini_label_cents").click(function () {
881
+ if (jQuery(this).children('input').length == 0) {
882
+ var cents = "<input type='text' id='cents' class='cents' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
883
+ jQuery(this).html(cents);
884
+ jQuery("input.cents").focus();
885
+ jQuery("input.cents").blur(function () {
886
+ var id_for_blur = document.getElementById('cents').parentNode.id.split('_');
887
+ var value = jQuery(this).val();
888
+ jQuery("#" + id_for_blur[0] + "_mini_label_cents").text(value);
889
+ });
890
+ }
891
+ });
892
+ });
893
+ }
894
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_address") {
895
+ var myu = t;
896
+ jQuery(document).ready(function () {
897
+ jQuery("label#" + myu + "_mini_label_street1").click(function () {
898
+ if (jQuery(this).children('input').length == 0) {
899
+ var street1 = "<input type='text' id='street1' class='street1' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
900
+ jQuery(this).html(street1);
901
+ jQuery("input.street1").focus();
902
+ jQuery("input.street1").blur(function () {
903
+ var id_for_blur = document.getElementById('street1').parentNode.id.split('_');
904
+ var value = jQuery(this).val();
905
+ jQuery("#" + id_for_blur[0] + "_mini_label_street1").text(value);
906
+ });
907
+ }
908
+ });
909
+ jQuery("label#" + myu + "_mini_label_street2").click(function () {
910
+ if (jQuery(this).children('input').length == 0) {
911
+ var street2 = "<input type='text' id='street2' class='street2' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
912
+ jQuery(this).html(street2);
913
+ jQuery("input.street2").focus();
914
+ jQuery("input.street2").blur(function () {
915
+ var id_for_blur = document.getElementById('street2').parentNode.id.split('_');
916
+ var value = jQuery(this).val();
917
+ jQuery("#" + id_for_blur[0] + "_mini_label_street2").text(value);
918
+ });
919
+ }
920
+ });
921
+ jQuery("label#" + myu + "_mini_label_city").click(function () {
922
+ if (jQuery(this).children('input').length == 0) {
923
+ var city = "<input type='text' id='city' class='city' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
924
+ jQuery(this).html(city);
925
+ jQuery("input.city").focus();
926
+ jQuery("input.city").blur(function () {
927
+ var id_for_blur = document.getElementById('city').parentNode.id.split('_');
928
+ var value = jQuery(this).val();
929
+ jQuery("#" + id_for_blur[0] + "_mini_label_city").text(value);
930
+ });
931
+ }
932
+ });
933
+ jQuery("label#" + myu + "_mini_label_state").click(function () {
934
+ if (jQuery(this).children('input').length == 0) {
935
+ var state = "<input type='text' id='state' class='state' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
936
+ jQuery(this).html(state);
937
+ jQuery("input.state").focus();
938
+ jQuery("input.state").blur(function () {
939
+ var id_for_blur = document.getElementById('state').parentNode.id.split('_');
940
+ var value = jQuery(this).val();
941
+ jQuery("#" + id_for_blur[0] + "_mini_label_state").text(value);
942
+ });
943
+ }
944
+ });
945
+ jQuery("label#" + myu + "_mini_label_postal").click(function () {
946
+ if (jQuery(this).children('input').length == 0) {
947
+ var postal = "<input type='text' id='postal' class='postal' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
948
+ jQuery(this).html(postal);
949
+ jQuery("input.postal").focus();
950
+ jQuery("input.postal").blur(function () {
951
+ var id_for_blur = document.getElementById('postal').parentNode.id.split('_');
952
+ var value = jQuery(this).val();
953
+ jQuery("#" + id_for_blur[0] + "_mini_label_postal").text(value);
954
+ });
955
+ }
956
+ });
957
+ jQuery("label#" + myu + "_mini_label_country").click(function () {
958
+ if (jQuery(this).children('input').length == 0) {
959
+ var country = "<input type='country' id='country' class='country' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
960
+ jQuery(this).html(country);
961
+ jQuery("input.country").focus();
962
+ jQuery("input.country").blur(function () {
963
+ var id_for_blur = document.getElementById('country').parentNode.id.split('_');
964
+ var value = jQuery(this).val();
965
+ jQuery("#" + id_for_blur[0] + "_mini_label_country").text(value);
966
+ });
967
+ }
968
+ });
969
+ });
970
+ }
971
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_scale_rating") {
972
+ var myu = t;
973
+ jQuery(document).ready(function () {
974
+ jQuery("#" + myu + "_mini_label_worst").click(function () {
975
+ if (jQuery(this).children('input').length == 0) {
976
+ 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() + "\">";
977
+ jQuery(this).html(worst);
978
+ jQuery("input.worst").focus();
979
+ jQuery("input.worst").blur(function () {
980
+ var id_for_blur = document.getElementById('worst').parentNode.id.split('_');
981
+ var value = jQuery(this).val();
982
+ jQuery("#" + id_for_blur[0] + "_mini_label_worst").text(value);
983
+ });
984
+ }
985
+ });
986
+ jQuery("label#" + myu + "_mini_label_best").click(function () {
987
+ if (jQuery(this).children('input').length == 0) {
988
+
989
+ 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() + "\">";
990
+ jQuery(this).html(best);
991
+ jQuery("input.best").focus();
992
+ jQuery("input.best").blur(function () {
993
+ var id_for_blur = document.getElementById('best').parentNode.id.split('_');
994
+ var value = jQuery(this).val();
995
+ jQuery("#" + id_for_blur[0] + "_mini_label_best").text(value);
996
+ });
997
+ }
998
+ });
999
+ });
1000
+ }
1001
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_spinner") {
1002
+ var spinner_value = document.getElementById(t + "_elementform_id_temp").value;
1003
+ var spinner_min_value = document.getElementById(t + "_min_valueform_id_temp").value;
1004
+ var spinner_max_value = document.getElementById(t + "_max_valueform_id_temp").value;
1005
+ var spinner_step = document.getElementById(t + "_stepform_id_temp").value;
1006
+ jQuery("#" + t + "_elementform_id_temp")[0].spin = null;
1007
+ spinner = jQuery("#" + t + "_elementform_id_temp").spinner();
1008
+ spinner.spinner("value", spinner_value);
1009
+ jQuery("#" + t + "_elementform_id_temp").spinner({ min:spinner_min_value});
1010
+ jQuery("#" + t + "_elementform_id_temp").spinner({ max:spinner_max_value});
1011
+ jQuery("#" + t + "_elementform_id_temp").spinner({ step:spinner_step});
1012
+ }
1013
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_slider") {
1014
+ var slider_value = document.getElementById(t + "_slider_valueform_id_temp").value;
1015
+ var slider_min_value = document.getElementById(t + "_slider_min_valueform_id_temp").value;
1016
+ var slider_max_value = document.getElementById(t + "_slider_max_valueform_id_temp").value;
1017
+ var slider_element_value = document.getElementById(t + "_element_valueform_id_temp");
1018
+ var slider_value_save = document.getElementById(t + "_slider_valueform_id_temp");
1019
+ jQuery("#" + t + "_elementform_id_temp")[0].slide = null;
1020
+ jQuery(function () {
1021
+ jQuery("#" + t + "_elementform_id_temp").slider({
1022
+ range:"min",
1023
+ value:eval(slider_value),
1024
+ min:eval(slider_min_value),
1025
+ max:eval(slider_max_value),
1026
+ slide:function (event, ui) {
1027
+ slider_element_value.innerHTML = "" + ui.value;
1028
+ slider_value_save.value = "" + ui.value;
1029
+ }
1030
+ });
1031
+ });
1032
+ }
1033
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_range") {
1034
+ var spinner_value0 = document.getElementById(t + "_elementform_id_temp0").value;
1035
+ var spinner_step = document.getElementById(t + "_range_stepform_id_temp").value;
1036
+ jQuery("#" + t + "_elementform_id_temp0")[0].spin = null;
1037
+ jQuery("#" + t + "_elementform_id_temp1")[0].spin = null;
1038
+ spinner0 = jQuery("#" + t + "_elementform_id_temp0").spinner();
1039
+ spinner0.spinner("value", spinner_value0);
1040
+ jQuery("#" + t + "_elementform_id_temp0").spinner({ step:spinner_step});
1041
+ var spinner_value1 = document.getElementById(t + "_elementform_id_temp1").value;
1042
+ spinner1 = jQuery("#" + t + "_elementform_id_temp1").spinner();
1043
+ spinner1.spinner("value", spinner_value1);
1044
+ jQuery("#" + t + "_elementform_id_temp1").spinner({ step:spinner_step});
1045
+ var myu = t;
1046
+ jQuery(document).ready(function () {
1047
+ jQuery("#" + myu + "_mini_label_from").click(function () {
1048
+ if (jQuery(this).children('input').length == 0) {
1049
+ 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() + "\">";
1050
+ jQuery(this).html(from);
1051
+ jQuery("input.from").focus();
1052
+ jQuery("input.from").blur(function () {
1053
+ var id_for_blur = document.getElementById('from').parentNode.id.split('_');
1054
+ var value = jQuery(this).val();
1055
+ jQuery("#" + id_for_blur[0] + "_mini_label_from").text(value);
1056
+ });
1057
+ }
1058
+ });
1059
+ jQuery("label#" + myu + "_mini_label_to").click(function () {
1060
+ if (jQuery(this).children('input').length == 0) {
1061
+ 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() + "\">";
1062
+ jQuery(this).html(to);
1063
+ jQuery("input.to").focus();
1064
+ jQuery("input.to").blur(function () {
1065
+ var id_for_blur = document.getElementById('to').parentNode.id.split('_');
1066
+ var value = jQuery(this).val();
1067
+ jQuery("#" + id_for_blur[0] + "_mini_label_to").text(value);
1068
+ });
1069
+ }
1070
+ });
1071
+ });
1072
+ }
1073
+ }
1074
+ }
1075
+ remove_whitespace(document.getElementById('take'));
1076
+ form_view = 1;
1077
+ form_view_count = 0;
1078
+ for (i = 1; i <= 30; i++) {
1079
+ if (document.getElementById('form_id_tempform_view' + i)) {
1080
+ form_view_count++;
1081
+ form_view_max = i;
1082
+ tbody_img = document.createElement('div');
1083
+ tbody_img.setAttribute('id', 'form_id_tempform_view_img' + i);
1084
+ tbody_img.style.cssText = "float:right";
1085
+ tr_img = document.createElement('div');
1086
+ var img = document.createElement('img');
1087
+ img.setAttribute('src', '<?php echo WD_FMC_URL; ?>/images/minus.png');
1088
+ img.setAttribute('title', 'Show or hide the page');
1089
+ img.setAttribute("class", "page_toolbar");
1090
+ img.setAttribute('id', 'show_page_img_' + i);
1091
+ img.setAttribute('onClick', 'show_or_hide("' + i + '")');
1092
+ img.setAttribute("onmouseover", 'chnage_icons_src(this,"minus")');
1093
+ img.setAttribute("onmouseout", 'chnage_icons_src(this,"minus")');
1094
+ var img_X = document.createElement("img");
1095
+ img_X.setAttribute("src", "<?php echo WD_FMC_URL; ?>/images/page_delete.png");
1096
+ img_X.setAttribute('title', 'Delete the page');
1097
+ img_X.setAttribute("class", "page_toolbar");
1098
+ img_X.setAttribute("onclick", 'remove_page("' + i + '")');
1099
+ img_X.setAttribute("onmouseover", 'chnage_icons_src(this,"page_delete")');
1100
+ img_X.setAttribute("onmouseout", 'chnage_icons_src(this,"page_delete")');
1101
+ var img_X_all = document.createElement("img");
1102
+ img_X_all.setAttribute("src", "<?php echo WD_FMC_URL; ?>/images/page_delete_all.png");
1103
+ img_X_all.setAttribute('title', 'Delete the page with fields');
1104
+ img_X_all.setAttribute("class", "page_toolbar");
1105
+ img_X_all.setAttribute("onclick", 'remove_page_all("' + i + '")');
1106
+ img_X_all.setAttribute("onmouseover", 'chnage_icons_src(this,"page_delete_all")');
1107
+ img_X_all.setAttribute("onmouseout", 'chnage_icons_src(this,"page_delete_all")');
1108
+ var img_EDIT = document.createElement("img");
1109
+ img_EDIT.setAttribute("src", "<?php echo WD_FMC_URL; ?>/images/page_edit.png");
1110
+ img_EDIT.setAttribute('title', 'Edit the page');
1111
+ img_EDIT.setAttribute("class", "page_toolbar");
1112
+ img_EDIT.setAttribute("onclick", 'edit_page_break("' + i + '")');
1113
+ img_EDIT.setAttribute("onmouseover", 'chnage_icons_src(this,"page_edit")');
1114
+ img_EDIT.setAttribute("onmouseout", 'chnage_icons_src(this,"page_edit")');
1115
+ tr_img.appendChild(img);
1116
+ tr_img.appendChild(img_X);
1117
+ tr_img.appendChild(img_X_all);
1118
+ tr_img.appendChild(img_EDIT);
1119
+ tbody_img.appendChild(tr_img);
1120
+ document.getElementById('form_id_tempform_view' + i).parentNode.appendChild(tbody_img);
1121
+ }
1122
+ }
1123
+ if (form_view_count > 1) {
1124
+ for (i = 1; i <= form_view_max; i++) {
1125
+ if (document.getElementById('form_id_tempform_view' + i)) {
1126
+ first_form_view = i;
1127
+ break;
1128
+ }
1129
+ }
1130
+ form_view = form_view_max;
1131
+ need_enable = false;
1132
+ generate_page_nav(first_form_view);
1133
+ var img_EDIT = document.createElement("img");
1134
+ img_EDIT.setAttribute("src", "<?php echo WD_FMC_URL . '/images/edit.png'; ?>");
1135
+ img_EDIT.style.cssText = "margin-left:40px; cursor:pointer";
1136
+ img_EDIT.setAttribute("onclick", 'el_page_navigation()');
1137
+ var td_EDIT = document.getElementById("edit_page_navigation");
1138
+ td_EDIT.appendChild(img_EDIT);
1139
+ document.getElementById('page_navigation').appendChild(td_EDIT);
1140
+ }
1141
+ document.getElementById('araqel').value = 1;
1142
+ }
1143
+ function formAddToOnload() {
1144
+ if (formOldFunctionOnLoad) {
1145
+ formOldFunctionOnLoad();
1146
+ }
1147
+ formOnload();
1148
+ }
1149
+ function formLoadBody() {
1150
+ formOldFunctionOnLoad = window.onload;
1151
+ window.onload = formOnload;
1152
+ }
1153
+ var formOldFunctionOnLoad = null;
1154
+ formLoadBody();
1155
+ </script>
1156
+ <?php
1157
+ }
1158
+ ?>
1159
+
1160
+ <input type="hidden" name="option" value="com_formmaker" />
1161
+ <input type="hidden" name="id" value="<?php echo $row->id; ?>" />
1162
+ <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
1163
+
1164
+ <input type="hidden" id="task" name="task" value=""/>
1165
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
1166
+ </form>
1167
+ <?php
1168
+ }
1169
+
1170
+ public function edit_old($id) {
1171
+ // header("X-XSS-Protection: 0");
1172
+ $row = $this->model->get_row_data($id);
1173
+ $themes = $this->model->get_theme_rows_data('old');
1174
+ $labels = array();
1175
+ $label_id = array();
1176
+ $label_order_original = array();
1177
+ $label_type = array();
1178
+ $label_all = explode('#****#', $row->label_order);
1179
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
1180
+ foreach ($label_all as $key => $label_each) {
1181
+ $label_id_each = explode('#**id**#', $label_each);
1182
+ array_push($label_id, $label_id_each[0]);
1183
+ $label_oder_each = explode('#**label**#', $label_id_each[1]);
1184
+ array_push($label_order_original, addslashes($label_oder_each[0]));
1185
+ array_push($label_type, $label_oder_each[1]);
1186
+ }
1187
+ $labels['id'] = '"' . implode('","', $label_id) . '"';
1188
+ $labels['label'] = '"' . implode('","', $label_order_original) . '"';
1189
+ $labels['type'] = '"' . implode('","', $label_type) . '"';
1190
+
1191
+ $page_title = (($id != 0) ? 'Edit form ' . $row->title : 'Create new form');
1192
+ ?>
1193
+ <script type="text/javascript">
1194
+ var fmc_plugin_url = "<?php echo WD_FMC_URL; ?>";
1195
+ </script>
1196
+ <script src="<?php echo WD_FMC_URL . '/js/formmaker_free.js'; ?>" type="text/javascript"></script>
1197
+ <script type="text/javascript">
1198
+ function submitbutton() {
1199
+ if (!document.getElementById('araqel') || (document.getElementById('araqel').value == '0')) {
1200
+ alert('Please wait while page loading.');
1201
+ return false;
1202
+ }
1203
+ tox = '';
1204
+ l_id_array = [<?php echo $labels['id']?>];
1205
+ l_label_array = [<?php echo $labels['label']?>];
1206
+ l_type_array = [<?php echo $labels['type']?>];
1207
+ l_id_removed = [];
1208
+ for (x=0; x< l_id_array.length; x++) {
1209
+ l_id_removed[l_id_array[x]]=true;
1210
+ }
1211
+ for (t=1;t<=form_view_max;t++) {
1212
+ if (document.getElementById('form_id_tempform_view'+t)) {
1213
+ form_view_element=document.getElementById('form_id_tempform_view'+t);
1214
+ n=form_view_element.childNodes.length-2;
1215
+ for(q=0;q<=n;q++) {
1216
+ if (form_view_element.childNodes[q].nodeType!=3) {
1217
+ if (!form_view_element.childNodes[q].id) {
1218
+ GLOBAL_tr=form_view_element.childNodes[q];
1219
+ for (x=0; x < GLOBAL_tr.firstChild.childNodes.length; x++) {
1220
+ table=GLOBAL_tr.firstChild.childNodes[x];
1221
+ tbody=table.firstChild;
1222
+ for (y=0; y < tbody.childNodes.length; y++) {
1223
+ is_in_old=false;
1224
+ tr=tbody.childNodes[y];
1225
+ l_id=tr.id;
1226
+ l_label=document.getElementById( tr.id+'_element_labelform_id_temp').innerHTML;
1227
+ l_label = l_label.replace(/(\r\n|\n|\r)/gm," ");
1228
+ l_type=tr.getAttribute('type');
1229
+ for (z = 0; z < l_id_array.length; z++) {
1230
+ if (l_id_array[z] == l_id) {
1231
+ if (l_type_array[z] == "type_address") {
1232
+ if (document.getElementById(l_id + "_mini_label_street1")) {
1233
+ l_id_removed[l_id_array[z]] = false;
1234
+ }
1235
+ if (document.getElementById(l_id+"_mini_label_street2")) {
1236
+ l_id_removed[parseInt(l_id_array[z]) + 1] = false;
1237
+ }
1238
+ if (document.getElementById(l_id+"_mini_label_city")) {
1239
+ l_id_removed[parseInt(l_id_array[z]) + 2] = false;
1240
+ }
1241
+ if (document.getElementById(l_id+"_mini_label_state")) {
1242
+ l_id_removed[parseInt(l_id_array[z]) + 3] = false;
1243
+ }
1244
+ if (document.getElementById(l_id+"_mini_label_postal")) {
1245
+ l_id_removed[parseInt(l_id_array[z]) + 4] = false;
1246
+ }
1247
+ if (document.getElementById(l_id+"_mini_label_country")) {
1248
+ l_id_removed[parseInt(l_id_array[z]) + 5] = false;
1249
+ }
1250
+ z = z + 5;
1251
+ }
1252
+ else {
1253
+ l_id_removed[l_id] = false;
1254
+ }
1255
+ }
1256
+ }
1257
+ if (tr.getAttribute('type')=="type_address") {
1258
+ addr_id=parseInt(tr.id);
1259
+ id_for_country= addr_id;
1260
+ if(document.getElementById(id_for_country+"_mini_label_street1"))
1261
+ tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_street1").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
1262
+ if(document.getElementById(id_for_country+"_mini_label_street2"))
1263
+ tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_street2").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
1264
+ if(document.getElementById(id_for_country+"_mini_label_city"))
1265
+ tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_city").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1266
+ if(document.getElementById(id_for_country+"_mini_label_state"))
1267
+ tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_state").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1268
+ if(document.getElementById(id_for_country+"_mini_label_postal"))
1269
+ tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_postal").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1270
+ if(document.getElementById(id_for_country+"_mini_label_country"))
1271
+ tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_country").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#';
1272
+ }
1273
+ else {
1274
+ tox = tox+l_id+'#**id**#'+l_label+'#**label**#'+l_type+'#****#';
1275
+ }
1276
+ }
1277
+ }
1278
+ }
1279
+ }
1280
+ }
1281
+ }
1282
+ }
1283
+ document.getElementById('label_order_current').value = tox;
1284
+ for (x = 0; x < l_id_array.length; x++) {
1285
+ if (l_id_removed[l_id_array[x]]) {
1286
+ tox = tox + l_id_array[x] + '#**id**#' + l_label_array[x] + '#**label**#' + l_type_array[x] + '#****#';
1287
+ }
1288
+ }
1289
+ document.getElementById('label_order').value = tox;
1290
+ refresh_old();
1291
+ document.getElementById('pagination').value=document.getElementById('pages').getAttribute("type");
1292
+ document.getElementById('show_title').value=document.getElementById('pages').getAttribute("show_title");
1293
+ document.getElementById('show_numbers').value=document.getElementById('pages').getAttribute("show_numbers");
1294
+ return true;
1295
+ }
1296
+
1297
+ gen = <?php echo (($id != 0) ? $row->counter : 1); ?>;
1298
+
1299
+ function enable() {
1300
+ alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
1301
+ for (x = 0; x < 14; x++) {
1302
+ document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FMC_URL . '/images/'; ?>" + alltypes[x] + ".png";
1303
+ }
1304
+ if (document.getElementById('formMakerDiv').style.display == 'block') {
1305
+ jQuery('#formMakerDiv').slideToggle(200);
1306
+ }
1307
+ else {
1308
+ jQuery('#formMakerDiv').slideToggle(400);
1309
+ }
1310
+ if (document.getElementById('formMakerDiv').offsetWidth) {
1311
+ document.getElementById('formMakerDiv1').style.width = (document.getElementById('formMakerDiv').offsetWidth - 60) + 'px';
1312
+ }
1313
+ if (document.getElementById('formMakerDiv1').style.display == 'block') {
1314
+ jQuery('#formMakerDiv1').slideToggle(200);
1315
+ }
1316
+ else {
1317
+ jQuery('#formMakerDiv1').slideToggle(400);
1318
+ }
1319
+ document.getElementById('when_edit').style.display = 'none';
1320
+ }
1321
+
1322
+ function enable2() {
1323
+ alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
1324
+ for (x = 0; x < 14; x++) {
1325
+ document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FMC_URL . '/images/'; ?>" + alltypes[x] + ".png";
1326
+ }
1327
+ if (document.getElementById('formMakerDiv').style.display == 'block') {
1328
+ jQuery('#formMakerDiv').slideToggle(200);
1329
+ }
1330
+ else {
1331
+ jQuery('#formMakerDiv').slideToggle(400);
1332
+ }
1333
+ if (document.getElementById('formMakerDiv').offsetWidth) {
1334
+ document.getElementById('formMakerDiv1').style.width = (document.getElementById('formMakerDiv').offsetWidth - 60) + 'px';
1335
+ }
1336
+ if (document.getElementById('formMakerDiv1').style.display == 'block') {
1337
+ jQuery('#formMakerDiv1').slideToggle(200);
1338
+ }
1339
+ else {
1340
+ jQuery('#formMakerDiv1').slideToggle(400);
1341
+ }
1342
+ document.getElementById('when_edit').style.display = 'block';
1343
+ if (document.getElementById('field_types').offsetWidth) {
1344
+ document.getElementById('when_edit').style.width = document.getElementById('field_types').offsetWidth + 'px';
1345
+ }
1346
+ if (document.getElementById('field_types').offsetHeight) {
1347
+ document.getElementById('when_edit').style.height = document.getElementById('field_types').offsetHeight + 'px';
1348
+ }
1349
+ }
1350
+ </script>
1351
+ <div style="clear: both; float: left; width: 99%;">
1352
+ <div style="float:left; font-size: 14px; font-weight: bold;">
1353
+ This section allows you to add fields to your form.
1354
+ <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>
1355
+ </div>
1356
+ <div style="float: right; text-align: right;">
1357
+ <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/files/fromContactForm.php">
1358
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FMC_URL . '/images/wd_logo.png'; ?>" />
1359
+ </a>
1360
+ </div>
1361
+ </div>
1362
+ <form class="wrap" id="manage_form" method="post" action="admin.php?page=manage_fmc" style="float: left; width: 99%;">
1363
+ <h2><?php echo $page_title; ?></h2>
1364
+ <div style="float: right; margin: 0 5px 0 0;">
1365
+ <a href="<?php echo add_query_arg(array('action' => 'FormMakerPreview_fmc', 'id' => $row->theme, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" class="button-primary thickbox thickbox-preview" id="preview_form" title="Form Preview" onclick="return false;">
1366
+ Preview
1367
+ </a>
1368
+ <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"/>
1369
+ <?php
1370
+ if ($id) {
1371
+ ?>
1372
+ <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"/>
1373
+ <?php
1374
+ }
1375
+ ?>
1376
+ <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"/>
1377
+ <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"/>
1378
+ <input class="button-secondary" type="submit" onclick="spider_set_input_value('task', 'cancel')" value="Cancel"/>
1379
+ </div>
1380
+
1381
+ <div class="formmaker_table" width="100%">
1382
+ <div style="float: left; text-align: center;"><br />
1383
+ <span class="cfm_logo cfm_black">Contact</span>
1384
+ <span class="cfm_logo cfm_white">Form</span>
1385
+ <span class="cfm_logo cfm_black">Maker</span><br /><br />
1386
+ <img src="<?php echo WD_FMC_URL . '/images/logo.png'; ?>" />
1387
+ </div>
1388
+ <div style="float:right">
1389
+ <span style="font-size: 16.76pt; font-family: tahoma; color: #FFFFFF; vertical-align: middle;">Form title:&nbsp;&nbsp;</span>
1390
+ <input id="title" name="title" class="form_maker_title" value="<?php echo $row->title; ?>"/>
1391
+ <br />
1392
+ <img src="<?php echo WD_FMC_URL . '/images/formoptions.png'; ?>" onclick="if (spider_check_required('title', 'Form title')) {return false;}; submitbutton(); spider_set_input_value('task', 'form_options_old'); spider_form_submit(event, 'manage_form');" style="cursor: pointer; margin: 10px 0 10px 10px; float: right;"/>
1393
+ <br /><br /><br />
1394
+ <img src="<?php echo WD_FMC_URL . '/images/addanewfield.png'; ?>" onclick="enable(); Enable(); " style="cursor: pointer; margin:10px 0 10px 10px; float: right;"/>
1395
+ </div>
1396
+ </div>
1397
+
1398
+ <div id="formMakerDiv" onclick="close_window()"></div>
1399
+ <div id="formMakerDiv1" style="padding-top: 20px;" align="center">
1400
+ <table border="0" width="100%" cellpadding="0" cellspacing="0" height="100%" style="border: 6px #00aeef solid; background-color: #FFF;">
1401
+ <tr>
1402
+ <td style="padding:0px">
1403
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
1404
+ <tr valign="top">
1405
+ <td width="15%" height="100%" style="border-right: dotted black 1px;" id="field_types">
1406
+ <div id="when_edit" style="display: none;"></div>
1407
+ <table border="0" cellpadding="0" cellspacing="3" width="100%">
1408
+ <tr>
1409
+ <td align="center" onClick="addRow('customHTML')" style="cursor:pointer" id="table_editor" class="field_buttons">
1410
+ <img src="<?php echo WD_FMC_URL . '/images/customHTML.png'; ?>" style="margin:5px" id="img_customHTML"/>
1411
+ </td>
1412
+ <td align="center" onClick="addRow('text')" style="cursor:pointer" id="table_text" class="field_buttons">
1413
+ <img src="<?php echo WD_FMC_URL . '/images/text.png'; ?>" style="margin:5px" id="img_text"/>
1414
+ </td>
1415
+ </tr>
1416
+ <tr>
1417
+ <td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_time_and_date" class="field_buttons">
1418
+ <img src="<?php echo WD_FMC_URL . '/images/time_and_date.png'; ?>" style="margin:5px" id="img_time_and_date"/>
1419
+ </td>
1420
+ <td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_select" class="field_buttons">
1421
+ <img src="<?php echo WD_FMC_URL . '/images/select.png'; ?>" style="margin:5px" id="img_select"/>
1422
+ </td>
1423
+ </tr>
1424
+ <tr>
1425
+ <td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_checkbox" class="field_buttons">
1426
+ <img src="<?php echo WD_FMC_URL . '/images/checkbox.png'; ?>" style="margin:5px" id="img_checkbox"/>
1427
+ </td>
1428
+ <td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_radio" class="field_buttons">
1429
+ <img src="<?php echo WD_FMC_URL . '/images/radio.png'; ?>" style="margin:5px" id="img_radio"/>
1430
+ </td>
1431
+ </tr>
1432
+ <tr>
1433
+ <td align="center" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_file_upload" class="field_buttons"
1434
+ onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')">
1435
+ <img src="<?php echo WD_FMC_URL . '/images/file_upload.png'; ?>" style="margin:5px" id="img_file_upload" />
1436
+ </td>
1437
+ <td align="center" onClick="addRow('captcha')" style="cursor:pointer" id="table_captcha" class="field_buttons">
1438
+ <img src="<?php echo WD_FMC_URL . '/images/captcha.png'; ?>" style="margin:5px" id="img_captcha"/>
1439
+ </td>
1440
+ </tr>
1441
+ <tr>
1442
+ <td align="center" onClick="addRow('page_break')" style="cursor:pointer" id="table_page_break" class="field_buttons">
1443
+ <img src="<?php echo WD_FMC_URL . '/images/page_break.png'; ?>" style="margin:5px" id="img_page_break"/>
1444
+ </td>
1445
+ <td align="center" onClick="addRow('section_break')" style="cursor:pointer" id="table_section_break" class="field_buttons">
1446
+ <img src="<?php echo WD_FMC_URL . '/images/section_break.png'; ?>" style="margin:5px" id="img_section_break"/>
1447
+ </td>
1448
+ </tr>
1449
+ <tr>
1450
+ <td align="center" id="table_map" class="field_buttons" onClick="addRow('map')">
1451
+ <img src="<?php echo WD_FMC_URL . '/images/map.png'; ?>" style="margin:5px" id="img_map" />
1452
+ </td>
1453
+ <td align="center" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_paypal" class="field_buttons"
1454
+ onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')">
1455
+ <img src="<?php echo WD_FMC_URL . '/images/paypal.png'; ?>" style="margin:5px" id="img_paypal" />
1456
+ </td>
1457
+ </tr>
1458
+ <tr>
1459
+ <td align="center" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" class="field_buttons" id="table_survey"
1460
+ onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')">
1461
+ <img src="<?php echo WD_FMC_URL . '/images/survey.png'; ?>" style="margin:5px" id="img_survey"/>
1462
+ </td>
1463
+ <td align="center" onClick="addRow('button')" id="table_button" class="field_buttons">
1464
+ <img src="<?php echo WD_FMC_URL . '/images/button.png'; ?>" style="margin:5px" id="img_button"/>
1465
+ </td>
1466
+ </tr>
1467
+ </table>
1468
+ </td>
1469
+ <td width="35%" height="100%" align="left">
1470
+ <div id="edit_table" style="padding:0px; overflow-y:scroll; height:575px"></div>
1471
+ </td>
1472
+ <td align="center" valign="top" style="background: url("<?php echo WD_FMC_URL . '/images/border2.png'; ?>") repeat-y;">&nbsp;</td>
1473
+ <td style="padding:15px">
1474
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
1475
+ <tr>
1476
+ <td align="right">
1477
+ <input type="radio" value="end" name="el_pos" checked="checked" id="pos_end" onclick="Disable()"/>
1478
+ At The End
1479
+ <input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
1480
+ At The Beginning
1481
+ <input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
1482
+ Before
1483
+ <select style="width: 100px; margin-left: 5px;" id="sel_el_pos" disabled="disabled"></select>
1484
+ <img alt="ADD" title="add" style="cursor:pointer; vertical-align:middle; margin:5px" src="<?php echo WD_FMC_URL . '/images/save.png'; ?>" onClick="add(0)"/>
1485
+ <img alt="CANCEL" title="cancel" style="cursor: pointer; vertical-align:middle; margin:5px" src="<?php echo WD_FMC_URL . '/images/cancel_but.png'; ?>" onClick="close_window()"/>
1486
+ <hr style=" margin-bottom:10px" />
1487
+ </td>
1488
+ </tr>
1489
+ <tr height="100%" valign="top">
1490
+ <td id="show_table"></td>
1491
+ </tr>
1492
+ </table>
1493
+ </td>
1494
+ </tr>
1495
+ </table>
1496
+ </td>
1497
+ </tr>
1498
+ </table>
1499
+ <input type="hidden" id="old" />
1500
+ <input type="hidden" id="old_selected" />
1501
+ <input type="hidden" id="element_type" />
1502
+ <input type="hidden" id="editing_id" />
1503
+ <input type="hidden" value="<?php echo WD_FMC_URL; ?>" id="form_plugins_url" />
1504
+ <div id="main_editor" style="position: absolute; display: none; z-index: 140;">
1505
+ <?php
1506
+ if (user_can_richedit()) {
1507
+ wp_editor('', 'form_maker_editor', array('teeny' => FALSE, 'textarea_name' => 'form_maker_editor', 'media_buttons' => FALSE, 'textarea_rows' => 5));
1508
+ }
1509
+ else {
1510
+ ?>
1511
+ <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>
1512
+ <?php
1513
+ }
1514
+ ?>
1515
+ </div>
1516
+ </div>
1517
+ <?php
1518
+ if (!function_exists('the_editor')) {
1519
+ ?>
1520
+ <iframe id="tinymce" style="display: none;"></iframe>
1521
+ <?php
1522
+ }
1523
+ ?>
1524
+ <br /><br />
1525
+ <fieldset>
1526
+ <legend><h2 style="color: #00aeef;">Form</h2></legend>
1527
+ <table width="100%" style="margin:8px">
1528
+ <tr id="page_navigation">
1529
+ <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>
1530
+ <td align="left" id="edit_page_navigation"></td>
1531
+ </tr>
1532
+ </table>
1533
+ <div id="take">
1534
+ <?php
1535
+ if ($row->form) {
1536
+ echo $row->form;
1537
+ }
1538
+ else {
1539
+ ?>
1540
+ <table border="0" cellpadding="4" cellspacing="0" class="wdform_table1" style="width: 100%;">
1541
+ <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">
1542
+ <tr class="wdform_tr1">
1543
+ <td class="wdform_td1" >
1544
+ <table class="wdform_table2">
1545
+ <tbody class="wdform_tbody2"></tbody>
1546
+ </table>
1547
+ </td>
1548
+ </tr>
1549
+ <tr class="wdform_footer">
1550
+ <td colspan="100" valign="top">
1551
+ <table width="100%" style="padding-right:170px"><tbody><tr id="form_id_temppage_nav1"></tr></tbody></table>
1552
+ </td>
1553
+ </tr>
1554
+ <tbody id="form_id_tempform_view_img1" style="float: right !important;" >
1555
+ <tr>
1556
+ <td width="0%"></td>
1557
+ <td align="right">
1558
+ <img src="<?php echo WD_FMC_URL . '/images/minus.png'; ?>" title="Show or hide the page" class="page_toolbar" onclick="show_or_hide('1')" onmouseover="chnage_icons_src(this,'minus')" onmouseout="chnage_icons_src(this,'minus')" id="show_page_img_1" />
1559
+ </td>
1560
+ <td>
1561
+ <img src="<?php echo WD_FMC_URL . '/images/page_delete.png'; ?>" title="Delete the page" class="page_toolbar" onclick="remove_page('1')" onmouseover="chnage_icons_src(this,'page_delete')" onmouseout="chnage_icons_src(this,'page_delete')" />
1562
+ </td>
1563
+ <td>
1564
+ <img src="<?php echo WD_FMC_URL . '/images/page_delete_all.png'; ?>" title="Delete the page with fields" class="page_toolbar" onclick="remove_page_all('1')" onmouseover="chnage_icons_src(this,'page_delete_all')" onmouseout="chnage_icons_src(this,'page_delete_all')" />
1565
+ </td>
1566
+ <td>
1567
+ <img src="<?php echo WD_FMC_URL . '/images/page_edit.png'; ?>" title="Edit the page" class="page_toolbar" onclick="edit_page_break('1')" onmouseover="chnage_icons_src(this,'page_edit')" onmouseout="chnage_icons_src(this,'page_edit')" />
1568
+ </td>
1569
+ </tr>
1570
+ </tbody>
1571
+ </table>
1572
+ <?php
1573
+ }
1574
+ ?>
1575
+ </div>
1576
+ </fieldset>
1577
+ <input type="hidden" name="form" id="form" />
1578
+ <input type="hidden" name="form_front" id="form_front" />
1579
+ <input type="hidden" name="pagination" id="pagination" />
1580
+ <input type="hidden" name="show_title" id="show_title" />
1581
+ <input type="hidden" name="show_numbers" id="show_numbers" />
1582
+ <input type="hidden" name="public_key" id="public_key" />
1583
+ <input type="hidden" name="private_key" id="private_key" />
1584
+ <input type="hidden" name="recaptcha_theme" id="recaptcha_theme" />
1585
+ <input type="hidden" id="label_order" name="label_order" value="<?php echo $row->label_order; ?>" />
1586
+ <input type="hidden" id="label_order_current" name="label_order_current" value="<?php echo $row->label_order_current; ?>" />
1587
+ <input type="hidden" name="counter" id="counter" value="<?php echo $row->counter; ?>" />
1588
+ <input type="hidden" id="araqel" value="0" />
1589
+ <script type="text/javascript">
1590
+ form_view = 1;
1591
+ form_view_count = 1;
1592
+ form_view_max = 1;
1593
+ function formOnload() {
1594
+ // Enable maps.
1595
+ for (t = 0; t < <?php echo $row->counter;?>; t++)
1596
+ if (document.getElementById(t+"_typeform_id_temp")) {
1597
+ if (document.getElementById(t+"_typeform_id_temp").value=="type_map" || document.getElementById(t+"_typeform_id_temp").value=="type_mark_map") {
1598
+ if_gmap_init(t);
1599
+ for (q = 0; q < 20; q++) {
1600
+ if (document.getElementById(t+"_elementform_id_temp").getAttribute("long"+q)) {
1601
+ w_long=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("long"+q));
1602
+ w_lat=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("lat"+q));
1603
+ w_info=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("info"+q));
1604
+ add_marker_on_map(t,q, w_long, w_lat, w_info, false);
1605
+ }
1606
+ }
1607
+ }
1608
+ else
1609
+ if (document.getElementById(t+"_typeform_id_temp").value == "type_date") {
1610
+ // Calendar.setup({
1611
+ // inputField: t+"_elementform_id_temp",
1612
+ // ifFormat: document.getElementById(t+"_buttonform_id_temp").getAttribute('format'),
1613
+ // button: t+"_buttonform_id_temp",
1614
+ // align: "Tl",
1615
+ // singleClick: true,
1616
+ // firstDay: 0
1617
+ // });
1618
+ }
1619
+ else
1620
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_spinner") {
1621
+ var spinner_value = jQuery("#" + t + "_elementform_id_temp").get( "aria-valuenow" );
1622
+ var spinner_min_value = document.getElementById(t+"_min_valueform_id_temp").value;
1623
+ var spinner_max_value = document.getElementById(t+"_max_valueform_id_temp").value;
1624
+ var spinner_step = document.getElementById(t+"_stepform_id_temp").value;
1625
+
1626
+ jQuery( "#"+t+"_elementform_id_temp" ).removeClass( "ui-spinner-input" )
1627
+ .prop( "disabled", false )
1628
+ .removeAttr( "autocomplete" )
1629
+ .removeAttr( "role" )
1630
+ .removeAttr( "aria-valuemin" )
1631
+ .removeAttr( "aria-valuemax" )
1632
+ .removeAttr( "aria-valuenow" );
1633
+
1634
+ span_ui= document.getElementById(t+"_elementform_id_temp").parentNode;
1635
+ span_ui.parentNode.appendChild(document.getElementById(t+"_elementform_id_temp"));
1636
+ span_ui.parentNode.removeChild(span_ui);
1637
+
1638
+ jQuery("#"+t+"_elementform_id_temp")[0].spin = null;
1639
+
1640
+ spinner = jQuery( "#"+t+"_elementform_id_temp" ).spinner();
1641
+ spinner.spinner( "value", spinner_value );
1642
+ jQuery( "#"+t+"_elementform_id_temp" ).spinner({ min: spinner_min_value});
1643
+ jQuery( "#"+t+"_elementform_id_temp" ).spinner({ max: spinner_max_value});
1644
+ jQuery( "#"+t+"_elementform_id_temp" ).spinner({ step: spinner_step});
1645
+
1646
+ }
1647
+ else
1648
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_slider") {
1649
+
1650
+ var slider_value = document.getElementById(t+"_slider_valueform_id_temp").value;
1651
+ var slider_min_value = document.getElementById(t+"_slider_min_valueform_id_temp").value;
1652
+ var slider_max_value = document.getElementById(t+"_slider_max_valueform_id_temp").value;
1653
+
1654
+ var slider_element_value = document.getElementById( t+"_element_valueform_id_temp" );
1655
+ var slider_value_save = document.getElementById( t+"_slider_valueform_id_temp" );
1656
+
1657
+ document.getElementById(t+"_elementform_id_temp").innerHTML = "";
1658
+ document.getElementById(t+"_elementform_id_temp").removeAttribute( "class" );
1659
+ document.getElementById(t+"_elementform_id_temp").removeAttribute( "aria-disabled" );
1660
+
1661
+ jQuery("#"+t+"_elementform_id_temp")[0].slide = null;
1662
+
1663
+ jQuery(function() {
1664
+ jQuery( "#"+t+"_elementform_id_temp").slider({
1665
+ range: "min",
1666
+ value: eval(slider_value),
1667
+ min: eval(slider_min_value),
1668
+ max: eval(slider_max_value),
1669
+ slide: function( event, ui ) {
1670
+ slider_element_value.innerHTML = "" + ui.value ;
1671
+ slider_value_save.value = "" + ui.value;
1672
+
1673
+ }
1674
+ });
1675
+
1676
+
1677
+ });
1678
+
1679
+
1680
+ }
1681
+ else
1682
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_range"){
1683
+ var spinner_value0 = jQuery("#" + t+"_elementform_id_temp0").get( "aria-valuenow" );
1684
+ var spinner_step = document.getElementById(t+"_range_stepform_id_temp").value;
1685
+
1686
+ jQuery( "#"+t+"_elementform_id_temp0" ).removeClass( "ui-spinner-input" )
1687
+ .prop( "disabled", false )
1688
+ .removeAttr( "autocomplete" )
1689
+ .removeAttr( "role" )
1690
+ .removeAttr( "aria-valuenow" );
1691
+
1692
+ span_ui= document.getElementById(t+"_elementform_id_temp0").parentNode;
1693
+ span_ui.parentNode.appendChild(document.getElementById(t+"_elementform_id_temp0"));
1694
+ span_ui.parentNode.removeChild(span_ui);
1695
+
1696
+
1697
+ jQuery("#"+t+"_elementform_id_temp0")[0].spin = null;
1698
+ jQuery("#"+t+"_elementform_id_temp1")[0].spin = null;
1699
+
1700
+ spinner0 = jQuery( "#"+t+"_elementform_id_temp0" ).spinner();
1701
+ spinner0.spinner( "value", spinner_value0 );
1702
+ jQuery( "#"+t+"_elementform_id_temp0" ).spinner({ step: spinner_step});
1703
+
1704
+
1705
+
1706
+ var spinner_value1 = jQuery("#" + t+"_elementform_id_temp1").get( "aria-valuenow" );
1707
+
1708
+ jQuery( "#"+t+"_elementform_id_temp1" ).removeClass( "ui-spinner-input" )
1709
+ .prop( "disabled", false )
1710
+ .removeAttr( "autocomplete" )
1711
+ .removeAttr( "role" )
1712
+ .removeAttr( "aria-valuenow" );
1713
+
1714
+ span_ui1= document.getElementById(t+"_elementform_id_temp1").parentNode;
1715
+ span_ui1.parentNode.appendChild(document.getElementById(t+"_elementform_id_temp1"));
1716
+ span_ui1.parentNode.removeChild(span_ui1);
1717
+
1718
+ spinner1 = jQuery( "#"+t+"_elementform_id_temp1" ).spinner();
1719
+ spinner1.spinner( "value", spinner_value1 );
1720
+ jQuery( "#"+t+"_elementform_id_temp1" ).spinner({ step: spinner_step});
1721
+
1722
+ var myu = t;
1723
+ jQuery(document).ready(function() {
1724
+
1725
+ jQuery("#"+myu+"_mini_label_from").click(function() {
1726
+ if (jQuery(this).children('input').length == 0) {
1727
+ 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()+"\">";
1728
+ jQuery(this).html(from);
1729
+ jQuery("input.from").focus();
1730
+ jQuery("input.from").blur(function() {
1731
+ var id_for_blur = document.getElementById('from').parentNode.id.split('_');
1732
+ var value = jQuery(this).val();
1733
+ jQuery("#"+id_for_blur[0]+"_mini_label_from").text(value);
1734
+ });
1735
+ }
1736
+ });
1737
+
1738
+ jQuery("label#"+myu+"_mini_label_to").click(function() {
1739
+ if (jQuery(this).children('input').length == 0) {
1740
+
1741
+ 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()+"\">";
1742
+ jQuery(this).html(to);
1743
+ jQuery("input.to").focus();
1744
+ jQuery("input.to").blur(function() {
1745
+ var id_for_blur = document.getElementById('to').parentNode.id.split('_');
1746
+ var value = jQuery(this).val();
1747
+
1748
+ jQuery("#"+id_for_blur[0]+"_mini_label_to").text(value);
1749
+ });
1750
+
1751
+ }
1752
+ });
1753
+
1754
+
1755
+
1756
+ });
1757
+ }
1758
+
1759
+ else
1760
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_name"){
1761
+ var myu = t;
1762
+ jQuery(document).ready(function() {
1763
+
1764
+ jQuery("#"+myu+"_mini_label_first").click(function() {
1765
+
1766
+ if (jQuery(this).children('input').length == 0) {
1767
+
1768
+ var first = "<input type='text' id='first' class='first' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1769
+ jQuery(this).html(first);
1770
+ jQuery("input.first").focus();
1771
+ jQuery("input.first").blur(function() {
1772
+
1773
+ var id_for_blur = document.getElementById('first').parentNode.id.split('_');
1774
+ var value = jQuery(this).val();
1775
+ jQuery("#"+id_for_blur[0]+"_mini_label_first").text(value);
1776
+ });
1777
+ }
1778
+ });
1779
+
1780
+ jQuery("label#"+myu+"_mini_label_last").click(function() {
1781
+ if (jQuery(this).children('input').length == 0) {
1782
+
1783
+ var last = "<input type='text' id='last' class='last' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1784
+ jQuery(this).html(last);
1785
+ jQuery("input.last").focus();
1786
+ jQuery("input.last").blur(function() {
1787
+ var id_for_blur = document.getElementById('last').parentNode.id.split('_');
1788
+ var value = jQuery(this).val();
1789
+
1790
+ jQuery("#"+id_for_blur[0]+"_mini_label_last").text(value);
1791
+ });
1792
+
1793
+ }
1794
+ });
1795
+
1796
+ jQuery("label#"+myu+"_mini_label_title").click(function() {
1797
+ if (jQuery(this).children('input').length == 0) {
1798
+ var title = "<input type='text' id='title' class='title' size='10' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1799
+ jQuery(this).html(title);
1800
+ jQuery("input.title").focus();
1801
+ jQuery("input.title").blur(function() {
1802
+ var id_for_blur = document.getElementById('title').parentNode.id.split('_');
1803
+ var value = jQuery(this).val();
1804
+
1805
+
1806
+ jQuery("#"+id_for_blur[0]+"_mini_label_title").text(value);
1807
+ });
1808
+ }
1809
+
1810
+ });
1811
+
1812
+
1813
+ jQuery("label#"+myu+"_mini_label_middle").click(function() {
1814
+ if (jQuery(this).children('input').length == 0) {
1815
+ var middle = "<input type='text' id='middle' class='middle' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1816
+ jQuery(this).html(middle);
1817
+ jQuery("input.middle").focus();
1818
+ jQuery("input.middle").blur(function() {
1819
+ var id_for_blur = document.getElementById('middle').parentNode.id.split('_');
1820
+ var value = jQuery(this).val();
1821
+
1822
+ jQuery("#"+id_for_blur[0]+"_mini_label_middle").text(value);
1823
+ });
1824
+ }
1825
+ });
1826
+
1827
+ });
1828
+ }
1829
+ else
1830
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_address"){
1831
+ var myu = t;
1832
+
1833
+ jQuery(document).ready(function() {
1834
+ jQuery("label#"+myu+"_mini_label_street1").click(function() {
1835
+
1836
+ if (jQuery(this).children('input').length == 0) {
1837
+ var street1 = "<input type='text' id='street1' class='street1' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1838
+ jQuery(this).html(street1);
1839
+ jQuery("input.street1").focus();
1840
+ jQuery("input.street1").blur(function() {
1841
+ var id_for_blur = document.getElementById('street1').parentNode.id.split('_');
1842
+ var value = jQuery(this).val();
1843
+ jQuery("#"+id_for_blur[0]+"_mini_label_street1").text(value);
1844
+ });
1845
+ }
1846
+ });
1847
+
1848
+ jQuery("label#"+myu+"_mini_label_street2").click(function() {
1849
+ if (jQuery(this).children('input').length == 0) {
1850
+ var street2 = "<input type='text' id='street2' class='street2' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1851
+ jQuery(this).html(street2);
1852
+ jQuery("input.street2").focus();
1853
+ jQuery("input.street2").blur(function() {
1854
+ var id_for_blur = document.getElementById('street2').parentNode.id.split('_');
1855
+ var value = jQuery(this).val();
1856
+ jQuery("#"+id_for_blur[0]+"_mini_label_street2").text(value);
1857
+ });
1858
+ }
1859
+ });
1860
+
1861
+
1862
+ jQuery("label#"+myu+"_mini_label_city").click(function() {
1863
+ if (jQuery(this).children('input').length == 0) {
1864
+ var city = "<input type='text' id='city' class='city' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1865
+ jQuery(this).html(city);
1866
+ jQuery("input.city").focus();
1867
+ jQuery("input.city").blur(function() {
1868
+ var id_for_blur = document.getElementById('city').parentNode.id.split('_');
1869
+ var value = jQuery(this).val();
1870
+ jQuery("#"+id_for_blur[0]+"_mini_label_city").text(value);
1871
+ });
1872
+ }
1873
+ });
1874
+
1875
+ jQuery("label#"+myu+"_mini_label_state").click(function() {
1876
+ if (jQuery(this).children('input').length == 0) {
1877
+ var state = "<input type='text' id='state' class='state' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1878
+ jQuery(this).html(state);
1879
+ jQuery("input.state").focus();
1880
+ jQuery("input.state").blur(function() {
1881
+ var id_for_blur = document.getElementById('state').parentNode.id.split('_');
1882
+ var value = jQuery(this).val();
1883
+ jQuery("#"+id_for_blur[0]+"_mini_label_state").text(value);
1884
+ });
1885
+ }
1886
+ });
1887
+
1888
+ jQuery("label#"+myu+"_mini_label_postal").click(function() {
1889
+ if (jQuery(this).children('input').length == 0) {
1890
+ var postal = "<input type='text' id='postal' class='postal' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1891
+ jQuery(this).html(postal);
1892
+ jQuery("input.postal").focus();
1893
+ jQuery("input.postal").blur(function() {
1894
+ var id_for_blur = document.getElementById('postal').parentNode.id.split('_');
1895
+ var value = jQuery(this).val();
1896
+ jQuery("#"+id_for_blur[0]+"_mini_label_postal").text(value);
1897
+ });
1898
+ }
1899
+ });
1900
+
1901
+
1902
+ jQuery("label#"+myu+"_mini_label_country").click(function() {
1903
+ if (jQuery(this).children('input').length == 0) {
1904
+ var country = "<input type='country' id='country' class='country' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1905
+ jQuery(this).html(country);
1906
+ jQuery("input.country").focus();
1907
+ jQuery("input.country").blur(function() {
1908
+ var id_for_blur = document.getElementById('country').parentNode.id.split('_');
1909
+ var value = jQuery(this).val();
1910
+ jQuery("#"+id_for_blur[0]+"_mini_label_country").text(value);
1911
+ });
1912
+ }
1913
+ });
1914
+ });
1915
+
1916
+ }
1917
+ else
1918
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_phone"){
1919
+ var myu = t;
1920
+
1921
+ jQuery(document).ready(function() {
1922
+ jQuery("label#"+myu+"_mini_label_area_code").click(function() {
1923
+ if (jQuery(this).children('input').length == 0) {
1924
+
1925
+ 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()+"\">";
1926
+
1927
+ jQuery(this).html(area_code);
1928
+ jQuery("input.area_code").focus();
1929
+ jQuery("input.area_code").blur(function() {
1930
+ var id_for_blur = document.getElementById('area_code').parentNode.id.split('_');
1931
+ var value = jQuery(this).val();
1932
+ jQuery("#"+id_for_blur[0]+"_mini_label_area_code").text(value);
1933
+ });
1934
+ }
1935
+ });
1936
+
1937
+
1938
+ jQuery("label#"+myu+"_mini_label_phone_number").click(function() {
1939
+
1940
+ if (jQuery(this).children('input').length == 0) {
1941
+ var phone_number = "<input type='text' id='phone_number' class='phone_number' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1942
+
1943
+ jQuery(this).html(phone_number);
1944
+
1945
+ jQuery("input.phone_number").focus();
1946
+ jQuery("input.phone_number").blur(function() {
1947
+ var id_for_blur = document.getElementById('phone_number').parentNode.id.split('_');
1948
+ var value = jQuery(this).val();
1949
+ jQuery("#"+id_for_blur[0]+"_mini_label_phone_number").text(value);
1950
+ });
1951
+ }
1952
+ });
1953
+
1954
+ });
1955
+ }
1956
+ else
1957
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_date_fields"){
1958
+ var myu = t;
1959
+
1960
+ jQuery(document).ready(function() {
1961
+ jQuery("label#"+myu+"_day_label").click(function() {
1962
+ if (jQuery(this).children('input').length == 0) {
1963
+ var day = "<input type='text' id='day' class='day' size='8' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1964
+ jQuery(this).html(day);
1965
+ jQuery("input.day").focus();
1966
+ jQuery("input.day").blur(function() {
1967
+ var id_for_blur = document.getElementById('day').parentNode.id.split('_');
1968
+ var value = jQuery(this).val();
1969
+
1970
+ jQuery("#"+id_for_blur[0]+"_day_label").text(value);
1971
+ });
1972
+ }
1973
+ });
1974
+
1975
+
1976
+ jQuery("label#"+myu+"_month_label").click(function() {
1977
+ if (jQuery(this).children('input').length == 0) {
1978
+ var month = "<input type='text' id='month' class='month' size='8' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1979
+ jQuery(this).html(month);
1980
+ jQuery("input.month").focus();
1981
+ jQuery("input.month").blur(function() {
1982
+ var id_for_blur = document.getElementById('month').parentNode.id.split('_');
1983
+ var value = jQuery(this).val();
1984
+
1985
+ jQuery("#"+id_for_blur[0]+"_month_label").text(value);
1986
+ });
1987
+ }
1988
+ });
1989
+
1990
+ jQuery("label#"+myu+"_year_label").click(function() {
1991
+ if (jQuery(this).children('input').length == 0) {
1992
+ var year = "<input type='text' id='year' class='year' size='8' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1993
+ jQuery(this).html(year);
1994
+ jQuery("input.year").focus();
1995
+ jQuery("input.year").blur(function() {
1996
+ var id_for_blur = document.getElementById('year').parentNode.id.split('_');
1997
+ var value = jQuery(this).val();
1998
+
1999
+ jQuery("#"+id_for_blur[0]+"_year_label").text(value);
2000
+ });
2001
+ }
2002
+ });
2003
+
2004
+ });
2005
+
2006
+
2007
+ }
2008
+ else
2009
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_time"){
2010
+ var myu = t;
2011
+
2012
+ jQuery(document).ready(function() {
2013
+ jQuery("label#"+myu+"_mini_label_hh").click(function() {
2014
+ if (jQuery(this).children('input').length == 0) {
2015
+ var hh = "<input type='text' id='hh' class='hh' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2016
+ jQuery(this).html(hh);
2017
+ jQuery("input.hh").focus();
2018
+ jQuery("input.hh").blur(function() {
2019
+ var id_for_blur = document.getElementById('hh').parentNode.id.split('_');
2020
+ var value = jQuery(this).val();
2021
+
2022
+
2023
+ jQuery("#"+id_for_blur[0]+"_mini_label_hh").text(value);
2024
+ });
2025
+ }
2026
+ });
2027
+
2028
+
2029
+ jQuery("label#"+myu+"_mini_label_mm").click(function() {
2030
+ if (jQuery(this).children('input').length == 0) {
2031
+ var mm = "<input type='text' id='mm' class='mm' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2032
+ jQuery(this).html(mm);
2033
+ jQuery("input.mm").focus();
2034
+ jQuery("input.mm").blur(function() {
2035
+ var id_for_blur = document.getElementById('mm').parentNode.id.split('_');
2036
+ var value = jQuery(this).val();
2037
+
2038
+ jQuery("#"+id_for_blur[0]+"_mini_label_mm").text(value);
2039
+ });
2040
+ }
2041
+ });
2042
+
2043
+ jQuery("label#"+myu+"_mini_label_ss").click(function() {
2044
+ if (jQuery(this).children('input').length == 0) {
2045
+ var ss = "<input type='text' id='ss' class='ss' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2046
+ jQuery(this).html(ss);
2047
+ jQuery("input.ss").focus();
2048
+ jQuery("input.ss").blur(function() {
2049
+ var id_for_blur = document.getElementById('ss').parentNode.id.split('_');
2050
+ var value = jQuery(this).val();
2051
+
2052
+ jQuery("#"+id_for_blur[0]+"_mini_label_ss").text(value);
2053
+ });
2054
+ }
2055
+ });
2056
+
2057
+ jQuery("label#"+myu+"_mini_label_am_pm").click(function() {
2058
+ if (jQuery(this).children('input').length == 0) {
2059
+ 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()+"\">";
2060
+ jQuery(this).html(am_pm);
2061
+ jQuery("input.am_pm").focus();
2062
+ jQuery("input.am_pm").blur(function() {
2063
+ var id_for_blur = document.getElementById('am_pm').parentNode.id.split('_');
2064
+ var value = jQuery(this).val();
2065
+
2066
+ jQuery("#"+id_for_blur[0]+"_mini_label_am_pm").text(value);
2067
+ });
2068
+ }
2069
+ });
2070
+ });
2071
+
2072
+ }
2073
+
2074
+ else
2075
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_paypal_price"){
2076
+ var myu = t;
2077
+ jQuery(document).ready(function() {
2078
+
2079
+ jQuery("#"+myu+"_mini_label_dollars").click(function() {
2080
+
2081
+ if (jQuery(this).children('input').length == 0) {
2082
+
2083
+ var dollars = "<input type='text' id='dollars' class='dollars' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2084
+ jQuery(this).html(dollars);
2085
+ jQuery("input.dollars").focus();
2086
+ jQuery("input.dollars").blur(function() {
2087
+
2088
+ var id_for_blur = document.getElementById('dollars').parentNode.id.split('_');
2089
+ var value = jQuery(this).val();
2090
+ jQuery("#"+id_for_blur[0]+"_mini_label_dollars").text(value);
2091
+ });
2092
+ }
2093
+ });
2094
+
2095
+ jQuery("label#"+myu+"_mini_label_cents").click(function() {
2096
+ if (jQuery(this).children('input').length == 0) {
2097
+
2098
+ var cents = "<input type='text' id='cents' class='cents' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2099
+ jQuery(this).html(cents);
2100
+ jQuery("input.cents").focus();
2101
+ jQuery("input.cents").blur(function() {
2102
+ var id_for_blur = document.getElementById('cents').parentNode.id.split('_');
2103
+ var value = jQuery(this).val();
2104
+
2105
+ jQuery("#"+id_for_blur[0]+"_mini_label_cents").text(value);
2106
+ });
2107
+
2108
+ }
2109
+ });
2110
+ });
2111
+ }
2112
+ else
2113
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_scale_rating"){
2114
+ var myu = t;
2115
+ jQuery(document).ready(function() {
2116
+
2117
+ jQuery("#"+myu+"_mini_label_worst").click(function() {
2118
+
2119
+ if (jQuery(this).children('input').length == 0) {
2120
+
2121
+ 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()+"\">";
2122
+ jQuery(this).html(worst);
2123
+ jQuery("input.worst").focus();
2124
+ jQuery("input.worst").blur(function() {
2125
+
2126
+ var id_for_blur = document.getElementById('worst').parentNode.id.split('_');
2127
+ var value = jQuery(this).val();
2128
+ jQuery("#"+id_for_blur[0]+"_mini_label_worst").text(value);
2129
+ });
2130
+ }
2131
+ });
2132
+
2133
+ jQuery("label#"+myu+"_mini_label_best").click(function() {
2134
+ if (jQuery(this).children('input').length == 0) {
2135
+
2136
+ 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()+"\">";
2137
+ jQuery(this).html(best);
2138
+ jQuery("input.best").focus();
2139
+ jQuery("input.best").blur(function() {
2140
+ var id_for_blur = document.getElementById('best').parentNode.id.split('_');
2141
+ var value = jQuery(this).val();
2142
+
2143
+ jQuery("#"+id_for_blur[0]+"_mini_label_best").text(value);
2144
+ });
2145
+
2146
+ }
2147
+ });
2148
+
2149
+
2150
+
2151
+ });
2152
+ }
2153
+ }
2154
+ form_view = 1;
2155
+ form_view_count = 0;
2156
+ for (i = 1; i <= 30; i++) {
2157
+ if (document.getElementById('form_id_tempform_view'+i)) {
2158
+ form_view_count++;
2159
+ form_view_max=i;
2160
+ }
2161
+ }
2162
+ if (form_view_count > 1) {
2163
+ for (i=1; i<=form_view_max; i++) {
2164
+ if (document.getElementById('form_id_tempform_view'+i)) {
2165
+ first_form_view=i;
2166
+ break;
2167
+ }
2168
+ }
2169
+ form_view=form_view_max;
2170
+ generate_page_nav(first_form_view);
2171
+ var img_EDIT = document.createElement("img");
2172
+ img_EDIT.setAttribute("src", "<?php echo WD_FMC_URL . '/images/edit.png'; ?>");
2173
+ img_EDIT.style.cssText = "margin-left:40px; cursor:pointer";
2174
+ img_EDIT.setAttribute("onclick", 'el_page_navigation()');
2175
+ var td_EDIT = document.getElementById("edit_page_navigation");
2176
+ td_EDIT.appendChild(img_EDIT);
2177
+ document.getElementById('page_navigation').appendChild(td_EDIT);
2178
+ }
2179
+ //if(document.getElementById('take').innerHTML.indexOf('up_row(')==-1) location.reload(true);
2180
+ //else
2181
+
2182
+ document.getElementById('form').value=document.getElementById('take').innerHTML;
2183
+ document.getElementById('araqel').value = 1;
2184
+ }
2185
+ function formAddToOnload() {
2186
+ if (formOldFunctionOnLoad) {
2187
+ formOldFunctionOnLoad();
2188
+ }
2189
+ formOnload();
2190
+ }
2191
+ function formLoadBody() {
2192
+ formOldFunctionOnLoad = window.onload;
2193
+ window.onload = formAddToOnload;
2194
+ }
2195
+ var formOldFunctionOnLoad = null;
2196
+ formLoadBody();
2197
+ </script>
2198
+
2199
+ <input type="hidden" name="option" value="com_formmaker" />
2200
+ <input type="hidden" name="id" value="<?php echo $row->id; ?>" />
2201
+ <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
2202
+
2203
+ <input type="hidden" id="task" name="task" value=""/>
2204
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
2205
+ </form>
2206
+ <script>
2207
+ jQuery(window).load(function() {
2208
+ spider_popup();
2209
+ });
2210
+ </script>
2211
+ <?php
2212
+ }
2213
+
2214
+ public function form_options_old($id) {
2215
+ $row = $this->model->get_row_data($id);
2216
+ $themes = $this->model->get_theme_rows_data('_old');
2217
+ $page_title = $row->title . ' form options';
2218
+ $label_id = array();
2219
+ $label_label = array();
2220
+ $label_type = array();
2221
+ $label_all = explode('#****#', $row->label_order_current);
2222
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
2223
+ foreach ($label_all as $key => $label_each) {
2224
+ $label_id_each = explode('#**id**#', $label_each);
2225
+ array_push($label_id, $label_id_each[0]);
2226
+ $label_order_each = explode('#**label**#', $label_id_each[1]);
2227
+ array_push($label_label, $label_order_each[0]);
2228
+ array_push($label_type, $label_order_each[1]);
2229
+ }
2230
+ ?>
2231
+ <script>
2232
+ gen = "<?php echo $row->counter; ?>";
2233
+ form_view_max = 20;
2234
+ function set_preview() {
2235
+ document.getElementById('preview_form').href = '<?php echo add_query_arg(array('action' => 'FormMakerPreview_fmc', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&id='+document.getElementById('theme').value+'&width=1000&height=500&TB_iframe=1';
2236
+ }
2237
+ </script>
2238
+ <div style="clear: both; float: left; width: 99%;">
2239
+ <div style="float:left; font-size: 14px; font-weight: bold;">
2240
+ This section allows you to edit form options.
2241
+ <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>
2242
+ </div>
2243
+ <div style="float: right; text-align: right;">
2244
+ <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/files/fromContactForm.php">
2245
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FMC_URL . '/images/wd_logo.png'; ?>" />
2246
+ </a>
2247
+ </div>
2248
+ </div>
2249
+ <form class="wrap" method="post" action="admin.php?page=manage_fmc" style="float: left; width: 99%;" name="adminForm" id="adminForm">
2250
+ <h2><?php echo $page_title; ?></h2>
2251
+ <div style="float: right; margin: 0 5px 0 0;">
2252
+ <input class="button-secondary" type="submit" onclick="if (spider_check_email('mail') ||
2253
+ spider_check_email('from_mail') ||
2254
+ spider_check_email('paypal_email')) {return false;}; spider_set_input_value('task', 'save_options_old')" value="Save"/>
2255
+ <input class="button-secondary" type="submit" onclick="if (spider_check_email('mail') ||
2256
+ spider_check_email('from_mail') ||
2257
+ spider_check_email('paypal_email')) {return false;}; spider_set_input_value('task', 'apply_options_old')" value="Apply"/>
2258
+ <input class="button-secondary" type="submit" onclick="spider_set_input_value('task', 'cancel_options_old')" value="Cancel"/>
2259
+ </div>
2260
+ <input type="hidden" name="take" id="take" value="<?php $row->form ?>">
2261
+ <div class="submenu-box" style="width: 99%; float: left; margin: 15px 0 0 0;">
2262
+ <div class="submenu-pad">
2263
+ <ul id="submenu" class="configuration">
2264
+ <li>
2265
+ <a id="general" class="fm_fieldset_tab" onclick="form_maker_options_tabs('general')" href="#">General Options</a>
2266
+ </li>
2267
+ <li>
2268
+ <a id="actions" class="fm_fieldset_tab" onclick="form_maker_options_tabs('actions')" href="#">Actions after Submission</a>
2269
+ </li>
2270
+ <li>
2271
+ <a id="payment" class="fm_fieldset_tab" onclick="form_maker_options_tabs('payment')" href="#">Payment Options</a>
2272
+ </li>
2273
+ <li>
2274
+ <a id="javascript" class="fm_fieldset_tab" onclick="form_maker_options_tabs('javascript')" href="#">JavaScript</a>
2275
+ </li>
2276
+ <li>
2277
+ <a id="custom" class="fm_fieldset_tab" onclick="form_maker_options_tabs('custom')" href="#">Custom Text in Email</a>
2278
+ </li>
2279
+ </ul>
2280
+ </div>
2281
+ </div>
2282
+ <fieldset id="actions_fieldset" class="adminform fm_fieldset_deactive">
2283
+ <legend style="color:#0B55C4;font-weight: bold;">Actions after submission</legend>
2284
+ <table class="admintable">
2285
+ <tr valign="top">
2286
+ <td class="fm_options_label">
2287
+ <label>Action type</label>
2288
+ </td>
2289
+ <td class="fm_options_value">
2290
+ <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>
2291
+ <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>
2292
+ <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>
2293
+ <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>
2294
+ <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>
2295
+ </td>
2296
+ </tr>
2297
+ <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"' : ''); ?>>
2298
+ <td class="fm_options_label">
2299
+ <label>Stay on Form</label>
2300
+ </td>
2301
+ <td class="fm_options_value">
2302
+ <img src="<?php echo WD_FMC_URL . '/images/tick.png'; ?>" border="0">
2303
+ </td>
2304
+ </tr>
2305
+ <tr id="post" <?php echo (($row->submit_text_type != 2) ? 'style="display:none"' : ''); ?>>
2306
+ <td class="fm_options_label">
2307
+ <label for="post_name">Post</label>
2308
+ </td>
2309
+ <td class="fm_options_value">
2310
+ <select id="post_name" name="post_name" style="width: 153px; font-size: 11px;">
2311
+ <option value="0">- Select Post -</option>
2312
+ <?php
2313
+ // The Query.
2314
+ $args = array('posts_per_page' => 10000);
2315
+ query_posts($args);
2316
+ // The Loop.
2317
+ while (have_posts()) : the_post(); ?>
2318
+ <option value="<?php $x = get_permalink(get_the_ID()); echo $x; ?>" <?php echo (($row->article_id == $x) ? 'selected="selected"' : ''); ?>><?php the_title(); ?></option>
2319
+ <?php
2320
+ endwhile;
2321
+ // Reset Query.
2322
+ wp_reset_query();
2323
+ ?>
2324
+ </select>
2325
+ </td>
2326
+ </tr>
2327
+ <tr id="page" <?php echo (($row->submit_text_type != 5) ? 'style="display:none"' : ''); ?>>
2328
+ <td class="fm_options_label">
2329
+ <label for="page_name">Page</label>
2330
+ </td>
2331
+ <td class="fm_options_value">
2332
+ <select id="page_name" name="page_name" style="width:153px; font-size:11px;">
2333
+ <option value="0">- Select Page -</option>
2334
+ <?php
2335
+ // The Query.
2336
+ $pages = get_pages();
2337
+ // The Loop.
2338
+ foreach ($pages as $page) {
2339
+ $page_id = get_page_link($page->ID);
2340
+ ?>
2341
+ <option value="<?php echo $page_id; ?>" <?php echo (($row->article_id == $page_id) ? 'selected="selected"' : ''); ?>><?php echo $page->post_title; ?></option>
2342
+ <?php
2343
+ }
2344
+ // Reset Query.
2345
+ wp_reset_query();
2346
+ ?>
2347
+ </select>
2348
+ </td>
2349
+ </tr>
2350
+ <tr id="custom_text" <?php echo (($row->submit_text_type != 3) ? 'style="display: none;"' : ''); ?>>
2351
+ <td class="fm_options_label">
2352
+ <label for="submit_text">Text</label>
2353
+ </td>
2354
+ <td class="fm_options_value">
2355
+ <?php
2356
+ if (user_can_richedit()) {
2357
+ wp_editor($row->submit_text, 'submit_text', array('teeny' => FALSE, 'textarea_name' => 'submit_text', 'media_buttons' => FALSE, 'textarea_rows' => 5));
2358
+ }
2359
+ else {
2360
+ ?>
2361
+ <textarea cols="36" rows="5" id="submit_text" name="submit_text" style="resize: vertical;">
2362
+ <?php echo $row->submit_text; ?>
2363
+ </textarea>
2364
+ <?php
2365
+ }
2366
+ ?>
2367
+ </td>
2368
+ </tr>
2369
+ <tr id="url" <?php echo (($row->submit_text_type != 4 ) ? 'style="display:none"' : ''); ?>>
2370
+ <td class="fm_options_label">
2371
+ <label for="url">URL</label>
2372
+ </td>
2373
+ <td class="fm_options_value">
2374
+ <input type="text" id="url" name="url" style="width:300px" value="<?php echo $row->url; ?>" />
2375
+ </td>
2376
+ </tr>
2377
+ </table>
2378
+ </fieldset>
2379
+ <fieldset id="custom_fieldset" class="adminform fm_fieldset_deactive">
2380
+ <legend style="color:#0B55C4;font-weight: bold;">Custom text in email</legend>
2381
+ <table class="admintable">
2382
+ <tr>
2383
+ <td class="fm_options_label" valign="top">
2384
+ <label>For Administrator</label>
2385
+ </td>
2386
+ <td class="fm_options_value">
2387
+ <div style="margin-bottom:5px">
2388
+ <?php
2389
+ $choise = "document.getElementById('script_mail')";
2390
+ for ($i = 0; $i < count($label_label); $i++) {
2391
+ 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") {
2392
+ continue;
2393
+ }
2394
+ $param = htmlspecialchars(addslashes($label_label[$i]));
2395
+ ?>
2396
+ <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; ?>')" />
2397
+ <?php
2398
+ }
2399
+ ?>
2400
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="All fields list" onClick="insertAtCursor(<?php echo $choise; ?>, 'all')" />
2401
+ </div>
2402
+ <?php
2403
+ if (user_can_richedit()) {
2404
+ wp_editor($row->script_mail, 'script_mail', array('teeny' => FALSE, 'textarea_name' => 'script_mail', 'media_buttons' => FALSE, 'textarea_rows' => 5));
2405
+ }
2406
+ else {
2407
+ ?>
2408
+ <textarea name="script_mail" id="script_mail" cols="20" rows="10" style="width:300px; height:450px;"><?php echo $row->script_mail; ?></textarea>
2409
+ <?php
2410
+ }
2411
+ ?>
2412
+ </td>
2413
+ </tr>
2414
+ <tr>
2415
+ <td valign="top" height="30"></td>
2416
+ <td valign="top"></td>
2417
+ </tr>
2418
+ <tr>
2419
+ <td class="fm_options_label" valign="top">
2420
+ <label>For User</label>
2421
+ </td>
2422
+ <td class="fm_options_value">
2423
+ <div style="margin-bottom:5px">
2424
+ <?php
2425
+ $choise = "document.getElementById('script_mail_user')";
2426
+ for ($i = 0; $i < count($label_label); $i++) {
2427
+ 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") {
2428
+ continue;
2429
+ }
2430
+ $param = htmlspecialchars(addslashes($label_label[$i]));
2431
+ ?>
2432
+ <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; ?>')" />
2433
+ <?php
2434
+ }
2435
+ ?>
2436
+ <input style="border: 1px solid silver; font-size: 10px; margin:3px;" type="button" value="All fields list" onClick="insertAtCursor(<?php echo $choise; ?>, 'all')" />
2437
+ </div>
2438
+ <?php
2439
+ if (user_can_richedit()) {
2440
+ wp_editor($row->script_mail_user, 'script_mail_user', array('teeny' => FALSE, 'textarea_name' => 'script_mail_user', 'media_buttons' => FALSE, 'textarea_rows' => 5));
2441
+ }
2442
+ else {
2443
+ ?>
2444
+ <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>
2445
+ <?php
2446
+ }
2447
+ ?>
2448
+ </td>
2449
+ </tr>
2450
+ </table>
2451
+ </fieldset>
2452
+ <fieldset id="general_fieldset" class="adminform fm_fieldset_deactive">
2453
+ <legend style="color:#0B55C4;font-weight: bold;">General Options</legend>
2454
+ <table class="admintable" style="float:left">
2455
+ <tr valign="top">
2456
+ <td class="fm_options_label">
2457
+ <label for="mail">Email to send submissions to</label>
2458
+ </td>
2459
+ <td class="fm_options_value">
2460
+ <input id="mail" name="mail" value="<?php echo $row->mail; ?>" style="width:250px;" />
2461
+ </td>
2462
+ </tr>
2463
+ <tr valign="top">
2464
+ <td class="fm_options_label">
2465
+ <label for="from_mail">From Email</label>
2466
+ </td>
2467
+ <td class="fm_options_value">
2468
+ <input id="from_mail" name="from_mail" value="<?php echo $row->from_mail; ?>" style="width:250px;" />
2469
+ </td>
2470
+ </tr>
2471
+ <tr valign="top">
2472
+ <td class="fm_options_label">
2473
+ <label for="from_name">From Name</label>
2474
+ </td>
2475
+ <td class="fm_options_value">
2476
+ <input id="from_name" name="from_name" value="<?php echo $row->from_name; ?>" style="width:250px;"/>
2477
+ </td>
2478
+ </tr>
2479
+ <tr valign="top">
2480
+ <td class="fm_options_label">
2481
+ <label for="theme">Theme</label>
2482
+ </td>
2483
+ <td class="fm_options_value">
2484
+ <select id="theme" name="theme" style="width:260px;" onChange="set_preview()">
2485
+ <?php
2486
+ foreach ($themes as $theme) {
2487
+ ?>
2488
+ <option value="<?php echo $theme->id; ?>" <?php echo (($theme->id == $row->theme) ? 'selected' : ''); ?>><?php echo $theme->title; ?></option>
2489
+ <?php
2490
+ }
2491
+ ?>
2492
+ </select>
2493
+ <a href="<?php echo add_query_arg(array('action' => 'FormMakerPreview_fmc', '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;">
2494
+ Preview
2495
+ </a>
2496
+ </td>
2497
+ </tr>
2498
+ </table>
2499
+ </fieldset>
2500
+ <fieldset id="payment_fieldset" class="adminform fm_fieldset_deactive">
2501
+ <legend style="color:#0B55C4;font-weight: bold;">Payment Options</legend>
2502
+ <table class="admintable">
2503
+ <tr>
2504
+ <td colspan="2">
2505
+ <div class="error" style="padding: 5px; font-size: 14px;">Paypal Options are disabled in free version.</div>
2506
+ </td>
2507
+ </tr>
2508
+ <tr valign="top">
2509
+ <td class="fm_options_label">
2510
+ <label>Turn Paypal On</label>
2511
+ </td>
2512
+ <td class="fm_options_value">
2513
+ <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>
2514
+ <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>
2515
+ </td>
2516
+ </tr>
2517
+ <tr valign="top">
2518
+ <td class="fm_options_label">
2519
+ <label>Checkout Mode</label>
2520
+ </td>
2521
+ <td class="fm_options_value">
2522
+ <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>
2523
+ <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>
2524
+ </td>
2525
+ </tr>
2526
+ <tr valign="top">
2527
+ <td class="fm_options_label">
2528
+ <label for="paypal_email">Paypal email</label>
2529
+ </td>
2530
+ <td class="fm_options_value">
2531
+ <input disabled="disabled" type="text" name="paypal_email" id="paypal_email" value="<?php echo $row->paypal_email; ?>" class="text_area" style="width:250px">
2532
+ </td>
2533
+ </tr>
2534
+ <tr valign="top">
2535
+ <td class="fm_options_label">
2536
+ <label for="payment_currency">Payment Currency</label>
2537
+ </td>
2538
+ <td class="fm_options_value">
2539
+ <select disabled="disabled" id="payment_currency" name="payment_currency" style="width:253px">
2540
+ <option value="USD" <?php echo (($row->payment_currency == 'USD') ? 'selected' : ''); ?>>$ &#8226; U.S. Dollar</option>
2541
+ <option value="EUR" <?php echo (($row->payment_currency == 'EUR') ? 'selected' : ''); ?>>&#8364; &#8226; Euro</option>
2542
+ <option value="GBP" <?php echo (($row->payment_currency == 'GBP') ? 'selected' : ''); ?>>&#163; &#8226; Pound Sterling</option>
2543
+ <option value="JPY" <?php echo (($row->payment_currency == 'JPY') ? 'selected' : ''); ?>>&#165; &#8226; Japanese Yen</option>
2544
+ <option value="CAD" <?php echo (($row->payment_currency == 'CAD') ? 'selected' : ''); ?>>C$ &#8226; Canadian Dollar</option>
2545
+ <option value="MXN" <?php echo (($row->payment_currency == 'MXN') ? 'selected' : ''); ?>>Mex$ &#8226; Mexican Peso</option>
2546
+ <option value="HKD" <?php echo (($row->payment_currency == 'HKD') ? 'selected' : ''); ?>>HK$ &#8226; Hong Kong Dollar</option>
2547
+ <option value="HUF" <?php echo (($row->payment_currency == 'HUF') ? 'selected' : ''); ?>>Ft &#8226; Hungarian Forint</option>
2548
+ <option value="NOK" <?php echo (($row->payment_currency == 'NOK') ? 'selected' : ''); ?>>kr &#8226; Norwegian Kroner</option>
2549
+ <option value="NZD" <?php echo (($row->payment_currency == 'NZD') ? 'selected' : ''); ?>>NZ$ &#8226; New Zealand Dollar</option>
2550
+ <option value="SGD" <?php echo (($row->payment_currency == 'SGD') ? 'selected' : ''); ?>>S$ &#8226; Singapore Dollar</option>
2551
+ <option value="SEK" <?php echo (($row->payment_currency == 'SEK') ? 'selected' : ''); ?>>kr &#8226; Swedish Kronor</option>
2552
+ <option value="PLN" <?php echo (($row->payment_currency == 'PLN') ? 'selected' : ''); ?>>zl &#8226; Polish Zloty</option>
2553
+ <option value="AUD" <?php echo (($row->payment_currency == 'AUD') ? 'selected' : ''); ?>>A$ &#8226; Australian Dollar</option>
2554
+ <option value="DKK" <?php echo (($row->payment_currency == 'DKK') ? 'selected' : ''); ?>>kr &#8226; Danish Kroner</option>
2555
+ <option value="CHF" <?php echo (($row->payment_currency == 'CHF') ? 'selected' : ''); ?>>CHF &#8226; Swiss Francs</option>
2556
+ <option value="CZK" <?php echo (($row->payment_currency == 'CZK') ? 'selected' : ''); ?>>Kc &#8226; Czech Koruny</option>
2557
+ <option value="ILS" <?php echo (($row->payment_currency == 'ILS') ? 'selected' : ''); ?>>&#8362; &#8226; Israeli Sheqel</option>
2558
+ <option value="BRL" <?php echo (($row->payment_currency == 'BRL') ? 'selected' : ''); ?>>R$ &#8226; Brazilian Real</option>
2559
+ <option value="TWD" <?php echo (($row->payment_currency == 'TWD') ? 'selected' : ''); ?>>NT$ &#8226; Taiwan New Dollars</option>
2560
+ <option value="MYR" <?php echo (($row->payment_currency == 'MYR') ? 'selected' : ''); ?>>RM &#8226; Malaysian Ringgit</option>
2561
+ <option value="PHP" <?php echo (($row->payment_currency == 'PHP') ? 'selected' : ''); ?>>&#8369; &#8226; Philippine Peso</option>
2562
+ <option value="THB" <?php echo (($row->payment_currency == 'THB') ? 'selected' : ''); ?>>&#xe3f; &#8226; Thai Bahtv</option>
2563
+ </select>
2564
+ </td>
2565
+ </tr>
2566
+ <tr valign="top">
2567
+ <td class="fm_options_label">
2568
+ <label for="tax">Tax</label>
2569
+ </td>
2570
+ <td class="fm_options_value">
2571
+ <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)"> %
2572
+ </td>
2573
+ </tr>
2574
+ </table>
2575
+ </fieldset>
2576
+ <fieldset id="javascript_fieldset" class="adminform fm_fieldset_deactive">
2577
+ <legend style="color:#0B55C4;font-weight: bold;">JavaScript</legend>
2578
+ <table class="admintable">
2579
+ <tr valign="top">
2580
+ <td class="fm_options_label">
2581
+ <label for="javascript">Javascript</label>
2582
+ </td>
2583
+ <td class="fm_options_value">
2584
+ <textarea style="margin: 0px;" cols="60" rows="30" name="javascript" id="javascript"><?php echo $row->javascript; ?></textarea>
2585
+ </td>
2586
+ </tr>
2587
+ </table>
2588
+ </fieldset>
2589
+ <input type="hidden" name="fieldset_id" id="fieldset_id" value="<?php echo WDW_FMC_Library::get('fieldset_id', 'general'); ?>" />
2590
+ <input type="hidden" id="task" name="task" value=""/>
2591
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
2592
+ </form>
2593
+ <script>
2594
+ jQuery(window).load(function () {
2595
+ form_maker_options_tabs(jQuery("#fieldset_id").val());
2596
+ spider_popup();
2597
+ });
2598
+ </script>
2599
+ <?php
2600
+ }
2601
+
2602
+ public function form_options($id) {
2603
+ $row = $this->model->get_row_data($id);
2604
+ $themes = $this->model->get_theme_rows_data();
2605
+ $page_title = $row->title . ' form options';
2606
+ $label_id = array();
2607
+ $label_label = array();
2608
+ $label_type = array();
2609
+ $label_all = explode('#****#', $row->label_order_current);
2610
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
2611
+ foreach ($label_all as $key => $label_each) {
2612
+ $label_id_each = explode('#**id**#', $label_each);
2613
+ array_push($label_id, $label_id_each[0]);
2614
+ $label_order_each = explode('#**label**#', $label_id_each[1]);
2615
+ array_push($label_label, $label_order_each[0]);
2616
+ array_push($label_type, $label_order_each[1]);
2617
+ }
2618
+ $fields = explode('*:*id*:*type_submitter_mail*:*type*:*', $row->form_fields);
2619
+ $fields_count = count($fields);
2620
+ ?>
2621
+ <script>
2622
+ gen = "<?php echo $row->counter; ?>";
2623
+ form_view_max = 20;
2624
+ function set_preview() {
2625
+ jQuery("#preview_form").attr("href", '<?php echo add_query_arg(array('action' => 'FormMakerPreview_fmc', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&test_theme=' + jQuery("#theme").val() + '&width=1000&height=500&TB_iframe=1');
2626
+ jQuery("#edit_css").attr("href", '<?php echo add_query_arg(array('action' => 'FormMakerEditCSS_fmc', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&id=' + jQuery("#theme").val() + '&width=800&height=500&TB_iframe=1');
2627
+ }
2628
+ function set_condition() {
2629
+ field_condition ='';
2630
+
2631
+ for(i=0;i<100;i++)
2632
+ {
2633
+ conditions = '';
2634
+ if(document.getElementById("condition"+i))
2635
+ {
2636
+ field_condition+=document.getElementById("show_hide"+i).value+"*:*show_hide*:*";
2637
+ field_condition+=document.getElementById("fields"+i).value+"*:*field_label*:*";
2638
+ field_condition+=document.getElementById("all_any"+i).value+"*:*all_any*:*";
2639
+
2640
+ for(k=0;k<100;k++)
2641
+ {
2642
+ if(document.getElementById("condition_div"+i+"_"+k))
2643
+ {
2644
+ conditions+=document.getElementById("field_labels"+i+"_"+k).value+"***";
2645
+ conditions+=document.getElementById("is_select"+i+"_"+k).value+"***";
2646
+ if(document.getElementById("field_value"+i+"_"+k).tagName=="SELECT" && document.getElementById("field_value"+i+"_"+k).getAttribute('multiple'))
2647
+ {
2648
+ var sel = document.getElementById("field_value"+i+"_"+k);
2649
+ var selValues = '';
2650
+ for(m=0; m < sel.length; m++)
2651
+ {
2652
+ if(sel.options[m].selected)
2653
+ {
2654
+ selValues += sel.options[m].value+"@@@";
2655
+ }
2656
+ }
2657
+ conditions+=selValues;
2658
+ }
2659
+ else
2660
+ conditions+=document.getElementById("field_value"+i+"_"+k).value;
2661
+ conditions+="*:*next_condition*:*";
2662
+ }
2663
+ }
2664
+
2665
+ field_condition+=conditions;
2666
+ field_condition+="*:*new_condition*:*";
2667
+
2668
+ }
2669
+ }
2670
+ document.getElementById('condition').value = field_condition;
2671
+ }
2672
+ </script>
2673
+ <div style="clear: both; float: left; width: 99%;">
2674
+ <div style="float:left; font-size: 14px; font-weight: bold;">
2675
+ This section allows you to edit form options.
2676
+ <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>
2677
+ </div>
2678
+ <div style="float: right; text-align: right;">
2679
+ <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/files/fromContactForm.php">
2680
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FMC_URL . '/images/wd_logo.png'; ?>" />
2681
+ </a>
2682
+ </div>
2683
+ </div>
2684
+ <form class="wrap" method="post" action="admin.php?page=manage_fmc" style="float: left; width: 99%;" name="adminForm" id="adminForm">
2685
+ <h2><?php echo $page_title; ?></h2>
2686
+ <div style="float: right; margin: 0 5px 0 0;">
2687
+ <input class="button-secondary" type="submit" onclick="if (spider_check_email('mail') ||
2688
+ spider_check_email('from_mail') ||
2689
+ spider_check_email('reply_to') ||
2690
+ spider_check_email('mail_from_user') ||
2691
+ spider_check_email('reply_to_user') ||
2692
+ spider_check_email('mail_from_other') ||
2693
+ spider_check_email('reply_to_other') ||
2694
+ spider_check_email('paypal_email')) {return false;}; set_condition(); spider_set_input_value('task', 'save_options')" value="Save"/>
2695
+ <input class="button-secondary" type="submit" onclick="if (spider_check_email('mail') ||
2696
+ spider_check_email('from_mail') ||
2697
+ spider_check_email('reply_to') ||
2698
+ spider_check_email('mail_from_user') ||
2699
+ spider_check_email('reply_to_user') ||
2700
+ spider_check_email('mail_from_other') ||
2701
+ spider_check_email('reply_to_other') ||
2702
+ spider_check_email('paypal_email')) {return false;}; set_condition(); spider_set_input_value('task', 'apply_options')" value="Apply"/>
2703
+ <input class="button-secondary" type="submit" onclick="spider_set_input_value('task', 'cancel_options')" value="Cancel"/>
2704
+ </div>
2705
+ <div class="submenu-box" style="width: 99%; float: left; margin: 15px 0 0 0;">
2706
+ <div class="submenu-pad">
2707
+ <ul id="submenu" class="configuration">
2708
+ <li>
2709
+ <a id="general" class="fm_fieldset_tab" onclick="form_maker_options_tabs('general')" href="#">General Options</a>
2710
+ </li>
2711
+ <li>
2712
+ <a id="custom" class="fm_fieldset_tab" onclick="form_maker_options_tabs('custom')" href="#">Email Options</a>
2713
+ </li>
2714
+ <li>
2715
+ <a id="actions" class="fm_fieldset_tab" onclick="form_maker_options_tabs('actions')" href="#">Actions after Submission</a>
2716
+ </li>
2717
+ <li>
2718
+ <a id="payment" class="fm_fieldset_tab" onclick="form_maker_options_tabs('payment')" href="#">Payment Options</a>
2719
+ </li>
2720
+ <li>
2721
+ <a id="javascript" class="fm_fieldset_tab" onclick="form_maker_options_tabs('javascript')" href="#">JavaScript</a>
2722
+ </li>
2723
+ <li>
2724
+ <a id="conditions" class="fm_fieldset_tab" onclick="form_maker_options_tabs('conditions')" href="#">Conditional Fields</a>
2725
+ </li>
2726
+ </ul>
2727
+ </div>
2728
+ </div>
2729
+ <fieldset id="general_fieldset" class="adminform fm_fieldset_deactive">
2730
+ <legend style="color:#0B55C4;font-weight: bold;">General Options</legend>
2731
+ <table class="admintable" style="float: left;">
2732
+ <tr valign="top">
2733
+ <td class="fm_options_label">
2734
+ <label>Published</label>
2735
+ </td>
2736
+ <td class="fm_options_value">
2737
+ <input type="radio" name="published" id="published_yes" value="1" <?php echo ($row->published) ? "checked" : ""; ?> /><label for="published_yes">Yes</label>
2738
+ <input type="radio" name="published" id="published_no" value="0" <?php echo (!$row->published) ? "checked" : ""; ?> /><label for="published_no">No</label>
2739
+ </td>
2740
+ </tr>
2741
+ <tr valign="top">
2742
+ <td class="fm_options_label">
2743
+ <label>Save data(to database)</label>
2744
+ </td>
2745
+ <td class="fm_options_value">
2746
+ <input type="radio" name="savedb" id="savedb_yes" value="1" <?php echo ($row->savedb) ? "checked" : ""; ?> /><label for="savedb_yes">Yes</label>
2747
+ <input type="radio" name="savedb" id="savedb_no" value="0" <?php echo (!$row->savedb) ? "checked" : ""; ?> /><label for="savedb_no">No</label>
2748
+ </td>
2749
+ </tr>
2750
+ <tr valign="top">
2751
+ <td class="fm_options_label">
2752
+ <label for="theme">Theme</label>
2753
+ </td>
2754
+ <td class="fm_options_value">
2755
+ <select id="theme" name="theme" style="width:260px;" onChange="set_preview()">
2756
+ <?php
2757
+ foreach ($themes as $theme) {
2758
+ ?>
2759
+ <option value="<?php echo $theme->id; ?>" <?php echo (($theme->id == $row->theme) ? 'selected' : ''); ?>><?php echo $theme->title; ?></option>
2760
+ <?php
2761
+ }
2762
+ ?>
2763
+ </select>
2764
+ <a href="<?php echo add_query_arg(array('action' => 'FormMakerPreview_fmc', '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;">
2765
+ Preview
2766
+ </a>
2767
+ <a href="<?php echo add_query_arg(array('action' => 'FormMakerEditCSS_fmc', '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;">
2768
+ Edit CSS
2769
+ </a>
2770
+ </td>
2771
+ </tr>
2772
+ <tr valign="top">
2773
+ <td class="fm_options_label">
2774
+ <label for="requiredmark">Required fields mark</label>
2775
+ </td>
2776
+ <td class="fm_options_value">
2777
+ <input id="requiredmark" name="requiredmark" value="<?php echo $row->requiredmark; ?>" style="width:250px;" />
2778
+ </td>
2779
+ </tr>
2780
+ </table>
2781
+ </fieldset>
2782
+ <fieldset id="custom_fieldset" class="adminform fm_fieldset_deactive">
2783
+ <legend style="color: #0B55C4; font-weight: bold;">Email Options</legend>
2784
+ <table class="admintable">
2785
+ <tr valign="top">
2786
+ <td style="padding: 15px;">
2787
+ <label>Send E-mail</label>
2788
+ </td>
2789
+ <td style="padding: 15px;">
2790
+ <input type="radio" name="sendemail" id="sendemail_yes" value="1" <?php echo ($row->sendemail) ? "checked" : ""; ?> /><label for="sendemail_yes">Yes</label>
2791
+ <input type="radio" name="sendemail" id="sendemail_no" value="0" <?php echo (!$row->sendemail) ? "checked" : ""; ?> /><label for="sendemail_no">No</label>
2792
+ </td>
2793
+ </tr>
2794
+ </table>
2795
+ <fieldset class="fm_mail_options">
2796
+ <legend style="color:#0B55C4;font-weight: bold;">Email to Administrator</legend>
2797
+ <table class="admintable">
2798
+ <tr valign="top">
2799
+ <td class="fm_options_label">
2800
+ <label for="mail">Email to send submissions to</label>
2801
+ </td>
2802
+ <td class="fm_options_value">
2803
+ <input id="mail" name="mail" value="<?php echo $row->mail; ?>" style="width:250px;" />
2804
+ </td>
2805
+ </tr>
2806
+ <tr valign="top">
2807
+ <td class="fm_options_label">
2808
+ <label for="from_mail">Email From</label>
2809
+ </td>
2810
+ <td class="fm_options_value">
2811
+ <!--<input id="from_mail" name="from_mail" value="<?php echo $row->from_mail; ?>" style="width:250px;" />-->
2812
+ <?php
2813
+ $is_other = TRUE;
2814
+ for ($i = 0; $i < $fields_count - 1; $i++) {
2815
+ ?>
2816
+ <div>
2817
+ <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')" />
2818
+ <label for="from_mail<?php echo $i; ?>"><?php echo substr($fields[$i + 1], 0, strpos($fields[$i + 1], '*:*w_field_label*:*')); ?></label>
2819
+ </div>
2820
+ <?php
2821
+ if (substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*') + 15, strlen($fields[$i])) == $row->from_mail) {
2822
+ $is_other = FALSE;
2823
+ }
2824
+ }
2825
+ ?>
2826
+ <div style="<?php echo ($fields_count == 1) ? 'display:none;' : ''; ?>">
2827
+ <input type="radio" id="other" name="from_mail" value="other" <?php echo ($is_other) ? 'checked="checked"' : ''; ?> onclick="wdshow('mail_from_other')" />
2828
+ <label for="other">Other</label>
2829
+ </div>
2830
+ <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 : ''; ?>" />
2831
+ </td>
2832
+ </tr>
2833
+ <tr valign="top">
2834
+ <td class="fm_options_label">
2835
+ <label for="from_name">From Name</label>
2836
+ </td>
2837
+ <td class="fm_options_value">
2838
+ <input id="from_name" name="from_name" value="<?php echo $row->from_name; ?>" style="width: 230px;" />
2839
+ <img src="<?php echo WD_FMC_URL . '/images/add.png'; ?>" onclick="document.getElementById('mail_from_labels').style.display='block';" style="vertical-align: middle; display:inline-block; margin:0px; float:none;">
2840
+ <?php
2841
+ $choise = "document.getElementById('from_name')";
2842
+ echo '<div style="position:relative; top:-3px;"><div id="mail_from_labels" class="email_labels" style="display:none;">';
2843
+ for($i=0; $i<count($label_label); $i++)
2844
+ {
2845
+ 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" || $label_type[$i]=="type_matrix")
2846
+ continue;
2847
+
2848
+ $param = htmlspecialchars(addslashes($label_label[$i]));
2849
+
2850
+ $fld_label = $param;
2851
+ if(strlen($fld_label)>30)
2852
+ {
2853
+ $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
2854
+ $fld_label = explode("\n", $fld_label);
2855
+ $fld_label = $fld_label[0] . ' ...';
2856
+ }
2857
+
2858
+ echo "<a onClick=\"insertAtCursor(".$choise.",'".$param."'); document.getElementById('mail_from_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">".$fld_label."</a>";
2859
+
2860
+ }
2861
+ echo '</div></div>';
2862
+ ?>
2863
+ </td>
2864
+ </tr>
2865
+ <tr valign="top">
2866
+ <td class="fm_options_label">
2867
+ <label for="reply_to">Reply to<br/>(if different from "Email From") </label>
2868
+ </td>
2869
+ <td class="fm_options_value">
2870
+ <!--<input id="reply_to" name="reply_to" value="<?php echo $row->reply_to; ?>" style="width:250px;"/>-->
2871
+ <?php
2872
+ $is_other = TRUE;
2873
+ for ($i = 0; $i < $fields_count - 1; $i++) {
2874
+ ?>
2875
+ <div>
2876
+ <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')" />
2877
+ <label for="reply_to<?php echo $i; ?>"><?php echo substr($fields[$i + 1], 0, strpos($fields[$i + 1], '*:*w_field_label*:*')); ?></label>
2878
+ </div>
2879
+ <?php
2880
+ if (substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*') + 15, strlen($fields[$i])) == $row->reply_to) {
2881
+ $is_other = FALSE;
2882
+ }
2883
+ }
2884
+ ?>
2885
+ <div style="<?php echo ($fields_count == 1) ? 'display: none;' : ''; ?>">
2886
+ <input type="radio" id="other1" name="reply_to" value="other" <?php echo ($is_other) ? 'checked="checked"' : ''; ?> onclick="wdshow('reply_to_other')" />
2887
+ <label for="other1">Other</label>
2888
+ </div>
2889
+ <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 : ''; ?>" />
2890
+ </td>
2891
+ </tr>
2892
+ <tr valign="top">
2893
+ <td class="fm_options_label">
2894
+ <label> CC: </label>
2895
+ </td>
2896
+ <td class="fm_options_value">
2897
+ <input id="mail_cc" name="mail_cc" value="<?php echo $row->mail_cc ?>" style="width:250px;" />
2898
+ </td>
2899
+ </tr>
2900
+ <tr valign="top">
2901
+ <td class="fm_options_label">
2902
+ <label> BCC: </label>
2903
+ </td>
2904
+ <td class="fm_options_value">
2905
+ <input id="mail_bcc" name="mail_bcc" value="<?php echo $row->mail_bcc ?>" style="width:250px;" />
2906
+ </td>
2907
+ </tr>
2908
+ <tr valign="top">
2909
+ <td class="fm_options_label">
2910
+ <label> Subject: </label>
2911
+ </td>
2912
+ <td class="fm_options_value">
2913
+ <input id="mail_subject" name="mail_subject" value="<?php echo $row->mail_subject ?>" style="width:230px;" />
2914
+ <img src="<?php echo WD_FMC_URL . '/images/add.png'; ?>" onclick="document.getElementById('mail_subject_labels').style.display='block';" style="vertical-align: middle; display:inline-block; margin:0px; float:none;">
2915
+ <?php
2916
+ $choise = "document.getElementById('mail_subject')";
2917
+ echo '<div style="position:relative; top:-3px;"><div id="mail_subject_labels" class="email_labels" style="display:none;">';
2918
+ for($i=0; $i<count($label_label); $i++)
2919
+ {
2920
+ 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" || $label_type[$i]=="type_matrix")
2921
+ continue;
2922
+
2923
+ $param = htmlspecialchars(addslashes($label_label[$i]));
2924
+
2925
+ $fld_label = $param;
2926
+ if(strlen($fld_label)>30)
2927
+ {
2928
+ $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
2929
+ $fld_label = explode("\n", $fld_label);
2930
+ $fld_label = $fld_label[0] . ' ...';
2931
+ }
2932
+
2933
+ echo "<a onClick=\"insertAtCursor(".$choise.",'".$param."'); document.getElementById('mail_subject_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">".$fld_label."</a>";
2934
+
2935
+ }
2936
+ echo '</div></div>';
2937
+ ?>
2938
+ </td>
2939
+ </tr>
2940
+ <tr valign="top">
2941
+ <td class="fm_options_label" style="vertical-align: middle;">
2942
+ <label> Mode: </label>
2943
+ </td>
2944
+ <td class="fm_options_value">
2945
+ <input type="radio" name="mail_mode" id="htmlmode" value="1" <?php if($row->mail_mode==1 ) echo "checked" ?> /> <label for="htmlmode">HTML</label>
2946
+ <input type="radio" name="mail_mode" id="textmode" value="0" <?php if($row->mail_mode==0 ) echo "checked" ?> /> <label for="textmode">Text</label>
2947
+ </td>
2948
+ </tr>
2949
+ <tr valign="top">
2950
+ <td class="fm_options_label" style="vertical-align: middle;">
2951
+ <label> Attach File: </label>
2952
+ </td>
2953
+ <td class="fm_options_value">
2954
+ <input type="radio" disabled="disabled" name="mail_attachment" value="1" id="en_attach" <?php if($row->mail_attachment==1 ) echo "checked" ?> /> <label for="en_attach">Yes</label>
2955
+ <input type="radio" disabled="disabled" name="mail_attachment" id="dis_attach" value="0" <?php if($row->mail_attachment==0 ) echo "checked" ?> /> <label for="dis_attach">No</label>
2956
+ <div class="error" style="padding: 5px; font-size: 14px;">File attach is disabled in free version.</div>
2957
+ </td>
2958
+ </tr>
2959
+ <tr>
2960
+ <td class="fm_options_label" valign="top">
2961
+ <label>Custom Text in Email For Administrator</label>
2962
+ </td>
2963
+ <td class="fm_options_value">
2964
+ <div style="margin-bottom:5px">
2965
+ <?php
2966
+ $choise = "document.getElementById('script_mail')";
2967
+ for ($i = 0; $i < count($label_label); $i++) {
2968
+ 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") {
2969
+ continue;
2970
+ }
2971
+ $param = htmlspecialchars(addslashes($label_label[$i]));
2972
+ ?>
2973
+ <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; ?>')" />
2974
+ <?php
2975
+ }
2976
+ ?>
2977
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="All fields list" onClick="insertAtCursor(<?php echo $choise; ?>, 'all')" />
2978
+ </div>
2979
+ <?php
2980
+ if (user_can_richedit()) {
2981
+ wp_editor($row->script_mail, 'script_mail', array('teeny' => FALSE, 'textarea_name' => 'script_mail', 'media_buttons' => FALSE, 'textarea_rows' => 5));
2982
+ }
2983
+ else {
2984
+ ?>
2985
+ <textarea name="script_mail" id="script_mail" cols="20" rows="10" style="width:300px; height:450px;"><?php echo $row->script_mail; ?></textarea>
2986
+ <?php
2987
+ }
2988
+ ?>
2989
+ </td>
2990
+ </tr>
2991
+ </table>
2992
+ </fieldset>
2993
+ <fieldset class="fm_mail_options">
2994
+ <legend style="color: #0B55C4; font-weight: bold;">Email to User</legend>
2995
+ <table class="admintable">
2996
+ <tr valign="top">
2997
+ <td class="fm_options_label">
2998
+ <label for="mail">Send to</label>
2999
+ </td>
3000
+ <td class="fm_options_value">
3001
+ <?php
3002
+ $fields = explode('*:*id*:*type_submitter_mail*:*type*:*', $row->form_fields);
3003
+ $fields_count = count($fields);
3004
+ if ($fields_count == 1) {
3005
+ ?>
3006
+ There is no email field
3007
+ <?php
3008
+ }
3009
+ else {
3010
+ for ($i = 0; $i < $fields_count - 1; $i++) {
3011
+ ?>
3012
+ <div>
3013
+ <input type="checkbox" name="send_to<?php echo $i; ?>" id="send_to<?php echo $i; ?>" value="<?php echo (strlen($fields[$i])!=1 ? substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*')+15, strlen($fields[$i])) : $fields[$i]); ?>" <?php echo (is_numeric(strpos($row->send_to, '*'.(strlen($fields[$i])!=1 ? substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*')+15, strlen($fields[$i])) : $fields[$i]).'*')) ? 'checked="checked"' : '' ); ?> style="margin: 0px 5px 0px 0px;" />
3014
+ <label for="send_to<?php echo $i; ?>"><?php echo substr($fields[$i + 1], 0, strpos($fields[$i + 1], '*:*w_field_label*:*')); ?></label>
3015
+ </div>
3016
+ <?php
3017
+ }
3018
+ }
3019
+ ?>
3020
+ </td>
3021
+ </tr>
3022
+ <tr valign="top">
3023
+ <td class="fm_options_label">
3024
+ <label for="mail_from_user">Email From</label>
3025
+ </td>
3026
+ <td class="fm_options_value">
3027
+ <input id="mail_from_user" name="mail_from_user" value="<?php echo $row->mail_from_user; ?>" style="width: 250px;" />
3028
+ </td>
3029
+ </tr>
3030
+ <tr valign="top">
3031
+ <td class="fm_options_label">
3032
+ <label for="mail_from_name_user">From Name</label>
3033
+ </td>
3034
+ <td class="fm_options_value">
3035
+ <input id="mail_from_name_user" name="mail_from_name_user" value="<?php echo $row->mail_from_name_user; ?>" style="width: 230px;"/>
3036
+ <img src="<?php echo WD_FMC_URL . '/images/add.png'; ?>" onclick="document.getElementById('mail_from_name_user_labels').style.display='block';" style="vertical-align: middle; display:inline-block; margin:0px; float:none;">
3037
+ <?php
3038
+ $choise = "document.getElementById('mail_from_name_user')";
3039
+ echo '<div style="position:relative; top:-3px;"><div id="mail_from_name_user_labels" class="email_labels" style="display:none;">';
3040
+ for($i=0; $i<count($label_label); $i++)
3041
+ {
3042
+ 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")
3043
+ continue;
3044
+
3045
+ $param = htmlspecialchars(addslashes($label_label[$i]));
3046
+
3047
+ $fld_label = $param;
3048
+ if(strlen($fld_label)>30)
3049
+ {
3050
+ $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3051
+ $fld_label = explode("\n", $fld_label);
3052
+ $fld_label = $fld_label[0] . ' ...';
3053
+ }
3054
+
3055
+ echo "<a onClick=\"insertAtCursor(".$choise.",'".$param."'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">".$fld_label."</a>";
3056
+
3057
+ }
3058
+ echo '</div></div>';
3059
+ ?>
3060
+ </td>
3061
+ </tr>
3062
+ <tr valign="top">
3063
+ <td class="fm_options_label">
3064
+ <label for="reply_to_user">Reply to<br />(if different from "Email Form")</label>
3065
+ </td>
3066
+ <td class="fm_options_value">
3067
+ <input id="reply_to_user" name="reply_to_user" value="<?php echo $row->reply_to_user; ?>" style="width:250px;"/>
3068
+ </td>
3069
+ </tr>
3070
+ <tr valign="top">
3071
+ <td class="fm_options_label">
3072
+ <label> CC: </label>
3073
+ </td>
3074
+ <td class="fm_options_value">
3075
+ <input id="mail_cc_user" name="mail_cc_user" value="<?php echo $row->mail_cc_user ?>" style="width:250px;" />
3076
+ </td>
3077
+ </tr>
3078
+ <tr valign="top">
3079
+ <td class="fm_options_label">
3080
+ <label> BCC: </label>
3081
+ </td>
3082
+ <td class="fm_options_value">
3083
+ <input id="mail_bcc_user" name="mail_bcc_user" value="<?php echo $row->mail_bcc_user ?>" style="width:250px;" />
3084
+ </td>
3085
+ </tr>
3086
+ <tr valign="top">
3087
+ <td class="fm_options_label">
3088
+ <label> Subject: </label>
3089
+ </td>
3090
+ <td class="fm_options_value">
3091
+ <input id="mail_subject_user" name="mail_subject_user" value="<?php echo $row->mail_subject_user ?>" style="width:230px;" />
3092
+ <img src="<?php echo WD_FMC_URL . '/images/add.png'; ?>" onclick="document.getElementById('mail_subject_user_labels').style.display='block';" style="vertical-align: middle; display:inline-block; margin:0px; float:none;">
3093
+ <?php
3094
+ $choise = "document.getElementById('mail_subject_user')";
3095
+ echo '<div style="position:relative; top:-3px;"><div id="mail_subject_user_labels" class="email_labels" style="display:none;">';
3096
+ for($i=0; $i<count($label_label); $i++)
3097
+ {
3098
+ 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")
3099
+ continue;
3100
+
3101
+ $param = htmlspecialchars(addslashes($label_label[$i]));
3102
+
3103
+ $fld_label = $param;
3104
+ if(strlen($fld_label)>30)
3105
+ {
3106
+ $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3107
+ $fld_label = explode("\n", $fld_label);
3108
+ $fld_label = $fld_label[0] . ' ...';
3109
+ }
3110
+
3111
+ echo "<a onClick=\"insertAtCursor(".$choise.",'".$param."'); document.getElementById('mail_subject_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">".$fld_label."</a>";
3112
+
3113
+ }
3114
+ echo '</div></div>';
3115
+ ?>
3116
+ </td>
3117
+ </tr>
3118
+ <tr valign="top">
3119
+ <td class="fm_options_label" style="vertical-align: middle;">
3120
+ <label> Mode: </label>
3121
+ </td>
3122
+ <td class="fm_options_value">
3123
+ <input type="radio" name="mail_mode_user" id="htmlmode_user" value="1" <?php if($row->mail_mode_user==1 ) echo "checked" ?> /> <label for="htmlmode_user">HTML</label>
3124
+ <input type="radio" name="mail_mode_user" id="textmode_user" value="0" <?php if($row->mail_mode_user==0 ) echo "checked" ?> /> <label for="textmode_user">Text</label>
3125
+ </td>
3126
+ </tr>
3127
+ <tr valign="top">
3128
+ <td class="fm_options_label" style="vertical-align: middle;">
3129
+ <label> Attach File: </label>
3130
+ </td>
3131
+ <td class="fm_options_value">
3132
+ <input type="radio" disabled="disabled" name="mail_attachment_user" value="1" id="en_attach_user" <?php if($row->mail_attachment_user==1 ) echo "checked" ?> /> <label for="en_attach_user">Yes</label>
3133
+ <input type="radio" disabled="disabled" name="mail_attachment_user" id="dis_attach_user" value="0" <?php if($row->mail_attachment_user==0 ) echo "checked" ?> /> <label for="dis_attach_user">No</label>
3134
+ <div class="error" style="padding: 5px; font-size: 14px;">File attach is disabled in free version.</div>
3135
+ </td>
3136
+ </tr>
3137
+ <tr>
3138
+ <td class="fm_options_label" valign="top">
3139
+ <label>Custom Text in Email For User</label>
3140
+ </td>
3141
+ <td class="fm_options_value">
3142
+ <div style="margin-bottom:5px">
3143
+ <?php
3144
+ $choise = "document.getElementById('script_mail_user')";
3145
+ for ($i = 0; $i < count($label_label); $i++) {
3146
+ 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") {
3147
+ continue;
3148
+ }
3149
+ $param = htmlspecialchars(addslashes($label_label[$i]));
3150
+ ?>
3151
+ <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; ?>')" />
3152
+ <?php
3153
+ }
3154
+ ?>
3155
+ <input style="border: 1px solid silver; font-size: 10px; margin:3px;" type="button" value="All fields list" onClick="insertAtCursor(<?php echo $choise; ?>, 'all')" />
3156
+ </div>
3157
+ <?php
3158
+ if (user_can_richedit()) {
3159
+ wp_editor($row->script_mail_user, 'script_mail_user', array('teeny' => FALSE, 'textarea_name' => 'script_mail_user', 'media_buttons' => FALSE, 'textarea_rows' => 5));
3160
+ }
3161
+ else {
3162
+ ?>
3163
+ <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>
3164
+ <?php
3165
+ }
3166
+ ?>
3167
+ </td>
3168
+ </tr>
3169
+ </table>
3170
+ </fieldset>
3171
+ </fieldset>
3172
+ <fieldset id="actions_fieldset" class="adminform fm_fieldset_deactive">
3173
+ <legend style="color:#0B55C4;font-weight: bold;">Actions after submission</legend>
3174
+ <table class="admintable">
3175
+ <tr valign="top">
3176
+ <td class="fm_options_label">
3177
+ <label>Action type</label>
3178
+ </td>
3179
+ <td class="fm_options_value">
3180
+ <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>
3181
+ <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>
3182
+ <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>
3183
+ <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>
3184
+ <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>
3185
+ </td>
3186
+ </tr>
3187
+ <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"' : ''); ?>>
3188
+ <td class="fm_options_label">
3189
+ <label>Stay on Form</label>
3190
+ </td>
3191
+ <td class="fm_options_value">
3192
+ <img src="<?php echo WD_FMC_URL . '/images/tick.png'; ?>" border="0">
3193
+ </td>
3194
+ </tr>
3195
+ <tr id="post" <?php echo (($row->submit_text_type != 2) ? 'style="display:none"' : ''); ?>>
3196
+ <td class="fm_options_label">
3197
+ <label for="post_name">Post</label>
3198
+ </td>
3199
+ <td class="fm_options_value">
3200
+ <select id="post_name" name="post_name" style="width: 153px; font-size: 11px;">
3201
+ <option value="0">- Select Post -</option>
3202
+ <?php
3203
+ // The Query.
3204
+ $args = array('posts_per_page' => 10000);
3205
+ query_posts($args);
3206
+ // The Loop.
3207
+ while (have_posts()) : the_post(); ?>
3208
+ <option value="<?php $x = get_permalink(get_the_ID()); echo $x; ?>" <?php echo (($row->article_id == $x) ? 'selected="selected"' : ''); ?>><?php the_title(); ?></option>
3209
+ <?php
3210
+ endwhile;
3211
+ // Reset Query.
3212
+ wp_reset_query();
3213
+ ?>
3214
+ </select>
3215
+ </td>
3216
+ </tr>
3217
+ <tr id="page" <?php echo (($row->submit_text_type != 5) ? 'style="display:none"' : ''); ?>>
3218
+ <td class="fm_options_label">
3219
+ <label for="page_name">Page</label>
3220
+ </td>
3221
+ <td class="fm_options_value">
3222
+ <select id="page_name" name="page_name" style="width: 153px; font-size: 11px;">
3223
+ <option value="0">- Select Page -</option>
3224
+ <?php
3225
+ // The Query.
3226
+ $pages = get_pages();
3227
+ // The Loop.
3228
+ foreach ($pages as $page) {
3229
+ $page_id = get_page_link($page->ID);
3230
+ ?>
3231
+ <option value="<?php echo $page_id; ?>" <?php echo (($row->article_id == $page_id) ? 'selected="selected"' : ''); ?>><?php echo $page->post_title; ?></option>
3232
+ <?php
3233
+ }
3234
+ // Reset Query.
3235
+ wp_reset_query();
3236
+ ?>
3237
+ </select>
3238
+ </td>
3239
+ </tr>
3240
+ <tr id="custom_text" <?php echo (($row->submit_text_type != 3) ? 'style="display: none;"' : ''); ?>>
3241
+ <td class="fm_options_label">
3242
+ <label for="submit_text">Text</label>
3243
+ </td>
3244
+ <td class="fm_options_value">
3245
+ <?php
3246
+ if (user_can_richedit()) {
3247
+ wp_editor($row->submit_text, 'submit_text', array('teeny' => FALSE, 'textarea_name' => 'submit_text', 'media_buttons' => FALSE, 'textarea_rows' => 5));
3248
+ }
3249
+ else {
3250
+ ?>
3251
+ <textarea cols="36" rows="5" id="submit_text" name="submit_text" style="resize: vertical;">
3252
+ <?php echo $row->submit_text; ?>
3253
+ </textarea>
3254
+ <?php
3255
+ }
3256
+ ?>
3257
+ </td>
3258
+ </tr>
3259
+ <tr id="url" <?php echo (($row->submit_text_type != 4 ) ? 'style="display:none"' : ''); ?>>
3260
+ <td class="fm_options_label">
3261
+ <label for="url">URL</label>
3262
+ </td>
3263
+ <td class="fm_options_value">
3264
+ <input type="text" id="url" name="url" style="width:300px" value="<?php echo $row->url; ?>" />
3265
+ </td>
3266
+ </tr>
3267
+ </table>
3268
+ </fieldset>
3269
+ <fieldset id="payment_fieldset" class="adminform fm_fieldset_deactive">
3270
+ <legend style="color:#0B55C4;font-weight: bold;">Payment Options</legend>
3271
+ <table class="admintable">
3272
+ <tr>
3273
+ <td colspan="2">
3274
+ <div class="error" style="padding: 5px; font-size: 14px;">Paypal Options are disabled in free version.</div>
3275
+ </td>
3276
+ </tr>
3277
+ <tr valign="top">
3278
+ <td class="fm_options_label">
3279
+ <label>Turn Paypal On</label>
3280
+ </td>
3281
+ <td class="fm_options_value">
3282
+ <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>
3283
+ <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>
3284
+ </td>
3285
+ </tr>
3286
+ <tr valign="top">
3287
+ <td class="fm_options_label">
3288
+ <label>Checkout Mode</label>
3289
+ </td>
3290
+ <td class="fm_options_value">
3291
+ <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>
3292
+ <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>
3293
+ </td>
3294
+ </tr>
3295
+ <tr valign="top">
3296
+ <td class="fm_options_label">
3297
+ <label for="paypal_email">Paypal email</label>
3298
+ </td>
3299
+ <td class="fm_options_value">
3300
+ <input disabled="disabled" type="text" name="paypal_email" id="paypal_email" value="<?php echo $row->paypal_email; ?>" class="text_area" style="width:250px">
3301
+ </td>
3302
+ </tr>
3303
+ <tr valign="top">
3304
+ <td class="fm_options_label">
3305
+ <label for="payment_currency">Payment Currency</label>
3306
+ </td>
3307
+ <td class="fm_options_value">
3308
+ <select disabled="disabled" id="payment_currency" name="payment_currency" style="width:253px">
3309
+ <option value="USD" <?php echo (($row->payment_currency == 'USD') ? 'selected' : ''); ?>>$ &#8226; U.S. Dollar</option>
3310
+ <option value="EUR" <?php echo (($row->payment_currency == 'EUR') ? 'selected' : ''); ?>>&#8364; &#8226; Euro</option>
3311
+ <option value="GBP" <?php echo (($row->payment_currency == 'GBP') ? 'selected' : ''); ?>>&#163; &#8226; Pound Sterling</option>
3312
+ <option value="JPY" <?php echo (($row->payment_currency == 'JPY') ? 'selected' : ''); ?>>&#165; &#8226; Japanese Yen</option>
3313
+ <option value="CAD" <?php echo (($row->payment_currency == 'CAD') ? 'selected' : ''); ?>>C$ &#8226; Canadian Dollar</option>
3314
+ <option value="MXN" <?php echo (($row->payment_currency == 'MXN') ? 'selected' : ''); ?>>Mex$ &#8226; Mexican Peso</option>
3315
+ <option value="HKD" <?php echo (($row->payment_currency == 'HKD') ? 'selected' : ''); ?>>HK$ &#8226; Hong Kong Dollar</option>
3316
+ <option value="HUF" <?php echo (($row->payment_currency == 'HUF') ? 'selected' : ''); ?>>Ft &#8226; Hungarian Forint</option>
3317
+ <option value="NOK" <?php echo (($row->payment_currency == 'NOK') ? 'selected' : ''); ?>>kr &#8226; Norwegian Kroner</option>
3318
+ <option value="NZD" <?php echo (($row->payment_currency == 'NZD') ? 'selected' : ''); ?>>NZ$ &#8226; New Zealand Dollar</option>
3319
+ <option value="SGD" <?php echo (($row->payment_currency == 'SGD') ? 'selected' : ''); ?>>S$ &#8226; Singapore Dollar</option>
3320
+ <option value="SEK" <?php echo (($row->payment_currency == 'SEK') ? 'selected' : ''); ?>>kr &#8226; Swedish Kronor</option>
3321
+ <option value="PLN" <?php echo (($row->payment_currency == 'PLN') ? 'selected' : ''); ?>>zl &#8226; Polish Zloty</option>
3322
+ <option value="AUD" <?php echo (($row->payment_currency == 'AUD') ? 'selected' : ''); ?>>A$ &#8226; Australian Dollar</option>
3323
+ <option value="DKK" <?php echo (($row->payment_currency == 'DKK') ? 'selected' : ''); ?>>kr &#8226; Danish Kroner</option>
3324
+ <option value="CHF" <?php echo (($row->payment_currency == 'CHF') ? 'selected' : ''); ?>>CHF &#8226; Swiss Francs</option>
3325
+ <option value="CZK" <?php echo (($row->payment_currency == 'CZK') ? 'selected' : ''); ?>>Kc &#8226; Czech Koruny</option>
3326
+ <option value="ILS" <?php echo (($row->payment_currency == 'ILS') ? 'selected' : ''); ?>>&#8362; &#8226; Israeli Sheqel</option>
3327
+ <option value="BRL" <?php echo (($row->payment_currency == 'BRL') ? 'selected' : ''); ?>>R$ &#8226; Brazilian Real</option>
3328
+ <option value="TWD" <?php echo (($row->payment_currency == 'TWD') ? 'selected' : ''); ?>>NT$ &#8226; Taiwan New Dollars</option>
3329
+ <option value="MYR" <?php echo (($row->payment_currency == 'MYR') ? 'selected' : ''); ?>>RM &#8226; Malaysian Ringgit</option>
3330
+ <option value="PHP" <?php echo (($row->payment_currency == 'PHP') ? 'selected' : ''); ?>>&#8369; &#8226; Philippine Peso</option>
3331
+ <option value="THB" <?php echo (($row->payment_currency == 'THB') ? 'selected' : ''); ?>>&#xe3f; &#8226; Thai Bahtv</option>
3332
+ </select>
3333
+ </td>
3334
+ </tr>
3335
+ <tr valign="top">
3336
+ <td class="fm_options_label">
3337
+ <label for="tax">Tax</label>
3338
+ </td>
3339
+ <td class="fm_options_value">
3340
+ <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)"> %
3341
+ </td>
3342
+ </tr>
3343
+ </table>
3344
+ </fieldset>
3345
+ <fieldset id="javascript_fieldset" class="adminform fm_fieldset_deactive">
3346
+ <legend style="color:#0B55C4;font-weight: bold;">JavaScript</legend>
3347
+ <table class="admintable">
3348
+ <tr valign="top">
3349
+ <td class="fm_options_label">
3350
+ <label for="javascript">Javascript</label>
3351
+ </td>
3352
+ <td class="fm_options_value">
3353
+ <textarea style="margin: 0px;" cols="60" rows="30" name="javascript" id="javascript"><?php echo $row->javascript; ?></textarea>
3354
+ </td>
3355
+ </tr>
3356
+ </table>
3357
+ </fieldset>
3358
+ <fieldset id="conditions_fieldset" class="adminform fm_fieldset_deactive">
3359
+ <legend style="color:#0B55C4;font-weight: bold;">Conditional Fields</legend>
3360
+ <?php
3361
+ $ids = array();
3362
+ $types = array();
3363
+ $labels = array();
3364
+ $paramss = array();
3365
+ $all_ids = array();
3366
+ $all_labels = array();
3367
+
3368
+ $select_and_input = array("type_text", "type_password", "type_textarea", "type_name", "type_number", "type_phone", "type_submitter_mail", "type_address", "type_checkbox", "type_radio", "type_own_select", "type_paypal_price", "type_paypal_select", "type_paypal_checkbox", "type_paypal_radio", "type_paypal_shipping");
3369
+ $select_type_fields = array("type_address", "type_checkbox", "type_radio", "type_own_select", "type_paypal_select", "type_paypal_checkbox", "type_paypal_radio", "type_paypal_shipping");
3370
+
3371
+ $fields=explode('*:*new_field*:*',$row->form_fields);
3372
+ $fields = array_slice($fields,0, count($fields)-1);
3373
+ foreach($fields as $field)
3374
+ {
3375
+ $temp=explode('*:*id*:*',$field);
3376
+ array_push($ids, $temp[0]);
3377
+ array_push($all_ids, $temp[0]);
3378
+ $temp=explode('*:*type*:*',$temp[1]);
3379
+ array_push($types, $temp[0]);
3380
+ $temp=explode('*:*w_field_label*:*',$temp[1]);
3381
+ array_push($labels, $temp[0]);
3382
+ array_push($all_labels, $temp[0]);
3383
+ array_push($paramss, $temp[1]);
3384
+
3385
+ }
3386
+
3387
+ foreach($types as $key=>$value)
3388
+ {
3389
+ if(!in_array($types[$key],$select_and_input))
3390
+ {
3391
+ unset($ids[$key]);
3392
+ unset($labels[$key]);
3393
+ unset($types[$key]);
3394
+ unset($paramss[$key]);
3395
+ }
3396
+ }
3397
+
3398
+ $ids = array_values($ids);
3399
+ $labels = array_values($labels);
3400
+ $types = array_values($types);
3401
+ $paramss = array_values($paramss);
3402
+
3403
+
3404
+ $chose_ids = implode('@@**@@',$ids);
3405
+ $chose_labels = implode('@@**@@',$labels);
3406
+ $chose_types = implode('@@**@@',$types);
3407
+ $chose_paramss = implode('@@**@@',$paramss);
3408
+
3409
+ $all_ids_cond = implode('@@**@@',$all_ids);
3410
+ $all_labels_cond = implode('@@**@@',$all_labels);
3411
+
3412
+ $show_hide = array();
3413
+ $field_label = array();
3414
+ $all_any = array();
3415
+ $condition_params = array();
3416
+
3417
+ $count_of_conditions=0;
3418
+ if($row->condition!="")
3419
+ {
3420
+ $conditions=explode('*:*new_condition*:*',$row->condition);
3421
+ $conditions = array_slice($conditions,0, count($conditions)-1);
3422
+ $count_of_conditions = count($conditions);
3423
+
3424
+ foreach($conditions as $condition)
3425
+ {
3426
+ $temp=explode('*:*show_hide*:*',$condition);
3427
+ array_push($show_hide, $temp[0]);
3428
+ $temp=explode('*:*field_label*:*',$temp[1]);
3429
+ array_push($field_label, $temp[0]);
3430
+ $temp=explode('*:*all_any*:*',$temp[1]);
3431
+ array_push($all_any, $temp[0]);
3432
+ array_push($condition_params, $temp[1]);
3433
+ }
3434
+
3435
+ }
3436
+ else
3437
+ {
3438
+ $show_hide[0]=1;
3439
+ $all_any[0]='and';
3440
+ $condition_params[0]='';
3441
+ if($all_ids)
3442
+ $field_label[0] = $all_ids[0];
3443
+ }
3444
+ ?>
3445
+ <div>
3446
+ <span style="font-size:13px;">Add Condition<span/>
3447
+ <img src="<?php echo WD_FMC_URL . '/images/add_condition.png'; ?>" title="add" onclick="add_condition('<?php echo $chose_ids; ?>', '<?php echo addslashes($chose_labels); ?>', '<?php echo $chose_types; ?>', '<?php echo $chose_paramss; ?>', '<?php echo $all_ids_cond; ?>', '<?php echo addslashes($all_labels_cond); ?>')" style="cursor: pointer; vertical-align: middle; margin-left:15px;">
3448
+ </div>
3449
+ <?php
3450
+
3451
+ for($k=0; $k<$count_of_conditions; $k++)
3452
+ {
3453
+
3454
+ if(in_array($field_label[$k],$all_ids)) : ?>
3455
+ <div id="condition<?php echo $k; ?>" >
3456
+ <div id="conditional_fileds<?php echo $k; ?>">
3457
+ <select id="show_hide<?php echo $k; ?>" name="show_hide<?php echo $k; ?>" style="width:60px; ">
3458
+ <option value="1" <?php if($show_hide[$k]==1) echo 'selected="selected"'; ?>>show</option>
3459
+ <option value="0" <?php if($show_hide[$k]==0) echo 'selected="selected"'; ?>>hide</option>
3460
+ </select>
3461
+
3462
+ <select id="fields<?php echo $k; ?>" name="fields<?php echo $k; ?>" style="width:400px; " onChange="" >
3463
+ <?php
3464
+ foreach($all_labels as $key => $value)
3465
+ {
3466
+ if($field_label[$k]==$all_ids[$key])
3467
+ $selected = 'selected="selected"';
3468
+ else
3469
+ $selected ='';
3470
+ echo '<option value="'.$all_ids[$key].'" '.$selected.'>'.$value.'</option>';
3471
+ }
3472
+
3473
+ ?>
3474
+ </select>
3475
+ <span>if</span>
3476
+
3477
+ <select id="all_any<?php echo $k; ?>" name="all_any<?php echo $k; ?>" style="width:45px; ">
3478
+ <option value="and" <?php if($all_any[$k]=="and") echo 'selected="selected"'; ?>>all</option>
3479
+ <option value="or" <?php if($all_any[$k]=="or") echo 'selected="selected"'; ?>>any</option>
3480
+ </select>
3481
+
3482
+ <span>of the following match:</span>
3483
+ <img src="<?php echo WD_FMC_URL . '/images/add.png'; ?>" title="add" onclick="add_condition_fields(<?php echo $k; ?>,'<?php echo $chose_ids; ?>', '<?php echo addslashes($chose_labels); ?>', '<?php echo $chose_types; ?>', '<?php echo $chose_paramss; ?>')" style="cursor: pointer; vertical-align: middle;">
3484
+
3485
+ <img src="<?php echo WD_FMC_URL . '/images/page_delete.png'; ?>" onclick="delete_condition('<?php echo $k; ?>')" style="cursor: pointer; vertical-align: middle;">
3486
+ </div>
3487
+
3488
+ <?php
3489
+
3490
+ if($condition_params[$k])
3491
+ {
3492
+ $_params =explode('*:*next_condition*:*',$condition_params[$k]);
3493
+ $_params = array_slice($_params,0, count($_params)-1);
3494
+
3495
+ foreach($_params as $key=>$_param)
3496
+ {
3497
+ $key_select_or_input ='';
3498
+ $param_values = explode('***',$_param);
3499
+ $multiselect = explode('@@@',$param_values[2]);
3500
+
3501
+ ?>
3502
+ <div id="condition_div<?php echo $k; ?>_<?php echo $key; ?>">
3503
+ <select id="field_labels<?php echo $k; ?>_<?php echo $key; ?>" onchange="change_choices(this.options[this.selectedIndex].id+'_<?php echo $key; ?>','<?php echo $chose_ids; ?>', '<?php echo $chose_types; ?>', '<?php echo $chose_paramss; ?>')" style="width:350px;"/>
3504
+ <?php
3505
+ foreach($labels as $key1 => $value)
3506
+ {
3507
+ if($param_values[0]==$ids[$key1])
3508
+ {
3509
+ $selected = 'selected="selected"';
3510
+ if ($types[$key1]=="type_checkbox" || $types[$key1]=="type_paypal_checkbox")
3511
+ $multiple = 'multiple="multiple" class="multiple_select"';
3512
+ else
3513
+ $multiple ='';
3514
+
3515
+ $key_select_or_input = $key1;
3516
+ }
3517
+ else
3518
+ $selected ='';
3519
+ if($field_label[$k]!=$ids[$key1])
3520
+ echo '<option id="'.$k.'_'.$key1.'" value="'.$ids[$key1].'" '.$selected.'>'.$value.'</option>';
3521
+
3522
+ }
3523
+
3524
+ ?>
3525
+ </select>
3526
+
3527
+ <select id="is_select<?php echo $k; ?>_<?php echo $key; ?>" style="vertical-align: top;">
3528
+ <option value="==" <?php if($param_values[1]=="==") echo 'selected="selected"'; ?>>is</option>
3529
+ <option value="!=" <?php if($param_values[1]=="!=") echo 'selected="selected"'; ?>>is not</option>
3530
+ </select>
3531
+
3532
+ <?php if (in_array($types[$key_select_or_input],$select_type_fields)) : ?>
3533
+ <select id="field_value<?php echo $k; ?>_<?php echo $key; ?>" <?php echo $multiple; ?> style="vertical-align: top; width: 200px;">
3534
+ <?php
3535
+ switch($types[$key_select_or_input])
3536
+ {
3537
+ case "type_own_select":
3538
+ case "type_paypal_select":
3539
+ $w_size = explode('*:*w_size*:*',$paramss[$key_select_or_input]);
3540
+ break;
3541
+
3542
+ case "type_radio":
3543
+ case "type_checkbox":
3544
+ case "type_paypal_radio":
3545
+ case "type_paypal_checkbox":
3546
+ case "type_paypal_shipping":
3547
+ $w_size = explode('*:*w_flow*:*',$paramss[$key_select_or_input]);
3548
+ break;
3549
+ }
3550
+
3551
+ $w_choices = explode('*:*w_choices*:*',$w_size[1]);
3552
+ $w_choices_array = explode('***',$w_choices[0]);
3553
+
3554
+ $w_choices_price = explode('*:*w_choices_price*:*',$w_choices[1]);
3555
+ $w_choices_price_array = explode('***',$w_choices_price[0]);
3556
+
3557
+ for($m=0; $m<count($w_choices_array); $m++)
3558
+ {
3559
+ if($types[$key_select_or_input]=="type_paypal_checkbox")
3560
+ $w_choice = $w_choices_array[$m].'*:*value*:*'.$w_choices_price_array[$m];
3561
+ else
3562
+ $w_choice = $w_choices_array[$m];
3563
+
3564
+ if(in_array($w_choice,$multiselect))
3565
+ {
3566
+ $selected = 'selected="selected"';
3567
+ }
3568
+ else
3569
+ $selected ='';
3570
+
3571
+ echo '<option id="choise_'.$k.'_'.$m.'" value="'.$w_choice.'" '.$selected.'>'.$w_choices_array[$m].'</option>';
3572
+ }
3573
+
3574
+ if($types[$key_select_or_input]=="type_address")
3575
+ {
3576
+ $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");
3577
+ $w_options = '';
3578
+ foreach($w_countries as $w_country)
3579
+ {
3580
+ if(in_array($w_country,$multiselect))
3581
+ {
3582
+ $selected = 'selected="selected"';
3583
+ }
3584
+ else
3585
+ $selected ='';
3586
+
3587
+ echo '<option value="'.$w_country.'" '.$selected.'>'.$w_country.'</option>';
3588
+ }
3589
+ }
3590
+
3591
+ ?>
3592
+ </select>
3593
+ <?php else :
3594
+ if($types[$key_select_or_input]=="type_number" || $types[$key_select_or_input]=="type_phone")
3595
+ $onkeypress_function = "onkeypress='return check_isnum_space(event)'";
3596
+ else
3597
+ if($types[$key_select_or_input]=="type_paypal_price")
3598
+ $onkeypress_function = "onkeypress='return check_isnum_point(event)'";
3599
+ else
3600
+ $onkeypress_function = "";
3601
+ ?>
3602
+ <input id="field_value<?php echo $k; ?>_<?php echo $key; ?>" type="text" value="<?php echo $param_values[2];?>" <?php echo $onkeypress_function; ?> style="vertical-align: top; width: 200px;"><?php endif; ?>
3603
+
3604
+ <img src="<?php echo WD_FMC_URL . '/images/delete.png'; ?>" id="delete_condition<?php echo $k; ?>_<?php echo $key; ?>" onclick="delete_field_condition('<?php echo $k; ?>_<?php echo $key; ?>')" style="vertical-align: top;">
3605
+ </div>
3606
+ <?php
3607
+ }
3608
+ }
3609
+
3610
+ ?>
3611
+ </div>
3612
+ <?php endif;
3613
+ }
3614
+ ?>
3615
+ <input type="hidden" id="condition" name="condition" value="<?php echo $row->condition; ?>" />
3616
+
3617
+ </fieldset>
3618
+ <input type="hidden" name="fieldset_id" id="fieldset_id" value="<?php echo WDW_FMC_Library::get('fieldset_id', 'general'); ?>" />
3619
+
3620
+ <input type="hidden" id="task" name="task" value=""/>
3621
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
3622
+ </form>
3623
+ <script>
3624
+ jQuery(window).load(function () {
3625
+ form_maker_options_tabs(jQuery("#fieldset_id").val());
3626
+ spider_popup();
3627
+ function hide_email_labels(event) {
3628
+ var e = event.toElement || event.relatedTarget;
3629
+ if (e.parentNode == this || e == this) {
3630
+ return;
3631
+ }
3632
+ this.style.display="none";
3633
+ }
3634
+ if(document.getElementById('mail_from_labels')) {
3635
+ document.getElementById('mail_from_labels').addEventListener('mouseout',hide_email_labels,true);
3636
+ }
3637
+ if(document.getElementById('mail_subject_labels')) {
3638
+ document.getElementById('mail_subject_labels').addEventListener('mouseout',hide_email_labels,true);
3639
+ }
3640
+ if(document.getElementById('mail_from_name_user_labels')) {
3641
+ document.getElementById('mail_from_name_user_labels').addEventListener('mouseout',hide_email_labels,true);
3642
+ }
3643
+ if(document.getElementById('mail_subject_user_labels')) {
3644
+ document.getElementById('mail_subject_user_labels').addEventListener('mouseout',hide_email_labels,true);
3645
+ }
3646
+ });
3647
+ </script>
3648
+ <?php
3649
+ }
3650
+
3651
+ public function form_layout($id) {
3652
+ $row = $this->model->get_row_data($id);
3653
+ $ids = array();
3654
+ $types = array();
3655
+ $labels = array();
3656
+ $fields = explode('*:*new_field*:*', $row->form_fields);
3657
+ $fields = array_slice($fields, 0, count($fields) - 1);
3658
+ foreach ($fields as $field) {
3659
+ $temp = explode('*:*id*:*', $field);
3660
+ array_push($ids, $temp[0]);
3661
+ $temp = explode('*:*type*:*', $temp[1]);
3662
+ array_push($types, $temp[0]);
3663
+ $temp = explode('*:*w_field_label*:*', $temp[1]);
3664
+ array_push($labels, $temp[0]);
3665
+ }
3666
+ ?>
3667
+ <script>
3668
+ var form_front = '<?php echo addslashes($row->form_front);?>';
3669
+ var custom_front = '<?php echo addslashes($row->custom_front);?>';
3670
+ if (custom_front == '') {
3671
+ custom_front = form_front;
3672
+ }
3673
+ function submitbutton() {
3674
+ if (jQuery('#autogen_layout').is(':checked')) {
3675
+ jQuery('#custom_front').val(custom_front.replace(/\s+/g, ' ').replace(/> </g, '><'));
3676
+ }
3677
+ else {
3678
+ jQuery('#custom_front').val(editor.getValue().replace(/\s+/g, ' ').replace(/> </g, '><'));
3679
+ }
3680
+ }
3681
+ function insertAtCursor_form(myId, myLabel) {
3682
+ if (jQuery('#autogen_layout').is(':checked')) {
3683
+ alert("Uncheck the Auto-Generate Layout box.");
3684
+ return;
3685
+ }
3686
+ myValue = '<div wdid="' + myId + '" class="wdform_row">%' + myId + ' - ' + myLabel + '%</div>';
3687
+ line = editor.getCursor().line;
3688
+ ch = editor.getCursor().ch;
3689
+ text = editor.getLine(line);
3690
+ text1 = text.substr(0, ch);
3691
+ text2 = text.substr(ch);
3692
+ text = text1 + myValue + text2;
3693
+ editor.setLine(line, text);
3694
+ editor.focus();
3695
+ }
3696
+ function autogen(status) {
3697
+ if (status) {
3698
+ custom_front = editor.getValue();
3699
+ editor.setValue(form_front);
3700
+ editor.setOption('readOnly', true);
3701
+ autoFormat();
3702
+ }
3703
+ else {
3704
+ editor.setValue(custom_front);
3705
+ editor.setOption('readOnly', false);
3706
+ autoFormat();
3707
+ }
3708
+ }
3709
+ function autoFormat() {
3710
+ CodeMirror.commands["selectAll"](editor);
3711
+ editor.autoFormatRange(editor.getCursor(true), editor.getCursor(false));
3712
+ editor.scrollTo(0,0);
3713
+ }
3714
+ </script>
3715
+
3716
+ <div class="fm_layout" style="width: 99%;">
3717
+ <form action="admin.php?page=manage_fmc" method="post" name="adminForm" enctype="multipart/form-data">
3718
+ <div class="buttons_div">
3719
+ <input class="button-secondary" type="submit" onclick="submitbutton(); spider_set_input_value('task', 'save_layout')" value="Save"/>
3720
+ <input class="button-secondary" type="submit" onclick="submitbutton(); spider_set_input_value('task', 'apply_layout')" value="Apply"/>
3721
+ <input class="button-secondary" type="submit" onclick="spider_set_input_value('task', 'cancel_options')" value="Cancel"/>
3722
+ </div>
3723
+ <h2 style="clear: both;">Description</h2>
3724
+ <p>To customize the layout of the form fields uncheck the Auto-Generate Layout box and edit the HTML.</p>
3725
+ <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:
3726
+ <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>
3727
+ , where <b><span class="cm-tag">&lt;div&gt;</span></b> is used to set a row.</p>
3728
+ <p>To return to the default settings you should check Auto-Generate Layout box.</p>
3729
+ <h3 style="color:red">Notice</h3>
3730
+ <p>Make sure not to publish the same field twice. This will cause malfunctioning of the form.</p>
3731
+ <hr/>
3732
+ <label for="autogen_layout" style="font-size: 20px; line-height: 45px; margin-left: 10px;">Auto Generate Layout? </label>
3733
+ <input type="checkbox" value="1" name="autogen_layout" id="autogen_layout" <?php echo (($row->autogen_layout) ? 'checked="checked"' : ''); ?> />
3734
+ <input type="hidden" name="custom_front" id="custom_front" value="" />
3735
+
3736
+ <input type="hidden" id="task" name="task" value=""/>
3737
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
3738
+ </form>
3739
+ <br/>
3740
+ <?php
3741
+ foreach($ids as $key => $id) {
3742
+ if ($types[$key] != "type_section_break") {
3743
+ ?>
3744
+ <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>
3745
+ <?php
3746
+ }
3747
+ }
3748
+ ?>
3749
+ <br /><br />
3750
+ <button class="fm_submit_layout button button-secondary button-hero" onclick="autoFormat()"><strong>Apply Source Formatting</strong> <em>(ctrl-enter)</em></button>
3751
+ <textarea id="source" name="source" style="display: none;"></textarea>
3752
+ </div>
3753
+ <script>
3754
+ var editor = CodeMirror.fromTextArea(document.getElementById("source"), {
3755
+ lineNumbers: true,
3756
+ lineWrapping: true,
3757
+ mode: "htmlmixed",
3758
+ value: form_front
3759
+ });
3760
+ if (jQuery('#autogen_layout').is(':checked')) {
3761
+ editor.setOption('readOnly', true);
3762
+ editor.setValue(form_front);
3763
+ }
3764
+ else {
3765
+ editor.setOption('readOnly', false);
3766
+ editor.setValue(custom_front);
3767
+ }
3768
+ jQuery('#autogen_layout').click(function() {
3769
+ autogen(jQuery(this).is(':checked'));
3770
+ });
3771
+ autoFormat();
3772
+ </script>
3773
+ <?php
3774
+ }
3775
+
3776
+ ////////////////////////////////////////////////////////////////////////////////////////
3777
+ // Getters & Setters //
3778
+ ////////////////////////////////////////////////////////////////////////////////////////
3779
+ ////////////////////////////////////////////////////////////////////////////////////////
3780
+ // Private Methods //
3781
+ ////////////////////////////////////////////////////////////////////////////////////////
3782
+ ////////////////////////////////////////////////////////////////////////////////////////
3783
+ // Listeners //
3784
+ ////////////////////////////////////////////////////////////////////////////////////////
3785
+ }
admin/views/FMViewShow_matrix_fmc.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_fmc.php ADDED
@@ -0,0 +1,2767 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewSubmissions_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ // Constructor & Destructor //
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct($model) {
19
+ $this->model = $model;
20
+ }
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display($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_FMC_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_FMC_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/files/fromContactForm.php">
184
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FMC_URL . '/images/wd_logo.png'; ?>" />
185
+ </a>
186
+ </div>
187
+ </div>
188
+ <form action="admin.php?page=submissions_fmc" 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_fmc', '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_fmc', '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_FMC_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_FMC_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_FMC_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_fmc', '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_fmc', '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, "@@@") !== FALSE || $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_FMC_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_fmc', 'page' => 'submissions_fmc'), 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_fmc" 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_FMC_URL; ?>" id="form_plugins_url" />
970
+ <script>
971
+ fmc_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_fmc" 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_FMC_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">
1925
+ <div class="wdform-label-section" style="float:left; width: 150px;"><span class="wdform-label">' . $label . '</span></div>
1926
+ <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>';
1927
+
1928
+ break;
1929
+ }
1930
+
1931
+
1932
+ case 'type_paypal_price': {
1933
+
1934
+ $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');
1935
+ $temp=$params;
1936
+
1937
+ foreach($params_names as $params_name ) {
1938
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1939
+ $param[$params_name] = $temp[0];
1940
+ $temp=$temp[1];
1941
+ }
1942
+
1943
+
1944
+ if($temp) {
1945
+ $temp =explode('*:*w_attr_name*:*',$temp);
1946
+ $attrs = array_slice($temp,0, count($temp)-1);
1947
+ foreach($attrs as $attr)
1948
+ $param['attributes'] = $param['attributes'].' '.$attr;
1949
+ }
1950
+
1951
+ if (strpos($element_value,'.')!== false)
1952
+ $element = explode('.',$element_value);
1953
+ else {
1954
+ $element = Array();
1955
+ $element[0] = preg_replace("/[^0-9]/","",$element_value);
1956
+ $element[1] = '';
1957
+ }
1958
+
1959
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
1960
+
1961
+ $hide_cents = ($param['w_hide_cents']=="yes" ? "none;" : "table-cell;");
1962
+
1963
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
1964
+
1965
+ $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>';
1966
+
1967
+ $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>';
1968
+
1969
+ $onload_js .='jQuery("#wdform_'.$id1.'_element_cents'.$form_id.'").blur(function() {add_0(this)});';
1970
+ $onload_js .='jQuery("#wdform_'.$id1.'_element_cents'.$form_id.'").keypress(function() {return check_isnum_interval(event,this,0,99)});';
1971
+
1972
+ break;
1973
+ }
1974
+
1975
+ case 'type_paypal_select': {
1976
+
1977
+ if($element_value=='')
1978
+ $element_value = ' :';
1979
+
1980
+ $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');
1981
+ $temp=$params;
1982
+
1983
+ foreach($params_names as $params_name ) {
1984
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1985
+ $param[$params_name] = $temp[0];
1986
+ $temp=$temp[1];
1987
+ }
1988
+
1989
+ if($temp) {
1990
+ $temp =explode('*:*w_attr_name*:*',$temp);
1991
+ $attrs = array_slice($temp,0, count($temp)-1);
1992
+ foreach($attrs as $attr)
1993
+ $param['attributes'] = $param['attributes'].' '.$attr;
1994
+ }
1995
+
1996
+ $wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_size']) : max($param['w_field_label_size'], $param['w_size']));
1997
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
1998
+
1999
+ $param['w_choices'] = explode('***',$param['w_choices']);
2000
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
2001
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
2002
+ $param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
2003
+ $param['w_property'] = explode('***',$param['w_property']);
2004
+ $param['w_property_values'] = explode('***',$param['w_property_values']);
2005
+
2006
+ if(strpos($element_value,'***br***') !== false) {
2007
+ $element_value = explode('***br***',$element_value);
2008
+ if (count($element_value)==2) {
2009
+ if (strpos($element_value[1],'***quantity***') !== false) {
2010
+ $quantity_value = explode(': ',str_replace("***quantity***","",$element_value[1]));
2011
+ $quantity_value = $quantity_value[1];
2012
+ $property_of_select = '';
2013
+ }
2014
+ else {
2015
+ $quantity_value = '' ;
2016
+ $property_of_select = explode(': ',str_replace("***property***","",$element_value[1]));
2017
+ $property_of_select = $property_of_select[1];
2018
+ }
2019
+ $element_value = explode(' :',$element_value[0]);
2020
+ $choise_value = preg_replace("/[^0-9]/","",$element_value[1]);
2021
+ }
2022
+ else {
2023
+ $quantity_value = explode(': ',str_replace("***quantity***","",$element_value[1]));
2024
+ $quantity_value = $quantity_value[1];
2025
+ $property_of_select = explode(': ',str_replace("***property***","",$element_value[2]));
2026
+ $property_of_select = $property_of_select[1];
2027
+ $element_value = explode(' :',$element_value[0]);
2028
+ $choise_value = preg_replace("/[^0-9]/","",$element_value[1]);
2029
+ }
2030
+ }
2031
+ else {
2032
+ $element_value = explode(' :',$element_value);
2033
+ $choise_value = preg_replace("/[^0-9]/","",$element_value[1]);
2034
+ $quantity_value = '';
2035
+ $property_of_select = '';
2036
+ }
2037
+
2038
+
2039
+ $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>';
2040
+
2041
+ $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'].'>';
2042
+ foreach($param['w_choices'] as $key => $choice) {
2043
+ if($param['w_choices_disabled'][$key]=="true")
2044
+ $choice_value='';
2045
+ else
2046
+ $choice_value=$param['w_choices_price'][$key];
2047
+
2048
+
2049
+ if($element_value[0] == $choice && $param['w_choices_price'][$key] == $choise_value)
2050
+ $selected = 'selected="selected"';
2051
+ else
2052
+ $selected = '';
2053
+
2054
+ $rep.='<option id="wdform_'.$id1.'_option'.$key.'" value="'.$choice_value.'" '.$selected.'>'.$choice.'</option>';
2055
+ }
2056
+ $rep.='</select><div id="wdform_'.$id1.'_div'.$form_id.'">';
2057
+ if($param['w_quantity']=="yes") {
2058
+ $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>';
2059
+ }
2060
+
2061
+ if($param['w_property'][0])
2062
+ foreach($param['w_property'] as $key => $property) {
2063
+
2064
+ $rep.='
2065
+ <div id="wdform_'.$id1.'_property_'.$key.'" class="paypal-property">
2066
+ <div style="width:100px; display:inline-block;">
2067
+ <label class="mini_label" id="wdform_'.$id1.'_property_label_'.$form_id.''.$key.'" style="margin-right: 5px;">'.$property.'</label>
2068
+ <select id="wdform_'.$id1.'_property'.$form_id.''.$key.'" name="wdform_'.$id1.'_property'.$form_id.''.$key.'" style="width: 100%; margin: 2px 0px;">';
2069
+ $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
2070
+ $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
2071
+
2072
+ foreach($param['w_property_values'][$key] as $subkey => $property_value) {
2073
+ $rep.='<option id="wdform_'.$id1.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'" '.($property_of_select==$property_value ? 'selected="selected"' : "").'>'.$property_value.'</option>';
2074
+ }
2075
+ $rep.='</select></div></div>';
2076
+ }
2077
+
2078
+ $rep.='</div></div></div>';
2079
+
2080
+ $onsubmit_js.='
2081
+ 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.'");
2082
+ ';
2083
+ $onsubmit_js.='
2084
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_quantity_label'.$form_id.'\" />").val("Quantity").appendTo("#form'.$form_id.'");
2085
+ ';
2086
+ $onsubmit_js.='
2087
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_property_label'.$form_id.'\" />").val("'.$param['w_property'][0].'").appendTo("#form'.$form_id.'");
2088
+ ';
2089
+
2090
+ break;
2091
+ }
2092
+
2093
+ case 'type_paypal_checkbox': {
2094
+
2095
+ if($element_value == '')
2096
+ $element_value =' :';
2097
+
2098
+ $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');
2099
+ $temp=$params;
2100
+
2101
+ foreach($params_names as $params_name ) {
2102
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2103
+ $param[$params_name] = $temp[0];
2104
+ $temp=$temp[1];
2105
+ }
2106
+
2107
+ if($temp) {
2108
+ $temp =explode('*:*w_attr_name*:*',$temp);
2109
+ $attrs = array_slice($temp,0, count($temp)-1);
2110
+ foreach($attrs as $attr)
2111
+ $param['attributes'] = $param['attributes'].' '.$attr;
2112
+ }
2113
+
2114
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
2115
+
2116
+ $param['w_choices'] = explode('***',$param['w_choices']);
2117
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
2118
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
2119
+ $param['w_property'] = explode('***',$param['w_property']);
2120
+ $param['w_property_values'] = explode('***',$param['w_property_values']);
2121
+
2122
+ if(strpos($element_value,'***br***') !== false) {
2123
+ $element_value = explode('***br***',$element_value);
2124
+ foreach($element_value as $key => $element) {
2125
+
2126
+ if(strpos($element,'***quantity***') !== false) {
2127
+ $quantity_value = explode(': ',str_replace("***quantity***","",$element));
2128
+ $quantity_value = $quantity_value[1];
2129
+ unset($element_value[$key]);
2130
+ }
2131
+ else
2132
+ if(strpos($element,'***property***') !== false) {
2133
+ $property_of_check = explode(': ',str_replace("***property***","",$element));
2134
+ $property_of_check = $property_of_check[1];
2135
+ unset($element_value[$key]);
2136
+ }
2137
+ else {
2138
+ for($m=0; $m<strlen($element); $m++) {
2139
+ if(!ctype_digit($element[strlen($element)-1]))
2140
+ $element_value[$key] = substr($element,0,-1);
2141
+ else
2142
+ break;
2143
+ }
2144
+ $quantity_value = '';
2145
+ $property_of_check = '';
2146
+ }
2147
+
2148
+ }
2149
+ }
2150
+ else {
2151
+ $element_value = explode(' :',$element_value);
2152
+ $choise_value = preg_replace("/[^0-9]/","",$element_value[1]);
2153
+ $quantity_value = '';
2154
+ $property_of_check = '';
2155
+ }
2156
+
2157
+
2158
+ $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>';
2159
+
2160
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].';">';
2161
+
2162
+ foreach($param['w_choices'] as $key => $choice) {
2163
+ $checked=(in_array($choice.' - '.$param['w_choices_price'][$key], $element_value)=='true' ? 'checked="checked"' : '');
2164
+
2165
+ $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>';
2166
+ }
2167
+
2168
+ $rep.='<div id="wdform_'.$id1.'_div'.$form_id.'">';
2169
+ if($param['w_quantity']=="yes")
2170
+ $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>';
2171
+
2172
+ if($param['w_property'][0])
2173
+ foreach($param['w_property'] as $key => $property) {
2174
+ $rep.='
2175
+ <div class="paypal-property">
2176
+ <div style="width:100px; display:inline-block;">
2177
+ <label class="mini_label" id="wdform_'.$id1.'_property_label_'.$form_id.''.$key.'" style="margin-right: 5px;">'.$property.'</label>
2178
+ <select id="wdform_'.$id1.'_property'.$form_id.''.$key.'" name="wdform_'.$id1.'_property'.$form_id.''.$key.'" style="width: 100%; margin: 2px 0px;">';
2179
+ $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
2180
+ $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
2181
+ foreach($param['w_property_values'][$key] as $subkey => $property_value) {
2182
+ $rep.='<option id="wdform_'.$id1.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'" '.($property_of_check==$property_value ? 'selected="selected"' : "").'>'.$property_value.'</option>';
2183
+ }
2184
+ $rep.='</select></div></div>';
2185
+ }
2186
+
2187
+ $rep.='</div></div></div>';
2188
+
2189
+ /*$onsubmit_js.='
2190
+ 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.'");
2191
+ ';*/
2192
+
2193
+ $onsubmit_js.='
2194
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_quantity_label'.$form_id.'\" />").val("Quantity").appendTo("#form'.$form_id.'");
2195
+ ';
2196
+ $onsubmit_js.='
2197
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_property_label'.$form_id.'\" />").val("'.$param['w_property'][0].'").appendTo("#form'.$form_id.'");
2198
+ ';
2199
+
2200
+ break;
2201
+ }
2202
+
2203
+ case 'type_paypal_radio': {
2204
+ if($element_value=='')
2205
+ $element_value = ' :';
2206
+
2207
+ $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');
2208
+ $temp=$params;
2209
+
2210
+ foreach($params_names as $params_name ) {
2211
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2212
+ $param[$params_name] = $temp[0];
2213
+ $temp=$temp[1];
2214
+ }
2215
+
2216
+ if($temp) {
2217
+ $temp =explode('*:*w_attr_name*:*',$temp);
2218
+ $attrs = array_slice($temp,0, count($temp)-1);
2219
+ foreach($attrs as $attr)
2220
+ $param['attributes'] = $param['attributes'].' '.$attr;
2221
+ }
2222
+
2223
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
2224
+
2225
+
2226
+ $param['w_choices'] = explode('***',$param['w_choices']);
2227
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
2228
+ $param['w_property'] = explode('***',$param['w_property']);
2229
+ $param['w_property_values'] = explode('***',$param['w_property_values']);
2230
+
2231
+
2232
+ $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>';
2233
+
2234
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].';">';
2235
+
2236
+ if(strpos($element_value,'***br***') !== false) {
2237
+ $element_value = explode('***br***',$element_value);
2238
+ if (count($element_value)==2) {
2239
+ if (strpos($element_value[1], '***quantity***') !== false) {
2240
+ $quantity_value = explode(': ',str_replace("***quantity***","",$element_value[1]));
2241
+ $quantity_value = $quantity_value[1];
2242
+ $property_of_radio = '';
2243
+ }
2244
+ else {
2245
+ $quantity_value = '' ;
2246
+ $property_of_radio = explode(': ',str_replace("***property***","",$element_value[1]));
2247
+ $property_of_radio = $property_of_radio[1];
2248
+ }
2249
+
2250
+ $element_value = explode(' :',$element_value[0]);
2251
+ $choise_value = preg_replace("/[^0-9]/","",$element_value[1]);
2252
+ }
2253
+ else {
2254
+ $quantity_value = explode(': ',str_replace("***quantity***","",$element_value[1]));
2255
+ $quantity_value = $quantity_value[1];
2256
+ $property_of_radio = explode(': ',str_replace("***property***","",$element_value[2]));
2257
+ $property_of_radio = $property_of_radio[1];
2258
+
2259
+ $element_value = explode(' :',$element_value[0]);
2260
+ $choise_value = preg_replace("/[^0-9]/","",$element_value[1]);
2261
+ }
2262
+ }
2263
+ else {
2264
+ $element_value = explode(' :',$element_value);
2265
+ $choise_value = preg_replace("/[^0-9]/","",$element_value[1]);
2266
+ $quantity_value = '';
2267
+ $property_of_radio = '';
2268
+ }
2269
+
2270
+ foreach($param['w_choices'] as $key => $choice) {
2271
+
2272
+ if($element_value[0] == $choice && $param['w_choices_price'][$key] == $choise_value)
2273
+ $checked = 'checked="checked"';
2274
+ else
2275
+ $checked = '';
2276
+
2277
+ $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>';
2278
+
2279
+ }
2280
+
2281
+ $rep.='<div id="wdform_'.$id1.'_div'.$form_id.'">';
2282
+ if($param['w_quantity']=="yes")
2283
+ $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>';
2284
+
2285
+ if($param['w_property'][0])
2286
+ foreach($param['w_property'] as $key => $property) {
2287
+ $rep.='
2288
+ <div class="paypal-property">
2289
+ <div style="width:100px; display:inline-block;">
2290
+ <label class="mini_label" id="wdform_'.$id1.'_property_label_'.$form_id.''.$key.'" style="margin-right: 5px;">'.$property.'</label>
2291
+ <select id="wdform_'.$id1.'_property'.$form_id.''.$key.'" name="wdform_'.$id1.'_property'.$form_id.''.$key.'" style="width: 100%; margin: 2px 0px;">';
2292
+ $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
2293
+ $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
2294
+ foreach($param['w_property_values'][$key] as $subkey => $property_value) {
2295
+ $rep.='<option id="wdform_'.$id1.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'" '.($property_of_radio==$property_value ? 'selected="selected"' : "").'>'.$property_value.'</option>';
2296
+ }
2297
+ $rep.='</select></div></div>';
2298
+ }
2299
+
2300
+ $rep.='</div></div></div>';
2301
+
2302
+ $onsubmit_js.='
2303
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_label'.$form_id.'\" />").val(
2304
+ jQuery("label[for=\'"+jQuery("input[name^=\'wdform_'.$id1.'_element'.$form_id.'\']:checked").prop("id")+"\']").eq(0).text()
2305
+ ).appendTo("#form'.$form_id.'");
2306
+
2307
+ ';
2308
+
2309
+ $onsubmit_js.='
2310
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_quantity_label'.$form_id.'\" />").val("Quantity").appendTo("#form'.$form_id.'");
2311
+ ';
2312
+ $onsubmit_js.='
2313
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_property_label'.$form_id.'\" />").val("'.$param['w_property'][0].'").appendTo("#form'.$form_id.'");
2314
+ ';
2315
+
2316
+ break;
2317
+ }
2318
+
2319
+
2320
+ case 'type_paypal_shipping': {
2321
+ if($element_value=='')
2322
+ $element_value =' - ';
2323
+
2324
+ $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');
2325
+ $temp=$params;
2326
+
2327
+ foreach($params_names as $params_name ) {
2328
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2329
+ $param[$params_name] = $temp[0];
2330
+ $temp=$temp[1];
2331
+ }
2332
+
2333
+ if($temp)
2334
+ {
2335
+ $temp =explode('*:*w_attr_name*:*',$temp);
2336
+ $attrs = array_slice($temp,0, count($temp)-1);
2337
+ foreach($attrs as $attr)
2338
+ $param['attributes'] = $param['attributes'].' '.$attr;
2339
+ }
2340
+
2341
+
2342
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
2343
+
2344
+ $param['w_choices'] = explode('***',$param['w_choices']);
2345
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
2346
+
2347
+ $element_value = explode(' - ',$element_value);
2348
+ $element_value[1] = preg_replace("/[^0-9]/","",$element_value[1]);
2349
+
2350
+ $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>';
2351
+
2352
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].';">';
2353
+
2354
+ foreach($param['w_choices'] as $key => $choice) {
2355
+
2356
+ $checked =(($choice==$element_value[0] && $param['w_choices_price'][$key]== $element_value[1]) ? 'checked="checked"' : '');
2357
+
2358
+ $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>';
2359
+
2360
+ }
2361
+
2362
+ $rep.='</div></div>';
2363
+
2364
+ $onsubmit_js.='
2365
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_label'.$form_id.'\" />").val(
2366
+ jQuery("label[for=\'"+jQuery("input[name^=\'wdform_'.$id1.'_element'.$form_id.'\']:checked").prop("id")+"\']").eq(0).text()
2367
+ ).appendTo("#form'.$form_id.'");
2368
+
2369
+ ';
2370
+
2371
+ break;
2372
+ }
2373
+
2374
+ case 'type_star_rating': {
2375
+ if($element_value=='')
2376
+ $element_value = '/';
2377
+
2378
+ $params_names = array('w_field_label_size','w_field_label_pos','w_field_label_col','w_star_amount','w_required','w_class');
2379
+ $temp = $params;
2380
+ foreach($params_names as $params_name ) {
2381
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2382
+ $param[$params_name] = $temp[0];
2383
+ $temp=$temp[1];
2384
+ }
2385
+
2386
+ if($temp) {
2387
+ $temp =explode('*:*w_attr_name*:*',$temp);
2388
+ $attrs = array_slice($temp,0, count($temp)-1);
2389
+ foreach($attrs as $attr)
2390
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
2391
+ }
2392
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
2393
+
2394
+ $element_value = explode('/', $element_value);
2395
+
2396
+ $images = '';
2397
+ for($i=0; $i<$element_value[1]; $i++) {
2398
+ $images .= '<img id="wdform_'.$id1.'_star_'.$i.'_'.$form_id.'" src="' . WD_FMC_URL . '/images/star.png" >';
2399
+
2400
+ $onload_js .='jQuery("#wdform_'.$id1.'_star_'.$i.'_'.$form_id.'").mouseover(function() {change_src('.$i.',"wdform_'.$id1.'", "'.$form_id.'", "'.$param['w_field_label_col'].'");});';
2401
+ $onload_js .='jQuery("#wdform_'.$id1.'_star_'.$i.'_'.$form_id.'").mouseout(function() {reset_src('.$i.',"wdform_'.$id1.'", "'.$form_id.'");});';
2402
+ $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].'");});';
2403
+ $onload_js .='select_star_rating('.($element_value[0]-1).',"wdform_'.$id1.'", "'.$form_id.'","'.$param['w_field_label_col'].'", "'.$element_value[1].'");';
2404
+ }
2405
+
2406
+ $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>';
2407
+
2408
+ $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>';
2409
+
2410
+
2411
+ $onsubmit_js.='
2412
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_star_amount'.$form_id.'\" value = \"'.$param['w_star_amount'].'\" />").appendTo("#form'.$form_id.'");
2413
+ ';
2414
+
2415
+ break;
2416
+ }
2417
+ case 'type_scale_rating': {
2418
+
2419
+ if($element_value=='')
2420
+ $element_value = '/';
2421
+
2422
+ $params_names=array('w_field_label_size','w_field_label_pos','w_mini_labels','w_scale_amount','w_required','w_class');
2423
+ $temp=$params;
2424
+ foreach($params_names as $params_name ) {
2425
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2426
+ $param[$params_name] = $temp[0];
2427
+ $temp=$temp[1];
2428
+ }
2429
+
2430
+ if($temp) {
2431
+ $temp =explode('*:*w_attr_name*:*',$temp);
2432
+ $attrs = array_slice($temp,0, count($temp)-1);
2433
+ foreach($attrs as $attr)
2434
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
2435
+ }
2436
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
2437
+
2438
+ $element_value = explode('/',$element_value);
2439
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
2440
+
2441
+ $numbers = '';
2442
+ $radio_buttons = '';
2443
+ $to_check=0;
2444
+ $to_check=$element_value[0];
2445
+
2446
+ for($i=1; $i<=$element_value[1]; $i++) {
2447
+ $numbers.= '<div style="text-align: center; display: table-cell;"><span>'.$i.'</span></div>';
2448
+ $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>';
2449
+ }
2450
+
2451
+ $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>';
2452
+
2453
+ $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>';
2454
+
2455
+ $onsubmit_js.='
2456
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_scale_amount'.$form_id.'\" value = \"'.$param['w_scale_amount'].'\" />").appendTo("#form'.$form_id.'");
2457
+ ';
2458
+
2459
+ break;
2460
+ }
2461
+
2462
+ case 'type_spinner': {
2463
+
2464
+ $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');
2465
+ $temp=$params;
2466
+ foreach($params_names as $params_name ) {
2467
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2468
+ $param[$params_name] = $temp[0];
2469
+ $temp=$temp[1];
2470
+ }
2471
+
2472
+ if($temp) {
2473
+ $temp =explode('*:*w_attr_name*:*',$temp);
2474
+ $attrs = array_slice($temp,0, count($temp)-1);
2475
+ foreach($attrs as $attr)
2476
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
2477
+ }
2478
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
2479
+
2480
+
2481
+ $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>';
2482
+
2483
+ $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>';
2484
+
2485
+ $onload_js .='
2486
+ jQuery("#wdform_'.$id1.'_element'.$form_id.'")[0].spin = null;
2487
+ spinner = jQuery("#wdform_'.$id1.'_element'.$form_id.'").spinner();
2488
+ spinner.spinner( "value", "'.($element_value!= 'null' ? $element_value : '').'");
2489
+ jQuery("#wdform_'.$id1.'_element'.$form_id.'").spinner({ min: "'.$param['w_field_min_value'].'"});
2490
+ jQuery("#wdform_'.$id1.'_element'.$form_id.'").spinner({ max: "'.$param['w_field_max_value'].'"});
2491
+ jQuery("#wdform_'.$id1.'_element'.$form_id.'").spinner({ step: "'.$param['w_field_step'].'"});
2492
+ ';
2493
+
2494
+ break;
2495
+ }
2496
+
2497
+ case 'type_slider': {
2498
+
2499
+ $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');
2500
+ $temp=$params;
2501
+ foreach($params_names as $params_name ) {
2502
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2503
+ $param[$params_name] = $temp[0];
2504
+ $temp=$temp[1];
2505
+ }
2506
+
2507
+ if($temp) {
2508
+ $temp =explode('*:*w_attr_name*:*',$temp);
2509
+ $attrs = array_slice($temp,0, count($temp)-1);
2510
+ foreach($attrs as $attr)
2511
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
2512
+ }
2513
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
2514
+
2515
+
2516
+ $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>';
2517
+
2518
+
2519
+ $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>';
2520
+
2521
+
2522
+ $onload_js .='
2523
+ jQuery("#wdform_'.$id1.'_element'.$form_id.'")[0].slide = null;
2524
+ jQuery("#wdform_'.$id1.'_element'.$form_id.'").slider({
2525
+ range: "min",
2526
+ value: eval('.$element_value.'),
2527
+ min: eval('.$param['w_field_min_value'].'),
2528
+ max: eval('.$param['w_field_max_value'].'),
2529
+ slide: function( event, ui ) {
2530
+
2531
+ jQuery("#wdform_'.$id1.'_element_value'.$form_id.'").html("" + ui.value)
2532
+ jQuery("#wdform_'.$id1.'_slider_value'.$form_id.'").val("" + ui.value)
2533
+
2534
+ }
2535
+ });
2536
+ ';
2537
+
2538
+ break;
2539
+ }
2540
+
2541
+
2542
+ case 'type_range': {
2543
+
2544
+ if($element_value=='')
2545
+ $element_value = '-';
2546
+
2547
+ $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');
2548
+ $temp=$params;
2549
+ foreach($params_names as $params_name ) {
2550
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2551
+ $param[$params_name] = $temp[0];
2552
+ $temp=$temp[1];
2553
+ }
2554
+
2555
+ if($temp) {
2556
+ $temp =explode('*:*w_attr_name*:*',$temp);
2557
+ $attrs = array_slice($temp,0, count($temp)-1);
2558
+ foreach($attrs as $attr)
2559
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
2560
+ }
2561
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
2562
+
2563
+ $element_value = explode('-',$element_value);
2564
+
2565
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
2566
+
2567
+ $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>';
2568
+
2569
+ $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>';
2570
+
2571
+ $onload_js .='
2572
+ jQuery("#wdform_'.$id1.'_element'.$form_id.'0")[0].spin = null;
2573
+ jQuery("#wdform_'.$id1.'_element'.$form_id.'1")[0].spin = null;
2574
+
2575
+ spinner0 = jQuery("#wdform_'.$id1.'_element'.$form_id.'0").spinner();
2576
+ spinner0.spinner( "value", "'.($element_value[0]!= 'null' ? $element_value[0] : '').'");
2577
+ jQuery("#wdform_'.$id1.'_element'.$form_id.'").spinner({ step: '.$param['w_field_range_step'].'});
2578
+
2579
+ spinner1 = jQuery("#wdform_'.$id1.'_element'.$form_id.'1").spinner();
2580
+ spinner1.spinner( "value", "'.($element_value[1]!= 'null' ? $element_value[1] : '').'");
2581
+ jQuery("#wdform_'.$id1.'_element'.$form_id.'").spinner({ step: '.$param['w_field_range_step'].'});
2582
+ ';
2583
+
2584
+ break;
2585
+ }
2586
+
2587
+ case 'type_grading': {
2588
+ $params_names=array('w_field_label_size','w_field_label_pos', 'w_items', 'w_total', 'w_required','w_class');
2589
+ $temp=$params;
2590
+ foreach($params_names as $params_name ) {
2591
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2592
+ $param[$params_name] = $temp[0];
2593
+ $temp=$temp[1];
2594
+ }
2595
+
2596
+ if($temp) {
2597
+ $temp =explode('*:*w_attr_name*:*',$temp);
2598
+ $attrs = array_slice($temp,0, count($temp)-1);
2599
+ foreach($attrs as $attr)
2600
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
2601
+ }
2602
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
2603
+
2604
+
2605
+ $element_value = explode(':', $element_value);
2606
+
2607
+ $w_items = explode('***',$param['w_items']);
2608
+
2609
+ $w_items_labels =implode(':',$w_items);
2610
+
2611
+ $grading_items ='';
2612
+
2613
+
2614
+ for($i=0; $i<(count($element_value))/2-1; $i++) {
2615
+ $value=$element_value[$i];
2616
+
2617
+ $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>';
2618
+
2619
+ }
2620
+
2621
+ $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>';
2622
+
2623
+ $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>';
2624
+
2625
+ $onload_js.='
2626
+ jQuery("#wdform_'.$id1.'_element'.$form_id.' input").change(function() {sum_grading_values("wdform_'.$id1.'","'.$form_id.'");});';
2627
+
2628
+ $onload_js.='
2629
+ jQuery("#wdform_'.$id1.'_element'.$form_id.' input").keyup(function() {sum_grading_values("wdform_'.$id1.'","'.$form_id.'");});';
2630
+
2631
+
2632
+ $onload_js.='
2633
+ sum_grading_values("wdform_'.$id1.'","'.$form_id.'");';
2634
+
2635
+ $onsubmit_js.='
2636
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_hidden_item'.$form_id.'\" value = \"'.$w_items_labels.':'.$param['w_total'].'\" />").appendTo("#form'.$form_id.'");
2637
+ ';
2638
+
2639
+ break;
2640
+ }
2641
+ case 'type_matrix': {
2642
+
2643
+ $params_names=array('w_field_label_size','w_field_label_pos', 'w_field_input_type', 'w_rows', 'w_columns', 'w_required','w_class');
2644
+ $temp=$params;
2645
+ foreach($params_names as $params_name ) {
2646
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2647
+ $param[$params_name] = $temp[0];
2648
+ $temp=$temp[1];
2649
+ }
2650
+
2651
+ if($temp) {
2652
+ $temp =explode('*:*w_attr_name*:*',$temp);
2653
+ $attrs = array_slice($temp,0, count($temp)-1);
2654
+ foreach($attrs as $attr)
2655
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
2656
+ }
2657
+
2658
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
2659
+ $w_rows = explode('***',$param['w_rows']);
2660
+ $w_columns = explode('***',$param['w_columns']);
2661
+ $element_value = str_replace("******matrix***","",$element_value);
2662
+ $element_value = explode($param['w_field_input_type'].'***', $element_value);
2663
+ $element_value = explode('***', $element_value[1]);
2664
+ $column_labels ='';
2665
+
2666
+ for($i=1; $i<count($w_columns); $i++) {
2667
+ $column_labels .= '<div><label class="wdform-ch-rad-label">'.$w_columns[$i].'</label></div>';
2668
+ }
2669
+
2670
+ $rows_columns = '';
2671
+ $for_matrix =0;
2672
+ for($i=1; $i<count($w_rows); $i++) {
2673
+
2674
+ $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>';
2675
+
2676
+
2677
+ for($k=1; $k<count($w_columns); $k++) {
2678
+ $rows_columns .= '<div class="wdform-matrix-cell">';
2679
+ if($param['w_field_input_type']=='radio') {
2680
+ if (array_key_exists($i-1,$element_value))
2681
+ $to_check=$element_value[$i-1];
2682
+ else
2683
+ $to_check= '' ;
2684
+
2685
+ $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>';
2686
+
2687
+ }
2688
+ else
2689
+ if($param['w_field_input_type']=='checkbox') {
2690
+
2691
+ if (array_key_exists($for_matrix,$element_value))
2692
+ $to_check=$element_value[$for_matrix];
2693
+ else
2694
+ $to_check= '' ;
2695
+
2696
+ $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>';
2697
+
2698
+ $for_matrix++;
2699
+ }
2700
+ else
2701
+ if($param['w_field_input_type']=='text') {
2702
+ $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] : '').'">';
2703
+
2704
+ $for_matrix++;
2705
+ }
2706
+ else
2707
+ if($param['w_field_input_type']=='select') {
2708
+ $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>';
2709
+
2710
+ $for_matrix++;
2711
+ }
2712
+ $rows_columns.='</div>';
2713
+ }
2714
+
2715
+ $rows_columns .= '</div>';
2716
+ }
2717
+
2718
+ $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>';
2719
+
2720
+ $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>';
2721
+
2722
+ $onsubmit_js.='
2723
+ 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.'");
2724
+ ';
2725
+
2726
+ break;
2727
+ }
2728
+ }
2729
+ $form = str_replace('%'.$id1.' - '.$labels[$id1s_key].'%', $rep, $form);
2730
+ }
2731
+ }
2732
+ echo $form;
2733
+ ?>
2734
+ <input type="hidden" name="option" value="com_formmaker"/>
2735
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $rows[0]->group_id; ?>" />
2736
+ <input type="hidden" name="form_id" value="<?php echo $rows[0]->form_id; ?>" />
2737
+ <input type="hidden" name="date" value="<?php echo $rows[0]->date; ?>" />
2738
+ <input type="hidden" name="ip" value="<?php echo $rows[0]->ip; ?>" />
2739
+ <input type="hidden" id="task" name="task" value="" />
2740
+ <input type="hidden" value="<?php echo WD_FMC_URL; ?>" id="form_plugins_url" />
2741
+ <script type="text/javascript">
2742
+ function pressbutton() {
2743
+ <?php echo $onsubmit_js; ?>;
2744
+ }
2745
+ 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) {
2746
+ return check_isnum(evt);
2747
+ });
2748
+ jQuery("div[type='type_grading'] input").keypress(function() {
2749
+ return check_isnum_or_minus(event);
2750
+ });
2751
+ fmc_plugin_url = '<?php echo WD_FMC_URL; ?>';
2752
+ <?php
2753
+ if ($onload_js) {
2754
+ ?>
2755
+ jQuery(window).load(function () {
2756
+ <?php echo $onload_js; ?>;
2757
+ });
2758
+ <?php
2759
+ }
2760
+ ?>
2761
+ </script>
2762
+ </form>
2763
+ <?php
2764
+ }
2765
+ }
2766
+
2767
+ ?>
admin/views/FMViewThemes_fmc.php ADDED
@@ -0,0 +1,208 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewThemes_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ // Constructor & Destructor //
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct($model) {
19
+ $this->model = $model;
20
+ }
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ $rows_data = $this->model->get_rows_data();
27
+ $page_nav = $this->model->page_nav();
28
+ $search_value = ((isset($_POST['search_value'])) ? esc_html($_POST['search_value']) : '');
29
+ $search_select_value = ((isset($_POST['search_select_value'])) ? (int)$_POST['search_select_value'] : 0);
30
+ $asc_or_desc = ((isset($_POST['asc_or_desc'])) ? esc_html($_POST['asc_or_desc']) : 'asc');
31
+ $order_by = (isset($_POST['order_by']) ? esc_html($_POST['order_by']) : 'id');
32
+ $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
33
+ $ids_string = '';
34
+ ?>
35
+ <div style="clear: both; float: left; width: 99%;">
36
+ <div style="float:left; font-size: 14px; font-weight: bold;">
37
+ This section allows you to 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/files/fromContactForm.php">
42
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FMC_URL . '/images/wd_logo.png'; ?>" />
43
+ </a>
44
+ </div>
45
+ </div>
46
+ <form class="wrap" id="themes_form" method="post" action="admin.php?page=themes_fmc" 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_FMC_Library::search('Title', $search_value, 'themes_form');
63
+ WDW_FMC_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_FMC_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/files/fromContactForm.php">
168
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FMC_URL . '/images/wd_logo.png'; ?>" />
169
+ </a>
170
+ </div>
171
+ </div>
172
+ <form class="wrap" method="post" action="admin.php?page=themes_fmc" 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_fmc.php ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewUninstall_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ global $wpdb;
27
+ $prefix = $wpdb->prefix;
28
+ ?>
29
+ <form method="post" action="admin.php?page=uninstall_fmc" style="width:95%;">
30
+ <?php wp_nonce_field('form_maker uninstall');?>
31
+ <div class="wrap">
32
+ <span class="uninstall_icon"></span>
33
+ <h2>Uninstall Contact Form Maker</h2>
34
+ <p>
35
+ Deactivating Contact 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 Contact Form Maker?
65
+ </p>
66
+ <p style="text-align: center;">
67
+ <input type="checkbox" name="Contact 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 Contact 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=contact-form-maker/contact-form-maker.php', 'deactivate-plugin_contact-form-maker/contact-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 Contact Form Maker</h2>
104
+ <p><strong><a href="<?php echo $deactivate_url; ?>">Click Here</a> To Finish the Uninstallation and Contact 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_fmc.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewWidget_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ // Constructor & Destructor //
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct($model) {
19
+ $this->model = $model;
20
+ }
21
+ ////////////////////////////////////////////////////////////////////////////////////////
22
+ // 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_FMC_DIR . '/frontend/controllers/FMControllerForm_maker_fmc.php');
40
+ $controller_class = 'FMControllerForm_maker_fmc';
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
+ }
contact-form-maker.php ADDED
@@ -0,0 +1,412 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name: Contact 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.7.10
7
+ * Author: http://web-dorado.com/
8
+ * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
9
+ */
10
+ define('WD_FMC_DIR', WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__)));
11
+ define('WD_FMC_URL', plugins_url(plugin_basename(dirname(__FILE__))));
12
+
13
+ // Plugin menu.
14
+ function form_maker_options_panel_cfm() {
15
+ if (!get_option('form_maker_pro_active', FALSE)) {
16
+ add_menu_page('Contact Form Maker', 'Contact Form', 'manage_options', 'manage_fmc', 'form_maker_cfm', WD_FMC_URL . '/images/FormMakerLogo-16.png');
17
+
18
+ $manage_page = add_submenu_page('manage_fmc', 'Manager', 'Manager', 'manage_options', 'manage_fmc', 'form_maker_cfm');
19
+ add_action('admin_print_styles-' . $manage_page, 'form_maker_manage_styles_cfm');
20
+ add_action('admin_print_scripts-' . $manage_page, 'form_maker_manage_scripts_cfm');
21
+
22
+ $submissions_page = add_submenu_page('manage_fmc', 'Submissions', 'Submissions', 'manage_options', 'submissions_fmc', 'form_maker_cfm');
23
+ add_action('admin_print_styles-' . $submissions_page, 'form_maker_cfm_submissions_styles');
24
+ add_action('admin_print_scripts-' . $submissions_page, 'form_maker_cfm_submissions_scripts');
25
+
26
+ $blocked_ips_page = add_submenu_page('manage_fmc', 'Blocked IPs', 'Blocked IPs', 'manage_options', 'blocked_ips_fmc', 'form_maker_cfm');
27
+ add_action('admin_print_styles-' . $blocked_ips_page, 'form_maker_manage_styles_cfm');
28
+ add_action('admin_print_scripts-' . $blocked_ips_page, 'form_maker_manage_scripts_cfm');
29
+
30
+ $themes_page = add_submenu_page('manage_fmc', 'Themes', 'Themes', 'manage_options', 'themes_fmc', 'form_maker_cfm');
31
+ add_action('admin_print_styles-' . $themes_page, 'form_maker_styles_cfm');
32
+ add_action('admin_print_scripts-' . $themes_page, 'form_maker_scripts_cfm');
33
+
34
+ $licensing_plugins_page = add_submenu_page('manage_fmc', 'Licensing/Donation', 'Licensing/Donation', 'manage_options', 'licensing_fmc', 'form_maker_cfm');
35
+
36
+ $featured_plugins_page = add_submenu_page('manage_fmc', 'Featured Plugins', 'Featured Plugins', 'manage_options', 'featured_plugins_fmc', 'form_maker_cfm');
37
+ add_action('admin_print_styles-' . $featured_plugins_page, 'form_maker_featured_plugins_styles_cfm');
38
+
39
+ $uninstall_page = add_submenu_page('manage_fmc', 'Uninstall', 'Uninstall', 'manage_options', 'uninstall_fmc', 'form_maker_cfm');
40
+ add_action('admin_print_styles-' . $uninstall_page, 'form_maker_styles_cfm');
41
+ add_action('admin_print_scripts-' . $uninstall_page, 'form_maker_scripts_cfm');
42
+ }
43
+ }
44
+ add_action('admin_menu', 'form_maker_options_panel_cfm');
45
+
46
+ function form_maker_cfm() {
47
+ require_once(WD_FMC_DIR . '/framework/WDW_FMC_Library.php');
48
+ $page = WDW_FMC_Library::get('page');
49
+ if (($page != '') && (($page == 'manage_fmc') || ($page == 'submissions_fmc') || ($page == 'blocked_ips_fmc') || ($page == 'themes_fmc') || ($page == 'licensing_fmc') || ($page == 'featured_plugins_fmc') || ($page == 'uninstall_fmc') || ($page == 'formcontactwindow'))) {
50
+ require_once (WD_FMC_DIR . '/admin/controllers/FMController' . ucfirst(strtolower($page)) . '.php');
51
+ $controller_class = 'FMController' . ucfirst(strtolower($page));
52
+ $controller = new $controller_class();
53
+ $controller->execute();
54
+ }
55
+ }
56
+
57
+ add_action('wp_ajax_get_stats_fmc', 'form_maker_cfm'); //Show statistics
58
+ add_action('wp_ajax_generete_csv_fmc', 'form_maker_ajax_cfm'); // Export csv.
59
+ add_action('wp_ajax_generete_xml_fmc', 'form_maker_ajax_cfm'); // Export xml.
60
+ add_action('wp_ajax_FormMakerPreview_fmc', 'form_maker_ajax_cfm');
61
+ add_action('wp_ajax_formcontactwdcaptcha', 'form_maker_ajax_cfm'); // Generete captcha image and save it code in session.
62
+ add_action('wp_ajax_nopriv_formcontactwdcaptcha', 'form_maker_ajax_cfm'); // Generete captcha image and save it code in session for all users.
63
+ // add_action('wp_ajax_paypal_info', 'form_maker_ajax_cfm'); // Paypal info in submissions page.
64
+ add_action('wp_ajax_fromeditcountryinpopup_fmc', 'form_maker_ajax_cfm'); // Open country list.
65
+ add_action('wp_ajax_product_option_fmc', 'form_maker_ajax_cfm'); // Open product options on add paypal field.
66
+ add_action('wp_ajax_frommapeditinpopup_fmc', 'form_maker_ajax_cfm'); // Open map in submissions.
67
+ add_action('wp_ajax_show_matrix_fmc', 'form_maker_ajax_cfm'); // Edit matrix in submissions.
68
+ add_action('wp_ajax_FormMakerEditCSS_fmc', 'form_maker_ajax_cfm'); // Edit css from form options.
69
+
70
+ // add_action('wp_ajax_checkpaypal', 'form_maker_ajax_cfm'); // Notify url from Paypal Sandbox.
71
+ // add_action('wp_ajax_nopriv_checkpaypal', 'form_maker_ajax_cfm'); // Notify url from Paypal Sandbox for all users.
72
+
73
+
74
+ function form_maker_ajax_cfm() {
75
+ require_once(WD_FMC_DIR . '/framework/WDW_FMC_Library.php');
76
+ $page = WDW_FMC_Library::get('action');
77
+ if ($page != 'formcontactwdcaptcha') {
78
+ if (function_exists('current_user_can')) {
79
+ if (!current_user_can('manage_options')) {
80
+ die('Access Denied');
81
+ }
82
+ }
83
+ else {
84
+ die('Access Denied');
85
+ }
86
+ }
87
+ if ($page != '') {
88
+ require_once (WD_FMC_DIR . '/admin/controllers/FMController' . ucfirst($page) . '.php');
89
+ $controller_class = 'FMController' . ucfirst($page);
90
+ $controller = new $controller_class();
91
+ $controller->execute();
92
+ }
93
+ }
94
+
95
+ // Add the Contact Form Maker button.
96
+ function form_maker_add_button_cfm($buttons) {
97
+ if (!get_option('form_maker_pro_active', FALSE)) {
98
+ array_push($buttons, "fmc_form_mce");
99
+ }
100
+ return $buttons;
101
+ }
102
+
103
+ // Register Contact Form Maker button.
104
+ function form_maker_register_cfm($plugin_array) {
105
+ if (!get_option('form_maker_pro_active', FALSE)) {
106
+ $url = WD_FMC_URL . '/js/form_maker_editor_button.js';
107
+ $plugin_array["fmc_form_mce"] = $url;
108
+ }
109
+ return $plugin_array;
110
+ }
111
+
112
+ function form_maker_admin_ajax_cfm() {
113
+ ?>
114
+ <script>
115
+ var form_maker_admin_ajax_cfm = '<?php echo add_query_arg(array('action' => 'formcontactwindow'), admin_url('admin-ajax.php')); ?>';
116
+ var fmc_plugin_url = '<?php echo WD_FMC_URL; ?>';
117
+ </script>
118
+ <?php
119
+ }
120
+ add_action('admin_head', 'form_maker_admin_ajax_cfm');
121
+
122
+ function do_output_buffer_fmc() {
123
+ ob_start();
124
+ }
125
+ add_action('init', 'do_output_buffer_fmc');
126
+
127
+ function Contact_Form_maker_fornt_end_main($content) {
128
+ global $contact_form_maker_generate_action;
129
+ if (!get_option('form_maker_pro_active', FALSE)) {
130
+ if ($contact_form_maker_generate_action) {
131
+ $pattern = '[\[wd_contact_form id="([0-9]*)"\]]';
132
+ $count_forms_in_post = preg_match_all($pattern, $content, $matches_form);
133
+ if ($count_forms_in_post) {
134
+ require_once (WD_FMC_DIR . '/frontend/controllers/FMControllerForm_maker_fmc.php');
135
+ $controller = new FMControllerForm_maker_fmc();
136
+ for ($jj = 0; $jj < $count_forms_in_post; $jj++) {
137
+ $padron = $matches_form[0][$jj];
138
+ $replacment = $controller->execute($matches_form[1][$jj]);
139
+ $content = str_replace($padron, $replacment, $content);
140
+ }
141
+ }
142
+ $pattern = '[\[contact_form id="([0-9]*)"\]]';
143
+ $count_forms_in_post = preg_match_all($pattern, $content, $matches_form);
144
+ if ($count_forms_in_post) {
145
+ require_once (WD_FMC_DIR . '/frontend/controllers/FMControllerForm_maker_fmc.php');
146
+ $controller = new FMControllerForm_maker_fmc();
147
+ for ($jj = 0; $jj < $count_forms_in_post; $jj++) {
148
+ $padron = $matches_form[0][$jj];
149
+ $replacment = $controller->execute($matches_form[1][$jj]);
150
+ $content = str_replace($padron, $replacment, $content);
151
+ }
152
+ }
153
+ }
154
+ }
155
+ return $content;
156
+ }
157
+ add_filter('the_content', 'Contact_Form_maker_fornt_end_main', 5000);
158
+
159
+ function xapel_shortcode_1_fmc($content) {
160
+ $pattern = '[\[contact_form id="([0-9]*)"\]]';
161
+ $count_forms_in_post = preg_match_all($pattern, $content, $matches_form);
162
+ if ($count_forms_in_post) {
163
+ require_once (WD_FMC_DIR . '/frontend/controllers/FMControllerForm_maker_fmc.php');
164
+ $controller = new FMControllerForm_maker_fmc();
165
+ for ($jj = 0; $jj < $count_forms_in_post; $jj++) {
166
+ $padron = $matches_form[0][$jj];
167
+ $replacment = $controller->execute($matches_form[1][$jj]);
168
+ $replacment = '[contact_form_for_repace id="' . $matches_form[1][$jj] . '"]';
169
+ $content = str_replace($padron, $replacment, $content);
170
+ }
171
+ }
172
+ $pattern = '[\[wd_contact_form id="([0-9]*)"\]]';
173
+ $count_forms_in_post = preg_match_all($pattern, $content, $matches_form);
174
+ if ($count_forms_in_post) {
175
+ require_once (WD_FMC_DIR . '/frontend/controllers/FMControllerForm_maker_fmc.php');
176
+ $controller = new FMControllerForm_maker_fmc();
177
+ for ($jj = 0; $jj < $count_forms_in_post; $jj++) {
178
+ $padron = $matches_form[0][$jj];
179
+ $replacment = $controller->execute($matches_form[1][$jj]);
180
+ $replacment = '[contact_form_for_repace id="' . $matches_form[1][$jj] . '"]';
181
+ $content = str_replace($padron, $replacment, $content);
182
+ }
183
+ }
184
+ return $content;
185
+ }
186
+ //add_filter('the_content', 'xapel_shortcode_1_fmc', 1);
187
+
188
+ // Add the Contact Form Maker button to editor.
189
+ add_action('wp_ajax_formcontactwindow', 'form_maker_ajax_cfm');
190
+ add_filter('mce_external_plugins', 'form_maker_register_cfm');
191
+ add_filter('mce_buttons', 'form_maker_add_button_cfm', 0);
192
+
193
+ for ($ii = 0; $ii < 100; $ii++) {
194
+ remove_filter('the_content', 'do_shortcode', $ii);
195
+ remove_filter('the_content', 'wpautop', $ii);
196
+ }
197
+ add_filter('the_content', 'wpautop', 10);
198
+ add_filter('the_content', 'do_shortcode', 11);
199
+
200
+
201
+ // Contact Form Maker Widget.
202
+ if (class_exists('WP_Widget')) {
203
+ require_once(WD_FMC_DIR . '/admin/controllers/FMControllerWidget_fmc.php');
204
+ add_action('widgets_init', create_function('', 'return register_widget("FMControllerWidget_fmc");'));
205
+ }
206
+
207
+ // Activate plugin.
208
+ function form_maker_activate_cfm() {
209
+ $version = get_option("wd_form_maker_version");
210
+ $new_version = '1.7.6';
211
+ if (!$version) {
212
+ add_option("wd_form_maker_version", $new_version, '', 'no');
213
+ global $wpdb;
214
+ if ($wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "formmaker'") == $wpdb->prefix . "formmaker") {
215
+ require_once WD_FMC_DIR . "/contact_form_maker_update.php";
216
+ contact_form_maker_update_until_mvc();
217
+ contact_form_maker_update('');
218
+ }
219
+ else {
220
+ require_once WD_FMC_DIR . "/contact_form_maker_insert.php";
221
+ contact_from_maker_insert();
222
+ }
223
+ }
224
+ elseif (version_compare($version, $new_version, '<')) {
225
+ require_once WD_FMC_DIR . "/contact_form_maker_update.php";
226
+ contact_form_maker_update($version);
227
+ update_option("wd_form_maker_version", $new_version);
228
+ }
229
+ require_once WD_FMC_DIR . "/contact_form_maker_insert.php";
230
+ install_demo_forms_fmc();
231
+ }
232
+ register_activation_hook(__FILE__, 'form_maker_activate_cfm');
233
+
234
+ if (!isset($_GET['action']) || $_GET['action'] != 'deactivate') {
235
+ add_action('admin_init', 'form_maker_activate_cfm');
236
+ }
237
+
238
+ // Contact Form Maker manage page styles.
239
+ function form_maker_manage_styles_cfm() {
240
+ wp_admin_css('thickbox');
241
+ wp_enqueue_style('form_maker_tables', WD_FMC_URL . '/css/form_maker_tables.css', array(), get_option("wd_form_maker_version"));
242
+ wp_enqueue_style('form_maker_first', WD_FMC_URL . '/css/form_maker_first.css', array(), get_option("wd_form_maker_version"));
243
+ wp_enqueue_style('form_maker_calendar-jos', WD_FMC_URL . '/css/calendar-jos.css');
244
+ wp_enqueue_style('jquery-ui', WD_FMC_URL . '/css/jquery-ui-1.10.3.custom.css');
245
+ wp_enqueue_style('jquery-ui-spinner', WD_FMC_URL . '/css/jquery-ui-spinner.css');
246
+ wp_enqueue_style('form_maker_style', WD_FMC_URL . '/css/style.css', array(), get_option("wd_form_maker_version"));
247
+ wp_enqueue_style('form_maker_codemirror', WD_FMC_URL . '/css/codemirror.css');
248
+ wp_enqueue_style('form_maker_layout', WD_FMC_URL . '/css/form_maker_layout.css', array(), get_option("wd_form_maker_version"));
249
+ }
250
+ // Contact Form Maker manage page scripts.
251
+ function form_maker_manage_scripts_cfm() {
252
+ wp_enqueue_script('thickbox');
253
+ global $wp_scripts;
254
+ if (isset($wp_scripts->registered['jquery'])) {
255
+ $jquery = $wp_scripts->registered['jquery'];
256
+ if (!isset($jquery->ver) OR version_compare($jquery->ver, '1.8.2', '<')) {
257
+ wp_deregister_script('jquery');
258
+ wp_register_script('jquery', FALSE, array('jquery-core', 'jquery-migrate'), '1.10.2' );
259
+ }
260
+ }
261
+ wp_enqueue_script('jquery');
262
+ wp_enqueue_script('jquery-ui-sortable');
263
+ wp_enqueue_script('jquery-ui-widget');
264
+ wp_enqueue_script('jquery-ui-slider');
265
+ wp_enqueue_script('jquery-ui-spinner');
266
+
267
+ // wp_enqueue_script('mootools', WD_FMC_URL . '/js/mootools.js', array(), '1.12');
268
+ wp_enqueue_script('gmap_form_api', 'https://maps.google.com/maps/api/js?sensor=false');
269
+ wp_enqueue_script('gmap_form', WD_FMC_URL . '/js/if_gmap_back_end.js');
270
+
271
+ wp_enqueue_script('form_maker_admin', WD_FMC_URL . '/js/form_maker_admin.js', array(), get_option("wd_form_maker_version"));
272
+ wp_enqueue_script('form_maker_manage', WD_FMC_URL . '/js/form_maker_manage.js', array(), get_option("wd_form_maker_version"));
273
+
274
+ wp_enqueue_script('form_maker_codemirror', WD_FMC_URL . '/js/layout/codemirror.js', array(), '2.3');
275
+ wp_enqueue_script('form_maker_clike', WD_FMC_URL . '/js/layout/clike.js', array(), '1.0.0');
276
+ wp_enqueue_script('form_maker_formatting', WD_FMC_URL . '/js/layout/formatting.js', array(), '1.0.0');
277
+ wp_enqueue_script('form_maker_css', WD_FMC_URL . '/js/layout/css.js', array(), '1.0.0');
278
+ wp_enqueue_script('form_maker_javascript', WD_FMC_URL . '/js/layout/javascript.js', array(), '1.0.0');
279
+ wp_enqueue_script('form_maker_xml', WD_FMC_URL . '/js/layout/xml.js', array(), '1.0.0');
280
+ wp_enqueue_script('form_maker_php', WD_FMC_URL . '/js/layout/php.js', array(), '1.0.0');
281
+ wp_enqueue_script('form_maker_htmlmixed', WD_FMC_URL . '/js/layout/htmlmixed.js', array(), '1.0.0');
282
+
283
+ wp_enqueue_script('Calendar', WD_FMC_URL . '/js/calendar/calendar.js', array(), '1.0');
284
+ wp_enqueue_script('calendar_function', WD_FMC_URL . '/js/calendar/calendar_function.js');
285
+ // wp_enqueue_script('form_maker_calendar_setup', WD_FMC_URL . '/js/calendar/calendar-setup.js');
286
+ }
287
+
288
+ // Contact Form Maker submissions page styles.
289
+ function form_maker_cfm_submissions_styles() {
290
+ wp_admin_css('thickbox');
291
+ wp_enqueue_style('form_maker_tables', WD_FMC_URL . '/css/form_maker_tables.css', array(), get_option("wd_form_maker_version"));
292
+ wp_enqueue_style('form_maker_calendar-jos', WD_FMC_URL . '/css/calendar-jos.css');
293
+ wp_enqueue_style('jquery-ui', WD_FMC_URL . '/css/jquery-ui-1.10.3.custom.css', array(), '1.10.3');
294
+ wp_enqueue_style('jquery-ui-spinner', WD_FMC_URL . '/css/jquery-ui-spinner.css', array(), '1.10.3');
295
+ wp_enqueue_style('jquery.fancybox', WD_FMC_URL . '/js/fancybox/jquery.fancybox.css', array(), '2.1.5');
296
+ wp_enqueue_style('form_maker_style', WD_FMC_URL . '/css/style.css', array(), get_option("wd_form_maker_version"));
297
+ }
298
+ // Contact Form Maker submissions page scripts.
299
+ function form_maker_cfm_submissions_scripts() {
300
+ wp_enqueue_script('thickbox');
301
+ global $wp_scripts;
302
+ if (isset($wp_scripts->registered['jquery'])) {
303
+ $jquery = $wp_scripts->registered['jquery'];
304
+ if (!isset($jquery->ver) OR version_compare($jquery->ver, '1.8.2', '<')) {
305
+ wp_deregister_script('jquery');
306
+ wp_register_script('jquery', FALSE, array('jquery-core', 'jquery-migrate'), '1.10.2' );
307
+ }
308
+ }
309
+ wp_enqueue_script('jquery');
310
+ wp_enqueue_script('jquery-ui-sortable');
311
+ wp_enqueue_script('jquery-ui-widget');
312
+ wp_enqueue_script('jquery-ui-slider');
313
+ wp_enqueue_script('jquery-ui-spinner');
314
+ wp_enqueue_script('jquery-ui-mouse');
315
+ wp_enqueue_script('jquery-ui-core');
316
+
317
+ // wp_enqueue_script('mootools', WD_FMC_URL . '/js/mootools.js', array(), '1.12');
318
+
319
+ wp_enqueue_script('form_maker_admin', WD_FMC_URL . '/js/form_maker_admin.js', array(), get_option("wd_form_maker_version"));
320
+ wp_enqueue_script('form_maker_manage', WD_FMC_URL . '/js/form_maker_manage.js', array(), get_option("wd_form_maker_version"));
321
+ wp_enqueue_script('form_maker_submissions', WD_FMC_URL . '/js/form_maker_submissions.js', array(), get_option("wd_form_maker_version"));
322
+
323
+ wp_enqueue_script('main', WD_FMC_URL . '/js/main.js', array(), get_option("wd_form_maker_version"));
324
+ wp_enqueue_script('main_div_front_end', WD_FMC_URL . '/js/main_div_front_end.js', array(), get_option("wd_form_maker_version"));
325
+
326
+ wp_enqueue_script('Calendar', WD_FMC_URL . '/js/calendar/calendar.js', array(), '1.0');
327
+ wp_enqueue_script('calendar_function', WD_FMC_URL . '/js/calendar/calendar_function.js');
328
+ // wp_enqueue_script('form_maker_calendar_setup', WD_FMC_URL . '/js/calendar/calendar-setup.js');
329
+
330
+ // Fancybox.
331
+ wp_enqueue_script('jquery.fancybox.pack', WD_FMC_URL . '/js/fancybox/jquery.fancybox.pack.js', array(), '2.1.5');
332
+ wp_localize_script('main_div_front_end', 'fm_objectL10n', array(
333
+ 'fmc_plugin_url' => WD_FMC_URL
334
+ ));
335
+ }
336
+
337
+ // Contact Form Maker Featured plugins page styles.
338
+ function form_maker_featured_plugins_styles_cfm() {
339
+ wp_enqueue_style('Featured_Plugins', WD_FMC_URL . '/css/form_maker_featured_plugins.css');
340
+ }
341
+
342
+ function form_maker_styles_cfm() {
343
+ wp_enqueue_style('form_maker_tables', WD_FMC_URL . '/css/form_maker_tables.css', array(), get_option("wd_form_maker_version"));
344
+ }
345
+ function form_maker_scripts_cfm() {
346
+ wp_enqueue_script('form_maker_admin', WD_FMC_URL . '/js/form_maker_admin.js', array(), get_option("wd_form_maker_version"));
347
+ }
348
+
349
+ $contact_form_maker_generate_action = 0;
350
+ function contact_form_maker_generate_action() {
351
+ global $contact_form_maker_generate_action;
352
+ $contact_form_maker_generate_action = 1;
353
+ }
354
+ add_filter('wp_head', 'contact_form_maker_generate_action', 10000);
355
+
356
+ function form_maker_front_end_scripts_cfm() {
357
+ // global $wp_scripts;
358
+ // if (isset($wp_scripts->registered['jquery'])) {
359
+ // $jquery = $wp_scripts->registered['jquery'];
360
+ // if (!isset($jquery->ver) OR version_compare($jquery->ver, '1.8.2', '<')) {
361
+ // wp_deregister_script('jquery');
362
+ // wp_register_script('jquery', FALSE, array('jquery-core', 'jquery-migrate'), '1.10.2' );
363
+ // }
364
+ // }
365
+ wp_enqueue_script('jquery');
366
+ wp_enqueue_script('jquery-ui-widget');
367
+ wp_enqueue_script('jquery-ui-slider');
368
+ wp_enqueue_script('jquery-ui-spinner');
369
+ wp_enqueue_script('jquery-effects-shake');
370
+
371
+ wp_enqueue_style('jquery-ui', WD_FMC_URL . '/css/jquery-ui-1.10.3.custom.css');
372
+ wp_enqueue_style('jquery-ui-spinner', WD_FMC_URL . '/css/jquery-ui-spinner.css');
373
+
374
+ // wp_enqueue_script('mootools', WD_FMC_URL . '/js/mootools.js', array(), '1.12');
375
+ wp_enqueue_script('gmap_form_api', 'https://maps.google.com/maps/api/js?sensor=false');
376
+ wp_enqueue_script('gmap_form', WD_FMC_URL . '/js/if_gmap_front_end.js');
377
+ wp_enqueue_script('jelly.min', WD_FMC_URL . '/js/jelly.min.js');
378
+ wp_enqueue_script('file-upload', WD_FMC_URL . '/js/file-upload.js');
379
+ // wp_enqueue_style('gmap_styles_', WD_FMC_URL . '/css/style_for_map.css');
380
+
381
+ wp_enqueue_script('Calendar', WD_FMC_URL . '/js/calendar/calendar.js');
382
+ wp_enqueue_script('calendar_function', WD_FMC_URL . '/js/calendar/calendar_function.js');
383
+ // wp_enqueue_script('form_maker_calendar_setup', WD_FMC_URL . '/js/calendar/calendar-setup.js');
384
+ wp_enqueue_style('form_maker_calendar-jos', WD_FMC_URL . '/css/calendar-jos.css');
385
+ wp_enqueue_style('form_maker_frontend', WD_FMC_URL . '/css/form_maker_frontend.css');
386
+
387
+ wp_register_script('main_div_front_end', WD_FMC_URL . '/js/main_div_front_end.js', array(), get_option("wd_form_maker_version"));
388
+ wp_register_script('main_front_end', WD_FMC_URL . '/js/main_front_end.js', array(), get_option("wd_form_maker_version"));
389
+ wp_localize_script('main_div_front_end', 'fm_objectL10n', array(
390
+ 'fmc_plugin_url' => WD_FMC_URL
391
+ ));
392
+ wp_localize_script('main_front_end', 'fm_objectL10n', array(
393
+ 'fmc_plugin_url' => WD_FMC_URL
394
+ ));
395
+ }
396
+ add_action('wp_enqueue_scripts', 'form_maker_front_end_scripts_cfm');
397
+
398
+ // Languages localization.
399
+ function form_maker_language_load_cfm() {
400
+ load_plugin_textdomain('form_maker_cfm', FALSE, basename(dirname(__FILE__)) . '/languages');
401
+ }
402
+ add_action('init', 'form_maker_language_load_cfm');
403
+
404
+ function form_maker_sesseion_path_cfm() {
405
+ if (session_id() == '' || (function_exists('session_status') && (session_status() == PHP_SESSION_NONE))) {
406
+ @session_start();
407
+ }
408
+ session_save_path(WD_FMC_DIR . '/session');
409
+ }
410
+ add_action('init', 'form_maker_sesseion_path_cfm');
411
+
412
+ ?>
contact_form.php DELETED
@@ -1,1505 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Contact Form FREE
4
- Plugin URI: http://web-dorado.com/products/form-maker-wordpress.html
5
- Description: WordPress Contact Form Maker is an advanced and easy-to-use tool for creating forms. The backend interface is intuitive and user friendly which allows users far from scripting and programming to create WordPress Forms.
6
- Version: 1.6.4
7
- Author: http://web-dorado.com/
8
- License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
9
- */
10
-
11
- function contact_form_sesseion_path() {
12
- @session_start();
13
- session_save_path(ABSPATH . 'wp-content/plugins/contact-form-maker/session');
14
- }
15
- add_action('init', 'contact_form_sesseion_path');
16
-
17
- //// load languages
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_contact_form.php");
211
- require_once("contact_form_maker_widget.php");
212
- require_once('recaptchalib.php');
213
- add_action('init', 'contact_form_language_load');
214
- function contact_form_language_load() {
215
- load_plugin_textdomain('form_maker', FALSE, basename(dirname(__FILE__)) . '/languages');
216
- }
217
-
218
- function spider_contact_form_output_buffer() {
219
- ob_start();
220
- }
221
- add_action('init', 'spider_contact_form_output_buffer');
222
-
223
- add_filter('the_content', 'Contact_Form_maker_fornt_end_main', 5000);
224
- function Contact_Form_maker_fornt_end_main($content) {
225
- if (!get_option('form_maker_pro_active', FALSE)) {
226
- $pattern = '[\[wd_contact_form id="([0-9]*)"\]]';
227
- $count_forms_in_post = preg_match_all($pattern, $content, $matches_form);
228
- for ($jj = 0; $jj < $count_forms_in_post; $jj++) {
229
- $padron = $matches_form[0][$jj];
230
- $replacment = contact_form_front_end($matches_form[1][$jj]);
231
- $content = str_replace($padron, $replacment, $content);
232
- }
233
- $pattern = '[\[contact_form id="([0-9]*)"\]]';
234
- $count_forms_in_post = preg_match_all($pattern, $content, $matches_form);
235
- for ($jj = 0; $jj < $count_forms_in_post; $jj++) {
236
- $padron = $matches_form[0][$jj];
237
- $replacment = contact_form_front_end($matches_form[1][$jj]);
238
- $content = str_replace($padron, $replacment, $content);
239
- }
240
- }
241
- return $content;
242
- }
243
-
244
- function contact_form_scripts_method() {
245
- if (!get_option('form_maker_pro_active', FALSE)) {
246
- wp_enqueue_style("gmap_styles_", plugins_url("css/style_for_map.css", __FILE__), FALSE);
247
- wp_enqueue_script("contact_main_g_js", plugins_url("js/main_front_end.js", __FILE__), FALSE);
248
- wp_enqueue_script("Gmap", "http://maps.google.com/maps/api/js?sensor=false", FALSE);
249
- wp_enqueue_script("if_gmap", plugins_url("js/if_gmap_front_end.js", __FILE__), FALSE);
250
- wp_enqueue_script("Calendar", plugins_url("js/calendar.js", __FILE__), FALSE);
251
- wp_enqueue_script("calendar-setup", plugins_url("js/calendar-setup.js", __FILE__), FALSE);
252
- wp_enqueue_script("calendar_function", plugins_url("js/calendar_function.js", __FILE__), FALSE);
253
- wp_enqueue_style("Css", plugins_url("js/calendar-jos.css", __FILE__), FALSE);
254
- wp_enqueue_script("jquery", plugins_url("js/jquery-1.9.1.js", __FILE__), array(), '1.9.1');
255
- }
256
- }
257
-
258
- add_action('wp_enqueue_scripts', 'contact_form_scripts_method');
259
- ///////////////////////////// FORNT END Print message
260
- for ($ii = 0; $ii < 100; $ii++) {
261
- remove_filter('the_content', 'do_shortcode', $ii);
262
- remove_filter('the_content', 'wpautop', $ii);
263
- }
264
- add_filter('the_content', 'wpautop', 10);
265
- add_filter('the_content', 'do_shortcode', 11);
266
-
267
- $check_seo = 0;
268
- function print_massage_contact_form($content) {
269
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
270
- if (is_plugin_active('wordpress-seo/wp-seo.php') && $_SESSION['form_submit_type']) {
271
- global $check_seo;
272
- if ($check_seo++ != 1) {
273
- // return;
274
- }
275
- }
276
- if (!get_option('form_maker_pro_active', FALSE)) {
277
- $mh_after_head = did_action('wp_enqueue_scripts');
278
- if ($mh_after_head == 1) {
279
- global $wpdb;
280
- @session_start();
281
- if (isset($_SESSION['form_submit_type']) && $_SESSION['form_submit_type']) {
282
- $type_and_id = $_SESSION['form_submit_type'];
283
- $type_and_id = explode(',', $type_and_id);
284
- $form_get_type = $type_and_id[0];
285
- $form_get_id = $type_and_id[1];
286
- $_SESSION['form_submit_type'] = 0;
287
- if ($form_get_type == 3) {
288
- $_SESSION['massage_after_submit'] = "";
289
- $row = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_get_id . "'");
290
- return wpautop($row->submit_text);
291
- }
292
- }
293
- if (isset($_SESSION['massage_after_submit'])) {
294
- if ($_SESSION['massage_after_submit'] != "") {
295
- $message = $_SESSION['massage_after_submit'];
296
- $_SESSION['massage_after_submit'] = "";
297
- $returned_content = " <style>
298
- .updated,.error{
299
- border-width:1px !important;
300
- border-style:solid !important;
301
- padding:0 .6em !important;
302
- margin:5px 15px 2px !important;
303
- -moz-border-radius:3px !important;
304
- -khtml-border-radius:3px !important;
305
- -webkit-border-radius:3px !important;
306
- border-radius:3px !important;
307
- }
308
- .updated p, .error p
309
- {
310
- font-size: 12px !important;
311
- margin:.5em 0 !important;
312
- line-height:1 !important;
313
- padding:2px !important;
314
- }
315
- .updated, .error
316
- {
317
- margin:5px 0 15px !important;
318
- }
319
- .updated{
320
- background-color:#ffffe0 !important;
321
- border-color:#e6db55 !important;
322
- }
323
- .error
324
- {
325
- background-color:#ffebe8 !important;
326
- border-color:#c00 !important;
327
- }
328
- error a
329
- {
330
- color:#c00 !important;
331
- }
332
- .error
333
- {
334
- line-height:22px !important;
335
- margin:0 15px !important;
336
- padding:3px 5px !important;
337
- }
338
- .error-div
339
- {
340
- display:block !important;
341
- line-height:36px !important;
342
- float:right !important;
343
- margin-right:20px !important;
344
- }
345
- </style>";
346
- if ($_SESSION['error_or_no']) {
347
- $error = 'error';
348
- }
349
- else {
350
- $error = 'updated';
351
- }
352
- $returned_content .= "<div class=\"" . $error . "\" ><p><strong>" . $message . "</strong></p></div>" . $content; // modified content
353
- return $returned_content;
354
- }
355
- else {
356
- return $content;
357
- }
358
- }
359
- else {
360
- return $content;
361
- }
362
- }
363
- else {
364
- return $content;
365
- }
366
- }
367
- else
368
- return $content;
369
- }
370
-
371
- add_filter('the_content', 'print_massage_contact_form');
372
- ///////////////////////////// FORNT END FUNCTION
373
- //// add front end
374
- //// add editor new mce button
375
- add_filter('mce_external_plugins', "contact_form_register");
376
- add_filter('mce_buttons', 'contact_form_add_button', 0);
377
- /// function for add new button
378
- function contact_form_add_button($buttons) {
379
- if (!get_option('form_maker_pro_active', FALSE)) {
380
- array_push($buttons, "contact_form_mce");
381
- }
382
- return $buttons;
383
- }
384
-
385
- /// function for registr new button
386
- function contact_form_register($plugin_array) {
387
- if (!get_option('form_maker_pro_active', FALSE)) {
388
- $url = plugins_url('js/editor_plugin.js', __FILE__);
389
- $plugin_array["contact_form_mce"] = $url;
390
- }
391
- return $plugin_array;
392
- }
393
-
394
- ///////////////////////////////////////// add ajax for form maker functionaliti
395
- require_once("contact_form_ajax_functions.php"); //////////// include form ajax functions for next 2 ajax hooks
396
- add_action('wp_ajax_formcontactwdcaptcha', 'form_contact_wd_captcha'); /// generete captcha image and save it code in session
397
- add_action('wp_ajax_formcontactwindow', 'form_contact_window_php'); /// openid window in post or page for editor
398
- add_action('wp_ajax_form_preview_product_option', 'contact_form_preview_product_option');
399
- add_action('wp_ajax_nopriv_formcontactwdcaptcha', 'form_contact_wd_captcha'); /// generete captcha image and save it code in session
400
- add_action('wp_ajax_nopriv_formcontactwindow', 'form_contact_window_php'); /// openid window in post or page for editor
401
- ////////////////////////////////////////////////////////////////////////////
402
- function add_button_style_contact_form() {
403
- echo '<script>var plugin_url = "' . plugins_url('', __FILE__) . '";</script>';
404
- }
405
-
406
- add_action('admin_head', 'add_button_style_contact_form');
407
- add_action('admin_menu', 'contact_form_options_panel');
408
- function contact_form_options_panel() {
409
- if (!get_option('form_maker_pro_active', FALSE)) {
410
- $icon_url = plugins_url('images/FormMakerLogo-16.png', __FILE__);
411
- add_menu_page('Theme page title', 'Contact Form', 'manage_options', 'contact_form', 'Manage_contact_form', $icon_url);
412
- $page_form = add_submenu_page('contact_form', 'Contact Form Manager', 'Manager', 'manage_options', 'contact_form', 'Manage_contact_form');
413
- $page_submits = add_submenu_page('contact_form', 'Contact Form Submissions', 'Submissions', 'manage_options', 'contact_form_Submits', 'contact_form_Submits');
414
- add_submenu_page('contact_form', 'Contact Form Themes', 'Themes', 'manage_options', 'contact_form_Themes', 'contact_form_Themes');
415
- add_submenu_page('contact_form', 'Licensing/Donation', 'Licensing/Donation', 'manage_options', 'contact_form_Licensing', 'contact_form_Licensing');
416
- $Featured_Plugins = add_submenu_page('contact_form', 'Featured Plugins', 'Featured Plugins', 'manage_options', 'contact_form_Featured_Plugins', 'contact_form_Featured_Plugins');
417
- add_submenu_page('contact_form', 'Uninstall Contact Form ', 'Uninstall Contact Form', 'manage_options', 'Uninstall_contact_form', 'Uninstall_contact_form');
418
- add_action('admin_print_styles-' . $Featured_Plugins, 'contact_form_Featured_Plugins_styles');
419
- add_action('admin_print_styles-' . $page_form, 'contact_form_admin_styles_scripts');
420
- add_action('admin_print_styles-' . $page_submits, 'contact_form_submits_styles_scripts');
421
- }
422
- }
423
-
424
- function contact_form_Featured_Plugins_styles() {
425
- wp_enqueue_style("Featured_Plugins", plugins_url("css/featured_plugins.css", __FILE__));
426
- }
427
- function contact_form_Featured_Plugins() {
428
- ?>
429
- <div id="main_featured_plugins_page">
430
- <table align="center" width="90%" style="margin-top: 0px;border-bottom: rgb(111, 111, 111) solid 2px;">
431
- <tr>
432
- <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>
433
- <td align="right" style="font-size:16px;">
434
- <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="text-decoration:none;">
435
- <img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="www.web-dorado.com" width="215">
436
- </a>
437
- </td>
438
- </tr>
439
- </table>
440
- <form method="post">
441
- <ul id="featured-plugins-list">
442
- <li class="form-maker">
443
- <div class="product">
444
- <div class="title">
445
- <strong class="heading">Form Maker</strong>
446
- <p>Wordpress form builder plugin</p>
447
- </div>
448
- </div>
449
- <div class="description">
450
- <p>Form Maker is a modern and advanced tool for creating WordPress forms easily and fast.</p>
451
- <a target="_blank" href="http://web-dorado.com/products/wordpress-form.html" class="download">Download</a>
452
- </div>
453
- </li>
454
- <li class="photo-gallery">
455
- <div class="product">
456
- <div class="title">
457
- <strong class="heading">Photo Gallery</strong>
458
- <p>WordPress Photo Gallery plugin</p>
459
- </div>
460
- </div>
461
- <div class="description">
462
- <p>Photo Gallery is a fully responsive WordPress Gallery plugin with advanced functionality.
463
- It allows having different image galleries for your posts and pages, as well as different widgets.</p>
464
- <a target="_blank" href="http://web-dorado.com/products/wordpress-photo-gallery-plugin.html" class="download">Download</a>
465
- </div>
466
- </li>
467
- <li class="spider-calendar">
468
- <div class="product">
469
- <div class="title">
470
- <strong class="heading">Spider Calendar</strong>
471
- <p>WordPress event calendar plugin</p>
472
- </div>
473
- </div>
474
- <div class="description">
475
- <p>Spider Event Calendar is a highly configurable product which allows you to have multiple organized events.</p>
476
- <a target="_blank" href="http://web-dorado.com/products/wordpress-calendar.html" class="download">Download</a>
477
- </div>
478
- </li>
479
- <li class="catalog">
480
- <div class="product">
481
- <div class="title">
482
- <strong class="heading">Spider Catalog</strong>
483
- <p>WordPress product catalog plugin</p>
484
- </div>
485
- </div>
486
- <div class="description">
487
- <p>Spider Catalog for WordPress is a convenient tool for organizing the products represented on your website into catalogs.</p>
488
- <a target="_blank" href="http://web-dorado.com/products/wordpress-catalog.html" class="download">Download</a>
489
- </div>
490
- </li>
491
- <li class="player">
492
- <div class="product">
493
- <div class="title">
494
- <strong class="heading">Video Player</strong>
495
- <p>WordPress Video player plugin</p>
496
- </div>
497
- </div>
498
- <div class="description">
499
- <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>
500
- <a target="_blank" href="http://web-dorado.com/products/wordpress-player.html" class="download">Download</a>
501
- </div>
502
- </li>
503
- <li class="contacts">
504
- <div class="product">
505
- <div class="title">
506
- <strong class="heading">Spider Contacts</strong>
507
- <p>Wordpress staff list plugin</p>
508
- </div>
509
- </div>
510
- <div class="description">
511
- <p>Spider Contacts helps you to display information about the group of people more intelligible, effective and convenient.</p>
512
- <a target="_blank" href="http://web-dorado.com/products/wordpress-contacts-plugin.html" class="download">Download</a>
513
- </div>
514
- </li>
515
- <li class="facebook">
516
- <div class="product">
517
- <div class="title">
518
- <strong class="heading">Spider Facebook</strong>
519
- <p>WordPress Facebook plugin</p>
520
- </div>
521
- </div>
522
- <div class="description">
523
- <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>
524
- <a target="_blank" href="http://web-dorado.com/products/wordpress-facebook.html" class="download">Download</a>
525
- </div>
526
- </li>
527
- <li class="twitter-widget">
528
- <div class="product">
529
- <div class="title">
530
- <strong class="heading">Widget Twitter</strong>
531
- <p>WordPress Widget Twitter plugin</p>
532
- </div>
533
- </div>
534
- <div class="description">
535
- <p>The Widget Twitter plugin lets you to fully integrate your WordPress site with your Twitter account.</p>
536
- <a target="_blank" href="http://web-dorado.com/products/wordpress-twitter-integration-plugin.html" class="download">Download</a>
537
- </div>
538
- </li>
539
- <li class="faq">
540
- <div class="product">
541
- <div class="title">
542
- <strong class="heading">Spider FAQ</strong>
543
- <p>WordPress FAQ Plugin</p>
544
- </div>
545
- </div>
546
- <div class="description">
547
- <p>The Spider FAQ WordPress plugin is for creating an FAQ (Frequently Asked Questions) section for your website.</p>
548
- <a target="_blank" href="http://web-dorado.com/products/wordpress-faq-plugin.html" class="download">Download</a>
549
- </div>
550
- </li>
551
- <li class="zoom">
552
- <div class="product">
553
- <div class="title">
554
- <strong class="heading">Zoom</strong>
555
- <p>WordPress text zoom plugin</p>
556
- </div>
557
- </div>
558
- <div class="description">
559
- <p>Zoom enables site users to resize the predefined areas of the web site.</p>
560
- <a target="_blank" href="http://web-dorado.com/products/wordpress-zoom.html" class="download">Download</a>
561
- </div>
562
- </li>
563
- <li class="flash-calendar">
564
- <div class="product">
565
- <div class="title">
566
- <strong class="heading">Flash Calendar</strong>
567
- <p>WordPress flash calendar plugin</p>
568
- </div>
569
- </div>
570
- <div class="description">
571
- <p>Spider Flash Calendar is a highly configurable Flash calendar plugin which allows you to have multiple organized events.</p>
572
- <a target="_blank" href="http://web-dorado.com/products/wordpress-events-calendar.html" class="download">Download</a>
573
- </div>
574
- </li>
575
- </ul>
576
- </form>
577
- </div >
578
- <?php
579
- }
580
-
581
- function contact_form_Licensing() {
582
- ?>
583
- <div style="width:95%">
584
- <p>This plugin is the non-commercial version of the Contact Form. Use of this plugin is free. You can add unlimited
585
- number of the fields. The limitation is on the some types of the fields (Time and Date, Select, Check box, Radio, File Upload and Paypal). If you want to use those fields, you are required to purchase a license. </p>
586
- <br/>
587
- <a href="http://web-dorado.com/files/fromContactForm.php" class="button-primary" target="_blank">Purchase a License</a>
588
- <br/><br/>
589
- <p>After the purchasing the commercial version follow this steps:</p>
590
- <ol>
591
- <li>Deactivate Contact Form Plugin</li>
592
- <li>Delete Contact Form Plugin</li>
593
- <li>Install the downloaded commercial version of the plugin</li>
594
- </ol>
595
- <br/>
596
- <p>If you enjoy using Contact Form 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>
597
- <br/>
598
- <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>
599
- </div>
600
- <?php
601
- }
602
-
603
- function contact_form_submits_styles_scripts() {
604
- wp_enqueue_script('word-count');
605
- wp_enqueue_script('post');
606
- wp_enqueue_script('editor');
607
- wp_enqueue_script('media-upload');
608
- wp_admin_css('thickbox');
609
- wp_print_scripts('media-upload');
610
- do_action('admin_print_styles');
611
- wp_enqueue_script('common');
612
- wp_enqueue_script('jquery-color');
613
- wp_print_scripts('editor');
614
- if (function_exists('add_thickbox'))
615
- add_thickbox();
616
- if (get_bloginfo('version') < '3.3')
617
- if (function_exists('wp_tiny_mce'))
618
- wp_tiny_mce();
619
- wp_enqueue_script('utils');
620
- wp_enqueue_script("main", plugins_url("js/main.js", __FILE__));
621
- wp_enqueue_script("mootools", plugins_url("js/mootools.js", __FILE__));
622
- wp_enqueue_script("f_calendar", plugins_url("js/calendar.js", __FILE__));
623
- wp_enqueue_script("f_calendar_functions", plugins_url("js/calendar_function.js", __FILE__));
624
- wp_enqueue_script("f_calendar_setup", plugins_url("js/calendar-setup.js", __FILE__));
625
- wp_enqueue_style("calendar-jos", plugins_url("js/calendar-jos.css", __FILE__));
626
- wp_enqueue_script("jquery", plugins_url("js/jquery-1.9.1.js", __FILE__), array(), '1.9.1');
627
- }
628
-
629
- function contact_form_admin_styles_scripts() {
630
- if (isset($_GET['task'])) {
631
- if (esc_html($_GET['task']) == "gotoedit" || esc_html($_GET['task']) == "add_form" || esc_html($_GET['task']) == "edit_form" || esc_html($_GET['task']) == "Save_Edit_JavaScript" || esc_html($_GET['task']) == "Save_Actions_after_submission" || esc_html($_GET['task']) == "Save_Custom_text_in_email_for_administrator" || esc_html($_GET['task']) == "Save_Custom_text_in_email_for_user") {
632
- wp_enqueue_script('word-count');
633
- wp_enqueue_script('post');
634
- wp_enqueue_script('editor');
635
- wp_enqueue_script('media-upload');
636
- wp_admin_css('thickbox');
637
- wp_print_scripts('media-upload');
638
- if (get_bloginfo('version') < '3.3')
639
- wp_print_scripts('editor-functions');
640
- do_action('admin_print_styles');
641
- wp_enqueue_script('common');
642
- wp_enqueue_script('jquery-color');
643
- if (get_bloginfo('version') < '3.3')
644
- wp_print_scripts('editor');
645
- if (function_exists('add_thickbox'))
646
- add_thickbox();
647
- if (get_bloginfo('version') < '3.3')
648
- if (function_exists('wp_tiny_mce'))
649
- wp_tiny_mce();
650
- wp_enqueue_script('utils');
651
- if (get_bloginfo('version') > 3.3) {
652
- wp_enqueue_script("jquery");
653
- }
654
- else {
655
- wp_deregister_script('jquery');
656
- wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js');
657
- wp_enqueue_script('jquery');
658
- }
659
- wp_enqueue_script("gmap_form", plugins_url("js/if_gmap_back_end.js", __FILE__));
660
- wp_enqueue_script("form_main_js_free", plugins_url("js/formmaker_free.js", __FILE__));
661
- wp_enqueue_script("gmap_form_api", 'http://maps.google.com/maps/api/js?sensor=false');
662
- wp_enqueue_style("styles_form", plugins_url("css/style.css", __FILE__));
663
- wp_enqueue_script("mootools", plugins_url("js/mootools.js", __FILE__));
664
- wp_enqueue_script("f_calendar", plugins_url("js/calendar.js", __FILE__));
665
- wp_enqueue_script("f_calendar_functions", plugins_url("js/calendar_function.js", __FILE__));
666
- wp_enqueue_script("f_calendar_setup", plugins_url("js/calendar-setup.js", __FILE__));
667
- wp_enqueue_style("calendar-jos", plugins_url("js/calendar-jos.css", __FILE__));
668
- wp_enqueue_script("jquery", plugins_url("js/jquery-1.9.1.js", __FILE__), array(), '1.9.1');
669
- }
670
- }
671
- }
672
-
673
- function Manage_contact_form() {
674
- require_once("contact_form_functions.php");
675
- require_once("contact_form_functions.html.php");
676
- if (!function_exists('print_html_nav'))
677
- require_once("nav_function/nav_html_func.php");
678
- global $wpdb;
679
- if (isset($_GET["task"])) {
680
- $task = esc_html($_GET["task"]);
681
- }
682
- else {
683
- $task = "show";
684
- }
685
- if (isset($_GET["id"])) {
686
- $id = (int) $_GET["id"];
687
- }
688
- else {
689
- $id = 0;
690
- }
691
- switch ($task) {
692
- case "add_form" :
693
- add_form();
694
- break;
695
- case "edit_form" :
696
- edit_contact_form($id);
697
- break;
698
- case "Save" :
699
- if ($id)
700
- apply_form($id);
701
- else
702
- save_form();
703
- display_form_lists();
704
- break;
705
- case "Apply" :
706
- if ($id) {
707
- apply_form($id);
708
- }
709
- else {
710
- save_form();
711
- $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
712
- }
713
- forchrome($id);
714
- break;
715
- case "gotoedit" :
716
- gotoedit();
717
- edit_contact_form($id);
718
- break;
719
- case "remove_form" :
720
- remove_form($id);
721
- display_form_lists();
722
- break;
723
- // Form options.
724
- case "form_options" :
725
- if ($id) {
726
- apply_form($id);
727
- }
728
- else {
729
- save_form();
730
- $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
731
- }
732
- wd_form_options($id);
733
- break;
734
- case "Save_form_options" :
735
- Apply_form_options($id);
736
- forchrome($id);
737
- break;
738
- case "Apply_form_options" :
739
- Apply_form_options($id);
740
- wd_form_options($id);
741
- break;
742
- case "save_as_copy":
743
- save_as_copy();
744
- display_form_lists();
745
- break;
746
- default:
747
- display_form_lists();
748
- }
749
- }
750
-
751
- ////////////////////////////////////////////
752
- //////////////////////////////////////////// Submi
753
- ////////////////////////////////////////////
754
- ////map in spubmits
755
- add_action('wp_ajax_contactfrommapeditinpopup', 'spider_contact_form_map_edit');
756
- function spider_contact_form_map_edit() {
757
- if (function_exists('current_user_can')) {
758
- if (!current_user_can('manage_options')) {
759
- die('Access Denied');
760
- }
761
- }
762
- else {
763
- die('Access Denied');
764
- }
765
- if (isset($_GET['long']) && isset($_GET['lat'])) {
766
- $long = esc_html($_GET['long']);
767
- $lat = esc_html($_GET['lat']);
768
-
769
-
770
- ?>
771
- <script src="<?php echo plugins_url("js/if_gmap_back_end.js", __FILE__); ?>"></script>
772
- <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
773
-
774
- <table style="margin:0px; padding:0px">
775
- <tr>
776
- <td><b>Address:</b></td>
777
- <td><input type="text" id="addrval0" style="border:0px; background:none" size="80" readonly/></td>
778
- </tr>
779
- <tr>
780
- <td><b>Longitude:</b></td>
781
- <td><input type="text" id="longval0" style="border:0px; background:none" size="80" readonly/></td>
782
- </tr>
783
- <tr>
784
- <td><b>Latitude:</b></td>
785
- <td><input type="text" id="latval0" style="border:0px; background:none" size="80" readonly/></td>
786
- </tr>
787
- </table>
788
-
789
- <div id="0_elementform_id_temp" long="<?php echo $long ?>" center_x="<?php echo $long ?>"
790
- center_y="<?php echo $lat ?>" lat="<?php echo $lat ?>" zoom="8" info=""
791
- style="width:600px; height:500px; "></div>
792
-
793
- <script>
794
- if_gmap_init("0");
795
- add_marker_on_map(0, 0, "<?php echo $long ?>", "<?php echo $lat ?>", '');
796
-
797
-
798
- </script>
799
-
800
- <?php
801
-
802
-
803
- die();
804
- }
805
- else {
806
- return 0;
807
- }
808
- }
809
-
810
- /////////////////////////////////////////////////////////////////////////////////////
811
- /////////////////////////////////////////////////////////////////////////////////// priview form
812
- ///////////////////////////////////////////////////////////////////////////////////
813
- ///////////////////////////////////////////////////////////////////////////////////
814
- add_action('wp_ajax_frommakerpreview', 'preview_contact_form');
815
- function html_preview_contact_form($css) {
816
- $cmpnt_js_path = plugins_url('js', __FILE__);
817
- $id = 'form_id_temp';
818
- ?>
819
- <script src="<?php echo $cmpnt_js_path . "/if_gmap_back_end.js"; ?>"></script>
820
- <script src="<?php echo $cmpnt_js_path . "/main.js"; ?>"></script>
821
- <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
822
- <script src="<?php echo $cmpnt_js_path . "/jquery-1.9.1.js"; ?>"></script>
823
- <script src="<?php echo $cmpnt_js_path . "/main_front_end.js"; ?>"></script>
824
- <link media="all" type="text/css" href="<?php echo plugins_url('', __FILE__) . "/css/jquery-ui-spinner.css"; ?>" rel="stylesheet">
825
- <style>
826
- <?php
827
- $cmpnt_js_path = plugins_url('', __FILE__);
828
- echo str_replace('[SITE_ROOT]', $cmpnt_js_path, $css);
829
-
830
- ?>
831
- </style>
832
- <div id="form_id_temppages" class="wdform_page_navigation" show_title="" show_numbers="" type=""></div>
833
-
834
- <form id="form_preview"></form>
835
- <input type="hidden" id="counter<?php echo $id ?>" value="" name="counter<?php echo $id ?>"/>
836
-
837
- <script>
838
- JURI_ROOT = '<?php echo $cmpnt_js_path ?>';
839
-
840
- document.getElementById('form_preview').innerHTML = window.parent.document.getElementById('take').innerHTML;
841
- document.getElementById('form_id_temppages').setAttribute('show_title', window.parent.document.getElementById('pages').getAttribute('show_title'));
842
- document.getElementById('form_id_temppages').setAttribute('show_numbers', window.parent.document.getElementById('pages').getAttribute('show_numbers'));
843
- document.getElementById('form_id_temppages').setAttribute('type', window.parent.document.getElementById('pages').getAttribute('type'));
844
- document.getElementById('counterform_id_temp').value = window.parent.gen;
845
- ;
846
-
847
- form_view_count<?php echo $id ?>= 0;
848
- for (i = 1; i <= 30; i++) {
849
- if (document.getElementById('<?php echo $id ?>form_view' + i)) {
850
- form_view_count<?php echo $id ?>++;
851
- form_view_max<?php echo $id ?>= i;
852
- document.getElementById('<?php echo $id ?>form_view' + i).parentNode.removeAttribute('style');
853
- }
854
- }
855
-
856
- refresh_first();
857
-
858
-
859
- if (form_view_count<?php echo $id ?>> 1) {
860
- for (i = 1; i <= form_view_max<?php echo $id ?>; i++) {
861
- if (document.getElementById('<?php echo $id ?>form_view' + i)) {
862
- first_form_view<?php echo $id ?>= i;
863
- break;
864
- }
865
- }
866
-
867
- generate_page_nav(first_form_view<?php echo $id ?>, '<?php echo $id ?>', form_view_count<?php echo $id ?>, form_view_max<?php echo $id ?>);
868
- }
869
-
870
-
871
- function remove_add_(id) {
872
- attr_name = new Array();
873
- attr_value = new Array();
874
- var input = document.getElementById(id);
875
- atr = input.attributes;
876
- for (v = 0; v < 30; v++)
877
- if (atr[v]) {
878
- if (atr[v].name.indexOf("add_") == 0) {
879
- attr_name.push(atr[v].name.replace('add_', ''));
880
- attr_value.push(atr[v].value);
881
- input.removeAttribute(atr[v].name);
882
- v--;
883
- }
884
- }
885
- for (v = 0; v < attr_name.length; v++) {
886
- input.setAttribute(attr_name[v], attr_value[v])
887
- }
888
- }
889
-
890
- function refresh_first() {
891
-
892
- n = window.parent.gen;
893
- for (i = 0; i < n; i++) {
894
- if (document.getElementById(i)) {
895
- for (z = 0; z < document.getElementById(i).childNodes.length; z++)
896
- if (document.getElementById(i).childNodes[z].nodeType == 3)
897
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
898
-
899
- if (document.getElementById(i).getAttribute('type') == "type_map") {
900
- if_gmap_init(i);
901
- for (q = 0; q < 20; q++)
902
- if (document.getElementById(i + "_elementform_id_temp").getAttribute("long" + q)) {
903
-
904
- w_long = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("long" + q));
905
- w_lat = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("lat" + q));
906
-