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

Version Description

Changed: Backend Design

Download this release

Release Info

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

Code changes from version 1.7.97 to 1.8.0

Files changed (83) hide show
  1. admin/controllers/FMControllerBlocked_ips_fm.php +2 -2
  2. admin/controllers/FMControllerExtensions_fm.php +0 -1
  3. admin/controllers/FMControllerFeatured_plugins_fm.php +0 -49
  4. admin/controllers/FMControllerFormMakerSQLMapping.php +2 -2
  5. admin/controllers/FMControllerManage_fm.php +55 -26
  6. admin/controllers/FMControllerSelect_data_from_db.php +1 -1
  7. admin/controllers/FMControllerSubmissions_fm.php +7 -5
  8. admin/models/FMModelBlocked_ips_fm.php +0 -1
  9. admin/models/FMModelExtensions_fm.php +0 -30
  10. admin/models/FMModelFeatured_plugins_fm.php +0 -30
  11. admin/models/FMModelFormmakerwindow.php +1 -1
  12. admin/models/FMModelGenerete_csv.php +3 -2
  13. admin/models/FMModelGenerete_xml.php +2 -2
  14. admin/models/FMModelManage_fm.php +25 -28
  15. admin/models/FMModelSubmissions_fm.php +84 -82
  16. admin/models/FMModelThemes_fm.php +1 -1
  17. admin/views/FMViewBlocked_ips_fm.php +136 -126
  18. admin/views/FMViewExtensions_fm.php +0 -61
  19. admin/views/FMViewFeatured_plugins_fm.php +0 -171
  20. admin/views/FMViewFormMakerEditCSS.php +69 -48
  21. admin/views/FMViewFormMakerSQLMapping.php +1331 -1152
  22. admin/views/FMViewFormmakerwdcaptcha.php +1 -0
  23. admin/views/FMViewFormmakerwindow.php +47 -6
  24. admin/views/FMViewFromeditcountryinpopup.php +148 -104
  25. admin/views/FMViewGenerete_csv.php +1 -0
  26. admin/views/FMViewGenerete_xml.php +1 -1
  27. admin/views/FMViewManage_fm.php +3297 -3215
  28. admin/views/FMViewSelect_data_from_db.php +161 -160
  29. admin/views/FMViewSubmissions_fm.php +905 -863
  30. admin/views/FMViewThemes_fm.php +198 -206
  31. admin/views/FMViewUninstall_fm.php +67 -72
  32. assets/{conditional-emalis-update.png → conditional-emails-update.png} +0 -0
  33. css/calendar-jos.css +3 -3
  34. css/form_maker_featured_plugins.css +0 -88
  35. css/form_maker_first.css +110 -125
  36. css/form_maker_frontend.css +1 -1
  37. css/form_maker_tables.css +866 -369
  38. css/images/catalog.jpg +0 -0
  39. css/images/contact.maker.jpg +0 -0
  40. css/images/contacts.jpg +0 -0
  41. css/images/download.jpg +0 -0
  42. css/images/facebook.jpg +0 -0
  43. css/images/faq.jpg +0 -0
  44. css/images/flash.calendar.jpg +0 -0
  45. css/images/folder.menu.jpg +0 -0
  46. css/images/form_make_import.png +0 -0
  47. css/images/photo-gallery.jpg +0 -0
  48. css/images/player.jpg +0 -0
  49. css/images/spider.calendar.jpg +0 -0
  50. css/images/twitter-widget.jpg +0 -0
  51. css/images/zoom.jpg +0 -0
  52. css/notices.css +0 -1
  53. css/style.css +349 -271
  54. css/style_submissions.css +135 -0
  55. featured/admin.css +4 -0
  56. featured/featured.php +13 -13
  57. featured/images/Add_Ons.jpg +0 -0
  58. featured/images/catalog.jpg +0 -0
  59. featured/images/contact-form-builder.jpg +0 -0
  60. featured/images/contact-form-maker.jpg +0 -0
  61. featured/images/contacts.jpg +0 -0
  62. featured/images/facebook.jpg +0 -0
  63. featured/images/faq.jpg +0 -0
  64. featured/images/flash.calendar.jpg +0 -0
  65. featured/images/fm.import.jpg +0 -0
  66. featured/images/folder.menu.jpg +0 -0
  67. featured/images/form.jpg +0 -0
  68. featured/images/photo-gallery.jpg +0 -0
  69. featured/images/player.jpg +0 -0
  70. featured/images/slider.jpg +0 -0
  71. featured/images/spider-calendar.jpg +0 -0
  72. featured/images/twitter-widget.jpg +0 -0
  73. featured/images/zoom.jpg +0 -0
  74. featured/updates.php +158 -0
  75. form-maker.php +3 -3
  76. form_maker_notices_class.php +1 -1
  77. framework/WDW_FM_Library.php +25 -25
  78. frontend/controllers/FMControllerForm_maker.php +1 -1
  79. frontend/controllers/FMControllerForm_submissions.php +124 -0
  80. frontend/models/FMModelForm_maker.php +907 -755
  81. frontend/models/FMModelForm_submissions.php +296 -0
  82. frontend/views/FMViewForm_maker.php +49 -20
  83. frontend/views/FMViewForm_submissions.php +301 -0
admin/controllers/FMControllerBlocked_ips_fm.php CHANGED
@@ -24,8 +24,8 @@ class FMControllerBlocked_ips_fm {
24
  $message = WDW_FM_Library::get('message');
25
  echo WDW_FM_Library::message_id($message);
26
  if (method_exists($this, $task)) {
27
- check_admin_referer('nonce_fm', 'nonce_fm');
28
- $this->$task($id);
29
  }
30
  else {
31
  $this->display();
24
  $message = WDW_FM_Library::get('message');
25
  echo WDW_FM_Library::message_id($message);
26
  if (method_exists($this, $task)) {
27
+ check_admin_referer('nonce_fm', 'nonce_fm');
28
+ $this->$task($id);
29
  }
30
  else {
31
  $this->display();
admin/controllers/FMControllerExtensions_fm.php DELETED
@@ -1 +0,0 @@
1
- <?php
2
  ////////////////////////////////////////////////////////////////////////////////////////
3
  // Events //
4
  ////////////////////////////////////////////////////////////////////////////////////////
5
  ////////////////////////////////////////////////////////////////////////////////////////
6
  // Constants //
7
  ////////////////////////////////////////////////////////////////////////////////////////
8
  ////////////////////////////////////////////////////////////////////////////////////////
9
  // Variables //
10
  ////////////////////////////////////////////////////////////////////////////////////////
11
  ////////////////////////////////////////////////////////////////////////////////////////
12
  // Constructor & Destructor //
13
  ////////////////////////////////////////////////////////////////////////////////////////
14
  public function __construct() {
15
  }
16
  ////////////////////////////////////////////////////////////////////////////////////////
17
  // Public Methods //
18
  ////////////////////////////////////////////////////////////////////////////////////////
19
  public function execute() {
20
  $task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
21
  if (method_exists($this, $task)) {
22
  $this->$task($id);
23
  }
24
  else {
25
  $this->display();
26
  }
27
  }
28
  public function display() {
29
  require_once WD_FM_DIR . "/admin/models/FMModelExtensions_fm.php";
30
  $model = new FMModelExtensions_fm();
31
  require_once WD_FM_DIR . "/admin/views/FMViewExtensions_fm.php";
32
  $view = new FMViewExtensions_fm($model);
33
  $view->display();
34
  }
35
  ////////////////////////////////////////////////////////////////////////////////////////
36
  // Getters & Setters //
37
  ////////////////////////////////////////////////////////////////////////////////////////
38
  ////////////////////////////////////////////////////////////////////////////////////////
39
  // Private Methods //
40
  ////////////////////////////////////////////////////////////////////////////////////////
41
  ////////////////////////////////////////////////////////////////////////////////////////
42
  // Listeners //
43
  ////////////////////////////////////////////////////////////////////////////////////////
 
0
  ////////////////////////////////////////////////////////////////////////////////////////
1
  // Events //
2
  ////////////////////////////////////////////////////////////////////////////////////////
3
  ////////////////////////////////////////////////////////////////////////////////////////
4
  // Constants //
5
  ////////////////////////////////////////////////////////////////////////////////////////
6
  ////////////////////////////////////////////////////////////////////////////////////////
7
  // Variables //
8
  ////////////////////////////////////////////////////////////////////////////////////////
9
  ////////////////////////////////////////////////////////////////////////////////////////
10
  // Constructor & Destructor //
11
  ////////////////////////////////////////////////////////////////////////////////////////
12
  public function __construct() {
13
  }
14
  ////////////////////////////////////////////////////////////////////////////////////////
15
  // Public Methods //
16
  ////////////////////////////////////////////////////////////////////////////////////////
17
  public function execute() {
18
  $task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
19
  if (method_exists($this, $task)) {
20
  $this->$task($id);
21
  }
22
  else {
23
  $this->display();
24
  }
25
  }
26
  public function display() {
27
  require_once WD_FM_DIR . "/admin/models/FMModelExtensions_fm.php";
28
  $model = new FMModelExtensions_fm();
29
  require_once WD_FM_DIR . "/admin/views/FMViewExtensions_fm.php";
30
  $view = new FMViewExtensions_fm($model);
31
  $view->display();
32
  }
33
  ////////////////////////////////////////////////////////////////////////////////////////
34
  // Getters & Setters //
35
  ////////////////////////////////////////////////////////////////////////////////////////
36
  ////////////////////////////////////////////////////////////////////////////////////////
37
  // Private Methods //
38
  ////////////////////////////////////////////////////////////////////////////////////////
39
  ////////////////////////////////////////////////////////////////////////////////////////
40
  // Listeners //
41
  ////////////////////////////////////////////////////////////////////////////////////////
admin/controllers/FMControllerFeatured_plugins_fm.php DELETED
@@ -1,49 +0,0 @@
1
- <?php
2
-
3
- class FMControllerFeatured_plugins_fm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
23
- if (method_exists($this, $task)) {
24
- $this->$task($id);
25
- }
26
- else {
27
- $this->display();
28
- }
29
- }
30
-
31
- public function display() {
32
- require_once WD_FM_DIR . "/admin/models/FMModelFeatured_plugins_fm.php";
33
- $model = new FMModelFeatured_plugins_fm();
34
-
35
- require_once WD_FM_DIR . "/admin/views/FMViewFeatured_plugins_fm.php";
36
- $view = new FMViewFeatured_plugins_fm($model);
37
- $view->display();
38
- }
39
-
40
- ////////////////////////////////////////////////////////////////////////////////////////
41
- // Getters & Setters //
42
- ////////////////////////////////////////////////////////////////////////////////////////
43
- ////////////////////////////////////////////////////////////////////////////////////////
44
- // Private Methods //
45
- ////////////////////////////////////////////////////////////////////////////////////////
46
- ////////////////////////////////////////////////////////////////////////////////////////
47
- // Listeners //
48
- ////////////////////////////////////////////////////////////////////////////////////////
49
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/controllers/FMControllerFormMakerSQLMapping.php CHANGED
@@ -59,7 +59,7 @@ class FMControllerFormMakerSQLMapping {
59
 
60
  require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
61
  $view = new FMViewFormMakerSQLMapping($model);
62
- $view->db_tables((int)$form_id);
63
  }
64
 
65
  public function db_table_struct($form_id) {
@@ -68,7 +68,7 @@ class FMControllerFormMakerSQLMapping {
68
 
69
  require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
70
  $view = new FMViewFormMakerSQLMapping($model);
71
- $view->db_table_struct((int)$form_id);
72
  }
73
 
74
  public function save_query() {
59
 
60
  require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
61
  $view = new FMViewFormMakerSQLMapping($model);
62
+ $view->db_tables($form_id);
63
  }
64
 
65
  public function db_table_struct($form_id) {
68
 
69
  require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
70
  $view = new FMViewFormMakerSQLMapping($model);
71
+ $view->db_table_struct($form_id);
72
  }
73
 
74
  public function save_query() {
admin/controllers/FMControllerManage_fm.php CHANGED
@@ -24,11 +24,11 @@ class FMControllerManage_fm {
24
  $message = WDW_FM_Library::get('message');
25
  echo WDW_FM_Library::message_id($message);
26
  if (method_exists($this, $task)) {
27
- check_admin_referer('nonce_fm', 'nonce_fm');
28
- $this->$task($id);
29
  }
30
  else {
31
- $this->display();
32
  }
33
  }
34
  public function undo()
@@ -92,11 +92,11 @@ public function redo()
92
 
93
  require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
94
  $view = new FMViewManage_fm($model);
95
- $id = WDW_FM_Library::get('current_id', 0);
96
 
97
  global $wpdb;
98
  $query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE cur=1 and id=".$id;
99
- $backup_id = (int)$wpdb->get_var($query);
100
 
101
  if(!$backup_id)
102
  {
@@ -107,7 +107,6 @@ public function redo()
107
  else
108
  $backup_id=1;
109
  $query = "INSERT INTO ".$wpdb->prefix."formmaker_backup SELECT ".$backup_id." AS backup_id, 1 AS cur, formmakerbkup.id, formmakerbkup.title, formmakerbkup.mail, formmakerbkup.form_front, formmakerbkup.theme, formmakerbkup.javascript, formmakerbkup.submit_text, formmakerbkup.url, formmakerbkup.submit_text_type, formmakerbkup.script_mail, formmakerbkup.script_mail_user, formmakerbkup.counter, formmakerbkup.published, formmakerbkup.label_order, formmakerbkup.label_order_current, formmakerbkup.article_id, formmakerbkup.pagination, formmakerbkup.show_title, formmakerbkup.show_numbers, formmakerbkup.public_key, formmakerbkup.private_key, formmakerbkup.recaptcha_theme, formmakerbkup.paypal_mode, formmakerbkup.checkout_mode, formmakerbkup.paypal_email, formmakerbkup.payment_currency, formmakerbkup.tax, formmakerbkup.form_fields, formmakerbkup.savedb, formmakerbkup.sendemail, formmakerbkup.requiredmark, formmakerbkup.from_mail, formmakerbkup.from_name, formmakerbkup.reply_to, formmakerbkup.send_to, formmakerbkup.autogen_layout, formmakerbkup.custom_front, formmakerbkup.mail_from_user, formmakerbkup.mail_from_name_user, formmakerbkup.reply_to_user, formmakerbkup.condition, formmakerbkup.mail_cc, formmakerbkup.mail_cc_user, formmakerbkup.mail_bcc, formmakerbkup.mail_bcc_user, formmakerbkup.mail_subject, formmakerbkup.mail_subject_user, formmakerbkup.mail_mode, formmakerbkup.mail_mode_user, formmakerbkup.mail_attachment, formmakerbkup.mail_attachment_user, formmakerbkup.user_id_wd, formmakerbkup.sortable, formmakerbkup.frontend_submit_fields, formmakerbkup.frontend_submit_stat_fields, formmakerbkup.mail_emptyfields, formmakerbkup.mail_verify, formmakerbkup.mail_verify_expiretime, formmakerbkup.mail_verification_post_id, formmakerbkup.save_uploads FROM ".$wpdb->prefix."formmaker as formmakerbkup WHERE id=".$id;
110
-
111
  $wpdb->query($query);
112
  }
113
 
@@ -153,8 +152,6 @@ public function redo()
153
 
154
  require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
155
  $view = new FMViewManage_fm($model);
156
- // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
157
- // $view->form_options_old($id);
158
  $page = WDW_FM_Library::get('page');
159
  $current_id = (int)WDW_FM_Library::get('current_id', 0);
160
  $fieldset_id = WDW_FM_Library::get('fieldset_id', 'general');
@@ -323,7 +320,7 @@ function before_reset() {
323
  // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
324
  // $view->form_options($id);
325
  $page = WDW_FM_Library::get('page');
326
- $current_id =(int) WDW_FM_Library::get('current_id', 0);
327
  $fieldset_id = WDW_FM_Library::get('fieldset_id', 'general');
328
  WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'form_options', 'current_id' => $current_id, 'message' => $message, 'fieldset_id' => $fieldset_id), admin_url('admin.php')));
329
  }
@@ -331,8 +328,8 @@ function before_reset() {
331
  public function remove_query() {
332
  global $wpdb;
333
  $cid = ((isset($_POST['cid']) && $_POST['cid'] != '') ? $_POST['cid'] : NULL);
334
- if (count($cid)) {
335
- array_walk($cid, create_function('&$value', '$value = (int)$value;'));
336
  $cids = implode(',', $cid);
337
  $query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_query WHERE id IN ( ' . $cids . ' )';
338
  if ($wpdb->query($query)) {
@@ -370,9 +367,10 @@ function before_reset() {
370
  $id = (int)WDW_FM_Library::get('current_id', 0);
371
  $published = (isset($_POST['published']) ? esc_html(stripslashes($_POST['published'])) : 1);
372
  $savedb = (isset($_POST['savedb']) ? esc_html(stripslashes($_POST['savedb'])) : 1);
373
- $theme = ((isset($_POST['theme']) && (esc_html($_POST['theme']) != 0)) ? (int)esc_html(stripslashes($_POST['theme'])) : $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker_themes"));
374
  $requiredmark = (isset($_POST['requiredmark']) ? esc_html(stripslashes($_POST['requiredmark'])) : '*');
375
  $sendemail = (isset($_POST['sendemail']) ? esc_html(stripslashes($_POST['sendemail'])) : 1);
 
376
  $mail = (isset($_POST['mail']) ? esc_html(stripslashes($_POST['mail'])) : '');
377
  if (isset($_POST['mailToAdd']) && esc_html(stripslashes($_POST['mailToAdd'])) != '') {
378
  $mail .= esc_html(stripslashes($_POST['mailToAdd'])) . ',';
@@ -413,10 +411,10 @@ function before_reset() {
413
  $user_id_wd = (isset($_POST['user_id_wd']) ? stripslashes($_POST['user_id_wd']) : 'administrator,');
414
  $frontend_submit_fields = (isset($_POST['frontend_submit_fields']) ? stripslashes($_POST['frontend_submit_fields']) : '');
415
  $frontend_submit_stat_fields = (isset($_POST['frontend_submit_stat_fields']) ? stripslashes($_POST['frontend_submit_stat_fields']) : '');
416
- $mail_emptyfields = (isset($_POST['mail_emptyfields']) ? esc_html(stripslashes($_POST['mail_emptyfields'])) : 0);
417
  $mail_verify = (isset($_POST['mail_verify']) ? esc_html(stripslashes($_POST['mail_verify'])) : 0);
418
  $mail_verify_expiretime = (isset($_POST['mail_verify_expiretime']) ? esc_html(stripslashes($_POST['mail_verify_expiretime'])) : '');
419
- $send_to = '';
420
  for ($i = 0; $i < 20; $i++) {
421
  if (isset($_POST['send_to' . $i])) {
422
  $send_to .= '*' . esc_html(stripslashes($_POST['send_to' . $i])) . '*';
@@ -456,6 +454,7 @@ function before_reset() {
456
  'theme' => $theme,
457
  'requiredmark' => $requiredmark,
458
  'sendemail' => $sendemail,
 
459
  'mail' => $mail,
460
  'from_mail' => $from_mail,
461
  'from_name' => $from_name,
@@ -496,10 +495,13 @@ function before_reset() {
496
  'mail_verification_post_id' => $mail_verification_post_id,
497
  ), array('id' => $id));
498
  if ($save !== FALSE) {
499
- return 8;
 
 
 
500
  }
501
  else {
502
- return 2;
503
  }
504
  }
505
 
@@ -522,7 +524,7 @@ function before_reset() {
522
  $message = $this->save_db_old();
523
  // $this->edit_old();
524
  $id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
525
- $current_id =(int) WDW_FM_Library::get('current_id', $id);
526
  $page = WDW_FM_Library::get('page');
527
  WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit_old', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
528
  }
@@ -627,7 +629,8 @@ function before_reset() {
627
  'sendemail' => $row->sendemail,
628
  'savedb' => $row->savedb,
629
  'form_fields' => $row->form_fields,
630
- 'published' => $row->published
 
631
  ), array(
632
  '%s',
633
  '%s',
@@ -674,7 +677,7 @@ function before_reset() {
674
  '%s',
675
  '%d'
676
  ));
677
- $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
678
  $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
679
  'form_id' => $id,
680
  'views' => 0
@@ -727,8 +730,9 @@ function before_reset() {
727
  }";
728
  $id = (int)WDW_FM_Library::get('current_id', 0);
729
  $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
 
730
  $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
731
- $sortable = (isset($_POST['sortable']) ? 1 : 0);
732
  $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
733
  $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
734
  $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
@@ -742,6 +746,7 @@ function before_reset() {
742
  if ($id != 0) {
743
  $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
744
  'title' => $title,
 
745
  'form_front' => $form_front,
746
  'sortable' => $sortable,
747
  'counter' => $counter,
@@ -761,7 +766,7 @@ function before_reset() {
761
  'title' => $title,
762
  'mail' => '',
763
  'form_front' => $form_front,
764
- 'theme' => $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE css LIKE '%.wdform_section%'"),
765
  'counter' => $counter,
766
  'label_order' => $label_order,
767
  'pagination' => $pagination,
@@ -812,6 +817,7 @@ function before_reset() {
812
  'user_id_wd' => 'administrator,',
813
  'frontend_submit_fields' => '',
814
  'frontend_submit_stat_fields' => '',
 
815
  ), array(
816
  '%s',
817
  '%s',
@@ -867,8 +873,9 @@ function before_reset() {
867
  '%s',
868
  '%s',
869
  '%s',
 
870
  ));
871
- $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
872
  // $_POST['current_id'] = $id;
873
  $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
874
  'form_id' => $id,
@@ -898,6 +905,7 @@ function before_reset() {
898
  $save = $wpdb->update($wpdb->prefix . 'formmaker_backup', array(
899
  'cur' => 1,
900
  'title' => $title,
 
901
  'form_front' => $form_front,
902
  'sortable' => $sortable,
903
  'counter' => $counter,
@@ -930,7 +938,7 @@ function before_reset() {
930
  'title' => $title,
931
  'mail' => '',
932
  'form_front' => $form_front,
933
- 'theme' => $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE css LIKE '%.wdform_section%'"),
934
  'counter' => $counter,
935
  'label_order' => $label_order,
936
  'pagination' => $pagination,
@@ -1130,6 +1138,7 @@ function before_reset() {
1130
  'user_id_wd' => $row->user_id_wd,
1131
  'frontend_submit_fields' => $row->frontend_submit_fields,
1132
  'frontend_submit_stat_fields' => $row->frontend_submit_stat_fields,
 
1133
  ), array(
1134
  '%s',
1135
  '%s',
@@ -1185,17 +1194,28 @@ function before_reset() {
1185
  '%s',
1186
  '%s',
1187
  '%s',
 
1188
  ));
1189
- $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
1190
  $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
1191
- 'form_id' => $id,
1192
  'views' => 0
1193
  ), array(
1194
  '%d',
1195
  '%d'
1196
  ));
1197
  if ($save !== FALSE) {
1198
- return 1;
 
 
 
 
 
 
 
 
 
 
1199
  }
1200
  else {
1201
  return 2;
@@ -1208,6 +1228,15 @@ function before_reset() {
1208
  if ($wpdb->query($query)) {
1209
  $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $id));
1210
  $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $id));
 
 
 
 
 
 
 
 
 
1211
  $message = 3;
1212
  }
1213
  else {
24
  $message = WDW_FM_Library::get('message');
25
  echo WDW_FM_Library::message_id($message);
26
  if (method_exists($this, $task)) {
27
+ check_admin_referer('nonce_fm', 'nonce_fm');
28
+ $this->$task($id);
29
  }
30
  else {
31
+ $this->display();
32
  }
33
  }
34
  public function undo()
92
 
93
  require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
94
  $view = new FMViewManage_fm($model);
95
+ $id = (int)WDW_FM_Library::get('current_id', 0);
96
 
97
  global $wpdb;
98
  $query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE cur=1 and id=".$id;
99
+ $backup_id = $wpdb->get_var($query);
100
 
101
  if(!$backup_id)
102
  {
107
  else
108
  $backup_id=1;
109
  $query = "INSERT INTO ".$wpdb->prefix."formmaker_backup SELECT ".$backup_id." AS backup_id, 1 AS cur, formmakerbkup.id, formmakerbkup.title, formmakerbkup.mail, formmakerbkup.form_front, formmakerbkup.theme, formmakerbkup.javascript, formmakerbkup.submit_text, formmakerbkup.url, formmakerbkup.submit_text_type, formmakerbkup.script_mail, formmakerbkup.script_mail_user, formmakerbkup.counter, formmakerbkup.published, formmakerbkup.label_order, formmakerbkup.label_order_current, formmakerbkup.article_id, formmakerbkup.pagination, formmakerbkup.show_title, formmakerbkup.show_numbers, formmakerbkup.public_key, formmakerbkup.private_key, formmakerbkup.recaptcha_theme, formmakerbkup.paypal_mode, formmakerbkup.checkout_mode, formmakerbkup.paypal_email, formmakerbkup.payment_currency, formmakerbkup.tax, formmakerbkup.form_fields, formmakerbkup.savedb, formmakerbkup.sendemail, formmakerbkup.requiredmark, formmakerbkup.from_mail, formmakerbkup.from_name, formmakerbkup.reply_to, formmakerbkup.send_to, formmakerbkup.autogen_layout, formmakerbkup.custom_front, formmakerbkup.mail_from_user, formmakerbkup.mail_from_name_user, formmakerbkup.reply_to_user, formmakerbkup.condition, formmakerbkup.mail_cc, formmakerbkup.mail_cc_user, formmakerbkup.mail_bcc, formmakerbkup.mail_bcc_user, formmakerbkup.mail_subject, formmakerbkup.mail_subject_user, formmakerbkup.mail_mode, formmakerbkup.mail_mode_user, formmakerbkup.mail_attachment, formmakerbkup.mail_attachment_user, formmakerbkup.user_id_wd, formmakerbkup.sortable, formmakerbkup.frontend_submit_fields, formmakerbkup.frontend_submit_stat_fields, formmakerbkup.mail_emptyfields, formmakerbkup.mail_verify, formmakerbkup.mail_verify_expiretime, formmakerbkup.mail_verification_post_id, formmakerbkup.save_uploads FROM ".$wpdb->prefix."formmaker as formmakerbkup WHERE id=".$id;
 
110
  $wpdb->query($query);
111
  }
112
 
152
 
153
  require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
154
  $view = new FMViewManage_fm($model);
 
 
155
  $page = WDW_FM_Library::get('page');
156
  $current_id = (int)WDW_FM_Library::get('current_id', 0);
157
  $fieldset_id = WDW_FM_Library::get('fieldset_id', 'general');
320
  // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
321
  // $view->form_options($id);
322
  $page = WDW_FM_Library::get('page');
323
+ $current_id = (int)WDW_FM_Library::get('current_id', 0);
324
  $fieldset_id = WDW_FM_Library::get('fieldset_id', 'general');
325
  WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'form_options', 'current_id' => $current_id, 'message' => $message, 'fieldset_id' => $fieldset_id), admin_url('admin.php')));
326
  }
328
  public function remove_query() {
329
  global $wpdb;
330
  $cid = ((isset($_POST['cid']) && $_POST['cid'] != '') ? $_POST['cid'] : NULL);
331
+ if (count($cid)) {
332
+ array_walk($cid, create_function('&$value', '$value = (int)$value;'));
333
  $cids = implode(',', $cid);
334
  $query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_query WHERE id IN ( ' . $cids . ' )';
335
  if ($wpdb->query($query)) {
367
  $id = (int)WDW_FM_Library::get('current_id', 0);
368
  $published = (isset($_POST['published']) ? esc_html(stripslashes($_POST['published'])) : 1);
369
  $savedb = (isset($_POST['savedb']) ? esc_html(stripslashes($_POST['savedb'])) : 1);
370
+ $theme = (int)((isset($_POST['theme']) && (esc_html($_POST['theme']) != 0)) ? esc_html(stripslashes($_POST['theme'])) : $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'"));
371
  $requiredmark = (isset($_POST['requiredmark']) ? esc_html(stripslashes($_POST['requiredmark'])) : '*');
372
  $sendemail = (isset($_POST['sendemail']) ? esc_html(stripslashes($_POST['sendemail'])) : 1);
373
+ $save_uploads = (isset($_POST['save_uploads']) ? esc_html(stripslashes($_POST['save_uploads'])) : 1);
374
  $mail = (isset($_POST['mail']) ? esc_html(stripslashes($_POST['mail'])) : '');
375
  if (isset($_POST['mailToAdd']) && esc_html(stripslashes($_POST['mailToAdd'])) != '') {
376
  $mail .= esc_html(stripslashes($_POST['mailToAdd'])) . ',';
411
  $user_id_wd = (isset($_POST['user_id_wd']) ? stripslashes($_POST['user_id_wd']) : 'administrator,');
412
  $frontend_submit_fields = (isset($_POST['frontend_submit_fields']) ? stripslashes($_POST['frontend_submit_fields']) : '');
413
  $frontend_submit_stat_fields = (isset($_POST['frontend_submit_stat_fields']) ? stripslashes($_POST['frontend_submit_stat_fields']) : '');
414
+ $mail_emptyfields = (isset($_POST['mail_emptyfields']) ? esc_html(stripslashes($_POST['mail_emptyfields'])) : 0);
415
  $mail_verify = (isset($_POST['mail_verify']) ? esc_html(stripslashes($_POST['mail_verify'])) : 0);
416
  $mail_verify_expiretime = (isset($_POST['mail_verify_expiretime']) ? esc_html(stripslashes($_POST['mail_verify_expiretime'])) : '');
417
+ $send_to = '';
418
  for ($i = 0; $i < 20; $i++) {
419
  if (isset($_POST['send_to' . $i])) {
420
  $send_to .= '*' . esc_html(stripslashes($_POST['send_to' . $i])) . '*';
454
  'theme' => $theme,
455
  'requiredmark' => $requiredmark,
456
  'sendemail' => $sendemail,
457
+ 'save_uploads' => $save_uploads,
458
  'mail' => $mail,
459
  'from_mail' => $from_mail,
460
  'from_name' => $from_name,
495
  'mail_verification_post_id' => $mail_verification_post_id,
496
  ), array('id' => $id));
497
  if ($save !== FALSE) {
498
+ $save_theme_in_backup = $wpdb->update($wpdb->prefix . 'formmaker_backup', array(
499
+ 'theme' => $theme
500
+ ), array('id' => $id));
501
+ return 8;
502
  }
503
  else {
504
+ return 2;
505
  }
506
  }
507
 
524
  $message = $this->save_db_old();
525
  // $this->edit_old();
526
  $id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
527
+ $current_id = (int)WDW_FM_Library::get('current_id', $id);
528
  $page = WDW_FM_Library::get('page');
529
  WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit_old', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
530
  }
629
  'sendemail' => $row->sendemail,
630
  'savedb' => $row->savedb,
631
  'form_fields' => $row->form_fields,
632
+ 'published' => $row->published,
633
+ 'save_uploads' => $row->save_uploads
634
  ), array(
635
  '%s',
636
  '%s',
677
  '%s',
678
  '%d'
679
  ));
680
+ $id = (int)$wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
681
  $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
682
  'form_id' => $id,
683
  'views' => 0
730
  }";
731
  $id = (int)WDW_FM_Library::get('current_id', 0);
732
  $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
733
+ $theme = (isset($_POST['theme']) ? esc_html(stripslashes($_POST['theme'])) : $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'"));
734
  $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
735
+ $sortable = (isset($_POST['sortable']) ? stripslashes($_POST['sortable']) : 1);
736
  $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
737
  $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
738
  $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
746
  if ($id != 0) {
747
  $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
748
  'title' => $title,
749
+ 'theme' => $theme,
750
  'form_front' => $form_front,
751
  'sortable' => $sortable,
752
  'counter' => $counter,
766
  'title' => $title,
767
  'mail' => '',
768
  'form_front' => $form_front,
769
+ 'theme' => $theme,
770
  'counter' => $counter,
771
  'label_order' => $label_order,
772
  'pagination' => $pagination,
817
  'user_id_wd' => 'administrator,',
818
  'frontend_submit_fields' => '',
819
  'frontend_submit_stat_fields' => '',
820
+ 'save_uploads' => 1,
821
  ), array(
822
  '%s',
823
  '%s',
873
  '%s',
874
  '%s',
875
  '%s',
876
+ '%d',
877
  ));
878
+ $id = (int)$wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
879
  // $_POST['current_id'] = $id;
880
  $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
881
  'form_id' => $id,
905
  $save = $wpdb->update($wpdb->prefix . 'formmaker_backup', array(
906
  'cur' => 1,
907
  'title' => $title,
908
+ 'theme' => $theme,
909
  'form_front' => $form_front,
910
  'sortable' => $sortable,
911
  'counter' => $counter,
938
  'title' => $title,
939
  'mail' => '',
940
  'form_front' => $form_front,
941
+ 'theme' => $theme,
942
  'counter' => $counter,
943
  'label_order' => $label_order,
944
  'pagination' => $pagination,
1138
  'user_id_wd' => $row->user_id_wd,
1139
  'frontend_submit_fields' => $row->frontend_submit_fields,
1140
  'frontend_submit_stat_fields' => $row->frontend_submit_stat_fields,
1141
+ 'save_uploads' => $row->save_uploads,
1142
  ), array(
1143
  '%s',
1144
  '%s',
1194
  '%s',
1195
  '%s',
1196
  '%s',
1197
+ '%d',
1198
  ));
1199
+ $new_id = (int)$wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
1200
  $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
1201
+ 'form_id' => $new_id,
1202
  'views' => 0
1203
  ), array(
1204
  '%d',
1205
  '%d'
1206
  ));
1207
  if ($save !== FALSE) {
1208
+ $addons = array('WD_FM_EMAIL_COND' => 'Conditional Emails', 'WD_FM_PDF' => 'PDF Integration');
1209
+ $addons_array = array();
1210
+ foreach($addons as $addon => $addon_name) {
1211
+ if (defined($addon) && is_plugin_active(constant($addon))) {
1212
+ $_GET['addon_task'] = 'save_as_copy';
1213
+ $_GET['form_id'] = $id;
1214
+ $_GET['form_id_new'] = $new_id;
1215
+ do_action($addon.'_init');
1216
+ }
1217
+ }
1218
+ return 1;
1219
  }
1220
  else {
1221
  return 2;
1228
  if ($wpdb->query($query)) {
1229
  $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $id));
1230
  $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $id));
1231
+ $addons = array('WD_FM_EMAIL_COND' => 'Conditional Emails', 'WD_FM_PDF' => 'PDF Integration');
1232
+ $addons_array = array();
1233
+ foreach($addons as $addon => $addon_name) {
1234
+ if (defined($addon) && is_plugin_active(constant($addon))) {
1235
+ $_GET['addon_task'] = 'delete';
1236
+ $_GET['form_id'] = $id;
1237
+ do_action($addon.'_init');
1238
+ }
1239
+ }
1240
  $message = 3;
1241
  }
1242
  else {
admin/controllers/FMControllerSelect_data_from_db.php CHANGED
@@ -48,7 +48,7 @@ class FMControllerSelect_data_from_db {
48
 
49
  require_once WD_FM_DIR . "/admin/views/FMViewSelect_data_from_db.php";
50
  $view = new FMViewSelect_data_from_db($model);
51
- $view->db_tables((int)$form_id,$field_type);
52
  }
53
  public function db_table_struct_select($form_id,$field_type) {
54
  require_once WD_FM_DIR . "/admin/models/FMModelSelect_data_from_db.php";
48
 
49
  require_once WD_FM_DIR . "/admin/views/FMViewSelect_data_from_db.php";
50
  $view = new FMViewSelect_data_from_db($model);
51
+ $view->db_tables((int)$form_id, $field_type);
52
  }
53
  public function db_table_struct_select($form_id,$field_type) {
54
  require_once WD_FM_DIR . "/admin/models/FMModelSelect_data_from_db.php";
admin/controllers/FMControllerSubmissions_fm.php CHANGED
@@ -22,6 +22,7 @@ class FMControllerSubmissions_fm {
22
  $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
23
  $id = ((isset($_POST['current_id'])) ? (int)esc_html($_POST['current_id']) : 0);
24
  $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
 
25
  if (method_exists($this, $task)) {
26
  if($task != 'show_stats')
27
  check_admin_referer('nonce_fm', 'nonce_fm');
@@ -30,7 +31,7 @@ class FMControllerSubmissions_fm {
30
  $this->$task($id);
31
  }
32
  else {
33
- $this->display($form_id);
34
  }
35
  }
36
 
@@ -45,6 +46,7 @@ class FMControllerSubmissions_fm {
45
  }
46
 
47
  public function show_stats() {
 
48
  $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
49
  require_once WD_FM_DIR . "/admin/models/FMModelSubmissions_fm.php";
50
  $model = new FMModelSubmissions_fm();
@@ -692,10 +694,10 @@ class FMControllerSubmissions_fm {
692
 
693
  public function delete_all() {
694
  global $wpdb;
695
- $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
696
  $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
697
  if (count($cid)) {
698
- array_walk($cid, create_function('&$value', '$value = (int)$value;'));
699
  $cids = implode(',', $cid);
700
  $query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )';
701
  // $elements_col = $wpdb->get_col('SELECT element_value FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )');
@@ -728,7 +730,7 @@ class FMControllerSubmissions_fm {
728
  $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
729
  $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
730
  if (count($cid)) {
731
- array_walk($cid, create_function('&$value', '$value = (int)$value;'));
732
  $cids = implode(',', $cid);
733
  $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( '. $cids .' )';
734
  $rows = $wpdb->get_results($query);
@@ -759,7 +761,7 @@ class FMControllerSubmissions_fm {
759
  $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
760
  $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
761
  if (count($cid)) {
762
- array_walk($cid, create_function('&$value', '$value = (int)$value;'));
763
  $cids = implode(',', $cid);
764
  $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( '. $cids .' )';
765
  $rows = $wpdb->get_results($query);
22
  $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
23
  $id = ((isset($_POST['current_id'])) ? (int)esc_html($_POST['current_id']) : 0);
24
  $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
25
+
26
  if (method_exists($this, $task)) {
27
  if($task != 'show_stats')
28
  check_admin_referer('nonce_fm', 'nonce_fm');
31
  $this->$task($id);
32
  }
33
  else {
34
+ $this->display($form_id);
35
  }
36
  }
37
 
46
  }
47
 
48
  public function show_stats() {
49
+
50
  $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
51
  require_once WD_FM_DIR . "/admin/models/FMModelSubmissions_fm.php";
52
  $model = new FMModelSubmissions_fm();
694
 
695
  public function delete_all() {
696
  global $wpdb;
697
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
698
  $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
699
  if (count($cid)) {
700
+ array_walk($cid, create_function('&$value', '$value = (int)$value;'));
701
  $cids = implode(',', $cid);
702
  $query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )';
703
  // $elements_col = $wpdb->get_col('SELECT element_value FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )');
730
  $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
731
  $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
732
  if (count($cid)) {
733
+ array_walk($cid, create_function('&$value', '$value = (int)$value;'));
734
  $cids = implode(',', $cid);
735
  $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( '. $cids .' )';
736
  $rows = $wpdb->get_results($query);
761
  $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
762
  $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
763
  if (count($cid)) {
764
+ array_walk($cid, create_function('&$value', '$value = (int)$value;'));
765
  $cids = implode(',', $cid);
766
  $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( '. $cids .' )';
767
  $rows = $wpdb->get_results($query);
admin/models/FMModelBlocked_ips_fm.php CHANGED
@@ -24,7 +24,6 @@ class FMModelBlocked_ips_fm {
24
  $asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
25
  $order_by_array = array('id', 'ip');
26
  $order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
27
- $order_by = in_array($order_by, $order_by_array) ? $order_by : 'id';
28
  $order_by = ' ORDER BY `' . $order_by . '` ' . $asc_or_desc;
29
  if (isset($_POST['page_number']) && $_POST['page_number']) {
30
  $limit = ((int) $_POST['page_number'] - 1) * 20;
24
  $asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
25
  $order_by_array = array('id', 'ip');
26
  $order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
 
27
  $order_by = ' ORDER BY `' . $order_by . '` ' . $asc_or_desc;
28
  if (isset($_POST['page_number']) && $_POST['page_number']) {
29
  $limit = ((int) $_POST['page_number'] - 1) * 20;
admin/models/FMModelExtensions_fm.php DELETED
@@ -1,30 +0,0 @@
1
- <?php
2
-
3
- class FMModelExtensions_fm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- ////////////////////////////////////////////////////////////////////////////////////////
22
- // Getters & Setters //
23
- ////////////////////////////////////////////////////////////////////////////////////////
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- // Private Methods //
26
- ////////////////////////////////////////////////////////////////////////////////////////
27
- ////////////////////////////////////////////////////////////////////////////////////////
28
- // Listeners //
29
- ////////////////////////////////////////////////////////////////////////////////////////
30
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/models/FMModelFeatured_plugins_fm.php DELETED
@@ -1,30 +0,0 @@
1
- <?php
2
-
3
- class FMModelFeatured_plugins_fm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- ////////////////////////////////////////////////////////////////////////////////////////
22
- // Getters & Setters //
23
- ////////////////////////////////////////////////////////////////////////////////////////
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- // Private Methods //
26
- ////////////////////////////////////////////////////////////////////////////////////////
27
- ////////////////////////////////////////////////////////////////////////////////////////
28
- // Listeners //
29
- ////////////////////////////////////////////////////////////////////////////////////////
30
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/models/FMModelFormmakerwindow.php CHANGED
@@ -21,7 +21,7 @@ class FMModelFormmakerwindow {
21
 
22
  public function get_form_data() {
23
  global $wpdb;
24
- $row = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN(" . get_option('contact_form_forms', 0) . ") order by `title`");
25
  return $row;
26
  }
27
  ////////////////////////////////////////////////////////////////////////////////////////
21
 
22
  public function get_form_data() {
23
  global $wpdb;
24
+ $row = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker order by `title`");
25
  return $row;
26
  }
27
  ////////////////////////////////////////////////////////////////////////////////////////
admin/models/FMModelGenerete_csv.php CHANGED
@@ -39,7 +39,7 @@ class FMModelGenerete_csv {
39
  $rows_lable = $wpdb->get_results($query_lable);
40
  $ptn = "/[^a-zA-Z0-9_]/";
41
  $rpltxt = "";
42
- $title = preg_replace($ptn, $rpltxt, $rows_lable[0]->title);
43
 
44
  $sorted_labels_id = array();
45
  $sorted_labels = array();
@@ -70,6 +70,7 @@ class FMModelGenerete_csv {
70
  }
71
 
72
  $m = count($sorted_labels);
 
73
 
74
  $query = $wpdb->prepare("SELECT group_id, ip, date, user_id_wd, GROUP_CONCAT( element_label SEPARATOR ',') as element_label, GROUP_CONCAT( element_value SEPARATOR '*:*el_value*:*') as element_value FROM " . $wpdb->prefix . "formmaker_submits where form_id= %d GROUP BY group_id ORDER BY date ASC limit %d, %d", $form_id, $limitstart, 1000);
75
  $rows = $wpdb->get_results($query, OBJECT_K);
@@ -212,7 +213,7 @@ class FMModelGenerete_csv {
212
  $data_temp[stripslashes($label_titles[$h])] = ($element_value ? $val : '');
213
  }
214
  }
215
- else
216
  $data_temp[stripslashes($label_titles[$h])] = '';
217
  }
218
 
39
  $rows_lable = $wpdb->get_results($query_lable);
40
  $ptn = "/[^a-zA-Z0-9_]/";
41
  $rpltxt = "";
42
+ $title = isset($rows_lable[0]) ? preg_replace($ptn, $rpltxt, $rows_lable[0]->title) : '';
43
 
44
  $sorted_labels_id = array();
45
  $sorted_labels = array();
70
  }
71
 
72
  $m = count($sorted_labels);
73
+ $wpdb->query("SET SESSION group_concat_max_len = 1000000");
74
 
75
  $query = $wpdb->prepare("SELECT group_id, ip, date, user_id_wd, GROUP_CONCAT( element_label SEPARATOR ',') as element_label, GROUP_CONCAT( element_value SEPARATOR '*:*el_value*:*') as element_value FROM " . $wpdb->prefix . "formmaker_submits where form_id= %d GROUP BY group_id ORDER BY date ASC limit %d, %d", $form_id, $limitstart, 1000);
76
  $rows = $wpdb->get_results($query, OBJECT_K);
213
  $data_temp[stripslashes($label_titles[$h])] = ($element_value ? $val : '');
214
  }
215
  }
216
+ else
217
  $data_temp[stripslashes($label_titles[$h])] = '';
218
  }
219
 
admin/models/FMModelGenerete_xml.php CHANGED
@@ -40,7 +40,7 @@ class FMModelGenerete_xml {
40
  $rows_lable = $wpdb->get_results($query_lable);
41
  $ptn = "/[^a-zA-Z0-9_]/";
42
  $rpltxt = "";
43
- $title = preg_replace($ptn, $rpltxt, $rows_lable[0]->title);
44
 
45
  $sorted_labels_id = array();
46
  $sorted_labels = array();
@@ -213,7 +213,7 @@ class FMModelGenerete_xml {
213
  $data_temp[stripslashes($label_titles[$h])] = ($element_value ? $val : '');
214
  }
215
  }
216
- else
217
  $data_temp[stripslashes($label_titles[$h])] = '';
218
  }
219
 
40
  $rows_lable = $wpdb->get_results($query_lable);
41
  $ptn = "/[^a-zA-Z0-9_]/";
42
  $rpltxt = "";
43
+ $title = isset($rows_lable[0]) ? preg_replace($ptn, $rpltxt, $rows_lable[0]->title) : '';
44
 
45
  $sorted_labels_id = array();
46
  $sorted_labels = array();
213
  $data_temp[stripslashes($label_titles[$h])] = ($element_value ? $val : '');
214
  }
215
  }
216
+ else
217
  $data_temp[stripslashes($label_titles[$h])] = '';
218
  }
219
 
admin/models/FMModelManage_fm.php CHANGED
@@ -20,12 +20,10 @@ class FMModelManage_fm {
20
  ////////////////////////////////////////////////////////////////////////////////////////
21
  public function get_rows_data() {
22
  global $wpdb;
23
- $where = 'WHERE `id` NOT IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')';
24
- $where .= ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? ' AND title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
25
  $asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
26
  $order_by_array = array('id', 'title', 'mail');
27
  $order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
28
- $order_by = in_array($order_by, $order_by_array) ? $order_by : 'id';
29
  $order_by = ' ORDER BY `' . $order_by . '` ' . $asc_or_desc;
30
  if (isset($_POST['page_number']) && $_POST['page_number']) {
31
  $limit = ((int) $_POST['page_number'] - 1) * 20;
@@ -91,6 +89,7 @@ class FMModelManage_fm {
91
  $row->mail_from_user = '';
92
  $row->mail_from_name_user = '';
93
  $row->reply_to_user = '';
 
94
  }
95
  return $row;
96
  }
@@ -144,12 +143,12 @@ class FMModelManage_fm {
144
  {
145
  case 'type_section_break':
146
  {
147
- $arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" ><div id="X_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png" title="Remove the field" onclick="remove_section_break(&quot;'.$id.'&quot;)"></div><div id="edit_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png" title="Edit the field" onclick="edit(&quot;'.$id.'&quot;)"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">custom_'.$id.'</span></div><div id="dublicate_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/dublicate.png" title="Dublicate the field" onclick="dublicate(&quot;'.$id.'&quot;)"></div></div>';
148
  break;
149
  }
150
  case 'type_editor':
151
  {
152
- $arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" type="type_editor" style="margin-top:0px;"><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png" title="Remove the field" onclick="remove_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;delete_el&quot;)" onmouseout="chnage_icons_src(this,&quot;delete_el&quot;)"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/left.png" title="Move the field to the left" onclick="left_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;left&quot;)" onmouseout="chnage_icons_src(this,&quot;left&quot;)"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/up.png" title="Move the field up" onclick="up_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;up&quot;)" onmouseout="chnage_icons_src(this,&quot;up&quot;)"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/down.png" title="Move the field down" onclick="down_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;down&quot;)" onmouseout="chnage_icons_src(this,&quot;down&quot;)"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/right.png" title="Move the field to the right" onclick="right_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;right&quot;)" onmouseout="chnage_icons_src(this,&quot;right&quot;)"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png" title="Edit the field" onclick="edit(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;edit&quot;)" onmouseout="chnage_icons_src(this,&quot;edit&quot;)"></div><div id="dublicate_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/dublicate.png" title="Dublicate the field" onclick="dublicate(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;dublicate&quot;)" onmouseout="chnage_icons_src(this,&quot;dublicate&quot;)"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_up.png" title="Move the field to the upper page" onclick="page_up(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;page_up&quot;)" onmouseout="chnage_icons_src(this,&quot;page_up&quot;)"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_down.png" title="Move the field to the lower page" onclick="page_down(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;page_down&quot;)" onmouseout="chnage_icons_src(this,&quot;page_down&quot;)"></div></div>';
153
  break;
154
  }
155
 
@@ -158,13 +157,13 @@ class FMModelManage_fm {
158
  case 'type_arithmetic_captcha':
159
  case 'type_recaptcha':
160
  {
161
- $arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows"><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png" title="Remove the field" onclick="remove_row(&quot;'.$id.'&quot;)"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/left.png" title="Move the field to the left" onclick="left_row(&quot;'.$id.'&quot;)"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/up.png" title="Move the field up" onclick="up_row(&quot;'.$id.'&quot;)"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/down.png" title="Move the field down" onclick="down_row(&quot;'.$id.'&quot;)"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/right.png" title="Move the field to the right" onclick="right_row(&quot;'.$id.'&quot;)"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png" title="Edit the field" onclick="edit(&quot;'.$id.'&quot;)"></div><div id="dublicate_'.$id.'" valign="middle" class="element_toolbar"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_up.png" title="Move the field to the upper page" onclick="page_up(&quot;'.$id.'&quot;)"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_down.png" title="Move the field to the lower page" onclick="page_down(&quot;'.$id.'&quot;)"></div></div>';
162
  break;
163
  }
164
 
165
  default :
166
  {
167
- $arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" ><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png" title="Remove the field" onclick="remove_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;delete_el&quot;)" onmouseout="chnage_icons_src(this,&quot;delete_el&quot;)"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/left.png" title="Move the field to the left" onclick="left_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;left&quot;)" onmouseout="chnage_icons_src(this,&quot;left&quot;)"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/up.png" title="Move the field up" onclick="up_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;up&quot;)" onmouseout="chnage_icons_src(this,&quot;up&quot;)"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/down.png" title="Move the field down" onclick="down_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;down&quot;)" onmouseout="chnage_icons_src(this,&quot;down&quot;)"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/right.png" title="Move the field to the right" onclick="right_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;right&quot;)" onmouseout="chnage_icons_src(this,&quot;right&quot;)"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png" title="Edit the field" onclick="edit(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;edit&quot;)" onmouseout="chnage_icons_src(this,&quot;edit&quot;)"></div><div id="dublicate_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/dublicate.png" title="Dublicate the field" onclick="dublicate(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;dublicate&quot;)" onmouseout="chnage_icons_src(this,&quot;dublicate&quot;)"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_up.png" title="Move the field to the upper page" onclick="page_up(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;page_up&quot;)" onmouseout="chnage_icons_src(this,&quot;page_up&quot;)"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_down.png" title="Move the field to the lower page" onclick="page_down(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;page_down&quot;)" onmouseout="chnage_icons_src(this,&quot;page_down&quot;)"></div></div>';
168
  break;
169
  }
170
 
@@ -213,7 +212,7 @@ class FMModelManage_fm {
213
  $rep ='<div id="wdform_field'.$id.'" type="type_send_copy" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" style="display: '.$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'].' disabled /></div></div>';
214
  break;
215
  }
216
- case 'type_text': {
217
  $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique');
218
  $temp = $params;
219
  if(strpos($temp, 'w_regExp_status') > -1)
@@ -245,7 +244,7 @@ class FMModelManage_fm {
245
 
246
  break;
247
  }
248
- case 'type_number': {
249
  $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique', 'w_class');
250
  $temp = $params;
251
  foreach ($params_names as $params_name) {
@@ -331,7 +330,7 @@ class FMModelManage_fm {
331
  $rep ='<div id="wdform_field'.$id.'" type="type_phone" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$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'].' disabled /><span class="wdform_line" style="margin: 0px 4px; padding: 0px;">-</span></div><div id="'.$id.'_td_name_input_last" style="display: table-cell;"><input type="text" class="'.$input_active.'" id="'.$id.'_element_lastform_id_temp" name="'.$id.'_element_lastform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'" onfocus="delete_value(&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'].' disabled /></div></div><div id="'.$id.'_tr_name2" style="display: table-row;"><div id="'.$id.'_td_name_label_first" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_area_code">'.$w_mini_labels[0].'</label></div><div id="'.$id.'_td_name_label_last" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_phone_number">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
332
  break;
333
  }
334
- case 'type_name': {
335
  $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');
336
  $temp = $params;
337
  if(strpos($temp, 'w_name_fields') > -1)
@@ -373,7 +372,7 @@ class FMModelManage_fm {
373
  $rep ='<div id="wdform_field'.$id.'" type="type_name" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$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"><input type="hidden" name="'.$id.'_enable_fieldsform_id_temp" id="'.$id.'_enable_fieldsform_id_temp" title="'.$w_name_fields[0].'" first="yes" last="yes" middle="'.$w_name_fields[1].'"><div id="'.$id.'_table_name" cellpadding="0" cellspacing="0" style="display: table;"><div id="'.$id.'_tr_name1" style="display: table-row;">'.$w_name_format.'</div><div id="'.$id.'_tr_name2" style="display: table-row;">'.$w_name_format_mini_labels.'</div></div></div></div>';
374
  break;
375
  }
376
- case 'type_address': {
377
  $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_mini_labels', 'w_disabled_fields', 'w_required', 'w_class');
378
  $temp = $params;
379
  foreach ($params_names as $params_name) {
@@ -427,24 +426,22 @@ class FMModelManage_fm {
427
  if($w_disabled_fields[5]=='yes' && $w_disabled_fields[6]=='yes')
428
  $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'].' disabled ><option value=""></option><option value="Alabama">Alabama</option><option value="Alaska">Alaska</option><option value="Arizona">Arizona</option><option value="Arkansas">Arkansas</option><option value="California">California</option><option value="Colorado">Colorado</option><option value="Connecticut">Connecticut</option><option value="Delaware">Delaware</option><option value="Florida">Florida</option><option value="Georgia">Georgia</option><option value="Hawaii">Hawaii</option><option value="Idaho">Idaho</option><option value="Illinois">Illinois</option><option value="Indiana">Indiana</option><option value="Iowa">Iowa</option><option value="Kansas">Kansas</option><option value="Kentucky">Kentucky</option><option value="Louisiana">Louisiana</option><option value="Maine">Maine</option><option value="Maryland">Maryland</option><option value="Massachusetts">Massachusetts</option><option value="Michigan">Michigan</option><option value="Minnesota">Minnesota</option><option value="Mississippi">Mississippi</option><option value="Missouri">Missouri</option><option value="Montana">Montana</option><option value="Nebraska">Nebraska</option><option value="Nevada">Nevada</option><option value="New Hampshire">New Hampshire</option><option value="New Jersey">New Jersey</option><option value="New Mexico">New Mexico</option><option value="New York">New York</option><option value="North Carolina">North Carolina</option><option value="North Dakota">North Dakota</option><option value="Ohio">Ohio</option><option value="Oklahoma">Oklahoma</option><option value="Oregon">Oregon</option><option value="Pennsylvania">Pennsylvania</option><option value="Rhode Island">Rhode Island</option><option value="South Carolina">South Carolina</option><option value="South Dakota">South Dakota</option><option value="Tennessee">Tennessee</option><option value="Texas">Texas</option><option value="Utah">Utah</option><option value="Vermont">Vermont</option><option value="Virginia">Virginia</option><option value="Washington">Washington</option><option value="West Virginia">West Virginia</option><option value="Wisconsin">Wisconsin</option><option value="Wyoming">Wyoming</option></select><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_state">'.$w_mini_labels[3].'</label></span>';
429
  else
430
- $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>';
431
  }
432
 
433
  if($w_disabled_fields[4]=='no')
434
  {
435
  $g++;
436
- $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>';
437
  }
438
 
439
  if($w_disabled_fields[5]=='no')
440
  {
441
  $g++;
442
- $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="Colombia">Colombia</option><option value="Comoros">Comoros</option><option value="Congo (Brazzaville)">Congo (Brazzaville)</option><option value="Congo">Congo</option><option value="Costa Rica">Costa Rica</option><option value="Cote d\'Ivoire">Cote d\'Ivoire</option><option value="Croatia">Croatia</option><option value="Cuba">Cuba</option><option value="Cyprus">Cyprus</option><option value="Czech Republic">Czech Republic</option><option value="Denmark">Denmark</option><option value="Djibouti">Djibouti</option><option value="Dominica">Dominica</option><option value="Dominican Republic">Dominican Republic</option><option value="East Timor (Timor Timur)">East Timor (Timor Timur)</option><option value="Ecuador">Ecuador</option><option value="Egypt">Egypt</option><option value="El Salvador">El Salvador</option><option value="Equatorial Guinea">Equatorial Guinea</option><option value="Eritrea">Eritrea</option><option value="Estonia">Estonia</option><option value="Ethiopia">Ethiopia</option><option value="Fiji">Fiji</option><option value="Finland">Finland</option><option value="France">France</option><option value="Gabon">Gabon</option><option value="Gambia, The">Gambia, The</option><option value="Georgia">Georgia</option><option value="Germany">Germany</option><option value="Ghana">Ghana</option><option value="Greece">Greece</option><option value="Grenada">Grenada</option><option value="Guatemala">Guatemala</option><option value="Guinea">Guinea</option><option value="Guinea-Bissau">Guinea-Bissau</option><option value="Guyana">Guyana</option><option value="Haiti">Haiti</option><option value="Honduras">Honduras</option><option value="Hungary">Hungary</option><option value="Iceland">Iceland</option><option value="India">India</option><option value="Indonesia">Indonesia</option><option value="Iran">Iran</option><option value="Iraq">Iraq</option><option value="Ireland">Ireland</option><option value="Israel">Israel</option><option value="Italy">Italy</option><option value="Jamaica">Jamaica</option><option value="Japan">Japan</option><option value="Jordan">Jordan</option><option value="Kazakhstan">Kazakhstan</option><option value="Kenya">Kenya</option><option va
443
- lue="Kiribati">Kiribati</option><option value="Korea, North">Korea, North</option><option value="Korea, South">Korea, South</option><option value="Kuwait">Kuwait</option><option value="Kyrgyzstan">Kyrgyzstan</option><option value="Laos">Laos</option><option value="Latvia">Latvia</option><option value="Lebanon">Lebanon</option><option value="Lesotho">Lesotho</option><option value="Liberia">Liberia</option><option value="Libya">Libya</option><option value="Liechtenstein">Liechtenstein</option><option value="Lithuania">Lithuania</option><option value="Luxembourg">Luxembourg</option><option value="Macedonia">Macedonia</option><option value="Madagascar">Madagascar</option><option value="Malawi">Malawi</option><option value="Malaysia">Malaysia</option><option value="Maldives">Maldives</option><option value="Mali">Mali</option><option value="Malta">Malta</option><option value="Marshall Islands">Marshall Islands</option><option value="Mauritania">Mauritania</option><option value="Mauritius">Mauritius</option><option value="Mexico">Mexico</option><option value="Micronesia">Micronesia</option><option value="Moldova">Moldova</option><option value="Monaco">Monaco</option><option value="Mongolia">Mongolia</option><option value="Morocco">Morocco</option><option value="Mozambique">Mozambique</option><option value="Myanmar">Myanmar</option><option value="Namibia">Namibia</option><option value="Nauru">Nauru</option><option value="Nepal">Nepal</option><option value="Netherlands">Netherlands</option><option value="New Zealand">New Zealand</option><option value="Nicaragua">Nicaragua</option><option value="Niger">Niger</option><option value="Nigeria">Nigeria</option><option value="Norway">Norway</option><option value="Oman">Oman</option><option value="Pakistan">Pakistan</option><option value="Palau">Palau</option><option value="Panama">Panama</option><option value="Papua New Guinea">Papua New Guinea</option><option value="Paraguay">Paraguay</option><option value="Peru">Peru</option><option value="Philippines">Philippines</option><option value="Poland">Poland</option><option value="Portugal">Portugal</option><option value="Qatar">Qatar</option><option value="Romania">Romania</option><option value="Russia">Russia</option><option value="Rwanda">Rwanda</option><option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option><option value="Saint Lucia">Saint Lucia</option><option value="Saint Vincent">Saint Vincent</option><option value="Samoa">Samoa</option><option value="San Marino">San Marino</option><option value="Sao Tome and Principe">Sao Tome and Principe</option><option value="Saudi Arabia">Saudi Arabia</option><option value="Senegal">Senegal</option><option value="Serbia and Montenegro">Serbia and Montenegro</option><option value="Seychelles">Seychelles</option><option value="Sierra Leone">Sierra Leone</option><option value="Singapore">Singapore</option><option value="Slovakia">Slovakia</option><option value="Slovenia">Slovenia</option><option value="Solomon Islands">Solomon Islands</option><option value="Somalia">Somalia</option><option value="South Africa">South Africa</option><option value="Spain">Spain</option><option value="Sri Lanka">Sri Lanka</option><option value="Sudan">Sudan</option><option value="Suriname">Suriname</option><option value="Swaziland">Swaziland</option><option value="Sweden">Sweden</option><option value="Switzerland">Switzerland</option><option value="Syria">Syria</option><option value="Taiwan">Taiwan</option><option value="Tajikistan">Tajikistan</option><option value="Tanzania">Tanzania</option><option value="Thailand">Thailand</option><option value="Togo">Togo</option><option value="Tonga">Tonga</option><option value="Trinidad and Tobago">Trinidad and Tobago</option><option value="Tunisia">Tunisia</option><option value="Turkey">Turkey</option><option value="Turkmenistan">Turkmenistan</option><option value="Tuvalu">Tuvalu</option><option value="Uganda">Uganda</option><option value="Ukraine">Ukraine</option><option value="United Arab Emirates">United Arab Emirates</option><option value="United Kingdom">United Ki
444
- ngdom</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>';
445
  }
446
 
447
- $rep ='<div id="wdform_field'.$id.'" type="type_address" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$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="'.$w_disabled_fields[0].'" street2="'.$w_disabled_fields[1].'" city="'.$w_disabled_fields[2].'" state="'.$w_disabled_fields[3].'" postal="'.$w_disabled_fields[4].'" country="'.$w_disabled_fields[5].'" us_states="'.$w_disabled_fields[6].'"><div id="'.$id.'_div_address" style="width: '.$param['w_size'].'px;">'.$address_fields.$hidden_inputs.'</div></div></div>';
448
  break;
449
  }
450
  case 'type_submitter_mail': {
@@ -821,7 +818,7 @@ ngdom</option><option value="United States">United States</option><option value=
821
 
822
  $rep.='</div>';
823
  }
824
-
825
  if(count($param['w_choices'])%$param['w_rowcol']!=0)
826
  {
827
  $rep.='<div id="'.$id.'_element_tr'.((int)(count($param['w_choices'])/(int)$param['w_rowcol'])).'" style="display: table-row;">';
@@ -1031,7 +1028,7 @@ ngdom</option><option value="United States">United States</option><option value=
1031
 
1032
  break;
1033
  }
1034
- case 'type_date':
1035
  {
1036
  $params_names=array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val');
1037
  $temp = $params;
@@ -1057,7 +1054,7 @@ ngdom</option><option value="United States">United States</option><option value=
1057
  $param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
1058
  $disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
1059
 
1060
- $rep ='<div id="wdform_field'.$id.'" type="type_date" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_date" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_disable_past_days'].'" name="'.$id.'_dis_past_daysform_id_temp" id="'.$id.'_dis_past_daysform_id_temp"><input type="text" value="'.$param['w_date'].'" class="wdform-date" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" maxlength="10" size="10" onchange="change_value(&quot;'.$id.'_elementform_id_temp&quot;)" '.$param['attributes'].' disabled/><input id="'.$id.'_buttonform_id_temp" class="button" type="reset" value="'.$param['w_but_val'].'" format="'.$param['w_format'].'" src="templates/bluestork/images/system/calendar.png" alt="calendario" '.$param['attributes'].' onclick="return showCalendar(&quot;'.$id.'_elementform_id_temp&quot; , &quot;'.$param['w_format'].'&quot;, '.$disable_past_days.')"></div></div>';
1061
 
1062
  break;
1063
  }
@@ -1218,7 +1215,7 @@ ngdom</option><option value="United States">United States</option><option value=
1218
 
1219
  break;
1220
  }
1221
- case 'type_arithmetic_captcha':
1222
  {
1223
  $params_names=array('w_field_label_size','w_field_label_pos', 'w_count', 'w_operations','w_class', 'w_input_size');
1224
  $temp=$params;
@@ -1248,7 +1245,7 @@ ngdom</option><option value="United States">United States</option><option value=
1248
  }
1249
 
1250
 
1251
- case 'type_recaptcha':
1252
  {
1253
  $params_names=array('w_field_label_size','w_field_label_pos','w_public','w_private','w_theme','w_class');
1254
  $temp=$params;
@@ -1851,7 +1848,7 @@ ngdom</option><option value="United States">United States</option><option value=
1851
  $images = '';
1852
  for($i=0; $i<$param['w_star_amount']; $i++)
1853
  {
1854
- $images .= '<img id="'.$id.'_star_'.$i.'" src="' . WD_FM_URL . '/images/star.png" onmouseover="change_src('.$i.','.$id.',&quot;form_id_temp&quot;)" onmouseout="reset_src('.$i.','.$id.')" onclick="select_star_rating('.$i.','.$id.', &quot;form_id_temp&quot;)">';
1855
  }
1856
 
1857
  $rep ='<div id="wdform_field'.$id.'" type="type_star_rating" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$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>';
@@ -1988,7 +1985,7 @@ ngdom</option><option value="United States">United States</option><option value=
1988
 
1989
  break;
1990
  }
1991
- case 'type_matrix': {
1992
  $params_names=array('w_field_label_size','w_field_label_pos', 'w_field_input_type', 'w_rows', 'w_columns', 'w_required','w_class','w_textbox_size');
1993
  $temp = $params;
1994
  foreach ($params_names as $params_name) {
@@ -2044,7 +2041,7 @@ ngdom</option><option value="United States">United States</option><option value=
2044
 
2045
  break;
2046
  }
2047
- case 'type_submit_reset': {
2048
  $params_names=array('w_submit_title','w_reset_title','w_class','w_act');
2049
  $temp=$params;
2050
  foreach ($params_names as $params_name) {
@@ -2103,7 +2100,7 @@ ngdom</option><option value="United States">United States</option><option value=
2103
  $row->mail = '';
2104
  $row->form = '';
2105
  $row->form_front = '';
2106
- $row->theme = 0;
2107
  $row->javascript = '';
2108
  $row->submit_text = '';
2109
  $row->url = '';
@@ -2144,6 +2141,7 @@ ngdom</option><option value="United States">United States</option><option value=
2144
  $row->mail_from_user = '';
2145
  $row->mail_from_name_user = '';
2146
  $row->reply_to_user = '';
 
2147
 
2148
  $row->condition = '';
2149
  $row->mail_cc = '';
@@ -2191,8 +2189,7 @@ ngdom</option><option value="United States">United States</option><option value=
2191
 
2192
  public function page_nav() {
2193
  global $wpdb;
2194
- $where = 'WHERE `id` NOT IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')';
2195
- $where .= ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? ' AND title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
2196
  $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker " . $where;
2197
  $total = $wpdb->get_var($query);
2198
  $page_nav['total'] = $total;
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']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
25
  $order_by_array = array('id', 'title', 'mail');
26
  $order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
 
27
  $order_by = ' ORDER BY `' . $order_by . '` ' . $asc_or_desc;
28
  if (isset($_POST['page_number']) && $_POST['page_number']) {
29
  $limit = ((int) $_POST['page_number'] - 1) * 20;
89
  $row->mail_from_user = '';
90
  $row->mail_from_name_user = '';
91
  $row->reply_to_user = '';
92
+ $row->save_uploads = 1;
93
  }
94
  return $row;
95
  }
143
  {
144
  case 'type_section_break':
145
  {
146
+ $arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" ><div id="X_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png?ver='. get_option("wd_form_maker_version").'" title="Remove the field" onclick="remove_section_break(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;delete_el&quot;)" onmouseout="chnage_icons_src(this,&quot;delete_el&quot;)"></div><div id="edit_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png?ver='. get_option("wd_form_maker_version").'" 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;)"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">custom_'.$id.'</span></div><div id="duplicate_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/duplicate.png?ver='. get_option("wd_form_maker_version").'" title="Duplicate the field" onclick="duplicate(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;duplicate&quot;)" onmouseout="chnage_icons_src(this,&quot;duplicate&quot;)"></div></div>';
147
  break;
148
  }
149
  case 'type_editor':
150
  {
151
+ $arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" type="type_editor" style="margin-top:0px;"><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png?ver='. get_option("wd_form_maker_version").'" title="Remove the field" onclick="remove_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;delete_el&quot;)" onmouseout="chnage_icons_src(this,&quot;delete_el&quot;)"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/left.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the left" onclick="left_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;left&quot;)" onmouseout="chnage_icons_src(this,&quot;left&quot;)"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/up.png?ver='. get_option("wd_form_maker_version").'" title="Move the field up" onclick="up_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;up&quot;)" onmouseout="chnage_icons_src(this,&quot;up&quot;)"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/down.png?ver='. get_option("wd_form_maker_version").'" title="Move the field down" onclick="down_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;down&quot;)" onmouseout="chnage_icons_src(this,&quot;down&quot;)"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/right.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the right" onclick="right_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;right&quot;)" onmouseout="chnage_icons_src(this,&quot;right&quot;)"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png?ver='. get_option("wd_form_maker_version").'" 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="duplicate_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/duplicate.png?ver='. get_option("wd_form_maker_version").'" title="Duplicate the field" onclick="duplicate(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;duplicate&quot;)" onmouseout="chnage_icons_src(this,&quot;duplicate&quot;)"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_up.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the upper page" onclick="page_up(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;page_up&quot;)" onmouseout="chnage_icons_src(this,&quot;page_up&quot;)"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_down.png?ver='. get_option("wd_form_maker_version").'" 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>';
152
  break;
153
  }
154
 
157
  case 'type_arithmetic_captcha':
158
  case 'type_recaptcha':
159
  {
160
+ $arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows"><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png?ver='. get_option("wd_form_maker_version").'" title="Remove the field" onclick="remove_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;delete_el&quot;)" onmouseout="chnage_icons_src(this,&quot;delete_el&quot;)"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/left.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the left" onclick="left_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;left&quot;)" onmouseout="chnage_icons_src(this,&quot;left&quot;)"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/up.png?ver='. get_option("wd_form_maker_version").'" title="Move the field up" onclick="up_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;up&quot;)" onmouseout="chnage_icons_src(this,&quot;up&quot;)"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/down.png?ver='. get_option("wd_form_maker_version").'" title="Move the field down" onclick="down_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;down&quot;)" onmouseout="chnage_icons_src(this,&quot;down&quot;)"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/right.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the right" onclick="right_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;right&quot;)" onmouseout="chnage_icons_src(this,&quot;right&quot;)"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png?ver='. get_option("wd_form_maker_version").'" 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="duplicate_'.$id.'" valign="middle" class="element_toolbar"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_up.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the upper page" onclick="page_up(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;page_up&quot;)" onmouseout="chnage_icons_src(this,&quot;page_up&quot;)"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_down.png?ver='. get_option("wd_form_maker_version").'" 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>';
161
  break;
162
  }
163
 
164
  default :
165
  {
166
+ $arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" ><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png?ver='. get_option("wd_form_maker_version").'" title="Remove the field" onclick="remove_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;delete_el&quot;)" onmouseout="chnage_icons_src(this,&quot;delete_el&quot;)"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/left.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the left" onclick="left_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;left&quot;)" onmouseout="chnage_icons_src(this,&quot;left&quot;)"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/up.png?ver='. get_option("wd_form_maker_version").'" title="Move the field up" onclick="up_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;up&quot;)" onmouseout="chnage_icons_src(this,&quot;up&quot;)"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/down.png?ver='. get_option("wd_form_maker_version").'" title="Move the field down" onclick="down_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;down&quot;)" onmouseout="chnage_icons_src(this,&quot;down&quot;)"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/right.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the right" onclick="right_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;right&quot;)" onmouseout="chnage_icons_src(this,&quot;right&quot;)"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png?ver='. get_option("wd_form_maker_version").'" 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="duplicate_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/duplicate.png?ver='. get_option("wd_form_maker_version").'" title="Duplicate the field" onclick="duplicate(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;duplicate&quot;)" onmouseout="chnage_icons_src(this,&quot;duplicate&quot;)"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_up.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the upper page" onclick="page_up(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;page_up&quot;)" onmouseout="chnage_icons_src(this,&quot;page_up&quot;)"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_down.png?ver='. get_option("wd_form_maker_version").'" 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>';
167
  break;
168
  }
169
 
212
  $rep ='<div id="wdform_field'.$id.'" type="type_send_copy" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" style="display: '.$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'].' disabled /></div></div>';
213
  break;
214
  }
215
+ case 'type_text': {
216
  $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique');
217
  $temp = $params;
218
  if(strpos($temp, 'w_regExp_status') > -1)
244
 
245
  break;
246
  }
247
+ case 'type_number': {
248
  $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique', 'w_class');
249
  $temp = $params;
250
  foreach ($params_names as $params_name) {
330
  $rep ='<div id="wdform_field'.$id.'" type="type_phone" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$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'].' disabled /><span class="wdform_line" style="margin: 0px 4px; padding: 0px;">-</span></div><div id="'.$id.'_td_name_input_last" style="display: table-cell;"><input type="text" class="'.$input_active.'" id="'.$id.'_element_lastform_id_temp" name="'.$id.'_element_lastform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'" onfocus="delete_value(&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'].' disabled /></div></div><div id="'.$id.'_tr_name2" style="display: table-row;"><div id="'.$id.'_td_name_label_first" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_area_code">'.$w_mini_labels[0].'</label></div><div id="'.$id.'_td_name_label_last" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_phone_number">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
331
  break;
332
  }
333
+ case 'type_name': {
334
  $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');
335
  $temp = $params;
336
  if(strpos($temp, 'w_name_fields') > -1)
372
  $rep ='<div id="wdform_field'.$id.'" type="type_name" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$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"><input type="hidden" name="'.$id.'_enable_fieldsform_id_temp" id="'.$id.'_enable_fieldsform_id_temp" title="'.$w_name_fields[0].'" first="yes" last="yes" middle="'.$w_name_fields[1].'"><div id="'.$id.'_table_name" cellpadding="0" cellspacing="0" style="display: table;"><div id="'.$id.'_tr_name1" style="display: table-row;">'.$w_name_format.'</div><div id="'.$id.'_tr_name2" style="display: table-row;">'.$w_name_format_mini_labels.'</div></div></div></div>';
373
  break;
374
  }
375
+ case 'type_address': {
376
  $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_mini_labels', 'w_disabled_fields', 'w_required', 'w_class');
377
  $temp = $params;
378
  foreach ($params_names as $params_name) {
426
  if($w_disabled_fields[5]=='yes' && $w_disabled_fields[6]=='yes')
427
  $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'].' disabled ><option value=""></option><option value="Alabama">Alabama</option><option value="Alaska">Alaska</option><option value="Arizona">Arizona</option><option value="Arkansas">Arkansas</option><option value="California">California</option><option value="Colorado">Colorado</option><option value="Connecticut">Connecticut</option><option value="Delaware">Delaware</option><option value="Florida">Florida</option><option value="Georgia">Georgia</option><option value="Hawaii">Hawaii</option><option value="Idaho">Idaho</option><option value="Illinois">Illinois</option><option value="Indiana">Indiana</option><option value="Iowa">Iowa</option><option value="Kansas">Kansas</option><option value="Kentucky">Kentucky</option><option value="Louisiana">Louisiana</option><option value="Maine">Maine</option><option value="Maryland">Maryland</option><option value="Massachusetts">Massachusetts</option><option value="Michigan">Michigan</option><option value="Minnesota">Minnesota</option><option value="Mississippi">Mississippi</option><option value="Missouri">Missouri</option><option value="Montana">Montana</option><option value="Nebraska">Nebraska</option><option value="Nevada">Nevada</option><option value="New Hampshire">New Hampshire</option><option value="New Jersey">New Jersey</option><option value="New Mexico">New Mexico</option><option value="New York">New York</option><option value="North Carolina">North Carolina</option><option value="North Dakota">North Dakota</option><option value="Ohio">Ohio</option><option value="Oklahoma">Oklahoma</option><option value="Oregon">Oregon</option><option value="Pennsylvania">Pennsylvania</option><option value="Rhode Island">Rhode Island</option><option value="South Carolina">South Carolina</option><option value="South Dakota">South Dakota</option><option value="Tennessee">Tennessee</option><option value="Texas">Texas</option><option value="Utah">Utah</option><option value="Vermont">Vermont</option><option value="Virginia">Virginia</option><option value="Washington">Washington</option><option value="West Virginia">West Virginia</option><option value="Wisconsin">Wisconsin</option><option value="Wyoming">Wyoming</option></select><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_state">'.$w_mini_labels[3].'</label></span>';
428
  else
429
+ $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'].' disabled><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_state">'.$w_mini_labels[3].'</label></span>';
430
  }
431
 
432
  if($w_disabled_fields[4]=='no')
433
  {
434
  $g++;
435
+ $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'].' disabled><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_postal">'.$w_mini_labels[4].'</label></span>';
436
  }
437
 
438
  if($w_disabled_fields[5]=='no')
439
  {
440
  $g++;
441
+ $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'].' disabled><option value=""></option><option value="Afghanistan">Afghanistan</option><option value="Albania">Albania</option><option value="Algeria">Algeria</option><option value="Andorra">Andorra</option><option value="Angola">Angola</option><option value="Antigua and Barbuda">Antigua and Barbuda</option><option value="Argentina">Argentina</option><option value="Armenia">Armenia</option><option value="Australia">Australia</option><option value="Austria">Austria</option><option value="Azerbaijan">Azerbaijan</option><option value="Bahamas">Bahamas</option><option value="Bahrain">Bahrain</option><option value="Bangladesh">Bangladesh</option><option value="Barbados">Barbados</option><option value="Belarus">Belarus</option><option value="Belgium">Belgium</option><option value="Belize">Belize</option><option value="Benin">Benin</option><option value="Bhutan">Bhutan</option><option value="Bolivia">Bolivia</option><option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option><option value="Botswana">Botswana</option><option value="Brazil">Brazil</option><option value="Brunei">Brunei</option><option value="Bulgaria">Bulgaria</option><option value="Burkina Faso">Burkina Faso</option><option value="Burundi">Burundi</option><option value="Cambodia">Cambodia</option><option value="Cameroon">Cameroon</option><option value="Canada">Canada</option><option value="Cape Verde">Cape Verde</option><option value="Central African Republic">Central African Republic</option><option value="Chad">Chad</option><option value="Chile">Chile</option><option value="China">China</option><option value="Colombia">Colombia</option><option value="Comoros">Comoros</option><option value="Congo (Brazzaville)">Congo (Brazzaville)</option><option value="Congo">Congo</option><option value="Costa Rica">Costa Rica</option><option value="Cote d\'Ivoire">Cote d\'Ivoire</option><option value="Croatia">Croatia</option><option value="Cuba">Cuba</option><option value="Cyprus">Cyprus</option><option value="Czech Republic">Czech Republic</option><option value="Denmark">Denmark</option><option value="Djibouti">Djibouti</option><option value="Dominica">Dominica</option><option value="Dominican Republic">Dominican Republic</option><option value="East Timor (Timor Timur)">East Timor (Timor Timur)</option><option value="Ecuador">Ecuador</option><option value="Egypt">Egypt</option><option value="El Salvador">El Salvador</option><option value="Equatorial Guinea">Equatorial Guinea</option><option value="Eritrea">Eritrea</option><option value="Estonia">Estonia</option><option value="Ethiopia">Ethiopia</option><option value="Fiji">Fiji</option><option value="Finland">Finland</option><option value="France">France</option><option value="Gabon">Gabon</option><option value="Gambia, The">Gambia, The</option><option value="Georgia">Georgia</option><option value="Germany">Germany</option><option value="Ghana">Ghana</option><option value="Greece">Greece</option><option value="Grenada">Grenada</option><option value="Guatemala">Guatemala</option><option value="Guinea">Guinea</option><option value="Guinea-Bissau">Guinea-Bissau</option><option value="Guyana">Guyana</option><option value="Haiti">Haiti</option><option value="Honduras">Honduras</option><option value="Hungary">Hungary</option><option value="Iceland">Iceland</option><option value="India">India</option><option value="Indonesia">Indonesia</option><option value="Iran">Iran</option><option value="Iraq">Iraq</option><option value="Ireland">Ireland</option><option value="Israel">Israel</option><option value="Italy">Italy</option><option value="Jamaica">Jamaica</option><option value="Japan">Japan</option><option value="Jordan">Jordan</option><option value="Kazakhstan">Kazakhstan</option><option value="Kenya">Kenya</option><option value="Kiribati">Kiribati</option><option value="Korea, North">Korea, North</option><option value="Korea, South">Korea, South</option><option value="Kuwait">Kuwait</option><option value="Kyrgyzstan">Kyrgyzstan</option><option value="Laos">Laos</option><option value="Latvia">Latvia</option><option value="Lebanon">Lebanon</option><option value="Lesotho">Lesotho</option><option value="Liberia">Liberia</option><option value="Libya">Libya</option><option value="Liechtenstein">Liechtenstein</option><option value="Lithuania">Lithuania</option><option value="Luxembourg">Luxembourg</option><option value="Macedonia">Macedonia</option><option value="Madagascar">Madagascar</option><option value="Malawi">Malawi</option><option value="Malaysia">Malaysia</option><option value="Maldives">Maldives</option><option value="Mali">Mali</option><option value="Malta">Malta</option><option value="Marshall Islands">Marshall Islands</option><option value="Mauritania">Mauritania</option><option value="Mauritius">Mauritius</option><option value="Mexico">Mexico</option><option value="Micronesia">Micronesia</option><option value="Moldova">Moldova</option><option value="Monaco">Monaco</option><option value="Mongolia">Mongolia</option><option value="Morocco">Morocco</option><option value="Mozambique">Mozambique</option><option value="Myanmar">Myanmar</option><option value="Namibia">Namibia</option><option value="Nauru">Nauru</option><option value="Nepal">Nepal</option><option value="Netherlands">Netherlands</option><option value="New Zealand">New Zealand</option><option value="Nicaragua">Nicaragua</option><option value="Niger">Niger</option><option value="Nigeria">Nigeria</option><option value="Norway">Norway</option><option value="Oman">Oman</option><option value="Pakistan">Pakistan</option><option value="Palau">Palau</option><option value="Panama">Panama</option><option value="Papua New Guinea">Papua New Guinea</option><option value="Paraguay">Paraguay</option><option value="Peru">Peru</option><option value="Philippines">Philippines</option><option value="Poland">Poland</option><option value="Portugal">Portugal</option><option value="Qatar">Qatar</option><option value="Romania">Romania</option><option value="Russia">Russia</option><option value="Rwanda">Rwanda</option><option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option><option value="Saint Lucia">Saint Lucia</option><option value="Saint Vincent">Saint Vincent</option><option value="Samoa">Samoa</option><option value="San Marino">San Marino</option><option value="Sao Tome and Principe">Sao Tome and Principe</option><option value="Saudi Arabia">Saudi Arabia</option><option value="Senegal">Senegal</option><option value="Serbia and Montenegro">Serbia and Montenegro</option><option value="Seychelles">Seychelles</option><option value="Sierra Leone">Sierra Leone</option><option value="Singapore">Singapore</option><option value="Slovakia">Slovakia</option><option value="Slovenia">Slovenia</option><option value="Solomon Islands">Solomon Islands</option><option value="Somalia">Somalia</option><option value="South Africa">South Africa</option><option value="Spain">Spain</option><option value="Sri Lanka">Sri Lanka</option><option value="Sudan">Sudan</option><option value="Suriname">Suriname</option><option value="Swaziland">Swaziland</option><option value="Sweden">Sweden</option><option value="Switzerland">Switzerland</option><option value="Syria">Syria</option><option value="Taiwan">Taiwan</option><option value="Tajikistan">Tajikistan</option><option value="Tanzania">Tanzania</option><option value="Thailand">Thailand</option><option value="Togo">Togo</option><option value="Tonga">Tonga</option><option value="Trinidad and Tobago">Trinidad and Tobago</option><option value="Tunisia">Tunisia</option><option value="Turkey">Turkey</option><option value="Turkmenistan">Turkmenistan</option><option value="Tuvalu">Tuvalu</option><option value="Uganda">Uganda</option><option value="Ukraine">Ukraine</option><option value="United Arab Emirates">United Arab Emirates</option><option value="United Kingdom">United Kingdom</option><option value="United States">United States</option><option value="Uruguay">Uruguay</option><option value="Uzbekistan">Uzbekistan</option><option value="Vanuatu">Vanuatu</option><option value="Vatican City">Vatican City</option><option value="Venezuela">Venezuela</option><option value="Vietnam">Vietnam</option><option value="Yemen">Yemen</option><option value="Zambia">Zambia</option><option value="Zimbabwe">Zimbabwe</option></select><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_country">'.$w_mini_labels[5].'</span>';
 
 
442
  }
443
 
444
+ $rep ='<div id="wdform_field'.$id.'" type="type_address" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$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: '.$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="'.$w_disabled_fields[0].'" street2="'.$w_disabled_fields[1].'" city="'.$w_disabled_fields[2].'" state="'.$w_disabled_fields[3].'" postal="'.$w_disabled_fields[4].'" country="'.$w_disabled_fields[5].'" us_states="'.$w_disabled_fields[6].'"><div id="'.$id.'_div_address" style="width: '.$param['w_size'].'px;">'.$address_fields.$hidden_inputs.'</div></div></div>';
445
  break;
446
  }
447
  case 'type_submitter_mail': {
818
 
819
  $rep.='</div>';
820
  }
821
+
822
  if(count($param['w_choices'])%$param['w_rowcol']!=0)
823
  {
824
  $rep.='<div id="'.$id.'_element_tr'.((int)(count($param['w_choices'])/(int)$param['w_rowcol'])).'" style="display: table-row;">';
1028
 
1029
  break;
1030
  }
1031
+ case 'type_date':
1032
  {
1033
  $params_names=array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val');
1034
  $temp = $params;
1054
  $param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
1055
  $disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
1056
 
1057
+ $rep ='<div id="wdform_field'.$id.'" type="type_date" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_date" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_disable_past_days'].'" name="'.$id.'_dis_past_daysform_id_temp" id="'.$id.'_dis_past_daysform_id_temp"><input type="text" value="'.$param['w_date'].'" class="wdform-date" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" maxlength="10" size="10" onchange="change_value(&quot;'.$id.'_elementform_id_temp&quot;)" '.$param['attributes'].' disabled/><input id="'.$id.'_buttonform_id_temp" class="button" type="reset" value="'.$param['w_but_val'].'" format="'.$param['w_format'].'" src="templates/bluestork/images/system/calendar.png?ver='. get_option("wd_form_maker_version").'" alt="calendario" '.$param['attributes'].' onclick="return showCalendar(&quot;'.$id.'_elementform_id_temp&quot; , &quot;'.$param['w_format'].'&quot;, '.$disable_past_days.')"></div></div>';
1058
 
1059
  break;
1060
  }
1215
 
1216
  break;
1217
  }
1218
+ case 'type_arithmetic_captcha':
1219
  {
1220
  $params_names=array('w_field_label_size','w_field_label_pos', 'w_count', 'w_operations','w_class', 'w_input_size');
1221
  $temp=$params;
1245
  }
1246
 
1247
 
1248
+ case 'type_recaptcha':
1249
  {
1250
  $params_names=array('w_field_label_size','w_field_label_pos','w_public','w_private','w_theme','w_class');
1251
  $temp=$params;
1848
  $images = '';
1849
  for($i=0; $i<$param['w_star_amount']; $i++)
1850
  {
1851
+ $images .= '<img id="'.$id.'_star_'.$i.'" src="' . WD_FM_URL . '/images/star.png?ver='. get_option("wd_form_maker_version").'" 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;)">';
1852
  }
1853
 
1854
  $rep ='<div id="wdform_field'.$id.'" type="type_star_rating" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$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>';
1985
 
1986
  break;
1987
  }
1988
+ case 'type_matrix': {
1989
  $params_names=array('w_field_label_size','w_field_label_pos', 'w_field_input_type', 'w_rows', 'w_columns', 'w_required','w_class','w_textbox_size');
1990
  $temp = $params;
1991
  foreach ($params_names as $params_name) {
2041
 
2042
  break;
2043
  }
2044
+ case 'type_submit_reset': {
2045
  $params_names=array('w_submit_title','w_reset_title','w_class','w_act');
2046
  $temp=$params;
2047
  foreach ($params_names as $params_name) {
2100
  $row->mail = '';
2101
  $row->form = '';
2102
  $row->form_front = '';
2103
+ $row->theme = $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'");
2104
  $row->javascript = '';
2105
  $row->submit_text = '';
2106
  $row->url = '';
2141
  $row->mail_from_user = '';
2142
  $row->mail_from_name_user = '';
2143
  $row->reply_to_user = '';
2144
+ $row->save_uploads = 1;
2145
 
2146
  $row->condition = '';
2147
  $row->mail_cc = '';
2189
 
2190
  public function page_nav() {
2191
  global $wpdb;
2192
+ $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
 
2193
  $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker " . $where;
2194
  $total = $wpdb->get_var($query);
2195
  $page_nav['total'] = $total;
admin/models/FMModelSubmissions_fm.php CHANGED
@@ -1,50 +1,50 @@
1
  <?php
2
  class FMModelSubmissions_fm {
3
- ////////////////////////////////////////////////////////////////////////////////////////
4
- // Events //
5
- ////////////////////////////////////////////////////////////////////////////////////////
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- // Constants //
8
- ////////////////////////////////////////////////////////////////////////////////////////
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- // Variables //
11
- ////////////////////////////////////////////////////////////////////////////////////////
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- // Constructor & Destructor //
14
- ////////////////////////////////////////////////////////////////////////////////////////
15
- public function __construct() {
16
- }
17
- ////////////////////////////////////////////////////////////////////////////////////////
18
- // Public Methods //
19
- ////////////////////////////////////////////////////////////////////////////////////////
20
- public function blocked_ips() {
21
- global $wpdb;
22
- $ips = $wpdb->get_col('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked');
23
- return $ips;
24
- }
25
 
26
- public function get_form_titles() {
27
- global $wpdb;
28
- $query = "SELECT id, title FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT 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;
@@ -67,7 +67,7 @@ class FMModelSubmissions_fm {
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'])) != '') ? esc_html(stripslashes($_POST['order_by'])) : 'group_id');
71
  $asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
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'])) : '');
@@ -124,8 +124,10 @@ class FMModelSubmissions_fm {
124
  if (strpos($form->label_order, 'type_paypal_')) {
125
  $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#****#";
126
  }
 
127
  $form_labels = explode('#****#', $form->label_order);
128
  $form_labels = array_slice($form_labels, 0, count($form_labels) - 1);
 
129
  foreach ($form_labels as $key => $form_label) {
130
  $label_id = explode('#**id**#', $form_label);
131
  array_push($labels_id, $label_id[0]);
@@ -137,6 +139,7 @@ class FMModelSubmissions_fm {
137
  array_push($label_names, $label_name);
138
  array_push($label_types, $label_name_type[1]);
139
  }
 
140
  foreach ($labels_id as $key => $label_id) {
141
  if (in_array($label_id, $labels)) {
142
  if (!in_array($label_id, $sorted_labels_id)) {
@@ -321,39 +324,38 @@ class FMModelSubmissions_fm {
321
  }
322
  }
323
 
324
- public function statistic_for_radio($where_choices, $sorted_label_id) {
325
- global $wpdb;
326
- $choices_params = array();
327
- $query = "SELECT element_value FROM " . $wpdb->prefix . "formmaker_submits WHERE " . $where_choices . " AND element_label='" . $sorted_label_id . "'";
328
- $choices = $wpdb->get_results($query);
329
- $colors = array(
330
- '#2CBADE',
331
- '#FE6400'
332
- );
333
- $choices_labels = array();
334
- $choices_count = array();
335
- $all = count($choices);
336
- $unanswered = 0;
337
- foreach ($choices as $key => $choice) {
338
- if ($choice->element_value == '') {
339
- $unanswered++;
340
- }
341
- else {
342
- if (!in_array($choice->element_value, $choices_labels)) {
343
- array_push($choices_labels, $choice->element_value);
344
- array_push($choices_count, 0);
345
- }
346
- $choices_count[array_search($choice->element_value, $choices_labels)]++;
347
- }
348
- }
349
- array_multisort($choices_count, SORT_DESC, $choices_labels);
350
- array_push($choices_params, $choices_count);
351
- array_push($choices_params, $choices_labels);
352
- array_push($choices_params, $unanswered);
353
- array_push($choices_params, $all);
354
- array_push($choices_params, $colors);
355
- return $choices_params;
356
- }
357
 
358
  public function get_data_of_group_id($id) {
359
  global $wpdb;
@@ -419,10 +421,10 @@ class FMModelSubmissions_fm {
419
  $stars = "";
420
  $new_filename=explode('***', $new_filename);
421
  for ($j = 0; $j < $new_filename[1]; $j++) {
422
- $stars .= '<img id="' . $element_label . '_star_' . $j . '" src="' . WD_FM_URL . '/images/star_' . $new_filename[2] . '.png" /> ';
423
  }
424
  for ($k = $new_filename[1]; $k < $new_filename[0]; $k++) {
425
- $stars .= '<img id="' . $element_label . '_star_' . $k . '" src="' . WD_FM_URL . '/images/star.png" /> ';
426
  }
427
  array_push($view_star_rating_array, $stars);
428
  return $view_star_rating_array;
@@ -450,10 +452,10 @@ class FMModelSubmissions_fm {
450
  $element_value1 = str_replace("***star_rating***", '', $element_value);
451
  $stars_value = explode('***', $element_value1);
452
  for ($j = 0; $j < $stars_value[1]; $j++) {
453
- $edit_stars .= '<img id="'.$label_id.'_star_'.$j.'" onclick="edit_star_rating('.$j.','.$label_id.')" src="' . WD_FM_URL . '/images/star_'.$stars_value[2].'.png" /> ';
454
  }
455
  for( $k=$stars_value[1];$k<$stars_value[0];$k++) {
456
- $edit_stars .= '<img id="'.$label_id.'_star_'.$k.'" onclick="edit_star_rating('.$k.','.$label_id.')" src="' . WD_FM_URL . '/images/star.png" /> ';
457
  }
458
  array_push($star_rating_array, $edit_stars);
459
  array_push($star_rating_array, $stars_value);
@@ -654,7 +656,7 @@ class FMModelSubmissions_fm {
654
  }
655
  return $choices_values;
656
  }
657
- public function get_subs_count($form_id) {
658
  global $wpdb;
659
  $query = $wpdb->prepare("SELECT distinct group_id FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d", $form_id);
660
  $group_id_s = $wpdb->get_col($query);
1
  <?php
2
  class FMModelSubmissions_fm {
3
+ ////////////////////////////////////////////////////////////////////////////////////////
4
+ // Events //
5
+ ////////////////////////////////////////////////////////////////////////////////////////
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ // Constants //
8
+ ////////////////////////////////////////////////////////////////////////////////////////
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ // Variables //
11
+ ////////////////////////////////////////////////////////////////////////////////////////
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ // Constructor & Destructor //
14
+ ////////////////////////////////////////////////////////////////////////////////////////
15
+ public function __construct() {
16
+ }
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ // Public Methods //
19
+ ////////////////////////////////////////////////////////////////////////////////////////
20
+ public function blocked_ips() {
21
+ global $wpdb;
22
+ $ips = $wpdb->get_col('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked');
23
+ return $ips;
24
+ }
25
 
26
+ public function get_form_titles() {
27
+ global $wpdb;
28
+ $query = "SELECT id, title FROM " . $wpdb->prefix . "formmaker 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;
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'])) != '') ? esc_html(stripslashes($_POST['order_by'])) : 'group_id');
71
  $asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
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'])) : '');
124
  if (strpos($form->label_order, 'type_paypal_')) {
125
  $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#****#";
126
  }
127
+
128
  $form_labels = explode('#****#', $form->label_order);
129
  $form_labels = array_slice($form_labels, 0, count($form_labels) - 1);
130
+
131
  foreach ($form_labels as $key => $form_label) {
132
  $label_id = explode('#**id**#', $form_label);
133
  array_push($labels_id, $label_id[0]);
139
  array_push($label_names, $label_name);
140
  array_push($label_types, $label_name_type[1]);
141
  }
142
+
143
  foreach ($labels_id as $key => $label_id) {
144
  if (in_array($label_id, $labels)) {
145
  if (!in_array($label_id, $sorted_labels_id)) {
324
  }
325
  }
326
 
327
+ public function statistic_for_radio($where_choices, $sorted_label_id) {
328
+ global $wpdb;
329
+ $choices_params = array();
330
+ $query = "SELECT element_value FROM " . $wpdb->prefix . "formmaker_submits WHERE " . $where_choices . " AND element_label='" . $sorted_label_id . "'";
331
+ $choices = $wpdb->get_results($query);
332
+ $colors=array('#5FE2FF','#F9E89C');
333
+ $choices_colors=array('#4EC0D9','#DDCC7F');
334
+ $choices_labels = array();
335
+ $choices_count = array();
336
+ $all = count($choices);
337
+ $unanswered = 0;
338
+ foreach ($choices as $key => $choice) {
339
+ if ($choice->element_value == '') {
340
+ $unanswered++;
341
+ }
342
+ else {
343
+ if (!in_array($choice->element_value, $choices_labels)) {
344
+ array_push($choices_labels, $choice->element_value);
345
+ array_push($choices_count, 0);
346
+ }
347
+ $choices_count[array_search($choice->element_value, $choices_labels)]++;
348
+ }
349
+ }
350
+ array_multisort($choices_count, SORT_DESC, $choices_labels);
351
+ array_push($choices_params, $choices_count);
352
+ array_push($choices_params, $choices_labels);
353
+ array_push($choices_params, $unanswered);
354
+ array_push($choices_params, $all);
355
+ array_push($choices_params, $colors);
356
+ array_push($choices_params, $choices_colors);
357
+ return $choices_params;
358
+ }
 
359
 
360
  public function get_data_of_group_id($id) {
361
  global $wpdb;
421
  $stars = "";
422
  $new_filename=explode('***', $new_filename);
423
  for ($j = 0; $j < $new_filename[1]; $j++) {
424
+ $stars .= '<img id="' . $element_label . '_star_' . $j . '" src="' . WD_FM_URL . '/images/star_' . $new_filename[2] . '.png?ver='. get_option("wd_form_maker_version").'" /> ';
425
  }
426
  for ($k = $new_filename[1]; $k < $new_filename[0]; $k++) {
427
+ $stars .= '<img id="' . $element_label . '_star_' . $k . '" src="' . WD_FM_URL . '/images/star.png?ver='. get_option("wd_form_maker_version").'" /> ';
428
  }
429
  array_push($view_star_rating_array, $stars);
430
  return $view_star_rating_array;
452
  $element_value1 = str_replace("***star_rating***", '', $element_value);
453
  $stars_value = explode('***', $element_value1);
454
  for ($j = 0; $j < $stars_value[1]; $j++) {
455
+ $edit_stars .= '<img id="'.$label_id.'_star_'.$j.'" onclick="edit_star_rating('.$j.','.$label_id.')" src="' . WD_FM_URL . '/images/star_'.$stars_value[2].'.png?ver='. get_option("wd_form_maker_version").'" /> ';
456
  }
457
  for( $k=$stars_value[1];$k<$stars_value[0];$k++) {
458
+ $edit_stars .= '<img id="'.$label_id.'_star_'.$k.'" onclick="edit_star_rating('.$k.','.$label_id.')" src="' . WD_FM_URL . '/images/star.png?ver='. get_option("wd_form_maker_version").'" /> ';
459
  }
460
  array_push($star_rating_array, $edit_stars);
461
  array_push($star_rating_array, $stars_value);
656
  }
657
  return $choices_values;
658
  }
659
+ public function get_subs_count($form_id) {
660
  global $wpdb;
661
  $query = $wpdb->prepare("SELECT distinct group_id FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d", $form_id);
662
  $group_id_s = $wpdb->get_col($query);
admin/models/FMModelThemes_fm.php CHANGED
@@ -21,7 +21,7 @@ class FMModelThemes_fm {
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']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
25
  $order_by_array = array('id', 'title', 'default');
26
  $order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
27
  $order_by = ' ORDER BY `' . $order_by . '` ' . $asc_or_desc;
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']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
25
  $order_by_array = array('id', 'title', 'default');
26
  $order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
27
  $order_by = ' ORDER BY `' . $order_by . '` ' . $asc_or_desc;
admin/views/FMViewBlocked_ips_fm.php CHANGED
@@ -1,142 +1,152 @@
1
  <?php
2
 
3
  class FMViewBlocked_ips_fm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- private $model;
14
 
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- // Constructor & Destructor //
17
- ////////////////////////////////////////////////////////////////////////////////////////
18
- public function __construct($model) {
19
- $this->model = $model;
20
- }
21
 
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Public Methods //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- public function display() {
26
- $rows_data = $this->model->get_rows_data();
27
- $page_nav = $this->model->page_nav();
28
- $search_value = ((isset($_POST['search_value'])) ? esc_html(stripslashes($_POST['search_value'])) : '');
29
- $asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
30
- $order_by_array = array('id', 'ip');
31
- $order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
32
- $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
33
- $ids_string = '';
34
- ?>
35
- <div id="fm_blocked_ips_message" style="width: 99%; display: none;"></div>
36
- <div style="clear: both; float: left; width: 99%;">
37
- <div style="float:left; font-size: 14px; font-weight: bold;">
38
- This section allows you to block IPs.
39
- <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-2.html">Read More in User Manual</a>
40
- </div>
41
- <div style="float: right; text-align: right;">
42
- <a style="text-decoration: none;" target="_blank" href="https://web-dorado.com/files/fromFormMaker.php">
43
- <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
44
- </a>
45
- </div>
46
- </div>
47
- <form onkeypress="fm_doNothing(event)" class="wrap" id="blocked_ips" method="post" action="admin.php?page=blocked_ips_fm" style="float: left; width: 99%;">
48
- <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
49
- <span class="block_icon"></span>
50
- <h2>Blocked IPs</h2>
51
- <div class="buttons_div">
52
- <input class="button-primary" type="submit" value="Save" onclick="fm_set_input_value('task', 'save_all');" />
53
- <input class="button-secondary" type="submit" value="Delete" onclick="if (confirm('Do you want to unblock selected IPs?')) {
54
- fm_set_input_value('task', 'delete_all');
55
- } else {
56
- return false;
57
- }" />
58
- </div>
59
- <div class="tablenav top">
60
- <?php
61
- WDW_FM_Library::search('IP', $search_value, 'blocked_ips');
62
- WDW_FM_Library::html_page_nav($page_nav['total'], $page_nav['limit'], 'blocked_ips');
63
- ?>
64
- </div>
65
- <table class="wp-list-table widefat fixed pages">
66
- <thead>
67
- <tr>
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="fm_set_input_value('task', '');
 
 
 
 
 
71
  fm_set_input_value('order_by', 'id');
72
  fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'id' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
73
  fm_form_submit(event, 'blocked_ips')" href="">
74
- <span>ID</span><span class="sorting-indicator"></span></th>
75
- </a>
76
- <th class="<?php if ($order_by == 'ip') {echo $order_class;} ?>">
77
- <a onclick="fm_set_input_value('task', '');
78
  fm_set_input_value('order_by', 'ip');
79
  fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'ip' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
80
  fm_form_submit(event, 'blocked_ips')" href="">
81
- <span>IP</span><span class="sorting-indicator"></span>
82
- </a>
83
- </th>
84
- <th class="table_big_col">Edit</th>
85
- <th class="table_big_col">Delete</th>
86
- </tr>
87
- <tr id="tr">
88
- <th></th>
89
- <th></th>
90
- <th class="edit_input"><input type="text" class="input_th" id="ip" name="ip" onkeypress="return fm_check_isnum(event)"></th>
91
- <th class="table_big_col">
92
- <a class="add_tag_th button-primary button button-small" onclick="if (fm_check_required('ip', 'IP')) {return false;}
93
- fm_set_input_value('task', 'save');
94
- fm_set_input_value('current_id', '');
95
- fm_form_submit(event, 'blocked_ips')" href="">Add IP</a>
96
- </th>
97
- <th></th>
98
- </tr>
99
- </thead>
100
- <tbody id="tbody_arr">
101
- <?php
102
- if ($rows_data) {
103
- foreach ($rows_data as $row_data) {
104
- $alternate = (!isset($alternate) || $alternate == 'class="alternate"') ? '' : 'class="alternate"';
105
- ?>
106
- <tr id="tr_<?php echo $row_data->id; ?>" <?php echo $alternate; ?>>
107
- <td class="table_small_col check-column" id="td_check_<?php echo $row_data->id; ?>" >
108
- <input id="check_<?php echo $row_data->id; ?>" name="check_<?php echo $row_data->id; ?>" type="checkbox" />
109
- </td>
110
- <td class="table_small_col" id="td_id_<?php echo $row_data->id; ?>" ><?php echo $row_data->id; ?></td>
111
- <td id="td_ip_<?php echo $row_data->id; ?>" >
112
- <a class="pointer" id="ip<?php echo $row_data->id; ?>"
113
- onclick="fm_edit_ip(<?php echo $row_data->id; ?>)"
114
- title="Edit"><?php echo $row_data->ip; ?></a>
115
- </td>
116
- <td class="table_big_col" id="td_edit_<?php echo $row_data->id; ?>">
117
- <a onclick="fm_edit_ip(<?php echo $row_data->id; ?>)">Edit</a>
118
- </td>
119
- <td class="table_big_col" id="td_delete_<?php echo $row_data->id; ?>">
120
- <a onclick="if (confirm('Do you want to delete selected item(s)?')) { fm_set_input_value('task', 'delete');
121
- fm_set_input_value('current_id', <?php echo $row_data->id; ?>);
122
- fm_form_submit(event, 'blocked_ips'); } else { return false;}" href="">Delete</a>
123
- </td>
124
- </tr>
125
- <?php
126
- $ids_string .= $row_data->id . ',';
127
- }
128
- }
129
- ?>
130
- </tbody>
131
- </table>
132
- <input id="task" name="task" type="hidden" value="" />
133
- <input id="current_id" name="current_id" type="hidden" value="" />
134
- <input id="ids_string" name="ids_string" type="hidden" value="<?php echo $ids_string; ?>" />
135
- <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="<?php echo $asc_or_desc; ?>" />
136
- <input id="order_by" name="order_by" type="hidden" value="<?php echo $order_by; ?>" />
 
 
 
 
 
137
  </form>
138
  <?php
139
- }
140
 
141
  ////////////////////////////////////////////////////////////////////////////////////////
142
  // Getters & Setters //
1
  <?php
2
 
3
  class FMViewBlocked_ips_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
 
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ // Constructor & Destructor //
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct($model) {
19
+ $this->model = $model;
20
+ }
21
 
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ $rows_data = $this->model->get_rows_data();
27
+ $page_nav = $this->model->page_nav();
28
+ $search_value = ((isset($_POST['search_value'])) ? esc_html(stripslashes($_POST['search_value'])) : '');
29
+ $asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
30
+ $order_by_array = array('id', 'ip');
31
+ $order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
32
+ $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
33
+ $ids_string = '';
34
+ ?>
35
+ <div id="fm_blocked_ips_message" style="width: 99%; display: none;"></div>
36
+ <div class="fm-user-manual">
37
+ This section allows you to block IPs.
38
+ <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-2.html">Read More in User Manual</a>
39
+ </div>
40
+ <div class="fm-upgrade-pro">
41
+ <a target="_blank" href="https://web-dorado.com/files/fromFormMaker.php">
42
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
43
+ </a>
44
+ </div>
45
+ <div class="fm-clear"></div>
46
+ <form onkeypress="fm_doNothing(event)" class="wrap" id="blocked_ips" method="post" action="admin.php?page=blocked_ips_fm" style="width:99%;">
47
+ <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
48
+ <div class="fm-page-banner blocked-ips-banner">
49
+ <div class="block_icon">
50
+ </div>
51
+ <div class="fm-logo-title">Blocked IPs</div>
52
+ <div class="fm-page-actions">
53
+ <button class="fm-button save-button small" onclick="fm_set_input_value('task', 'save_all');">
54
+ <span></span>
55
+ Save
56
+ </button>
57
+ <button class="fm-button delete-button small" onclick="if (confirm('Do you want to unblock selected IPs?')) { fm_set_input_value('task', 'delete_all'); } else { return false; }">
58
+ <span></span>
59
+ Delete
60
+ </button>
61
+ </div>
62
+ </div>
63
+ <div class="fm-clear"></div>
64
+ <div class="tablenav top">
65
+ <?php
66
+ WDW_FM_Library::search('IP', $search_value, 'blocked_ips');
67
+ WDW_FM_Library::html_page_nav($page_nav['total'], $page_nav['limit'], 'blocked_ips');
68
+ ?>
69
+ </div>
70
+ <table class="wp-list-table widefat fixed pages fm-block-ip">
71
+ <thead>
72
+ <tr>
73
+ <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin: 0;" /></th>
74
+ <th class="table_small_col <?php if ($order_by == 'id') {echo $order_class;} ?>">
75
+ <a onclick="fm_set_input_value('task', '');
76
  fm_set_input_value('order_by', 'id');
77
  fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'id' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
78
  fm_form_submit(event, 'blocked_ips')" href="">
79
+ <span>ID</span><span class="sorting-indicator"></span></th>
80
+ </a>
81
+ <th class="<?php if ($order_by == 'ip') {echo $order_class;} ?>">
82
+ <a onclick="fm_set_input_value('task', '');
83
  fm_set_input_value('order_by', 'ip');
84
  fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'ip' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
85
  fm_form_submit(event, 'blocked_ips')" href="">
86
+ <span>IP</span><span class="sorting-indicator"></span>
87
+ </a>
88
+ </th>
89
+ <th class="table_small_col">Edit</th>
90
+ <th class="table_small_col">Delete</th>
91
+ </tr>
92
+ <tr id="tr" style="background-color: #f9f9f9;">
93
+ <th></th>
94
+ <th></th>
95
+ <th>
96
+ <input type="text" class="input_th" id="ip" name="ip" onkeypress="return fm_check_isnum(event)">
97
+ <button class="fm-button add-button small" onclick="if (fm_check_required('ip', 'IP')) {return false;} fm_set_input_value('task', 'save'); fm_set_input_value('current_id', ''); fm_save_ip('blocked_ips');">
98
+ Add IP
99
+ <span></span>
100
+ </button>
101
+ </th>
102
+ <th>
103
+
104
+ </th>
105
+ <th></th>
106
+ </tr>
107
+ </thead>
108
+ <tbody id="tbody_arr">
109
+ <?php
110
+ if ($rows_data) {
111
+ foreach ($rows_data as $row_data) {
112
+ $alternate = (!isset($alternate) || $alternate == 'class="alternate"') ? '' : 'class="alternate"';
113
+ ?>
114
+ <tr id="tr_<?php echo $row_data->id; ?>" <?php echo $alternate; ?>>
115
+ <td class="table_small_col check-column" id="td_check_<?php echo $row_data->id; ?>" >
116
+ <input id="check_<?php echo $row_data->id; ?>" name="check_<?php echo $row_data->id; ?>" type="checkbox" />
117
+ </td>
118
+ <td class="table_small_col" id="td_id_<?php echo $row_data->id; ?>" ><?php echo $row_data->id; ?></td>
119
+ <td id="td_ip_<?php echo $row_data->id; ?>" >
120
+ <a class="pointer" id="ip<?php echo $row_data->id; ?>"
121
+ onclick="fm_edit_ip(<?php echo $row_data->id; ?>)"
122
+ title="Edit"><?php echo $row_data->ip; ?></a>
123
+ </td>
124
+ <td class="table_small_col" id="td_edit_<?php echo $row_data->id; ?>">
125
+ <button class="fm-icon edit-icon" onclick="fm_edit_ip(<?php echo $row_data->id; ?>);">
126
+ <span></span>
127
+ </button>
128
+ </td>
129
+ <td class="table_small_col" id="td_delete_<?php echo $row_data->id; ?>">
130
+ <button class="fm-icon delete-icon" onclick="if (confirm('Do you want to unblock selected IP?')) { fm_set_input_value('task', 'delete'); fm_set_input_value('current_id', <?php echo $row_data->id; ?>); fm_form_submit(event, 'blocked_ips'); } else {return false;}">
131
+ <span></span>
132
+ </button>
133
+ </td>
134
+ </tr>
135
+ <?php
136
+ $ids_string .= $row_data->id . ',';
137
+ }
138
+ }
139
+ ?>
140
+ </tbody>
141
+ </table>
142
+ <input id="task" name="task" type="hidden" value="" />
143
+ <input id="current_id" name="current_id" type="hidden" value="" />
144
+ <input id="ids_string" name="ids_string" type="hidden" value="<?php echo $ids_string; ?>" />
145
+ <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="<?php echo $asc_or_desc; ?>" />
146
+ <input id="order_by" name="order_by" type="hidden" value="<?php echo $order_by; ?>" />
147
  </form>
148
  <?php
149
+ }
150
 
151
  ////////////////////////////////////////////////////////////////////////////////////////
152
  // Getters & Setters //
admin/views/FMViewExtensions_fm.php DELETED
@@ -1,61 +0,0 @@
1
- <?php
2
-
3
- class FMViewExtensions_fm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- private $model;
14
-
15
-
16
- ////////////////////////////////////////////////////////////////////////////////////////
17
- // Constructor & Destructor //
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- public function __construct($model) {
20
- $this->model = $model;
21
- }
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Public Methods //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- public function display() {
26
- ?>
27
- <div id="main_featured_plugins_page">
28
- <table align="center" width="90%" style="margin-top: 0px;border-bottom: rgb(111, 111, 111) solid 2px;">
29
- <tr>
30
- <td colspan="2" style="height: 70px;"><h3 style="margin: 0px;font-family:Segoe UI;padding-bottom: 15px;color: rgb(111, 111, 111); font-size:18pt;">Form Maker Plugins</h3></td>
31
- <td></td>
32
- </tr>
33
- </table>
34
- <form method="post">
35
- <ul id="featured-plugins-list">
36
- <li class="form_maker_import">
37
- <div class="product">
38
- <div class="title">
39
- <strong class="heading">Form Maker Export/Import</strong>
40
- </div>
41
- </div>
42
- <div class="description">
43
- <p>Form Maker Export/Import WordPress plugin allows exporting and importing forms with/without submissions.</p>
44
- <a target="_blank" href="https://web-dorado.com/products/wordpress-form/export-import.html" class="download">Download</a>
45
- </div>
46
- </li>
47
- </ul>
48
- </form>
49
- </div>
50
- <?php
51
- }
52
- ////////////////////////////////////////////////////////////////////////////////////////
53
- // Getters & Setters //
54
- ////////////////////////////////////////////////////////////////////////////////////////
55
- ////////////////////////////////////////////////////////////////////////////////////////
56
- // Private Methods //
57
- ////////////////////////////////////////////////////////////////////////////////////////
58
- ////////////////////////////////////////////////////////////////////////////////////////
59
- // Listeners //
60
- ////////////////////////////////////////////////////////////////////////////////////////
61
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/views/FMViewFeatured_plugins_fm.php DELETED
@@ -1,171 +0,0 @@
1
- <?php
2
-
3
- class FMViewFeatured_plugins_fm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- private $model;
14
-
15
-
16
- ////////////////////////////////////////////////////////////////////////////////////////
17
- // Constructor & Destructor //
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- public function __construct($model) {
20
- $this->model = $model;
21
- }
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Public Methods //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- public function display() {
26
- ?>
27
- <div id="main_featured_plugins_page">
28
- <table align="center" width="90%" style="margin-top: 0px;border-bottom: rgb(111, 111, 111) solid 2px;">
29
- <tr>
30
- <td colspan="2" style="height: 70px;"><h3 style="margin: 0px;font-family:Segoe UI;padding-bottom: 15px;color: rgb(111, 111, 111); font-size:18pt;">Featured Plugins</h3></td>
31
- <td></td>
32
- </tr>
33
- </table>
34
- <form method="post">
35
- <ul id="featured-plugins-list">
36
- <li class="photo-gallery">
37
- <div class="product">
38
- <div class="title">
39
- <strong class="heading">Photo Gallery</strong>
40
- <p>WordPress Photo Gallery plugin</p>
41
- </div>
42
- </div>
43
- <div class="description">
44
- <p>Photo Gallery is a fully responsive WordPress Gallery plugin with advanced functionality.
45
- It allows having different image galleries for your posts and pages, as well as different widgets.</p>
46
- <a target="_blank" href="https://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="https://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="https://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="https://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="https://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="https://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="https://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="https://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="https://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="https://web-dorado.com/products/wordpress-events-calendar.html" class="download">Download</a>
155
- </div>
156
- </li>
157
- </ul>
158
- </form>
159
- </div >
160
- <?php
161
- }
162
- ////////////////////////////////////////////////////////////////////////////////////////
163
- // Getters & Setters //
164
- ////////////////////////////////////////////////////////////////////////////////////////
165
- ////////////////////////////////////////////////////////////////////////////////////////
166
- // Private Methods //
167
- ////////////////////////////////////////////////////////////////////////////////////////
168
- ////////////////////////////////////////////////////////////////////////////////////////
169
- // Listeners //
170
- ////////////////////////////////////////////////////////////////////////////////////////
171
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/views/FMViewFormMakerEditCSS.php CHANGED
@@ -44,59 +44,80 @@ class FMViewFormMakerEditCSS {
44
  <link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/codemirror.css'; ?>" rel="stylesheet">
45
 
46
  <style>
47
- .CodeMirror {
48
- border: 1px solid #ccc;
49
- font-size: 12px;
50
- margin-bottom: 6px;
51
- background: white;
52
- }
53
  </style>
54
 
55
- <form id="fm_theme" class="wrap wp-core-ui" method="post" action="#" style="width: 99%; margin: 5px 0 0 5px;">
56
- <div style="float: right; margin: 0 5px 0 0;">
57
- <input class="button-secondary" type="submit" onclick="if (fm_check_required('title', 'Theme title')) {return false;};
58
- fm_set_input_value('task', 'save');
59
- window.parent.jQuery('#theme option[value=<?php echo $theme_id; ?>]').html(jQuery('#title').val());
60
- window.parent.tb_remove();" value="Save"/>
61
- <input class="button-secondary" type="submit" onclick="if (fm_check_required('title', 'Theme title')) {return false;};
62
- fm_set_input_value('task', 'apply');
63
- window.parent.jQuery('#theme option[value=<?php echo $theme_id; ?>]').html(jQuery('#title').val());" value="Apply"/>
64
- <input class="button-secondary" type="submit" onclick="if (fm_check_required('title', 'Theme title')) {return false;};
65
- fm_set_input_value('task', 'save_as_new');
66
- window.parent.jQuery('#theme').append('<option value=0>' + jQuery('#title').val() + '</option>');
67
- window.parent.tb_remove();" value="Save as New"/>
68
- <input class="button-primary" type="button" onclick="jQuery('#css').val(jQuery('#main_theme').html());" value="Reset"/>
69
- <input class="button-secondary" type="button" onclick="window.parent.tb_remove();" value="Cancel"/>
70
- </div>
71
- <table style="clear: both;">
72
- <tbody>
73
- <tr>
74
- <td class="fm_label"><label for="title">Theme title: <span style="color:#FF0000;"> * </span> </label></td>
75
- <td><input type="text" id="title" name="title" value="<?php echo $row->title; ?>" class="fm_text_input" /></td>
76
- </tr>
77
- <tr>
78
- <td class="fm_label"><label for="css">Css: </label></td>
79
- <td style="width: 90%;"><textarea id="css" name="css" rows="25" style="width: 100%;"><?php echo htmlspecialchars($row->css); ?></textarea></td>
80
- </tr>
81
- </tbody>
82
- </table>
83
- <div style="display: none;" id="main_theme"><?php echo str_replace('"', '\"', $row->css); ?></div>
84
- <input type="hidden" id="task" name="task" value="" />
85
- <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
86
- <input type="hidden" id="default" name="default" value="<?php echo $row->default; ?>" />
87
- <input type="hidden" name="form_id" id="form_id" value="<?php echo $form_id; ?>" />
 
 
 
 
 
 
 
 
 
 
88
  </form>
89
  <script>
90
- var editor = CodeMirror.fromTextArea(
91
- document.getElementById("css"), {
92
- lineNumbers: true,
93
- lineWrapping: true,
94
- mode: "css"
95
- });
96
 
97
- CodeMirror.commands["selectAll"](editor);
98
- editor.autoFormatRange(editor.getCursor(true), editor.getCursor(false));
99
- editor.scrollTo(0,0);
 
 
 
 
 
 
 
 
 
 
 
100
  </script>
101
  <?php
102
  die();
44
  <link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/codemirror.css'; ?>" rel="stylesheet">
45
 
46
  <style>
47
+ .CodeMirror {
48
+ border: 1px solid #ccc;
49
+ font-size: 12px;
50
+ margin-bottom: 6px;
51
+ background: white;
52
+ }
53
  </style>
54
 
55
+ <form id="fm_theme" class="wrap wp-core-ui" method="post" action="#" style="width: 99%; padding-left:3px;">
56
+ <div class="fm-page-header">
57
+ <div class="fm-page-actions">
58
+ <button class="fm-button save-button small" onclick="if (fm_check_required('title', 'Theme title')) {return false;}; fm_save_theme('save'); window.parent.jQuery('#theme option[value=<?php echo $theme_id; ?>]').html(jQuery('#title').val()); window.parent.tb_remove();">
59
+ <span></span>
60
+ Save
61
+ </button>
62
+ <button class="fm-button apply-button small" onclick="if (fm_check_required('title', 'Theme title')) {return false;}; fm_save_theme('apply'); window.parent.jQuery('#theme option[value=<?php echo $theme_id; ?>]').html(jQuery('#title').val()); return false;">
63
+ <span></span>
64
+ Apply
65
+ </button>
66
+ <button class="fm-button save-as-copy-button medium" onclick="if (fm_check_required('title', 'Theme title')) {return false;}; fm_save_theme('save_as_new'); window.parent.jQuery('#theme').append('<option value=0>' + jQuery('#title').val() + '</option>'); window.parent.tb_remove(); return false;">
67
+ <span></span>
68
+ Save as New
69
+ </button>
70
+ <button class="fm-button undo-button small" onclick="fm_reset_theme(); return false;">
71
+ <span></span>
72
+ Reset
73
+ </button>
74
+ <button class="fm-button cancel-button small" onclick="window.parent.tb_remove();">
75
+ <span></span>
76
+ Cancel
77
+ </button>
78
+ </div>
79
+ <div class="fm-clear"></div>
80
+ </div>
81
+ <table style="clear: both;">
82
+ <tbody>
83
+ <tr>
84
+ <td class="fm_label"><label for="title">Theme title: <span style="color:#FF0000;"> * </span> </label></td>
85
+ <td><input type="text" id="title" name="title" value="<?php echo $row->title; ?>" class="fm_text_input" /></td>
86
+ </tr>
87
+ <tr>
88
+ <td class="fm_label"><label for="css">Css: </label></td>
89
+ <td style="width: 90%;"><textarea id="css" name="css" rows="25" style="width: 100%;"><?php echo htmlspecialchars($row->css); ?></textarea></td>
90
+ </tr>
91
+ </tbody>
92
+ </table>
93
+ <div style="display: none;" id="main_theme"><?php echo str_replace('"', '\"', $row->css); ?></div>
94
+ <input type="hidden" id="task" name="task" value="" />
95
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
96
+ <input type="hidden" id="default" name="default" value="<?php echo $row->default; ?>" />
97
+ <input type="hidden" name="form_id" id="form_id" value="<?php echo $form_id; ?>" />
98
  </form>
99
  <script>
100
+ var editor = CodeMirror.fromTextArea(
101
+ document.getElementById("css"), {
102
+ lineNumbers: true,
103
+ lineWrapping: true,
104
+ mode: "css"
105
+ });
106
 
107
+ CodeMirror.commands["selectAll"](editor);
108
+ editor.autoFormatRange(editor.getCursor(true), editor.getCursor(false));
109
+ editor.scrollTo(0,0);
110
+
111
+ function fm_save_theme(task) {
112
+ fm_set_input_value('task', task);
113
+ document.getElementById('fm_theme').submit();
114
+ }
115
+
116
+ function fm_reset_theme() {
117
+ editor.setValue(jQuery('#main_theme').html())
118
+ jQuery('#css').val(jQuery('#main_theme').html());
119
+ }
120
+
121
  </script>
122
  <?php
123
  die();
admin/views/FMViewFormMakerSQLMapping.php CHANGED
@@ -23,842 +23,981 @@ class FMViewFormMakerSQLMapping {
23
  // Public Methods //
24
  ////////////////////////////////////////////////////////////////////////////////////////
25
 
26
- public function edit_query($id, $form_id) {
27
  wp_print_scripts('jquery');
28
  wp_print_scripts('jquery-ui-tooltip');
29
  ?>
30
- <link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/style.css'; ?>" rel="stylesheet">
31
- <link rel="stylesheet" href="<?php echo WD_FM_URL . '/css/jquery-ui-1.10.3.custom.css'; ?>">
32
- <?php
33
- $label = $this->model->get_labels($form_id);
34
- $query_obj = $this->model->get_query($id);
35
-
36
- $temp = explode('***wdfcon_typewdf***',$query_obj->details);
37
- $con_type = $temp[0];
38
- $temp = explode('***wdfcon_methodwdf***',$temp[1]);
39
- $con_method = $temp[0];
40
- $temp = explode('***wdftablewdf***',$temp[1]);
41
- $table_cur = $temp[0];
42
- $temp = explode('***wdfhostwdf***',$temp[1]);
43
- $host = $temp[0];
44
- $temp = explode('***wdfportwdf***',$temp[1]);
45
- $port = $temp[0];
46
- $temp = explode('***wdfusernamewdf***',$temp[1]);
47
- $username = $temp[0];
48
- $temp = explode('***wdfpasswordwdf***',$temp[1]);
49
- $password = $temp[0];
50
- $temp = explode('***wdfdatabasewdf***',$temp[1]);
51
- $database = $temp[0];
52
-
53
- $details = $temp[1];
54
-
55
- $tables = $this->model->get_tables_saved($con_type, $username, $password, $database, $host);
56
- $table_struct = $this->model->get_table_struct_saved($con_type, $username, $password, $database, $host, $table_cur, $con_method);
57
-
58
- $filter_types=array("type_submit_reset", "type_map", "type_editor", "type_captcha", "type_recaptcha", "type_button", "type_paypal_total", "type_send_copy");
59
- $label_id= array();
60
- $label_order= array();
61
- $label_order_original= array();
62
- $label_type= array();
63
-
64
- ///stexic
65
- $label_all = explode('#****#',$label);
66
- $label_all = array_slice($label_all,0, count($label_all)-1);
67
-
68
- foreach($label_all as $key => $label_each) {
69
- $label_id_each=explode('#**id**#',$label_each);
70
- $label_oder_each=explode('#**label**#', $label_id_each[1]);
71
-
72
- if(in_array($label_oder_each[1],$filter_types))
73
- continue;
74
-
75
- array_push($label_id, $label_id_each[0]);
76
- array_push($label_order_original, $label_oder_each[0]);
77
- $ptn = "/[^a-zA-Z0-9_]/";
78
- $rpltxt = "";
79
- $label_temp=preg_replace($ptn, $rpltxt, $label_oder_each[0]);
80
- array_push($label_order, $label_temp);
81
- array_push($label_type, $label_oder_each[1]);
82
- }
83
-
84
- $form_fields='';
85
- foreach($label_id as $key => $lid) {
86
- $form_fields.='<a onclick="insert_field('.$lid.'); jQuery(\'#fieldlist\').hide();" style="display:block; text-decoration:none;">'.$label_order_original[$key].'</a>';
87
- }
88
- $user_fields = array("subid"=>"Submission ID", "ip"=>"Submitter's IP", "userid"=>"User ID", "username"=>"Username", "useremail"=>"User Email");
89
- foreach($user_fields as $user_key=>$user_field) {
90
- $form_fields.='<a onclick="insert_field(\''.$user_key.'\'); jQuery(\'#fieldlist\').hide();" style="display:block; text-decoration:none;">'.$user_field.'</a>';
91
- }
92
- $cond='<div id="condid"><select id="sel_condid" style="width: 110px">';
93
- foreach($table_struct as $col) {
94
- $cond.='<option>'.$col->Field.'</option>';
95
- }
96
- $cond.='</select>';
97
- $cond.='<select id="op_condid"><option value="=" selected="selected">=</option><option value="!=">!=</option><option value=">">&gt;</option><option value="<">&lt;</option><option value=">=">&gt;=</option><option value="<=">&lt;=</option><option value="%..%">Like</option><option value="%..">Starts with</option><option value="..%">Ends with</option></select><input id="val_condid" style="width:120px" type="text" /><select id="andor_condid" style="visibility: hidden;"><option value="AND">AND</option><option value="OR">OR</option></select><img src="' . WD_FM_URL . '/images/delete.png" onclick="delete_cond(&quot;condid&quot;)" style="vertical-align: middle;"></div>';
98
- ?>
99
- <script>
100
- function connect() {
101
- jQuery("input[type='radio']").attr('disabled','');
102
- jQuery('#struct').html('<div id="saving"><div id="saving_text">Loading</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
103
-
104
- jQuery("#struct").load('index.php?option=com_formmaker&task=db_tables&con_type='+jQuery('input[name=con_type]:checked').val()+'&con_method='+jQuery('input[name=con_method]:checked').val()+'&format=row');
105
- }
106
- jQuery(document).ready(function() {
107
- jQuery("#tables").change(function (){
108
- jQuery('#table_struct').html('<div id="saving"><div id="saving_text">Loading</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
109
-
110
- jQuery("#table_struct").load('index.php?option=com_formmaker&task=db_table_struct&name='+jQuery(this).val()+'&con_type='+jQuery('input[name=con_type]:checked').val()+'&con_method='+jQuery('input[name=con_method]:checked').val()+'&host='+jQuery('#host_rem').val()+'&port='+jQuery('#port_rem').val()+'&username='+jQuery('#username_rem').val()+'&password='+jQuery('#password_rem').val()+'&database='+jQuery('#database_rem').val()+'&format=row&id='+jQuery("#form_id").val());
111
- });
112
- jQuery('html').click(function() {
113
- if(jQuery("#fieldlist").css('display')=="block") {
114
- jQuery("#fieldlist").hide();
115
- }
116
- });
117
- jQuery('.cols input[type="text"]').on('click', function() {
118
- event.stopPropagation();
119
- jQuery("#fieldlist").css("top",jQuery(this).offset().top+jQuery(this).height()+2);
120
- jQuery("#fieldlist").css("left",jQuery(this).offset().left);
121
- jQuery("#fieldlist").slideDown('fast');
122
- selected_field=this.id;
123
- });
124
- jQuery('#query_txt').click(function() {
125
- event.stopPropagation();
126
- jQuery("#fieldlist").css("top",jQuery(this).offset().top+jQuery(this).height()+2);
127
- jQuery("#fieldlist").css("left",jQuery(this).offset().left);
128
- jQuery("#fieldlist").slideDown('fast');
129
- selected_field=this.id;
130
- });
131
- jQuery('#fieldlist').click(function(event){
132
- event.stopPropagation();
133
- });
134
- jQuery('.add_cond').click( function() {
135
- jQuery('.cols').append(conds.replace(/condid/g, cond_id++));
136
- update_vis();
137
- }
138
- );
139
- });
140
- var selected_field ='';
141
- var isvisible = 1;
142
- var cond_id = 1;
143
- conds='<?php echo $cond ?>';
144
- fields=new Array(<?php
145
- $fields = "";
146
- if($table_struct) {
147
- foreach($table_struct as $col) {
148
- $fields.=' "'.$col->Field.'",';
149
- }
150
- echo substr($fields, 0, -1);
151
- }
152
- ?>);
153
-
154
- function dis(id, x) {
155
- if(x)
156
- jQuery('#'+id).removeAttr('disabled');
157
- else
158
- jQuery('#'+id).attr('disabled','disabled');
159
- }
160
- function update_vis() {
161
- previous=0;
162
- for(i=1; i<cond_id; i++) {
163
- if(jQuery('#'+i).html()) {
164
- jQuery('#andor_'+i).css('visibility', 'hidden');
165
- if(previous)
166
- jQuery('#andor_'+previous).css('visibility', 'visible');
167
- previous=i;
168
- }
169
- }
170
- }
171
- function delete_cond(id) {
172
- jQuery('#'+id).remove();
173
- update_vis();
174
- }
175
- function save_query() {
176
- con_type =jQuery('input[name=con_type]:checked').val();
177
- con_method =jQuery('input[name=con_method]:checked').val();
178
- table =jQuery('#tables').val();
179
- host =jQuery('#host_rem').val();
180
- port =jQuery('#port_rem').val();
181
- username =jQuery('#username_rem').val();
182
- password =jQuery('#password_rem').val();
183
- database =jQuery('#database_rem').val();
184
-
185
- str=con_type+"***wdfcon_typewdf***"+con_method+"***wdfcon_methodwdf***"+table+"***wdftablewdf***"+host+"***wdfhostwdf***"+port+"***wdfportwdf***"+username+"***wdfusernamewdf***"+password+"***wdfpasswordwdf***"+database+"***wdfdatabasewdf***";
186
-
187
- if(fields.length) {
188
- for(i=0; i<fields.length; i++) {
189
- str+=fields[i]+'***wdfnamewdf***'+jQuery('#'+fields[i]).val()+'***wdfvaluewdf***'+jQuery('#ch_'+fields[i]+":checked" ).length+'***wdffieldwdf***';
190
- }
191
- }
192
-
193
- for(i=1; i<cond_id; i++) {
194
- if(jQuery('#'+i).html()) {
195
- str+=jQuery('#sel_'+i).val()+'***sel***'+jQuery('#op_'+i).val()+'***op***'+jQuery('#val_'+i).val()+'***val***'+jQuery('#andor_'+i).val()+'***where***';
196
- }
197
- }
198
- if(!jQuery('#query_txt').val()) {
199
- gen_query();
200
- }
201
- jQuery('#details').val(str);
202
- var datatxt = jQuery("#query_form").serialize()+'&form_id='+jQuery("#form_id").val();
203
-
204
- if(jQuery('#query_txt').val()) {
205
- jQuery('.c1').html('<div id="saving"><div id="saving_text">Saving</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
206
-
207
- jQuery.ajax({
208
- type: "POST",
209
- url: "<?php echo add_query_arg(array('action' => 'FormMakerSQLMapping', 'id' => $id, 'form_id' => $form_id, 'task' => 'update_query', 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>",
210
- data: datatxt,
211
- success: function(data) {
212
- window.parent.wd_fm_apply_options();
213
- window.parent.tb_remove();
214
- }
215
- });
216
- }
217
- else {
218
- alert('The query is empty.');
219
- }
220
- return false;
221
- }
222
-
223
- function gen_query() {
224
- if(jQuery('#query_txt').val())
225
- if(!confirm('Are you sure you want to replace the Query? All the modifications to the Query will be lost.'))
226
- return;
227
-
228
- query="";
229
- fields=new Array(<?php
230
- $fields = "";
231
- if($table_struct) {
232
- foreach($table_struct as $col) {
233
- $fields.=' "'.$col->Field.'",';
234
- }
235
- echo substr($fields, 0, -1);
236
- }
237
- ?>);
238
-
239
- con_type =jQuery('input[name=con_type]:checked').val();
240
- con_method =jQuery('input[name=con_method]:checked').val();
241
- table =jQuery('#tables').val();
242
- fls='';
243
- vals='';
244
- valsA=new Array();
245
- flsA=new Array();
246
-
247
- if(fields.length) {
248
- for(i=0; i<fields.length; i++) {
249
- if(jQuery('#ch_'+fields[i]+":checked" ).length) {
250
- flsA.push(fields[i]);
251
- valsA.push(jQuery('#'+fields[i]).val());
252
- }
253
- }
254
- }
255
- if(con_method=="insert") {
256
- if(flsA.length) {
257
- for(i=0; i<flsA.length-1; i++) {
258
- fls+= '`'+flsA[i]+'`, ';
259
- vals+= '"'+valsA[i]+'", ';
260
- }
261
- fls+= '`'+flsA[i]+'`';
262
- vals+= '"'+valsA[i]+'"';
263
- }
264
- if(fls)
265
- query="INSERT INTO "+jQuery('#tables').val()+" (" +fls+") VALUES ("+vals+")";
266
- }
267
-
268
- if(con_method=="update") {
269
- if(flsA.length) {
270
- for(i=0; i<flsA.length-1; i++) {
271
- vals+= '`'+flsA[i]+'`="'+valsA[i]+'", ';
272
- }
273
- vals+= '`'+flsA[i]+'`="'+valsA[i]+'"';
274
- }
275
- where="";
276
- previous='';
277
-
278
- for(i=1; i<cond_id; i++) {
279
- if(jQuery('#'+i).html()) {
280
- if(jQuery('#op_'+i).val()=="%..%")
281
- op_val=' LIKE "%'+jQuery('#val_'+i).val()+'%"';
282
- else if(jQuery('#op_'+i).val()=="%..")
283
- op_val=' LIKE "%'+jQuery('#val_'+i).val()+'"';
284
- else if(jQuery('#op_'+i).val()=="..%")
285
- op_val=' LIKE "'+jQuery('#val_'+i).val()+'%"';
286
- else
287
- op_val=' '+jQuery('#op_'+i).val()+' "'+jQuery('#val_'+i).val()+'"';
288
- where+=previous+' `'+jQuery('#sel_'+i).val()+'`'+op_val;
289
- previous=' '+ jQuery('#andor_'+i).val();
290
- }
291
- }
292
- if(vals)
293
- query="UPDATE "+jQuery('#tables').val()+" SET " + vals+(where? ' WHERE'+where: '') ;
294
- }
295
- if(con_method=="delete") {
296
- where="";
297
- previous='';
298
- for(i=1; i<cond_id; i++) {
299
- if(jQuery('#'+i).html()) {
300
- if(jQuery('#op_'+i).val()=="%..%")
301
- op_val=' LIKE "%'+jQuery('#val_'+i).val()+'%"';
302
- else if(jQuery('#op_'+i).val()=="%..")
303
- op_val=' LIKE "%'+jQuery('#val_'+i).val()+'"';
304
- else if(jQuery('#op_'+i).val()=="..%")
305
- op_val=' LIKE "'+jQuery('#val_'+i).val()+'%"';
306
- else
307
- op_val=' '+jQuery('#op_'+i).val()+' "'+jQuery('#val_'+i).val()+'"';
308
- where+=previous+' '+jQuery('#sel_'+i).val()+op_val;
309
- previous=' '+ jQuery('#andor_'+i).val();
310
- }
311
- }
312
- if(where)
313
- query="DELETE FROM "+jQuery('#tables').val()+ ' WHERE'+where ;
314
- }
315
- jQuery('#query_txt').val(query);
316
- }
317
-
318
- jQuery(document).ready(function () {
319
- jQuery(".hasTip").tooltip({
320
- track: true,
321
- content: function () {
322
- return jQuery(this).prop('title');
323
- }
324
- });
325
- });
326
-
327
- function insert_field(myValue) {
328
- if(!selected_field)
329
- return;
330
- myField=document.getElementById(selected_field);
331
- if (document.selection) {
332
- myField.focus();
333
- sel = document.selection.createRange();
334
- sel.text = myValue;
335
- }
336
- else {
337
- if (myField.selectionStart || myField.selectionStart == '0') {
338
- var startPos = myField.selectionStart;
339
- var endPos = myField.selectionEnd;
340
- myField.value = myField.value.substring(0, startPos)
341
- + "{"+myValue+"}"
342
- + myField.value.substring(endPos, myField.value.length);
343
- }
344
- else {
345
- myField.value += "{"+myValue+"}";
346
- }
347
- }
348
- }
349
- </script>
350
-
351
- <style>
352
- .main_func {
353
- font-size: 12px;
354
- display:inline-block;
355
- width:480px;
356
- vertical-align:top;
357
- }
358
- .desc {
359
- font-size: 12px;
360
- display:inline-block;
361
- width:250px;
362
- position:fixed;
363
- margin:15px;
364
- padding-left:55px;
365
- }
366
- .desc button {
367
- max-width: 200px;
368
- overflow: hidden;
369
- white-space: nowrap;
370
- text-overflow: ellipsis;
371
- }
372
- .key label {
373
- display:inline-block;
374
- width:150px;
375
- }
376
- .cols {
377
- border: 3px solid red;
378
- padding: 4px;
379
- }
380
- .cols div:nth-child(even) {background: #FFF}
381
- .cols div:nth-child(odd) {background: #F5F5F5}
382
- .cols div {
383
- height: 28px;
384
- padding: 5px
385
- }
386
- .cols label {
387
- display:inline-block;
388
- width:200px;
389
- font-size:15px;
390
- overflow: hidden;
391
- white-space: nowrap;
392
- text-overflow: ellipsis;
393
- vertical-align: middle;
394
- }
395
- .cols input[type="text"] {
396
- width: 220px;
397
- line-height: 18px;
398
- height: 20px;
399
- }
400
- .cols input[type="text"]:disabled {
401
- cursor: not-allowed;
402
- background-color: #eee;
403
- }
404
- .cols input[type="checkbox"] {
405
- width: 20px;
406
- line-height: 18px;
407
- height: 20px;
408
- vertical-align: middle;
409
- }
410
- .cols select {
411
- line-height: 18px;
412
- height: 24px;
413
- }
414
- #fieldlist {
415
- position: absolute;
416
- width:225px;
417
- background: #fff;
418
- border: solid 1px #c7c7c7;
419
- top: 0;
420
- left: 0;
421
- z-index: 1000;
422
- }
423
- #fieldlist a {
424
- padding: 5px;
425
- cursor:pointer;
426
- overflow: hidden;
427
- white-space: nowrap;
428
- text-overflow: ellipsis;
429
- }
430
- #fieldlist a:hover {
431
- background: #ccc;
432
- }
433
- .gen_query, .gen_query:focus {
434
- width: 200px;
435
- height: 38px;
436
- background: #0E73D4;
437
- color: white;
438
- cursor: pointer;
439
- border: 0px;
440
- font-size: 16px;
441
- font-weight: bold;
442
- margin: 20px;
443
- }
444
- .gen_query:active {
445
- background: #ccc;
446
- }
447
- </style>
448
-
449
- <div class="c1">
450
- <div class="main_func">
451
- <table class="admintable">
452
- <tr valign="top">
453
- <td class="key">
454
- <label title="asf">Connection type: </label>
455
- </td>
456
- <td >
457
- <input type="radio" name="con_type" id="local" value="local" <?php if($con_type=='local') echo 'checked="checked"'?> disabled>
458
- <label for="local">Local</label>
459
- <input type="radio" name="con_type" id="remote" value="remote" <?php if($con_type=='remote') echo 'checked="checked"'?> disabled>
460
- <label for="remote">Remote</label>
461
- </td>
462
- </tr>
463
- <tr class="remote_info" <?php if($con_type=='local') echo 'style="display:none"'?>>
464
- <td class="key">Host</td>
465
- <td>
466
- <input type="text" name="host" id="host_rem" style="width:180px" value="<?php echo $host; ?>" disabled>
467
- Port : <input type="text" name="port" id="port_rem" value="<?php echo $port; ?>" style="width:50px" disabled>
468
- </td>
469
- </tr>
470
- <tr class="remote_info" <?php if($con_type=='local') echo 'style="display:none"'?>>
471
- <td class="key">Username</td>
472
- <td>
473
- <input type="text" name="username" id="username_rem" style="width:272px" value="<?php echo $username; ?>" disabled>
474
- </td>
475
- </tr>
476
- <tr class="remote_info" <?php if($con_type=='local') echo 'style="display:none"'?>>
477
- <td class="key">Password</td>
478
- <td>
479
- <input type="password" name="password" id="password_rem" style="width:272px" value="<?php echo $password; ?>" disabled>
480
- </td>
481
- </tr>
482
- <tr class="remote_info" <?php if($con_type=='local') echo 'style="display:none"'?>>
483
- <td class="key">Database</td>
484
- <td>
485
- <input type="text"name="database" id="database_rem" style="width:272px" value="<?php echo $database; ?>" disabled>
486
- </td>
487
- </tr>
488
- <tr valign="top">
489
- <td class="key">
490
- <label>Type: </label>
491
- </td>
492
- <td >
493
- <input type="radio" name="con_method" id="insert" value="insert" <?php if($con_method=='insert') echo 'checked="checked"'?> disabled>
494
- <label for="insert">Insert</label>
495
- <input type="radio" name="con_method" id="update" value="update" <?php if($con_method=='update') echo 'checked="checked"'?> disabled>
496
- <label for="update">Update</label>
497
- <input type="radio" name="con_method" id="delete" value="delete" <?php if($con_method=='delete') echo 'checked="checked"'?> disabled>
498
- <label for="delete">Delete</label>
499
- </td>
500
- </tr>
501
- <tr valign="top">
502
- <td class="key">
503
- </td>
504
- <td >
505
- <input type="button" value="Connect" onclick="connect()" disabled>
506
- </td>
507
- </tr>
508
- </table>
509
- <div id="struct">
510
- <label for="tables" style="display:inline-block;width:157px;font-weight: bold;">Select a table</label>
511
- <select name="tables" id="tables" disabled>
512
- <option value="" ></option>
513
- <?php
514
-
515
- foreach($tables as $table)
516
- echo '<option value="'.$table.'" '.($table_cur==$table ? 'selected' : '').' >'.$table.'</option>';
517
- ?>
518
- </select>
519
- <br/><br/>
520
-
521
-
522
- <div id="table_struct">
523
-
524
- <?php
525
- if($table_struct)
526
- {
527
- ?>
528
-
529
- <div class="cols">
530
- <?php
531
 
532
- $temps=explode('***wdffieldwdf***',$details);
533
- $wheres = $temps[count($temps)-1];
534
- $temps = array_slice($temps,0, count($temps)-1);
535
- $col_names= array();
536
- $col_vals= array();
537
- $col_checks= array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
538
 
539
- foreach($temps as $temp)
540
- {
541
- $temp=explode('***wdfnamewdf***',$temp);
542
- array_push($col_names, $temp[0]);
543
- $temp=explode('***wdfvaluewdf***',$temp[1]);
544
- array_push($col_vals, $temp[0]);
545
- array_push($col_checks, $temp[1]);
546
- }
547
- if($con_method=='insert' or $con_method=='update')
548
- {
549
- echo '<div style="background: none;text-align: center;font-size: 20px;color: rgb(0, 164, 228);font-weight: bold;"> SET </div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
550
 
551
- foreach($table_struct as $key =>$col)
552
- {
553
-
554
- $title=' '.$col->Field;
555
- $title.="<ul style='padding-left: 17px;'>";
556
- $title.="<li>Type - ".$col->Type."</li>";
557
- $title.="<li>Null - ".$col->Null."</li>";
558
- $title.="<li>Key - ".$col->Key."</li>";
559
- $title.="<li>Default - ".$col->Default."</li>";
560
- $title.="<li>Extra - ".$col->Extra."</li>";
561
- $title.="</ul>";
562
-
563
- ?>
564
- <div><label title="<?php echo $title; ?>" class="hasTip"><b><?php echo $col->Field; ?></b><img src="<?php echo WD_FM_URL . '/images/info.png'; ?>" style="width:20px; vertical-align:middle;padding-left: 10px;" /></label><input type="text" id="<?php echo $col->Field; ?>" <?php if(!$col_checks[$key]) echo 'disabled="disabled"'?> value="<?php echo $col_vals[$key]; ?>" /><input id="ch_<?php echo $col->Field; ?>" type="checkbox" onClick="dis('<?php echo $col->Field; ?>', this.checked)" <?php if($col_checks[$key]) echo 'checked="checked"'?> /></div>
565
- <?php
566
- }
567
- }
568
-
569
- if($con_method=='delete' or $con_method=='update')
570
- {
571
- echo '<div style="background: none;text-align: center;font-size: 20px;color: rgb(0, 164, 228);font-weight: bold;"> WHERE </div>
572
- <img src="' . WD_FM_URL . '/images/add_condition.png" title="ADD" class="add_cond"/></br>';
573
-
574
- if($wheres)
575
- {
576
- echo '<script>';
577
 
578
- $wheres =explode('***where***',$wheres);
579
- $wheres = array_slice($wheres,0, count($wheres)-1);
580
- foreach($wheres as $where)
581
- {
582
- $temp=explode('***sel***',$where);
583
- $sel = $temp[0];
584
- $temp=explode('***op***',$temp[1]);
585
- $op = $temp[0];
586
- $temp=explode('***val***',$temp[1]);
587
- $val = $temp[0];
588
- $andor = $temp[1];
589
- echo 'jQuery(".cols").append(conds.replace(/condid/g, cond_id++)); update_vis();
590
- jQuery("#sel_"+(cond_id-1)).val("'.$sel.'");
591
- jQuery("#op_"+(cond_id-1)).val("'.$op.'");
592
- jQuery("#val_"+(cond_id-1)).val("'.$val.'");
593
- jQuery("#andor_"+(cond_id-1)).val("'.$andor.'");
594
- ';
595
 
596
- }
597
- echo '</script>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
598
 
599
- }
 
 
 
 
 
 
 
600
 
601
-
602
- }
603
- ?>
604
- <div style="color:red; background: none">The changes above will not affect the query until you click "Generate query".</div>
605
- </div>
606
- <br/>
607
- <input type="button" value="Generate Query" class="gen_query" onclick="gen_query()">
608
- <br/>
609
- <form name="query_form" id="query_form" >
610
- <label style="vertical-align: top;" for="query_txt" > Query: </label><textarea id="query_txt" name="query" rows=5 style="width:428px" ><?php echo $query_obj->query; ?></textarea>
611
- <input type="hidden" name="details" id="details">
612
- <input type="hidden" name="id" value="<?php echo $query_obj->id; ?>">
613
- </form>
614
- <input type="button" value="Save" style="float: right;width: 200px;height: 38px;background: #0E73D4;color: white;cursor: pointer;border: 0px;font-size: 16px;font-weight: bold;margin: 20px;" onclick="save_query()">
615
-
616
-
617
- <div id="fieldlist" style="display: none;">
618
- <?php echo $form_fields ?>
619
- </div>
620
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
621
 
622
- <?php
623
- }
624
- ?>
625
- </div>
626
- </div>
627
- <input type="hidden" value="<?php echo $form_id ?>" id="form_id">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
628
 
629
- </div>
 
 
 
 
 
 
 
 
630
 
631
- <div class="desc">
632
- <?php
633
- foreach($label_id as $key => $lid)
634
- {
635
- echo '<div>{'.$lid.'} - <button onclick="insert_field('.$lid.');">'.$label_order_original[$key].'</button></div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
636
 
637
- }
638
- $user_fields = array("subid"=>"Submission ID", "ip"=>"Submitter's IP", "userid"=>"User ID", "username"=>"Username", "useremail"=>"User Email");
639
- foreach($user_fields as $user_key=>$user_field) {
640
- echo '<div>{'.$user_key.'} - <button onclick="insert_field(\''.$user_key.'\');">'.$user_field.'</button></div>';
641
- }
642
- ?>
643
- </div>
644
- </div>
645
- <?php
646
- die();
647
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
648
 
649
- public function add_query($form_id){
650
- wp_print_scripts('jquery');
651
- wp_print_scripts('jquery-ui-tooltip');
652
- ?>
653
- <link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/style.css'; ?>" rel="stylesheet">
654
- <link rel="stylesheet" href="<?php echo WD_FM_URL . '/css/jquery-ui-1.10.3.custom.css'; ?>">
655
- <?php
656
- $label = $this->model->get_labels($form_id);
657
 
658
  $filter_types=array("type_submit_reset", "type_map", "type_editor", "type_captcha", "type_recaptcha", "type_button", "type_paypal_total", "type_send_copy");
659
  $label_id= array();
660
  $label_order= array();
661
  $label_order_original= array();
662
  $label_type= array();
663
-
664
- ///stexic
665
- $label_all = explode('#****#',$label);
666
- $label_all = array_slice($label_all,0, count($label_all)-1);
667
-
668
  foreach($label_all as $key => $label_each) {
669
  $label_id_each=explode('#**id**#',$label_each);
670
  $label_oder_each=explode('#**label**#', $label_id_each[1]);
671
 
672
  if(in_array($label_oder_each[1],$filter_types))
673
  continue;
674
-
675
  array_push($label_id, $label_id_each[0]);
676
-
677
-
678
  array_push($label_order_original, $label_oder_each[0]);
679
-
680
  $ptn = "/[^a-zA-Z0-9_]/";
681
  $rpltxt = "";
682
  $label_temp=preg_replace($ptn, $rpltxt, $label_oder_each[0]);
683
  array_push($label_order, $label_temp);
684
-
685
  array_push($label_type, $label_oder_each[1]);
686
  }
687
- ?>
688
- <script>
689
- function insert_field(){}
690
-
691
- function connect() {
692
- jQuery("input[type='radio']").attr('disabled','');
693
- jQuery(".connect").attr('disabled','');
694
- jQuery('#struct').html('<div id="saving"><div id="saving_text">Loading</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
695
- jQuery.ajax({
696
- type: "POST",
697
- url: "<?php echo add_query_arg(array('action' => 'FormMakerSQLMapping', 'id' => 0, 'form_id' => $form_id, 'task' => 'db_tables', 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>",
698
- data: 'con_type='+jQuery('input[name=con_type]:checked').val()+'&con_method='+jQuery('input[name=con_method]:checked').val()+'&host='+jQuery('#host_rem').val()+'&port='+jQuery('#port_rem').val()+'&username='+jQuery('#username_rem').val()+'&password='+jQuery('#password_rem').val()+'&database='+jQuery('#database_rem').val()+'&format=row',
699
- success: function(data) {
700
- if(data==1) {
701
- jQuery("#struct").html('<div style="font-size: 22px; text-align: center; padding-top: 15px;">Could not connect to MySQL.</div>')
702
- jQuery(".connect").removeAttr('disabled');
703
- jQuery("input[type='radio']").removeAttr('disabled','');
704
- }
705
- else {
706
- jQuery("#struct").html(data);
707
- }
708
- }
709
- });
710
- }
711
-
712
- function shh(x) {
713
- if(x)
714
- jQuery(".remote_info").show();
715
- else
716
- jQuery(".remote_info").hide();
717
- }
718
-
719
- </script>
720
- <style>
721
- .main_func {
722
- font-size: 12px;
723
- display:inline-block;
724
- width:480px;
725
- vertical-align:top;
726
- }
727
-
728
- .desc {
729
- font-size: 12px;
730
- display:inline-block;
731
- width:250px;
732
- position:fixed;
733
- margin:15px;
734
- margin-left:55px;
735
- }
736
-
737
- .desc button {
738
- max-width: 200px;
739
- overflow: hidden;
740
- white-space: nowrap;
741
- text-overflow: ellipsis;
742
- }
743
-
744
- .key label {
745
- display:inline-block;
746
- width:150px;
747
- }
748
- </style>
749
-
750
- <div class="c1">
751
- <div class="main_func">
752
- <table class="admintable">
753
- <tr valign="top">
754
- <td class="key">
755
- <label title="asf">Connection type: </label>
756
- </td>
757
- <td >
758
- <input type="radio" name="con_type" id="local" value="local" checked="checked" onclick="shh(false)">
759
- <label for="local">Local</label>
760
- <input type="radio" name="con_type" id="remote" value="remote" onclick="shh(true)">
761
- <label for="remote">Remote</label>
762
- </td>
763
- </tr>
764
- <tr class="remote_info" style="display:none">
765
- <td class="key">Host</td>
766
- <td>
767
- <input type="text" name="host" id="host_rem" style="width:180px">
768
- Port : <input type="text" name="port" id="port_rem" value="3306" style="width:50px">
769
- </td>
770
- </tr>
771
- <tr class="remote_info" style="display:none">
772
- <td class="key">Username</td>
773
- <td>
774
- <input type="text" name="username" id="username_rem" style="width:272px">
775
- </td>
776
- </tr>
777
- <tr class="remote_info" style="display:none">
778
- <td class="key">Password</td>
779
- <td>
780
- <input type="password" name="password" id="password_rem" style="width:272px">
781
- </td>
782
- </tr>
783
- <tr class="remote_info" style="display:none">
784
- <td class="key">Database</td>
785
- <td>
786
- <input type="text"name="database" id="database_rem" style="width:272px">
787
- </td>
788
- </tr>
789
- <tr valign="top">
790
- <td class="key">
791
- <label>Type: </label>
792
- </td>
793
- <td >
794
- <input type="radio" name="con_method" id="insert" value="insert" checked="checked">
795
- <label for="insert">Insert</label>
796
- <input type="radio" name="con_method" id="update" value="update">
797
- <label for="update">Update</label>
798
- <input type="radio" name="con_method" id="delete" value="delete">
799
- <label for="delete">Delete</label>
800
- </td>
801
- </tr>
802
- <tr valign="top">
803
- <td class="key">
804
- </td>
805
- <td >
806
- <input type="button" value="Connect" onclick="connect()" class="connect">
807
- </td>
808
- </tr>
809
- </table>
810
- <div id="struct">
811
- </div>
812
- <input type="hidden" value="<?php echo $form_id ?>" id="form_id">
813
- </div>
814
- <div class="desc">
815
- <?php
816
- foreach($label_id as $key => $lid) {
817
- echo '<div>{'.$lid.'} - <button onclick="insert_field('.$lid.');">'.$label_order_original[$key].'</button></div>';
818
- }
819
- $user_fields = array("subid"=>"Submission ID", "ip"=>"Submitter's IP", "userid"=>"User ID", "username"=>"Username", "useremail"=>"User Email");
820
- foreach($user_fields as $user_key=>$user_field) {
821
- echo '<div>{'.$user_key.'} - <button onclick="insert_field(\''.$user_key.'\');">'.$user_field.'</button></div>';
822
- }
823
- ?>
824
- </div>
825
- </div>
826
- <?php
827
- die();
828
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
829
 
830
- public function db_tables($form_id){
831
- $tables = $this->model->get_tables();
832
- ?>
833
- <label for="tables" style="display:inline-block;width:157px;font-weight: bold;">Select a table</label>
834
- <select name="tables" id="tables">
835
- <option value="" ></option>
836
- <?php
837
- foreach($tables as $table) {
838
- echo '<option value="' . $table . '" >' . $table . '</option>';
839
- }
840
- ?>
841
- </select>
842
- <br/><br/>
843
- <div id="table_struct">
844
- </div>
845
- <script>
846
- jQuery("#tables").change(function (){
847
- jQuery('#table_struct').html('<div id="saving"><div id="saving_text">Loading</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
848
-
849
- jQuery.ajax({
850
- type: "POST",
851
- url: "<?php echo add_query_arg(array('action' => 'FormMakerSQLMapping', 'id' => 0, 'form_id' => $form_id, 'task' => 'db_table_struct', 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>",
852
- data: 'name='+jQuery(this).val()+'&con_type='+jQuery('input[name=con_type]:checked').val()+'&con_method='+jQuery('input[name=con_method]:checked').val()+'&host='+jQuery('#host_rem').val()+'&port='+jQuery('#port_rem').val()+'&username='+jQuery('#username_rem').val()+'&password='+jQuery('#password_rem').val()+'&database='+jQuery('#database_rem').val()+'&format=row',
853
- success: function(data) {
854
- jQuery("#table_struct").html(data);
855
- }
856
- });
857
- })
858
- </script>
859
- <?php
860
- die();
861
- }
862
 
863
  public function db_table_struct ($form_id) {
864
  $table_struct = $this->model->get_table_struct();
@@ -880,7 +1019,7 @@ class FMViewFormMakerSQLMapping {
880
 
881
  if(in_array($label_oder_each[1],$filter_types)) {
882
  continue;
883
- }
884
  array_push($label_id, $label_id_each[0]);
885
  array_push($label_order_original, $label_oder_each[0]);
886
  $ptn = "/[^a-zA-Z0-9_]/";
@@ -897,384 +1036,424 @@ class FMViewFormMakerSQLMapping {
897
  foreach($user_fields as $user_key=>$user_field) {
898
  $form_fields.='<a onclick="insert_field(\''.$user_key.'\'); jQuery(\'#fieldlist\').hide();" style="display:block; text-decoration:none;">'.$user_field.'</a>';
899
  }
900
- $cond='<div id="condid"><select id="sel_condid" style="width: 110px">';
901
  foreach($table_struct as $col) {
902
- $cond.='<option>'.$col->Field.'</option>';
903
  }
904
  $cond.='</select>';
905
 
906
- $cond.='<select id="op_condid"><option value="=" selected="selected">=</option><option value="!=">!=</option><option value=">">&gt;</option><option value="<">&lt;</option><option value=">=">&gt;=</option><option value="<=">&lt;=</option><option value="%..%">Like</option><option value="%..">Starts with</option><option value="..%">Ends with</option></select><input id="val_condid" style="width:120px" type="text" /><select id="andor_condid" style="visibility: hidden;"><option value="AND">AND</option><option value="OR">OR</option></select><img src="' . WD_FM_URL . '/images/delete.png" onclick="delete_cond(&quot;condid&quot;)" style="vertical-align: middle;"></div>';
907
  ?>
908
  <script>
909
- var selected_field ='';
910
- var isvisible = 1;
911
- var cond_id = 1;
912
- //onclick="gen_query()"
913
- conds='<?php echo $cond ?>';
914
- fields=new Array(<?php
915
- $fields = "";
916
- if($table_struct) {
917
- foreach($table_struct as $col) {
918
- $fields.=' "'.$col->Field.'",';
919
- }
920
- echo substr($fields, 0, -1);
921
- }
922
  ?>);
923
- function dis(id, x) {
924
- if(x)
925
- jQuery('#'+id).removeAttr('disabled');
926
- else
927
- jQuery('#'+id).attr('disabled','disabled');
928
- }
929
 
930
- function update_vis() {
931
- previous=0;
932
- for(i=1; i<cond_id; i++) {
933
- if(jQuery('#'+i).html()) {
934
- jQuery('#andor_'+i).css('visibility', 'hidden');
935
- if(previous) {
936
- jQuery('#andor_'+previous).css('visibility', 'visible');
937
- }
938
- previous=i;
939
- }
940
- }
941
- }
942
 
943
- function delete_cond(id) {
944
- jQuery('#'+id).remove();
945
- update_vis();
946
- }
947
 
948
- jQuery('.add_cond').click( function() {
949
- jQuery('.cols').append(conds.replace(/condid/g, cond_id++));
950
- update_vis();
951
- }
952
- );
953
 
954
- jQuery('html').click(function() {
955
- if(jQuery("#fieldlist").css('display')=="block") {
956
- jQuery("#fieldlist").hide();
957
- }
958
- });
959
 
960
- jQuery('.cols input[type="text"]').on('click', function() {
961
- event.stopPropagation();
962
- jQuery("#fieldlist").css("top",jQuery(this).offset().top+jQuery(this).height()+2);
963
- jQuery("#fieldlist").css("left",jQuery(this).offset().left);
964
- jQuery("#fieldlist").slideDown('fast');
965
- selected_field=this.id;
966
- });
967
 
968
- jQuery('#query_txt').click(function() {
969
- event.stopPropagation();
970
- jQuery("#fieldlist").css("top",jQuery(this).offset().top+jQuery(this).height()+2);
971
- jQuery("#fieldlist").css("left",jQuery(this).offset().left);
972
- jQuery("#fieldlist").slideDown('fast');
973
- selected_field=this.id;
974
- });
975
 
976
- jQuery('#fieldlist').click(function(event){
977
- event.stopPropagation();
978
- });
979
 
980
- function save_query() {
981
- con_type =jQuery('input[name=con_type]:checked').val();
982
- con_method =jQuery('input[name=con_method]:checked').val();
983
- table =jQuery('#tables').val();
984
- table =jQuery('#tables').val();
985
- host =jQuery('#host_rem').val();
986
- port =jQuery('#port_rem').val();
987
- username =jQuery('#username_rem').val();
988
- password =jQuery('#password_rem').val();
989
- database =jQuery('#database_rem').val();
990
-
991
- str=con_type+"***wdfcon_typewdf***"+con_method+"***wdfcon_methodwdf***"+table+"***wdftablewdf***"+host+"***wdfhostwdf***"+port+"***wdfportwdf***"+username+"***wdfusernamewdf***"+password+"***wdfpasswordwdf***"+database+"***wdfdatabasewdf***";
992
 
993
- if(fields.length) {
994
- for(i=0; i<fields.length; i++) {
995
- str+=fields[i]+'***wdfnamewdf***'+jQuery('#'+fields[i]).val()+'***wdfvaluewdf***'+jQuery('#ch_'+fields[i]+":checked" ).length+'***wdffieldwdf***';
996
- }
997
- }
998
 
999
- for(i=1; i<cond_id; i++) {
1000
- if(jQuery('#'+i).html()) {
1001
- str+=jQuery('#sel_'+i).val()+'***sel***'+jQuery('#op_'+i).val()+'***op***'+jQuery('#val_'+i).val()+'***val***'+jQuery('#andor_'+i).val()+'***where***';
1002
- }
1003
- }
1004
 
1005
- if(!jQuery('#query_txt').val()) {
1006
- gen_query();
1007
- }
1008
 
1009
- jQuery('#details').val(str);
1010
 
1011
- var datatxt = jQuery("#query_form").serialize()+'&form_id='+jQuery("#form_id").val();
1012
- if(jQuery('#query_txt').val()) {
1013
- jQuery('.c1').html('<div id="saving"><div id="saving_text">Saving</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
1014
- jQuery.ajax({
1015
- type: "POST",
1016
- url: "<?php echo add_query_arg(array('action' => 'FormMakerSQLMapping', 'id' => 0, 'form_id' => $form_id, 'task' => 'save_query', 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>",
1017
- data: datatxt,
1018
- success: function(data) {
1019
- window.parent.wd_fm_apply_options();
1020
- window.parent.tb_remove();
1021
- }
1022
- });
1023
- }
1024
- else {
1025
- alert('The query is empty.');
1026
- }
1027
- return false;
1028
- }
1029
 
1030
- function gen_query() {
1031
- if(jQuery('#query_txt').val()) {
1032
- if(!confirm('Are you sure you want to replace the Query? All the modifications to the Query will be lost.')) {
1033
- return;
1034
- }
1035
- }
1036
- query="";
1037
- fields=new Array(<?php
1038
- $fields = "";
1039
- if($table_struct) {
1040
- foreach($table_struct as $col) {
1041
- $fields.=' "'.$col->Field.'",';
1042
- }
1043
- echo substr($fields, 0, -1);
1044
- }
1045
- ?>);
1046
 
1047
- con_type =jQuery('input[name=con_type]:checked').val();
1048
- con_method =jQuery('input[name=con_method]:checked').val();
1049
- table =jQuery('#tables').val();
1050
- fls='';
1051
- vals='';
1052
- valsA=new Array();
1053
- flsA=new Array();
1054
 
1055
- if(fields.length) {
1056
- for(i=0; i<fields.length; i++) {
1057
- if(jQuery('#ch_'+fields[i]+":checked" ).length) {
1058
- flsA.push(fields[i]);
1059
- valsA.push(jQuery('#'+fields[i]).val());
1060
- }
1061
- }
1062
- }
1063
 
1064
- if(con_method=="insert") {
1065
- if(flsA.length) {
1066
- for(i=0; i<flsA.length-1; i++) {
1067
- fls+= '`'+flsA[i]+'`, ';
1068
- vals+= '"'+valsA[i]+'", ';
1069
- }
1070
- fls+= '`'+flsA[i]+'`';
1071
- vals+= '"'+valsA[i]+'"';
1072
- }
1073
- if(fls) {
1074
- query="INSERT INTO "+jQuery('#tables').val()+" (" +fls+") VALUES ("+vals+")";
1075
- }
1076
- }
1077
 
1078
- if(con_method=="update") {
1079
- if(flsA.length) {
1080
- for(i=0; i<flsA.length-1; i++) {
1081
- vals+= '`'+flsA[i]+'`="'+valsA[i]+'", ';
1082
- }
1083
- vals+= '`'+flsA[i]+'`="'+valsA[i]+'"';
1084
- }
1085
- where="";
1086
- previous='';
1087
- for(i=1; i<cond_id; i++) {
1088
- if(jQuery('#'+i).html()) {
1089
- if(jQuery('#op_'+i).val()=="%..%")
1090
- op_val=' LIKE "%'+jQuery('#val_'+i).val()+'%"';
1091
- else if(jQuery('#op_'+i).val()=="%..")
1092
- op_val=' LIKE "%'+jQuery('#val_'+i).val()+'"';
1093
- else if(jQuery('#op_'+i).val()=="..%")
1094
- op_val=' LIKE "'+jQuery('#val_'+i).val()+'%"';
1095
- else
1096
- op_val=' '+jQuery('#op_'+i).val()+' "'+jQuery('#val_'+i).val()+'"';
1097
- where+=previous+' `'+jQuery('#sel_'+i).val()+'`'+op_val;
1098
- previous=' '+ jQuery('#andor_'+i).val();
1099
- }
1100
- }
1101
- if(vals) {
1102
- query="UPDATE "+jQuery('#tables').val()+" SET " + vals+(where? ' WHERE'+where: '') ;
1103
- }
1104
- }
1105
-
1106
- if(con_method=="delete") {
1107
- where="";
1108
- previous='';
1109
- for(i=1; i<cond_id; i++) {
1110
- if(jQuery('#'+i).html()) {
1111
- if(jQuery('#op_'+i).val()=="%..%")
1112
- op_val=' LIKE "%'+jQuery('#val_'+i).val()+'%"';
1113
-
1114
- else if(jQuery('#op_'+i).val()=="%..")
1115
- op_val=' LIKE "%'+jQuery('#val_'+i).val()+'"';
1116
-
1117
- else if(jQuery('#op_'+i).val()=="..%")
1118
- op_val=' LIKE "'+jQuery('#val_'+i).val()+'%"';
1119
-
1120
- else
1121
- op_val=' '+jQuery('#op_'+i).val()+' "'+jQuery('#val_'+i).val()+'"';
1122
- where+=previous+' '+jQuery('#sel_'+i).val()+op_val;
1123
- previous=' '+ jQuery('#andor_'+i).val();
1124
- }
1125
- }
1126
- if(where) {
1127
- query="DELETE FROM "+jQuery('#tables').val()+ ' WHERE'+where ;
1128
- }
1129
- }
1130
- jQuery('#query_txt').val(query);
1131
- }
1132
 
1133
- jQuery(document).ready(function () {
1134
- jQuery(".hasTip").tooltip({
1135
- track: true,
1136
- content: function () {
1137
- return jQuery(this).prop('title');
1138
- }
1139
- });
1140
- });
1141
 
1142
- function insert_field(myValue) {
1143
- if(!selected_field)
1144
- return;
1145
- myField=document.getElementById(selected_field);
1146
- if (document.selection) {
1147
- myField.focus();
1148
- sel = document.selection.createRange();
1149
- sel.text = myValue;
1150
- }
1151
- else {
1152
- if (myField.selectionStart || myField.selectionStart == '0') {
1153
- var startPos = myField.selectionStart;
1154
- var endPos = myField.selectionEnd;
1155
- myField.value = myField.value.substring(0, startPos)
1156
- + "{"+myValue+"}"
1157
- + myField.value.substring(endPos, myField.value.length);
1158
- }
1159
- else {
1160
- myField.value += "{"+myValue+"}";
1161
- }
1162
- }
1163
- }
1164
- </script>
1165
- <style>
1166
- .cols div:nth-child(even) {background: #FFF;}
1167
- .cols div:nth-child(odd) {background: #F5F5F5;}
1168
- .cols div {
1169
- height: 28px;
1170
- padding: 5px;
1171
- }
1172
- .cols label {
1173
- display:inline-block;
1174
- width:200px;
1175
- font-size:15px;
1176
- overflow: hidden;
1177
- white-space: nowrap;
1178
- text-overflow: ellipsis;
1179
- vertical-align: middle;
1180
- }
1181
- .cols input[type="text"] {
1182
- width: 220px;
1183
- line-height: 18px;
1184
- height: 20px;
1185
- }
1186
- .cols input[type="text"]:disabled {
1187
- cursor: not-allowed;
1188
- background-color: #eee;
1189
- }
1190
- .cols input[type="checkbox"] {
1191
- width: 20px;
1192
- line-height: 18px;
1193
- height: 20px;
1194
- vertical-align: middle;
1195
- }
1196
- .cols select {
1197
- line-height: 18px;
1198
- height: 24px;
1199
- }
1200
- #fieldlist {
1201
- position: absolute;
1202
- width:225px;
1203
- background: #fff;
1204
- border: solid 1px #c7c7c7;
1205
- top: 0;
1206
- left: 0;
1207
- z-index: 1000;
1208
- }
1209
- #fieldlist a {
1210
- padding: 5px;
1211
- cursor:pointer;
1212
- overflow: hidden;
1213
- white-space: nowrap;
1214
- text-overflow: ellipsis;
1215
- }
1216
- #fieldlist a:hover {
1217
- background: #ccc;
1218
- }
1219
- .gen_query, .gen_query:focus {
1220
- width: 200px;
1221
- height: 38px;
1222
- background: #0E73D4;
1223
- color: white;
1224
- cursor: pointer;
1225
- border: 0px;
1226
- font-size: 16px;
1227
- font-weight: bold;
1228
- margin: 20px;
1229
- }
1230
- .gen_query:active {
1231
- background: #ccc;
1232
- }
1233
- </style>
1234
- <?php
1235
- if($table_struct) {
1236
- ?>
1237
-
1238
- <div class="cols">
1239
- <?php
1240
- if($con_method=='insert' or $con_method=='update') {
1241
- echo '<div style="background: none;text-align: center;font-size: 20px;color: rgb(0, 164, 228);font-weight: bold;"> SET </div>';
1242
- foreach($table_struct as $col) {
1243
- $title=' '.$col->Field;
1244
- $title.="<ul style='padding-left: 17px;'>";
1245
- $title.="<li>Type - ".$col->Type."</li>";
1246
- $title.="<li>Null - ".$col->Null."</li>";
1247
- $title.="<li>Key - ".$col->Key."</li>";
1248
- $title.="<li>Default - ".$col->Default."</li>";
1249
- $title.="<li>Extra - ".$col->Extra."</li>";
1250
- $title.="</ul>";
1251
- ?>
1252
- <div><label title="<?php echo $title; ?>" class="hasTip"><b><?php echo $col->Field; ?></b><img src="<?php echo WD_FM_URL . '/images/info.png'; ?>" style="width:20px; vertical-align:middle;padding-left: 10px;" /></label><input type="text" id="<?php echo $col->Field; ?>" disabled="disabled"/><input id="ch_<?php echo $col->Field; ?>" type="checkbox" onClick="dis('<?php echo $col->Field; ?>', this.checked)"/></div>
1253
- <?php
1254
- }
1255
- }
1256
- if($con_method=='delete' or $con_method=='update') {
1257
- echo '<div style="background: none;text-align: center;font-size: 20px;color: rgb(0, 164, 228);font-weight: bold;"> WHERE </div>
1258
-
1259
- <img src="' . WD_FM_URL . '/images/add_condition.png" title="ADD" class="add_cond"/></br>';
1260
- }
1261
- ?>
1262
- </div>
1263
- <br/>
1264
- <input type="button" value="Generate Query" class="gen_query" onclick="gen_query()">
1265
- <br/>
1266
- <form name="query_form" id="query_form" >
1267
- <label style="vertical-align: top;" for="query_txt" > Query: </label><textarea id="query_txt" name="query" rows=5 style="width:428px"></textarea>
1268
- <input type="hidden" name="details" id="details">
1269
- </form>
1270
- <input type="button" value="Save" style="float: right;width: 200px;height: 38px;background: #0E73D4;color: white;cursor: pointer;border: 0px;font-size: 16px;font-weight: bold;margin: 20px;" onclick="save_query()">
1271
- <div id="fieldlist" style="display: none;">
1272
- <?php echo $form_fields ?>
1273
- </div>
1274
- <?php
1275
- }
1276
- die();
1277
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1278
 
1279
  ////////////////////////////////////////////////////////////////////////////////////////
1280
  // Getters & Setters //
23
  // Public Methods //
24
  ////////////////////////////////////////////////////////////////////////////////////////
25
 
26
+ public function edit_query($id, $form_id) {
27
  wp_print_scripts('jquery');
28
  wp_print_scripts('jquery-ui-tooltip');
29
  ?>
30
+ <link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/style.css'; ?>" rel="stylesheet">
31
+ <link rel="stylesheet" href="<?php echo WD_FM_URL . '/css/jquery-ui-1.10.3.custom.css'; ?>">
32
+ <?php
33
+ $label = $this->model->get_labels($form_id);
34
+ $query_obj = $this->model->get_query($id);
35
+
36
+ $temp = explode('***wdfcon_typewdf***',$query_obj->details);
37
+ $con_type = $temp[0];
38
+ $temp = explode('***wdfcon_methodwdf***',$temp[1]);
39
+ $con_method = $temp[0];
40
+ $temp = explode('***wdftablewdf***',$temp[1]);
41
+ $table_cur = $temp[0];
42
+ $temp = explode('***wdfhostwdf***',$temp[1]);
43
+ $host = $temp[0];
44
+ $temp = explode('***wdfportwdf***',$temp[1]);
45
+ $port = $temp[0];
46
+ $temp = explode('***wdfusernamewdf***',$temp[1]);
47
+ $username = $temp[0];
48
+ $temp = explode('***wdfpasswordwdf***',$temp[1]);
49
+ $password = $temp[0];
50
+ $temp = explode('***wdfdatabasewdf***',$temp[1]);
51
+ $database = $temp[0];
52
+ $details = $temp[1];
53
+
54
+ $tables = $this->model->get_tables_saved($con_type, $username, $password, $database, $host);
55
+ $table_struct = $this->model->get_table_struct_saved($con_type, $username, $password, $database, $host, $table_cur, $con_method);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
 
57
+ $filter_types=array("type_submit_reset", "type_map", "type_editor", "type_captcha", "type_recaptcha", "type_button", "type_paypal_total", "type_send_copy");
58
+ $label_id= array();
59
+ $label_order= array();
60
+ $label_order_original= array();
61
+ $label_type= array();
62
+
63
+ $label_all = explode('#****#',$label);
64
+ $label_all = array_slice($label_all,0, count($label_all)-1);
65
+
66
+ foreach($label_all as $key => $label_each) {
67
+ $label_id_each=explode('#**id**#',$label_each);
68
+ $label_oder_each=explode('#**label**#', $label_id_each[1]);
69
+
70
+ if(in_array($label_oder_each[1],$filter_types))
71
+ continue;
72
+
73
+ array_push($label_id, $label_id_each[0]);
74
+ array_push($label_order_original, $label_oder_each[0]);
75
+ $ptn = "/[^a-zA-Z0-9_]/";
76
+ $rpltxt = "";
77
+ $label_temp=preg_replace($ptn, $rpltxt, $label_oder_each[0]);
78
+ array_push($label_order, $label_temp);
79
+ array_push($label_type, $label_oder_each[1]);
80
+ }
81
+
82
+ $form_fields='';
83
+ foreach($label_id as $key => $lid) {
84
+ $form_fields.='<a onclick="insert_field('.$lid.'); jQuery(\'#fieldlist\').hide();" style="display:block; text-decoration:none;">'.$label_order_original[$key].'</a>';
85
+ }
86
+ $user_fields = array("subid"=>"Submission ID", "ip"=>"Submitter's IP", "userid"=>"User ID", "username"=>"Username", "useremail"=>"User Email");
87
+ foreach($user_fields as $user_key=>$user_field) {
88
+ $form_fields.='<a onclick="insert_field(\''.$user_key.'\'); jQuery(\'#fieldlist\').hide();" style="display:block; text-decoration:none;">'.$user_field.'</a>';
89
+ }
90
+
91
+ $cond='<div id="condid"><select id="sel_condid" style="width: 160px">';
92
+ foreach($table_struct as $col) {
93
+ $cond.='<option>'.str_replace("'", "SingleQuot", $col->Field).'</option>';
94
+ }
95
+ $cond.='</select>';
96
+ $cond.='<select id="op_condid"><option value="=" selected="selected">=</option><option value="!=">!=</option><option value=">">&gt;</option><option value="<">&lt;</option><option value=">=">&gt;=</option><option value="<=">&lt;=</option><option value="%..%">Like</option><option value="%..">Starts with</option><option value="..%">Ends with</option></select><input id="val_condid" style="width:170px" type="text" /><select id="andor_condid" style="visibility: hidden;"><option value="AND">AND</option><option value="OR">OR</option></select><img src="' . WD_FM_URL . '/images/delete.png?ver='. get_option("wd_form_maker_version").'" onclick="delete_cond(&quot;condid&quot;)" style="vertical-align: middle;"></div>';
97
+ ?>
98
+ <script>
99
+ function connect() {
100
+ jQuery("input[type='radio']").attr('disabled','');
101
+ jQuery('#struct').html('<div class="fm-loading-container"><div class="fm-loading-content"></div></div>');
102
+ jQuery("#struct").load('index.php?option=com_formmaker&task=db_tables&con_type='+jQuery('input[name=con_type]:checked').val()+'&con_method='+jQuery('input[name=con_method]:checked').val()+'&format=row');
103
+ }
104
+ jQuery(document).ready(function() {
105
+ jQuery("#tables").change(function (){
106
+ jQuery("#struct").removeClass("fm_loading");
107
+ jQuery("#table_struct").load('index.php?option=com_formmaker&task=db_table_struct&name='+jQuery(this).val()+'&con_type='+jQuery('input[name=con_type]:checked').val()+'&con_method='+jQuery('input[name=con_method]:checked').val()+'&host='+jQuery('#host_rem').val()+'&port='+jQuery('#port_rem').val()+'&username='+jQuery('#username_rem').val()+'&password='+jQuery('#password_rem').val()+'&database='+jQuery('#database_rem').val()+'&format=row&id='+jQuery("#form_id").val());
108
+ });
109
+ jQuery('html').click(function() {
110
+ if(jQuery("#fieldlist").css('display')=="block") {
111
+ jQuery("#fieldlist").hide();
112
+ }
113
+ });
114
+ jQuery('.cols input[type="text"]').on('click', function() {
115
+ event.stopPropagation();
116
+ jQuery("#fieldlist").css("top",jQuery(this).offset().top+jQuery(this).height()+2);
117
+ jQuery("#fieldlist").css("left",jQuery(this).offset().left);
118
+ jQuery("#fieldlist").slideDown('fast');
119
+ selected_field=this.id;
120
+ });
121
+ jQuery('#query_txt').click(function() {
122
+ event.stopPropagation();
123
+ jQuery("#fieldlist").css("top",jQuery(this).offset().top+jQuery(this).height()+2);
124
+ jQuery("#fieldlist").css("left",jQuery(this).offset().left);
125
+ jQuery("#fieldlist").slideDown('fast');
126
+ selected_field=this.id;
127
+ });
128
+ jQuery('#fieldlist').click(function(event){
129
+ event.stopPropagation();
130
+ });
131
+ jQuery('.add_cond').click( function() {
132
+ jQuery('.cols').append(conds.replace(/condid/g, cond_id++).replace('SingleQuot', "'"));
133
+ update_vis();
134
+ });
135
+ });
136
+ var selected_field ='';
137
+ var isvisible = 1;
138
+ var cond_id = 1;
139
+ conds='<?php echo $cond ?>';
140
+ fields=new Array(<?php
141
+ $fields = "";
142
+ if($table_struct) {
143
+ foreach($table_struct as $col) {
144
+ $fields.=' "'.$col->Field.'",';
145
+ }
146
+ echo substr($fields, 0, -1);
147
+ }
148
+ ?>);
149
 
150
+ function dis(id, x) {
151
+ if(x)
152
+ jQuery('#'+id).removeAttr('disabled');
153
+ else
154
+ jQuery('#'+id).attr('disabled','disabled');
155
+ }
156
+ function update_vis() {
157
+ previous=0;
158
+ for(i=1; i<cond_id; i++) {
159
+ if(jQuery('#'+i).html()) {
160
+ jQuery('#andor_'+i).css('visibility', 'hidden');
161
+ if(previous)
162
+ jQuery('#andor_'+previous).css('visibility', 'visible');
163
+ previous=i;
164
+ }
165
+ }
166
+ }
167
+ function delete_cond(id) {
168
+ jQuery('#'+id).remove();
169
+ update_vis();
170
+ }
171
+ function save_query() {
172
+ con_type =jQuery('input[name=con_type]:checked').val();
173
+ con_method =jQuery('input[name=con_method]:checked').val();
174
+ table =jQuery('#tables').val();
175
+ host =jQuery('#host_rem').val();
176
+ port =jQuery('#port_rem').val();
177
+ username =jQuery('#username_rem').val();
178
+ password =jQuery('#password_rem').val();
179
+ database =jQuery('#database_rem').val();
180
+
181
+ str=con_type+"***wdfcon_typewdf***"+con_method+"***wdfcon_methodwdf***"+table+"***wdftablewdf***"+host+"***wdfhostwdf***"+port+"***wdfportwdf***"+username+"***wdfusernamewdf***"+password+"***wdfpasswordwdf***"+database+"***wdfdatabasewdf***";
182
+
183
+ if(fields.length) {
184
+ for(i=0; i<fields.length; i++) {
185
+ str+=fields[i]+'***wdfnamewdf***'+jQuery('#'+fields[i]).val()+'***wdfvaluewdf***'+jQuery('#ch_'+fields[i]+":checked" ).length+'***wdffieldwdf***';
186
+ }
187
+ }
188
+
189
+ for(i=1; i<cond_id; i++) {
190
+ if(jQuery('#'+i).html()) {
191
+ str+=jQuery('#sel_'+i).val()+'***sel***'+jQuery('#op_'+i).val()+'***op***'+jQuery('#val_'+i).val()+'***val***'+jQuery('#andor_'+i).val()+'***where***';
192
+ }
193
+ }
194
+ if(!jQuery('#query_txt').val()) {
195
+ gen_query();
196
+ }
197
+ jQuery('#details').val(str);
198
+ var datatxt = jQuery("#query_form").serialize()+'&form_id='+jQuery("#form_id").val();
199
+
200
+ if(jQuery('#query_txt').val()) {
201
+ jQuery('.c1').html('<div class="fm-loading-container"><div class="fm-loading-content"></div></div>');
202
 
203
+ jQuery.ajax({
204
+ type: "POST",
205
+ url: "<?php echo add_query_arg(array('action' => 'FormMakerSQLMapping', 'id' => $id, 'form_id' => $form_id, 'task' => 'update_query', 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>",
206
+ data: datatxt,
207
+ success: function(data) {
208
+ window.parent.wd_fm_apply_options('apply_options');
209
+ window.parent.tb_remove();
210
+ }
211
+ });
212
+ }
213
+ else {
214
+ alert('The query is empty.');
215
+ }
216
+ return false;
217
+ }
 
 
 
 
 
 
 
 
 
 
 
218
 
219
+ function gen_query() {
220
+ if(jQuery('#query_txt').val())
221
+ if(!confirm('Are you sure you want to replace the Query? All the modifications to the Query will be lost.'))
222
+ return;
223
+ query="";
224
+ fields=new Array(<?php
225
+ $fields = "";
226
+ if($table_struct) {
227
+ foreach($table_struct as $col) {
228
+ $fields.=' "'.str_replace("'", "SingleQuot", $col->Field).'",';
229
+ }
230
+ echo substr($fields, 0, -1);
231
+ }
232
+ ?>);
 
 
 
233
 
234
+ con_type =jQuery('input[name=con_type]:checked').val();
235
+ con_method =jQuery('input[name=con_method]:checked').val();
236
+ table =jQuery('#tables').val();
237
+ fls='';
238
+ vals='';
239
+ valsA=new Array();
240
+ flsA=new Array();
241
+
242
+ if(fields.length) {
243
+ for(i=0; i<fields.length; i++) {
244
+ if(jQuery('#ch_'+fields[i]+":checked" ).length) {
245
+ flsA.push(fields[i]);
246
+ valsA.push(jQuery('#'+fields[i]).val());
247
+ }
248
+ }
249
+ }
250
+ if(con_method=="insert") {
251
+ if(flsA.length) {
252
+ for(i=0; i<flsA.length-1; i++) {
253
+ fls+= '`'+flsA[i]+'`, ';
254
+ vals+= '"'+valsA[i]+'", ';
255
+ }
256
+ fls+= '`'+flsA[i]+'`';
257
+ vals+= '"'+valsA[i]+'"';
258
+ }
259
+ if(fls)
260
+ query="INSERT INTO "+jQuery('#tables').val()+" (" +fls+") VALUES ("+vals+")";
261
+ }
262
+
263
+ if(con_method=="update") {
264
+ if(flsA.length) {
265
+ for(i=0; i<flsA.length-1; i++) {
266
+ vals+= '`'+flsA[i]+'`="'+valsA[i]+'", ';
267
+ }
268
+ vals+= '`'+flsA[i]+'`="'+valsA[i]+'"';
269
+ }
270
+ where="";
271
+ previous='';
272
+
273
+ for(i=1; i<cond_id; i++) {
274
+ if(jQuery('#'+i).html()) {
275
+ if(jQuery('#op_'+i).val()=="%..%")
276
+ op_val=' LIKE "%'+jQuery('#val_'+i).val()+'%"';
277
+ else if(jQuery('#op_'+i).val()=="%..")
278
+ op_val=' LIKE "%'+jQuery('#val_'+i).val()+'"';
279
+ else if(jQuery('#op_'+i).val()=="..%")
280
+ op_val=' LIKE "'+jQuery('#val_'+i).val()+'%"';
281
+ else
282
+ op_val=' '+jQuery('#op_'+i).val()+' "'+jQuery('#val_'+i).val()+'"';
283
+ where+=previous+' `'+jQuery('#sel_'+i).val()+'`'+op_val;
284
+ previous=' '+ jQuery('#andor_'+i).val();
285
+ }
286
+ }
287
+ if(vals)
288
+ query="UPDATE "+jQuery('#tables').val()+" SET " + vals+(where? ' WHERE'+where: '') ;
289
+ }
290
+ if(con_method=="delete") {
291
+ where="";
292
+ previous='';
293
+ for(i=1; i<cond_id; i++) {
294
+ if(jQuery('#'+i).html()) {
295
+ if(jQuery('#op_'+i).val()=="%..%")
296
+ op_val=' LIKE "%'+jQuery('#val_'+i).val()+'%"';
297
+ else if(jQuery('#op_'+i).val()=="%..")
298
+ op_val=' LIKE "%'+jQuery('#val_'+i).val()+'"';
299
+ else if(jQuery('#op_'+i).val()=="..%")
300
+ op_val=' LIKE "'+jQuery('#val_'+i).val()+'%"';
301
+ else
302
+ op_val=' '+jQuery('#op_'+i).val()+' "'+jQuery('#val_'+i).val()+'"';
303
+ where+=previous+' '+jQuery('#sel_'+i).val()+op_val;
304
+ previous=' '+ jQuery('#andor_'+i).val();
305
+ }
306
+ }
307
+ if(where)
308
+ query="DELETE FROM "+jQuery('#tables').val()+ ' WHERE'+where ;
309
+ }
310
+ jQuery('#query_txt').val(query.replace("SingleQuot", "'"));
311
+ }
312
 
313
+ jQuery(document).ready(function () {
314
+ jQuery(".hasTip").tooltip({
315
+ track: true,
316
+ content: function () {
317
+ return jQuery(this).prop('title');
318
+ }
319
+ });
320
+ });
321
 
322
+ function insert_field(myValue) {
323
+ if(!selected_field)
324
+ return;
325
+ myField=document.getElementById(selected_field);
326
+ if (document.selection) {
327
+ myField.focus();
328
+ sel = document.selection.createRange();
329
+ sel.text = myValue;
330
+ }
331
+ else {
332
+ if (myField.selectionStart || myField.selectionStart == '0') {
333
+ var startPos = myField.selectionStart;
334
+ var endPos = myField.selectionEnd;
335
+ myField.value = myField.value.substring(0, startPos)
336
+ + "{"+myValue+"}"
337
+ + myField.value.substring(endPos, myField.value.length);
338
+ }
339
+ else {
340
+ myField.value += "{"+myValue+"}";
341
+ }
342
+ }
343
+ }
344
+ </script>
345
+ <style>
346
+ .c1 {
347
+ padding: 0 10px;
348
+ }
349
+
350
+ .main_func{
351
+ font-family: Segoe UI;
352
+ display: inline-block;
353
+ width: 550px;
354
+ }
355
+
356
+ .main_func .admintable {
357
+ width: 100%;
358
+ padding: 10px 0;
359
+ margin-bottom: 15px;
360
+ }
361
+
362
+ .main_func .admintable .key{
363
+ width: 36%;
364
+ }
365
+
366
+ .main_func .admintable input[type='text'],
367
+ .main_func .admintable input[type='password']{
368
+ padding: 4px 6px;
369
+ width:244px;
370
+ }
371
+
372
+ .btn.connect {
373
+ background:#4EC0D9;
374
+ width:78px;
375
+ height:32px;
376
+ border:1px solid #4EC0D9;
377
+ border-radius:0px;
378
+ color:#fff;
379
+ cursor:pointer;
380
+ }
381
+
382
+ .desc {
383
+ font-size: 13px;
384
+ display: inline-block;
385
+ width: 265px;
386
+ position: fixed;
387
+ margin: 15px;
388
+ margin-left: 45px;
389
+ }
390
+
391
+ .desc > div {
392
+ margin-top:3px;
393
+ }
394
+
395
+ .desc div span {
396
+ width: 62px;
397
+ display: inline-block;
398
+ }
399
+
400
+ .desc button {
401
+ max-width: 190px;
402
+ overflow: hidden;
403
+ white-space: nowrap;
404
+ text-overflow: ellipsis;
405
+ padding: 4px;
406
+ background: #eee;
407
+ border: 1px solid #ccc;
408
+ border-radius:0px;
409
+ height:27px;
410
+ }
411
+
412
+ .key label {
413
+ display:inline-block;
414
+ width:150px;
415
+ }
416
+
417
+ .select-db-label {
418
+ display: inline-block;
419
+ font-size: 16px;
420
+ width: 201px;
421
+
422
+ }
423
+
424
+ .select-db-select {
425
+ width:325px;
426
+ padding:6px;
427
+ }
428
+
429
+ .struct {
430
+ border: 3px solid red;
431
+ padding: 4px 6px;
432
+ display: inline-block;
433
+ margin-top:10px;
434
+ }
435
+
436
+ .cols div:nth-child(even) {background: #FFF}
437
+ .cols div:nth-child(odd) {background: #F5F5F5}
438
+ .cols div {
439
+ height: 28px;
440
+ padding: 5px
441
+ }
442
 
443
+ .cols label {
444
+ display: inline-block;
445
+ width: 175px;
446
+ font-size: 15px;
447
+ overflow: hidden;
448
+ white-space: nowrap;
449
+ text-overflow: ellipsis;
450
+ vertical-align: middle;
451
+ }
452
+
453
+ .cols input[type="text"] {
454
+ width: 295px;
455
+ line-height: 18px;
456
+ height: 28px;
457
+ border: 1px solid #ccc;
458
+ padding: 0 3px;
459
+ margin-right: 2px;
460
+ }
461
+
462
+ .cols input[type="text"]:disabled {
463
+ cursor: not-allowed;
464
+ background-color: #eee;
465
+ }
466
+
467
+ .cols input[type="checkbox"] {
468
+ width: 20px;
469
+ line-height: 18px;
470
+ height: 20px;
471
+ vertical-align: middle;
472
+ }
473
+
474
+ .cols select {
475
+ line-height: 18px;
476
+ height: 28px;
477
+ margin-right: 2px;
478
+ }
479
+
480
+ #fieldlist {
481
+ position: absolute;
482
+ width:225px;
483
+ background: #fff;
484
+ border: solid 1px #c7c7c7;
485
+ top: 0;
486
+ left: 0;
487
+ z-index: 1000;
488
+ }
489
+
490
+ #fieldlist a {
491
+ padding: 5px;
492
+ cursor:pointer;
493
+ overflow: hidden;
494
+ white-space: nowrap;
495
+ text-overflow: ellipsis;
496
+ }
497
+
498
+ #fieldlist a:hover {
499
+ background: #ccc;
500
+ }
501
+
502
+ .gen_query, .gen_query:focus {
503
+ width: 148px;
504
+ height: 38px;
505
+ background: #4EC0D9;
506
+ color: white;
507
+ cursor: pointer;
508
+ border: 0px;
509
+ font-size: 14px;
510
+ font-weight: bold;
511
+ margin: 20px 0;
512
+ border-radius: 0px;
513
+ }
514
+
515
+ .gen_query:active {
516
+ background: #ccc;
517
+ }
518
+
519
+ .fm-query-save {
520
+ float: right;
521
+ font-size: 13px;
522
+ margin: 0 20px;
523
+ background: #4EC0D9;
524
+ width: 83px;
525
+ height: 34px;
526
+ border: 1px solid #4EC0D9;
527
+ border-radius: 0px;
528
+ color: #fff;
529
+ cursor: pointer;
530
+ }
531
+
532
+ .select-db-op {
533
+ display: inline-block;
534
+ text-align: right;
535
+ font-weight: bold;
536
+ font-size: 18px;
537
+ padding: 5px 0;
538
+ margin: 5px 0;
539
+ background:none !important;
540
+ }
541
+
542
+ .select-db-op.where{
543
+ width: 272px;
544
+ }
545
+
546
+ .select-db-op img{
547
+ float:left;
548
+ }
549
+
550
+ .select-db-label {
551
+ display: inline-block;
552
+ font-size: 16px;
553
+ width: 201px;
554
+
555
+ }
556
+ .select-db-select {
557
+ width:325px;
558
+ padding:6px;
559
+ }
560
+
561
+ .fm-query-save {
562
+ float: right;
563
+ font-size: 13px;
564
+ margin: 0 20px;
565
+ background: #4EC0D9;
566
+ width: 83px;
567
+ height: 34px;
568
+ border: 1px solid #4EC0D9;
569
+ border-radius: 0px;
570
+ color: #fff;
571
+ cursor: pointer;
572
+ }
573
+ </style>
574
+ <div class="c1">
575
+ <div class="main_func">
576
+ <table class="admintable">
577
+ <tr valign="top">
578
+ <td class="key">
579
+ <label style="font-size:20px;">Connection type: </label>
580
+ </td>
581
+ <td>
582
+ <input type="radio" name="con_type" id="local" value="local" <?php if($con_type=='local') echo 'checked="checked"'?> disabled>
583
+ <label for="local">Local</label>
584
+ <input type="radio" name="con_type" id="remote" value="remote" <?php if($con_type=='remote') echo 'checked="checked"'?> disabled>
585
+ <label for="remote">Remote</label>
586
+ </td>
587
+ <td rowspan="2">
588
+ <input type="button" value="Connect" onclick="connect()" class="btn connect" disabled>
589
+ </td>
590
+ </tr>
591
+ <tr class="remote_info" <?php if($con_type=='local') echo 'style="display:none"'?>>
592
+ <td class="key">Host</td>
593
+ <td>
594
+ <input type="text" name="host" id="host_rem" style="width:150px" value="<?php echo $host; ?>" disabled>
595
+ Port : <input type="text" name="port" id="port_rem" value="<?php echo $port; ?>" style="width:48px" disabled>
596
+ </td>
597
+ </tr>
598
+ <tr class="remote_info" <?php if($con_type=='local') echo 'style="display:none"'?>>
599
+ <td class="key">Username</td>
600
+ <td>
601
+ <input type="text" name="username" id="username_rem" value="<?php echo $username; ?>" disabled>
602
+ </td>
603
+ </tr>
604
+ <tr class="remote_info" <?php if($con_type=='local') echo 'style="display:none"'?>>
605
+ <td class="key">Password</td>
606
+ <td>
607
+ <input type="password" name="password" id="password_rem" value="<?php echo $password; ?>" disabled>
608
+ </td>
609
+ </tr>
610
+ <tr class="remote_info" <?php if($con_type=='local') echo 'style="display:none"'?>>
611
+ <td class="key">Database</td>
612
+ <td>
613
+ <input type="text"name="database" id="database_rem" value="<?php echo $database; ?>" disabled>
614
+ </td>
615
+ </tr>
616
+ <tr valign="top">
617
+ <td class="key">
618
+ <label style="font-size:20px;">Type: </label>
619
+ </td>
620
+ <td>
621
+ <input type="radio" name="con_method" id="insert" value="insert" <?php if($con_method=='insert') echo 'checked="checked"'?> disabled>
622
+ <label for="insert">Insert</label>
623
+ <input type="radio" name="con_method" id="update" value="update" <?php if($con_method=='update') echo 'checked="checked"'?> disabled>
624
+ <label for="update">Update</label>
625
+ <input type="radio" name="con_method" id="delete" value="delete" <?php if($con_method=='delete') echo 'checked="checked"'?> disabled>
626
+ <label for="delete">Delete</label>
627
+ </td>
628
+ </tr>
629
+ </table>
630
+ <div id="struct">
631
+ <label for="tables" class="select-db-label">Select a table</label>
632
+ <select name="tables" id="tables" class="select-db-select" disabled>
633
+ <option value="" ></option>
634
+ <?php
635
+ foreach($tables as $table) {
636
+ echo '<option value="'.$table.'" '.($table_cur==$table ? 'selected' : '').' >'.$table.'</option>';
637
+ }
638
+ ?>
639
+ </select>
640
+ <br/>
641
+ <div id="table_struct">
642
+ <?php
643
+ if($table_struct) {
644
+ ?>
645
+ <div class="struct">
646
+ <div class="cols">
647
+ <?php
648
+ $temps=explode('***wdffieldwdf***',$details);
649
+ $wheres = $temps[count($temps)-1];
650
+ $temps = array_slice($temps,0, count($temps)-1);
651
+ $col_names= array();
652
+ $col_vals= array();
653
+ $col_checks= array();
654
 
655
+ foreach($temps as $temp) {
656
+ $temp=explode('***wdfnamewdf***',$temp);
657
+ array_push($col_names, $temp[0]);
658
+ $temp=explode('***wdfvaluewdf***',$temp[1]);
659
+ array_push($col_vals, $temp[0]);
660
+ array_push($col_checks, $temp[1]);
661
+ }
662
+ if($con_method=='insert' or $con_method=='update') {
663
+ echo '<div style="background: none;text-align: center;font-size: 20px;color: #000;font-weight: bold;"> SET </div>';
664
 
665
+ foreach($table_struct as $key =>$col) {
666
+ $title=' '.$col->Field;
667
+ $title.="<ul style='padding-left: 17px;'>";
668
+ $title.="<li>Type - ".$col->Type."</li>";
669
+ $title.="<li>Null - ".$col->Null."</li>";
670
+ $title.="<li>Key - ".$col->Key."</li>";
671
+ $title.="<li>Default - ".$col->Default."</li>";
672
+ $title.="<li>Extra - ".$col->Extra."</li>";
673
+ $title.="</ul>";
674
+ ?>
675
+ <div><label title="<?php echo $title; ?>" class="hasTip"><b><?php echo $col->Field; ?></b><img src="<?php echo WD_FM_URL . '/images/info.png?ver='. get_option("wd_form_maker_version").''; ?>" style="width:20px; vertical-align:middle;padding-left: 10px;" /></label><input type="text" id="<?php echo str_replace("'", "SingleQuot", $col->Field); ?>" <?php if(!$col_checks[$key]) echo 'disabled="disabled"'?> value="<?php echo $col_vals[$key]; ?>" /><input id="ch_<?php echo str_replace("'", "SingleQuot", $col->Field); ?>" type="checkbox" onClick="dis('<?php echo str_replace("'", "SingleQuot", $col->Field); ?>', this.checked)" <?php if($col_checks[$key]) echo 'checked="checked"'?> /></div>
676
+ <?php
677
+ }
678
+ }
679
+
680
+ if($con_method=='delete' or $con_method=='update') {
681
+ echo '<div class="select-db-op where"><img src="'.WD_FM_URL . '/images/add_condition.png?ver='. get_option("wd_form_maker_version").'" title="ADD" class="add_cond"/>WHERE</div>';
682
+ if($wheres) {
683
+ echo '<script>';
684
 
685
+ $wheres = explode('***where***',$wheres);
686
+ $wheres = array_slice($wheres,0, count($wheres)-1);
687
+ foreach($wheres as $where) {
688
+ $temp=explode('***sel***',$where);
689
+ $sel = $temp[0];
690
+ $temp=explode('***op***',$temp[1]);
691
+ $op = $temp[0];
692
+ $temp=explode('***val***',$temp[1]);
693
+ $val = $temp[0];
694
+ $andor = $temp[1];
695
+ echo 'jQuery(".cols").append(conds.replace(/condid/g, cond_id++).replace(\'SingleQuot\', "\'")); update_vis();
696
+ jQuery("#sel_"+(cond_id-1)).val("'.html_entity_decode($sel, ENT_QUOTES).'");
697
+ jQuery("#op_"+(cond_id-1)).val("'.$op.'");
698
+ jQuery("#val_"+(cond_id-1)).val("'.$val.'");
699
+ jQuery("#andor_"+(cond_id-1)).val("'.$andor.'");';
700
+ }
701
+ echo '</script>';
702
+ }
703
+ }
704
+ ?>
705
+ </div>
706
+ <div style="color:red; background: none">The changes above will not affect the query until you click "Generate query".</div>
707
+ </div>
708
+ <br/>
709
+ <input type="button" value="Generate Query" class="gen_query" onclick="gen_query()">
710
+ <br/>
711
+ <form name="query_form" id="query_form" >
712
+ <label style="vertical-align: top; width: 102px; display: inline-block;" for="query_txt" > Query: </label><textarea id="query_txt" name="query" rows=5 style="width:428px" ><?php echo $query_obj->query; ?></textarea>
713
+ <input type="hidden" name="details" id="details">
714
+ <input type="hidden" name="id" value="<?php echo $query_obj->id; ?>">
715
+ </form>
716
+ <input type="button" value="Save" class="fm-query-save" onclick="save_query()">
717
+ <div id="fieldlist" style="display: none;">
718
+ <?php echo $form_fields; ?>
719
+ </div>
720
+ <?php
721
+ }
722
+ ?>
723
+ </div>
724
+ </div>
725
+ <input type="hidden" value="<?php echo $form_id ?>" id="form_id">
726
+ </div>
727
+ <div class="desc">
728
+ <?php
729
+ foreach($label_id as $key => $lid) {
730
+ echo '<div>{'.$lid.'} - <button onclick="insert_field('.$lid.');">'.$label_order_original[$key].'</button></div>';
731
+ }
732
+ $user_fields = array("subid"=>"Submission ID", "ip"=>"Submitter's IP", "userid"=>"User ID", "username"=>"Username", "useremail"=>"User Email");
733
+ foreach($user_fields as $user_key=>$user_field) {
734
+ echo '<div>{'.$user_key.'} - <button onclick="insert_field(\''.$user_key.'\');">'.$user_field.'</button></div>';
735
+ }
736
+ ?>
737
+ </div>
738
+ </div>
739
+ <?php
740
+ die();
741
+ }
742
 
743
+ public function add_query($form_id){
744
+ wp_print_scripts('jquery');
745
+ wp_print_scripts('jquery-ui-tooltip');
746
+ ?>
747
+ <link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/style.css'; ?>" rel="stylesheet">
748
+ <link rel="stylesheet" href="<?php echo WD_FM_URL . '/css/jquery-ui-1.10.3.custom.css'; ?>">
749
+ <?php
750
+ $label = $this->model->get_labels($form_id);
751
 
752
  $filter_types=array("type_submit_reset", "type_map", "type_editor", "type_captcha", "type_recaptcha", "type_button", "type_paypal_total", "type_send_copy");
753
  $label_id= array();
754
  $label_order= array();
755
  $label_order_original= array();
756
  $label_type= array();
757
+
758
+ $label_all = explode('#****#',$label);
759
+ $label_all = array_slice($label_all,0, count($label_all)-1);
 
 
760
  foreach($label_all as $key => $label_each) {
761
  $label_id_each=explode('#**id**#',$label_each);
762
  $label_oder_each=explode('#**label**#', $label_id_each[1]);
763
 
764
  if(in_array($label_oder_each[1],$filter_types))
765
  continue;
 
766
  array_push($label_id, $label_id_each[0]);
 
 
767
  array_push($label_order_original, $label_oder_each[0]);
 
768
  $ptn = "/[^a-zA-Z0-9_]/";
769
  $rpltxt = "";
770
  $label_temp=preg_replace($ptn, $rpltxt, $label_oder_each[0]);
771
  array_push($label_order, $label_temp);
 
772
  array_push($label_type, $label_oder_each[1]);
773
  }
774
+ ?>
775
+ <script>
776
+ function insert_field(){}
777
+
778
+ function connect() {
779
+ jQuery("input[type='radio']").attr('disabled','');
780
+ jQuery(".connect").attr('disabled','');
781
+ jQuery('#struct').html('<div class="fm-loading-container"><div class="fm-loading-content"></div></div>');
782
+ jQuery.ajax({
783
+ type: "POST",
784
+ url: "<?php echo add_query_arg(array('action' => 'FormMakerSQLMapping', 'id' => 0, 'form_id' => $form_id, 'task' => 'db_tables', 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>",
785
+ data: 'con_type='+jQuery('input[name=con_type]:checked').val()+'&con_method='+jQuery('input[name=con_method]:checked').val()+'&host='+jQuery('#host_rem').val()+'&port='+jQuery('#port_rem').val()+'&username='+jQuery('#username_rem').val()+'&password='+jQuery('#password_rem').val()+'&database='+jQuery('#database_rem').val()+'&format=row',
786
+ success: function(data) {
787
+ jQuery("#struct").removeClass("fm_loading");
788
+ if(data==1) {
789
+ jQuery("#struct").html('<div style="font-size: 22px; text-align: center; padding-top: 15px;">Could not connect to MySQL.</div>')
790
+ jQuery(".connect").removeAttr('disabled');
791
+ jQuery("input[type='radio']").removeAttr('disabled','');
792
+ }
793
+ else {
794
+ jQuery("#struct").html(data);
795
+ }
796
+
797
+ }
798
+ });
799
+ }
800
+
801
+ function shh(x) {
802
+ if(x)
803
+ jQuery(".remote_info").show();
804
+ else
805
+ jQuery(".remote_info").hide();
806
+ }
807
+ </script>
808
+ <style>
809
+ .c1 {
810
+ padding: 0 10px;
811
+ }
812
+
813
+ .main_func{
814
+ font-family: Segoe UI;
815
+ display: inline-block;
816
+ width: 550px;
817
+ }
818
+
819
+ .main_func .admintable {
820
+ width: 100%;
821
+ padding: 10px 0;
822
+ margin-bottom: 15px;
823
+ }
824
+
825
+ .main_func .admintable .key{
826
+ width: 36%;
827
+ }
828
+
829
+ .main_func .admintable input[type='text'],
830
+ .main_func .admintable input[type='password']{
831
+ padding: 4px 6px;
832
+ width:244px;
833
+ }
834
+
835
+ .btn.connect {
836
+ background:#4EC0D9;
837
+ width:78px;
838
+ height:32px;
839
+ border:1px solid #4EC0D9;
840
+ border-radius:0px;
841
+ color:#fff;
842
+ cursor:pointer;
843
+ }
844
+
845
+ .desc {
846
+ font-size: 13px;
847
+ display: inline-block;
848
+ width: 265px;
849
+ position: fixed;
850
+ margin: 15px;
851
+ margin-left: 45px;
852
+ }
853
+
854
+ .desc > div {
855
+ margin-top:3px;
856
+ }
857
+
858
+ .desc div span {
859
+ width: 62px;
860
+ display: inline-block;
861
+ }
862
+
863
+ .desc button {
864
+ max-width: 190px;
865
+ overflow: hidden;
866
+ white-space: nowrap;
867
+ text-overflow: ellipsis;
868
+ padding: 4px;
869
+ background: #eee;
870
+ border: 1px solid #ccc;
871
+ border-radius:0px;
872
+ height:27px;
873
+ }
874
+
875
+ .key label {
876
+ display:inline-block;
877
+ width:150px;
878
+ }
879
+
880
+ .select-db-label {
881
+ display: inline-block;
882
+ font-size: 16px;
883
+ width: 201px;
884
+
885
+ }
886
+
887
+ .select-db-select {
888
+ width:325px;
889
+ padding:6px;
890
+ }
891
+ </style>
892
+ <div class="c1">
893
+ <div class="main_func">
894
+ <table class="admintable">
895
+ <tr valign="top">
896
+ <td class="key">
897
+ <label style="font-size:20px;">Connection type: </label>
898
+ </td>
899
+ <td>
900
+ <input type="radio" name="con_type" id="local" value="local" checked="checked" onclick="shh(false)">
901
+ <label for="local">Local</label>
902
+ <input type="radio" name="con_type" id="remote" value="remote" onclick="shh(true)">
903
+ <label for="remote">Remote</label>
904
+ </td>
905
+ <td rowspan="2">
906
+ <input type="button" value="Connect" onclick="connect()" class="btn connect">
907
+ </td>
908
+ </tr>
909
+ <tr class="remote_info" style="display:none">
910
+ <td class="key">Host</td>
911
+ <td>
912
+ <input type="text" name="host" id="host_rem" style="width:150px">
913
+ Port : <input type="text" name="port" id="port_rem" value="3306" style="width:48px">
914
+ </td>
915
+ </tr>
916
+ <tr class="remote_info" style="display:none">
917
+ <td class="key">Username</td>
918
+ <td>
919
+ <input type="text" name="username" id="username_rem">
920
+ </td>
921
+ </tr>
922
+ <tr class="remote_info" style="display:none">
923
+ <td class="key">Password</td>
924
+ <td>
925
+ <input type="password" name="password" id="password_rem">
926
+ </td>
927
+ </tr>
928
+ <tr class="remote_info" style="display:none">
929
+ <td class="key">Database</td>
930
+ <td>
931
+ <input type="text"name="database" id="database_rem">
932
+ </td>
933
+ </tr>
934
+ <tr valign="top">
935
+ <td class="key">
936
+ <label style="font-size:20px;">Type: </label>
937
+ </td>
938
+ <td >
939
+ <input type="radio" name="con_method" id="insert" value="insert" checked="checked">
940
+ <label for="insert">Insert</label>
941
+ <input type="radio" name="con_method" id="update" value="update">
942
+ <label for="update">Update</label>
943
+ <input type="radio" name="con_method" id="delete" value="delete">
944
+ <label for="delete">Delete</label>
945
+ </td>
946
+ </tr>
947
+ </table>
948
+ <div id="struct">
949
+ </div>
950
+ <input type="hidden" value="<?php echo $form_id ?>" id="form_id">
951
+ </div>
952
+ <div class="desc">
953
+ <?php
954
+ foreach($label_id as $key => $lid) {
955
+ echo '<div><span>{'.$lid.'}</span> - <button onclick="insert_field('.$lid.');">'.$label_order_original[$key].'</button></div>';
956
+ }
957
+
958
+ $user_fields = array("subid"=>"Submission ID", "ip"=>"Submitter's IP", "userid"=>"User ID", "username"=>"Username", "useremail"=>"User Email");
959
+ foreach($user_fields as $user_key=>$user_field) {
960
+ echo '<div><span>{'.$user_key.'}</span> - <button onclick="insert_field(\''.$user_key.'\');">'.$user_field.'</button></div>';
961
+ }
962
+ ?>
963
+ </div>
964
+ </div>
965
+ <?php
966
+ die();
967
+ }
968
 
969
+ public function db_tables($form_id){
970
+ $tables = $this->model->get_tables();
971
+ ?>
972
+ <label for="tables" class="select-db-label">Select a table</label>
973
+ <select name="tables" id="tables" class="select-db-select">
974
+ <option value="" ></option>
975
+ <?php
976
+ foreach($tables as $table) {
977
+ echo '<option value="' . $table . '" >' . $table . '</option>';
978
+ }
979
+ ?>
980
+ </select>
981
+ <br/>
982
+ <div id="table_struct">
983
+ </div>
984
+ <script>
985
+ jQuery("#tables").change(function (){
986
+ jQuery('#table_struct').html('<div class="fm-loading-container"><div class="fm-loading-content"></div></div>');
987
+ jQuery.ajax({
988
+ type: "POST",
989
+ url: "<?php echo add_query_arg(array('action' => 'FormMakerSQLMapping', 'id' => 0, 'form_id' => $form_id, 'task' => 'db_table_struct', 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>",
990
+ data: 'name='+jQuery(this).val()+'&con_type='+jQuery('input[name=con_type]:checked').val()+'&con_method='+jQuery('input[name=con_method]:checked').val()+'&host='+jQuery('#host_rem').val()+'&port='+jQuery('#port_rem').val()+'&username='+jQuery('#username_rem').val()+'&password='+jQuery('#password_rem').val()+'&database='+jQuery('#database_rem').val()+'&format=row',
991
+ success: function(data) {
992
+ jQuery("#table_struct").removeClass("fm_loading");
993
+ jQuery("#table_struct").html(data);
994
+ }
995
+ });
996
+ })
997
+ </script>
998
+ <?php
999
+ die();
1000
+ }
1001
 
1002
  public function db_table_struct ($form_id) {
1003
  $table_struct = $this->model->get_table_struct();
1019
 
1020
  if(in_array($label_oder_each[1],$filter_types)) {
1021
  continue;
1022
+ }
1023
  array_push($label_id, $label_id_each[0]);
1024
  array_push($label_order_original, $label_oder_each[0]);
1025
  $ptn = "/[^a-zA-Z0-9_]/";
1036
  foreach($user_fields as $user_key=>$user_field) {
1037
  $form_fields.='<a onclick="insert_field(\''.$user_key.'\'); jQuery(\'#fieldlist\').hide();" style="display:block; text-decoration:none;">'.$user_field.'</a>';
1038
  }
1039
+ $cond='<div id="condid"><select id="sel_condid" style="width: 160px">';
1040
  foreach($table_struct as $col) {
1041
+ $cond.='<option>'.str_replace("'", "SingleQuot", $col->Field).'</option>';
1042
  }
1043
  $cond.='</select>';
1044
 
1045
+ $cond.='<select id="op_condid"><option value="=" selected="selected">=</option><option value="!=">!=</option><option value=">">&gt;</option><option value="<">&lt;</option><option value=">=">&gt;=</option><option value="<=">&lt;=</option><option value="%..%">Like</option><option value="%..">Starts with</option><option value="..%">Ends with</option></select><input id="val_condid" style="width:170px" type="text" /><select id="andor_condid" style="visibility: hidden;"><option value="AND">AND</option><option value="OR">OR</option></select><img src="' . WD_FM_URL . '/images/delete.png?ver='. get_option("wd_form_maker_version").'" onclick="delete_cond(&quot;condid&quot;)" style="vertical-align: middle;"></div>';
1046
  ?>
1047
  <script>
1048
+ var selected_field ='';
1049
+ var isvisible = 1;
1050
+ var cond_id = 1;
1051
+
1052
+ conds='<?php echo $cond ?>';
1053
+ fields=new Array(<?php
1054
+ $fields = "";
1055
+ if($table_struct) {
1056
+ foreach($table_struct as $col) {
1057
+ $fields.=' "'.$col->Field.'",';
1058
+ }
1059
+ echo substr($fields, 0, -1);
1060
+ }
1061
  ?>);
1062
+ function dis(id, x) {
1063
+ if(x)
1064
+ jQuery('#'+id).removeAttr('disabled');
1065
+ else
1066
+ jQuery('#'+id).attr('disabled','disabled');
1067
+ }
1068
 
1069
+ function update_vis() {
1070
+ previous=0;
1071
+ for(i=1; i<cond_id; i++) {
1072
+ if(jQuery('#'+i).html()) {
1073
+ jQuery('#andor_'+i).css('visibility', 'hidden');
1074
+ if(previous) {
1075
+ jQuery('#andor_'+previous).css('visibility', 'visible');
1076
+ }
1077
+ previous=i;
1078
+ }
1079
+ }
1080
+ }
1081
 
1082
+ function delete_cond(id) {
1083
+ jQuery('#'+id).remove();
1084
+ update_vis();
1085
+ }
1086
 
1087
+ jQuery('.add_cond').click( function() {
1088
+ jQuery('.cols').append(conds.replace(/condid/g, cond_id++).replace('SingleQuot', "'"));
1089
+ update_vis();
1090
+ });
 
1091
 
1092
+ jQuery('html').click(function() {
1093
+ if(jQuery("#fieldlist").css('display')=="block") {
1094
+ jQuery("#fieldlist").hide();
1095
+ }
1096
+ });
1097
 
1098
+ jQuery('.cols input[type="text"]').on('click', function() {
1099
+ event.stopPropagation();
1100
+ jQuery("#fieldlist").css("top",jQuery(this).offset().top+jQuery(this).height()+2);
1101
+ jQuery("#fieldlist").css("left",jQuery(this).offset().left);
1102
+ jQuery("#fieldlist").slideDown('fast');
1103
+ selected_field=this.id;
1104
+ });
1105
 
1106
+ jQuery('#query_txt').click(function() {
1107
+ event.stopPropagation();
1108
+ jQuery("#fieldlist").css("top",jQuery(this).offset().top+jQuery(this).height()+2);
1109
+ jQuery("#fieldlist").css("left",jQuery(this).offset().left);
1110
+ jQuery("#fieldlist").slideDown('fast');
1111
+ selected_field=this.id;
1112
+ });
1113
 
1114
+ jQuery('#fieldlist').click(function(event){
1115
+ event.stopPropagation();
1116
+ });
1117
 
1118
+ function save_query() {
1119
+ con_type =jQuery('input[name=con_type]:checked').val();
1120
+ con_method =jQuery('input[name=con_method]:checked').val();
1121
+ table =jQuery('#tables').val();
1122
+ table =jQuery('#tables').val();
1123
+ host =jQuery('#host_rem').val();
1124
+ port =jQuery('#port_rem').val();
1125
+ username =jQuery('#username_rem').val();
1126
+ password =jQuery('#password_rem').val();
1127
+ database =jQuery('#database_rem').val();
1128
+
1129
+ str=con_type+"***wdfcon_typewdf***"+con_method+"***wdfcon_methodwdf***"+table+"***wdftablewdf***"+host+"***wdfhostwdf***"+port+"***wdfportwdf***"+username+"***wdfusernamewdf***"+password+"***wdfpasswordwdf***"+database+"***wdfdatabasewdf***";
1130
 
1131
+ if(fields.length) {
1132
+ for(i=0; i<fields.length; i++) {
1133
+ str+=fields[i]+'***wdfnamewdf***'+jQuery('#'+fields[i]).val()+'***wdfvaluewdf***'+jQuery('#ch_'+fields[i]+":checked" ).length+'***wdffieldwdf***';
1134
+ }
1135
+ }
1136
 
1137
+ for(i=1; i<cond_id; i++) {
1138
+ if(jQuery('#'+i).html()) {
1139
+ str+=jQuery('#sel_'+i).val()+'***sel***'+jQuery('#op_'+i).val()+'***op***'+jQuery('#val_'+i).val()+'***val***'+jQuery('#andor_'+i).val()+'***where***';
1140
+ }
1141
+ }
1142
 
1143
+ if(!jQuery('#query_txt').val()) {
1144
+ gen_query();
1145
+ }
1146
 
1147
+ jQuery('#details').val(str);
1148
 
1149
+ var datatxt = jQuery("#query_form").serialize()+'&form_id='+jQuery("#form_id").val();
1150
+ if(jQuery('#query_txt').val()) {
1151
+ jQuery('.c1').html('<div class="fm-loading-container"><div class="fm-loading-content"></div></div>');
1152
+ jQuery.ajax({
1153
+ type: "POST",
1154
+ url: "<?php echo add_query_arg(array('action' => 'FormMakerSQLMapping', 'id' => 0, 'form_id' => $form_id, 'task' => 'save_query', 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>",
1155
+ data: datatxt,
1156
+ success: function(data) {
1157
+ window.parent.wd_fm_apply_options('apply_options');
1158
+ window.parent.tb_remove();
1159
+ }
1160
+ });
1161
+ }
1162
+ else {
1163
+ alert('The query is empty.');
1164
+ }
1165
+ return false;
1166
+ }
1167
 
1168
+ function gen_query() {
1169
+ if(jQuery('#query_txt').val()) {
1170
+ if(!confirm('Are you sure you want to replace the Query? All the modifications to the Query will be lost.')) {
1171
+ return;
1172
+ }
1173
+ }
1174
+ query="";
1175
+ fields=new Array(<?php
1176
+ $fields = "";
1177
+ if($table_struct) {
1178
+ foreach($table_struct as $col) {
1179
+ $fields.=' "'.str_replace("'", "SingleQuot", $col->Field).'",';
1180
+ }
1181
+ echo substr($fields, 0, -1);
1182
+ }
1183
+ ?>);
1184
 
1185
+ con_type =jQuery('input[name=con_type]:checked').val();
1186
+ con_method =jQuery('input[name=con_method]:checked').val();
1187
+ table =jQuery('#tables').val();
1188
+ fls='';
1189
+ vals='';
1190
+ valsA=new Array();
1191
+ flsA=new Array();
1192
 
1193
+ if(fields.length) {
1194
+ for(i=0; i<fields.length; i++) {
1195
+ if(jQuery('#ch_'+fields[i]+":checked" ).length) {
1196
+ flsA.push(fields[i]);
1197
+ valsA.push(jQuery('#'+fields[i]).val());
1198
+ }
1199
+ }
1200
+ }
1201
 
1202
+ if(con_method=="insert") {
1203
+ if(flsA.length) {
1204
+ for(i=0; i<flsA.length-1; i++) {
1205
+ fls+= '`'+flsA[i]+'`, ';
1206
+ vals+= '"'+valsA[i]+'", ';
1207
+ }
1208
+ fls+= '`'+flsA[i]+'`';
1209
+ vals+= '"'+valsA[i]+'"';
1210
+ }
1211
+ if(fls) {
1212
+ query="INSERT INTO "+jQuery('#tables').val()+" (" +fls+") VALUES ("+vals+")";
1213
+ }
1214
+ }
1215
 
1216
+ if(con_method=="update") {
1217
+ if(flsA.length) {
1218
+ for(i=0; i<flsA.length-1; i++) {
1219
+ vals+= '`'+flsA[i]+'`="'+valsA[i]+'", ';
1220
+ }
1221
+ vals+= '`'+flsA[i]+'`="'+valsA[i]+'"';
1222
+ }
1223
+ where="";
1224
+ previous='';
1225
+ for(i=1; i<cond_id; i++) {
1226
+ if(jQuery('#'+i).html()) {
1227
+ if(jQuery('#op_'+i).val()=="%..%")
1228
+ op_val=' LIKE "%'+jQuery('#val_'+i).val()+'%"';
1229
+ else if(jQuery('#op_'+i).val()=="%..")
1230
+ op_val=' LIKE "%'+jQuery('#val_'+i).val()+'"';
1231
+ else if(jQuery('#op_'+i).val()=="..%")
1232
+ op_val=' LIKE "'+jQuery('#val_'+i).val()+'%"';
1233
+ else
1234
+ op_val=' '+jQuery('#op_'+i).val()+' "'+jQuery('#val_'+i).val()+'"';
1235
+ where+=previous+' `'+jQuery('#sel_'+i).val()+'`'+op_val;
1236
+ previous=' '+ jQuery('#andor_'+i).val();
1237
+ }
1238
+ }
1239
+ if(vals) {
1240
+ query="UPDATE "+jQuery('#tables').val()+" SET " + vals+(where? ' WHERE'+where: '') ;
1241
+ }
1242
+ }
1243
+
1244
+ if(con_method=="delete") {
1245
+ where="";
1246
+ previous='';
1247
+ for(i=1; i<cond_id; i++) {
1248
+ if(jQuery('#'+i).html()) {
1249
+ if(jQuery('#op_'+i).val()=="%..%")
1250
+ op_val=' LIKE "%'+jQuery('#val_'+i).val()+'%"';
1251
+ else if(jQuery('#op_'+i).val()=="%..")
1252
+ op_val=' LIKE "%'+jQuery('#val_'+i).val()+'"';
1253
+ else if(jQuery('#op_'+i).val()=="..%")
1254
+ op_val=' LIKE "'+jQuery('#val_'+i).val()+'%"';
1255
+ else
1256
+ op_val=' '+jQuery('#op_'+i).val()+' "'+jQuery('#val_'+i).val()+'"';
1257
+ where+=previous+' '+jQuery('#sel_'+i).val()+op_val;
1258
+ previous=' '+ jQuery('#andor_'+i).val();
1259
+ }
1260
+ }
1261
+ if(where) {
1262
+ query="DELETE FROM "+jQuery('#tables').val()+ ' WHERE'+where ;
1263
+ }
1264
+ }
1265
+ jQuery('#query_txt').val(query.replace("SingleQuot", "'"));
1266
+ }
 
 
 
1267
 
1268
+ jQuery(document).ready(function () {
1269
+ jQuery(".hasTip").tooltip({
1270
+ track: true,
1271
+ content: function () {
1272
+ return jQuery(this).prop('title');
1273
+ }
1274
+ });
1275
+ });
1276
 
1277
+ function insert_field(myValue) {
1278
+ if(!selected_field)
1279
+ return;
1280
+ myField=document.getElementById(selected_field);
1281
+ if (document.selection) {
1282
+ myField.focus();
1283
+ sel = document.selection.createRange();
1284
+ sel.text = myValue;
1285
+ }
1286
+ else {
1287
+ if (myField.selectionStart || myField.selectionStart == '0') {
1288
+ var startPos = myField.selectionStart;
1289
+ var endPos = myField.selectionEnd;
1290
+ myField.value = myField.value.substring(0, startPos)
1291
+ + "{"+myValue+"}"
1292
+ + myField.value.substring(endPos, myField.value.length);
1293
+ }
1294
+ else {
1295
+ myField.value += "{"+myValue+"}";
1296
+ }
1297
+ }
1298
+ }
1299
+ </script>
1300
+ <style>
1301
+ .cols div:nth-child(even) {background: #FFF;}
1302
+ .cols div:nth-child(odd) {background: #F5F5F5;}
1303
+ .cols div {
1304
+ height: 28px;
1305
+ padding: 5px;
1306
+ }
1307
+
1308
+ .cols {
1309
+ display: inline-block;
1310
+ }
1311
+
1312
+ .cols label {
1313
+ display: inline-block;
1314
+ width: 200px;
1315
+ font-size: 15px;
1316
+ overflow: hidden;
1317
+ white-space: nowrap;
1318
+ text-overflow: ellipsis;
1319
+ vertical-align: middle;
1320
+ }
1321
+
1322
+ .cols input[type="text"] {
1323
+ width: 295px;
1324
+ line-height: 18px;
1325
+ height: 28px;
1326
+ border: 1px solid #ccc;
1327
+ padding: 0 3px;
1328
+ margin-right: 2px;
1329
+ }
1330
+
1331
+ .cols input[type="text"]:disabled {
1332
+ cursor: not-allowed;
1333
+ background-color: #eee;
1334
+ }
1335
+
1336
+ .cols input[type="checkbox"] {
1337
+ width: 20px;
1338
+ line-height: 18px;
1339
+ height: 20px;
1340
+ vertical-align: middle;
1341
+ }
1342
+
1343
+ .cols select {
1344
+ line-height: 18px;
1345
+ height: 28px;
1346
+ margin-right: 2px;
1347
+ }
1348
+
1349
+ #fieldlist {
1350
+ position: absolute;
1351
+ width:225px;
1352
+ background: #fff;
1353
+ border: solid 1px #c7c7c7;
1354
+ top: 0;
1355
+ left: 0;
1356
+ z-index: 1000;
1357
+ }
1358
+
1359
+ #fieldlist a {
1360
+ padding: 5px;
1361
+ cursor:pointer;
1362
+ overflow: hidden;
1363
+ white-space: nowrap;
1364
+ text-overflow: ellipsis;
1365
+ }
1366
+
1367
+ #fieldlist a:hover {
1368
+ background: #ccc;
1369
+ }
1370
+ .gen_query, .gen_query:focus {
1371
+ width: 148px;
1372
+ height: 38px;
1373
+ background: #4EC0D9;
1374
+ color: white;
1375
+ cursor: pointer;
1376
+ border: 0px;
1377
+ font-size: 14px;
1378
+ font-weight: bold;
1379
+ margin: 20px 0;
1380
+ border-radius: 0px;
1381
+ }
1382
+ .gen_query:active {
1383
+ background: #ccc;
1384
+ }
1385
+
1386
+ .fm-query-save {
1387
+ float: right;
1388
+ font-size: 13px;
1389
+ margin: 0 20px;
1390
+ background: #4EC0D9;
1391
+ width: 83px;
1392
+ height: 34px;
1393
+ border: 1px solid #4EC0D9;
1394
+ border-radius: 0px;
1395
+ color: #fff;
1396
+ cursor: pointer;
1397
+ }
1398
+
1399
+ .select-db-op {
1400
+ display: inline-block;
1401
+ text-align: right;
1402
+ font-weight: bold;
1403
+ font-size: 18px;
1404
+ padding: 5px 0;
1405
+ margin: 5px 0;
1406
+ background:none !important;
1407
+ }
1408
+
1409
+ .select-db-op.where{
1410
+ width: 272px;
1411
+ }
1412
+
1413
+ .select-db-op img{
1414
+ float:left;
1415
+ }
1416
+ </style>
1417
+ <?php
1418
+ if($table_struct) { ?>
1419
+ <div class="cols">
1420
+ <?php
1421
+ if($con_method=='insert' or $con_method=='update') {
1422
+ echo '<div style="background: none;text-align: center;font-size: 20px;color: #000;font-weight: bold;"> SET </div>';
1423
+ foreach($table_struct as $col) {
1424
+ $title=' '.$col->Field;
1425
+ $title.="<ul style='padding-left: 17px;'>";
1426
+ $title.="<li>Type - ".$col->Type."</li>";
1427
+ $title.="<li>Null - ".$col->Null."</li>";
1428
+ $title.="<li>Key - ".$col->Key."</li>";
1429
+ $title.="<li>Default - ".$col->Default."</li>";
1430
+ $title.="<li>Extra - ".$col->Extra."</li>";
1431
+ $title.="</ul>";
1432
+ ?>
1433
+ <div><label title="<?php echo $title; ?>" class="hasTip"><b><?php echo $col->Field; ?></b><img src="<?php echo WD_FM_URL . '/images/info.png?ver='. get_option("wd_form_maker_version").''; ?>" style="width:20px; vertical-align:middle;padding-left: 10px;" /></label><input type="text" id="<?php echo str_replace("'", "SingleQuot", $col->Field); ?>" disabled="disabled"/><input id="ch_<?php echo str_replace("'", "SingleQuot", $col->Field); ?>" type="checkbox" onClick="dis('<?php echo str_replace("'", "SingleQuot", $col->Field); ?>', this.checked)"/></div>
1434
+ <?php
1435
+ }
1436
+ }
1437
+ if($con_method=='delete' or $con_method=='update') {
1438
+ echo '<div class="select-db-op where"><img src="'.WD_FM_URL . '/images/add_condition.png?ver='. get_option("wd_form_maker_version").'" title="ADD" class="add_cond"/>WHERE</div>';
1439
+ }
1440
+ ?>
1441
+ </div>
1442
+ <br/>
1443
+ <input type="button" value="Generate Query" class="gen_query" onclick="gen_query()">
1444
+ <br/>
1445
+ <form name="query_form" id="query_form" >
1446
+ <label style="vertical-align: top; width: 102px; display: inline-block;" for="query_txt" > Query: </label><textarea id="query_txt" name="query" rows=5 style="width:428px"></textarea>
1447
+ <input type="hidden" name="details" id="details">
1448
+ </form>
1449
+ <input type="button" value="Save" class="fm-query-save" onclick="save_query()">
1450
+ <div id="fieldlist" style="display: none;">
1451
+ <?php echo $form_fields ?>
1452
+ </div>
1453
+ <?php
1454
+ }
1455
+ die();
1456
+ }
1457
 
1458
  ////////////////////////////////////////////////////////////////////////////////////////
1459
  // Getters & Setters //
admin/views/FMViewFormmakerwdcaptcha.php CHANGED
@@ -55,6 +55,7 @@ class FMViewFormmakerwdcaptcha {
55
  if (session_id() == '' || (function_exists('session_status') && (session_status() == PHP_SESSION_NONE))) {
56
  @session_start();
57
  }
 
58
  $_SESSION[$i . '_wd_captcha_code'] = md5($code);
59
  $canvas = imagecreatetruecolor($cap_width, $cap_height);
60
  $c = imagecolorallocate($canvas, rand(150, 255), rand(150, 255), rand(150, 255));
55
  if (session_id() == '' || (function_exists('session_status') && (session_status() == PHP_SESSION_NONE))) {
56
  @session_start();
57
  }
58
+
59
  $_SESSION[$i . '_wd_captcha_code'] = md5($code);
60
  $canvas = imagecreatetruecolor($cap_width, $cap_height);
61
  $c = imagecolorallocate($canvas, rand(150, 255), rand(150, 255), rand(150, 255));
admin/views/FMViewFormmakerwindow.php CHANGED
@@ -32,7 +32,9 @@ class FMViewFormmakerwindow {
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
  ?>
@@ -69,7 +71,7 @@ class FMViewFormmakerwindow {
69
  margin: 0 !important;
70
  }
71
  </style>
72
- <div class="panel_wrapper" style="overflow: hidden;">
73
  <div id="display_panel" class="panel current">
74
  <table>
75
  <tr>
@@ -90,9 +92,6 @@ class FMViewFormmakerwindow {
90
  </table>
91
  </div>
92
  <div id="submissions_panel" class="panel">
93
- <div class="error" style="position: relative; padding: 5px; font-size: 20px; color: red; opacity: 1; font-weight: bolder;">Front end submissions are disabled in free version.</div>
94
- <div style="position: absolute; background: gray; width: 92%; height: 65%; opacity: 0.3;">
95
- </div>
96
  <table>
97
  <tr>
98
  <td class="smaller_font">Select a Form:</td>
@@ -235,6 +234,30 @@ class FMViewFormmakerwindow {
235
  if (!short_code['type']) {
236
  document.getElementById("form_maker_id").value = short_code['id'];
237
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
  }
239
  // Get shortcodes attributes.
240
  function get_params(module_name) {
@@ -272,7 +295,25 @@ class FMViewFormmakerwindow {
272
  }
273
  }
274
  else {
275
- alert("Front end submissions are disabled in free version.");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
276
  }
277
  }
278
  </script>
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
+ <script language="javascript" type="text/javascript" src="<?php echo WD_FM_URL; ?>/js/calendar/calendar.js"></script>
36
+ <script language="javascript" type="text/javascript" src="<?php echo WD_FM_URL; ?>/js/calendar/calendar_function.js"></script>
37
+ <link rel="stylesheet" href="<?php echo WD_FM_URL; ?>/css/calendar-jos.css" type="text/css" media="all">
38
  <?php
39
  wp_print_scripts('jquery');
40
  ?>
71
  margin: 0 !important;
72
  }
73
  </style>
74
+ <div class="panel_wrapper">
75
  <div id="display_panel" class="panel current">
76
  <table>
77
  <tr>
92
  </table>
93
  </div>
94
  <div id="submissions_panel" class="panel">
 
 
 
95
  <table>
96
  <tr>
97
  <td class="smaller_font">Select a Form:</td>
234
  if (!short_code['type']) {
235
  document.getElementById("form_maker_id").value = short_code['id'];
236
  }
237
+ else {
238
+ mcTabs.displayTab('submissions_tab','submissions_panel');
239
+ document.getElementById("submissions_id").value = short_code['id'];
240
+ document.getElementById("startdate").value = short_code['startdate'];
241
+ document.getElementById("enddate").value = short_code['enddate'];
242
+ document.getElementById("submit_date").checked = short_code['submit_date'] == "1" ? true : false;
243
+ document.getElementById("submitter_ip").checked = short_code['submitter_ip'] == "1" ? true : false;
244
+ document.getElementById("username").checked = short_code['username'] == "1" ? true : false;
245
+ document.getElementById("useremail").checked = short_code['useremail'] == "1" ? true : false;
246
+ document.getElementById("form_fields").checked = short_code['form_fields'] == "1" ? true : false;
247
+
248
+ show = short_code['show'].split(",");
249
+
250
+ document.getElementById("csv").checked = show[0] == 1 ? true : false;
251
+ document.getElementById("xml").checked = show[1] == 1 ? true : false;
252
+ document.getElementById("title").checked = show[2] == 1 ? true : false;
253
+ document.getElementById("search").checked = show[3] == 1 ? true : false;
254
+ document.getElementById("ordering").checked = show[4] == 1 ? true : false;
255
+ document.getElementById("entries").checked = show[5] == 1 ? true : false;
256
+ document.getElementById("views").checked = show[6] == 1 ? true : false;
257
+ document.getElementById("conversion_rate").checked = show[7] == 1 ? true : false;
258
+ document.getElementById("pagination").checked = show[8] == 1 ? true : false;
259
+ document.getElementById("stats").checked = show[9] == 1 ? true : false;
260
+ }
261
  }
262
  // Get shortcodes attributes.
263
  function get_params(module_name) {
295
  }
296
  }
297
  else {
298
+ if (document.getElementById('submissions_id').value == '- Select Form -') {
299
+ tinyMCEPopup.close();
300
+ }
301
+ else {
302
+ var tagtext;
303
+ show = document.getElementById('csv').checked ? "1," : "0,";
304
+ show += document.getElementById('xml').checked ? "1," : "0,";
305
+ show += document.getElementById('title').checked ? "1," : "0,";
306
+ show += document.getElementById('search').checked ? "1," : "0,";
307
+ show += document.getElementById('ordering').checked ? "1," : "0,";
308
+ show += document.getElementById('entries').checked ? "1," : "0,";
309
+ show += document.getElementById('views').checked ? "1," : "0,";
310
+ show += document.getElementById('conversion_rate').checked ? "1," : "0,";
311
+ show += document.getElementById('pagination').checked ? "1," : "0,";
312
+ show += document.getElementById('stats').checked ? "1" : "0";
313
+ tagtext = '[Form id="' + document.getElementById('submissions_id').value + '" type="submission" startdate="' + document.getElementById('startdate').value + '" enddate="' + document.getElementById('enddate').value + '" submit_date="' + (document.getElementById('submit_date').checked ? 1 : 0) + '" submitter_ip="' + (document.getElementById('submitter_ip').checked ? 1 : 0) + '" username="' + (document.getElementById('username').checked ? 1 : 0) + '" useremail="' + (document.getElementById('useremail').checked ? 1 : 0) + '" form_fields="' + (document.getElementById('form_fields').checked ? 1 : 0) + '" show="' + show + '"]';
314
+ window.tinyMCE.execCommand('mceInsertContent', false, tagtext);
315
+ tinyMCEPopup.close();
316
+ }
317
  }
318
  }
319
  </script>
admin/views/FMViewFromeditcountryinpopup.php CHANGED
@@ -22,112 +22,156 @@ class FMViewFromeditcountryinpopup {
22
  ////////////////////////////////////////////////////////////////////////////////////////
23
  // Public Methods //
24
  ////////////////////////////////////////////////////////////////////////////////////////
25
- public function display() {
26
- $id = ((isset($_GET['field_id'])) ? esc_html(stripslashes($_GET['field_id'])) : 0);
27
- wp_print_scripts('jquery');
28
- wp_print_scripts('jquery-ui-core');
29
- wp_print_scripts('jquery-ui-widget');
30
- wp_print_scripts('jquery-ui-mouse');
31
- wp_print_scripts('jquery-ui-slider');
32
- wp_print_scripts('jquery-ui-sortable');
33
- ?>
34
- <span style="position: absolute; right: 8px;">
35
- <img title="Add" style="cursor: pointer; vertical-align: middle;" src="<?php echo WD_FM_URL . '/images/save.png'; ?>" onClick="save_list()" />
36
- <img title="Cancel" style=" cursor: pointer; vertical-align: middle;" src="<?php echo WD_FM_URL . '/images/cancel_but.png'; ?>" onClick="window.parent.tb_remove();" />
37
- </span>
38
- <button class="button-secondary" onClick="select_all()">Select all</button>
39
- <button class="button-secondary" onClick="remove_all()">Remove all</button>
40
- <ul id="countries_list" style="list-style: none; padding: 0px;"></ul>
41
- <script>
42
- selec_coutries = [];
43
- coutries = ["", "Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombia", "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", "Nepal", "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 //
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
+ ?>
35
+ <style>
36
+ .country-list {
37
+ padding:10px 0;
38
+ }
39
+
40
+ .country-list ul {
41
+ font-family: Segoe UI !important;
42
+ font-size:13px;
43
+ }
44
+ .country-list > div {
45
+ display:inline-block;
46
+ }
47
+
48
+ .save-cancel {
49
+ float:right;
50
+ }
51
+
52
+ .fm-select-remove {
53
+ background: #4EC0D9;
54
+ width: 78px;
55
+ height: 32px;
56
+ border: 1px solid #4EC0D9;
57
+ border-radius: 6px;
58
+ color: #fff;
59
+ cursor:pointer;
60
+ }
61
+
62
+ .fm-select-remove.large {
63
+ width: 90px;
64
+ }
65
+ </style>
66
+ <div class="country-list">
67
+ <div class="select-remove">
68
+ <button class="fm-select-remove large" onclick="select_all(); return false;">
69
+ Select all
70
+ <span></span>
71
+ </button>
72
+ <button class="fm-select-remove large" onclick="remove_all(); return false;">
73
+ Remove all
74
+ <span></span>
75
+ </button>
76
+ </div>
77
+ <div class="save-cancel">
78
+ <button class="fm-select-remove" onclick="save_list(); return false;">
79
+ Save
80
+ <span></span>
81
+ </button>
82
+ </div>
83
+ <ul id="countries_list" style="list-style: none; padding: 0px;"></ul>
84
+ </div>
85
+ <script>
86
+ selec_coutries = [];
87
+ 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", "Colombia", "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", "Nepal", "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"];
88
+ select_ = window.parent.document.getElementById('<?php echo $id ?>_elementform_id_temp');
89
+ n = select_.childNodes.length;
90
+ for (i = 0; i < n; i++) {
91
+ selec_coutries.push(select_.childNodes[i].value);
92
+ var ch = document.createElement('input');
93
+ ch.setAttribute("type", "checkbox");
94
+ ch.setAttribute("checked", "checked");
95
+ ch.value = select_.childNodes[i].value;
96
+ ch.id = i + "ch";
97
 
98
+ var p = document.createElement('span');
99
+ p.style.cssText = "color:#000000; font-size: 13px; cursor:move";
100
+ p.innerHTML = select_.childNodes[i].value;
101
+ var li = document.createElement('li');
102
+ li.style.cssText = "margin:3px; vertical-align:middle";
103
+ li.id = i;
104
+ li.appendChild(ch);
105
+ li.appendChild(p);
106
+ document.getElementById('countries_list').appendChild(li);
107
+ }
108
+ cur = i;
109
+ m = coutries.length;
110
+ for (i = 0; i < m; i++) {
111
+ isin = isValueInArray(selec_coutries, coutries[i]);
112
+ if (!isin) {
113
+ var ch = document.createElement('input');
114
+ ch.setAttribute("type", "checkbox");
115
+ ch.value = coutries[i];
116
+ ch.id = cur + "ch";
117
 
118
+ var p = document.createElement('span');
119
+ p.style.cssText = "color:#000000; font-size: 13px; cursor:move";
120
+ p.innerHTML = coutries[i];
121
+ var li = document.createElement('li');
122
+ li.style.cssText = "margin:3px; vertical-align:middle";
123
+ li.id = cur;
124
+ li.appendChild(ch);
125
+ li.appendChild(p);
126
+ document.getElementById('countries_list').appendChild(li);
127
+ cur++;
128
+ }
129
+ }
130
+ jQuery(function () {
131
+ jQuery("#countries_list").sortable();
132
+ jQuery("#countries_list").disableSelection();
133
+ });
134
+
135
+ function isValueInArray(arr, val) {
136
+ inArray = false;
137
+ for (x = 0; x < arr.length; x++) {
138
+ if (val == arr[x]) {
139
+ inArray = true;
140
+ }
141
+ }
142
+ return inArray;
143
+ }
144
+ function save_list() {
145
+ select_.innerHTML = ""
146
+ ul = document.getElementById('countries_list');
147
+ n = ul.childNodes.length;
148
+ for (i = 0; i < n; i++) {
149
+ if (ul.childNodes[i].tagName == "LI") {
150
+ id = ul.childNodes[i].id;
151
+ if (document.getElementById(id + 'ch').checked) {
152
+ var option_ = document.createElement('option');
153
+ option_.setAttribute("value", document.getElementById(id + 'ch').value);
154
+ option_.innerHTML = document.getElementById(id + 'ch').value;
155
+ select_.appendChild(option_);
156
+ }
157
+ }
158
+ }
159
+ window.parent.tb_remove();
160
+ }
161
+ function select_all() {
162
+ for (i = 0; i < 194; i++) {
163
+ document.getElementById(i + 'ch').checked = true;
164
+ }
165
+ }
166
+ function remove_all() {
167
+ for (i = 0; i < 194; i++) {
168
+ document.getElementById(i + 'ch').checked = false;
169
+ }
170
+ }
171
+ </script>
172
+ <?php
173
+ die();
174
+ }
175
 
176
  ////////////////////////////////////////////////////////////////////////////////////////
177
  // Getters & Setters //
admin/views/FMViewGenerete_csv.php CHANGED
@@ -53,6 +53,7 @@ class FMViewGenerete_csv {
53
  $tempfile = $file_path.'/export'.$form_id.'.txt';
54
  if($limitstart == 0 && file_exists ($tempfile))
55
  unlink($tempfile);
 
56
  $output = fopen($tempfile, "a");
57
  if($limitstart == 0) {
58
  fputcsv($output, str_replace('PAYPAL_', '', $keys_array));
53
  $tempfile = $file_path.'/export'.$form_id.'.txt';
54
  if($limitstart == 0 && file_exists ($tempfile))
55
  unlink($tempfile);
56
+
57
  $output = fopen($tempfile, "a");
58
  if($limitstart == 0) {
59
  fputcsv($output, str_replace('PAYPAL_', '', $keys_array));
admin/views/FMViewGenerete_xml.php CHANGED
@@ -23,7 +23,7 @@ class FMViewGenerete_xml {
23
  // Public Methods //
24
  ////////////////////////////////////////////////////////////////////////////////////////
25
  public function display() {
26
- $form_id = (int)$_REQUEST['form_id'];
27
  $params = $this->model->get_data();
28
  $limitstart = (int)$_REQUEST['limitstart'];
29
  $send_header = (int)$_REQUEST['send_header'];
23
  // Public Methods //
24
  ////////////////////////////////////////////////////////////////////////////////////////
25
  public function display() {
26
+ $form_id = (int)$_REQUEST['form_id'];
27
  $params = $this->model->get_data();
28
  $limitstart = (int)$_REQUEST['limitstart'];
29
  $send_header = (int)$_REQUEST['send_header'];
admin/views/FMViewManage_fm.php CHANGED
@@ -22,134 +22,1244 @@ class FMViewManage_fm {
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']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
31
- $order_by_array = array('id', 'title', 'mail');
32
- $order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
33
- $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
34
- $ids_string = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
- ?>
37
- <div style="clear: both; float: left; width: 99%;">
38
- <div style="float:left; font-size: 14px; font-weight: bold;">
39
- This section allows you to create, edit forms.
40
- <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-2.html">Read More in User Manual</a>
41
- </div>
42
- <div style="float: right; text-align: right;">
43
- <a style="text-decoration: none;" target="_blank" href="https://web-dorado.com/files/fromFormMaker.php">
44
- <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
45
- </a>
46
- </div>
47
- </div>
48
- <form onkeypress="fm_doNothing(event)" class="wrap" id="manage_form" method="post" action="admin.php?page=manage_fm" style="float: left; width: 99%;">
49
- <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
50
- <span class="form_maker_icon"></span>
51
- <h2>
52
- Form Maker
53
- <a href="" class="add-new-h2" onclick="fm_set_input_value('task', 'add');
54
- fm_form_submit(event, 'manage_form')">Add new</a>
55
- </h2>
56
- <div class="tablenav top">
57
- <?php
58
- WDW_FM_Library::search('Title', $search_value, 'manage_form');
59
- WDW_FM_Library::html_page_nav($page_nav['total'], $page_nav['limit'], 'manage_form');
60
- ?>
61
- </div>
62
- <table class="wp-list-table widefat fixed pages">
63
- <thead>
64
- <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin:0;"/></th>
65
- <th class="table_small_col <?php if ($order_by == 'id') { echo $order_class; } ?>">
66
- <a onclick="fm_set_input_value('task', '');
67
- fm_set_input_value('order_by', 'id');
68
- fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'id' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
69
- fm_form_submit(event, 'manage_form')" href="">
70
- <span>ID</span><span class="sorting-indicator"></span></a>
71
- </th>
72
- <th class="<?php if ($order_by == 'title') { echo $order_class; } ?>">
73
- <a onclick="fm_set_input_value('task', '');
74
- fm_set_input_value('order_by', 'title');
75
- fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'title' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
76
- fm_form_submit(event, 'manage_form')" href="">
77
- <span>Title</span><span class="sorting-indicator"></span></a>
78
- </th>
79
- <th class="<?php if ($order_by == 'mail') { echo $order_class; } ?>">
80
- <a onclick="fm_set_input_value('task', '');
81
- fm_set_input_value('order_by', 'mail');
82
- fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'mail' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
83
- fm_form_submit(event, 'manage_form')" href="">
84
- <span>Email to send submissions to</span><span class="sorting-indicator"></span></a>
85
- </th>
86
- <th class="table_big_col">Shortcode</th>
87
- <th class="table_large_col">PHP function</th>
88
- <th class="table_big_col">Edit</th>
89
- <th class="table_big_col"><a title="Delete selected items" href="" onclick="if (confirm('Do you want to delete selected items?')) {
90
- fm_set_input_value('task', 'delete_all');
91
- fm_form_submit(event, 'manage_form');
92
- } else {
93
- return false;
94
- }">Delete</a></th>
95
- </thead>
96
- <tbody id="tbody_arr">
97
- <?php
98
- if ($rows_data) {
99
- foreach ($rows_data as $row_data) {
100
- $alternate = (!isset($alternate) || $alternate == 'class="alternate"') ? '' : 'class="alternate"';
101
- $old = '';
102
- if (isset($row_data->form) && ($row_data->form != '')) {
103
- $old = '_old';
104
- }
105
- ?>
106
- <tr id="tr_<?php echo $row_data->id; ?>" <?php echo $alternate; ?>>
107
- <td class="table_small_col check-column">
108
- <input id="check_<?php echo $row_data->id; ?>" name="check_<?php echo $row_data->id; ?>" type="checkbox"/>
109
- </td>
110
- <td class="table_small_col"><?php echo $row_data->id; ?></td>
111
- <td>
112
- <a onclick="fm_set_input_value('task', 'edit<?php echo $old; ?>');
113
- fm_set_input_value('current_id', '<?php echo $row_data->id; ?>');
114
- fm_form_submit(event, 'manage_form')" href="" title="Edit"><?php echo $row_data->title; ?></a>
115
- </td>
116
- <td><?php echo $row_data->mail; ?></td>
117
- <td class="table_big_col" style="padding-left: 0; padding-right: 0;">
118
- <input type="text" value='[Form id="<?php echo $row_data->id; ?>"]' onclick="fm_select_value(this)" size="12" readonly="readonly" style="padding-left: 1px; padding-right: 1px;"/>
119
- </td>
120
- <td class="table_large_col" style="padding-left: 0; padding-right: 0;">
121
- <input type="text" value='&#60;?php wd_form_maker(<?php echo $row_data->id; ?>); ?&#62;' onclick="fm_select_value(this)" readonly="readonly" style="padding-left: 1px; padding-right: 1px;"/>
122
- </td>
123
- <td class="table_big_col">
124
- <a onclick="fm_set_input_value('task', 'edit<?php echo $old; ?>');
125
- fm_set_input_value('current_id', '<?php echo $row_data->id; ?>');
126
- fm_form_submit(event, 'manage_form')" href="">Edit</a>
127
- </td>
128
- <td class="table_big_col">
129
- <a onclick="if (confirm('Do you want to delete selected item(s)?')) { fm_set_input_value('task', 'delete');
130
- fm_set_input_value('current_id', '<?php echo $row_data->id; ?>'); fm_form_submit(event, 'manage_form'); } else { return false; }" href="">Delete</a>
131
- </td>
132
- </tr>
133
- <?php
134
- $ids_string .= $row_data->id . ',';
135
- }
136
- }
137
- ?>
138
- </tbody>
139
- </table>
140
- <input id="task" name="task" type="hidden" value=""/>
141
- <input id="current_id" name="current_id" type="hidden" value=""/>
142
- <input id="ids_string" name="ids_string" type="hidden" value="<?php echo $ids_string; ?>"/>
143
- <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="asc"/>
144
- <input id="order_by" name="order_by" type="hidden" value="<?php echo $order_by; ?>"/>
145
- </form>
146
- <?php
147
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
 
149
- public function edit($id) {
150
  // header("X-XSS-Protection: 0");
151
- $row = $this->model->get_row_data_new($id);
152
- $themes = $this->model->get_theme_rows_data();
153
  $labels = array();
154
  $label_id = array();
155
  $label_order_original = array();
@@ -166,173 +1276,96 @@ class FMViewManage_fm {
166
  $labels['id'] = '"' . implode('","', $label_id) . '"';
167
  $labels['label'] = '"' . implode('","', $label_order_original) . '"';
168
  $labels['type'] = '"' . implode('","', $label_type) . '"';
 
169
  $page_title = (($id != 0) ? 'Edit form ' . $row->title : 'Create new form');
170
  ?>
171
  <script type="text/javascript">
172
  var plugin_url = "<?php echo WD_FM_URL; ?>";
173
  </script>
174
- <script src="<?php echo WD_FM_URL . '/js/formmaker_div_free.js'; ?>?ver=<?php echo get_option("wd_form_maker_version"); ?>" type="text/javascript"></script>
175
  <script type="text/javascript">
176
- form_view = 1;
177
- form_view_count = 1;
178
- form_view_max = 1;
179
  function submitbutton() {
180
- <?php
181
- if ($id) {
182
- ?>
183
  if (!document.getElementById('araqel') || (document.getElementById('araqel').value == '0')) {
184
  alert('Please wait while page loading.');
185
  return false;
186
  }
187
- <?php
188
- }
189
- ?>
190
  tox = '';
191
- form_fields = '';
192
- document.getElementById('take').style.display = "none";
193
- document.getElementById('page_bar').style.display = "none";
194
- document.getElementById('saving').style.display = "block";
195
- jQuery('.wdform_section').each(function() {
196
- var this2 = this;
197
- jQuery(this2).find('.wdform_column').each(function() {
198
- if(!jQuery(this).html() && jQuery(this2).children().length>1)
199
- jQuery(this).remove();
200
- });
201
- });
202
- remove_whitespace(document.getElementById('take'));
203
  l_id_array = [<?php echo $labels['id']?>];
204
  l_label_array = [<?php echo $labels['label']?>];
205
  l_type_array = [<?php echo $labels['type']?>];
206
  l_id_removed = [];
207
- for (x = 0; x < l_id_array.length; x++) {
208
- l_id_removed[l_id_array[x]] = true;
209
  }
210
- for (t = 1; t <= form_view_max; t++) {
211
- if (document.getElementById('form_id_tempform_view' + t)) {
212
- wdform_page = document.getElementById('form_id_tempform_view' + t);
213
- remove_whitespace(wdform_page);
214
- n = wdform_page.childNodes.length - 2;
215
- for (q = 0; q <= n; q++) {
216
- if (!wdform_page.childNodes[q].getAttribute("wdid")) {
217
- wdform_section = wdform_page.childNodes[q];
218
- for (x = 0; x < wdform_section.childNodes.length; x++) {
219
- wdform_column = wdform_section.childNodes[x];
220
- if (wdform_column.firstChild) {
221
- for (y=0; y < wdform_column.childNodes.length; y++) {
222
- is_in_old = false;
223
- wdform_row = wdform_column.childNodes[y];
224
- if (wdform_row.nodeType == 3) {
225
- continue;
226
- }
227
- wdid = wdform_row.getAttribute("wdid");
228
- if (!wdid) {
229
- continue;
230
- }
231
- l_id = wdid;
232
- l_label = document.getElementById(wdid + '_element_labelform_id_temp').innerHTML;
233
  l_label = l_label.replace(/(\r\n|\n|\r)/gm," ");
234
- wdtype = wdform_row.firstChild.getAttribute('type');
235
- for (var z = 0; z < l_id_array.length; z++) {
236
- if (l_type_array[z] == "type_address") {
237
- if (document.getElementById(l_id + "_mini_label_street1") || document.getElementById(l_id + "_mini_label_street2") || document.getElementById(l_id + "_mini_label_city") || document.getElementById(l_id + "_mini_label_state") || document.getElementById(l_id+"_mini_label_postal") || document.getElementById(l_id+"_mini_label_country")) {
238
- l_id_removed[l_id_array[z]] = false;
239
- }
240
- }
241
- else {
242
- if (l_id_array[z] == wdid) {
243
- l_id_removed[l_id] = false;
244
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
245
  }
246
-
247
  }
248
- if (wdtype == "type_address") {
249
- addr_id = parseInt(wdid);
250
- id_for_country = addr_id;
251
- if (document.getElementById(id_for_country + "_mini_label_street1"))
252
- tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_street1").innerHTML + '#**label**#type_address#****#';
253
- addr_id++;
254
- if (document.getElementById(id_for_country + "_mini_label_street2"))
255
- tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_street2").innerHTML + '#**label**#type_address#****#';
256
- addr_id++;
257
- if (document.getElementById(id_for_country+"_mini_label_city"))
258
- tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_city").innerHTML + '#**label**#type_address#****#';
259
- addr_id++;
260
- if (document.getElementById(id_for_country + "_mini_label_state"))
261
- tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_state").innerHTML + '#**label**#type_address#****#';
262
- addr_id++;
263
- if (document.getElementById(id_for_country + "_mini_label_postal"))
264
- tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_postal").innerHTML + '#**label**#type_address#****#';
265
- addr_id++;
266
- if (document.getElementById(id_for_country+"_mini_label_country")) {
267
- tox=tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_country").innerHTML + '#**label**#type_address#****#';
268
- }
269
  }
270
  else {
271
- tox = tox + wdid + '#**id**#' + l_label + '#**label**#' + wdtype + '#****#';
272
- }
273
- id = wdid;
274
- form_fields += wdid + "*:*id*:*";
275
- form_fields += wdtype + "*:*type*:*";
276
- w_choices = new Array();
277
- w_choices_value=new Array();
278
- w_choices_checked = new Array();
279
- w_choices_disabled = new Array();
280
- w_choices_params =new Array();
281
- w_allow_other_num = 0;
282
- w_property = new Array();
283
- w_property_type = new Array();
284
- w_property_values = new Array();
285
- w_choices_price = new Array();
286
- if (document.getElementById(id+'_element_labelform_id_temp').innerHTML) {
287
- w_field_label = document.getElementById(id + '_element_labelform_id_temp').innerHTML.replace(/(\r\n|\n|\r)/gm," ");
288
- }
289
- else {
290
- w_field_label = " ";
291
- }
292
- if (document.getElementById(id + '_label_sectionform_id_temp')) {
293
- if (document.getElementById(id + '_label_sectionform_id_temp').style.display == "block") {
294
- w_field_label_pos = "top";
295
- }
296
- else {
297
- w_field_label_pos = "left";
298
- }
299
- }
300
- if (document.getElementById(id + "_elementform_id_temp")) {
301
- s = document.getElementById(id + "_elementform_id_temp").style.width;
302
- w_size=s.substring(0,s.length - 2);
303
- }
304
- if (document.getElementById(id + "_label_sectionform_id_temp")) {
305
- s = document.getElementById(id + "_label_sectionform_id_temp").style.width;
306
- w_field_label_size = s.substring(0, s.length - 2);
307
- }
308
- if (document.getElementById(id + "_requiredform_id_temp")) {
309
- w_required = document.getElementById(id + "_requiredform_id_temp").value;
310
- }
311
- if (document.getElementById(id + "_uniqueform_id_temp")) {
312
- w_unique = document.getElementById(id + "_uniqueform_id_temp").value;
313
- }
314
- if (document.getElementById(id + '_label_sectionform_id_temp')) {
315
- w_class = document.getElementById(id + '_label_sectionform_id_temp').getAttribute("class");
316
- if (!w_class) {
317
- w_class = "";
318
- }
319
  }
320
- gen_form_fields();
321
- wdform_row.innerHTML = "%" + id + " - " + l_label + "%";
322
  }
323
  }
324
  }
325
  }
326
- else {
327
- id = wdform_page.childNodes[q].getAttribute("wdid");
328
- w_editor = document.getElementById(id + "_element_sectionform_id_temp").innerHTML;
329
- form_fields += id + "*:*id*:*";
330
- form_fields += "type_section_break" + "*:*type*:*";
331
- form_fields += "custom_" + id + "*:*w_field_label*:*";
332
- form_fields += w_editor + "*:*w_editor*:*";
333
- form_fields += "*:*new_field*:*";
334
- wdform_page.childNodes[q].innerHTML = "%" + id + " - " + "custom_" + id + "%";
335
- }
336
  }
337
  }
338
  }
@@ -343,8 +1376,7 @@ class FMViewManage_fm {
343
  }
344
  }
345
  document.getElementById('label_order').value = tox;
346
- document.getElementById('form_fields').value = form_fields;
347
- refresh_();
348
  document.getElementById('pagination').value=document.getElementById('pages').getAttribute("type");
349
  document.getElementById('show_title').value=document.getElementById('pages').getAttribute("show_title");
350
  document.getElementById('show_numbers').value=document.getElementById('pages').getAttribute("show_numbers");
@@ -356,7 +1388,7 @@ class FMViewManage_fm {
356
  function enable() {
357
  alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
358
  for (x = 0; x < 14; x++) {
359
- document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FM_URL . '/images/'; ?>" + alltypes[x] + ".png";
360
  }
361
  if (document.getElementById('formMakerDiv').style.display == 'block') {
362
  jQuery('#formMakerDiv').slideToggle(200);
@@ -379,7 +1411,7 @@ class FMViewManage_fm {
379
  function enable2() {
380
  alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
381
  for (x = 0; x < 14; x++) {
382
- document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FM_URL . '/images/'; ?>" + alltypes[x] + ".png";
383
  }
384
  if (document.getElementById('formMakerDiv').style.display == 'block') {
385
  jQuery('#formMakerDiv').slideToggle(200);
@@ -405,88 +1437,51 @@ class FMViewManage_fm {
405
  }
406
  }
407
  </script>
408
- <div style="clear: both; float: left; width: 99%;">
409
- <div style="float:left; font-size: 14px; font-weight: bold;">
410
  This section allows you to add fields to your form.
411
  <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-4.html">Read More in User Manual</a>
412
  </div>
413
- <div style="float: right; text-align: right;">
414
- <a style="text-decoration: none;" target="_blank" href="https://web-dorado.com/files/fromFormMaker.php">
415
- <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
416
- </a>
417
- </div>
418
- </div>
419
- <form class="wrap" id="manage_form" method="post" action="admin.php?page=manage_fm" style="float: left; width: 99%;">
420
  <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
421
  <h2><?php echo $page_title; ?></h2>
422
  <div style="float: right; margin: 0 5px 0 0;">
423
-
424
- <?php
425
-
426
- if(isset($row->backup_id) )
427
- if($row->backup_id!="")
428
- {
429
- global $wpdb;
430
-
431
- $query = "SELECT backup_id FROM " . $wpdb->prefix . "formmaker_backup WHERE backup_id > ".$row->backup_id." AND id = ".$row->id." ORDER BY backup_id ASC LIMIT 0 , 1 ";
432
- $backup_id = $wpdb->get_var($query);
433
-
434
- if($backup_id)
435
- {?>
436
- <input class="button-primary" type="submit" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; jQuery('#saving_text').html('Redo');fm_set_input_value('task', 'redo');" value="Redo"/>
437
-
438
- <?php
439
- }
440
-
441
- $query = "SELECT backup_id FROM " . $wpdb->prefix . "formmaker_backup WHERE backup_id < ".$row->backup_id." AND id = ".$row->id." ORDER BY backup_id DESC LIMIT 0 , 1 ";
442
- $backup_id = $wpdb->get_var($query);
443
-
444
- if($backup_id)
445
- {?>
446
- <input class="button-secondary" type="submit" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; jQuery('#saving_text').html('Undo');fm_set_input_value('task', 'undo');" value="Undo"/>
447
-
448
- <?php
449
- }
450
- }
451
- ?>
452
- <a href="<?php echo add_query_arg(array('action' => 'FormMakerPreview', 'form_id' => $row->id, 'test_theme' => $row->theme, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" class="button-primary thickbox thickbox-preview" id="preview_form" title="Form Preview" onclick="return false;">
453
- Preview
454
- </a>
455
- <input class="button-primary" type="submit" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'form_options');" value="Form Options"/>
456
- <input class="button-primary" type="submit" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'form_layout');" value="Form Layout"/>
457
  <?php
458
  if ($id) {
459
  ?>
460
- <input class="button-secondary" type="submit" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'save_as_copy')" value="Save as Copy"/>
461
  <?php
462
  }
463
  ?>
464
- <input class="button-secondary" type="submit" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'save')" value="Save"/>
465
- <input class="button-secondary" type="submit" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'apply');" value="Apply"/>
466
  <input class="button-secondary" type="submit" onclick="fm_set_input_value('task', 'cancel')" value="Cancel"/>
467
  </div>
468
 
469
  <div class="formmaker_table" width="100%">
470
  <div style="float: left; text-align: center;"><br />
471
- <img src="<?php echo WD_FM_URL . '/images/formmaker.png'; ?>" /><br /><br />
472
- <img src="<?php echo WD_FM_URL . '/images/logo.png'; ?>" />
473
  </div>
474
  <div style="float:right">
475
  <span style="font-size: 16.76pt; font-family: tahoma; color: #FFFFFF; vertical-align: middle;">Form title:&nbsp;&nbsp;</span>
476
  <input id="title" name="title" class="form_maker_title" value="<?php echo $row->title; ?>"/>
477
  <br />
478
- <img src="<?php echo WD_FM_URL . '/images/formoptions.png'; ?>" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'form_options'); fm_form_submit(event, 'manage_form');" style="cursor: pointer; margin: 10px 0 10px 10px; float: right;"/>
479
  <br /><br /><br />
480
  <img src="<?php echo WD_FM_URL . '/images/addanewfield.png'; ?>" onclick="enable(); Enable();" style="cursor: pointer; margin:10px 0 10px 10px; float: right;"/>
481
  </div>
482
  </div>
483
 
484
- <div id="formMakerDiv" onclick="close_window()"></div>
485
- <div id="formMakerDiv1" style="padding-top: 20px;" align="center">
486
- <table border="0" width="100%" cellpadding="0" cellspacing="0" height="100%" style="border: 6px #00aeef solid; background-color: #FFF;">
487
- <tr>
488
- <td style="padding:0px">
489
- <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
490
  <tr valign="top">
491
  <td width="15%" height="100%" style="border-right: dotted black 1px;" id="field_types">
492
  <div id="when_edit" style="display: none;"></div>
@@ -499,6 +1494,14 @@ class FMViewManage_fm {
499
  <img src="<?php echo WD_FM_URL . '/images/text.png'; ?>" style="margin:5px" id="img_text"/>
500
  </td>
501
  </tr>
 
 
 
 
 
 
 
 
502
  <tr>
503
  <td align="center" onClick="addRow('checkbox')" style="cursor:pointer" id="table_checkbox" class="field_buttons">
504
  <img src="<?php echo WD_FM_URL . '/images/checkbox.png'; ?>" style="margin:5px" id="img_checkbox"/>
@@ -508,43 +1511,32 @@ class FMViewManage_fm {
508
  </td>
509
  </tr>
510
  <tr>
511
- <td align="center" onClick="addRow('survey')" class="field_buttons" id="table_survey">
512
- <img src="<?php echo WD_FM_URL . '/images/survey.png'; ?>" style="margin:5px" id="img_survey"/>
513
  </td>
514
- <td align="center" onClick="addRow('time_and_date')" style="cursor:pointer" id="table_time_and_date" class="field_buttons">
515
- <img src="<?php echo WD_FM_URL . '/images/time_and_date.png'; ?>" style="margin:5px" id="img_time_and_date"/>
516
  </td>
517
  </tr>
518
  <tr>
519
- <td align="center" onClick="addRow('select')" style="cursor:pointer" id="table_select" class="field_buttons">
520
- <img src="<?php echo WD_FM_URL . '/images/select.png'; ?>" style="margin:5px" id="img_select"/>
521
- </td>
522
- <td align="center" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_file_upload" class="field_buttons"
523
- onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')">
524
- <img src="<?php echo WD_FM_URL . '/images/file_upload.png'; ?>" style="margin:5px" id="img_file_upload" />
525
  </td>
526
- </tr>
527
- <tr>
528
  <td align="center" onClick="addRow('section_break')" style="cursor:pointer" id="table_section_break" class="field_buttons">
529
  <img src="<?php echo WD_FM_URL . '/images/section_break.png'; ?>" style="margin:5px" id="img_section_break"/>
530
  </td>
531
- <td align="center" onClick="addRow('page_break')" style="cursor:pointer" id="table_page_break" class="field_buttons">
532
- <img src="<?php echo WD_FM_URL . '/images/page_break.png'; ?>" style="margin:5px" id="img_page_break"/>
533
- </td>
534
  </tr>
535
  <tr>
536
- <td align="center" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_map" class="field_buttons"
537
- onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')">
538
- <img src="<?php echo WD_FM_URL . '/images/map.png'; ?>" style="margin:5px" id="img_map" />
539
  </td>
540
- <td align="center" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_paypal" class="field_buttons"
541
- onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')">
542
- <img src="<?php echo WD_FM_URL . '/images/paypal.png'; ?>" style="margin:5px" id="img_paypal" />
543
  </td>
544
  </tr>
545
  <tr>
546
- <td align="center" onClick="addRow('captcha')" style="cursor:pointer" id="table_captcha" class="field_buttons">
547
- <img src="<?php echo WD_FM_URL . '/images/captcha.png'; ?>" style="margin:5px" id="img_captcha"/>
548
  </td>
549
  <td align="center" onClick="addRow('button')" id="table_button" class="field_buttons">
550
  <img src="<?php echo WD_FM_URL . '/images/button.png'; ?>" style="margin:5px" id="img_button"/>
@@ -566,7 +1558,7 @@ class FMViewManage_fm {
566
  At The Beginning
567
  <input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
568
  Before
569
- <select style="width: 100px; margin-left: 5px;" id="sel_el_pos" onclick="change_before()" disabled="disabled"></select>
570
  <img alt="ADD" title="add" style="cursor:pointer; vertical-align:middle; margin:5px" src="<?php echo WD_FM_URL . '/images/save.png'; ?>" onClick="add(0, false)"/>
571
  <img alt="CANCEL" title="cancel" style="cursor: pointer; vertical-align:middle; margin:5px" src="<?php echo WD_FM_URL . '/images/cancel_but.png'; ?>" onClick="close_window()"/>
572
  <hr style=" margin-bottom:10px" />
@@ -587,14 +1579,14 @@ class FMViewManage_fm {
587
  <input type="hidden" id="element_type" />
588
  <input type="hidden" id="editing_id" />
589
  <input type="hidden" value="<?php echo WD_FM_URL; ?>" id="form_plugins_url" />
590
- <div id="main_editor" style="position: absolute; display: none; z-index: 140;">
591
  <?php
592
  if (user_can_richedit()) {
593
  wp_editor('', 'form_maker_editor', array('teeny' => FALSE, 'textarea_name' => 'form_maker_editor', 'media_buttons' => FALSE, 'textarea_rows' => 5));
594
  }
595
  else {
596
  ?>
597
- <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>
598
  <?php
599
  }
600
  ?>
@@ -607,82 +1599,67 @@ class FMViewManage_fm {
607
  <?php
608
  }
609
  ?>
610
- <br />
611
- <div style="margin-left:5px;">
612
- <label for="enable_sortable" style="font-size: 14px; font-weight: bold;">Enable Drag & Drop</label>
613
- <input type="checkbox" name="sortable" id="enable_sortable" value="<?php echo $row->sortable; ?>" onclick="enable_drag(this)" <?php if($row->sortable==1) echo 'checked="checked"'; ?> />
614
- <div>You can use drag and drop to move the fields up/down for the change of the order and left/right for creating columns within the form.</div>
615
- </div>
616
  <br />
617
  <fieldset>
618
  <legend><h2 style="color: #00aeef;">Form</h2></legend>
619
- <div id="saving" style="display:none;">
620
- <div id="saving_text">Saving</div>
621
- <div id="fadingBarsG">
622
- <div id="fadingBarsG_1" class="fadingBarsG"></div>
623
- <div id="fadingBarsG_2" class="fadingBarsG"></div>
624
- <div id="fadingBarsG_3" class="fadingBarsG"></div>
625
- <div id="fadingBarsG_4" class="fadingBarsG"></div>
626
- <div id="fadingBarsG_5" class="fadingBarsG"></div>
627
- <div id="fadingBarsG_6" class="fadingBarsG"></div>
628
- <div id="fadingBarsG_7" class="fadingBarsG"></div>
629
- <div id="fadingBarsG_8" class="fadingBarsG"></div>
630
- </div>
631
- </div>
632
  <?php
633
- if ($id) {
634
- ?>
635
- <div style="margin: 8px; display: table; width: 100%;" id="page_bar">
636
- <div id="page_navigation" style="display: table-row;">
637
- <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>
638
- <div align="left" id="edit_page_navigation" style="display: table-cell; vertical-align: middle;"></div>
639
- </div>
640
- </div>
641
- <div id="take" class="main">
642
- <?php
643
- echo $row->form_front;
644
- ?>
645
- </div>
646
- <?php
647
  }
648
  else {
649
  ?>
650
- <div style="margin:8px; display:table; width:100%" id="page_bar">
651
- <div id="page_navigation" style="display:table-row">
652
- <div align="center" id="pages" show_title="false" show_numbers="true" type="none" style="display:table-cell; width:90%"></div>
653
- <div align="left" id="edit_page_navigation" style="display:table-cell; vertical-align: middle;"></div>
654
- </div>
655
- </div>
656
- <div id="take" class="main">
657
- <div class="wdform-page-and-images" style="display:table; border-top:0px solid black;">
658
- <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">
659
- <div class="wdform_section"><div class="wdform_column"></div></div>
660
- <div valign="top" class="wdform_footer" style="width: 100%;">
661
- <div style="width: 100%;">
662
- <div style="width: 100%; display: table;">
663
- <div style="display: table-row-group;">
664
- <div id="form_id_temppage_nav1" style="display: table-row;"></div>
665
- </div>
666
- </div>
667
- </div>
668
- </div>
669
- </div>
670
- <div id="form_id_tempform_view_img1" style="float: right;">
671
- <div>
672
- <img src="<?php echo WD_FM_URL . '/images/minus.png'; ?>" title="Show or hide the page" class="page_toolbar" onClick="show_or_hide('1')" onMouseOver="chnage_icons_src(this,'minus')" onmouseout="chnage_icons_src(this,'minus')" id="show_page_img_1"/>
673
- <img src="<?php echo WD_FM_URL . '/images/page_delete.png'; ?>" title="Delete the page" class="page_toolbar" onClick="remove_page('1')" onMouseOver="chnage_icons_src(this,'page_delete')" onmouseout="chnage_icons_src(this,'page_delete')"/>
674
- <img src="<?php echo WD_FM_URL . '/images/page_delete_all.png'; ?>" title="Delete the page with fields" class="page_toolbar" onClick="remove_page_all('1')" onMouseOver="chnage_icons_src(this,'page_delete_all')" onmouseout="chnage_icons_src(this,'page_delete_all')"/>
675
- <img src="<?php echo WD_FM_URL . '/images/page_edit.png'; ?>" title="Edit the page" class="page_toolbar" onClick="edit_page_break('1')" onMouseOver="chnage_icons_src(this,'page_edit')" onmouseout="chnage_icons_src(this,'page_edit')"/>
676
- </div>
677
- </div>
678
- </div>
679
- </div>
 
 
 
 
 
 
 
680
  <?php
681
  }
682
  ?>
 
683
  </fieldset>
 
684
  <input type="hidden" name="form_front" id="form_front" />
685
- <input type="hidden" name="form_fields" id="form_fields" />
686
  <input type="hidden" name="pagination" id="pagination" />
687
  <input type="hidden" name="show_title" id="show_title" />
688
  <input type="hidden" name="show_numbers" id="show_numbers" />
@@ -693,1037 +1670,89 @@ class FMViewManage_fm {
693
  <input type="hidden" id="label_order_current" name="label_order_current" value="<?php echo $row->label_order_current; ?>" />
694
  <input type="hidden" name="counter" id="counter" value="<?php echo $row->counter; ?>" />
695
  <input type="hidden" id="araqel" value="0" />
696
- <input type="hidden" name="backup_id" id="backup_id" value="<?php echo $row->backup_id;?>">
697
- <?php
698
- if ($id) {
699
- ?>
700
  <script type="text/javascript">
 
 
 
701
  function formOnload() {
702
  // Enable maps.
703
- for (t = 0; t < <?php echo $row->counter; ?>; t++) {
704
- if (document.getElementById(t + "_typeform_id_temp")) {
705
- if (document.getElementById(t + "_typeform_id_temp").value == "type_map" || document.getElementById(t + "_typeform_id_temp").value == "type_mark_map") {
706
  if_gmap_init(t);
707
  for (q = 0; q < 20; q++) {
708
- if (document.getElementById(t + "_elementform_id_temp").getAttribute("long" + q)) {
709
- w_long = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("long" + q));
710
- w_lat = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("lat" + q));
711
- w_info = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("info" + q));
712
- add_marker_on_map(t, q, w_long, w_lat, w_info, false);
713
  }
714
  }
715
  }
716
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_date") {
717
- // Calendar.setup({
718
- // inputField:t + "_elementform_id_temp",
719
- // ifFormat:document.getElementById(t + "_buttonform_id_temp").getAttribute('format'),
720
- // button:t + "_buttonform_id_temp",
721
- // align:"Tl",
722
- // singleClick:true,
723
- // firstDay:0
724
- // });
725
- }
726
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_name") {
727
- var myu = t;
728
- jQuery(document).ready(function () {
729
- jQuery("#" + myu + "_mini_label_first").click(function () {
730
- if (jQuery(this).children('input').length == 0) {
731
- var first = "<input type='text' id='first' class='first' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
732
- jQuery(this).html(first);
733
- jQuery("input.first").focus();
734
- jQuery("input.first").blur(function () {
735
- var id_for_blur = document.getElementById('first').parentNode.id.split('_');
736
- var value = jQuery(this).val();
737
- jQuery("#" + id_for_blur[0] + "_mini_label_first").text(value);
738
- });
739
- }
740
- });
741
- jQuery("label#" + myu + "_mini_label_last").click(function () {
742
- if (jQuery(this).children('input').length == 0) {
743
- var last = "<input type='text' id='last' class='last' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
744
- jQuery(this).html(last);
745
- jQuery("input.last").focus();
746
- jQuery("input.last").blur(function () {
747
- var id_for_blur = document.getElementById('last').parentNode.id.split('_');
748
- var value = jQuery(this).val();
749
- jQuery("#" + id_for_blur[0] + "_mini_label_last").text(value);
750
- });
751
- }
752
- });
753
- jQuery("label#" + myu + "_mini_label_title").click(function () {
754
- if (jQuery(this).children('input').length == 0) {
755
- var title_ = "<input type='text' id='title_' class='title_' style='outline:none; border:none; background:none; width:50px;' value=\"" + jQuery(this).text() + "\">";
756
- jQuery(this).html(title_);
757
- jQuery("input.title_").focus();
758
- jQuery("input.title_").blur(function () {
759
- var id_for_blur = document.getElementById('title_').parentNode.id.split('_');
760
- var value = jQuery(this).val();
761
- jQuery("#" + id_for_blur[0] + "_mini_label_title").text(value);
762
- });
763
- }
764
- });
765
- jQuery("label#" + myu + "_mini_label_middle").click(function () {
766
- if (jQuery(this).children('input').length == 0) {
767
- var middle = "<input type='text' id='middle' class='middle' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
768
- jQuery(this).html(middle);
769
- jQuery("input.middle").focus();
770
- jQuery("input.middle").blur(function () {
771
- var id_for_blur = document.getElementById('middle').parentNode.id.split('_');
772
- var value = jQuery(this).val();
773
- jQuery("#" + id_for_blur[0] + "_mini_label_middle").text(value);
774
- });
775
- }
776
- });
777
- });
778
- }
779
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_phone") {
780
- var myu = t;
781
- jQuery(document).ready(function () {
782
- jQuery("label#" + myu + "_mini_label_area_code").click(function () {
783
- if (jQuery(this).children('input').length == 0) {
784
- 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() + "\">";
785
- jQuery(this).html(area_code);
786
- jQuery("input.area_code").focus();
787
- jQuery("input.area_code").blur(function () {
788
- var id_for_blur = document.getElementById('area_code').parentNode.id.split('_');
789
- var value = jQuery(this).val();
790
- jQuery("#" + id_for_blur[0] + "_mini_label_area_code").text(value);
791
- });
792
- }
793
- });
794
- jQuery("label#" + myu + "_mini_label_phone_number").click(function () {
795
- if (jQuery(this).children('input').length == 0) {
796
- var phone_number = "<input type='text' id='phone_number' class='phone_number' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
797
- jQuery(this).html(phone_number);
798
- jQuery("input.phone_number").focus();
799
- jQuery("input.phone_number").blur(function () {
800
- var id_for_blur = document.getElementById('phone_number').parentNode.id.split('_');
801
- var value = jQuery(this).val();
802
- jQuery("#" + id_for_blur[0] + "_mini_label_phone_number").text(value);
803
- });
804
- }
805
- });
806
- });
807
- }
808
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_date_fields") {
809
- var myu = t;
810
- jQuery(document).ready(function () {
811
- jQuery("label#" + myu + "_day_label").click(function () {
812
- if (jQuery(this).children('input').length == 0) {
813
- var day = "<input type='text' id='day' class='day' size='8' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
814
- jQuery(this).html(day);
815
- jQuery("input.day").focus();
816
- jQuery("input.day").blur(function () {
817
- var id_for_blur = document.getElementById('day').parentNode.id.split('_');
818
- var value = jQuery(this).val();
819
- jQuery("#" + id_for_blur[0] + "_day_label").text(value);
820
- });
821
- }
822
- });
823
- jQuery("label#" + myu + "_month_label").click(function () {
824
- if (jQuery(this).children('input').length == 0) {
825
- var month = "<input type='text' id='month' class='month' size='8' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
826
- jQuery(this).html(month);
827
- jQuery("input.month").focus();
828
- jQuery("input.month").blur(function () {
829
- var id_for_blur = document.getElementById('month').parentNode.id.split('_');
830
- var value = jQuery(this).val();
831
- jQuery("#" + id_for_blur[0] + "_month_label").text(value);
832
- });
833
- }
834
- });
835
- jQuery("label#" + myu + "_year_label").click(function () {
836
- if (jQuery(this).children('input').length == 0) {
837
- var year = "<input type='text' id='year' class='year' size='8' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
838
- jQuery(this).html(year);
839
- jQuery("input.year").focus();
840
- jQuery("input.year").blur(function () {
841
- var id_for_blur = document.getElementById('year').parentNode.id.split('_');
842
- var value = jQuery(this).val();
843
- jQuery("#" + id_for_blur[0] + "_year_label").text(value);
844
- });
845
- }
846
- });
847
- });
848
- }
849
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_time") {
850
- var myu = t;
851
- jQuery(document).ready(function () {
852
- jQuery("label#" + myu + "_mini_label_hh").click(function () {
853
- if (jQuery(this).children('input').length == 0) {
854
- var hh = "<input type='text' id='hh' class='hh' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
855
- jQuery(this).html(hh);
856
- jQuery("input.hh").focus();
857
- jQuery("input.hh").blur(function () {
858
- var id_for_blur = document.getElementById('hh').parentNode.id.split('_');
859
- var value = jQuery(this).val();
860
- jQuery("#" + id_for_blur[0] + "_mini_label_hh").text(value);
861
- });
862
- }
863
- });
864
- jQuery("label#" + myu + "_mini_label_mm").click(function () {
865
- if (jQuery(this).children('input').length == 0) {
866
- var mm = "<input type='text' id='mm' class='mm' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
867
- jQuery(this).html(mm);
868
- jQuery("input.mm").focus();
869
- jQuery("input.mm").blur(function () {
870
- var id_for_blur = document.getElementById('mm').parentNode.id.split('_');
871
- var value = jQuery(this).val();
872
- jQuery("#" + id_for_blur[0] + "_mini_label_mm").text(value);
873
- });
874
- }
875
- });
876
- jQuery("label#" + myu + "_mini_label_ss").click(function () {
877
- if (jQuery(this).children('input').length == 0) {
878
- var ss = "<input type='text' id='ss' class='ss' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
879
- jQuery(this).html(ss);
880
- jQuery("input.ss").focus();
881
- jQuery("input.ss").blur(function () {
882
- var id_for_blur = document.getElementById('ss').parentNode.id.split('_');
883
- var value = jQuery(this).val();
884
- jQuery("#" + id_for_blur[0] + "_mini_label_ss").text(value);
885
- });
886
- }
887
- });
888
- jQuery("label#" + myu + "_mini_label_am_pm").click(function () {
889
- if (jQuery(this).children('input').length == 0) {
890
- 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() + "\">";
891
- jQuery(this).html(am_pm);
892
- jQuery("input.am_pm").focus();
893
- jQuery("input.am_pm").blur(function () {
894
- var id_for_blur = document.getElementById('am_pm').parentNode.id.split('_');
895
- var value = jQuery(this).val();
896
- jQuery("#" + id_for_blur[0] + "_mini_label_am_pm").text(value);
897
- });
898
- }
899
- });
900
- });
901
- }
902
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_paypal_price") {
903
- var myu = t;
904
- jQuery(document).ready(function () {
905
- jQuery("#" + myu + "_mini_label_dollars").click(function () {
906
- if (jQuery(this).children('input').length == 0) {
907
- var dollars = "<input type='text' id='dollars' class='dollars' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
908
- jQuery(this).html(dollars);
909
- jQuery("input.dollars").focus();
910
- jQuery("input.dollars").blur(function () {
911
- var id_for_blur = document.getElementById('dollars').parentNode.id.split('_');
912
- var value = jQuery(this).val();
913
- jQuery("#" + id_for_blur[0] + "_mini_label_dollars").text(value);
914
- });
915
- }
916
- });
917
- jQuery("label#" + myu + "_mini_label_cents").click(function () {
918
- if (jQuery(this).children('input').length == 0) {
919
- var cents = "<input type='text' id='cents' class='cents' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
920
- jQuery(this).html(cents);
921
- jQuery("input.cents").focus();
922
- jQuery("input.cents").blur(function () {
923
- var id_for_blur = document.getElementById('cents').parentNode.id.split('_');
924
- var value = jQuery(this).val();
925
- jQuery("#" + id_for_blur[0] + "_mini_label_cents").text(value);
926
- });
927
- }
928
- });
929
- });
930
- }
931
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_address") {
932
- var myu = t;
933
- jQuery(document).ready(function () {
934
- jQuery("label#" + myu + "_mini_label_street1").click(function () {
935
- if (jQuery(this).children('input').length == 0) {
936
- var street1 = "<input type='text' id='street1' class='street1' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
937
- jQuery(this).html(street1);
938
- jQuery("input.street1").focus();
939
- jQuery("input.street1").blur(function () {
940
- var id_for_blur = document.getElementById('street1').parentNode.id.split('_');
941
- var value = jQuery(this).val();
942
- jQuery("#" + id_for_blur[0] + "_mini_label_street1").text(value);
943
- });
944
- }
945
- });
946
- jQuery("label#" + myu + "_mini_label_street2").click(function () {
947
- if (jQuery(this).children('input').length == 0) {
948
- var street2 = "<input type='text' id='street2' class='street2' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
949
- jQuery(this).html(street2);
950
- jQuery("input.street2").focus();
951
- jQuery("input.street2").blur(function () {
952
- var id_for_blur = document.getElementById('street2').parentNode.id.split('_');
953
- var value = jQuery(this).val();
954
- jQuery("#" + id_for_blur[0] + "_mini_label_street2").text(value);
955
- });
956
- }
957
- });
958
- jQuery("label#" + myu + "_mini_label_city").click(function () {
959
- if (jQuery(this).children('input').length == 0) {
960
- var city = "<input type='text' id='city' class='city' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
961
- jQuery(this).html(city);
962
- jQuery("input.city").focus();
963
- jQuery("input.city").blur(function () {
964
- var id_for_blur = document.getElementById('city').parentNode.id.split('_');
965
- var value = jQuery(this).val();
966
- jQuery("#" + id_for_blur[0] + "_mini_label_city").text(value);
967
- });
968
- }
969
- });
970
- jQuery("label#" + myu + "_mini_label_state").click(function () {
971
- if (jQuery(this).children('input').length == 0) {
972
- var state = "<input type='text' id='state' class='state' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
973
- jQuery(this).html(state);
974
- jQuery("input.state").focus();
975
- jQuery("input.state").blur(function () {
976
- var id_for_blur = document.getElementById('state').parentNode.id.split('_');
977
- var value = jQuery(this).val();
978
- jQuery("#" + id_for_blur[0] + "_mini_label_state").text(value);
979
- });
980
- }
981
- });
982
- jQuery("label#" + myu + "_mini_label_postal").click(function () {
983
- if (jQuery(this).children('input').length == 0) {
984
- var postal = "<input type='text' id='postal' class='postal' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
985
- jQuery(this).html(postal);
986
- jQuery("input.postal").focus();
987
- jQuery("input.postal").blur(function () {
988
- var id_for_blur = document.getElementById('postal').parentNode.id.split('_');
989
- var value = jQuery(this).val();
990
- jQuery("#" + id_for_blur[0] + "_mini_label_postal").text(value);
991
- });
992
- }
993
- });
994
- jQuery("label#" + myu + "_mini_label_country").click(function () {
995
- if (jQuery(this).children('input').length == 0) {
996
- var country = "<input type='country' id='country' class='country' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
997
- jQuery(this).html(country);
998
- jQuery("input.country").focus();
999
- jQuery("input.country").blur(function () {
1000
- var id_for_blur = document.getElementById('country').parentNode.id.split('_');
1001
- var value = jQuery(this).val();
1002
- jQuery("#" + id_for_blur[0] + "_mini_label_country").text(value);
1003
- });
1004
- }
1005
- });
1006
- });
1007
- }
1008
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_scale_rating") {
1009
- var myu = t;
1010
- jQuery(document).ready(function () {
1011
- jQuery("#" + myu + "_mini_label_worst").click(function () {
1012
- if (jQuery(this).children('input').length == 0) {
1013
- 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() + "\">";
1014
- jQuery(this).html(worst);
1015
- jQuery("input.worst").focus();
1016
- jQuery("input.worst").blur(function () {
1017
- var id_for_blur = document.getElementById('worst').parentNode.id.split('_');
1018
- var value = jQuery(this).val();
1019
- jQuery("#" + id_for_blur[0] + "_mini_label_worst").text(value);
1020
- });
1021
- }
1022
- });
1023
- jQuery("label#" + myu + "_mini_label_best").click(function () {
1024
- if (jQuery(this).children('input').length == 0) {
1025
-
1026
- 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() + "\">";
1027
- jQuery(this).html(best);
1028
- jQuery("input.best").focus();
1029
- jQuery("input.best").blur(function () {
1030
- var id_for_blur = document.getElementById('best').parentNode.id.split('_');
1031
- var value = jQuery(this).val();
1032
- jQuery("#" + id_for_blur[0] + "_mini_label_best").text(value);
1033
- });
1034
- }
1035
- });
1036
- });
1037
- }
1038
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_spinner") {
1039
- var spinner_value = document.getElementById(t + "_elementform_id_temp").value;
1040
- var spinner_min_value = document.getElementById(t + "_min_valueform_id_temp").value;
1041
- var spinner_max_value = document.getElementById(t + "_max_valueform_id_temp").value;
1042
- var spinner_step = document.getElementById(t + "_stepform_id_temp").value;
1043
- jQuery("#" + t + "_elementform_id_temp")[0].spin = null;
1044
- spinner = jQuery("#" + t + "_elementform_id_temp").spinner();
1045
- spinner.spinner("value", spinner_value);
1046
- jQuery("#" + t + "_elementform_id_temp").spinner({ min:spinner_min_value});
1047
- jQuery("#" + t + "_elementform_id_temp").spinner({ max:spinner_max_value});
1048
- jQuery("#" + t + "_elementform_id_temp").spinner({ step:spinner_step});
1049
- }
1050
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_slider") {
1051
- var slider_value = document.getElementById(t + "_slider_valueform_id_temp").value;
1052
- var slider_min_value = document.getElementById(t + "_slider_min_valueform_id_temp").value;
1053
- var slider_max_value = document.getElementById(t + "_slider_max_valueform_id_temp").value;
1054
- var slider_element_value = document.getElementById(t + "_element_valueform_id_temp");
1055
- var slider_value_save = document.getElementById(t + "_slider_valueform_id_temp");
1056
- jQuery("#" + t + "_elementform_id_temp")[0].slide = null;
1057
- jQuery(function () {
1058
- jQuery("#" + t + "_elementform_id_temp").slider({
1059
- range:"min",
1060
- value:eval(slider_value),
1061
- min:eval(slider_min_value),
1062
- max:eval(slider_max_value),
1063
- slide:function (event, ui) {
1064
- slider_element_value.innerHTML = "" + ui.value;
1065
- slider_value_save.value = "" + ui.value;
1066
- }
1067
- });
1068
- });
1069
- }
1070
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_range") {
1071
- var spinner_value0 = document.getElementById(t + "_elementform_id_temp0").value;
1072
- var spinner_step = document.getElementById(t + "_range_stepform_id_temp").value;
1073
- jQuery("#" + t + "_elementform_id_temp0")[0].spin = null;
1074
- jQuery("#" + t + "_elementform_id_temp1")[0].spin = null;
1075
- spinner0 = jQuery("#" + t + "_elementform_id_temp0").spinner();
1076
- spinner0.spinner("value", spinner_value0);
1077
- jQuery("#" + t + "_elementform_id_temp0").spinner({ step:spinner_step});
1078
- var spinner_value1 = document.getElementById(t + "_elementform_id_temp1").value;
1079
- spinner1 = jQuery("#" + t + "_elementform_id_temp1").spinner();
1080
- spinner1.spinner("value", spinner_value1);
1081
- jQuery("#" + t + "_elementform_id_temp1").spinner({ step:spinner_step});
1082
- var myu = t;
1083
- jQuery(document).ready(function () {
1084
- jQuery("#" + myu + "_mini_label_from").click(function () {
1085
- if (jQuery(this).children('input').length == 0) {
1086
- 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() + "\">";
1087
- jQuery(this).html(from);
1088
- jQuery("input.from").focus();
1089
- jQuery("input.from").blur(function () {
1090
- var id_for_blur = document.getElementById('from').parentNode.id.split('_');
1091
- var value = jQuery(this).val();
1092
- jQuery("#" + id_for_blur[0] + "_mini_label_from").text(value);
1093
- });
1094
- }
1095
- });
1096
- jQuery("label#" + myu + "_mini_label_to").click(function () {
1097
- if (jQuery(this).children('input').length == 0) {
1098
- 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() + "\">";
1099
- jQuery(this).html(to);
1100
- jQuery("input.to").focus();
1101
- jQuery("input.to").blur(function () {
1102
- var id_for_blur = document.getElementById('to').parentNode.id.split('_');
1103
- var value = jQuery(this).val();
1104
- jQuery("#" + id_for_blur[0] + "_mini_label_to").text(value);
1105
- });
1106
- }
1107
- });
1108
- });
1109
- }
1110
- }
1111
- }
1112
- remove_whitespace(document.getElementById('take'));
1113
- form_view = 1;
1114
- form_view_count = 0;
1115
- for (i = 1; i <= 30; i++) {
1116
- if (document.getElementById('form_id_tempform_view' + i)) {
1117
- form_view_count++;
1118
- form_view_max = i;
1119
- tbody_img = document.createElement('div');
1120
- tbody_img.setAttribute('id', 'form_id_tempform_view_img' + i);
1121
- tbody_img.style.cssText = "float:right";
1122
- tr_img = document.createElement('div');
1123
- var img = document.createElement('img');
1124
- img.setAttribute('src', '<?php echo WD_FM_URL; ?>/images/minus.png');
1125
- img.setAttribute('title', 'Show or hide the page');
1126
- img.setAttribute("class", "page_toolbar");
1127
- img.setAttribute('id', 'show_page_img_' + i);
1128
- img.setAttribute('onClick', 'show_or_hide("' + i + '")');
1129
- img.setAttribute("onmouseover", 'chnage_icons_src(this,"minus")');
1130
- img.setAttribute("onmouseout", 'chnage_icons_src(this,"minus")');
1131
- var img_X = document.createElement("img");
1132
- img_X.setAttribute("src", "<?php echo WD_FM_URL; ?>/images/page_delete.png");
1133
- img_X.setAttribute('title', 'Delete the page');
1134
- img_X.setAttribute("class", "page_toolbar");
1135
- img_X.setAttribute("onclick", 'remove_page("' + i + '")');
1136
- img_X.setAttribute("onmouseover", 'chnage_icons_src(this,"page_delete")');
1137
- img_X.setAttribute("onmouseout", 'chnage_icons_src(this,"page_delete")');
1138
- var img_X_all = document.createElement("img");
1139
- img_X_all.setAttribute("src", "<?php echo WD_FM_URL; ?>/images/page_delete_all.png");
1140
- img_X_all.setAttribute('title', 'Delete the page with fields');
1141
- img_X_all.setAttribute("class", "page_toolbar");
1142
- img_X_all.setAttribute("onclick", 'remove_page_all("' + i + '")');
1143
- img_X_all.setAttribute("onmouseover", 'chnage_icons_src(this,"page_delete_all")');
1144
- img_X_all.setAttribute("onmouseout", 'chnage_icons_src(this,"page_delete_all")');
1145
- var img_EDIT = document.createElement("img");
1146
- img_EDIT.setAttribute("src", "<?php echo WD_FM_URL; ?>/images/page_edit.png");
1147
- img_EDIT.setAttribute('title', 'Edit the page');
1148
- img_EDIT.setAttribute("class", "page_toolbar");
1149
- img_EDIT.setAttribute("onclick", 'edit_page_break("' + i + '")');
1150
- img_EDIT.setAttribute("onmouseover", 'chnage_icons_src(this,"page_edit")');
1151
- img_EDIT.setAttribute("onmouseout", 'chnage_icons_src(this,"page_edit")');
1152
- tr_img.appendChild(img);
1153
- tr_img.appendChild(img_X);
1154
- tr_img.appendChild(img_X_all);
1155
- tr_img.appendChild(img_EDIT);
1156
- tbody_img.appendChild(tr_img);
1157
- document.getElementById('form_id_tempform_view' + i).parentNode.appendChild(tbody_img);
1158
- }
1159
- }
1160
- if (form_view_count > 1) {
1161
- for (i = 1; i <= form_view_max; i++) {
1162
- if (document.getElementById('form_id_tempform_view' + i)) {
1163
- first_form_view = i;
1164
- break;
1165
- }
1166
- }
1167
- form_view = form_view_max;
1168
- need_enable = false;
1169
- generate_page_nav(first_form_view);
1170
- var img_EDIT = document.createElement("img");
1171
- img_EDIT.setAttribute("src", "<?php echo WD_FM_URL . '/images/edit.png'; ?>");
1172
- img_EDIT.style.cssText = "margin-left:40px; cursor:pointer";
1173
- img_EDIT.setAttribute("onclick", 'el_page_navigation()');
1174
- var td_EDIT = document.getElementById("edit_page_navigation");
1175
- td_EDIT.appendChild(img_EDIT);
1176
- document.getElementById('page_navigation').appendChild(td_EDIT);
1177
- }
1178
- document.getElementById('araqel').value = 1;
1179
  }
1180
- jQuery(window).load(function () {
1181
- formOnload();
1182
- });
1183
- jQuery(function() {
1184
-
1185
- jQuery('.wdform_section .wdform_column:last-child').each(function() {
1186
- jQuery(this).parent().append(jQuery('<div></div>').addClass("wdform_column"));
1187
- });
1188
 
1189
- sortable_columns();
1190
- if(<?php echo $row->sortable ?>==1)
1191
- {
1192
- jQuery( ".wdform_arrows" ).hide();
1193
- all_sortable_events();
1194
- }
1195
- else
1196
- jQuery('.wdform_column').sortable( "disable" );
1197
-
1198
- });
1199
- </script>
1200
- <?php
1201
- }
1202
- else { ?>
1203
- <script type="text/javascript">
1204
- jQuery(function() {
1205
- jQuery('.wdform_section .wdform_column:last-child').each(function() {
1206
- jQuery(this).parent().append(jQuery('<div></div>').addClass("wdform_column"));
1207
- });
1208
- sortable_columns();
1209
- all_sortable_events();
1210
- });
1211
- </script>
1212
- <?php }
1213
- ?>
1214
-
1215
- <input type="hidden" name="option" value="com_formmaker" />
1216
- <input type="hidden" name="id" value="<?php echo $row->id; ?>" />
1217
- <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
1218
-
1219
- <input type="hidden" id="task" name="task" value=""/>
1220
- <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
1221
- </form>
1222
- <?php
1223
- }
1224
 
1225
- public function edit_old($id) {
1226
- // header("X-XSS-Protection: 0");
1227
- $row = $this->model->get_row_data($id);
1228
- $themes = $this->model->get_theme_rows_data('old');
1229
- $labels = array();
1230
- $label_id = array();
1231
- $label_order_original = array();
1232
- $label_type = array();
1233
- $label_all = explode('#****#', $row->label_order);
1234
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
1235
- foreach ($label_all as $key => $label_each) {
1236
- $label_id_each = explode('#**id**#', $label_each);
1237
- array_push($label_id, $label_id_each[0]);
1238
- $label_oder_each = explode('#**label**#', $label_id_each[1]);
1239
- array_push($label_order_original, addslashes($label_oder_each[0]));
1240
- array_push($label_type, $label_oder_each[1]);
1241
- }
1242
- $labels['id'] = '"' . implode('","', $label_id) . '"';
1243
- $labels['label'] = '"' . implode('","', $label_order_original) . '"';
1244
- $labels['type'] = '"' . implode('","', $label_type) . '"';
1245
-
1246
- $page_title = (($id != 0) ? 'Edit form ' . $row->title : 'Create new form');
1247
- ?>
1248
- <script type="text/javascript">
1249
- var plugin_url = "<?php echo WD_FM_URL; ?>";
1250
- </script>
1251
- <script src="<?php echo WD_FM_URL . '/js/formmaker_free.js'; ?>?ver=<?php echo get_option("wd_form_maker_version"); ?>" type="text/javascript"></script>
1252
- <script type="text/javascript">
1253
- function submitbutton() {
1254
- if (!document.getElementById('araqel') || (document.getElementById('araqel').value == '0')) {
1255
- alert('Please wait while page loading.');
1256
- return false;
1257
- }
1258
- tox = '';
1259
- l_id_array = [<?php echo $labels['id']?>];
1260
- l_label_array = [<?php echo $labels['label']?>];
1261
- l_type_array = [<?php echo $labels['type']?>];
1262
- l_id_removed = [];
1263
- for (x=0; x< l_id_array.length; x++) {
1264
- l_id_removed[l_id_array[x]]=true;
1265
- }
1266
- for (t=1;t<=form_view_max;t++) {
1267
- if (document.getElementById('form_id_tempform_view'+t)) {
1268
- form_view_element=document.getElementById('form_id_tempform_view'+t);
1269
- n=form_view_element.childNodes.length-2;
1270
- for(q=0;q<=n;q++) {
1271
- if (form_view_element.childNodes[q].nodeType!=3) {
1272
- if (!form_view_element.childNodes[q].id) {
1273
- GLOBAL_tr=form_view_element.childNodes[q];
1274
- for (x=0; x < GLOBAL_tr.firstChild.childNodes.length; x++) {
1275
- table=GLOBAL_tr.firstChild.childNodes[x];
1276
- tbody=table.firstChild;
1277
- for (y=0; y < tbody.childNodes.length; y++) {
1278
- is_in_old=false;
1279
- tr=tbody.childNodes[y];
1280
- l_id=tr.id;
1281
- l_label=document.getElementById( tr.id+'_element_labelform_id_temp').innerHTML;
1282
- l_label = l_label.replace(/(\r\n|\n|\r)/gm," ");
1283
- l_type=tr.getAttribute('type');
1284
- for (z = 0; z < l_id_array.length; z++) {
1285
- if (l_id_array[z] == l_id) {
1286
- if (l_type_array[z] == "type_address") {
1287
- if (document.getElementById(l_id + "_mini_label_street1")) {
1288
- l_id_removed[l_id_array[z]] = false;
1289
- }
1290
- if (document.getElementById(l_id+"_mini_label_street2")) {
1291
- l_id_removed[parseInt(l_id_array[z]) + 1] = false;
1292
- }
1293
- if (document.getElementById(l_id+"_mini_label_city")) {
1294
- l_id_removed[parseInt(l_id_array[z]) + 2] = false;
1295
- }
1296
- if (document.getElementById(l_id+"_mini_label_state")) {
1297
- l_id_removed[parseInt(l_id_array[z]) + 3] = false;
1298
- }
1299
- if (document.getElementById(l_id+"_mini_label_postal")) {
1300
- l_id_removed[parseInt(l_id_array[z]) + 4] = false;
1301
- }
1302
- if (document.getElementById(l_id+"_mini_label_country")) {
1303
- l_id_removed[parseInt(l_id_array[z]) + 5] = false;
1304
- }
1305
- z = z + 5;
1306
- }
1307
- else {
1308
- l_id_removed[l_id] = false;
1309
- }
1310
- }
1311
- }
1312
- if (tr.getAttribute('type')=="type_address") {
1313
- addr_id=parseInt(tr.id);
1314
- id_for_country= addr_id;
1315
- if(document.getElementById(id_for_country+"_mini_label_street1"))
1316
- tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_street1").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
1317
- if(document.getElementById(id_for_country+"_mini_label_street2"))
1318
- tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_street2").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
1319
- if(document.getElementById(id_for_country+"_mini_label_city"))
1320
- tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_city").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1321
- if(document.getElementById(id_for_country+"_mini_label_state"))
1322
- tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_state").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1323
- if(document.getElementById(id_for_country+"_mini_label_postal"))
1324
- tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_postal").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1325
- if(document.getElementById(id_for_country+"_mini_label_country"))
1326
- tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_country").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#';
1327
- }
1328
- else {
1329
- tox = tox+l_id+'#**id**#'+l_label+'#**label**#'+l_type+'#****#';
1330
- }
1331
- }
1332
- }
1333
- }
1334
- }
1335
- }
1336
- }
1337
- }
1338
- document.getElementById('label_order_current').value = tox;
1339
- for (x = 0; x < l_id_array.length; x++) {
1340
- if (l_id_removed[l_id_array[x]]) {
1341
- tox = tox + l_id_array[x] + '#**id**#' + l_label_array[x] + '#**label**#' + l_type_array[x] + '#****#';
1342
- }
1343
- }
1344
- document.getElementById('label_order').value = tox;
1345
- refresh_old();
1346
- document.getElementById('pagination').value=document.getElementById('pages').getAttribute("type");
1347
- document.getElementById('show_title').value=document.getElementById('pages').getAttribute("show_title");
1348
- document.getElementById('show_numbers').value=document.getElementById('pages').getAttribute("show_numbers");
1349
- return true;
1350
- }
1351
-
1352
- gen = <?php echo (($id != 0) ? $row->counter : 1); ?>;
1353
-
1354
- function enable() {
1355
- alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
1356
- for (x = 0; x < 14; x++) {
1357
- document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FM_URL . '/images/'; ?>" + alltypes[x] + ".png";
1358
- }
1359
- if (document.getElementById('formMakerDiv').style.display == 'block') {
1360
- jQuery('#formMakerDiv').slideToggle(200);
1361
- }
1362
- else {
1363
- jQuery('#formMakerDiv').slideToggle(400);
1364
- }
1365
- if (document.getElementById('formMakerDiv').offsetWidth) {
1366
- document.getElementById('formMakerDiv1').style.width = (document.getElementById('formMakerDiv').offsetWidth - 60) + 'px';
1367
- }
1368
- if (document.getElementById('formMakerDiv1').style.display == 'block') {
1369
- jQuery('#formMakerDiv1').slideToggle(200);
1370
- }
1371
- else {
1372
- jQuery('#formMakerDiv1').slideToggle(400);
1373
- }
1374
- document.getElementById('when_edit').style.display = 'none';
1375
- }
1376
-
1377
- function enable2() {
1378
- alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
1379
- for (x = 0; x < 14; x++) {
1380
- document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FM_URL . '/images/'; ?>" + alltypes[x] + ".png";
1381
- }
1382
- if (document.getElementById('formMakerDiv').style.display == 'block') {
1383
- jQuery('#formMakerDiv').slideToggle(200);
1384
- }
1385
- else {
1386
- jQuery('#formMakerDiv').slideToggle(400);
1387
- }
1388
- if (document.getElementById('formMakerDiv').offsetWidth) {
1389
- document.getElementById('formMakerDiv1').style.width = (document.getElementById('formMakerDiv').offsetWidth - 60) + 'px';
1390
- }
1391
- if (document.getElementById('formMakerDiv1').style.display == 'block') {
1392
- jQuery('#formMakerDiv1').slideToggle(200);
1393
- }
1394
- else {
1395
- jQuery('#formMakerDiv1').slideToggle(400);
1396
- }
1397
- document.getElementById('when_edit').style.display = 'block';
1398
- if (document.getElementById('field_types').offsetWidth) {
1399
- document.getElementById('when_edit').style.width = document.getElementById('field_types').offsetWidth + 'px';
1400
- }
1401
- if (document.getElementById('field_types').offsetHeight) {
1402
- document.getElementById('when_edit').style.height = document.getElementById('field_types').offsetHeight + 'px';
1403
- }
1404
- }
1405
- </script>
1406
- <div style="clear: both; float: left; width: 99%;">
1407
- <div style="float:left; font-size: 14px; font-weight: bold;">
1408
- This section allows you to add fields to your form.
1409
- <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-4.html">Read More in User Manual</a>
1410
- </div>
1411
- <div style="float: right; text-align: right;">
1412
- <a style="text-decoration: none;" target="_blank" href="https://web-dorado.com/files/fromFormMaker.php">
1413
- <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
1414
- </a>
1415
- </div>
1416
- </div>
1417
- <form class="wrap" id="manage_form" method="post" action="admin.php?page=manage_fm" style="float: left; width: 99%;">
1418
- <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
1419
- <h2><?php echo $page_title; ?></h2>
1420
- <div style="float: right; margin: 0 5px 0 0;">
1421
- <a href="<?php echo add_query_arg(array('action' => 'FormMakerPreview', 'id' => $row->theme, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" class="button-primary thickbox thickbox-preview" id="preview_form" title="Form Preview" onclick="return false;">
1422
- Preview
1423
- </a>
1424
- <input class="button-primary" type="submit" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'form_options_old');" value="Form options"/>
1425
- <?php
1426
- if ($id) {
1427
- ?>
1428
- <input class="button-secondary" type="submit" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'save_as_copy_old')" value="Save as Copy"/>
1429
- <?php
1430
- }
1431
- ?>
1432
- <input class="button-secondary" type="submit" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'save_old')" value="Save"/>
1433
- <input class="button-secondary" type="submit" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'apply_old')" value="Apply"/>
1434
- <input class="button-secondary" type="submit" onclick="fm_set_input_value('task', 'cancel')" value="Cancel"/>
1435
- </div>
1436
-
1437
- <div class="formmaker_table" width="100%">
1438
- <div style="float: left; text-align: center;"><br />
1439
- <img src="<?php echo WD_FM_URL . '/images/FormMaker.png'; ?>" /><br /><br />
1440
- <img src="<?php echo WD_FM_URL . '/images/logo.png'; ?>" />
1441
- </div>
1442
- <div style="float:right">
1443
- <span style="font-size: 16.76pt; font-family: tahoma; color: #FFFFFF; vertical-align: middle;">Form title:&nbsp;&nbsp;</span>
1444
- <input id="title" name="title" class="form_maker_title" value="<?php echo $row->title; ?>"/>
1445
- <br />
1446
- <img src="<?php echo WD_FM_URL . '/images/formoptions.png'; ?>" onclick="if (fm_check_required('title', 'Form title')) {return false;}; submitbutton(); fm_set_input_value('task', 'form_options_old'); fm_form_submit(event, 'manage_form');" style="cursor: pointer; margin: 10px 0 10px 10px; float: right;"/>
1447
- <br /><br /><br />
1448
- <img src="<?php echo WD_FM_URL . '/images/addanewfield.png'; ?>" onclick="enable(); Enable();" style="cursor: pointer; margin:10px 0 10px 10px; float: right;"/>
1449
- </div>
1450
- </div>
1451
-
1452
- <div id="formMakerDiv" onclick="close_window()"></div>
1453
- <div id="formMakerDiv1" style="padding-top: 20px;" align="center">
1454
- <table border="0" width="100%" cellpadding="0" cellspacing="0" height="100%" style="border: 6px #00aeef solid; background-color: #FFF;">
1455
- <tr>
1456
- <td style="padding:0px">
1457
- <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
1458
- <tr valign="top">
1459
- <td width="15%" height="100%" style="border-right: dotted black 1px;" id="field_types">
1460
- <div id="when_edit" style="display: none;"></div>
1461
- <table border="0" cellpadding="0" cellspacing="3" width="100%">
1462
- <tr>
1463
- <td align="center" onClick="addRow('customHTML')" style="cursor:pointer" id="table_editor" class="field_buttons">
1464
- <img src="<?php echo WD_FM_URL . '/images/customHTML.png'; ?>" style="margin:5px" id="img_customHTML"/>
1465
- </td>
1466
- <td align="center" onClick="addRow('text')" style="cursor:pointer" id="table_text" class="field_buttons">
1467
- <img src="<?php echo WD_FM_URL . '/images/text.png'; ?>" style="margin:5px" id="img_text"/>
1468
- </td>
1469
- </tr>
1470
- <tr>
1471
- <td align="center" onClick="addRow('time_and_date')" style="cursor:pointer" id="table_time_and_date" class="field_buttons">
1472
- <img src="<?php echo WD_FM_URL . '/images/time_and_date.png'; ?>" style="margin:5px" id="img_time_and_date"/>
1473
- </td>
1474
- <td align="center" onClick="addRow('select')" style="cursor:pointer" id="table_select" class="field_buttons">
1475
- <img src="<?php echo WD_FM_URL . '/images/select.png'; ?>" style="margin:5px" id="img_select"/>
1476
- </td>
1477
- </tr>
1478
- <tr>
1479
- <td align="center" onClick="addRow('checkbox')" style="cursor:pointer" id="table_checkbox" class="field_buttons">
1480
- <img src="<?php echo WD_FM_URL . '/images/checkbox.png'; ?>" style="margin:5px" id="img_checkbox"/>
1481
- </td>
1482
- <td align="center" onClick="addRow('radio')" style="cursor:pointer" id="table_radio" class="field_buttons">
1483
- <img src="<?php echo WD_FM_URL . '/images/radio.png'; ?>" style="margin:5px" id="img_radio"/>
1484
- </td>
1485
- </tr>
1486
- <tr>
1487
- <td align="center" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_file_upload" class="field_buttons"
1488
- onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')">
1489
- <img src="<?php echo WD_FM_URL . '/images/file_upload.png'; ?>" style="margin:5px" id="img_file_upload" />
1490
- </td>
1491
- <td align="center" onClick="addRow('captcha')" style="cursor:pointer" id="table_captcha" class="field_buttons">
1492
- <img src="<?php echo WD_FM_URL . '/images/captcha.png'; ?>" style="margin:5px" id="img_captcha"/>
1493
- </td>
1494
- </tr>
1495
- <tr>
1496
- <td align="center" onClick="addRow('page_break')" style="cursor:pointer" id="table_page_break" class="field_buttons">
1497
- <img src="<?php echo WD_FM_URL . '/images/page_break.png'; ?>" style="margin:5px" id="img_page_break"/>
1498
- </td>
1499
- <td align="center" onClick="addRow('section_break')" style="cursor:pointer" id="table_section_break" class="field_buttons">
1500
- <img src="<?php echo WD_FM_URL . '/images/section_break.png'; ?>" style="margin:5px" id="img_section_break"/>
1501
- </td>
1502
- </tr>
1503
- <tr>
1504
- <td align="center" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_map" class="field_buttons"
1505
- onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')">
1506
- <img src="<?php echo WD_FM_URL . '/images/map.png'; ?>" style="margin:5px" id="img_map" />
1507
- </td>
1508
- <td align="center" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_paypal" class="field_buttons"
1509
- onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')">
1510
- <img src="<?php echo WD_FM_URL . '/images/paypal.png'; ?>" style="margin:5px" id="img_paypal" />
1511
- </td>
1512
- </tr>
1513
- <tr>
1514
- <td align="center" onClick="addRow('survey')" class="field_buttons" id="table_survey">
1515
- <img src="<?php echo WD_FM_URL . '/images/survey.png'; ?>" style="margin:5px" id="img_survey"/>
1516
- </td>
1517
- <td align="center" onClick="addRow('button')" id="table_button" class="field_buttons">
1518
- <img src="<?php echo WD_FM_URL . '/images/button.png'; ?>" style="margin:5px" id="img_button"/>
1519
- </td>
1520
- </tr>
1521
- </table>
1522
- </td>
1523
- <td width="35%" height="100%" align="left">
1524
- <div id="edit_table" style="padding:0px; overflow-y:scroll; height:575px"></div>
1525
- </td>
1526
- <td align="center" valign="top" style="background: url("<?php echo WD_FM_URL . '/images/border2.png'; ?>") repeat-y;">&nbsp;</td>
1527
- <td style="padding:15px">
1528
- <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
1529
- <tr>
1530
- <td align="right">
1531
- <input type="radio" value="end" name="el_pos" checked="checked" id="pos_end" onclick="Disable()"/>
1532
- At The End
1533
- <input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
1534
- At The Beginning
1535
- <input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
1536
- Before
1537
- <select style="width: 100px; margin-left: 5px;" id="sel_el_pos" disabled="disabled"></select>
1538
- <img alt="ADD" title="add" style="cursor:pointer; vertical-align:middle; margin:5px" src="<?php echo WD_FM_URL . '/images/save.png'; ?>" onClick="add(0, false)"/>
1539
- <img alt="CANCEL" title="cancel" style="cursor: pointer; vertical-align:middle; margin:5px" src="<?php echo WD_FM_URL . '/images/cancel_but.png'; ?>" onClick="close_window()"/>
1540
- <hr style=" margin-bottom:10px" />
1541
- </td>
1542
- </tr>
1543
- <tr height="100%" valign="top">
1544
- <td id="show_table"></td>
1545
- </tr>
1546
- </table>
1547
- </td>
1548
- </tr>
1549
- </table>
1550
- </td>
1551
- </tr>
1552
- </table>
1553
- <input type="hidden" id="old" />
1554
- <input type="hidden" id="old_selected" />
1555
- <input type="hidden" id="element_type" />
1556
- <input type="hidden" id="editing_id" />
1557
- <input type="hidden" value="<?php echo WD_FM_URL; ?>" id="form_plugins_url" />
1558
- <div id="main_editor" style="position: absolute; display: none; z-index: 140;">
1559
- <?php
1560
- if (user_can_richedit()) {
1561
- wp_editor('', 'form_maker_editor', array('teeny' => FALSE, 'textarea_name' => 'form_maker_editor', 'media_buttons' => FALSE, 'textarea_rows' => 5));
1562
- }
1563
- else {
1564
- ?>
1565
- <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>
1566
- <?php
1567
- }
1568
- ?>
1569
- </div>
1570
- </div>
1571
- <?php
1572
- if (!function_exists('the_editor')) {
1573
- ?>
1574
- <iframe id="tinymce" style="display: none;"></iframe>
1575
- <?php
1576
- }
1577
- ?>
1578
- <br />
1579
- <br />
1580
- <fieldset>
1581
- <legend><h2 style="color: #00aeef;">Form</h2></legend>
1582
- <table width="100%" style="margin:8px">
1583
- <tr id="page_navigation">
1584
- <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>
1585
- <td align="left" id="edit_page_navigation"></td>
1586
- </tr>
1587
- </table>
1588
- <div id="take">
1589
- <?php
1590
- if ($row->form) {
1591
- echo $row->form;
1592
- }
1593
- else {
1594
- ?>
1595
- <table border="0" cellpadding="4" cellspacing="0" class="wdform_table1" style="width: 100%;">
1596
- <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">
1597
- <tr class="wdform_tr1">
1598
- <td class="wdform_td1" >
1599
- <table class="wdform_table2">
1600
- <tbody class="wdform_tbody2"></tbody>
1601
- </table>
1602
- </td>
1603
- </tr>
1604
- <tr class="wdform_footer">
1605
- <td colspan="100" valign="top">
1606
- <table width="100%" style="padding-right:170px"><tbody><tr id="form_id_temppage_nav1"></tr></tbody></table>
1607
- </td>
1608
- </tr>
1609
- <tbody id="form_id_tempform_view_img1" style="float: right !important;" >
1610
- <tr>
1611
- <td width="0%"></td>
1612
- <td align="right">
1613
- <img src="<?php echo WD_FM_URL . '/images/minus.png'; ?>" title="Show or hide the page" class="page_toolbar" onclick="show_or_hide('1')" onmouseover="chnage_icons_src(this,'minus')" onmouseout="chnage_icons_src(this,'minus')" id="show_page_img_1" />
1614
- </td>
1615
- <td>
1616
- <img src="<?php echo WD_FM_URL . '/images/page_delete.png'; ?>" title="Delete the page" class="page_toolbar" onclick="remove_page('1')" onmouseover="chnage_icons_src(this,'page_delete')" onmouseout="chnage_icons_src(this,'page_delete')" />
1617
- </td>
1618
- <td>
1619
- <img src="<?php echo WD_FM_URL . '/images/page_delete_all.png'; ?>" title="Delete the page with fields" class="page_toolbar" onclick="remove_page_all('1')" onmouseover="chnage_icons_src(this,'page_delete_all')" onmouseout="chnage_icons_src(this,'page_delete_all')" />
1620
- </td>
1621
- <td>
1622
- <img src="<?php echo WD_FM_URL . '/images/page_edit.png'; ?>" title="Edit the page" class="page_toolbar" onclick="edit_page_break('1')" onmouseover="chnage_icons_src(this,'page_edit')" onmouseout="chnage_icons_src(this,'page_edit')" />
1623
- </td>
1624
- </tr>
1625
- </tbody>
1626
- </table>
1627
- <?php
1628
- }
1629
- ?>
1630
- </div>
1631
- </fieldset>
1632
- <input type="hidden" name="form" id="form" />
1633
- <input type="hidden" name="form_front" id="form_front" />
1634
- <input type="hidden" name="pagination" id="pagination" />
1635
- <input type="hidden" name="show_title" id="show_title" />
1636
- <input type="hidden" name="show_numbers" id="show_numbers" />
1637
- <input type="hidden" name="public_key" id="public_key" />
1638
- <input type="hidden" name="private_key" id="private_key" />
1639
- <input type="hidden" name="recaptcha_theme" id="recaptcha_theme" />
1640
- <input type="hidden" id="label_order" name="label_order" value="<?php echo $row->label_order; ?>" />
1641
- <input type="hidden" id="label_order_current" name="label_order_current" value="<?php echo $row->label_order_current; ?>" />
1642
- <input type="hidden" name="counter" id="counter" value="<?php echo $row->counter; ?>" />
1643
- <input type="hidden" id="araqel" value="0" />
1644
- <script type="text/javascript">
1645
- form_view = 1;
1646
- form_view_count = 1;
1647
- form_view_max = 1;
1648
- function formOnload() {
1649
- // Enable maps.
1650
- for (t = 0; t < <?php echo $row->counter;?>; t++)
1651
- if (document.getElementById(t+"_typeform_id_temp")) {
1652
- if (document.getElementById(t+"_typeform_id_temp").value=="type_map" || document.getElementById(t+"_typeform_id_temp").value=="type_mark_map") {
1653
- if_gmap_init(t);
1654
- for (q = 0; q < 20; q++) {
1655
- if (document.getElementById(t+"_elementform_id_temp").getAttribute("long"+q)) {
1656
- w_long=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("long"+q));
1657
- w_lat=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("lat"+q));
1658
- w_info=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("info"+q));
1659
- add_marker_on_map(t,q, w_long, w_lat, w_info, false);
1660
- }
1661
- }
1662
- }
1663
- else
1664
- if (document.getElementById(t+"_typeform_id_temp").value == "type_date") {
1665
- // Calendar.setup({
1666
- // inputField: t+"_elementform_id_temp",
1667
- // ifFormat: document.getElementById(t+"_buttonform_id_temp").getAttribute('format'),
1668
- // button: t+"_buttonform_id_temp",
1669
- // align: "Tl",
1670
- // singleClick: true,
1671
- // firstDay: 0
1672
- // });
1673
- }
1674
- else
1675
- if(document.getElementById(t+"_typeform_id_temp").value=="type_spinner") {
1676
- var spinner_value = jQuery("#" + t + "_elementform_id_temp").get( "aria-valuenow" );
1677
- var spinner_min_value = document.getElementById(t+"_min_valueform_id_temp").value;
1678
- var spinner_max_value = document.getElementById(t+"_max_valueform_id_temp").value;
1679
- var spinner_step = document.getElementById(t+"_stepform_id_temp").value;
1680
-
1681
- jQuery( "#"+t+"_elementform_id_temp" ).removeClass( "ui-spinner-input" )
1682
- .prop( "disabled", false )
1683
- .removeAttr( "autocomplete" )
1684
- .removeAttr( "role" )
1685
- .removeAttr( "aria-valuemin" )
1686
- .removeAttr( "aria-valuemax" )
1687
- .removeAttr( "aria-valuenow" );
1688
-
1689
- span_ui= document.getElementById(t+"_elementform_id_temp").parentNode;
1690
- span_ui.parentNode.appendChild(document.getElementById(t+"_elementform_id_temp"));
1691
- span_ui.parentNode.removeChild(span_ui);
1692
-
1693
- jQuery("#"+t+"_elementform_id_temp")[0].spin = null;
1694
-
1695
- spinner = jQuery( "#"+t+"_elementform_id_temp" ).spinner();
1696
- spinner.spinner( "value", spinner_value );
1697
- jQuery( "#"+t+"_elementform_id_temp" ).spinner({ min: spinner_min_value});
1698
- jQuery( "#"+t+"_elementform_id_temp" ).spinner({ max: spinner_max_value});
1699
- jQuery( "#"+t+"_elementform_id_temp" ).spinner({ step: spinner_step});
1700
-
1701
- }
1702
- else
1703
- if(document.getElementById(t+"_typeform_id_temp").value=="type_slider") {
1704
-
1705
- var slider_value = document.getElementById(t+"_slider_valueform_id_temp").value;
1706
- var slider_min_value = document.getElementById(t+"_slider_min_valueform_id_temp").value;
1707
- var slider_max_value = document.getElementById(t+"_slider_max_valueform_id_temp").value;
1708
-
1709
- var slider_element_value = document.getElementById( t+"_element_valueform_id_temp" );
1710
- var slider_value_save = document.getElementById( t+"_slider_valueform_id_temp" );
1711
-
1712
- document.getElementById(t+"_elementform_id_temp").innerHTML = "";
1713
- document.getElementById(t+"_elementform_id_temp").removeAttribute( "class" );
1714
- document.getElementById(t+"_elementform_id_temp").removeAttribute( "aria-disabled" );
1715
-
1716
- jQuery("#"+t+"_elementform_id_temp")[0].slide = null;
1717
-
1718
- jQuery(function() {
1719
- jQuery( "#"+t+"_elementform_id_temp").slider({
1720
- range: "min",
1721
- value: eval(slider_value),
1722
- min: eval(slider_min_value),
1723
- max: eval(slider_max_value),
1724
- slide: function( event, ui ) {
1725
- slider_element_value.innerHTML = "" + ui.value ;
1726
- slider_value_save.value = "" + ui.value;
1727
 
1728
  }
1729
  });
@@ -2195,462 +2224,71 @@ class FMViewManage_fm {
2195
  var id_for_blur = document.getElementById('best').parentNode.id.split('_');
2196
  var value = jQuery(this).val();
2197
 
2198
- jQuery("#"+id_for_blur[0]+"_mini_label_best").text(value);
2199
- });
2200
-
2201
- }
2202
- });
2203
-
2204
-
2205
-
2206
- });
2207
- }
2208
- }
2209
- form_view = 1;
2210
- form_view_count = 0;
2211
- for (i = 1; i <= 30; i++) {
2212
- if (document.getElementById('form_id_tempform_view'+i)) {
2213
- form_view_count++;
2214
- form_view_max=i;
2215
- }
2216
- }
2217
- if (form_view_count > 1) {
2218
- for (i=1; i<=form_view_max; i++) {
2219
- if (document.getElementById('form_id_tempform_view'+i)) {
2220
- first_form_view=i;
2221
- break;
2222
- }
2223
- }
2224
- form_view=form_view_max;
2225
- generate_page_nav(first_form_view);
2226
- var img_EDIT = document.createElement("img");
2227
- img_EDIT.setAttribute("src", "<?php echo WD_FM_URL . '/images/edit.png'; ?>");
2228
- img_EDIT.style.cssText = "margin-left:40px; cursor:pointer";
2229
- img_EDIT.setAttribute("onclick", 'el_page_navigation()');
2230
- var td_EDIT = document.getElementById("edit_page_navigation");
2231
- td_EDIT.appendChild(img_EDIT);
2232
- document.getElementById('page_navigation').appendChild(td_EDIT);
2233
- }
2234
- //if(document.getElementById('take').innerHTML.indexOf('up_row(')==-1) location.reload(true);
2235
- //else
2236
-
2237
- document.getElementById('form').value=document.getElementById('take').innerHTML;
2238
- document.getElementById('araqel').value = 1;
2239
- }
2240
- jQuery(window).load(function () {
2241
- formOnload();
2242
- });
2243
- </script>
2244
-
2245
- <input type="hidden" name="option" value="com_formmaker" />
2246
- <input type="hidden" name="id" value="<?php echo $row->id; ?>" />
2247
- <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
2248
-
2249
- <input type="hidden" id="task" name="task" value=""/>
2250
- <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
2251
- </form>
2252
- <script>
2253
- jQuery(window).load(function() {
2254
- fm_popup();
2255
- });
2256
- </script>
2257
- <?php
2258
- }
2259
-
2260
- public function form_options_old($id) {
2261
- $row = $this->model->get_row_data($id);
2262
- $themes = $this->model->get_theme_rows_data('_old');
2263
- $page_title = $row->title . ' form options';
2264
- $label_id = array();
2265
- $label_label = array();
2266
- $label_type = array();
2267
- $label_all = explode('#****#', $row->label_order_current);
2268
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
2269
- foreach ($label_all as $key => $label_each) {
2270
- $label_id_each = explode('#**id**#', $label_each);
2271
- array_push($label_id, $label_id_each[0]);
2272
- $label_order_each = explode('#**label**#', $label_id_each[1]);
2273
- array_push($label_label, $label_order_each[0]);
2274
- array_push($label_type, $label_order_each[1]);
2275
- }
2276
- ?>
2277
- <script>
2278
- gen = "<?php echo $row->counter; ?>";
2279
- form_view_max = 20;
2280
- function set_preview() {
2281
- document.getElementById('preview_form').href = '<?php echo add_query_arg(array('action' => 'FormMakerPreview', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&id='+document.getElementById('theme').value+'&width=1000&height=500&TB_iframe=1';
2282
- }
2283
- </script>
2284
- <div style="clear: both; float: left; width: 99%;">
2285
- <div style="float:left; font-size: 14px; font-weight: bold;">
2286
- This section allows you to edit form options.
2287
- <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-3.html">Read More in User Manual</a>
2288
- </div>
2289
- <div style="float: right; text-align: right;">
2290
- <a style="text-decoration: none;" target="_blank" href="https://web-dorado.com/files/fromFormMaker.php">
2291
- <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
2292
- </a>
2293
- </div>
2294
- </div>
2295
- <form class="wrap" method="post" action="admin.php?page=manage_fm" style="float: left; width: 99%;" name="adminForm" id="adminForm">
2296
- <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
2297
- <h2><?php echo $page_title; ?></h2>
2298
- <div style="float: right; margin: 0 5px 0 0;">
2299
- <input class="button-secondary" type="submit" onclick="if (fm_check_email('mail') ||
2300
- fm_check_email('from_mail') ||
2301
- fm_check_email('paypal_email')) {return false;}; fm_set_input_value('task', 'save_options_old')" value="Save"/>
2302
- <input class="button-secondary" type="submit" onclick="if (fm_check_email('mail') ||
2303
- fm_check_email('from_mail') ||
2304
- fm_check_email('paypal_email')) {return false;}; fm_set_input_value('task', 'apply_options_old')" value="Apply"/>
2305
- <input class="button-secondary" type="submit" onclick="fm_set_input_value('task', 'cancel_options_old')" value="Cancel"/>
2306
- </div>
2307
- <input type="hidden" name="take" id="take" value="<?php $row->form ?>">
2308
- <div class="submenu-box" style="width: 99%; float: left; margin: 15px 0 0 0;">
2309
- <div class="submenu-pad">
2310
- <ul id="submenu" class="configuration">
2311
- <li>
2312
- <a id="general" class="fm_fieldset_tab" onclick="form_maker_options_tabs('general')" href="#">General Options</a>
2313
- </li>
2314
- <li>
2315
- <a id="actions" class="fm_fieldset_tab" onclick="form_maker_options_tabs('actions')" href="#">Actions after Submission</a>
2316
- </li>
2317
- <li>
2318
- <a id="payment" class="fm_fieldset_tab" onclick="form_maker_options_tabs('payment')" href="#">Payment Options</a>
2319
- </li>
2320
- <li>
2321
- <a id="javascript" class="fm_fieldset_tab" onclick="form_maker_options_tabs('javascript')" href="#">JavaScript</a>
2322
- </li>
2323
- <li>
2324
- <a id="custom" class="fm_fieldset_tab" onclick="form_maker_options_tabs('custom')" href="#">Custom Text in Email</a>
2325
- </li>
2326
- </ul>
2327
- </div>
2328
- </div>
2329
- <fieldset id="actions_fieldset" class="adminform fm_fieldset_deactive">
2330
- <legend style="color:#0B55C4;font-weight: bold;">Actions after submission</legend>
2331
- <table class="admintable">
2332
- <tr valign="top">
2333
- <td class="fm_options_label">
2334
- <label>Action type</label>
2335
- </td>
2336
- <td class="fm_options_value">
2337
- <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>
2338
- <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>
2339
- <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>
2340
- <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>
2341
- <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>
2342
- </td>
2343
- </tr>
2344
- <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"' : ''); ?>>
2345
- <td class="fm_options_label">
2346
- <label>Stay on Form</label>
2347
- </td>
2348
- <td class="fm_options_value">
2349
- <img src="<?php echo WD_FM_URL . '/images/tick.png'; ?>" border="0">
2350
- </td>
2351
- </tr>
2352
- <tr id="post" <?php echo (($row->submit_text_type != 2) ? 'style="display:none"' : ''); ?>>
2353
- <td class="fm_options_label">
2354
- <label for="post_name">Post</label>
2355
- </td>
2356
- <td class="fm_options_value">
2357
- <select id="post_name" name="post_name" style="width: 153px; font-size: 11px;">
2358
- <option value="0">- Select Post -</option>
2359
- <?php
2360
- // The Query.
2361
- $args = array('posts_per_page' => 10000);
2362
- query_posts($args);
2363
- // The Loop.
2364
- while (have_posts()) : the_post(); ?>
2365
- <option value="<?php $x = get_permalink(get_the_ID()); echo $x; ?>" <?php echo (($row->article_id == $x) ? 'selected="selected"' : ''); ?>><?php the_title(); ?></option>
2366
- <?php
2367
- endwhile;
2368
- // Reset Query.
2369
- wp_reset_query();
2370
- ?>
2371
- </select>
2372
- </td>
2373
- </tr>
2374
- <tr id="page" <?php echo (($row->submit_text_type != 5) ? 'style="display:none"' : ''); ?>>
2375
- <td class="fm_options_label">
2376
- <label for="page_name">Page</label>
2377
- </td>
2378
- <td class="fm_options_value">
2379
- <select id="page_name" name="page_name" style="width:153px; font-size:11px;">
2380
- <option value="0">- Select Page -</option>
2381
- <?php
2382
- // The Query.
2383
- $pages = get_pages();
2384
- // The Loop.
2385
- foreach ($pages as $page) {
2386
- $page_id = get_page_link($page->ID);
2387
- ?>
2388
- <option value="<?php echo $page_id; ?>" <?php echo (($row->article_id == $page_id) ? 'selected="selected"' : ''); ?>><?php echo $page->post_title; ?></option>
2389
- <?php
2390
- }
2391
- // Reset Query.
2392
- wp_reset_query();
2393
- ?>
2394
- </select>
2395
- </td>
2396
- </tr>
2397
- <tr id="custom_text" <?php echo (($row->submit_text_type != 3) ? 'style="display: none;"' : ''); ?>>
2398
- <td class="fm_options_label">
2399
- <label for="submit_text">Text</label>
2400
- </td>
2401
- <td class="fm_options_value">
2402
- <?php
2403
- if (user_can_richedit()) {
2404
- wp_editor($row->submit_text, 'submit_text', array('teeny' => FALSE, 'textarea_name' => 'submit_text', 'media_buttons' => FALSE, 'textarea_rows' => 5));
2405
- }
2406
- else {
2407
- ?>
2408
- <textarea cols="36" rows="5" id="submit_text" name="submit_text" style="resize: vertical;">
2409
- <?php echo $row->submit_text; ?>
2410
- </textarea>
2411
- <?php
2412
- }
2413
- ?>
2414
- </td>
2415
- </tr>
2416
- <tr id="url" <?php echo (($row->submit_text_type != 4 ) ? 'style="display:none"' : ''); ?>>
2417
- <td class="fm_options_label">
2418
- <label for="url">URL</label>
2419
- </td>
2420
- <td class="fm_options_value">
2421
- <input type="text" id="url" name="url" style="width:300px" value="<?php echo $row->url; ?>" />
2422
- </td>
2423
- </tr>
2424
- </table>
2425
- </fieldset>
2426
- <fieldset id="custom_fieldset" class="adminform fm_fieldset_deactive">
2427
- <legend style="color:#0B55C4;font-weight: bold;">Custom text in email</legend>
2428
- <table class="admintable">
2429
- <tr>
2430
- <td class="fm_options_label" valign="top">
2431
- <label>For Administrator</label>
2432
- </td>
2433
- <td class="fm_options_value">
2434
- <div style="margin-bottom:5px">
2435
- <?php
2436
- $choise = "document.getElementById('script_mail')";
2437
- for ($i = 0; $i < count($label_label); $i++) {
2438
- 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") {
2439
- continue;
2440
- }
2441
- $param = htmlspecialchars(addslashes($label_label[$i]));
2442
- ?>
2443
- <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; ?>')" />
2444
- <?php
2445
- }
2446
- ?>
2447
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="All fields list" onClick="insertAtCursor(<?php echo $choise; ?>, 'all')" />
2448
- </div>
2449
- <?php
2450
- if (user_can_richedit()) {
2451
- wp_editor($row->script_mail, 'script_mail', array('teeny' => FALSE, 'textarea_name' => 'script_mail', 'media_buttons' => FALSE, 'textarea_rows' => 5));
2452
- }
2453
- else {
2454
- ?>
2455
- <textarea name="script_mail" id="script_mail" cols="20" rows="10" style="width:300px; height:450px;"><?php echo $row->script_mail; ?></textarea>
2456
- <?php
2457
- }
2458
- ?>
2459
- </td>
2460
- </tr>
2461
- <tr>
2462
- <td valign="top" height="30"></td>
2463
- <td valign="top"></td>
2464
- </tr>
2465
- <tr>
2466
- <td class="fm_options_label" valign="top">
2467
- <label>For User</label>
2468
- </td>
2469
- <td class="fm_options_value">
2470
- <div style="margin-bottom:5px">
2471
- <?php
2472
- $choise = "document.getElementById('script_mail_user')";
2473
- for ($i = 0; $i < count($label_label); $i++) {
2474
- 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") {
2475
- continue;
2476
- }
2477
- $param = htmlspecialchars(addslashes($label_label[$i]));
2478
- ?>
2479
- <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; ?>')" />
2480
- <?php
2481
- }
2482
- ?>
2483
- <input style="border: 1px solid silver; font-size: 10px; margin:3px;" type="button" value="All fields list" onClick="insertAtCursor(<?php echo $choise; ?>, 'all')" />
2484
- </div>
2485
- <?php
2486
- if (user_can_richedit()) {
2487
- wp_editor($row->script_mail_user, 'script_mail_user', array('teeny' => FALSE, 'textarea_name' => 'script_mail_user', 'media_buttons' => FALSE, 'textarea_rows' => 5));
2488
- }
2489
- else {
2490
- ?>
2491
- <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>
2492
- <?php
2493
  }
2494
- ?>
2495
- </td>
2496
- </tr>
2497
- </table>
2498
- </fieldset>
2499
- <fieldset id="general_fieldset" class="adminform fm_fieldset_deactive">
2500
- <legend style="color:#0B55C4;font-weight: bold;">General Options</legend>
2501
- <table class="admintable" style="float:left">
2502
- <tr valign="top">
2503
- <td class="fm_options_label">
2504
- <label for="mail">Email to send submissions to</label>
2505
- </td>
2506
- <td class="fm_options_value">
2507
- <input id="mail" name="mail" value="<?php echo $row->mail; ?>" style="width:250px;" />
2508
- </td>
2509
- </tr>
2510
- <tr valign="top">
2511
- <td class="fm_options_label">
2512
- <label for="from_mail">From Email</label>
2513
- </td>
2514
- <td class="fm_options_value">
2515
- <input id="from_mail" name="from_mail" value="<?php echo $row->from_mail; ?>" style="width:250px;" />
2516
- </td>
2517
- </tr>
2518
- <tr valign="top">
2519
- <td class="fm_options_label">
2520
- <label for="from_name">From Name</label>
2521
- </td>
2522
- <td class="fm_options_value">
2523
- <input id="from_name" name="from_name" value="<?php echo $row->from_name; ?>" style="width:250px;"/>
2524
- </td>
2525
- </tr>
2526
- <tr valign="top">
2527
- <td class="fm_options_label">
2528
- <label for="theme">Theme</label>
2529
- </td>
2530
- <td class="fm_options_value">
2531
- <select id="theme" name="theme" style="width:260px;" onChange="set_preview()">
2532
- <?php
2533
- foreach ($themes as $theme) {
2534
- ?>
2535
- <option value="<?php echo $theme->id; ?>" <?php echo (($theme->id == $row->theme) ? 'selected' : ''); ?>><?php echo $theme->title; ?></option>
2536
- <?php
2537
- }
2538
- ?>
2539
- </select>
2540
- <a href="<?php echo add_query_arg(array('action' => 'FormMakerPreview', 'id' => $row->theme, 'form_id' => $row->id, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" class="button-primary thickbox thickbox-preview" id="preview_form" title="Form Preview" onclick="return false;">
2541
- Preview
2542
- </a>
2543
- </td>
2544
- </tr>
2545
- </table>
2546
- </fieldset>
2547
- <fieldset id="payment_fieldset" class="adminform fm_fieldset_deactive">
2548
- <legend style="color:#0B55C4;font-weight: bold;">Payment Options</legend>
2549
- <table class="admintable">
2550
- <tr>
2551
- <td colspan="2">
2552
- <div class="error_fm" style="padding: 5px; font-size: 14px;">Paypal Options are disabled in free version.</div>
2553
- </td>
2554
- </tr>
2555
- <tr valign="top">
2556
- <td class="fm_options_label">
2557
- <label>Turn Paypal On</label>
2558
- </td>
2559
- <td class="fm_options_value">
2560
- <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>
2561
- <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>
2562
- </td>
2563
- </tr>
2564
- <tr valign="top">
2565
- <td class="fm_options_label">
2566
- <label>Checkout Mode</label>
2567
- </td>
2568
- <td class="fm_options_value">
2569
- <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>
2570
- <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>
2571
- </td>
2572
- </tr>
2573
- <tr valign="top">
2574
- <td class="fm_options_label">
2575
- <label for="paypal_email">Paypal email</label>
2576
- </td>
2577
- <td class="fm_options_value">
2578
- <input disabled="disabled" type="text" name="paypal_email" id="paypal_email" value="<?php echo $row->paypal_email; ?>" class="text_area" style="width:250px">
2579
- </td>
2580
- </tr>
2581
- <tr valign="top">
2582
- <td class="fm_options_label">
2583
- <label for="payment_currency">Payment Currency</label>
2584
- </td>
2585
- <td class="fm_options_value">
2586
- <select disabled="disabled" id="payment_currency" name="payment_currency" style="width:253px">
2587
- <option value="USD" <?php echo (($row->payment_currency == 'USD') ? 'selected' : ''); ?>>$ &#8226; U.S. Dollar</option>
2588
- <option value="EUR" <?php echo (($row->payment_currency == 'EUR') ? 'selected' : ''); ?>>&#8364; &#8226; Euro</option>
2589
- <option value="GBP" <?php echo (($row->payment_currency == 'GBP') ? 'selected' : ''); ?>>&#163; &#8226; Pound Sterling</option>
2590
- <option value="JPY" <?php echo (($row->payment_currency == 'JPY') ? 'selected' : ''); ?>>&#165; &#8226; Japanese Yen</option>
2591
- <option value="CAD" <?php echo (($row->payment_currency == 'CAD') ? 'selected' : ''); ?>>C$ &#8226; Canadian Dollar</option>
2592
- <option value="MXN" <?php echo (($row->payment_currency == 'MXN') ? 'selected' : ''); ?>>Mex$ &#8226; Mexican Peso</option>
2593
- <option value="HKD" <?php echo (($row->payment_currency == 'HKD') ? 'selected' : ''); ?>>HK$ &#8226; Hong Kong Dollar</option>
2594
- <option value="HUF" <?php echo (($row->payment_currency == 'HUF') ? 'selected' : ''); ?>>Ft &#8226; Hungarian Forint</option>
2595
- <option value="NOK" <?php echo (($row->payment_currency == 'NOK') ? 'selected' : ''); ?>>kr &#8226; Norwegian Kroner</option>
2596
- <option value="NZD" <?php echo (($row->payment_currency == 'NZD') ? 'selected' : ''); ?>>NZ$ &#8226; New Zealand Dollar</option>
2597
- <option value="SGD" <?php echo (($row->payment_currency == 'SGD') ? 'selected' : ''); ?>>S$ &#8226; Singapore Dollar</option>
2598
- <option value="SEK" <?php echo (($row->payment_currency == 'SEK') ? 'selected' : ''); ?>>kr &#8226; Swedish Kronor</option>
2599
- <option value="PLN" <?php echo (($row->payment_currency == 'PLN') ? 'selected' : ''); ?>>zl &#8226; Polish Zloty</option>
2600
- <option value="AUD" <?php echo (($row->payment_currency == 'AUD') ? 'selected' : ''); ?>>A$ &#8226; Australian Dollar</option>
2601
- <option value="DKK" <?php echo (($row->payment_currency == 'DKK') ? 'selected' : ''); ?>>kr &#8226; Danish Kroner</option>
2602
- <option value="CHF" <?php echo (($row->payment_currency == 'CHF') ? 'selected' : ''); ?>>CHF &#8226; Swiss Francs</option>
2603
- <option value="CZK" <?php echo (($row->payment_currency == 'CZK') ? 'selected' : ''); ?>>Kc &#8226; Czech Koruny</option>
2604
- <option value="ILS" <?php echo (($row->payment_currency == 'ILS') ? 'selected' : ''); ?>>&#8362; &#8226; Israeli Sheqel</option>
2605
- <option value="BRL" <?php echo (($row->payment_currency == 'BRL') ? 'selected' : ''); ?>>R$ &#8226; Brazilian Real</option>
2606
- <option value="TWD" <?php echo (($row->payment_currency == 'TWD') ? 'selected' : ''); ?>>NT$ &#8226; Taiwan New Dollars</option>
2607
- <option value="MYR" <?php echo (($row->payment_currency == 'MYR') ? 'selected' : ''); ?>>RM &#8226; Malaysian Ringgit</option>
2608
- <option value="PHP" <?php echo (($row->payment_currency == 'PHP') ? 'selected' : ''); ?>>&#8369; &#8226; Philippine Peso</option>
2609
- <option value="THB" <?php echo (($row->payment_currency == 'THB') ? 'selected' : ''); ?>>&#xe3f; &#8226; Thai Bahtv</option>
2610
- </select>
2611
- </td>
2612
- </tr>
2613
- <tr valign="top">
2614
- <td class="fm_options_label">
2615
- <label for="tax">Tax</label>
2616
- </td>
2617
- <td class="fm_options_value">
2618
- <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)"> %
2619
- </td>
2620
- </tr>
2621
- </table>
2622
- </fieldset>
2623
- <fieldset id="javascript_fieldset" class="adminform fm_fieldset_deactive">
2624
- <legend style="color:#0B55C4;font-weight: bold;">JavaScript</legend>
2625
- <table class="admintable">
2626
- <tr valign="top">
2627
- <td class="fm_options_label">
2628
- <label for="javascript">Javascript</label>
2629
- </td>
2630
- <td class="fm_options_value">
2631
- <textarea style="margin: 0px;" cols="60" rows="30" name="javascript" id="javascript"><?php echo $row->javascript; ?></textarea>
2632
- </td>
2633
- </tr>
2634
- </table>
2635
- </fieldset>
2636
- <input type="hidden" name="fieldset_id" id="fieldset_id" value="<?php echo WDW_FM_Library::get('fieldset_id', 'general'); ?>" />
2637
  <input type="hidden" id="task" name="task" value=""/>
2638
  <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
2639
  </form>
2640
  <script>
2641
- jQuery(window).load(function () {
2642
- form_maker_options_tabs(jQuery("#fieldset_id").val());
2643
  fm_popup();
2644
  });
2645
  </script>
2646
  <?php
2647
  }
2648
-
2649
- public function form_options($id) {
2650
  $row = $this->model->get_row_data($id);
2651
- $themes = $this->model->get_theme_rows_data();
2652
- $queries = $this->model->get_queries_rows_data($id);
2653
- $userGroups = get_editable_roles();
2654
  $page_title = $row->title . ' form options';
2655
  $label_id = array();
2656
  $label_label = array();
@@ -2664,1003 +2302,266 @@ class FMViewManage_fm {
2664
  array_push($label_label, $label_order_each[0]);
2665
  array_push($label_type, $label_order_each[1]);
2666
  }
2667
- $fields = explode('*:*id*:*type_submitter_mail*:*type*:*', $row->form_fields);
2668
- $fields_count = count($fields);
2669
  ?>
2670
  <script>
2671
  gen = "<?php echo $row->counter; ?>";
2672
  form_view_max = 20;
2673
  function set_preview() {
2674
- jQuery("#preview_form").attr("href", '<?php echo add_query_arg(array('action' => 'FormMakerPreview', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&test_theme=' + jQuery("#theme").val() + '&width=1000&height=500&TB_iframe=1');
2675
- jQuery("#edit_css").attr("href", '<?php echo add_query_arg(array('action' => 'FormMakerEditCSS', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&id=' + jQuery("#theme").val() + '&width=800&height=500&TB_iframe=1');
2676
  }
2677
- function set_condition() {
2678
- field_condition = '';
2679
- for(i=0;i<500;i++) {
2680
- conditions = '';
2681
- if(document.getElementById("condition"+i)) {
2682
- field_condition+=document.getElementById("show_hide"+i).value+"*:*show_hide*:*";
2683
- field_condition+=document.getElementById("fields"+i).value+"*:*field_label*:*";
2684
- field_condition+=document.getElementById("all_any"+i).value+"*:*all_any*:*";
2685
- for(k=0;k<500;k++) {
2686
- if(document.getElementById("condition_div"+i+"_"+k)) {
2687
- conditions+=document.getElementById("field_labels"+i+"_"+k).value+"***";
2688
- conditions+=document.getElementById("is_select"+i+"_"+k).value+"***";
2689
- if(document.getElementById("field_value"+i+"_"+k).tagName=="SELECT" ) {
2690
- if(document.getElementById("field_value"+i+"_"+k).getAttribute('multiple')) {
2691
- var sel = document.getElementById("field_value"+i+"_"+k);
2692
- var selValues = '';
2693
- for(m=0; m < sel.length; m++) {
2694
- if(sel.options[m].selected)
2695
-
2696
- selValues += sel.options[m].value+"@@@";
2697
- }
2698
- conditions+=selValues;
2699
- } else {
2700
- conditions+=document.getElementById("field_value"+i+"_"+k).value;
2701
- }
2702
- }
2703
- else
2704
- conditions+=document.getElementById("field_value"+i+"_"+k).value;
2705
- conditions+="*:*next_condition*:*";
2706
- }
2707
- }
2708
- field_condition+=conditions;
2709
- field_condition+="*:*new_condition*:*";
2710
- }
2711
- }
2712
- document.getElementById('condition').value = field_condition;
2713
- }
2714
-
2715
- function show_verify_options(s){
2716
- if(s){
2717
- jQuery(".verification_div").removeAttr( "style" );
2718
- jQuery(".expire_link").removeAttr( "style" );
2719
-
2720
- } else{
2721
- jQuery(".verification_div").css( 'display', 'none' );
2722
- jQuery(".expire_link").css( 'display', 'none' );
2723
- }
2724
- }
2725
  </script>
2726
- <style>
2727
- .CodeMirror {
2728
- border: 1px solid #ccc;
2729
- font-size: 12px;
2730
- margin-bottom: 6px;
2731
- background: white;
2732
- }
2733
- </style>
2734
- <div style="clear: both; float: left; width: 99%;">
2735
- <div style="float:left; font-size: 14px; font-weight: bold;">
2736
  This section allows you to edit form options.
2737
  <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-3.html">Read More in User Manual</a>
2738
  </div>
2739
- <div style="float: right; text-align: right;">
2740
- <a style="text-decoration: none;" target="_blank" href="https://web-dorado.com/files/fromFormMaker.php">
2741
- <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
2742
- </a>
2743
- </div>
2744
- </div>
2745
- <form class="wrap" method="post" action="admin.php?page=manage_fm" style="float: left; width: 99%;" name="adminForm" id="adminForm">
2746
  <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
2747
  <h2><?php echo $page_title; ?></h2>
2748
  <div style="float: right; margin: 0 5px 0 0;">
2749
- <input class="button-secondary" type="submit" onclick="if (fm_check_email('mailToAdd') ||
2750
  fm_check_email('from_mail') ||
2751
- fm_check_email('reply_to') ||
2752
- fm_check_email('mail_from_user') ||
2753
- fm_check_email('reply_to_user') ||
2754
- fm_check_email('mail_from_other') ||
2755
- fm_check_email('reply_to_other') ||
2756
- fm_check_email('paypal_email')) {return false;}; set_condition(); fm_set_input_value('task', 'save_options')" value="Save"/>
2757
- <input class="button-secondary" type="submit" onclick="if (fm_check_email('mailToAdd') ||
2758
  fm_check_email('from_mail') ||
2759
- fm_check_email('reply_to') ||
2760
- fm_check_email('mail_from_user') ||
2761
- fm_check_email('reply_to_user') ||
2762
- fm_check_email('mail_from_other') ||
2763
- fm_check_email('reply_to_other') ||
2764
- fm_check_email('paypal_email')) {return false;}; set_condition(); fm_set_input_value('task', 'apply_options')" value="Apply"/>
2765
- <input class="button-secondary" type="submit" onclick="fm_set_input_value('task', 'cancel_options')" value="Cancel"/>
2766
  </div>
 
2767
  <div class="submenu-box" style="width: 99%; float: left; margin: 15px 0 0 0;">
2768
  <div class="submenu-pad">
2769
  <ul id="submenu" class="configuration">
2770
  <li>
2771
  <a id="general" class="fm_fieldset_tab" onclick="form_maker_options_tabs('general')" href="#">General Options</a>
2772
  </li>
2773
- <li>
2774
- <a id="custom" class="fm_fieldset_tab" onclick="form_maker_options_tabs('custom')" href="#">Email Options</a>
2775
- </li>
2776
  <li>
2777
  <a id="actions" class="fm_fieldset_tab" onclick="form_maker_options_tabs('actions')" href="#">Actions after Submission</a>
2778
  </li>
2779
  <li>
2780
  <a id="payment" class="fm_fieldset_tab" onclick="form_maker_options_tabs('payment')" href="#">Payment Options</a>
2781
  </li>
2782
- <li>
2783
- <a id="javascript" class="fm_fieldset_tab" onclick="form_maker_options_tabs('javascript'); codemirror_for_javascript();" href="#">JavaScript</a>
2784
- </li>
2785
- <li>
2786
- <a id="conditions" class="fm_fieldset_tab" onclick="form_maker_options_tabs('conditions')" href="#">Conditional Fields</a>
2787
- </li>
2788
- <li>
2789
- <a id="mapping" class="fm_fieldset_tab" onclick="form_maker_options_tabs('mapping')" href="#" >MySQL Mapping</a>
2790
- </li>
2791
- </ul>
2792
- </div>
2793
- </div>
2794
- <fieldset id="general_fieldset" class="adminform fm_fieldset_deactive">
2795
- <legend style="color:#0B55C4;font-weight: bold;">General Options</legend>
2796
- <table class="admintable">
2797
- <tr valign="top">
2798
- <td class="fm_options_label">
2799
- <label>Published</label>
2800
- </td>
2801
- <td class="fm_options_value">
2802
- <input type="radio" name="published" id="published_yes" value="1" <?php echo ($row->published) ? "checked" : ""; ?> /><label for="published_yes">Yes</label>
2803
- <input type="radio" name="published" id="published_no" value="0" <?php echo (!$row->published) ? "checked" : ""; ?> /><label for="published_no">No</label>
2804
- </td>
2805
- </tr>
2806
- <tr valign="top">
2807
- <td class="fm_options_label">
2808
- <label>Save data(to database)</label>
2809
- </td>
2810
- <td class="fm_options_value">
2811
- <input type="radio" name="savedb" id="savedb_yes" value="1" <?php echo ($row->savedb) ? "checked" : ""; ?> /><label for="savedb_yes">Yes</label>
2812
- <input type="radio" name="savedb" id="savedb_no" value="0" <?php echo (!$row->savedb) ? "checked" : ""; ?> /><label for="savedb_no">No</label>
2813
- </td>
2814
- </tr>
2815
- <tr valign="top">
2816
- <td class="fm_options_label">
2817
- <label for="theme">Theme</label>
2818
- </td>
2819
- <td class="fm_options_value">
2820
- <select id="theme" name="theme" style="width:260px;" onChange="set_preview()">
2821
- <?php
2822
- foreach ($themes as $theme) {
2823
- ?>
2824
- <option value="<?php echo $theme->id; ?>" <?php echo (($theme->id == $row->theme) ? 'selected' : ''); ?>><?php echo $theme->title; ?></option>
2825
- <?php
2826
- }
2827
- ?>
2828
- </select>
2829
-
2830
- <a href="<?php echo add_query_arg(array('action' => 'FormMakerEditCSS', 'id' => $row->theme, 'form_id' => $row->id, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" class="button-secondary thickbox thickbox-preview" id="edit_css" title="Edit CSS" onclick="return false;">
2831
- Edit CSS
2832
- </a>
2833
- </td>
2834
- </tr>
2835
  <tr valign="top">
2836
  <td class="fm_options_label">
2837
- <label for="requiredmark">Required fields mark</label>
2838
  </td>
2839
  <td class="fm_options_value">
2840
- <input type="text" id="requiredmark" name="requiredmark" value="<?php echo $row->requiredmark; ?>" style="width:250px;" />
2841
- </td>
2842
- </tr>
2843
- </table>
2844
- <div class="error_fm" style="padding: 5px; font-size: 14px;">Front end submissions are disabled in free version.</div>
2845
- <fieldset class="adminform">
2846
- <legend style="color:#0B55C4;font-weight: bold;">Front end submissions access level</legend>
2847
- <table>
2848
- <tr>
2849
- <td class="key">
2850
- <label for="name">
2851
- Allow User to see submissions:
2852
- </label>
2853
- </td>
2854
- <td>
2855
- <?php
2856
- $checked_UserGroup=explode(',',$row->user_id_wd);
2857
- $i = 0;
2858
- foreach($userGroups as $val => $uG) {
2859
- echo '<input disabled="disabled" type="checkbox" value="'.$val .'" id="user_'.$i.'"';
2860
- if(in_array($val ,$checked_UserGroup))
2861
- echo 'checked="checked"';
2862
- echo 'onchange="acces_level('.count($userGroups).')"/><label for="user_'.$i.'">'.$uG["name"].'</label><br>';
2863
- $i++;
2864
- }
2865
- ?>
2866
- <input disabled="disabled" type="checkbox" value="guest" id="user_<?php echo $i; ?>" onchange="acces_level(<?php echo count($userGroups); ?>)"<?php echo (in_array('guest', $checked_UserGroup) ? 'checked="checked"' : '') ?>/><label for="user_<?php echo $i; ?>">Guest</label>
2867
- <input disabled="disabled" type="hidden" name="user_id_wd" value="<?php echo $row->user_id_wd ?>" id="user_id_wd" />
2868
- </td>
2869
- </tr>
2870
- </table>
2871
- </fieldset>
2872
- <?php
2873
- $labels_for_submissions = $this->model->get_labels($id);
2874
- $payment_info = $this->model->is_paypal($id);
2875
-
2876
- $labels_id_for_submissions= array();
2877
- $label_titles_for_submissions=array();
2878
- $labels_type_for_submissions= array();
2879
- if($labels_for_submissions)
2880
- {
2881
- $label_id_for_submissions= array();
2882
- $label_order_original_for_submissions= array();
2883
- $label_type_for_submissions= array();
2884
-
2885
- if(strpos($row->label_order, 'type_paypal_'))
2886
- {
2887
- $row->label_order=$row->label_order."item_total#**id**#Item Total#**label**#type_paypal_payment_total#****#total#**id**#Total#**label**#type_paypal_payment_total#****#0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
2888
- }
2889
-
2890
- $label_all_for_submissions = explode('#****#',$row->label_order);
2891
- $label_all_for_submissions = array_slice($label_all_for_submissions,0, count($label_all_for_submissions)-1);
2892
-
2893
- foreach($label_all_for_submissions as $key => $label_each)
2894
- {
2895
- $label_id_each=explode('#**id**#',$label_each);
2896
- array_push($label_id_for_submissions, $label_id_each[0]);
2897
-
2898
- $label_order_each=explode('#**label**#', $label_id_each[1]);
2899
-
2900
- array_push($label_order_original_for_submissions, $label_order_each[0]);
2901
- array_push($label_type_for_submissions, $label_order_each[1]);
2902
- }
2903
-
2904
- foreach($label_id_for_submissions as $key => $label) {
2905
- if(in_array($label, $labels_for_submissions))
2906
- {
2907
- array_push($labels_type_for_submissions, $label_type_for_submissions[$key]);
2908
- array_push($labels_id_for_submissions, $label);
2909
- array_push($label_titles_for_submissions, $label_order_original_for_submissions[$key]);
2910
- }
2911
- }
2912
- }
2913
-
2914
- $stats_labels = array();
2915
- $stats_labels_ids = array();
2916
- foreach($labels_type_for_submissions as $key => $label_type_cur)
2917
- {
2918
- if($label_type_cur=="type_checkbox" || $label_type_cur=="type_radio" || $label_type_cur=="type_own_select" || $label_type_cur=="type_country" || $label_type_cur=="type_paypal_select" || $label_type_cur=="type_paypal_radio" || $label_type_cur=="type_paypal_checkbox" || $label_type_cur=="type_paypal_shipping")
2919
- {
2920
- $stats_labels_ids[] = $labels_id_for_submissions[$key];
2921
- $stats_labels[] = $label_titles_for_submissions[$key];
2922
- }
2923
- }
2924
- ?>
2925
- <script type="text/javascript">
2926
- function inArray(needle, myarray) {
2927
- var length = myarray.length;
2928
- for(var i = 0; i < length; i++) {
2929
- if(myarray[i] == needle) return true;
2930
- }
2931
- return false;
2932
- }
2933
-
2934
- function checked_labels(class_name) {
2935
- var checked_ids ='';
2936
- jQuery('.'+class_name).each(function() {
2937
- if(this.checked) {
2938
- checked_ids += this.value+',';
2939
- }
2940
- });
2941
- if(class_name == 'filed_label') {
2942
- document.getElementById("frontend_submit_fields").value = checked_ids ;
2943
- if(checked_ids == document.getElementById("all_fields").value)
2944
- document.getElementById("all_fields").checked = true;
2945
- else
2946
- document.getElementById("all_fields").checked = false;
2947
- }
2948
- else {
2949
- document.getElementById("frontend_submit_stat_fields").value = checked_ids ;
2950
- if(checked_ids == document.getElementById("all_stats_fields").value)
2951
- document.getElementById("all_stats_fields").checked = true;
2952
- else
2953
- document.getElementById("all_stats_fields").checked = false;
2954
- }
2955
- }
2956
-
2957
- jQuery(document).ready(function () {
2958
- jQuery('.filed_label').each(function() {
2959
- if(document.getElementById("frontend_submit_fields").value == document.getElementById("all_fields").value)
2960
- document.getElementById("all_fields").checked = true;
2961
- if(inArray(this.value, document.getElementById("frontend_submit_fields").value.split(","))) {
2962
- this.checked = true;
2963
- }
2964
- });
2965
-
2966
- jQuery('.stats_filed_label').each(function() {
2967
- if(document.getElementById("frontend_submit_stat_fields").value == document.getElementById("all_stats_fields").value)
2968
- document.getElementById("all_stats_fields").checked = true;
2969
- if(inArray(this.value, document.getElementById("frontend_submit_stat_fields").value.split(","))) {
2970
- this.checked = true;
2971
- }
2972
- });
2973
-
2974
- jQuery(document).on('change','input[name="all_fields"]',function() {
2975
- jQuery('.filed_label').prop("checked" , this.checked);
2976
- });
2977
-
2978
- jQuery(document).on('change','input[name="all_stats_fields"]',function() {
2979
- jQuery('.stats_filed_label').prop("checked" , this.checked);
2980
- });
2981
- });
2982
- </script>
2983
-
2984
- <style>
2985
- li{
2986
- list-style-type: none;
2987
- }
2988
-
2989
- .simple_table
2990
- {
2991
- padding-left: 0px !important;
2992
- }
2993
-
2994
- .simple_table input, .simple_table label, .simple_table img
2995
- {
2996
- display:inline-block !important;
2997
- float:none !important;
2998
- }
2999
- </style>
3000
- <fieldset class="adminform">
3001
- <legend style="color:#0B55C4;font-weight: bold;">Fields to hide in frontend submissions</legend>
3002
- <?php if(count($label_titles_for_submissions)): ?>
3003
- <table style="margin-left:-3px;">
3004
- <tr>
3005
- <td>
3006
- <label>Select fields:</label>
3007
- </td>
3008
- <td class="simple_table">
3009
- <ul id="form_fields">
3010
- <li>
3011
- <input disabled="disabled" type="checkbox" name="all_fields" id="all_fields" value="submit_id,<?php echo implode(',',$labels_id_for_submissions)."," . ($payment_info ? "payment_info" : ""); ?>" onclick="checked_labels('filed_label')"/>
3012
- <label for="all_fields">Select All</label>
3013
- </li>
3014
- <?php
3015
- echo "<li><input disabled=\"disabled\" type=\"checkbox\" id=\"submit_id\" name=\"submit_id\" value=\"submit_id\" class=\"filed_label\" onclick=\"checked_labels('filed_label')\"><label for=\"submit_id\">ID</label></li>";
3016
-
3017
- for($i=0, $n=count($label_titles_for_submissions); $i < $n ; $i++)
3018
- {
3019
- $field_label = $label_titles_for_submissions[$i];
3020
-
3021
- echo "<li><input disabled=\"disabled\" type=\"checkbox\" id=\"filed_label".$i."\" name=\"filed_label".$i."\" value=\"".$labels_id_for_submissions[$i]."\" class=\"filed_label\" onclick=\"checked_labels('filed_label')\"><label for=\"filed_label".$i."\">".(strlen($field_label) > 80 ? substr ($field_label ,0, 80).'...' : $field_label)."</label></li>";
3022
-
3023
- }
3024
- if($payment_info)
3025
- echo "<li><input disabled=\"disabled\" type=\"checkbox\" id=\"payment_info\" name=\"payment_info\" value=\"payment_info\" class=\"filed_label\" onclick=\"checked_labels('filed_label')\"><label for=\"payment_info\">Payment Info</label></li>";
3026
- ?>
3027
- </ul>
3028
- <input type="hidden" name="frontend_submit_fields" value="<?php echo $row->frontend_submit_fields ?>" id="frontend_submit_fields" />
3029
- </td>
3030
- </tr>
3031
- <?php if($stats_labels): ?>
3032
- <tr id="stats">
3033
- <td>
3034
- <label>Stats fields:</label>
3035
- </td>
3036
- <td class="simple_table">
3037
- <ul id="stats_fields">
3038
- <li>
3039
- <input disabled="disabled" type="checkbox" name="all_stats_fields" id="all_stats_fields" value="<?php echo implode(',',$stats_labels_ids).","; ?>" onclick="checked_labels('stats_filed_label')">
3040
- <label for="all_stats_fields">Select All</label>
3041
- </li>
3042
- <?php
3043
- for($i=0, $n=count($stats_labels); $i < $n ; $i++)
3044
- {
3045
- $field_label = $stats_labels[$i];
3046
- echo "<li><input disabled=\"disabled\" type=\"checkbox\" id=\"stats_filed_label".$i."\" name=\"stats_filed_label".$i."\" value=\"".$stats_labels_ids[$i]."\" class=\"stats_filed_label\" onclick=\"checked_labels('stats_filed_label')\" ><label for=\"stats_filed_label".$i."\">".(strlen($field_label) > 80 ? substr ($field_label ,0, 80).'...' : $field_label)."</label></li>";
3047
- }
3048
- ?>
3049
- </ul>
3050
- <input type="hidden" name="frontend_submit_stat_fields" value="<?php echo $row->frontend_submit_stat_fields ?>" id="frontend_submit_stat_fields" />
3051
- </td>
3052
- </tr>
3053
- <?php endif; ?>
3054
- </table>
3055
- <?php endif; ?>
3056
- </fieldset>
3057
- </fieldset>
3058
- <fieldset id="custom_fieldset" class="adminform fm_fieldset_deactive">
3059
- <legend style="color: #0B55C4; font-weight: bold;">Email Options</legend>
3060
- <table class="admintable">
3061
- <tr valign="top">
3062
- <td style="padding: 15px; width:75px;">
3063
- <label>Send E-mail</label>
3064
- </td>
3065
- <td style="padding: 15px;">
3066
- <input type="radio" name="sendemail" id="sendemail_yes" value="1" <?php echo ($row->sendemail) ? "checked" : ""; ?> /><label for="sendemail_yes">Yes</label>
3067
- <input type="radio" name="sendemail" id="sendemail_no" value="0" <?php echo (!$row->sendemail) ? "checked" : ""; ?> /><label for="sendemail_no">No</label>
3068
  </td>
3069
  </tr>
3070
- </table>
3071
- <fieldset class="fm_mail_options">
3072
- <legend style="color:#0B55C4;font-weight: bold;">Email to Administrator</legend>
3073
- <table class="admintable">
3074
- <tr valign="top">
3075
- <td class="fm_options_label">
3076
- <label for="mailToAdd">Email to send submissions to</label>
3077
- </td>
3078
- <td class="fm_options_value">
3079
- <input type="text" id="mailToAdd" name="mailToAdd" style="width: 250px;" />
3080
- <input type="hidden" id="mail" name="mail" value="<?php echo $row->mail . ($row->mail && (substr($row->mail, -1) != ',') ? ',' : ''); ?>" />
3081
- <img src="<?php echo WD_FM_URL . '/images/add.png'; ?>"
3082
- style="vertical-align: middle; cursor: pointer;"
3083
- title="Add more emails"
3084
- onclick="if (fm_check_email('mailToAdd')) {return false;};cfm_create_input('mail', 'mailToAdd', 'cfm_mail_div', '<?php echo WD_FM_URL; ?>')" />
3085
- <div id="cfm_mail_div">
3086
- <?php
3087
- $mail_array = explode(',', $row->mail);
3088
- foreach ($mail_array as $mail) {
3089
- if ($mail && $mail != ',') {
3090
- ?>
3091
- <div class="fm_mail_input">
3092
- <?php echo $mail; ?>
3093
- <img src="<?php echo WD_FM_URL; ?>/images/delete.png" class="fm_delete_img" onclick="fm_delete_mail(this, '<?php echo $mail; ?>')" title="Delete Email" />
3094
- </div>
3095
- <?php
3096
- }
3097
- }
3098
- ?>
3099
- </div>
3100
- </td>
3101
- </tr>
3102
- <tr valign="top">
3103
- <td class="fm_options_label">
3104
- <label for="from_mail">Email From</label>
3105
- </td>
3106
- <td class="fm_options_value">
3107
- <!--<input id="from_mail" name="from_mail" value="<?php echo $row->from_mail; ?>" style="width:250px;" />-->
3108
- <?php
3109
- $is_other = TRUE;
3110
- for ($i = 0; $i < $fields_count - 1; $i++) {
3111
- ?>
3112
- <div>
3113
- <input type="radio" name="from_mail" id="from_mail<?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 ((strlen($fields[$i])!=1 ? substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*')+15, strlen($fields[$i])) : $fields[$i]) == $row->from_mail ? 'checked="checked"' : '' ); ?> onclick="wdhide('mail_from_other')" />
3114
- <label for="from_mail<?php echo $i; ?>"><?php echo substr($fields[$i + 1], 0, strpos($fields[$i + 1], '*:*w_field_label*:*')); ?></label>
3115
- </div>
3116
- <?php
3117
- if(strlen($fields[$i])!=1) {
3118
- if (substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*') + 15, strlen($fields[$i])) == $row->from_mail) {
3119
- $is_other = FALSE;
3120
- }
3121
- }
3122
- else {
3123
- if($fields[$i] == $row->from_mail)
3124
- $is_other=false;
3125
- }
3126
- }
3127
- ?>
3128
- <div style="<?php echo ($fields_count == 1) ? 'display:none;' : ''; ?>">
3129
- <input type="radio" id="other" name="from_mail" value="other" <?php echo ($is_other) ? 'checked="checked"' : ''; ?> onclick="wdshow('mail_from_other')" />
3130
- <label for="other">Other</label>
3131
- </div>
3132
- <input type="text" 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 : ''; ?>" />
3133
- </td>
3134
- </tr>
3135
- <tr valign="top">
3136
- <td class="fm_options_label">
3137
- <label for="from_name">From Name</label>
3138
- </td>
3139
- <td class="fm_options_value">
3140
- <input type="text" id="from_name" name="from_name" value="<?php echo $row->from_name; ?>" style="width: 250px;" />
3141
- <img src="<?php echo WD_FM_URL . '/images/add.png'; ?>" onclick="document.getElementById('mail_from_labels').style.display='block';" style="vertical-align: middle; cursor: pointer;display:inline-block; margin:0px; float:none;">
3142
- <?php
3143
- $choise = "document.getElementById('from_name')";
3144
- echo '<div style="position:relative; top:-3px;"><div id="mail_from_labels" class="email_labels" style="display:none;">';
3145
- echo "<a onClick=\"insertAtCursor(".$choise.",'username'); document.getElementById('mail_from_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Username</a>";
3146
- for($i=0; $i<count($label_label); $i++)
3147
- {
3148
- 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")
3149
- continue;
3150
-
3151
- $param = htmlspecialchars(addslashes($label_label[$i]));
3152
-
3153
- $fld_label = $param;
3154
- if(strlen($fld_label)>30)
3155
- {
3156
- $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3157
- $fld_label = explode("\n", $fld_label);
3158
- $fld_label = $fld_label[0] . ' ...';
3159
- }
3160
-
3161
- echo "<a onClick=\"insertAtCursor(".$choise.",'".$param."'); document.getElementById('mail_from_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">".$fld_label."</a>";
3162
-
3163
- }
3164
- echo "<a onClick=\"insertAtCursor(".$choise.",'subid'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Submission ID</a>";
3165
-
3166
- echo "<a onClick=\"insertAtCursor(".$choise.",'username'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Username</a>";
3167
- echo '</div></div>';
3168
- ?>
3169
- </td>
3170
- </tr>
3171
- <tr valign="top">
3172
- <td class="fm_options_label">
3173
- <label for="reply_to">Reply to<br/>(if different from "Email From") </label>
3174
- </td>
3175
- <td class="fm_options_value">
3176
- <!--<input id="reply_to" name="reply_to" value="<?php echo $row->reply_to; ?>" style="width:250px;"/>-->
3177
- <?php
3178
- $is_other = TRUE;
3179
- for ($i = 0; $i < $fields_count - 1; $i++) {
3180
- ?>
3181
- <div>
3182
- <input type="radio" name="reply_to" id="reply_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 ((strlen($fields[$i])!=1 ? substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*')+15, strlen($fields[$i])) : $fields[$i]) == $row->reply_to ? 'checked="checked"' : '' ); ?> onclick="wdhide('reply_to_other')" />
3183
- <label for="reply_to<?php echo $i; ?>"><?php echo substr($fields[$i + 1], 0, strpos($fields[$i + 1], '*:*w_field_label*:*')); ?></label>
3184
- </div>
3185
- <?php
3186
- if(strlen($fields[$i])!=1) {
3187
- if (substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*') + 15, strlen($fields[$i])) == $row->reply_to) {
3188
- $is_other = FALSE;
3189
- }
3190
- }
3191
- else {
3192
- if($fields[$i] == $row->reply_to)
3193
- $is_other=false;
3194
- }
3195
- }
3196
- ?>
3197
- <div style="<?php echo ($fields_count == 1) ? 'display: none;' : ''; ?>">
3198
- <input type="radio" id="other1" name="reply_to" value="other" <?php echo ($is_other) ? 'checked="checked"' : ''; ?> onclick="wdshow('reply_to_other')" />
3199
- <label for="other1">Other</label>
3200
- </div>
3201
- <input type="text" 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 : ''; ?>" />
3202
- </td>
3203
- </tr>
3204
- <tr valign="top">
3205
- <td class="fm_options_label">
3206
- <label> CC: </label>
3207
- </td>
3208
- <td class="fm_options_value">
3209
- <input type="text" id="mail_cc" name="mail_cc" value="<?php echo $row->mail_cc ?>" style="width:250px;" />
3210
- </td>
3211
- </tr>
3212
- <tr valign="top">
3213
- <td class="fm_options_label">
3214
- <label> BCC: </label>
3215
- </td>
3216
- <td class="fm_options_value">
3217
- <input type="text" id="mail_bcc" name="mail_bcc" value="<?php echo $row->mail_bcc ?>" style="width:250px;" />
3218
- </td>
3219
- </tr>
3220
- <tr valign="top">
3221
- <td class="fm_options_label">
3222
- <label> Subject: </label>
3223
- </td>
3224
- <td class="fm_options_value">
3225
- <input type="text" id="mail_subject" name="mail_subject" value="<?php echo $row->mail_subject ?>" style="width:250px;" />
3226
- <img src="<?php echo WD_FM_URL . '/images/add.png'; ?>" onclick="document.getElementById('mail_subject_labels').style.display='block';" style="vertical-align: middle;cursor: pointer; display:inline-block; margin:0px; float:none;">
3227
- <?php
3228
- $choise = "document.getElementById('mail_subject')";
3229
- echo '<div style="position:relative; top:-3px;"><div id="mail_subject_labels" class="email_labels" style="display:none;">';
3230
- for($i=0; $i<count($label_label); $i++)
3231
- {
3232
- 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")
3233
- continue;
3234
-
3235
- $param = htmlspecialchars(addslashes($label_label[$i]));
3236
-
3237
- $fld_label = $param;
3238
- if(strlen($fld_label)>30)
3239
- {
3240
- $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3241
- $fld_label = explode("\n", $fld_label);
3242
- $fld_label = $fld_label[0] . ' ...';
3243
- }
3244
-
3245
- echo "<a onClick=\"insertAtCursor(".$choise.",'".$param."'); document.getElementById('mail_subject_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">".$fld_label."</a>";
3246
-
3247
- }
3248
- echo "<a onClick=\"insertAtCursor(".$choise.",'subid'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Submission ID</a>";
3249
-
3250
- echo "<a onClick=\"insertAtCursor(".$choise.",'username'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Username</a>";
3251
- echo '</div></div>';
3252
- ?>
3253
- </td>
3254
- </tr>
3255
- <tr valign="top">
3256
- <td class="fm_options_label" style="vertical-align: middle;">
3257
- <label> Mode: </label>
3258
- </td>
3259
- <td class="fm_options_value">
3260
- <input type="radio" name="mail_mode" id="htmlmode" value="1" <?php if($row->mail_mode==1 ) echo "checked" ?> /> <label for="htmlmode">HTML</label>
3261
- <input type="radio" name="mail_mode" id="textmode" value="0" <?php if($row->mail_mode==0 ) echo "checked" ?> /> <label for="textmode">Text</label>
3262
- </td>
3263
- </tr>
3264
- <tr valign="top">
3265
- <td class="fm_options_label" style="vertical-align: middle;">
3266
- <label> Attach File: </label>
3267
- </td>
3268
- <td class="fm_options_value">
3269
- <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>
3270
- <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>
3271
- <div class="error_fm" style="padding: 5px; font-size: 14px;">File attach is disabled in free version.</div>
3272
- </td>
3273
- </tr>
3274
- <tr valign="top">
3275
- <td class="fm_options_label" style="vertical-align: middle;">
3276
- <label> Email empty fields: </label>
3277
- </td>
3278
- <td class="fm_options_value">
3279
- <input type="radio" name="mail_emptyfields" value="1" id="en_mail_emptyfields" <?php if($row->mail_emptyfields==1 ) echo "checked" ?> /> <label for="en_mail_emptyfields">Yes</label>
3280
- <input type="radio" name="mail_emptyfields" id="dis_mail_emptyfields" value="0" <?php if($row->mail_emptyfields==0 ) echo "checked" ?> /> <label for="dis_mail_emptyfields">No</label>
3281
- </td>
3282
- </tr>
3283
- <tr>
3284
- <td class="fm_options_label" valign="top">
3285
- <label>Custom Text in Email For Administrator</label>
3286
- </td>
3287
- <td class="fm_options_value">
3288
- <div style="margin-bottom:5px">
3289
- <?php
3290
- $choise = "document.getElementById('script_mail')";
3291
- for ($i = 0; $i < count($label_label); $i++) {
3292
- 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_send_copy") {
3293
- continue;
3294
- }
3295
- $param = htmlspecialchars(addslashes($label_label[$i]));
3296
- $fld_label = $param;
3297
- if(strlen($fld_label)>30)
3298
- {
3299
- $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3300
- $fld_label = explode("\n", $fld_label);
3301
- $fld_label = $fld_label[0] . ' ...';
3302
- }
3303
-
3304
- if($label_type[$i]=="type_file_upload")
3305
- $fld_label .= '(as image)';
3306
- ?>
3307
- <input style="border: 1px solid silver; font-size: 10px;" type="button" value="<?php echo $fld_label; ?>" onClick="insertAtCursor(<?php echo $choise; ?>, '<?php echo $param; ?>')" />
3308
- <?php
3309
- }
3310
- ?>
3311
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Submission ID" onClick="insertAtCursor(<?php echo $choise; ?>,'subid')" />
3312
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Ip" onClick="insertAtCursor(<?php echo $choise; ?>,'ip')" />
3313
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Username" onClick="insertAtCursor(<?php echo $choise; ?>,'username')" />
3314
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="User Email" onClick="insertAtCursor(<?php echo $choise; ?>,'useremail')" />
3315
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="All fields list" onClick="insertAtCursor(<?php echo $choise; ?>, 'all')" />
3316
- </div>
3317
- <?php
3318
- if (user_can_richedit()) {
3319
- wp_editor($row->script_mail, 'script_mail', array('teeny' => FALSE, 'textarea_name' => 'script_mail', 'media_buttons' => FALSE, 'textarea_rows' => 5));
3320
- }
3321
- else {
3322
- ?>
3323
- <textarea name="script_mail" id="script_mail" cols="20" rows="10" style="width:300px; height:450px;"><?php echo $row->script_mail; ?></textarea>
3324
- <?php
3325
- }
3326
- ?>
3327
- </td>
3328
- </tr>
3329
- </table>
3330
- </fieldset>
3331
- <fieldset class="fm_mail_options">
3332
- <legend style="color: #0B55C4; font-weight: bold;">Email to User</legend>
3333
- <table class="admintable">
3334
- <tr valign="top">
3335
- <td class="fm_options_label">
3336
- <label for="mail">Send to</label>
3337
- </td>
3338
- <td class="fm_options_value">
3339
- <?php
3340
- $fields = explode('*:*id*:*type_submitter_mail*:*type*:*', $row->form_fields);
3341
- $fields_count = count($fields);
3342
- if ($fields_count == 1) {
3343
- ?>
3344
- There is no email field
3345
- <?php
3346
- }
3347
- else {
3348
- for ($i = 0; $i < $fields_count - 1; $i++) {
3349
- ?>
3350
- <div>
3351
- <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;" />
3352
- <label for="send_to<?php echo $i; ?>"><?php echo substr($fields[$i + 1], 0, strpos($fields[$i + 1], '*:*w_field_label*:*')); ?></label>
3353
- </div>
3354
- <?php
3355
- }
3356
- }
3357
- ?>
3358
- </td>
3359
- </tr>
3360
- <tr valign="top">
3361
- <td class="fm_options_label">
3362
- <label for="mail_from_user">Email From</label>
3363
- </td>
3364
- <td class="fm_options_value">
3365
- <input type="text" id="mail_from_user" name="mail_from_user" value="<?php echo $row->mail_from_user; ?>" style="width: 250px;" />
3366
- </td>
3367
- </tr>
3368
- <tr valign="top">
3369
- <td class="fm_options_label">
3370
- <label for="mail_from_name_user">From Name</label>
3371
- </td>
3372
- <td class="fm_options_value">
3373
- <input type="text" id="mail_from_name_user" name="mail_from_name_user" value="<?php echo $row->mail_from_name_user; ?>" style="width: 250px;"/>
3374
- <img src="<?php echo WD_FM_URL . '/images/add.png'; ?>" onclick="document.getElementById('mail_from_name_user_labels').style.display='block';" style="vertical-align: middle;cursor: pointer; display:inline-block; margin:0px; float:none;">
3375
- <?php
3376
- $choise = "document.getElementById('mail_from_name_user')";
3377
- echo '<div style="position:relative; top:-3px;"><div id="mail_from_name_user_labels" class="email_labels" style="display:none;">';
3378
- for($i=0; $i<count($label_label); $i++)
3379
- {
3380
- 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")
3381
- continue;
3382
-
3383
- $param = htmlspecialchars(addslashes($label_label[$i]));
3384
-
3385
- $fld_label = $param;
3386
- if(strlen($fld_label)>30)
3387
- {
3388
- $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3389
- $fld_label = explode("\n", $fld_label);
3390
- $fld_label = $fld_label[0] . ' ...';
3391
- }
3392
-
3393
- 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>";
3394
-
3395
- }
3396
- echo "<a onClick=\"insertAtCursor(".$choise.",'subid'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Submission ID</a>";
3397
-
3398
- echo "<a onClick=\"insertAtCursor(".$choise.",'username'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Username</a>";
3399
- echo '</div></div>';
3400
- ?>
3401
- </td>
3402
- </tr>
3403
- <tr valign="top">
3404
- <td class="fm_options_label">
3405
- <label for="reply_to_user">Reply to<br />(if different from "Email Form")</label>
3406
- </td>
3407
- <td class="fm_options_value">
3408
- <input type="text" id="reply_to_user" name="reply_to_user" value="<?php echo $row->reply_to_user; ?>" style="width:250px;"/>
3409
- </td>
3410
- </tr>
3411
- <tr valign="top">
3412
- <td class="fm_options_label">
3413
- <label> CC: </label>
3414
- </td>
3415
- <td class="fm_options_value">
3416
- <input type="text" id="mail_cc_user" name="mail_cc_user" value="<?php echo $row->mail_cc_user ?>" style="width:250px;" />
3417
- </td>
3418
- </tr>
3419
- <tr valign="top">
3420
- <td class="fm_options_label">
3421
- <label> BCC: </label>
3422
- </td>
3423
- <td class="fm_options_value">
3424
- <input type="text" id="mail_bcc_user" name="mail_bcc_user" value="<?php echo $row->mail_bcc_user ?>" style="width:250px;" />
3425
- </td>
3426
- </tr>
3427
- <tr valign="top">
3428
- <td class="fm_options_label">
3429
- <label> Subject: </label>
3430
- </td>
3431
- <td class="fm_options_value">
3432
- <input type="text" id="mail_subject_user" name="mail_subject_user" value="<?php echo $row->mail_subject_user ?>" style="width:250px;" />
3433
- <img src="<?php echo WD_FM_URL . '/images/add.png'; ?>" onclick="document.getElementById('mail_subject_user_labels').style.display='block';" style="vertical-align: middle; cursor: pointer; display:inline-block; margin:0px; float:none;">
3434
- <?php
3435
- $choise = "document.getElementById('mail_subject_user')";
3436
- echo '<div style="position:relative; top:-3px;"><div id="mail_subject_user_labels" class="email_labels" style="display:none;">';
3437
- for($i=0; $i<count($label_label); $i++)
3438
- {
3439
- 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")
3440
- continue;
3441
-
3442
- $param = htmlspecialchars(addslashes($label_label[$i]));
3443
-
3444
- $fld_label = $param;
3445
- if(strlen($fld_label)>30)
3446
- {
3447
- $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3448
- $fld_label = explode("\n", $fld_label);
3449
- $fld_label = $fld_label[0] . ' ...';
3450
- }
3451
-
3452
- echo "<a onClick=\"insertAtCursor(".$choise.",'".$param."'); document.getElementById('mail_subject_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">".$fld_label."</a>";
3453
-
3454
- }
3455
- echo "<a onClick=\"insertAtCursor(".$choise.",'subid'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Submission ID</a>";
3456
-
3457
- echo "<a onClick=\"insertAtCursor(".$choise.",'username'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Username</a>";
3458
- echo '</div></div>';
3459
- ?>
3460
- </td>
3461
- </tr>
3462
- <tr valign="top">
3463
- <td class="fm_options_label" style="vertical-align: middle;">
3464
- <label> Mode: </label>
3465
- </td>
3466
- <td class="fm_options_value">
3467
- <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>
3468
- <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>
3469
- </td>
3470
- </tr>
3471
- <tr valign="top">
3472
- <td class="fm_options_label" style="vertical-align: middle;">
3473
- <label> Attach File: </label>
3474
- </td>
3475
- <td class="fm_options_value">
3476
- <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>
3477
- <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>
3478
- <div class="error_fm" style="padding: 5px; font-size: 14px;">File attach is disabled in free version.</div>
3479
- </td>
3480
- </tr>
3481
- <tr valign="top">
3482
- <td class="fm_options_label" style="vertical-align: middle;">
3483
- <label> Email verification: </label>
3484
  </td>
3485
  <td class="fm_options_value">
3486
- <input type="radio" name="mail_verify" value="1" id="en_mail_verify" <?php if($row->mail_verify==1 ) echo "checked" ?> onClick = "show_verify_options(true)" /> <label for="en_mail_verify">Yes</label>
3487
- <input type="radio" name="mail_verify" id="dis_mail_verify" value="0" <?php if($row->mail_verify==0 ) echo "checked" ?> onClick = "show_verify_options(false)"/> <label for="dis_mail_verify">No</label>
3488
  </td>
3489
- </tr>
3490
- <tr valign="top" class="expire_link" <?php echo ($row->mail_verify==0 ? 'style="display:none;"' : '')?>>
3491
- <td class="fm_options_label" valign="top">
3492
- <label> Verification link expires in: </label>
3493
  </td>
3494
  <td class="fm_options_value">
3495
- <input class="inputbox" type="text" name="mail_verify_expiretime" maxlength="10" value = "<?php echo ($row->mail_verify_expiretime ? $row->mail_verify_expiretime : 0); ?>" style="width:95px;" onkeypress="return check_isnum_point(event)"/><small> -- hours (0 - never expires).</small>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3496
  </td>
3497
  </tr>
3498
- <tr>
3499
- <td class="fm_options_label" valign="top">
3500
- <label>Custom Text in Email For User</label>
3501
- </td>
3502
- <td class="fm_options_value">
3503
- <div style="margin-bottom:5px">
3504
- <?php
3505
- $choise = "document.getElementById('script_mail_user')";
3506
- for ($i = 0; $i < count($label_label); $i++) {
3507
- 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") {
3508
- continue;
3509
- }
3510
- $param = htmlspecialchars(addslashes($label_label[$i]));
3511
- $fld_label = $param;
3512
- if(strlen($fld_label)>30)
3513
- {
3514
- $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3515
- $fld_label = explode("\n", $fld_label);
3516
- $fld_label = $fld_label[0] . ' ...';
3517
- }
3518
- if($label_type[$i]=="type_file_upload")
3519
- $fld_label .= '(as image)';
3520
- ?>
3521
- <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; ?>')" />
3522
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3523
  }
 
3524
  ?>
3525
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Submission ID" onClick="insertAtCursor(<?php echo $choise; ?>,'subid')" />
3526
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Ip" onClick="insertAtCursor(<?php echo $choise; ?>,'ip')" />
3527
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Username" onClick="insertAtCursor(<?php echo $choise; ?>,'username')" />
3528
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="User Email" onClick="insertAtCursor(<?php echo $choise; ?>,'useremail')" />
3529
- <input style="border: 1px solid silver; font-size: 10px; margin:3px;" type="button" value="All fields list" onClick="insertAtCursor(<?php echo $choise; ?>, 'all')" />
3530
- <div class="verification_div" <?php echo ($row->mail_verify==0 ? 'style="display:none;"' : '')?>><input style="border: 1px solid silver; font-size: 10px; margin:3px;" type="button" value="Verification link" onClick="insertAtCursor(<?php echo $choise; ?>,'Verification link')" /> </div>
3531
- </div>
 
 
 
 
 
 
3532
  <?php
3533
- if (user_can_richedit()) {
3534
- wp_editor($row->script_mail_user, 'script_mail_user', array('teeny' => FALSE, 'textarea_name' => 'script_mail_user', 'media_buttons' => FALSE, 'textarea_rows' => 5));
3535
- }
3536
- else {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3537
  ?>
3538
- <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>
3539
  <?php
3540
  }
3541
  ?>
3542
- </td>
3543
- </tr>
3544
- </table>
3545
- </fieldset>
 
 
 
 
 
 
 
 
 
 
 
3546
  </fieldset>
3547
- <fieldset id="actions_fieldset" class="adminform fm_fieldset_deactive">
3548
- <legend style="color:#0B55C4;font-weight: bold;">Actions after submission</legend>
3549
- <table class="admintable">
3550
  <tr valign="top">
3551
  <td class="fm_options_label">
3552
- <label>Action type</label>
3553
  </td>
3554
  <td class="fm_options_value">
3555
- <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>
3556
- <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>
3557
- <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>
3558
- <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>
3559
- <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>
3560
  </td>
3561
  </tr>
3562
- <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"' : ''); ?>>
3563
  <td class="fm_options_label">
3564
- <label>Stay on Form</label>
3565
  </td>
3566
  <td class="fm_options_value">
3567
- <img src="<?php echo WD_FM_URL . '/images/tick.png'; ?>" border="0">
3568
  </td>
3569
  </tr>
3570
- <tr id="post" <?php echo (($row->submit_text_type != 2) ? 'style="display:none"' : ''); ?>>
3571
  <td class="fm_options_label">
3572
- <label for="post_name">Post</label>
3573
  </td>
3574
  <td class="fm_options_value">
3575
- <select id="post_name" name="post_name" style="width: 153px; font-size: 11px;">
3576
- <option value="0">- Select Post -</option>
3577
- <?php
3578
- // The Query.
3579
- $args = array('posts_per_page' => 10000);
3580
- query_posts($args);
3581
- // The Loop.
3582
- while (have_posts()) : the_post(); ?>
3583
- <option value="<?php $x = get_permalink(get_the_ID()); echo $x; ?>" <?php echo (($row->article_id == $x) ? 'selected="selected"' : ''); ?>><?php the_title(); ?></option>
3584
- <?php
3585
- endwhile;
3586
- // Reset Query.
3587
- wp_reset_query();
3588
- ?>
3589
- </select>
3590
  </td>
3591
  </tr>
3592
- <tr id="page" <?php echo (($row->submit_text_type != 5) ? 'style="display:none"' : ''); ?>>
3593
  <td class="fm_options_label">
3594
- <label for="page_name">Page</label>
3595
  </td>
3596
  <td class="fm_options_value">
3597
- <select id="page_name" name="page_name" style="width: 153px; font-size: 11px;">
3598
- <option value="0">- Select Page -</option>
3599
  <?php
3600
- // The Query.
3601
- $pages = get_pages();
3602
- // The Loop.
3603
- foreach ($pages as $page) {
3604
- $page_id = get_page_link($page->ID);
3605
  ?>
3606
- <option value="<?php echo $page_id; ?>" <?php echo (($row->article_id == $page_id) ? 'selected="selected"' : ''); ?>><?php echo $page->post_title; ?></option>
3607
  <?php
3608
  }
3609
- // Reset Query.
3610
- wp_reset_query();
3611
  ?>
3612
  </select>
3613
- </td>
3614
- </tr>
3615
- <tr id="custom_text" <?php echo (($row->submit_text_type != 3) ? 'style="display: none;"' : ''); ?>>
3616
- <td class="fm_options_label">
3617
- <label for="submit_text">Text</label>
3618
- </td>
3619
- <td class="fm_options_value">
3620
- <?php $choise = "document.getElementById('submit_text')";
3621
- for ($i = 0; $i < count($label_label); $i++) {
3622
- 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_send_copy" || $label_type[$i]=="type_file_upload") {
3623
- continue;
3624
- }
3625
- $param = htmlspecialchars(addslashes($label_label[$i]));
3626
- $fld_label = $param;
3627
- if(strlen($fld_label)>30)
3628
- {
3629
- $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3630
- $fld_label = explode("\n", $fld_label);
3631
- $fld_label = $fld_label[0] . ' ...';
3632
- }
3633
-
3634
- ?>
3635
- <input style="border: 1px solid silver; font-size: 10px;" type="button" value="<?php echo $fld_label; ?>" onClick="insertAtCursor(<?php echo $choise; ?>, '<?php echo $param; ?>')" />
3636
- <?php
3637
- }
3638
- ?>
3639
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Submission ID" onClick="insertAtCursor(<?php echo $choise; ?>,'subid')" />
3640
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Ip" onClick="insertAtCursor(<?php echo $choise; ?>,'ip')" />
3641
- <input style="border: 1px solid silver; font-size: 10px; margin:3px;" type="button" value="User Id" onClick="insertAtCursor(<?php echo $choise; ?>, 'userid')" />
3642
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Username" onClick="insertAtCursor(<?php echo $choise; ?>,'username')" />
3643
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="User Email" onClick="insertAtCursor(<?php echo $choise; ?>,'useremail')" />
3644
- <?php
3645
- if (user_can_richedit()) {
3646
- wp_editor($row->submit_text, 'submit_text', array('teeny' => FALSE, 'textarea_name' => 'submit_text', 'media_buttons' => FALSE, 'textarea_rows' => 5));
3647
- }
3648
- else {
3649
- ?>
3650
- <textarea cols="36" rows="5" id="submit_text" name="submit_text" style="resize: vertical;">
3651
- <?php echo $row->submit_text; ?>
3652
- </textarea>
3653
- <?php
3654
- }
3655
- ?>
3656
- </td>
3657
- </tr>
3658
- <tr id="url" <?php echo (($row->submit_text_type != 4 ) ? 'style="display:none"' : ''); ?>>
3659
- <td class="fm_options_label">
3660
- <label for="url">URL</label>
3661
- </td>
3662
- <td class="fm_options_value">
3663
- <input type="text" id="url" name="url" style="width:300px" value="<?php echo $row->url; ?>" />
3664
  </td>
3665
  </tr>
3666
  </table>
@@ -3668,18 +2569,13 @@ class FMViewManage_fm {
3668
  <fieldset id="payment_fieldset" class="adminform fm_fieldset_deactive">
3669
  <legend style="color:#0B55C4;font-weight: bold;">Payment Options</legend>
3670
  <table class="admintable">
3671
- <tr>
3672
- <td colspan="2">
3673
- <div class="error_fm" style="padding: 5px; font-size: 14px;">Paypal Options are disabled in free version.</div>
3674
- </td>
3675
- </tr>
3676
  <tr valign="top">
3677
  <td class="fm_options_label">
3678
  <label>Turn Paypal On</label>
3679
  </td>
3680
  <td class="fm_options_value">
3681
- <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>
3682
- <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>
3683
  </td>
3684
  </tr>
3685
  <tr valign="top">
@@ -3687,8 +2583,8 @@ class FMViewManage_fm {
3687
  <label>Checkout Mode</label>
3688
  </td>
3689
  <td class="fm_options_value">
3690
- <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>
3691
- <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>
3692
  </td>
3693
  </tr>
3694
  <tr valign="top">
@@ -3696,7 +2592,7 @@ class FMViewManage_fm {
3696
  <label for="paypal_email">Paypal email</label>
3697
  </td>
3698
  <td class="fm_options_value">
3699
- <input disabled="disabled" type="text" name="paypal_email" id="paypal_email" value="<?php echo $row->paypal_email; ?>" class="text_area" style="width:250px">
3700
  </td>
3701
  </tr>
3702
  <tr valign="top">
@@ -3704,7 +2600,7 @@ class FMViewManage_fm {
3704
  <label for="payment_currency">Payment Currency</label>
3705
  </td>
3706
  <td class="fm_options_value">
3707
- <select disabled="disabled" id="payment_currency" name="payment_currency" style="width:253px">
3708
  <option value="USD" <?php echo (($row->payment_currency == 'USD') ? 'selected' : ''); ?>>$ &#8226; U.S. Dollar</option>
3709
  <option value="EUR" <?php echo (($row->payment_currency == 'EUR') ? 'selected' : ''); ?>>&#8364; &#8226; Euro</option>
3710
  <option value="GBP" <?php echo (($row->payment_currency == 'GBP') ? 'selected' : ''); ?>>&#163; &#8226; Pound Sterling</option>
@@ -3748,29 +2644,1202 @@ class FMViewManage_fm {
3748
  <td class="fm_options_label">
3749
  <label for="javascript">Javascript</label>
3750
  </td>
3751
- <td class="fm_options_value" style="width:650px;">
3752
- <textarea style="margin: 0px; height: 400px; width: 600px;" cols="60" rows="30" name="javascript" id="form_javascript"><?php echo $row->javascript; ?></textarea>
3753
  </td>
3754
  </tr>
3755
  </table>
3756
  </fieldset>
3757
- <fieldset id="conditions_fieldset" class="adminform fm_fieldset_deactive">
3758
- <legend style="color:#0B55C4;font-weight: bold;">Conditional Fields</legend>
3759
- <?php
3760
- $ids = array();
3761
- $types = array();
3762
- $labels = array();
3763
- $paramss = array();
3764
- $all_ids = array();
3765
- $all_labels = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3766
 
3767
  $select_and_input = array("type_text", "type_password", "type_textarea", "type_name", "type_number", "type_phone", "type_submitter_mail", "type_address", "type_spinner", "type_checkbox", "type_radio", "type_own_select", "type_paypal_price", "type_paypal_select", "type_paypal_checkbox", "type_paypal_radio", "type_paypal_shipping");
3768
  $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");
3769
 
3770
  $fields=explode('*:*new_field*:*',$row->form_fields);
3771
  $fields = array_slice($fields,0, count($fields)-1);
3772
- foreach($fields as $field)
3773
- {
3774
  $temp=explode('*:*id*:*',$field);
3775
  array_push($ids, $temp[0]);
3776
  array_push($all_ids, $temp[0]);
@@ -3783,10 +3852,8 @@ class FMViewManage_fm {
3783
 
3784
  }
3785
 
3786
- foreach($types as $key=>$value)
3787
- {
3788
- if(!in_array($types[$key],$select_and_input))
3789
- {
3790
  unset($ids[$key]);
3791
  unset($labels[$key]);
3792
  unset($types[$key]);
@@ -3799,12 +3866,11 @@ class FMViewManage_fm {
3799
  $types = array_values($types);
3800
  $paramss = array_values($paramss);
3801
 
3802
-
3803
  $chose_ids = implode('@@**@@',$ids);
3804
  $chose_labels = implode('@@**@@',$labels);
3805
  $chose_types = implode('@@**@@',$types);
3806
  $chose_paramss = implode('@@**@@',$paramss);
3807
-
3808
  $all_ids_cond = implode('@@**@@',$all_ids);
3809
  $all_labels_cond = implode('@@**@@',$all_labels);
3810
 
@@ -3814,14 +3880,12 @@ class FMViewManage_fm {
3814
  $condition_params = array();
3815
 
3816
  $count_of_conditions=0;
3817
- if($row->condition!="")
3818
- {
3819
  $conditions=explode('*:*new_condition*:*',$row->condition);
3820
  $conditions = array_slice($conditions,0, count($conditions)-1);
3821
  $count_of_conditions = count($conditions);
3822
 
3823
- foreach($conditions as $condition)
3824
- {
3825
  $temp=explode('*:*show_hide*:*',$condition);
3826
  array_push($show_hide, $temp[0]);
3827
  $temp=explode('*:*field_label*:*',$temp[1]);
@@ -3830,10 +3894,8 @@ class FMViewManage_fm {
3830
  array_push($all_any, $temp[0]);
3831
  array_push($condition_params, $temp[1]);
3832
  }
3833
-
3834
  }
3835
- else
3836
- {
3837
  $show_hide[0]=1;
3838
  $all_any[0]='and';
3839
  $condition_params[0]='';
@@ -3842,404 +3904,424 @@ class FMViewManage_fm {
3842
  }
3843
  ?>
3844
  <div>
3845
- <span style="font-size:13px;">Add Condition<span/>
3846
- <img src="<?php echo WD_FM_URL . '/images/add_condition.png'; ?>" title="add" onclick="add_condition('<?php echo $chose_ids; ?>', '<?php echo htmlspecialchars(addslashes($chose_labels)); ?>', '<?php echo $chose_types; ?>', '<?php echo htmlspecialchars(addslashes($chose_paramss)); ?>', '<?php echo $all_ids_cond; ?>', '<?php echo htmlspecialchars(addslashes($all_labels_cond)); ?>')" style="cursor: pointer; vertical-align: middle; margin-left:15px;">
 
 
3847
  </div>
3848
- <?php
3849
-
3850
- for($k=0; $k<$count_of_conditions; $k++)
3851
- {
3852
-
3853
- if(in_array($field_label[$k],$all_ids)) : ?>
3854
- <div id="condition<?php echo $k; ?>" >
3855
- <div id="conditional_fileds<?php echo $k; ?>">
3856
- <select id="show_hide<?php echo $k; ?>" name="show_hide<?php echo $k; ?>" style="width:80px; ">
3857
- <option value="1" <?php if($show_hide[$k]==1) echo 'selected="selected"'; ?>>show</option>
3858
- <option value="0" <?php if($show_hide[$k]==0) echo 'selected="selected"'; ?>>hide</option>
3859
- </select>
3860
-
3861
- <select id="fields<?php echo $k; ?>" name="fields<?php echo $k; ?>" style="width:400px; " onChange="" >
3862
- <?php
3863
- foreach($all_labels as $key => $value)
3864
- {
3865
- if($field_label[$k]==$all_ids[$key])
3866
- $selected = 'selected="selected"';
3867
- else
3868
- $selected ='';
3869
- echo '<option value="'.$all_ids[$key].'" '.$selected.'>'.$value.'</option>';
3870
- }
3871
-
3872
- ?>
3873
- </select>
3874
- <span>if</span>
3875
-
3876
- <select id="all_any<?php echo $k; ?>" name="all_any<?php echo $k; ?>" style="width:60px; ">
3877
- <option value="and" <?php if($all_any[$k]=="and") echo 'selected="selected"'; ?>>all</option>
3878
- <option value="or" <?php if($all_any[$k]=="or") echo 'selected="selected"'; ?>>any</option>
3879
- </select>
3880
-
3881
- <span>of the following match:</span>
3882
- <img src="<?php echo WD_FM_URL . '/images/add.png'; ?>" title="add" onclick="add_condition_fields(<?php echo $k; ?>,'<?php echo $chose_ids; ?>', '<?php echo htmlspecialchars(addslashes($chose_labels)); ?>', '<?php echo $chose_types; ?>', '<?php echo htmlspecialchars(addslashes($chose_paramss)); ?>')" style="cursor: pointer; vertical-align: middle;">
3883
-
3884
- <img src="<?php echo WD_FM_URL . '/images/page_delete.png'; ?>" onclick="delete_condition('<?php echo $k; ?>')" style="cursor: pointer; vertical-align: middle;">
3885
- </div>
3886
-
3887
- <?php
3888
-
3889
- if($condition_params[$k])
3890
- {
3891
- $_params =explode('*:*next_condition*:*',$condition_params[$k]);
3892
- $_params = array_slice($_params,0, count($_params)-1);
3893
-
3894
- foreach($_params as $key=>$_param)
3895
- {
3896
- $key_select_or_input ='';
3897
- $param_values = explode('***',$_param);
3898
- $multiselect = explode('@@@',$param_values[2]);
3899
-
3900
- if(in_array($param_values[0],$ids)): ?>
3901
- <div id="condition_div<?php echo $k; ?>_<?php echo $key; ?>">
3902
- <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 htmlspecialchars(addslashes($chose_paramss)); ?>')" style="width:350px;"/>
3903
- <?php
3904
- foreach($labels as $key1 => $value)
3905
- {
3906
- if($param_values[0]==$ids[$key1])
3907
- {
3908
- $selected = 'selected="selected"';
3909
- if ($types[$key1]=="type_checkbox" || $types[$key1]=="type_paypal_checkbox")
3910
- $multiple = 'multiple="multiple" class="multiple_select"';
3911
- else
3912
- $multiple ='';
3913
-
3914
- $key_select_or_input = $key1;
3915
- }
3916
- else
3917
- $selected ='';
3918
- if($field_label[$k]!=$ids[$key1])
3919
- echo '<option id="'.$k.'_'.$key1.'" value="'.$ids[$key1].'" '.$selected.'>'.$value.'</option>';
3920
-
3921
- }
3922
-
3923
- ?>
3924
- </select>
3925
 
3926
- <select id="is_select<?php echo $k; ?>_<?php echo $key; ?>" style="vertical-align: top;">
3927
- <option value="==" <?php if($param_values[1]=="==") echo 'selected="selected"'; ?>>is</option>
3928
- <option value="!=" <?php if($param_values[1]=="!=") echo 'selected="selected"'; ?>>is not</option>
3929
- <option value="%" <?php if($param_values[1]=="%") echo 'selected="selected"'; ?>>like</option>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3930
 
3931
- <option value="!%" <?php if($param_values[1]=="!%") echo 'selected="selected"'; ?>>not like</option>
3932
 
3933
- <option value="=" <?php if($param_values[1]=="=") echo 'selected="selected"'; ?>>empty</option>
3934
 
3935
- <option value="!" <?php if($param_values[1]=="!") echo 'selected="selected"'; ?>>not empty</option>
3936
 
3937
- </select>
3938
-
3939
- <?php if ($key_select_or_input !== '' && in_array($types[$key_select_or_input],$select_type_fields)) : ?>
3940
- <select id="field_value<?php echo $k; ?>_<?php echo $key; ?>" <?php echo $multiple; ?> style="vertical-align: top; width: 200px;">
3941
- <?php
3942
- switch($types[$key_select_or_input])
3943
- {
3944
- case "type_own_select":
3945
- case "type_paypal_select":
3946
- $w_size = explode('*:*w_size*:*',$paramss[$key_select_or_input]);
3947
- break;
3948
-
3949
- case "type_radio":
3950
- case "type_checkbox":
3951
- case "type_paypal_radio":
3952
- case "type_paypal_checkbox":
3953
- case "type_paypal_shipping":
3954
- $w_size = explode('*:*w_flow*:*',$paramss[$key_select_or_input]);
3955
- break;
3956
- }
3957
-
3958
- $w_choices = explode('*:*w_choices*:*',$w_size[1]);
3959
- $w_choices_array = explode('***',$w_choices[0]);
3960
-
3961
- $w_choices_price = explode('*:*w_choices_price*:*',$w_choices[1]);
3962
- $w_choices_price_array = explode('***',$w_choices_price[0]);
3963
- for($m=0; $m<count($w_choices_array); $m++)
3964
- {
3965
- if($types[$key_select_or_input]=="type_paypal_checkbox" || $types[$key_select_or_input]=="type_paypal_radio" || $types[$key_select_or_input]=="type_paypal_shipping" || $types[$key_select_or_input]=="type_paypal_select")
3966
- $w_choice = $w_choices_array[$m].'*:*value*:*'.$w_choices_price_array[$m];
3967
- else
3968
- $w_choice = $w_choices_array[$m];
3969
-
3970
- if(in_array(esc_html($w_choice),$multiselect))
3971
- {
3972
- $selected = 'selected="selected"';
3973
- }
3974
- else
3975
- $selected ='';
 
3976
 
3977
- if(strpos($w_choices_array[$m], '[') === false && strpos($w_choices_array[$m], ']') === false && strpos($w_choices_array[$m], ':') === false) {
3978
- echo '<option id="choise_'.$k.'_'.$m.'" value="'.$w_choice.'" '.$selected.'>'.$w_choices_array[$m].'</option>';
 
3979
  }
3980
- }
3981
-
3982
- if($types[$key_select_or_input]=="type_address")
3983
- {
3984
- $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","Colombia","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","Nepal","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");
3985
- $w_options = '';
3986
- foreach($w_countries as $w_country)
3987
  {
3988
- if(in_array($w_country,$multiselect))
 
 
3989
  {
3990
- $selected = 'selected="selected"';
3991
- }
3992
- else
3993
- $selected ='';
3994
-
3995
- echo '<option value="'.$w_country.'" '.$selected.'>'.$w_country.'</option>';
 
 
 
3996
  }
3997
- }
3998
-
3999
- ?>
4000
- </select>
4001
- <?php else :
4002
- if($key_select_or_input != '' && ($types[$key_select_or_input]=="type_number" || $types[$key_select_or_input]=="type_phone"))
4003
- $onkeypress_function = "onkeypress='return check_isnum_space(event)'";
4004
- else
4005
- if($key_select_or_input != '' && $types[$key_select_or_input]=="type_paypal_price")
4006
- $onkeypress_function = "onkeypress='return check_isnum_point(event)'";
4007
  else
4008
- $onkeypress_function = "";
4009
- ?>
4010
- <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; ?>
4011
-
4012
- <img src="<?php echo WD_FM_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;">
4013
- </div>
4014
- <?php endif;
 
 
 
 
4015
  }
4016
- }
4017
 
4018
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4019
  </div>
4020
- <?php endif;
4021
- }
4022
- ?>
4023
- <input type="hidden" id="condition" name="condition" value="<?php echo $row->condition; ?>" />
4024
-
4025
- </fieldset>
4026
-
4027
- <fieldset id="mapping_fieldset" class="adminform fm_fieldset_deactive">
4028
- <legend style="color:#0B55C4;font-weight: bold;">MySQL Mapping</legend>
4029
- <div>
4030
- <a href="<?php echo add_query_arg(array('action' => 'FormMakerSQLMapping', 'id' => 0, 'form_id' => $row->id, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" class="button-secondary thickbox thickbox-preview" id="add_query" title="Add Query" onclick="return false;">
4031
- Add Query
4032
- </a>
4033
- <button class="button-primary thickbox thickbox-preview" onclick="if (fm_check_email('mailToAdd') ||
4034
- fm_check_email('from_mail') ||
4035
- fm_check_email('reply_to') ||
4036
- fm_check_email('mail_from_user') ||
4037
- fm_check_email('reply_to_user') ||
4038
- fm_check_email('mail_from_other') ||
4039
- fm_check_email('reply_to_other') ||
4040
- fm_check_email('paypal_email')) {return false;}; set_condition(); fm_set_input_value('task', 'remove_query')">Delete</button>
4041
- </div>
4042
- <?php
4043
- if ($queries)
4044
- {
4045
- ?>
4046
- <table class="wp-list-table widefat fixed posts table_content">
4047
- <thead>
4048
- <tr>
4049
- <th style="width:4%;" class="table_small_col count_col sub-align">#</th>
4050
- <th style="width:4%;" class="table_small_col count_col sub-align">ID</th>
4051
- <th style="width:6%;" class="manage-column column-cb check-column table_small_col sub-align form_check">
4052
- <input id="check_all" type="checkbox" style="margin:0;">
4053
- </th>
4054
- <th style="width:86%;" class="table_large_col">Query</th>
4055
- </tr>
4056
- </thead>
4057
- <?php
4058
- $k = 0;
4059
- for($i=0, $n=count($queries); $i < $n ; $i++) {
4060
- $query = $queries[$i];
4061
- $checked = '<input type="checkbox" id="' . $i . '" name="cid[]" value="' . $query->id . '" />';
4062
- $link = add_query_arg(array('action' => 'FormMakerSQLMapping', 'id' => $query->id, 'form_id' => $row->id, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
4063
  ?>
4064
- <tr <?php if ($k) echo "class=\"alternate\""; ?>>
4065
- <td align="center" class="table_small_col"><?php echo $i+1; ?></td>
4066
- <td align="center" class="table_small_col"><?php echo $query->id; ?></td>
4067
- <td align="center" class="table_small_col check-column"><?php echo $checked; ?></td>
4068
- <td align="center"><a href="<?php echo $link; ?>" class="thickbox thickbox-preview" onclick="return false;"><?php echo $query->query; ?></a></td>
4069
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4070
  <?php
4071
- $k = 1 - $k;
4072
- }
4073
- ?>
4074
- </table>
4075
  <?php
4076
- }
 
 
 
 
 
 
4077
  ?>
4078
- </fieldset>
4079
- <input type="hidden" name="boxchecked" value="0">
4080
- <input type="hidden" name="fieldset_id" id="fieldset_id" value="<?php echo WDW_FM_Library::get('fieldset_id', 'general'); ?>" />
4081
-
4082
- <input type="hidden" id="task" name="task" value=""/>
4083
- <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
4084
- </form>
4085
- <script>
4086
- jQuery(window).load(function () {
4087
- form_maker_options_tabs(jQuery("#fieldset_id").val());
4088
- fm_popup();
4089
- function hide_email_labels(event) {
4090
- var e = event.toElement || event.relatedTarget;
4091
- if (e.parentNode == this || e == this) {
4092
- return;
4093
- }
4094
- this.style.display="none";
4095
- }
4096
- if(document.getElementById('mail_from_labels')) {
4097
- document.getElementById('mail_from_labels').addEventListener('mouseout',hide_email_labels,true);
4098
- }
4099
- if(document.getElementById('mail_subject_labels')) {
4100
- document.getElementById('mail_subject_labels').addEventListener('mouseout',hide_email_labels,true);
4101
- }
4102
- if(document.getElementById('mail_from_name_user_labels')) {
4103
- document.getElementById('mail_from_name_user_labels').addEventListener('mouseout',hide_email_labels,true);
4104
- }
4105
- if(document.getElementById('mail_subject_user_labels')) {
4106
- document.getElementById('mail_subject_user_labels').addEventListener('mouseout',hide_email_labels,true);
4107
- }
4108
- });
4109
- function wd_fm_apply_options() {
4110
- set_condition();
4111
- fm_set_input_value('task', 'apply_options');
4112
- document.getElementById('adminForm').submit();
4113
- }
4114
- </script>
4115
- <?php
4116
- }
 
 
 
 
 
 
 
 
 
 
 
4117
 
4118
- public function form_layout($id) {
4119
- $row = $this->model->get_row_data($id);
4120
- $ids = array();
4121
- $types = array();
4122
- $labels = array();
4123
- $fields = explode('*:*new_field*:*', $row->form_fields);
4124
- $fields = array_slice($fields, 0, count($fields) - 1);
4125
- foreach ($fields as $field) {
4126
- $temp = explode('*:*id*:*', $field);
4127
- array_push($ids, $temp[0]);
4128
- $temp = explode('*:*type*:*', $temp[1]);
4129
- array_push($types, $temp[0]);
4130
- $temp = explode('*:*w_field_label*:*', $temp[1]);
4131
- array_push($labels, $temp[0]);
4132
- }
4133
  ?>
4134
- <script>
4135
- var form_front = '<?php echo addslashes($row->form_front);?>';
4136
- var custom_front = '<?php echo addslashes($row->custom_front);?>';
4137
- if (custom_front == '') {
4138
- custom_front = form_front;
4139
- }
4140
- function submitbutton() {
4141
- if (jQuery('#autogen_layout').is(':checked')) {
4142
- jQuery('#custom_front').val(custom_front.replace(/\s+/g, ' ').replace(/> </g, '><'));
4143
- }
4144
- else {
4145
- jQuery('#custom_front').val(editor.getValue().replace(/\s+/g, ' ').replace(/> </g, '><'));
4146
- }
4147
- }
4148
- function insertAtCursor_form(myId, myLabel) {
4149
- if (jQuery('#autogen_layout').is(':checked')) {
4150
- alert("Uncheck the Auto-Generate Layout box.");
4151
- return;
4152
- }
4153
- myValue = '<div wdid="' + myId + '" class="wdform_row">%' + myId + ' - ' + myLabel + '%</div>';
4154
- line = editor.getCursor().line;
4155
- ch = editor.getCursor().ch;
4156
- text = editor.getLine(line);
4157
- text1 = text.substr(0, ch);
4158
- text2 = text.substr(ch);
4159
- text = text1 + myValue + text2;
4160
- editor.setLine(line, text);
4161
- editor.focus();
4162
- }
4163
- function autogen(status) {
4164
- if (status) {
4165
- custom_front = editor.getValue();
4166
- editor.setValue(form_front);
4167
- editor.setOption('readOnly', true);
4168
- autoFormat();
4169
- }
4170
- else {
4171
- editor.setValue(custom_front);
4172
- editor.setOption('readOnly', false);
4173
- autoFormat();
4174
- }
4175
- }
4176
- function autoFormat() {
4177
- CodeMirror.commands["selectAll"](editor);
4178
- editor.autoFormatRange(editor.getCursor(true), editor.getCursor(false));
4179
- editor.scrollTo(0,0);
4180
- }
4181
- </script>
4182
-
4183
- <div class="fm_layout" style="width: 99%;">
4184
- <form action="admin.php?page=manage_fm" method="post" name="adminForm" enctype="multipart/form-data">
4185
- <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
4186
- <div class="buttons_div">
4187
- <input class="button-secondary" type="submit" onclick="submitbutton(); fm_set_input_value('task', 'save_layout')" value="Save"/>
4188
- <input class="button-secondary" type="submit" onclick="submitbutton(); fm_set_input_value('task', 'apply_layout')" value="Apply"/>
4189
- <input class="button-secondary" type="submit" onclick="fm_set_input_value('task', 'cancel_options')" value="Cancel"/>
4190
- </div>
4191
- <h2 style="clear: both;">Description</h2>
4192
- <p>To customize the layout of the form fields uncheck the Auto-Generate Layout box and edit the HTML.</p>
4193
- <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:
4194
- <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>
4195
- , where <b><span class="cm-tag">&lt;div&gt;</span></b> is used to set a row.</p>
4196
- <p>To return to the default settings you should check Auto-Generate Layout box.</p>
4197
- <h3 style="color:red">Notice</h3>
4198
- <p>Make sure not to publish the same field twice. This will cause malfunctioning of the form.</p>
4199
- <hr/>
4200
- <label for="autogen_layout" style="font-size: 20px; line-height: 45px; margin-left: 10px;">Auto Generate Layout? </label>
4201
- <input type="checkbox" value="1" name="autogen_layout" id="autogen_layout" <?php echo (($row->autogen_layout) ? 'checked="checked"' : ''); ?> />
4202
- <input type="hidden" name="custom_front" id="custom_front" value="" />
4203
 
4204
- <input type="hidden" id="task" name="task" value=""/>
4205
- <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
4206
- </form>
4207
- <br/>
4208
- <?php
4209
- foreach($ids as $key => $id) {
4210
- if ($types[$key] != "type_section_break") {
4211
- ?>
4212
- <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>
4213
- <?php
4214
- }
4215
- }
4216
- ?>
4217
- <br /><br />
4218
- <button class="fm_submit_layout button button-secondary button-hero" onclick="autoFormat()"><strong>Apply Source Formatting</strong> <em>(ctrl-enter)</em></button>
4219
- <textarea id="source" name="source" style="display: none;"></textarea>
4220
- </div>
4221
- <script>
4222
- var editor = CodeMirror.fromTextArea(document.getElementById("source"), {
4223
- lineNumbers: true,
4224
- lineWrapping: true,
4225
- mode: "htmlmixed",
4226
- value: form_front
4227
- });
4228
- if (jQuery('#autogen_layout').is(':checked')) {
4229
- editor.setOption('readOnly', true);
4230
- editor.setValue(form_front);
4231
- }
4232
- else {
4233
- editor.setOption('readOnly', false);
4234
- editor.setValue(custom_front);
4235
- }
4236
- jQuery('#autogen_layout').click(function() {
4237
- autogen(jQuery(this).is(':checked'));
4238
- });
4239
- autoFormat();
4240
- </script>
4241
- <?php
4242
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4243
 
4244
  ////////////////////////////////////////////////////////////////////////////////////////
4245
  // Getters & Setters //
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']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
31
+ $order_by_array = array('id', 'title', 'mail');
32
+ $order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
33
+ $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
34
+ $ids_string = '';
35
+ ?>
36
+ <div class="fm-user-manual">
37
+ This section allows you to create, edit forms.
38
+ <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-2.html">Read More in User Manual</a>
39
+ </div>
40
+ <div class="fm-upgrade-pro">
41
+ <a target="_blank" href="https://web-dorado.com/files/fromFormMaker.php">
42
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
43
+ </a>
44
+ </div>
45
+ <div class="fm-clear"></div>
46
+ <form onkeypress="fm_doNothing(event)" class="wrap" id="manage_form" method="post" action="admin.php?page=manage_fm" style="width:99%;">
47
+ <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
48
+ <div class="fm-page-banner">
49
+ <div class="fm-logo">
50
+ </div>
51
+ <div class="fm-logo-title">Form</br>Maker</div>
52
+ <button class="fm-button add-button medium" onclick="fm_set_input_value('task', 'add'); fm_form_submit(event, 'manage_form')">
53
+ <span></span>
54
+ Add New
55
+ </button>
56
+ </div>
57
+ <div class="tablenav top">
58
+ <?php
59
+ WDW_FM_Library::search('Title', $search_value, 'manage_form');
60
+ WDW_FM_Library::html_page_nav($page_nav['total'], $page_nav['limit'], 'manage_form');
61
+ ?>
62
+ </div>
63
+ <table class="wp-list-table widefat fixed pages">
64
+ <thead>
65
+ <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin:0;"/></th>
66
+ <th class="table_small_col <?php if ($order_by == 'id') { echo $order_class; } ?>">
67
+ <a onclick="fm_set_input_value('task', ''); fm_set_input_value('order_by', 'id'); fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'id' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>'); fm_form_submit(event, 'manage_form')" href="">
68
+ <span>ID</span><span class="sorting-indicator"></span></a>
69
+ </th>
70
+ <th class="<?php if ($order_by == 'title') { echo $order_class; } ?>">
71
+ <a onclick="fm_set_input_value('task', ''); fm_set_input_value('order_by', 'title'); fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'title' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>'); fm_form_submit(event, 'manage_form')" href="">
72
+ <span>Title</span><span class="sorting-indicator"></span></a>
73
+ </th>
74
+ <th class="<?php if ($order_by == 'mail') { echo $order_class; } ?>">
75
+ <a onclick="fm_set_input_value('task', ''); fm_set_input_value('order_by', 'mail'); fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'mail' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>'); fm_form_submit(event, 'manage_form')" href="">
76
+ <span>Email to send submissions to</span><span class="sorting-indicator"></span></a>
77
+ </th>
78
+ <th class="table_big_col">Shortcode</th>
79
+ <th class="table_large_col">PHP function</th>
80
+ <th class="table_small_col">Edit</th>
81
+ <th class="table_small_col">
82
+ <a title="Delete selected items" href="" onclick="if (confirm('Do you want to delete selected items?')) { fm_set_input_value('task', 'delete_all'); fm_form_submit(event, 'manage_form'); } else { return false; }">Delete</a>
83
+ </th>
84
+ </thead>
85
+ <tbody id="tbody_arr">
86
+ <?php
87
+ if ($rows_data) {
88
+ foreach ($rows_data as $row_data) {
89
+ $alternate = (!isset($alternate) || $alternate == '') ? 'class="alternate"' : '';
90
+ $old = '';
91
+ if (isset($row_data->form) && ($row_data->form != '')) {
92
+ $old = '_old';
93
+ }
94
+ ?>
95
+ <tr id="tr_<?php echo $row_data->id; ?>" <?php echo $alternate; ?>>
96
+ <td class="table_small_col check-column">
97
+ <input id="check_<?php echo $row_data->id; ?>" name="check_<?php echo $row_data->id; ?>" type="checkbox"/>
98
+ </td>
99
+ <td class="table_small_col"><?php echo $row_data->id; ?></td>
100
+ <td>
101
+ <a onclick="fm_set_input_value('task', 'edit<?php echo $old; ?>'); fm_set_input_value('current_id', '<?php echo $row_data->id; ?>'); fm_form_submit(event, 'manage_form')" href="" title="Edit"><?php echo $row_data->title; ?></a>
102
+ </td>
103
+ <td><?php echo $row_data->mail; ?></td>
104
+ <td class="table_big_col" style="padding-left: 0; padding-right: 0;">
105
+ <input type="text" value='[Form id="<?php echo $row_data->id; ?>"]' onclick="fm_select_value(this)" size="12" readonly="readonly" style="padding-left: 1px; padding-right: 1px;"/>
106
+ </td>
107
+ <td class="table_large_col" style="padding-left: 0; padding-right: 0;">
108
+ <input type="text" value='&#60;?php wd_form_maker(<?php echo $row_data->id; ?>); ?&#62;' onclick="fm_select_value(this)" readonly="readonly" style="padding-left: 1px; padding-right: 1px;"/>
109
+ </td>
110
+ <td class="table_small_col">
111
+ <button class="fm-icon edit-icon" onclick="fm_set_input_value('task', 'edit<?php echo $old; ?>'); fm_set_input_value('current_id', '<?php echo $row_data->id; ?>'); fm_form_submit(event, 'manage_form')">
112
+ <span></span>
113
+ </button>
114
+ </td>
115
+ <td class="table_small_col">
116
+ <button class="fm-icon delete-icon" onclick="if (confirm('Do you want to delete selected item(s)?')) { fm_set_input_value('task', 'delete'); fm_set_input_value('current_id', '<?php echo $row_data->id; ?>'); fm_form_submit(event, 'manage_form'); } else { return false; }">
117
+ <span></span>
118
+ </button>
119
+ </td>
120
+ </tr>
121
+ <?php
122
+ $ids_string .= $row_data->id . ',';
123
+ }
124
+ }
125
+ ?>
126
+ </tbody>
127
+ </table>
128
+ <input id="task" name="task" type="hidden" value=""/>
129
+ <input id="current_id" name="current_id" type="hidden" value=""/>
130
+ <input id="ids_string" name="ids_string" type="hidden" value="<?php echo $ids_string; ?>"/>
131
+ <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="asc"/>
132
+ <input id="order_by" name="order_by" type="hidden" value="<?php echo $order_by; ?>"/>
133
+ </form>
134
+ <?php
135
+ }
136
 
137
+ public function edit($id) {
138
+ $row = $this->model->get_row_data_new($id);
139
+ $themes = $this->model->get_theme_rows_data();
140
+ $labels = array();
141
+ $label_id = array();
142
+ $label_order_original = array();
143
+ $label_type = array();
144
+ $label_all = explode('#****#', $row->label_order);
145
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
146
+ foreach ($label_all as $key => $label_each) {
147
+ $label_id_each = explode('#**id**#', $label_each);
148
+ array_push($label_id, $label_id_each[0]);
149
+ $label_oder_each = explode('#**label**#', $label_id_each[1]);
150
+ array_push($label_order_original, addslashes($label_oder_each[0]));
151
+ array_push($label_type, $label_oder_each[1]);
152
+ }
153
+ $labels['id'] = '"' . implode('","', $label_id) . '"';
154
+ $labels['label'] = '"' . implode('","', $label_order_original) . '"';
155
+ $labels['type'] = '"' . implode('","', $label_type) . '"';
156
+ $page_title = (($id != 0) ? 'Edit form ' . $row->title : 'Create new form');
157
+ ?>
158
+ <script type="text/javascript">
159
+ var plugin_url = "<?php echo WD_FM_URL; ?>";
160
+ </script>
161
+ <script src="<?php echo WD_FM_URL . '/js/formmaker_div_free.js'; ?>?ver=<?php echo get_option("wd_form_maker_version"); ?>" type="text/javascript"></script>
162
+ <script type="text/javascript">
163
+ form_view = 1;
164
+ form_view_count = 1;
165
+ form_view_max = 1;
166
+ function submitbutton() {
167
+ <?php if ($id) { ?>
168
+ if (!document.getElementById('araqel') || (document.getElementById('araqel').value == '0')) {
169
+ alert('Please wait while page loading.');
170
+ return false;
171
+ }
172
+ <?php } ?>
173
+ tox = '';
174
+ form_fields = '';
175
+ document.getElementById('take').style.display = "none";
176
+ document.getElementById('page_bar').style.display = "none";
177
+ jQuery('#saving').html('<div class="fm-loading-container"><div class="fm-loading-content"></div></div>');
178
+ jQuery('.wdform_section').each(function() {
179
+ var this2 = this;
180
+ jQuery(this2).find('.wdform_column').each(function() {
181
+ if(!jQuery(this).html() && jQuery(this2).children().length>1)
182
+ jQuery(this).remove();
183
+ });
184
+ });
185
+ remove_whitespace(document.getElementById('take'));
186
+ l_id_array = [<?php echo $labels['id']?>];
187
+ l_label_array = [<?php echo $labels['label']?>];
188
+ l_type_array = [<?php echo $labels['type']?>];
189
+ l_id_removed = [];
190
+ for (x = 0; x < l_id_array.length; x++) {
191
+ l_id_removed[l_id_array[x]] = true;
192
+ }
193
+ for (t = 1; t <= form_view_max; t++) {
194
+ if (document.getElementById('form_id_tempform_view' + t)) {
195
+ wdform_page = document.getElementById('form_id_tempform_view' + t);
196
+ remove_whitespace(wdform_page);
197
+ n = wdform_page.childNodes.length - 2;
198
+ for (q = 0; q <= n; q++) {
199
+ if (!wdform_page.childNodes[q].getAttribute("wdid")) {
200
+ wdform_section = wdform_page.childNodes[q];
201
+ for (x = 0; x < wdform_section.childNodes.length; x++) {
202
+ wdform_column = wdform_section.childNodes[x];
203
+ if (wdform_column.firstChild) {
204
+ for (y=0; y < wdform_column.childNodes.length; y++) {
205
+ is_in_old = false;
206
+ wdform_row = wdform_column.childNodes[y];
207
+ if (wdform_row.nodeType == 3) {
208
+ continue;
209
+ }
210
+ wdid = wdform_row.getAttribute("wdid");
211
+ if (!wdid) {
212
+ continue;
213
+ }
214
+ l_id = wdid;
215
+ l_label = document.getElementById(wdid + '_element_labelform_id_temp').innerHTML;
216
+ l_label = l_label.replace(/(\r\n|\n|\r)/gm," ");
217
+ wdtype = wdform_row.firstChild.getAttribute('type');
218
+
219
+ for (var z = 0; z < l_id_array.length; z++) {
220
+ if (l_type_array[z] == "type_address") {
221
+ if (document.getElementById(l_id + "_mini_label_street1") || document.getElementById(l_id + "_mini_label_street2") || document.getElementById(l_id + "_mini_label_city") || document.getElementById(l_id + "_mini_label_state") || document.getElementById(l_id+"_mini_label_postal") || document.getElementById(l_id+"_mini_label_country")) {
222
+ l_id_removed[l_id_array[z]] = false;
223
+ }
224
+ }
225
+ else {
226
+ if (l_id_array[z] == wdid) {
227
+ l_id_removed[l_id] = false;
228
+ }
229
+ }
230
+
231
+ }
232
+
233
+ if (wdtype == "type_address") {
234
+ addr_id = parseInt(wdid);
235
+ id_for_country = addr_id;
236
+ if (document.getElementById(id_for_country + "_mini_label_street1"))
237
+ tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_street1").innerHTML + '#**label**#type_address#****#';
238
+ addr_id++;
239
+ if (document.getElementById(id_for_country + "_mini_label_street2"))
240
+ tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_street2").innerHTML + '#**label**#type_address#****#';
241
+ addr_id++;
242
+ if (document.getElementById(id_for_country+"_mini_label_city"))
243
+ tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_city").innerHTML + '#**label**#type_address#****#';
244
+ addr_id++;
245
+ if (document.getElementById(id_for_country + "_mini_label_state"))
246
+ tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_state").innerHTML + '#**label**#type_address#****#';
247
+ addr_id++;
248
+ if (document.getElementById(id_for_country + "_mini_label_postal"))
249
+ tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_postal").innerHTML + '#**label**#type_address#****#';
250
+ addr_id++;
251
+ if (document.getElementById(id_for_country+"_mini_label_country")) {
252
+ tox=tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_country").innerHTML + '#**label**#type_address#****#';
253
+ }
254
+
255
+ }
256
+ else {
257
+ tox = tox + wdid + '#**id**#' + l_label + '#**label**#' + wdtype + '#****#';
258
+ }
259
+
260
+ id = wdid;
261
+ form_fields += wdid + "*:*id*:*";
262
+ form_fields += wdtype + "*:*type*:*";
263
+ w_choices = new Array();
264
+ w_choices_value=new Array();
265
+ w_choices_checked = new Array();
266
+ w_choices_disabled = new Array();
267
+ w_choices_params =new Array();
268
+ w_allow_other_num = 0;
269
+ w_property = new Array();
270
+ w_property_type = new Array();
271
+ w_property_values = new Array();
272
+ w_choices_price = new Array();
273
+ if (document.getElementById(id+'_element_labelform_id_temp').innerHTML) {
274
+ w_field_label = document.getElementById(id + '_element_labelform_id_temp').innerHTML.replace(/(\r\n|\n|\r)/gm," ");
275
+ }
276
+ else {
277
+ w_field_label = " ";
278
+ }
279
+ if (document.getElementById(id + '_label_sectionform_id_temp')) {
280
+ if (document.getElementById(id + '_label_sectionform_id_temp').style.display == "block") {
281
+ w_field_label_pos = "top";
282
+ }
283
+ else {
284
+ w_field_label_pos = "left";
285
+ }
286
+ }
287
+ if (document.getElementById(id + "_elementform_id_temp")) {
288
+ s = document.getElementById(id + "_elementform_id_temp").style.width;
289
+ w_size=s.substring(0,s.length - 2);
290
+ }
291
+ if (document.getElementById(id + "_label_sectionform_id_temp")) {
292
+ s = document.getElementById(id + "_label_sectionform_id_temp").style.width;
293
+ w_field_label_size = s.substring(0, s.length - 2);
294
+ }
295
+ if (document.getElementById(id + "_requiredform_id_temp")) {
296
+ w_required = document.getElementById(id + "_requiredform_id_temp").value;
297
+ }
298
+ if (document.getElementById(id + "_uniqueform_id_temp")) {
299
+ w_unique = document.getElementById(id + "_uniqueform_id_temp").value;
300
+ }
301
+ if (document.getElementById(id + '_label_sectionform_id_temp')) {
302
+ w_class = document.getElementById(id + '_label_sectionform_id_temp').getAttribute("class");
303
+ if (!w_class) {
304
+ w_class = "";
305
+ }
306
+ }
307
+ gen_form_fields();
308
+ wdform_row.innerHTML = "%" + id + " - " + l_label + "%";
309
+ }
310
+ }
311
+ }
312
+ }
313
+ else {
314
+ id = wdform_page.childNodes[q].getAttribute("wdid");
315
+ w_editor = document.getElementById(id + "_element_sectionform_id_temp").innerHTML;
316
+ form_fields += id + "*:*id*:*";
317
+ form_fields += "type_section_break" + "*:*type*:*";
318
+ form_fields += "custom_" + id + "*:*w_field_label*:*";
319
+ form_fields += w_editor + "*:*w_editor*:*";
320
+ form_fields += "*:*new_field*:*";
321
+ wdform_page.childNodes[q].innerHTML = "%" + id + " - " + "custom_" + id + "%";
322
+ }
323
+ }
324
+ }
325
+ }
326
+ document.getElementById('label_order_current').value = tox;
327
+
328
+ for (x = 0; x < l_id_array.length; x++) {
329
+ if (l_id_removed[l_id_array[x]]) {
330
+ tox = tox + l_id_array[x] + '#**id**#' + l_label_array[x] + '#**label**#' + l_type_array[x] + '#****#';
331
+ }
332
+ }
333
+
334
+ document.getElementById('label_order').value = tox;
335
+ document.getElementById('form_fields').value = form_fields;
336
+ refresh_();
337
+ document.getElementById('pagination').value=document.getElementById('pages').getAttribute("type");
338
+ document.getElementById('show_title').value=document.getElementById('pages').getAttribute("show_title");
339
+ document.getElementById('show_numbers').value=document.getElementById('pages').getAttribute("show_numbers");
340
+ return true;
341
+ }
342
+
343
+ gen = <?php echo (($id != 0) ? $row->counter : 1); ?>;
344
+
345
+ function enable() {
346
+ alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
347
+ for (x = 0; x < 14; x++) {
348
+ document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FM_URL . '/images/'; ?>" + alltypes[x] + ".png?ver=<?php echo get_option("wd_form_maker_version"); ?>";
349
+ }
350
+ if (document.getElementById('formMakerDiv').style.display == 'block') {
351
+ jQuery('#formMakerDiv').slideToggle(200);
352
+ }
353
+ else {
354
+ jQuery('#formMakerDiv').slideToggle(400);
355
+ }
356
+ if (document.getElementById('formMakerDiv').offsetWidth) {
357
+ document.getElementById('formMakerDiv1').style.width = (document.getElementById('formMakerDiv').offsetWidth - 60) + 'px';
358
+ }
359
+ if (document.getElementById('formMakerDiv1').style.display == 'block') {
360
+ jQuery('#formMakerDiv1').slideToggle(200);
361
+ }
362
+ else {
363
+ jQuery('#formMakerDiv1').slideToggle(400);
364
+ }
365
+ document.getElementById('when_edit').style.display = 'none';
366
+ }
367
+
368
+ function enable2() {
369
+ alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
370
+ for (x = 0; x < 14; x++) {
371
+ document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FM_URL . '/images/'; ?>" + alltypes[x] + ".png?ver=<?php echo get_option("wd_form_maker_version"); ?>";
372
+ }
373
+ if (document.getElementById('formMakerDiv').style.display == 'block') {
374
+ jQuery('#formMakerDiv').slideToggle(200);
375
+ }
376
+ else {
377
+ jQuery('#formMakerDiv').slideToggle(400);
378
+ }
379
+ if (document.getElementById('formMakerDiv').offsetWidth) {
380
+ document.getElementById('formMakerDiv1').style.width = (document.getElementById('formMakerDiv').offsetWidth - 60) + 'px';
381
+ }
382
+ if (document.getElementById('formMakerDiv1').style.display == 'block') {
383
+ jQuery('#formMakerDiv1').slideToggle(200);
384
+ }
385
+ else {
386
+ jQuery('#formMakerDiv1').slideToggle(400);
387
+ }
388
+ document.getElementById('when_edit').style.display = 'block';
389
+ if (document.getElementById('field_types').offsetWidth) {
390
+ document.getElementById('when_edit').style.width = document.getElementById('field_types').offsetWidth + 'px';
391
+ }
392
+ if (document.getElementById('field_types').offsetHeight) {
393
+ document.getElementById('when_edit').style.height = document.getElementById('field_types').offsetHeight + 'px';
394
+ }
395
+ }
396
+ </script>
397
+ <div class="fm-user-manual">
398
+ This section allows you to add fields to your form.
399
+ <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-4.html">Read More in User Manual</a>
400
+ </div>
401
+ <div class="fm-upgrade-pro">
402
+ <a target="_blank" href="https://web-dorado.com/files/fromFormMaker.php">
403
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
404
+ </a>
405
+ </div>
406
+ <div class="fm-clear"></div>
407
+ <form class="wrap" id="manage_form" method="post" action="admin.php?page=manage_fm" style="width:99%;">
408
+ <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
409
+ <h2></h2>
410
+ <div class="fm-page-header">
411
+ <!-- <div class="fm-page-title">
412
+ <?php echo $page_title; ?>
413
+ </div> -->
414
+ <div class="fm-page-actions">
415
+ <?php
416
+ if(isset($row->backup_id) )
417
+ if($row->backup_id!="") {
418
+ global $wpdb;
419
+ $query = "SELECT backup_id FROM " . $wpdb->prefix . "formmaker_backup WHERE backup_id > ".$row->backup_id." AND id = ".$row->id." ORDER BY backup_id ASC LIMIT 0 , 1 ";
420
+ $backup_id = $wpdb->get_var($query);
421
+ if($backup_id) { ?>
422
+ <button class="fm-button redo-button small" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; jQuery('#saving_text').html('Redo');fm_set_input_value('task', 'redo');">
423
+ <span></span>
424
+ Redo
425
+ </button>
426
+ <?php
427
+ }
428
+ $query = "SELECT backup_id FROM " . $wpdb->prefix . "formmaker_backup WHERE backup_id < ".$row->backup_id." AND id = ".$row->id." ORDER BY backup_id DESC LIMIT 0 , 1 ";
429
+ $backup_id = $wpdb->get_var($query);
430
+
431
+ if($backup_id) { ?>
432
+ <button class="fm-button undo-button small" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; jQuery('#saving_text').html('Undo');fm_set_input_value('task', 'undo');">
433
+ <span></span>
434
+ Undo
435
+ </button>
436
+ <?php
437
+ }
438
+ }
439
+ ?>
440
+ <button class="fm-button form-options-button medium" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'form_options');">
441
+ <span></span>
442
+ Form Options
443
+ </button>
444
+ <button class="fm-button form-layout-button medium" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'form_layout');">
445
+ <span></span>
446
+ Form Layout
447
+ </button>
448
+ <?php if ($id) { ?>
449
+ <button class="fm-button save-as-copy-button medium" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'save_as_copy');">
450
+ <span></span>
451
+ Save as Copy
452
+ </button>
453
+ <?php } ?>
454
+ <button class="fm-button save-button small" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'save');">
455
+ <span></span>
456
+ Save
457
+ </button>
458
+ <button class="fm-button apply-button small" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'apply');">
459
+ <span></span>
460
+ Apply
461
+ </button>
462
+ <button class="fm-button cancel-button small" onclick="fm_set_input_value('task', 'cancel');">
463
+ <span></span>
464
+ Cancel
465
+ </button>
466
+ </div>
467
+ <div class="fm-clear"></div>
468
+ </div>
469
+
470
+ <div class="fm-page-banner">
471
+ <div class="fm-logo">
472
+ </div>
473
+ <div class="fm-logo-title">Form</br>Maker</div>
474
+ <div style="float:right; text-align:right;">
475
+ <div class="fm-title">
476
+ <span style="">Form title:&nbsp;</span>
477
+ <input id="title" name="title" value="<?php echo $row->title; ?>"/>
478
+ </div>
479
+ <div>
480
+ <button class="fm-button banner-form-options-button large" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'form_options'); fm_form_submit(event, 'manage_form');">
481
+ Form Options
482
+ <span></span>
483
+ </button>
484
+ <button class="fm-button add-button large" onclick="enable(); Enable(); return false;">
485
+ Add a New Field
486
+ <span></span>
487
+ </button>
488
+ </div>
489
+ </div>
490
+ <div class="fm-clear"></div>
491
+ </div>
492
+ <br/>
493
+ <div class="fm-theme-banner">
494
+ <div>
495
+ <div class="fm-title">
496
+ <span style="">Theme:&nbsp;</span>
497
+ <select id="theme" name="theme" onChange="set_preview()">
498
+ <?php
499
+
500
+ foreach ($themes as $theme) {
501
+ ?>
502
+ <option value="<?php echo $theme->id; ?>" <?php echo (($theme->id == $row->theme) ? 'selected' : ''); ?>><?php echo $theme->title; ?></option>
503
+ <?php
504
+ }
505
+ ?>
506
+ </select>
507
+ <button id="preview_form" class="fm-button preview-button small" onclick="tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerPreview', 'form_id' => $row->id, 'test_theme' => $row->theme, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>'); return false;">
508
+ <span></span>
509
+ Preview
510
+ </button>
511
+ <button id="edit_css" class="fm-button options-edit-button small" onclick="tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerEditCSS', 'id' => $row->theme, 'form_id' => $row->id, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>'); return false;">
512
+ <span></span>
513
+ Edit CSS
514
+ </button>
515
+ </div>
516
+ </div>
517
+ </div>
518
+ <div id="formMakerDiv" onclick="close_window()"></div>
519
+ <div id="formMakerDiv1">
520
+ <table class="formMakerDiv1_table" border="0" width="100%" cellpadding="0" cellspacing="0" height="100%">
521
+ <tr>
522
+ <td style="padding:0px">
523
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%" >
524
+ <tr valign="top">
525
+ <td width="20%" height="100%" id="field_types">
526
+ <div id="when_edit" style="display: none;"></div>
527
+ <table border="0" cellpadding="0" cellspacing="3" width="100%" style="border-collapse: separate; border-spacing: 3px;">
528
+ <tbody>
529
+ <tr>
530
+ <td align="center" onclick="addRow('customHTML')" class="field_buttons" id="table_editor">
531
+ <img src="<?php echo WD_FM_URL; ?>/images/customHTML.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_customHTML">
532
+ <div>Custom HTML</div>
533
+ </td>
534
+ <td align="center" onclick="addRow('text')" class="field_buttons" id="table_text">
535
+ <img src="<?php echo WD_FM_URL; ?>/images/text.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_text">
536
+ <div>Text input</div>
537
+ </td>
538
+ </tr>
539
+ <tr>
540
+ <td align="center" onclick="addRow('checkbox')" class="field_buttons" id="table_checkbox">
541
+ <img src="<?php echo WD_FM_URL; ?>/images/checkbox.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_checkbox">
542
+ <div>Multiple Choice</div>
543
+ </td>
544
+ <td align="center" onclick="addRow('radio')" class="field_buttons" id="table_radio">
545
+ <img src="<?php echo WD_FM_URL; ?>/images/radio.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_radio">
546
+ <div>Single Choice</div>
547
+ </td>
548
+ </tr>
549
+ <tr>
550
+ <td align="center" onclick="addRow('survey')" class="field_buttons" id="table_survey">
551
+ <img src="<?php echo WD_FM_URL; ?>/images/survey.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_survey">
552
+ <div>Survey Tools</div>
553
+ </td>
554
+ <td align="center" onclick="addRow('time_and_date')" class="field_buttons" id="table_time_and_date">
555
+ <img src="<?php echo WD_FM_URL; ?>/images/time_and_date.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_time_and_date">
556
+ <div>Time and Date</div>
557
+ </td>
558
+ </tr>
559
+ <tr>
560
+ <td align="center" onclick="addRow('select')" class="field_buttons" id="table_select">
561
+ <img src="<?php echo WD_FM_URL; ?>/images/select.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_select">
562
+ <div>Select Box</div>
563
+ </td>
564
+ <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.')" class="field_buttons field_disabled" id="table_file_upload">
565
+ <img src="<?php echo WD_FM_URL; ?>/images/file_upload.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_file_upload">
566
+ <div>File Upload</div>
567
+ </td>
568
+ </tr>
569
+ <tr>
570
+ <td align="center" onclick="addRow('section_break')" class="field_buttons" id="table_section_break">
571
+ <img src="<?php echo WD_FM_URL; ?>/images/section_break.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_section_break">
572
+ <div>Section Break</div>
573
+ </td>
574
+ <td align="center" onclick="addRow('page_break')" class="field_buttons" id="table_page_break">
575
+ <img src="<?php echo WD_FM_URL; ?>/images/page_break.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_page_break">
576
+ <div>Page Break</div>
577
+ </td>
578
+ </tr>
579
+ <tr>
580
+ <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.')" class="field_buttons field_disabled" id="table_map">
581
+ <img src="<?php echo WD_FM_URL; ?>/images/map.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_map">
582
+ <div>Map</div>
583
+ </td>
584
+ <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.')" id="table_paypal" class="field_buttons field_disabled">
585
+ <img src="<?php echo WD_FM_URL; ?>/images/paypal.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_paypal">
586
+ <div>PayPal</div>
587
+ </td>
588
+ </tr>
589
+ <tr>
590
+ <td align="center" onclick="addRow('captcha')" class="field_buttons" id="table_captcha">
591
+ <img src="<?php echo WD_FM_URL; ?>/images/captcha.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_captcha">
592
+ <div>Captcha</div>
593
+ </td>
594
+ <td align="center" onclick="addRow('button')" id="table_button" class="field_buttons">
595
+ <img src="<?php echo WD_FM_URL; ?>/images/button.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_button">
596
+ <div>Button</div>
597
+ </td>
598
+ </tr>
599
+ </tbody>
600
+ </table>
601
+ </td>
602
+ <td width="40%" height="100%" align="left">
603
+ <div id="edit_table"></div>
604
+ </td>
605
+ <td align="center" valign="top" style="background: url("<?php echo WD_FM_URL . '/images/border2.png'; ?>") repeat-y;">&nbsp;</td>
606
+ <td style="padding:15px;">
607
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%" >
608
+ <tr>
609
+ <td align="right">
610
+ <input type="radio" value="end" name="el_pos" checked="checked" id="pos_end" onclick="Disable()"/>
611
+ At The End
612
+ <input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
613
+ At The Beginning
614
+ <input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
615
+ Before
616
+ <select style="width: 100px; margin-left: 5px;" id="sel_el_pos" onclick="change_before()" disabled="disabled"></select>
617
+ <br>
618
+ <button class="fm-button field-save-button small" onclick="add(0, false); return false;">
619
+ Save
620
+ <span></span>
621
+ </button>
622
+ <button class="fm-button cancel-button small" onclick="close_window(); return false;">
623
+ Cancel
624
+ <span></span>
625
+ </button>
626
+ <hr style="margin-bottom:10px" />
627
+ </td>
628
+ </tr>
629
+ <tr height="100%" valign="top">
630
+ <td id="show_table"></td>
631
+ </tr>
632
+ </table>
633
+ </td>
634
+ </tr>
635
+ </table>
636
+ </td>
637
+ </tr>
638
+ </table>
639
+ <input type="hidden" id="old" />
640
+ <input type="hidden" id="old_selected" />
641
+ <input type="hidden" id="element_type" />
642
+ <input type="hidden" id="editing_id" />
643
+ <input type="hidden" value="<?php echo WD_FM_URL; ?>" id="form_plugins_url" />
644
+ <div id="main_editor" style="position: fixed; display: none; z-index: 140;">
645
+ <?php if (user_can_richedit()) {
646
+ wp_editor('', 'form_maker_editor', array('teeny' => FALSE, 'textarea_name' => 'form_maker_editor', 'media_buttons' => FALSE, 'textarea_rows' => 5));
647
+ }
648
+ else { ?>
649
+ <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>
650
+ <?php
651
+ }
652
+ ?>
653
+ </div>
654
+ </div>
655
+ <?php if (!function_exists('the_editor')) { ?>
656
+ <iframe id="tinymce" style="display: none;"></iframe>
657
+ <?php } ?>
658
+
659
+ <div class="fm-edit-content">
660
+ <div class="fm-drag-and-drop">
661
+ <div>
662
+ <label for="enable_sortable">Enable Drag & Drop</label>
663
+ <button name="sortable" id="enable_sortable" class="fm-checkbox-radio-button <?php echo $row->sortable == 1 ? 'fm-yes' : 'fm-no' ?>" onclick="enable_drag(this); return false;" value="<?php echo $row->sortable; ?>">
664
+ <span></span>
665
+ </button>
666
+ <input type="hidden" name="sortable" id="sortable_hidden" value="<?php echo $row->sortable; ?>"/>
667
+ </div>
668
+ <div>
669
+ You can use drag and drop to move the fields up/down for the change of the order and left/right for creating columns within the form.
670
+ </div>
671
+ </div>
672
+ <fieldset>
673
+ <legend></legend>
674
+ <?php if ($id) { ?>
675
+ <div style="margin: 8px; display: table; width: 100%;" id="page_bar">
676
+ <div id="page_navigation" style="display: table-row;">
677
+ <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>
678
+ <div align="left" id="edit_page_navigation" style="display: table-cell; vertical-align: middle;"></div>
679
+ </div>
680
+ </div>
681
+ <div id="take" class="main">
682
+ <?php echo $row->form_front; ?>
683
+ </div>
684
+ <?php } else { ?>
685
+ <div style="margin:8px; display:table; width:100%" id="page_bar">
686
+ <div id="page_navigation" style="display:table-row">
687
+ <div align="center" id="pages" show_title="false" show_numbers="true" type="none" style="display:table-cell; width:90%"></div>
688
+ <div align="left" id="edit_page_navigation" style="display:table-cell; vertical-align: middle;"></div>
689
+ </div>
690
+ </div>
691
+ <div id="take" class="main">
692
+ <div class="wdform-page-and-images" style="display:table; border-top:0px solid black;">
693
+ <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">
694
+ <div class="wdform_section">
695
+ <div class="wdform_column"></div>
696
+ </div>
697
+ <div valign="top" class="wdform_footer" style="width: 100%;">
698
+ <div style="width: 100%;">
699
+ <div style="width: 100%; display: table; padding-top:10px;">
700
+ <div style="display: table-row-group;">
701
+ <div id="form_id_temppage_nav1" style="display: table-row;"></div>
702
+ </div>
703
+ </div>
704
+ </div>
705
+ </div>
706
+ </div>
707
+ <div id="form_id_tempform_view_img1" style="float: right;">
708
+ <div>
709
+ <img src="<?php echo WD_FM_URL . '/images/minus.png?ver='. get_option("wd_form_maker_version"); ?>" 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"/>
710
+ <img src="<?php echo WD_FM_URL . '/images/page_delete.png?ver='. get_option("wd_form_maker_version"); ?>" 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')"/>
711
+ <img src="<?php echo WD_FM_URL . '/images/page_delete_all.png?ver='. get_option("wd_form_maker_version"); ?>" 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')"/>
712
+ <img src="<?php echo WD_FM_URL . '/images/page_edit.png?ver='. get_option("wd_form_maker_version"); ?>" 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')"/>
713
+ </div>
714
+ </div>
715
+ </div>
716
+ </div>
717
+ <?php } ?>
718
+ </fieldset>
719
+ </div>
720
+ <input type="hidden" name="form_front" id="form_front" />
721
+ <input type="hidden" name="form_fields" id="form_fields" />
722
+ <input type="hidden" name="pagination" id="pagination" />
723
+ <input type="hidden" name="show_title" id="show_title" />
724
+ <input type="hidden" name="show_numbers" id="show_numbers" />
725
+ <input type="hidden" name="public_key" id="public_key" />
726
+ <input type="hidden" name="private_key" id="private_key" />
727
+ <input type="hidden" name="recaptcha_theme" id="recaptcha_theme" />
728
+ <input type="hidden" id="label_order" name="label_order" value="<?php echo $row->label_order; ?>" />
729
+ <input type="hidden" id="label_order_current" name="label_order_current" value="<?php echo $row->label_order_current; ?>" />
730
+ <input type="hidden" name="counter" id="counter" value="<?php echo $row->counter; ?>" />
731
+ <input type="hidden" id="araqel" value="0" />
732
+ <input type="hidden" name="backup_id" id="backup_id" value="<?php echo $row->backup_id;?>">
733
+
734
+ <?php if ($id) { ?>
735
+ <script type="text/javascript">
736
+ function set_preview() {
737
+ jQuery("#preview_form").attr("onclick", "tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerPreview', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&test_theme=" + jQuery('#theme').val() + "&width=1000&height=500&TB_iframe=1'); return false;");
738
+ jQuery("#edit_css").attr("onclick", "tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerEditCSS', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&id=" + jQuery('#theme').val() + "&width=800&height=500&TB_iframe=1'); return false;");
739
+ }
740
+ function formOnload() {
741
+ for (t = 0; t < <?php echo $row->counter; ?>; t++) {
742
+ if (document.getElementById(t + "_typeform_id_temp")) {
743
+ if (document.getElementById(t + "_typeform_id_temp").value == "type_map" || document.getElementById(t + "_typeform_id_temp").value == "type_mark_map") {
744
+ if_gmap_init(t);
745
+ for (q = 0; q < 20; q++) {
746
+ if (document.getElementById(t + "_elementform_id_temp").getAttribute("long" + q)) {
747
+ w_long = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("long" + q));
748
+ w_lat = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("lat" + q));
749
+ w_info = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("info" + q));
750
+ add_marker_on_map(t, q, w_long, w_lat, w_info, false);
751
+ }
752
+ }
753
+ }
754
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_date") {
755
+ // Calendar.setup({
756
+ // inputField:t + "_elementform_id_temp",
757
+ // ifFormat:document.getElementById(t + "_buttonform_id_temp").getAttribute('format'),
758
+ // button:t + "_buttonform_id_temp",
759
+ // align:"Tl",
760
+ // singleClick:true,
761
+ // firstDay:0
762
+ // });
763
+ }
764
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_name") {
765
+ var myu = t;
766
+ jQuery(document).ready(function () {
767
+ jQuery("#" + myu + "_mini_label_first").click(function () {
768
+ if (jQuery(this).children('input').length == 0) {
769
+ var first = "<input type='text' id='first' class='first' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
770
+ jQuery(this).html(first);
771
+ jQuery("input.first").focus();
772
+ jQuery("input.first").blur(function () {
773
+ var id_for_blur = document.getElementById('first').parentNode.id.split('_');
774
+ var value = jQuery(this).val();
775
+ jQuery("#" + id_for_blur[0] + "_mini_label_first").text(value);
776
+ });
777
+ }
778
+ });
779
+ jQuery("label#" + myu + "_mini_label_last").click(function () {
780
+ if (jQuery(this).children('input').length == 0) {
781
+ var last = "<input type='text' id='last' class='last' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
782
+ jQuery(this).html(last);
783
+ jQuery("input.last").focus();
784
+ jQuery("input.last").blur(function () {
785
+ var id_for_blur = document.getElementById('last').parentNode.id.split('_');
786
+ var value = jQuery(this).val();
787
+ jQuery("#" + id_for_blur[0] + "_mini_label_last").text(value);
788
+ });
789
+ }
790
+ });
791
+ jQuery("label#" + myu + "_mini_label_title").click(function () {
792
+ if (jQuery(this).children('input').length == 0) {
793
+ var title_ = "<input type='text' id='title_' class='title_' style='outline:none; border:none; background:none; width:50px;' value=\"" + jQuery(this).text() + "\">";
794
+ jQuery(this).html(title_);
795
+ jQuery("input.title_").focus();
796
+ jQuery("input.title_").blur(function () {
797
+ var id_for_blur = document.getElementById('title_').parentNode.id.split('_');
798
+ var value = jQuery(this).val();
799
+ jQuery("#" + id_for_blur[0] + "_mini_label_title").text(value);
800
+ });
801
+ }
802
+ });
803
+ jQuery("label#" + myu + "_mini_label_middle").click(function () {
804
+ if (jQuery(this).children('input').length == 0) {
805
+ var middle = "<input type='text' id='middle' class='middle' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
806
+ jQuery(this).html(middle);
807
+ jQuery("input.middle").focus();
808
+ jQuery("input.middle").blur(function () {
809
+ var id_for_blur = document.getElementById('middle').parentNode.id.split('_');
810
+ var value = jQuery(this).val();
811
+ jQuery("#" + id_for_blur[0] + "_mini_label_middle").text(value);
812
+ });
813
+ }
814
+ });
815
+ });
816
+ }
817
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_phone") {
818
+ var myu = t;
819
+ jQuery(document).ready(function () {
820
+ jQuery("label#" + myu + "_mini_label_area_code").click(function () {
821
+ if (jQuery(this).children('input').length == 0) {
822
+ 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() + "\">";
823
+ jQuery(this).html(area_code);
824
+ jQuery("input.area_code").focus();
825
+ jQuery("input.area_code").blur(function () {
826
+ var id_for_blur = document.getElementById('area_code').parentNode.id.split('_');
827
+ var value = jQuery(this).val();
828
+ jQuery("#" + id_for_blur[0] + "_mini_label_area_code").text(value);
829
+ });
830
+ }
831
+ });
832
+ jQuery("label#" + myu + "_mini_label_phone_number").click(function () {
833
+ if (jQuery(this).children('input').length == 0) {
834
+ var phone_number = "<input type='text' id='phone_number' class='phone_number' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
835
+ jQuery(this).html(phone_number);
836
+ jQuery("input.phone_number").focus();
837
+ jQuery("input.phone_number").blur(function () {
838
+ var id_for_blur = document.getElementById('phone_number').parentNode.id.split('_');
839
+ var value = jQuery(this).val();
840
+ jQuery("#" + id_for_blur[0] + "_mini_label_phone_number").text(value);
841
+ });
842
+ }
843
+ });
844
+ });
845
+ }
846
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_date_fields") {
847
+ var myu = t;
848
+ jQuery(document).ready(function () {
849
+ jQuery("label#" + myu + "_day_label").click(function () {
850
+ if (jQuery(this).children('input').length == 0) {
851
+ var day = "<input type='text' id='day' class='day' size='8' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
852
+ jQuery(this).html(day);
853
+ jQuery("input.day").focus();
854
+ jQuery("input.day").blur(function () {
855
+ var id_for_blur = document.getElementById('day').parentNode.id.split('_');
856
+ var value = jQuery(this).val();
857
+ jQuery("#" + id_for_blur[0] + "_day_label").text(value);
858
+ });
859
+ }
860
+ });
861
+ jQuery("label#" + myu + "_month_label").click(function () {
862
+ if (jQuery(this).children('input').length == 0) {
863
+ var month = "<input type='text' id='month' class='month' size='8' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
864
+ jQuery(this).html(month);
865
+ jQuery("input.month").focus();
866
+ jQuery("input.month").blur(function () {
867
+ var id_for_blur = document.getElementById('month').parentNode.id.split('_');
868
+ var value = jQuery(this).val();
869
+ jQuery("#" + id_for_blur[0] + "_month_label").text(value);
870
+ });
871
+ }
872
+ });
873
+ jQuery("label#" + myu + "_year_label").click(function () {
874
+ if (jQuery(this).children('input').length == 0) {
875
+ var year = "<input type='text' id='year' class='year' size='8' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
876
+ jQuery(this).html(year);
877
+ jQuery("input.year").focus();
878
+ jQuery("input.year").blur(function () {
879
+ var id_for_blur = document.getElementById('year').parentNode.id.split('_');
880
+ var value = jQuery(this).val();
881
+ jQuery("#" + id_for_blur[0] + "_year_label").text(value);
882
+ });
883
+ }
884
+ });
885
+ });
886
+ }
887
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_time") {
888
+ var myu = t;
889
+ jQuery(document).ready(function () {
890
+ jQuery("label#" + myu + "_mini_label_hh").click(function () {
891
+ if (jQuery(this).children('input').length == 0) {
892
+ var hh = "<input type='text' id='hh' class='hh' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
893
+ jQuery(this).html(hh);
894
+ jQuery("input.hh").focus();
895
+ jQuery("input.hh").blur(function () {
896
+ var id_for_blur = document.getElementById('hh').parentNode.id.split('_');
897
+ var value = jQuery(this).val();
898
+ jQuery("#" + id_for_blur[0] + "_mini_label_hh").text(value);
899
+ });
900
+ }
901
+ });
902
+ jQuery("label#" + myu + "_mini_label_mm").click(function () {
903
+ if (jQuery(this).children('input').length == 0) {
904
+ var mm = "<input type='text' id='mm' class='mm' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
905
+ jQuery(this).html(mm);
906
+ jQuery("input.mm").focus();
907
+ jQuery("input.mm").blur(function () {
908
+ var id_for_blur = document.getElementById('mm').parentNode.id.split('_');
909
+ var value = jQuery(this).val();
910
+ jQuery("#" + id_for_blur[0] + "_mini_label_mm").text(value);
911
+ });
912
+ }
913
+ });
914
+ jQuery("label#" + myu + "_mini_label_ss").click(function () {
915
+ if (jQuery(this).children('input').length == 0) {
916
+ var ss = "<input type='text' id='ss' class='ss' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
917
+ jQuery(this).html(ss);
918
+ jQuery("input.ss").focus();
919
+ jQuery("input.ss").blur(function () {
920
+ var id_for_blur = document.getElementById('ss').parentNode.id.split('_');
921
+ var value = jQuery(this).val();
922
+ jQuery("#" + id_for_blur[0] + "_mini_label_ss").text(value);
923
+ });
924
+ }
925
+ });
926
+ jQuery("label#" + myu + "_mini_label_am_pm").click(function () {
927
+ if (jQuery(this).children('input').length == 0) {
928
+ 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() + "\">";
929
+ jQuery(this).html(am_pm);
930
+ jQuery("input.am_pm").focus();
931
+ jQuery("input.am_pm").blur(function () {
932
+ var id_for_blur = document.getElementById('am_pm').parentNode.id.split('_');
933
+ var value = jQuery(this).val();
934
+ jQuery("#" + id_for_blur[0] + "_mini_label_am_pm").text(value);
935
+ });
936
+ }
937
+ });
938
+ });
939
+ }
940
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_paypal_price") {
941
+ var myu = t;
942
+ jQuery(document).ready(function () {
943
+ jQuery("#" + myu + "_mini_label_dollars").click(function () {
944
+ if (jQuery(this).children('input').length == 0) {
945
+ var dollars = "<input type='text' id='dollars' class='dollars' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
946
+ jQuery(this).html(dollars);
947
+ jQuery("input.dollars").focus();
948
+ jQuery("input.dollars").blur(function () {
949
+ var id_for_blur = document.getElementById('dollars').parentNode.id.split('_');
950
+ var value = jQuery(this).val();
951
+ jQuery("#" + id_for_blur[0] + "_mini_label_dollars").text(value);
952
+ });
953
+ }
954
+ });
955
+ jQuery("label#" + myu + "_mini_label_cents").click(function () {
956
+ if (jQuery(this).children('input').length == 0) {
957
+ var cents = "<input type='text' id='cents' class='cents' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
958
+ jQuery(this).html(cents);
959
+ jQuery("input.cents").focus();
960
+ jQuery("input.cents").blur(function () {
961
+ var id_for_blur = document.getElementById('cents').parentNode.id.split('_');
962
+ var value = jQuery(this).val();
963
+ jQuery("#" + id_for_blur[0] + "_mini_label_cents").text(value);
964
+ });
965
+ }
966
+ });
967
+ });
968
+ }
969
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_address") {
970
+ var myu = t;
971
+ jQuery(document).ready(function () {
972
+ jQuery("label#" + myu + "_mini_label_street1").click(function () {
973
+ if (jQuery(this).children('input').length == 0) {
974
+ var street1 = "<input type='text' id='street1' class='street1' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
975
+ jQuery(this).html(street1);
976
+ jQuery("input.street1").focus();
977
+ jQuery("input.street1").blur(function () {
978
+ var id_for_blur = document.getElementById('street1').parentNode.id.split('_');
979
+ var value = jQuery(this).val();
980
+ jQuery("#" + id_for_blur[0] + "_mini_label_street1").text(value);
981
+ });
982
+ }
983
+ });
984
+ jQuery("label#" + myu + "_mini_label_street2").click(function () {
985
+ if (jQuery(this).children('input').length == 0) {
986
+ var street2 = "<input type='text' id='street2' class='street2' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
987
+ jQuery(this).html(street2);
988
+ jQuery("input.street2").focus();
989
+ jQuery("input.street2").blur(function () {
990
+ var id_for_blur = document.getElementById('street2').parentNode.id.split('_');
991
+ var value = jQuery(this).val();
992
+ jQuery("#" + id_for_blur[0] + "_mini_label_street2").text(value);
993
+ });
994
+ }
995
+ });
996
+ jQuery("label#" + myu + "_mini_label_city").click(function () {
997
+ if (jQuery(this).children('input').length == 0) {
998
+ var city = "<input type='text' id='city' class='city' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
999
+ jQuery(this).html(city);
1000
+ jQuery("input.city").focus();
1001
+ jQuery("input.city").blur(function () {
1002
+ var id_for_blur = document.getElementById('city').parentNode.id.split('_');
1003
+ var value = jQuery(this).val();
1004
+ jQuery("#" + id_for_blur[0] + "_mini_label_city").text(value);
1005
+ });
1006
+ }
1007
+ });
1008
+ jQuery("label#" + myu + "_mini_label_state").click(function () {
1009
+ if (jQuery(this).children('input').length == 0) {
1010
+ var state = "<input type='text' id='state' class='state' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
1011
+ jQuery(this).html(state);
1012
+ jQuery("input.state").focus();
1013
+ jQuery("input.state").blur(function () {
1014
+ var id_for_blur = document.getElementById('state').parentNode.id.split('_');
1015
+ var value = jQuery(this).val();
1016
+ jQuery("#" + id_for_blur[0] + "_mini_label_state").text(value);
1017
+ });
1018
+ }
1019
+ });
1020
+ jQuery("label#" + myu + "_mini_label_postal").click(function () {
1021
+ if (jQuery(this).children('input').length == 0) {
1022
+ var postal = "<input type='text' id='postal' class='postal' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
1023
+ jQuery(this).html(postal);
1024
+ jQuery("input.postal").focus();
1025
+ jQuery("input.postal").blur(function () {
1026
+ var id_for_blur = document.getElementById('postal').parentNode.id.split('_');
1027
+ var value = jQuery(this).val();
1028
+ jQuery("#" + id_for_blur[0] + "_mini_label_postal").text(value);
1029
+ });
1030
+ }
1031
+ });
1032
+ jQuery("label#" + myu + "_mini_label_country").click(function () {
1033
+ if (jQuery(this).children('input').length == 0) {
1034
+ var country = "<input type='country' id='country' class='country' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
1035
+ jQuery(this).html(country);
1036
+ jQuery("input.country").focus();
1037
+ jQuery("input.country").blur(function () {
1038
+ var id_for_blur = document.getElementById('country').parentNode.id.split('_');
1039
+ var value = jQuery(this).val();
1040
+ jQuery("#" + id_for_blur[0] + "_mini_label_country").text(value);
1041
+ });
1042
+ }
1043
+ });
1044
+ });
1045
+ }
1046
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_scale_rating") {
1047
+ var myu = t;
1048
+ jQuery(document).ready(function () {
1049
+ jQuery("#" + myu + "_mini_label_worst").click(function () {
1050
+ if (jQuery(this).children('input').length == 0) {
1051
+ 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() + "\">";
1052
+ jQuery(this).html(worst);
1053
+ jQuery("input.worst").focus();
1054
+ jQuery("input.worst").blur(function () {
1055
+ var id_for_blur = document.getElementById('worst').parentNode.id.split('_');
1056
+ var value = jQuery(this).val();
1057
+ jQuery("#" + id_for_blur[0] + "_mini_label_worst").text(value);
1058
+ });
1059
+ }
1060
+ });
1061
+ jQuery("label#" + myu + "_mini_label_best").click(function () {
1062
+ if (jQuery(this).children('input').length == 0) {
1063
+ 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() + "\">";
1064
+ jQuery(this).html(best);
1065
+ jQuery("input.best").focus();
1066
+ jQuery("input.best").blur(function () {
1067
+ var id_for_blur = document.getElementById('best').parentNode.id.split('_');
1068
+ var value = jQuery(this).val();
1069
+ jQuery("#" + id_for_blur[0] + "_mini_label_best").text(value);
1070
+ });
1071
+ }
1072
+ });
1073
+ });
1074
+ }
1075
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_spinner") {
1076
+ var spinner_value = document.getElementById(t + "_elementform_id_temp").value;
1077
+ var spinner_min_value = document.getElementById(t + "_min_valueform_id_temp").value;
1078
+ var spinner_max_value = document.getElementById(t + "_max_valueform_id_temp").value;
1079
+ var spinner_step = document.getElementById(t + "_stepform_id_temp").value;
1080
+ jQuery("#" + t + "_elementform_id_temp")[0].spin = null;
1081
+ spinner = jQuery("#" + t + "_elementform_id_temp").spinner();
1082
+ spinner.spinner("value", spinner_value);
1083
+ jQuery("#" + t + "_elementform_id_temp").spinner({ min:spinner_min_value});
1084
+ jQuery("#" + t + "_elementform_id_temp").spinner({ max:spinner_max_value});
1085
+ jQuery("#" + t + "_elementform_id_temp").spinner({ step:spinner_step});
1086
+ }
1087
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_slider") {
1088
+ var slider_value = document.getElementById(t + "_slider_valueform_id_temp").value;
1089
+ var slider_min_value = document.getElementById(t + "_slider_min_valueform_id_temp").value;
1090
+ var slider_max_value = document.getElementById(t + "_slider_max_valueform_id_temp").value;
1091
+ var slider_element_value = document.getElementById(t + "_element_valueform_id_temp");
1092
+ var slider_value_save = document.getElementById(t + "_slider_valueform_id_temp");
1093
+ jQuery("#" + t + "_elementform_id_temp")[0].slide = null;
1094
+ jQuery(function () {
1095
+ jQuery("#" + t + "_elementform_id_temp").slider({
1096
+ range:"min",
1097
+ value:eval(slider_value),
1098
+ min:eval(slider_min_value),
1099
+ max:eval(slider_max_value),
1100
+ slide:function (event, ui) {
1101
+ slider_element_value.innerHTML = "" + ui.value;
1102
+ slider_value_save.value = "" + ui.value;
1103
+ }
1104
+ });
1105
+ });
1106
+ }
1107
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_range") {
1108
+ var spinner_value0 = document.getElementById(t + "_elementform_id_temp0").value;
1109
+ var spinner_step = document.getElementById(t + "_range_stepform_id_temp").value;
1110
+ jQuery("#" + t + "_elementform_id_temp0")[0].spin = null;
1111
+ jQuery("#" + t + "_elementform_id_temp1")[0].spin = null;
1112
+ spinner0 = jQuery("#" + t + "_elementform_id_temp0").spinner();
1113
+ spinner0.spinner("value", spinner_value0);
1114
+ jQuery("#" + t + "_elementform_id_temp0").spinner({ step:spinner_step});
1115
+ var spinner_value1 = document.getElementById(t + "_elementform_id_temp1").value;
1116
+ spinner1 = jQuery("#" + t + "_elementform_id_temp1").spinner();
1117
+ spinner1.spinner("value", spinner_value1);
1118
+ jQuery("#" + t + "_elementform_id_temp1").spinner({ step:spinner_step});
1119
+ var myu = t;
1120
+ jQuery(document).ready(function () {
1121
+ jQuery("#" + myu + "_mini_label_from").click(function () {
1122
+ if (jQuery(this).children('input').length == 0) {
1123
+ 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() + "\">";
1124
+ jQuery(this).html(from);
1125
+ jQuery("input.from").focus();
1126
+ jQuery("input.from").blur(function () {
1127
+ var id_for_blur = document.getElementById('from').parentNode.id.split('_');
1128
+ var value = jQuery(this).val();
1129
+ jQuery("#" + id_for_blur[0] + "_mini_label_from").text(value);
1130
+ });
1131
+ }
1132
+ });
1133
+ jQuery("label#" + myu + "_mini_label_to").click(function () {
1134
+ if (jQuery(this).children('input').length == 0) {
1135
+ 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() + "\">";
1136
+ jQuery(this).html(to);
1137
+ jQuery("input.to").focus();
1138
+ jQuery("input.to").blur(function () {
1139
+ var id_for_blur = document.getElementById('to').parentNode.id.split('_');
1140
+ var value = jQuery(this).val();
1141
+ jQuery("#" + id_for_blur[0] + "_mini_label_to").text(value);
1142
+ });
1143
+ }
1144
+ });
1145
+ });
1146
+ }
1147
+ }
1148
+ }
1149
+
1150
+ remove_whitespace(document.getElementById('take'));
1151
+ form_view = 1;
1152
+ form_view_count = 0;
1153
+
1154
+ for (i = 1; i <= 30; i++) {
1155
+ if (document.getElementById('form_id_tempform_view' + i)) {
1156
+ form_view_count++;
1157
+ form_view_max = i;
1158
+ tbody_img = document.createElement('div');
1159
+ tbody_img.setAttribute('id', 'form_id_tempform_view_img' + i);
1160
+ tbody_img.style.cssText = "float:right";
1161
+ tr_img = document.createElement('div');
1162
+ var img = document.createElement('img');
1163
+ img.setAttribute('src', '<?php echo WD_FM_URL; ?>/images/minus.png?ver=<?php echo get_option("wd_form_maker_version"); ?>');
1164
+ img.setAttribute('title', 'Show or hide the page');
1165
+ img.setAttribute("class", "page_toolbar");
1166
+ img.setAttribute('id', 'show_page_img_' + i);
1167
+ img.setAttribute('onClick', 'show_or_hide("' + i + '")');
1168
+ img.setAttribute("onmouseover", 'chnage_icons_src(this,"minus")');
1169
+ img.setAttribute("onmouseout", 'chnage_icons_src(this,"minus")');
1170
+ var img_X = document.createElement("img");
1171
+ img_X.setAttribute("src", "<?php echo WD_FM_URL; ?>/images/page_delete.png?ver=<?php echo get_option("wd_form_maker_version"); ?>");
1172
+ img_X.setAttribute('title', 'Delete the page');
1173
+ img_X.setAttribute("class", "page_toolbar");
1174
+ img_X.setAttribute("onclick", 'remove_page("' + i + '")');
1175
+ img_X.setAttribute("onmouseover", 'chnage_icons_src(this,"page_delete")');
1176
+ img_X.setAttribute("onmouseout", 'chnage_icons_src(this,"page_delete")');
1177
+ var img_X_all = document.createElement("img");
1178
+ img_X_all.setAttribute("src", "<?php echo WD_FM_URL; ?>/images/page_delete_all.png?ver=<?php echo get_option("wd_form_maker_version"); ?>");
1179
+ img_X_all.setAttribute('title', 'Delete the page with fields');
1180
+ img_X_all.setAttribute("class", "page_toolbar");
1181
+ img_X_all.setAttribute("onclick", 'remove_page_all("' + i + '")');
1182
+ img_X_all.setAttribute("onmouseover", 'chnage_icons_src(this,"page_delete_all")');
1183
+ img_X_all.setAttribute("onmouseout", 'chnage_icons_src(this,"page_delete_all")');
1184
+ var img_EDIT = document.createElement("img");
1185
+ img_EDIT.setAttribute("src", "<?php echo WD_FM_URL; ?>/images/page_edit.png?ver=<?php echo get_option("wd_form_maker_version"); ?>");
1186
+ img_EDIT.setAttribute('title', 'Edit the page');
1187
+ img_EDIT.setAttribute("class", "page_toolbar");
1188
+ img_EDIT.setAttribute("onclick", 'edit_page_break("' + i + '")');
1189
+ img_EDIT.setAttribute("onmouseover", 'chnage_icons_src(this,"page_edit")');
1190
+ img_EDIT.setAttribute("onmouseout", 'chnage_icons_src(this,"page_edit")');
1191
+ tr_img.appendChild(img);
1192
+ tr_img.appendChild(img_X);
1193
+ tr_img.appendChild(img_X_all);
1194
+ tr_img.appendChild(img_EDIT);
1195
+ tbody_img.appendChild(tr_img);
1196
+ document.getElementById('form_id_tempform_view' + i).parentNode.appendChild(tbody_img);
1197
+ }
1198
+ }
1199
+
1200
+ if (form_view_count > 1) {
1201
+ for (i = 1; i <= form_view_max; i++) {
1202
+ if (document.getElementById('form_id_tempform_view' + i)) {
1203
+ first_form_view = i;
1204
+ break;
1205
+ }
1206
+ }
1207
+ form_view = form_view_max;
1208
+ need_enable = false;
1209
+ generate_page_nav(first_form_view);
1210
+ var img_EDIT = document.createElement("img");
1211
+ img_EDIT.setAttribute("src", "<?php echo WD_FM_URL . '/images/edit.png?ver='.get_option("wd_form_maker_version"); ?>");
1212
+ img_EDIT.style.cssText = "margin-left:40px; cursor:pointer";
1213
+ img_EDIT.setAttribute("onclick", 'el_page_navigation()');
1214
+ var td_EDIT = document.getElementById("edit_page_navigation");
1215
+ td_EDIT.appendChild(img_EDIT);
1216
+ document.getElementById('page_navigation').appendChild(td_EDIT);
1217
+ }
1218
+ document.getElementById('araqel').value = 1;
1219
+ }
1220
+ jQuery(window).load(function () {
1221
+ formOnload();
1222
+ });
1223
+ jQuery(function() {
1224
+ jQuery('.wdform_section .wdform_column:last-child').each(function() {
1225
+ jQuery(this).parent().append(jQuery('<div></div>').addClass("wdform_column"));
1226
+ });
1227
+
1228
+ sortable_columns();
1229
+ if(<?php echo $row->sortable ?>==1) {
1230
+ jQuery( ".wdform_arrows" ).hide();
1231
+ all_sortable_events();
1232
+ }
1233
+ else
1234
+ jQuery('.wdform_column').sortable( "disable" );
1235
+
1236
+ });
1237
+ </script>
1238
+ <?php
1239
+ } else { ?>
1240
+ <script type="text/javascript">
1241
+ jQuery(function() {
1242
+ jQuery('.wdform_section .wdform_column:last-child').each(function() {
1243
+ jQuery(this).parent().append(jQuery('<div></div>').addClass("wdform_column"));
1244
+ });
1245
+ sortable_columns();
1246
+ all_sortable_events();
1247
+ });
1248
+ </script>
1249
+ <?php } ?>
1250
+ <input type="hidden" name="option" value="com_formmaker" />
1251
+ <input type="hidden" name="id" value="<?php echo $row->id; ?>" />
1252
+ <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
1253
+ <input type="hidden" id="task" name="task" value=""/>
1254
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
1255
+ </form>
1256
+ <?php
1257
+ }
1258
 
1259
+ public function edit_old($id) {
1260
  // header("X-XSS-Protection: 0");
1261
+ $row = $this->model->get_row_data($id);
1262
+ $themes = $this->model->get_theme_rows_data('old');
1263
  $labels = array();
1264
  $label_id = array();
1265
  $label_order_original = array();
1276
  $labels['id'] = '"' . implode('","', $label_id) . '"';
1277
  $labels['label'] = '"' . implode('","', $label_order_original) . '"';
1278
  $labels['type'] = '"' . implode('","', $label_type) . '"';
1279
+
1280
  $page_title = (($id != 0) ? 'Edit form ' . $row->title : 'Create new form');
1281
  ?>
1282
  <script type="text/javascript">
1283
  var plugin_url = "<?php echo WD_FM_URL; ?>";
1284
  </script>
1285
+ <script src="<?php echo WD_FM_URL . '/js/formmaker_free.js'; ?>?ver=<?php echo get_option("wd_form_maker_version"); ?>" type="text/javascript"></script>
1286
  <script type="text/javascript">
 
 
 
1287
  function submitbutton() {
 
 
 
1288
  if (!document.getElementById('araqel') || (document.getElementById('araqel').value == '0')) {
1289
  alert('Please wait while page loading.');
1290
  return false;
1291
  }
 
 
 
1292
  tox = '';
 
 
 
 
 
 
 
 
 
 
 
 
1293
  l_id_array = [<?php echo $labels['id']?>];
1294
  l_label_array = [<?php echo $labels['label']?>];
1295
  l_type_array = [<?php echo $labels['type']?>];
1296
  l_id_removed = [];
1297
+ for (x=0; x< l_id_array.length; x++) {
1298
+ l_id_removed[l_id_array[x]]=true;
1299
  }
1300
+ for (t=1;t<=form_view_max;t++) {
1301
+ if (document.getElementById('form_id_tempform_view'+t)) {
1302
+ form_view_element=document.getElementById('form_id_tempform_view'+t);
1303
+ n=form_view_element.childNodes.length-2;
1304
+ for(q=0;q<=n;q++) {
1305
+ if (form_view_element.childNodes[q].nodeType!=3) {
1306
+ if (!form_view_element.childNodes[q].id) {
1307
+ GLOBAL_tr=form_view_element.childNodes[q];
1308
+ for (x=0; x < GLOBAL_tr.firstChild.childNodes.length; x++) {
1309
+ table=GLOBAL_tr.firstChild.childNodes[x];
1310
+ tbody=table.firstChild;
1311
+ for (y=0; y < tbody.childNodes.length; y++) {
1312
+ is_in_old=false;
1313
+ tr=tbody.childNodes[y];
1314
+ l_id=tr.id;
1315
+ l_label=document.getElementById( tr.id+'_element_labelform_id_temp').innerHTML;
 
 
 
 
 
 
 
1316
  l_label = l_label.replace(/(\r\n|\n|\r)/gm," ");
1317
+ l_type=tr.getAttribute('type');
1318
+ for (z = 0; z < l_id_array.length; z++) {
1319
+ if (l_id_array[z] == l_id) {
1320
+ if (l_type_array[z] == "type_address") {
1321
+ if (document.getElementById(l_id + "_mini_label_street1")) {
1322
+ l_id_removed[l_id_array[z]] = false;
1323
+ }
1324
+ if (document.getElementById(l_id+"_mini_label_street2")) {
1325
+ l_id_removed[parseInt(l_id_array[z]) + 1] = false;
1326
+ }
1327
+ if (document.getElementById(l_id+"_mini_label_city")) {
1328
+ l_id_removed[parseInt(l_id_array[z]) + 2] = false;
1329
+ }
1330
+ if (document.getElementById(l_id+"_mini_label_state")) {
1331
+ l_id_removed[parseInt(l_id_array[z]) + 3] = false;
1332
+ }
1333
+ if (document.getElementById(l_id+"_mini_label_postal")) {
1334
+ l_id_removed[parseInt(l_id_array[z]) + 4] = false;
1335
+ }
1336
+ if (document.getElementById(l_id+"_mini_label_country")) {
1337
+ l_id_removed[parseInt(l_id_array[z]) + 5] = false;
1338
+ }
1339
+ z = z + 5;
1340
+ }
1341
+ else {
1342
+ l_id_removed[l_id] = false;
1343
+ }
1344
  }
 
1345
  }
1346
+ if (tr.getAttribute('type')=="type_address") {
1347
+ addr_id=parseInt(tr.id);
1348
+ id_for_country= addr_id;
1349
+ if(document.getElementById(id_for_country+"_mini_label_street1"))
1350
+ tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_street1").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
1351
+ if(document.getElementById(id_for_country+"_mini_label_street2"))
1352
+ tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_street2").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
1353
+ if(document.getElementById(id_for_country+"_mini_label_city"))
1354
+ tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_city").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1355
+ if(document.getElementById(id_for_country+"_mini_label_state"))
1356
+ tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_state").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1357
+ if(document.getElementById(id_for_country+"_mini_label_postal"))
1358
+ tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_postal").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1359
+ if(document.getElementById(id_for_country+"_mini_label_country"))
1360
+ tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_country").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#';
 
 
 
 
 
 
1361
  }
1362
  else {
1363
+ tox = tox+l_id+'#**id**#'+l_label+'#**label**#'+l_type+'#****#';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1364
  }
 
 
1365
  }
1366
  }
1367
  }
1368
  }
 
 
 
 
 
 
 
 
 
 
1369
  }
1370
  }
1371
  }
1376
  }
1377
  }
1378
  document.getElementById('label_order').value = tox;
1379
+ refresh_old();
 
1380
  document.getElementById('pagination').value=document.getElementById('pages').getAttribute("type");
1381
  document.getElementById('show_title').value=document.getElementById('pages').getAttribute("show_title");
1382
  document.getElementById('show_numbers').value=document.getElementById('pages').getAttribute("show_numbers");
1388
  function enable() {
1389
  alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
1390
  for (x = 0; x < 14; x++) {
1391
+ document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FM_URL . '/images/'; ?>" + alltypes[x] + ".png?ver=<?php echo get_option("wd_form_maker_version"); ?>";
1392
  }
1393
  if (document.getElementById('formMakerDiv').style.display == 'block') {
1394
  jQuery('#formMakerDiv').slideToggle(200);
1411
  function enable2() {
1412
  alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
1413
  for (x = 0; x < 14; x++) {
1414
+ document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FM_URL . '/images/'; ?>" + alltypes[x] + ".png?ver=<?php echo get_option("wd_form_maker_version"); ?>";
1415
  }
1416
  if (document.getElementById('formMakerDiv').style.display == 'block') {
1417
  jQuery('#formMakerDiv').slideToggle(200);
1437
  }
1438
  }
1439
  </script>
1440
+ <div style="font-size: 14px; font-weight: bold;">
 
1441
  This section allows you to add fields to your form.
1442
  <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-4.html">Read More in User Manual</a>
1443
  </div>
1444
+ <form class="wrap" id="manage_form" method="post" action="admin.php?page=manage_fm" style="width:99%;">
 
 
 
 
 
 
1445
  <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
1446
  <h2><?php echo $page_title; ?></h2>
1447
  <div style="float: right; margin: 0 5px 0 0;">
1448
+ <a href="<?php echo add_query_arg(array('action' => 'FormMakerPreview', 'id' => $row->theme, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" class="button-primary thickbox thickbox-preview" id="preview_form" title="Form Preview" onclick="return false;">
1449
+ Preview
1450
+ </a>
1451
+ <input class="button-primary" type="submit" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'form_options_old');" value="Form options"/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1452
  <?php
1453
  if ($id) {
1454
  ?>
1455
+ <input class="button-secondary" type="submit" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'save_as_copy_old')" value="Save as Copy"/>
1456
  <?php
1457
  }
1458
  ?>
1459
+ <input class="button-secondary" type="submit" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'save_old')" value="Save"/>
1460
+ <input class="button-secondary" type="submit" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'apply_old')" value="Apply"/>
1461
  <input class="button-secondary" type="submit" onclick="fm_set_input_value('task', 'cancel')" value="Cancel"/>
1462
  </div>
1463
 
1464
  <div class="formmaker_table" width="100%">
1465
  <div style="float: left; text-align: center;"><br />
1466
+ <img src="<?php echo WD_FM_URL . '/images/FormMaker.png?ver='. get_option("wd_form_maker_version"); ?>" /><br /><br />
1467
+ <img src="<?php echo WD_FM_URL . '/images/logo.png?ver='. get_option("wd_form_maker_version"); ?>" />
1468
  </div>
1469
  <div style="float:right">
1470
  <span style="font-size: 16.76pt; font-family: tahoma; color: #FFFFFF; vertical-align: middle;">Form title:&nbsp;&nbsp;</span>
1471
  <input id="title" name="title" class="form_maker_title" value="<?php echo $row->title; ?>"/>
1472
  <br />
1473
+ <img src="<?php echo WD_FM_URL . '/images/formoptions.png'; ?>" onclick="if (fm_check_required('title', 'Form title')) {return false;}; submitbutton(); fm_set_input_value('task', 'form_options_old'); fm_form_submit(event, 'manage_form');" style="cursor: pointer; margin: 10px 0 10px 10px; float: right;"/>
1474
  <br /><br /><br />
1475
  <img src="<?php echo WD_FM_URL . '/images/addanewfield.png'; ?>" onclick="enable(); Enable();" style="cursor: pointer; margin:10px 0 10px 10px; float: right;"/>
1476
  </div>
1477
  </div>
1478
 
1479
+ <div id="formMakerDiv" onclick="close_window()"></div>
1480
+ <div id="formMakerDiv1" style="padding-top: 20px;" align="center">
1481
+ <table border="0" width="100%" cellpadding="0" cellspacing="0" height="100%" class="formMakerDiv1_table">
1482
+ <tr>
1483
+ <td style="padding:0px">
1484
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
1485
  <tr valign="top">
1486
  <td width="15%" height="100%" style="border-right: dotted black 1px;" id="field_types">
1487
  <div id="when_edit" style="display: none;"></div>
1494
  <img src="<?php echo WD_FM_URL . '/images/text.png'; ?>" style="margin:5px" id="img_text"/>
1495
  </td>
1496
  </tr>
1497
+ <tr>
1498
+ <td align="center" onClick="addRow('time_and_date')" style="cursor:pointer" id="table_time_and_date" class="field_buttons">
1499
+ <img src="<?php echo WD_FM_URL . '/images/time_and_date.png'; ?>" style="margin:5px" id="img_time_and_date"/>
1500
+ </td>
1501
+ <td align="center" onClick="addRow('select')" style="cursor:pointer" id="table_select" class="field_buttons">
1502
+ <img src="<?php echo WD_FM_URL . '/images/select.png'; ?>" style="margin:5px" id="img_select"/>
1503
+ </td>
1504
+ </tr>
1505
  <tr>
1506
  <td align="center" onClick="addRow('checkbox')" style="cursor:pointer" id="table_checkbox" class="field_buttons">
1507
  <img src="<?php echo WD_FM_URL . '/images/checkbox.png'; ?>" style="margin:5px" id="img_checkbox"/>
1511
  </td>
1512
  </tr>
1513
  <tr>
1514
+ <td align="center" onClick="addRow('file_upload')" style="cursor:pointer" id="table_file_upload" class="field_buttons">
1515
+ <img src="<?php echo WD_FM_URL . '/images/file_upload.png'; ?>" style="margin:5px" id="img_file_upload"/>
1516
  </td>
1517
+ <td align="center" onClick="addRow('captcha')" style="cursor:pointer" id="table_captcha" class="field_buttons">
1518
+ <img src="<?php echo WD_FM_URL . '/images/captcha.png'; ?>" style="margin:5px" id="img_captcha"/>
1519
  </td>
1520
  </tr>
1521
  <tr>
1522
+ <td align="center" onClick="addRow('page_break')" style="cursor:pointer" id="table_page_break" class="field_buttons">
1523
+ <img src="<?php echo WD_FM_URL . '/images/page_break.png'; ?>" style="margin:5px" id="img_page_break"/>
 
 
 
 
1524
  </td>
 
 
1525
  <td align="center" onClick="addRow('section_break')" style="cursor:pointer" id="table_section_break" class="field_buttons">
1526
  <img src="<?php echo WD_FM_URL . '/images/section_break.png'; ?>" style="margin:5px" id="img_section_break"/>
1527
  </td>
 
 
 
1528
  </tr>
1529
  <tr>
1530
+ <td align="center" onClick="addRow('map')" style="cursor:pointer" id="table_map" class="field_buttons">
1531
+ <img src="<?php echo WD_FM_URL . '/images/map.png'; ?>" style="margin:5px" id="img_map"/>
 
1532
  </td>
1533
+ <td align="center" onClick="addRow('paypal')" id="table_paypal" class="field_buttons">
1534
+ <img src="<?php echo WD_FM_URL . '/images/paypal.png'; ?>" style="margin:5px" id="img_paypal"/>
 
1535
  </td>
1536
  </tr>
1537
  <tr>
1538
+ <td align="center" onClick="addRow('survey')" class="field_buttons" id="table_survey">
1539
+ <img src="<?php echo WD_FM_URL . '/images/survey.png'; ?>" style="margin:5px" id="img_survey"/>
1540
  </td>
1541
  <td align="center" onClick="addRow('button')" id="table_button" class="field_buttons">
1542
  <img src="<?php echo WD_FM_URL . '/images/button.png'; ?>" style="margin:5px" id="img_button"/>
1558
  At The Beginning
1559
  <input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
1560
  Before
1561
+ <select style="width: 100px; margin-left: 5px;" id="sel_el_pos" disabled="disabled"></select>
1562
  <img alt="ADD" title="add" style="cursor:pointer; vertical-align:middle; margin:5px" src="<?php echo WD_FM_URL . '/images/save.png'; ?>" onClick="add(0, false)"/>
1563
  <img alt="CANCEL" title="cancel" style="cursor: pointer; vertical-align:middle; margin:5px" src="<?php echo WD_FM_URL . '/images/cancel_but.png'; ?>" onClick="close_window()"/>
1564
  <hr style=" margin-bottom:10px" />
1579
  <input type="hidden" id="element_type" />
1580
  <input type="hidden" id="editing_id" />
1581
  <input type="hidden" value="<?php echo WD_FM_URL; ?>" id="form_plugins_url" />
1582
+ <div id="main_editor" style="position: fixed; display: none; z-index: 140;">
1583
  <?php
1584
  if (user_can_richedit()) {
1585
  wp_editor('', 'form_maker_editor', array('teeny' => FALSE, 'textarea_name' => 'form_maker_editor', 'media_buttons' => FALSE, 'textarea_rows' => 5));
1586
  }
1587
  else {
1588
  ?>
1589
+ <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>
1590
  <?php
1591
  }
1592
  ?>
1599
  <?php
1600
  }
1601
  ?>
1602
+ <br />
 
 
 
 
 
1603
  <br />
1604
  <fieldset>
1605
  <legend><h2 style="color: #00aeef;">Form</h2></legend>
1606
+ <table width="100%" style="margin:8px">
1607
+ <tr id="page_navigation">
1608
+ <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>
1609
+ <td align="left" id="edit_page_navigation"></td>
1610
+ </tr>
1611
+ </table>
1612
+ <div id="take">
 
 
 
 
 
 
1613
  <?php
1614
+ if ($row->form) {
1615
+ echo $row->form;
 
 
 
 
 
 
 
 
 
 
 
 
1616
  }
1617
  else {
1618
  ?>
1619
+ <table border="0" cellpadding="4" cellspacing="0" class="wdform_table1" style="width: 100%;">
1620
+ <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">
1621
+ <tr class="wdform_tr1">
1622
+ <td class="wdform_td1" >
1623
+ <table class="wdform_table2">
1624
+ <tbody class="wdform_tbody2"></tbody>
1625
+ </table>
1626
+ </td>
1627
+ </tr>
1628
+ <tr class="wdform_footer">
1629
+ <td colspan="100" valign="top">
1630
+ <table width="100%" style="padding-right:170px">
1631
+ <tbody>
1632
+ <tr id="form_id_temppage_nav1">
1633
+ </tr>
1634
+ </tbody>
1635
+ </table>
1636
+ </td>
1637
+ </tr>
1638
+ <tbody id="form_id_tempform_view_img1" style="float: right !important;" >
1639
+ <tr>
1640
+ <td width="0%"></td>
1641
+ <td align="right">
1642
+ <img src="<?php echo WD_FM_URL . '/images/minus.png?ver='. get_option("wd_form_maker_version").''; ?>" 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" />
1643
+ </td>
1644
+ <td>
1645
+ <img src="<?php echo WD_FM_URL . '/images/page_delete.png?ver='. get_option("wd_form_maker_version").''; ?>" 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')" />
1646
+ </td>
1647
+ <td>
1648
+ <img src="<?php echo WD_FM_URL . '/images/page_delete_all.png?ver='. get_option("wd_form_maker_version").''; ?>" 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')" />
1649
+ </td>
1650
+ <td>
1651
+ <img src="<?php echo WD_FM_URL . '/images/page_edit.png?ver='. get_option("wd_form_maker_version").''; ?>" 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')" />
1652
+ </td>
1653
+ </tr>
1654
+ </tbody>
1655
+ </table>
1656
  <?php
1657
  }
1658
  ?>
1659
+ </div>
1660
  </fieldset>
1661
+ <input type="hidden" name="form" id="form" />
1662
  <input type="hidden" name="form_front" id="form_front" />
 
1663
  <input type="hidden" name="pagination" id="pagination" />
1664
  <input type="hidden" name="show_title" id="show_title" />
1665
  <input type="hidden" name="show_numbers" id="show_numbers" />
1670
  <input type="hidden" id="label_order_current" name="label_order_current" value="<?php echo $row->label_order_current; ?>" />
1671
  <input type="hidden" name="counter" id="counter" value="<?php echo $row->counter; ?>" />
1672
  <input type="hidden" id="araqel" value="0" />
 
 
 
 
1673
  <script type="text/javascript">
1674
+ form_view = 1;
1675
+ form_view_count = 1;
1676
+ form_view_max = 1;
1677
  function formOnload() {
1678
  // Enable maps.
1679
+ for (t = 0; t < <?php echo $row->counter;?>; t++)
1680
+ if (document.getElementById(t+"_typeform_id_temp")) {
1681
+ if (document.getElementById(t+"_typeform_id_temp").value=="type_map" || document.getElementById(t+"_typeform_id_temp").value=="type_mark_map") {
1682
  if_gmap_init(t);
1683
  for (q = 0; q < 20; q++) {
1684
+ if (document.getElementById(t+"_elementform_id_temp").getAttribute("long"+q)) {
1685
+ w_long=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("long"+q));
1686
+ w_lat=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("lat"+q));
1687
+ w_info=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("info"+q));
1688
+ add_marker_on_map(t,q, w_long, w_lat, w_info, false);
1689
  }
1690
  }
1691
  }
1692
+ else
1693
+ if (document.getElementById(t+"_typeform_id_temp").value == "type_date") {
1694
+ // Calendar.setup({
1695
+ // inputField: t+"_elementform_id_temp",
1696
+ // ifFormat: document.getElementById(t+"_buttonform_id_temp").getAttribute('format'),
1697
+ // button: t+"_buttonform_id_temp",
1698
+ // align: "Tl",
1699
+ // singleClick: true,
1700
+ // firstDay: 0
1701
+ // });
1702
+ }
1703
+ else
1704
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_spinner") {
1705
+ var spinner_value = jQuery("#" + t + "_elementform_id_temp").get( "aria-valuenow" );
1706
+ var spinner_min_value = document.getElementById(t+"_min_valueform_id_temp").value;
1707
+ var spinner_max_value = document.getElementById(t+"_max_valueform_id_temp").value;
1708
+ var spinner_step = document.getElementById(t+"_stepform_id_temp").value;
1709
+
1710
+ jQuery( "#"+t+"_elementform_id_temp" ).removeClass( "ui-spinner-input" )
1711
+ .prop( "disabled", false )
1712
+ .removeAttr( "autocomplete" )
1713
+ .removeAttr( "role" )
1714
+ .removeAttr( "aria-valuemin" )
1715
+ .removeAttr( "aria-valuemax" )
1716
+ .removeAttr( "aria-valuenow" );
1717
+
1718
+ span_ui= document.getElementById(t+"_elementform_id_temp").parentNode;
1719
+ span_ui.parentNode.appendChild(document.getElementById(t+"_elementform_id_temp"));
1720
+ span_ui.parentNode.removeChild(span_ui);
1721
+
1722
+ jQuery("#"+t+"_elementform_id_temp")[0].spin = null;
1723
+
1724
+ spinner = jQuery( "#"+t+"_elementform_id_temp" ).spinner();
1725
+ spinner.spinner( "value", spinner_value );
1726
+ jQuery( "#"+t+"_elementform_id_temp" ).spinner({ min: spinner_min_value});
1727
+ jQuery( "#"+t+"_elementform_id_temp" ).spinner({ max: spinner_max_value});
1728
+ jQuery( "#"+t+"_elementform_id_temp" ).spinner({ step: spinner_step});
1729
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1730
  }
1731
+ else
1732
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_slider") {
1733
+
1734
+ var slider_value = document.getElementById(t+"_slider_valueform_id_temp").value;
1735
+ var slider_min_value = document.getElementById(t+"_slider_min_valueform_id_temp").value;
1736
+ var slider_max_value = document.getElementById(t+"_slider_max_valueform_id_temp").value;
 
 
1737
 
1738
+ var slider_element_value = document.getElementById( t+"_element_valueform_id_temp" );
1739
+ var slider_value_save = document.getElementById( t+"_slider_valueform_id_temp" );
1740
+
1741
+ document.getElementById(t+"_elementform_id_temp").innerHTML = "";
1742
+ document.getElementById(t+"_elementform_id_temp").removeAttribute( "class" );
1743
+ document.getElementById(t+"_elementform_id_temp").removeAttribute( "aria-disabled" );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1744
 
1745
+ jQuery("#"+t+"_elementform_id_temp")[0].slide = null;
1746
+
1747
+ jQuery(function() {
1748
+ jQuery( "#"+t+"_elementform_id_temp").slider({
1749
+ range: "min",
1750
+ value: eval(slider_value),
1751
+ min: eval(slider_min_value),
1752
+ max: eval(slider_max_value),
1753
+ slide: function( event, ui ) {
1754
+ slider_element_value.innerHTML = "" + ui.value ;
1755
+ slider_value_save.value = "" + ui.value;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1756
 
1757
  }
1758
  });
2224
  var id_for_blur = document.getElementById('best').parentNode.id.split('_');
2225
  var value = jQuery(this).val();
2226
 
2227
+ jQuery("#"+id_for_blur[0]+"_mini_label_best").text(value);
2228
+ });
2229
+
2230
+ }
2231
+ });
2232
+
2233
+
2234
+
2235
+ });
2236
+ }
2237
+ }
2238
+ form_view = 1;
2239
+ form_view_count = 0;
2240
+ for (i = 1; i <= 30; i++) {
2241
+ if (document.getElementById('form_id_tempform_view'+i)) {
2242
+ form_view_count++;
2243
+ form_view_max=i;
2244
+ }
2245
+ }
2246
+ if (form_view_count > 1) {
2247
+ for (i=1; i<=form_view_max; i++) {
2248
+ if (document.getElementById('form_id_tempform_view'+i)) {
2249
+ first_form_view=i;
2250
+ break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2251
  }
2252
+ }
2253
+ form_view=form_view_max;
2254
+ generate_page_nav(first_form_view);
2255
+ var img_EDIT = document.createElement("img");
2256
+ img_EDIT.setAttribute("src", "<?php echo WD_FM_URL . '/images/edit.png'; ?>");
2257
+ img_EDIT.style.cssText = "margin-left:40px; cursor:pointer";
2258
+ img_EDIT.setAttribute("onclick", 'el_page_navigation()');
2259
+ var td_EDIT = document.getElementById("edit_page_navigation");
2260
+ td_EDIT.appendChild(img_EDIT);
2261
+ document.getElementById('page_navigation').appendChild(td_EDIT);
2262
+ }
2263
+ //if(document.getElementById('take').innerHTML.indexOf('up_row(')==-1) location.reload(true);
2264
+ //else
2265
+
2266
+ document.getElementById('form').value=document.getElementById('take').innerHTML;
2267
+ document.getElementById('araqel').value = 1;
2268
+ }
2269
+ jQuery(window).load(function () {
2270
+ formOnload();
2271
+ });
2272
+ </script>
2273
+
2274
+ <input type="hidden" name="option" value="com_formmaker" />
2275
+ <input type="hidden" name="id" value="<?php echo $row->id; ?>" />
2276
+ <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
2277
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2278
  <input type="hidden" id="task" name="task" value=""/>
2279
  <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
2280
  </form>
2281
  <script>
2282
+ jQuery(window).load(function() {
 
2283
  fm_popup();
2284
  });
2285
  </script>
2286
  <?php
2287
  }
2288
+
2289
+ public function form_options_old($id) {
2290
  $row = $this->model->get_row_data($id);
2291
+ $themes = $this->model->get_theme_rows_data('_old');
 
 
2292
  $page_title = $row->title . ' form options';
2293
  $label_id = array();
2294
  $label_label = array();
2302
  array_push($label_label, $label_order_each[0]);
2303
  array_push($label_type, $label_order_each[1]);
2304
  }
 
 
2305
  ?>
2306
  <script>
2307
  gen = "<?php echo $row->counter; ?>";
2308
  form_view_max = 20;
2309
  function set_preview() {
2310
+ document.getElementById('preview_form').href = '<?php echo add_query_arg(array('action' => 'FormMakerPreview', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&id='+document.getElementById('theme').value+'&width=1000&height=500&TB_iframe=1';
 
2311
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2312
  </script>
2313
+ <div style="font-size: 14px; font-weight: bold;">
 
 
 
 
 
 
 
 
 
2314
  This section allows you to edit form options.
2315
  <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-3.html">Read More in User Manual</a>
2316
  </div>
2317
+ <form class="wrap" method="post" action="admin.php?page=manage_fm" style="width:99%;" name="adminForm" id="adminForm">
 
 
 
 
 
 
2318
  <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
2319
  <h2><?php echo $page_title; ?></h2>
2320
  <div style="float: right; margin: 0 5px 0 0;">
2321
+ <input class="button-secondary" type="submit" onclick="if (fm_check_email('mail') ||
2322
  fm_check_email('from_mail') ||
2323
+ fm_check_email('paypal_email')) {return false;}; fm_set_input_value('task', 'save_options_old')" value="Save"/>
2324
+ <input class="button-secondary" type="submit" onclick="if (fm_check_email('mail') ||
 
 
 
 
 
2325
  fm_check_email('from_mail') ||
2326
+ fm_check_email('paypal_email')) {return false;}; fm_set_input_value('task', 'apply_options_old')" value="Apply"/>
2327
+ <input class="button-secondary" type="submit" onclick="fm_set_input_value('task', 'cancel_options_old')" value="Cancel"/>
 
 
 
 
 
2328
  </div>
2329
+ <input type="hidden" name="take" id="take" value="<?php $row->form ?>">
2330
  <div class="submenu-box" style="width: 99%; float: left; margin: 15px 0 0 0;">
2331
  <div class="submenu-pad">
2332
  <ul id="submenu" class="configuration">
2333
  <li>
2334
  <a id="general" class="fm_fieldset_tab" onclick="form_maker_options_tabs('general')" href="#">General Options</a>
2335
  </li>
 
 
 
2336
  <li>
2337
  <a id="actions" class="fm_fieldset_tab" onclick="form_maker_options_tabs('actions')" href="#">Actions after Submission</a>
2338
  </li>
2339
  <li>
2340
  <a id="payment" class="fm_fieldset_tab" onclick="form_maker_options_tabs('payment')" href="#">Payment Options</a>
2341
  </li>
2342
+ <li>
2343
+ <a id="javascript" class="fm_fieldset_tab" onclick="form_maker_options_tabs('javascript')" href="#">JavaScript</a>
2344
+ </li>
2345
+ <li>
2346
+ <a id="custom" class="fm_fieldset_tab" onclick="form_maker_options_tabs('custom')" href="#">Custom Text in Email</a>
2347
+ </li>
2348
+ </ul>
2349
+ </div>
2350
+ </div>
2351
+ <fieldset id="actions_fieldset" class="adminform fm_fieldset_deactive">
2352
+ <legend style="color:#0B55C4;font-weight: bold;">Actions after submission</legend>
2353
+ <table class="admintable">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2354
  <tr valign="top">
2355
  <td class="fm_options_label">
2356
+ <label>Action type</label>
2357
  </td>
2358
  <td class="fm_options_value">
2359
+ <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>
2360
+ <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>
2361
+ <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>
2362
+ <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>
2363
+ <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>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2364
  </td>
2365
  </tr>
2366
+ <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"' : ''); ?>>
2367
+ <td class="fm_options_label">
2368
+ <label>Stay on Form</label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2369
  </td>
2370
  <td class="fm_options_value">
2371
+ <img src="<?php echo WD_FM_URL . '/images/tick.png'; ?>" border="0">
 
2372
  </td>
2373
+ </tr>
2374
+ <tr id="post" <?php echo (($row->submit_text_type != 2) ? 'style="display:none"' : ''); ?>>
2375
+ <td class="fm_options_label">
2376
+ <label for="post_name">Post</label>
2377
  </td>
2378
  <td class="fm_options_value">
2379
+ <select id="post_name" name="post_name">
2380
+ <option value="0">- Select Post -</option>
2381
+ <?php
2382
+ // The Query.
2383
+ $args = array('posts_per_page' => 10000);
2384
+ query_posts($args);
2385
+ // The Loop.
2386
+ while (have_posts()) : the_post(); ?>
2387
+ <option value="<?php $x = get_permalink(get_the_ID()); echo $x; ?>" <?php echo (($row->article_id == $x) ? 'selected="selected"' : ''); ?>><?php the_title(); ?></option>
2388
+ <?php
2389
+ endwhile;
2390
+ // Reset Query.
2391
+ wp_reset_query();
2392
+ ?>
2393
+ </select>
2394
  </td>
2395
  </tr>
2396
+ <tr id="page" <?php echo (($row->submit_text_type != 5) ? 'style="display:none"' : ''); ?>>
2397
+ <td class="fm_options_label">
2398
+ <label for="page_name">Page</label>
2399
+ </td>
2400
+ <td class="fm_options_value">
2401
+ <select id="page_name" name="page_name" style="width:153px; font-size:11px;">
2402
+ <option value="0">- Select Page -</option>
2403
+ <?php
2404
+ // The Query.
2405
+ $pages = get_pages();
2406
+ // The Loop.
2407
+ foreach ($pages as $page) {
2408
+ $page_id = get_page_link($page->ID);
2409
+ ?>
2410
+ <option value="<?php echo $page_id; ?>" <?php echo (($row->article_id == $page_id) ? 'selected="selected"' : ''); ?>><?php echo $page->post_title; ?></option>
2411
+ <?php
2412
+ }
2413
+ // Reset Query.
2414
+ wp_reset_query();
2415
+ ?>
2416
+ </select>
2417
+ </td>
2418
+ </tr>
2419
+ <tr id="custom_text" <?php echo (($row->submit_text_type != 3) ? 'style="display: none;"' : ''); ?>>
2420
+ <td class="fm_options_label">
2421
+ <label for="submit_text">Text</label>
2422
+ </td>
2423
+ <td class="fm_options_value">
2424
+ <?php
2425
+ if (user_can_richedit()) {
2426
+ wp_editor($row->submit_text, 'submit_text', array('teeny' => FALSE, 'textarea_name' => 'submit_text', 'media_buttons' => FALSE, 'textarea_rows' => 5));
2427
+ }
2428
+ else {
2429
+ ?>
2430
+ <textarea cols="36" rows="5" id="submit_text" name="submit_text" style="resize: vertical;">
2431
+ <?php echo $row->submit_text; ?>
2432
+ </textarea>
2433
+ <?php
2434
+ }
2435
+ ?>
2436
+ </td>
2437
+ </tr>
2438
+ <tr id="url" <?php echo (($row->submit_text_type != 4 ) ? 'style="display:none"' : ''); ?>>
2439
+ <td class="fm_options_label">
2440
+ <label for="url">URL</label>
2441
+ </td>
2442
+ <td class="fm_options_value">
2443
+ <input type="text" id="url" name="url" style="width:300px" value="<?php echo $row->url; ?>" />
2444
+ </td>
2445
+ </tr>
2446
+ </table>
2447
+ </fieldset>
2448
+ <fieldset id="custom_fieldset" class="adminform fm_fieldset_deactive">
2449
+ <legend style="color:#0B55C4;font-weight: bold;">Custom text in email</legend>
2450
+ <table class="admintable">
2451
+ <tr>
2452
+ <td class="fm_options_label" valign="top">
2453
+ <label>For Administrator</label>
2454
+ </td>
2455
+ <td class="fm_options_value">
2456
+ <div style="margin-bottom:5px">
2457
+ <?php
2458
+ $choise = "document.getElementById('script_mail')";
2459
+ for ($i = 0; $i < count($label_label); $i++) {
2460
+ 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") {
2461
+ continue;
2462
  }
2463
+ $param = htmlspecialchars(addslashes($label_label[$i]));
2464
  ?>
2465
+ <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; ?>')" />
2466
+ <?php
2467
+ }
2468
+ ?>
2469
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="All fields list" onClick="insertAtCursor(<?php echo $choise; ?>, 'all')" />
2470
+ </div>
2471
+ <?php
2472
+ if (user_can_richedit()) {
2473
+ wp_editor($row->script_mail, 'script_mail', array('teeny' => FALSE, 'textarea_name' => 'script_mail', 'media_buttons' => FALSE, 'textarea_rows' => 5));
2474
+ }
2475
+ else {
2476
+ ?>
2477
+ <textarea name="script_mail" id="script_mail" cols="20" rows="10" style="width:300px; height:450px;"><?php echo $row->script_mail; ?></textarea>
2478
  <?php
2479
+ }
2480
+ ?>
2481
+ </td>
2482
+ </tr>
2483
+ <tr>
2484
+ <td valign="top" height="30"></td>
2485
+ <td valign="top"></td>
2486
+ </tr>
2487
+ <tr>
2488
+ <td class="fm_options_label" valign="top">
2489
+ <label>For User</label>
2490
+ </td>
2491
+ <td class="fm_options_value">
2492
+ <div style="margin-bottom:5px">
2493
+ <?php
2494
+ $choise = "document.getElementById('script_mail_user')";
2495
+ for ($i = 0; $i < count($label_label); $i++) {
2496
+ 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") {
2497
+ continue;
2498
+ }
2499
+ $param = htmlspecialchars(addslashes($label_label[$i]));
2500
  ?>
2501
+ <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; ?>')" />
2502
  <?php
2503
  }
2504
  ?>
2505
+ <input style="border: 1px solid silver; font-size: 10px; margin:3px;" type="button" value="All fields list" onClick="insertAtCursor(<?php echo $choise; ?>, 'all')" />
2506
+ </div>
2507
+ <?php
2508
+ if (user_can_richedit()) {
2509
+ wp_editor($row->script_mail_user, 'script_mail_user', array('teeny' => FALSE, 'textarea_name' => 'script_mail_user', 'media_buttons' => FALSE, 'textarea_rows' => 5));
2510
+ }
2511
+ else {
2512
+ ?>
2513
+ <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>
2514
+ <?php
2515
+ }
2516
+ ?>
2517
+ </td>
2518
+ </tr>
2519
+ </table>
2520
  </fieldset>
2521
+ <fieldset id="general_fieldset" class="adminform fm_fieldset_deactive">
2522
+ <legend style="color:#0B55C4;font-weight: bold;">General Options</legend>
2523
+ <table class="admintable" style="float:left">
2524
  <tr valign="top">
2525
  <td class="fm_options_label">
2526
+ <label for="mail">Email to send submissions to</label>
2527
  </td>
2528
  <td class="fm_options_value">
2529
+ <input id="mail" name="mail" value="<?php echo $row->mail; ?>" style="width:250px;" />
 
 
 
 
2530
  </td>
2531
  </tr>
2532
+ <tr valign="top">
2533
  <td class="fm_options_label">
2534
+ <label for="from_mail">From Email</label>
2535
  </td>
2536
  <td class="fm_options_value">
2537
+ <input id="from_mail" name="from_mail" value="<?php echo $row->from_mail; ?>" style="width:250px;" />
2538
  </td>
2539
  </tr>
2540
+ <tr valign="top">
2541
  <td class="fm_options_label">
2542
+ <label for="from_name">From Name</label>
2543
  </td>
2544
  <td class="fm_options_value">
2545
+ <input id="from_name" name="from_name" value="<?php echo $row->from_name; ?>" style="width:250px;"/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2546
  </td>
2547
  </tr>
2548
+ <tr valign="top">
2549
  <td class="fm_options_label">
2550
+ <label for="theme">Theme</label>
2551
  </td>
2552
  <td class="fm_options_value">
2553
+ <select id="theme" name="theme" style="width:260px;" onChange="set_preview()">
 
2554
  <?php
2555
+ foreach ($themes as $theme) {
 
 
 
 
2556
  ?>
2557
+ <option value="<?php echo $theme->id; ?>" <?php echo (($theme->id == $row->theme) ? 'selected' : ''); ?>><?php echo $theme->title; ?></option>
2558
  <?php
2559
  }
 
 
2560
  ?>
2561
  </select>
2562
+ <a href="<?php echo add_query_arg(array('action' => 'FormMakerPreview', 'id' => $row->theme, 'form_id' => $row->id, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" class="button-primary thickbox thickbox-preview" id="preview_form" title="Form Preview" onclick="return false;">
2563
+ Preview
2564
+ </a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2565
  </td>
2566
  </tr>
2567
  </table>
2569
  <fieldset id="payment_fieldset" class="adminform fm_fieldset_deactive">
2570
  <legend style="color:#0B55C4;font-weight: bold;">Payment Options</legend>
2571
  <table class="admintable">
 
 
 
 
 
2572
  <tr valign="top">
2573
  <td class="fm_options_label">
2574
  <label>Turn Paypal On</label>
2575
  </td>
2576
  <td class="fm_options_value">
2577
+ <div><input type="radio" name="paypal_mode" id="paypal_mode1" value="1" <?php echo ($row->paypal_mode == "1") ? "checked" : ""; ?> /><label for="paypal_mode1">On</label></div>
2578
+ <div><input type="radio" name="paypal_mode" id="paypal_mode2" value="0" <?php echo ($row->paypal_mode != "1") ? "checked" : ""; ?> /><label for="paypal_mode2">Off</label></div>
2579
  </td>
2580
  </tr>
2581
  <tr valign="top">
2583
  <label>Checkout Mode</label>
2584
  </td>
2585
  <td class="fm_options_value">
2586
+ <div><input type="radio" name="checkout_mode" id="checkout_mode1" value="production" <?php echo ($row->checkout_mode == "production") ? "checked" : ""; ?> /><label for="checkout_mode1">Production</label></div>
2587
+ <div><input type="radio" name="checkout_mode" id="checkout_mode2" value="testmode" <?php echo ($row->checkout_mode != "production") ? "checked" : ""; ?> /><label for="checkout_mode2">Testmode</label></div>
2588
  </td>
2589
  </tr>
2590
  <tr valign="top">
2592
  <label for="paypal_email">Paypal email</label>
2593
  </td>
2594
  <td class="fm_options_value">
2595
+ <input type="text" name="paypal_email" id="paypal_email" value="<?php echo $row->paypal_email; ?>" class="text_area" style="width:250px">
2596
  </td>
2597
  </tr>
2598
  <tr valign="top">
2600
  <label for="payment_currency">Payment Currency</label>
2601
  </td>
2602
  <td class="fm_options_value">
2603
+ <select id="payment_currency" name="payment_currency" style="width:253px">
2604
  <option value="USD" <?php echo (($row->payment_currency == 'USD') ? 'selected' : ''); ?>>$ &#8226; U.S. Dollar</option>
2605
  <option value="EUR" <?php echo (($row->payment_currency == 'EUR') ? 'selected' : ''); ?>>&#8364; &#8226; Euro</option>
2606
  <option value="GBP" <?php echo (($row->payment_currency == 'GBP') ? 'selected' : ''); ?>>&#163; &#8226; Pound Sterling</option>
2644
  <td class="fm_options_label">
2645
  <label for="javascript">Javascript</label>
2646
  </td>
2647
+ <td class="fm_options_value">
2648
+ <textarea style="margin: 0px;" cols="60" rows="30" name="javascript" id="javascript"><?php echo $row->javascript; ?></textarea>
2649
  </td>
2650
  </tr>
2651
  </table>
2652
  </fieldset>
2653
+ <input type="hidden" name="fieldset_id" id="fieldset_id" value="<?php echo WDW_FM_Library::get('fieldset_id', 'general'); ?>" />
2654
+ <input type="hidden" id="task" name="task" value=""/>
2655
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
2656
+ </form>
2657
+ <script>
2658
+ jQuery(window).load(function () {
2659
+ form_maker_options_tabs(jQuery("#fieldset_id").val());
2660
+ fm_popup();
2661
+ });
2662
+ </script>
2663
+ <?php
2664
+ }
2665
+
2666
+ public function form_options($id) {
2667
+ $addons = array('WD_FM_MAILCHIMP' => 'MailChimp', 'WD_FM_REG' => 'Registration', 'WD_FM_POST_GEN' => 'Post Generation', 'WD_FM_EMAIL_COND' => 'Conditional Emails', 'WD_FM_DBOX_INT' => 'Dropbox Integration', 'WD_FM_GDRIVE_INT' => 'Google Drive Integration','WD_FM_PDF' => 'PDF Integration',);
2668
+
2669
+ $row = $this->model->get_row_data($id);
2670
+ $themes = $this->model->get_theme_rows_data();
2671
+ $queries = $this->model->get_queries_rows_data($id);
2672
+ $userGroups = get_editable_roles();
2673
+ $page_title = $row->title . ' form options';
2674
+ $label_id = array();
2675
+ $label_label = array();
2676
+ $label_type = array();
2677
+ $label_all = explode('#****#', $row->label_order_current);
2678
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
2679
+ foreach ($label_all as $key => $label_each) {
2680
+ $label_id_each = explode('#**id**#', $label_each);
2681
+ array_push($label_id, $label_id_each[0]);
2682
+ $label_order_each = explode('#**label**#', $label_id_each[1]);
2683
+ array_push($label_label, $label_order_each[0]);
2684
+ array_push($label_type, $label_order_each[1]);
2685
+ }
2686
+ $fields = explode('*:*id*:*type_submitter_mail*:*type*:*', $row->form_fields);
2687
+ $fields_count = count($fields);
2688
+ ?>
2689
+ <script>
2690
+ function fm_change_radio_checkbox_text(elem) {
2691
+ var labels_array = [];
2692
+ labels_array['paypal_mode'] = ['Off', 'On'];
2693
+ labels_array['checkout_mode'] = ['Testmode', 'Production'];
2694
+ labels_array['mail_mode'] = ['Text', 'HTML'];
2695
+ labels_array['value'] = ['1', '0'];
2696
+
2697
+ jQuery(elem).val(labels_array['value'][jQuery(elem).val()]);
2698
+ jQuery(elem).next().val(jQuery(elem).val());
2699
+
2700
+ var clicked_element = labels_array[jQuery(elem).attr('name')];
2701
+ jQuery(elem).find('label').html(clicked_element[jQuery(elem).val()]);
2702
+ if(jQuery( elem ).hasClass( "fm-text-yes" )) {
2703
+ jQuery( elem ).removeClass('fm-text-yes').addClass('fm-text-no');
2704
+ jQuery(elem).find("span").animate({
2705
+ right: parseInt(jQuery( elem ).css( "width")) - 14 + 'px'
2706
+ }, 400, function() {
2707
+ });
2708
+ }
2709
+ else {
2710
+ jQuery( elem ).removeClass('fm-text-no').addClass('fm-text-yes');
2711
+ jQuery(elem).find("span").animate({
2712
+ right: 0
2713
+ }, 400, function() {
2714
+ });
2715
+ }
2716
+ }
2717
+
2718
+ gen = "<?php echo $row->counter; ?>";
2719
+ form_view_max = 20;
2720
+ function set_preview() {
2721
+ jQuery("#preview_form").attr("onclick", "tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerPreview', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&test_theme=" + jQuery('#theme').val() + "&width=1000&height=500&TB_iframe=1'); return false;");
2722
+ jQuery("#edit_css").attr("onclick", "tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerEditCSS', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&id=" + jQuery('#theme').val() + "&width=800&height=500&TB_iframe=1'); return false;");
2723
+ }
2724
+
2725
+ function set_condition() {
2726
+ field_condition = '';
2727
+ for(i=0;i<500;i++) {
2728
+ conditions = '';
2729
+ if(document.getElementById("condition"+i)) {
2730
+ field_condition+=document.getElementById("show_hide"+i).value+"*:*show_hide*:*";
2731
+ field_condition+=document.getElementById("fields"+i).value+"*:*field_label*:*";
2732
+ field_condition+=document.getElementById("all_any"+i).value+"*:*all_any*:*";
2733
+ for(k=0;k<500;k++) {
2734
+ if(document.getElementById("condition_div"+i+"_"+k)) {
2735
+ conditions+=document.getElementById("field_labels"+i+"_"+k).value+"***";
2736
+ conditions+=document.getElementById("is_select"+i+"_"+k).value+"***";
2737
+ if(document.getElementById("field_value"+i+"_"+k).tagName=="SELECT" ) {
2738
+ if(document.getElementById("field_value"+i+"_"+k).getAttribute('multiple')) {
2739
+ var sel = document.getElementById("field_value"+i+"_"+k);
2740
+ var selValues = '';
2741
+ for(m=0; m < sel.length; m++) {
2742
+ if(sel.options[m].selected)
2743
+
2744
+ selValues += sel.options[m].value+"@@@";
2745
+ }
2746
+ conditions+=selValues;
2747
+ } else {
2748
+ conditions+=document.getElementById("field_value"+i+"_"+k).value;
2749
+ }
2750
+ }
2751
+ else
2752
+ conditions+=document.getElementById("field_value"+i+"_"+k).value;
2753
+ conditions+="*:*next_condition*:*";
2754
+ }
2755
+ }
2756
+ field_condition+=conditions;
2757
+ field_condition+="*:*new_condition*:*";
2758
+ }
2759
+ }
2760
+ document.getElementById('condition').value = field_condition;
2761
+ }
2762
+
2763
+ function show_verify_options(s){
2764
+ if(s){
2765
+ jQuery(".verification_div").removeAttr( "style" );
2766
+ jQuery(".expire_link").removeAttr( "style" );
2767
+
2768
+ } else{
2769
+ jQuery(".verification_div").css( 'display', 'none' );
2770
+ jQuery(".expire_link").css( 'display', 'none' );
2771
+ }
2772
+ }
2773
+ </script>
2774
+ <style>
2775
+ .CodeMirror {
2776
+ border: 1px solid #ccc;
2777
+ font-size: 12px;
2778
+ margin-bottom: 6px;
2779
+ background: white;
2780
+ }
2781
+ </style>
2782
+ <div class="fm-user-manual">
2783
+ This section allows you to add fields to your form.
2784
+ <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-3.html">Read More in User Manual</a>
2785
+ </div>
2786
+ <div class="fm-upgrade-pro">
2787
+ <a target="_blank" href="https://web-dorado.com/files/fromFormMaker.php">
2788
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
2789
+ </a>
2790
+ </div>
2791
+ <div class="fm-clear"></div>
2792
+ <form class="wrap" method="post" action="admin.php?page=manage_fm" style="width:99%;" name="adminForm" id="adminForm">
2793
+ <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
2794
+ <div class="fm-page-header">
2795
+ <div class="fm-page-title" style="width: inherit;">
2796
+ <?php echo $page_title; ?>
2797
+ </div>
2798
+ <div class="fm-page-actions">
2799
+ <button class="fm-button save-button small" onclick="if (fm_check_email('mailToAdd') ||fm_check_email('from_mail') || fm_check_email('reply_to') || fm_check_email('mail_from_user') || fm_check_email('reply_to_user') || fm_check_email('mail_from_other') || fm_check_email('reply_to_other') || fm_check_email('paypal_email')) {return false;}; set_condition(); wd_fm_apply_options('save_options');">
2800
+ <span></span>
2801
+ Save
2802
+ </button>
2803
+ <button class="fm-button apply-button small" onclick="if (fm_check_email('mailToAdd') || fm_check_email('from_mail') || fm_check_email('reply_to') || fm_check_email('mail_from_user') || fm_check_email('reply_to_user') || fm_check_email('mail_from_other') || fm_check_email('reply_to_other') || fm_check_email('paypal_email')) {return false;}; set_condition(); wd_fm_apply_options('apply_options');">
2804
+ <span></span>
2805
+ Apply
2806
+ </button>
2807
+ <button class="fm-button cancel-button small" onclick="fm_set_input_value('task', 'cancel_options');">
2808
+ <span></span>
2809
+ Cancel
2810
+ </button>
2811
+ </div>
2812
+ <div class="fm-clear"></div>
2813
+ </div>
2814
+ <div class="fm-form-options">
2815
+ <div class="submenu-box">
2816
+ <div class="submenu-pad">
2817
+ <ul id="submenu" class="configuration">
2818
+ <li>
2819
+ <a id="general" class="fm_fieldset_tab" onclick="form_maker_options_tabs('general')" href="#">General Options</a>
2820
+ </li>
2821
+ <li>
2822
+ <a id="custom" class="fm_fieldset_tab" onclick="form_maker_options_tabs('custom')" href="#">Email Options</a>
2823
+ </li>
2824
+ <li>
2825
+ <a id="actions" class="fm_fieldset_tab" onclick="form_maker_options_tabs('actions')" href="#">Actions after Submission</a>
2826
+ </li>
2827
+ <li>
2828
+ <a id="payment" class="fm_fieldset_tab" onclick="form_maker_options_tabs('payment')" href="#">Payment Options</a>
2829
+ </li>
2830
+ <li>
2831
+ <a id="javascript" class="fm_fieldset_tab" onclick="form_maker_options_tabs('javascript'); codemirror_for_javascript();" href="#">JavaScript</a>
2832
+ </li>
2833
+ <li>
2834
+ <a id="conditions" class="fm_fieldset_tab" onclick="form_maker_options_tabs('conditions')" href="#">Conditional Fields</a>
2835
+ </li>
2836
+ <li>
2837
+ <a id="mapping" class="fm_fieldset_tab" onclick="form_maker_options_tabs('mapping')" href="#" >MySQL Mapping</a>
2838
+ </li>
2839
+ <?php
2840
+ foreach($addons as $addon => $addon_name) {
2841
+ if (defined($addon) && is_plugin_active(constant($addon))) {
2842
+ ?>
2843
+ <li>
2844
+ <a id="<?php echo $addon;?>" class="fm_fieldset_tab" onclick="form_maker_options_tabs('<?php echo $addon;?>')" href="#" ><?php echo $addon_name;?></a>
2845
+ </li>
2846
+ <?php
2847
+ }
2848
+ }
2849
+ ?>
2850
+ </ul>
2851
+ </div>
2852
+ </div>
2853
+ <fieldset id="general_fieldset" class="adminform fm_fieldset_deactive">
2854
+ <legend>General Options</legend>
2855
+ <table class="admintable" >
2856
+ <tr valign="top">
2857
+ <td class="fm_options_label">
2858
+ <label>Published</label>
2859
+ </td>
2860
+ <td class="fm_options_value">
2861
+ <button class="fm-checkbox-radio-button <?php echo $row->published == 1 ? 'fm-yes' : 'fm-no' ?>" onclick="fm_change_radio(this); return false;" value="<?php echo $row->published; ?>">
2862
+ <span></span>
2863
+ </button>
2864
+ <input type="hidden" name="published" value="<?php echo $row->published; ?>"/>
2865
+ </td>
2866
+ </tr>
2867
+ <tr valign="top">
2868
+ <td class="fm_options_label">
2869
+ <label>Save data(to database)</label>
2870
+ </td>
2871
+ <td class="fm_options_value">
2872
+ <button class="fm-checkbox-radio-button <?php echo $row->savedb == 1 ? 'fm-yes' : 'fm-no' ?>" onclick="fm_change_radio(this); return false;" value="<?php echo $row->savedb; ?>">
2873
+ <span></span>
2874
+ </button>
2875
+ <input type="hidden" name="savedb" value="<?php echo $row->savedb; ?>"/>
2876
+ </td>
2877
+ </tr>
2878
+ <tr valign="top">
2879
+ <td class="fm_options_label">
2880
+ <label for="theme">Theme</label>
2881
+ </td>
2882
+ <td class="fm_options_value">
2883
+ <select id="theme" name="theme" onChange="set_preview()">
2884
+ <?php
2885
+ foreach ($themes as $theme) {
2886
+ ?>
2887
+ <option value="<?php echo $theme->id; ?>" <?php echo (($theme->id == $row->theme) ? 'selected' : ''); ?>><?php echo $theme->title; ?></option>
2888
+ <?php
2889
+ }
2890
+ ?>
2891
+ </select>
2892
+ <button id="preview_form" class="fm-button preview-button small" onclick="tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerPreview', 'form_id' => $row->id, 'test_theme' => $row->theme, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>'); return false;">
2893
+ <span></span>
2894
+ Preview
2895
+ </button>
2896
+ <button id="edit_css" class="fm-button options-edit-button small" onclick="tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerEditCSS', 'id' => $row->theme, 'form_id' => $row->id, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>'); return false;">
2897
+ <span></span>
2898
+ Edit CSS
2899
+ </button>
2900
+ </td>
2901
+ </tr>
2902
+ <tr valign="top">
2903
+ <td class="fm_options_label">
2904
+ <label for="requiredmark">Required fields mark</label>
2905
+ </td>
2906
+ <td class="fm_options_value">
2907
+ <input type="text" id="requiredmark" name="requiredmark" value="<?php echo $row->requiredmark; ?>" style="width:250px;" />
2908
+ </td>
2909
+ </tr>
2910
+ <tr valign="top">
2911
+ <td class="fm_options_label">
2912
+ <label>Save Uploads</label>
2913
+ </td>
2914
+ <td class="fm_options_value">
2915
+ <button class="fm-checkbox-radio-button <?php echo $row->save_uploads == 1 ? 'fm-yes' : 'fm-no' ?>" onclick="fm_change_radio(this); return false;" value="<?php echo $row->save_uploads; ?>">
2916
+ <span></span>
2917
+ </button>
2918
+ <input type="hidden" name="save_uploads" value="<?php echo $row->save_uploads; ?>"/>
2919
+ </td>
2920
+ </tr>
2921
+ </table>
2922
+ <br/>
2923
+ <div class="error_fm" style="padding: 5px; font-size: 14px;">Front end submissions are disabled in free version.</div>
2924
+ <fieldset class="adminform">
2925
+ <legend>Front end submissions access level</legend>
2926
+ <table>
2927
+ <tr>
2928
+ <td class="key">
2929
+ <label for="name">Allow User to see submissions:</label>
2930
+ </td>
2931
+ <td>
2932
+ <?php
2933
+ $checked_UserGroup=explode(',',$row->user_id_wd);
2934
+ $i = 0;
2935
+ foreach($userGroups as $val => $uG) {
2936
+ echo '<input type="checkbox" value="'.$val .'" id="user_'.$i.'"';
2937
+ if(in_array($val ,$checked_UserGroup))
2938
+ echo 'checked="checked"';
2939
+ echo 'onchange="acces_level('.count($userGroups).')" disabled/><label for="user_'.$i.'">'.$uG["name"].'</label><br>';
2940
+ $i++;
2941
+ }
2942
+ ?>
2943
+ <input type="checkbox" value="guest" id="user_<?php echo $i; ?>" onchange="acces_level(<?php echo count($userGroups); ?>)"<?php echo (in_array('guest', $checked_UserGroup) ? 'checked="checked"' : '') ?> disabled/><label for="user_<?php echo $i; ?>">Guest</label>
2944
+ <input type="hidden" name="user_id_wd" value="<?php echo $row->user_id_wd ?>" id="user_id_wd" />
2945
+ </td>
2946
+ </tr>
2947
+ </table>
2948
+ </fieldset>
2949
+ <?php
2950
+ $labels_for_submissions = $this->model->get_labels($id);
2951
+ $payment_info = $this->model->is_paypal($id);
2952
+ $labels_id_for_submissions= array();
2953
+ $label_titles_for_submissions=array();
2954
+ $labels_type_for_submissions= array();
2955
+ if($labels_for_submissions) {
2956
+ $label_id_for_submissions= array();
2957
+ $label_order_original_for_submissions= array();
2958
+ $label_type_for_submissions= array();
2959
+
2960
+ if(strpos($row->label_order, 'type_paypal_')) {
2961
+ $row->label_order=$row->label_order."item_total#**id**#Item Total#**label**#type_paypal_payment_total#****#total#**id**#Total#**label**#type_paypal_payment_total#****#0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
2962
+ }
2963
+
2964
+ $label_all_for_submissions = explode('#****#',$row->label_order);
2965
+ $label_all_for_submissions = array_slice($label_all_for_submissions,0, count($label_all_for_submissions)-1);
2966
+ foreach($label_all_for_submissions as $key => $label_each) {
2967
+ $label_id_each=explode('#**id**#',$label_each);
2968
+ array_push($label_id_for_submissions, $label_id_each[0]);
2969
+ $label_order_each=explode('#**label**#', $label_id_each[1]);
2970
+ array_push($label_order_original_for_submissions, $label_order_each[0]);
2971
+ array_push($label_type_for_submissions, $label_order_each[1]);
2972
+ }
2973
+
2974
+ foreach($label_id_for_submissions as $key => $label) {
2975
+ if(in_array($label, $labels_for_submissions)) {
2976
+ array_push($labels_type_for_submissions, $label_type_for_submissions[$key]);
2977
+ array_push($labels_id_for_submissions, $label);
2978
+ array_push($label_titles_for_submissions, $label_order_original_for_submissions[$key]);
2979
+ }
2980
+ }
2981
+ }
2982
+
2983
+ $stats_labels = array();
2984
+ $stats_labels_ids = array();
2985
+ foreach($labels_type_for_submissions as $key => $label_type_cur) {
2986
+ if($label_type_cur=="type_checkbox" || $label_type_cur=="type_radio" || $label_type_cur=="type_own_select" || $label_type_cur=="type_country" || $label_type_cur=="type_paypal_select" || $label_type_cur=="type_paypal_radio" || $label_type_cur=="type_paypal_checkbox" || $label_type_cur=="type_paypal_shipping") {
2987
+ $stats_labels_ids[] = $labels_id_for_submissions[$key];
2988
+ $stats_labels[] = $label_titles_for_submissions[$key];
2989
+ }
2990
+ }
2991
+ ?>
2992
+ <script type="text/javascript">
2993
+ function inArray(needle, myarray) {
2994
+ var length = myarray.length;
2995
+ for(var i = 0; i < length; i++) {
2996
+ if(myarray[i] == needle) return true;
2997
+ }
2998
+ return false;
2999
+ }
3000
+
3001
+ function checked_labels(class_name) {
3002
+ var checked_ids ='';
3003
+ jQuery('.'+class_name).each(function() {
3004
+ if(this.checked) {
3005
+ checked_ids += this.value+',';
3006
+ }
3007
+ });
3008
+
3009
+ if(class_name == 'filed_label') {
3010
+ document.getElementById("frontend_submit_fields").value = checked_ids ;
3011
+ if(checked_ids == document.getElementById("all_fields").value)
3012
+ document.getElementById("all_fields").checked = true;
3013
+ else
3014
+ document.getElementById("all_fields").checked = false;
3015
+ }
3016
+ else {
3017
+ document.getElementById("frontend_submit_stat_fields").value = checked_ids ;
3018
+ if(checked_ids == document.getElementById("all_stats_fields").value)
3019
+ document.getElementById("all_stats_fields").checked = true;
3020
+ else
3021
+ document.getElementById("all_stats_fields").checked = false;
3022
+ }
3023
+ }
3024
+
3025
+ jQuery(document).ready(function () {
3026
+ jQuery('.filed_label').each(function() {
3027
+ if(document.getElementById("frontend_submit_fields").value == document.getElementById("all_fields").value)
3028
+ document.getElementById("all_fields").checked = true;
3029
+ if(inArray(this.value, document.getElementById("frontend_submit_fields").value.split(","))) {
3030
+ this.checked = true;
3031
+ }
3032
+ });
3033
+
3034
+ jQuery('.stats_filed_label').each(function() {
3035
+ if(document.getElementById("frontend_submit_stat_fields").value == document.getElementById("all_stats_fields").value)
3036
+ document.getElementById("all_stats_fields").checked = true;
3037
+ if(inArray(this.value, document.getElementById("frontend_submit_stat_fields").value.split(","))) {
3038
+ this.checked = true;
3039
+ }
3040
+ });
3041
+
3042
+ jQuery(document).on('change','input[name="all_fields"]',function() {
3043
+ jQuery('.filed_label').prop("checked" , this.checked);
3044
+ });
3045
+
3046
+ jQuery(document).on('change','input[name="all_stats_fields"]',function() {
3047
+ jQuery('.stats_filed_label').prop("checked" , this.checked);
3048
+ });
3049
+ });
3050
+ </script>
3051
+ <style>
3052
+ li{
3053
+ list-style-type: none;
3054
+ }
3055
+
3056
+ .simple_table {
3057
+ padding-left: 0px !important;
3058
+ }
3059
+
3060
+ .simple_table input, .simple_table label, .simple_table img {
3061
+ display:inline-block !important;
3062
+ float:none !important;
3063
+ }
3064
+ </style>
3065
+ <fieldset class="adminform">
3066
+ <legend>Fields to hide in frontend submissions</legend>
3067
+ <?php if(count($label_titles_for_submissions)): ?>
3068
+ <table style="margin-left:-3px;">
3069
+ <tr>
3070
+ <td>
3071
+ <label>Select fields:</label>
3072
+ </td>
3073
+ <td class="simple_table">
3074
+ <ul id="form_fields">
3075
+ <li>
3076
+ <input type="checkbox" name="all_fields" id="all_fields" value="submit_id,<?php echo implode(',',$labels_id_for_submissions)."," . ($payment_info ? "payment_info" : ""); ?>" onclick="checked_labels('filed_label')"/>
3077
+ <label for="all_fields">Select All</label>
3078
+ </li>
3079
+ <?php
3080
+ echo "<li><input type=\"checkbox\" id=\"submit_id\" name=\"submit_id\" value=\"submit_id\" class=\"filed_label\" onclick=\"checked_labels('filed_label')\"><label for=\"submit_id\">ID</label></li>";
3081
+
3082
+ for($i=0, $n=count($label_titles_for_submissions); $i < $n ; $i++)
3083
+ {
3084
+ $field_label = $label_titles_for_submissions[$i];
3085
+
3086
+ echo "<li><input type=\"checkbox\" id=\"filed_label".$i."\" name=\"filed_label".$i."\" value=\"".$labels_id_for_submissions[$i]."\" class=\"filed_label\" onclick=\"checked_labels('filed_label')\"><label for=\"filed_label".$i."\">".(strlen($field_label) > 80 ? substr ($field_label ,0, 80).'...' : $field_label)."</label></li>";
3087
+
3088
+ }
3089
+ if($payment_info)
3090
+ echo "<li><input type=\"checkbox\" id=\"payment_info\" name=\"payment_info\" value=\"payment_info\" class=\"filed_label\" onclick=\"checked_labels('filed_label')\"><label for=\"payment_info\">Payment Info</label></li>";
3091
+ ?>
3092
+ </ul>
3093
+ <input type="hidden" name="frontend_submit_fields" value="<?php echo $row->frontend_submit_fields ?>" id="frontend_submit_fields" />
3094
+ </td>
3095
+ </tr>
3096
+ <?php if($stats_labels): ?>
3097
+ <tr id="stats">
3098
+ <td>
3099
+ <label>Stats fields:</label>
3100
+ </td>
3101
+ <td class="simple_table">
3102
+ <ul id="stats_fields">
3103
+ <li>
3104
+ <input type="checkbox" name="all_stats_fields" id="all_stats_fields" value="<?php echo implode(',',$stats_labels_ids).","; ?>" onclick="checked_labels('stats_filed_label')">
3105
+ <label for="all_stats_fields">Select All</label>
3106
+ </li>
3107
+ <?php
3108
+ for($i=0, $n=count($stats_labels); $i < $n ; $i++)
3109
+ {
3110
+ $field_label = $stats_labels[$i];
3111
+ echo "<li><input type=\"checkbox\" id=\"stats_filed_label".$i."\" name=\"stats_filed_label".$i."\" value=\"".$stats_labels_ids[$i]."\" class=\"stats_filed_label\" onclick=\"checked_labels('stats_filed_label')\" ><label for=\"stats_filed_label".$i."\">".(strlen($field_label) > 80 ? substr ($field_label ,0, 80).'...' : $field_label)."</label></li>";
3112
+ }
3113
+ ?>
3114
+ </ul>
3115
+ <input type="hidden" name="frontend_submit_stat_fields" value="<?php echo $row->frontend_submit_stat_fields ?>" id="frontend_submit_stat_fields" />
3116
+ </td>
3117
+ </tr>
3118
+ <?php endif; ?>
3119
+ </table>
3120
+ <?php endif; ?>
3121
+ </fieldset>
3122
+ </fieldset>
3123
+ <fieldset id="custom_fieldset" class="adminform fm_fieldset_deactive">
3124
+ <legend>Email Options</legend>
3125
+ <table class="admintable">
3126
+ <tr valign="top">
3127
+ <td style="width: 75px; vertical-align: middle;">
3128
+ <label>Send E-mail</label>
3129
+ </td>
3130
+ <td style="padding: 15px;">
3131
+ <button class="fm-checkbox-radio-button <?php echo $row->sendemail == 1 ? 'fm-yes' : 'fm-no' ?>" onclick="fm_change_radio(this); return false;" value="<?php echo $row->sendemail; ?>">
3132
+ <span></span>
3133
+ </button>
3134
+ <input type="hidden" name="sendemail" value="<?php echo $row->sendemail; ?>"/>
3135
+ </td>
3136
+ </tr>
3137
+ </table>
3138
+ <fieldset class="adminform fm_mail_options">
3139
+ <legend>Email to Administrator</legend>
3140
+ <table class="admintable">
3141
+ <tr valign="top">
3142
+ <td class="fm_options_label">
3143
+ <label for="mailToAdd">Email to send submissions to</label>
3144
+ </td>
3145
+ <td class="fm_options_value">
3146
+ <input type="text" id="mailToAdd" name="mailToAdd" style="width: 250px;" />
3147
+ <input type="hidden" id="mail" name="mail" value="<?php echo $row->mail . ($row->mail && (substr($row->mail, -1) != ',') ? ',' : ''); ?>" />
3148
+ <img src="<?php echo WD_FM_URL . '/images/add.png?ver='. get_option("wd_form_maker_version"); ?>" style="vertical-align: middle; cursor: pointer;" title="Add more emails" onclick="if (fm_check_email('mailToAdd')) {return false;};cfm_create_input('mail', 'mailToAdd', 'cfm_mail_div', '<?php echo WD_FM_URL; ?>')" />
3149
+ <div id="cfm_mail_div">
3150
+ <?php
3151
+ $mail_array = explode(',', $row->mail);
3152
+ foreach ($mail_array as $mail) {
3153
+ if ($mail && $mail != ',') {
3154
+ ?>
3155
+ <div class="fm_mail_input">
3156
+ <?php echo $mail; ?>
3157
+ <img src="<?php echo WD_FM_URL; ?>/images/delete.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" class="fm_delete_img" onclick="fm_delete_mail(this, '<?php echo $mail; ?>')" title="Delete Email" />
3158
+ </div>
3159
+ <?php
3160
+ }
3161
+ }
3162
+ ?>
3163
+ </div>
3164
+ </td>
3165
+ </tr>
3166
+ <tr valign="top">
3167
+ <td class="fm_options_label">
3168
+ <label for="from_mail">Email From</label>
3169
+ </td>
3170
+ <td class="fm_options_value">
3171
+ <?php
3172
+ $is_other = TRUE;
3173
+ for ($i = 0; $i < $fields_count - 1; $i++) {
3174
+ ?>
3175
+ <div>
3176
+ <input type="radio" name="from_mail" id="from_mail<?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 ((strlen($fields[$i])!=1 ? substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*')+15, strlen($fields[$i])) : $fields[$i]) == $row->from_mail ? 'checked="checked"' : '' ); ?> onclick="wdhide('mail_from_other')" />
3177
+ <label for="from_mail<?php echo $i; ?>"><?php echo substr($fields[$i + 1], 0, strpos($fields[$i + 1], '*:*w_field_label*:*')); ?></label>
3178
+ </div>
3179
+ <?php
3180
+ if(strlen($fields[$i])!=1) {
3181
+ if (substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*') + 15, strlen($fields[$i])) == $row->from_mail) {
3182
+ $is_other = FALSE;
3183
+ }
3184
+ }
3185
+ else {
3186
+ if($fields[$i] == $row->from_mail)
3187
+ $is_other=false;
3188
+ }
3189
+ }
3190
+ ?>
3191
+ <div style="<?php echo ($fields_count == 1) ? 'display:none;' : ''; ?>">
3192
+ <input type="radio" id="other" name="from_mail" value="other" <?php echo ($is_other) ? 'checked="checked"' : ''; ?> onclick="wdshow('mail_from_other')" />
3193
+ <label for="other">Other</label>
3194
+ </div>
3195
+ <input type="text" 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 : ''; ?>" />
3196
+ </td>
3197
+ </tr>
3198
+ <tr valign="top">
3199
+ <td class="fm_options_label">
3200
+ <label for="from_name">From Name</label>
3201
+ </td>
3202
+ <td class="fm_options_value">
3203
+ <input type="text" id="from_name" name="from_name" value="<?php echo $row->from_name; ?>" style="width: 250px;" />
3204
+ <img src="<?php echo WD_FM_URL . '/images/add.png?ver='. get_option("wd_form_maker_version").''; ?>" onclick="document.getElementById('mail_from_labels').style.display='block';" style="vertical-align: middle; cursor: pointer;display:inline-block; margin:0px; float:none;">
3205
+ <?php
3206
+ $choise = "document.getElementById('from_name')";
3207
+ echo '<div style="position:relative; top:-3px;"><div id="mail_from_labels" class="email_labels" style="display:none;">';
3208
+ echo "<a onClick=\"insertAtCursor(".$choise.",'username'); document.getElementById('mail_from_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Username</a>";
3209
+ for($i=0; $i<count($label_label); $i++) {
3210
+ 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")
3211
+ continue;
3212
+
3213
+ $param = htmlspecialchars(addslashes($label_label[$i]));
3214
+ $fld_label = $param;
3215
+ if(strlen($fld_label)>30) {
3216
+ $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3217
+ $fld_label = explode("\n", $fld_label);
3218
+ $fld_label = $fld_label[0] . ' ...';
3219
+ }
3220
+
3221
+ echo "<a onClick=\"insertAtCursor(".$choise.",'".$param."'); document.getElementById('mail_from_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">".$fld_label."</a>";
3222
+ }
3223
+ echo "<a onClick=\"insertAtCursor(".$choise.",'subid'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Submission ID</a>";
3224
+
3225
+ echo "<a onClick=\"insertAtCursor(".$choise.",'username'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Username</a>";
3226
+ echo '</div></div>';
3227
+ ?>
3228
+ </td>
3229
+ </tr>
3230
+ <tr valign="top">
3231
+ <td class="fm_options_label">
3232
+ <label for="reply_to">Reply to<br/>(if different from "Email From") </label>
3233
+ </td>
3234
+ <td class="fm_options_value">
3235
+ <?php
3236
+ $is_other = TRUE;
3237
+ for ($i = 0; $i < $fields_count - 1; $i++) {
3238
+ ?>
3239
+ <div>
3240
+ <input type="radio" name="reply_to" id="reply_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 ((strlen($fields[$i])!=1 ? substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*')+15, strlen($fields[$i])) : $fields[$i]) == $row->reply_to ? 'checked="checked"' : '' ); ?> onclick="wdhide('reply_to_other')" />
3241
+ <label for="reply_to<?php echo $i; ?>"><?php echo substr($fields[$i + 1], 0, strpos($fields[$i + 1], '*:*w_field_label*:*')); ?></label>
3242
+ </div>
3243
+ <?php
3244
+ if(strlen($fields[$i])!=1) {
3245
+ if (substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*') + 15, strlen($fields[$i])) == $row->reply_to) {
3246
+ $is_other = FALSE;
3247
+ }
3248
+ }
3249
+ else {
3250
+ if($fields[$i] == $row->reply_to)
3251
+ $is_other=false;
3252
+ }
3253
+ }
3254
+ ?>
3255
+ <div style="<?php echo ($fields_count == 1) ? 'display: none;' : ''; ?>">
3256
+ <input type="radio" id="other1" name="reply_to" value="other" <?php echo ($is_other) ? 'checked="checked"' : ''; ?> onclick="wdshow('reply_to_other')" />
3257
+ <label for="other1">Other</label>
3258
+ </div>
3259
+ <input type="text" 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 : ''; ?>" />
3260
+ </td>
3261
+ </tr>
3262
+ <tr valign="top">
3263
+ <td class="fm_options_label">
3264
+ <label> CC: </label>
3265
+ </td>
3266
+ <td class="fm_options_value">
3267
+ <input type="text" id="mail_cc" name="mail_cc" value="<?php echo $row->mail_cc ?>" style="width:250px;" />
3268
+ </td>
3269
+ </tr>
3270
+ <tr valign="top">
3271
+ <td class="fm_options_label">
3272
+ <label> BCC: </label>
3273
+ </td>
3274
+ <td class="fm_options_value">
3275
+ <input type="text" id="mail_bcc" name="mail_bcc" value="<?php echo $row->mail_bcc ?>" style="width:250px;" />
3276
+ </td>
3277
+ </tr>
3278
+ <tr valign="top">
3279
+ <td class="fm_options_label">
3280
+ <label> Subject: </label>
3281
+ </td>
3282
+ <td class="fm_options_value">
3283
+ <input type="text" id="mail_subject" name="mail_subject" value="<?php echo $row->mail_subject ?>" style="width:250px;" />
3284
+ <img src="<?php echo WD_FM_URL . '/images/add.png?ver='. get_option("wd_form_maker_version").''; ?>" onclick="document.getElementById('mail_subject_labels').style.display='block';" style="vertical-align: middle;cursor: pointer; display:inline-block; margin:0px; float:none;">
3285
+ <?php
3286
+ $choise = "document.getElementById('mail_subject')";
3287
+ echo '<div style="position:relative; top:-3px;"><div id="mail_subject_labels" class="email_labels" style="display:none;">';
3288
+ for($i=0; $i<count($label_label); $i++) {
3289
+ 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")
3290
+ continue;
3291
+
3292
+ $param = htmlspecialchars(addslashes($label_label[$i]));
3293
+
3294
+ $fld_label = $param;
3295
+ if(strlen($fld_label)>30)
3296
+ {
3297
+ $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3298
+ $fld_label = explode("\n", $fld_label);
3299
+ $fld_label = $fld_label[0] . ' ...';
3300
+ }
3301
+
3302
+ echo "<a onClick=\"insertAtCursor(".$choise.",'".$param."'); document.getElementById('mail_subject_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">".$fld_label."</a>";
3303
+
3304
+ }
3305
+ echo "<a onClick=\"insertAtCursor(".$choise.",'subid'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Submission ID</a>";
3306
+
3307
+ echo "<a onClick=\"insertAtCursor(".$choise.",'username'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Username</a>";
3308
+ echo '</div></div>';
3309
+ ?>
3310
+ </td>
3311
+ </tr>
3312
+ <tr valign="top">
3313
+ <td class="fm_options_label" style="vertical-align: middle;">
3314
+ <label> Mode: </label>
3315
+ </td>
3316
+ <td class="fm_options_value">
3317
+ <button name="mail_mode"class="fm-checkbox-radio-button <?php echo $row->mail_mode == 1 ? 'fm-text-yes' : 'fm-text-no' ?> medium" onclick="fm_change_radio_checkbox_text(this); return false;" value="<?php echo $row->mail_mode ?>">
3318
+ <label><?php echo $row->mail_mode == 1 ? 'HTML' : 'Text' ?></label>
3319
+ <span></span>
3320
+ </button>
3321
+ <input type="hidden" name="mail_mode" value="<?php echo $row->mail_mode; ?>"/>
3322
+ </td>
3323
+ </tr>
3324
+ <tr valign="top">
3325
+ <td class="fm_options_label" style="vertical-align: middle;">
3326
+ <label> Attach File: </label>
3327
+ </td>
3328
+ <td class="fm_options_value">
3329
+ <div class="error_fm" style="padding: 5px; font-size: 14px;">File attach is disabled in free version.</div>
3330
+ <input type="hidden" name="mail_attachment" value="<?php echo $row->mail_attachment; ?>"/>
3331
+ </td>
3332
+ </tr>
3333
+ <tr valign="top">
3334
+ <td class="fm_options_label" style="vertical-align: middle;">
3335
+ <label> Email empty fields: </label>
3336
+ </td>
3337
+ <td class="fm_options_value">
3338
+ <button class="fm-checkbox-radio-button <?php echo $row->mail_emptyfields == 1 ? 'fm-yes' : 'fm-no' ?>" onclick="fm_change_radio(this); return false;" value="<?php echo $row->mail_emptyfields; ?>">
3339
+ <span></span>
3340
+ </button>
3341
+ <input type="hidden" name="mail_emptyfields" value="<?php echo $row->mail_emptyfields; ?>"/>
3342
+ </td>
3343
+ </tr>
3344
+ <tr>
3345
+ <td class="fm_options_label" valign="top">
3346
+ <label>Custom Text in Email For Administrator</label>
3347
+ </td>
3348
+ <td class="fm_options_value">
3349
+ <div style="margin-bottom:5px">
3350
+ <?php
3351
+ $choise = "document.getElementById('script_mail')";
3352
+ for ($i = 0; $i < count($label_label); $i++) {
3353
+ 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_send_copy")
3354
+ continue;
3355
+
3356
+ $param = htmlspecialchars(addslashes($label_label[$i]));
3357
+ $fld_label = $param;
3358
+ if(strlen($fld_label)>30) {
3359
+ $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3360
+ $fld_label = explode("\n", $fld_label);
3361
+ $fld_label = $fld_label[0] . ' ...';
3362
+ }
3363
+
3364
+ if($label_type[$i]=="type_file_upload")
3365
+ $fld_label .= '(as image)';
3366
+ ?>
3367
+ <input style="border: 1px solid silver; font-size: 10px;" type="button" value="<?php echo $fld_label; ?>" onClick="insertAtCursor(<?php echo $choise; ?>, '<?php echo $param; ?>')" />
3368
+ <?php
3369
+ }
3370
+ ?>
3371
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Submission ID" onClick="insertAtCursor(<?php echo $choise; ?>,'subid')" />
3372
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Ip" onClick="insertAtCursor(<?php echo $choise; ?>,'ip')" />
3373
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Username" onClick="insertAtCursor(<?php echo $choise; ?>,'username')" />
3374
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="User Email" onClick="insertAtCursor(<?php echo $choise; ?>,'useremail')" />
3375
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="All fields list" onClick="insertAtCursor(<?php echo $choise; ?>, 'all')" />
3376
+ </div>
3377
+ <?php
3378
+ if (user_can_richedit()) {
3379
+ wp_editor($row->script_mail, 'script_mail', array('teeny' => FALSE, 'textarea_name' => 'script_mail', 'media_buttons' => FALSE, 'textarea_rows' => 5));
3380
+ }
3381
+ else {
3382
+ ?>
3383
+ <textarea name="script_mail" id="script_mail" cols="20" rows="10" style="width:300px; height:450px;"><?php echo $row->script_mail; ?></textarea>
3384
+ <?php
3385
+ }
3386
+ ?>
3387
+ </td>
3388
+ </tr>
3389
+ </table>
3390
+ </fieldset>
3391
+ <fieldset class="fm_mail_options">
3392
+ <legend>Email to User</legend>
3393
+ <table class="admintable">
3394
+ <tr valign="top">
3395
+ <td class="fm_options_label">
3396
+ <label for="mail">Send to</label>
3397
+ </td>
3398
+ <td class="fm_options_value">
3399
+ <?php
3400
+ $fields = explode('*:*id*:*type_submitter_mail*:*type*:*', $row->form_fields);
3401
+ $fields_count = count($fields);
3402
+ if ($fields_count == 1) { ?>
3403
+ There is no email field
3404
+ <?php
3405
+ }
3406
+ else {
3407
+ for ($i = 0; $i < $fields_count - 1; $i++) {
3408
+ ?>
3409
+ <div>
3410
+ <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;" />
3411
+ <label for="send_to<?php echo $i; ?>"><?php echo substr($fields[$i + 1], 0, strpos($fields[$i + 1], '*:*w_field_label*:*')); ?></label>
3412
+ </div>
3413
+ <?php
3414
+ }
3415
+ }
3416
+ ?>
3417
+ </td>
3418
+ </tr>
3419
+ <tr valign="top">
3420
+ <td class="fm_options_label">
3421
+ <label for="mail_from_user">Email From</label>
3422
+ </td>
3423
+ <td class="fm_options_value">
3424
+ <input type="text" id="mail_from_user" name="mail_from_user" value="<?php echo $row->mail_from_user; ?>" style="width: 250px;" />
3425
+ </td>
3426
+ </tr>
3427
+ <tr valign="top">
3428
+ <td class="fm_options_label">
3429
+ <label for="mail_from_name_user">From Name</label>
3430
+ </td>
3431
+ <td class="fm_options_value">
3432
+ <input type="text" id="mail_from_name_user" name="mail_from_name_user" value="<?php echo $row->mail_from_name_user; ?>" style="width: 250px;"/>
3433
+ <img src="<?php echo WD_FM_URL . '/images/add.png?ver='. get_option("wd_form_maker_version").''; ?>" onclick="document.getElementById('mail_from_name_user_labels').style.display='block';" style="vertical-align: middle;cursor: pointer; display:inline-block; margin:0px; float:none;">
3434
+ <?php
3435
+ $choise = "document.getElementById('mail_from_name_user')";
3436
+ echo '<div style="position:relative; top:-3px;"><div id="mail_from_name_user_labels" class="email_labels" style="display:none;">';
3437
+ for($i=0; $i<count($label_label); $i++) {
3438
+ 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")
3439
+ continue;
3440
+
3441
+ $param = htmlspecialchars(addslashes($label_label[$i]));
3442
+ $fld_label = $param;
3443
+ if(strlen($fld_label)>30) {
3444
+ $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3445
+ $fld_label = explode("\n", $fld_label);
3446
+ $fld_label = $fld_label[0] . ' ...';
3447
+ }
3448
+
3449
+ 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>";
3450
+ }
3451
+ echo "<a onClick=\"insertAtCursor(".$choise.",'subid'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Submission ID</a>";
3452
+ echo "<a onClick=\"insertAtCursor(".$choise.",'username'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Username</a>";
3453
+ echo '</div></div>';
3454
+ ?>
3455
+ </td>
3456
+ </tr>
3457
+ <tr valign="top">
3458
+ <td class="fm_options_label">
3459
+ <label for="reply_to_user">Reply to<br />(if different from "Email Form")</label>
3460
+ </td>
3461
+ <td class="fm_options_value">
3462
+ <input type="text" id="reply_to_user" name="reply_to_user" value="<?php echo $row->reply_to_user; ?>" style="width:250px;"/>
3463
+ </td>
3464
+ </tr>
3465
+ <tr valign="top">
3466
+ <td class="fm_options_label">
3467
+ <label> CC: </label>
3468
+ </td>
3469
+ <td class="fm_options_value">
3470
+ <input type="text" id="mail_cc_user" name="mail_cc_user" value="<?php echo $row->mail_cc_user ?>" style="width:250px;" />
3471
+ </td>
3472
+ </tr>
3473
+ <tr valign="top">
3474
+ <td class="fm_options_label">
3475
+ <label> BCC: </label>
3476
+ </td>
3477
+ <td class="fm_options_value">
3478
+ <input type="text" id="mail_bcc_user" name="mail_bcc_user" value="<?php echo $row->mail_bcc_user ?>" style="width:250px;" />
3479
+ </td>
3480
+ </tr>
3481
+ <tr valign="top">
3482
+ <td class="fm_options_label">
3483
+ <label> Subject: </label>
3484
+ </td>
3485
+ <td class="fm_options_value">
3486
+ <input type="text" id="mail_subject_user" name="mail_subject_user" value="<?php echo $row->mail_subject_user ?>" style="width:250px;" />
3487
+ <img src="<?php echo WD_FM_URL . '/images/add.png?ver='. get_option("wd_form_maker_version").''; ?>" onclick="document.getElementById('mail_subject_user_labels').style.display='block';" style="vertical-align: middle; cursor: pointer; display:inline-block; margin:0px; float:none;">
3488
+ <?php
3489
+ $choise = "document.getElementById('mail_subject_user')";
3490
+ echo '<div style="position:relative; top:-3px;"><div id="mail_subject_user_labels" class="email_labels" style="display:none;">';
3491
+ for($i=0; $i<count($label_label); $i++)
3492
+ {
3493
+ 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")
3494
+ continue;
3495
+
3496
+ $param = htmlspecialchars(addslashes($label_label[$i]));
3497
+
3498
+ $fld_label = $param;
3499
+ if(strlen($fld_label)>30)
3500
+ {
3501
+ $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3502
+ $fld_label = explode("\n", $fld_label);
3503
+ $fld_label = $fld_label[0] . ' ...';
3504
+ }
3505
+
3506
+ echo "<a onClick=\"insertAtCursor(".$choise.",'".$param."'); document.getElementById('mail_subject_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">".$fld_label."</a>";
3507
+
3508
+ }
3509
+ echo "<a onClick=\"insertAtCursor(".$choise.",'subid'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Submission ID</a>";
3510
+
3511
+ echo "<a onClick=\"insertAtCursor(".$choise.",'username'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Username</a>";
3512
+ echo '</div></div>';
3513
+ ?>
3514
+ </td>
3515
+ </tr>
3516
+ <tr valign="top">
3517
+ <td class="fm_options_label" style="vertical-align: middle;">
3518
+ <label> Mode: </label>
3519
+ </td>
3520
+ <td class="fm_options_value">
3521
+ <button name="mail_mode_user" class="fm-checkbox-radio-button <?php echo $row->mail_mode_user == 1 ? 'fm-text-yes' : 'fm-text-no' ?> medium" onclick="fm_change_radio_checkbox_text(this); return false;" value="<?php echo $row->mail_mode_user == 1 ? '1' : '0' ?>">
3522
+ <label><?php echo $row->mail_mode_user == 1 ? 'HTML' : 'Text' ?></label>
3523
+ <span></span>
3524
+ </button>
3525
+ <input type="hidden" name="mail_mode_user" value="<?php echo $row->mail_mode_user; ?>"/>
3526
+ </td>
3527
+ </tr>
3528
+ <tr valign="top">
3529
+ <td class="fm_options_label" style="vertical-align: middle;">
3530
+ <label> Attach File: </label>
3531
+ </td>
3532
+ <td class="fm_options_value">
3533
+ <div class="error_fm" style="padding: 5px; font-size: 14px;">File attach is disabled in free version.</div>
3534
+ <input type="hidden" name="mail_attachment_user" value="<?php echo $row->mail_attachment_user; ?>"/>
3535
+ </td>
3536
+ </tr>
3537
+ <tr valign="top">
3538
+ <td class="fm_options_label" style="vertical-align: middle;">
3539
+ <label> Email verification: </label>
3540
+ </td>
3541
+ <td class="fm_options_value">
3542
+ <button name="mail_verify" class="fm-checkbox-radio-button <?php echo $row->mail_verify == 1 ? 'fm-yes' : 'fm-no' ?>" onclick="fm_change_radio(this); return false;" value="<?php echo $row->mail_verify; ?>">
3543
+ <span></span>
3544
+ </button>
3545
+ <input type="hidden" name="mail_verify" value="<?php echo $row->mail_verify; ?>"/>
3546
+ </td>
3547
+ </tr>
3548
+ <tr valign="top" class="expire_link" <?php echo ($row->mail_verify==0 ? 'style="display:none;"' : '')?>>
3549
+ <td class="fm_options_label" valign="top">
3550
+ <label> Verification link expires in: </label>
3551
+ </td>
3552
+ <td class="fm_options_value">
3553
+ <input class="inputbox" type="text" name="mail_verify_expiretime" maxlength="10" value = "<?php echo ($row->mail_verify_expiretime ? $row->mail_verify_expiretime : 0); ?>" style="width:95px;" onkeypress="return check_isnum_point(event)"/><small> -- hours (0 - never expires).</small>
3554
+ </td>
3555
+ </tr>
3556
+ <tr>
3557
+ <td class="fm_options_label" valign="top">
3558
+ <label>Custom Text in Email For User</label>
3559
+ </td>
3560
+ <td class="fm_options_value">
3561
+ <div style="margin-bottom:5px">
3562
+ <?php
3563
+ $choise = "document.getElementById('script_mail_user')";
3564
+ for ($i = 0; $i < count($label_label); $i++) {
3565
+ 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")
3566
+ continue;
3567
+
3568
+ $param = htmlspecialchars(addslashes($label_label[$i]));
3569
+ $fld_label = $param;
3570
+ if(strlen($fld_label)>30) {
3571
+ $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3572
+ $fld_label = explode("\n", $fld_label);
3573
+ $fld_label = $fld_label[0] . ' ...';
3574
+ }
3575
+ if($label_type[$i]=="type_file_upload")
3576
+ $fld_label .= '(as image)';
3577
+ ?>
3578
+ <input style="border: 1px solid silver; font-size: 10px;" type="button" value="<?php echo $fld_label; ?>" onClick="insertAtCursor(<?php echo $choise; ?>, '<?php echo $param; ?>')" />
3579
+ <?php
3580
+ }
3581
+ ?>
3582
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Submission ID" onClick="insertAtCursor(<?php echo $choise; ?>,'subid')" />
3583
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Ip" onClick="insertAtCursor(<?php echo $choise; ?>,'ip')" />
3584
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Username" onClick="insertAtCursor(<?php echo $choise; ?>,'username')" />
3585
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="User Email" onClick="insertAtCursor(<?php echo $choise; ?>,'useremail')" />
3586
+ <input style="border: 1px solid silver; font-size: 10px; margin:3px;" type="button" value="All fields list" onClick="insertAtCursor(<?php echo $choise; ?>, 'all')" />
3587
+ <div class="verification_div" <?php echo ($row->mail_verify==0 ? 'style="display:none;"' : '')?>><input style="border: 1px solid silver; font-size: 10px; margin:3px;" type="button" value="Verification link" onClick="insertAtCursor(<?php echo $choise; ?>,'Verification link')" /> </div>
3588
+ </div>
3589
+ <?php
3590
+ if (user_can_richedit()) {
3591
+ wp_editor($row->script_mail_user, 'script_mail_user', array('teeny' => FALSE, 'textarea_name' => 'script_mail_user', 'media_buttons' => FALSE, 'textarea_rows' => 5));
3592
+ }
3593
+ else {
3594
+ ?>
3595
+ <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>
3596
+ <?php
3597
+ }
3598
+ ?>
3599
+ </td>
3600
+ </tr>
3601
+ </table>
3602
+ </fieldset>
3603
+ </fieldset>
3604
+ <fieldset id="actions_fieldset" class="adminform fm_fieldset_deactive">
3605
+ <legend>Actions after submission</legend>
3606
+ <table class="admintable">
3607
+ <tr valign="top">
3608
+ <td class="fm_options_label">
3609
+ <label>Action type</label>
3610
+ </td>
3611
+ <td class="fm_options_value">
3612
+ <div>
3613
+ <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" : ""; ?> />
3614
+ <label for="text_type_none">Stay on Form</label>
3615
+ </div>
3616
+ <div>
3617
+ <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" : ""; ?> />
3618
+ <label for="text_type_post">Post</label>
3619
+ </div>
3620
+ <div>
3621
+ <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" : ""; ?> />
3622
+ <label for="text_type_page">Page</label>
3623
+ </div>
3624
+ <div>
3625
+ <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" : ""; ?> />
3626
+ <label for="text_type_custom_text">Custom Text</label>
3627
+ </div>
3628
+ <div>
3629
+ <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" : ""; ?> />
3630
+ <label for="text_type_url">URL</label>
3631
+ </div>
3632
+ </td>
3633
+ </tr>
3634
+ <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"' : ''); ?>>
3635
+ <td class="fm_options_label">
3636
+ <label>Stay on Form</label>
3637
+ </td>
3638
+ <td class="fm_options_value">
3639
+ <img src="<?php echo WD_FM_URL . '/images/tick.png'; ?>" border="0">
3640
+ </td>
3641
+ </tr>
3642
+ <tr id="post" <?php echo (($row->submit_text_type != 2) ? 'style="display:none"' : ''); ?>>
3643
+ <td class="fm_options_label">
3644
+ <label for="post_name">Post</label>
3645
+ </td>
3646
+ <td class="fm_options_value">
3647
+ <select id="post_name" name="post_name">
3648
+ <option value="0">- Select Post -</option>
3649
+ <?php
3650
+ $args = array('posts_per_page' => 10000);
3651
+ query_posts($args);
3652
+ while (have_posts()) : the_post(); ?>
3653
+ <option value="<?php $x = get_permalink(get_the_ID()); echo $x; ?>" <?php echo (($row->article_id == $x) ? 'selected="selected"' : ''); ?>><?php the_title(); ?></option>
3654
+ <?php
3655
+ endwhile;
3656
+ wp_reset_query();
3657
+ ?>
3658
+ </select>
3659
+ </td>
3660
+ </tr>
3661
+ <tr id="page" <?php echo (($row->submit_text_type != 5) ? 'style="display:none"' : ''); ?>>
3662
+ <td class="fm_options_label">
3663
+ <label for="page_name">Page</label>
3664
+ </td>
3665
+ <td class="fm_options_value">
3666
+ <select id="page_name" name="page_name">
3667
+ <option value="0">- Select Page -</option>
3668
+ <?php
3669
+ $pages = get_pages();
3670
+ foreach ($pages as $page) {
3671
+ $page_id = get_page_link($page->ID);
3672
+ ?>
3673
+ <option value="<?php echo $page_id; ?>" <?php echo (($row->article_id == $page_id) ? 'selected="selected"' : ''); ?>><?php echo $page->post_title; ?></option>
3674
+ <?php
3675
+ }
3676
+ wp_reset_query();
3677
+ ?>
3678
+ </select>
3679
+ </td>
3680
+ </tr>
3681
+ <tr id="custom_text" <?php echo (($row->submit_text_type != 3) ? 'style="display: none;"' : ''); ?>>
3682
+ <td class="fm_options_label">
3683
+ <label for="submit_text">Text</label>
3684
+ </td>
3685
+ <td class="fm_options_value">
3686
+ <?php $choise = "document.getElementById('submit_text')";
3687
+ for ($i = 0; $i < count($label_label); $i++) {
3688
+ 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_send_copy" || $label_type[$i]=="type_file_upload")
3689
+ continue;
3690
+
3691
+ $param = htmlspecialchars(addslashes($label_label[$i]));
3692
+ $fld_label = $param;
3693
+ if(strlen($fld_label)>30) {
3694
+ $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3695
+ $fld_label = explode("\n", $fld_label);
3696
+ $fld_label = $fld_label[0] . ' ...';
3697
+ }
3698
+
3699
+ ?>
3700
+ <input style="border: 1px solid silver; font-size: 10px;" type="button" value="<?php echo $fld_label; ?>" onClick="insertAtCursor(<?php echo $choise; ?>, '<?php echo $param; ?>')" />
3701
+ <?php
3702
+ }
3703
+ ?>
3704
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Submission ID" onClick="insertAtCursor(<?php echo $choise; ?>,'subid')" />
3705
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Ip" onClick="insertAtCursor(<?php echo $choise; ?>,'ip')" />
3706
+ <input style="border: 1px solid silver; font-size: 10px; margin:3px;" type="button" value="User Id" onClick="insertAtCursor(<?php echo $choise; ?>, 'userid')" />
3707
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Username" onClick="insertAtCursor(<?php echo $choise; ?>,'username')" />
3708
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="User Email" onClick="insertAtCursor(<?php echo $choise; ?>,'useremail')" />
3709
+ <?php
3710
+ if (user_can_richedit()) {
3711
+ wp_editor($row->submit_text, 'submit_text', array('teeny' => FALSE, 'textarea_name' => 'submit_text', 'media_buttons' => FALSE, 'textarea_rows' => 5));
3712
+ }
3713
+ else {
3714
+ ?>
3715
+ <textarea cols="36" rows="5" id="submit_text" name="submit_text" style="resize: vertical;">
3716
+ <?php echo $row->submit_text; ?>
3717
+ </textarea>
3718
+ <?php
3719
+ }
3720
+ ?>
3721
+ </td>
3722
+ </tr>
3723
+ <tr id="url" <?php echo (($row->submit_text_type != 4 ) ? 'style="display:none"' : ''); ?>>
3724
+ <td class="fm_options_label">
3725
+ <label for="url">URL</label>
3726
+ </td>
3727
+ <td class="fm_options_value">
3728
+ <input type="text" id="url" name="url" style="width:300px" value="<?php echo $row->url; ?>" />
3729
+ </td>
3730
+ </tr>
3731
+ </table>
3732
+ </fieldset>
3733
+ <fieldset id="payment_fieldset" class="adminform fm_fieldset_deactive">
3734
+ <legend>Payment Options</legend>
3735
+ <table class="admintable">
3736
+ <tr>
3737
+ <td colspan="2">
3738
+ <div class="error_fm" style="padding: 5px; font-size: 14px;">Paypal Options are disabled in free version.</div>
3739
+ </td>
3740
+ </tr>
3741
+ <tr valign="top">
3742
+ <td class="fm_options_label">
3743
+ <label>Turn Paypal On</label>
3744
+ </td>
3745
+ <td class="fm_options_value">
3746
+ <button name="paypal_mode" class="fm-checkbox-radio-button <?php echo $row->paypal_mode == 1 ? 'fm-text-yes' : 'fm-text-no' ?> small" onclick="fm_change_radio_checkbox_text(this); return false;" value="<?php echo $row->paypal_mode == 1 ? '1' : '0' ?>" disabled="disabled">
3747
+ <label><?php echo $row->paypal_mode == 1 ? 'On' : 'Off' ?></label>
3748
+ <span></span>
3749
+ </button>
3750
+ <input type="hidden" name="paypal_mode" value="<?php echo $row->paypal_mode; ?>"/>
3751
+ </td>
3752
+ </tr>
3753
+ <tr valign="top">
3754
+ <td class="fm_options_label">
3755
+ <label>Checkout Mode</label>
3756
+ </td>
3757
+ <td class="fm_options_value">
3758
+ <button name="checkout_mode" class="fm-checkbox-radio-button <?php echo $row->checkout_mode == 1 ? 'fm-text-yes' : 'fm-text-no' ?> large" onclick="fm_change_radio_checkbox_text(this); return false;" value="<?php echo $row->checkout_mode == 1 ? '1' : '0' ?>" disabled="disabled">
3759
+ <label><?php echo $row->checkout_mode == 1 ? 'Production' : 'Testmode' ?></label>
3760
+ <span></span>
3761
+ </button>
3762
+ <input type="hidden" name="checkout_mode" value="<?php echo $row->checkout_mode; ?>"/>
3763
+ </td>
3764
+ </tr>
3765
+ <tr valign="top">
3766
+ <td class="fm_options_label">
3767
+ <label for="paypal_email">Paypal email</label>
3768
+ </td>
3769
+ <td class="fm_options_value">
3770
+ <input type="text" name="paypal_email" id="paypal_email" value="<?php echo $row->paypal_email; ?>" class="text_area" style="width:250px" disabled="disabled">
3771
+ </td>
3772
+ </tr>
3773
+ <tr valign="top">
3774
+ <td class="fm_options_label">
3775
+ <label for="payment_currency">Payment Currency</label>
3776
+ </td>
3777
+ <td class="fm_options_value">
3778
+ <select id="payment_currency" name="payment_currency" disabled="disabled">
3779
+ <option value="USD" <?php echo (($row->payment_currency == 'USD') ? 'selected' : ''); ?>>$ &#8226; U.S. Dollar</option>
3780
+ <option value="EUR" <?php echo (($row->payment_currency == 'EUR') ? 'selected' : ''); ?>>&#8364; &#8226; Euro</option>
3781
+ <option value="GBP" <?php echo (($row->payment_currency == 'GBP') ? 'selected' : ''); ?>>&#163; &#8226; Pound Sterling</option>
3782
+ <option value="JPY" <?php echo (($row->payment_currency == 'JPY') ? 'selected' : ''); ?>>&#165; &#8226; Japanese Yen</option>
3783
+ <option value="CAD" <?php echo (($row->payment_currency == 'CAD') ? 'selected' : ''); ?>>C$ &#8226; Canadian Dollar</option>
3784
+ <option value="MXN" <?php echo (($row->payment_currency == 'MXN') ? 'selected' : ''); ?>>Mex$ &#8226; Mexican Peso</option>
3785
+ <option value="HKD" <?php echo (($row->payment_currency == 'HKD') ? 'selected' : ''); ?>>HK$ &#8226; Hong Kong Dollar</option>
3786
+ <option value="HUF" <?php echo (($row->payment_currency == 'HUF') ? 'selected' : ''); ?>>Ft &#8226; Hungarian Forint</option>
3787
+ <option value="NOK" <?php echo (($row->payment_currency == 'NOK') ? 'selected' : ''); ?>>kr &#8226; Norwegian Kroner</option>
3788
+ <option value="NZD" <?php echo (($row->payment_currency == 'NZD') ? 'selected' : ''); ?>>NZ$ &#8226; New Zealand Dollar</option>
3789
+ <option value="SGD" <?php echo (($row->payment_currency == 'SGD') ? 'selected' : ''); ?>>S$ &#8226; Singapore Dollar</option>
3790
+ <option value="SEK" <?php echo (($row->payment_currency == 'SEK') ? 'selected' : ''); ?>>kr &#8226; Swedish Kronor</option>
3791
+ <option value="PLN" <?php echo (($row->payment_currency == 'PLN') ? 'selected' : ''); ?>>zl &#8226; Polish Zloty</option>
3792
+ <option value="AUD" <?php echo (($row->payment_currency == 'AUD') ? 'selected' : ''); ?>>A$ &#8226; Australian Dollar</option>
3793
+ <option value="DKK" <?php echo (($row->payment_currency == 'DKK') ? 'selected' : ''); ?>>kr &#8226; Danish Kroner</option>
3794
+ <option value="CHF" <?php echo (($row->payment_currency == 'CHF') ? 'selected' : ''); ?>>CHF &#8226; Swiss Francs</option>
3795
+ <option value="CZK" <?php echo (($row->payment_currency == 'CZK') ? 'selected' : ''); ?>>Kc &#8226; Czech Koruny</option>
3796
+ <option value="ILS" <?php echo (($row->payment_currency == 'ILS') ? 'selected' : ''); ?>>&#8362; &#8226; Israeli Sheqel</option>
3797
+ <option value="BRL" <?php echo (($row->payment_currency == 'BRL') ? 'selected' : ''); ?>>R$ &#8226; Brazilian Real</option>
3798
+ <option value="TWD" <?php echo (($row->payment_currency == 'TWD') ? 'selected' : ''); ?>>NT$ &#8226; Taiwan New Dollars</option>
3799
+ <option value="MYR" <?php echo (($row->payment_currency == 'MYR') ? 'selected' : ''); ?>>RM &#8226; Malaysian Ringgit</option>
3800
+ <option value="PHP" <?php echo (($row->payment_currency == 'PHP') ? 'selected' : ''); ?>>&#8369; &#8226; Philippine Peso</option>
3801
+ <option value="THB" <?php echo (($row->payment_currency == 'THB') ? 'selected' : ''); ?>>&#xe3f; &#8226; Thai Bahtv</option>
3802
+ </select>
3803
+ </td>
3804
+ </tr>
3805
+ <tr valign="top">
3806
+ <td class="fm_options_label">
3807
+ <label for="tax">Tax</label>
3808
+ </td>
3809
+ <td class="fm_options_value">
3810
+ <input type="text" name="tax" id="tax" value="<?php echo $row->tax; ?>" class="text_area" style="width: 40px;" onKeyPress="return check_isnum_point(event)" disabled="disabled"> %
3811
+ </td>
3812
+ </tr>
3813
+ </table>
3814
+ </fieldset>
3815
+ <fieldset id="javascript_fieldset" class="adminform fm_fieldset_deactive">
3816
+ <legend>JavaScript</legend>
3817
+ <table class="admintable">
3818
+ <tr valign="top">
3819
+ <td class="fm_options_label">
3820
+ <label for="javascript">Javascript</label>
3821
+ </td>
3822
+ <td class="fm_options_value" style="width:650px;">
3823
+ <textarea style="margin: 0px; height: 400px; width: 600px;" cols="60" rows="30" name="javascript" id="form_javascript"><?php echo $row->javascript; ?></textarea>
3824
+ </td>
3825
+ </tr>
3826
+ </table>
3827
+ </fieldset>
3828
+ <fieldset id="conditions_fieldset" class="adminform fm_fieldset_deactive">
3829
+ <?php
3830
+ $ids = array();
3831
+ $types = array();
3832
+ $labels = array();
3833
+ $paramss = array();
3834
+ $all_ids = array();
3835
+ $all_labels = array();
3836
 
3837
  $select_and_input = array("type_text", "type_password", "type_textarea", "type_name", "type_number", "type_phone", "type_submitter_mail", "type_address", "type_spinner", "type_checkbox", "type_radio", "type_own_select", "type_paypal_price", "type_paypal_select", "type_paypal_checkbox", "type_paypal_radio", "type_paypal_shipping");
3838
  $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");
3839
 
3840
  $fields=explode('*:*new_field*:*',$row->form_fields);
3841
  $fields = array_slice($fields,0, count($fields)-1);
3842
+ foreach($fields as $field) {
 
3843
  $temp=explode('*:*id*:*',$field);
3844
  array_push($ids, $temp[0]);
3845
  array_push($all_ids, $temp[0]);
3852
 
3853
  }
3854
 
3855
+ foreach($types as $key=>$value){
3856
+ if(!in_array($types[$key],$select_and_input)){
 
 
3857
  unset($ids[$key]);
3858
  unset($labels[$key]);
3859
  unset($types[$key]);
3866
  $types = array_values($types);
3867
  $paramss = array_values($paramss);
3868
 
 
3869
  $chose_ids = implode('@@**@@',$ids);
3870
  $chose_labels = implode('@@**@@',$labels);
3871
  $chose_types = implode('@@**@@',$types);
3872
  $chose_paramss = implode('@@**@@',$paramss);
3873
+
3874
  $all_ids_cond = implode('@@**@@',$all_ids);
3875
  $all_labels_cond = implode('@@**@@',$all_labels);
3876
 
3880
  $condition_params = array();
3881
 
3882
  $count_of_conditions=0;
3883
+ if($row->condition!="") {
 
3884
  $conditions=explode('*:*new_condition*:*',$row->condition);
3885
  $conditions = array_slice($conditions,0, count($conditions)-1);
3886
  $count_of_conditions = count($conditions);
3887
 
3888
+ foreach($conditions as $condition) {
 
3889
  $temp=explode('*:*show_hide*:*',$condition);
3890
  array_push($show_hide, $temp[0]);
3891
  $temp=explode('*:*field_label*:*',$temp[1]);
3894
  array_push($all_any, $temp[0]);
3895
  array_push($condition_params, $temp[1]);
3896
  }
 
3897
  }
3898
+ else {
 
3899
  $show_hide[0]=1;
3900
  $all_any[0]='and';
3901
  $condition_params[0]='';
3904
  }
3905
  ?>
3906
  <div>
3907
+ <button class="fm-button add-button large" onclick="add_condition('<?php echo $chose_ids; ?>', '<?php echo htmlspecialchars(addslashes($chose_labels)); ?>', '<?php echo $chose_types; ?>', '<?php echo htmlspecialchars(addslashes($chose_paramss)); ?>', '<?php echo $all_ids_cond; ?>', '<?php echo htmlspecialchars(addslashes($all_labels_cond)); ?>'); return false;">
3908
+ Add Condition
3909
+ <span></span>
3910
+ </button>
3911
  </div>
3912
+ <?php
3913
+ for($k=0; $k<$count_of_conditions; $k++) {
3914
+ if(in_array($field_label[$k],$all_ids)) : ?>
3915
+ <div id="condition<?php echo $k; ?>" class="fm-condition">
3916
+ <div id="conditional_fileds<?php echo $k; ?>">
3917
+ <select id="show_hide<?php echo $k; ?>" name="show_hide<?php echo $k; ?>" style="width:80px; ">
3918
+ <option value="1" <?php if($show_hide[$k]==1) echo 'selected="selected"'; ?>>show</option>
3919
+ <option value="0" <?php if($show_hide[$k]==0) echo 'selected="selected"'; ?>>hide</option>
3920
+ </select>
3921
+ <select id="fields<?php echo $k; ?>" name="fields<?php echo $k; ?>" style="width:300px; " onChange="" >
3922
+ <?php
3923
+ foreach($all_labels as $key => $value) {
3924
+ if($field_label[$k]==$all_ids[$key])
3925
+ $selected = 'selected="selected"';
3926
+ else
3927
+ $selected ='';
3928
+ echo '<option value="'.$all_ids[$key].'" '.$selected.'>'.$value.'</option>';
3929
+ }
3930
+ ?>
3931
+ </select>
3932
+ <span>if</span>
3933
+ <select id="all_any<?php echo $k; ?>" name="all_any<?php echo $k; ?>" style="width:60px; ">
3934
+ <option value="and" <?php if($all_any[$k]=="and") echo 'selected="selected"'; ?>>all</option>
3935
+ <option value="or" <?php if($all_any[$k]=="or") echo 'selected="selected"'; ?>>any</option>
3936
+ </select>
3937
+ <span>of the following match:</span>
3938
+ <img src="<?php echo WD_FM_URL . '/images/add.png?ver='. get_option("wd_form_maker_version").''; ?>" title="add" onclick="add_condition_fields(<?php echo $k; ?>,'<?php echo $chose_ids; ?>', '<?php echo htmlspecialchars(addslashes($chose_labels)); ?>', '<?php echo $chose_types; ?>', '<?php echo htmlspecialchars(addslashes($chose_paramss)); ?>')" style="cursor: pointer; vertical-align: middle;">
3939
+ <img src="<?php echo WD_FM_URL . '/images/page_delete.png?ver='. get_option("wd_form_maker_version").''; ?>" onclick="delete_condition('<?php echo $k; ?>')" style="cursor: pointer; vertical-align: middle;">
3940
+ </div>
3941
+ <?php
3942
+ if($condition_params[$k]) {
3943
+ $_params = explode('*:*next_condition*:*',$condition_params[$k]);
3944
+ $_params = array_slice($_params,0, count($_params)-1);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3945
 
3946
+ foreach($_params as $key=>$_param) {
3947
+ $key_select_or_input ='';
3948
+ $param_values = explode('***',$_param);
3949
+ $multiselect = explode('@@@',$param_values[2]);
3950
+
3951
+ if(in_array($param_values[0],$ids)): ?>
3952
+ <div id="condition_div<?php echo $k; ?>_<?php echo $key; ?>">
3953
+ <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 htmlspecialchars(addslashes($chose_paramss)); ?>')" style="width:300px;"/>
3954
+ <?php
3955
+ foreach($labels as $key1 => $value)
3956
+ {
3957
+ if($param_values[0]==$ids[$key1])
3958
+ {
3959
+ $selected = 'selected="selected"';
3960
+ if ($types[$key1]=="type_checkbox" || $types[$key1]=="type_paypal_checkbox")
3961
+ $multiple = 'multiple="multiple" class="multiple_select"';
3962
+ else
3963
+ $multiple ='';
3964
+
3965
+ $key_select_or_input = $key1;
3966
+ }
3967
+ else
3968
+ $selected ='';
3969
+ if($field_label[$k]!=$ids[$key1])
3970
+ echo '<option id="'.$k.'_'.$key1.'" value="'.$ids[$key1].'" '.$selected.'>'.$value.'</option>';
3971
+
3972
+ }
3973
+
3974
+ ?>
3975
+ </select>
3976
+
3977
+ <select id="is_select<?php echo $k; ?>_<?php echo $key; ?>" style="vertical-align: top; width:94px;">
3978
+ <option value="==" <?php if($param_values[1]=="==") echo 'selected="selected"'; ?>>is</option>
3979
+ <option value="!=" <?php if($param_values[1]=="!=") echo 'selected="selected"'; ?>>is not</option>
3980
+ <option value="%" <?php if($param_values[1]=="%") echo 'selected="selected"'; ?>>like</option>
3981
 
3982
+ <option value="!%" <?php if($param_values[1]=="!%") echo 'selected="selected"'; ?>>not like</option>
3983
 
3984
+ <option value="=" <?php if($param_values[1]=="=") echo 'selected="selected"'; ?>>empty</option>
3985
 
3986
+ <option value="!" <?php if($param_values[1]=="!") echo 'selected="selected"'; ?>>not empty</option>
3987
 
3988
+ </select>
3989
+
3990
+ <?php if ($key_select_or_input !== '' && in_array($types[$key_select_or_input],$select_type_fields)) : ?>
3991
+ <select id="field_value<?php echo $k; ?>_<?php echo $key; ?>" <?php echo $multiple; ?> style="width: 200px;">
3992
+ <?php
3993
+ switch($types[$key_select_or_input])
3994
+ {
3995
+ case "type_own_select":
3996
+ case "type_paypal_select":
3997
+ $w_size = explode('*:*w_size*:*',$paramss[$key_select_or_input]);
3998
+ break;
3999
+
4000
+ case "type_radio":
4001
+ case "type_checkbox":
4002
+ case "type_paypal_radio":
4003
+ case "type_paypal_checkbox":
4004
+ case "type_paypal_shipping":
4005
+ $w_size = explode('*:*w_flow*:*',$paramss[$key_select_or_input]);
4006
+ break;
4007
+ }
4008
+
4009
+ $w_choices = explode('*:*w_choices*:*',$w_size[1]);
4010
+ $w_choices_array = explode('***',$w_choices[0]);
4011
+
4012
+ $w_choices_price = explode('*:*w_choices_price*:*',$w_choices[1]);
4013
+ $w_choices_price_array = explode('***',$w_choices_price[0]);
4014
+
4015
+ for($m=0; $m<count($w_choices_array); $m++)
4016
+ {
4017
+ if($types[$key_select_or_input]=="type_paypal_checkbox" || $types[$key_select_or_input]=="type_paypal_radio" || $types[$key_select_or_input]=="type_paypal_shipping" || $types[$key_select_or_input]=="type_paypal_select")
4018
+ $w_choice = $w_choices_array[$m].'*:*value*:*'.$w_choices_price_array[$m];
4019
+ else
4020
+ $w_choice = $w_choices_array[$m];
4021
+
4022
+ if(in_array(esc_html($w_choice),$multiselect))
4023
+ {
4024
+ $selected = 'selected="selected"';
4025
+ }
4026
+ else
4027
+ $selected ='';
4028
 
4029
+ if(strpos($w_choices_array[$m], '[') === false && strpos($w_choices_array[$m], ']') === false && strpos($w_choices_array[$m], ':') === false) {
4030
+ echo '<option id="choise_'.$k.'_'.$m.'" value="'.$w_choice.'" '.$selected.'>'.$w_choices_array[$m].'</option>';
4031
+ }
4032
  }
4033
+
4034
+ if($types[$key_select_or_input]=="type_address")
 
 
 
 
 
4035
  {
4036
+ $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","Colombia","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","Nepal","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");
4037
+ $w_options = '';
4038
+ foreach($w_countries as $w_country)
4039
  {
4040
+ if(in_array($w_country,$multiselect))
4041
+ {
4042
+ $selected = 'selected="selected"';
4043
+ }
4044
+ else
4045
+ $selected ='';
4046
+
4047
+ echo '<option value="'.$w_country.'" '.$selected.'>'.$w_country.'</option>';
4048
+ }
4049
  }
4050
+
4051
+ ?>
4052
+ </select>
4053
+ <?php else :
4054
+ if($key_select_or_input != '' && ($types[$key_select_or_input]=="type_number" || $types[$key_select_or_input]=="type_phone"))
4055
+ $onkeypress_function = "onkeypress='return check_isnum_space(event)'";
 
 
 
 
4056
  else
4057
+ if($key_select_or_input != '' && $types[$key_select_or_input]=="type_paypal_price")
4058
+ $onkeypress_function = "onkeypress='return check_isnum_point(event)'";
4059
+ else
4060
+ $onkeypress_function = "";
4061
+ ?>
4062
+ <input id="field_value<?php echo $k; ?>_<?php echo $key; ?>" type="text" value="<?php echo $param_values[2];?>" <?php echo $onkeypress_function; ?> style=" width: 200px;"><?php endif; ?>
4063
+
4064
+ <img src="<?php echo WD_FM_URL . '/images/delete.png?ver='. get_option("wd_form_maker_version").''; ?>" id="delete_condition<?php echo $k; ?>_<?php echo $key; ?>" onclick="delete_field_condition('<?php echo $k; ?>_<?php echo $key; ?>')" style="vertical-align: middle;">
4065
+ </div>
4066
+ <?php endif;
4067
+ }
4068
  }
 
4069
 
4070
+ ?>
4071
+ </div>
4072
+ <?php endif;
4073
+ }
4074
+ ?>
4075
+ <input type="hidden" id="condition" name="condition" value="<?php echo $row->condition; ?>" />
4076
+ </fieldset>
4077
+ <fieldset id="mapping_fieldset" class="adminform fm_fieldset_deactive">
4078
+ <div style="padding-bottom:15px;">
4079
+ <button id="add_query" class="fm-button add-button medium" onclick="tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerSQLMapping', 'id' => 0, 'form_id' => $row->id, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>'); return false;">
4080
+ <span></span>
4081
+ Add Query
4082
+ </button>
4083
+ <button class="fm-button delete-button small" onclick="if (fm_check_email('mailToAdd') || fm_check_email('from_mail') || fm_check_email('reply_to') || fm_check_email('mail_from_other') || fm_check_email('reply_to_other') || fm_check_email('paypal_email')) {return false;}; set_condition(); wd_fm_apply_options('remove_query'); return false;">
4084
+ <span></span>
4085
+ Delete
4086
+ </button>
4087
  </div>
4088
+ <?php
4089
+ if ($queries) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4090
  ?>
4091
+ <table class="wp-list-table widefat fixed posts table_content">
4092
+ <thead>
4093
+ <tr>
4094
+ <th style="width:4%;" class="table_small_col count_col sub-align">#</th>
4095
+ <th style="width:4%;" class="table_small_col count_col sub-align">ID</th>
4096
+ <th style="width:6%;" class="manage-column column-cb check-column table_small_col sub-align form_check">
4097
+ <input id="check_all" type="checkbox" style="margin:0;">
4098
+ </th>
4099
+ <th style="width:86%;" class="table_large_col">Query</th>
4100
+ </tr>
4101
+ </thead>
4102
+ <?php
4103
+ $k = 0;
4104
+ for($i=0, $n=count($queries); $i < $n ; $i++) {
4105
+ $query = $queries[$i];
4106
+ $checked = '<input type="checkbox" id="' . $i . '" name="cid[]" value="' . $query->id . '" />';
4107
+ $link = add_query_arg(array('action' => 'FormMakerSQLMapping', 'id' => $query->id, 'form_id' => $row->id, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
4108
+ ?>
4109
+ <tr <?php if (!$k) echo "class=\"alternate\""; ?>>
4110
+ <td align="center" class="table_small_col"><?php echo $i+1; ?></td>
4111
+ <td align="center" class="table_small_col"><?php echo $query->id; ?></td>
4112
+ <td align="center" class="table_small_col check-column"><?php echo $checked; ?></td>
4113
+ <td align="center">
4114
+ <a rel="{handler: 'iframe', size: {x: 530, y: 370}}" onclick="tb_show('', '<?php echo $link; ?>'); return false;" style="cursor:pointer;">
4115
+ <?php echo $query->query; ?>
4116
+ </a>
4117
+ </td>
4118
+ </tr>
4119
+ <?php
4120
+ $k = 1 - $k;
4121
+ }
4122
+ ?>
4123
+ </table>
4124
  <?php
4125
+ }
4126
+ ?>
4127
+ </fieldset>
 
4128
  <?php
4129
+ foreach($addons as $addon => $addon_name) {
4130
+ if (defined($addon) && is_plugin_active(constant($addon))) {
4131
+ $_GET['addon_view']='admin';
4132
+ $_GET['form_id']=$row->id;
4133
+ do_action($addon.'_init');
4134
+ }
4135
+ }
4136
  ?>
4137
+ </div>
4138
+ <input type="hidden" name="boxchecked" value="0">
4139
+ <input type="hidden" name="fieldset_id" id="fieldset_id" value="<?php echo WDW_FM_Library::get('fieldset_id', 'general'); ?>" />
4140
+ <input type="hidden" id="task" name="task" value=""/>
4141
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
4142
+ </form>
4143
+ <script>
4144
+ jQuery(window).load(function () {
4145
+ form_maker_options_tabs(jQuery("#fieldset_id").val());
4146
+ fm_popup();
4147
+ function hide_email_labels(event) {
4148
+ var e = event.toElement || event.relatedTarget;
4149
+ if (e.parentNode == this || e == this) {
4150
+ return;
4151
+ }
4152
+ this.style.display="none";
4153
+ }
4154
+ if(document.getElementById('mail_from_labels')) {
4155
+ document.getElementById('mail_from_labels').addEventListener('mouseout',hide_email_labels,true);
4156
+ }
4157
+ if(document.getElementById('mail_subject_labels')) {
4158
+ document.getElementById('mail_subject_labels').addEventListener('mouseout',hide_email_labels,true);
4159
+ }
4160
+ if(document.getElementById('mail_from_name_user_labels')) {
4161
+ document.getElementById('mail_from_name_user_labels').addEventListener('mouseout',hide_email_labels,true);
4162
+ }
4163
+ if(document.getElementById('mail_subject_user_labels')) {
4164
+ document.getElementById('mail_subject_user_labels').addEventListener('mouseout',hide_email_labels,true);
4165
+ }
4166
+ if(document.getElementById('post_title_labels')) {
4167
+ document.getElementById('post_title_labels').addEventListener('mouseout',hide_email_labels,true);
4168
+ }
4169
+ if(document.getElementById('post_tags_labels')) {
4170
+ document.getElementById('post_tags_labels').addEventListener('mouseout',hide_email_labels,true);
4171
+ }
4172
+ if(document.getElementById('post_featured_image_labels')) {
4173
+ document.getElementById('post_featured_image_labels').addEventListener('mouseout',hide_email_labels,true);
4174
+ }
4175
+ if(document.getElementById('dbox_upload_dir_labels')) {
4176
+ document.getElementById('dbox_upload_dir_labels').addEventListener('mouseout',hide_email_labels,true);
4177
+ }
4178
+ });
4179
+ function wd_fm_apply_options(task) {
4180
+ set_condition();
4181
+ fm_set_input_value('task', task);
4182
+ document.getElementById('adminForm').submit();
4183
+ }
4184
+ </script>
4185
+ <?php
4186
+ }
4187
 
4188
+ public function form_layout($id) {
4189
+ $row = $this->model->get_row_data($id);
4190
+ $ids = array();
4191
+ $types = array();
4192
+ $labels = array();
4193
+ $fields = explode('*:*new_field*:*', $row->form_fields);
4194
+ $fields = array_slice($fields, 0, count($fields) - 1);
4195
+ foreach ($fields as $field) {
4196
+ $temp = explode('*:*id*:*', $field);
4197
+ array_push($ids, $temp[0]);
4198
+ $temp = explode('*:*type*:*', $temp[1]);
4199
+ array_push($types, $temp[0]);
4200
+ $temp = explode('*:*w_field_label*:*', $temp[1]);
4201
+ array_push($labels, $temp[0]);
4202
+ }
4203
  ?>
4204
+ <script>
4205
+ var form_front = '<?php echo addslashes($row->form_front);?>';
4206
+ var custom_front = '<?php echo addslashes($row->custom_front);?>';
4207
+ if (custom_front == '') {
4208
+ custom_front = form_front;
4209
+ }
4210
+ function submitbutton() {
4211
+ if (jQuery('#autogen_layout').is(':checked')) {
4212
+ jQuery('#custom_front').val(custom_front.replace(/\s+/g, ' ').replace(/> </g, '><'));
4213
+ }
4214
+ else {
4215
+ jQuery('#custom_front').val(editor.getValue().replace(/\s+/g, ' ').replace(/> </g, '><'));
4216
+ }
4217
+ }
4218
+ function insertAtCursor_form(myId, myLabel) {
4219
+ if (jQuery('#autogen_layout').is(':checked')) {
4220
+ alert("Uncheck the Auto-Generate Layout box.");
4221
+ return;
4222
+ }
4223
+ myValue = '<div wdid="' + myId + '" class="wdform_row">%' + myId + ' - ' + myLabel + '%</div>';
4224
+ line = editor.getCursor().line;
4225
+ ch = editor.getCursor().ch;
4226
+ text = editor.getLine(line);
4227
+ text1 = text.substr(0, ch);
4228
+ text2 = text.substr(ch);
4229
+ text = text1 + myValue + text2;
4230
+ editor.setLine(line, text);
4231
+ editor.focus();
4232
+ }
4233
+ function autogen(status) {
4234
+ if (status) {
4235
+ custom_front = editor.getValue();
4236
+ editor.setValue(form_front);
4237
+ editor.setOption('readOnly', true);
4238
+ autoFormat();
4239
+ }
4240
+ else {
4241
+ editor.setValue(custom_front);
4242
+ editor.setOption('readOnly', false);
4243
+ autoFormat();
4244
+ }
4245
+ }
4246
+ function autoFormat() {
4247
+ CodeMirror.commands["selectAll"](editor);
4248
+ editor.autoFormatRange(editor.getCursor(true), editor.getCursor(false));
4249
+ editor.scrollTo(0,0);
4250
+ }
4251
+ </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4252
 
4253
+ <div class="fm_layout">
4254
+ <form action="admin.php?page=manage_fm" method="post" name="adminForm" enctype="multipart/form-data">
4255
+ <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
4256
+ <div class="fm-layout-actions">
4257
+ <div class="fm-page-actions">
4258
+ <button class="fm-button save-button small" onclick="submitbutton(); fm_set_input_value('task', 'save_layout');">
4259
+ Save
4260
+ <span></span>
4261
+ </button>
4262
+ <button class="fm-button apply-button small" onclick="submitbutton(); fm_set_input_value('task', 'apply_layout');">
4263
+ Apply
4264
+ <span></span>
4265
+ </button>
4266
+ <button class="fm-button cancel-button small" onclick="fm_set_input_value('task', 'cancel_options');">
4267
+ Cancel
4268
+ <span></span>
4269
+ </button>
4270
+ </div>
4271
+ </div>
4272
+ <div class="fm-layout-content">
4273
+ <h2 style="clear: both;">Description</h2>
4274
+ <p>To customize the layout of the form fields uncheck the Auto-Generate Layout box and edit the HTML.</p>
4275
+ <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:
4276
+ <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>
4277
+ , where <b><span class="cm-tag">&lt;div&gt;</span></b> is used to set a row.</p>
4278
+ <p>To return to the default settings you should check Auto-Generate Layout box.</p>
4279
+ <h3 style="color:red">Notice</h3>
4280
+ <p>Make sure not to publish the same field twice. This will cause malfunctioning of the form.</p>
4281
+ <hr/>
4282
+ <label for="autogen_layout" style="font-size: 20px; line-height: 45px; margin-left: 10px;">Auto Generate Layout? </label>
4283
+ <input type="checkbox" value="1" name="autogen_layout" id="autogen_layout" <?php echo (($row->autogen_layout) ? 'checked="checked"' : ''); ?> />
4284
+ <input type="hidden" name="custom_front" id="custom_front" value="" />
4285
+ <input type="hidden" id="task" name="task" value=""/>
4286
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
4287
+ <br/>
4288
+ <?php
4289
+ foreach($ids as $key => $id) {
4290
+ if ($types[$key] != "type_section_break") {
4291
+ ?>
4292
+ <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>
4293
+ <?php
4294
+ }
4295
+ }
4296
+ ?>
4297
+ </form>
4298
+ </div>
4299
+ <br /><br />
4300
+ <button class="fm_submit_layout button button-secondary button-hero" onclick="autoFormat()"><strong>Apply Source Formatting</strong> <em>(ctrl-enter)</em></button>
4301
+ <textarea id="source" name="source" style="display: none;"></textarea>
4302
+ </div>
4303
+ <script>
4304
+ var editor = CodeMirror.fromTextArea(document.getElementById("source"), {
4305
+ lineNumbers: true,
4306
+ lineWrapping: true,
4307
+ mode: "htmlmixed",
4308
+ value: form_front
4309
+ });
4310
+ if (jQuery('#autogen_layout').is(':checked')) {
4311
+ editor.setOption('readOnly', true);
4312
+ editor.setValue(form_front);
4313
+ }
4314
+ else {
4315
+ editor.setOption('readOnly', false);
4316
+ editor.setValue(custom_front);
4317
+ }
4318
+ jQuery('#autogen_layout').click(function() {
4319
+ autogen(jQuery(this).is(':checked'));
4320
+ });
4321
+ autoFormat();
4322
+ </script>
4323
+ <?php
4324
+ }
4325
 
4326
  ////////////////////////////////////////////////////////////////////////////////////////
4327
  // Getters & Setters //
admin/views/FMViewSelect_data_from_db.php CHANGED
@@ -38,13 +38,14 @@ class FMViewSelect_data_from_db {
38
  function connect(){
39
  jQuery("input[type='radio']").attr('disabled','');
40
  jQuery(".connect").attr('disabled','');
41
- jQuery('#struct').html('<div id="saving"><div id="saving_text">Loading</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
42
  jQuery.ajax({
43
  type: "POST",
44
  url:"<?php echo add_query_arg(array('action' => 'select_data_from_db', 'form_id' => $form_id, 'field_type' => $field_type, 'task' => 'db_tables', 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>",
45
  data: 'con_type='+jQuery('input[name=con_type]:checked').val()+'&con_method='+jQuery('input[name=con_method]:checked').val()+'&host='+jQuery('#host_rem').val()+'&port='+jQuery('#port_rem').val()+'&username='+jQuery('#username_rem').val()+'&password='+jQuery('#password_rem').val()+'&database='+jQuery('#database_rem').val()+'&field_type='+jQuery('#field_type').val()+'&format=row',
46
  success: function(data)
47
  {
 
48
  if(data==1)
49
  {
50
  jQuery("#struct").html('<div style="font-size: 22px; text-align: center; padding-top: 15px;">Could not connect to MySQL.</div>')
@@ -53,106 +54,167 @@ class FMViewSelect_data_from_db {
53
 
54
  }
55
  else
56
- jQuery("#struct").html(data)
57
 
58
  }
59
 
60
  });
61
  }
62
 
63
- function shh(x)
64
- {
65
  if(x)
66
-
67
  jQuery(".remote_info").show();
68
-
69
  else
70
-
71
  jQuery(".remote_info").hide();
72
-
73
  }
74
-
75
  </script>
76
  <style>
77
-
78
- label{
79
-
80
- display:inline;
81
- margin-bottom: 5px;
82
  }
83
-
84
  .main_func{
85
-
86
- font-size: 12px;
87
- display:inline-block;
88
- width:480px;
89
- vertical-align:top;
90
  }
91
-
92
- .key label{
93
-
94
- display:inline-block;
95
- width:150px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  }
97
-
98
  </style>
99
  <div class="c1">
100
  <div class="main_func">
101
  <table class="admintable">
102
  <tr valign="top">
103
- <td class="key">
104
- <label style="font-weight:bold;"> <?php echo __( 'Connection type','form_maker' ); ?>: </label>
105
  </td>
106
- <td>
107
  <input type="radio" name="con_type" id="local" value="local" checked="checked" onclick="shh(false)">
108
  <label for="local">Local</label>
109
  <input type="radio" name="con_type" id="remote" value="remote" onclick="shh(true)">
110
  <label for="remote">Remote</label>
111
  </td>
 
 
 
112
  </tr>
113
  <tr class="remote_info" style="display:none">
114
- <td class="key">Host</td>
115
  <td>
116
- <input type="text" name="host" id="host_rem" style="width:180px">
117
- Port : <input type="text" name="port" id="port_rem" value="3306" style="width:50px">
118
  </td>
119
- </tr>
120
- <tr class="remote_info" style="display:none">
121
- <td class="key">Username</td>
122
  <td>
123
- <input type="text" name="username" id="username_rem" style="width:272px">
124
  </td>
125
  </tr>
126
  <tr class="remote_info" style="display:none">
127
- <td class="key">Password</td>
128
  <td>
129
- <input type="password" name="password" id="password_rem" style="width:272px">
130
  </td>
131
- </tr>
132
- <tr class="remote_info" style="display:none">
133
- <td class="key">Database</td>
134
  <td>
135
- <input type="text"name="database" id="database_rem" style="width:272px">
136
  </td>
137
  </tr>
138
- <tr valign="top" style="display:none;">
139
- <td class="key">
140
- <label> <?php echo __( 'Type','form_maker' ); ?>: </label>
 
141
  </td>
142
  <td>
143
- <input type="radio" name="con_method" id="select" value="select" checked="checked">
144
- <label for="select">Select</label>
145
- </td>
146
  </tr>
147
- <tr valign="top">
148
- <td class="key">
 
 
149
  </td>
150
  <td>
151
- <input type="button" value="Connect" onclick="connect()" class="btn connect">
152
  </td>
153
  </tr>
154
  </table>
155
- <div id="struct" style="margin-top:10px">
156
  </div>
157
  <input type="hidden" id="form_id" value="<?php echo $id ?>" >
158
  <input type="hidden" id="form_field_id" value="<?php echo $field_id ?>" >
@@ -160,7 +222,6 @@ class FMViewSelect_data_from_db {
160
  <input type="hidden" id="value_disabled" value="<?php echo $value_disabled ?>" >
161
  </div>
162
  </div>
163
-
164
  <?php
165
  die();
166
  }
@@ -169,14 +230,14 @@ class FMViewSelect_data_from_db {
169
  public function db_table_struct_select($form_id, $field_type){
170
  $table_struct = $this->model->get_table_struct();
171
  $label = $this->model->get_labels($form_id);
172
- $cond='<div id="condid"><select id="sel_condid" style="width: 110px">';
173
  foreach($table_struct as $col)
174
  {
175
  $cond.='<option>'.$col->Field.'</option>';
176
  }
177
 
178
  $cond.='</select>';
179
- $cond.='<select id="op_condid" style="width: 150px"><option value="=" selected="selected">=</option><option value="!=">!=</option><option value=">">&gt;</option><option value="<">&lt;</option><option value=">=">&gt;=</option><option value="<=">&lt;=</option><option value="%..%">Like</option><option value="%..">Starts with</option><option value="..%">Ends with</option></select><input id="val_condid" style="width:120px; margin:0px !important; padding: 4px 6px;" type="text" /><select id="andor_condid" style="visibility: hidden; width:70px;"><option value="AND">AND</option><option value="OR">OR</option></select><img src="' . WD_FM_URL . '/images/delete.png" onclick="delete_cond(&quot;condid&quot;)" style="vertical-align: middle;"></div>';
180
 
181
  ?>
182
 
@@ -234,7 +295,6 @@ function update_vis(){
234
 
235
 
236
  function save_query()
237
-
238
  {
239
  str = '';
240
  plugin_url='<?php echo WD_FM_URL; ?>';
@@ -256,10 +316,8 @@ function save_query()
256
  var value_disabled = jQuery('#value_disabled').val();
257
  var num = jQuery("#form_field_id").val();
258
  var field_type = jQuery("#field_type").val();
259
- if(product_name || product_price){
260
-
261
- jQuery('.c1').html('<div id="saving"><div id="saving_text">Saving</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
262
-
263
  var max_value = 0;
264
  window.parent.jQuery('.change_pos').each(function() {
265
  var value = jQuery(this)[0].id;
@@ -276,7 +334,7 @@ function save_query()
276
  el_choices.setAttribute("id", "el_choices"+max_value);
277
  el_choices.setAttribute("type", "text");
278
  el_choices.setAttribute("value", '['+table+':'+product_name+']');
279
- el_choices.style.cssText = "width:100px; margin:1px; padding:3px 0; border-width: 1px";
280
  el_choices.setAttribute("onKeyUp", "change_label('"+num+"_label_element"+max_value+"', this.value); change_in_value('"+num+"_elementform_id_temp"+max_value+"', this.value)");
281
  el_choices.setAttribute("disabled", 'disabled');
282
  var el_choices_value = document.createElement('input');
@@ -286,7 +344,7 @@ function save_query()
286
  el_choices_value.setAttribute("value", '['+table+':'+product_name+']');
287
  else
288
  el_choices_value.setAttribute("value", '['+table+':'+product_price+']');
289
- el_choices_value.style.cssText = "width:100px; margin:1px; padding:3px 0; border-width: 1px";
290
  el_choices_value.setAttribute("onKeyUp", "change_label_value('"+num+"_elementform_id_temp"+max_value+"', this.value)");
291
  el_choices_value.setAttribute("disabled", 'disabled');
292
  var el_choices_params = document.createElement('input');
@@ -296,14 +354,14 @@ function save_query()
296
  el_choices_params.setAttribute("value", where+'[where_order_by]'+order + '[db_info]'+'['+str+']');
297
  var el_choices_remove = document.createElement('img');
298
  el_choices_remove.setAttribute("id", "el_choices"+max_value+"_remove");
299
- el_choices_remove.setAttribute("src", plugin_url + '/images/delete.png');
300
- el_choices_remove.style.cssText = 'cursor:pointer;vertical-align:middle; margin:3px 3px 3px 7px;';
301
  el_choices_remove.setAttribute("align", 'top');
302
  el_choices_remove.setAttribute("onClick", "remove_choise('"+max_value+"','"+num+"','"+field_type+"')");
303
  var el_choices_handle = document.createElement('img');
304
  el_choices_handle.setAttribute("class", "el_choices_sortable");
305
- el_choices_handle.setAttribute("src", plugin_url + '/images/move_cursor.png');
306
- el_choices_handle.style.cssText = 'cursor:move; vertical-align:middle; margin:3px 3px 3px 9px;';
307
  el_choices_handle.setAttribute("align", 'top');
308
 
309
  div.appendChild(el_choices);
@@ -358,12 +416,12 @@ function save_query()
358
  el_choices.setAttribute("id", "el_option"+max_value);
359
  el_choices.setAttribute("type", "text");
360
  el_choices.setAttribute("value", '['+table+':'+product_name+']');
361
- el_choices.style.cssText = "width:100px; margin:1px; padding:3px 0; border-width: 1px";
362
  el_choices.setAttribute("onKeyUp", "change_label_name('"+max_value+"', '"+num+"_option"+max_value+"', this.value)");
363
  el_choices.setAttribute("disabled", 'disabled');
364
  var el_choices_remove = document.createElement('img');
365
  el_choices_remove.setAttribute("id", "el_option"+max_value+"_remove");
366
- el_choices_remove.setAttribute("src", plugin_url + '/images/delete.png');
367
  el_choices_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
368
  el_choices_remove.setAttribute("align", 'top');
369
  el_choices_remove.setAttribute("onClick", "remove_option('"+max_value+"','"+num+"')");
@@ -382,7 +440,7 @@ function save_query()
382
  el_choices_value.setAttribute("value", '['+table+':'+product_name+']');
383
  else
384
  el_choices_value.setAttribute("value", '['+table+':'+product_price+']');
385
- el_choices_value.style.cssText = "width:100px; margin:1px; padding:3px 0; border-width: 1px";
386
  el_choices_value.setAttribute("onKeyUp", "change_label_value('"+num+"_option"+max_value+"', this.value)");
387
  el_choices_value.setAttribute("disabled", 'disabled');
388
  var el_choices_params = document.createElement('input');
@@ -392,8 +450,8 @@ function save_query()
392
  el_choices_params.setAttribute("value", where+'[where_order_by]'+order + '[db_info]'+'['+str+']');
393
  var el_choices_handle = document.createElement('img');
394
  el_choices_handle.setAttribute("class", "el_choices_sortable");
395
- el_choices_handle.setAttribute("src", plugin_url + '/images/move_cursor.png');
396
- el_choices_handle.style.cssText = 'cursor:move; vertical-align:middle; margin:3px 3px 3px 10px;';
397
  el_choices_handle.setAttribute("align", 'top');
398
 
399
  div.appendChild(el_choices);
@@ -424,13 +482,13 @@ function save_query()
424
  el_choices.setAttribute("id", "el_option"+max_value);
425
  el_choices.setAttribute("type", "text");
426
  el_choices.setAttribute("value", '['+table+':'+product_name+']');
427
- el_choices.style.cssText = "width:100px; margin:1px; padding:3px 0; border-width: 1px";
428
  el_choices.setAttribute("onKeyUp", "change_label_price('"+num+"_option"+max_value+"', this.value)");el_choices.setAttribute("disabled", 'disabled');
429
  var el_choices_price = document.createElement('input');
430
  el_choices_price.setAttribute("id", "el_option_price"+max_value);
431
  el_choices_price.setAttribute("type", "text");
432
  el_choices_price.setAttribute("value", '['+table+':'+product_price+']');
433
- el_choices_price.style.cssText = "width:50px; margin:1px; padding:3px 0; border-width: 1px";
434
  el_choices_price.setAttribute("onKeyUp", "change_value_price('"+num+"_option"+max_value+"', this.value)");
435
  el_choices_price.setAttribute("onKeyPress", "return check_isnum_point(event)");
436
  el_choices_price.setAttribute("disabled", 'disabled');
@@ -441,8 +499,8 @@ function save_query()
441
  el_choices_params.setAttribute("value", where+'[where_order_by]'+order + '[db_info]'+'['+str+']');
442
  var el_choices_remove = document.createElement('img');
443
  el_choices_remove.setAttribute("id", "el_option"+max_value+"_remove");
444
- el_choices_remove.setAttribute("src", plugin_url + '/images/delete.png');
445
- el_choices_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin-left:4px;';
446
  el_choices_remove.setAttribute("align", 'top');
447
  el_choices_remove.setAttribute("onClick", "remove_option_price('"+max_value+"','"+num+"')");
448
  var el_choices_dis = document.createElement('input');
@@ -452,8 +510,8 @@ function save_query()
452
  el_choices_dis.style.cssText ="vertical-align: middle; margin-right:24px; margin-left:24px;";
453
  var el_choices_handle = document.createElement('img');
454
  el_choices_handle.setAttribute("class", "el_choices_sortable");
455
- el_choices_handle.setAttribute("src", plugin_url + '/images/move_cursor.png');
456
- el_choices_handle.style.cssText = 'cursor:move; vertical-align:middle; margin:3px 3px 3px 20px;';
457
  el_choices_handle.setAttribute("align", 'top');
458
 
459
  div.appendChild(el_choices);
@@ -466,7 +524,6 @@ function save_query()
466
 
467
  }
468
 
469
-
470
  if(field_type=='paypal_radio' || field_type=='paypal_checkbox' || field_type=='paypal_shipping'){
471
  if(field_type == 'paypal_shipping')
472
  field_type = 'paypal_radio';
@@ -518,20 +575,20 @@ function save_query()
518
  el_choices.setAttribute("id", "el_choices"+max_value);
519
  el_choices.setAttribute("type", "text");
520
  el_choices.setAttribute("value", '['+table+':'+product_name+']');
521
- el_choices.style.cssText = "width:100px; margin:1px; padding:3px 0; border-width: 1px";
522
  el_choices.setAttribute("onKeyUp", "change_label('"+num+"_label_element"+max_value+"', this.value); change_label_1('"+num+"_elementlabel_form_id_temp"+max_value+"', this.value); ");
523
  el_choices.setAttribute("disabled", 'disabled');
524
  var el_choices_remove = document.createElement('img');
525
  el_choices_remove.setAttribute("id", "el_choices"+max_value+"_remove");
526
- el_choices_remove.setAttribute("src", plugin_url + '/images/delete.png');
527
- el_choices_remove.style.cssText = 'cursor:pointer;vertical-align:middle; margin: 3px 3px 3px 8px;';
528
  el_choices_remove.setAttribute("align", 'top');
529
  el_choices_remove.setAttribute("onClick", "remove_choise_price('"+max_value+"','"+num+"')");
530
  var el_choices_price = document.createElement('input');
531
  el_choices_price.setAttribute("id", "el_option_price"+max_value);
532
  el_choices_price.setAttribute("type", "text");
533
  el_choices_price.setAttribute("value", '['+table+':'+product_price+']');
534
- el_choices_price.style.cssText = "width:50px; margin:1px; padding:3px 0; border-width: 1px";
535
  el_choices_price.setAttribute("onKeyUp", "change_value_price('"+num+"_elementform_id_temp"+max_value+"', this.value)");
536
  el_choices_price.setAttribute("onKeyPress", "return check_isnum_point(event)");
537
  el_choices_price.setAttribute("disabled", 'disabled');
@@ -542,8 +599,8 @@ function save_query()
542
  el_choices_params.setAttribute("value", where+'[where_order_by]'+order + '[db_info]'+'['+str+']');
543
  var el_choices_handle = document.createElement('img');
544
  el_choices_handle.setAttribute("class", "el_choices_sortable");
545
- el_choices_handle.setAttribute("src", plugin_url + '/images/move_cursor.png');
546
- el_choices_handle.style.cssText = 'cursor:move; vertical-align:middle; margin: 3px 3px 3px 15px;';
547
  el_choices_handle.setAttribute("align", 'top');
548
 
549
 
@@ -562,12 +619,9 @@ function save_query()
562
  window.parent["refresh_attr"](num, 'type_checkbox');
563
 
564
  }
565
-
566
-
567
- window.parent.tb_remove();
568
-
569
  }
570
-
571
  else{
572
  if(field_type=="checkbox" || field_type=="radio" || field_type=="select")
573
  alert('Select a option(s).');
@@ -620,61 +674,11 @@ function gen_query(){
620
 
621
  </script>
622
 
623
- <style>
624
-
625
- .table_fields{
626
-
627
- margin-bottom:2px;
628
- }
629
-
630
- .table_fields select {
631
-
632
- line-height: 18px;
633
- width: inherit;
634
- margin: inherit;
635
- }
636
-
637
-
638
-
639
- .table_fields input[type="text"]{
640
-
641
- width: 225px;
642
- line-height: 18px;
643
- height: 20px;
644
-
645
- }
646
-
647
-
648
-
649
- .gen_query, .gen_query:focus{
650
-
651
- width: 200px !important;
652
- height: 38px;
653
- background: #0E73D4;
654
- color: white;
655
- cursor: pointer;
656
- border: 0px;
657
- font-size: 16px;
658
- font-weight: bold;
659
- margin: 20px 20px 20px 0;
660
- }
661
-
662
-
663
-
664
- .gen_query:active{
665
-
666
- background: #ccc;
667
- }
668
-
669
-
670
-
671
- </style>
672
-
673
  <?php if($table_struct): ?>
674
  <div class="cols">
675
- <div class="table_fields">
676
- <label for="product_name" style="display:inline-block;width:157px;font-weight: bold; vertical-align: top;"><?php echo (strpos($field_type, 'paypal_') === false ? 'Select a name' : ($field_type == 'paypal_shipping' ? 'Select a shipping type' : 'Select a product name')); ?></label>
677
- <select name="product_name" id="product_name">
678
  <option value="" ></option>
679
  <?php
680
  foreach($table_struct as $col)
@@ -682,9 +686,9 @@ function gen_query(){
682
  ?>
683
  </select>
684
  </div>
685
- <div class="table_fields ch_rad_value_disabled">
686
- <label for="product_price" style="display:inline-block;width:157px;font-weight: bold; vertical-align: top;"><?php echo (strpos($field_type, 'paypal_') === false ? 'Select a value' : 'Select a product price'); ?></label>
687
- <select name="product_price" id="product_price">
688
  <option value="" ></option>
689
  <?php
690
  foreach($table_struct as $col)
@@ -693,14 +697,12 @@ function gen_query(){
693
  ?>
694
  </select>
695
  </div>
696
- <br/>
697
- <div style="background: none;text-align: center;font-size: 20px;color: rgb(0, 164, 228);font-weight: bold;">WHERE </div>
698
- <img src="<?php echo WD_FM_URL . '/images/add_condition.png'; ?>" title="ADD" class="add_cond"/>
699
  </div>
700
- </br>
701
- <div style="background: none;text-align: center;font-size: 20px;color: rgb(0, 164, 228);font-weight: bold; margin:8px 0;">ORDER BY</div>
702
- <div class="table_fields">
703
- <label for="order_by" style="display:inline-block;width:157px;font-weight: bold; vertical-align: top;">Select an option</label>
704
  <select name="order_by" id="order_by">
705
  <option value="" ></option>
706
  <?php
@@ -714,7 +716,9 @@ function gen_query(){
714
  </select>
715
  </div>
716
  <br/>
717
- <input type="button" value="Save" class="gen_query" onclick="save_query()">
 
 
718
  <form name="query_form" id="query_form" style="display:none;">
719
  <textarea id="where" name="where"></textarea>
720
  <textarea id="order" name="order"></textarea>
@@ -724,11 +728,10 @@ function gen_query(){
724
  }
725
 
726
  public function db_tables($form_id,$field_type){
727
- /*$document = JFactory::getDocument();
728
- $document->addScript(JURI::root(true).'/components/com_formmaker/views/formmaker/tmpl/wdform.js');*/
729
  $tables = $this->model->get_tables();
730
  ?>
731
- <label for="tables" style="display:inline-block;width:157px;font-weight: bold;">Select a table</label><select name="tables" id="tables">
 
732
  <option value="" ></option>
733
  <?php
734
 
@@ -736,21 +739,19 @@ public function db_tables($form_id,$field_type){
736
  echo '<option value="'.$table.'" >'.$table.'</option>';
737
  ?>
738
  </select>
739
- <br/><br/>
740
  <div id="table_struct">
741
  </div>
742
 
743
  <script>
744
 
745
  jQuery("#tables").change(function (){
746
- jQuery('#table_struct').html('<div id="saving"><div id="saving_text">Loading</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
747
-
748
-
749
  jQuery.ajax({
750
  type: "POST",
751
  url: "<?php echo add_query_arg(array('action' => 'select_data_from_db', 'form_id' => $form_id, 'field_type' => $field_type, 'task' => 'db_table_struct_select', 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>",
752
  data: 'name='+jQuery(this).val()+'&con_type='+jQuery('input[name=con_type]:checked').val()+'&con_method='+jQuery('input[name=con_method]:checked').val()+'&host='+jQuery('#host_rem').val()+'&port='+jQuery('#port_rem').val()+'&username='+jQuery('#username_rem').val()+'&password='+jQuery('#password_rem').val()+'&database='+jQuery('#database_rem').val()+'&format=row&field_type='+jQuery('#field_type').val(),
753
  success: function(data) {
 
754
  jQuery("#table_struct").html(data);
755
  }
756
  });
38
  function connect(){
39
  jQuery("input[type='radio']").attr('disabled','');
40
  jQuery(".connect").attr('disabled','');
41
+ jQuery('#struct').html('<div class="fm-loading-container"><div class="fm-loading-content"></div></div>');
42
  jQuery.ajax({
43
  type: "POST",
44
  url:"<?php echo add_query_arg(array('action' => 'select_data_from_db', 'form_id' => $form_id, 'field_type' => $field_type, 'task' => 'db_tables', 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>",
45
  data: 'con_type='+jQuery('input[name=con_type]:checked').val()+'&con_method='+jQuery('input[name=con_method]:checked').val()+'&host='+jQuery('#host_rem').val()+'&port='+jQuery('#port_rem').val()+'&username='+jQuery('#username_rem').val()+'&password='+jQuery('#password_rem').val()+'&database='+jQuery('#database_rem').val()+'&field_type='+jQuery('#field_type').val()+'&format=row',
46
  success: function(data)
47
  {
48
+ jQuery("#struct").removeClass("fm_loading");
49
  if(data==1)
50
  {
51
  jQuery("#struct").html('<div style="font-size: 22px; text-align: center; padding-top: 15px;">Could not connect to MySQL.</div>')
54
 
55
  }
56
  else
57
+ jQuery("#struct").html(data);
58
 
59
  }
60
 
61
  });
62
  }
63
 
64
+ function shh(x) {
 
65
  if(x)
 
66
  jQuery(".remote_info").show();
 
67
  else
 
68
  jQuery(".remote_info").hide();
 
69
  }
 
70
  </script>
71
  <style>
72
+ .c1 {
73
+ padding: 0 10px;
 
 
 
74
  }
75
+
76
  .main_func{
77
+ font-family: Segoe UI;
 
 
 
 
78
  }
79
+
80
+ .main_func .admintable {
81
+ width: 520px;
82
+ padding: 10px 0;
83
+ margin-bottom: 15px;
84
+ }
85
+
86
+ .main_func .admintable input[type='text'],
87
+ .main_func .admintable input[type='password']{
88
+ padding: 4px 6px;
89
+ width:244px;
90
+ }
91
+
92
+ .btn.connect, .gen_query {
93
+ background:#4EC0D9;
94
+ width:78px;
95
+ height:32px;
96
+ border:1px solid #4EC0D9;
97
+ border-radius:0px;
98
+ color:#fff;
99
+ cursor:pointer;
100
+ }
101
+
102
+ .select-db-label {
103
+ display: inline-block;
104
+ font-size: 16px;
105
+ width: 206px;
106
+
107
+ }
108
+
109
+ .select-db-select {
110
+ width:300px;
111
+ }
112
+
113
+ .select-db-op {
114
+ display: inline-block;
115
+ text-align: right;
116
+ font-weight: bold;
117
+ font-size: 18px;
118
+ padding: 5px 0;
119
+ }
120
+
121
+ .select-db-op.where{
122
+ width: 272px;
123
+ }
124
+
125
+ .select-db-op img{
126
+ float:left;
127
+ }
128
+
129
+ .select-db-op.orderby {
130
+ width: 295px;
131
+ }
132
+
133
+ #order_by {
134
+ width: 221px;
135
+ }
136
+
137
+ img, input[type="button"]{
138
+ cursor:pointer;
139
+ }
140
+
141
+ select {
142
+ padding: 4px 6px;
143
+ margin-right:4px;
144
+ }
145
+
146
+ #struct {
147
+ width:520px;
148
+ }
149
+
150
+ #table_struct, .cols > div {
151
+ margin-top:5px;
152
+
153
+ }
154
+
155
+ .cols input {
156
+ width: 147px;
157
+ margin: 0px 4px 0 0 !important;
158
+ padding: 4px 6px;
159
+ }
160
+
161
+ .select-db-save {
162
+ text-align: right;
163
+ margin-right: 10px;
164
  }
 
165
  </style>
166
  <div class="c1">
167
  <div class="main_func">
168
  <table class="admintable">
169
  <tr valign="top">
170
+ <td class="key" width="40%">
171
+ <label style="font-size:20px;"> <?php echo __( 'Connection type','form_maker' ); ?>: </label>
172
  </td>
173
+ <td width="50%" style="vertical-align: middle;">
174
  <input type="radio" name="con_type" id="local" value="local" checked="checked" onclick="shh(false)">
175
  <label for="local">Local</label>
176
  <input type="radio" name="con_type" id="remote" value="remote" onclick="shh(true)">
177
  <label for="remote">Remote</label>
178
  </td>
179
+ <td width="10%" style="text-align:right;">
180
+ <input type="button" value="Connect" onclick="connect()" class="btn connect">
181
+ </td>
182
  </tr>
183
  <tr class="remote_info" style="display:none">
184
+ <td width="40%">Host</td>
185
  <td>
186
+ <input type="text" name="host" id="host_rem" style="width:150px">
187
+ Port : <input type="text" name="port" id="port_rem" value="3306" style="width:48px">
188
  </td>
 
 
 
189
  <td>
 
190
  </td>
191
  </tr>
192
  <tr class="remote_info" style="display:none">
193
+ <td width="40%">Username</td>
194
  <td>
195
+ <input type="text" name="username" id="username_rem">
196
  </td>
 
 
 
197
  <td>
 
198
  </td>
199
  </tr>
200
+ <tr class="remote_info" style="display:none">
201
+ <td width="40%">Password</td>
202
+ <td>
203
+ <input type="password" name="password" id="password_rem">
204
  </td>
205
  <td>
206
+ </td>
 
 
207
  </tr>
208
+ <tr class="remote_info" style="display:none">
209
+ <td width="40%">Database</td>
210
+ <td>
211
+ <input type="text"name="database" id="database_rem">
212
  </td>
213
  <td>
 
214
  </td>
215
  </tr>
216
  </table>
217
+ <div id="struct" style="margin-left:5px;">
218
  </div>
219
  <input type="hidden" id="form_id" value="<?php echo $id ?>" >
220
  <input type="hidden" id="form_field_id" value="<?php echo $field_id ?>" >
222
  <input type="hidden" id="value_disabled" value="<?php echo $value_disabled ?>" >
223
  </div>
224
  </div>
 
225
  <?php
226
  die();
227
  }
230
  public function db_table_struct_select($form_id, $field_type){
231
  $table_struct = $this->model->get_table_struct();
232
  $label = $this->model->get_labels($form_id);
233
+ $cond='<div id="condid"><select id="sel_condid" style="width: 130px">';
234
  foreach($table_struct as $col)
235
  {
236
  $cond.='<option>'.$col->Field.'</option>';
237
  }
238
 
239
  $cond.='</select>';
240
+ $cond.='<select id="op_condid" style="width: 110px"><option value="=" selected="selected">=</option><option value="!=">!=</option><option value=">">&gt;</option><option value="<">&lt;</option><option value=">=">&gt;=</option><option value="<=">&lt;=</option><option value="%..%">Like</option><option value="%..">Starts with</option><option value="..%">Ends with</option></select><input id="val_condid" type="text" /><select id="andor_condid" style="visibility: hidden; width:70px;"><option value="AND">AND</option><option value="OR">OR</option></select><img src="' . WD_FM_URL . '/images/delete.png?ver='. get_option("wd_form_maker_version").'" onclick="delete_cond(&quot;condid&quot;)" style="vertical-align: middle;"></div>';
241
 
242
  ?>
243
 
295
 
296
 
297
  function save_query()
 
298
  {
299
  str = '';
300
  plugin_url='<?php echo WD_FM_URL; ?>';
316
  var value_disabled = jQuery('#value_disabled').val();
317
  var num = jQuery("#form_field_id").val();
318
  var field_type = jQuery("#field_type").val();
319
+ if(product_name || product_price){
320
+ jQuery('.c1').html('<div class="fm-loading-container"><div class="fm-loading-content"></div></div>');
 
 
321
  var max_value = 0;
322
  window.parent.jQuery('.change_pos').each(function() {
323
  var value = jQuery(this)[0].id;
334
  el_choices.setAttribute("id", "el_choices"+max_value);
335
  el_choices.setAttribute("type", "text");
336
  el_choices.setAttribute("value", '['+table+':'+product_name+']');
337
+ el_choices.setAttribute("class", "fm-field-choice");
338
  el_choices.setAttribute("onKeyUp", "change_label('"+num+"_label_element"+max_value+"', this.value); change_in_value('"+num+"_elementform_id_temp"+max_value+"', this.value)");
339
  el_choices.setAttribute("disabled", 'disabled');
340
  var el_choices_value = document.createElement('input');
344
  el_choices_value.setAttribute("value", '['+table+':'+product_name+']');
345
  else
346
  el_choices_value.setAttribute("value", '['+table+':'+product_price+']');
347
+ el_choices_value.setAttribute("class", "fm-field-choice");
348
  el_choices_value.setAttribute("onKeyUp", "change_label_value('"+num+"_elementform_id_temp"+max_value+"', this.value)");
349
  el_choices_value.setAttribute("disabled", 'disabled');
350
  var el_choices_params = document.createElement('input');
354
  el_choices_params.setAttribute("value", where+'[where_order_by]'+order + '[db_info]'+'['+str+']');
355
  var el_choices_remove = document.createElement('img');
356
  el_choices_remove.setAttribute("id", "el_choices"+max_value+"_remove");
357
+ el_choices_remove.setAttribute("src", plugin_url + '/images/delete.png?ver=<?php echo get_option("wd_form_maker_version"); ?>');
358
+ el_choices_remove.style.cssText = 'cursor:pointer;vertical-align:middle; margin:3px;';
359
  el_choices_remove.setAttribute("align", 'top');
360
  el_choices_remove.setAttribute("onClick", "remove_choise('"+max_value+"','"+num+"','"+field_type+"')");
361
  var el_choices_handle = document.createElement('img');
362
  el_choices_handle.setAttribute("class", "el_choices_sortable");
363
+ el_choices_handle.setAttribute("src", plugin_url + '/images/move_cursor.png?ver=<?php echo get_option("wd_form_maker_version"); ?>');
364
+ el_choices_handle.style.cssText = 'cursor:move; vertical-align:middle; margin:3px;';
365
  el_choices_handle.setAttribute("align", 'top');
366
 
367
  div.appendChild(el_choices);
416
  el_choices.setAttribute("id", "el_option"+max_value);
417
  el_choices.setAttribute("type", "text");
418
  el_choices.setAttribute("value", '['+table+':'+product_name+']');
419
+ el_choices.setAttribute("class", "fm-field-choice");
420
  el_choices.setAttribute("onKeyUp", "change_label_name('"+max_value+"', '"+num+"_option"+max_value+"', this.value)");
421
  el_choices.setAttribute("disabled", 'disabled');
422
  var el_choices_remove = document.createElement('img');
423
  el_choices_remove.setAttribute("id", "el_option"+max_value+"_remove");
424
+ el_choices_remove.setAttribute("src", plugin_url + '/images/delete.png?ver=<?php echo get_option("wd_form_maker_version"); ?>');
425
  el_choices_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
426
  el_choices_remove.setAttribute("align", 'top');
427
  el_choices_remove.setAttribute("onClick", "remove_option('"+max_value+"','"+num+"')");
440
  el_choices_value.setAttribute("value", '['+table+':'+product_name+']');
441
  else
442
  el_choices_value.setAttribute("value", '['+table+':'+product_price+']');
443
+ el_choices_value.setAttribute("class", "fm-field-choice");
444
  el_choices_value.setAttribute("onKeyUp", "change_label_value('"+num+"_option"+max_value+"', this.value)");
445
  el_choices_value.setAttribute("disabled", 'disabled');
446
  var el_choices_params = document.createElement('input');
450
  el_choices_params.setAttribute("value", where+'[where_order_by]'+order + '[db_info]'+'['+str+']');
451
  var el_choices_handle = document.createElement('img');
452
  el_choices_handle.setAttribute("class", "el_choices_sortable");
453
+ el_choices_handle.setAttribute("src", plugin_url + '/images/move_cursor.png?ver=<?php echo get_option("wd_form_maker_version"); ?>');
454
+ el_choices_handle.style.cssText = 'cursor:move; vertical-align:middle; margin:3px;';
455
  el_choices_handle.setAttribute("align", 'top');
456
 
457
  div.appendChild(el_choices);
482
  el_choices.setAttribute("id", "el_option"+max_value);
483
  el_choices.setAttribute("type", "text");
484
  el_choices.setAttribute("value", '['+table+':'+product_name+']');
485
+ el_choices.setAttribute("class", "fm-field-choice");
486
  el_choices.setAttribute("onKeyUp", "change_label_price('"+num+"_option"+max_value+"', this.value)");el_choices.setAttribute("disabled", 'disabled');
487
  var el_choices_price = document.createElement('input');
488
  el_choices_price.setAttribute("id", "el_option_price"+max_value);
489
  el_choices_price.setAttribute("type", "text");
490
  el_choices_price.setAttribute("value", '['+table+':'+product_price+']');
491
+ el_choices_price.setAttribute("class", "fm-field-paypal-choice");
492
  el_choices_price.setAttribute("onKeyUp", "change_value_price('"+num+"_option"+max_value+"', this.value)");
493
  el_choices_price.setAttribute("onKeyPress", "return check_isnum_point(event)");
494
  el_choices_price.setAttribute("disabled", 'disabled');
499
  el_choices_params.setAttribute("value", where+'[where_order_by]'+order + '[db_info]'+'['+str+']');
500
  var el_choices_remove = document.createElement('img');
501
  el_choices_remove.setAttribute("id", "el_option"+max_value+"_remove");
502
+ el_choices_remove.setAttribute("src", plugin_url + '/images/delete.png?ver=<?php echo get_option("wd_form_maker_version"); ?>');
503
+ el_choices_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px;';
504
  el_choices_remove.setAttribute("align", 'top');
505
  el_choices_remove.setAttribute("onClick", "remove_option_price('"+max_value+"','"+num+"')");
506
  var el_choices_dis = document.createElement('input');
510
  el_choices_dis.style.cssText ="vertical-align: middle; margin-right:24px; margin-left:24px;";
511
  var el_choices_handle = document.createElement('img');
512
  el_choices_handle.setAttribute("class", "el_choices_sortable");
513
+ el_choices_handle.setAttribute("src", plugin_url + '/images/move_cursor.png?ver=<?php echo get_option("wd_form_maker_version"); ?>');
514
+ el_choices_handle.style.cssText = 'cursor:move; vertical-align:middle; margin:3px;';
515
  el_choices_handle.setAttribute("align", 'top');
516
 
517
  div.appendChild(el_choices);
524
 
525
  }
526
 
 
527
  if(field_type=='paypal_radio' || field_type=='paypal_checkbox' || field_type=='paypal_shipping'){
528
  if(field_type == 'paypal_shipping')
529
  field_type = 'paypal_radio';
575
  el_choices.setAttribute("id", "el_choices"+max_value);
576
  el_choices.setAttribute("type", "text");
577
  el_choices.setAttribute("value", '['+table+':'+product_name+']');
578
+ el_choices.setAttribute("class", "fm-field-choice");
579
  el_choices.setAttribute("onKeyUp", "change_label('"+num+"_label_element"+max_value+"', this.value); change_label_1('"+num+"_elementlabel_form_id_temp"+max_value+"', this.value); ");
580
  el_choices.setAttribute("disabled", 'disabled');
581
  var el_choices_remove = document.createElement('img');
582
  el_choices_remove.setAttribute("id", "el_choices"+max_value+"_remove");
583
+ el_choices_remove.setAttribute("src", plugin_url + '/images/delete.png?ver=<?php echo get_option("wd_form_maker_version"); ?>');
584
+ el_choices_remove.style.cssText = 'cursor:pointer;vertical-align:middle; margin: 3px;';
585
  el_choices_remove.setAttribute("align", 'top');
586
  el_choices_remove.setAttribute("onClick", "remove_choise_price('"+max_value+"','"+num+"')");
587
  var el_choices_price = document.createElement('input');
588
  el_choices_price.setAttribute("id", "el_option_price"+max_value);
589
  el_choices_price.setAttribute("type", "text");
590
  el_choices_price.setAttribute("value", '['+table+':'+product_price+']');
591
+ el_choices_price.setAttribute("class", "fm-field-paypal-choice");
592
  el_choices_price.setAttribute("onKeyUp", "change_value_price('"+num+"_elementform_id_temp"+max_value+"', this.value)");
593
  el_choices_price.setAttribute("onKeyPress", "return check_isnum_point(event)");
594
  el_choices_price.setAttribute("disabled", 'disabled');
599
  el_choices_params.setAttribute("value", where+'[where_order_by]'+order + '[db_info]'+'['+str+']');
600
  var el_choices_handle = document.createElement('img');
601
  el_choices_handle.setAttribute("class", "el_choices_sortable");
602
+ el_choices_handle.setAttribute("src", plugin_url + '/images/move_cursor.png?ver=<?php echo get_option("wd_form_maker_version"); ?>');
603
+ el_choices_handle.style.cssText = 'cursor:move; vertical-align:middle; margin: 3px;';
604
  el_choices_handle.setAttribute("align", 'top');
605
 
606
 
619
  window.parent["refresh_attr"](num, 'type_checkbox');
620
 
621
  }
622
+
623
+ window.parent.tb_remove();
 
 
624
  }
 
625
  else{
626
  if(field_type=="checkbox" || field_type=="radio" || field_type=="select")
627
  alert('Select a option(s).');
674
 
675
  </script>
676
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
677
  <?php if($table_struct): ?>
678
  <div class="cols">
679
+ <div>
680
+ <label for="product_name" class="select-db-label"><?php echo (strpos($field_type, 'paypal_') === false ? 'Select a name' : ($field_type == 'paypal_shipping' ? 'Select a shipping type' : 'Select a product name')); ?></label>
681
+ <select name="product_name" id="product_name" class="select-db-select">
682
  <option value="" ></option>
683
  <?php
684
  foreach($table_struct as $col)
686
  ?>
687
  </select>
688
  </div>
689
+ <div>
690
+ <label for="product_price" class="select-db-label"><?php echo (strpos($field_type, 'paypal_') === false ? 'Select a value' : 'Select a product price'); ?></label>
691
+ <select name="product_price" id="product_price" class="select-db-select">
692
  <option value="" ></option>
693
  <?php
694
  foreach($table_struct as $col)
697
  ?>
698
  </select>
699
  </div>
700
+ <div class="select-db-op where"><img src="<?php echo WD_FM_URL . '/images/add_condition.png?ver='. get_option("wd_form_maker_version").''; ?>" title="ADD" class="add_cond"/>WHERE</div>
701
+
 
702
  </div>
703
+ <div class="select-db-op orderby">ORDER BY</div>
704
+ <div>
705
+ <label for="order_by" class="select-db-label">Select an option</label>
 
706
  <select name="order_by" id="order_by">
707
  <option value="" ></option>
708
  <?php
716
  </select>
717
  </div>
718
  <br/>
719
+ <div class="select-db-save">
720
+ <input type="button" value="Save" class="gen_query" onclick="save_query()">
721
+ </div>
722
  <form name="query_form" id="query_form" style="display:none;">
723
  <textarea id="where" name="where"></textarea>
724
  <textarea id="order" name="order"></textarea>
728
  }
729
 
730
  public function db_tables($form_id,$field_type){
 
 
731
  $tables = $this->model->get_tables();
732
  ?>
733
+ <label for="tables" class="select-db-label">Select a table</label>
734
+ <select name="tables" id="tables" class="select-db-select">
735
  <option value="" ></option>
736
  <?php
737
 
739
  echo '<option value="'.$table.'" >'.$table.'</option>';
740
  ?>
741
  </select>
 
742
  <div id="table_struct">
743
  </div>
744
 
745
  <script>
746
 
747
  jQuery("#tables").change(function (){
748
+ jQuery('#table_struct').html('<div class="fm-loading-container"><div class="fm-loading-content"></div></div>');
 
 
749
  jQuery.ajax({
750
  type: "POST",
751
  url: "<?php echo add_query_arg(array('action' => 'select_data_from_db', 'form_id' => $form_id, 'field_type' => $field_type, 'task' => 'db_table_struct_select', 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>",
752
  data: 'name='+jQuery(this).val()+'&con_type='+jQuery('input[name=con_type]:checked').val()+'&con_method='+jQuery('input[name=con_method]:checked').val()+'&host='+jQuery('#host_rem').val()+'&port='+jQuery('#port_rem').val()+'&username='+jQuery('#username_rem').val()+'&password='+jQuery('#password_rem').val()+'&database='+jQuery('#database_rem').val()+'&format=row&field_type='+jQuery('#field_type').val(),
753
  success: function(data) {
754
+ jQuery('#table_struct').removeClass("fm_loading");
755
  jQuery("#table_struct").html(data);
756
  }
757
  });
admin/views/FMViewSubmissions_fm.php CHANGED
@@ -1,64 +1,80 @@
1
  <?php
2
 
3
  class FMViewSubmissions_fm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- private $model;
14
-
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- // Constructor & Destructor //
17
- ////////////////////////////////////////////////////////////////////////////////////////
18
- public function __construct($model) {
19
- $this->model = $model;
20
- }
21
 
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Public Methods //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- public function display($form_id) {
26
- global $wpdb;
27
- $forms = $this->model->get_form_titles();
28
- $statistics = $this->model->get_statistics($form_id);
29
- $labels_parameters = $this->model->get_labels_parameters($form_id);
30
- $sorted_labels_id = $labels_parameters[0];
31
- $sorted_label_types = $labels_parameters[1];
32
- $lists = $labels_parameters[2];
33
- $sorted_label_names = $labels_parameters[3];
34
- $sorted_label_names_original = $labels_parameters[4];
35
- $rows = ((isset($labels_parameters[5])) ? $labels_parameters[5] : NULL);
36
- $group_ids = ((isset($labels_parameters[6])) ? $labels_parameters[6] : NULL);
37
- $where_choices = $labels_parameters[7];
38
- $order_by = (isset($_POST['order_by']) ? esc_html(stripslashes($_POST['order_by'])) : 'group_id');
39
- $asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'asc') ? 'asc' : '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
-
44
- $style_username = $this->model->hide_or_not($lists['hide_label_list'], '@submitterusername@');
45
- $style_useremail = $this->model->hide_or_not($lists['hide_label_list'], '@submitteremail@');
46
-
47
- $oder_class_default = "manage-column column-autor sortable desc";
48
- $oder_class = "manage-column column-title sorted " . $asc_or_desc;
49
- $ispaypal = FALSE;
50
- $temp = array();
51
- $m = count($sorted_label_names);
52
- $n = count($rows);
53
- $group_id_s = array();
54
- $group_id_s = $this->model->sort_group_ids(count($sorted_label_names),$group_ids);
55
- $ka_fielderov_search = (($lists['ip_search'] || $lists['startdate'] || $lists['enddate'] || $lists['username_search'] || $lists['useremail_search'] || $lists['id_search']) ? TRUE : FALSE);
56
- $is_stats = false;
57
- $blocked_ips = $this->model->blocked_ips();
58
- $subs_count = $this->model->get_subs_count($form_id);
59
- ?>
60
- <script type="text/javascript">
61
- function export_submissions(type, limit) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  var progressbar = jQuery( "#fm-progressbar" );
63
  var progressLabel = jQuery( ".fm-progress-label" );
64
 
@@ -105,675 +121,675 @@ class FMViewSubmissions_fm {
105
  }
106
  });
107
  }
108
- function clickLabChBAll(ChBAll) {
109
- <?php
110
- if (isset($sorted_label_names)) {
111
- $templabels = array_merge(array(
112
- 'submitid',
113
- 'submitdate',
114
- 'submitterip',
115
- 'submitterusername',
116
- 'submitteremail'
117
- ), $sorted_labels_id);
118
- $sorted_label_names_for_check = array_merge(array(
119
- 'ID',
120
- 'Submit date',
121
- "Submitter's IP",
122
- "Submitter's Username",
123
- "Submitter's Email Address"
124
- ), $sorted_label_names_original);
125
- }
126
- else {
127
- $templabels = array(
128
- 'submitid',
129
- 'submitdate',
130
- 'submitterip',
131
- 'submitterusername',
132
- 'submitteremail'
133
- );
134
- $sorted_label_names_for_check = array(
135
- 'ID',
136
- 'Submit date',
137
- "Submitter's IP",
138
- 'Submitter\'s Username',
139
- 'Submitter\'s Email Address'
140
- );
141
- }
142
- ?>
143
- if (ChBAll.checked) {
144
- document.forms.admin_form.hide_label_list.value = '';
145
- for (i = 0; i <= ChBAll.form.length; i++) {
146
- if (typeof(ChBAll.form[i]) != "undefined") {
147
- if (ChBAll.form[i].type == "checkbox") {
148
- ChBAll.form[i].checked = true;
149
- }
150
- }
151
- }
152
- }
153
- else {
154
- document.forms.admin_form.hide_label_list.value = '@<?php echo implode($templabels, '@@') ?>@' + '@payment_info@';
155
- for (i = 0; i <= ChBAll.form.length; i++) {
156
- if (typeof(ChBAll.form[i]) != "undefined") {
157
- if (ChBAll.form[i].type == "checkbox") {
158
- ChBAll.form[i].checked = false;
159
- }
160
- }
161
- }
162
- }
163
- renderColumns();
164
- }
165
- function remove_all() {
166
- if(document.getElementById('startdate'))
167
- document.getElementById('startdate').value='';
168
- if(document.getElementById('enddate'))
169
- document.getElementById('enddate').value='';
170
- if(document.getElementById('id_search'))
171
- document.getElementById('id_search').value='';
172
- if(document.getElementById('ip_search'))
173
- document.getElementById('ip_search').value='';
174
- if(document.getElementById('username_search'))
175
- document.getElementById('username_search').value='';
176
- if(document.getElementById('useremail_search'))
177
- document.getElementById('useremail_search').value='';
178
- <?php
179
- $n = count($rows);
180
- for ($i = 0; $i < count($sorted_label_names); $i++) {
181
- if ($sorted_label_types[$i] != "type_mark_map") {
182
- ?>
183
- document.getElementById('<?php echo $form_id . '_' . $sorted_labels_id[$i] . '_search'; ?>').value='';
184
- <?php
185
- }
186
- }
187
- ?>
188
- }
189
- function show_hide_filter() {
190
- if (document.getElementById('fields_filter').style.display == "none") {
191
- document.getElementById('fields_filter').style.display = '';
192
- document.getElementById('filter_img').src = '<?php echo WD_FM_URL . '/images/filter_hide.png'; ?>';
193
- }
194
- else {
195
- document.getElementById('fields_filter').style.display = "none";
196
- document.getElementById('filter_img').src = '<?php echo WD_FM_URL . '/images/filter_show.png'; ?>';
197
- }
198
- }
199
- jQuery(document).ready(function () {
200
- jQuery('.theme-detail').click(function () {
201
- jQuery(this).siblings('.themedetaildiv').toggle();
202
- return false;
203
- });
204
- });
205
- </script>
206
- <div class="fm_modal">
207
- <div id="fm-progressbar" ><div class="fm-progress-label">Loading...</div></div>
208
- </div>
209
- <div class="export_progress" style="position: fixed; z-index: 1003; height: 100%;width: 100%;top: 56%; left: 45%; font-size:15px; color:#000; display:none;"><span class="exp_count"><?php echo $subs_count; ?></span> left from <?php echo $subs_count; ?></div>
210
- <div id="sbox-overlay" onclick="toggleChBDiv(false)"
211
- 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;">
212
- </div>
213
- <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">
214
- <form action="#">
215
- <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
216
- <p style="font-weight: bold; font-size: 18px; margin-top: 0px;">Select Columns</p>
217
- <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>
218
- <?php
219
- foreach ($templabels as $key => $curlabel) {
220
- if (strpos($lists['hide_label_list'], '@' . $curlabel . '@') === FALSE) {
221
- ?>
222
- <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>
223
- <?php
224
- }
225
- else {
226
- ?>
227
- <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>
228
- <?php
229
- }
230
- }
231
- $ispaypal = FALSE;
232
- for ($i = 0; $i < count($sorted_label_names); $i++) {
233
- if ($sorted_label_types[$i] == 'type_paypal_payment_status') {
234
- $ispaypal = TRUE;
235
- }
236
- }
237
- if ($ispaypal) {
238
- ?>
239
- <div class="fm_check_labels">
240
- <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"' : ''; ?> />
241
- <label for="fm_check_payment_info"> Payment Info</label>
242
- </div>
243
- <?php
244
- }
245
- ?>
246
- <div style="text-align: center; padding: 20px;">
247
- <input type="button" class="button-secondary" onclick="toggleChBDiv(false);" value="Done" />
248
- </div>
249
- </form>
250
- </div>
251
- <div style="clear: both; float: left; width: 99%;">
252
- <div style="float:left; font-size: 14px; font-weight: bold;">
253
- This section allows you to view and manage form submissions.
254
- <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-6.html">Read More in User Manual</a>
255
- </div>
256
- <div style="float: right; text-align: right;">
257
- <a style="text-decoration: none;" target="_blank" href="https://web-dorado.com/files/fromFormMaker.php">
258
- <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
259
- </a>
260
- </div>
261
- </div>
262
- <form action="admin.php?page=submissions_fm" method="post" id="admin_form" name="admin_form">
263
- <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
264
- <input type="hidden" name="option" value="com_formmaker" />
265
- <input type="hidden" id="task" name="task" value="" />
266
- <input type="hidden" id="current_id" name="current_id" value="" />
267
- <input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php echo $asc_or_desc; ?>" />
268
- <input type="hidden" name="order_by" id="order_by" value="<?php echo $order_by; ?>" />
269
- <br />
270
- <table width="99%">
271
- <tr style="line-height: inherit !important;">
272
- <td align="left" width="300">
273
- <select name="form_id" id="form_id" style="width:99%" onchange="document.admin_form.submit();">
274
- <option value="0" selected="selected"> - Select a Form - </option>
275
- <?php
276
- if ($forms) {
277
- foreach($forms as $form) {
278
- ?>
279
- <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>
280
- <?php
281
- }
282
- }
283
- ?>
284
- </select>
285
- </td>
286
- <?php
287
- if ($form_id > 0) {
288
- ?>
289
- <td class="reports"><strong>Entries</strong><br /><?php echo $statistics["total_entries"]; ?></td>
290
- <td class="reports"><strong>Views</strong><br /><?php echo $statistics["total_views"]; ?></td>
291
- <td class="reports"><strong>Conversion Rate</strong><br/><?php echo $statistics["conversion_rate"]; ?></td>
292
- <td class="form_title">
293
- <span class="form_title_cont" title="<?php echo $chosen_form_title; ?>"><?php echo $chosen_form_title; ?></span>
294
- </td>
295
- <td style="text-align: right;" width="300">
296
- <span class="exp_but_span">Export to</span>
297
- <input type="button" class="button-secondary" value="CSV" onclick="export_submissions('csv', 0)" />&nbsp;
298
- <input type="button" class="button-secondary" value="XML" onclick="export_submissions('xml', 0)" />
299
- </td>
300
- </tr>
301
- <tr>
302
- <td align="left" colspan="4">
303
- <input type="hidden" name="hide_label_list" value="<?php echo $lists['hide_label_list']; ?>" />
304
- <img src="<?php echo WD_FM_URL . '/images/filter_show.png'; ?>" width="40" style="vertical-align: bottom; cursor: pointer;" onclick="show_hide_filter()" title="Search by fields" id="filter_img" />
305
- <input type="button" class="button-secondary" onclick="fm_form_submit(event, 'admin_form')" value="Go" />
306
- <input type="button" class="button-secondary" onclick="remove_all(); fm_form_submit(event, 'admin_form')" value="Reset" />
307
- </td>
308
- <td align="right" colspan="2">
309
- <br />
310
- <?php
311
- if (isset($sorted_label_names)) {
312
- ?>
313
- <input type="button" class="button-secondary" onclick="toggleChBDiv(true)" value="Add/Remove Columns" />
314
- <?php
315
- }
316
- ?>
317
- <input class="button-secondary" type="button" onclick="fm_set_input_value('task', 'block_ip'); fm_form_submit(event, 'admin_form')" value="Block IP" />
318
- <input class="button-secondary" type="button" onclick="fm_set_input_value('task', 'unblock_ip'); fm_form_submit(event, 'admin_form')" value="Unblock IP" />
319
- <input class="button-secondary" type="button" onclick="if (confirm('Do you want to delete selected items?')) {
320
- fm_set_input_value('task', 'delete_all');
321
- fm_form_submit(event, 'admin_form')
322
- } else {
323
- return false;
324
- }" value="Delete"/>
325
- </td>
326
- </tr>
327
- <?php
328
- }
329
- else {
330
- ?>
331
- <td></td>
332
- </tr>
333
- <?php
334
- }
335
- ?>
336
- </table>
337
- <div class="tablenav top" style="width: 99%;">
338
- <?php WDW_FM_Library::html_page_nav($lists['total'], $lists['limit'], 'admin_form'); ?>
339
- </div>
340
- <div class="submit_content" id="fm-scroll" style="width: 99%;">
341
- <table class="wp-list-table widefat fixed posts table_content">
342
- <thead>
343
- <tr>
344
- <th class="table_small_col count_col sub-align">#</th>
345
- <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>
346
- <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;?>>
347
- <a href="" class="sub_id" onclick="fm_set_input_value('order_by', 'group_id');
348
- fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'group_id' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
349
- fm_form_submit(event, 'admin_form')">
350
- <span>ID</span>
351
- <span class="sorting-indicator" style="margin-top: 8px;"></span>
352
- </a>
353
- </th>
354
- <th class="table_small_col sub-align">Edit</th>
355
- <th class="table_small_col sub-align">Delete</th>
356
- <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;?>>
357
- <a href="" onclick="fm_set_input_value('order_by', 'date');
358
- fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'date' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
359
- fm_form_submit(event, 'admin_form')">
360
- <span>Submit date</span>
361
- <span class="sorting-indicator"></span>
362
- </a>
363
- </th>
364
- <th scope="col" id="submitterip_fc" class="table_medium_col_uncenter submitterip_fc <?php if ($order_by == "ip")echo $oder_class; else echo $oder_class_default; ?>" <?php echo $style_ip;?>>
365
- <a href="" onclick="fm_set_input_value('order_by', 'ip');
366
- fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'ip' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
367
- fm_form_submit(event, 'admin_form')">
368
- <span>Submitter's IP</span>
369
- <span class="sorting-indicator"></span>
370
- </a>
371
- </th>
372
-
373
- <th scope="col" id="submitterusername_fc" class="table_medium_col_uncenter submitterusername_fc <?php if ($order_by == "display_name")echo $oder_class; else echo $oder_class_default; ?>" <?php echo $style_username;?>>
374
- <a href="" onclick="fm_set_input_value('order_by', 'display_name');
375
- fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'display_name' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
376
- fm_form_submit(event, 'admin_form')">
377
- <span>Submitter's Username</span>
378
- <span class="sorting-indicator"></span>
379
- </a>
380
- </th>
381
-
382
- <th scope="col" id="submitteremail_fc" class="table_medium_col_uncenter submitteremail_fc <?php if ($order_by == "user_email")echo $oder_class; else echo $oder_class_default; ?>" <?php echo $style_useremail ;?>>
383
- <a href="" onclick="fm_set_input_value('order_by', 'user_email');
384
- fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'user_email' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
385
- fm_form_submit(event, 'admin_form')">
386
- <span>Submitter's Email Address</span>
387
- <span class="sorting-indicator"></span>
388
- </a>
389
- </th>
390
-
391
 
392
- <?php
393
- for ($i = 0; $i < count($sorted_label_names); $i++) {
394
- $styleStr = $this->model->hide_or_not($lists['hide_label_list'], $sorted_labels_id[$i]);
395
- $styleStr2 = $this->model->hide_or_not($lists['hide_label_list'] , '@payment_info@');
396
- $field_title = $this->model->get_type_address($sorted_label_types[$i], $sorted_label_names_original[$i]);
397
- if ($sorted_label_types[$i] == 'type_paypal_payment_status') {
398
- $ispaypal = TRUE;
399
- ?>
400
- <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 . '"'; ?>">
401
- <a href="" onclick="fm_set_input_value('order_by', '<?php echo $sorted_labels_id[$i] . '_field'; ?>');
402
- fm_set_input_value('asc_or_desc', '<?php echo (($order_by == $sorted_labels_id[$i] . '_field' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
403
- fm_form_submit(event, 'admin_form')">
404
- <span><?php echo $field_title; ?></span>
405
- <span class="sorting-indicator"></span>
406
- </a>
407
- </th>
408
- <th class="table_large_col payment_info_fc" <?php echo $styleStr2; ?>>Payment Info</th>
409
- <?php
410
- }
411
- else {
412
- ?>
413
- <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 . '"'; ?>">
414
- <a href="" onclick="fm_set_input_value('order_by', '<?php echo $sorted_labels_id[$i] . '_field'; ?>');
415
- fm_set_input_value('asc_or_desc', '<?php echo (($order_by == $sorted_labels_id[$i] . '_field' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
416
- fm_form_submit(event, 'admin_form')">
417
- <span><?php echo $field_title; ?></span>
418
- <span class="sorting-indicator"></span>
419
- </a>
420
- </th>
421
- <?php
422
- }
423
- }
424
- ?>
425
- </tr>
426
- <tr id="fields_filter" style="display: none;">
427
- <th></th>
428
- <th></th>
429
- <th class="submitid_fc" <?php echo $style_id; ?> >
430
- <input type="text" name="id_search" id="id_search" value="<?php echo $lists['id_search'] ?>" onChange="this.form.submit();" style="width:30px"/>
431
- </th>
432
- <th></th>
433
- <th></th>
434
- <th width="150" class="submitdate_fc" <?php echo $style_date; ?>>
435
- <table align="center" style="margin:auto" class="simple_table">
436
- <tr class="simple_table">
437
- <td class="simple_table" style="text-align: left;">From:</td>
438
- <td style="text-align: center;" class="simple_table">
439
- <input class="inputbox" type="text" name="startdate" id="startdate" size="10" maxlength="10" value="<?php echo $lists['startdate']; ?>" />
440
- </td>
441
- <td style="text-align: center;" class="simple_table">
442
- <input type="reset" style="width: 22px; border-radius: 3px !important;" class="button" value="..." onclick="return showCalendar('startdate','%Y-%m-%d');" />
443
- </td>
444
- </tr>
445
- <tr class="simple_table">
446
- <td style="text-align: left;" class="simple_table">To:</td>
447
- <td style="text-align: center;" class="simple_table">
448
- <input class="inputbox" type="text" name="enddate" id="enddate" size="10" maxlength="10" value="<?php echo $lists['enddate']; ?>" />
449
- </td>
450
- <td style="text-align: center;" class="simple_table">
451
- <input type="reset" style="width: 22px; border-radius: 3px !important;" class="button" value="..." onclick="return showCalendar('enddate','%Y-%m-%d');" />
452
- </td>
453
- </tr>
454
- </table>
455
- </th>
456
- <th class="table_medium_col_uncenter submitterip_fc" <?php echo $style_ip; ?>>
457
- <input type="text" name="ip_search" id="ip_search" value="<?php echo $lists['ip_search']; ?>" onChange="this.form.submit();" />
458
- </th>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
459
 
460
- </th>
461
- <th class="table_medium_col_uncenter submitterusername_fc" <?php echo $style_username; ?>>
462
- <input type="text" name="username_search" id="username_search" value="<?php echo $lists['username_search']; ?>" onChange="this.form.submit();" />
463
- </th>
464
-
465
- </th>
466
- <th class="table_medium_col_uncenter submitteremail_fc" <?php echo $style_useremail; ?>>
467
- <input type="text" name="useremail_search" id="useremail_search" value="<?php echo $lists['useremail_search']; ?>" onChange="this.form.submit();" />
468
- </th>
469
-
470
- <?php
471
- for ($i = 0; $i < count($sorted_label_names); $i++) {
472
- $styleStr = $this->model->hide_or_not($lists['hide_label_list'], $sorted_labels_id[$i]);
473
- if (!$ka_fielderov_search) {
474
- if ($lists[$form_id . '_' . $sorted_labels_id[$i] . '_search']) {
475
- $ka_fielderov_search = TRUE;
476
- }
477
- }
478
- switch ($sorted_label_types[$i]) {
479
- case 'type_mark_map': ?>
480
- <th class="table_large_col <?php echo $sorted_labels_id[$i]; ?>_fc" <?php echo $styleStr; ?>></th>
481
- <?php
482
- break;
483
- case 'type_paypal_payment_status': ?>
484
- <th class="table_large_col <?php echo $sorted_labels_id[$i]; ?>_fc" <?php echo $styleStr; ?>>
485
- <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']; ?>" >
486
- <option value="" ></option>
487
- <option value="canceled" >Canceled</option>
488
- <option value="cleared" >Cleared</option>
489
- <option value="cleared by payment review" >Cleared by payment review</option>
490
- <option value="completed" >Completed</option>
491
- <option value="denied" >Denied</option>
492
- <option value="failed" >Failed</option>
493
- <option value="held" >Held</option>
494
- <option value="in progress" >In progress</option>
495
- <option value="on hold" >On hold</option>
496
- <option value="paid" >Paid</option>
497
- <option value="partially refunded" >Partially refunded</option>
498
- <option value="pending verification" >Pending verification</option>
499
- <option value="placed" >Placed</option>
500
- <option value="processing" >Processing</option>
501
- <option value="refunded" >Refunded</option>
502
- <option value="refused" >Refused</option>
503
- <option value="removed" >Removed</option>
504
- <option value="returned" >Returned</option>
505
- <option value="reversed" >Reversed</option>
506
- <option value="temporary hold" >Temporary hold</option>
507
- <option value="unclaimed" >Unclaimed</option>
508
- </select>
509
- <script>
510
- var element = document.getElementById('<?php echo $form_id.'_'.$sorted_labels_id[$i]; ?>_search');
511
- element.value = '<?php echo $lists[$form_id.'_'.$sorted_labels_id[$i].'_search']; ?>';
512
- </script>
513
- </th>
514
- <th class="table_large_col payment_info_fc" <?php echo $styleStr2; ?>></th>
515
- <?php
516
- break;
517
- default: ?>
518
- <th class="<?php echo $sorted_labels_id[$i]; ?>_fc" <?php echo $styleStr; ?>>
519
- <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();" >
520
- </th>
521
- <?php
522
- break;
523
- }
524
- }
525
- ?>
526
- </tr>
527
- </thead>
528
- <?php
529
- $k = 0;
530
- for ($www = 0, $qqq = count($group_id_s); $www < $qqq; $www++) {
531
- $i = $group_id_s[$www];
532
- $alternate = (!isset($alternate) || $alternate == 'class="alternate"') ? '' : 'class="alternate"';
533
- $temp = $this->model->array_for_group_id($group_id_s[$www], $rows);
534
- $data = $temp[0];
535
- $userinfo=get_userdata($data->user_id_wd);
536
- $useremail=$userinfo ? $userinfo->user_email : "";
537
- $username=$userinfo ? $userinfo->display_name : "";
538
-
539
- ?>
540
- <tr <?php echo $alternate; ?>>
541
- <td class="table_small_col count_col sub-align"><?php echo $www + 1; ?></td>
542
- <th class="check-column table_small_col sub-align" style="padding: 0;">
543
- <input type="checkbox" name="post[]" value="<?php echo $data->group_id; ?>">
544
- </th>
545
- <td class="table_small_col sub-align submitid_fc" id="submitid_fc" <?php echo $style_id; ?>>
546
- <a href="" onclick="fm_set_input_value('task', 'edit');
547
- fm_set_input_value('current_id',<?php echo $data->group_id; ?>);
548
- fm_form_submit(event, 'admin_form');" ><?php echo $data->group_id; ?>
549
- </a>
550
- </td>
551
- <td class="table_small_col sub-align">
552
- <a href="" onclick="fm_set_input_value('task', 'edit');
553
- fm_set_input_value('current_id',<?php echo $data->group_id; ?>);
554
- fm_form_submit(event, 'admin_form');">Edit
555
- </a>
556
- </td>
557
- <td class="table_small_col sub-align">
558
- <a href="" onclick="if (confirm('Do you want to delete selected item(s)?')) { fm_set_input_value('task', 'delete'); fm_set_input_value('current_id',<?php echo $data->group_id; ?>); fm_form_submit(event, 'admin_form'); } else { return false; }">Delete
559
- </a>
560
- </td>
561
- <td class="table_large_col submitdate_fc sub-align" id="submitdate_fc" <?php echo $style_date; ?>>
562
- <a href="" onclick="fm_set_input_value('task', 'edit');
563
- fm_set_input_value('current_id',<?php echo $data->group_id; ?>);
564
- fm_form_submit(event, 'admin_form');" ><?php echo $data->date ;?>
565
- </a>
566
- </td>
567
- <td class="table_medium_col_uncenter submitterip_fc sub-align" id="submitterip_fc" <?php echo $style_ip; ?>>
568
- <a class="thickbox-preview" href="<?php echo add_query_arg(array('action' => 'fromipinfoinpopup', 'data_ip' => $data->ip, 'width' => '400', 'height' => '300', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" title="Show submitter information" <?php echo (!in_array($data->ip, $blocked_ips)) ? '' : 'style="color: #FF0000;"'; ?>><?php echo $data->ip; ?></a>
569
- </td>
570
-
571
-
572
-
573
- <td class="table_large_col submitterusername_fc sub-align" id="submitterusername_fc" <?php echo $style_username; ?>>
574
- <?php echo $username; ?>
575
- </td>
576
-
577
- <td class="table_large_col submitteremail_fc sub-align" id="submitteremail_fc" <?php echo $style_useremail; ?>>
578
- <?php echo $useremail; ?>
579
- </td>
580
-
581
-
582
-
583
- <?php
584
- for ($h = 0; $h < $m; $h++) {
585
- $not_label = TRUE;
586
- for ($g = 0; $g < count($temp); $g++) {
587
- $styleStr = $this->model->hide_or_not($lists['hide_label_list'], $sorted_labels_id[$h]);
588
- if ($temp[$g]->element_label == $sorted_labels_id[$h]) {
589
- if (strpos($temp[$g]->element_value, "***map***")) {
590
- $map_params = explode('***map***', $temp[$g]->element_value);
591
- ?>
592
- <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; ?>>
593
- <a class="thickbox-preview" href="<?php echo add_query_arg(array('action' => 'frommapeditinpopup', 'long' => $map_params[0], 'lat' => $map_params[1], 'width' => '620', 'height' => '550', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" title="Show on Map">Show on Map</a>
594
- </td>
595
- <?php
596
- }
597
- elseif (strpos($temp[$g]->element_value, "*@@url@@*")) {
598
- ?>
599
- <td class="<?php echo $sorted_labels_id[$h]; ?>_fc sub-align" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?>>
600
- <?php
601
- $new_files = explode("*@@url@@*", $temp[$g]->element_value);
602
- foreach ($new_files as $new_file) {
603
- if ($new_file) {
604
- $new_filename = explode('/', $new_file);
605
- $new_filename = $new_filename[count($new_filename) - 1];
606
- ?>
607
- <a target="_blank" class="fm_fancybox" rel="group_<?php echo $www; ?>" href="<?php echo $new_file; ?>"><?php echo $new_filename; ?></a><br />
608
- <?php
609
- }
610
- }
611
- ?>
612
- </td>
613
- <?php
614
- }
615
- elseif (strpos($temp[$g]->element_value, "***star_rating***")) {
616
- $view_star_rating_array = $this->model->view_for_star_rating($temp[$g]->element_value, $temp[$g]->element_label);
617
- $stars = $view_star_rating_array[0];
618
- ?>
619
- <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>
620
- <?php
621
- }
622
- elseif (strpos($temp[$g]->element_value, "***matrix***")) {
623
- ?>
624
- <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; ?>>
625
- <a class="thickbox-preview" href="<?php echo add_query_arg(array('action' => 'show_matrix', 'matrix_params' => $temp[$g]->element_value, 'width' => '620', 'height' => '550', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" title="Show Matrix">Show Matrix</a>
626
- </td>
627
- <?php
628
- }
629
- elseif (strpos($temp[$g]->element_value, "@@@") !== FALSE || $temp[$g]->element_value == "@@@" || $temp[$g]->element_value == "@@@@@@@@@") {
630
- ?>
631
- <td class="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?>>
632
- <p><?php echo str_replace("@@@", " ", $temp[$g]->element_value); ?></p>
633
- </td>
634
- <?php
635
- }
636
- elseif (strpos($temp[$g]->element_value, "***grading***")) {
637
- $view_grading_array = $this->model->view_for_grading($temp[$g]->element_value);
638
- $items = $view_grading_array[0];
639
- ?>
640
- <td class="<?php echo $sorted_labels_id[$h];?>_fc sub-align" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?>>
641
- <p><?php echo $items; ?></p>
642
- </td>
643
- <?php
644
- }
645
- else {
646
- if (strpos($temp[$g]->element_value, "***quantity***")) {
647
- $temp[$g]->element_value = str_replace("***quantity***", " ", $temp[$g]->element_value);
648
  }
649
- if (strpos($temp[$g]->element_value, "***property***")) {
650
- $temp[$g]->element_value = str_replace("***property***", " ", $temp[$g]->element_value);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
651
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
652
 
653
- if($sorted_label_types[$h]=="type_submitter_mail"){
654
- $query = $wpdb->prepare('SELECT id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id ="%d" AND group_id="%d" AND element_value="verified**%d"', $form_id, $i, $sorted_labels_id[$h]);
655
- $isverified = $wpdb->get_var($query);
656
-
657
- if($isverified) { ?>
658
- <td class="<?php echo $sorted_labels_id[$h];?>_fc" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?>>
659
- <p><?php echo $temp[$g]->element_value; ?> <span style="color:#2DA068;">( Verified <img src="<?php echo WD_FM_URL . '/images/verified.png'; ?>" /> )</span></p>
660
- </td>
661
- <?php }
662
- else {?>
663
- <td class="<?php echo $sorted_labels_id[$h];?>_fc" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?>>
664
- <p><?php echo $temp[$g]->element_value; ?></p>
665
- </td>
666
- <?php }
667
- }
668
- else{
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
669
  ?>
670
- <td class="<?php echo $sorted_labels_id[$h];?>_fc sub-align" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?>>
671
- <p><?php echo str_replace("***br***", '<br>', stripslashes($temp[$g]->element_value)) ; ?></p>
672
- </td>
673
- <?php
 
 
674
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
675
  }
676
- $not_label = FALSE;
677
- }
678
- }
679
- if ($not_label) {
680
- ?>
681
- <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>
682
- <?php
683
- }
684
- }
685
- if ($ispaypal) {
686
- $styleStr = $this->model->hide_or_not($lists['hide_label_list'], '@payment_info@');
687
- ?>
688
- <td class="table_large_col payment_info_fc sub-align" id="payment_info_fc" <?php echo $styleStr; ?>>
689
- <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')); ?>">
690
- <img src="<?php echo WD_FM_URL . '/images/info.png'; ?>" />
691
- </a>
692
- </td>
693
- <?php
694
- }
695
- ?>
696
- </tr>
697
- <?php
698
- $k = 1 - $k;
699
- }
700
- ?>
701
- </table>
702
- </div>
703
- <?php
704
- if ($sorted_label_types) {
705
- foreach ($sorted_label_types as $key => $sorted_label_type) {
706
- if ($this->model->check_radio_type($sorted_label_type)) {
707
- $is_stats = true;
708
- break;
709
- }
710
- }
711
- if ($is_stats) {
712
- $ajax_nonce = wp_create_nonce( "nonce_fm_ajax" );
713
- ?>
714
- <br /><br />
715
- <h1 style="border-bottom: 1px solid; padding-bottom:7px; width:99%; color: hsl(197, 100%, 32%);">Statistics</h1>
716
- <table class="wp-list-table widefat fixed posts table_content" style="width: 99%;">
717
- <tr>
718
- <td class="key" style="vertical-align: middle;width: 9%">
719
- <label for="sorted_label_key">Select a Field:</label>
720
- </td>
721
- <td width="330">
722
- <select id="sorted_label_key">
723
- <option value="">Select a Field</option>
724
- <?php
725
- foreach ($sorted_label_types as $key => $sorted_label_type) {
726
- 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") {
727
- ?>
728
- <option value="<?php echo $key; ?>"><?php echo $sorted_label_names_original[$key]; ?></option>
729
- <?php
730
- }
731
- }
732
- ?>
733
- </select>
734
- </td>
735
- <td></td>
736
- </tr>
737
- <tr>
738
- <td class="key" style="vertical-align: middle;">
739
- <label>Select a Date:</label>
740
- </td>
741
- <td width="330">
742
- From: <input class="inputbox" type="text" name="startstats" id="startstats" size="9" maxlength="9" />
743
- <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');" />
744
-
745
- To: <input class="inputbox" type="text" name="endstats" id="endstats" size="9" maxlength="9" />
746
- <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');" />
747
- </td>
748
- <td class="key" style="vertical-align: middle;">
749
- <input type="button" onclick="show_stats()" class="button-secondary" value="Show">
750
- </td>
751
- </tr>
752
- </table>
753
- <div id="div_stats"></div>
754
- <script>
755
- function show_stats() {
756
- 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>');
757
- if(jQuery('#sorted_label_key').val()!="") {
758
- jQuery('#div_stats').load('<?php echo add_query_arg(array('action' => 'get_stats', 'page' => 'submissions_fm'), admin_url('admin-ajax.php')); ?>', {
759
- 'task': 'show_stats',
760
- 'form_id' : '<?php echo $form_id; ?>',
761
- 'sorted_label_key' : jQuery('#sorted_label_key').val(),
762
- 'startdate' : jQuery('#startstats').val(),
763
- 'enddate' : jQuery('#endstats').val(),
764
- 'nonce_fm_ajax': '<?php echo $ajax_nonce; ?>'
765
- });
766
- }
767
- else
768
- jQuery('#div_stats').html("Please select the field!")
769
- }
770
- </script>
771
- <?php
772
- }
773
- }
774
- ?>
775
- </form>
776
- <script>
777
  function fm_scroll(element) {
778
  var scrollbar= document.createElement('div');
779
  scrollbar.appendChild(document.createElement('div'));
@@ -789,92 +805,110 @@ class FMViewSubmissions_fm {
789
  scrollbar.scrollLeft= element.scrollLeft;
790
  };
791
  element.parentNode.insertBefore(scrollbar, element);
792
- }
793
- jQuery(window).load(function() {
794
- fm_popup();
795
- fm_scroll(document.getElementById('fm-scroll'));
796
- });
797
- <?php
798
- if ($ka_fielderov_search) {
799
- ?>
800
- document.getElementById('fields_filter').style.display = '';
801
- <?php
802
- }
803
- ?>
804
- </script>
805
- <?php
806
- }
807
-
808
- public function show_stats($form_id) {
809
- $key = (isset($_POST['sorted_label_key']) ? esc_html(stripslashes($_POST['sorted_label_key'])) : '');
810
- $labels_parameters = $this->model->get_labels_parameters($form_id);
811
- $where_choices = $labels_parameters[7];
812
- $sorted_label_names_original = $labels_parameters[4];
813
- $sorted_labels_id = $labels_parameters[0];
814
- if(count($sorted_labels_id)!=0 && $key < count($sorted_labels_id) ) {
815
- $choices_params = $this->model->statistic_for_radio($where_choices, $sorted_labels_id[$key]);
816
- $sorted_label_name_original = $sorted_label_names_original[$key];
817
- $choices_count = $choices_params[0];
818
- $choices_labels = $choices_params[1];
819
- $unanswered = $choices_params[2];
820
- $all = $choices_params[3];
821
- $colors = $choices_params[4];
822
- }
823
- else {
824
- $choices_labels = array();
825
- $sorted_label_name_original = '';
826
- $unanswered = NULL;
827
- $all = 0;
828
  }
829
- ?>
830
- <br/>
831
- <br/>
832
- <strong><?php echo stripslashes($sorted_label_name_original); ?></strong>
833
- <br/>
834
- <br/>
835
- <table style="width:99%" class="wp-list-table widefat fixed posts">
836
- <thead>
837
- <tr>
838
- <th width="20%">Choices</th>
839
- <th>Percentage</th>
840
- <th width="10%">Count</th>
841
- </tr>
842
- </thead>
843
- <?php
844
- foreach ($choices_labels as $key => $choices_label) {
845
- if (strpos($choices_label, "***quantity***")) {
846
- $choices_label = str_replace("***quantity***", " ", $choices_label);
847
- }
848
- if (strpos($choices_label, "***property***")) {
849
- $choices_label = str_replace("***property***", " ", $choices_label);
850
- }
851
- ?>
852
- <tr>
853
- <td><?php echo str_replace("***br***", '<br>', $choices_label); ?></td>
854
- <td>
855
- <div class="bordered" style="width:<?php echo ($choices_count[$key] / ($all - $unanswered)) * 100; ?>%; height:18px; background-color:<?php echo $colors[$key % 2]; ?>"></div>
856
- </td>
857
- <td><?php echo $choices_count[$key]; ?></td>
858
- </tr>
859
- <?php
860
  }
861
- if ($unanswered) {
862
- ?>
863
- <tr>
864
- <td colspan="2" align="right">Unanswered</th>
865
- <td><strong><?php echo $unanswered; ?></strong></th>
866
- </tr>
867
- <?php
868
  }
869
- ?>
870
- <tr>
871
- <td colspan="2" align="right"><strong>Total</strong></th>
872
- <td><strong><?php echo $all; ?></strong></th>
873
- </tr>
874
- </table>
875
- <?php
876
- die();
877
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
878
 
879
  public function edit($id) {
880
  $current_id = ((isset($id)) ? $id : 0);
@@ -1146,63 +1180,68 @@ class FMViewSubmissions_fm {
1146
  $username = $userinfo ? $userinfo->display_name : "";
1147
  $useremail = $userinfo ? $userinfo->user_email : "";
1148
  ?>
 
 
 
 
 
 
 
 
 
 
1149
  <form action="admin.php?page=submissions_fm" method="post" id="formform_id_temp" name="formform_id_temp">
1150
- <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
1151
- <table width="99%">
1152
- <tbody>
1153
- <tr>
1154
- <td width="100%"><h2>Edit Submission</h2></td>
1155
- <td align="right">
1156
- <input type="button" class="button-secondary" onclick="pressbutton();
1157
- fm_set_input_value('task', 'save');
1158
- fm_set_input_value('current_id', <?php echo $current_id ;?>);
1159
- fm_form_submit(event, 'formform_id_temp');" value="Save" class="button-secondary action">
1160
- </td>
1161
- <td align="right">
1162
- <input type="button" class="button-secondary" onclick="pressbutton();
1163
- fm_set_input_value('task', 'apply');
1164
- fm_set_input_value('current_id', <?php echo $current_id ;?>);
1165
- fm_form_submit(event, 'formform_id_temp');" value="Apply" class="button-secondary action">
1166
- </td>
1167
- <td align="right">
1168
- <input class="button-secondary" type="button" onclick="fm_set_input_value('task', '');fm_form_submit(event, 'formform_id_temp');" value="Cancel" class="button-secondary action">
1169
- </td>
1170
- </tr>
1171
- </tbody>
1172
- </table>
1173
- <table class="admintable">
1174
- <tr>
1175
- <td class="fm_label"><label for="ID">ID: </label></td>
1176
- <td><?php echo $rows[0]->group_id; ?></td>
1177
- </tr>
1178
- <tr>
1179
- <td class="fm_label"><label for="Date">Date: </label></td>
1180
- <td><?php echo $rows[0]->date; ?></td>
1181
- </tr>
1182
- <tr>
1183
- <td class="fm_label"><label for="IP">IP: </label></td>
1184
- <td><?php echo $rows[0]->ip; ?></td>
1185
- </tr>
1186
-
1187
- <tr>
1188
- <td class="fm_label"><label for="Submitter's Username">Submitter's Username: </label></td>
1189
- <td><?php echo $username; ?></td>
1190
- </tr>
1191
- <tr>
1192
- <td class="fm_label"><label for="Submitter's Email Address">Submitter's Email Address: </label></td>
1193
- <td><?php echo $useremail; ?></td>
1194
- </tr>
1195
-
1196
- </table>
1197
- <?php
1198
- $css_rep1 = array("[SITE_ROOT]");
1199
- $css_rep2 = array(WD_FM_URL);
1200
- $order = array("\r\n", "\n", "\r");
1201
- $form_theme = str_replace($order, '', $form_theme);
1202
- $form_theme = str_replace($css_rep1, $css_rep2, $form_theme);
1203
- $form_theme = "#form" . $form->id . ' ' . $form_theme;
1204
- ?>
1205
- <style>
1206
  <?php
1207
  echo $form_theme;
1208
  ?>
@@ -1480,15 +1519,16 @@ class FMViewSubmissions_fm {
1480
 
1481
  break;
1482
  }
1483
- case 'type_name': {
 
1484
 
1485
  if($element_value =='')
1486
  $element_value = '@@@';
1487
 
1488
- $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');
1489
- $temp = $params;
1490
- if(strpos($temp, 'w_name_fields') > -1)
1491
- $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class', 'w_name_fields');
1492
 
1493
  foreach($params_names as $params_name ) {
1494
  $temp=explode('*:*'.$params_name.'*:*',$temp);
@@ -4379,7 +4419,9 @@ class FMViewSubmissions_fm {
4379
  }
4380
  echo $form;
4381
  ?>
4382
- <input type="hidden" name="option" value="com_formmaker"/>
 
 
4383
  <input type="hidden" id="current_id" name="current_id" value="<?php echo $rows[0]->group_id; ?>" />
4384
  <input type="hidden" name="form_id" value="<?php echo $rows[0]->form_id; ?>" />
4385
  <input type="hidden" name="date" value="<?php echo $rows[0]->date; ?>" />
1
  <?php
2
 
3
  class FMViewSubmissions_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ // Constructor & Destructor //
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct($model) {
19
+ $this->model = $model;
20
+ }
21
 
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display($form_id) {
26
+
27
+
28
+ global $wpdb;
29
+ $forms = $this->model->get_form_titles();
30
+ $statistics = $this->model->get_statistics($form_id);
31
+ $labels_parameters = $this->model->get_labels_parameters($form_id);
32
+
33
+ $sorted_labels_id = $labels_parameters[0];
34
+ $sorted_label_types = $labels_parameters[1];
35
+ $lists = $labels_parameters[2];
36
+ $sorted_label_names = $labels_parameters[3];
37
+ $sorted_label_names_original = $labels_parameters[4];
38
+ $rows = ((isset($labels_parameters[5])) ? $labels_parameters[5] : NULL);
39
+ $group_ids = ((isset($labels_parameters[6])) ? $labels_parameters[6] : NULL);
40
+ $where_choices = $labels_parameters[7];
41
+ $order_by = (isset($_POST['order_by']) ? esc_html(stripslashes($_POST['order_by'])) : 'group_id');
42
+ $asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'asc') ? 'asc' : 'desc');
43
+ $style_id = $this->model->hide_or_not($lists['hide_label_list'], '@submitid@');
44
+ $style_date = $this->model->hide_or_not($lists['hide_label_list'], '@submitdate@');
45
+ $style_ip = $this->model->hide_or_not($lists['hide_label_list'], '@submitterip@');
46
+
47
+ $style_username = $this->model->hide_or_not($lists['hide_label_list'], '@submitterusername@');
48
+ $style_useremail = $this->model->hide_or_not($lists['hide_label_list'], '@submitteremail@');
49
+
50
+ $oder_class_default = "manage-column column-autor sortable desc";
51
+ $oder_class = "manage-column column-title sorted " . $asc_or_desc;
52
+ $ispaypal = FALSE;
53
+ $temp = array();
54
+ $m = count($sorted_label_names);
55
+ $n = count($rows);
56
+ $group_id_s = array();
57
+ $group_id_s = $this->model->sort_group_ids(count($sorted_label_names),$group_ids);
58
+ $ka_fielderov_search = (($lists['ip_search'] || $lists['startdate'] || $lists['enddate'] || $lists['username_search'] || $lists['useremail_search'] || $lists['id_search']) ? TRUE : FALSE);
59
+ $is_stats = false;
60
+ $blocked_ips = $this->model->blocked_ips();
61
+
62
+ if (defined('WD_FM_PDF') && is_plugin_active(constant('WD_FM_PDF'))) {
63
+ require_once(WD_FM_PDF_DIR.'/model.php');
64
+ $pdf_data = WD_FM_PDF_model::get_pdf_data($form_id);
65
+ }
66
+ $subs_count = $this->model->get_subs_count($form_id);
67
+ $chosen_form_title = '';
68
+ if ($forms) {
69
+ foreach($forms as $form) {
70
+ if ($form_id == $form->id) {
71
+ $chosen_form_title = $form->title;
72
+ }
73
+ }
74
+ }
75
+ ?>
76
+ <script type="text/javascript">
77
+ function export_submissions(type, limit) {
78
  var progressbar = jQuery( "#fm-progressbar" );
79
  var progressLabel = jQuery( ".fm-progress-label" );
80
 
121
  }
122
  });
123
  }
124
+
125
+ function clickLabChBAll(ChBAll) {
126
+ <?php
127
+ if (isset($sorted_label_names)) {
128
+ $templabels = array_merge(array(
129
+ 'submitid',
130
+ 'submitdate',
131
+ 'submitterip',
132
+ 'submitterusername',
133
+ 'submitteremail'
134
+ ), $sorted_labels_id);
135
+ $sorted_label_names_for_check = array_merge(array(
136
+ 'ID',
137
+ 'Submit date',
138
+ "Submitter's IP",
139
+ "Submitter's Username",
140
+ "Submitter's Email Address"
141
+ ), $sorted_label_names_original);
142
+ }
143
+ else {
144
+ $templabels = array(
145
+ 'submitid',
146
+ 'submitdate',
147
+ 'submitterip',
148
+ 'submitterusername',
149
+ 'submitteremail'
150
+ );
151
+ $sorted_label_names_for_check = array(
152
+ 'ID',
153
+ 'Submit date',
154
+ "Submitter's IP",
155
+ 'Submitter\'s Username',
156
+ 'Submitter\'s Email Address'
157
+ );
158
+ }
159
+ ?>
160
+ if (ChBAll.checked) {
161
+ document.forms.admin_form.hide_label_list.value = '';
162
+ for (i = 0; i <= ChBAll.form.length; i++) {
163
+ if (typeof(ChBAll.form[i]) != "undefined") {
164
+ if (ChBAll.form[i].type == "checkbox") {
165
+ ChBAll.form[i].checked = true;
166
+ }
167
+ }
168
+ }
169
+ }
170
+ else {
171
+ document.forms.admin_form.hide_label_list.value = '@<?php echo implode($templabels, '@@') ?>@' + '@payment_info@';
172
+ for (i = 0; i <= ChBAll.form.length; i++) {
173
+ if (typeof(ChBAll.form[i]) != "undefined") {
174
+ if (ChBAll.form[i].type == "checkbox") {
175
+ ChBAll.form[i].checked = false;
176
+ }
177
+ }
178
+ }
179
+ }
180
+ renderColumns();
181
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
 
183
+ function remove_all() {
184
+ if(document.getElementById('startdate'))
185
+ document.getElementById('startdate').value='';
186
+ if(document.getElementById('enddate'))
187
+ document.getElementById('enddate').value='';
188
+ if(document.getElementById('id_search'))
189
+ document.getElementById('id_search').value='';
190
+ if(document.getElementById('ip_search'))
191
+ document.getElementById('ip_search').value='';
192
+ if(document.getElementById('username_search'))
193
+ document.getElementById('username_search').value='';
194
+ if(document.getElementById('useremail_search'))
195
+ document.getElementById('useremail_search').value='';
196
+ <?php
197
+ $n = count($rows);
198
+ for ($i = 0; $i < count($sorted_label_names); $i++) {
199
+ if ($sorted_label_types[$i] != "type_mark_map") { ?>
200
+ document.getElementById('<?php echo $form_id . '_' . $sorted_labels_id[$i] . '_search'; ?>').value='';
201
+ <?php
202
+ }
203
+ }
204
+ ?>
205
+ }
206
+ function show_hide_filter() {
207
+ if (document.getElementById('fields_filter').style.display == "none") {
208
+ document.getElementById('fields_filter').style.display = '';
209
+ }
210
+ else {
211
+ document.getElementById('fields_filter').style.display = "none";
212
+ }
213
+ return false;
214
+ }
215
+ jQuery(document).ready(function () {
216
+ jQuery('.theme-detail').click(function () {
217
+ jQuery(this).siblings('.themedetaildiv').toggle();
218
+ return false;
219
+ });
220
+ });
221
+ </script>
222
+ <div class="fm_modal">
223
+ <div id="fm-progressbar" >
224
+ <div class="fm-progress-label">Loading...</div>
225
+ </div>
226
+ </div>
227
+ <div class="export_progress">
228
+ <span class="exp_count"><?php echo $subs_count; ?></span> left from <?php echo $subs_count; ?>
229
+ </div>
230
+ <div id="sbox-overlay" onclick="toggleChBDiv(false);">
231
+ </div>
232
+ <div id="ChBDiv">
233
+ <form action="#">
234
+ <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
235
+ <p style="font-weight: bold; font-size: 18px; margin-top: 0px;">Select Columns</p>
236
+ <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>
237
+ <?php
238
+ foreach ($templabels as $key => $curlabel) {
239
+ if (strpos($lists['hide_label_list'], '@' . $curlabel . '@') === FALSE) {
240
+ ?>
241
+ <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>
242
+ <?php
243
+ }
244
+ else {
245
+ ?>
246
+ <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>
247
+ <?php
248
+ }
249
+ }
250
+ $ispaypal = FALSE;
251
+ for ($i = 0; $i < count($sorted_label_names); $i++) {
252
+ if ($sorted_label_types[$i] == 'type_paypal_payment_status') {
253
+ $ispaypal = TRUE;
254
+ }
255
+ }
256
+ if ($ispaypal) {
257
+ ?>
258
+ <div class="fm_check_labels">
259
+ <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"' : ''; ?> />
260
+ <label for="fm_check_payment_info"> Payment Info</label>
261
+ </div>
262
+ <?php
263
+ }
264
+ ?>
265
+ <div style="text-align: center; padding-top: 20px;">
266
+ <button onclick="toggleChBDiv(false); return false;" style="background: #4EC0D9; width: 78px; height: 32px; border: 1px solid #4EC0D9; border-radius: 0px; color: #fff; cursor: pointer;">Done</button>
267
+ </div>
268
+ </form>
269
+ </div>
270
+ <div class="fm-user-manual">
271
+ This section allows you to view and manage form submissions.
272
+ <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-6.html">Read More in User Manual</a>
273
+ </div>
274
+ <div class="fm-upgrade-pro">
275
+ <a target="_blank" href="https://web-dorado.com/files/fromFormMaker.php">
276
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
277
+ </a>
278
+ </div>
279
+ <div class="fm-clear"></div>
280
+ <form action="admin.php?page=submissions_fm" method="post" id="admin_form" name="admin_form">
281
+ <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
282
+ <input type="hidden" name="option" value="com_formmaker" />
283
+ <input type="hidden" id="task" name="task" value="" />
284
+ <input type="hidden" id="current_id" name="current_id" value="" />
285
+ <input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php echo $asc_or_desc; ?>" />
286
+ <input type="hidden" name="order_by" id="order_by" value="<?php echo $order_by; ?>" />
287
 
288
+ <div class="fm-submissions-page">
289
+ <div class="submissions-actions">
290
+ <div class="fm-form-title">
291
+ <?php echo $chosen_form_title; ?>
292
+ </div>
293
+ <div class="fm-page-actions">
294
+ <button class="fm-button block-button small" onclick="fm_set_input_value('task', 'block_ip'); fm_form_submit(event, 'admin_form');">
295
+ <span></span>
296
+ Block IP
297
+ </button>
298
+ <button class="fm-button unblock-button medium" onclick="fm_set_input_value('task', 'unblock_ip'); fm_form_submit(event, 'admin_form');">
299
+ <span></span>
300
+ Unblock IP
301
+ </button>
302
+ <button class="fm-button delete-button small" onclick="if (confirm('Do you want to delete selected items?')) { fm_set_input_value('task', 'delete_all'); fm_form_submit(event, 'admin_form'); } else { return false; }">
303
+ <span></span>
304
+ Delete
305
+ </button>
306
+ </div>
307
+ </div>
308
+ <div class="submissions-toolbar">
309
+ <div class="submissions-tools">
310
+ <select name="form_id" id="form_id" onchange="document.admin_form.submit();">
311
+ <option value="0" selected="selected"> - Select a Form - </option>
312
+ <?php if ($forms) {
313
+ foreach($forms as $form) {
314
+ ?>
315
+ <option value="<?php echo $form->id; ?>" <?php if ($form_id == $form->id) { echo 'selected="selected"'; }?>> <?php echo $form->title ?> </option>
316
+ <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
317
  }
318
+ } ?>
319
+ </select>
320
+ <div class="fm-reports">
321
+ <div class="fm-tools-button"><div class="fm-total_entries"><?php echo $statistics["total_entries"]; ?></div>Entries</div>
322
+ <div class="fm-tools-button"><div class="fm-total_rate"><?php echo $statistics["conversion_rate"]; ?></div>Conversion Rate</div>
323
+ <div class="fm-tools-button"><div class="fm-total_views"><?php echo $statistics["total_views"] ? $statistics["total_views"] : 0; ?></div>Views</div>
324
+ </div>
325
+
326
+ <div class="fm-export-tools">
327
+ <span class="exp_but_span">Export to</span>
328
+ &nbsp;
329
+ <button class="fm-tools-button" onclick="export_submissions('csv', 0); return false;">
330
+ CSV
331
+ </button>
332
+ <button class="fm-tools-button" onclick="export_submissions('xml', 0); return false;">
333
+ XML
334
+ </button>
335
+ </div>
336
+ </div>
337
+ </div>
338
+ <div class="tablenav top">
339
+ <div class="fm-filters">
340
+ <div class="fm-search-tools">
341
+ <input type="hidden" name="hide_label_list" value="<?php echo $lists['hide_label_list']; ?>">
342
+ <button class="fm-icon show-filter-icon" onclick="show_hide_filter(); return false;" title="Show Filters">
343
+ <span></span>
344
+ </button>
345
+ <button class="fm-icon search-icon" onclick="fm_form_submit(event, 'admin_form'); return false;" title="Search">
346
+ </button>
347
+ <button class="fm-icon reset-icon" onclick="remove_all(); fm_form_submit(event, 'admin_form'); return false;" title="Reset">
348
+ </button>
349
+ </div>
350
+ <div class="fm-add-remove">
351
+ <?php if (isset($sorted_label_names)) { ?>
352
+ <button class="fm-button" onclick="toggleChBDiv(true); return false;">
353
+ Add/Remove Columns
354
+ </button>
355
+ <?php WDW_FM_Library::html_page_nav($lists['total'], $lists['limit'], 'admin_form'); ?>
356
+ <?php } ?>
357
+ </div>
358
+ </div>
359
+ <div class="fm-clear"></div>
360
+ </div>
361
+
362
+ <div class="fm-loading-container" style="display:none;">
363
+ <div class="fm-loading-content">
364
+ </div>
365
+ </div>
366
+ <div class="submit_content" id="fm-scroll" style="width: 100%;">
367
+ <table class="wp-list-table widefat fixed posts table_content">
368
+ <thead>
369
+ <tr>
370
+ <?php if (defined('WD_FM_PDF') && is_plugin_active(constant('WD_FM_PDF'))): ?>
371
+ <th class="table_small_col count_col sub-align">PDF</th>
372
+ <?php endif; ?>
373
+ <th class="table_small_col count_col sub-align">#</th>
374
+ <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>
375
+ <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;?>>
376
+ <a href="" class="sub_id" onclick="fm_set_input_value('order_by', 'group_id');
377
+ fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'group_id' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
378
+ fm_form_submit(event, 'admin_form')">
379
+ <span>ID</span>
380
+ <span class="sorting-indicator" style="margin-top: 8px;"></span>
381
+ </a>
382
+ </th>
383
+ <th class="table_small_col sub-align">Edit</th>
384
+ <th class="table_small_col sub-align">Delete</th>
385
+ <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;?>>
386
+ <a href="" onclick="fm_set_input_value('order_by', 'date');
387
+ fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'date' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
388
+ fm_form_submit(event, 'admin_form')">
389
+ <span>Submit date</span>
390
+ <span class="sorting-indicator"></span>
391
+ </a>
392
+ </th>
393
+ <th scope="col" id="submitterip_fc" class="table_medium_col_uncenter submitterip_fc <?php if ($order_by == "ip")echo $oder_class; else echo $oder_class_default; ?>" <?php echo $style_ip;?>>
394
+ <a href="" onclick="fm_set_input_value('order_by', 'ip');
395
+ fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'ip' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
396
+ fm_form_submit(event, 'admin_form')">
397
+ <span>Submitter's IP</span>
398
+ <span class="sorting-indicator"></span>
399
+ </a>
400
+ </th>
401
+ <th scope="col" id="submitterusername_fc" class="table_medium_col_uncenter submitterusername_fc <?php if ($order_by == "display_name")echo $oder_class; else echo $oder_class_default; ?>" <?php echo $style_username;?>>
402
+ <a href="" onclick="fm_set_input_value('order_by', 'display_name');
403
+ fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'display_name' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
404
+ fm_form_submit(event, 'admin_form')">
405
+ <span>Submitter's Username</span>
406
+ <span class="sorting-indicator"></span>
407
+ </a>
408
+ </th>
409
+ <th scope="col" id="submitteremail_fc" class="table_medium_col_uncenter submitteremail_fc <?php if ($order_by == "user_email")echo $oder_class; else echo $oder_class_default; ?>" <?php echo $style_useremail ;?>>
410
+ <a href="" onclick="fm_set_input_value('order_by', 'user_email');
411
+ fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'user_email' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
412
+ fm_form_submit(event, 'admin_form')">
413
+ <span>Submitter's Email Address</span>
414
+ <span class="sorting-indicator"></span>
415
+ </a>
416
+ </th>
417
+ <?php
418
+ for ($i = 0; $i < count($sorted_label_names); $i++) {
419
+ $styleStr = $this->model->hide_or_not($lists['hide_label_list'], $sorted_labels_id[$i]);
420
+ $styleStr2 = $this->model->hide_or_not($lists['hide_label_list'] , '@payment_info@');
421
+ $field_title = $this->model->get_type_address($sorted_label_types[$i], $sorted_label_names_original[$i]);
422
+ if ($sorted_label_types[$i] == 'type_paypal_payment_status') {
423
+ $ispaypal = TRUE;
424
+ ?>
425
+ <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 . '"'; ?>">
426
+ <a href="" onclick="fm_set_input_value('order_by', '<?php echo $sorted_labels_id[$i] . '_field'; ?>'); fm_set_input_value('asc_or_desc', '<?php echo (($order_by == $sorted_labels_id[$i] . '_field' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>'); fm_form_submit(event, 'admin_form')">
427
+ <span><?php echo $field_title; ?></span>
428
+ <span class="sorting-indicator"></span>
429
+ </a>
430
+ </th>
431
+ <th class="table_large_col payment_info_fc" <?php echo $styleStr2; ?>>Payment Info</th>
432
+ <?php
433
+ }
434
+ else {
435
+ ?>
436
+ <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 . '"'; ?>">
437
+ <a href="" onclick="fm_set_input_value('order_by', '<?php echo $sorted_labels_id[$i] . '_field'; ?>'); fm_set_input_value('asc_or_desc', '<?php echo (($order_by == $sorted_labels_id[$i] . '_field' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>'); fm_form_submit(event, 'admin_form')">
438
+ <span><?php echo $field_title; ?></span>
439
+ <span class="sorting-indicator"></span>
440
+ </a>
441
+ </th>
442
+ <?php
443
+ }
444
+ }
445
+ ?>
446
+ </tr>
447
+ <tr id="fields_filter" style="display: none;">
448
+ <th></th>
449
+ <th></th>
450
+ <th class="submitid_fc" <?php echo $style_id; ?> >
451
+ <input type="text" name="id_search" id="id_search" value="<?php echo $lists['id_search'] ?>" onChange="this.form.submit();" style="width:30px"/>
452
+ </th>
453
+ <th></th>
454
+ <th></th>
455
+ <th width="150" class="submitdate_fc" <?php echo $style_date; ?>>
456
+ <table align="center" style="margin:auto" class="simple_table">
457
+ <tr class="simple_table">
458
+ <td class="simple_table" style="text-align: left;">From:</td>
459
+ <td style="text-align: center;" class="simple_table">
460
+ <input class="inputbox" type="text" name="startdate" id="startdate" size="10" maxlength="10" value="<?php echo $lists['startdate']; ?>" />
461
+ </td>
462
+ <td style="text-align: center;" class="simple_table">
463
+ <input type="reset" style="width: 22px; border-radius: 3px !important;" class="button" value="..." onclick="return showCalendar('startdate','%Y-%m-%d');" />
464
+ </td>
465
+ </tr>
466
+ <tr class="simple_table">
467
+ <td style="text-align: left;" class="simple_table">To:</td>
468
+ <td style="text-align: center;" class="simple_table">
469
+ <input class="inputbox" type="text" name="enddate" id="enddate" size="10" maxlength="10" value="<?php echo $lists['enddate']; ?>" />
470
+ </td>
471
+ <td style="text-align: center;" class="simple_table">
472
+ <input type="reset" style="width: 22px; border-radius: 3px !important;" class="button" value="..." onclick="return showCalendar('enddate','%Y-%m-%d');" />
473
+ </td>
474
+ </tr>
475
+ </table>
476
+ </th>
477
+ <th class="table_medium_col_uncenter submitterip_fc" <?php echo $style_ip; ?>>
478
+ <input type="text" name="ip_search" id="ip_search" value="<?php echo $lists['ip_search']; ?>" onChange="this.form.submit();" />
479
+ </th>
480
+ <th class="table_medium_col_uncenter submitterusername_fc" <?php echo $style_username; ?>>
481
+ <input type="text" name="username_search" id="username_search" value="<?php echo $lists['username_search']; ?>" onChange="this.form.submit();" />
482
+ </th>
483
+ <th class="table_medium_col_uncenter submitteremail_fc" <?php echo $style_useremail; ?>>
484
+ <input type="text" name="useremail_search" id="useremail_search" value="<?php echo $lists['useremail_search']; ?>" onChange="this.form.submit();" />
485
+ </th>
486
+ <?php
487
+ for ($i = 0; $i < count($sorted_label_names); $i++) {
488
+ $styleStr = $this->model->hide_or_not($lists['hide_label_list'], $sorted_labels_id[$i]);
489
+ if (!$ka_fielderov_search) {
490
+ if ($lists[$form_id . '_' . $sorted_labels_id[$i] . '_search']) {
491
+ $ka_fielderov_search = TRUE;
492
+ }
493
+ }
494
+ switch ($sorted_label_types[$i]) {
495
+ case 'type_mark_map': ?>
496
+ <th class="table_large_col <?php echo $sorted_labels_id[$i]; ?>_fc" <?php echo $styleStr; ?>></th>
497
+ <?php
498
+ break;
499
+ case 'type_paypal_payment_status': ?>
500
+ <th class="table_large_col <?php echo $sorted_labels_id[$i]; ?>_fc" <?php echo $styleStr; ?>>
501
+ <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']; ?>" >
502
+ <option value="" ></option>
503
+ <option value="canceled" >Canceled</option>
504
+ <option value="cleared" >Cleared</option>
505
+ <option value="cleared by payment review" >Cleared by payment review</option>
506
+ <option value="completed" >Completed</option>
507
+ <option value="denied" >Denied</option>
508
+ <option value="failed" >Failed</option>
509
+ <option value="held" >Held</option>
510
+ <option value="in progress" >In progress</option>
511
+ <option value="on hold" >On hold</option>
512
+ <option value="paid" >Paid</option>
513
+ <option value="partially refunded" >Partially refunded</option>
514
+ <option value="pending verification" >Pending verification</option>
515
+ <option value="placed" >Placed</option>
516
+ <option value="processing" >Processing</option>
517
+ <option value="refunded" >Refunded</option>
518
+ <option value="refused" >Refused</option>
519
+ <option value="removed" >Removed</option>
520
+ <option value="returned" >Returned</option>
521
+ <option value="reversed" >Reversed</option>
522
+ <option value="temporary hold" >Temporary hold</option>
523
+ <option value="unclaimed" >Unclaimed</option>
524
+ </select>
525
+ <script>
526
+ var element = document.getElementById('<?php echo $form_id.'_'.$sorted_labels_id[$i]; ?>_search');
527
+ element.value = '<?php echo $lists[$form_id.'_'.$sorted_labels_id[$i].'_search']; ?>';
528
+ </script>
529
+ </th>
530
+ <th class="table_large_col payment_info_fc" <?php echo $styleStr2; ?>></th>
531
+ <?php
532
+ break;
533
+ default: ?>
534
+ <th class="<?php echo $sorted_labels_id[$i]; ?>_fc" <?php echo $styleStr; ?>>
535
+ <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();" >
536
+ </th>
537
+ <?php
538
+ break;
539
+ }
540
  }
541
+ ?>
542
+ </tr>
543
+ </thead>
544
+ <?php
545
+ $k = 0;
546
+ for ($www = 0, $qqq = count($group_id_s); $www < $qqq; $www++) {
547
+ $i = $group_id_s[$www];
548
+ $alternate = (!isset($alternate) || $alternate == 'class="alternate"') ? '' : 'class="alternate"';
549
+ $temp = $this->model->array_for_group_id($group_id_s[$www], $rows);
550
+ $data = $temp[0];
551
+ $userinfo=get_userdata($data->user_id_wd);
552
+ $useremail=$userinfo ? $userinfo->user_email : "";
553
+ $username=$userinfo ? $userinfo->display_name : "";
554
+ ?>
555
+ <tr <?php echo $alternate; ?>>
556
+ <?php if (defined('WD_FM_PDF') && is_plugin_active(constant('WD_FM_PDF'))): ?>
557
+ <td class="table_small_col pdf_col sub-align">
558
+ <?php if($pdf_data && isset($pdf_data[$group_id_s[$www]])): ?>
559
+ <a href="<?php echo site_url().'/'.$pdf_data[$group_id_s[$www]]; ?>" style="display: block;" download><img src="<?php echo WD_FM_PDF_URL . '/images/pdf-icon.png'; ?>" /></a>
560
+ <?php endif; ?>
561
+ </td>
562
+ <?php endif; ?>
563
+ <td class="table_small_col count_col sub-align"><?php echo $www + 1; ?></td>
564
+ <td class="check-column table_small_col sub-align" style="padding: 0;">
565
+ <input type="checkbox" name="post[]" value="<?php echo $data->group_id; ?>">
566
+ </td>
567
+ <td class="table_small_col sub-align submitid_fc" id="submitid_fc" <?php echo $style_id; ?>>
568
+ <a href="" onclick="fm_set_input_value('task', 'edit'); fm_set_input_value('current_id',<?php echo $data->group_id; ?>); fm_form_submit(event, 'admin_form');" >
569
+ <?php echo $data->group_id; ?>
570
+ </a>
571
+ </td>
572
+ <td class="table_small_col sub-align">
573
+ <a href="" onclick="fm_set_input_value('task', 'edit'); fm_set_input_value('current_id',<?php echo $data->group_id; ?>); fm_form_submit(event, 'admin_form');">Edit
574
+ </a>
575
+ </td>
576
+ <td class="table_small_col sub-align">
577
+ <a href="" onclick="if (confirm('Do you want to delete selected item(s)?')) { fm_set_input_value('task', 'delete'); fm_set_input_value('current_id',<?php echo $data->group_id; ?>); fm_form_submit(event, 'admin_form'); } else { return false; }">Delete
578
+ </a>
579
+ </td>
580
+ <td class="table_large_col submitdate_fc sub-align" id="submitdate_fc" <?php echo $style_date; ?>>
581
+ <a href="" onclick="fm_set_input_value('task', 'edit'); fm_set_input_value('current_id',<?php echo $data->group_id; ?>); fm_form_submit(event, 'admin_form');" ><?php echo $data->date ;?>
582
+ </a>
583
+ </td>
584
+ <td class="table_medium_col_uncenter submitterip_fc sub-align" id="submitterip_fc" <?php echo $style_ip; ?>>
585
+ <a class="thickbox-preview" href="<?php echo add_query_arg(array('action' => 'fromipinfoinpopup', 'data_ip' => $data->ip, 'width' => '400', 'height' => '300', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" title="Show submitter information" <?php echo (!in_array($data->ip, $blocked_ips)) ? '' : 'style="color: #FF0000;"'; ?>><?php echo $data->ip; ?></a>
586
+ </td>
587
+ <td class="table_large_col submitterusername_fc sub-align" id="submitterusername_fc" <?php echo $style_username; ?>>
588
+ <?php echo $username; ?>
589
+ </td>
590
+ <td class="table_large_col submitteremail_fc sub-align" id="submitteremail_fc" <?php echo $style_useremail; ?>>
591
+ <?php echo $useremail; ?>
592
+ </td>
593
+ <?php
594
+ for ($h = 0; $h < $m; $h++) {
595
+ $not_label = TRUE;
596
+ for ($g = 0; $g < count($temp); $g++) {
597
+ $styleStr = $this->model->hide_or_not($lists['hide_label_list'], $sorted_labels_id[$h]);
598
+ if ($temp[$g]->element_label == $sorted_labels_id[$h]) {
599
+ if (strpos($temp[$g]->element_value, "***map***")) {
600
+ $map_params = explode('***map***', $temp[$g]->element_value);
601
+ ?>
602
+ <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; ?>>
603
+ <a class="thickbox-preview" href="<?php echo add_query_arg(array('action' => 'frommapeditinpopup', 'long' => $map_params[0], 'lat' => $map_params[1], 'width' => '620', 'height' => '550', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" title="Show on Map">Show on Map</a>
604
+ </td>
605
+ <?php
606
+ }
607
+ elseif (strpos($temp[$g]->element_value, "*@@url@@*")) {
608
+ ?>
609
+ <td class="<?php echo $sorted_labels_id[$h]; ?>_fc sub-align" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?>>
610
+ <?php
611
+ $new_files = explode("*@@url@@*", $temp[$g]->element_value);
612
+ foreach ($new_files as $new_file) {
613
+ if ($new_file) {
614
+ $new_filename = explode('/', $new_file);
615
+ $new_filename = $new_filename[count($new_filename) - 1];
616
+ ?>
617
+ <a target="_blank" class="fm_fancybox" rel="group_<?php echo $www; ?>" href="<?php echo $new_file; ?>"><?php echo $new_filename; ?></a><br />
618
+ <?php
619
+ }
620
+ }
621
+ ?>
622
+ </td>
623
+ <?php
624
+ }
625
+ elseif (strpos($temp[$g]->element_value, "***star_rating***")) {
626
+ $view_star_rating_array = $this->model->view_for_star_rating($temp[$g]->element_value, $temp[$g]->element_label);
627
+ $stars = $view_star_rating_array[0];
628
+ ?>
629
+ <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>
630
+ <?php
631
+ }
632
+ elseif (strpos($temp[$g]->element_value, "***matrix***")) {
633
+ ?>
634
+ <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; ?>>
635
+ <a class="thickbox-preview" href="<?php echo add_query_arg(array('action' => 'show_matrix', 'matrix_params' => $temp[$g]->element_value, 'width' => '620', 'height' => '550', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" title="Show Matrix">Show Matrix</a>
636
+ </td>
637
+ <?php
638
+ }
639
+ elseif (strpos($temp[$g]->element_value, "@@@") !== FALSE || $temp[$g]->element_value == "@@@" || $temp[$g]->element_value == "@@@@@@@@@") {
640
+ ?>
641
+ <td class="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?>>
642
+ <p><?php echo str_replace("@@@", " ", $temp[$g]->element_value); ?></p>
643
+ </td>
644
+ <?php
645
+ }
646
+ elseif (strpos($temp[$g]->element_value, "***grading***")) {
647
+ $view_grading_array = $this->model->view_for_grading($temp[$g]->element_value);
648
+ $items = $view_grading_array[0];
649
+ ?>
650
+ <td class="<?php echo $sorted_labels_id[$h];?>_fc sub-align" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?>>
651
+ <p><?php echo $items; ?></p>
652
+ </td>
653
+ <?php
654
+ }
655
+ else {
656
+ if (strpos($temp[$g]->element_value, "***quantity***")) {
657
+ $temp[$g]->element_value = str_replace("***quantity***", " ", $temp[$g]->element_value);
658
+ }
659
+ if (strpos($temp[$g]->element_value, "***property***")) {
660
+ $temp[$g]->element_value = str_replace("***property***", " ", $temp[$g]->element_value);
661
+ }
662
 
663
+ if($sorted_label_types[$h]=="type_submitter_mail"){
664
+ $query = $wpdb->prepare('SELECT id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id ="%d" AND group_id="%d" AND element_value="verified**%d"', $form_id, $i, $sorted_labels_id[$h]);
665
+ $isverified = $wpdb->get_var($query);
666
+
667
+ if($isverified) { ?>
668
+ <td class="<?php echo $sorted_labels_id[$h];?>_fc" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?>>
669
+ <p><?php echo $temp[$g]->element_value; ?> <span style="color:#2DA068;">( Verified <img src="<?php echo WD_FM_URL . '/images/verified.png'; ?>" /> )</span></p>
670
+ </td>
671
+ <?php }
672
+ else {?>
673
+ <td class="<?php echo $sorted_labels_id[$h];?>_fc" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?>>
674
+ <p><?php echo $temp[$g]->element_value; ?></p>
675
+ </td>
676
+ <?php }
677
+ }
678
+ else{
679
+ ?>
680
+ <td class="<?php echo $sorted_labels_id[$h];?>_fc sub-align" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?>>
681
+ <p><?php echo str_replace("***br***", '<br>', stripslashes($temp[$g]->element_value)) ; ?></p>
682
+ </td>
683
+ <?php
684
+ }
685
+ }
686
+ $not_label = FALSE;
687
+ }
688
+ }
689
+ if ($not_label) {
690
+ ?>
691
+ <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>
692
+ <?php
693
+ }
694
+ }
695
+ if ($ispaypal) {
696
+ $styleStr = $this->model->hide_or_not($lists['hide_label_list'], '@payment_info@');
697
  ?>
698
+ <td class="table_large_col payment_info_fc sub-align" id="payment_info_fc" <?php echo $styleStr; ?>>
699
+ <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')); ?>">
700
+ <img src="<?php echo WD_FM_URL . '/images/info.png'; ?>" />
701
+ </a>
702
+ </td>
703
+ <?php
704
  }
705
+ ?>
706
+ </tr>
707
+ <?php
708
+ $k = 1 - $k;
709
+ }
710
+ ?>
711
+ </table>
712
+ </div>
713
+ <?php
714
+ if ($sorted_label_types) {
715
+ foreach ($sorted_label_types as $key => $sorted_label_type) {
716
+ if ($this->model->check_radio_type($sorted_label_type)) {
717
+ $is_stats = true;
718
+ break;
719
+ }
720
  }
721
+ if ($is_stats) {
722
+ $ajax_nonce = wp_create_nonce( "nonce_fm_ajax" );
723
+ ?>
724
+ <br/>
725
+ <div class="fm-statistics">
726
+ <h1>Statistics</h1>
727
+ <table class="stats">
728
+ <tr>
729
+ <td>
730
+ <label for="sorted_label_key">Select a Field:</label>
731
+ </td>
732
+ <td>
733
+ <select id="sorted_label_key">
734
+ <option value="">Select a Field</option>
735
+ <?php
736
+ foreach ($sorted_label_types as $key => $sorted_label_type) {
737
+ 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") {
738
+ ?>
739
+ <option value="<?php echo $key; ?>"><?php echo $sorted_label_names_original[$key]; ?></option>
740
+ <?php
741
+ }
742
+ }
743
+ ?>
744
+ </select>
745
+ </td>
746
+ <td></td>
747
+ </tr>
748
+ <tr>
749
+ <td>
750
+ <label>Select a Date:</label>
751
+ </td>
752
+ <td>
753
+ From: <input class="inputbox" type="text" name="startstats" id="startstats" size="9" maxlength="9" />
754
+ <input type="reset" class="button" style="width: 22px;" value="..." name="startstats_but" id="startstats_but" onclick="return showCalendar('startstats','%Y-%m-%d');" />
755
+
756
+ To: <input class="inputbox" type="text" name="endstats" id="endstats" size="9" maxlength="9" />
757
+ <input type="reset" class="button" style="width: 22px;" value="..." name="endstats_but" id="endstats_but" onclick="return showCalendar('endstats','%Y-%m-%d');" />
758
+ </td>
759
+ <td>
760
+ <button onclick="show_stats(); return false;">Show</button>
761
+ </td>
762
+ </tr>
763
+ </table>
764
+
765
+ <div id="div_stats"></div>
766
+ </div>
767
+ <script>
768
+ function show_stats() {
769
+ jQuery('#div_stats').html('<div class="fm-loading-container"><div class="fm-loading-content"></div></div>');
770
+ if(jQuery('#sorted_label_key').val()!="") {
771
+ jQuery('#div_stats').load('<?php echo add_query_arg(array('action' => 'get_stats', 'page' => 'submissions_fm'), admin_url('admin-ajax.php')); ?>', {
772
+ 'task': 'show_stats',
773
+ 'form_id' : '<?php echo $form_id; ?>',
774
+ 'sorted_label_key' : jQuery('#sorted_label_key').val(),
775
+ 'startdate' : jQuery('#startstats').val(),
776
+ 'enddate' : jQuery('#endstats').val(),
777
+ 'nonce_fm_ajax': '<?php echo $ajax_nonce; ?>'
778
+ });
779
+ }
780
+ else {
781
+ jQuery('#div_stats').html("<div style='padding:10px 5px; color:red; font-size:14px;'>Please select the field!</div>");
782
+ }
783
+ jQuery("#div_stats").removeClass("fm_loading");
784
+ }
785
+ </script>
786
+ <?php
787
+ }
788
+ }
789
+ ?>
790
+ </div>
791
+ </form>
792
+ <script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
793
  function fm_scroll(element) {
794
  var scrollbar= document.createElement('div');
795
  scrollbar.appendChild(document.createElement('div'));
805
  scrollbar.scrollLeft= element.scrollLeft;
806
  };
807
  element.parentNode.insertBefore(scrollbar, element);
808
+ }
809
+ jQuery(window).load(function() {
810
+ fm_popup();
811
+ fm_scroll(document.getElementById('fm-scroll'));
812
+ if (typeof jQuery().fancybox !== 'undefined' && jQuery.isFunction(jQuery().fancybox)) {
813
+ jQuery(".fm_fancybox").fancybox({
814
+ 'maxWidth ' : 600,
815
+ 'maxHeight' : 500
816
+ });
817
+ }
818
+ });
819
+ <?php if ($ka_fielderov_search) { ?>
820
+ document.getElementById('fields_filter').style.display = '';
821
+ <?php } ?>
822
+ </script>
823
+ <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
824
  }
825
+
826
+ public function show_stats($form_id) {
827
+ $key = (isset($_POST['sorted_label_key']) ? esc_html(stripslashes($_POST['sorted_label_key'])) : '');
828
+ $labels_parameters = $this->model->get_labels_parameters($form_id);
829
+ $where_choices = $labels_parameters[7];
830
+ $sorted_label_names_original = $labels_parameters[4];
831
+ $sorted_labels_id = $labels_parameters[0];
832
+ if(count($sorted_labels_id)!=0 && $key < count($sorted_labels_id) ) {
833
+ $choices_params = $this->model->statistic_for_radio($where_choices, $sorted_labels_id[$key]);
834
+ $sorted_label_name_original = $sorted_label_names_original[$key];
835
+ $choices_count = $choices_params[0];
836
+ $choices_labels = $choices_params[1];
837
+ $unanswered = $choices_params[2];
838
+ $all = $choices_params[3];
839
+ $colors = $choices_params[4];
840
+ $choices_colors = $choices_params[5];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
841
  }
842
+ else {
843
+ $choices_labels = array();
844
+ $sorted_label_name_original = '';
845
+ $unanswered = NULL;
846
+ $all = 0;
 
 
847
  }
848
+ ?>
849
+ <br/>
850
+ <br/>
851
+ <div class="field-label"><?php echo stripslashes($sorted_label_name_original); ?></div>
852
+ <table class="adminlist">
853
+ <thead>
854
+ <tr>
855
+ <th width="20%">Choices</th>
856
+ <th>Percentage</th>
857
+ <th width="10%">Count</th>
858
+ </tr>
859
+ </thead>
860
+ <?php
861
+ $k=0;
862
+ foreach ($choices_labels as $key => $choices_label) {
863
+ if (strpos($choices_label, "***quantity***")) {
864
+ $choices_label = str_replace("***quantity***", " ", $choices_label);
865
+ }
866
+ if (strpos($choices_label, "***property***")) {
867
+ $choices_label = str_replace("***property***", " ", $choices_label);
868
+ }
869
+ ?>
870
+ <tr>
871
+ <td class="label<?php echo $k; ?>"><?php echo str_replace("***br***",'<br>', $choices_label)?></td>
872
+ <td>
873
+ <div class="bordered" style="width:<?php echo ($choices_count[$key]/($all-$unanswered))*100; ?>%; height:16px; background-color:<?php echo $colors[$key % 2]; ?>; float: left;">
874
+ </div>
875
+ <div <?php echo ($choices_count[$key]/($all-$unanswered)!=1 ? 'class="bordered'.$k.'"' : "") ?> style="width:<?php echo 100-($choices_count[$key]/($all-$unanswered))*100; ?>%; height:16px; background-color:#F2F0F1; float: left;">
876
+ </div>
877
+ </td>
878
+ <td>
879
+ <div>
880
+ <div style="width: 0; height: 0; border-top: 8px solid transparent;border-bottom: 8px solid transparent; border-right:8px solid <?php echo $choices_colors[$key % 2]; ?>; float:left;">
881
+ </div>
882
+ <div style="background-color:<?php echo $choices_colors[$key % 2]; ?>; height:16px; width:16px; text-align: center; margin-left:8px; color: #fff;">
883
+ <?php echo $choices_count[$key]?>
884
+ </div>
885
+ </div>
886
+ </td>
887
+ </tr>
888
+ <tr>
889
+ <td colspan="3">
890
+ </td>
891
+ </tr>
892
+ <?php
893
+ $k = 1 - $k;
894
+ }
895
+ if($unanswered){
896
+ ?>
897
+ <tr>
898
+ <td colspan="2" style="text-align:right; color: #000;">Unanswered</th>
899
+ <td><strong style="margin-left:10px;"><?php echo $unanswered;?></strong></th>
900
+ </tr>
901
+ <?php
902
+ }
903
+ ?>
904
+ <tr>
905
+ <td colspan="2" style="text-align:right; color: #000;"><strong>Total</strong></th>
906
+ <td><strong style="margin-left:10px;"><?php echo $all;?></strong></th>
907
+ </tr>
908
+ </table>
909
+ <?php
910
+ die();
911
+ }
912
 
913
  public function edit($id) {
914
  $current_id = ((isset($id)) ? $id : 0);
1180
  $username = $userinfo ? $userinfo->display_name : "";
1181
  $useremail = $userinfo ? $userinfo->user_email : "";
1182
  ?>
1183
+ <div class="fm-user-manual">
1184
+ This section allows you to edit form submissions.
1185
+ <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-6.html">Read More in User Manual</a>
1186
+ </div>
1187
+ <div class="fm-upgrade-pro">
1188
+ <a target="_blank" href="https://web-dorado.com/files/fromFormMaker.php">
1189
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
1190
+ </a>
1191
+ </div>
1192
+ <div class="fm-clear"></div>
1193
  <form action="admin.php?page=submissions_fm" method="post" id="formform_id_temp" name="formform_id_temp">
1194
+ <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
1195
+ <div class="fm-page-header">
1196
+ <div class="fm-page-title">Edit Submission</div>
1197
+ <div class="fm-page-actions">
1198
+ <button class="fm-button save-button small" onclick="pressbutton(); fm_set_input_value('task', 'save'); fm_set_input_value('current_id', <?php echo $current_id ;?>); fm_form_submit(event, 'formform_id_temp');">
1199
+ <span></span>
1200
+ Save
1201
+ </button>
1202
+ <button class="fm-button apply-button small" onclick="pressbutton(); fm_set_input_value('task', 'apply'); fm_set_input_value('current_id', <?php echo $current_id ;?>); fm_form_submit(event, 'formform_id_temp');">
1203
+ <span></span>
1204
+ Apply
1205
+ </button>
1206
+ <button class="fm-button cancel-button small" onclick="fm_set_input_value('task', '');fm_form_submit(event, 'formform_id_temp');">
1207
+ <span></span>
1208
+ Cancel
1209
+ </button>
1210
+ </div>
1211
+ <div class="fm-clear"></div>
1212
+ </div>
1213
+ <div class="fm-submissins-edit">
1214
+ <table>
1215
+ <tr>
1216
+ <td class="fm-key"><label for="ID">ID: </label></td>
1217
+ <td><?php echo $rows[0]->group_id; ?></td>
1218
+ </tr>
1219
+ <tr>
1220
+ <td class="fm-key"><label for="Date">Date: </label></td>
1221
+ <td><?php echo $rows[0]->date; ?></td>
1222
+ </tr>
1223
+ <tr>
1224
+ <td class="fm-key"><label for="IP">IP: </label></td>
1225
+ <td><?php echo $rows[0]->ip; ?></td>
1226
+ </tr>
1227
+ <tr>
1228
+ <td class="fm-key"><label for="Submitter's Username">Submitter's Username: </label></td>
1229
+ <td><?php echo $username; ?></td>
1230
+ </tr>
1231
+ <tr>
1232
+ <td class="fm-key"><label for="Submitter's Email Address">Submitter's Email Address: </label></td>
1233
+ <td><?php echo $useremail; ?></td>
1234
+ </tr>
1235
+ </table>
1236
+ <?php
1237
+ $css_rep1 = array("[SITE_ROOT]");
1238
+ $css_rep2 = array(WD_FM_URL);
1239
+ $order = array("\r\n", "\n", "\r");
1240
+ $form_theme = str_replace($order, '', $form_theme);
1241
+ $form_theme = str_replace($css_rep1, $css_rep2, $form_theme);
1242
+ $form_theme = "#form" . $form->id . ' ' . $form_theme;
1243
+ ?>
1244
+ <style>
 
 
 
 
 
1245
  <?php
1246
  echo $form_theme;
1247
  ?>
1519
 
1520
  break;
1521
  }
1522
+
1523
+ case 'type_name': {
1524
 
1525
  if($element_value =='')
1526
  $element_value = '@@@';
1527
 
1528
+ $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');
1529
+ $temp = $params;
1530
+ if(strpos($temp, 'w_name_fields') > -1)
1531
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class', 'w_name_fields');
1532
 
1533
  foreach($params_names as $params_name ) {
1534
  $temp=explode('*:*'.$params_name.'*:*',$temp);
4419
  }
4420
  echo $form;
4421
  ?>
4422
+
4423
+ </div>
4424
+ <input type="hidden" name="option" value="com_formmaker"/>
4425
  <input type="hidden" id="current_id" name="current_id" value="<?php echo $rows[0]->group_id; ?>" />
4426
  <input type="hidden" name="form_id" value="<?php echo $rows[0]->form_id; ?>" />
4427
  <input type="hidden" name="date" value="<?php echo $rows[0]->date; ?>" />
admin/views/FMViewThemes_fm.php CHANGED
@@ -1,23 +1,22 @@
1
  <?php
2
-
3
  class FMViewThemes_fm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- private $model;
14
 
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- // Constructor & Destructor //
17
- ////////////////////////////////////////////////////////////////////////////////////////
18
- public function __construct($model) {
19
- $this->model = $model;
20
- }
21
 
22
  ////////////////////////////////////////////////////////////////////////////////////////
23
  // Public Methods //
@@ -33,198 +32,191 @@ class FMViewThemes_fm {
33
  $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
34
  $ids_string = '';
35
  ?>
36
- <div style="clear: both; float: left; width: 99%;">
37
- <div style="float:left; font-size: 14px; font-weight: bold;">
38
- This section allows you to edit form themes.
39
- <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-2.html">Read More in User Manual</a>
40
- </div>
41
- <div style="float: right; text-align: right;">
42
- <a style="text-decoration: none;" target="_blank" href="https://web-dorado.com/files/fromFormMaker.php">
43
- <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
44
- </a>
45
- </div>
46
- </div>
47
- <form class="wrap" id="themes_form" method="post" action="admin.php?page=themes_fm" style="float: left; width: 99%;">
48
- <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
49
- <span class="theme_icon"></span>
50
- <h2>
51
- Themes
52
- <a href="" class="add-new-h2" onclick="fm_set_input_value('task', 'add');
53
- fm_form_submit(event, 'themes_form')">Add new</a>
54
- </h2>
55
- <div class="buttons_div">
56
- <input class="button-secondary" type="submit" onclick="if (confirm('Do you want to delete selected items?')) {
57
- fm_set_input_value('task', 'delete_all');
58
- } else {
59
- return false;
60
- }" value="Delete" />
61
- </div>
62
- <div class="tablenav top">
63
- <?php
64
- WDW_FM_Library::search('Title', $search_value, 'themes_form');
65
- WDW_FM_Library::html_page_nav($page_nav['total'], $page_nav['limit'], 'themes_form');
66
- ?>
67
- </div>
68
- <table class="wp-list-table widefat fixed pages">
69
- <thead>
70
- <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin:0;"/></th>
71
- <th class="table_small_col <?php if ($order_by == 'id') { echo $order_class; } ?>">
72
- <a onclick="fm_set_input_value('task', '');
73
- fm_set_input_value('order_by', 'id');
74
- fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'id' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
75
- fm_form_submit(event, 'themes_form')" href="">
76
- <span>ID</span><span class="sorting-indicator"></span></a>
77
- </th>
78
- <th class="<?php if ($order_by == 'title') { echo $order_class; } ?>">
79
- <a onclick="fm_set_input_value('task', '');
80
- fm_set_input_value('order_by', 'title');
81
- fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'title' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
82
- fm_form_submit(event, 'themes_form')" href="">
83
- <span>Title</span><span class="sorting-indicator"></span></a>
84
- </th>
85
- <th class="table_big_col <?php if ($order_by == 'default') { echo $order_class; } ?>">
86
- <a onclick="fm_set_input_value('task', '');
87
- fm_set_input_value('order_by', 'default');
88
- fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'default' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
89
- fm_form_submit(event, 'themes_form')" href="">
90
- <span>Default</span><span class="sorting-indicator"></span></a>
91
- </th>
92
- <th class="table_big_col">Edit</th>
93
- <th class="table_big_col">Delete</th>
94
- </thead>
95
- <tbody id="tbody_arr">
96
- <?php
97
- if ($rows_data) {
98
- foreach ($rows_data as $row_data) {
99
- $alternate = (!isset($alternate) || $alternate == 'class="alternate"') ? '' : 'class="alternate"';
100
- $default_image = (($row_data->default) ? 'default' : 'notdefault');
101
- $default = (($row_data->default) ? '' : 'setdefault');
102
- ?>
103
- <tr id="tr_<?php echo $row_data->id; ?>" <?php echo $alternate; ?>>
104
- <td class="table_small_col check-column">
105
- <input id="check_<?php echo $row_data->id; ?>" name="check_<?php echo $row_data->id; ?>" type="checkbox"/>
106
- </td>
107
- <td class="table_small_col"><?php echo $row_data->id; ?></td>
108
- <td>
109
- <a onclick="fm_set_input_value('task', 'edit');
110
- fm_set_input_value('current_id', '<?php echo $row_data->id; ?>');
111
- fm_form_submit(event, 'themes_form')" href="" title="Edit"><?php echo $row_data->title; ?></a>
112
- </td>
113
- <td class="table_big_col">
114
- <?php
115
- if ($default != '') {
116
- ?>
117
- <a onclick="fm_set_input_value('task', '<?php echo $default; ?>');
118
- fm_set_input_value('current_id', '<?php echo $row_data->id; ?>');
119
- fm_form_submit(event, 'themes_form')" href="">
120
- <?php
121
- }
122
- ?>
123
- <img src="<?php echo WD_FM_URL . '/images/' . $default_image . '.png'; ?>" />
124
- <?php
125
- if ($default != '') {
126
- ?>
127
- </a>
128
- <?php
129
- }
130
- ?>
131
- </td>
132
- <td class="table_big_col">
133
- <a onclick="fm_set_input_value('task', 'edit');
134
- fm_set_input_value('current_id', '<?php echo $row_data->id; ?>');
135
- fm_form_submit(event, 'themes_form')" href="">Edit</a>
136
- </td>
137
- <td class="table_big_col">
138
- <a onclick="if (confirm('Do you want to delete selected item(s)?')) { fm_set_input_value('task', 'delete');
139
- fm_set_input_value('current_id', '<?php echo $row_data->id; ?>');
140
- fm_form_submit(event, 'themes_form'); } else { return false; }" href="">Delete</a>
141
- </td>
142
- </tr>
143
- <?php
144
- $ids_string .= $row_data->id . ',';
145
- }
146
- }
147
- ?>
148
- </tbody>
149
- </table>
150
- <input id="task" name="task" type="hidden" value=""/>
151
- <input id="current_id" name="current_id" type="hidden" value=""/>
152
- <input id="ids_string" name="ids_string" type="hidden" value="<?php echo $ids_string; ?>"/>
153
- <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="asc"/>
154
- <input id="order_by" name="order_by" type="hidden" value="<?php echo $order_by; ?>"/>
155
  </form>
156
  <?php
157
- }
158
 
159
- public function edit($id, $reset) {
160
- $row = $this->model->get_row_data($id, $reset);
161
- $page_title = (($id != 0) ? 'Edit theme ' . $row->title : 'Create new theme');
162
- ?>
163
- <style>
164
- .CodeMirror {
165
- border: 1px solid #ccc;
166
- font-size: 12px;
167
- margin-bottom: 6px;
168
- background: white;
169
- }
170
- </style>
171
- <div style="clear: both; float: left; width: 99%;">
172
- <div style="float:left; font-size: 14px; font-weight: bold;">
173
- This section allows you to edit form themes.
174
- <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-2.html">Read More in User Manual</a>
175
- </div>
176
- <div style="float: right; text-align: right;">
177
- <a style="text-decoration: none;" target="_blank" href="https://web-dorado.com/files/fromFormMaker.php">
178
- <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
179
- </a>
180
- </div>
181
- </div>
182
- <form class="wrap" method="post" action="admin.php?page=themes_fm" style="float: left; width: 99%;">
183
- <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
184
- <span class="theme_icon"></span>
185
- <h2><?php echo $page_title; ?></h2>
186
- <div style="float: right; margin: 0 5px 0 0;">
187
- <input class="button-secondary" type="submit" onclick="if (fm_check_required('title', 'Title')) {return false;}; fm_set_input_value('task', 'save')" value="Save"/>
188
- <input class="button-secondary" type="submit" onclick="if (fm_check_required('title', 'Title')) {return false;}; fm_set_input_value('task', 'apply')" value="Apply"/>
189
- <input class="button-secondary" type="submit" onclick="fm_set_input_value('task', 'cancel')" value="Cancel"/>
190
- </div>
191
- <table style="clear:both;">
192
- <tbody>
193
- <tr>
194
- <td class="fm_label"><label for="title">Title: <span style="color:#FF0000;"> * </span> </label></td>
195
- <td><input type="text" id="title" name="title" value="<?php echo $row->title; ?>" class="fm_text_input" /></td>
196
- </tr>
197
- <tr>
198
- <td class="fm_label"><label for="css">Css: </label></td>
199
- <td style="width: 90%;"><textarea id="css" name="css" rows="30" style="width: 100%;"><?php echo htmlspecialchars($row->css) ?></textarea></td>
200
- </tr>
201
- </tbody>
202
- </table>
203
- <input type="hidden" id="task" name="task" value=""/>
204
- <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>"/>
205
- <input type="hidden" id="default" name="default" value="<?php echo $row->default; ?>"/>
206
- </form>
207
- <script>
208
- var editor = CodeMirror.fromTextArea(document.getElementById("css"), {
209
- lineNumbers: true,
210
- lineWrapping: true,
211
- mode: "css"
212
- });
 
 
 
 
 
 
 
 
 
 
 
 
213
 
214
- CodeMirror.commands["selectAll"](editor);
215
- editor.autoFormatRange(editor.getCursor(true), editor.getCursor(false));
216
- editor.scrollTo(0,0);
217
- </script>
218
- <?php
219
- }
220
 
221
- ////////////////////////////////////////////////////////////////////////////////////////
222
- // Getters & Setters //
223
- ////////////////////////////////////////////////////////////////////////////////////////
224
- ////////////////////////////////////////////////////////////////////////////////////////
225
- // Private Methods //
226
- ////////////////////////////////////////////////////////////////////////////////////////
227
- ////////////////////////////////////////////////////////////////////////////////////////
228
- // Listeners //
229
- ////////////////////////////////////////////////////////////////////////////////////////
230
  }
1
  <?php
 
2
  class FMViewThemes_fm {
3
+ ////////////////////////////////////////////////////////////////////////////////////////
4
+ // Events //
5
+ ////////////////////////////////////////////////////////////////////////////////////////
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ // Constants //
8
+ ////////////////////////////////////////////////////////////////////////////////////////
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ // Variables //
11
+ ////////////////////////////////////////////////////////////////////////////////////////
12
+ private $model;
13
 
14
+ ////////////////////////////////////////////////////////////////////////////////////////
15
+ // Constructor & Destructor //
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ public function __construct($model) {
18
+ $this->model = $model;
19
+ }
20
 
21
  ////////////////////////////////////////////////////////////////////////////////////////
22
  // Public Methods //
32
  $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
33
  $ids_string = '';
34
  ?>
35
+ <div class="fm-user-manual">
36
+ This section allows you to create, edit form themes.
37
+ <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-2.html">Read More in User Manual</a>
38
+ </div>
39
+ <div class="fm-upgrade-pro">
40
+ <a target="_blank" href="https://web-dorado.com/files/fromFormMaker.php">
41
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
42
+ </a>
43
+ </div>
44
+ <div class="fm-clear"></div>
45
+ <form class="wrap" id="themes_form" method="post" action="admin.php?page=themes_fm" style="width:99%;">
46
+ <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
47
+ <div class="fm-page-banner themes-banner">
48
+ <div class="theme_icon">
49
+ </div>
50
+ <div class="fm-logo-title">Themes</div>
51
+ <button class="fm-button add-button medium" style="margin-left: 31px;" onclick="fm_set_input_value('task', 'add'); fm_form_submit(event, 'themes_form');">
52
+ <span></span>
53
+ Add New
54
+ </button>
55
+ <div class="fm-page-actions">
56
+ <button class="fm-button delete-button small" onclick="if (confirm('Do you want to delete selected item(s)?')) { fm_set_input_value('task', 'delete_all'); } else { return false; }">
57
+ <span></span>
58
+ Delete
59
+ </button>
60
+ </div>
61
+ </div>
62
+ <div class="fm-clear"></div>
63
+ <div class="tablenav top">
64
+ <?php
65
+ WDW_FM_Library::search('Title', $search_value, 'themes_form');
66
+ WDW_FM_Library::html_page_nav($page_nav['total'], $page_nav['limit'], 'themes_form');
67
+ ?>
68
+ </div>
69
+ <table class="wp-list-table widefat fixed pages">
70
+ <thead>
71
+ <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin:0;"/></th>
72
+ <th class="table_small_col <?php if ($order_by == 'id') { echo $order_class; } ?>">
73
+ <a onclick="fm_set_input_value('task', ''); fm_set_input_value('order_by', 'id'); fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'id' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>'); fm_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="fm_set_input_value('task', ''); fm_set_input_value('order_by', 'title'); fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'title' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>'); fm_form_submit(event, 'themes_form')" href="">
78
+ <span>Title</span><span class="sorting-indicator"></span></a>
79
+ </th>
80
+ <th class="table_big_col <?php if ($order_by == 'default') { echo $order_class; } ?>">
81
+ <a onclick="fm_set_input_value('task', ''); fm_set_input_value('order_by', 'default'); fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'default' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>'); fm_form_submit(event, 'themes_form')" href="">
82
+ <span>Default</span><span class="sorting-indicator"></span></a>
83
+ </th>
84
+ <th class="table_small_col">Edit</th>
85
+ <th class="table_small_col">Delete</th>
86
+ </thead>
87
+ <tbody id="tbody_arr">
88
+ <?php
89
+ if ($rows_data) {
90
+ foreach ($rows_data as $row_data) {
91
+ $alternate = (!isset($alternate) || $alternate == 'class="alternate"') ? '' : 'class="alternate"';
92
+ $default_image = (($row_data->default) ? 'default' : 'notdefault');
93
+ $default = (($row_data->default) ? '' : 'setdefault');
94
+ ?>
95
+ <tr id="tr_<?php echo $row_data->id; ?>" <?php echo $alternate; ?>>
96
+ <td class="table_small_col check-column">
97
+ <input id="check_<?php echo $row_data->id; ?>" name="check_<?php echo $row_data->id; ?>" type="checkbox"/>
98
+ </td>
99
+ <td class="table_small_col"><?php echo $row_data->id; ?></td>
100
+ <td>
101
+ <a onclick="fm_set_input_value('task', 'edit'); fm_set_input_value('current_id', '<?php echo $row_data->id; ?>'); fm_form_submit(event, 'themes_form')" href="" title="Edit"><?php echo $row_data->title; ?></a>
102
+ </td>
103
+ <td class="table_big_col">
104
+ <?php if ($default != '') { ?>
105
+ <a onclick="fm_set_input_value('task', '<?php echo $default; ?>'); fm_set_input_value('current_id', '<?php echo $row_data->id; ?>'); fm_form_submit(event, 'themes_form')" href="">
106
+ <?php } ?>
107
+ <img src="<?php echo WD_FM_URL . '/images/' . $default_image . '.png?ver='. get_option("wd_form_maker_version").''; ?>" />
108
+ <?php if ($default != '') { ?>
109
+ </a>
110
+ <?php } ?>
111
+ </td>
112
+ <td class="table_small_col">
113
+ <button class="fm-icon edit-icon" onclick="fm_set_input_value('task', 'edit'); fm_set_input_value('current_id', '<?php echo $row_data->id; ?>'); fm_form_submit(event, 'themes_form');">
114
+ <span></span>
115
+ </button>
116
+ </td>
117
+ <td class="table_small_col">
118
+ <button class="fm-icon delete-icon" onclick="if (confirm('Do you want to delete selected item(s)?')) { fm_set_input_value('task', 'delete'); fm_set_input_value('current_id', '<?php echo $row_data->id; ?>'); fm_form_submit(event, 'themes_form'); } else {return false;}">
119
+ <span></span>
120
+ </button>
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="asc"/>
134
+ <input id="order_by" name="order_by" type="hidden" value="<?php echo $order_by; ?>"/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  </form>
136
  <?php
137
+ }
138
 
139
+ public function edit($id, $reset) {
140
+ $row = $this->model->get_row_data($id, $reset);
141
+ $page_title = (($id != 0) ? 'Edit theme ' . $row->title : 'Create new theme');
142
+ ?>
143
+ <style>
144
+ .CodeMirror {
145
+ border: 1px solid #ccc;
146
+ font-size: 12px;
147
+ margin-bottom: 6px;
148
+ background: white;
149
+ }
150
+ </style>
151
+ <div class="fm-user-manual">
152
+ This section allows you to add fields to your form.
153
+ <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-4.html">Read More in User Manual</a>
154
+ </div>
155
+ <div class="fm-upgrade-pro">
156
+ <a target="_blank" href="https://web-dorado.com/files/fromFormMaker.php">
157
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
158
+ </a>
159
+ </div>
160
+ <div class="fm-clear"></div>
161
+ <form class="wrap" method="post" action="admin.php?page=themes_fm" style="width:99%;">
162
+ <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
163
+ <div class="fm-page-header">
164
+ <div class="fm-page-title">
165
+ <?php echo $page_title; ?>
166
+ </div>
167
+ <div class="fm-page-actions">
168
+ <button class="fm-button save-button small" onclick="if (fm_check_required('title', 'Title')) {return false;}; fm_set_input_value('task', 'save');">
169
+ <span></span>
170
+ Save
171
+ </button>
172
+ <button class="fm-button apply-button small" onclick="if (fm_check_required('title', 'Title')) {return false;}; fm_set_input_value('task', 'apply');">
173
+ <span></span>
174
+ Apply
175
+ </button>
176
+ <button class="fm-button cancel-button small" onclick="fm_set_input_value('task', 'cancel');">
177
+ <span></span>
178
+ Cancel
179
+ </button>
180
+ </div>
181
+ </div>
182
+
183
+ <table style="clear:both;">
184
+ <tbody>
185
+ <tr>
186
+ <td class="fm_label"><label for="title">Title: <span style="color:#FF0000;"> * </span> </label></td>
187
+ <td><input type="text" id="title" name="title" value="<?php echo $row->title; ?>" class="fm_text_input" /></td>
188
+ </tr>
189
+ <tr>
190
+ <td class="fm_label"><label for="css">Css: </label></td>
191
+ <td style="width: 90%;"><textarea id="css" name="css" rows="30" style="width: 100%;"><?php echo htmlspecialchars($row->css) ?></textarea></td>
192
+ </tr>
193
+ </tbody>
194
+ </table>
195
+ <input type="hidden" id="task" name="task" value=""/>
196
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>"/>
197
+ <input type="hidden" id="default" name="default" value="<?php echo $row->default; ?>"/>
198
+ </form>
199
+ <script>
200
+ var editor = CodeMirror.fromTextArea(document.getElementById("css"), {
201
+ lineNumbers: true,
202
+ lineWrapping: true,
203
+ mode: "css"
204
+ });
205
 
206
+ CodeMirror.commands["selectAll"](editor);
207
+ editor.autoFormatRange(editor.getCursor(true), editor.getCursor(false));
208
+ editor.scrollTo(0,0);
209
+ </script>
210
+ <?php
211
+ }
212
 
213
+ ////////////////////////////////////////////////////////////////////////////////////////
214
+ // Getters & Setters //
215
+ ////////////////////////////////////////////////////////////////////////////////////////
216
+ ////////////////////////////////////////////////////////////////////////////////////////
217
+ // Private Methods //
218
+ ////////////////////////////////////////////////////////////////////////////////////////
219
+ ////////////////////////////////////////////////////////////////////////////////////////
220
+ // Listeners //
221
+ ////////////////////////////////////////////////////////////////////////////////////////
222
  }
admin/views/FMViewUninstall_fm.php CHANGED
@@ -22,69 +22,64 @@ class FMViewUninstall_fm {
22
  ////////////////////////////////////////////////////////////////////////////////////////
23
  // Public Methods //
24
  ////////////////////////////////////////////////////////////////////////////////////////
25
- public function display() {
26
- global $wpdb;
27
- $prefix = $wpdb->prefix;
28
- ?>
29
- <form method="post" action="admin.php?page=uninstall_fm" style="width:95%;">
30
- <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
31
- <div class="wrap">
32
- <span class="uninstall_icon"></span>
33
- <h2>Uninstall Form Maker</h2>
34
- <p>
35
- Deactivating Form Maker plugin does not remove any data that may have been created, such as the Forms and the Submissions. To completely remove this plugin, you can uninstall it here.
36
- </p>
37
- <p style="color: red;">
38
- <strong>WARNING:</strong>
39
- Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first.
40
- </p>
41
- <p style="color: red">
42
- <strong>The following WordPress Options/Tables will be DELETED:</strong>
43
- </p>
44
- <table class="widefat">
45
- <thead>
46
- <tr>
47
- <th>Database Tables</th>
48
- </tr>
49
- </thead>
50
- <tr>
51
- <td valign="top">
52
- <ol>
53
- <li><?php echo $prefix; ?>formmaker</li>
54
- <li><?php echo $prefix; ?>formmaker_backup</li>
55
- <li><?php echo $prefix; ?>formmaker_blocked</li>
56
- <li><?php echo $prefix; ?>formmaker_submits</li>
57
- <li><?php echo $prefix; ?>formmaker_views</li>
58
- <li><?php echo $prefix; ?>formmaker_themes</li>
59
- <li><?php echo $prefix; ?>formmaker_sessions</li>
60
- <li><?php echo $prefix; ?>formmaker_query</li>
61
- </ol>
62
- </td>
63
- </tr>
64
- </table>
65
- <p style="text-align: center;">
66
- Do you really want to uninstall Form Maker?
67
- </p>
68
- <p style="text-align: center;">
69
- <input type="checkbox" name="Form Maker" id="check_yes" value="yes" />&nbsp;<label for="check_yes">Yes</label>
70
- </p>
71
- <p style="text-align: center;">
72
- <input type="submit" value="UNINSTALL" class="button-primary" onclick="if (check_yes.checked) {
73
- if (confirm('You are About to Uninstall Form Maker from WordPress.\nThis Action Is Not Reversible.')) {
74
- fm_set_input_value('task', 'uninstall');
75
- } else {
76
- return false;
77
- }
78
- }
79
- else {
80
- return false;
81
- }" />
82
- </p>
83
- </div>
84
- <input id="task" name="task" type="hidden" value="" />
85
- </form>
86
- <?php
87
- }
88
 
89
  public function uninstall() {
90
  $this->model->delete_db_tables();
@@ -94,15 +89,15 @@ class FMViewUninstall_fm {
94
  $deactivate_url = wp_nonce_url($deactivate_url, 'deactivate-plugin_form-maker/form-maker.php');
95
  ?>
96
  <div id="message" class="updated fade">
97
- <p>The following Database Tables succesfully deleted:</p>
98
- <p><?php echo $prefix; ?>formmaker,</p>
99
- <p><?php echo $prefix; ?>formmaker_backup,</p>
100
- <p><?php echo $prefix; ?>formmaker_blocked,</p>
101
- <p><?php echo $prefix; ?>formmaker_sessions,</p>
102
- <p><?php echo $prefix; ?>formmaker_submits,</p>
103
- <p><?php echo $prefix; ?>formmaker_themes,</p>
104
- <p><?php echo $prefix; ?>formmaker_views.</p>
105
- <p><?php echo $prefix; ?>formmaker_query.</p>
106
  </div>
107
  <div class="wrap">
108
  <h2>Uninstall Form Maker</h2>
22
  ////////////////////////////////////////////////////////////////////////////////////////
23
  // Public Methods //
24
  ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ global $wpdb;
27
+ $prefix = $wpdb->prefix;
28
+ ?>
29
+ <form method="post" action="admin.php?page=uninstall_fm" style="width:95%;">
30
+ <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
31
+ <div class="wrap">
32
+ <div class="fm-page-banner uninstall-banner">
33
+ <div class="uninstall_icon">
34
+ </div>
35
+ <div class="fm-logo-title">Uninstall Form Maker</div>
36
+ </div>
37
+ <p>
38
+ Deactivating Form Maker plugin does not remove any data that may have been created, such as the Forms and the Submissions. To completely remove this plugin, you can uninstall it here.
39
+ </p>
40
+ <p style="color: red;">
41
+ <strong>WARNING:</strong>
42
+ Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first.
43
+ </p>
44
+ <p style="color: red">
45
+ <strong>The following WordPress Options/Tables will be DELETED:</strong>
46
+ </p>
47
+ <table class="widefat">
48
+ <thead>
49
+ <tr>
50
+ <th>Database Tables</th>
51
+ </tr>
52
+ </thead>
53
+ <tr>
54
+ <td valign="top">
55
+ <ol>
56
+ <li><?php echo $prefix; ?>formmaker</li>
57
+ <li><?php echo $prefix; ?>formmaker_backup</li>
58
+ <li><?php echo $prefix; ?>formmaker_blocked</li>
59
+ <li><?php echo $prefix; ?>formmaker_submits</li>
60
+ <li><?php echo $prefix; ?>formmaker_views</li>
61
+ <li><?php echo $prefix; ?>formmaker_themes</li>
62
+ <li><?php echo $prefix; ?>formmaker_sessions</li>
63
+ <li><?php echo $prefix; ?>formmaker_query</li>
64
+
65
+ </ol>
66
+ </td>
67
+ </tr>
68
+ </table>
69
+ <p style="text-align: center;">
70
+ Do you really want to uninstall Form Maker?
71
+ </p>
72
+ <p style="text-align: center;">
73
+ <input type="checkbox" name="Form Maker" id="check_yes" value="yes" />&nbsp;<label for="check_yes">Yes</label>
74
+ </p>
75
+ <p style="text-align: center;">
76
+ <input type="submit" value="UNINSTALL" class="button-primary" onclick="if (check_yes.checked) { if (confirm('You are About to Uninstall Form Maker from WordPress.\nThis Action Is Not Reversible.')) { fm_set_input_value('task', 'uninstall'); } else { return false; } } else { return false; }" />
77
+ </p>
78
+ </div>
79
+ <input id="task" name="task" type="hidden" value="" />
80
+ </form>
81
+ <?php
82
+ }
 
 
 
 
 
83
 
84
  public function uninstall() {
85
  $this->model->delete_db_tables();
89
  $deactivate_url = wp_nonce_url($deactivate_url, 'deactivate-plugin_form-maker/form-maker.php');
90
  ?>
91
  <div id="message" class="updated fade">
92
+ <p>The following Database Tables succesfully deleted:</p>
93
+ <p><?php echo $prefix; ?>formmaker,</p>
94
+ <p><?php echo $prefix; ?>formmaker_backup,</p>
95
+ <p><?php echo $prefix; ?>formmaker_blocked,</p>
96
+ <p><?php echo $prefix; ?>formmaker_sessions,</p>
97
+ <p><?php echo $prefix; ?>formmaker_submits,</p>
98
+ <p><?php echo $prefix; ?>formmaker_themes,</p>
99
+ <p><?php echo $prefix; ?>formmaker_views.</p>
100
+ <p><?php echo $prefix; ?>formmaker_query.</p>
101
  </div>
102
  <div class="wrap">
103
  <h2>Uninstall Form Maker</h2>
assets/{conditional-emalis-update.png → conditional-emails-update.png} RENAMED
File without changes
css/calendar-jos.css CHANGED
@@ -6,9 +6,9 @@
6
  }
7
 
8
  div.calendar {
9
- position: relative;
10
- z-index: 100;
11
- width: 326px;
12
  }
13
 
14
  .calendar,
6
  }
7
 
8
  div.calendar {
9
+ position: relative;
10
+ z-index: 100;
11
+ width: 326px;
12
  }
13
 
14
  .calendar,
css/form_maker_featured_plugins.css DELETED
@@ -1,88 +0,0 @@
1
- #main_featured_plugins_page #featured-plugins-list {
2
- position:relative;
3
- margin:0px auto;
4
- width:90%;
5
- height:auto;
6
- display:table;
7
- list-style:none;
8
- }
9
-
10
- #main_featured_plugins_page #featured-plugins-list li {
11
- display:block;
12
- height:113px;
13
- padding:15px 5% 15px 5%;
14
- margin:0px 0px 12px 0px;
15
- background:#ededed;
16
- }
17
-
18
- #main_featured_plugins_page #featured-plugins-list li .product {
19
- position:relative;
20
- float:left;
21
- width:35%;
22
- height:113px;
23
- }
24
-
25
- #main_featured_plugins_page #featured-plugins-list li .title {
26
- float:left;
27
- height:113px;
28
- width:90%;
29
- margin:0px 0px 0px 109px;
30
- background:#cacaca;
31
- border-top-right-radius:3px;
32
- border-bottom-right-radius:3px;
33
- }
34
-
35
- #main_featured_plugins_page #featured-plugins-list li.photo-gallery .product {background:url("images/photo-gallery.jpg") left center no-repeat;}
36
- #main_featured_plugins_page #featured-plugins-list li.twitter-widget .product {background:url("images/twitter-widget.jpg") left center no-repeat;}
37
- #main_featured_plugins_page #featured-plugins-list li.form-maker .product {background:url("images/form.jpg") left center no-repeat;}
38
- #main_featured_plugins_page #featured-plugins-list li.catalog .product {background:url("images/catalog.jpg") left center no-repeat;}
39
- #main_featured_plugins_page #featured-plugins-list li.contact-maker .product {background:url("images/contact.maker.jpg") left center no-repeat;}
40
- #main_featured_plugins_page #featured-plugins-list li.contacts .product {background:url("images/contacts.jpg") left center no-repeat;}
41
- #main_featured_plugins_page #featured-plugins-list li.facebook .product {background:url("images/facebook.jpg") left center no-repeat;}
42
- #main_featured_plugins_page #featured-plugins-list li.faq .product {background:url("images/faq.jpg") left center no-repeat;}
43
- #main_featured_plugins_page #featured-plugins-list li.flash-calendar .product {background:url("images/flash.calendar.jpg") left center no-repeat;}
44
- #main_featured_plugins_page #featured-plugins-list li.folder-menu .product {background:url("images/folder.menu.jpg") left center no-repeat;}
45
- #main_featured_plugins_page #featured-plugins-list li.player .product {background:url("images/player.jpg") left center no-repeat;}
46
- #main_featured_plugins_page #featured-plugins-list li.spider-calendar .product {background:url("images/spider.calendar.jpg") left center no-repeat;}
47
- #main_featured_plugins_page #featured-plugins-list li.zoom .product {background:url("images/zoom.jpg") left center no-repeat;}
48
-
49
- #main_featured_plugins_page #featured-plugins-list li.form_maker_import .product {
50
- background: #cacaca url("images/form_make_import.png") left 11px no-repeat;
51
- background-size: 100px 110px;
52
- border-top-left-radius: 3px;
53
- border-bottom-left-radius: 3px;
54
- }
55
-
56
- #main_featured_plugins_page #featured-plugins-list li .title .heading {
57
- display:block;
58
- position:relative;
59
- font-size:24px;
60
- color:#014f73;
61
- margin:30px 0px -10px 20px;
62
- line-height: 24px;
63
- }
64
-
65
- #main_featured_plugins_page #featured-plugins-list li .title p {
66
- font-size:14px;
67
- color:#444;
68
- margin-left:20px;
69
- }
70
-
71
- #main_featured_plugins_page #featured-plugins-list li .description {
72
- float:right;
73
- width:50%;
74
- height:113px;
75
- }
76
-
77
- #main_featured_plugins_page #featured-plugins-list li .description p {
78
- text-align:right;
79
- }
80
-
81
- #main_featured_plugins_page #featured-plugins-list li .description a.download, #main_featured_plugins_page #featured-plugins-list li .description a.download:link, #main_featured_plugins_page #featured-plugins-list li .description a.download:visited {
82
- display:block;
83
- width:106px;
84
- height:32px;
85
- text-indent:-9999px;
86
- background:url(images/download.jpg) left top no-repeat;
87
- float:right;
88
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/form_maker_first.css CHANGED
@@ -1,189 +1,174 @@
1
  .wdform-page-and-images {
2
- color: #000000;
3
- font-size: 14px;
4
- font-weight: normal;
5
- width: 100%;
6
  }
7
 
8
  .wdform_table1 {
9
- color: #000000;
10
- font-size: 14px;
11
- font-weight: normal;
12
- width: 100%;
13
  }
14
 
15
  .wdform_tbody1 {
16
- float: left;
17
  }
18
 
19
  .wdform_table2 {
20
- border-collapse: separate !important;
21
- border-spacing: 0px;
22
- float: left;
23
- padding-right: 50px !important;
24
- }
25
-
26
- #edit_main_table label {
27
- line-height: 19px;
28
- }
29
-
30
- #edit_main_table td {
31
- padding-right: 5px;
32
  }
33
 
34
  .time_box {
35
- border-width: 1px;
36
- margin: 0px;
37
- padding: 0px;
38
- text-align: right;
39
- vertical-align: middle
40
- width: 30px;
41
  }
42
 
43
- .mini_label {
44
- font-family: 'Lucida Grande', Tahoma, Arial, Verdana, sans-serif;
45
- font-size: 10px;
46
  }
47
 
48
- .ch_rad_label {
49
- display: inline;
50
- float: none;
51
- margin-left: 5px;
52
- margin-right: 15px;
53
  }
54
 
55
  .label {
56
- border: none;
57
  }
58
 
59
  .td_am_pm_select {
60
- padding-left: 5px;
61
  }
62
 
63
  .am_pm_select {
64
- height: 16px;
65
- margin: 0;
66
- padding: 0
67
  }
68
 
69
  .input_deactive {
70
- border-width: 1px;
71
- color: #999999;
72
- font-style: italic;
73
- margin: 0px;
74
- padding: 0px
75
  }
76
 
77
  .input_active {
78
- border-width: 1px;
79
- color: #000000;
80
- font-style: normal;
81
- margin: 0px;
82
- padding: 0px
83
  }
84
 
85
  .required {
86
- border: none;
87
- color: red
88
  }
89
 
90
  .captcha_img {
91
- border-width: 0px;
92
- cursor: pointer;
93
- margin: 0px;
94
- padding: 0px;
95
  }
96
 
97
  .captcha_refresh {
98
- background-image: url("../images/refresh_black.png");
99
- border-width: 0px;
100
- cursor: pointer;
101
- height: 30px;
102
- margin: 0px;
103
- padding: 0px;
104
- vertical-align: middle;
105
- width: 30px;
106
  }
107
 
108
  .captcha_input {
109
- border-width: 1px;
110
- height: 20px;
111
- margin: 0px;
112
- padding: 0px;
113
- vertical-align: middle;
114
  }
115
 
116
  .arithmetic_captcha_img {
117
- border-width: 0px;
118
- cursor: pointer;
119
- margin: 0px;
120
- padding: 0px;
121
- vertical-align: middle;
122
  }
123
 
124
  .arithmetic_captcha_input {
125
- border-width: 1px;
126
- height: 25px;
127
- margin-left: 3px;
128
- padding: 0px;
129
- vertical-align: middle;
130
  }
131
 
132
  .file_upload {
133
- border-width: 1px;
134
- margin: 0px;
135
- padding: 0px
136
  }
137
 
138
  .page_deactive {
139
- background-color: #DBDBDB;
140
- border: 1px solid black;
141
- cursor: pointer;
142
- margin: 4px;
143
- padding: 4px 7px 4px 7px;
144
  }
145
 
146
- .page_active {
147
- background-color: #878787;
148
- border: 1px solid black;
149
- cursor: pointer;
150
- padding: 4px 7px 4px 7px;
151
- margin: 4px;
152
  }
153
 
154
- .page_percentage_active {
155
- background-color: yellow;
156
- border-radius: 30px;
157
- border-spacing: 0px;
158
- height: 30px;
159
- line-height: 30px;
160
- float: left;
161
- font-size: 15px;
162
- margin: 0px;
163
- padding: 0px;
164
- text-align: right !important;
165
  }
166
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
 
168
  .page_percentage_deactive {
169
- background-color: white;
170
- border: 1px solid black;
171
- border-radius: 30px;
172
- height: 30px;
173
- line-height: 30px;
174
- padding: 5px;
175
- text-align: left !important;
176
- width: 100%;
177
- }
178
-
179
- .page_numbers {
180
- font-size: 11px;
181
- }
182
-
183
- .phone_area_code {
184
- width: 50px;
185
- }
186
-
187
- .phone_number {
188
- width: 100px;
189
- }
1
  .wdform-page-and-images {
2
+ color: #000000;
3
+ font-size: 14px;
4
+ font-weight: normal;
5
+ width: 100%;
6
  }
7
 
8
  .wdform_table1 {
9
+ color: #000000;
10
+ font-size: 14px;
11
+ font-weight: normal;
12
+ width: 100%;
13
  }
14
 
15
  .wdform_tbody1 {
16
+ float: left;
17
  }
18
 
19
  .wdform_table2 {
20
+ border-collapse: separate !important;
21
+ border-spacing: 0px;
22
+ float: left;
23
+ padding-right: 50px !important;
 
 
 
 
 
 
 
 
24
  }
25
 
26
  .time_box {
27
+ border-width: 1px;
28
+ margin: 0px;
29
+ padding: 2px;
30
+ text-align: right;
31
+ vertical-align: middle;
32
+ width: 30px !important;
33
  }
34
 
35
+ .wdform-date {
36
+ width: 100px !important;
 
37
  }
38
 
39
+ .mini_label {
40
+ font-family: 'Lucida Grande', Tahoma, Arial, Verdana, sans-serif;
41
+ font-size: 10px;
 
 
42
  }
43
 
44
  .label {
45
+ border: none;
46
  }
47
 
48
  .td_am_pm_select {
49
+ padding-left: 5px;
50
  }
51
 
52
  .am_pm_select {
53
+ height: 16px;
54
+ margin: 0;
55
+ padding: 0
56
  }
57
 
58
  .input_deactive {
59
+ border-width: 1px;
60
+ color: #999999;
61
+ font-style: italic;
 
 
62
  }
63
 
64
  .input_active {
65
+ border-width: 1px;
66
+ color: #000000;
67
+ font-style: normal;
 
 
68
  }
69
 
70
  .required {
71
+ border: none;
72
+ color: red
73
  }
74
 
75
  .captcha_img {
76
+ border-width: 0px;
77
+ cursor: pointer;
78
+ margin: 0px;
79
+ padding: 0px;
80
  }
81
 
82
  .captcha_refresh {
83
+ background-image: url("../images/refresh_black.png");
84
+ border-width: 0px;
85
+ cursor: pointer;
86
+ height: 30px;
87
+ margin: 0px;
88
+ padding: 0px;
89
+ vertical-align: middle;
90
+ width: 30px;
91
  }
92
 
93
  .captcha_input {
94
+ border-width: 1px;
95
+ height: 20px;
96
+ margin: 0px;
97
+ padding: 0px;
98
+ vertical-align: middle;
99
  }
100
 
101
  .arithmetic_captcha_img {
102
+ border-width: 0px;
103
+ cursor: pointer;
104
+ margin: 0px;
105
+ padding: 0px;
106
+ vertical-align: middle;
107
  }
108
 
109
  .arithmetic_captcha_input {
110
+ border-width: 1px;
111
+ height: 25px;
112
+ margin-left: 3px;
113
+ padding: 0px;
114
+ vertical-align: middle;
115
  }
116
 
117
  .file_upload {
118
+ border-width: 1px;
119
+ margin: 0px;
120
+ padding: 0px;
121
  }
122
 
123
  .page_deactive {
124
+ border: 1px solid #BFBEBE;
125
+ cursor: pointer;
126
+ border-radius: 15px;
127
+ padding: 2px 8px;
 
128
  }
129
 
130
+ .page_deactive:hover {
131
+ background-color: #F0F0F0;
 
 
 
 
132
  }
133
 
134
+ .page_active {
135
+ background-color: #4EC0D9;
136
+ cursor: pointer;
137
+ padding: 2px 8px;
138
+ margin: 4px;
139
+ cursor: pointer;
140
+ border-radius: 15px;
141
+ padding: 3px 9px;
142
+ color: #fff;
 
 
143
  }
144
 
145
+ .page_percentage_active {
146
+ background-color: #4EC0D9;
147
+ border-radius: 30px;
148
+ border-spacing: 0px;
149
+ height: 30px;
150
+ line-height: 29px;
151
+ float: left;
152
+ font-size: 15px;
153
+ margin: 0px;
154
+ padding: 0px;
155
+ text-align: right !important;
156
+ color: #4EC0D9;
157
+ }
158
+
159
+ .page_percentage_active b{
160
+ padding: 4px 15px;
161
+ background: #fff;
162
+ border-radius: 18px;
163
+ margin: 3px;
164
+ }
165
 
166
  .page_percentage_deactive {
167
+ background-color: white;
168
+ border: 1px solid #ABA8A8;
169
+ border-radius: 30px;
170
+ height: 30px;
171
+ line-height: 30px;
172
+ text-align: left !important;
173
+ width: 100%;
174
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
css/form_maker_frontend.css CHANGED
@@ -18,7 +18,7 @@
18
 
19
  .page_percentage_deactive,
20
  .page_percentage_deactive * {
21
- word-wrap: normal;
22
  }
23
 
24
  .wdform_percentage_text,
18
 
19
  .page_percentage_deactive,
20
  .page_percentage_deactive * {
21
+ word-wrap: normal;
22
  }
23
 
24
  .wdform_percentage_text,
css/form_maker_tables.css CHANGED
@@ -1,205 +1,480 @@
1
- #TB_window,
2
- #TB_overlay {
3
- z-index: 10200;
4
- }
5
 
6
  #main_div input[type="checkbox"], #main_div input[type="radio"] {
7
- float: right !important;
8
- margin: 3px 3px 3px 4px;
9
  }
10
 
11
  .wdform_column input[type="checkbox"],.wdform_column input[type="radio"] {
12
- float: right !important;
13
- margin: 3px 3px 3px 4px;
14
- }
15
-
16
- #manage_form fieldset {
17
- clear: both;
18
- float: left;
19
- width: 99%;
20
- }
21
-
22
- .form_maker_title {
23
- border: none;
24
- font-size: 11px;
25
- height: 19px;
26
- width: 160px;
27
  }
28
 
29
  #take_temp .element_toolbar,
30
  #take_temp .page_toolbar,
31
  #take_temp .captcha_img,
32
  #take_temp .wdform_stars {
33
- display: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  }
35
 
36
  #when_edit {
37
- position: absolute;
38
- background-color: #666;
39
- z-index: 101;
40
- display: none;
41
- width: 100%;
42
- height: 100%;
43
- opacity: 0.7;
44
- filter: alpha(opacity=70);
45
  }
 
 
46
  #formMakerDiv {
47
- position: fixed;
48
- background-color: #666;
49
- z-index: 100;
50
- display: none;
51
- left: 0;
52
- top: 0;
53
- width: 100%;
54
- height: 100%;
55
- opacity: 0.7;
56
- filter: alpha(opacity=70);
57
  }
 
58
  #formMakerDiv1 {
59
- padding-top: 20px;
60
- position: fixed;
61
- z-index: 10000;
62
- background-color: transparent;
63
- top: 0;
64
- left: 0;
65
- display: none;
66
- margin-left: 30px;
67
- margin-top: 15px;
68
- }
69
- .formmaker_table input {
70
- border-radius: 3px;
71
- padding: 2px;
72
- }
73
- .formmaker_table {
74
- background-color: #00aeef;
75
- border-radius: 8px;
76
- border: 6px #00aeef solid;
77
- float: left;
78
- height: 120px;
79
- margin: 25px 5px 0 0;
80
- width: 99%;
81
  }
 
82
  .formMakerDiv1_table {
83
- border: 6px #00aeef solid;
84
- background-color: #FFF;
85
- border-radius: 8px;
86
  }
87
 
88
- .borderer {
89
- border-radius: 5px;
90
- padding-left: 5px;
91
- background-color: #F0F0F0;
92
- height: 19px;
93
- width: 153px;
94
  }
95
- fieldset.adminform {
96
- border-radius: 7px;
97
- border: 1px solid;
98
- padding: 5px;
99
- width: 99%;
100
- }
101
- fieldset.fm_mail_options {
102
- border-radius: 7px;
103
- border: 1px solid;
104
- margin: 5px;
105
- padding: 5px;
106
- width: 98%;
 
 
 
 
107
  }
108
- table.admintable td.key,
109
- table.admintable td.paramlist_key {
110
- background-color: #F6F6F6;
111
- border-bottom: 1px solid #E9E9E9;
112
- border-right: 1px solid #E9E9E9;
113
- color: #666666;
114
- font-weight: bold;
115
- text-align: right;
116
- width: 200px;
 
 
 
117
  }
118
- table.admintable {
119
- width: 100%;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  .submenu-box {
122
- background-color: #F4F4F4;
123
- border: 1px solid #CCCCCC;
124
- border-radius: 7px 7px 7px 7px;
125
- padding: 6px 5px;
126
- margin: 5px 0;
127
  }
128
- #submenu li {
129
- display: inline;
130
- margin: 0;
131
- padding: 0;
132
  }
 
 
 
 
 
 
 
133
  #submenu {
134
- margin: 0;
135
- padding: 0;
136
  }
137
- #general {
138
- padding: 0 15px;
 
 
 
139
  }
 
140
  #submenu a:hover,
141
  #submenu a.active,
142
  #submenu span.nolink.active {
143
- background: none repeat scroll 0 0 #FFFFFF;
144
- color: #146295;
145
  }
 
 
 
 
 
146
  #submenu li a,
147
  #submenu span.nolink {
148
- border-right: 1px solid #CCCCCC;
149
- color: #808080;
150
- cursor: pointer;
151
- font-size: 1.1em;
152
- font-weight: bold;
153
- height: 12px;
154
- line-height: 14px;
155
- padding: 0 15px;
156
  }
157
 
158
- .fm_fieldset_active {
159
- display: block;
 
 
160
  }
161
 
162
- .fm_fieldset_deactive {
163
- display: none;
 
 
 
164
  }
165
 
166
- div.wd_preview span {
167
- float: none;
168
- width: 32px;
169
- height: 32px;
170
- margin: 0 auto;
171
- display: block;
172
  }
173
- div.wd_preview a {
174
- display: block;
175
- float: left;
176
- white-space: nowrap;
177
- border: 1px solid #fbfbfb;
178
- padding: 1px 5px;
179
- cursor: pointer;
180
- text-decoration: none
 
 
 
 
 
181
  }
182
 
183
- .wrap * {
184
- font-size: 12px;
185
- font-family: sans-serif;
 
186
  }
187
 
188
- .input_th {
189
- margin-left: 0px !important;
190
- width: 160px !important;
191
- font-family: sans-serif;
192
  }
193
- .input_th2 {
194
- margin-left: 0px !important;
195
- width: 160px !important;
196
- margin-top: 5px;
197
- height: 19px;
198
  }
199
 
200
- .edit_input {
201
- height: 28px !important;
202
- padding-bottom: 7px !important;
203
  }
204
 
205
  .add_tag_th {
@@ -209,49 +484,40 @@ div.wd_preview a {
209
  }
210
 
211
  .pointer{
212
- cursor: pointer;
213
- }
214
-
215
- .non_selectable {
216
- -webkit-touch-callout: none;
217
- -webkit-user-select: none;
218
- -khtml-user-select: none;
219
- -moz-user-select: none;
220
- -ms-user-select: none;
221
- user-select: none;
222
  }
223
 
224
  .table_small_col {
225
- text-align: center !important;
226
- width: 45px;
227
  }
228
 
229
  .table_medium_col {
230
- text-align: center !important;
231
- width: 70px;
232
  }
233
 
234
  .table_big_col {
235
- text-align: center !important;
236
- width: 80px;
237
  }
238
 
239
  .table_large_col {
240
- text-align: center !important;
241
- width: 200px;
242
  }
243
 
244
  .table_large_col input{
245
- width: 180px;
246
  }
247
 
248
  .table_medium_col_uncenter {
249
- width: 80px;
250
  }
251
 
252
  .table_extra_large_col {
253
- padding: 4px !important;
254
- width: 150px !important;
255
  }
256
 
257
  .first-page,
@@ -262,82 +528,66 @@ div.wd_preview a {
262
  .table_medium_col a,
263
  .table_big_col a,
264
  .table_small_col a {
265
- cursor: pointer;
266
  }
267
 
268
- .fm_word_wrap {
269
- word-wrap: normal;
270
- }
271
-
272
- .fm_description {
273
- color: #666666;
274
- font-size: 0.923em;
275
- line-height: 1.231em;
276
- margin: 2px 0 10px 2px;
277
- }
278
 
279
  .handle {
280
- background: url("../images/draggable.png") no-repeat /*scroll 6px 9px*/ transparent;
281
- border: none;
282
- height: 15px;
283
- margin: 0 auto;
284
- vertical-align: middle;
285
- width: 15px;
286
  }
287
 
288
  .form_maker_icon {
289
- background-image: url("../images/formmakerLogo-48.png");
290
- background-repeat: no-repeat;
291
- border: none;
292
- float: left;
293
- height: 48px;
294
- margin: 0 8px 0 0;
295
- width: 48px;
296
  }
297
 
298
  .block_icon {
299
- background-image: url("../images/block-icon.png");
300
- background-repeat: no-repeat;
301
- border: none;
302
- float: left;
303
- height: 32px;
304
- margin: 7px 8px 0 0;
305
- width: 32px;
306
  }
307
 
308
  .theme_icon {
309
- background-image: url("../images/theme-icon.png");
310
- background-repeat: no-repeat;
311
- border: none;
312
- float: left;
313
- height: 32px;
314
- margin: 7px 8px 0 0;
315
- width: 32px;
316
  }
317
 
318
  .uninstall_icon {
319
- background-image: url("../images/uninstall-icon.png");
320
- background-repeat: no-repeat;
321
- border: none;
322
- float: left;
323
- height: 32px;
324
- margin: 7px 8px 0 0;
325
- width: 32px;
326
  }
327
 
328
  .connectedSortable {
329
- cursor: move;
330
  }
331
 
332
  .fm_label {
333
- font-weight: bold;
334
- width: 100px;
335
- }
336
-
337
- .fm_fieldset .fm_label {
338
- font-weight: bold;
339
- vertical-align: top;
340
- width: 150px;
341
  }
342
 
343
  .fm_label_options {
@@ -350,120 +600,15 @@ div.wd_preview a {
350
  width: 80px;
351
  }
352
 
353
- .fm_char_input {
354
- width: 115px;
355
- }
356
-
357
  .fm_text_input {
358
  width: 190px;
359
  }
360
 
361
- .fm_slider_div {
362
- display: inline-block;
363
- vertical-align: middle;
364
- width: 140px;
365
- }
366
-
367
- .fm_slider_percentage,
368
- .fm_slider_percentage input,
369
- .fm_slider_percentage input :focus {
370
- background: transparent;
371
- border: none;
372
- color: #00AEEF;
373
- display: inline;
374
- font-weight: bold;
375
- text-align: right;
376
- vertical-align: middle;
377
- width: 30px;
378
- }
379
-
380
  .updated,
381
  .error {
382
  margin: 5px 0 2px !important;
383
  }
384
 
385
- .error_fm {
386
- padding: 5px;
387
- font-size: 14px;
388
- margin: 5px 0 2px !important;
389
- }
390
-
391
- div.error_fm {
392
- background: #fff;
393
- border-left: 4px solid #dd3d36;
394
- -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
395
- box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
396
- }
397
-
398
- .buttons_div {
399
- clear: both;
400
- float: right;
401
- margin: 5px 0;
402
- }
403
-
404
- .fm_delete_img {
405
- background-image: url("../images/delete.png");
406
- border: none;
407
- cursor: pointer;
408
- display: inline-block;
409
- vertical-align: middle;
410
- height: 14px;
411
- width: 14px;
412
- }
413
-
414
- .fm_delete_img_small {
415
- background-image: url("../images/delete.png");
416
- background-size: 10px auto;
417
- border: medium none;
418
- cursor: pointer;
419
- display: inline-block;
420
- height: 10px;
421
- margin-top: 2px;
422
- vertical-align: middle;
423
- width: 10px;
424
- }
425
-
426
- .fm_fieldset {
427
- background: none repeat scroll 0 0 #F4F4F4;
428
- border: 1px solid #8F8D8D;
429
- border-radius: 8px 8px 8px 8px;
430
- display: none;
431
- float: left;
432
- margin: 4px;
433
- padding: 13px;
434
- width: 97%;
435
- }
436
-
437
- .fm_type_fieldset {
438
- background: none repeat scroll 0 0 #F4F4F4;
439
- border-radius: 8px 8px 8px 8px;
440
- display: none;
441
- float: left;
442
- width: 100%;
443
- }
444
-
445
- .fm_child_fieldset {
446
- background: none repeat scroll 0 0 #F4F4F4;
447
- border: 1px solid #8F8D8D;
448
- border-radius: 8px 8px 8px 8px;
449
- float: left;
450
- margin: 4px;
451
- width: 30%;
452
- padding: 13px;
453
- display: block;
454
- }
455
-
456
- .fm_table td {
457
- padding: 0;
458
- vertical-align: middle;
459
- }
460
-
461
- .fm_ctrls {
462
- padding: 4px;
463
- text-align: center;
464
- width: 40px;
465
- }
466
-
467
  .theme_type {
468
  background-color: #F4F4F4;
469
  border: 1px solid #8F8D8D;
@@ -488,56 +633,23 @@ div.error_fm {
488
  margin: 0 0 4px;
489
  }
490
 
491
- .wdform_arrows img {
492
- cursor: pointer;
493
- }
494
 
495
  #form_id_tempform_view_img1 td {
496
  padding: 0;
497
  }
498
 
499
- .form_title {
500
- font-size: 36px;
501
- line-height: initial;
502
- text-align: center;
503
- }
504
 
505
- .form_title_cont {
506
- cursor: pointer;
507
- display: block;
508
- overflow: hidden;
509
- text-overflow: ellipsis;
510
- white-space: nowrap;
511
- width: 300px;
512
  }
513
 
514
- .submit_content {
515
- border-radius: 3px;
516
- border: 1px solid #F0F0F0;
517
- overflow-x: auto;
518
- width: 99%;
519
- }
520
 
521
- .reports {
522
- border: 1px solid #DEDEDE;
523
- border-radius: 11px;
524
- background-color: #F0F0F0;
525
- text-align: center;
526
- width: 100px;
527
- }
528
 
529
- .bordered {
530
- border-radius: 8px;
531
- }
532
 
533
- .payment_info_fc {
534
- width: 72px;
535
- }
536
 
537
- .exp_but_span {
538
- display: inline-block;
539
- vertical-align: middle;
540
- }
541
 
542
  .sub-align {
543
  vertical-align: middle !important;
@@ -626,3 +738,388 @@ div.error_fm {
626
  padding: 0;
627
  vertical-align: middle;
628
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
 
 
 
2
 
3
  #main_div input[type="checkbox"], #main_div input[type="radio"] {
4
+ float: right !important;
5
+ margin: 3px 3px 3px 4px;
6
  }
7
 
8
  .wdform_column input[type="checkbox"],.wdform_column input[type="radio"] {
9
+ float: right !important;
10
+ margin: 3px 3px 3px 4px;
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  }
12
 
13
  #take_temp .element_toolbar,
14
  #take_temp .page_toolbar,
15
  #take_temp .captcha_img,
16
  #take_temp .wdform_stars {
17
+ display: none;
18
+ }
19
+
20
+
21
+
22
+
23
+ /*///////////////
24
+ new
25
+ //////////////*/
26
+ #TB_window,
27
+ #TB_overlay {
28
+ z-index: 10200;
29
+ }
30
+
31
+ fieldset input,
32
+ fieldset textarea,
33
+ fieldset select,
34
+ fieldset img,
35
+ fieldset button {
36
+ float:none !important;
37
+ }
38
+
39
+ fieldset input[type="text"],
40
+ fieldset input[type="password"],
41
+ fieldset input[type="number"],
42
+ fieldset select {
43
+ height: 27px !important;
44
+ margin: 2px 0 !important;
45
+ padding: 2px !important;
46
+ border-radius: 0;
47
+ width: 250px;
48
+ border: 1px solid #ccc;
49
+ box-shadow: none;
50
+ vertical-align: middle;
51
  }
52
 
53
  #when_edit {
54
+ position: absolute;
55
+ background-color: #666;
56
+ z-index: 101;
57
+ display: none;
58
+ width: 100%;
59
+ height: 100%;
60
+ opacity: 0.7;
61
+ filter: alpha(opacity=70);
62
  }
63
+
64
+
65
  #formMakerDiv {
66
+ position: fixed;
67
+ background-color: #666;
68
+ z-index: 100;
69
+ display: none;
70
+ left: 0;
71
+ top: 0;
72
+ width: 100%;
73
+ height: 100%;
74
+ opacity: 0.7;
75
+ filter: alpha(opacity=70);
76
  }
77
+
78
  #formMakerDiv1 {
79
+ padding-top: 20px;
80
+ position: fixed;
81
+ z-index: 10000;
82
+ top: 0;
83
+ left: 0;
84
+ display: none;
85
+ margin-left: 30px;
86
+ margin-top: 12px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  }
88
+
89
  .formMakerDiv1_table {
90
+ font-family: Segoe UI !important;
91
+ background-color: #FFF;
 
92
  }
93
 
94
+ #field_types {
95
+ border-right: 4px solid #E5E5E5;
96
+ background: #F2F2F2;
 
 
 
97
  }
98
+
99
+
100
+
101
+ /* submissions */
102
+
103
+ #sbox-overlay {
104
+ z-index: 65555;
105
+ position: fixed;
106
+ top: 0px;
107
+ left: 0px;
108
+ visibility: visible;
109
+ zoom: 1;
110
+ background-color: #000000;
111
+ opacity: 0.7;
112
+ filter: alpha(opacity=70);
113
+ display: none;
114
  }
115
+
116
+ #ChBDiv {
117
+ background-color: #FFFFFF;
118
+ width: 350px;
119
+ max-height: 350px;
120
+ overflow-y: auto;
121
+ padding: 20px;
122
+ position: fixed;
123
+ top: 100px;
124
+ display: none;
125
+ border: 2px solid #AAAAAA;
126
+ z-index: 65556;
127
  }
128
+
129
+ .fm-submissions-page {
130
+ width:99%;
131
+ }
132
+
133
+ .submit_content {
134
+ overflow-x: auto;
135
+ }
136
+
137
+ .fm-reports {
138
+ text-align: left;
139
+ display:inline-block;
140
+ vertical-align: middle;
141
+ }
142
+
143
+ .fm-tools-button {
144
+ border: 1px solid;
145
+ border-radius: 0px;
146
+ text-align: left;
147
+ color: #0288C5;
148
+ height: 40px;
149
+ line-height: 40px;
150
+ display: inline-block;
151
+ padding: 0px 10px;
152
+ background: #F1F1F1;
153
+ border-color: #F1F1F1;
154
+ font-size:15px;
155
+ }
156
+
157
+ .fm-total_rate, .fm-total_entries, .fm-total_views {
158
+ display: inline-block;
159
+ line-height: 18px;
160
+ padding: 5px 10px;
161
+ border-radius: 37px;
162
+ font-size: 16px;
163
+ background: #fff;
164
+ border: none;
165
+ margin-right: 6px;
166
+ }
167
+
168
+
169
+ .fm-form-title {
170
+ text-align: left;
171
+ display: inline-block;
172
+ height: 46px;
173
+ line-height: 46px;
174
+ font-size: 28px;
175
+ font-weight: bold;
176
+ max-width: 450px;
177
+ overflow: hidden;
178
+ text-overflow: ellipsis;
179
+ white-space: nowrap;
180
+ }
181
+
182
+ .submissions-actions {
183
+ height: 70px;
184
+ line-height: 50px;
185
+ }
186
+
187
+ .submissions-toolbar {
188
+ background: #fff;
189
+ height: 100px;
190
+ line-height: 100px;
191
+ }
192
+
193
+ .submissions-tools {
194
+ padding: 0 10px;
195
+ }
196
+
197
+ .submissions-tools select {
198
+ height: 41px;
199
+ width:280px;
200
+ max-width: 280px;
201
+ border: 1px solid #f1f1f1;
202
+ font-style: italic;
203
+ border-radius: 0px;
204
+ margin-left:7px;
205
+ box-shadow:none;
206
+ }
207
+
208
+ .fm-export-tools {
209
+ float:right;
210
+ }
211
+
212
+ .fm-export-tools span {
213
+ display: inline-block;
214
+ font-size:15px;
215
+ color:#0288C5;
216
+ }
217
+
218
+ .fm-export-tools button{
219
+ cursor:pointer;
220
+ }
221
+
222
+ .fm-search-tools {
223
+ float:left;
224
+ }
225
+
226
+ .fm-add-remove{
227
+ float:right;
228
+ }
229
+
230
+ .fm-add-remove button {
231
+ font-size: 13px;
232
+ background: #4EC0D9;
233
+ width: 154px;
234
+ margin-right:15px;
235
+ }
236
+
237
+
238
+ .fm-statistics{
239
+ background: #fff;
240
+ padding: 10px 10px 20px 10px;
241
+ }
242
+
243
+ .fm-statistics .stats tr {
244
+ border: none !important;
245
+ }
246
+
247
+ .fm-statistics .stats td {
248
+ border: none !important;
249
+ padding: 5px 3px;
250
+ vertical-align: middle;
251
+ }
252
+
253
+ .fm-statistics .stats select{
254
+ height: 31px;
255
+ width: 298px;
256
+ max-width: 298px;
257
+ border: 1px solid #E6E4E4;
258
+ font-style: italic;
259
+ border-radius: 0px;
260
+ margin-left: 7px;
261
+ box-shadow: none;
262
+ }
263
+
264
+ .fm-statistics #div_stats .field-label {
265
+ font-size: 16px;
266
+ font-weight: bold;
267
+ }
268
+
269
+ .fm-statistics .stats button{
270
+ display: inline-block;
271
+ height: 27px;
272
+ line-height: 27px;
273
+ border-radius: 0px;
274
+ font-size: 12px;
275
+ font-weight: bold;
276
+ padding: 0 14px;
277
+ cursor: pointer;
278
+ text-align: center;
279
+ color: #fff;
280
+ border: none;
281
+ background: #4EC0D9;
282
+ }
283
+
284
+ .fm-statistics .stats input{
285
+ border-radius: 0px;
286
+ border: 1px solid #E6E4E4;
287
+ box-shadow: none;
288
+ vertical-align: middle;
289
+ }
290
+
291
+ .fm-statistics .stats label{
292
+ font-size:14px;
293
+ }
294
+
295
+ .fm-statistics .label0{
296
+ background:#4EC0D9;
297
+ border: 2px solid #4EC0D9;
298
+ }
299
+
300
+ .fm-statistics .label1
301
+ {
302
+ background:#DDCC7F;
303
+ border: 2px solid #DDCC7F;
304
+ }
305
+
306
+ .fm-statistics .bordered0:before
307
+ {
308
+ content: " ";
309
+ width:20px;
310
+ height:16px;
311
+ margin-left: -15px;
312
+ background:#5FE2FF;
313
+ display: inline-block;
314
+ -webkit-transform: scale(1) rotate(0deg) translateX(0px) translateY(0px) skewX(-25deg) skewY(0deg);
315
+ }
316
+
317
+ .fm-statistics .bordered1:before
318
+ {
319
+ content: " ";
320
+ width:20px;
321
+ height:16px;
322
+ margin-left: -15px;
323
+ background:#F9E89C;
324
+ display: inline-block;
325
+ -webkit-transform: scale(1) rotate(0deg) translateX(0px) translateY(0px) skewX(-25deg) skewY(0deg);
326
+ }
327
+
328
+ .fm-statistics .adminlist{
329
+ border-collapse: separate;
330
+ font-size:14px;
331
+ width: 100%;
332
  }
333
+
334
+ .fm-statistics .adminlist th
335
+ {
336
+ font-size:14px;
337
+ padding: 10px 0;
338
+ }
339
+
340
+ .fm-statistics .adminlist td
341
+ {
342
+ border: none !important;
343
+ }
344
+
345
+ .fm-statistics .adminlist td:first-child
346
+ {
347
+ color:#fff;
348
+ padding: 4px;
349
+ }
350
+
351
+
352
+ .fm_layout {
353
+ width:99%;
354
+ padding:15px 0;
355
+ }
356
+
357
+ .fm-layout-actions:after {
358
+ clear:both;
359
+ content:'';
360
+ display:block;
361
+ }
362
+
363
+ .fm-layout-content {
364
+ background:#fff;
365
+ padding:10px 10px 20px 10px;
366
+ margin-top:15px;
367
+ }
368
+ /*///////////////
369
+ new end
370
+ //////////////*/
371
+
372
+
373
+
374
+ /* form options */
375
+ .fm-form-options {
376
+ background:#fff;
377
+ padding: 13px;
378
+ }
379
+
380
  .submenu-box {
381
+ width: 100%;
382
+ padding: 15px 0;
 
 
 
383
  }
384
+
385
+ .submenu-pad {
386
+ float:left;
 
387
  }
388
+
389
+ .submenu-box:after {
390
+ display:block;
391
+ content:'';
392
+ clear:both;
393
+ }
394
+
395
  #submenu {
396
+ margin: 0;
397
+ padding: 0;
398
  }
399
+
400
+ #submenu li {
401
+ display: inline;
402
+ margin: 0;
403
+ padding: 0;
404
  }
405
+
406
  #submenu a:hover,
407
  #submenu a.active,
408
  #submenu span.nolink.active {
409
+ background: none repeat scroll 0 0 #FFFFFF;
410
+ border: 1px solid #46ACC3
411
  }
412
+
413
+ #submenu a:focus {
414
+ box-shadow: none !important;
415
+ }
416
+
417
  #submenu li a,
418
  #submenu span.nolink {
419
+ border: 1px solid #F1F1F1;
420
+ color: #444;
421
+ cursor: pointer;
422
+ font-size: 13px;
423
+ font-weight: bold;
424
+ padding: 12px;
425
+ background: #fff;
426
+ text-decoration: none;
427
  }
428
 
429
+
430
+ fieldset.adminform {
431
+ width: 99%;
432
+ margin: 10px 0;
433
  }
434
 
435
+ fieldset.adminform legend {
436
+ color: #444;
437
+ font-weight: bold;
438
+ font-size: 16px;
439
+ padding: 10px 3px;
440
  }
441
 
442
+ .wp-list-table td{
443
+ vertical-align: middle !important;
 
 
 
 
444
  }
445
+
446
+ table.admintable td.key,
447
+ table.admintable td.paramlist_key {
448
+ background-color: #F6F6F6;
449
+ border-bottom: 1px solid #E9E9E9;
450
+ border-right: 1px solid #E9E9E9;
451
+ color: #666666;
452
+ font-weight: bold;
453
+ text-align: right;
454
+ width: 200px;
455
+ }
456
+ table.admintable {
457
+ width: 100%;
458
  }
459
 
460
+ .fm-condition {
461
+ padding:20px 0;
462
+ display:table;
463
+ border-bottom:1px solid #00A0D2;
464
  }
465
 
466
+
467
+
468
+ .fm_fieldset_active {
469
+ display: block;
470
  }
471
+
472
+ .fm_fieldset_deactive {
473
+ display: none;
 
 
474
  }
475
 
476
+ .wrap * {
477
+ font-size: 13px;
 
478
  }
479
 
480
  .add_tag_th {
484
  }
485
 
486
  .pointer{
487
+ cursor: pointer;
 
 
 
 
 
 
 
 
 
488
  }
489
 
490
  .table_small_col {
491
+ text-align: center !important;
492
+ width: 45px;
493
  }
494
 
495
  .table_medium_col {
496
+ text-align: center !important;
497
+ width: 70px;
498
  }
499
 
500
  .table_big_col {
501
+ text-align: center !important;
502
+ width: 80px;
503
  }
504
 
505
  .table_large_col {
506
+ text-align: center !important;
507
+ width: 200px;
508
  }
509
 
510
  .table_large_col input{
511
+ width: 180px;
512
  }
513
 
514
  .table_medium_col_uncenter {
515
+ width: 80px;
516
  }
517
 
518
  .table_extra_large_col {
519
+ padding: 4px !important;
520
+ width: 150px !important;
521
  }
522
 
523
  .first-page,
528
  .table_medium_col a,
529
  .table_big_col a,
530
  .table_small_col a {
531
+ cursor: pointer;
532
  }
533
 
 
 
 
 
 
 
 
 
 
 
534
 
535
  .handle {
536
+ background: url("../images/draggable.png") no-repeat /*scroll 6px 9px*/ transparent;
537
+ border: none;
538
+ height: 15px;
539
+ margin: 0 auto;
540
+ vertical-align: middle;
541
+ width: 15px;
542
  }
543
 
544
  .form_maker_icon {
545
+ background-image: url("../images/formmakerLogo-48.png");
546
+ background-repeat: no-repeat;
547
+ border: none;
548
+ float: left;
549
+ height: 48px;
550
+ margin: 0 8px 0 0;
551
+ width: 48px;
552
  }
553
 
554
  .block_icon {
555
+ background-image: url("../images/block-icon.png");
556
+ background-repeat: no-repeat;
557
+ border: none;
558
+ display:inline-block;
559
+ height: 42px;
560
+ width: 31px;
561
+ vertical-align: middle;
562
  }
563
 
564
  .theme_icon {
565
+ background-image: url("../images/theme-icon.png");
566
+ background-repeat: no-repeat;
567
+ border: none;
568
+ height: 42px;
569
+ width: 42px;
570
+ display: inline-block;
571
+ vertical-align: middle;
572
  }
573
 
574
  .uninstall_icon {
575
+ background-image: url("../images/uninstall-icon.png");
576
+ background-repeat: no-repeat;
577
+ border: none;
578
+ height: 42px;
579
+ width: 37px;
580
+ display: inline-block;
581
+ vertical-align: middle;
582
  }
583
 
584
  .connectedSortable {
585
+ cursor: move;
586
  }
587
 
588
  .fm_label {
589
+ font-weight: bold;
590
+ width: 100px;
 
 
 
 
 
 
591
  }
592
 
593
  .fm_label_options {
600
  width: 80px;
601
  }
602
 
 
 
 
 
603
  .fm_text_input {
604
  width: 190px;
605
  }
606
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
607
  .updated,
608
  .error {
609
  margin: 5px 0 2px !important;
610
  }
611
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
612
  .theme_type {
613
  background-color: #F4F4F4;
614
  border: 1px solid #8F8D8D;
633
  margin: 0 0 4px;
634
  }
635
 
636
+
 
 
637
 
638
  #form_id_tempform_view_img1 td {
639
  padding: 0;
640
  }
641
 
 
 
 
 
 
642
 
643
+ .payment_info_fc {
644
+ width: 72px;
 
 
 
 
 
645
  }
646
 
 
 
 
 
 
 
647
 
 
 
 
 
 
 
 
648
 
 
 
 
649
 
 
 
 
650
 
651
+
652
+
 
 
653
 
654
  .sub-align {
655
  vertical-align: middle !important;
738
  padding: 0;
739
  vertical-align: middle;
740
  }
741
+
742
+
743
+
744
+
745
+
746
+
747
+
748
+
749
+
750
+ button:focus {
751
+ outline:none !important;
752
+ }
753
+
754
+
755
+ .fm-button{
756
+ display: inline-block;
757
+ height: 40px;
758
+ line-height: 38px;
759
+ border-radius: 0px;
760
+ font-size: 15px;
761
+ font-weight: normal;
762
+ padding: 0;
763
+ cursor: pointer;
764
+ text-align: center;
765
+ color: #fff;
766
+ border: none;
767
+ }
768
+
769
+ .fm-button span{
770
+ width: 46px;
771
+ height: 40px;
772
+ display: inline-block;
773
+ background-size: contain;
774
+ background: transparent;
775
+ background-repeat: no-repeat;
776
+ background-position: 0 0;
777
+ border-radius: 0px;
778
+ float: left;
779
+ margin-top: -1px;
780
+ margin-left: -1px;
781
+ }
782
+
783
+ .fm-button.small {
784
+ width: 110px;
785
+ }
786
+
787
+ .fm-button.medium {
788
+ width: 150px;
789
+ }
790
+
791
+ .fm-button.large {
792
+ width: 170px;
793
+ }
794
+
795
+ .fm-button.add-button,
796
+ .fm-button.banner-form-options-button {
797
+ background-color: #4EC0D9;
798
+ border: 1px solid transparent;
799
+ }
800
+
801
+ .fm-button.add-button span{
802
+ background-image: url("../images/add-button.png");
803
+ }
804
+
805
+ .fm-button.banner-form-options-button span{
806
+ background-image: url("../images/banner-form-options-button.png");
807
+ }
808
+
809
+ .fm-icon {
810
+ width:35px;
811
+ height:36px;
812
+ border-radius: 0px;
813
+ cursor: pointer;
814
+ border: none;
815
+ vertical-align: middle;
816
+ }
817
+
818
+ .fm-icon.search-icon{
819
+ background: #DDCC7F url("../images/search-icon.png") no-repeat 50% 50%;
820
+ }
821
+
822
+ .fm-icon.reset-icon{
823
+ background: #C1C1C1 url("../images/reset-icon.png") no-repeat 50% 50%;
824
+ }
825
+
826
+ .fm-icon.edit-icon{
827
+ background: #DDCC7F url("../images/edit-icon.png") no-repeat 50% 50%;
828
+ }
829
+
830
+ .fm-icon.delete-icon{
831
+ background: #E5705D url("../images/delete-icon.png") no-repeat 50% 50%;
832
+ }
833
+
834
+ .fm-icon.show-filter-icon{
835
+ background: #DDCC7F url("../images/show-filter-icon.png") no-repeat 50% 50%;
836
+ }
837
+
838
+ .fm-icon.add-block-ip-icon{
839
+ background: #4EC0D9 url("../images/add-block-ip-icon.png") no-repeat 50% 50%;
840
+ }
841
+
842
+ .fm-button.edit-button span{
843
+ background: #DDCC7F url("../images/edit-button.png") no-repeat 50% 50%;
844
+ }
845
+
846
+ .fm-button.block-button span {
847
+ background: url("../images/block-button.png") no-repeat 50% 50%;
848
+ }
849
+
850
+ .fm-button.unblock-button span {
851
+ background: url("../images/unblock-button.png") no-repeat 50% 50%;
852
+ }
853
+
854
+ .fm-button.delete-button span{
855
+ background:url("../images/delete-button.png") no-repeat 50% 50%;
856
+ }
857
+
858
+ .fm-button.form-layout-button span{
859
+ background:url("../images/form-layout-button.png") no-repeat 50% 50%;
860
+ }
861
+
862
+ .fm-button.form-options-button span{
863
+ background:url("../images/form-options-button.png") no-repeat 50% 50%;
864
+ }
865
+
866
+ .fm-button.undo-button span{
867
+ background:url("../images/undo-button.png") no-repeat 50% 50%;
868
+ }
869
+
870
+ .fm-button.redo-button span{
871
+ background:url("../images/redo-button.png") no-repeat 50% 50%;
872
+ }
873
+
874
+ .fm-button.save-button span{
875
+ background:url("../images/save-button.png") no-repeat 50% 50%;
876
+ }
877
+
878
+ .fm-button.save-as-copy-button span{
879
+ background:url("../images/save-as-copy-button.png") no-repeat 50% 50%;
880
+ }
881
+
882
+ .field-save-button span,
883
+ .fm-button.apply-button span{
884
+ background:url("../images/apply-button.png") no-repeat 50% 50%;
885
+ }
886
+
887
+ .fm-button.cancel-button span{
888
+ background:url("../images/cancel-button.png") no-repeat 50% 50%;
889
+ }
890
+
891
+ .fm-button.options-edit-button span {
892
+ background-image: url("../images/edit-button.png");
893
+ }
894
+
895
+ .fm-button.preview-button span {
896
+ background-image: url("../images/preview-button.png");
897
+ }
898
+
899
+ .fm-page-actions{
900
+ float:right;
901
+ }
902
+
903
+ .fm-page-actions .fm-button,
904
+ .fm-button.field-save-button,
905
+ .fm-button.cancel-button,
906
+ .fm-button.delete-button,
907
+ .fm-button.options-edit-button,
908
+ .fm-button.preview-button{
909
+ background: transparent;
910
+ color: #444;
911
+ border:1px solid #C5C6C7 !important;
912
+ }
913
+
914
+ .fm-page-banner {
915
+ background: #fff;
916
+ display: block;
917
+ height: 90px;
918
+ padding: 15px 10px;
919
+ }
920
+
921
+ .fm-theme-banner{
922
+ background: #fff;
923
+ display: block;
924
+ height: 60px;
925
+ padding: 10px;
926
+ }
927
+
928
+ .fm-theme-banner select{
929
+ height:40px;
930
+ line-height:40px;
931
+ border: 1px solid #919191;
932
+ }
933
+
934
+ .fm-theme-banner button {
935
+ vertical-align: middle;
936
+ }
937
+
938
+ .uninstall-banner {
939
+ background: #fff;
940
+ display: block;
941
+ padding: 15px 10px;
942
+ height: 38px;
943
+ }
944
+
945
+ .uninstall-banner .fm-logo-title{
946
+ width: 200px;
947
+ vertical-align: middle;
948
+ }
949
+
950
+ .blocked-ips-banner,
951
+ .themes-banner{
952
+ line-height: 80px;
953
+ }
954
+
955
+ .fm-clear {
956
+ content: '';
957
+ clear: both;
958
+ display: block;
959
+ }
960
+
961
+ .fm-logo {
962
+ display: inline-block;
963
+ background-image: url("../images/FormCreatorLogo.png");
964
+ background-repeat: no-repeat;
965
+ width: 100px;
966
+ height: 79px;
967
+ vertical-align: bottom;
968
+ margin-top: 10px;
969
+ }
970
+
971
+ .fm-logo-title {
972
+ text-transform: uppercase;
973
+ display: inline-block;
974
+ font-size: 16px;
975
+ vertical-align: middle;
976
+ width: 100px;
977
+ margin-left: 10px;
978
+ line-height: 22px;
979
+ }
980
+
981
+ .tablenav {
982
+ margin:20px 0;
983
+ }
984
+
985
+ .tablenav .fm-alternate {
986
+ background-color: #F1F1F1;
987
+ }
988
+
989
+ .fm-search label{
990
+ font-size:14px;
991
+ width:45px;
992
+ display:inline-block;
993
+ }
994
+
995
+ .fm-search input{
996
+ width: 251px;
997
+ padding: 4px;
998
+ border: 1px solid #919191;
999
+ height: 36px;
1000
+ background: transparent;
1001
+ margin: 0;
1002
+ display: inline-block;
1003
+ vertical-align: middle;
1004
+ font-size:14px;
1005
+ }
1006
+
1007
+ .fm-search input:focus{
1008
+ outline:none;
1009
+ }
1010
+
1011
+ .check-column {
1012
+ width: 2.2em;
1013
+ padding: 8px 10px !important;
1014
+ }
1015
+
1016
+ .fm-checkbox-radio-button {
1017
+ height: 16px;
1018
+ border-radius: 10px;
1019
+ cursor: pointer;
1020
+ text-align: center;
1021
+ padding: 1px;
1022
+ font-size: 12px;
1023
+ line-height: 12px;
1024
+ color: #fff;
1025
+ width:46px;
1026
+ min-width: 46px;
1027
+ position: relative;
1028
+ }
1029
+
1030
+ .fm-checkbox-radio-button span{
1031
+ width: 12px;
1032
+ height: 12px;
1033
+ display: inline-block;
1034
+ background-size: contain;
1035
+ background: #fff;
1036
+ border-radius: 6px;
1037
+ position: absolute;
1038
+ top: 1px;
1039
+ }
1040
+
1041
+ .fm-checkbox-radio-button label{
1042
+ line-height: 13px;
1043
+ margin-right:6px;
1044
+ }
1045
+
1046
+ .fm-checkbox-radio-button.small {
1047
+ width:46px;
1048
+ }
1049
+
1050
+ .fm-checkbox-radio-button.medium {
1051
+ width:60px;
1052
+ }
1053
+
1054
+ .fm-checkbox-radio-button.large {
1055
+ width:98px;
1056
+ }
1057
+
1058
+ .fm-yes{
1059
+ background:#46ACC3 url("../images/radio-yes.png");
1060
+ border: 1px solid #46ACC3;
1061
+ background-repeat: no-repeat;
1062
+ background-position: 35%;
1063
+ }
1064
+
1065
+ .fm-no{
1066
+ background:#A1A1A1;
1067
+ border: 1px solid #A1A1A1;
1068
+ background-repeat: no-repeat;
1069
+ background-position: 35%;
1070
+ }
1071
+
1072
+ .fm-text-yes span,
1073
+ .fm-yes span{
1074
+ right: 0px;
1075
+ }
1076
+
1077
+ .fm-text-no.small span,
1078
+ .fm-no span{
1079
+ right: 32px;
1080
+ }
1081
+
1082
+ .fm-text-no.medium span{
1083
+ right: 46px;
1084
+ }
1085
+
1086
+ .fm-text-no.large span{
1087
+ right: 84px;
1088
+ }
1089
+
1090
+ .fm-text-yes{
1091
+ background:#46ACC3;
1092
+ border: 1px solid #46ACC3;
1093
+ }
1094
+
1095
+ .fm-text-no{
1096
+ background:#A1A1A1;
1097
+ border: 1px solid #A1A1A1;
1098
+ }
1099
+
1100
+ .fm-text-no label{
1101
+ margin-left:12px;
1102
+ }
1103
+
1104
+ .fm-block-ip input[type="text"] {
1105
+ width: 160px;
1106
+ padding: 3px;
1107
+ border: 1px solid #ccc;
1108
+ margin: 0;
1109
+ height: 28px;
1110
+ vertical-align: middle;
1111
+ }
1112
+
1113
+ .fm-submissins-edit table{
1114
+ background:#fff;
1115
+ width:100%;
1116
+ padding:15px;
1117
+ }
1118
+
1119
+ .fm-submissins-edit .fm-key{
1120
+ width:190px;
1121
+ }
1122
+
1123
+ div.error_fm {
1124
+ border-left: 4px solid #dd3d36;
1125
+ }
css/images/catalog.jpg DELETED
Binary file
css/images/contact.maker.jpg DELETED
Binary file
css/images/contacts.jpg DELETED
Binary file
css/images/download.jpg DELETED
Binary file
css/images/facebook.jpg DELETED
Binary file
css/images/faq.jpg DELETED
Binary file
css/images/flash.calendar.jpg DELETED
Binary file
css/images/folder.menu.jpg DELETED
Binary file
css/images/form_make_import.png DELETED
Binary file
css/images/photo-gallery.jpg DELETED
Binary file
css/images/player.jpg DELETED
Binary file
css/images/spider.calendar.jpg DELETED
Binary file
css/images/twitter-widget.jpg DELETED
Binary file
css/images/zoom.jpg DELETED
Binary file
css/notices.css CHANGED
@@ -14,7 +14,6 @@
14
  content: "";
15
  display: block;
16
  background-image: url("../images/FormCreatorLogo.png");
17
- background-size: 108px 107px;
18
  background-repeat: no-repeat;
19
  background-position: 0 45%;
20
  width: 125px;
14
  content: "";
15
  display: block;
16
  background-image: url("../images/FormCreatorLogo.png");
 
17
  background-repeat: no-repeat;
18
  background-position: 0 45%;
19
  width: 125px;
css/style.css CHANGED
@@ -1,53 +1,164 @@
1
- fieldset label {
2
- display: inline !important;
3
- float: none !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  }
5
 
6
- .wdform_row {
7
- display: table-row;
 
 
 
 
8
  }
9
 
10
- .field_buttons {
11
- background-color: #00AAF1;
12
- border-radius: 0px;
13
- cursor: pointer;
14
- height: 75px;
15
- margin: 1px;
16
- padding: 2px;
17
- width: 87px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  }
19
 
20
- #edit_div>table>tr {
21
- vertical-align: top;
 
 
 
 
 
 
 
 
 
 
22
  }
23
 
24
- #edit_div>table>tr>td {
25
- border-bottom: 1px dotted #D1C8C8;
26
- padding-bottom: 10px;
 
 
 
 
 
 
 
27
  }
28
 
29
  .field_buttons:hover {
30
- background-color: #0E83EB;
 
 
 
 
 
31
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  .wdform_tr_section_break {
33
  min-width:480px;
34
  }
 
35
  .element_toolbar {
36
- background-color:#F0F0F0
37
- margin: 0px;
38
- padding: 0px;
39
- display:inline;
40
  }
41
 
42
  .element_toolbar img {
43
- margin: 2px;
44
  }
45
 
46
  .no_spacing {
47
- border-spacing: 0px;
48
- float: left;
49
- padding-right: 10px !important;
50
  }
 
51
  .wdform_arrows_section
52
  {
53
  padding-left: 10px;
@@ -57,54 +168,45 @@ fieldset label {
57
  }
58
  .wdform_arrows
59
  {
60
- vertical-align: middle;
61
- min-width:216px;
62
- background:#D7E3EB;
63
- text-align:right;
64
- margin-bottom:5px;
65
- border-top: 1px solid#B4C8D5;
66
  }
 
67
  .wdform_arrows_show
68
  {
69
  vertical-align: middle;
70
  min-width:216px;
71
- background:#C0D0DB;
72
- text-align:right;
73
  margin-top:-11px;
74
  margin-bottom:5px;
75
  cursor:default !important;
 
 
 
 
 
76
  }
 
77
  .page_toolbar {
78
- width: 33px;
79
  cursor: pointer;
80
- margin: 5px 5px 5px 0;
81
- }
82
- .wdform_star_rating img {
83
- margin:0;
84
- }
85
- .wdform_scale_rating input {
86
- margin:0 2px;
87
- }
88
- .grading input {
89
- float:none;
90
- margin:0 0 2px 0;
91
- }
92
- .wdform_matrix tr td:first-child {
93
- border:none;
94
  }
95
 
96
  .wdform_field_section_break {
97
- min-width: 300px;
98
- display: inline-block;
99
- width: 80%;
100
- }
101
- .wdform_field{
102
  padding-top:10px;
103
  }
104
 
105
- .wdform_field_section_break {
106
  padding-top:10px;
107
  }
 
108
  .wdform_page {
109
  margin:7px;
110
  float:left;
@@ -112,268 +214,233 @@ width: 80%;
112
  .wdform_section {
113
  margin:7px;
114
  }
115
- .wdform_column:first-child {
116
- padding:0 15px 0 0 !important;
117
- }
118
  .wdform_column {
119
- padding-right:50px !important;
120
  float:left;
121
  border-spacing: 1px;
122
  border-collapse:separate !important;
123
- min-width: 250px ;
124
  min-height: 50px;
125
  }
126
- .time_box {
127
- border-width:1px;
128
- margin: 0px;
129
- padding: 0px;
130
- text-align:right;
131
- width:30px;
132
- vertical-align:middle
133
- }
134
- #edit_main_table>tr>td {
135
- vertical-align:top;
136
- padding-top:10px;
137
- }
138
- #edit_main_table>tr>td label {
139
- color:#00aeef;
140
- font-weight:bold;
141
- font-size: 13px;
142
- }
143
- fieldset input, fieldset textarea, fieldset select, fieldset img, fieldset button {
144
- float:none !important;
145
- }
146
 
147
- fieldset select{
148
- height:20px !important;
149
- border-radius: 2px;
150
- }
151
- .multiple_select
152
- {
153
- height:20px !important;
154
  }
155
-
156
- fieldset input{
157
- border-radius: 2px;
158
  }
159
-
160
- .email_labels
161
- {
162
- position: absolute;
163
- background: #fff;
164
- border: solid 1px #c7c7c7;
165
- top: 0;
166
- left: 0;
167
- z-index: 1000;
168
  }
169
-
170
- .email_labels a
171
- {
172
- padding: 5px;
173
- cursor:pointer;
174
  }
175
 
176
- .email_labels a:hover
177
  {
178
- background: #ccc;
179
- }
180
-
181
-
182
- #fadingBarsG{
183
- position:relative;
184
- width:446px;
185
- height:54px;
186
- display: inline-block;
187
- }
188
-
189
- .fadingBarsG{
190
- position:absolute;
191
- top:0;
192
- background-color:#036EF2;
193
- width:54px;
194
- height:54px;
195
- -moz-animation-name:bounce_fadingBarsG;
196
- -moz-animation-duration:1.1s;
197
- -moz-animation-iteration-count:infinite;
198
- -moz-animation-direction:linear;
199
- -moz-transform:scale(.3);
200
- -webkit-animation-name:bounce_fadingBarsG;
201
- -webkit-animation-duration:1.1s;
202
- -webkit-animation-iteration-count:infinite;
203
- -webkit-animation-direction:linear;
204
- -webkit-transform:scale(.3);
205
- -o-animation-name:bounce_fadingBarsG;
206
- -o-animation-duration:1.1s;
207
- -o-animation-iteration-count:infinite;
208
- -o-animation-direction:linear;
209
- -o-transform:scale(.3);
210
- -ms-animation-name:bounce_fadingBarsG;
211
- -ms-animation-duration:1.1s;
212
- -ms-animation-iteration-count:infinite;
213
- -ms-animation-direction:linear;
214
- -ms-transform:scale(.3);
215
- animation-name:bounce_fadingBarsG;
216
- animation-duration:1.1s;
217
- animation-iteration-count:infinite;
218
- animation-direction:linear;
219
- transform:scale(.3);
220
- }
221
-
222
- #fadingBarsG_1{
223
- left:0;
224
- -moz-animation-delay:0.44s;
225
- -webkit-animation-delay:0.44s;
226
- -o-animation-delay:0.44s;
227
- -ms-animation-delay:0.44s;
228
- animation-delay:0.44s;
229
- }
230
-
231
- #fadingBarsG_2{
232
- left:56px;
233
- -moz-animation-delay:0.55s;
234
- -webkit-animation-delay:0.55s;
235
- -o-animation-delay:0.55s;
236
- -ms-animation-delay:0.55s;
237
- animation-delay:0.55s;
238
- }
239
-
240
- #fadingBarsG_3{
241
- left:112px;
242
- -moz-animation-delay:0.66s;
243
- -webkit-animation-delay:0.66s;
244
- -o-animation-delay:0.66s;
245
- -ms-animation-delay:0.66s;
246
- animation-delay:0.66s;
247
- }
248
-
249
- #fadingBarsG_4{
250
- left:167px;
251
- -moz-animation-delay:0.77s;
252
- -webkit-animation-delay:0.77s;
253
- -o-animation-delay:0.77s;
254
- -ms-animation-delay:0.77s;
255
- animation-delay:0.77s;
256
- }
257
-
258
- #fadingBarsG_5{
259
- left:223px;
260
- -moz-animation-delay:0.88s;
261
- -webkit-animation-delay:0.88s;
262
- -o-animation-delay:0.88s;
263
- -ms-animation-delay:0.88s;
264
- animation-delay:0.88s;
265
- }
266
-
267
- #fadingBarsG_6{
268
- left:279px;
269
- -moz-animation-delay:0.99s;
270
- -webkit-animation-delay:0.99s;
271
- -o-animation-delay:0.99s;
272
- -ms-animation-delay:0.99s;
273
- animation-delay:0.99s;
274
  }
275
 
276
- #fadingBarsG_7{
277
- left:335px;
278
- -moz-animation-delay:1.1s;
279
- -webkit-animation-delay:1.1s;
280
- -o-animation-delay:1.1s;
281
- -ms-animation-delay:1.1s;
282
- animation-delay:1.1s;
283
  }
284
 
285
- #fadingBarsG_8{
286
- left:390px;
287
- -moz-animation-delay:1.21s;
288
- -webkit-animation-delay:1.21s;
289
- -o-animation-delay:1.21s;
290
- -ms-animation-delay:1.21s;
291
- animation-delay:1.21s;
292
  }
293
 
294
- @-moz-keyframes bounce_fadingBarsG{
295
- 0%{
296
- -moz-transform:scale(1);
297
- background-color:#036EF2;
 
 
 
 
298
  }
299
 
300
- 100%{
301
- -moz-transform:scale(.3);
302
- background-color:#FFFFFF;
 
303
  }
304
 
305
- }
306
 
307
- @-webkit-keyframes bounce_fadingBarsG{
308
- 0%{
309
- -webkit-transform:scale(1);
310
- background-color:#036EF2;
311
  }
312
-
313
- 100%{
314
- -webkit-transform:scale(.3);
315
- background-color:#FFFFFF;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
316
  }
317
 
 
 
 
 
318
  }
319
 
320
- @-o-keyframes bounce_fadingBarsG{
321
- 0%{
322
- -o-transform:scale(1);
323
- background-color:#036EF2;
324
  }
325
 
326
- 100%{
327
- -o-transform:scale(.3);
328
- background-color:#FFFFFF;
329
  }
330
 
331
- }
 
 
332
 
333
- @-ms-keyframes bounce_fadingBarsG{
334
- 0%{
335
- -ms-transform:scale(1);
336
- background-color:#036EF2;
 
 
 
 
 
 
337
  }
338
 
339
- 100%{
340
- -ms-transform:scale(.3);
341
- background-color:#FFFFFF;
342
  }
343
 
 
 
344
  }
345
 
346
- @keyframes bounce_fadingBarsG{
347
- 0%{
348
- transform:scale(1);
349
- background-color:#036EF2;
 
 
350
  }
351
 
352
- 100%{
353
- transform:scale(.3);
354
- background-color:#FFFFFF;
 
355
  }
356
 
 
 
357
  }
358
 
359
- #saving
360
- {
361
- text-align:center;
362
  }
363
-
364
- #saving_text{
365
- font-size: 55px;
366
- color: #036EF2;
367
- line-height: initial;
 
368
  }
369
 
370
- .highlight
371
- {
372
- border: 1px dotted red !important;
373
- visibility: visible !important;
374
- height: 80px !important;
375
- width: 100% !important;
376
- display:inline-block
377
  }
378
 
379
  .fm_modal {
@@ -387,7 +454,6 @@ display:inline-block
387
  background: rgba( 255, 255, 255, .8 );
388
  }
389
 
390
-
391
  .ui-progressbar {
392
  position: relative;
393
  }
@@ -414,4 +480,16 @@ display:inline-block
414
  position: absolute;
415
  left: 46%;
416
  top: 4px;
417
- }
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*///////////////
2
+ new
3
+ //////////////*/
4
+ input[disabled],
5
+ select[disabled],
6
+ textarea[disabled],
7
+ input[readonly],
8
+ select[readonly],
9
+ textarea[readonly] {
10
+ cursor: not-allowed;
11
+ background-color: #eee;
12
+ }
13
+
14
+ #edit_table {
15
+ padding:0px;
16
+ overflow-y:scroll;
17
+ height:575px;
18
+ }
19
+
20
+ #edit_table .fm-label {
21
+ color:#000;
22
+ font-weight:bold;
23
+ font-size: 13px;
24
  }
25
 
26
+ #edit_div {
27
+ border-top: 1px solid #E5E5E5;
28
+ padding: 10px;
29
+ padding-top: 2px;
30
+ padding-bottom: 0px;
31
+ margin-top: 10px;
32
  }
33
 
34
+ #edit_div input[type="text"]:disabled{
35
+ opacity:0.5;
36
+ }
37
+
38
+ #edit_main_table tr {
39
+ vertical-align: middle;
40
+ }
41
+
42
+ #edit_main_table > tr > td {
43
+ border-bottom: 1px solid #E6E4E4;
44
+ padding: 6px 0;
45
+ }
46
+
47
+ #edit_main_table input[type="text"],
48
+ #edit_main_table textarea,
49
+ #edit_main_table select {
50
+ font-style: italic;
51
+ border: 0;
52
+ background: #F1F1F1;
53
+ box-shadow: none;
54
+ border-radius: 0;
55
+ }
56
+
57
+ #edit_main_table input[type="text"] {
58
+ display: inline-block;
59
+ width: 200px;
60
+ padding: 4px 6px;
61
+ font-size: 13px;
62
+ line-height: 18px;
63
+ color: #555;
64
+ vertical-align: middle;
65
+ }
66
+
67
+ #edit_main_table textarea {
68
+ width: 200px;
69
+ font-size: 13px;
70
+ color: #555;
71
  }
72
 
73
+ #edit_main_table img {
74
+ vertical-align: middle;
75
+ }
76
+
77
+ #edit_main_table label {
78
+ line-height: 19px;
79
+ }
80
+
81
+ #sel_el_pos {
82
+ width: 100px;
83
+ padding:4px 6px;
84
+ margin-bottom:9px;
85
  }
86
 
87
+ .field_buttons {
88
+ background: #F2F2F2;
89
+ margin: 1px;
90
+ border-radius: 2px;
91
+ padding: 5px;
92
+ height: 60px;
93
+ width: 87px;
94
+ cursor: pointer;
95
+ font-size: 12px;
96
+ border: 1px solid #CCCCCC;
97
  }
98
 
99
  .field_buttons:hover {
100
+ background: #E3E3E3;
101
+ }
102
+
103
+ .field_disabled {
104
+ cursor: pointer;
105
+ background: #D0D0D0;
106
  }
107
+
108
+ .field_disabled:hover {
109
+ background: #D0D0D0;
110
+ }
111
+
112
+ .fm-field-label {
113
+ color: #000000;
114
+ font-weight: bold;
115
+ font-size: 13px;
116
+ margin-right: 20px;
117
+ }
118
+
119
+ .fm-field-choice {
120
+ width: 100px !important;
121
+ margin: 1px !important;
122
+ }
123
+
124
+ .fm-field-paypal-choice{
125
+ width: 50px !important;
126
+ margin: 1px !important;
127
+ }
128
+
129
+ .fm-field-recaptcha-label{
130
+ color:#BA0D0D;
131
+ font-weight:bold;
132
+ font-size: 13px;
133
+ text-decoration:underline
134
+
135
+ }
136
+
137
+ .fm-editable-label {
138
+ margin-left:4px;
139
+ color:red;
140
+ font-style:italic;
141
+ }
142
+
143
+
144
  .wdform_tr_section_break {
145
  min-width:480px;
146
  }
147
+
148
  .element_toolbar {
149
+ display:inline;
 
 
 
150
  }
151
 
152
  .element_toolbar img {
153
+ margin: 2px;
154
  }
155
 
156
  .no_spacing {
157
+ //border-spacing: 0px;
158
+ //float: left;
159
+ //padding-right: 10px !important;
160
  }
161
+
162
  .wdform_arrows_section
163
  {
164
  padding-left: 10px;
168
  }
169
  .wdform_arrows
170
  {
171
+ vertical-align: middle;
172
+ min-width: 216px;
173
+ background: #F5F5F5;
174
+ margin-bottom: 5px;
175
+ border-top: 1px solid #E6E6E6;
 
176
  }
177
+
178
  .wdform_arrows_show
179
  {
180
  vertical-align: middle;
181
  min-width:216px;
182
+ background:#F5F5F5;
183
+ text-align:left;
184
  margin-top:-11px;
185
  margin-bottom:5px;
186
  cursor:default !important;
187
+ border-top: 1px solid #E6E6E6;
188
+ }
189
+
190
+ .wdform_arrows img {
191
+ cursor: pointer;
192
  }
193
+
194
  .page_toolbar {
 
195
  cursor: pointer;
196
+ margin: 5px 5px 5px 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  }
198
 
199
  .wdform_field_section_break {
200
+ min-width: 300px;
201
+ display: inline-block;
202
+ width: 80%;
 
 
203
  padding-top:10px;
204
  }
205
 
206
+ .wdform_field{
207
  padding-top:10px;
208
  }
209
+
210
  .wdform_page {
211
  margin:7px;
212
  float:left;
214
  .wdform_section {
215
  margin:7px;
216
  }
217
+
 
 
218
  .wdform_column {
219
+ padding:0 15px 10px 0 !important;
220
  float:left;
221
  border-spacing: 1px;
222
  border-collapse:separate !important;
223
+ min-width: 250px ;
224
  min-height: 50px;
225
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
 
227
+ .wdform_star_rating img {
228
+ margin:0;
 
 
 
 
 
229
  }
230
+ .wdform_scale_rating input {
231
+ margin:0 2px;
 
232
  }
233
+ .grading input {
234
+ float:none;
235
+ margin:0 0 2px 0;
 
 
 
 
 
 
236
  }
237
+ .wdform_matrix tr td:first-child {
238
+ border:none;
 
 
 
239
  }
240
 
241
+ .email_labels
242
  {
243
+ position: absolute;
244
+ background: #fff;
245
+ border: solid 1px #c7c7c7;
246
+ top: 0;
247
+ left: 0;
248
+ z-index: 1000;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
249
  }
250
 
251
+ .email_labels a {
252
+ padding: 5px;
253
+ cursor:pointer;
 
 
 
 
254
  }
255
 
256
+ .email_labels a:hover {
257
+ background: #ccc;
 
 
 
 
 
258
  }
259
 
260
+ .highlight
261
+ {
262
+ border: 2px dashed #DDCC7F !important;
263
+ visibility: visible !important;
264
+ height: 80px !important;
265
+ width: 100% !important;
266
+ display:inline-block ;
267
+ background:transparent;
268
  }
269
 
270
+ .wdform-page-button,
271
+ .page_numbersform_id_temp {
272
+ border: 1px solid #B3B3B3;
273
+ padding: 2px 15px;
274
  }
275
 
 
276
 
277
+ .fm-loading-container{
278
+ position:relative;
 
 
279
  }
280
+
281
+ .fm-loading-content,
282
+ .fm-loading-content::before,
283
+ .fm-loading-content::after {
284
+ z-index: 1000;
285
+ position: fixed;
286
+ top: 50%;
287
+ left: 50%;
288
+ border: 1px solid rgb(204,204,204);
289
+ border-left-color: rgb(0,0,0);
290
+ border-radius: 974px;
291
+ -o-border-radius: 974px;
292
+ -ms-border-radius: 974px;
293
+ -webkit-border-radius: 974px;
294
+ -moz-border-radius: 974px;
295
+ }
296
+
297
+ .fm-loading-content {
298
+ // margin: 20% 0;
299
+ height: 49px;
300
+ width: 49px;
301
+ animation: fm-loading-rotate 1150ms linear infinite;
302
+ -o-animation: fm-loading-rotate 1150ms linear infinite;
303
+ -ms-animation: fm-loading-rotate 1150ms linear infinite;
304
+ -webkit-animation: fm-loading-rotate 1150ms linear infinite;
305
+ -moz-animation: fm-loading-rotate 1150ms linear infinite;
306
+ }
307
+
308
+ .fm-loading-content::before {
309
+ content: "";
310
+ margin: -22px 0 0 -22px;
311
+ height: 43px;
312
+ width: 43px;
313
+ animation: fm-loading-rotate 1150ms linear infinite;
314
+ -o-animation: fm-loading-rotate 1150ms linear infinite;
315
+ -ms-animation: fm-loading-rotate 1150ms linear infinite;
316
+ -webkit-animation: fm-loading-rotate 1150ms linear infinite;
317
+ -moz-animation: fm-loading-rotate 1150ms linear infinite;
318
+ }
319
+
320
+ .fm-loading-content::after {
321
+ content: "";
322
+ margin: -28px 0 0 -28px;
323
+ height: 55px;
324
+ width: 55px;
325
+ animation: fm-loading-rotate 2300ms linear infinite;
326
+ -o-animation: fm-loading-rotate 2300ms linear infinite;
327
+ -ms-animation: fm-loading-rotate 2300ms linear infinite;
328
+ -webkit-animation: fm-loading-rotate 2300ms linear infinite;
329
+ -moz-animation: fm-loading-rotate 2300ms linear infinite;
330
+ }
331
+
332
+
333
+ @keyframes fm-loading-rotate {
334
+ 100% {
335
+ transform: rotate(360deg);
336
+ }
337
+ }
338
+
339
+ @-o-keyframes fm-loading-rotate {
340
+ 100% {
341
+ -o-transform: rotate(360deg);
342
+ }
343
+ }
344
+
345
+ @-ms-keyframes fm-loading-rotate {
346
+ 100% {
347
+ -ms-transform: rotate(360deg);
348
+ }
349
+ }
350
+
351
+ @-webkit-keyframes fm-loading-rotate {
352
+ 100% {
353
+ -webkit-transform: rotate(360deg);
354
+ }
355
+ }
356
+
357
+ @-moz-keyframes fm-loading-rotate {
358
+ 100% {
359
+ -moz-transform: rotate(360deg);
360
+ }
361
+ }
362
+
363
+ .fm-user-manual{
364
+ font-size: 14px;
365
+ font-weight: bold;
366
+ font-style:italic;
367
+ margin:20px 0;
368
+ float:left;
369
  }
370
 
371
+ .fm-upgrade-pro {
372
+ float: right;
373
+ text-align: right;
374
+ margin:10px 10px 0 0;
375
  }
376
 
377
+ .fm-upgrade-pro a {
378
+ color: blue;
379
+ text-decoration: none;
380
+ box-shadow:none !important;
381
  }
382
 
383
+ .fm-title {
384
+ margin: 10px 0;
 
385
  }
386
 
387
+ .fm-title span{
388
+ font-size:16px;
389
+ }
390
 
391
+ .fm-title input{
392
+ width: 261px;
393
+ padding: 4px;
394
+ border: 1px solid #919191;
395
+ height: 36px;
396
+ background: transparent;
397
+ margin: 0;
398
+ display: inline-block;
399
+ vertical-align: middle;
400
+ font-size:14px;
401
  }
402
 
403
+ input:focus{
404
+ outline: none !important;
 
405
  }
406
 
407
+ .fm-page-header {
408
+ padding: 0 0 20px 0;
409
  }
410
 
411
+ .fm-page-title {
412
+ width: 310px;
413
+ font-size: 24px;
414
+ line-height: 24px;
415
+ color: #444;
416
+ float: left;
417
  }
418
 
419
+ .fm-edit-content {
420
+ background:#fff;
421
+ margin: 20px 0;
422
+ padding: 15px 10px;
423
  }
424
 
425
+ .fm-drag-and-drop {
426
+ margin-bottom: 10px;
427
  }
428
 
429
+ .fm-drag-and-drop div{
430
+ padding: 5px 0;
431
+ font-style:italic;
432
  }
433
+
434
+ .fm-drag-and-drop label {
435
+ font-size: 15px;
436
+ font-weight: bold;
437
+ vertical-align: top;
438
+ margin-right: 10px;
439
  }
440
 
441
+ fieldset label {
442
+ display: inline !important;
443
+ float: none !important;
 
 
 
 
444
  }
445
 
446
  .fm_modal {
454
  background: rgba( 255, 255, 255, .8 );
455
  }
456
 
 
457
  .ui-progressbar {
458
  position: relative;
459
  }
480
  position: absolute;
481
  left: 46%;
482
  top: 4px;
483
+ }
484
+
485
+ .export_progress {
486
+ position: fixed;
487
+ z-index: 1003;
488
+ height: 100%;
489
+ width: 100%;
490
+ top: 56%;
491
+ left: 45%;
492
+ font-size:15px;
493
+ color:#000;
494
+ display:none;
495
+ }
css/style_submissions.css ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .form_title {
2
+ padding:10px 0 20px 0;
3
+ font-size:20px;
4
+ }
5
+ .stats tr {
6
+ border: none !important;
7
+ }
8
+ .stats td {
9
+ border: none !important;
10
+ padding: 5px 3px;
11
+ }
12
+ .submission_params .reports {
13
+ display:inline-block;
14
+ border: 1px solid #A7A7A7 !important;
15
+ text-align: center;
16
+ border-radius: 8px;
17
+ padding: 4px 2px;
18
+ }
19
+ .submission_params .csv_xml {
20
+ width: 100%;
21
+ margin-top: -26px;
22
+ text-align:right;
23
+ }
24
+ .search_and_pagination {
25
+ margin-top:20px;
26
+ }
27
+ .submissions {
28
+ margin-top:20px;
29
+ border-top:1px solid #ccc !important;
30
+ }
31
+ .submissions th {
32
+ padding: 3px;
33
+ text-align: center;
34
+ }
35
+ .submissions tr, .submissions tr table tr {
36
+ border:none !important;
37
+ }
38
+ .submissions tbody tr {
39
+ border-bottom: solid 1px #ddd !important;
40
+ }
41
+ .submissions td {
42
+ padding: 10px 4px;
43
+ border:none !important;
44
+ }
45
+ .submissions tr.row1 {
46
+ background-color: #f0f0ee !important;
47
+ }
48
+ .submissions .simple_table td {
49
+ padding: 0px !important;
50
+ }
51
+ .submissions a {
52
+ color:#000 !important;
53
+ font-weight:bold;
54
+ text-decoration:none;
55
+ }
56
+ .submissions a:hover {
57
+ background:transparent !important;
58
+ }
59
+ .submissions a img {
60
+ margin-left: 2px;
61
+ }
62
+ .submissions input:focus, .stats .inputbox:focus {
63
+ border: 1px solid #A9A9A9 !important;
64
+ outline: none !important;
65
+ padding: 1px;
66
+ }
67
+
68
+ .submissions .inputbox:focus {
69
+ border: 1px solid #A9A9A9 !important;
70
+ outline: none;
71
+ }
72
+ .csv_xml input, .stats input[type="button"], .submission_params input[type="button"], .csv_xml input:hover, .stats input[type="button"]:hover, .csv_xml input:active, .stats input[type="button"]:active , .submissions .button, .submissions .button:hover, .submissions .button:active, .stats .button, .stats .button:hover, .stats .button:active {
73
+ padding: 4px !important;
74
+ background: transparent !important;
75
+ border: 1px solid #A7A7A7 !important;
76
+ border-radius: 2px !important;
77
+ box-shadow: 1px 1px 1px #E7E7E7 !important;
78
+ color: black !important;
79
+ }
80
+ .csv_xml input:hover, .stats input[type="button"]:hover {
81
+ cursor: pointer;
82
+ }
83
+ .payment_info_fc {
84
+ width: 72px;
85
+ }
86
+ .pagination_td ul {
87
+ list-style-type:none !important;
88
+ }
89
+ .pagination_td li {
90
+ display:inline-block;
91
+ }
92
+ .tablenav .tablenav-pages {
93
+ float: right;
94
+ display: block;
95
+ cursor: default;
96
+ height: 30px;
97
+ color: #555;
98
+ line-height: 30px;
99
+ font-size: 12px;
100
+ }
101
+ .tablenav .displaying-num {
102
+ margin-right: 2px;
103
+ color: #777;
104
+ font-size: 12px;
105
+ font-style: italic;
106
+ }
107
+ .tablenav .tablenav-pages a.disabled,
108
+ .tablenav .tablenav-pages a.disabled:active,
109
+ .tablenav .tablenav-pages a.disabled:focus,
110
+ .tablenav .tablenav-pages a.disabled:hover {
111
+ color: #aaa;
112
+ background: #eee;
113
+ background: rgba(0,0,0,.05);
114
+ }
115
+ .tablenav .tablenav-pages a {
116
+ padding: 0 10px 3px;
117
+ background: #eee;
118
+ background: rgba(0,0,0,.05);
119
+ font-size: 16px;
120
+ font-weight: 400;
121
+ }
122
+ .tablenav {
123
+ clear: both;
124
+ height: 30px;
125
+ margin: 6px 0 4px;
126
+ vertical-align: middle;
127
+ }
128
+ .inputbox {
129
+ padding: 0;
130
+ border: 1px solid #d4d0ba;
131
+ border-radius: 3px;
132
+ }
133
+ .submissions pre {
134
+ background: transparent;
135
+ }
featured/admin.css CHANGED
@@ -730,4 +730,8 @@ span.fm_error{
730
  border-bottom: 0;
731
  padding-bottom: 0;
732
  margin-bottom: 0;
 
 
 
 
733
  }
730
  border-bottom: 0;
731
  padding-bottom: 0;
732
  margin-bottom: 0;
733
+ }
734
+
735
+ .fm_more_updates {
736
+ display: none;
737
  }
featured/featured.php CHANGED
@@ -191,7 +191,7 @@ function fm_featured_page($current_plugin = '') {
191
  function fm_extensions_page($current_plugin = '') {
192
 
193
  $addons = array(
194
- 'Attention: Add-ons are supported by premium version of Form Maker' => array(
195
  'imp_exp' => array(
196
  'name' => 'Import/Export',
197
  'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/export-import.html',
@@ -225,21 +225,21 @@ function fm_extensions_page($current_plugin = '') {
225
  'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/conditional-emails.html',
226
  'description' => 'Conditional Emails add-on allows to send emails to different recipients depending on the submitted data .',
227
  'icon' => '',
228
- 'image' => plugins_url( '../assets/conditional-emalis-update.png', __FILE__ ),
229
  ),
230
  'dropbox_integration' => array(
231
- 'name' => 'Dropbox Integration',
232
- 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/dropbox.html',
233
- 'description' => 'The Form Maker Dropbox Integration addon is extending the Form Maker capabilities allowing to store the form attachments straight to your Dropbox account.',
234
- 'icon' => '',
235
- 'image' => plugins_url( '../assets/dropbox-integration-update.png', __FILE__ ),
236
  ),
237
  'gdrive_integration' => array(
238
- 'name' => 'Google Drive Integration',
239
- 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/google-drive.html',
240
- 'description' => 'The Google Drive Integration add-on integrates Form Maker with Google Drive and allows you to send the file uploads to the Google Drive.',
241
- 'icon' => '',
242
- 'image' => plugins_url( '../assets/google_drive_integration.png', __FILE__ ),
243
  ),
244
  'pdf_integration' => array(
245
  'name' => 'PDF Integration',
@@ -265,7 +265,7 @@ function fm_extensions_page($current_plugin = '') {
265
  foreach ($addons as $name=>$cat) {
266
  ?>
267
 
268
- <div style="clear: both; margin-top: 15px; "> <h3 class="fm-addon-subtitle" style="color:red"><?php echo $name?> </h3></div>
269
  <?php
270
  foreach ( $cat as $addon ) {
271
  ?>
191
  function fm_extensions_page($current_plugin = '') {
192
 
193
  $addons = array(
194
+ 'Form Maker Add-ons' => array(
195
  'imp_exp' => array(
196
  'name' => 'Import/Export',
197
  'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/export-import.html',
225
  'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/conditional-emails.html',
226
  'description' => 'Conditional Emails add-on allows to send emails to different recipients depending on the submitted data .',
227
  'icon' => '',
228
+ 'image' => plugins_url( '../assets/conditional-emails-update.png', __FILE__ ),
229
  ),
230
  'dropbox_integration' => array(
231
+ 'name' => 'Dropbox Integration',
232
+ 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/dropbox.html',
233
+ 'description' => 'The Form Maker Dropbox Integration addon is extending the Form Maker capabilities allowing to store the form attachments straight to your Dropbox account.',
234
+ 'icon' => '',
235
+ 'image' => plugins_url( '../assets/dropbox-integration-update.png', __FILE__ ),
236
  ),
237
  'gdrive_integration' => array(
238
+ 'name' => 'Google Drive Integration',
239
+ 'url' => 'https://web-dorado.com/products/wordpress-form/add-ons/google-drive.html',
240
+ 'description' => 'The Google Drive Integration add-on integrates Form Maker with Google Drive and allows you to send the file uploads to the Google Drive',
241
+ 'icon' => '',
242
+ 'image' => plugins_url( '../assets/google_drive_integration.png', __FILE__ ),
243
  ),
244
  'pdf_integration' => array(
245
  'name' => 'PDF Integration',
265
  foreach ($addons as $name=>$cat) {
266
  ?>
267
 
268
+ <!-- <div style="clear: both; margin-top: 15px;"> <h3 class="fm-addon-subtitle"><?php echo $name?> </h3></div> -->
269
  <?php
270
  foreach ( $cat as $addon ) {
271
  ?>
featured/images/Add_Ons.jpg ADDED
Binary file
featured/images/catalog.jpg DELETED
Binary file
featured/images/contact-form-builder.jpg DELETED
Binary file
featured/images/contact-form-maker.jpg DELETED
Binary file
featured/images/contacts.jpg DELETED
Binary file
featured/images/facebook.jpg DELETED
Binary file
featured/images/faq.jpg DELETED
Binary file
featured/images/flash.calendar.jpg DELETED
Binary file
featured/images/fm.import.jpg DELETED
Binary file
featured/images/folder.menu.jpg DELETED
Binary file
featured/images/form.jpg DELETED
Binary file
featured/images/photo-gallery.jpg DELETED
Binary file
featured/images/player.jpg DELETED
Binary file
featured/images/slider.jpg DELETED
Binary file
featured/images/spider-calendar.jpg DELETED
Binary file
featured/images/twitter-widget.jpg DELETED
Binary file
featured/images/zoom.jpg DELETED
Binary file
featured/updates.php ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Admin page
5
+ */
6
+
7
+ // Exit if accessed directly.
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit;
10
+ }
11
+
12
+ $upd = FM_Admin::get_instance();
13
+ $upd->check_for_update();
14
+ $fm_plugins=$upd->fm_plugins;
15
+ $updates=$upd->updates;
16
+ ?>
17
+ <link href="<?php echo plugins_url( 'admin.css', __FILE__ )?>" rel="stylesheet"/>
18
+
19
+ <div class="wrap">
20
+ <?php settings_errors(); ?>
21
+ <div id="fm-settings">
22
+ <div id="fm-settings-content">
23
+ <h2 id="add_on_title"><?php echo esc_html( get_admin_page_title() ); ?></h2>
24
+
25
+
26
+ <div class="main-plugin_desc-cont">
27
+ You can download the latest version of your plugins from your <a href="https://web-dorado.com" target="_blank"> Web-Dorado.com</a> account.
28
+ After deactivate and
29
+ delete the current version.
30
+ Install the downloaded latest version of the plugin.
31
+ </div>
32
+
33
+ <br/>
34
+ <br/>
35
+
36
+ <?php
37
+ if ( $fm_plugins ) {
38
+ $update = 0;
39
+ if ( isset( $fm_plugins[31] ) ) {
40
+
41
+ $project = $fm_plugins[31];
42
+ unset( $fm_plugins[31] );
43
+ if ( isset( $updates[31] ) ) {
44
+ $update = 1;
45
+ }
46
+ ?>
47
+ <div class="main-plugin">
48
+ <div class="fm-add-on">
49
+ <?php if ( $project['fm_data']['image'] ) { ?>
50
+ <div class="fm-figure-img">
51
+ <a href="<?php echo $project['fm_data']['url'] ?>" target="_blank">
52
+ <img src="<?php echo $project['fm_data']['image'] ?>"/>
53
+ </a>
54
+ </div>
55
+ <?php } ?>
56
+
57
+ </div>
58
+ <div class="main-plugin-info">
59
+ <h2>
60
+ <a href="<?php echo $project['fm_data']['url'] ?>" target="_blank"><?php echo $project['Title'] ?></a>
61
+ </h2>
62
+ <div class="main-plugin_desc-cont">
63
+ <div class="main-plugin-desc"><?php echo $project['fm_data']['description'] ?></div>
64
+ <div class="main-plugin-desc main-plugin-desc-info">
65
+ <p><a href="<?php echo $project['fm_data']['url'] ?>" target="_blank">Version <?php echo $project['Version']?></a></p>
66
+ </div>
67
+
68
+ <?php if ( isset( $updates[31][0] ) ) { ?>
69
+ <span class="update-info">There is a new <?php echo $updates[31][0]['version'] ?> version available.</span>
70
+ <p><span>What's new:</span></p>
71
+ <div class="fm_last_update"><?php echo $updates[31][0]['version'] ?>
72
+ - <?php echo strip_tags( $updates[31][0]['note'] ) ?></div>
73
+ <?php unset( $updates[31][0] ); ?>
74
+ <?php if ( count( $updates[31] ) > 0 ) { ?>
75
+
76
+ <div class="fm_more_updates">
77
+ <?php foreach ( $updates[31] as $update ) {
78
+ ?>
79
+ <div class="fm_update"><?php echo $update['version'] ?>
80
+ - <?php echo strip_tags( $update['note'] ) ?></div>
81
+ <?php
82
+ }
83
+ ?>
84
+ </div>
85
+ <a href="#" class="fm_show_more_updates">More updates</a>
86
+ <?php
87
+ }
88
+ } ?>
89
+
90
+
91
+
92
+
93
+
94
+ </div>
95
+ </div>
96
+ </div>
97
+ <?php
98
+ }?>
99
+ <div class="fm-addons_updates">
100
+ <?php
101
+ foreach ( $fm_plugins as $id => $project ) {
102
+ ?>
103
+ <div class="fm-add-on">
104
+ <figure class="fm-figure">
105
+ <div class="fm-figure-img">
106
+ <a href="<?php echo $project['fm_data']['url'] ?>" target="_blank">
107
+ <?php if ( $project['fm_data']['image'] ) { ?>
108
+ <img src="<?php echo $project['fm_data']['image'] ?>"/>
109
+ <?php } ?>
110
+ </a>
111
+ </div>
112
+ <figcaption class="fm-addon-descr fm-figcaption">
113
+ <?php if ( isset( $updates[ $id ][0] ) ) { ?>
114
+ <p>What's new:</p>
115
+ <?php echo strip_tags( $updates[ $id ][0]['note'] ) ?>
116
+ <?php } else { ?><?php echo $project['Title'] ?> is up to date
117
+ <?php } ?>
118
+ </figcaption>
119
+ </figure>
120
+ <h2><?php echo $project['Title'] ?></h2>
121
+ <div class="main-plugin-desc-info">
122
+ <p><a href="<?php echo $project['fm_data']['url'] ?>"
123
+ target="_blank"><?php echo $project['Version'] ?></a> | Web-Dorado</p>
124
+ </div>
125
+ <?php if ( isset( $updates[ $id ] ) ) { ?>
126
+ <div class="fm-addon-descr-update">
127
+ <span
128
+ class="update-info">There is an new <?php echo $updates[ $id ][0]['version'] ?>
129
+ version</span><br/>
130
+ </div>
131
+ <?php } ?>
132
+ </div>
133
+
134
+ <?php
135
+ }?>
136
+ </div>
137
+ <?php
138
+ }
139
+ ?>
140
+
141
+ </div>
142
+ <!-- #fm-settings-content -->
143
+ </div>
144
+ <!-- #fm-settings -->
145
+ </div><!-- .wrap -->
146
+
147
+ <script>
148
+ jQuery('.fm_show_more_updates').click(function(){
149
+ if( jQuery('.fm_more_updates').is(':visible') == false) {
150
+ jQuery(this).text('Show less');
151
+ }else{
152
+ jQuery(this).text('More updates');
153
+ }
154
+ jQuery('.fm_more_updates').slideToggle();
155
+ return false;
156
+ });
157
+
158
+ </script>
form-maker.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Form Maker
4
  * Plugin URI: https://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.97
7
  * Author: WebDorado
8
  * Author URI: https://web-dorado.com/
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -32,7 +32,7 @@ function form_maker_options_panel() {
32
  add_action('admin_print_styles-' . $themes_page, 'form_maker_manage_styles');
33
  add_action('admin_print_scripts-' . $themes_page, 'form_maker_manage_scripts');
34
 
35
- $licensing_plugins_page = add_submenu_page('manage_fm', 'Licensing/Donation', 'Licensing/Donation', 'manage_options', 'licensing_fm', 'form_maker');
36
 
37
  add_submenu_page('manage_fm', 'Featured Plugins', 'Featured Plugins', 'manage_options', 'featured_plugins_fm', 'fm_featured');
38
  add_submenu_page('manage_fm', 'Featured Themes', 'Featured Themes', 'manage_options', 'featured_themes_fm', 'fm_featured_themes');
@@ -269,7 +269,7 @@ function register_fmemailverification_cpt(){
269
  // Activate plugin.
270
  function form_maker_activate() {
271
  $version = get_option("wd_form_maker_version");
272
- $new_version = '1.7.97';
273
  global $wpdb;
274
  if (!$version) {
275
  add_option("wd_form_maker_version", $new_version, '', 'no');
3
  * Plugin Name: Form Maker
4
  * Plugin URI: https://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.8.0
7
  * Author: WebDorado
8
  * Author URI: https://web-dorado.com/
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
32
  add_action('admin_print_styles-' . $themes_page, 'form_maker_manage_styles');
33
  add_action('admin_print_scripts-' . $themes_page, 'form_maker_manage_scripts');
34
 
35
+ $licensing_plugins_page = add_submenu_page('manage_fm', 'Pro Version', 'Pro Version', 'manage_options', 'licensing_fm', 'form_maker');
36
 
37
  add_submenu_page('manage_fm', 'Featured Plugins', 'Featured Plugins', 'manage_options', 'featured_plugins_fm', 'fm_featured');
38
  add_submenu_page('manage_fm', 'Featured Themes', 'Featured Themes', 'manage_options', 'featured_themes_fm', 'fm_featured_themes');
269
  // Activate plugin.
270
  function form_maker_activate() {
271
  $version = get_option("wd_form_maker_version");
272
+ $new_version = '1.8.0';
273
  global $wpdb;
274
  if (!$version) {
275
  add_option("wd_form_maker_version", $new_version, '', 'no');
form_maker_notices_class.php CHANGED
@@ -31,6 +31,7 @@ class FM_Notices {
31
  // Runs the admin notice temp ignore function incase a temp dismiss link has been clicked
32
  add_action( 'admin_init', array( $this, 'admin_notice_temp_ignore' ) );
33
  add_action('admin_notices', array($this, 'wd_admin_notices'));
 
34
  }
35
 
36
  // Checks to ensure notices aren't disabled and the user has the correct permissions.
@@ -103,7 +104,6 @@ class FM_Notices {
103
  // Get remaining query string
104
  $query_str = (isset($admin_notices[$slug]['later_link']) ? $admin_notices[$slug]['later_link'] : esc_url(add_query_arg('fm_admin_notice_ignore', $slug)));
105
 
106
-
107
  // Admin notice display output
108
  echo '<div class="update-nag fm-admin-notice">';
109
  echo '<div class="fm-notice-logo"></div>';
31
  // Runs the admin notice temp ignore function incase a temp dismiss link has been clicked
32
  add_action( 'admin_init', array( $this, 'admin_notice_temp_ignore' ) );
33
  add_action('admin_notices', array($this, 'wd_admin_notices'));
34
+
35
  }
36
 
37
  // Checks to ensure notices aren't disabled and the user has the correct permissions.
104
  // Get remaining query string
105
  $query_str = (isset($admin_notices[$slug]['later_link']) ? $admin_notices[$slug]['later_link'] : esc_url(add_query_arg('fm_admin_notice_ignore', $slug)));
106
 
 
107
  // Admin notice display output
108
  echo '<div class="update-nag fm-admin-notice">';
109
  echo '<div class="fm-notice-logo"></div>';
framework/WDW_FM_Library.php CHANGED
@@ -102,31 +102,31 @@ class WDW_FM_Library {
102
  public static function search($search_by, $search_value, $form_id) {
103
  ?>
104
  <div class="alignleft actions" style="clear:both;">
105
- <script>
106
- function fm_search() {
107
- document.getElementById("page_number").value = "1";
108
- document.getElementById("search_or_not").value = "search";
109
- document.getElementById("<?php echo $form_id; ?>").submit();
110
- }
111
- function fm_reset() {
112
- if (document.getElementById("search_value")) {
113
- document.getElementById("search_value").value = "";
114
- }
115
- if (document.getElementById("search_select_value")) {
116
- document.getElementById("search_select_value").value = 0;
117
- }
118
- document.getElementById("<?php echo $form_id; ?>").submit();
119
- }
120
- </script>
121
- <div class="alignleft actions" style="">
122
- <label for="search_value" style="font-size:14px; width:50px; display:inline-block;"><?php echo $search_by; ?>:</label>
123
- <input type="text" id="search_value" name="search_value" class="fm_search_value" value="<?php echo esc_html($search_value); ?>" style="width: 150px;<?php echo (get_bloginfo('version') > '3.7') ? ' height: 28px;' : ''; ?>" />
124
- </div>
125
- <div class="alignleft actions">
126
- <input type="button" value="Search" onclick="fm_search()" class="button-secondary action">
127
- <input type="button" value="Reset" onclick="fm_reset()" class="button-secondary action">
128
- </div>
129
- </div>
130
  <?php
131
  }
132
 
102
  public static function search($search_by, $search_value, $form_id) {
103
  ?>
104
  <div class="alignleft actions" style="clear:both;">
105
+ <script>
106
+ function fm_search() {
107
+ document.getElementById("page_number").value = "1";
108
+ document.getElementById("search_or_not").value = "search";
109
+ document.getElementById("<?php echo $form_id; ?>").submit();
110
+ }
111
+ function fm_reset() {
112
+ if (document.getElementById("search_value")) {
113
+ document.getElementById("search_value").value = "";
114
+ }
115
+ if (document.getElementById("search_select_value")) {
116
+ document.getElementById("search_select_value").value = 0;
117
+ }
118
+ document.getElementById("<?php echo $form_id; ?>").submit();
119
+ }
120
+ </script>
121
+ <div class="fm-search">
122
+ <label for="search_value"><?php echo $search_by; ?>:</label>
123
+ <input type="text" id="search_value" name="search_value" value="<?php echo esc_html($search_value); ?>"/>
124
+ <button class="fm-icon search-icon" onclick="fm_search()">
125
+ </button>
126
+ <button class="fm-icon reset-icon" onclick="fm_reset()">
127
+ </button>
128
+ </div>
129
+ </div>
130
  <?php
131
  }
132
 
frontend/controllers/FMControllerForm_maker.php CHANGED
@@ -32,7 +32,7 @@ class FMControllerForm_maker {
32
  require_once WD_FM_DIR . "/frontend/views/FMViewForm_maker.php";
33
  $view = new FMViewForm_maker($model);
34
 
35
- return $view->display($id);
36
  }
37
  ////////////////////////////////////////////////////////////////////////////////////////
38
  // Getters & Setters //
32
  require_once WD_FM_DIR . "/frontend/views/FMViewForm_maker.php";
33
  $view = new FMViewForm_maker($model);
34
 
35
+ return $view->display((int)$id);
36
  }
37
  ////////////////////////////////////////////////////////////////////////////////////////
38
  // Getters & Setters //
frontend/controllers/FMControllerForm_submissions.php ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerForm_submissions {
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($id = '', $startdate = '', $enddate = '', $submit_date = '', $submitter_ip = '', $username = '', $useremail = '', $form_fields = '', $show = '') {
22
+ require_once(WD_FM_DIR . '/framework/WDW_FM_Library.php');
23
+ $task = WDW_FM_Library::get('action');
24
+ if (method_exists($this, $task) && $task != 'display') {
25
+ return $this->$task();
26
+ }
27
+ else {
28
+ return $this->display((int)$id, $startdate, $enddate, $submit_date, $submitter_ip, $username, $useremail, $form_fields, $show);
29
+ }
30
+ }
31
+
32
+ public function display($id, $startdate, $enddate, $submit_date, $submitter_ip, $username, $useremail, $form_fields, $show) {
33
+ if (session_id() == '' || (function_exists('session_status') && (session_status() == PHP_SESSION_NONE))) {
34
+ @session_start();
35
+ }
36
+ require_once WD_FM_DIR . "/frontend/models/FMModelForm_submissions.php";
37
+ $model = new FMModelForm_submissions();
38
+
39
+ require_once WD_FM_DIR . "/frontend/views/FMViewForm_submissions.php";
40
+ $view = new FMViewForm_submissions($model);
41
+
42
+ $show = explode(",", $show);
43
+ $csv = isset($show[0]) ? $show[0] : 0;
44
+ $xml = isset($show[1]) ? $show[1] : 0;
45
+ $title = isset($show[2]) ? $show[2] : 0;
46
+ $search = isset($show[3]) ? $show[3] : 0;
47
+ $ordering = isset($show[4]) ? $show[4] : 0;
48
+ $entries = isset($show[5]) ? $show[5] : 0;
49
+ $views = isset($show[6]) ? $show[6] : 0;
50
+ $conversion_rate = isset($show[7]) ? $show[7] : 0;
51
+ $pagination = isset($show[8]) ? $show[8] : 0;
52
+ $stats = isset($show[9]) ? $show[9] : 0;
53
+
54
+ return $view->display($id, $startdate, $enddate, $submit_date, $submitter_ip, $username, $useremail, $form_fields, $csv, $xml, $title, $search, $ordering, $entries, $views, $conversion_rate, $pagination, $stats);
55
+ }
56
+
57
+ public function get_frontend_stats() {
58
+ require_once WD_FM_DIR . "/frontend/models/FMModelForm_submissions.php";
59
+ $model = new FMModelForm_submissions();
60
+
61
+ require_once WD_FM_DIR . "/frontend/views/FMViewForm_submissions.php";
62
+ $view = new FMViewForm_submissions($model);
63
+ $view->show_stats();
64
+ }
65
+
66
+ public function frontend_show_map() {
67
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
68
+ require_once WD_FM_DIR . "/frontend/models/FMModelForm_submissions.php";
69
+ $model = new FMModelForm_submissions();
70
+
71
+ require_once WD_FM_DIR . "/frontend/views/FMViewForm_submissions.php";
72
+ $view = new FMViewForm_submissions($model);
73
+ $view->show_map($form_id);
74
+ }
75
+
76
+ public function frontend_show_matrix() {
77
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
78
+ require_once WD_FM_DIR . "/frontend/models/FMModelForm_submissions.php";
79
+ $model = new FMModelForm_submissions();
80
+
81
+ require_once WD_FM_DIR . "/frontend/views/FMViewForm_submissions.php";
82
+ $view = new FMViewForm_submissions($model);
83
+ $view->show_matrix($form_id);
84
+ }
85
+
86
+ public function frontend_paypal_info() {
87
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
88
+ require_once WD_FM_DIR . "/frontend/models/FMModelForm_submissions.php";
89
+ $model = new FMModelForm_submissions();
90
+
91
+ require_once WD_FM_DIR . "/frontend/views/FMViewForm_submissions.php";
92
+ $view = new FMViewForm_submissions($model);
93
+ $view->paypal_info($form_id);
94
+ }
95
+
96
+ public function frontend_generate_csv() {
97
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
98
+ require_once WD_FM_DIR . "/frontend/models/FMModelForm_submissions.php";
99
+ $model = new FMModelForm_submissions();
100
+
101
+ require_once WD_FM_DIR . "/frontend/views/FMViewForm_submissions.php";
102
+ $view = new FMViewForm_submissions($model);
103
+ $view->generate_csv($form_id);
104
+ }
105
+
106
+ public function frontend_generate_xml() {
107
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
108
+ require_once WD_FM_DIR . "/frontend/models/FMModelForm_submissions.php";
109
+ $model = new FMModelForm_submissions();
110
+
111
+ require_once WD_FM_DIR . "/frontend/views/FMViewForm_submissions.php";
112
+ $view = new FMViewForm_submissions($model);
113
+ $view->generate_xml($form_id);
114
+ }
115
+ ////////////////////////////////////////////////////////////////////////////////////////
116
+ // Getters & Setters //
117
+ ////////////////////////////////////////////////////////////////////////////////////////
118
+ ////////////////////////////////////////////////////////////////////////////////////////
119
+ // Private Methods //
120
+ ////////////////////////////////////////////////////////////////////////////////////////
121
+ ////////////////////////////////////////////////////////////////////////////////////////
122
+ // Listeners //
123
+ ////////////////////////////////////////////////////////////////////////////////////////
124
+ }
frontend/models/FMModelForm_maker.php CHANGED
@@ -20,7 +20,7 @@ class FMModelForm_maker {
20
  ////////////////////////////////////////////////////////////////////////////////////////
21
  public function showform($id) {
22
  global $wpdb;
23
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d" AND id NOT IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')', $id));
24
  if (!$row || !$row->published) {
25
  return FALSE;
26
  }
@@ -105,7 +105,7 @@ class FMModelForm_maker {
105
  <?php
106
  }
107
  }
108
- elseif (isset($_POST["g-recaptcha-response"])){
109
  $privatekey = $form->private_key;
110
  $response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$privatekey."&response=".$_POST['g-recaptcha-response']);
111
  $response = json_decode($response, true);
@@ -140,9 +140,11 @@ class FMModelForm_maker {
140
  elseif (isset($counter)) {
141
  $this->gen_mail($counter, $all_files, $id_for_old, $result_temp[1]);
142
  }
143
- }
 
144
  return $all_files;
145
  }
 
146
  return $all_files;
147
  }
148
 
@@ -214,8 +216,8 @@ class FMModelForm_maker {
214
  $wp_username = '';
215
  $wp_useremail = '';
216
  }
217
- $ip = $_SERVER['REMOTE_ADDR'];
218
-
219
  $chgnac = TRUE;
220
  $all_files = array();
221
  $paypal = array();
@@ -244,8 +246,8 @@ class FMModelForm_maker {
244
  $label_label = array();
245
  $label_type = array();
246
 
247
- $disabled_fields = explode(',', (isset($_REQUEST["disabled_fields".$id]) ? $_REQUEST["disabled_fields".$id] : ""));
248
- $disabled_fields = array_slice($disabled_fields,0, count($disabled_fields)-1);
249
 
250
  if($old == false || ($old == true && $form->form=='')) {
251
  $label_all = explode('#****#',$form->label_order_current);
@@ -264,544 +266,608 @@ class FMModelForm_maker {
264
  $max = $wpdb->get_var("SELECT MAX( group_id ) FROM " . $wpdb->prefix . "formmaker_submits");
265
  $fvals=array();
266
  if ($old == FALSE || ($old == TRUE && $form->form == '')) {
267
- foreach ($label_type as $key => $type) {
268
- $value = '';
269
- if ($type == "type_submit_reset" or $type == "type_map" or $type == "type_editor" or $type == "type_captcha" or $type == "type_arithmetic_captcha" or $type == "type_recaptcha" or $type == "type_button" or $type == "type_paypal_total" or $type == "type_send_copy") {
270
- continue;
271
- }
272
- $i = $label_id[$key];
273
- if(!in_array($i,$disabled_fields))
274
- {
275
- switch ($type) {
276
- case 'type_text':
277
- case 'type_password':
278
- case 'type_textarea':
279
- case "type_submitter_mail":
280
- case "type_date":
281
- case "type_own_select":
282
- case "type_country":
283
- case "type_number": {
284
- $value = isset($_POST['wdform_'.$i."_element".$id]) ? esc_html($_POST['wdform_'.$i."_element".$id]) : "";
285
- break;
286
- }
287
- case "type_wdeditor": {
288
- $value = isset($_POST['wdform_'.$i.'_wd_editor'.$id]) ? esc_html($_POST['wdform_'.$i.'_wd_editor'.$id]) : "";
289
- break;
290
- }
291
- case "type_mark_map": {
292
- $value = (isset($_POST['wdform_'.$i."_long".$id]) ? $_POST['wdform_'.$i."_long".$id] : "") . '***map***' . (isset($_POST['wdform_'.$i."_lat".$id]) ? $_POST['wdform_'.$i."_lat".$id] : "");
293
- break;
294
- }
295
- case "type_date_fields": {
296
- $value = (isset($_POST['wdform_'.$i."_day".$id]) ? $_POST['wdform_'.$i."_day".$id] : "") . '-' . (isset($_POST['wdform_'.$i."_month".$id]) ? $_POST['wdform_'.$i."_month".$id] : "") . '-' . (isset($_POST['wdform_'.$i."_year".$id]) ? $_POST['wdform_'.$i."_year".$id] : "");
297
- break;
298
- }
299
- case "type_time": {
300
- $ss = isset($_POST['wdform_'.$i."_ss".$id]) ? $_POST['wdform_'.$i."_ss".$id] : NULL;
301
- if(isset($ss)) {
302
- $value = (isset($_POST['wdform_'.$i."_hh".$id]) ? $_POST['wdform_'.$i."_hh".$id] : "") . ':' . (isset($_POST['wdform_'.$i."_mm".$id]) ? $_POST['wdform_'.$i."_mm".$id] : "") . ':' . (isset($_POST['wdform_'.$i."_ss".$id]) ? $_POST['wdform_'.$i."_ss".$id] : "");
303
- }
304
- else {
305
- $value = (isset($_POST['wdform_'.$i."_hh".$id]) ? $_POST['wdform_'.$i."_hh".$id] : "") . ':' . (isset($_POST['wdform_'.$i."_mm".$id]) ? $_POST['wdform_'.$i."_mm".$id] : "");
306
- }
307
- $am_pm = isset($_POST['wdform_'.$i."_am_pm".$id]) ? $_POST['wdform_'.$i."_am_pm".$id] : NULL;
308
- if(isset($am_pm)) {
309
- $value = $value . ' ' . $am_pm;
310
- }
311
- break;
312
- }
313
- case "type_phone": {
314
- $value = (isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : "") . ' ' . (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : "");
315
- break;
316
- }
317
- case "type_name": {
318
- $element_title = isset($_POST['wdform_'.$i."_element_title".$id]) ? esc_html($_POST['wdform_'.$i."_element_title".$id]) : NULL;
319
- if(isset($element_title)) {
320
- $value = (isset($_POST['wdform_'.$i."_element_title".$id]) ? esc_html($_POST['wdform_'.$i."_element_title".$id]) : "") . '@@@' . (isset($_POST['wdform_'.$i."_element_first".$id]) ? esc_html($_POST['wdform_'.$i."_element_first".$id]) : "") . '@@@' . (isset($_POST['wdform_'.$i."_element_last".$id]) ? esc_html($_POST['wdform_'.$i."_element_last".$id]) : "") . '@@@' . (isset($_POST['wdform_'.$i."_element_middle".$id]) ? esc_html($_POST['wdform_'.$i."_element_middle".$id]) : "");
321
- }
322
- else {
323
- $value = (isset($_POST['wdform_'.$i."_element_first".$id]) ? esc_html($_POST['wdform_'.$i."_element_first".$id]) : "") . '@@@' . (isset($_POST['wdform_'.$i."_element_last".$id]) ? esc_html($_POST['wdform_'.$i."_element_last".$id]) : "");
324
- }
325
- break;
326
- }
327
- case "type_file_upload": {
328
- $files = isset($_FILES['wdform_'.$i.'_file'.$id]) ? $_FILES['wdform_'.$i.'_file'.$id] : NULL;
329
- foreach($files['name'] as $file_key => $file_name) {
330
- if($file_name) {
331
- $untilupload = $form->form_fields;
332
- $untilupload = substr($untilupload, strpos($untilupload,$i.'*:*id*:*type_file_upload'), -1);
333
- $untilupload = substr($untilupload, 0, strpos($untilupload,'*:*new_field*:'));
334
- $untilupload = explode('*:*w_field_label_pos*:*',$untilupload);
335
- $untilupload = $untilupload[1];
336
- $untilupload = explode('*:*w_destination*:*',$untilupload);
337
- $destination = $untilupload[0];
338
- $destination = str_replace(site_url() . '/', '', $destination);
339
- $untilupload = $untilupload[1];
340
- $untilupload = explode('*:*w_extension*:*',$untilupload);
341
- $extension = $untilupload[0];
342
- $untilupload = $untilupload[1];
343
- $untilupload = explode('*:*w_max_size*:*',$untilupload);
344
- $max_size = $untilupload[0];
345
- $untilupload = $untilupload[1];
346
- $fileName = $files['name'][$file_key];
347
- $fileSize = $files['size'][$file_key];
348
 
349
- if($fileSize > $max_size * 1024) {
350
- echo "<script> alert('" . addslashes(__('The file exceeds the allowed size of', 'form_maker')) . $max_size . " KB');</script>";
351
- return array($max+1);
352
- }
353
 
354
- $uploadedFileNameParts = explode('.',$fileName);
355
- $uploadedFileExtension = array_pop($uploadedFileNameParts);
356
- $to = strlen($fileName) - strlen($uploadedFileExtension) - 1;
357
-
358
- $fileNameFree = substr($fileName, 0, $to);
359
- $invalidFileExts = explode(',', $extension);
360
- $extOk = false;
361
 
362
- foreach($invalidFileExts as $key => $valuee) {
363
- if(is_numeric(strpos(strtolower($valuee), strtolower($uploadedFileExtension)))) {
364
- $extOk = true;
365
- }
366
- }
367
-
368
- if ($extOk == false) {
369
- echo "<script> alert('" . addslashes(__('Sorry, you are not allowed to upload this type of file.', 'form_maker')) . "');</script>";
370
- return array($max+1);
371
- }
372
-
373
- $fileTemp = $files['tmp_name'][$file_key];
374
- $p = 1;
375
- if (file_exists($destination . "/" . $fileName)) {
376
- $fileName1 = $filename;
377
- while (file_exists($destination . "/" . $fileName1)) {
378
- $to = strlen($file['name']) - strlen($uploadedFileExtension) - 1;
379
- $fileName1 = substr($fileName, 0, $to) . '(' . $p . ').' . $uploadedFileExtension;
380
- $file['name'] = $fileName;
381
- $p++;
382
- }
383
- $fileName = $fileName1;
384
- }
385
- if(!move_uploaded_file($fileTemp, ABSPATH . $destination . '/' . $fileName)) {
386
- echo "<script> alert('" . addslashes(__('Error, file cannot be moved.', 'form_maker')) . "');</script>";
387
- return array($max+1);
388
- }
 
 
 
 
 
 
 
389
 
390
- $value.= site_url() . '/' . $destination . '/' . $fileName . '*@@url@@*';
391
-
392
- $files['tmp_name'][$file_key]=$destination . "/" . $fileName;
393
- $temp_file = array( "name" => $files['name'][$file_key], "type" => $files['type'][$file_key], "tmp_name" => $files['tmp_name'][$file_key]);
394
- array_push($all_files,$temp_file);
395
- }
396
- }
397
- break;
398
- }
399
-
400
- case 'type_address': {
401
- $value = '*#*#*#';
402
- $element = isset($_POST['wdform_'.$i."_street1".$id]) ? esc_html($_POST['wdform_'.$i."_street1".$id]) : NULL;
403
- if(isset($element)) {
404
- $value = $element;
405
- break;
406
- }
407
-
408
- $element = isset($_POST['wdform_'.$i."_street2".$id]) ? esc_html($_POST['wdform_'.$i."_street2".$id]) : NULL;
409
- if(isset($element)) {
410
- $value = $element;
411
- break;
412
- }
413
-
414
- $element = isset($_POST['wdform_'.$i."_city".$id]) ? esc_html($_POST['wdform_'.$i."_city".$id]) : NULL;
415
- if(isset($element)) {
416
- $value = $element;
417
- break;
418
- }
419
-
420
- $element = isset($_POST['wdform_'.$i."_state".$id]) ? esc_html($_POST['wdform_'.$i."_state".$id]) : NULL;
421
- if(isset($element)) {
422
- $value = $element;
423
- break;
424
- }
425
-
426
- $element = isset($_POST['wdform_'.$i."_postal".$id]) ? esc_html($_POST['wdform_'.$i."_postal".$id]) : NULL;
427
- if(isset($element)) {
428
- $value = $element;
429
- break;
430
- }
431
-
432
- $element = isset($_POST['wdform_'.$i."_country".$id]) ? esc_html($_POST['wdform_'.$i."_country".$id]) : NULL;
433
- if(isset($element)) {
434
- $value = $element;
435
- break;
436
- }
437
- break;
438
- }
439
-
440
- case "type_hidden": {
441
- $value = isset($_POST[$label_label[$key]]) ? esc_html($_POST[$label_label[$key]]) : "";
442
- break;
443
- }
444
-
445
- case "type_radio": {
446
- $element = isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL;
447
- if(isset($element)) {
448
- $value = $element;
449
- break;
450
- }
451
- $value = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : "";
452
- break;
453
- }
454
-
455
- case "type_checkbox": {
456
- $start = -1;
457
- $value = '';
458
- for($j = 0; $j < 100; $j++) {
459
- $element = isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL;
460
- if(isset($element)) {
461
- $start = $j;
462
- break;
463
- }
464
- }
465
-
466
- $other_element_id = -1;
467
- $is_other = isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : "";
468
- if($is_other == "yes") {
469
- $other_element_id = isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : "";
470
- }
471
-
472
- if($start != -1) {
473
- for($j = $start; $j < 100; $j++) {
474
- $element = isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL;
475
- if(isset($element)) {
476
- if($j == $other_element_id) {
477
- $value = $value . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : "") . '***br***';
478
- }
479
- else {
480
- $value = $value . (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : "") . '***br***';
481
- }
482
- }
483
- }
484
- }
485
- break;
486
- }
487
-
488
- case "type_paypal_price": {
489
- $value = isset($_POST['wdform_'.$i."_element_dollars".$id]) ? $_POST['wdform_'.$i."_element_dollars".$id] : 0;
490
 
491
- $value = (int) preg_replace('/\D/', '', $value);
492
-
493
- if(isset($_POST['wdform_'.$i."_element_cents".$id])) {
494
- $value = $value . '.' . ( preg_replace('/\D/', '', $_POST['wdform_'.$i."_element_cents".$id]));
495
- }
496
-
497
- $total += (float)($value);
498
- $paypal_option = array();
499
 
500
- if($value != 0) {
501
- $quantity = (isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : 1);
502
- array_push ($paypal['item_name'], $label_label[$key]);
503
- array_push ($paypal['quantity'], $quantity);
504
- array_push ($paypal['amount'], $value);
505
- $is_amount=true;
506
- array_push ($paypal['on_os'], $paypal_option);
507
- }
508
- $value = $value . $form_currency;
509
- break;
510
- }
511
-
512
- case "type_paypal_select": {
513
- if(isset($_POST['wdform_'.$i."_element_label".$id]) && $_POST['wdform_'.$i."_element".$id] !='') {
514
- $value = $_POST['wdform_'.$i."_element_label".$id] . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : "") . $form_currency;
515
- }
516
- else {
517
- $value = '';
518
- }
519
- $quantity = (isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : 1);
520
- $total += (float)(isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : 0) * $quantity;
521
- array_push ($paypal['item_name'], $label_label[$key] . ' ' . (isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : ""));
522
- array_push ($paypal['quantity'], $quantity);
523
- array_push ($paypal['amount'], (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : ""));
524
- if(isset($_POST['wdform_'.$i."_element".$id]) && $_POST['wdform_'.$i."_element".$id] != 0) {
525
- $is_amount=true;
526
- }
527
- $element_quantity = isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL;
528
- if(isset($element_quantity) && $value != '') {
529
- $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : "") . ': ' . $_POST['wdform_'.$i."_element_quantity".$id] . '***quantity***';
530
- }
531
- $paypal_option = array();
532
- $paypal_option['on'] = array();
533
- $paypal_option['os'] = array();
534
 
535
- for($k = 0; $k < 50; $k++) {
536
- $temp_val = isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL;
537
- if(isset($temp_val) && $value != '') {
538
- array_push ($paypal_option['on'], (isset($_POST['wdform_'.$i."_element_property_label".$id.$k]) ? $_POST['wdform_'.$i."_element_property_label".$id.$k] : ""));
539
- array_push ($paypal_option['os'], (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : ""));
540
- $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_property_label".$id.$k]) ? $_POST['wdform_'.$i."_element_property_label".$id.$k] : "") . ': ' . (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : "") . '***property***';
541
- }
542
- }
543
- array_push ($paypal['on_os'], $paypal_option);
544
- break;
545
- }
546
-
547
- case "type_paypal_radio": {
548
- if(isset($_POST['wdform_'.$i."_element_label".$id])) {
549
- $value = $_POST['wdform_'.$i."_element_label".$id] . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : "") . $form_currency;
550
- }
551
- else {
552
- $value = '';
553
- }
554
- $quantity = (isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : 1);
555
- $total += (float)(isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : 0) * $quantity;
556
- array_push ($paypal['item_name'], $label_label[$key] . ' ' . (isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : ""));
557
- array_push ($paypal['quantity'], $quantity);
558
- array_push ($paypal['amount'], (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : 0));
559
- if(isset($_POST['wdform_'.$i."_element".$id]) && $_POST['wdform_'.$i."_element".$id] != 0) {
560
- $is_amount=true;
561
- }
562
-
563
- $element_quantity = isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL;
564
- if(isset($element_quantity) && $value != '') {
565
- $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : "") . ': ' . $_POST['wdform_'.$i."_element_quantity".$id] . '***quantity***';
566
- }
567
-
568
- $paypal_option = array();
569
- $paypal_option['on'] = array();
570
- $paypal_option['os'] = array();
571
 
572
- for($k = 0; $k < 50; $k++) {
573
- $temp_val = isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL;
574
- if(isset($temp_val) && $value != '') {
575
- array_push ($paypal_option['on'], (isset($_POST['wdform_'.$i."_element_property_label".$id.$k]) ? $_POST['wdform_'.$i."_element_property_label".$id.$k] : ""));
576
- array_push ($paypal_option['os'], $_POST['wdform_'.$i."_property".$id.$k]);
577
- $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_property_label".$id.$k]) ? $_POST['wdform_'.$i."_element_property_label".$id.$k] : "") . ': ' . $_POST['wdform_'.$i."_property".$id.$k] . '***property***';
578
- }
579
- }
580
- array_push ($paypal['on_os'], $paypal_option);
581
- break;
582
- }
583
 
584
- case "type_paypal_shipping": {
585
- if(isset($_POST['wdform_'.$i."_element_label".$id])) {
586
- $value = $_POST['wdform_'.$i."_element_label".$id] . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : "") . $form_currency;
587
- }
588
- else {
589
- $value = '';
590
- }
591
- $value = (isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : "") . ' - ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : "") . $form_currency;
592
- $paypal['shipping'] = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : "";
593
- break;
594
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
595
 
596
- case "type_paypal_checkbox": {
597
- $start = -1;
598
- $value = '';
599
- for($j = 0; $j < 100; $j++) {
600
- $element = isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL;
601
- if(isset($element)) {
602
- $start = $j;
603
- break;
604
- }
605
- }
606
-
607
- $other_element_id = -1;
608
- $is_other = isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : "";
609
- if($is_other == "yes") {
610
- $other_element_id = isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : "";
611
- }
612
-
613
- if($start != -1) {
614
- for($j = $start; $j < 100; $j++) {
615
- $element = isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL;
616
- if(isset($element)) {
617
- if($j == $other_element_id) {
618
- $value = $value . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : "") . '***br***';
619
- }
620
- else {
621
- $value = $value . (isset($_POST['wdform_'.$i."_element".$id.$j."_label"]) ? $_POST['wdform_'.$i."_element".$id.$j."_label"] : "") . ' - ' . (isset($_POST['wdform_'.$i."_element".$id.$j]) && $_POST['wdform_'.$i."_element".$id.$j] == '' ? '0' : (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : "")) . $form_currency . '***br***';
622
- $quantity = ((isset($_POST['wdform_' . $i . "_element_quantity" . $id]) && ($_POST['wdform_' . $i . "_element_quantity" . $id] >= 1)) ? $_POST['wdform_'.$i . "_element_quantity" . $id] : 1);
623
- $total += (float)(isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : 0) * (float)($quantity);
624
- array_push ($paypal['item_name'], $label_label[$key] . ' ' . (isset($_POST['wdform_'.$i."_element".$id.$j."_label"]) ? $_POST['wdform_'.$i."_element".$id.$j."_label"] : ""));
625
- array_push ($paypal['quantity'], $quantity);
626
- array_push ($paypal['amount'], (isset($_POST['wdform_'.$i."_element".$id.$j]) ? ($_POST['wdform_'.$i."_element".$id.$j] == '' ? '0' : $_POST['wdform_'.$i."_element".$id.$j]) : ""));
627
- if (isset($_POST['wdform_'.$i."_element".$id.$j]) && $_POST['wdform_'.$i."_element".$id.$j] != 0) {
628
- $is_amount = TRUE;
629
- }
630
- $paypal_option = array();
631
- $paypal_option['on'] = array();
632
- $paypal_option['os'] = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
633
 
634
- for($k = 0; $k < 50; $k++) {
635
- $temp_val = isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL;
636
- if(isset($temp_val)) {
637
- array_push ($paypal_option['on'], isset($_POST['wdform_'.$i."_element_property_label".$id.$k]) ? $_POST['wdform_'.$i."_element_property_label".$id.$k] : "");
638
- array_push ($paypal_option['os'], $_POST['wdform_'.$i."_property".$id.$k]);
639
- }
640
- }
641
- array_push ($paypal['on_os'], $paypal_option);
642
- }
643
- }
644
- }
645
-
646
- $element_quantity = isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL;
647
- if(isset($element_quantity)) {
648
- $value .= (isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : "") . ': ' . $_POST['wdform_'.$i."_element_quantity".$id] . '***quantity***';
649
- }
650
- for($k = 0; $k < 50; $k++) {
651
- $temp_val = isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL;
652
- if(isset($temp_val)) {
653
- $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_property_label".$id.$k]) ? $_POST['wdform_'.$i."_element_property_label".$id.$k] : "") . ': ' . $_POST['wdform_'.$i."_property".$id.$k] . '***property***';
654
- }
655
- }
656
- }
657
- break;
658
- }
659
-
660
- case "type_star_rating": {
661
- if(isset($_POST['wdform_'.$i."_selected_star_amount".$id]) && $_POST['wdform_'.$i."_selected_star_amount".$id] == "") {
662
- $selected_star_amount = 0;
663
- }
664
- else {
665
- $selected_star_amount = isset($_POST['wdform_'.$i."_selected_star_amount".$id]) ? $_POST['wdform_'.$i."_selected_star_amount".$id] : 0;
666
- }
667
- $value = $selected_star_amount . '/' . (isset($_POST['wdform_'.$i."_star_amount".$id]) ? $_POST['wdform_'.$i."_star_amount".$id] : "");
668
- break;
669
- }
670
-
671
- case "type_scale_rating": {
672
- $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] : "");
673
- break;
674
- }
675
-
676
- case "type_spinner": {
677
- $value = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : "";
678
- break;
679
- }
680
-
681
- case "type_slider": {
682
- $value = isset($_POST['wdform_'.$i."_slider_value".$id]) ? $_POST['wdform_'.$i."_slider_value".$id] : "";
683
- break;
684
- }
685
-
686
- case "type_range": {
687
- $value = (isset($_POST['wdform_'.$i."_element".$id.'0']) ? $_POST['wdform_'.$i."_element".$id.'0'] : "") . '-' . (isset($_POST['wdform_'.$i."_element".$id.'1']) ? $_POST['wdform_'.$i."_element".$id.'1'] : "");
688
- break;
689
- }
690
-
691
- case "type_grading": {
692
- $value = "";
693
- $items = explode(":", isset($_POST['wdform_'.$i."_hidden_item".$id]) ? $_POST['wdform_'.$i."_hidden_item".$id] : "");
694
- for($k = 0; $k < sizeof($items) - 1; $k++) {
695
- $value .= (isset($_POST['wdform_'.$i."_element".$id.'_'.$k]) ? $_POST['wdform_'.$i."_element".$id.'_'.$k] : "") . ':';
696
- }
697
- $value .= (isset($_POST['wdform_'.$i."_hidden_item".$id]) ? $_POST['wdform_'.$i."_hidden_item".$id] : "") . '***grading***';
698
- break;
699
- }
700
-
701
- case "type_matrix": {
702
- $rows_of_matrix = explode("***", isset($_POST['wdform_'.$i."_hidden_row".$id]) ? $_POST['wdform_'.$i."_hidden_row".$id] : "");
703
- $rows_count = sizeof($rows_of_matrix) - 1;
704
- $column_of_matrix = explode("***", isset($_POST['wdform_'.$i."_hidden_column".$id]) ? $_POST['wdform_'.$i."_hidden_column".$id] : "");
705
- $columns_count = sizeof($column_of_matrix) - 1;
706
-
707
- if(isset($_POST['wdform_'.$i."_input_type".$id]) && $_POST['wdform_'.$i."_input_type".$id] == "radio") {
708
- $input_value = "";
709
- for($k = 1; $k <= $rows_count; $k++) {
710
- $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k]) ? $_POST['wdform_'.$i."_input_element".$id.$k] : 0) . "***";
711
- }
712
- }
713
- if(isset($_POST['wdform_'.$i."_input_type".$id]) && $_POST['wdform_'.$i."_input_type".$id] == "checkbox") {
714
- $input_value = "";
715
- for($k = 1; $k <= $rows_count; $k++) {
716
- for($j = 1; $j <= $columns_count; $j++) {
717
- $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j] : 0)."***";
718
- }
719
- }
720
- }
721
-
722
- if(isset($_POST['wdform_'.$i."_input_type".$id]) && $_POST['wdform_'.$i."_input_type".$id] == "text") {
723
- $input_value = "";
724
- for($k = 1; $k <= $rows_count; $k++) {
725
- for($j = 1; $j <= $columns_count; $j++) {
726
- $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? esc_html($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) : "") . "***";
727
- }
728
- }
729
- }
730
-
731
- if(isset($_POST['wdform_'.$i."_input_type".$id]) && $_POST['wdform_'.$i."_input_type".$id] == "select") {
732
- $input_value = "";
733
- for($k = 1; $k <= $rows_count; $k++) {
734
- for($j = 1; $j <= $columns_count; $j++) {
735
- $input_value .= (isset($_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j] : "") . "***";
736
- }
737
- }
738
- }
739
-
740
- $value = $rows_count . (isset($_POST['wdform_'.$i."_hidden_row".$id]) ? $_POST['wdform_'.$i."_hidden_row".$id] : "") . '***' . $columns_count . (isset($_POST['wdform_'.$i."_hidden_column".$id]) ? $_POST['wdform_'.$i."_hidden_column".$id] : "") . '***' . (isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : "") . '***' . $input_value . '***matrix***';
741
- break;
742
- }
743
 
744
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
745
 
746
- if($type == "type_address") {
747
- if( $value == '*#*#*#') {
748
- continue;
749
- }
750
- }
751
- if($type == "type_text" or $type == "type_password" or $type == "type_textarea" or $type == "type_name" or $type == "type_submitter_mail" or $type == "type_number" or $type == "type_phone")
752
- {
753
- $untilupload = $form->form_fields;
754
- $untilupload = substr($untilupload, strpos($untilupload, $i.'*:*id*:*'.$type), -1);
755
- $untilupload = substr($untilupload, 0, strpos($untilupload, '*:*new_field*:'));
756
- $untilupload = explode('*:*w_required*:*', $untilupload);
757
- $untilupload = $untilupload[1];
758
- $untilupload = explode('*:*w_unique*:*', $untilupload);
759
- $unique_element = $untilupload[0];
760
- if(strlen($unique_element)>3)
761
- $unique_element = substr($unique_element, -3);
762
 
763
- if($unique_element == 'yes') {
764
- $unique = $wpdb->get_col($wpdb->prepare("SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id= %d and element_label= %s and element_value= %s", $id, $i, addslashes($value)));
765
- if ($unique) {
766
- echo "<script> alert('" . addslashes(__('This field %s requires a unique entry and this value was already submitted.', 'form_maker')) . "'.replace('%s','" . $label_label[$key] . "'));</script>";
767
- return array($max + 1);
768
- }
769
- }
770
- }
771
- $save_or_no = TRUE;
772
- $fvals['{'.$i.'}']=str_replace(array("***map***", "*@@url@@*", "@@@@@@@@@", "@@@", "***grading***", "***br***"), array(" ", "", " ", " ", " ", ", "), addslashes($value));
773
- if ($form->savedb) {
774
- $save_or_no = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
775
- 'form_id' => $id,
776
- 'element_label' => $i,
777
- 'element_value' => stripslashes($value),
778
- 'group_id' => ($max + 1),
779
- 'date' => date('Y-m-d H:i:s'),
780
- 'ip' => $_SERVER['REMOTE_ADDR'],
781
- 'user_id_wd' => $current_user->ID,
782
- ), array(
783
- '%d',
784
- '%s',
785
- '%s',
786
- '%d',
787
- '%s',
788
- '%s',
789
- '%d'
790
- ));
791
- }
792
- if (!$save_or_no) {
793
- return FALSE;
794
- }
795
- $chgnac = FALSE;
796
- }
797
- else
798
- $fvals['{'.$i.'}'] = '';
799
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
800
  }
801
  else {
802
  foreach ($label_type as $key => $type) {
803
  $value = '';
804
- if ($type == "type_submit_reset" or $type == "type_map" or $type == "type_editor" or $type == "type_captcha" or $type == "type_arithmetic_captcha" or $type == "type_recaptcha" or $type == "type_button" or $type=="type_paypal_total")
805
  continue;
806
  $i = $label_id[$key];
807
  if ($type != "type_address") {
@@ -896,6 +962,10 @@ class FMModelForm_maker {
896
  }
897
  $fileTemp = $file['tmp_name'];
898
  $p = 1;
 
 
 
 
899
  if (file_exists($destination . "/" . $fileName)) {
900
  $fileName1 = $filename;
901
  while (file_exists($destination . "/" . $fileName1)) {
@@ -1229,7 +1299,7 @@ class FMModelForm_maker {
1229
  return array($max + 1);
1230
  }
1231
  }
1232
-
1233
  $r = $wpdb->prefix . "formmaker_submits";
1234
 
1235
  $save_or_no = $wpdb->insert($r, array(
@@ -1256,11 +1326,11 @@ class FMModelForm_maker {
1256
  }
1257
  }
1258
 
 
1259
  $subid = $wpdb->get_var("SELECT MAX( group_id ) FROM " . $wpdb->prefix ."formmaker_submits" );
1260
  $user_fields = array("subid"=>$subid, "ip"=>$ip, "userid"=>$wp_userid, "username"=>$wp_username, "useremail"=>$wp_useremail);
1261
 
1262
  $queries = $wpdb->get_results( $wpdb->prepare("SELECT * FROM " .$wpdb->prefix. "formmaker_query WHERE form_id=%d",(int)$id ));
1263
-
1264
  if($queries)
1265
  {
1266
  foreach($queries as $query)
@@ -1282,13 +1352,14 @@ class FMModelForm_maker {
1282
  $temp = explode('***wdfdatabasewdf***',$temp[1]);
1283
  $database = $temp[0];
1284
 
1285
- $query=str_replace(array_keys($fvals), $fvals ,$query->query);
1286
  foreach($user_fields as $user_key=>$user_field)
1287
- $query=str_replace('{'.$user_key.'}', $user_field , $query);
 
1288
  if($con_type == 'remote')
1289
  {
1290
  $wpdb_temp = new wpdb($username, $password, $database, $host);
1291
- $wpdb_temp->query($query);
1292
  }
1293
  else {
1294
  $wpdb->query($query);
@@ -1296,6 +1367,18 @@ class FMModelForm_maker {
1296
  }
1297
  // $wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
1298
  }
 
 
 
 
 
 
 
 
 
 
 
 
1299
  $str = '';
1300
 
1301
  if ($form->paypal_mode) {
@@ -1449,14 +1532,25 @@ class FMModelForm_maker {
1449
 
1450
 
1451
  if ($chgnac) {
1452
- global $wpdb;
1453
- if ($form->submit_text_type != 4) {
1454
- $_SESSION['massage_after_submit' . $id] = addslashes(addslashes(__('Nothing was submitted.', 'form_maker')));
1455
- }
1456
- $_SESSION['error_or_no' . $id] = 1;
1457
- $_SESSION['form_submit_type' . $id] = $form->submit_text_type . "," . $form->id;
1458
- wp_redirect($_SERVER["REQUEST_URI"]);
1459
- exit;
 
 
 
 
 
 
 
 
 
 
 
1460
  }
1461
  return array($all_files, $str);
1462
  }
@@ -1466,7 +1560,7 @@ class FMModelForm_maker {
1466
  $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id= %d', $group_id));
1467
  }
1468
 
1469
- public function get_after_submission_text($form_id) {
1470
  global $wpdb;
1471
  $submit_text = $wpdb->get_var("SELECT submit_text FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'");
1472
  $current_user = wp_get_current_user();
@@ -1548,7 +1642,26 @@ class FMModelForm_maker {
1548
  }
1549
  }
1550
 
1551
- public function gen_mail($counter, $all_files, $id, $str) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1552
  $ip = $_SERVER['REMOTE_ADDR'];
1553
  $replyto = '';
1554
  global $wpdb;
@@ -1621,7 +1734,7 @@ class FMModelForm_maker {
1621
  $i = $label_order_id;
1622
  $type = $label_type[$i];
1623
 
1624
- if($type != "type_map" and $type != "type_submit_reset" and $type != "type_editor" and $type != "type_captcha" and $type != "type_arithmetic_captcha" and $type != "type_recaptcha" and $type != "type_button") {
1625
  $element_label=$label_order_original[$i];
1626
  if(!in_array($i,$disabled_fields)) {
1627
  switch ($type) {
@@ -1634,7 +1747,7 @@ class FMModelForm_maker {
1634
  case "type_number": {
1635
  $element = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL;
1636
  if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
1637
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
1638
  $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1639
  }
1640
 
@@ -1643,7 +1756,7 @@ class FMModelForm_maker {
1643
  case "type_hidden": {
1644
  $element = isset($_POST[$element_label]) ? $_POST[$element_label] : NULL;
1645
  if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
1646
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
1647
  $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1648
  }
1649
  break;
@@ -1659,7 +1772,7 @@ class FMModelForm_maker {
1659
  case "type_submitter_mail": {
1660
  $element = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL;
1661
  if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
1662
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
1663
  $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1664
  }
1665
  break;
@@ -1777,7 +1890,7 @@ class FMModelForm_maker {
1777
  }
1778
  $element = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL;
1779
  if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
1780
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
1781
  $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1782
  }
1783
  break;
@@ -1866,7 +1979,7 @@ class FMModelForm_maker {
1866
 
1867
  if($this->empty_field($value, $row->mail_emptyfields))
1868
  {
1869
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $value . '</pre></td></tr>';
1870
  $list_text_mode=$list_text_mode.$element_label.' - '.str_replace('<br/>',', ',$value)."\r\n";
1871
  }
1872
  break;
@@ -1894,19 +2007,19 @@ class FMModelForm_maker {
1894
 
1895
  if($this->empty_field($value, $row->mail_emptyfields))
1896
  {
1897
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $value . '</pre></td></tr>';
1898
  $list_text_mode=$list_text_mode.$element_label.' - '.str_replace('<br/>',', ',$value)."\r\n";
1899
  }
1900
  break;
1901
  }
1902
 
1903
- case "type_paypal_shipping": {
1904
  if(isset($_POST['wdform_'.$i."_element".$id])) {
1905
  $value = $_POST['wdform_'.$i."_element_label".$id] . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : "") . $form_currency;
1906
 
1907
  if($this->empty_field($value, $row->mail_emptyfields))
1908
  {
1909
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $value . '</pre></td></tr>';
1910
  $list_text_mode=$list_text_mode.$element_label.' - '.$value."\r\n";
1911
  }
1912
  }
@@ -1967,7 +2080,7 @@ class FMModelForm_maker {
1967
  $element = isset($_POST['wdform_'.$i."_paypal_total".$id]) ? $_POST['wdform_'.$i."_paypal_total".$id] : "";
1968
  if($this->empty_field($element, $row->mail_emptyfields))
1969
  {
1970
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
1971
  $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1972
  }
1973
  break;
@@ -1977,7 +2090,7 @@ class FMModelForm_maker {
1977
  $element = isset($_POST['wdform_'.$i."_star_amount".$id]) ? $_POST['wdform_'.$i."_star_amount".$id] : NULL;
1978
  $selected = isset($_POST['wdform_'.$i."_selected_star_amount".$id]) ? $_POST['wdform_'.$i."_selected_star_amount".$id] : 0;
1979
  if(isset($element) && $this->empty_field($selected, $row->mail_emptyfields)) {
1980
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $selected . '/' . $element . '</pre></td></tr>';
1981
  $list_text_mode=$list_text_mode.$element_label.' - '.$selected.'/'.$element."\r\n";
1982
  }
1983
  break;
@@ -1987,7 +2100,7 @@ class FMModelForm_maker {
1987
  $element = isset($_POST['wdform_'.$i."_scale_amount".$id]) ? $_POST['wdform_'.$i."_scale_amount".$id] : NULL;
1988
  $selected = isset($_POST['wdform_'.$i."_scale_radio".$id]) ? $_POST['wdform_'.$i."_scale_radio".$id] : 0;
1989
  if(isset($element) && $this->empty_field($selected, $row->mail_emptyfields)) {
1990
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $selected . '/' . $element . '</pre></td></tr>';
1991
  $list_text_mode=$list_text_mode.$element_label.' - '.$selected.'/'.$element."\r\n";
1992
  }
1993
  break;
@@ -1996,7 +2109,7 @@ class FMModelForm_maker {
1996
  case "type_spinner": {
1997
  $element = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL;
1998
  if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
1999
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
2000
  $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
2001
  }
2002
  break;
@@ -2005,7 +2118,7 @@ class FMModelForm_maker {
2005
  case "type_slider": {
2006
  $element = isset($_POST['wdform_'.$i."_slider_value".$id]) ? $_POST['wdform_'.$i."_slider_value".$id] : NULL;
2007
  if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
2008
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
2009
  $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
2010
  }
2011
  break;
@@ -2015,7 +2128,7 @@ class FMModelForm_maker {
2015
  $element0 = isset($_POST['wdform_'.$i."_element".$id.'0']) ? $_POST['wdform_'.$i."_element".$id.'0'] : NULL;
2016
  $element1 = isset($_POST['wdform_'.$i."_element".$id.'1']) ? $_POST['wdform_'.$i."_element".$id.'1'] : NULL;
2017
  if((isset($element0) && $this->empty_field($element0, $row->mail_emptyfields)) || (isset($element1) && $this->empty_field($element1, $row->mail_emptyfields))) {
2018
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">From:' . $element0 . '<span style="margin-left:6px">To</span>:' . $element1 . '</pre></td></tr>';
2019
  $list_text_mode=$list_text_mode.$element_label.' - From:'.$element0.' To:'.$element1."\r\n";
2020
  }
2021
  break;
@@ -2036,7 +2149,7 @@ class FMModelForm_maker {
2036
  }
2037
  $element .= "Total:" . $total;
2038
  if(isset($element) && $this->empty_field($form_empty_field, $row->mail_emptyfields)) {
2039
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
2040
  $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
2041
  }
2042
  break;
@@ -2108,7 +2221,7 @@ class FMModelForm_maker {
2108
  }
2109
  $matrix .= '</table>';
2110
  if(isset($matrix)) {
2111
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $matrix . '</pre></td></tr>';
2112
  }
2113
  break;
2114
  }
@@ -2119,107 +2232,118 @@ class FMModelForm_maker {
2119
  }
2120
 
2121
  $list = $list . '</table>';
2122
- if($row->sendemail)
2123
- if($row->send_to) {
2124
- $fromname = $row->mail_from_name_user;
2125
- if($row->mail_subject_user)
2126
- $subject = $row->mail_subject_user;
2127
- else
2128
- $subject = $row->title;
2129
- if($row->reply_to_user) {
2130
- $replyto = $row->reply_to_user;
2131
- }
2132
- $attachment_user = array();
2133
- if ($row->mail_attachment_user) {
2134
- for ($k = 0; $k < count($all_files); $k++) {
2135
- if (isset($all_files[$k]['tmp_name'])) {
2136
- $attachment_user[$k] = $all_files[$k]['tmp_name'];
2137
- }
2138
  }
2139
  }
 
2140
 
2141
- if ($row->mail_mode_user) {
2142
- $content_type = "text/html";
2143
- $mode = 1;
2144
- $list_user = wordwrap($list, 70, "\n", true);
2145
- $new_script = wpautop($row->script_mail_user);
2146
- }
2147
- else {
2148
- $content_type = "text/plain";
2149
- $mode = 0;
2150
- $list_user = wordwrap($list_text_mode, 1000, "\n", true);
2151
- $new_script = str_replace(array('<p>','</p>'),'',$row->script_mail_user);
 
 
 
 
 
 
 
2152
  }
2153
 
2154
- foreach($label_order_original as $key => $label_each) {
2155
- $type=$label_type[$key];
2156
- if(strpos($row->script_mail_user, "%".$label_each."%")>-1) {
2157
- $new_value = $this->custom_fields_mail($type, $key, $id, $attachment_user);
2158
- $new_script = str_replace("%".$label_each."%", $new_value, $new_script);
2159
  }
2160
-
2161
- if(strpos($fromname, "%".$label_each."%")>-1) {
2162
- $new_value = str_replace('<br>',', ',$this->custom_fields_mail($type, $key, $id, ''));
2163
- if(substr($new_value, -2)==', ') {
2164
- $new_value = substr($new_value, 0, -2);
2165
- }
2166
- $fromname = str_replace("%".$label_each."%", $new_value, $fromname);
2167
- }
2168
-
2169
- if(strpos($subject, "%".$label_each."%")>-1) {
2170
- $new_value = str_replace('<br>',', ',$this->custom_fields_mail($type, $key, $id, ''));
2171
- if(substr($new_value, -2)==', ') {
2172
- $new_value = substr($new_value, 0, -2);
2173
- }
2174
- $subject = str_replace("%".$label_each."%", $new_value, $subject);
2175
  }
 
2176
  }
 
2177
 
2178
- $recipient = '';
2179
- $cca = $row->mail_cc_user;
2180
- $bcc = $row->mail_bcc_user;
2181
- $send_tos=explode('**',$row->send_to);
2182
- if ($row->mail_from_user != '') {
2183
- if ($fromname != '') {
2184
- $from = "From: '" . $fromname . "' <" . $row->mail_from_user . ">" . "\r\n";
2185
- }
2186
- else {
2187
- $from = "From: '' <" . $row->mail_from_user . ">" . "\r\n";
2188
- }
2189
- }
2190
  else {
2191
- $from = '';
2192
  }
 
 
 
 
2193
 
2194
- $headers = $from . " Content-Type: " . $content_type . "; charset=\"" . get_option('blog_charset') . "\"\n";
2195
- if ($replyto) {
2196
- $headers .= "Reply-To: <" . $replyto . ">\r\n";
2197
- }
2198
- if ($cca) {
2199
- $headers .= "Cc: <" . $cca . ">\r\n";
2200
- }
2201
- if ($bcc) {
2202
- $headers .= "Bcc: <" . $bcc . ">\r\n";
2203
- }
2204
 
2205
- $custom_fields_value = array( $ip, $useremail, $username, $subid, $list_user );
2206
- foreach($custom_fields as $key=>$custom_field)
2207
- {
2208
- if(strpos($new_script, "%".$custom_field."%")>-1)
2209
- $new_script = str_replace("%".$custom_field."%", $custom_fields_value[$key], $new_script);
2210
 
2211
- if($key==2 || $key==3)
2212
- {
2213
- if(strpos($fromname, "%".$custom_field."%")>-1)
2214
- $fromname = str_replace("%".$custom_field."%", $custom_fields_value[$key], $fromname);
2215
-
2216
- if(strpos($subject, "%".$custom_field."%")>-1)
2217
- $subject = str_replace("%".$custom_field."%", $custom_fields_value[$key], $subject);
2218
- }
2219
  }
2220
- $body = $new_script;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2221
  $send_copy = isset($_POST["wdform_send_copy_".$id]) ? $_POST["wdform_send_copy_".$id] : NULL;
2222
-
2223
  if(isset($send_copy)) {
2224
  $send=true;
2225
  }
@@ -2240,124 +2364,127 @@ class FMModelForm_maker {
2240
  }
2241
  }
2242
  }
2243
-
2244
- if($row->sendemail)
2245
- if ($row->mail) {
2246
- if($row->reply_to) {
2247
- $replyto = isset($_POST['wdform_'.$row->reply_to."_element".$id]) ? $_POST['wdform_'.$row->reply_to."_element".$id] : NULL;
2248
- if(!isset($replyto)) {
2249
- $replyto = $row->reply_to;
2250
- }
2251
- }
2252
- $recipient = $row->mail;
2253
- if($row->mail_subject) {
2254
- $subject = $row->mail_subject;
2255
- }
2256
- else {
2257
- $subject = $row->title;
2258
- }
2259
 
2260
- if ($row->from_name) {
2261
- $fromname = $row->from_name;
2262
- }
2263
- else {
2264
- $fromname = '';
2265
  }
2266
- $attachment = array();
2267
- if ($row->mail_attachment) {
2268
- for ($k = 0; $k < count($all_files); $k++) {
2269
- if (isset($all_files[$k]['tmp_name'])) {
2270
- $attachment[$k] = $all_files[$k]['tmp_name'];
2271
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2272
  }
2273
  }
 
 
 
 
2274
 
2275
- if ($row->mail_mode) {
2276
- $content_type = "text/html";
2277
- $mode = 1;
2278
- $list = wordwrap($list, 70, "\n", true);
2279
- $new_script = wpautop($row->script_mail);
2280
- }
2281
- else {
2282
- $content_type = "text/plain";
2283
- $mode = 0;
2284
- $list = wordwrap($list_text_mode, 1000, "\n", true);
2285
- $new_script = str_replace(array('<p>','</p>'),'',$row->script_mail);
2286
- }
 
2287
 
2288
- foreach($label_order_original as $key => $label_each) {
2289
- $type=$label_type[$key];
2290
- if(strpos($row->script_mail, "%".$label_each."%")>-1) {
2291
- $new_value = $this->custom_fields_mail($type, $key, $id, $attachment);
2292
- $new_script = str_replace("%".$label_each."%", $new_value, $new_script);
2293
- }
2294
-
2295
- if(strpos($fromname, "%".$label_each."%")>-1) {
2296
- $new_value = str_replace('<br>',', ',$this->custom_fields_mail($type, $key, $id, ''));
2297
- if(substr($new_value, -2)==', ') {
2298
- $new_value = substr($new_value, 0, -2);
2299
- }
2300
- $fromname = str_replace("%".$label_each."%", $new_value, $fromname);
2301
- }
2302
-
2303
- if(strpos($fromname, "%username%")>-1){
2304
- $fromname = str_replace("%username%", $username, $fromname);
2305
- }
2306
-
2307
- if(strpos($subject, "%".$label_each."%")>-1) {
2308
- $new_value = str_replace('<br>',', ',$this->custom_fields_mail($type, $key, $id, ''));
2309
- if(substr($new_value, -2)==', ') {
2310
- $new_value = substr($new_value, 0, -2);
2311
- }
2312
- $subject = str_replace("%".$label_each."%", $new_value, $subject);
2313
- }
2314
  }
2315
-
2316
- if ($row->from_mail) {
2317
- $from = isset($_POST['wdform_'.$row->from_mail."_element".$id]) ? $_POST['wdform_'.$row->from_mail."_element".$id] : NULL;
2318
- if (!isset($from)) {
2319
- $from = $row->from_mail;
2320
  }
2321
- $from = "From: '" . $fromname . "' <" . $from . ">" . "\r\n";
2322
- }
2323
- else {
2324
- $from = "";
2325
  }
2326
 
2327
- $headers = $from . " Content-Type: " . $content_type . "; charset=\"" . get_option('blog_charset') . "\"\n";
2328
- if ($replyto) {
2329
- $headers .= "Reply-To: <" . $replyto . ">\r\n";
2330
  }
2331
- $cca = $row->mail_cc;
2332
- $bcc = $row->mail_bcc;
2333
- if ($cca) {
2334
- $headers .= "Cc: <" . $cca . ">\r\n";
 
 
 
2335
  }
2336
- if ($bcc) {
2337
- $headers .= "Bcc: <" . $bcc . ">\r\n";
 
 
 
 
2338
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2339
 
2340
- $custom_fields_value = array( $ip, $useremail, $username, $subid, $list );
2341
- foreach($custom_fields as $key=>$custom_field)
2342
- {
2343
- if(strpos($new_script, "%".$custom_field."%")>-1)
2344
- $new_script = str_replace("%".$custom_field."%", $custom_fields_value[$key], $new_script);
2345
 
2346
- if($key==2 || $key==3)
2347
- {
2348
- if(strpos($fromname, "%".$custom_field."%")>-1)
2349
- $fromname = str_replace("%".$custom_field."%", $custom_fields_value[$key], $fromname);
2350
-
2351
- if(strpos($subject, "%".$custom_field."%")>-1)
2352
- $subject = str_replace("%".$custom_field."%", $custom_fields_value[$key], $subject);
2353
- }
2354
- }
2355
- $body = $new_script;
2356
-
2357
- if($row->sendemail) {
2358
- $send = wp_mail(str_replace(' ', '', $recipient), $subject, stripslashes($body), $headers, $attachment);
2359
  }
2360
  }
 
 
 
 
 
2361
 
2362
  $_SESSION['error_or_no' . $id] = 0;
2363
  $msg = addslashes(__('Your form was successfully submitted.', 'form_maker'));
@@ -2377,13 +2504,28 @@ class FMModelForm_maker {
2377
  }
2378
  }
2379
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2380
  }
2381
  else { /* Old form.*/
2382
  foreach ($label_order_ids as $key => $label_order_id) {
2383
  $i = $label_order_id;
2384
  $type = $_POST[$i . "_type" . $id];
2385
  if (isset($_POST[$i . "_type" . $id]))
2386
- if ($type != "type_map" and $type != "type_submit_reset" and $type != "type_editor" and $type != "type_captcha" and $type != "type_arithmetic_captcha" and $type != "type_recaptcha" and $type != "type_button") {
2387
  $element_label = $label_order_original[$i];
2388
  switch ($type) {
2389
  case 'type_text':
@@ -2757,7 +2899,7 @@ class FMModelForm_maker {
2757
  else {
2758
  $from_mail = '';
2759
  }
2760
- $headers =$from_mail . " Content-Type: text/html; charset=\"" . get_option('blog_charset') . "\"\n";
2761
  for ($k = 0; $k < count($all_files); $k++) {
2762
  // $attachment[$k] = dirname(__FILE__) . '/uploads/' . $all_files[$k]['name'];
2763
  $attachment[$k]= $all_files[$k]['name'];
@@ -2771,7 +2913,7 @@ class FMModelForm_maker {
2771
  foreach ($label_order_original as $key => $label_each) {
2772
  if (strpos($row->script_mail_user, "%" . $label_each . "%") !== FALSE) {
2773
  $type = $label_type[$key];
2774
- if ($type != "type_submit_reset" or $type != "type_map" or $type != "type_editor" or $type != "type_captcha" or $type != "type_arithmetic_captcha" or $type != "type_recaptcha" or $type != "type_button") {
2775
  $new_value = "";
2776
  switch ($type) {
2777
  case 'type_text':
@@ -3202,7 +3344,7 @@ class FMModelForm_maker {
3202
  if ($row->mail) {
3203
  if ($c) {
3204
  // $headers_form_mail = "From: " . $c . " <" . $c . ">" . "\r\n";
3205
- $headers = "From: '" . $c . "' <" . $c . ">" . "\r\n" . "Content-Type: text/html; charset=\"" . get_option('blog_charset') . "\"\n";
3206
  }
3207
  // else {
3208
  // $headers_form_mail = "";
@@ -3214,7 +3356,7 @@ class FMModelForm_maker {
3214
  foreach($label_order_original as $key => $label_each) {
3215
  if (strpos($row->script_mail, "%" . $label_each . "%") !== FALSE) {
3216
  $type = $label_type[$key];
3217
- if ($type != "type_submit_reset" or $type!="type_map" or $type!="type_editor" or $type!="type_captcha" or $type != "type_arithmetic_captcha" or $type!="type_recaptcha" or $type!="type_button") {
3218
  $new_value ="";
3219
  switch ($type) {
3220
  case 'type_text':
@@ -3628,7 +3770,7 @@ class FMModelForm_maker {
3628
  foreach($label_order_original as $key => $label_each) {
3629
  if (strpos($row->script_mail, "%" . $label_each . "%") !== FALSE) {
3630
  $type = $label_type[$key];
3631
- if ($type != "type_submit_reset" or $type != "type_map" or $type != "type_editor" or $type!="type_captcha" or $type != "type_arithmetic_captcha" or $type!="type_recaptcha" or $type!="type_button") {
3632
  $new_value = "";
3633
  switch ($type) {
3634
  case 'type_text':
@@ -4072,6 +4214,16 @@ class FMModelForm_maker {
4072
  $msg = addslashes(__('Your form was successfully submitted.', 'form_maker'));
4073
  }
4074
  }
 
 
 
 
 
 
 
 
 
 
4075
  $https = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://');
4076
  switch ($row->submit_text_type) {
4077
  case "2":
@@ -4126,14 +4278,14 @@ class FMModelForm_maker {
4126
  }
4127
  }
4128
 
4129
- function custom_fields_mail($type, $key, $id, $attachment)
4130
  {
4131
  $new_value ="";
4132
 
4133
  $disabled_fields = explode(',', isset($_REQUEST["disabled_fields".$id]) ? $_REQUEST["disabled_fields".$id] : "");
4134
  $disabled_fields = array_slice($disabled_fields,0, count($disabled_fields)-1);
4135
 
4136
- if($type!="type_submit_reset" or $type!="type_map" or $type!="type_editor" or $type!="type_captcha" or $type != "type_arithmetic_captcha" or $type!="type_recaptcha" or $type!="type_button") {
4137
  switch ($type) {
4138
  case 'type_text':
4139
  case 'type_password':
@@ -4325,7 +4477,7 @@ class FMModelForm_maker {
4325
  case "type_paypal_select": {
4326
  $new_value = (isset($_POST['wdform_'.$key."_element_label".$id]) ? $_POST['wdform_'.$key."_element_label".$id] : "") . ':' . (isset($_POST['wdform_'.$key."_element".$id]) ? $_POST['wdform_'.$key."_element".$id] : "") . $form_currency;
4327
  $element_quantity_label = isset($_POST['wdform_'.$key."_element_quantity_label".$id]) ? $_POST['wdform_'.$key."_element_quantity_label".$id] : NULL;
4328
- $element_quantity = (isset($_POST['wdform_'.$i."_element_quantity".$id]) && $_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL;
4329
  if (isset($element_quantity)) {
4330
  $new_value .= '<br/>' . $element_quantity_label . ': ' . $element_quantity;
4331
  }
@@ -4374,7 +4526,7 @@ class FMModelForm_maker {
4374
  }
4375
  }
4376
  $element_quantity_label = isset($_POST['wdform_'.$key."_element_quantity_label".$id]) ? $_POST['wdform_'.$key."_element_quantity_label".$id] : NULL;
4377
- $element_quantity = (isset($_POST['wdform_'.$i."_element_quantity".$id]) && $_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL;
4378
  if (isset($element_quantity)) {
4379
  $new_value .= '<br/>' . $element_quantity_label . ': ' . $element_quantity;
4380
  }
20
  ////////////////////////////////////////////////////////////////////////////////////////
21
  public function showform($id) {
22
  global $wpdb;
23
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
24
  if (!$row || !$row->published) {
25
  return FALSE;
26
  }
105
  <?php
106
  }
107
  }
108
+ elseif (isset($_POST["g-recaptcha-response"])){
109
  $privatekey = $form->private_key;
110
  $response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$privatekey."&response=".$_POST['g-recaptcha-response']);
111
  $response = json_decode($response, true);
140
  elseif (isset($counter)) {
141
  $this->gen_mail($counter, $all_files, $id_for_old, $result_temp[1]);
142
  }
143
+
144
+ }
145
  return $all_files;
146
  }
147
+
148
  return $all_files;
149
  }
150
 
216
  $wp_username = '';
217
  $wp_useremail = '';
218
  }
219
+ $ip = $_SERVER['REMOTE_ADDR'];
220
+
221
  $chgnac = TRUE;
222
  $all_files = array();
223
  $paypal = array();
246
  $label_label = array();
247
  $label_type = array();
248
 
249
+ $disabled_fields = explode(',', (isset($_REQUEST["disabled_fields".$id]) ? $_REQUEST["disabled_fields".$id] : ""));
250
+ $disabled_fields = array_slice($disabled_fields,0, count($disabled_fields)-1);
251
 
252
  if($old == false || ($old == true && $form->form=='')) {
253
  $label_all = explode('#****#',$form->label_order_current);
266
  $max = $wpdb->get_var("SELECT MAX( group_id ) FROM " . $wpdb->prefix . "formmaker_submits");
267
  $fvals=array();
268
  if ($old == FALSE || ($old == TRUE && $form->form == '')) {
269
+ foreach ($label_type as $key => $type) {
270
+ $value = '';
271
+ if ($type == "type_submit_reset" or $type == "type_map" or $type == "type_editor" or $type == "type_captcha" or $type == "type_arithmetic_captcha" or $type == "type_recaptcha" or $type == "type_button" or $type == "type_paypal_total" or $type == "type_send_copy")
272
+ continue;
273
+
274
+ $i = $label_id[$key];
275
+ if(!in_array($i,$disabled_fields)) {
276
+ switch ($type) {
277
+ case 'type_text':
278
+ case 'type_password':
279
+ case 'type_textarea':
280
+ case "type_submitter_mail":
281
+ case "type_date":
282
+ case "type_own_select":
283
+ case "type_country":
284
+ case "type_number": {
285
+ $value = isset($_POST['wdform_'.$i."_element".$id]) ? esc_html($_POST['wdform_'.$i."_element".$id]) : "";
286
+ break;
287
+ }
288
+ case "type_wdeditor": {
289
+ $value = isset($_POST['wdform_'.$i.'_wd_editor'.$id]) ? esc_html($_POST['wdform_'.$i.'_wd_editor'.$id]) : "";
290
+ break;
291
+ }
292
+ case "type_mark_map": {
293
+ $value = (isset($_POST['wdform_'.$i."_long".$id]) ? $_POST['wdform_'.$i."_long".$id] : "") . '***map***' . (isset($_POST['wdform_'.$i."_lat".$id]) ? $_POST['wdform_'.$i."_lat".$id] : "");
294
+ break;
295
+ }
296
+ case "type_date_fields": {
297
+ $value = (isset($_POST['wdform_'.$i."_day".$id]) ? $_POST['wdform_'.$i."_day".$id] : "") . '-' . (isset($_POST['wdform_'.$i."_month".$id]) ? $_POST['wdform_'.$i."_month".$id] : "") . '-' . (isset($_POST['wdform_'.$i."_year".$id]) ? $_POST['wdform_'.$i."_year".$id] : "");
298
+ break;
299
+ }
300
+ case "type_time": {
301
+ $ss = isset($_POST['wdform_'.$i."_ss".$id]) ? $_POST['wdform_'.$i."_ss".$id] : NULL;
302
+ if(isset($ss)) {
303
+ $value = (isset($_POST['wdform_'.$i."_hh".$id]) ? $_POST['wdform_'.$i."_hh".$id] : "") . ':' . (isset($_POST['wdform_'.$i."_mm".$id]) ? $_POST['wdform_'.$i."_mm".$id] : "") . ':' . (isset($_POST['wdform_'.$i."_ss".$id]) ? $_POST['wdform_'.$i."_ss".$id] : "");
304
+ }
305
+ else {
306
+ $value = (isset($_POST['wdform_'.$i."_hh".$id]) ? $_POST['wdform_'.$i."_hh".$id] : "") . ':' . (isset($_POST['wdform_'.$i."_mm".$id]) ? $_POST['wdform_'.$i."_mm".$id] : "");
307
+ }
308
+ $am_pm = isset($_POST['wdform_'.$i."_am_pm".$id]) ? $_POST['wdform_'.$i."_am_pm".$id] : NULL;
309
+ if(isset($am_pm)) {
310
+ $value = $value . ' ' . $am_pm;
311
+ }
312
+ break;
313
+ }
314
+ case "type_phone": {
315
+ $value = (isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : "") . ' ' . (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : "");
316
+ break;
317
+ }
318
+ case "type_name": {
319
+ $element_title = isset($_POST['wdform_'.$i."_element_title".$id]) ? esc_html($_POST['wdform_'.$i."_element_title".$id]) : NULL;
320
+ if(isset($element_title)) {
321
+ $value = (isset($_POST['wdform_'.$i."_element_title".$id]) ? esc_html($_POST['wdform_'.$i."_element_title".$id]) : "") . '@@@' . (isset($_POST['wdform_'.$i."_element_first".$id]) ? esc_html($_POST['wdform_'.$i."_element_first".$id]) : "") . '@@@' . (isset($_POST['wdform_'.$i."_element_last".$id]) ? esc_html($_POST['wdform_'.$i."_element_last".$id]) : "") . '@@@' . (isset($_POST['wdform_'.$i."_element_middle".$id]) ? esc_html($_POST['wdform_'.$i."_element_middle".$id]) : "");
322
+ }
323
+ else {
324
+ $value = (isset($_POST['wdform_'.$i."_element_first".$id]) ? esc_html($_POST['wdform_'.$i."_element_first".$id]) : "") . '@@@' . (isset($_POST['wdform_'.$i."_element_last".$id]) ? esc_html($_POST['wdform_'.$i."_element_last".$id]) : "");
325
+ }
326
+ break;
327
+ }
328
+ case "type_file_upload": {
329
+ $files = isset($_FILES['wdform_'.$i.'_file'.$id]) ? $_FILES['wdform_'.$i.'_file'.$id] : NULL;
330
+ foreach($files['name'] as $file_key => $file_name) {
331
+ if($file_name) {
332
+ $untilupload = $form->form_fields;
333
+ $untilupload = substr($untilupload, strpos($untilupload,$i.'*:*id*:*type_file_upload'), -1);
334
+ $untilupload = substr($untilupload, 0, strpos($untilupload,'*:*new_field*:'));
335
+ $untilupload = explode('*:*w_field_label_pos*:*',$untilupload);
336
+ $untilupload = $untilupload[1];
337
+ $untilupload = explode('*:*w_destination*:*',$untilupload);
338
+ $destination = $untilupload[0];
339
+ $destination = str_replace(site_url() . '/', '', $destination);
340
+ $untilupload = $untilupload[1];
341
+ $untilupload = explode('*:*w_extension*:*',$untilupload);
342
+ $extension = $untilupload[0];
343
+ $untilupload = $untilupload[1];
344
+ $untilupload = explode('*:*w_max_size*:*',$untilupload);
345
+ $max_size = $untilupload[0];
346
+ $untilupload = $untilupload[1];
347
+ $fileName = $files['name'][$file_key];
348
+ $fileSize = $files['size'][$file_key];
 
349
 
350
+ if($fileSize > $max_size * 1024) {
351
+ echo "<script> alert('" . addslashes(__('The file exceeds the allowed size of', 'form_maker')) . $max_size . " KB');</script>";
352
+ return array($max+1);
353
+ }
354
 
355
+ $uploadedFileNameParts = explode('.',$fileName);
356
+ $uploadedFileExtension = array_pop($uploadedFileNameParts);
357
+ $to = strlen($fileName) - strlen($uploadedFileExtension) - 1;
358
+
359
+ $fileNameFree = substr($fileName, 0, $to);
360
+ $invalidFileExts = explode(',', $extension);
361
+ $extOk = false;
362
 
363
+ foreach($invalidFileExts as $key => $valuee) {
364
+ if(is_numeric(strpos(strtolower($valuee), strtolower($uploadedFileExtension)))) {
365
+ $extOk = true;
366
+ }
367
+ }
368
+
369
+ if ($extOk == false) {
370
+ echo "<script> alert('" . addslashes(__('Sorry, you are not allowed to upload this type of file.', 'form_maker')) . "');</script>";
371
+ return array($max+1);
372
+ }
373
+
374
+ $fileTemp = $files['tmp_name'][$file_key];
375
+ $p = 1;
376
+
377
+ if(!file_exists($destination))
378
+ mkdir($destination , 0777);
379
+ if (file_exists($destination . "/" . $fileName)) {
380
+ $fileName1 = $fileName;
381
+ while (file_exists($destination . "/" . $fileName1)) {
382
+ $to = strlen($file_name) - strlen($uploadedFileExtension) - 1;
383
+ $fileName1 = substr($fileName, 0, $to) . '(' . $p . ').' . $uploadedFileExtension;
384
+ // $file['name'] = $fileName;
385
+ $p++;
386
+ }
387
+ $fileName = $fileName1;
388
+ }
389
+
390
+ // for dropbox & google drive integration addons
391
+ $check_both = 0;
392
+ if($form->save_uploads == 0){
393
+ if(defined('WD_FM_DBOX_INT') && is_plugin_active(constant('WD_FM_DBOX_INT'))){
394
+ $enable = $wpdb->get_var("SELECT enable FROM " . $wpdb->prefix ."formmaker_dbox_int WHERE form_id=" . $form->id);
395
+ if($enable == 1){
396
+ $selectable_upload = $wpdb->get_var("SELECT selectable_upload FROM " . $wpdb->prefix ."formmaker_dbox_int WHERE form_id=" . $form->id);
397
 
398
+ if((int)$selectable_upload == 1){
399
+ $temp_dir_dbox = explode('\\', $fileTemp);
400
+ $temp_dir_dbox = implode('%%', $temp_dir_dbox);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
401
 
402
+ $value.= $temp_dir_dbox . '*@@url@@*' . $fileName;
403
+ }
404
+ else{
405
+ $dlink_dbox = '<a href="'.add_query_arg(array('action' => 'WD_FM_DBOX_INT', 'addon_task' => 'upload_dbox_file', 'id' => $form->id), admin_url('admin-ajax.php')).'&dbox_file_name=' . $fileName . '&dbox_folder_name=/'.$form->title.'" >' . $fileName . '</a>';
 
 
 
 
406
 
407
+ $value.= $dlink_dbox;
408
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
409
 
410
+ $files['tmp_name'][$file_key]=$fileTemp;
411
+ $temp_file = array( "name" => $files['name'][$file_key], "type" => $files['type'][$file_key], "tmp_name" => $files['tmp_name'][$file_key]);
412
+ }
413
+ else
414
+ $check_both ++;
415
+
416
+ }
417
+ else
418
+ $check_both ++;
419
+ if(defined('WD_FM_GDRIVE_INT') && is_plugin_active(constant('WD_FM_GDRIVE_INT'))){
420
+ $enable = $wpdb->get_var("SELECT enable FROM " . $wpdb->prefix ."formmaker_gdrive_int WHERE form_id=" . $form->id);
421
+ if($enable == 1){
422
+ $selectable_upload = $wpdb->get_var("SELECT selectable_upload FROM " . $wpdb->prefix ."formmaker_gdrive_int WHERE form_id=" . $form->id);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
423
 
424
+ if((int)$selectable_upload == 1){
425
+ $temp_dir_dbox = explode('\\', $fileTemp);
426
+ $temp_dir_dbox = implode('%%', $temp_dir_dbox);
427
+ $value.= 'wdCloudAddon' . $temp_dir_dbox . '*@@url@@*' . $fileName . '*@@url@@*' . $files['type'][$file_key];
428
+ }
429
+ else{
430
+ $dlink_dbox = '<a target="_blank" href="'.add_query_arg(array('action' => 'WD_FM_GDRIVE_INT', 'addon_task' => 'create_drive_link', 'id' => $form->id), admin_url('admin-ajax.php')).'&gdrive_file_name=' . $fileName . '&gdrive_folder_name='.$form->title.'" >' . $fileName . '</a>';
431
+ $value.= $dlink_dbox;
432
+ }
 
 
433
 
434
+ $files['tmp_name'][$file_key]=$fileTemp;
435
+ $temp_file = array( "name" => $files['name'][$file_key], "type" => $files['type'][$file_key], "tmp_name" => $files['tmp_name'][$file_key]);
436
+ }
437
+ else
438
+ $check_both ++;
439
+
440
+ }
441
+ else
442
+ $check_both ++;
443
+
444
+ }
445
+ //
446
+ if($check_both != 0){
447
+ $value.= '';
448
+ $files['tmp_name'][$file_key]=$fileTemp;
449
+ $temp_file = array( "name" => $files['name'][$file_key], "type" => $files['type'][$file_key], "tmp_name" => $files['tmp_name'][$file_key]);
450
+ }
451
+ // dropbox and google drive integration addons
452
+ if($form->save_uploads == 1){
453
+ if(!move_uploaded_file($fileTemp, ABSPATH . $destination . '/' . $fileName)) {
454
+ echo "<script> alert('" . addslashes(__('Error, file cannot be moved.', 'form_maker')) . "');</script>";
455
+ return array($max+1);
456
+ }
457
+ $value.= site_url() . '/' . $destination . '/' . $fileName . '*@@url@@*';
458
+ $files['tmp_name'][$file_key]=$destination . "/" . $fileName;
459
+ $temp_file = array( "name" => $files['name'][$file_key], "type" => $files['type'][$file_key], "tmp_name" => $files['tmp_name'][$file_key]);
460
 
461
+ }
462
+ array_push($all_files,$temp_file);
463
+ }
464
+ }
465
+ break;
466
+ }
467
+
468
+ case 'type_address': {
469
+ $value = '*#*#*#';
470
+ $element = isset($_POST['wdform_'.$i."_street1".$id]) ? esc_html($_POST['wdform_'.$i."_street1".$id]) : NULL;
471
+ if(isset($element)) {
472
+ $value = $element;
473
+ break;
474
+ }
475
+
476
+ $element = isset($_POST['wdform_'.$i."_street2".$id]) ? esc_html($_POST['wdform_'.$i."_street2".$id]) : NULL;
477
+ if(isset($element)) {
478
+ $value = $element;
479
+ break;
480
+ }
481
+
482
+ $element = isset($_POST['wdform_'.$i."_city".$id]) ? esc_html($_POST['wdform_'.$i."_city".$id]) : NULL;
483
+ if(isset($element)) {
484
+ $value = $element;
485
+ break;
486
+ }
487
+
488
+ $element = isset($_POST['wdform_'.$i."_state".$id]) ? esc_html($_POST['wdform_'.$i."_state".$id]) : NULL;
489
+ if(isset($element)) {
490
+ $value = $element;
491
+ break;
492
+ }
493
+
494
+ $element = isset($_POST['wdform_'.$i."_postal".$id]) ? esc_html($_POST['wdform_'.$i."_postal".$id]) : NULL;
495
+ if(isset($element)) {
496
+ $value = $element;
497
+ break;
498
+ }
499
+
500
+ $element = isset($_POST['wdform_'.$i."_country".$id]) ? esc_html($_POST['wdform_'.$i."_country".$id]) : NULL;
501
+ if(isset($element)) {
502
+ $value = $element;
503
+ break;
504
+ }
505
+ break;
506
+ }
507
+
508
+ case "type_hidden": {
509
+ $value = isset($_POST[$label_label[$key]]) ? esc_html($_POST[$label_label[$key]]) : "";
510
+ break;
511
+ }
512
+
513
+ case "type_radio": {
514
+ $element = isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL;
515
+ if(isset($element)) {
516
+ $value = $element;
517
+ break;
518
+ }
519
+ $value = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : "";
520
+ break;
521
+ }
522
+
523
+ case "type_checkbox": {
524
+ $start = -1;
525
+ $value = '';
526
+ for($j = 0; $j < 100; $j++) {
527
+ $element = isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL;
528
+ if(isset($element)) {
529
+ $start = $j;
530
+ break;
531
+ }
532
+ }
533
+
534
+ $other_element_id = -1;
535
+ $is_other = isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : "";
536
+ if($is_other == "yes") {
537
+ $other_element_id = isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : "";
538
+ }
539
+
540
+ if($start != -1) {
541
+ for($j = $start; $j < 100; $j++) {
542
+ $element = isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL;
543
+ if(isset($element)) {
544
+ if($j == $other_element_id) {
545
+ $value = $value . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : "") . '***br***';
546
+ }
547
+ else {
548
+ $value = $value . (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : "") . '***br***';
549
+ }
550
+ }
551
+ }
552
+ }
553
+ break;
554
+ }
555
+
556
+ case "type_paypal_price": {
557
+ $value = isset($_POST['wdform_'.$i."_element_dollars".$id]) ? $_POST['wdform_'.$i."_element_dollars".$id] : 0;
558
 
559
+ $value = (int) preg_replace('/\D/', '', $value);
560
+
561
+ if(isset($_POST['wdform_'.$i."_element_cents".$id])) {
562
+ $value = $value . '.' . ( preg_replace('/\D/', '', $_POST['wdform_'.$i."_element_cents".$id]));
563
+ }
564
+
565
+ $total += (float)($value);
566
+ $paypal_option = array();
567
+
568
+ if($value != 0) {
569
+ $quantity = (isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : 1);
570
+ array_push ($paypal['item_name'], $label_label[$key]);
571
+ array_push ($paypal['quantity'], $quantity);
572
+ array_push ($paypal['amount'], $value);
573
+ $is_amount=true;
574
+ array_push ($paypal['on_os'], $paypal_option);
575
+ }
576
+ $value = $value . $form_currency;
577
+ break;
578
+ }
579
+
580
+ case "type_paypal_select": {
581
+ if(isset($_POST['wdform_'.$i."_element_label".$id]) && $_POST['wdform_'.$i."_element".$id] !='') {
582
+ $value = $_POST['wdform_'.$i."_element_label".$id] . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : "") . $form_currency;
583
+ }
584
+ else {
585
+ $value = '';
586
+ }
587
+ $quantity = (isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : 1);
588
+ $total += (float)(isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : 0) * $quantity;
589
+ array_push ($paypal['item_name'], $label_label[$key] . ' ' . (isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : ""));
590
+ array_push ($paypal['quantity'], $quantity);
591
+ array_push ($paypal['amount'], (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : ""));
592
+ if(isset($_POST['wdform_'.$i."_element".$id]) && $_POST['wdform_'.$i."_element".$id] != 0) {
593
+ $is_amount=true;
594
+ }
595
+ $element_quantity = isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL;
596
+ if(isset($element_quantity) && $value != '') {
597
+ $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : "") . ': ' . $_POST['wdform_'.$i."_element_quantity".$id] . '***quantity***';
598
+ }
599
+ $paypal_option = array();
600
+ $paypal_option['on'] = array();
601
+ $paypal_option['os'] = array();
602
+
603
+ for($k = 0; $k < 50; $k++) {
604
+ $temp_val = isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL;
605
+ if(isset($temp_val) && $value != '') {
606
+ array_push ($paypal_option['on'], (isset($_POST['wdform_'.$i."_element_property_label".$id.$k]) ? $_POST['wdform_'.$i."_element_property_label".$id.$k] : ""));
607
+ array_push ($paypal_option['os'], (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : ""));
608
+ $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_property_label".$id.$k]) ? $_POST['wdform_'.$i."_element_property_label".$id.$k] : "") . ': ' . (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : "") . '***property***';
609
+ }
610
+ }
611
+ array_push ($paypal['on_os'], $paypal_option);
612
+ break;
613
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
614
 
615
+ case "type_paypal_radio": {
616
+ if(isset($_POST['wdform_'.$i."_element_label".$id])) {
617
+ $value = $_POST['wdform_'.$i."_element_label".$id] . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : "") . $form_currency;
618
+ }
619
+ else {
620
+ $value = '';
621
+ }
622
+ $quantity = (isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : 1);
623
+ $total += (float)(isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : 0) * $quantity;
624
+ array_push ($paypal['item_name'], $label_label[$key] . ' ' . (isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : ""));
625
+ array_push ($paypal['quantity'], $quantity);
626
+ array_push ($paypal['amount'], (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : 0));
627
+ if(isset($_POST['wdform_'.$i."_element".$id]) && $_POST['wdform_'.$i."_element".$id] != 0) {
628
+ $is_amount=true;
629
+ }
630
+
631
+ $element_quantity = isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL;
632
+ if(isset($element_quantity) && $value != '') {
633
+ $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : "") . ': ' . $_POST['wdform_'.$i."_element_quantity".$id] . '***quantity***';
634
+ }
635
+
636
+ $paypal_option = array();
637
+ $paypal_option['on'] = array();
638
+ $paypal_option['os'] = array();
639
 
640
+ for($k = 0; $k < 50; $k++) {
641
+ $temp_val = isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL;
642
+ if(isset($temp_val) && $value != '') {
643
+ array_push ($paypal_option['on'], (isset($_POST['wdform_'.$i."_element_property_label".$id.$k]) ? $_POST['wdform_'.$i."_element_property_label".$id.$k] : ""));
644
+ array_push ($paypal_option['os'], $_POST['wdform_'.$i."_property".$id.$k]);
645
+ $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_property_label".$id.$k]) ? $_POST['wdform_'.$i."_element_property_label".$id.$k] : "") . ': ' . $_POST['wdform_'.$i."_property".$id.$k] . '***property***';
646
+ }
647
+ }
648
+ array_push ($paypal['on_os'], $paypal_option);
649
+ break;
650
+ }
 
 
 
 
 
651
 
652
+ case "type_paypal_shipping": {
653
+ if(isset($_POST['wdform_'.$i."_element_label".$id])) {
654
+ $value = $_POST['wdform_'.$i."_element_label".$id] . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : "") . $form_currency;
655
+ }
656
+ else {
657
+ $value = '';
658
+ }
659
+ $value = (isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : "") . ' - ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : "") . $form_currency;
660
+ $paypal['shipping'] = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : "";
661
+ break;
662
+ }
663
+
664
+ case "type_paypal_checkbox": {
665
+ $start = -1;
666
+ $value = '';
667
+ for($j = 0; $j < 100; $j++) {
668
+ $element = isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL;
669
+ if(isset($element)) {
670
+ $start = $j;
671
+ break;
672
+ }
673
+ }
674
+
675
+ $other_element_id = -1;
676
+ $is_other = isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : "";
677
+ if($is_other == "yes") {
678
+ $other_element_id = isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : "";
679
+ }
680
+
681
+ if($start != -1) {
682
+ for($j = $start; $j < 100; $j++) {
683
+ $element = isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL;
684
+ if(isset($element)) {
685
+ if($j == $other_element_id) {
686
+ $value = $value . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : "") . '***br***';
687
+ }
688
+ else {
689
+ $value = $value . (isset($_POST['wdform_'.$i."_element".$id.$j."_label"]) ? $_POST['wdform_'.$i."_element".$id.$j."_label"] : "") . ' - ' . (isset($_POST['wdform_'.$i."_element".$id.$j]) && $_POST['wdform_'.$i."_element".$id.$j] == '' ? '0' : (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : "")) . $form_currency . '***br***';
690
+ $quantity = ((isset($_POST['wdform_' . $i . "_element_quantity" . $id]) && ($_POST['wdform_' . $i . "_element_quantity" . $id] >= 1)) ? $_POST['wdform_'.$i . "_element_quantity" . $id] : 1);
691
+ $total += (float)(isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : 0) * (float)($quantity);
692
+ array_push ($paypal['item_name'], $label_label[$key] . ' ' . (isset($_POST['wdform_'.$i."_element".$id.$j."_label"]) ? $_POST['wdform_'.$i."_element".$id.$j."_label"] : ""));
693
+ array_push ($paypal['quantity'], $quantity);
694
+ array_push ($paypal['amount'], (isset($_POST['wdform_'.$i."_element".$id.$j]) ? ($_POST['wdform_'.$i."_element".$id.$j] == '' ? '0' : $_POST['wdform_'.$i."_element".$id.$j]) : ""));
695
+ if (isset($_POST['wdform_'.$i."_element".$id.$j]) && $_POST['wdform_'.$i."_element".$id.$j] != 0) {
696
+ $is_amount = TRUE;
697
+ }
698
+ $paypal_option = array();
699
+ $paypal_option['on'] = array();
700
+ $paypal_option['os'] = array();
701
+
702
+ for($k = 0; $k < 50; $k++) {
703
+ $temp_val = isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL;
704
+ if(isset($temp_val)) {
705
+ array_push ($paypal_option['on'], isset($_POST['wdform_'.$i."_element_property_label".$id.$k]) ? $_POST['wdform_'.$i."_element_property_label".$id.$k] : "");
706
+ array_push ($paypal_option['os'], $_POST['wdform_'.$i."_property".$id.$k]);
707
+ }
708
+ }
709
+ array_push ($paypal['on_os'], $paypal_option);
710
+ }
711
+ }
712
+ }
713
+
714
+ $element_quantity = isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL;
715
+ if(isset($element_quantity)) {
716
+ $value .= (isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : "") . ': ' . $_POST['wdform_'.$i."_element_quantity".$id] . '***quantity***';
717
+ }
718
+ for($k = 0; $k < 50; $k++) {
719
+ $temp_val = isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL;
720
+ if(isset($temp_val)) {
721
+ $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_property_label".$id.$k]) ? $_POST['wdform_'.$i."_element_property_label".$id.$k] : "") . ': ' . $_POST['wdform_'.$i."_property".$id.$k] . '***property***';
722
+ }
723
+ }
724
+ }
725
+ break;
726
+ }
727
+
728
+ case "type_star_rating": {
729
+ if(isset($_POST['wdform_'.$i."_selected_star_amount".$id]) && $_POST['wdform_'.$i."_selected_star_amount".$id] == "") {
730
+ $selected_star_amount = 0;
731
+ }
732
+ else {
733
+ $selected_star_amount = isset($_POST['wdform_'.$i."_selected_star_amount".$id]) ? $_POST['wdform_'.$i."_selected_star_amount".$id] : 0;
734
+ }
735
+ $value = $selected_star_amount . '/' . (isset($_POST['wdform_'.$i."_star_amount".$id]) ? $_POST['wdform_'.$i."_star_amount".$id] : "");
736
+ break;
737
+ }
738
+
739
+ case "type_scale_rating": {
740
+ $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] : "");
741
+ break;
742
+ }
743
+
744
+ case "type_spinner": {
745
+ $value = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : "";
746
+ break;
747
+ }
748
+
749
+ case "type_slider": {
750
+ $value = isset($_POST['wdform_'.$i."_slider_value".$id]) ? $_POST['wdform_'.$i."_slider_value".$id] : "";
751
+ break;
752
+ }
753
+
754
+ case "type_range": {
755
+ $value = (isset($_POST['wdform_'.$i."_element".$id.'0']) ? $_POST['wdform_'.$i."_element".$id.'0'] : "") . '-' . (isset($_POST['wdform_'.$i."_element".$id.'1']) ? $_POST['wdform_'.$i."_element".$id.'1'] : "");
756
+ break;
757
+ }
758
+
759
+ case "type_grading": {
760
+ $value = "";
761
+ $items = explode(":", isset($_POST['wdform_'.$i."_hidden_item".$id]) ? $_POST['wdform_'.$i."_hidden_item".$id] : "");
762
+ for($k = 0; $k < sizeof($items) - 1; $k++) {
763
+ $value .= (isset($_POST['wdform_'.$i."_element".$id.'_'.$k]) ? $_POST['wdform_'.$i."_element".$id.'_'.$k] : "") . ':';
764
+ }
765
+ $value .= (isset($_POST['wdform_'.$i."_hidden_item".$id]) ? $_POST['wdform_'.$i."_hidden_item".$id] : "") . '***grading***';
766
+ break;
767
+ }
768
+
769
+ case "type_matrix": {
770
+ $rows_of_matrix = explode("***", isset($_POST['wdform_'.$i."_hidden_row".$id]) ? $_POST['wdform_'.$i."_hidden_row".$id] : "");
771
+ $rows_count = sizeof($rows_of_matrix) - 1;
772
+ $column_of_matrix = explode("***", isset($_POST['wdform_'.$i."_hidden_column".$id]) ? $_POST['wdform_'.$i."_hidden_column".$id] : "");
773
+ $columns_count = sizeof($column_of_matrix) - 1;
774
+
775
+ if(isset($_POST['wdform_'.$i."_input_type".$id]) && $_POST['wdform_'.$i."_input_type".$id] == "radio") {
776
+ $input_value = "";
777
+ for($k = 1; $k <= $rows_count; $k++) {
778
+ $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k]) ? $_POST['wdform_'.$i."_input_element".$id.$k] : 0) . "***";
779
+ }
780
+ }
781
+ if(isset($_POST['wdform_'.$i."_input_type".$id]) && $_POST['wdform_'.$i."_input_type".$id] == "checkbox") {
782
+ $input_value = "";
783
+ for($k = 1; $k <= $rows_count; $k++) {
784
+ for($j = 1; $j <= $columns_count; $j++) {
785
+ $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j] : 0)."***";
786
+ }
787
+ }
788
+ }
789
+
790
+ if(isset($_POST['wdform_'.$i."_input_type".$id]) && $_POST['wdform_'.$i."_input_type".$id] == "text") {
791
+ $input_value = "";
792
+ for($k = 1; $k <= $rows_count; $k++) {
793
+ for($j = 1; $j <= $columns_count; $j++) {
794
+ $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? esc_html($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) : "") . "***";
795
+ }
796
+ }
797
+ }
798
+
799
+ if(isset($_POST['wdform_'.$i."_input_type".$id]) && $_POST['wdform_'.$i."_input_type".$id] == "select") {
800
+ $input_value = "";
801
+ for($k = 1; $k <= $rows_count; $k++) {
802
+ for($j = 1; $j <= $columns_count; $j++) {
803
+ $input_value .= (isset($_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j] : "") . "***";
804
+ }
805
+ }
806
+ }
807
+
808
+ $value = $rows_count . (isset($_POST['wdform_'.$i."_hidden_row".$id]) ? $_POST['wdform_'.$i."_hidden_row".$id] : "") . '***' . $columns_count . (isset($_POST['wdform_'.$i."_hidden_column".$id]) ? $_POST['wdform_'.$i."_hidden_column".$id] : "") . '***' . (isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : "") . '***' . $input_value . '***matrix***';
809
+ break;
810
+ }
811
+
812
+ }
813
+
814
+ if($type == "type_address") {
815
+ if( $value == '*#*#*#') {
816
+ continue;
817
+ }
818
+ }
819
+ if($type == "type_text" or $type == "type_password" or $type == "type_textarea" or $type == "type_name" or $type == "type_submitter_mail" or $type == "type_number" or $type == "type_phone")
820
+ {
821
+ $untilupload = $form->form_fields;
822
+ $untilupload = substr($untilupload, strpos($untilupload, $i.'*:*id*:*'.$type), -1);
823
+ $untilupload = substr($untilupload, 0, strpos($untilupload, '*:*new_field*:'));
824
+ $untilupload = explode('*:*w_required*:*', $untilupload);
825
+ $untilupload = $untilupload[1];
826
+ $untilupload = explode('*:*w_unique*:*', $untilupload);
827
+ $unique_element = $untilupload[0];
828
+ if(strlen($unique_element)>3)
829
+ $unique_element = substr($unique_element, -3);
830
+
831
+ if($unique_element == 'yes') {
832
+ $unique = $wpdb->get_col($wpdb->prepare("SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id= %d and element_label= %s and element_value= %s", $id, $i, addslashes($value)));
833
+ if ($unique) {
834
+ echo "<script> alert('" . addslashes(__('This field %s requires a unique entry and this value was already submitted.', 'form_maker')) . "'.replace('%s','" . $label_label[$key] . "'));</script>";
835
+ return array($max + 1);
836
+ }
837
+ }
838
+ }
839
+ $save_or_no = TRUE;
840
+ $fvals['{'.$i.'}']=str_replace(array("***map***", "*@@url@@*", "@@@@@@@@@", "@@@", "***grading***", "***br***"), array(" ", "", " ", " ", " ", ", "), addslashes($value));
841
+ if ($form->savedb) {
842
+ $save_or_no = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
843
+ 'form_id' => $id,
844
+ 'element_label' => $i,
845
+ 'element_value' => stripslashes($value),
846
+ 'group_id' => ($max + 1),
847
+ 'date' => date('Y-m-d H:i:s'),
848
+ 'ip' => $_SERVER['REMOTE_ADDR'],
849
+ 'user_id_wd' => $current_user->ID,
850
+ ), array(
851
+ '%d',
852
+ '%s',
853
+ '%s',
854
+ '%d',
855
+ '%s',
856
+ '%s',
857
+ '%d'
858
+ ));
859
+ }
860
+ if (!$save_or_no) {
861
+ return FALSE;
862
+ }
863
+ $chgnac = FALSE;
864
+ }
865
+ }
866
  }
867
  else {
868
  foreach ($label_type as $key => $type) {
869
  $value = '';
870
+ if ($type == "type_submit_reset" or $type == "type_map" or $type == "type_editor" or $type == "type_captcha" or $type == "type_arithmetic_captcha" or $type == "type_recaptcha" or $type == "type_button" or $type=="type_paypal_total")
871
  continue;
872
  $i = $label_id[$key];
873
  if ($type != "type_address") {
962
  }
963
  $fileTemp = $file['tmp_name'];
964
  $p = 1;
965
+
966
+ if(!file_exists($destination))
967
+ mkdir($destination , 0777);
968
+
969
  if (file_exists($destination . "/" . $fileName)) {
970
  $fileName1 = $filename;
971
  while (file_exists($destination . "/" . $fileName1)) {
1299
  return array($max + 1);
1300
  }
1301
  }
1302
+
1303
  $r = $wpdb->prefix . "formmaker_submits";
1304
 
1305
  $save_or_no = $wpdb->insert($r, array(
1326
  }
1327
  }
1328
 
1329
+
1330
  $subid = $wpdb->get_var("SELECT MAX( group_id ) FROM " . $wpdb->prefix ."formmaker_submits" );
1331
  $user_fields = array("subid"=>$subid, "ip"=>$ip, "userid"=>$wp_userid, "username"=>$wp_username, "useremail"=>$wp_useremail);
1332
 
1333
  $queries = $wpdb->get_results( $wpdb->prepare("SELECT * FROM " .$wpdb->prefix. "formmaker_query WHERE form_id=%d",(int)$id ));
 
1334
  if($queries)
1335
  {
1336
  foreach($queries as $query)
1352
  $temp = explode('***wdfdatabasewdf***',$temp[1]);
1353
  $database = $temp[0];
1354
 
1355
+ $query=str_replace(array_keys($fvals), $fvals ,$query->query);
1356
  foreach($user_fields as $user_key=>$user_field)
1357
+ $query=str_replace('{'.$user_key.'}', $user_field , $query);
1358
+
1359
  if($con_type == 'remote')
1360
  {
1361
  $wpdb_temp = new wpdb($username, $password, $database, $host);
1362
+ $wpdb_temp->query($query);
1363
  }
1364
  else {
1365
  $wpdb->query($query);
1367
  }
1368
  // $wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
1369
  }
1370
+
1371
+ $addons = array('WD_FM_MAILCHIMP' => 'MailChimp', 'WD_FM_REG' => 'Registration');
1372
+ foreach($addons as $addon => $addon_name)
1373
+ {
1374
+ if (defined($addon) && is_plugin_active(constant($addon))) {
1375
+ $_GET['addon_task']='frontend';
1376
+ $_GET['form_id']=$id;
1377
+ $GLOBALS['fvals']=$fvals;
1378
+ do_action($addon.'_init');
1379
+ }
1380
+ }
1381
+
1382
  $str = '';
1383
 
1384
  if ($form->paypal_mode) {
1532
 
1533
 
1534
  if ($chgnac) {
1535
+ global $wpdb;
1536
+ if ($form->submit_text_type != 4) {
1537
+ $_SESSION['massage_after_submit' . $id] = addslashes(addslashes(__('Nothing was submitted.', 'form_maker')));
1538
+ }
1539
+ $_SESSION['error_or_no' . $id] = 1;
1540
+ $_SESSION['form_submit_type' . $id] = $form->submit_text_type . "," . $form->id;
1541
+ wp_redirect($_SERVER["REQUEST_URI"]);
1542
+ exit;
1543
+ }
1544
+
1545
+ $addons = array('WD_FM_GDRIVE_INT' => 'GDriveInt', 'WD_FM_DBOX_INT' => 'DboxInt', 'WD_FM_POST_GEN' => 'PostGen'); // the sequence is important for google drive and drop box addons !!!!!!!!!!
1546
+ foreach($addons as $addon => $addon_name) {
1547
+ if (defined($addon) && is_plugin_active(constant($addon))) {
1548
+ $_GET['addon_task'] = 'frontend';
1549
+ $_GET['form_id'] = $id;
1550
+ $GLOBALS['all_files'] = json_encode($all_files);
1551
+ $GLOBALS['form_currency'] = $form_currency;
1552
+ do_action($addon.'_init');
1553
+ }
1554
  }
1555
  return array($all_files, $str);
1556
  }
1560
  $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id= %d', $group_id));
1561
  }
1562
 
1563
+ public function get_after_submission_text($form_id) {
1564
  global $wpdb;
1565
  $submit_text = $wpdb->get_var("SELECT submit_text FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'");
1566
  $current_user = wp_get_current_user();
1642
  }
1643
  }
1644
 
1645
+ public function gen_mail($counter, $all_files, $id, $str) {
1646
+ // checking save uploads option
1647
+ global $wpdb;
1648
+ $save_uploads = $wpdb->get_var("SELECT save_uploads FROM " . $wpdb->prefix ."formmaker WHERE id=" . $id);
1649
+ if($save_uploads == 0){
1650
+ $destination = 'wp-content/uploads/tmpAddon';
1651
+ if(!file_exists($destination))
1652
+ mkdir($destination , 0777);
1653
+
1654
+ foreach($all_files as &$all_file){
1655
+ $fileTemp = $all_file['tmp_name'];
1656
+ $fileName = $all_file['name'];
1657
+ if(!move_uploaded_file($fileTemp, ABSPATH . $destination . '/' . $fileName)) {
1658
+ echo "<script> alert('" . addslashes(__('Error, file cannot be moved.', 'form_maker')) . "');</script>";
1659
+ return array($max+1);
1660
+ }
1661
+
1662
+ $all_file['tmp_name'] = $destination . "/" . $fileName;
1663
+ }
1664
+ }
1665
  $ip = $_SERVER['REMOTE_ADDR'];
1666
  $replyto = '';
1667
  global $wpdb;
1734
  $i = $label_order_id;
1735
  $type = $label_type[$i];
1736
 
1737
+ if($type != "type_map" and $type != "type_submit_reset" and $type != "type_editor" and $type != "type_captcha" and $type != "type_arithmetic_captcha" and $type != "type_recaptcha" and $type != "type_button") {
1738
  $element_label=$label_order_original[$i];
1739
  if(!in_array($i,$disabled_fields)) {
1740
  switch ($type) {
1747
  case "type_number": {
1748
  $element = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL;
1749
  if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
1750
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td>' . $element . '</td></tr>';
1751
  $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1752
  }
1753
 
1756
  case "type_hidden": {
1757
  $element = isset($_POST[$element_label]) ? $_POST[$element_label] : NULL;
1758
  if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
1759
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td>' . $element . '</td></tr>';
1760
  $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1761
  }
1762
  break;
1772
  case "type_submitter_mail": {
1773
  $element = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL;
1774
  if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
1775
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element . '</td></tr>';
1776
  $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1777
  }
1778
  break;
1890
  }
1891
  $element = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL;
1892
  if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
1893
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element . '</td></tr>';
1894
  $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1895
  }
1896
  break;
1979
 
1980
  if($this->empty_field($value, $row->mail_emptyfields))
1981
  {
1982
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $value . '</td></tr>';
1983
  $list_text_mode=$list_text_mode.$element_label.' - '.str_replace('<br/>',', ',$value)."\r\n";
1984
  }
1985
  break;
2007
 
2008
  if($this->empty_field($value, $row->mail_emptyfields))
2009
  {
2010
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $value . '</td></tr>';
2011
  $list_text_mode=$list_text_mode.$element_label.' - '.str_replace('<br/>',', ',$value)."\r\n";
2012
  }
2013
  break;
2014
  }
2015
 
2016
+ case "type_paypal_shipping": {
2017
  if(isset($_POST['wdform_'.$i."_element".$id])) {
2018
  $value = $_POST['wdform_'.$i."_element_label".$id] . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : "") . $form_currency;
2019
 
2020
  if($this->empty_field($value, $row->mail_emptyfields))
2021
  {
2022
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $value . '</td></tr>';
2023
  $list_text_mode=$list_text_mode.$element_label.' - '.$value."\r\n";
2024
  }
2025
  }
2080
  $element = isset($_POST['wdform_'.$i."_paypal_total".$id]) ? $_POST['wdform_'.$i."_paypal_total".$id] : "";
2081
  if($this->empty_field($element, $row->mail_emptyfields))
2082
  {
2083
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element . '</td></tr>';
2084
  $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
2085
  }
2086
  break;
2090
  $element = isset($_POST['wdform_'.$i."_star_amount".$id]) ? $_POST['wdform_'.$i."_star_amount".$id] : NULL;
2091
  $selected = isset($_POST['wdform_'.$i."_selected_star_amount".$id]) ? $_POST['wdform_'.$i."_selected_star_amount".$id] : 0;
2092
  if(isset($element) && $this->empty_field($selected, $row->mail_emptyfields)) {
2093
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $selected . '/' . $element . '</td></tr>';
2094
  $list_text_mode=$list_text_mode.$element_label.' - '.$selected.'/'.$element."\r\n";
2095
  }
2096
  break;
2100
  $element = isset($_POST['wdform_'.$i."_scale_amount".$id]) ? $_POST['wdform_'.$i."_scale_amount".$id] : NULL;
2101
  $selected = isset($_POST['wdform_'.$i."_scale_radio".$id]) ? $_POST['wdform_'.$i."_scale_radio".$id] : 0;
2102
  if(isset($element) && $this->empty_field($selected, $row->mail_emptyfields)) {
2103
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $selected . '/' . $element . '</td></tr>';
2104
  $list_text_mode=$list_text_mode.$element_label.' - '.$selected.'/'.$element."\r\n";
2105
  }
2106
  break;
2109
  case "type_spinner": {
2110
  $element = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL;
2111
  if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
2112
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element . '</td></tr>';
2113
  $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
2114
  }
2115
  break;
2118
  case "type_slider": {
2119
  $element = isset($_POST['wdform_'.$i."_slider_value".$id]) ? $_POST['wdform_'.$i."_slider_value".$id] : NULL;
2120
  if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
2121
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element . '</td></tr>';
2122
  $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
2123
  }
2124
  break;
2128
  $element0 = isset($_POST['wdform_'.$i."_element".$id.'0']) ? $_POST['wdform_'.$i."_element".$id.'0'] : NULL;
2129
  $element1 = isset($_POST['wdform_'.$i."_element".$id.'1']) ? $_POST['wdform_'.$i."_element".$id.'1'] : NULL;
2130
  if((isset($element0) && $this->empty_field($element0, $row->mail_emptyfields)) || (isset($element1) && $this->empty_field($element1, $row->mail_emptyfields))) {
2131
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >From:' . $element0 . '<span style="margin-left:6px">To</span>:' . $element1 . '</td></tr>';
2132
  $list_text_mode=$list_text_mode.$element_label.' - From:'.$element0.' To:'.$element1."\r\n";
2133
  }
2134
  break;
2149
  }
2150
  $element .= "Total:" . $total;
2151
  if(isset($element) && $this->empty_field($form_empty_field, $row->mail_emptyfields)) {
2152
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element . '</td></tr>';
2153
  $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
2154
  }
2155
  break;
2221
  }
2222
  $matrix .= '</table>';
2223
  if(isset($matrix)) {
2224
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $matrix . '</td></tr>';
2225
  }
2226
  break;
2227
  }
2232
  }
2233
 
2234
  $list = $list . '</table>';
2235
+ if($row->sendemail) {
2236
+ $fromname = $row->mail_from_name_user;
2237
+ if($row->mail_subject_user)
2238
+ $subject = $row->mail_subject_user;
2239
+ else
2240
+ $subject = $row->title;
2241
+ if($row->reply_to_user) {
2242
+ $replyto = $row->reply_to_user;
2243
+ }
2244
+ $attachment_user = array();
2245
+ if ($row->mail_attachment_user) {
2246
+ for ($k = 0; $k < count($all_files); $k++) {
2247
+ if (isset($all_files[$k]['tmp_name'])) {
2248
+ $attachment_user[$k] = $all_files[$k]['tmp_name'];
 
 
2249
  }
2250
  }
2251
+ }
2252
 
2253
+ if ($row->mail_mode_user) {
2254
+ $content_type = "text/html";
2255
+ $mode = 1;
2256
+ $list_user = wordwrap($list, 70, "\n", true);
2257
+ $new_script = wpautop($row->script_mail_user);
2258
+ }
2259
+ else {
2260
+ $content_type = "text/plain";
2261
+ $mode = 0;
2262
+ $list_user = wordwrap($list_text_mode, 1000, "\n", true);
2263
+ $new_script = str_replace(array('<p>','</p>'),'',$row->script_mail_user);
2264
+ }
2265
+
2266
+ foreach($label_order_original as $key => $label_each) {
2267
+ $type=$label_type[$key];
2268
+ if(strpos($row->script_mail_user, "%".$label_each."%")>-1) {
2269
+ $new_value = $this->custom_fields_mail($type, $key, $id, $attachment_user, '');
2270
+ $new_script = str_replace("%".$label_each."%", $new_value, $new_script);
2271
  }
2272
 
2273
+ if(strpos($fromname, "%".$label_each."%")>-1) {
2274
+ $new_value = str_replace('<br>',', ',$this->custom_fields_mail($type, $key, $id, '', ''));
2275
+ if(substr($new_value, -2)==', ') {
2276
+ $new_value = substr($new_value, 0, -2);
 
2277
  }
2278
+ $fromname = str_replace("%".$label_each."%", $new_value, $fromname);
2279
+ }
2280
+
2281
+ if(strpos($subject, "%".$label_each."%")>-1) {
2282
+ $new_value = str_replace('<br>',', ',$this->custom_fields_mail($type, $key, $id, '', ''));
2283
+ if(substr($new_value, -2)==', ') {
2284
+ $new_value = substr($new_value, 0, -2);
 
 
 
 
 
 
 
 
2285
  }
2286
+ $subject = str_replace("%".$label_each."%", $new_value, $subject);
2287
  }
2288
+ }
2289
 
2290
+ $recipient = '';
2291
+ $cca = $row->mail_cc_user;
2292
+ $bcc = $row->mail_bcc_user;
2293
+ if ($row->mail_from_user != '') {
2294
+ if ($fromname != '') {
2295
+ $from = "From: '" . $fromname . "' <" . $row->mail_from_user . ">" . "\r\n";
2296
+ }
 
 
 
 
 
2297
  else {
2298
+ $from = "From: '' <" . $row->mail_from_user . ">" . "\r\n";
2299
  }
2300
+ }
2301
+ else {
2302
+ $from = '';
2303
+ }
2304
 
2305
+ $headers = $from . " Content-Type: " . $content_type . "; charset=\"" . get_option('blog_charset') . "\"\n";
2306
+ if ($replyto) {
2307
+ $headers .= "Reply-To: <" . $replyto . ">\r\n";
2308
+ }
2309
+ if ($cca) {
2310
+ $headers .= "Cc: <" . $cca . ">\r\n";
2311
+ }
2312
+ if ($bcc) {
2313
+ $headers .= "Bcc: <" . $bcc . ">\r\n";
2314
+ }
2315
 
2316
+ $custom_fields_value = array( $ip, $useremail, $username, $subid, $list_user );
2317
+ foreach($custom_fields as $key=>$custom_field)
2318
+ {
2319
+ if(strpos($new_script, "%".$custom_field."%")>-1)
2320
+ $new_script = str_replace("%".$custom_field."%", $custom_fields_value[$key], $new_script);
2321
 
2322
+ if($key==2 || $key==3)
2323
+ {
2324
+ if(strpos($fromname, "%".$custom_field."%")>-1)
2325
+ $fromname = str_replace("%".$custom_field."%", $custom_fields_value[$key], $fromname);
2326
+
2327
+ if(strpos($subject, "%".$custom_field."%")>-1)
2328
+ $subject = str_replace("%".$custom_field."%", $custom_fields_value[$key], $subject);
 
2329
  }
2330
+ }
2331
+ $body = $new_script;
2332
+ $GLOBALS['attachment_user'] = array();
2333
+ $GLOBALS['attachment'] = array();
2334
+ if (defined('WD_FM_PDF') && is_plugin_active(constant('WD_FM_PDF'))) {
2335
+ $_GET['addon_task'] = 'frontend';
2336
+ $_GET['form_id'] = $id;
2337
+ $_GET['form_currency'] = $form_currency;
2338
+ $GLOBALS['custom_fields_value'] = $custom_fields_value;
2339
+ do_action('WD_FM_PDF_init');
2340
+ }
2341
+ if(!empty($GLOBALS['attachment_user']))
2342
+ array_push($attachment_user, $GLOBALS['attachment_user']);
2343
+
2344
+ if($row->send_to) {
2345
+ $send_tos = explode('**',$row->send_to);
2346
  $send_copy = isset($_POST["wdform_send_copy_".$id]) ? $_POST["wdform_send_copy_".$id] : NULL;
 
2347
  if(isset($send_copy)) {
2348
  $send=true;
2349
  }
2364
  }
2365
  }
2366
  }
2367
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2368
 
2369
+ if($row->sendemail) {
2370
+ if($row->reply_to) {
2371
+ $replyto = isset($_POST['wdform_'.$row->reply_to."_element".$id]) ? $_POST['wdform_'.$row->reply_to."_element".$id] : NULL;
2372
+ if(!isset($replyto)) {
2373
+ $replyto = $row->reply_to;
2374
  }
2375
+ }
2376
+ $recipient = $row->mail;
2377
+ if($row->mail_subject) {
2378
+ $subject = $row->mail_subject;
2379
+ }
2380
+ else {
2381
+ $subject = $row->title;
2382
+ }
2383
+
2384
+ if ($row->from_name) {
2385
+ $fromname = $row->from_name;
2386
+ }
2387
+ else {
2388
+ $fromname = '';
2389
+ }
2390
+ $attachment = array();
2391
+ if ($row->mail_attachment) {
2392
+ for ($k = 0; $k < count($all_files); $k++) {
2393
+ if (isset($all_files[$k]['tmp_name'])) {
2394
+ $attachment[$k] = $all_files[$k]['tmp_name'];
2395
  }
2396
  }
2397
+ }
2398
+ if(!empty($GLOBALS['attachment']))
2399
+ array_push($attachment, $GLOBALS['attachment']);
2400
+
2401
 
2402
+ if ($row->mail_mode) {
2403
+ $content_type = "text/html";
2404
+ $mode = 1;
2405
+ $list = wordwrap($list, 70, "\n", true);
2406
+ $new_script = wpautop($row->script_mail);
2407
+ }
2408
+ else {
2409
+ $content_type = "text/plain";
2410
+ $mode = 0;
2411
+ $list = $list_text_mode;
2412
+ $list = wordwrap($list, 1000, "\n", true);
2413
+ $new_script = str_replace(array('<p>','</p>'),'',$row->script_mail);
2414
+ }
2415
 
2416
+ foreach($label_order_original as $key => $label_each) {
2417
+ $type=$label_type[$key];
2418
+ if(strpos($row->script_mail, "%".$label_each."%")>-1) {
2419
+ $new_value = $this->custom_fields_mail($type, $key, $id, $attachment, '');
2420
+ $new_script = str_replace("%".$label_each."%", $new_value, $new_script);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2421
  }
2422
+
2423
+ if(strpos($fromname, "%".$label_each."%")>-1) {
2424
+ $new_value = str_replace('<br>',', ',$this->custom_fields_mail($type, $key, $id, '', ''));
2425
+ if(substr($new_value, -2)==', ') {
2426
+ $new_value = substr($new_value, 0, -2);
2427
  }
2428
+ $fromname = str_replace("%".$label_each."%", $new_value, $fromname);
 
 
 
2429
  }
2430
 
2431
+ if(strpos($fromname, "%username%")>-1){
2432
+ $fromname = str_replace("%username%", $username, $fromname);
 
2433
  }
2434
+
2435
+ if(strpos($subject, "%".$label_each."%")>-1) {
2436
+ $new_value = str_replace('<br>',', ',$this->custom_fields_mail($type, $key, $id, '', ''));
2437
+ if(substr($new_value, -2)==', ') {
2438
+ $new_value = substr($new_value, 0, -2);
2439
+ }
2440
+ $subject = str_replace("%".$label_each."%", $new_value, $subject);
2441
  }
2442
+ }
2443
+
2444
+ if ($row->from_mail) {
2445
+ $from = isset($_POST['wdform_'.$row->from_mail."_element".$id]) ? $_POST['wdform_'.$row->from_mail."_element".$id] : NULL;
2446
+ if (!isset($from)) {
2447
+ $from = $row->from_mail;
2448
  }
2449
+ $from = "From: '" . $fromname . "' <" . $from . ">" . "\r\n";
2450
+ }
2451
+ else {
2452
+ $from = "";
2453
+ }
2454
+
2455
+ $headers = $from . " Content-Type: " . $content_type . "; charset=\"" . get_option('blog_charset') . "\"\n";
2456
+ if ($replyto) {
2457
+ $headers .= "Reply-To: <" . $replyto . ">\r\n";
2458
+ }
2459
+ $cca = $row->mail_cc;
2460
+ $bcc = $row->mail_bcc;
2461
+ if ($cca) {
2462
+ $headers .= "Cc: <" . $cca . ">\r\n";
2463
+ }
2464
+ if ($bcc) {
2465
+ $headers .= "Bcc: <" . $bcc . ">\r\n";
2466
+ }
2467
 
2468
+ $custom_fields_value = array( $ip, $useremail, $username, $subid, $list );
2469
+ foreach($custom_fields as $key=>$custom_field)
2470
+ {
2471
+ if(strpos($new_script, "%".$custom_field."%")>-1)
2472
+ $new_script = str_replace("%".$custom_field."%", $custom_fields_value[$key], $new_script);
2473
 
2474
+ if($key==2 || $key==3)
2475
+ {
2476
+ if(strpos($fromname, "%".$custom_field."%")>-1)
2477
+ $fromname = str_replace("%".$custom_field."%", $custom_fields_value[$key], $fromname);
2478
+
2479
+ if(strpos($subject, "%".$custom_field."%")>-1)
2480
+ $subject = str_replace("%".$custom_field."%", $custom_fields_value[$key], $subject);
 
 
 
 
 
 
2481
  }
2482
  }
2483
+ $admin_body = $new_script;
2484
+ if($recipient) {
2485
+ $send = wp_mail(str_replace(' ', '', $recipient), $subject, stripslashes($admin_body), $headers, $attachment);
2486
+ }
2487
+ }
2488
 
2489
  $_SESSION['error_or_no' . $id] = 0;
2490
  $msg = addslashes(__('Your form was successfully submitted.', 'form_maker'));
2504
  }
2505
  }
2506
  }
2507
+
2508
+ $fm_email_params = $row->sendemail ? array('admin_body' => $admin_body, 'body' => $body, 'subject' => $subject, 'headers' => $headers, 'attachment' => $attachment, 'attachment_user' => $attachment_user) : array();
2509
+
2510
+ $addons = array('WD_FM_EMAIL_COND' => 'Email Conditions');
2511
+ $addons_array = array();
2512
+ foreach($addons as $addon => $addon_name) {
2513
+ if (defined($addon) && is_plugin_active(constant($addon))) {
2514
+ $_GET['addon_task'] = 'frontend';
2515
+ $_GET['form_id'] = $id;
2516
+ $GLOBALS['fm_email_params'] = $fm_email_params;
2517
+ $GLOBALS['form_currency'] = $form_currency;
2518
+ $GLOBALS['custom_fields_value'] = isset($custom_fields_value) ? $custom_fields_value : array();
2519
+ do_action($addon.'_init');
2520
+ }
2521
+ }
2522
  }
2523
  else { /* Old form.*/
2524
  foreach ($label_order_ids as $key => $label_order_id) {
2525
  $i = $label_order_id;
2526
  $type = $_POST[$i . "_type" . $id];
2527
  if (isset($_POST[$i . "_type" . $id]))
2528
+ if ($type != "type_map" and $type != "type_submit_reset" and $type != "type_editor" and $type != "type_captcha" and $type != "type_arithmetic_captcha" and $type != "type_recaptcha" and $type != "type_button") {
2529
  $element_label = $label_order_original[$i];
2530
  switch ($type) {
2531
  case 'type_text':
2899
  else {
2900
  $from_mail = '';
2901
  }
2902
+ $headers = $from_mail . " Content-Type: text/html; charset=\"" . get_option('blog_charset') . "\"\n";
2903
  for ($k = 0; $k < count($all_files); $k++) {
2904
  // $attachment[$k] = dirname(__FILE__) . '/uploads/' . $all_files[$k]['name'];
2905
  $attachment[$k]= $all_files[$k]['name'];
2913
  foreach ($label_order_original as $key => $label_each) {
2914
  if (strpos($row->script_mail_user, "%" . $label_each . "%") !== FALSE) {
2915
  $type = $label_type[$key];
2916
+ if ($type != "type_submit_reset" or $type != "type_map" or $type != "type_editor" or $type != "type_captcha" or $type != "type_arithmetic_captcha" or $type != "type_recaptcha" or $type != "type_button") {
2917
  $new_value = "";
2918
  switch ($type) {
2919
  case 'type_text':
3344
  if ($row->mail) {
3345
  if ($c) {
3346
  // $headers_form_mail = "From: " . $c . " <" . $c . ">" . "\r\n";
3347
+ $headers = "From: '" . $c . "' <" . $c . ">" . "\r\n" . "Content-Type: text/html; charset=\"" . get_option('blog_charset') . "\"\n";
3348
  }
3349
  // else {
3350
  // $headers_form_mail = "";
3356
  foreach($label_order_original as $key => $label_each) {
3357
  if (strpos($row->script_mail, "%" . $label_each . "%") !== FALSE) {
3358
  $type = $label_type[$key];
3359
+ if ($type != "type_submit_reset" or $type!="type_map" or $type!="type_editor" or $type!="type_captcha" or $type != "type_arithmetic_captcha" or $type!="type_recaptcha" or $type!="type_button") {
3360
  $new_value ="";
3361
  switch ($type) {
3362
  case 'type_text':
3770
  foreach($label_order_original as $key => $label_each) {
3771
  if (strpos($row->script_mail, "%" . $label_each . "%") !== FALSE) {
3772
  $type = $label_type[$key];
3773
+ if ($type != "type_submit_reset" or $type != "type_map" or $type != "type_editor" or $type!="type_captcha" or $type != "type_arithmetic_captcha" or $type!="type_recaptcha" or $type!="type_button") {
3774
  $new_value = "";
3775
  switch ($type) {
3776
  case 'type_text':
4214
  $msg = addslashes(__('Your form was successfully submitted.', 'form_maker'));
4215
  }
4216
  }
4217
+
4218
+ // delete files from uploads (save_upload = 0)
4219
+ if($row->save_uploads == 0){
4220
+ foreach ($all_files as &$all_file) {
4221
+ if (file_exists(ABSPATH.'/'.$all_file['tmp_name'])) {
4222
+ unlink(ABSPATH.'/'.$all_file['tmp_name']);
4223
+ }
4224
+ }
4225
+
4226
+ }
4227
  $https = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://');
4228
  switch ($row->submit_text_type) {
4229
  case "2":
4278
  }
4279
  }
4280
 
4281
+ public static function custom_fields_mail($type, $key, $id, $attachment, $form_currency)
4282
  {
4283
  $new_value ="";
4284
 
4285
  $disabled_fields = explode(',', isset($_REQUEST["disabled_fields".$id]) ? $_REQUEST["disabled_fields".$id] : "");
4286
  $disabled_fields = array_slice($disabled_fields,0, count($disabled_fields)-1);
4287
 
4288
+ if($type!="type_submit_reset" or $type!="type_map" or $type!="type_editor" or $type!="type_captcha" or $type != "type_arithmetic_captcha" or $type!="type_recaptcha" or $type!="type_button") {
4289
  switch ($type) {
4290
  case 'type_text':
4291
  case 'type_password':
4477
  case "type_paypal_select": {
4478
  $new_value = (isset($_POST['wdform_'.$key."_element_label".$id]) ? $_POST['wdform_'.$key."_element_label".$id] : "") . ':' . (isset($_POST['wdform_'.$key."_element".$id]) ? $_POST['wdform_'.$key."_element".$id] : "") . $form_currency;
4479
  $element_quantity_label = isset($_POST['wdform_'.$key."_element_quantity_label".$id]) ? $_POST['wdform_'.$key."_element_quantity_label".$id] : NULL;
4480
+ $element_quantity = (isset($_POST['wdform_'.$key."_element_quantity".$id]) && $_POST['wdform_'.$key."_element_quantity".$id]) ? $_POST['wdform_'.$key."_element_quantity".$id] : NULL;
4481
  if (isset($element_quantity)) {
4482
  $new_value .= '<br/>' . $element_quantity_label . ': ' . $element_quantity;
4483
  }
4526
  }
4527
  }
4528
  $element_quantity_label = isset($_POST['wdform_'.$key."_element_quantity_label".$id]) ? $_POST['wdform_'.$key."_element_quantity_label".$id] : NULL;
4529
+ $element_quantity = (isset($_POST['wdform_'.$key."_element_quantity".$id]) && $_POST['wdform_'.$key."_element_quantity".$id]) ? $_POST['wdform_'.$key."_element_quantity".$id] : NULL;
4530
  if (isset($element_quantity)) {
4531
  $new_value .= '<br/>' . $element_quantity_label . ': ' . $element_quantity;
4532
  }
frontend/models/FMModelForm_submissions.php ADDED
@@ -0,0 +1,296 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelForm_submissions {
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
+ function showsubmissions($form_id, $startdate, $enddate, $submit_date, $submitter_ip, $username, $useremail, $form_fields, $csv, $xml, $title, $search, $ordering, $entries, $views, $conversion_rate, $pagination, $stats) {
22
+ global $wpdb;
23
+
24
+ $user = wp_get_current_user();
25
+ $userGroups = $wpdb->get_var($wpdb->prepare("SELECT `user_id_wd` FROM " . $wpdb->prefix . "formmaker WHERE id='%d'", $form_id));
26
+ $users = explode(',', $userGroups);
27
+ $users = array_slice($users, 0, count($users) - 1);
28
+ $show_submits = false;
29
+ if(!is_user_logged_in()) {
30
+ if(!in_array('guest', $users))
31
+ return false;
32
+ }
33
+ else {
34
+ foreach($user->roles as $user_role) {
35
+ if(in_array($user_role, $users))
36
+ $show_submits = true;
37
+ }
38
+ if(!$show_submits)
39
+ return false;
40
+ }
41
+ $from = $startdate;
42
+ $to = $enddate;
43
+
44
+ $filter_order = ((isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) != '') ? esc_html(stripslashes($_POST['order_by'])) : 'group_id');
45
+ $filter_order_Dir = ((isset($_POST['asc_or_desc']) && ($_POST['asc_or_desc'] == 'asc' || $_POST['asc_or_desc'] == 'desc')) ? esc_html($_POST['asc_or_desc']) : 'asc');
46
+
47
+ $ip_search = $submitter_ip;
48
+ $username_search = strtolower($username);
49
+ $useremail_search = strtolower($useremail);
50
+
51
+ $where = array();
52
+ $lists['startdate'] = ((isset($_POST['startdate'])) ? esc_html(stripslashes($_POST['startdate'])) : '');
53
+ $lists['enddate'] = ((isset($_POST['enddate'])) ? esc_html(stripslashes($_POST['enddate'])) : '');
54
+ $lists['hide_label_list'] = ((isset($_POST['hide_label_list'])) ? esc_html(stripslashes($_POST['hide_label_list'])) : '');
55
+
56
+ $lists['ip_search'] = ((isset($_POST['ip_search'])) ? esc_html(stripslashes($_POST['ip_search'])) : '');
57
+ $lists['username_search'] = ((isset($_POST['username_search'])) ? esc_html(stripslashes($_POST['username_search'])) : '');
58
+ $lists['useremail_search'] = ((isset($_POST['useremail_search'])) ? esc_html(stripslashes($_POST['useremail_search'])) : '');
59
+ $limit = ((isset($_POST['page_number'])) ? ((int) $_POST['page_number'] - 1) * 20 : 0);
60
+
61
+ if ( $lists['ip_search'] ) {
62
+ $where[] = 'ip LIKE "%' . esc_sql($lists['ip_search']) . '%"';
63
+ }
64
+ if ( $lists['username_search'] ) {
65
+ $where[] = 'user_id_wd IN (SELECT `id` FROM `' . $wpdb->prefix . 'users` WHERE `display_name` LIKE "%' . esc_sql($lists['username_search']) . '%")';
66
+ }
67
+ if ( $lists['useremail_search'] ) {
68
+ $where[] = 'user_id_wd IN (SELECT `id` FROM `' . $wpdb->prefix . 'users` WHERE `user_email` LIKE "%' . esc_sql($lists['useremail_search']) . '%")';
69
+ }
70
+
71
+ if($from) {
72
+ if($lists['startdate'] != '') {
73
+ if(strtotime($from) > strtotime($lists['startdate']))
74
+ $where[] = "`date` >= '" . $from . " 00:00:00'";
75
+ else
76
+ $where[] ="`date`>='" . $lists['startdate'] . " 00:00:00' ";
77
+ }
78
+ else
79
+ $where[] = "`date` >= '" . $from . " 00:00:00'";
80
+ }
81
+ else {
82
+ if($lists['startdate']!='')
83
+ $where[] =" `date`>='".$lists['startdate']." 00:00:00' ";
84
+ }
85
+ if($to) {
86
+ if($lists['enddate']!='') {
87
+ if(strtotime($to) < strtotime($lists['enddate']))
88
+ $where[] = "`date` <= '".$to." 23:59:59'";
89
+ else
90
+ $where[] ="`date`<='".$lists['enddate']." 23:59:59' ";
91
+ }
92
+ else
93
+ $where[] = "`date` <= '".$to." 23:59:59'";
94
+ }
95
+ else {
96
+ if($lists['enddate']!='')
97
+ $where[] ="`date`<='".$lists['enddate']." 23:59:59' ";
98
+ }
99
+
100
+ $form_title = $wpdb->get_var($wpdb->prepare("SELECT `title` FROM " . $wpdb->prefix . "formmaker WHERE id='%d'", $form_id));
101
+
102
+ $where[] = 'form_id="' . (int)$form_id . '"';
103
+ $where = ( count( $where ) ? ' ' . implode( ' AND ', $where ) : '' );
104
+ $orderby = ' ';
105
+ if ($filter_order == 'id' or $filter_order == 'title' or $filter_order == 'mail') {
106
+ $orderby = ' ORDER BY `date` desc';
107
+ }
108
+ else {
109
+ if ($filter_order == 'group_id' or $filter_order == 'date' or $filter_order == 'ip') {
110
+ $orderby = ' ORDER BY '.$filter_order .' '. $filter_order_Dir .'';
111
+ }
112
+ else {
113
+ if ($filter_order == 'display_name' or $filter_order == 'user_email') {
114
+ $orderby = ' ORDER BY (SELECT `'.$filter_order.'` FROM `' . $wpdb->prefix . 'users` WHERE id=user_id_wd) '. $filter_order_Dir .'';
115
+ }
116
+ }
117
+ }
118
+ $query = "SELECT distinct element_label FROM " . $wpdb->prefix . "formmaker_submits WHERE ". $where;
119
+ $labels = $wpdb->get_col($query);
120
+
121
+ $query = $wpdb->prepare("SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id='%d' and element_label=0 limit 0, 1", $form_id);
122
+ $ispaypal = $wpdb->get_var($query);
123
+
124
+ $query = $wpdb->prepare('SELECT count(distinct group_id) FROM ' . $wpdb->prefix . 'formmaker_submits where form_id ="%d"', $form_id);
125
+ $total_entries = $wpdb->get_var($query);
126
+
127
+ $sorted_labels_type= array();
128
+ $sorted_labels_id= array();
129
+ $sorted_labels= array();
130
+ $label_titles=array();
131
+ $rows_ord = array();
132
+ $rows = array();
133
+ $total = 0;
134
+ $join_count='';
135
+ $checked_ids = '';
136
+ $stats_fields = '';
137
+
138
+ if($labels) {
139
+ $label_id= array();
140
+ $label_order= array();
141
+ $label_order_original= array();
142
+ $label_type= array();
143
+ $this_form = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='%d'", $form_id));
144
+ $checked_ids = $this_form->frontend_submit_fields;
145
+ $stats_fields = $this_form->frontend_submit_stat_fields;
146
+
147
+ if(strpos($this_form->label_order, 'type_paypal_')) {
148
+ $this_form->label_order=$this_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#****#";
149
+ }
150
+ $label_all = explode('#****#',$this_form->label_order);
151
+ $label_all = array_slice($label_all,0, count($label_all)-1);
152
+ foreach($label_all as $key => $label_each) {
153
+ $label_id_each=explode('#**id**#',$label_each);
154
+ array_push($label_id, $label_id_each[0]);
155
+
156
+ $label_order_each=explode('#**label**#', $label_id_each[1]);
157
+ array_push($label_order_original, $label_order_each[0]);
158
+
159
+ $ptn = "/[^a-zA-Z0-9_]/";
160
+ $rpltxt = "";
161
+ $label_temp=preg_replace($ptn, $rpltxt, $label_order_each[0]);
162
+ array_push($label_order, $label_temp);
163
+ array_push($label_type, $label_order_each[1]);
164
+ }
165
+
166
+ $join_query=array();
167
+ $join_where=array();
168
+ $join='';
169
+ $is_first=true;
170
+
171
+ foreach($label_id as $key => $label) {
172
+ if(in_array($label, $labels)) {
173
+ array_push($sorted_labels_type, $label_type[$key]);
174
+ array_push($sorted_labels, $label_order[$key]);
175
+ array_push($sorted_labels_id, $label);
176
+ array_push($label_titles, $label_order_original[$key]);
177
+ $search_temp = isset($_POST[$form_id.'_'.$label.'_search']) ? $_POST[$form_id.'_'.$label.'_search'] : '';
178
+ $search_temp = strtolower( $search_temp );
179
+ $lists[$form_id.'_'.$label.'_search'] = $search_temp;
180
+ if ( $search_temp ) {
181
+ $join_query[] ='search';
182
+ $join_where[] =array('label'=>$label, 'search'=>esc_sql($search_temp));
183
+ }
184
+ }
185
+ }
186
+ if(strpos($filter_order,"_field")) {
187
+ if (in_array(str_replace("_field", "", $filter_order), $labels)) {
188
+ $join_query[] ='sort';
189
+ $join_where[] =array('label'=>str_replace("_field", "", $filter_order));
190
+ }
191
+ }
192
+ $cols = 'group_id';
193
+ if ($filter_order == 'date' or $filter_order == 'ip') {
194
+ $cols = 'group_id, date, ip';
195
+ }
196
+
197
+ switch(count($join_query)) {
198
+ case 0:
199
+ $join='SELECT distinct group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE '. $where;
200
+ break;
201
+ case 1:
202
+ if($join_query[0]=='sort') {
203
+ $join = 'SELECT group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE '.$where.' AND element_label="'.$join_where[0]['label'].'" ';
204
+ $join_count = 'SELECT count(group_id) FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="'.esc_sql((int)$form_id).'" AND element_label="'.$join_where[0]['label'].'" ';
205
+ $orderby = ' ORDER BY `element_value` '. $filter_order_Dir .'';
206
+ }
207
+ else
208
+ $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;
209
+ break;
210
+ default:
211
+ $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 ';
212
+ for($key=1; $key< count($join_query); $key++) {
213
+ if($join_query[$key]=='sort') {
214
+ $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 ';
215
+ $orderby = ' ORDER BY t'.$key.'.`element_value` '. $filter_order_Dir .'';
216
+ }
217
+ else
218
+ $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 ';
219
+ }
220
+ break;
221
+ }
222
+
223
+ $pos = strpos($join, 'SELECT t.group_id');
224
+ if ($pos === false)
225
+ $query = str_replace(array('SELECT group_id','SELECT distinct group_id'), array('SELECT count(distinct group_id)','SELECT count(distinct group_id)'), $join);
226
+ else
227
+ $query = str_replace('SELECT t.group_id', 'SELECT count(t.group_id)', $join);
228
+ $total = $wpdb->get_var($query);
229
+
230
+ $query = $join.' '.$orderby . ($pagination ? ' limit ' . $limit . ', 20 ' : '') . ' ';
231
+
232
+ $rows_ord = $wpdb->get_col($query);
233
+
234
+ $where2 = array();
235
+ $where2 [] ="group_id='0'";
236
+ foreach($rows_ord as $rows_ordd) {
237
+ $where2 [] ="group_id='".esc_sql($rows_ordd)."'";
238
+ }
239
+ $where2 = ( count( $where2 ) ? ' WHERE ' . implode( ' OR ', $where2 ).'' : '' );
240
+ $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_submits ".$where2.'';
241
+
242
+ $rows = $wpdb->get_results($query);
243
+
244
+ if($join_count) {
245
+ $total_sort = $wpdb->get_var($join_count);
246
+ if($total_sort != $total_entries)
247
+ $join_count = $total_sort;
248
+ else
249
+ $join_count = '';
250
+ }
251
+ }
252
+
253
+ $query = $wpdb->prepare('SELECT views FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $form_id);
254
+ $total_views = $wpdb->get_var($query);
255
+
256
+ $pageNav = "";// $pageNav = new JPagination( $total, $limitstart, $limit );
257
+
258
+ $lists['order_Dir'] = $filter_order_Dir;
259
+ $lists['order'] = $filter_order;
260
+ $lists['total'] = $total;
261
+ $lists['limit'] = (int) ($limit / 20 + 1);
262
+ return array("rows" => $rows, "lists" => $lists, "pageNav" => $pageNav, "sorted_labels" => $sorted_labels, "label_titles" => $label_titles, "rows_ord" => $rows_ord, "sorted_labels_id" => $sorted_labels_id, "sorted_labels_type" => $sorted_labels_type, "total_entries" => $total_entries, "total_views" => $total_views, "join_count" => $join_count, "form_title" => $form_title, "checked_ids" => $checked_ids, "stats_fields" => $stats_fields);
263
+ }
264
+
265
+ function show_stats() {
266
+ global $wpdb;
267
+ $form_id = (isset($_POST['form_id']) ? esc_html(stripslashes($_POST['form_id'])) : 0);
268
+ $id = (isset($_POST['stat_id']) ? esc_html(stripslashes($_POST['stat_id'])) : 0);
269
+ $from = (isset($_POST['from']) ? esc_html(stripslashes($_POST['from'])) : 0);
270
+ $to = (isset($_POST['to']) ? esc_html(stripslashes($_POST['to'])) : 0);
271
+ $where = ' AND form_id=' . $form_id;
272
+ if($from != '')
273
+ $where .= " AND `date`>='".$from." 00:00:00' ";
274
+ if($to != '')
275
+ $where .= " AND `date`<='".$to." 23:59:59' ";
276
+ $query = "SELECT element_value FROM " . $wpdb->prefix . "formmaker_submits WHERE element_label='" . $id . "'" . $where;
277
+ $choices = $wpdb->get_col($query);
278
+ return $choices;
279
+ }
280
+
281
+ function paypal_info($id) {
282
+ global $wpdb;
283
+ $query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_sessions where group_id='%d'", $id);
284
+ return $wpdb->get_row($query);
285
+ }
286
+
287
+ ////////////////////////////////////////////////////////////////////////////////////////
288
+ // Getters & Setters //
289
+ ////////////////////////////////////////////////////////////////////////////////////////
290
+ ////////////////////////////////////////////////////////////////////////////////////////
291
+ // Private Methods //
292
+ ////////////////////////////////////////////////////////////////////////////////////////
293
+ ////////////////////////////////////////////////////////////////////////////////////////
294
+ // Listeners //
295
+ ////////////////////////////////////////////////////////////////////////////////////////
296
+ }
frontend/views/FMViewForm_maker.php CHANGED
@@ -113,7 +113,6 @@ class FMViewForm_maker {
113
  $form_theme = preg_replace($pattern, ' ', $form_theme);
114
  $form_maker_front_end .= '<style>' . str_replace('[SITE_ROOT]', WD_FM_URL, $form_theme) . '</style>';
115
  wp_print_scripts('main' . (($old == false || ($old == true && $row->form=='')) ? '_div' : '') . '_front_end', WD_FM_URL . '/js/main' . (($old == false || ($old == true && $row->form=='')) ? '_div' : '') . '_front_end.js?ver='. get_option("wd_form_maker_version"));
116
-
117
  $form_currency = '$';
118
  $check_js = '';
119
  $onload_js = '';
@@ -180,7 +179,6 @@ class FMViewForm_maker {
180
 
181
  for($k=0; $k<$count_of_conditions; $k++)
182
  {
183
-
184
  if($show_hide[$k])
185
  {
186
  $display = 'removeAttr("style")';
@@ -218,8 +216,6 @@ class FMViewForm_maker {
218
  for($m=0; $m<count($cond_params); $m++)
219
  {
220
  $params_value = explode('***',wp_specialchars_decode($cond_params[$m], 'single'));
221
-
222
-
223
  switch($type_and_id[$params_value[0]])
224
  {
225
  case "type_text":
@@ -248,7 +244,6 @@ class FMViewForm_maker {
248
  $click .= '#wdform_'.$params_value[0].'_element'.$form_id.' ~ a, ';
249
  break;
250
 
251
-
252
  case "type_name":
253
  if($params_value[1] == "%" || $params_value[1] == "!%")
254
  {
@@ -640,6 +635,7 @@ class FMViewForm_maker {
640
  }
641
  $keyup .= '#wdform_'.$params_value[0].'_element_title'.$form_id.', #wdform_'.$params_value[0].'_element_first'.$form_id.', #wdform_'.$params_value[0].'_element_last'.$form_id.', #wdform_'.$params_value[0].'_element_middle'.$form_id.', ';
642
  break;
 
643
  case "type_phone":
644
  if($params_value[1] == "==" || $params_value[1] == "!=")
645
  {
@@ -717,8 +713,6 @@ class FMViewForm_maker {
717
  break;
718
 
719
  case "type_own_select":
720
- case "type_paypal_select":
721
-
722
  if($params_value[1] == "%" || $params_value[1] == "!%")
723
  {
724
  $like_or_not = ($params_value[1] == "%" ? ">" : "==");
@@ -736,6 +730,35 @@ class FMViewForm_maker {
736
  $change .= '#wdform_'.$params_value[0].'_element'.$form_id.', ';
737
  break;
738
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
739
  case "type_address":
740
  if($params_value[1] == "%" || $params_value[1] == "!%")
741
  {
@@ -770,14 +793,23 @@ class FMViewForm_maker {
770
  }
771
  $change .= '#wdform_'.$params_value[0].'_element'.$form_id.', ';
772
  break;
 
773
  case "type_radio":
774
  case "type_paypal_radio":
775
  case "type_paypal_shipping":
776
 
777
  if($params_value[1] == "==" || $params_value[1] == "!=")
778
  {
779
-
780
- $if .= ' jQuery("input[name^=\'wdform_'.$params_value[0].'_element'.$form_id.'\']:checked").val()'.$params_value[1].'"'.$params_value[2].'" ';
 
 
 
 
 
 
 
 
781
  $click .= 'div[wdid='.$params_value[0].'] input[type=\'radio\'], ';
782
  }
783
 
@@ -1393,7 +1425,7 @@ class FMViewForm_maker {
1393
  break;
1394
  }
1395
 
1396
- case 'type_name': {
1397
  $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');
1398
  $temp = $params;
1399
  if(strpos($temp, 'w_name_fields') > -1)
@@ -1508,7 +1540,7 @@ class FMViewForm_maker {
1508
  }
1509
  ';
1510
  }
1511
- break;
1512
  }
1513
 
1514
  case 'type_address': {
@@ -2303,9 +2335,9 @@ class FMViewForm_maker {
2303
 
2304
  case 'type_date': {
2305
  $params_names=array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val');
2306
- $temp = $params;
2307
- if(strpos($temp, 'w_disable_past_days') > -1)
2308
- $params_names = array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val', 'w_disable_past_days');
2309
 
2310
  foreach($params_names as $params_name ) {
2311
  $temp=explode('*:*'.$params_name.'*:*',$temp);
@@ -2361,7 +2393,6 @@ class FMViewForm_maker {
2361
  }
2362
  ';
2363
  }
2364
-
2365
  break;
2366
  }
2367
 
@@ -2620,7 +2651,6 @@ class FMViewForm_maker {
2620
  break;
2621
  }
2622
 
2623
-
2624
  case 'type_recaptcha_old': {
2625
  $params_names=array('w_field_label_size','w_field_label_pos','w_public','w_private','w_theme','w_class');
2626
  $temp=$params;
@@ -2667,9 +2697,7 @@ class FMViewForm_maker {
2667
  $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
2668
 
2669
  $publickey=($row->public_key ? $row->public_key : '0');
2670
- $error = null;
2671
- require_once(WD_FM_DIR . '/recaptchalib.php');
2672
- $secure_server = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? recaptcha_get_html($publickey, $error, true) : recaptcha_get_html($publickey, $error);
2673
  $rep =' <script src="https://www.google.com/recaptcha/api.js"></script><div type="type_recaptcha" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span></div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].';"><div class="g-recaptcha" data-sitekey="'.$publickey.'"></div></div></div>';
2674
  break;
2675
  }
@@ -3723,8 +3751,10 @@ class FMViewForm_maker {
3723
  min: eval('.$param['w_field_min_value'].'),
3724
  max: eval('.$param['w_field_max_value'].'),
3725
  slide: function( event, ui ) {
 
3726
  jQuery("#wdform_'.$id1.'_element_value'.$form_id.'").html("" + ui.value);
3727
  jQuery("#wdform_'.$id1.'_slider_value'.$form_id.'").val("" + ui.value);
 
3728
  }
3729
  });
3730
  ';
@@ -4183,7 +4213,6 @@ class FMViewForm_maker {
4183
  }
4184
  generate_page_nav(first_form_view<?php echo $id ?>, '<?php echo $id ?>', form_view_count<?php echo $id ?>, form_view_max<?php echo $id ?>);
4185
  }
4186
-
4187
  });
4188
  function check_required<?php echo $form_id ?>(but_type) {
4189
  if (but_type == 'reset') {
113
  $form_theme = preg_replace($pattern, ' ', $form_theme);
114
  $form_maker_front_end .= '<style>' . str_replace('[SITE_ROOT]', WD_FM_URL, $form_theme) . '</style>';
115
  wp_print_scripts('main' . (($old == false || ($old == true && $row->form=='')) ? '_div' : '') . '_front_end', WD_FM_URL . '/js/main' . (($old == false || ($old == true && $row->form=='')) ? '_div' : '') . '_front_end.js?ver='. get_option("wd_form_maker_version"));
 
116
  $form_currency = '$';
117
  $check_js = '';
118
  $onload_js = '';
179
 
180
  for($k=0; $k<$count_of_conditions; $k++)
181
  {
 
182
  if($show_hide[$k])
183
  {
184
  $display = 'removeAttr("style")';
216
  for($m=0; $m<count($cond_params); $m++)
217
  {
218
  $params_value = explode('***',wp_specialchars_decode($cond_params[$m], 'single'));
 
 
219
  switch($type_and_id[$params_value[0]])
220
  {
221
  case "type_text":
244
  $click .= '#wdform_'.$params_value[0].'_element'.$form_id.' ~ a, ';
245
  break;
246
 
 
247
  case "type_name":
248
  if($params_value[1] == "%" || $params_value[1] == "!%")
249
  {
635
  }
636
  $keyup .= '#wdform_'.$params_value[0].'_element_title'.$form_id.', #wdform_'.$params_value[0].'_element_first'.$form_id.', #wdform_'.$params_value[0].'_element_last'.$form_id.', #wdform_'.$params_value[0].'_element_middle'.$form_id.', ';
637
  break;
638
+
639
  case "type_phone":
640
  if($params_value[1] == "==" || $params_value[1] == "!=")
641
  {
713
  break;
714
 
715
  case "type_own_select":
 
 
716
  if($params_value[1] == "%" || $params_value[1] == "!%")
717
  {
718
  $like_or_not = ($params_value[1] == "%" ? ">" : "==");
730
  $change .= '#wdform_'.$params_value[0].'_element'.$form_id.', ';
731
  break;
732
 
733
+ case "type_paypal_select":
734
+ if($params_value[1] == "%" || $params_value[1] == "!%")
735
+ {
736
+ $like_or_not = ($params_value[1] == "%" ? ">" : "==");
737
+ $if .= ' jQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val().indexOf("'.$params_value[2].'")'.$like_or_not.'-1 ';
738
+ }
739
+ else
740
+ {
741
+ if($params_value[1] == "=" || $params_value[1] == "!")
742
+ {
743
+ $params_value[2] = "";
744
+ $params_value[1] = $params_value[1]."=";
745
+ $if .= ' jQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'"';
746
+ }
747
+ else
748
+ {
749
+ if ( strpos($params_value[2], '*:*value*:*') > -1 ) {
750
+ $and_or = $params_value[1] == "==" ? '&&' : '||';
751
+ $choise_and_value = explode("*:*value*:*", $params_value[2]);
752
+ $params_value[2] = $choise_and_value[1];
753
+ $params_label = $choise_and_value[0];
754
+ $if .= ' jQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" '.$and_or.' jQuery("div[wdid='.$params_value[0].'] select option:selected").text()'.$params_value[1].'"'.$params_label.'" ';
755
+ } else {
756
+ $if .= ' jQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" ';
757
+ }
758
+ }
759
+ }
760
+ $change .= '#wdform_'.$params_value[0].'_element'.$form_id.', ';
761
+ break;
762
  case "type_address":
763
  if($params_value[1] == "%" || $params_value[1] == "!%")
764
  {
793
  }
794
  $change .= '#wdform_'.$params_value[0].'_element'.$form_id.', ';
795
  break;
796
+
797
  case "type_radio":
798
  case "type_paypal_radio":
799
  case "type_paypal_shipping":
800
 
801
  if($params_value[1] == "==" || $params_value[1] == "!=")
802
  {
803
+ if ( strpos($params_value[2], '*:*value*:*') > -1 ) {
804
+ $and_or = $params_value[1] == "==" ? '&&' : '||';
805
+ $choise_and_value = explode("*:*value*:*", $params_value[2]);
806
+ $params_value[2] = $choise_and_value[1];
807
+ $params_label = $choise_and_value[0];
808
+ $if .= ' jQuery("input[name^=\'wdform_'.$params_value[0].'_element'.$form_id.'\']:checked").val()'.$params_value[1].'"'.$params_value[2].'" '.$and_or.' jQuery("input[name^=\'wdform_'.$params_value[0].'_element'.$form_id.'\']:checked").attr("title")'.$params_value[1].'"'.$params_label.'" ';
809
+ } else {
810
+ $if .= ' jQuery("input[name^=\'wdform_'.$params_value[0].'_element'.$form_id.'\']:checked").val()'.$params_value[1].'"'.$params_value[2].'" ';
811
+ }
812
+
813
  $click .= 'div[wdid='.$params_value[0].'] input[type=\'radio\'], ';
814
  }
815
 
1425
  break;
1426
  }
1427
 
1428
+ case 'type_name': {
1429
  $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');
1430
  $temp = $params;
1431
  if(strpos($temp, 'w_name_fields') > -1)
1540
  }
1541
  ';
1542
  }
1543
+ break;
1544
  }
1545
 
1546
  case 'type_address': {
2335
 
2336
  case 'type_date': {
2337
  $params_names=array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val');
2338
+ $temp = $params;
2339
+ if(strpos($temp, 'w_disable_past_days') > -1)
2340
+ $params_names = array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val', 'w_disable_past_days');
2341
 
2342
  foreach($params_names as $params_name ) {
2343
  $temp=explode('*:*'.$params_name.'*:*',$temp);
2393
  }
2394
  ';
2395
  }
 
2396
  break;
2397
  }
2398
 
2651
  break;
2652
  }
2653
 
 
2654
  case 'type_recaptcha_old': {
2655
  $params_names=array('w_field_label_size','w_field_label_pos','w_public','w_private','w_theme','w_class');
2656
  $temp=$params;
2697
  $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
2698
 
2699
  $publickey=($row->public_key ? $row->public_key : '0');
2700
+
 
 
2701
  $rep =' <script src="https://www.google.com/recaptcha/api.js"></script><div type="type_recaptcha" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span></div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].';"><div class="g-recaptcha" data-sitekey="'.$publickey.'"></div></div></div>';
2702
  break;
2703
  }
3751
  min: eval('.$param['w_field_min_value'].'),
3752
  max: eval('.$param['w_field_max_value'].'),
3753
  slide: function( event, ui ) {
3754
+
3755
  jQuery("#wdform_'.$id1.'_element_value'.$form_id.'").html("" + ui.value);
3756
  jQuery("#wdform_'.$id1.'_slider_value'.$form_id.'").val("" + ui.value);
3757
+
3758
  }
3759
  });
3760
  ';
4213
  }
4214
  generate_page_nav(first_form_view<?php echo $id ?>, '<?php echo $id ?>', form_view_count<?php echo $id ?>, form_view_max<?php echo $id ?>);
4215
  }
 
4216
  });
4217
  function check_required<?php echo $form_id ?>(but_type) {
4218
  if (but_type == 'reset') {
frontend/views/FMViewForm_submissions.php ADDED
@@ -0,0 +1,1563 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewForm_submissions {
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($form_id, $startdate, $enddate, $submit_date, $submitter_ip, $username, $useremail, $form_fields, $csv, $xml, $title, $search, $ordering, $entries, $views, $conversion_rate, $pagination, $stats) {
26
+ require_once(WD_FM_DIR . '/framework/WDW_FM_Library.php');
27
+ $get_data = $this->model->showsubmissions($form_id, $startdate, $enddate, $submit_date, $submitter_ip, $username, $useremail, $form_fields, $csv, $xml, $title, $search, $ordering, $entries, $views, $conversion_rate, $pagination, $stats);
28
+ if ($get_data === false) {
29
+ echo WDW_FM_Library::message(__('You have no permission to view submissions.', 'form_maker'), 'warning');
30
+ return;
31
+ }
32
+ $rows = $get_data["rows"];
33
+ $lists = $get_data["lists"];
34
+ $pageNav = $get_data["pageNav"];
35
+ $labels = $get_data["sorted_labels"];
36
+ $label_titles = $get_data["label_titles"];
37
+ $group_id_s = $get_data["rows_ord"];
38
+ $labels_id = $get_data["sorted_labels_id"];
39
+ $sorted_labels_type = $get_data["sorted_labels_type"];
40
+ $total_entries = $get_data["total_entries"];
41
+ $total_views = $get_data["total_views"];
42
+ $join_count = $get_data["join_count"];
43
+ $form_title = $get_data["form_title"];
44
+ $checked_ids = $get_data["checked_ids"];
45
+ $stats_fields = $get_data["stats_fields"];
46
+ $current_url=htmlentities($_SERVER['REQUEST_URI']);
47
+
48
+ $order_by = (isset($_POST['order_by']) ? esc_html(stripslashes($_POST['order_by'])) : 'group_id');
49
+ $asc_or_desc = ((isset($_POST['asc_or_desc'])) ? esc_html(stripslashes($_POST['asc_or_desc'])) : 'desc');
50
+ $oder_class_default = "manage-column column-autor sortable desc";
51
+ $oder_class = "manage-column column-title sorted " . $asc_or_desc;
52
+
53
+ $other_fileds = array('submit_id', 'payment_info');
54
+ foreach($other_fileds as $other_filed)
55
+ $$other_filed = false;
56
+ if($checked_ids) {
57
+ $checked_ids = explode(',',$checked_ids);
58
+ $checked_ids = array_slice($checked_ids,0, count($checked_ids)-1);
59
+ }
60
+ else
61
+ $checked_ids = Array();
62
+
63
+ foreach($other_fileds as $other_filed) {
64
+ if(!in_array($other_filed, $checked_ids))
65
+ $$other_filed = true;
66
+ }
67
+
68
+ $is_paypal = $this->model->paypal_info($form_id);
69
+ if (!$is_paypal)
70
+ $payment_info = false;
71
+
72
+ $label_titles_copy=$label_titles;
73
+
74
+ $export_ids = "";
75
+ if ($form_fields && $submit_id) $export_ids .= "submit_id,";
76
+ if ($submit_date) $export_ids .= "submit_date,";
77
+ if ($submitter_ip) $export_ids .= "submitter_ip,";
78
+ if ($username) $export_ids .= "username,";
79
+ if ($useremail) $export_ids .= "useremail,";
80
+ for($i=0; $i < count($labels) ; $i++) {
81
+ if($form_fields && !in_array($labels_id[$i], $checked_ids)) {
82
+ $export_ids .= $labels_id[$i] . ",";
83
+ }
84
+ }
85
+
86
+ add_thickbox();
87
+ ?>
88
+
89
+ <script type="text/javascript">
90
+ function fm_form_submit(event, form_id, task, id) {
91
+ if (document.getElementById(form_id)) {
92
+ document.getElementById(form_id).submit();
93
+ }
94
+ if (event.preventDefault) {
95
+ event.preventDefault();
96
+ }
97
+ else {
98
+ event.returnValue = false;
99
+ }
100
+ }
101
+ function remove_all() {
102
+ if(document.getElementById('startdate'))
103
+ document.getElementById('startdate').value='';
104
+ if(document.getElementById('enddate'))
105
+ document.getElementById('enddate').value='';
106
+ if(document.getElementById('ip_search'))
107
+ document.getElementById('ip_search').value='';
108
+ if(document.getElementById('username_search'))
109
+ document.getElementById('username_search').value='';
110
+ if(document.getElementById('useremail_search'))
111
+ document.getElementById('useremail_search').value='';
112
+ <?php
113
+ $n=count($rows);
114
+ for($i=0; $i < count($labels) ; $i++) {
115
+ echo "if(document.getElementById('".$form_id.'_'.$labels_id[$i]."_search'))
116
+ document.getElementById('".$form_id.'_'.$labels_id[$i]."_search').value='';";
117
+ }
118
+ ?>
119
+ }
120
+ function show_hide_filter() {
121
+ if (document.getElementById('fields_filter').style.display == "none") {
122
+ document.getElementById('fields_filter').style.display = '';
123
+ document.getElementById('filter_img').src = '<?php echo WD_FM_URL . '/images/filter_hide.png'; ?>';
124
+ }
125
+ else {
126
+ document.getElementById('fields_filter').style.display = "none";
127
+ document.getElementById('filter_img').src = '<?php echo WD_FM_URL . '/images/filter_show.png'; ?>';
128
+ }
129
+ }
130
+ </script>
131
+
132
+ <form action="<?php echo $current_url; ?>" method="post" name="adminForm" id="adminForm">
133
+ <input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php echo $asc_or_desc; ?>" />
134
+ <input type="hidden" name="order_by" id="order_by" value="<?php echo $order_by; ?>" />
135
+ <input type="hidden" id="task" name="task" value="" />
136
+ <div class="submission_params">
137
+ <?php if(isset($form_id) and $form_id>0):?>
138
+ <?php if($title): ?>
139
+ <div class="form_title"><strong><?php echo $form_title; ?></strong></div>
140
+ <?php endif; ?>
141
+ <div>
142
+ <?php if($entries):?>
143
+ <div class="reports" style="width: 80px;"><strong><?php echo __('Entries', 'form_maker'); ?></strong><br /><?php echo $total_entries; ?></div>
144
+ <?php endif; if($views): ?>
145
+ <div class="reports" style="width: 80px;"><strong><?php echo __('Views', 'form_maker'); ?></strong><br /><?php echo $total_views; ?></div>
146
+ <?php endif; if($conversion_rate): ?>
147
+ <div class="reports" style="width: 130px;"><strong><?php echo __('Conversion Rate', 'form_maker'); ?></strong><br /><?php if($total_views) echo round((($total_entries/$total_views)*100),2).'%'; else echo '0%' ?></div>
148
+ <?php endif; if($csv || $xml):?>
149
+ <div <?php echo (($entries || $views || $conversion_rate) ? 'class="csv_xml"' : '') ?>>
150
+ <?php echo __('Export to', 'form_maker'); ?>
151
+ <?php if($csv): ?>
152
+ <input type="button" value="CSV" onclick="window.location='<?php echo add_query_arg(array('action' => 'frontend_generate_csv', 'page' => 'form_submissions', 'id' => $form_id, 'checked_ids' => $export_ids, 'from' => $startdate, 'to' => $enddate), admin_url('admin-ajax.php')) ?>'" />&nbsp;
153
+ <?php endif; ?>
154
+ <?php if($xml): ?>
155
+ <input type="button" value="XML" onclick="window.location='<?php echo add_query_arg(array('action' => 'frontend_generate_xml', 'page' => 'form_submissions', 'id' => $form_id, 'checked_ids' => $export_ids, 'from' => $startdate, 'to' => $enddate), admin_url('admin-ajax.php')) ?>'" />&nbsp;
156
+ <?php endif; ?>
157
+ </div>
158
+ <?php endif; ?>
159
+ </div>
160
+ <?php if($search || $pagination): ?>
161
+ <div class="search_and_pagination">
162
+ <?php if($search): ?>
163
+ <div>
164
+ <input type="hidden" name="hide_label_list" value="<?php echo $lists['hide_label_list']; ?>" />
165
+ <img id="filter_img" src="<?php echo WD_FM_URL . '/images/filter_show.png'; ?>" width="40" style="vertical-align:middle; cursor:pointer" onclick="show_hide_filter()" title="Search by fields" />
166
+ <input type="button" onclick="this.form.submit();" style="vertical-align:middle; cursor:pointer" value="<?php echo __('GO', 'form_maker'); ?>" />
167
+ <input type="button" onclick="remove_all();this.form.submit();" style="vertical-align:middle; cursor:pointer" value="<?php echo __('Reset', 'form_maker'); ?>" />
168
+ </div>
169
+ <div>
170
+ <?php if($join_count) echo ($total_entries-$join_count) . ' ' . __('of', 'form_maker') . ' ' . $total_entries . ' ' . __('submissions are not shown, as the field you sorted by is missing in those submissions.', 'form_maker'); ?>
171
+ </div>
172
+ <?php endif; ?>
173
+ <?php if($pagination): ?>
174
+ <div class="tablenav top">
175
+ <?php WDW_FM_Library::html_page_nav($lists['total'], $lists['limit'], 'adminForm'); ?>
176
+ </div>
177
+ <?php endif; ?>
178
+ </div>
179
+ <?php endif; ?>
180
+ <?php endif; ?>
181
+ </div>
182
+
183
+ <div style="overflow-x:scroll;">
184
+ <table class="submissions" width="100%">
185
+ <thead>
186
+ <tr>
187
+ <th width="3%"><?php echo '#'; ?></th>
188
+ <?php
189
+ if($form_fields && $submit_id) {
190
+ echo '<th width="4%" class="submitid_fc"';
191
+ if(!(strpos($lists['hide_label_list'],'@submitid@')===false))
192
+ echo 'style="display:none;"';
193
+ echo '>';
194
+ if($ordering)
195
+ echo '<a href="" onclick="document.getElementById(\'order_by\').value = \'group_id\'; document.getElementById(\'asc_or_desc\').value = \'' . (($order_by == "group_id" && $asc_or_desc == 'asc') ? 'desc' : 'asc') . '\'; fm_form_submit(event, \'adminForm\');">
196
+ <span>Id</span>
197
+ <span>' . ($order_by == "group_id" ? ($asc_or_desc == "asc" ? "&#x25B2;" : "&#x25BC;") : "") . '</span>
198
+ </a>';
199
+ else
200
+ echo 'Id';
201
+ echo '</th>';
202
+ }
203
+ if($submit_date) {
204
+ echo '<th width="150" align="center" class="submitdate_fc"';
205
+ if(!(strpos($lists['hide_label_list'],'@submitdate@')===false))
206
+ echo 'style="display:none;"';
207
+ echo '>';
208
+ if($ordering)
209
+ echo '<a href="" onclick="document.getElementById(\'order_by\').value = \'date\'; document.getElementById(\'asc_or_desc\').value = \'' . (($order_by == "date" && $asc_or_desc == 'asc') ? 'desc' : 'asc') . '\'; fm_form_submit(event, \'adminForm\');">
210
+ <span>Submit date</span>
211
+ <span>' . ($order_by == "date" ? ($asc_or_desc == "asc" ? "&#x25B2;" : "&#x25BC;") : "") . '</span>
212
+ </a>';
213
+ else
214
+ echo 'Submit Date';
215
+ echo '</th>';
216
+ }
217
+ if($submitter_ip) {
218
+ echo '<th width="100" align="center" class="submitterip_fc"';
219
+ if(!(strpos($lists['hide_label_list'],'@submitterip@')===false))
220
+ echo 'style="display:none;"';
221
+ echo '>';
222
+ if($ordering)
223
+ echo '<a href="" onclick="document.getElementById(\'order_by\').value = \'ip\'; document.getElementById(\'asc_or_desc\').value = \'' . (($order_by == "ip" && $asc_or_desc == 'asc') ? 'desc' : 'asc') . '\'; fm_form_submit(event, \'adminForm\');">
224
+ <span>Submitter\'s IP Address</span>
225
+ <span>' . ($order_by == "ip" ? ($asc_or_desc == "asc" ? "&#x25B2;" : "&#x25BC;") : "") . '</span>
226
+ </a>';
227
+ else
228
+ echo 'Submitter\'s IP Address';
229
+ echo '</th>';
230
+ }
231
+ if($username) {
232
+ echo '<th width="100" class="submitterusername_fc"';
233
+ if(!(strpos($lists['hide_label_list'],'@submitterusername@')===false))
234
+ echo 'style="display:none;"';
235
+ echo '>';
236
+ if($ordering)
237
+ echo '<a href="" onclick="document.getElementById(\'order_by\').value = \'display_name\'; document.getElementById(\'asc_or_desc\').value = \'' . (($order_by == "display_name" && $asc_or_desc == 'asc') ? 'desc' : 'asc') . '\'; fm_form_submit(event, \'adminForm\');">
238
+ <span>Submitter\'s Username</span>
239
+ <span>' . ($order_by == "display_name" ? ($asc_or_desc == "asc" ? "&#x25B2;" : "&#x25BC;") : "") . '</span>
240
+ </a>';
241
+ else
242
+ echo 'Submitter\'s Username';
243
+ echo '</th>';
244
+ }
245
+ if($useremail) {
246
+ echo '<th width="100" class="submitteremail_fc"';
247
+ if(!(strpos($lists['hide_label_list'],'@submitteremail@')===false))
248
+ echo 'style="display:none;"';
249
+ echo '>';
250
+ if($ordering)
251
+ echo '<a href="" onclick="document.getElementById(\'order_by\').value = \'user_email\'; document.getElementById(\'asc_or_desc\').value = \'' . (($order_by == "user_email" && $asc_or_desc == 'asc') ? 'desc' : 'asc') . '\'; fm_form_submit(event, \'adminForm\');">
252
+ <span>Submitter\'s Email Address</span>
253
+ <span>' . ($order_by == "user_email" ? ($asc_or_desc == "asc" ? "&#x25B2;" : "&#x25BC;") : "") . '</span>
254
+ </a>';
255
+ else
256
+ echo 'Submitter\'s Email Address';
257
+ echo '</th>';
258
+ }
259
+ $n=count($rows);
260
+ $ispaypal=false;
261
+ for($i=0; $i < count($labels) ; $i++) {
262
+ if($form_fields && !in_array($labels_id[$i], $checked_ids)) {
263
+ if(strpos($lists['hide_label_list'],'@'.$labels_id[$i].'@')===false) $styleStr='';
264
+ else $styleStr='style="display:none;"';
265
+ $field_title=$label_titles_copy[$i];
266
+ if($sorted_labels_type[$i]=='type_paypal_payment_status') {
267
+ $ispaypal=true;
268
+ }
269
+ echo '<th align="center" class="'.$labels_id[$i].'_fc" '.$styleStr.'>';
270
+ if($ordering)
271
+ echo '<a href="" onclick="document.getElementById(\'order_by\').value = \'' . $labels_id[$i] . '_field\'; document.getElementById(\'asc_or_desc\').value = \'' . (($order_by == $labels_id[$i] . '_field' && $asc_or_desc == 'asc') ? 'desc' : 'asc') . '\'; fm_form_submit(event, \'adminForm\');">
272
+ <span>' . $field_title . '</span>
273
+ <span>' . ($order_by == $labels_id[$i]."_field" ? ($asc_or_desc == "asc" ? "&#x25B2;" : "&#x25BC;") : "") . '</span>
274
+ </a>';
275
+ else
276
+ echo $field_title;
277
+ echo '</th>';
278
+ }
279
+ }
280
+ if($form_fields && $payment_info) {
281
+ if(strpos($lists['hide_label_list'],'@payment_info@')===false)
282
+ $styleStr2='aa';
283
+ else
284
+ $styleStr2='style="display:none;"';
285
+ echo '<th class="payment_info_fc" '.$styleStr2.'>Payment Info</th>';
286
+ }
287
+ ?>
288
+
289
+ </tr>
290
+ <tr id="fields_filter" style="display:none">
291
+ <th width="3%"></th>
292
+ <?php if($form_fields && $submit_id): ?>
293
+ <th width="4%" class="submitid_fc" <?php if(!(strpos($lists['hide_label_list'],'@submitid@')===false)) echo 'style="display:none;"';?> ></th>
294
+ <?php endif;
295
+
296
+ if($submit_date): ?>
297
+ <th class="submitdate_fc" style="text-align:left; <?php if(!(strpos($lists['hide_label_list'],'@submitdate@')===false)) echo 'display:none;';?>" align="center">
298
+ <table class="simple_table">
299
+ <tr>
300
+ <td><?php echo __('From', 'form_maker'); ?>:</td>
301
+ <td><input class="inputbox" type="text" name="startdate" id="startdate" size="10" ma