Contact Bank: WordPress Form Builder for Contact Forms - Version 2.1.0

Version Description

  • Major Version Release
  • Code Optimized
  • Saving of Data Changed
  • Removed Unwanted Javascript Functions
  • Forms are Serialized and Encoded with a Secure Algorithm
Download this release

Release Info

Developer contact-banker
Plugin Icon 128x128 Contact Bank: WordPress Form Builder for Contact Forms
Version 2.1.0
Comparing to
See all releases

Code changes from version 2.0.353 to 2.1.0

assets/css/stylesheet.css CHANGED
@@ -58,16 +58,6 @@
58
  z-index: 1103;
59
  }
60
 
61
- #dvLoading {
62
- background: #000 url("../images/lightbox_loading.gif") no-repeat center center;
63
- height: 100px;
64
- width: 100px;
65
- position: fixed;
66
- z-index: 1000;
67
- left: 50%;
68
- top: 50%;
69
- margin: -25px 0 0 -25px;
70
- }
71
  .separator-doubled {
72
  padding: 0;
73
  height: 0;
@@ -1661,10 +1651,6 @@ table th.layout-span12 {
1661
  background: url("../images/tables/sort_desc.png") no-repeat 100% 8px;
1662
  }
1663
 
1664
- .sorting_asc_disabled {
1665
- background: url("../images/tables/sort_asc_disabled.png") no-repeat 100% 8px;
1666
- }
1667
-
1668
  .sorting_desc_disabled {
1669
  background: url("../images/tables/sort_desc_disabled.png") no-repeat 100% 8px;
1670
  }
@@ -2373,7 +2359,7 @@ opacity: 0.8;
2373
  -moz-box-shadow: 0px 1px 1px 0 #FF6D1E inset;
2374
  -webkit-box-shadow: 0px 1px 1px 0 #FF6D1E inset;
2375
  box-shadow: 0px 1px 1px 0 #FF6D1E inset;
2376
-
2377
  }
2378
  .gb_buy_pro .gb_message_buttons:hover, .gb_buy_pro .gb_message_buttons:focus
2379
  {
@@ -2513,13 +2499,13 @@ opacity: 0.8;
2513
  {
2514
  padding: 0px 10px 0 16px;
2515
  }
2516
- .contact_bank_layout > a
2517
  {
2518
  margin-top:15px;
2519
  margin-bottom:10px;
2520
  text-decoration:none !important;
2521
  }
2522
- .contact_bank_layout > .btn
2523
  {
2524
  margin-top:15px;
2525
  margin-bottom:10px;
@@ -2530,7 +2516,7 @@ opacity: 0.8;
2530
  max-width : 45%;
2531
  float : left;
2532
  padding-right : 2.5%;
2533
-
2534
  padding-bottom : 2em;
2535
  }
2536
 
@@ -2583,19 +2569,19 @@ opacity: 0.8;
2583
  padding : 0;
2584
  }
2585
 
2586
- .framework_tabs
2587
  {
2588
  width:100%;
2589
  display:inline-block;
2590
  }
2591
- .framework_tab-links:after
2592
  {
2593
  display:inline-block;
2594
  clear:both;
2595
  content:'';
2596
  }
2597
-
2598
- .framework_tab-links li
2599
  {
2600
  margin:0px 5px;
2601
  float:left;
@@ -2603,8 +2589,8 @@ opacity: 0.8;
2603
  border :1px solid #e5e5e5;
2604
  border-bottom:none;
2605
  }
2606
-
2607
- .framework_tab-links a
2608
  {
2609
  padding:9px 15px;
2610
  display:inline-block;
@@ -2613,20 +2599,20 @@ opacity: 0.8;
2613
  color:#4c4c4c;
2614
  transition:all linear 0.15s;
2615
  }
2616
-
2617
- .framework_tab-links a:hover
2618
  {
2619
  background:#ffffff;
2620
  text-decoration:none;
2621
  }
2622
-
2623
- li.active a, li.active a:hover
2624
  {
2625
  background:#fff;
2626
  color:#4c4c4c;
2627
  }
2628
-
2629
- .framework_tab-content
2630
  {
2631
  border-radius:3px;
2632
  border:1px solid #e5e5e5;
@@ -2636,13 +2622,13 @@ li.active a, li.active a:hover
2636
  padding: 10px 10px 10px 10px;
2637
  margin-left: 4px;
2638
  }
2639
-
2640
- .framework_tab
2641
  {
2642
  display:none;
2643
  }
2644
-
2645
- .framework_tab.active
2646
  {
2647
  display:block;
2648
  }
@@ -2655,7 +2641,7 @@ li.active a, li.active a:hover
2655
  {
2656
  vertical-align: middle !important;
2657
  }
2658
- .plugin-div
2659
  {
2660
  float: left;
2661
  margin: 0 8px 16px;
@@ -2669,18 +2655,18 @@ li.active a, li.active a:hover
2669
  box-sizing: border-box
2670
  }
2671
 
2672
- .plugin-div:nth-child(odd)
2673
  {
2674
  clear: both;
2675
  margin-left: 0
2676
  }
2677
 
2678
- .plugin-div:nth-child(even)
2679
  {
2680
  margin-right: 0
2681
  }
2682
 
2683
- @media screen and (max-width:782px)
2684
  {
2685
  .plugin-card {
2686
  margin-left: 0;
@@ -2689,7 +2675,7 @@ li.active a, li.active a:hover
2689
  }
2690
  }
2691
 
2692
- .plugin-div-top
2693
  {
2694
  position: relative;
2695
  padding: 20px 20px 10px;
@@ -2699,7 +2685,7 @@ li.active a, li.active a:hover
2699
  {
2700
  min-height:150px;
2701
  }
2702
- .plugin-action-buttons, div.action-links
2703
  {
2704
  margin: 0
2705
  }
@@ -2712,18 +2698,18 @@ li.active a, li.active a:hover
2712
  .plugin-div .desc, .plugin-div .name
2713
  {
2714
  margin-left: 148px;
2715
-
2716
  }
2717
 
2718
- .plugin-div .action-links
2719
  {
2720
 
2721
  }
2722
- .plugin-div-button
2723
  {
2724
  margin-left: 5px !important;
2725
  }
2726
- .plugin-div-settings
2727
  {
2728
  display:inline-block;
2729
  margin: 0 0px 16px;
@@ -2745,44 +2731,44 @@ li.active a, li.active a:hover
2745
  margin-left: 0
2746
  }
2747
 
2748
- .plugin-div-settings:nth-child(even)
2749
  {
2750
  margin-right: 0;
2751
  margin-left: 8px;
2752
-
2753
  }
2754
 
2755
 
2756
- .plugin-div-settings-top
2757
  {
2758
  position: relative;
2759
  padding: 20px 20px 10px;
2760
  background-color: #fff;
2761
  }
2762
 
2763
- .plugin-action-buttons, div.action-links
2764
  {
2765
  margin: 0
2766
  }
2767
- .plugin-div-settings h4
2768
  {
2769
  margin: 0 0 12px;
2770
  font-size: 16px;
2771
  line-height: 1.3
2772
  }
2773
 
2774
- .plugin-div-settings .desc, .plugin-div-settings .name
2775
  {
2776
  margin-left: 148px;
2777
-
2778
  }
2779
 
2780
- .plugin-div-settings-button
2781
  {
2782
  margin-left: 5px !important;
2783
 
2784
  }
2785
- .plugin-card-bottom_settings
2786
  {
2787
  clear: both;
2788
  padding: 8px 20px;
@@ -2822,7 +2808,7 @@ li.active a, li.active a:hover
2822
  }
2823
 
2824
 
2825
- .service-div-settings
2826
  {
2827
  display:inline-block;
2828
  margin: 0 0px 16px;
@@ -2844,17 +2830,17 @@ li.active a, li.active a:hover
2844
  margin-left: 0
2845
  }
2846
 
2847
- .service-div-settings:nth-child(even)
2848
  {
2849
  margin-right: 0;
2850
  margin-left: 8px;
2851
-
2852
  }
2853
- .service-div-settings .desc, .service-div-settings .name
2854
  {
2855
-
2856
  }
2857
- .service-div-settings-top
2858
  {
2859
  position: relative;
2860
  padding: 5px 20px;
@@ -2880,4 +2866,4 @@ li.active a, li.active a:hover
2880
  {
2881
  color: #fff;
2882
  margin: 0px !important;
2883
- }
58
  z-index: 1103;
59
  }
60
 
 
 
 
 
 
 
 
 
 
 
61
  .separator-doubled {
62
  padding: 0;
63
  height: 0;
1651
  background: url("../images/tables/sort_desc.png") no-repeat 100% 8px;
1652
  }
1653
 
 
 
 
 
1654
  .sorting_desc_disabled {
1655
  background: url("../images/tables/sort_desc_disabled.png") no-repeat 100% 8px;
1656
  }
2359
  -moz-box-shadow: 0px 1px 1px 0 #FF6D1E inset;
2360
  -webkit-box-shadow: 0px 1px 1px 0 #FF6D1E inset;
2361
  box-shadow: 0px 1px 1px 0 #FF6D1E inset;
2362
+
2363
  }
2364
  .gb_buy_pro .gb_message_buttons:hover, .gb_buy_pro .gb_message_buttons:focus
2365
  {
2499
  {
2500
  padding: 0px 10px 0 16px;
2501
  }
2502
+ .contact_bank_layout > a
2503
  {
2504
  margin-top:15px;
2505
  margin-bottom:10px;
2506
  text-decoration:none !important;
2507
  }
2508
+ .contact_bank_layout > .btn
2509
  {
2510
  margin-top:15px;
2511
  margin-bottom:10px;
2516
  max-width : 45%;
2517
  float : left;
2518
  padding-right : 2.5%;
2519
+
2520
  padding-bottom : 2em;
2521
  }
2522
 
2569
  padding : 0;
2570
  }
2571
 
2572
+ .framework_tabs
2573
  {
2574
  width:100%;
2575
  display:inline-block;
2576
  }
2577
+ .framework_tab-links:after
2578
  {
2579
  display:inline-block;
2580
  clear:both;
2581
  content:'';
2582
  }
2583
+
2584
+ .framework_tab-links li
2585
  {
2586
  margin:0px 5px;
2587
  float:left;
2589
  border :1px solid #e5e5e5;
2590
  border-bottom:none;
2591
  }
2592
+
2593
+ .framework_tab-links a
2594
  {
2595
  padding:9px 15px;
2596
  display:inline-block;
2599
  color:#4c4c4c;
2600
  transition:all linear 0.15s;
2601
  }
2602
+
2603
+ .framework_tab-links a:hover
2604
  {
2605
  background:#ffffff;
2606
  text-decoration:none;
2607
  }
2608
+
2609
+ li.active a, li.active a:hover
2610
  {
2611
  background:#fff;
2612
  color:#4c4c4c;
2613
  }
2614
+
2615
+ .framework_tab-content
2616
  {
2617
  border-radius:3px;
2618
  border:1px solid #e5e5e5;
2622
  padding: 10px 10px 10px 10px;
2623
  margin-left: 4px;
2624
  }
2625
+
2626
+ .framework_tab
2627
  {
2628
  display:none;
2629
  }
2630
+
2631
+ .framework_tab.active
2632
  {
2633
  display:block;
2634
  }
2641
  {
2642
  vertical-align: middle !important;
2643
  }
2644
+ .plugin-div
2645
  {
2646
  float: left;
2647
  margin: 0 8px 16px;
2655
  box-sizing: border-box
2656
  }
2657
 
2658
+ .plugin-div:nth-child(odd)
2659
  {
2660
  clear: both;
2661
  margin-left: 0
2662
  }
2663
 
2664
+ .plugin-div:nth-child(even)
2665
  {
2666
  margin-right: 0
2667
  }
2668
 
2669
+ @media screen and (max-width:782px)
2670
  {
2671
  .plugin-card {
2672
  margin-left: 0;
2675
  }
2676
  }
2677
 
2678
+ .plugin-div-top
2679
  {
2680
  position: relative;
2681
  padding: 20px 20px 10px;
2685
  {
2686
  min-height:150px;
2687
  }
2688
+ .plugin-action-buttons, div.action-links
2689
  {
2690
  margin: 0
2691
  }
2698
  .plugin-div .desc, .plugin-div .name
2699
  {
2700
  margin-left: 148px;
2701
+
2702
  }
2703
 
2704
+ .plugin-div .action-links
2705
  {
2706
 
2707
  }
2708
+ .plugin-div-button
2709
  {
2710
  margin-left: 5px !important;
2711
  }
2712
+ .plugin-div-settings
2713
  {
2714
  display:inline-block;
2715
  margin: 0 0px 16px;
2731
  margin-left: 0
2732
  }
2733
 
2734
+ .plugin-div-settings:nth-child(even)
2735
  {
2736
  margin-right: 0;
2737
  margin-left: 8px;
2738
+
2739
  }
2740
 
2741
 
2742
+ .plugin-div-settings-top
2743
  {
2744
  position: relative;
2745
  padding: 20px 20px 10px;
2746
  background-color: #fff;
2747
  }
2748
 
2749
+ .plugin-action-buttons, div.action-links
2750
  {
2751
  margin: 0
2752
  }
2753
+ .plugin-div-settings h4
2754
  {
2755
  margin: 0 0 12px;
2756
  font-size: 16px;
2757
  line-height: 1.3
2758
  }
2759
 
2760
+ .plugin-div-settings .desc, .plugin-div-settings .name
2761
  {
2762
  margin-left: 148px;
2763
+
2764
  }
2765
 
2766
+ .plugin-div-settings-button
2767
  {
2768
  margin-left: 5px !important;
2769
 
2770
  }
2771
+ .plugin-card-bottom_settings
2772
  {
2773
  clear: both;
2774
  padding: 8px 20px;
2808
  }
2809
 
2810
 
2811
+ .service-div-settings
2812
  {
2813
  display:inline-block;
2814
  margin: 0 0px 16px;
2830
  margin-left: 0
2831
  }
2832
 
2833
+ .service-div-settings:nth-child(even)
2834
  {
2835
  margin-right: 0;
2836
  margin-left: 8px;
2837
+
2838
  }
2839
+ .service-div-settings .desc, .service-div-settings .name
2840
  {
2841
+
2842
  }
2843
+ .service-div-settings-top
2844
  {
2845
  position: relative;
2846
  padding: 5px 20px;
2866
  {
2867
  color: #fff;
2868
  margin: 0px !important;
2869
+ }
contact-bank.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
- /**
3
  Plugin Name: Contact Bank Lite Edition
4
  Plugin URI: http://tech-banker.com
5
  Description: Build Complex, Powerful Contact Forms in Just Seconds. No Programming Knowledge Required! Yeah, It's Really That Easy.
6
  Author: Tech Banker
7
- Version: 2.0.353
8
  Author URI: http://tech-banker.com
9
  License: GPLv3 or later
10
  */
@@ -18,9 +18,12 @@ if (!defined("contact_bank")) define("contact_bank", "contact_bank");
18
  if (!defined("tech_bank")) define("tech_bank", "tech-banker");
19
  if (!defined("CONTACT_BK_PLUGIN_BASENAME")) define("CONTACT_BK_PLUGIN_BASENAME", plugin_basename(__FILE__));
20
 
21
- function plugin_uninstall_script_for_contact_bank()
22
  {
23
- wp_clear_scheduled_hook("contact_bank_auto_update");
 
 
 
24
  }
25
  /* Function Name : plugin_install_script_for_contact_bank
26
  * Paramters : None
@@ -66,77 +69,79 @@ if(!function_exists("plugin_install_script_for_contact_bank"))
66
  * Last Modified : 1.0
67
  * Reasons for change : None
68
  */
69
- function create_global_menus_for_contact_bank()
70
  {
71
- global $wpdb,$current_user;
72
- if (is_super_admin())
73
- {
74
- $cb_role = "administrator";
75
- }
76
- else
77
  {
78
- $cb_role = $wpdb->prefix . "capabilities";
79
- $current_user->role = array_keys($current_user->$cb_role);
80
- $cb_role = $current_user->role[0];
81
- }
82
- switch ($cb_role) {
83
- case "administrator":
84
- add_menu_page("Contact Bank", __("Contact Bank", contact_bank), "read", "contact_dashboard","",plugins_url("/assets/images/icon.png" , __FILE__));
85
- add_submenu_page("contact_dashboard", "Dashboard", __("Dashboard", contact_bank), "read", "contact_dashboard","contact_dashboard");
86
- add_submenu_page("","","", "read", "contact_bank","contact_bank");
87
- add_submenu_page("contact_dashboard", "Plugin Updates", __("Plugin Updates", contact_bank), "read", "contact_plugin_update", "contact_plugin_update" );
88
- add_submenu_page("contact_dashboard", "Short-Codes", __("Short-Codes", contact_bank), "read", "contact_short_code", "contact_short_code" );
89
- add_submenu_page("contact_dashboard", "Form Entries", __("Form Entries", contact_bank), "read", "contact_frontend_data","contact_frontend_data");
90
- add_submenu_page("contact_dashboard", "Email Settings", __("Email Settings", contact_bank), "read", "contact_email", "contact_email");
91
- add_submenu_page("contact_dashboard", "Global Settings", __("Global Settings", contact_bank), "read", "contact_layout_settings", "contact_layout_settings");
92
- add_submenu_page("contact_dashboard", "Feature Requests", __("Feature Requests", contact_bank), "read", "contact_feature_request", "contact_feature_request");
93
- add_submenu_page("contact_dashboard", "System Status", __("System Status", contact_bank), "read", "contact_system_status", "contact_system_status" );
94
- add_submenu_page("contact_dashboard", "Recommendations", __("Recommendations", contact_bank), "read", "contact_bank_recommended_plugins", "contact_bank_recommended_plugins");
95
- add_submenu_page("contact_dashboard", "Premium Editions", __("Premium Editions", contact_bank), "read", "contact_pro_version", "contact_pro_version" );
96
- add_submenu_page("contact_dashboard", " Our Other Services ", __("Our Other Services", contact_bank), "read", "contact_bank_other_services", "contact_bank_other_services");
97
- add_submenu_page("","","", "read", "add_contact_email_settings", "add_contact_email_settings" );
98
- add_submenu_page("","","", "read", "form_preview", "form_preview" );
99
- break;
100
- case "editor":
101
- add_menu_page("Contact Bank", __("Contact Bank", contact_bank), "read", "contact_dashboard","",plugins_url("/assets/images/icon.png" , __FILE__));
102
- add_submenu_page("contact_dashboard", "Dashboard", __("Dashboard", contact_bank), "read", "contact_dashboard","contact_dashboard");
103
- add_submenu_page("","","", "read", "contact_bank","contact_bank");
104
- add_submenu_page("contact_dashboard", "Plugin Updates", __("Plugin Updates", contact_bank), "read", "contact_plugin_update", "contact_plugin_update" );
105
- add_submenu_page("contact_dashboard", "Short-Codes", __("Short-Codes", contact_bank), "read", "contact_short_code", "contact_short_code" );
106
- add_submenu_page("contact_dashboard", "Form Entries", __("Form Entries", contact_bank), "read", "contact_frontend_data","contact_frontend_data");
107
- add_submenu_page("contact_dashboard", "Email Settings", __("Email Settings", contact_bank), "read", "contact_email", "contact_email");
108
- add_submenu_page("contact_dashboard", "Global Settings", __("Global Settings", contact_bank), "read", "contact_layout_settings", "contact_layout_settings");
109
- add_submenu_page("contact_dashboard", "Feature Requests", __("Feature Requests", contact_bank), "read", "contact_feature_request", "contact_feature_request");
110
- add_submenu_page("contact_dashboard", "System Status", __("System Status", contact_bank), "read", "contact_system_status", "contact_system_status" );
111
- add_submenu_page("contact_dashboard", "Recommendations", __("Recommendations", contact_bank), "read", "contact_bank_recommended_plugins", "contact_bank_recommended_plugins");
112
- add_submenu_page("contact_dashboard", "Premium Editions", __("Premium Editions", contact_bank), "read", "contact_pro_version", "contact_pro_version" );
113
- add_submenu_page("contact_dashboard", " Our Other Services ", __("Our Other Services", contact_bank), "read", "contact_bank_other_services", "contact_bank_other_services");
114
- add_submenu_page("","","", "read", "add_contact_email_settings", "add_contact_email_settings" );
115
- add_submenu_page("","","", "read", "form_preview", "form_preview" );
116
- break;
117
- case "author":
118
- add_menu_page("Contact Bank", __("Contact Bank", contact_bank), "read", "contact_dashboard","",plugins_url("/assets/images/icon.png" , __FILE__));
119
- add_submenu_page("contact_dashboard", "Dashboard", __("Dashboard", contact_bank), "read", "contact_dashboard","contact_dashboard");
120
- add_submenu_page("","","", "read", "contact_bank","contact_bank");
121
- add_submenu_page("contact_dashboard", "Plugin Updates", __("Plugin Updates", contact_bank), "read", "contact_plugin_update", "contact_plugin_update" );
122
- add_submenu_page("contact_dashboard", "Short-Codes", __("Short-Codes", contact_bank), "read", "contact_short_code", "contact_short_code" );
123
- add_submenu_page("contact_dashboard", "Form Entries", __("Form Entries", contact_bank), "read", "contact_frontend_data","contact_frontend_data");
124
- add_submenu_page("contact_dashboard", "Email Settings", __("Email Settings", contact_bank), "read", "contact_email", "contact_email");
125
- add_submenu_page("contact_dashboard", "Global Settings", __("Global Settings", contact_bank), "read", "contact_layout_settings", "contact_layout_settings");
126
- add_submenu_page("contact_dashboard", "Feature Requests", __("Feature Requests", contact_bank), "read", "contact_feature_request", "contact_feature_request");
127
- add_submenu_page("contact_dashboard", "System Status", __("System Status", contact_bank), "read", "contact_system_status", "contact_system_status" );
128
- add_submenu_page("contact_dashboard", "Recommendations", __("Recommendations", contact_bank), "read", "contact_bank_recommended_plugins", "contact_bank_recommended_plugins");
129
- add_submenu_page("contact_dashboard", "Premium Editions", __("Premium Editions", contact_bank), "read", "contact_pro_version", "contact_pro_version" );
130
- add_submenu_page("contact_dashboard", " Our Other Services ", __("Our Other Services", contact_bank), "read", "contact_bank_other_services", "contact_bank_other_services");
131
- add_submenu_page("","","", "read", "add_contact_email_settings", "add_contact_email_settings" );
132
- add_submenu_page("","","", "read", "form_preview", "form_preview" );
133
- break;
134
- case "contributor":
135
  break;
136
-
137
- case "subscriber":
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  break;
139
 
 
 
 
140
  }
141
  }
142
  /* Function Name : contact_bank
@@ -147,436 +152,489 @@ function create_global_menus_for_contact_bank()
147
  * Last Modified : 1.0
148
  * Reasons for change : None
149
  */
150
- function contact_bank()
151
  {
152
-
153
- global $wpdb,$current_user,$cb_user_role_permission;
154
- if (is_super_admin())
155
- {
156
- $cb_role = "administrator";
157
- }
158
- else
159
- {
160
- $cb_role = $wpdb->prefix . "capabilities";
161
- $current_user->role = array_keys($current_user->$cb_role);
162
- $cb_role = $current_user->role[0];
163
- }
164
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
165
  {
166
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
167
- }
168
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact_view.php"))
169
- {
170
- include_once CONTACT_BK_PLUGIN_DIR ."/views/contact_view.php";
171
- }
172
- if(file_exists(CONTACT_BK_PLUGIN_DIR . "/views/includes_common_after.php"))
173
- {
174
- include_once CONTACT_BK_PLUGIN_DIR . "/views/includes_common_after.php";
175
- }
176
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
177
- {
178
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
  }
180
  }
181
- function contact_dashboard()
182
  {
183
- global $wpdb,$current_user,$cb_user_role_permission;
184
- if (is_super_admin())
185
- {
186
- $cb_role = "administrator";
187
- }
188
- else
189
  {
190
- $cb_role = $wpdb->prefix . "capabilities";
191
- $current_user->role = array_keys($current_user->$cb_role);
192
- $cb_role = $current_user->role[0];
193
- }
194
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
195
- {
196
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
197
- }
198
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/dashboard.php"))
199
- {
200
- include_once CONTACT_BK_PLUGIN_DIR ."/views/dashboard.php";
201
- }
202
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
203
- {
204
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
 
 
 
 
 
 
 
 
205
  }
206
  }
207
- function edit_contact_view()
208
  {
209
- global $wpdb,$current_user,$cb_user_role_permission;
210
- if (is_super_admin())
211
  {
212
- $cb_role = "administrator";
213
- }
214
- else
215
- {
216
- $cb_role = $wpdb->prefix . "capabilities";
217
- $current_user->role = array_keys($current_user->$cb_role);
218
- $cb_role = $current_user->role[0];
219
- }
220
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
221
- {
222
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
223
- }
224
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact_view.php"))
225
- {
226
- include_once CONTACT_BK_PLUGIN_DIR ."/views/contact_view.php";
227
- }
228
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
229
- {
230
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
 
 
 
 
231
  }
232
  }
233
-
234
- function contact_plugin_update()
235
  {
236
- global $wpdb,$current_user,$cb_user_role_permission;
237
- if (is_super_admin())
238
- {
239
- $cb_role = "administrator";
240
- }
241
- else
242
  {
243
- $cb_role = $wpdb->prefix . "capabilities";
244
- $current_user->role = array_keys($current_user->$cb_role);
245
- $cb_role = $current_user->role[0];
246
- }
247
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
248
- {
249
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
250
- }
251
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/automatic-plugin-update.php"))
252
- {
253
- include_once CONTACT_BK_PLUGIN_DIR ."/views/automatic-plugin-update.php";
254
- }
255
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
256
- {
257
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
 
 
 
 
 
 
 
 
258
  }
259
  }
260
- function contact_email()
261
  {
262
- global $wpdb,$current_user,$cb_user_role_permission;
263
- if (is_super_admin())
264
- {
265
- $cb_role = "administrator";
266
- }
267
- else
268
- {
269
- $cb_role = $wpdb->prefix . "capabilities";
270
- $current_user->role = array_keys($current_user->$cb_role);
271
- $cb_role = $current_user->role[0];
272
- }
273
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
274
  {
275
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
276
- }
277
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact_email_settings.php"))
278
- {
279
- include_once CONTACT_BK_PLUGIN_DIR ."/views/contact_email_settings.php";
280
- }
281
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
282
- {
283
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
  }
285
  }
286
- function contact_frontend_data()
287
  {
288
- global $wpdb,$current_user,$cb_user_role_permission;
289
- if (is_super_admin())
290
- {
291
- $cb_role = "administrator";
292
- }
293
- else
294
- {
295
- $cb_role = $wpdb->prefix . "capabilities";
296
- $current_user->role = array_keys($current_user->$cb_role);
297
- $cb_role = $current_user->role[0];
298
- }
299
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
300
- {
301
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
302
- }
303
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact_frontend_data.php"))
304
- {
305
- include_once CONTACT_BK_PLUGIN_DIR ."/views/contact_frontend_data.php";
306
- }
307
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
308
  {
309
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
310
  }
311
  }
312
- function add_contact_email_settings()
313
  {
314
- global $wpdb,$current_user,$cb_user_role_permission;
315
- if (is_super_admin())
316
- {
317
- $cb_role = "administrator";
318
- }
319
- else
320
- {
321
- $cb_role = $wpdb->prefix . "capabilities";
322
- $current_user->role = array_keys($current_user->$cb_role);
323
- $cb_role = $current_user->role[0];
324
- }
325
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
326
- {
327
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
328
- }
329
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/add_contact_email.php"))
330
- {
331
- include_once CONTACT_BK_PLUGIN_DIR ."/views/add_contact_email.php";
332
- }
333
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
334
  {
335
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
336
  }
337
  }
338
- function contact_layout_settings()
339
  {
340
- global $wpdb,$current_user,$cb_user_role_permission;
341
- if (is_super_admin())
342
- {
343
- $cb_role = "administrator";
344
- }
345
- else
346
- {
347
- $cb_role = $wpdb->prefix . "capabilities";
348
- $current_user->role = array_keys($current_user->$cb_role);
349
- $cb_role = $current_user->role[0];
350
- }
351
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
352
  {
353
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
354
- }
355
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact_bank_layout_settings.php"))
356
- {
357
- include_once CONTACT_BK_PLUGIN_DIR ."/views/contact_bank_layout_settings.php";
358
- }
359
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
360
- {
361
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
362
  }
363
  }
364
- function contact_feature_request()
365
  {
366
- global $wpdb,$current_user,$user_role_permission;
367
- if(is_super_admin())
368
- {
369
- $cb_role = "administrator";
370
- }
371
- else
372
- {
373
- $cb_role = $wpdb->prefix . "capabilities";
374
- $current_user->role = array_keys($current_user->$cb_role);
375
- $cb_role = $current_user->role[0];
376
- }
377
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
378
- {
379
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
380
- }
381
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact-feedback.php"))
382
  {
383
- include_once CONTACT_BK_PLUGIN_DIR ."/views/contact-feedback.php";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
384
  }
385
  }
386
- function contact_system_status()
387
  {
388
- global $wpdb,$current_user,$cb_user_role_permission;
389
- if (is_super_admin())
390
- {
391
- $cb_role = "administrator";
392
- }
393
- else
394
  {
395
- $cb_role = $wpdb->prefix . "capabilities";
396
- $current_user->role = array_keys($current_user->$cb_role);
397
- $cb_role = $current_user->role[0];
398
- }
399
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
400
- {
401
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
402
- }
403
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact-bank-system-report.php"))
404
- {
405
- include_once CONTACT_BK_PLUGIN_DIR ."/views/contact-bank-system-report.php";
406
- }
407
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
408
- {
409
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
 
 
 
 
 
 
 
 
410
  }
411
  }
412
-
413
- function form_preview()
414
  {
415
- global $wpdb,$current_user,$cb_user_role_permission;
416
- if (is_super_admin())
417
- {
418
- $cb_role = "administrator";
419
- }
420
- else
421
- {
422
- $cb_role = $wpdb->prefix . "capabilities";
423
- $current_user->role = array_keys($current_user->$cb_role);
424
- $cb_role = $current_user->role[0];
425
- }
426
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
427
- {
428
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
429
- }
430
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact_bank_form_preview.php"))
431
- {
432
- include_once CONTACT_BK_PLUGIN_DIR ."/views/contact_bank_form_preview.php";
433
- }
434
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
435
  {
436
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
437
  }
438
  }
439
- function contact_pro_version()
440
  {
441
- global $wpdb,$current_user,$cb_user_role_permission;
442
- if (is_super_admin())
443
- {
444
- $cb_role = "administrator";
445
- }
446
- else
447
- {
448
- $cb_role = $wpdb->prefix . "capabilities";
449
- $current_user->role = array_keys($current_user->$cb_role);
450
- $cb_role = $current_user->role[0];
451
- }
452
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
453
- {
454
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
455
- }
456
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/purchase_pro_version.php"))
457
- {
458
- include_once CONTACT_BK_PLUGIN_DIR ."/views/purchase_pro_version.php";
459
- }
460
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
461
  {
462
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
463
  }
464
  }
465
- function contact_bank_recommended_plugins()
466
  {
467
- global $wpdb,$current_user,$cb_user_role_permission;
468
- if (is_super_admin())
469
  {
470
- $cb_role = "administrator";
471
- }
472
- else
473
- {
474
- $cb_role = $wpdb->prefix . "capabilities";
475
- $current_user->role = array_keys($current_user->$cb_role);
476
- $cb_role = $current_user->role[0];
477
- }
478
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
479
- {
480
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
 
 
 
 
 
 
 
 
 
 
 
 
481
  }
482
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/recommended-plugins.php"))
 
 
 
483
  {
484
- include_once CONTACT_BK_PLUGIN_DIR ."/views/recommended-plugins.php";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
485
  }
486
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
 
 
 
487
  {
488
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
489
  }
490
  }
491
- function contact_bank_other_services()
492
  {
493
- global $wpdb,$current_user,$cb_user_role_permission;
494
- if (is_super_admin())
495
- {
496
- $cb_role = "administrator";
497
- }
498
- else
499
- {
500
- $cb_role = $wpdb->prefix . "capabilities";
501
- $current_user->role = array_keys($current_user->$cb_role);
502
- $cb_role = $current_user->role[0];
503
- }
504
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
505
- {
506
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
507
- }
508
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/other-services.php"))
509
- {
510
- include_once CONTACT_BK_PLUGIN_DIR ."/views/other-services.php";
511
- }
512
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
513
- {
514
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
515
  }
516
  }
517
- function contact_short_code()
518
  {
519
- global $wpdb,$current_user,$cb_user_role_permission;
520
- if (is_super_admin())
521
- {
522
- $cb_role = "administrator";
523
- }
524
- else
525
- {
526
- $cb_role = $wpdb->prefix . "capabilities";
527
- $current_user->role = array_keys($current_user->$cb_role);
528
- $cb_role = $current_user->role[0];
529
- }
530
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
531
- {
532
- include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
533
- }
534
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/shortcode.php"))
535
- {
536
- include_once CONTACT_BK_PLUGIN_DIR ."/views/shortcode.php";
537
- }
538
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
539
  {
540
- include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
 
 
541
  }
542
  }
543
-
544
- function backend_plugin_js_scripts_contact_bank()
545
- {
546
- wp_enqueue_script("jquery");
547
- wp_enqueue_script("jquery-ui-sortable");
548
- wp_enqueue_script("jquery-ui-droppable");
549
- wp_enqueue_script("jquery-ui-draggable");
550
- wp_enqueue_script("farbtastic");
551
- wp_enqueue_script("jquery-ui-dialog");
552
- wp_enqueue_script("jquery.Tooltip.js", plugins_url("/assets/js/jquery.Tooltip.js",__FILE__));
553
- wp_enqueue_script("jquery.dataTables.min", plugins_url("/assets/js/jquery.dataTables.min.js",__FILE__));
554
- wp_enqueue_script("jquery.validate.min", plugins_url("/assets/js/jquery.validate.min.js",__FILE__));
555
- wp_enqueue_script("bootstrap.js", plugins_url("/assets/js/bootstrap.js",__FILE__));
556
- wp_enqueue_script("jquery.prettyPhoto.js", plugins_url("/assets/js/jquery.prettyPhoto.js",__FILE__));
557
- }
558
- function frontend_plugin_js_scripts_contact_bank()
559
  {
560
- wp_enqueue_script("jquery");
561
- wp_enqueue_script("jquery.Tooltip.js", plugins_url("/assets/js/jquery.Tooltip.js",__FILE__));
562
- wp_enqueue_script("jquery.validate.min", plugins_url("/assets/js/jquery.validate.min.js",__FILE__));
563
- }
564
- function backend_plugin_css_styles_contact_bank()
565
- {
566
- wp_enqueue_style("farbtastic");
567
- wp_enqueue_style("wp-jquery-ui-dialog");
568
- wp_enqueue_style("stylesheet", plugins_url("/assets/css/stylesheet.css",__FILE__));
569
- wp_enqueue_style("font-awesome", plugins_url("/assets/css/font-awesome/css/font-awesome.css",__FILE__));
570
- wp_enqueue_style("system-message", plugins_url("/assets/css/system-message.css",__FILE__));
571
- wp_enqueue_style("prettyPhoto", plugins_url("/assets/css/prettyPhoto.css",__FILE__));
572
- wp_enqueue_style("premium-edition.css", plugins_url("/assets/css/premium-edition.css",__FILE__));
573
- wp_enqueue_style("responsive.css", plugins_url("/assets/css/responsive.css",__FILE__));
574
- wp_enqueue_style("google-fonts-roboto", "//fonts.googleapis.com/css?family=Roboto Condensed:300|Roboto Condensed:300|Roboto Condensed:300|Roboto Condensed:regular|Roboto Condensed:300");
575
  }
576
- function frontend_plugin_css_styles_contact_bank()
577
  {
578
- wp_enqueue_style("stylesheet", plugins_url("/assets/css/stylesheet.css",__FILE__));
579
- wp_enqueue_style("system-message", plugins_url("/assets/css/system-message.css",__FILE__));
 
 
 
580
  }
581
  if(isset($_REQUEST["action"]))
582
  {
@@ -585,22 +643,25 @@ if(isset($_REQUEST["action"]))
585
  case "add_contact_form_library":
586
 
587
  add_action( "admin_init", "add_contact_form_library");
588
- function add_contact_form_library()
589
  {
590
- global $wpdb,$current_user,$cb_user_role_permission;
591
- if (is_super_admin())
592
- {
593
- $cb_role = "administrator";
594
- }
595
- else
596
- {
597
- $cb_role = $wpdb->prefix . "capabilities";
598
- $current_user->role = array_keys($current_user->$cb_role);
599
- $cb_role = $current_user->role[0];
600
- }
601
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_view-class.php"))
602
  {
603
- include_once CONTACT_BK_PLUGIN_DIR . "/lib/contact_view-class.php";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
604
  }
605
  }
606
 
@@ -609,35 +670,40 @@ if(isset($_REQUEST["action"]))
609
  case "frontend_contact_form_library":
610
 
611
  add_action( "admin_init", "frontend_contact_form_library");
612
- function frontend_contact_form_library()
613
  {
614
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_bank_frontend-class.php"))
615
  {
616
- include_once CONTACT_BK_PLUGIN_DIR . "/lib/contact_bank_frontend-class.php";
 
 
 
617
  }
618
  }
619
-
620
  break;
621
 
622
  case "email_contact_form_library":
623
 
624
  add_action( "admin_init", "email_contact_form_library");
625
- function email_contact_form_library()
626
  {
627
- global $wpdb,$current_user,$cb_user_role_permission;
628
- if (is_super_admin())
629
- {
630
- $cb_role = "administrator";
631
- }
632
- else
633
  {
634
- $cb_role = $wpdb->prefix . "capabilities";
635
- $current_user->role = array_keys($current_user->$cb_role);
636
- $cb_role = $current_user->role[0];
637
- }
638
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_bank_email-class.php"))
639
- {
640
- include_once CONTACT_BK_PLUGIN_DIR . "/lib/contact_bank_email-class.php";
 
 
 
 
 
 
 
 
641
  }
642
  }
643
 
@@ -646,11 +712,14 @@ if(isset($_REQUEST["action"]))
646
  case "email_management_contact_form_library":
647
 
648
  add_action( "admin_init", "email_management_contact_form_library");
649
- function email_management_contact_form_library()
650
  {
651
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_bank_email_management.php"))
652
  {
653
- include_once CONTACT_BK_PLUGIN_DIR . "/lib/contact_bank_email_management.php";
 
 
 
654
  }
655
  }
656
 
@@ -659,73 +728,79 @@ if(isset($_REQUEST["action"]))
659
  case "frontend_data_contact_library":
660
 
661
  add_action( "admin_init", "frontend_data_contact_library");
662
- function frontend_data_contact_library()
663
  {
664
- global $wpdb,$current_user,$cb_user_role_permission;
665
- if (is_super_admin())
666
- {
667
- $cb_role = "administrator";
668
- }
669
- else
670
  {
671
- $cb_role = $wpdb->prefix . "capabilities";
672
- $current_user->role = array_keys($current_user->$cb_role);
673
- $cb_role = $current_user->role[0];
674
- }
675
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_frontend_data_class.php"))
676
- {
677
- include CONTACT_BK_PLUGIN_DIR . "/lib/contact_frontend_data_class.php";
 
 
 
 
 
 
 
 
678
  }
679
  }
680
-
681
  break;
682
 
683
  case "show_form_control_data_contact_library":
684
 
685
  add_action( "admin_init", "show_form_control_data_contact_library");
686
- function show_form_control_data_contact_library()
687
  {
688
- global $wpdb,$current_user,$cb_user_role_permission;
689
- if (is_super_admin())
690
- {
691
- $cb_role = "administrator";
692
- }
693
- else
694
- {
695
- $cb_role = $wpdb->prefix . "capabilities";
696
- $current_user->role = array_keys($current_user->$cb_role);
697
- $cb_role = $current_user->role[0];
698
- }
699
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_bank_show_form_control_data-class.php"))
700
  {
701
- include CONTACT_BK_PLUGIN_DIR . "/lib/contact_bank_show_form_control_data-class.php";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
702
  }
703
  }
704
-
705
  break;
706
 
707
  case "layout_settings_contact_library":
708
 
709
  add_action( "admin_init", "layout_settings_contact_library");
710
- function layout_settings_contact_library()
711
  {
712
- global $wpdb,$current_user,$cb_user_role_permission;
713
- if (is_super_admin())
714
  {
715
- $cb_role = "administrator";
716
- }
717
- else
718
- {
719
- $cb_role = $wpdb->prefix . "capabilities";
720
- $current_user->role = array_keys($current_user->$cb_role);
721
- $cb_role = $current_user->role[0];
722
- }
723
- if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_bank_layout_settings-class.php"))
724
- {
725
- include CONTACT_BK_PLUGIN_DIR . "/lib/contact_bank_layout_settings-class.php";
 
 
 
 
726
  }
727
  }
728
-
729
  break;
730
  }
731
  }
@@ -735,414 +810,465 @@ if(isset($_REQUEST["action"]))
735
  * Last Modified : 1.0
736
  * Reasons for change : None
737
  */
738
- function contact_bank_contact_form()
739
- {
740
- global $wpdb;
741
- return $wpdb->prefix . "cb_contact_form";
742
- }
743
- function contact_bank_dynamic_settings_form()
744
  {
745
- global $wpdb;
746
- return $wpdb->prefix . "cb_dynamic_settings";
 
 
 
747
  }
748
- function create_control_Table()
749
  {
750
- global $wpdb;
751
- return $wpdb->prefix . "cb_create_control_form";
 
 
 
752
  }
753
- function frontend_controls_data_Table()
754
  {
755
- global $wpdb;
756
- return $wpdb->prefix . "cb_frontend_data_table";
 
 
 
757
  }
758
- function contact_bank_email_template_admin()
759
  {
760
- global $wpdb;
761
- return $wpdb->prefix . "cb_email_template_admin";
 
 
 
762
  }
763
- function contact_bank_frontend_forms_Table()
764
  {
765
- global $wpdb;
766
- return $wpdb->prefix . "cb_frontend_forms_table";
 
 
 
767
  }
768
- function contact_bank_form_settings_Table()
769
  {
770
- global $wpdb;
771
- return $wpdb->prefix . "cb_form_settings_table";
 
 
 
772
  }
773
- function contact_bank_layout_settings_Table()
774
  {
775
- global $wpdb;
776
- return $wpdb->prefix . "cb_layout_settings_table";
 
 
 
777
  }
778
- function contact_bank_licensing()
779
  {
780
- global $wpdb;
781
- return $wpdb->prefix . "cb_licensing";
 
 
 
782
  }
783
- function contact_bank_roles_capability()
784
  {
785
- global $wpdb;
786
- return $wpdb->prefix . "cb_roles_capability";
 
 
 
787
  }
788
- function contact_bank_short_code($atts)
789
  {
790
- extract(shortcode_atts(array(
791
- "form_id" => "",
792
- "show_title" => "",
793
- "show_desc" => "",
794
- ), $atts));
795
- if(!is_feed())
796
- {
797
- return extract_short_code($form_id,$show_title,$show_desc);
798
- }
799
  }
800
- function extract_short_code($form_id,$show_title,$show_desc)
801
  {
802
- ob_start();
803
- require CONTACT_BK_PLUGIN_DIR."/frontend_views/contact_bank_forms.php";
804
- $contact_bank_output = ob_get_clean();
805
- wp_reset_query();
806
- return $contact_bank_output;
 
 
 
 
 
 
 
807
  }
808
- function add_contact_bank_icon($meta = TRUE)
809
  {
810
- if (!is_user_logged_in() )
811
  {
812
- return;
 
 
 
 
813
  }
814
- else
 
 
 
815
  {
816
- global $wp_admin_bar,$wpdb,$current_user;
817
- if (is_super_admin())
818
  {
819
- $cb_role = "administrator";
820
  }
821
  else
822
  {
823
- $cb_role = $wpdb->prefix . "capabilities";
824
- $current_user->role = array_keys($current_user->$cb_role);
825
- $cb_role = $current_user->role[0];
826
- }
 
 
 
 
 
 
 
827
 
828
- switch ($cb_role)
829
- {
830
- case "administrator":
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
831
 
832
- $wp_admin_bar->add_menu( array(
833
- "id" => "contact_bank_links",
834
- "title" => "<img src=\"".plugins_url("/assets/images/icon.png",__FILE__)."\" width=\"25\" height=\"25\" style=\"vertical-align:text-top; margin-right:5px;\" />Contact Bank" ,
835
- "href" => site_url() ."/wp-admin/admin.php?page=contact_dashboard",
836
- ));
837
- $wp_admin_bar->add_menu( array(
 
 
 
 
 
 
 
 
 
 
838
  "parent" => "contact_bank_links",
839
  "id" => "dashboard_links",
840
  "href" => site_url() ."/wp-admin/admin.php?page=contact_dashboard",
841
  "title" => __( "Dashboard", contact_bank) ) /* set the sub-menu name */
842
- );
843
- $wp_admin_bar->add_menu( array(
844
  "parent" => "contact_bank_links",
845
  "id" => "plugin_updates_links",
846
  "href" => site_url() ."/wp-admin/admin.php?page=contact_plugin_update",
847
  "title" => __( "Plugin Updates", contact_bank)) /* set the sub-menu name */
848
- );
849
- $wp_admin_bar->add_menu( array(
850
  "parent" => "contact_bank_links",
851
  "id" => "short_code_links",
852
  "href" => site_url() ."/wp-admin/admin.php?page=contact_short_code",
853
  "title" => __( "Short-Codes", contact_bank)) /* set the sub-menu name */
854
- );
855
- $wp_admin_bar->add_menu( array(
856
  "parent" => "contact_bank_links",
857
  "id" => "frontend_data_links",
858
  "href" => site_url() ."/wp-admin/admin.php?page=contact_frontend_data",
859
  "title" => __( "Form Entries", contact_bank)) /* set the sub-menu name */
860
- );
861
- $wp_admin_bar->add_menu( array(
862
  "parent" => "contact_bank_links",
863
  "id" => "email_links",
864
  "href" => site_url() ."/wp-admin/admin.php?page=contact_email",
865
  "title" => __( "Email Settings", contact_bank) ) /* set the sub-menu name */
866
- );
867
- $wp_admin_bar->add_menu( array(
868
  "parent" => "contact_bank_links",
869
  "id" => "form_settings_data_links",
870
  "href" => site_url() ."/wp-admin/admin.php?page=contact_layout_settings",
871
  "title" => __( "Global Settings", contact_bank)) /* set the sub-menu name */
872
- );
873
- $wp_admin_bar->add_menu( array(
874
  "parent" => "contact_bank_links",
875
  "id" => "feature_request_data_links",
876
  "href" => site_url() ."/wp-admin/admin.php?page=contact_feature_request",
877
  "title" => __( "Feature Requests", contact_bank)) /* set the sub-menu name */
878
- );
879
- $wp_admin_bar->add_menu( array(
 
880
  "parent" => "contact_bank_links",
881
  "id" => "system_status_data_links",
882
  "href" => site_url() ."/wp-admin/admin.php?page=contact_system_status",
883
  "title" => __( "System Status", contact_bank)) /* set the sub-menu name */
884
- );
885
- $wp_admin_bar->add_menu(array(
886
  "parent" => "contact_bank_links",
887
  "id" => "contact_bank_recommended_plugins_links",
888
  "href" => site_url() . "/wp-admin/admin.php?page=contact_bank_recommended_plugins",
889
  "title" => __("Recommendations", contact_bank))
890
- );
891
 
892
- $wp_admin_bar->add_menu(array(
893
  "parent" => "contact_bank_links",
894
  "id" => "pro_version_links",
895
  "href" => site_url() . "/wp-admin/admin.php?page=contact_pro_version",
896
  "title" => __("Premium Editions", contact_bank))
897
- );
898
 
899
- $wp_admin_bar->add_menu(array(
900
  "parent" => "contact_bank_links",
901
  "id" => "contact_bank_other_services_links",
902
  "href" => site_url() . "/wp-admin/admin.php?page=contact_bank_other_services",
903
  "title" => __("Our Other Services", contact_bank))
904
- );
905
- break;
906
-
907
- case "editor":
908
- $wp_admin_bar->add_menu( array(
909
- "id" => "contact_bank_links",
910
- "title" => "<img src=\"".plugins_url("/assets/images/icon.png",__FILE__)."\" width=\"25\" height=\"25\" style=\"vertical-align:text-top; margin-right:5px;\" />Contact Bank" ,
911
- "href" => site_url() ."/wp-admin/admin.php?page=contact_dashboard",
912
- ));
913
-
914
- $wp_admin_bar->add_menu( array(
915
- "parent" => "contact_bank_links",
916
- "id" => "dashboard_links",
917
- "href" => site_url() ."/wp-admin/admin.php?page=contact_dashboard",
918
- "title" => __( "Dashboard", contact_bank) ) /* set the sub-menu name */
919
- );
920
- $wp_admin_bar->add_menu( array(
921
- "parent" => "contact_bank_links",
922
- "id" => "plugin_updates_links",
923
- "href" => site_url() ."/wp-admin/admin.php?page=contact_plugin_update",
924
- "title" => __( "Plugin Updates", contact_bank)) /* set the sub-menu name */
925
- );
926
- $wp_admin_bar->add_menu( array(
927
- "parent" => "contact_bank_links",
928
- "id" => "short_code_links",
929
- "href" => site_url() ."/wp-admin/admin.php?page=contact_short_code",
930
- "title" => __( "Short-Codes", contact_bank)) /* set the sub-menu name */
931
- );
932
- $wp_admin_bar->add_menu( array(
933
- "parent" => "contact_bank_links",
934
- "id" => "frontend_data_links",
935
- "href" => site_url() ."/wp-admin/admin.php?page=contact_frontend_data",
936
- "title" => __( "Form Entries", contact_bank)) /* set the sub-menu name */
937
- );
938
- $wp_admin_bar->add_menu( array(
939
- "parent" => "contact_bank_links",
940
- "id" => "email_links",
941
- "href" => site_url() ."/wp-admin/admin.php?page=contact_email",
942
- "title" => __( "Email Settings", contact_bank) ) /* set the sub-menu name */
943
- );
944
- $wp_admin_bar->add_menu( array(
945
- "parent" => "contact_bank_links",
946
- "id" => "form_settings_data_links",
947
- "href" => site_url() ."/wp-admin/admin.php?page=contact_layout_settings",
948
- "title" => __( "Global Settings", contact_bank)) /* set the sub-menu name */
949
- );
950
- $wp_admin_bar->add_menu( array(
951
- "parent" => "contact_bank_links",
952
- "id" => "feature_request_data_links",
953
- "href" => site_url() ."/wp-admin/admin.php?page=contact_feature_request",
954
- "title" => __( "Feature Requests", contact_bank)) /* set the sub-menu name */
955
- );
956
 
957
- $wp_admin_bar->add_menu( array(
958
- "parent" => "contact_bank_links",
959
- "id" => "system_status_data_links",
960
- "href" => site_url() ."/wp-admin/admin.php?page=contact_system_status",
961
- "title" => __( "System Status", contact_bank)) /* set the sub-menu name */
962
- );
963
- $wp_admin_bar->add_menu(array(
964
- "parent" => "contact_bank_links",
965
- "id" => "contact_bank_recommended_plugins_links",
966
- "href" => site_url() . "/wp-admin/admin.php?page=contact_bank_recommended_plugins",
967
- "title" => __("Recommendations", contact_bank))
968
- );
969
-
970
- $wp_admin_bar->add_menu(array(
971
- "parent" => "contact_bank_links",
972
- "id" => "pro_version_links",
973
- "href" => site_url() . "/wp-admin/admin.php?page=contact_pro_version",
974
- "title" => __("Premium Editions", contact_bank))
975
- );
976
-
977
- $wp_admin_bar->add_menu(array(
978
- "parent" => "contact_bank_links",
979
- "id" => "contact_bank_other_services_links",
980
- "href" => site_url() . "/wp-admin/admin.php?page=contact_bank_other_services",
981
- "title" => __("Our Other Services", contact_bank))
982
- );
983
- break;
984
-
985
- case "author":
986
- $wp_admin_bar->add_menu( array(
987
- "id" => "contact_bank_links",
988
- "title" => "<img src=\"".plugins_url("/assets/images/icon.png",__FILE__)."\" width=\"25\" height=\"25\" style=\"vertical-align:text-top; margin-right:5px;\" />Contact Bank" ,
989
- "href" => site_url() ."/wp-admin/admin.php?page=contact_dashboard",
990
- ));
991
- $wp_admin_bar->add_menu( array(
992
- "parent" => "contact_bank_links",
993
- "id" => "dashboard_links",
994
- "href" => site_url() ."/wp-admin/admin.php?page=contact_dashboard",
995
- "title" => __( "Dashboard", contact_bank) ) /* set the sub-menu name */
996
- );
997
- $wp_admin_bar->add_menu( array(
998
- "parent" => "contact_bank_links",
999
- "id" => "plugin_updates_links",
1000
- "href" => site_url() ."/wp-admin/admin.php?page=contact_plugin_update",
1001
- "title" => __( "Plugin Updates", contact_bank)) /* set the sub-menu name */
1002
- );
1003
- $wp_admin_bar->add_menu( array(
1004
- "parent" => "contact_bank_links",
1005
- "id" => "short_code_links",
1006
- "href" => site_url() ."/wp-admin/admin.php?page=contact_short_code",
1007
- "title" => __( "Short-Codes", contact_bank)) /* set the sub-menu name */
1008
- );
1009
- $wp_admin_bar->add_menu( array(
1010
- "parent" => "contact_bank_links",
1011
- "id" => "frontend_data_links",
1012
- "href" => site_url() ."/wp-admin/admin.php?page=contact_frontend_data",
1013
- "title" => __( "Form Entries", contact_bank)) /* set the sub-menu name */
1014
- );
1015
- $wp_admin_bar->add_menu( array(
1016
- "parent" => "contact_bank_links",
1017
- "id" => "email_links",
1018
- "href" => site_url() ."/wp-admin/admin.php?page=contact_email",
1019
- "title" => __( "Email Settings", contact_bank) ) /* set the sub-menu name */
1020
- );
1021
- $wp_admin_bar->add_menu( array(
1022
- "parent" => "contact_bank_links",
1023
- "id" => "form_settings_data_links",
1024
- "href" => site_url() ."/wp-admin/admin.php?page=contact_layout_settings",
1025
- "title" => __( "Global Settings", contact_bank)) /* set the sub-menu name */
1026
- );
1027
- $wp_admin_bar->add_menu( array(
1028
- "parent" => "contact_bank_links",
1029
- "id" => "feature_request_data_links",
1030
- "href" => site_url() ."/wp-admin/admin.php?page=contact_feature_request",
1031
- "title" => __( "Feature Requests", contact_bank)) /* set the sub-menu name */
1032
- );
1033
- $wp_admin_bar->add_menu(array(
1034
- "parent" => "contact_bank_links",
1035
- "id" => "contact_bank_recommended_plugins_links",
1036
- "href" => site_url() . "/wp-admin/admin.php?page=contact_bank_recommended_plugins",
1037
- "title" => __("Recommendations", contact_bank))
1038
- );
1039
 
1040
- $wp_admin_bar->add_menu(array(
1041
- "parent" => "contact_bank_links",
1042
- "id" => "pro_version_links",
1043
- "href" => site_url() . "/wp-admin/admin.php?page=contact_pro_version",
1044
- "title" => __("Premium Editions", contact_bank))
1045
- );
1046
 
1047
- $wp_admin_bar->add_menu(array(
1048
- "parent" => "contact_bank_links",
1049
- "id" => "contact_bank_other_services_links",
1050
- "href" => site_url() . "/wp-admin/admin.php?page=contact_bank_other_services",
1051
- "title" => __("Our Other Services", contact_bank))
1052
- );
1053
- break;
 
1054
  }
1055
  }
1056
  }
1057
  add_action( "media_buttons_context", "add_contact_shortcode_button", 1);
1058
- function add_contact_shortcode_button($context)
1059
  {
1060
- add_thickbox();
1061
- $context .= "<a href=\"#TB_inline?width=300&height=400&inlineId=contact-bank\" class=\"button thickbox\" title=\"" . __("Add Contact Bank Form", contact_bank) . "\">
1062
- <span class=\"contact_icon\"></span> Add Contact Bank Form</a>";
1063
- return $context;
 
 
 
1064
  }
1065
  add_action("admin_footer","add_contact_mce_popup");
1066
 
1067
- function add_contact_mce_popup(){
1068
- ?>
1069
- <?php add_thickbox(); ?>
1070
- <div id="contact-bank" style="display:none;">
1071
- <div class="fluid-layout responsive">
1072
- <div style="padding:20px 0 10px 15px;">
1073
- <h3 class="label-shortcode"><?php _e("Insert Contact Bank Form", contact_bank); ?></h3>
 
 
 
1074
  <span>
1075
  <i><?php _e("Select a form below to add it to your post or page.", contact_bank); ?></i>
1076
  </span>
1077
- </div>
1078
- <div class="layout-span12 responsive" style="padding:15px 15px 0 0;">
1079
- <div class="layout-control-group">
1080
- <label class="custom-layout-label" for="ux_form_name"><?php _e("Form Name", contact_bank); ?> : </label>
1081
- <select id="add_contact_form_id" class="layout-span9">
1082
- <option value="0"><?php _e("Select a Form", contact_bank); ?> </option>
1083
- <?php
1084
- global $wpdb;
1085
- $forms = $wpdb->get_results
1086
- (
1087
- "SELECT * FROM " .contact_bank_contact_form()
1088
- );
1089
- for($flag = 0;$flag<count($forms);$flag++)
1090
- {
1091
- ?>
1092
- <option value="<?php echo intval($forms[$flag]->form_id); ?>"><?php echo esc_html($forms[$flag]->form_name) ?></option>
1093
- <?php
1094
- }
1095
- ?>
1096
- </select>
1097
- </div>
1098
- <div class="layout-control-group">
1099
- <label class="custom-layout-label"><?php _e("Show Form Title", contact_bank); ?> : </label>
1100
- <input type="checkbox" checked="checked" name="ux_form_title" id="ux_form_title"/>
1101
  </div>
1102
- <div class="layout-control-group">
1103
- <label class="custom-layout-label"><?php _e("Show Form Description", contact_bank); ?> : </label>
1104
- <input type="checkbox" name="ux_form_desc" id="ux_form_desc"/>
1105
- </div>
1106
- <div class="layout-control-group">
1107
- <label class="custom-layout-label"></label>
1108
- <input type="button" class="button-primary" value="<?php _e("Insert Form", contact_bank); ?>"
1109
- onclick="Insert_Contact_Form();"/>&nbsp;&nbsp;&nbsp;
1110
- <a class="button" style="color:#bbb;" href="#"
1111
- onclick="tb_remove(); return false;"><?php _e("Cancel", contact_bank); ?></a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1112
  </div>
1113
  </div>
1114
  </div>
1115
- </div>
1116
- <script type="text/javascript">
1117
- function Insert_Contact_Form()
1118
- {
1119
- var form_id = jQuery("#add_contact_form_id").val();
1120
- var show_title = jQuery("#ux_form_title").prop("checked");
1121
- var show_desc = jQuery("#ux_form_desc").prop("checked");
1122
- if(form_id == 0)
1123
  {
1124
- alert("<?php _e("Please choose a Form to insert into Shortcode", contact_bank) ?>");
1125
- return;
 
 
 
 
 
 
 
1126
  }
1127
- window.send_to_editor("[contact_bank form_id=" + form_id + " show_title=" + show_title +" show_desc=" + show_desc +"]");
1128
- }
1129
- </script>
1130
- <?php
1131
  }
1132
- function plugin_load_textdomain_contact_bank()
1133
  {
1134
- if(function_exists( "load_plugin_textdomain" ))
1135
- {
1136
- load_plugin_textdomain(contact_bank, false, CONTACT_BK_PLUGIN_DIRNAME ."/languages");
1137
- }
 
 
 
1138
  }
1139
  add_action("plugins_loaded", "plugin_load_textdomain_contact_bank");
1140
 
1141
- function plugin_load_textdomain_contact_bank_services()
1142
  {
1143
- if(function_exists( "load_plugin_textdomain" ))
1144
  {
1145
- load_plugin_textdomain(tech_bank, false, CONTACT_BK_PLUGIN_DIRNAME ."/tech-banker-services");
 
 
 
1146
  }
1147
  }
1148
  add_action("plugins_loaded", "plugin_load_textdomain_contact_bank_services");
@@ -1154,60 +1280,66 @@ if (is_admin() && !request_is_frontend_ajax())
1154
  add_action("admin_init", "plugin_install_script_for_contact_bank");
1155
  }
1156
  }
1157
- function contact_bank_plugin_row($links,$file)
1158
  {
1159
- if ($file == CONTACT_BK_PLUGIN_BASENAME)
1160
  {
1161
- $cpo_row_meta = array(
1162
- "docs" => "<a href='".esc_url( apply_filters("contact_bank_docs_url","http://tech-banker.com/products/wp-contact-bank/knowledge-base/"))."' title='".esc_attr(__( "View Contact Bank Documentation",contact_bank))."'>".__("Docs",contact_bank)."</a>",
1163
- "gopremium" => "<a href='" .esc_url( apply_filters("contact_bank_premium_editions_url", "http://tech-banker.com/products/wp-contact-bank/pricing/"))."' title='".esc_attr(__( "View Contact Bank Premium Editions",contact_bank))."'>".__("Go for Premium!",contact_bank)."</a>",
1164
- );
1165
- return array_merge($links,$cpo_row_meta);
 
 
 
 
1166
  }
1167
- return (array)$links;
1168
  }
1169
- function request_is_frontend_ajax()
1170
- {
1171
- $script_filename = isset($_SERVER['SCRIPT_FILENAME']) ? $_SERVER['SCRIPT_FILENAME'] : '';
1172
 
1173
- //Try to figure out if frontend AJAX request... If we are DOING_AJAX; let's look closer
1174
- if((defined('DOING_AJAX') && DOING_AJAX))
1175
  {
1176
- //From wp-includes/functions.php, wp_get_referer() function.
1177
- //Required to fix: https://core.trac.wordpress.org/ticket/25294
1178
- $ref = '';
1179
- if ( ! empty( $_REQUEST['_wp_http_referer'] ) )
1180
- $ref = wp_unslash( $_REQUEST['_wp_http_referer'] );
1181
- elseif ( ! empty( $_SERVER['HTTP_REFERER'] ) )
1182
- $ref = wp_unslash( $_SERVER['HTTP_REFERER'] );
1183
- //If referer does not contain admin URL and we are using the admin-ajax.php endpoint, this is likely a frontend AJAX request
1184
- if(((strpos($ref, admin_url()) === false) && (basename($script_filename) === 'admin-ajax.php')))
1185
- return true;
 
 
 
 
 
 
 
1186
  }
1187
 
1188
- //If no checks triggered, we end up here - not an AJAX request.
1189
- return false;
1190
- }
1191
  //--------------------------------------------------------------------------------------------------------------//
1192
  // CODE FOR PLUGIN UPDATE MESSAGE
1193
  //--------------------------------------------------------------------------------------------------------------//
1194
- function contact_bank_plugin_update_message($args)
1195
  {
1196
- $response = wp_remote_get( 'http://plugins.svn.wordpress.org/contact-bank/trunk/readme.txt' );
1197
- if ( ! is_wp_error( $response ) && ! empty( $response['body'] ) )
1198
  {
1199
- // Output Upgrade Notice
1200
- $matches = null;
1201
- $regexp = '~==\s*Changelog\s*==\s*=\s*[0-9.]+\s*=(.*)(=\s*' . preg_quote($args['Version']) . '\s*=|$)~Uis';
1202
- $upgrade_notice = '';
1203
- if ( preg_match( $regexp, $response['body'], $matches ) ) {
1204
- $changelog = (array) preg_split('~[\r\n]+~', trim($matches[1]));
1205
- $upgrade_notice .= '<div class="framework_plugin_message">';
1206
- foreach ( $changelog as $index => $line ) {
1207
- $upgrade_notice .= "<p>".$line."</p>";
 
 
 
 
 
 
1208
  }
1209
- $upgrade_notice .= '</div> ';
1210
- echo $upgrade_notice;
1211
  }
1212
  }
1213
  }
@@ -1236,76 +1368,80 @@ add_action( "network_admin_menu", "create_global_menus_for_contact_bank" );
1236
  // in_plugin_update_message Hook called for function to check updates
1237
  add_action("in_plugin_update_message-".CONTACT_BK,"contact_bank_plugin_update_message" );
1238
 
1239
-
1240
  add_filter("widget_text", "do_shortcode");
1241
- class Contact_Bank_Widget extends WP_Widget
1242
  {
1243
- function Contact_Bank_Widget()
1244
- {
1245
- $widget_ops = array("classname" => "Contact_Bank_Widget", "description" => "Uses Contact Form" );
1246
- $this->__construct("Contact_Bank_Widget", "Contact Bank", $widget_ops);
1247
- }
1248
- function form($instance)
1249
  {
1250
- $instance = wp_parse_args((array) $instance, array( "title" => "", "form_id" => "0" ) );
1251
- $title = $instance["title"];
1252
- global $wpdb;
1253
- $form_data = $wpdb->get_results
1254
- (
1255
- "SELECT * FROM " .contact_bank_contact_form()
1256
- );
1257
- ?>
1258
- <p><label for="<?php echo $this->get_field_id("title"); ?>"> Widget Title: <input class="widefat" id="<?php echo $this->get_field_id("title"); ?>" name="<?php echo $this->get_field_name("title"); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></label></p>
1259
- <p><label for="<?php echo $this->get_field_id("form_id"); ?>"><?php _e("Select Form :", contact_bank); ?></label>
1260
- <select size="1" name="<?php echo $this->get_field_name("form_id"); ?>" id="<?php echo $this->get_field_id("form_id"); ?>" class="widefat">
1261
- <option value="0" ><?php _e("Select Form", contact_bank); ?></option>
1262
- <?php
1263
- if($form_data) {
1264
- foreach($form_data as $form)
1265
- {
1266
- echo "<option value=\"" . $form->form_id . "\"";
1267
- if ($form->form_id == $instance["form_id"]) echo "selected=\"selected\"";
1268
- echo ">" . stripslashes(html_entity_decode($form->form_name)) . "</option>" . "\n\t";
1269
- }
1270
- }
1271
- ?>
1272
- </select>
1273
- </p>
1274
- <?php
1275
- }
1276
- function update($new_instance, $old_instance)
1277
- {
1278
- $instance = $old_instance;
1279
- $instance["title"] = $new_instance["title"];
1280
- $instance["form_id"] = (int) $new_instance["form_id"];
1281
- return $instance;
1282
- }
1283
- function widget($args, $instance)
1284
- {
1285
- global $wpdb;
1286
- $form_data = $wpdb->get_var
1287
- (
1288
- $wpdb->prepare
1289
- (
1290
- "SELECT count(*) FROM " .contact_bank_contact_form() . " WHERE form_id = %d",
1291
- $instance["form_id"]
1292
- )
1293
- );
 
 
 
 
 
 
 
 
 
1294
 
1295
- extract($args, EXTR_SKIP);
1296
- echo $before_widget;
1297
- $title = empty($instance["title"]) ? " " : apply_filters("widget_title", $instance["title"]);
1298
- if($form_data > 0)
1299
- {
1300
- if($instance["form_id"] != 0)
1301
- {
1302
- echo $before_title . $title . $after_title;
1303
- $shortcode_for_contact_bank_form = "[contact_bank form_id=" . $instance["form_id"] . " ]";
1304
- echo do_shortcode( $shortcode_for_contact_bank_form );
1305
- echo $after_widget;
1306
- }
1307
- }
1308
- }
 
1309
  }
1310
 
1311
  add_action( "widgets_init", create_function("", "return register_widget(\"Contact_Bank_Widget\");"));
@@ -1323,24 +1459,27 @@ else
1323
  {
1324
  wp_clear_scheduled_hook("contact_bank_auto_update");
1325
  }
1326
- function contact_plugin_autoUpdate()
1327
  {
1328
- try
1329
- {
1330
- require_once(ABSPATH . "wp-admin/includes/class-wp-upgrader.php");
1331
- require_once(ABSPATH . "wp-admin/includes/misc.php");
1332
- define("FS_METHOD", "direct");
1333
- require_once(ABSPATH . "wp-includes/update.php");
1334
- require_once(ABSPATH . "wp-admin/includes/file.php");
1335
- wp_update_plugins();
1336
- ob_start();
1337
- $plugin_upgrader = new Plugin_Upgrader();
1338
- $plugin_upgrader->upgrade("contact-bank/contact-bank.php");
1339
- $output = @ob_get_contents();
1340
- @ob_end_clean();
1341
- }
1342
- catch(Exception $e)
1343
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1344
  }
1345
  }
1346
  ?>
1
  <?php
2
+ /*
3
  Plugin Name: Contact Bank Lite Edition
4
  Plugin URI: http://tech-banker.com
5
  Description: Build Complex, Powerful Contact Forms in Just Seconds. No Programming Knowledge Required! Yeah, It's Really That Easy.
6
  Author: Tech Banker
7
+ Version: 2.1.0
8
  Author URI: http://tech-banker.com
9
  License: GPLv3 or later
10
  */
18
  if (!defined("tech_bank")) define("tech_bank", "tech-banker");
19
  if (!defined("CONTACT_BK_PLUGIN_BASENAME")) define("CONTACT_BK_PLUGIN_BASENAME", plugin_basename(__FILE__));
20
 
21
+ if(!function_exists("plugin_uninstall_script_for_contact_bank"))
22
  {
23
+ function plugin_uninstall_script_for_contact_bank()
24
+ {
25
+ wp_clear_scheduled_hook("contact_bank_auto_update");
26
+ }
27
  }
28
  /* Function Name : plugin_install_script_for_contact_bank
29
  * Paramters : None
69
  * Last Modified : 1.0
70
  * Reasons for change : None
71
  */
72
+ if(!function_exists("create_global_menus_for_contact_bank"))
73
  {
74
+ function create_global_menus_for_contact_bank()
 
 
 
 
 
75
  {
76
+ global $wpdb,$current_user;
77
+ if (is_super_admin())
78
+ {
79
+ $cb_role = "administrator";
80
+ }
81
+ else
82
+ {
83
+ $cb_role = $wpdb->prefix . "capabilities";
84
+ $current_user->role = array_keys($current_user->$cb_role);
85
+ $cb_role = $current_user->role[0];
86
+ }
87
+ switch ($cb_role) {
88
+ case "administrator":
89
+ add_menu_page("Contact Bank", __("Contact Bank", contact_bank), "read", "contact_dashboard","",plugins_url("/assets/images/icon.png" , __FILE__));
90
+ add_submenu_page("contact_dashboard", "Dashboard", __("Dashboard", contact_bank), "read", "contact_dashboard","contact_dashboard");
91
+ add_submenu_page("","","", "read", "contact_bank","contact_bank");
92
+ add_submenu_page("contact_dashboard", "Plugin Updates", __("Plugin Updates", contact_bank), "read", "contact_plugin_update", "contact_plugin_update" );
93
+ add_submenu_page("contact_dashboard", "Short-Codes", __("Short-Codes", contact_bank), "read", "contact_short_code", "contact_short_code" );
94
+ add_submenu_page("contact_dashboard", "Form Entries", __("Form Entries", contact_bank), "read", "contact_frontend_data","contact_frontend_data");
95
+ add_submenu_page("contact_dashboard", "Email Settings", __("Email Settings", contact_bank), "read", "contact_email", "contact_email");
96
+ add_submenu_page("contact_dashboard", "Global Settings", __("Global Settings", contact_bank), "read", "contact_layout_settings", "contact_layout_settings");
97
+ add_submenu_page("contact_dashboard", "Feature Requests", __("Feature Requests", contact_bank), "read", "contact_feature_request", "contact_feature_request");
98
+ add_submenu_page("contact_dashboard", "System Status", __("System Status", contact_bank), "read", "contact_system_status", "contact_system_status" );
99
+ add_submenu_page("contact_dashboard", "Recommendations", __("Recommendations", contact_bank), "read", "contact_bank_recommended_plugins", "contact_bank_recommended_plugins");
100
+ add_submenu_page("contact_dashboard", "Premium Editions", __("Premium Editions", contact_bank), "read", "contact_pro_version", "contact_pro_version" );
101
+ add_submenu_page("contact_dashboard", " Our Other Services ", __("Our Other Services", contact_bank), "read", "contact_bank_other_services", "contact_bank_other_services");
102
+ add_submenu_page("","","", "read", "add_contact_email_settings", "add_contact_email_settings" );
103
+ add_submenu_page("","","", "read", "form_preview", "form_preview" );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  break;
105
+ case "editor":
106
+ add_menu_page("Contact Bank", __("Contact Bank", contact_bank), "read", "contact_dashboard","",plugins_url("/assets/images/icon.png" , __FILE__));
107
+ add_submenu_page("contact_dashboard", "Dashboard", __("Dashboard", contact_bank), "read", "contact_dashboard","contact_dashboard");
108
+ add_submenu_page("","","", "read", "contact_bank","contact_bank");
109
+ add_submenu_page("contact_dashboard", "Plugin Updates", __("Plugin Updates", contact_bank), "read", "contact_plugin_update", "contact_plugin_update" );
110
+ add_submenu_page("contact_dashboard", "Short-Codes", __("Short-Codes", contact_bank), "read", "contact_short_code", "contact_short_code" );
111
+ add_submenu_page("contact_dashboard", "Form Entries", __("Form Entries", contact_bank), "read", "contact_frontend_data","contact_frontend_data");
112
+ add_submenu_page("contact_dashboard", "Email Settings", __("Email Settings", contact_bank), "read", "contact_email", "contact_email");
113
+ add_submenu_page("contact_dashboard", "Global Settings", __("Global Settings", contact_bank), "read", "contact_layout_settings", "contact_layout_settings");
114
+ add_submenu_page("contact_dashboard", "Feature Requests", __("Feature Requests", contact_bank), "read", "contact_feature_request", "contact_feature_request");
115
+ add_submenu_page("contact_dashboard", "System Status", __("System Status", contact_bank), "read", "contact_system_status", "contact_system_status" );
116
+ add_submenu_page("contact_dashboard", "Recommendations", __("Recommendations", contact_bank), "read", "contact_bank_recommended_plugins", "contact_bank_recommended_plugins");
117
+ add_submenu_page("contact_dashboard", "Premium Editions", __("Premium Editions", contact_bank), "read", "contact_pro_version", "contact_pro_version" );
118
+ add_submenu_page("contact_dashboard", " Our Other Services ", __("Our Other Services", contact_bank), "read", "contact_bank_other_services", "contact_bank_other_services");
119
+ add_submenu_page("","","", "read", "add_contact_email_settings", "add_contact_email_settings" );
120
+ add_submenu_page("","","", "read", "form_preview", "form_preview" );
121
+ break;
122
+ case "author":
123
+ add_menu_page("Contact Bank", __("Contact Bank", contact_bank), "read", "contact_dashboard","",plugins_url("/assets/images/icon.png" , __FILE__));
124
+ add_submenu_page("contact_dashboard", "Dashboard", __("Dashboard", contact_bank), "read", "contact_dashboard","contact_dashboard");
125
+ add_submenu_page("","","", "read", "contact_bank","contact_bank");
126
+ add_submenu_page("contact_dashboard", "Plugin Updates", __("Plugin Updates", contact_bank), "read", "contact_plugin_update", "contact_plugin_update" );
127
+ add_submenu_page("contact_dashboard", "Short-Codes", __("Short-Codes", contact_bank), "read", "contact_short_code", "contact_short_code" );
128
+ add_submenu_page("contact_dashboard", "Form Entries", __("Form Entries", contact_bank), "read", "contact_frontend_data","contact_frontend_data");
129
+ add_submenu_page("contact_dashboard", "Email Settings", __("Email Settings", contact_bank), "read", "contact_email", "contact_email");
130
+ add_submenu_page("contact_dashboard", "Global Settings", __("Global Settings", contact_bank), "read", "contact_layout_settings", "contact_layout_settings");
131
+ add_submenu_page("contact_dashboard", "Feature Requests", __("Feature Requests", contact_bank), "read", "contact_feature_request", "contact_feature_request");
132
+ add_submenu_page("contact_dashboard", "System Status", __("System Status", contact_bank), "read", "contact_system_status", "contact_system_status" );
133
+ add_submenu_page("contact_dashboard", "Recommendations", __("Recommendations", contact_bank), "read", "contact_bank_recommended_plugins", "contact_bank_recommended_plugins");
134
+ add_submenu_page("contact_dashboard", "Premium Editions", __("Premium Editions", contact_bank), "read", "contact_pro_version", "contact_pro_version" );
135
+ add_submenu_page("contact_dashboard", " Our Other Services ", __("Our Other Services", contact_bank), "read", "contact_bank_other_services", "contact_bank_other_services");
136
+ add_submenu_page("","","", "read", "add_contact_email_settings", "add_contact_email_settings" );
137
+ add_submenu_page("","","", "read", "form_preview", "form_preview" );
138
+ break;
139
+ case "contributor":
140
  break;
141
 
142
+ case "subscriber":
143
+ break;
144
+ }
145
  }
146
  }
147
  /* Function Name : contact_bank
152
  * Last Modified : 1.0
153
  * Reasons for change : None
154
  */
155
+ if(!function_exists("contact_bank"))
156
  {
157
+ function contact_bank()
 
 
 
 
 
 
 
 
 
 
 
 
158
  {
159
+ global $wpdb,$current_user,$cb_user_role_permission;
160
+ if (is_super_admin())
161
+ {
162
+ $cb_role = "administrator";
163
+ }
164
+ else
165
+ {
166
+ $cb_role = $wpdb->prefix . "capabilities";
167
+ $current_user->role = array_keys($current_user->$cb_role);
168
+ $cb_role = $current_user->role[0];
169
+ }
170
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
171
+ {
172
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
173
+ }
174
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact_view.php"))
175
+ {
176
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/contact_view.php";
177
+ }
178
+ if(file_exists(CONTACT_BK_PLUGIN_DIR . "/views/includes_common_after.php"))
179
+ {
180
+ include_once CONTACT_BK_PLUGIN_DIR . "/views/includes_common_after.php";
181
+ }
182
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
183
+ {
184
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
185
+ }
186
  }
187
  }
188
+ if(!function_exists("contact_dashboard"))
189
  {
190
+ function contact_dashboard()
 
 
 
 
 
191
  {
192
+ global $wpdb,$current_user,$cb_user_role_permission;
193
+ if (is_super_admin())
194
+ {
195
+ $cb_role = "administrator";
196
+ }
197
+ else
198
+ {
199
+ $cb_role = $wpdb->prefix . "capabilities";
200
+ $current_user->role = array_keys($current_user->$cb_role);
201
+ $cb_role = $current_user->role[0];
202
+ }
203
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
204
+ {
205
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
206
+ }
207
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/dashboard.php"))
208
+ {
209
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/dashboard.php";
210
+ }
211
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
212
+ {
213
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
214
+ }
215
  }
216
  }
217
+ if(!function_exists("edit_contact_view"))
218
  {
219
+ function edit_contact_view()
 
220
  {
221
+ global $wpdb,$current_user,$cb_user_role_permission;
222
+ if (is_super_admin())
223
+ {
224
+ $cb_role = "administrator";
225
+ }
226
+ else
227
+ {
228
+ $cb_role = $wpdb->prefix . "capabilities";
229
+ $current_user->role = array_keys($current_user->$cb_role);
230
+ $cb_role = $current_user->role[0];
231
+ }
232
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
233
+ {
234
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
235
+ }
236
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact_view.php"))
237
+ {
238
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/contact_view.php";
239
+ }
240
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
241
+ {
242
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
243
+ }
244
  }
245
  }
246
+ if(!function_exists("contact_plugin_update"))
 
247
  {
248
+ function contact_plugin_update()
 
 
 
 
 
249
  {
250
+ global $wpdb,$current_user,$cb_user_role_permission;
251
+ if (is_super_admin())
252
+ {
253
+ $cb_role = "administrator";
254
+ }
255
+ else
256
+ {
257
+ $cb_role = $wpdb->prefix . "capabilities";
258
+ $current_user->role = array_keys($current_user->$cb_role);
259
+ $cb_role = $current_user->role[0];
260
+ }
261
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
262
+ {
263
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
264
+ }
265
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/automatic-plugin-update.php"))
266
+ {
267
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/automatic-plugin-update.php";
268
+ }
269
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
270
+ {
271
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
272
+ }
273
  }
274
  }
275
+ if(!function_exists("contact_email"))
276
  {
277
+ function contact_email()
 
 
 
 
 
 
 
 
 
 
 
278
  {
279
+ global $wpdb,$current_user,$cb_user_role_permission;
280
+ if (is_super_admin())
281
+ {
282
+ $cb_role = "administrator";
283
+ }
284
+ else
285
+ {
286
+ $cb_role = $wpdb->prefix . "capabilities";
287
+ $current_user->role = array_keys($current_user->$cb_role);
288
+ $cb_role = $current_user->role[0];
289
+ }
290
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
291
+ {
292
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
293
+ }
294
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact_email_settings.php"))
295
+ {
296
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/contact_email_settings.php";
297
+ }
298
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
299
+ {
300
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
301
+ }
302
  }
303
  }
304
+ if(!function_exists("contact_frontend_data"))
305
  {
306
+ function contact_frontend_data()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
307
  {
308
+ global $wpdb,$current_user,$cb_user_role_permission;
309
+ if (is_super_admin())
310
+ {
311
+ $cb_role = "administrator";
312
+ }
313
+ else
314
+ {
315
+ $cb_role = $wpdb->prefix . "capabilities";
316
+ $current_user->role = array_keys($current_user->$cb_role);
317
+ $cb_role = $current_user->role[0];
318
+ }
319
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
320
+ {
321
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
322
+ }
323
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact_frontend_data.php"))
324
+ {
325
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/contact_frontend_data.php";
326
+ }
327
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
328
+ {
329
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
330
+ }
331
  }
332
  }
333
+ if(!function_exists("add_contact_email_settings"))
334
  {
335
+ function add_contact_email_settings()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
336
  {
337
+ global $wpdb,$current_user,$cb_user_role_permission;
338
+ if (is_super_admin())
339
+ {
340
+ $cb_role = "administrator";
341
+ }
342
+ else
343
+ {
344
+ $cb_role = $wpdb->prefix . "capabilities";
345
+ $current_user->role = array_keys($current_user->$cb_role);
346
+ $cb_role = $current_user->role[0];
347
+ }
348
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
349
+ {
350
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
351
+ }
352
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/add_contact_email.php"))
353
+ {
354
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/add_contact_email.php";
355
+ }
356
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
357
+ {
358
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
359
+ }
360
  }
361
  }
362
+ if(!function_exists("contact_layout_settings"))
363
  {
364
+ function contact_layout_settings()
 
 
 
 
 
 
 
 
 
 
 
365
  {
366
+ global $wpdb,$current_user,$cb_user_role_permission;
367
+ if (is_super_admin())
368
+ {
369
+ $cb_role = "administrator";
370
+ }
371
+ else
372
+ {
373
+ $cb_role = $wpdb->prefix . "capabilities";
374
+ $current_user->role = array_keys($current_user->$cb_role);
375
+ $cb_role = $current_user->role[0];
376
+ }
377
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
378
+ {
379
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
380
+ }
381
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact_bank_layout_settings.php"))
382
+ {
383
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/contact_bank_layout_settings.php";
384
+ }
385
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
386
+ {
387
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
388
+ }
389
  }
390
  }
391
+ if(!function_exists("contact_feature_request"))
392
  {
393
+ function contact_feature_request()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
394
  {
395
+ global $wpdb,$current_user,$user_role_permission;
396
+ if(is_super_admin())
397
+ {
398
+ $cb_role = "administrator";
399
+ }
400
+ else
401
+ {
402
+ $cb_role = $wpdb->prefix . "capabilities";
403
+ $current_user->role = array_keys($current_user->$cb_role);
404
+ $cb_role = $current_user->role[0];
405
+ }
406
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
407
+ {
408
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
409
+ }
410
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact-feedback.php"))
411
+ {
412
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/contact-feedback.php";
413
+ }
414
  }
415
  }
416
+ if(!function_exists("contact_system_status"))
417
  {
418
+ function contact_system_status()
 
 
 
 
 
419
  {
420
+ global $wpdb,$current_user,$cb_user_role_permission;
421
+ if (is_super_admin())
422
+ {
423
+ $cb_role = "administrator";
424
+ }
425
+ else
426
+ {
427
+ $cb_role = $wpdb->prefix . "capabilities";
428
+ $current_user->role = array_keys($current_user->$cb_role);
429
+ $cb_role = $current_user->role[0];
430
+ }
431
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
432
+ {
433
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
434
+ }
435
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact-bank-system-report.php"))
436
+ {
437
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/contact-bank-system-report.php";
438
+ }
439
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
440
+ {
441
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
442
+ }
443
  }
444
  }
445
+ if(!function_exists("form_preview"))
 
446
  {
447
+ function form_preview()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
448
  {
449
+ global $wpdb,$current_user,$cb_user_role_permission;
450
+ if (is_super_admin())
451
+ {
452
+ $cb_role = "administrator";
453
+ }
454
+ else
455
+ {
456
+ $cb_role = $wpdb->prefix . "capabilities";
457
+ $current_user->role = array_keys($current_user->$cb_role);
458
+ $cb_role = $current_user->role[0];
459
+ }
460
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
461
+ {
462
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
463
+ }
464
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/contact_bank_form_preview.php"))
465
+ {
466
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/contact_bank_form_preview.php";
467
+ }
468
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
469
+ {
470
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
471
+ }
472
  }
473
  }
474
+ if(!function_exists("contact_pro_version"))
475
  {
476
+ function contact_pro_version()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
477
  {
478
+ global $wpdb,$current_user,$cb_user_role_permission;
479
+ if (is_super_admin())
480
+ {
481
+ $cb_role = "administrator";
482
+ }
483
+ else
484
+ {
485
+ $cb_role = $wpdb->prefix . "capabilities";
486
+ $current_user->role = array_keys($current_user->$cb_role);
487
+ $cb_role = $current_user->role[0];
488
+ }
489
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
490
+ {
491
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
492
+ }
493
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/purchase_pro_version.php"))
494
+ {
495
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/purchase_pro_version.php";
496
+ }
497
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
498
+ {
499
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
500
+ }
501
  }
502
  }
503
+ if(!function_exists("contact_bank_recommended_plugins"))
504
  {
505
+ function contact_bank_recommended_plugins()
 
506
  {
507
+ global $wpdb,$current_user,$cb_user_role_permission;
508
+ if (is_super_admin())
509
+ {
510
+ $cb_role = "administrator";
511
+ }
512
+ else
513
+ {
514
+ $cb_role = $wpdb->prefix . "capabilities";
515
+ $current_user->role = array_keys($current_user->$cb_role);
516
+ $cb_role = $current_user->role[0];
517
+ }
518
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
519
+ {
520
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
521
+ }
522
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/recommended-plugins.php"))
523
+ {
524
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/recommended-plugins.php";
525
+ }
526
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
527
+ {
528
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
529
+ }
530
  }
531
+ }
532
+ if(!function_exists("contact_bank_other_services"))
533
+ {
534
+ function contact_bank_other_services()
535
  {
536
+ global $wpdb,$current_user,$cb_user_role_permission;
537
+ if (is_super_admin())
538
+ {
539
+ $cb_role = "administrator";
540
+ }
541
+ else
542
+ {
543
+ $cb_role = $wpdb->prefix . "capabilities";
544
+ $current_user->role = array_keys($current_user->$cb_role);
545
+ $cb_role = $current_user->role[0];
546
+ }
547
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
548
+ {
549
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
550
+ }
551
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/other-services.php"))
552
+ {
553
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/other-services.php";
554
+ }
555
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
556
+ {
557
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
558
+ }
559
  }
560
+ }
561
+ if(!function_exists("contact_short_code"))
562
+ {
563
+ function contact_short_code()
564
  {
565
+ global $wpdb,$current_user,$cb_user_role_permission;
566
+ if (is_super_admin())
567
+ {
568
+ $cb_role = "administrator";
569
+ }
570
+ else
571
+ {
572
+ $cb_role = $wpdb->prefix . "capabilities";
573
+ $current_user->role = array_keys($current_user->$cb_role);
574
+ $cb_role = $current_user->role[0];
575
+ }
576
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/header.php"))
577
+ {
578
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/header.php";
579
+ }
580
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/shortcode.php"))
581
+ {
582
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/shortcode.php";
583
+ }
584
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/views/footer.php"))
585
+ {
586
+ include_once CONTACT_BK_PLUGIN_DIR ."/views/footer.php";
587
+ }
588
  }
589
  }
590
+ if(!function_exists("backend_plugin_js_scripts_contact_bank"))
591
  {
592
+ function backend_plugin_js_scripts_contact_bank()
593
+ {
594
+ wp_enqueue_script("jquery");
595
+ wp_enqueue_script("jquery-ui-sortable");
596
+ wp_enqueue_script("jquery-ui-droppable");
597
+ wp_enqueue_script("jquery-ui-draggable");
598
+ wp_enqueue_script("farbtastic");
599
+ wp_enqueue_script("jquery-ui-dialog");
600
+ wp_enqueue_script("jquery.Tooltip.js", plugins_url("/assets/js/jquery.Tooltip.js",__FILE__));
601
+ wp_enqueue_script("jquery.dataTables.min", plugins_url("/assets/js/jquery.dataTables.min.js",__FILE__));
602
+ wp_enqueue_script("jquery.validate.min", plugins_url("/assets/js/jquery.validate.min.js",__FILE__));
603
+ wp_enqueue_script("bootstrap.js", plugins_url("/assets/js/bootstrap.js",__FILE__));
604
+ wp_enqueue_script("jquery.prettyPhoto.js", plugins_url("/assets/js/jquery.prettyPhoto.js",__FILE__));
 
 
 
 
 
 
 
 
 
605
  }
606
  }
607
+ if(!function_exists("frontend_plugin_js_scripts_contact_bank"))
608
  {
609
+ function frontend_plugin_js_scripts_contact_bank()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
610
  {
611
+ wp_enqueue_script("jquery");
612
+ wp_enqueue_script("jquery.Tooltip.js", plugins_url("/assets/js/jquery.Tooltip.js",__FILE__));
613
+ wp_enqueue_script("jquery.validate.min", plugins_url("/assets/js/jquery.validate.min.js",__FILE__));
614
  }
615
  }
616
+ if(!function_exists("backend_plugin_css_styles_contact_bank"))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
617
  {
618
+ function backend_plugin_css_styles_contact_bank()
619
+ {
620
+ wp_enqueue_style("farbtastic");
621
+ wp_enqueue_style("wp-jquery-ui-dialog");
622
+ wp_enqueue_style("stylesheet", plugins_url("/assets/css/stylesheet.css",__FILE__));
623
+ wp_enqueue_style("font-awesome", plugins_url("/assets/css/font-awesome/css/font-awesome.css",__FILE__));
624
+ wp_enqueue_style("system-message", plugins_url("/assets/css/system-message.css",__FILE__));
625
+ wp_enqueue_style("prettyPhoto", plugins_url("/assets/css/prettyPhoto.css",__FILE__));
626
+ wp_enqueue_style("premium-edition.css", plugins_url("/assets/css/premium-edition.css",__FILE__));
627
+ wp_enqueue_style("responsive.css", plugins_url("/assets/css/responsive.css",__FILE__));
628
+ wp_enqueue_style("google-fonts-roboto", "//fonts.googleapis.com/css?family=Roboto Condensed:300|Roboto Condensed:300|Roboto Condensed:300|Roboto Condensed:regular|Roboto Condensed:300");
629
+ }
 
 
 
630
  }
631
+ if(!function_exists("frontend_plugin_css_styles_contact_bank"))
632
  {
633
+ function frontend_plugin_css_styles_contact_bank()
634
+ {
635
+ wp_enqueue_style("stylesheet", plugins_url("/assets/css/stylesheet.css",__FILE__));
636
+ wp_enqueue_style("system-message", plugins_url("/assets/css/system-message.css",__FILE__));
637
+ }
638
  }
639
  if(isset($_REQUEST["action"]))
640
  {
643
  case "add_contact_form_library":
644
 
645
  add_action( "admin_init", "add_contact_form_library");
646
+ if(!function_exists("add_contact_form_library"))
647
  {
648
+ function add_contact_form_library()
 
 
 
 
 
 
 
 
 
 
 
649
  {
650
+ global $wpdb,$current_user,$cb_user_role_permission;
651
+ if (is_super_admin())
652
+ {
653
+ $cb_role = "administrator";
654
+ }
655
+ else
656
+ {
657
+ $cb_role = $wpdb->prefix . "capabilities";
658
+ $current_user->role = array_keys($current_user->$cb_role);
659
+ $cb_role = $current_user->role[0];
660
+ }
661
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_view-class.php"))
662
+ {
663
+ include_once CONTACT_BK_PLUGIN_DIR . "/lib/contact_view-class.php";
664
+ }
665
  }
666
  }
667
 
670
  case "frontend_contact_form_library":
671
 
672
  add_action( "admin_init", "frontend_contact_form_library");
673
+ if(!function_exists("frontend_contact_form_library"))
674
  {
675
+ function frontend_contact_form_library()
676
  {
677
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_bank_frontend-class.php"))
678
+ {
679
+ include_once CONTACT_BK_PLUGIN_DIR . "/lib/contact_bank_frontend-class.php";
680
+ }
681
  }
682
  }
 
683
  break;
684
 
685
  case "email_contact_form_library":
686
 
687
  add_action( "admin_init", "email_contact_form_library");
688
+ if(!function_exists("email_contact_form_library"))
689
  {
690
+ function email_contact_form_library()
 
 
 
 
 
691
  {
692
+ global $wpdb,$current_user,$cb_user_role_permission;
693
+ if (is_super_admin())
694
+ {
695
+ $cb_role = "administrator";
696
+ }
697
+ else
698
+ {
699
+ $cb_role = $wpdb->prefix . "capabilities";
700
+ $current_user->role = array_keys($current_user->$cb_role);
701
+ $cb_role = $current_user->role[0];
702
+ }
703
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_bank_email-class.php"))
704
+ {
705
+ include_once CONTACT_BK_PLUGIN_DIR . "/lib/contact_bank_email-class.php";
706
+ }
707
  }
708
  }
709
 
712
  case "email_management_contact_form_library":
713
 
714
  add_action( "admin_init", "email_management_contact_form_library");
715
+ if(!function_exists("email_management_contact_form_library"))
716
  {
717
+ function email_management_contact_form_library()
718
  {
719
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_bank_email_management.php"))
720
+ {
721
+ include_once CONTACT_BK_PLUGIN_DIR . "/lib/contact_bank_email_management.php";
722
+ }
723
  }
724
  }
725
 
728
  case "frontend_data_contact_library":
729
 
730
  add_action( "admin_init", "frontend_data_contact_library");
731
+ if(!function_exists("frontend_data_contact_library"))
732
  {
733
+ function frontend_data_contact_library()
 
 
 
 
 
734
  {
735
+ global $wpdb,$current_user,$cb_user_role_permission;
736
+ if (is_super_admin())
737
+ {
738
+ $cb_role = "administrator";
739
+ }
740
+ else
741
+ {
742
+ $cb_role = $wpdb->prefix . "capabilities";
743
+ $current_user->role = array_keys($current_user->$cb_role);
744
+ $cb_role = $current_user->role[0];
745
+ }
746
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_frontend_data_class.php"))
747
+ {
748
+ include CONTACT_BK_PLUGIN_DIR . "/lib/contact_frontend_data_class.php";
749
+ }
750
  }
751
  }
 
752
  break;
753
 
754
  case "show_form_control_data_contact_library":
755
 
756
  add_action( "admin_init", "show_form_control_data_contact_library");
757
+ if(!function_exists("show_form_control_data_contact_library"))
758
  {
759
+ function show_form_control_data_contact_library()
 
 
 
 
 
 
 
 
 
 
 
760
  {
761
+ global $wpdb,$current_user,$cb_user_role_permission;
762
+ if (is_super_admin())
763
+ {
764
+ $cb_role = "administrator";
765
+ }
766
+ else
767
+ {
768
+ $cb_role = $wpdb->prefix . "capabilities";
769
+ $current_user->role = array_keys($current_user->$cb_role);
770
+ $cb_role = $current_user->role[0];
771
+ }
772
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_bank_show_form_control_data-class.php"))
773
+ {
774
+ include CONTACT_BK_PLUGIN_DIR . "/lib/contact_bank_show_form_control_data-class.php";
775
+ }
776
  }
777
  }
 
778
  break;
779
 
780
  case "layout_settings_contact_library":
781
 
782
  add_action( "admin_init", "layout_settings_contact_library");
783
+ if(!function_exists("layout_settings_contact_library"))
784
  {
785
+ function layout_settings_contact_library()
 
786
  {
787
+ global $wpdb,$current_user,$cb_user_role_permission;
788
+ if (is_super_admin())
789
+ {
790
+ $cb_role = "administrator";
791
+ }
792
+ else
793
+ {
794
+ $cb_role = $wpdb->prefix . "capabilities";
795
+ $current_user->role = array_keys($current_user->$cb_role);
796
+ $cb_role = $current_user->role[0];
797
+ }
798
+ if(file_exists(CONTACT_BK_PLUGIN_DIR ."/lib/contact_bank_layout_settings-class.php"))
799
+ {
800
+ include CONTACT_BK_PLUGIN_DIR . "/lib/contact_bank_layout_settings-class.php";
801
+ }
802
  }
803
  }
 
804
  break;
805
  }
806
  }
810
  * Last Modified : 1.0
811
  * Reasons for change : None
812
  */
813
+ if(!function_exists("contact_bank_contact_form"))
 
 
 
 
 
814
  {
815
+ function contact_bank_contact_form()
816
+ {
817
+ global $wpdb;
818
+ return $wpdb->prefix . "cb_contact_form";
819
+ }
820
  }
821
+ if(!function_exists("contact_bank_dynamic_settings_form"))
822
  {
823
+ function contact_bank_dynamic_settings_form()
824
+ {
825
+ global $wpdb;
826
+ return $wpdb->prefix . "cb_dynamic_settings";
827
+ }
828
  }
829
+ if(!function_exists("create_control_Table"))
830
  {
831
+ function create_control_Table()
832
+ {
833
+ global $wpdb;
834
+ return $wpdb->prefix . "cb_create_control_form";
835
+ }
836
  }
837
+ if(!function_exists("frontend_controls_data_Table"))
838
  {
839
+ function frontend_controls_data_Table()
840
+ {
841
+ global $wpdb;
842
+ return $wpdb->prefix . "cb_frontend_data_table";
843
+ }
844
  }
845
+ if(!function_exists("contact_bank_email_template_admin"))
846
  {
847
+ function contact_bank_email_template_admin()
848
+ {
849
+ global $wpdb;
850
+ return $wpdb->prefix . "cb_email_template_admin";
851
+ }
852
  }
853
+ if(!function_exists("contact_bank_frontend_forms_Table"))
854
  {
855
+ function contact_bank_frontend_forms_Table()
856
+ {
857
+ global $wpdb;
858
+ return $wpdb->prefix . "cb_frontend_forms_table";
859
+ }
860
  }
861
+ if(!function_exists("contact_bank_form_settings_Table"))
862
  {
863
+ function contact_bank_form_settings_Table()
864
+ {
865
+ global $wpdb;
866
+ return $wpdb->prefix . "cb_form_settings_table";
867
+ }
868
  }
869
+ if(!function_exists("contact_bank_layout_settings_Table"))
870
  {
871
+ function contact_bank_layout_settings_Table()
872
+ {
873
+ global $wpdb;
874
+ return $wpdb->prefix . "cb_layout_settings_table";
875
+ }
876
  }
877
+ if(!function_exists("contact_bank_licensing"))
878
  {
879
+ function contact_bank_licensing()
880
+ {
881
+ global $wpdb;
882
+ return $wpdb->prefix . "cb_licensing";
883
+ }
884
  }
885
+ if(!function_exists("contact_bank_roles_capability"))
886
  {
887
+ function contact_bank_roles_capability()
888
+ {
889
+ global $wpdb;
890
+ return $wpdb->prefix . "cb_roles_capability";
891
+ }
 
 
 
 
892
  }
893
+ if(!function_exists("contact_bank_short_code"))
894
  {
895
+ function contact_bank_short_code($atts)
896
+ {
897
+ extract(shortcode_atts(array(
898
+ "form_id" => "",
899
+ "show_title" => "",
900
+ "show_desc" => "",
901
+ ), $atts));
902
+ if(!is_feed())
903
+ {
904
+ return extract_short_code($form_id,$show_title,$show_desc);
905
+ }
906
+ }
907
  }
908
+ if(!function_exists("extract_short_code"))
909
  {
910
+ function extract_short_code($form_id,$show_title,$show_desc)
911
  {
912
+ ob_start();
913
+ require CONTACT_BK_PLUGIN_DIR."/frontend_views/contact_bank_forms.php";
914
+ $contact_bank_output = ob_get_clean();
915
+ wp_reset_query();
916
+ return $contact_bank_output;
917
  }
918
+ }
919
+ if(!function_exists("add_contact_bank_icon"))
920
+ {
921
+ function add_contact_bank_icon($meta = TRUE)
922
  {
923
+ if (!is_user_logged_in() )
 
924
  {
925
+ return;
926
  }
927
  else
928
  {
929
+ global $wp_admin_bar,$wpdb,$current_user;
930
+ if (is_super_admin())
931
+ {
932
+ $cb_role = "administrator";
933
+ }
934
+ else
935
+ {
936
+ $cb_role = $wpdb->prefix . "capabilities";
937
+ $current_user->role = array_keys($current_user->$cb_role);
938
+ $cb_role = $current_user->role[0];
939
+ }
940
 
941
+ switch ($cb_role)
942
+ {
943
+ case "administrator":
944
+ $wp_admin_bar->add_menu( array(
945
+ "id" => "contact_bank_links",
946
+ "title" => "<img src=\"".plugins_url("/assets/images/icon.png",__FILE__)."\" width=\"25\" height=\"25\" style=\"vertical-align:text-top; margin-right:5px;\" />Contact Bank" ,
947
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_dashboard",
948
+ ));
949
+ $wp_admin_bar->add_menu( array(
950
+ "parent" => "contact_bank_links",
951
+ "id" => "dashboard_links",
952
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_dashboard",
953
+ "title" => __( "Dashboard", contact_bank) ) /* set the sub-menu name */
954
+ );
955
+ $wp_admin_bar->add_menu( array(
956
+ "parent" => "contact_bank_links",
957
+ "id" => "plugin_updates_links",
958
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_plugin_update",
959
+ "title" => __( "Plugin Updates", contact_bank)) /* set the sub-menu name */
960
+ );
961
+ $wp_admin_bar->add_menu( array(
962
+ "parent" => "contact_bank_links",
963
+ "id" => "short_code_links",
964
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_short_code",
965
+ "title" => __( "Short-Codes", contact_bank)) /* set the sub-menu name */
966
+ );
967
+ $wp_admin_bar->add_menu( array(
968
+ "parent" => "contact_bank_links",
969
+ "id" => "frontend_data_links",
970
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_frontend_data",
971
+ "title" => __( "Form Entries", contact_bank)) /* set the sub-menu name */
972
+ );
973
+ $wp_admin_bar->add_menu( array(
974
+ "parent" => "contact_bank_links",
975
+ "id" => "email_links",
976
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_email",
977
+ "title" => __( "Email Settings", contact_bank) ) /* set the sub-menu name */
978
+ );
979
+ $wp_admin_bar->add_menu( array(
980
+ "parent" => "contact_bank_links",
981
+ "id" => "form_settings_data_links",
982
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_layout_settings",
983
+ "title" => __( "Global Settings", contact_bank)) /* set the sub-menu name */
984
+ );
985
+ $wp_admin_bar->add_menu( array(
986
+ "parent" => "contact_bank_links",
987
+ "id" => "feature_request_data_links",
988
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_feature_request",
989
+ "title" => __( "Feature Requests", contact_bank)) /* set the sub-menu name */
990
+ );
991
+ $wp_admin_bar->add_menu( array(
992
+ "parent" => "contact_bank_links",
993
+ "id" => "system_status_data_links",
994
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_system_status",
995
+ "title" => __( "System Status", contact_bank)) /* set the sub-menu name */
996
+ );
997
+ $wp_admin_bar->add_menu(array(
998
+ "parent" => "contact_bank_links",
999
+ "id" => "contact_bank_recommended_plugins_links",
1000
+ "href" => site_url() . "/wp-admin/admin.php?page=contact_bank_recommended_plugins",
1001
+ "title" => __("Recommendations", contact_bank))
1002
+ );
1003
+
1004
+ $wp_admin_bar->add_menu(array(
1005
+ "parent" => "contact_bank_links",
1006
+ "id" => "pro_version_links",
1007
+ "href" => site_url() . "/wp-admin/admin.php?page=contact_pro_version",
1008
+ "title" => __("Premium Editions", contact_bank))
1009
+ );
1010
 
1011
+ $wp_admin_bar->add_menu(array(
1012
+ "parent" => "contact_bank_links",
1013
+ "id" => "contact_bank_other_services_links",
1014
+ "href" => site_url() . "/wp-admin/admin.php?page=contact_bank_other_services",
1015
+ "title" => __("Our Other Services", contact_bank))
1016
+ );
1017
+ break;
1018
+
1019
+ case "editor":
1020
+ $wp_admin_bar->add_menu( array(
1021
+ "id" => "contact_bank_links",
1022
+ "title" => "<img src=\"".plugins_url("/assets/images/icon.png",__FILE__)."\" width=\"25\" height=\"25\" style=\"vertical-align:text-top; margin-right:5px;\" />Contact Bank" ,
1023
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_dashboard",
1024
+ ));
1025
+
1026
+ $wp_admin_bar->add_menu( array(
1027
  "parent" => "contact_bank_links",
1028
  "id" => "dashboard_links",
1029
  "href" => site_url() ."/wp-admin/admin.php?page=contact_dashboard",
1030
  "title" => __( "Dashboard", contact_bank) ) /* set the sub-menu name */
1031
+ );
1032
+ $wp_admin_bar->add_menu( array(
1033
  "parent" => "contact_bank_links",
1034
  "id" => "plugin_updates_links",
1035
  "href" => site_url() ."/wp-admin/admin.php?page=contact_plugin_update",
1036
  "title" => __( "Plugin Updates", contact_bank)) /* set the sub-menu name */
1037
+ );
1038
+ $wp_admin_bar->add_menu( array(
1039
  "parent" => "contact_bank_links",
1040
  "id" => "short_code_links",
1041
  "href" => site_url() ."/wp-admin/admin.php?page=contact_short_code",
1042
  "title" => __( "Short-Codes", contact_bank)) /* set the sub-menu name */
1043
+ );
1044
+ $wp_admin_bar->add_menu( array(
1045
  "parent" => "contact_bank_links",
1046
  "id" => "frontend_data_links",
1047
  "href" => site_url() ."/wp-admin/admin.php?page=contact_frontend_data",
1048
  "title" => __( "Form Entries", contact_bank)) /* set the sub-menu name */
1049
+ );
1050
+ $wp_admin_bar->add_menu( array(
1051
  "parent" => "contact_bank_links",
1052
  "id" => "email_links",
1053
  "href" => site_url() ."/wp-admin/admin.php?page=contact_email",
1054
  "title" => __( "Email Settings", contact_bank) ) /* set the sub-menu name */
1055
+ );
1056
+ $wp_admin_bar->add_menu( array(
1057
  "parent" => "contact_bank_links",
1058
  "id" => "form_settings_data_links",
1059
  "href" => site_url() ."/wp-admin/admin.php?page=contact_layout_settings",
1060
  "title" => __( "Global Settings", contact_bank)) /* set the sub-menu name */
1061
+ );
1062
+ $wp_admin_bar->add_menu( array(
1063
  "parent" => "contact_bank_links",
1064
  "id" => "feature_request_data_links",
1065
  "href" => site_url() ."/wp-admin/admin.php?page=contact_feature_request",
1066
  "title" => __( "Feature Requests", contact_bank)) /* set the sub-menu name */
1067
+ );
1068
+
1069
+ $wp_admin_bar->add_menu( array(
1070
  "parent" => "contact_bank_links",
1071
  "id" => "system_status_data_links",
1072
  "href" => site_url() ."/wp-admin/admin.php?page=contact_system_status",
1073
  "title" => __( "System Status", contact_bank)) /* set the sub-menu name */
1074
+ );
1075
+ $wp_admin_bar->add_menu(array(
1076
  "parent" => "contact_bank_links",
1077
  "id" => "contact_bank_recommended_plugins_links",
1078
  "href" => site_url() . "/wp-admin/admin.php?page=contact_bank_recommended_plugins",
1079
  "title" => __("Recommendations", contact_bank))
1080
+ );
1081
 
1082
+ $wp_admin_bar->add_menu(array(
1083
  "parent" => "contact_bank_links",
1084
  "id" => "pro_version_links",
1085
  "href" => site_url() . "/wp-admin/admin.php?page=contact_pro_version",
1086
  "title" => __("Premium Editions", contact_bank))
1087
+ );
1088
 
1089
+ $wp_admin_bar->add_menu(array(
1090
  "parent" => "contact_bank_links",
1091
  "id" => "contact_bank_other_services_links",
1092
  "href" => site_url() . "/wp-admin/admin.php?page=contact_bank_other_services",
1093
  "title" => __("Our Other Services", contact_bank))
1094
+ );
1095
+ break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1096
 
1097
+ case "author":
1098
+ $wp_admin_bar->add_menu( array(
1099
+ "id" => "contact_bank_links",
1100
+ "title" => "<img src=\"".plugins_url("/assets/images/icon.png",__FILE__)."\" width=\"25\" height=\"25\" style=\"vertical-align:text-top; margin-right:5px;\" />Contact Bank" ,
1101
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_dashboard",
1102
+ ));
1103
+ $wp_admin_bar->add_menu( array(
1104
+ "parent" => "contact_bank_links",
1105
+ "id" => "dashboard_links",
1106
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_dashboard",
1107
+ "title" => __( "Dashboard", contact_bank) ) /* set the sub-menu name */
1108
+ );
1109
+ $wp_admin_bar->add_menu( array(
1110
+ "parent" => "contact_bank_links",
1111
+ "id" => "plugin_updates_links",
1112
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_plugin_update",
1113
+ "title" => __( "Plugin Updates", contact_bank)) /* set the sub-menu name */
1114
+ );
1115
+ $wp_admin_bar->add_menu( array(
1116
+ "parent" => "contact_bank_links",
1117
+ "id" => "short_code_links",
1118
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_short_code",
1119
+ "title" => __( "Short-Codes", contact_bank)) /* set the sub-menu name */
1120
+ );
1121
+ $wp_admin_bar->add_menu( array(
1122
+ "parent" => "contact_bank_links",
1123
+ "id" => "frontend_data_links",
1124
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_frontend_data",
1125
+ "title" => __( "Form Entries", contact_bank)) /* set the sub-menu name */
1126
+ );
1127
+ $wp_admin_bar->add_menu( array(
1128
+ "parent" => "contact_bank_links",
1129
+ "id" => "email_links",
1130
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_email",
1131
+ "title" => __( "Email Settings", contact_bank) ) /* set the sub-menu name */
1132
+ );
1133
+ $wp_admin_bar->add_menu( array(
1134
+ "parent" => "contact_bank_links",
1135
+ "id" => "form_settings_data_links",
1136
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_layout_settings",
1137
+ "title" => __( "Global Settings", contact_bank)) /* set the sub-menu name */
1138
+ );
1139
+ $wp_admin_bar->add_menu( array(
1140
+ "parent" => "contact_bank_links",
1141
+ "id" => "feature_request_data_links",
1142
+ "href" => site_url() ."/wp-admin/admin.php?page=contact_feature_request",
1143
+ "title" => __( "Feature Requests", contact_bank)) /* set the sub-menu name */
1144
+ );
1145
+ $wp_admin_bar->add_menu(array(
1146
+ "parent" => "contact_bank_links",
1147
+ "id" => "contact_bank_recommended_plugins_links",
1148
+ "href" => site_url() . "/wp-admin/admin.php?page=contact_bank_recommended_plugins",
1149
+ "title" => __("Recommendations", contact_bank))
1150
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1151
 
1152
+ $wp_admin_bar->add_menu(array(
1153
+ "parent" => "contact_bank_links",
1154
+ "id" => "pro_version_links",
1155
+ "href" => site_url() . "/wp-admin/admin.php?page=contact_pro_version",
1156
+ "title" => __("Premium Editions", contact_bank))
1157
+ );
1158
 
1159
+ $wp_admin_bar->add_menu(array(
1160
+ "parent" => "contact_bank_links",
1161
+ "id" => "contact_bank_other_services_links",
1162
+ "href" => site_url() . "/wp-admin/admin.php?page=contact_bank_other_services",
1163
+ "title" => __("Our Other Services", contact_bank))
1164
+ );
1165
+ break;
1166
+ }
1167
  }
1168
  }
1169
  }
1170
  add_action( "media_buttons_context", "add_contact_shortcode_button", 1);
1171
+ if(!function_exists("add_contact_shortcode_button"))
1172
  {
1173
+ function add_contact_shortcode_button($context)
1174
+ {
1175
+ add_thickbox();
1176
+ $context .= "<a href=\"#TB_inline?width=300&height=400&inlineId=contact-bank\" class=\"button thickbox\" title=\"" . __("Add Contact Bank Form", contact_bank) . "\">
1177
+ <span class=\"contact_icon\"></span> Add Contact Bank Form</a>";
1178
+ return $context;
1179
+ }
1180
  }
1181
  add_action("admin_footer","add_contact_mce_popup");
1182
 
1183
+ if(!function_exists("add_contact_mce_popup"))
1184
+ {
1185
+ function add_contact_mce_popup()
1186
+ {
1187
+ ?>
1188
+ <?php add_thickbox(); ?>
1189
+ <div id="contact-bank" style="display:none;">
1190
+ <div class="fluid-layout responsive">
1191
+ <div style="padding:20px 0 10px 15px;">
1192
+ <h3 class="label-shortcode"><?php _e("Insert Contact Bank Form", contact_bank); ?></h3>
1193
  <span>
1194
  <i><?php _e("Select a form below to add it to your post or page.", contact_bank); ?></i>
1195
  </span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1196
  </div>
1197
+ <div class="layout-span12 responsive" style="padding:15px 15px 0 0;">
1198
+ <div class="layout-control-group">
1199
+ <label class="custom-layout-label" for="ux_form_name"><?php _e("Form Name", contact_bank); ?> : </label>
1200
+ <select id="add_contact_form_id" class="layout-span9">
1201
+ <option value="0"><?php _e("Select a Form", contact_bank); ?> </option>
1202
+ <?php
1203
+ global $wpdb;
1204
+ $forms = $wpdb->get_results
1205
+ (
1206
+ "SELECT * FROM " .contact_bank_contact_form()
1207
+ );
1208
+ for($flag = 0;$flag<count($forms);$flag++)
1209
+ {
1210
+ ?>
1211
+ <option value="<?php echo intval($forms[$flag]->form_id); ?>"><?php echo esc_html($forms[$flag]->form_name) ?></option>
1212
+ <?php
1213
+ }
1214
+ ?>
1215
+ </select>
1216
+ </div>
1217
+ <div class="layout-control-group">
1218
+ <label class="custom-layout-label"><?php _e("Show Form Title", contact_bank); ?> : </label>
1219
+ <input type="checkbox" checked="checked" name="ux_form_title" id="ux_form_title"/>
1220
+ </div>
1221
+ <div class="layout-control-group">
1222
+ <label class="custom-layout-label"><?php _e("Show Form Description", contact_bank); ?> : </label>
1223
+ <input type="checkbox" name="ux_form_desc" id="ux_form_desc"/>
1224
+ </div>
1225
+ <div class="layout-control-group">
1226
+ <label class="custom-layout-label"></label>
1227
+ <input type="button" class="button-primary" value="<?php _e("Insert Form", contact_bank); ?>"
1228
+ onclick="Insert_Contact_Form();"/>&nbsp;&nbsp;&nbsp;
1229
+ <a class="button" style="color:#bbb;" href="#"
1230
+ onclick="tb_remove(); return false;"><?php _e("Cancel", contact_bank); ?></a>
1231
+ </div>
1232
  </div>
1233
  </div>
1234
  </div>
1235
+ <script type="text/javascript">
1236
+ function Insert_Contact_Form()
 
 
 
 
 
 
1237
  {
1238
+ var form_id = jQuery("#add_contact_form_id").val();
1239
+ var show_title = jQuery("#ux_form_title").prop("checked");
1240
+ var show_desc = jQuery("#ux_form_desc").prop("checked");
1241
+ if(form_id == 0)
1242
+ {
1243
+ alert("<?php _e("Please choose a Form to insert into Shortcode", contact_bank) ?>");
1244
+ return;
1245
+ }
1246
+ window.send_to_editor("[contact_bank form_id=" + form_id + " show_title=" + show_title +" show_desc=" + show_desc +"]");
1247
  }
1248
+ </script>
1249
+ <?php
1250
+ }
 
1251
  }
1252
+ if(!function_exists("plugin_load_textdomain_contact_bank"))
1253
  {
1254
+ function plugin_load_textdomain_contact_bank()
1255
+ {
1256
+ if(function_exists( "load_plugin_textdomain" ))
1257
+ {
1258
+ load_plugin_textdomain(contact_bank, false, CONTACT_BK_PLUGIN_DIRNAME ."/languages");
1259
+ }
1260
+ }
1261
  }
1262
  add_action("plugins_loaded", "plugin_load_textdomain_contact_bank");
1263
 
1264
+ if(!function_exists("plugin_load_textdomain_contact_bank_services"))
1265
  {
1266
+ function plugin_load_textdomain_contact_bank_services()
1267
  {
1268
+ if(function_exists( "load_plugin_textdomain" ))
1269
+ {
1270
+ load_plugin_textdomain(tech_bank, false, CONTACT_BK_PLUGIN_DIRNAME ."/tech-banker-services");
1271
+ }
1272
  }
1273
  }
1274
  add_action("plugins_loaded", "plugin_load_textdomain_contact_bank_services");
1280
  add_action("admin_init", "plugin_install_script_for_contact_bank");
1281
  }
1282
  }
1283
+ if(!function_exists("contact_bank_plugin_row"))
1284
  {
1285
+ function contact_bank_plugin_row($links,$file)
1286
  {
1287
+ if ($file == CONTACT_BK_PLUGIN_BASENAME)
1288
+ {
1289
+ $cpo_row_meta = array(
1290
+ "docs" => "<a href='".esc_url( apply_filters("contact_bank_docs_url","http://tech-banker.com/products/wp-contact-bank/knowledge-base/"))."' title='".esc_attr(__( "View Contact Bank Documentation",contact_bank))."'>".__("Docs",contact_bank)."</a>",
1291
+ "gopremium" => "<a href='" .esc_url( apply_filters("contact_bank_premium_editions_url", "http://tech-banker.com/products/wp-contact-bank/pricing/"))."' title='".esc_attr(__( "View Contact Bank Premium Editions",contact_bank))."'>".__("Go for Premium!",contact_bank)."</a>",
1292
+ );
1293
+ return array_merge($links,$cpo_row_meta);
1294
+ }
1295
+ return (array)$links;
1296
  }
 
1297
  }
 
 
 
1298
 
1299
+ function request_is_frontend_ajax()
 
1300
  {
1301
+ $script_filename = isset($_SERVER['SCRIPT_FILENAME']) ? $_SERVER['SCRIPT_FILENAME'] : '';
1302
+ //Try to figure out if frontend AJAX request... If we are DOING_AJAX; let's look closer
1303
+ if((defined('DOING_AJAX') && DOING_AJAX))
1304
+ {
1305
+ //From wp-includes/functions.php, wp_get_referer() function.
1306
+ //Required to fix: https://core.trac.wordpress.org/ticket/25294
1307
+ $ref = '';
1308
+ if ( ! empty( $_REQUEST['_wp_http_referer'] ) )
1309
+ $ref = wp_unslash( $_REQUEST['_wp_http_referer'] );
1310
+ elseif ( ! empty( $_SERVER['HTTP_REFERER'] ) )
1311
+ $ref = wp_unslash( $_SERVER['HTTP_REFERER'] );
1312
+ //If referer does not contain admin URL and we are using the admin-ajax.php endpoint, this is likely a frontend AJAX request
1313
+ if(((strpos($ref, admin_url()) === false) && (basename($script_filename) === 'admin-ajax.php')))
1314
+ return true;
1315
+ }
1316
+ //If no checks triggered, we end up here - not an AJAX request.
1317
+ return false;
1318
  }
1319
 
 
 
 
1320
  //--------------------------------------------------------------------------------------------------------------//
1321
  // CODE FOR PLUGIN UPDATE MESSAGE
1322
  //--------------------------------------------------------------------------------------------------------------//
1323
+ if(!function_exists("contact_bank_plugin_update_message"))
1324
  {
1325
+ function contact_bank_plugin_update_message($args)
 
1326
  {
1327
+ $response = wp_remote_get( 'http://plugins.svn.wordpress.org/contact-bank/trunk/readme.txt' );
1328
+ if ( ! is_wp_error( $response ) && ! empty( $response['body'] ) )
1329
+ {
1330
+ // Output Upgrade Notice
1331
+ $matches = null;
1332
+ $regexp = '~==\s*Changelog\s*==\s*=\s*[0-9.]+\s*=(.*)(=\s*' . preg_quote($args['Version']) . '\s*=|$)~Uis';
1333
+ $upgrade_notice = '';
1334
+ if ( preg_match( $regexp, $response['body'], $matches ) ) {
1335
+ $changelog = (array) preg_split('~[\r\n]+~', trim($matches[1]));
1336
+ $upgrade_notice .= '<div class="framework_plugin_message">';
1337
+ foreach ( $changelog as $index => $line ) {
1338
+ $upgrade_notice .= "<p>".$line."</p>";
1339
+ }
1340
+ $upgrade_notice .= '</div> ';
1341
+ echo $upgrade_notice;
1342
  }
 
 
1343
  }
1344
  }
1345
  }
1368
  // in_plugin_update_message Hook called for function to check updates
1369
  add_action("in_plugin_update_message-".CONTACT_BK,"contact_bank_plugin_update_message" );
1370
 
 
1371
  add_filter("widget_text", "do_shortcode");
1372
+ if(!class_exists("Contact_Bank_Widget"))
1373
  {
1374
+ class Contact_Bank_Widget extends WP_Widget
 
 
 
 
 
1375
  {
1376
+ function Contact_Bank_Widget()
1377
+ {
1378
+ $widget_ops = array("classname" => "Contact_Bank_Widget", "description" => "Uses Contact Form" );
1379
+ $this->__construct("Contact_Bank_Widget", "Contact Bank", $widget_ops);
1380
+ }
1381
+ function form($instance)
1382
+ {
1383
+ $instance = wp_parse_args((array) $instance, array( "title" => "", "form_id" => "0" ) );
1384
+ $title = $instance["title"];
1385
+ global $wpdb;
1386
+ $form_data = $wpdb->get_results
1387
+ (
1388
+ "SELECT * FROM " .contact_bank_contact_form()
1389
+ );
1390
+ ?>
1391
+ <p><label for="<?php echo $this->get_field_id("title"); ?>"> Widget Title: <input class="widefat" id="<?php echo $this->get_field_id("title"); ?>" name="<?php echo $this->get_field_name("title"); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></label></p>
1392
+ <p><label for="<?php echo $this->get_field_id("form_id"); ?>"><?php _e("Select Form :", contact_bank); ?></label>
1393
+ <select size="1" name="<?php echo $this->get_field_name("form_id"); ?>" id="<?php echo $this->get_field_id("form_id"); ?>" class="widefat">
1394
+ <option value="0" ><?php _e("Select Form", contact_bank); ?></option>
1395
+ <?php
1396
+ if($form_data)
1397
+ {
1398
+ foreach($form_data as $form)
1399
+ {
1400
+ echo "<option value=\"" . $form->form_id . "\"";
1401
+ if ($form->form_id == $instance["form_id"])
1402
+ echo "selected=\"selected\"";
1403
+ echo ">" . stripslashes(html_entity_decode($form->form_name)) . "</option>" . "\n\t";
1404
+ }
1405
+ }
1406
+ ?>
1407
+ </select>
1408
+ </p>
1409
+ <?php
1410
+ }
1411
+ function update($new_instance, $old_instance)
1412
+ {
1413
+ $instance = $old_instance;
1414
+ $instance["title"] = $new_instance["title"];
1415
+ $instance["form_id"] = (int) $new_instance["form_id"];
1416
+ return $instance;
1417
+ }
1418
+ function widget($args, $instance)
1419
+ {
1420
+ global $wpdb;
1421
+ $form_data = $wpdb->get_var
1422
+ (
1423
+ $wpdb->prepare
1424
+ (
1425
+ "SELECT count(*) FROM " .contact_bank_contact_form() . " WHERE form_id = %d",
1426
+ $instance["form_id"]
1427
+ )
1428
+ );
1429
 
1430
+ extract($args, EXTR_SKIP);
1431
+ echo $before_widget;
1432
+ $title = empty($instance["title"]) ? " " : apply_filters("widget_title", $instance["title"]);
1433
+ if($form_data > 0)
1434
+ {
1435
+ if($instance["form_id"] != 0)
1436
+ {
1437
+ echo $before_title . $title . $after_title;
1438
+ $shortcode_for_contact_bank_form = "[contact_bank form_id=" . $instance["form_id"] . " ]";
1439
+ echo do_shortcode( $shortcode_for_contact_bank_form );
1440
+ echo $after_widget;
1441
+ }
1442
+ }
1443
+ }
1444
+ }
1445
  }
1446
 
1447
  add_action( "widgets_init", create_function("", "return register_widget(\"Contact_Bank_Widget\");"));
1459
  {
1460
  wp_clear_scheduled_hook("contact_bank_auto_update");
1461
  }
1462
+ if(!function_exists("contact_plugin_autoUpdate"))
1463
  {
1464
+ function contact_plugin_autoUpdate()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1465
  {
1466
+ try
1467
+ {
1468
+ require_once(ABSPATH . "wp-admin/includes/class-wp-upgrader.php");
1469
+ require_once(ABSPATH . "wp-admin/includes/misc.php");
1470
+ define("FS_METHOD", "direct");
1471
+ require_once(ABSPATH . "wp-includes/update.php");
1472
+ require_once(ABSPATH . "wp-admin/includes/file.php");
1473
+ wp_update_plugins();
1474
+ ob_start();
1475
+ $plugin_upgrader = new Plugin_Upgrader();
1476
+ $plugin_upgrader->upgrade("contact-bank/contact-bank.php");
1477
+ $output = @ob_get_contents();
1478
+ @ob_end_clean();
1479
+ }
1480
+ catch(Exception $e)
1481
+ {
1482
+ }
1483
  }
1484
  }
1485
  ?>
frontend_views/contact_bank_forms.php CHANGED
@@ -116,7 +116,7 @@ $rand_value = RAND(10,10000);
116
  text-align: right !important;
117
  <?php
118
  }
119
- else
120
  {
121
  ?>
122
  text-align: <?php echo $layout_settings_array[$form_id]["label_setting_font_align_left"] == "0" ? "left" : "right"; ?> !important;
@@ -129,7 +129,7 @@ $rand_value = RAND(10,10000);
129
  }
130
  .input_control
131
  {
132
-
133
  font-family: <?php echo $layout_settings_array[$form_id]["input_field_font_family"]; ?> !important;
134
  color: <?php echo $layout_settings_array[$form_id]["input_field_font_color"]; ?> !important;
135
  <?php
@@ -168,7 +168,7 @@ $rand_value = RAND(10,10000);
168
  margin-left: 0px !important;
169
  <?php
170
  }
171
-
172
  ?>
173
  }
174
  .field_description
@@ -192,7 +192,7 @@ $rand_value = RAND(10,10000);
192
  }
193
  ?>
194
  font-size: <?php echo $layout_settings_array[$form_id]["label_setting_field_size"] . "px"; ?> !important;
195
- text-align: <?php echo $layout_settings_array[$form_id]["label_setting_field_align"]; ?> !important;
196
  }
197
  .btn_submit
198
  {
@@ -228,7 +228,7 @@ $rand_value = RAND(10,10000);
228
  }
229
  .success_message
230
  {
231
-
232
  background-color: <?php echo $layout_settings_array[$form_id]["success_msg_bg_color"]; ?> !important;
233
  border: <?php echo "2px Solid ".$layout_settings_array[$form_id]["success_msg_border_color"]; ?> !important;
234
  color: <?php echo $layout_settings_array[$form_id]["success_msg_text_color"]; ?> !important;
@@ -279,7 +279,7 @@ $rand_value = RAND(10,10000);
279
  {
280
  ?>
281
  <h4><?php _e($form_name, contact_bank ); ?></h4>
282
- <?php
283
  }
284
  if($show_desc == "true")
285
  {
@@ -291,7 +291,7 @@ $rand_value = RAND(10,10000);
291
  }
292
  ?>
293
  </div>
294
- <?php
295
  for($flag=0;$flag<count($form_fields);$flag++)
296
  {
297
  ?>
@@ -313,7 +313,7 @@ $rand_value = RAND(10,10000);
313
  case 1:
314
  ?>
315
  <div class="layout-controls layout_according_label_position">
316
- <input class="hovertip input_control" type="text" id="ux_txt_control_<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>" name="ux_txt_control_<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>" data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>" placeholder="<?php _e($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_default_txt_val"], contact_bank );?>" data-alpha="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_alpha_filter"];?>" data-alpha_num="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_ux_checkbox_alpha_num_filter"];?>" data-digit="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_digit_filter"];?>" data-strip="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_strip_tag_filter"];?>" data-trim="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_trim_filter"];?>" onfocus="prevent_paste(this.id);" />
317
  <span class="field_description" id="txt_description_"><?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_description"]; ?></span>
318
  </div>
319
  <?php
@@ -321,7 +321,7 @@ $rand_value = RAND(10,10000);
321
  case 2:
322
  ?>
323
  <div class="layout-controls layout_according_label_position">
324
- <textarea class="hovertip input_control" id="ux_textarea_control_<?php echo $form_fields[$flag]->column_dynamicId."_". $rand_value; ?>" placeholder="<?php _e($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_default_txt_val"], contact_bank );?>" name="ux_textarea_control_<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>" onfocus="prevent_paste(this.id);" data-alpha="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_alpha_filter"];?>" data-alpha_num="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_ux_checkbox_alpha_num_filter"];?>" data-digit="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_digit_filter"];?>" data-strip="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_strip_tag_filter"];?>" data-trim="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_trim_filter"];?>" data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>"></textarea>
325
  <span class="field_description" id="txt_description_"><?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_description"]; ?></span>
326
  </div>
327
  <?php
@@ -329,7 +329,7 @@ $rand_value = RAND(10,10000);
329
  case 3:
330
  ?>
331
  <div class="layout-controls layout_according_label_position">
332
- <input class="hovertip input_control" type="text" id="ux_txt_email_<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>" name="ux_txt_email_<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>" data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>" placeholder="<?php _e($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_default_txt_val"], contact_bank );?>"onfocus="prevent_paste(this.id);"/>
333
  <span class="field_description" id="txt_description_"><?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_description"]; ?></span>
334
  </div>
335
  <?php
@@ -345,7 +345,7 @@ $rand_value = RAND(10,10000);
345
  foreach($ddl_ids as $key => $value )
346
  {
347
  ?>
348
- <option value="<?php echo $ddl_values[$key]; ?>"><?php echo $ddl_values[$key]; ?></option>
349
  <?php
350
  }
351
  ?>
@@ -364,7 +364,7 @@ $rand_value = RAND(10,10000);
364
  foreach($chk_ids as $key => $value )
365
  {
366
  ?>
367
- <input type="checkbox" id="ux_chk_control_<?php echo $value ."_". $rand_value; ?>" name="<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>_chk[]" value ="<?php echo $chk_values[$key]; ?>" />
368
  <label style="margin:0px;vertical-align: middle;" id="chk_id_<?php echo $value; ?>">
369
  <?php echo $chk_values[$key]; ?>
370
  </label>
@@ -374,7 +374,7 @@ $rand_value = RAND(10,10000);
374
  </div>
375
  <?php
376
  }
377
- else
378
  {
379
  ?>
380
  <div class="layout-controls layout_according_label_position hovertip" data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>">
@@ -398,7 +398,7 @@ $rand_value = RAND(10,10000);
398
  if($layout_settings_array[$form_id]["input_field_rdl_multiple_row"] == "0")
399
  {
400
  ?>
401
- <input type="radio" checked="checked" class="hovertip" id="ux_rdl_control_<?php echo $value ."_". $rand_value; ?>" name="<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>_rdl" value ="<?php echo $rdl_values[$key]; ?>" />
402
  <label style="margin:0px;vertical-align: sub;" id="rdl_id_<?php echo $value; ?>">
403
  <?php echo $rdl_values[$key]; ?>
404
  </label>
@@ -408,7 +408,7 @@ $rand_value = RAND(10,10000);
408
  else
409
  {
410
  ?>
411
- <input type="radio" checked="checked" class="hovertip" id="ux_rdl_control_<?php echo $value ."_". $rand_value; ?>" name="<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>_rdl" value ="<?php echo $rdl_values[$key]; ?>" />
412
  <label style="margin:0px;vertical-align: sub;" id="rdl_id_<?php echo $value; ?>">
413
  <?php echo $rdl_values[$key]; ?>
414
  </label>
@@ -420,7 +420,7 @@ $rand_value = RAND(10,10000);
420
  if($layout_settings_array[$form_id]["input_field_rdl_multiple_row"] == "0")
421
  {
422
  ?>
423
- <input type="radio" class="hovertip" id="ux_rdl_control_<?php echo $value ."_". $rand_value; ?>" name="<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>_rdl" value ="<?php echo $rdl_values[$key]; ?>" />
424
  <label style="margin:0px;vertical-align: sub;" id="rdl_id_<?php echo $value; ?>">
425
  <?php echo $rdl_values[$key]; ?>
426
  </label>
@@ -430,7 +430,7 @@ $rand_value = RAND(10,10000);
430
  else
431
  {
432
  ?>
433
- <input type="radio" class="hovertip" id="ux_rdl_control_<?php echo $value ."_". $rand_value; ?>" name="<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>_rdl" value ="<?php echo $rdl_values[$key]; ?>" />
434
  <label style="margin:0px;vertical-align: sub;" id="rdl_id_<?php echo $value; ?>">
435
  <?php echo $rdl_values[$key]; ?>
436
  </label>
@@ -442,7 +442,7 @@ $rand_value = RAND(10,10000);
442
  </div>
443
  <?php
444
  }
445
- else
446
  {
447
  ?>
448
  <div class="layout-controls layout_according_label_position hovertip" data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>">
@@ -468,16 +468,40 @@ jQuery.extend(jQuery.validator.messages, {
468
  required: "<?php echo $form_settings_array[$form_id]["blank_field_message"];?>",
469
  email: "<?php echo $form_settings_array[$form_id]["incorrect_email_message"];?>"
470
  });
471
- function prevent_paste(control_id)
472
  {
473
- jQuery("#"+control_id).live("paste",function(e)
474
  {
475
- e.preventDefault();
476
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
477
  }
478
  jQuery("#ux_frm_front_end_form_<?php echo $form_id ."_". $rand_value; ?>").validate
479
  ({
480
- rules:
481
  {
482
  <?php
483
  $dynamic = "";
@@ -485,7 +509,7 @@ jQuery("#ux_frm_front_end_form_<?php echo $form_id ."_". $rand_value; ?>").valid
485
  {
486
  if($control_settings_array[$form_fields[$flag4]->column_dynamicId]["cb_control_required"] == 1)
487
  {
488
- switch($form_fields[$flag4]-> field_id)
489
  {
490
  case 1:
491
  $dynamic .= "ux_txt_control_".$form_fields[$flag4]->column_dynamicId ."_". $rand_value. ":{ required :true }";
@@ -505,14 +529,14 @@ jQuery("#ux_frm_front_end_form_<?php echo $form_id ."_". $rand_value; ?>").valid
505
  case 6:
506
  $dynamic .= "'".$form_fields[$flag4]->column_dynamicId ."_". $rand_value. "_rdl'". ":{ required :true }";
507
  break;
508
-
509
  }
510
  if( count($form_fields)> 1 && $flag4 < count($form_fields) - 1 )
511
  {
512
  $dynamic .= ",";
513
  }
514
  }
515
-
516
  }
517
  echo $dynamic;
518
  ?>
@@ -520,7 +544,7 @@ jQuery("#ux_frm_front_end_form_<?php echo $form_id ."_". $rand_value; ?>").valid
520
  errorPlacement: function(error, element)
521
  {
522
  <?php
523
-
524
  if($layout_settings_array[$form_id]["label_setting_label_position"] == "top")
525
  {
526
  ?>
@@ -538,7 +562,7 @@ jQuery("#ux_frm_front_end_form_<?php echo $form_id ."_". $rand_value; ?>").valid
538
  else
539
  {
540
  ?>
541
- if (element.attr("type") === "radio" || element.attr("type") === "checkbox")
542
  {
543
  error.insertAfter(element.parent().children("label:last-child"));
544
  }
@@ -557,14 +581,23 @@ jQuery("#ux_frm_front_end_form_<?php echo $form_id ."_". $rand_value; ?>").valid
557
  },
558
  submitHandler: function(form)
559
  {
 
560
  jQuery("body,html").animate({
561
  scrollTop: jQuery("body,html").position().top}, "slow");
 
562
  var form_id = "<?php echo $form_id ;?>";
563
- jQuery.post(ajaxurl, jQuery(form).serialize() +"&form_id="+form_id+"&rand="+<?php echo $rand_value;?>+"&param=frontend_submit_controls&action=frontend_contact_form_library", function(data)
 
 
 
 
 
 
 
 
564
  {
565
- jQuery("#form_success_message_frontend_<?php echo $rand_value;?>").css("display","block");
566
  var submit_id = data;
567
- jQuery.post(ajaxurl, "form_id="+form_id+"&submit_id="+submit_id+"&param=email_management&action=email_management_contact_form_library", function(data)
568
  {
569
  setTimeout(function()
570
  {
@@ -575,4 +608,4 @@ jQuery("#ux_frm_front_end_form_<?php echo $form_id ."_". $rand_value; ?>").valid
575
  });
576
  }
577
  });
578
- </script>
116
  text-align: right !important;
117
  <?php
118
  }
119
+ else
120
  {
121
  ?>
122
  text-align: <?php echo $layout_settings_array[$form_id]["label_setting_font_align_left"] == "0" ? "left" : "right"; ?> !important;
129
  }
130
  .input_control
131
  {
132
+
133
  font-family: <?php echo $layout_settings_array[$form_id]["input_field_font_family"]; ?> !important;
134
  color: <?php echo $layout_settings_array[$form_id]["input_field_font_color"]; ?> !important;
135
  <?php
168
  margin-left: 0px !important;
169
  <?php
170
  }
171
+
172
  ?>
173
  }
174
  .field_description
192
  }
193
  ?>
194
  font-size: <?php echo $layout_settings_array[$form_id]["label_setting_field_size"] . "px"; ?> !important;
195
+ text-align: <?php echo $layout_settings_array[$form_id]["label_setting_field_align"]; ?> !important;
196
  }
197
  .btn_submit
198
  {
228
  }
229
  .success_message
230
  {
231
+
232
  background-color: <?php echo $layout_settings_array[$form_id]["success_msg_bg_color"]; ?> !important;
233
  border: <?php echo "2px Solid ".$layout_settings_array[$form_id]["success_msg_border_color"]; ?> !important;
234
  color: <?php echo $layout_settings_array[$form_id]["success_msg_text_color"]; ?> !important;
279
  {
280
  ?>
281
  <h4><?php _e($form_name, contact_bank ); ?></h4>
282
+ <?php
283
  }
284
  if($show_desc == "true")
285
  {
291
  }
292
  ?>
293
  </div>
294
+ <?php
295
  for($flag=0;$flag<count($form_fields);$flag++)
296
  {
297
  ?>
313
  case 1:
314
  ?>
315
  <div class="layout-controls layout_according_label_position">
316
+ <input class="hovertip input_control" type="text" id="ux_txt_control_<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>" name="ux_txt_control_<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>" data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>" placeholder="<?php _e($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_default_txt_val"], contact_bank );?>" data-alpha="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_alpha_filter"];?>" data-alpha_num="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_ux_checkbox_alpha_num_filter"];?>" data-digit="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_digit_filter"];?>" data-strip="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_strip_tag_filter"];?>" data-trim="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_trim_filter"];?>" />
317
  <span class="field_description" id="txt_description_"><?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_description"]; ?></span>
318
  </div>
319
  <?php
321
  case 2:
322
  ?>
323
  <div class="layout-controls layout_according_label_position">
324
+ <textarea class="hovertip input_control" id="ux_textarea_control_<?php echo $form_fields[$flag]->column_dynamicId."_". $rand_value; ?>" placeholder="<?php _e($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_default_txt_val"], contact_bank );?>" name="ux_textarea_control_<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>" data-alpha="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_alpha_filter"];?>" data-alpha_num="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_ux_checkbox_alpha_num_filter"];?>" data-digit="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_digit_filter"];?>" data-strip="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_strip_tag_filter"];?>" data-trim="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_trim_filter"];?>" data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>"></textarea>
325
  <span class="field_description" id="txt_description_"><?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_description"]; ?></span>
326
  </div>
327
  <?php
329
  case 3:
330
  ?>
331
  <div class="layout-controls layout_according_label_position">
332
+ <input class="hovertip input_control" type="text" id="ux_txt_email_<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>" name="ux_txt_email_<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>" data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>" placeholder="<?php _e($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_default_txt_val"], contact_bank );?>"/>
333
  <span class="field_description" id="txt_description_"><?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_description"]; ?></span>
334
  </div>
335
  <?php
345
  foreach($ddl_ids as $key => $value )
346
  {
347
  ?>
348
+ <option value="<?php echo esc_html($ddl_values[$key]); ?>"><?php echo $ddl_values[$key]; ?></option>
349
  <?php
350
  }
351
  ?>
364
  foreach($chk_ids as $key => $value )
365
  {
366
  ?>
367
+ <input type="checkbox" id="ux_chk_control_<?php echo $value ."_". $rand_value; ?>" name="<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>_chk[]" value ="<?php echo esc_html($chk_values[$key]); ?>" />
368
  <label style="margin:0px;vertical-align: middle;" id="chk_id_<?php echo $value; ?>">
369
  <?php echo $chk_values[$key]; ?>
370
  </label>
374
  </div>
375
  <?php
376
  }
377
+ else
378
  {
379
  ?>
380
  <div class="layout-controls layout_according_label_position hovertip" data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>">
398
  if($layout_settings_array[$form_id]["input_field_rdl_multiple_row"] == "0")
399
  {
400
  ?>
401
+ <input type="radio" checked="checked" class="hovertip" id="ux_rdl_control_<?php echo $value ."_". $rand_value; ?>" name="<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>_rdl" value ="<?php echo esc_html($rdl_values[$key]); ?>" />
402
  <label style="margin:0px;vertical-align: sub;" id="rdl_id_<?php echo $value; ?>">
403
  <?php echo $rdl_values[$key]; ?>
404
  </label>
408
  else
409
  {
410
  ?>
411
+ <input type="radio" checked="checked" class="hovertip" id="ux_rdl_control_<?php echo $value ."_". $rand_value; ?>" name="<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>_rdl" value ="<?php echo esc_html($rdl_values[$key]); ?>" />
412
  <label style="margin:0px;vertical-align: sub;" id="rdl_id_<?php echo $value; ?>">
413
  <?php echo $rdl_values[$key]; ?>
414
  </label>
420
  if($layout_settings_array[$form_id]["input_field_rdl_multiple_row"] == "0")
421
  {
422
  ?>
423
+ <input type="radio" class="hovertip" id="ux_rdl_control_<?php echo $value ."_". $rand_value; ?>" name="<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>_rdl" value ="<?php echo esc_html($rdl_values[$key]); ?>" />
424
  <label style="margin:0px;vertical-align: sub;" id="rdl_id_<?php echo $value; ?>">
425
  <?php echo $rdl_values[$key]; ?>
426
  </label>
430
  else
431
  {
432
  ?>
433
+ <input type="radio" class="hovertip" id="ux_rdl_control_<?php echo $value ."_". $rand_value; ?>" name="<?php echo $form_fields[$flag]->column_dynamicId ."_". $rand_value; ?>_rdl" value ="<?php echo esc_html($rdl_values[$key]); ?>" />
434
  <label style="margin:0px;vertical-align: sub;" id="rdl_id_<?php echo $value; ?>">
435
  <?php echo $rdl_values[$key]; ?>
436
  </label>
442
  </div>
443
  <?php
444
  }
445
+ else
446
  {
447
  ?>
448
  <div class="layout-controls layout_according_label_position hovertip" data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>">
468
  required: "<?php echo $form_settings_array[$form_id]["blank_field_message"];?>",
469
  email: "<?php echo $form_settings_array[$form_id]["incorrect_email_message"];?>"
470
  });
471
+ if (typeof(base64_encode) != "function")
472
  {
473
+ function base64_encode(data)
474
  {
475
+ var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
476
+ var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
477
+ ac = 0,
478
+ enc = '',
479
+ tmp_arr = [];
480
+ if (!data)
481
+ {
482
+ return data;
483
+ }
484
+ do
485
+ {
486
+ o1 = data.charCodeAt(i++);
487
+ o2 = data.charCodeAt(i++);
488
+ o3 = data.charCodeAt(i++);
489
+ bits = o1 << 16 | o2 << 8 | o3;
490
+ h1 = bits >> 18 & 0x3f;
491
+ h2 = bits >> 12 & 0x3f;
492
+ h3 = bits >> 6 & 0x3f;
493
+ h4 = bits & 0x3f;
494
+ tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
495
+ }
496
+ while (i < data.length);
497
+ enc = tmp_arr.join('');
498
+ var r = data.length % 3;
499
+ return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
500
+ }
501
  }
502
  jQuery("#ux_frm_front_end_form_<?php echo $form_id ."_". $rand_value; ?>").validate
503
  ({
504
+ rules:
505
  {
506
  <?php
507
  $dynamic = "";
509
  {
510
  if($control_settings_array[$form_fields[$flag4]->column_dynamicId]["cb_control_required"] == 1)
511
  {
512
+ switch($form_fields[$flag4]-> field_id)
513
  {
514
  case 1:
515
  $dynamic .= "ux_txt_control_".$form_fields[$flag4]->column_dynamicId ."_". $rand_value. ":{ required :true }";
529
  case 6:
530
  $dynamic .= "'".$form_fields[$flag4]->column_dynamicId ."_". $rand_value. "_rdl'". ":{ required :true }";
531
  break;
532
+
533
  }
534
  if( count($form_fields)> 1 && $flag4 < count($form_fields) - 1 )
535
  {
536
  $dynamic .= ",";
537
  }
538
  }
539
+
540
  }
541
  echo $dynamic;
542
  ?>
544
  errorPlacement: function(error, element)
545
  {
546
  <?php
547
+
548
  if($layout_settings_array[$form_id]["label_setting_label_position"] == "top")
549
  {
550
  ?>
562
  else
563
  {
564
  ?>
565
+ if (element.attr("type") === "radio" || element.attr("type") === "checkbox")
566
  {
567
  error.insertAfter(element.parent().children("label:last-child"));
568
  }
581
  },
582
  submitHandler: function(form)
583
  {
584
+
585
  jQuery("body,html").animate({
586
  scrollTop: jQuery("body,html").position().top}, "slow");
587
+ jQuery("#form_success_message_frontend_<?php echo $rand_value;?>").css("display","block");
588
  var form_id = "<?php echo $form_id ;?>";
589
+ jQuery.post(ajaxurl,
590
+ {
591
+ data: base64_encode(jQuery(form).serialize()),
592
+ form_id: form_id,
593
+ rand: "<?php echo $rand_value;?>",
594
+ param: "frontend_submit_controls",
595
+ action: "frontend_contact_form_library"
596
+ },
597
+ function(data)
598
  {
 
599
  var submit_id = data;
600
+ jQuery.post(ajaxurl, "form_id="+form_id+"&submit_id="+submit_id+"&param=email_management&action=email_management_contact_form_library", function(data)
601
  {
602
  setTimeout(function()
603
  {
608
  });
609
  }
610
  });
611
+ </script>
includes/cb_checkbox.php CHANGED
@@ -10,7 +10,7 @@ switch($cb_role)
10
  case "author":
11
  $cb_user_role_permission = "publish_posts";
12
  break;
13
-
14
  }
15
  if (!current_user_can($cb_user_role_permission))
16
  {
@@ -19,127 +19,127 @@ if (!current_user_can($cb_user_role_permission))
19
  else
20
  {
21
  $form_settings = array();
22
- $control_id = $wpdb->get_var
23
- (
24
- $wpdb->prepare
25
- (
26
- "SELECT control_id FROM " .create_control_Table(). " where form_id= %d and field_id = %d and column_dynamicId = %d",
27
- $form_id,
28
- $field_type,
29
- $dynamicId
30
- )
31
- );
32
- if(count($control_id) != 0)
33
- {
34
- $form_data = $wpdb->get_results
35
  (
36
  $wpdb->prepare
37
  (
38
- "SELECT * FROM " .contact_bank_dynamic_settings_form(). " where dynamicId= %d",
39
- $control_id
 
 
40
  )
41
  );
42
- $form_settings[$dynamicId]["dynamic_id"] = $dynamicId;
43
- $form_settings[$dynamicId]["control_type"] = "1";
44
- for($flag = 0; $flag<count($form_data);$flag++)
45
  {
46
- $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = $form_data[$flag]->dynamic_settings_value;
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  }
48
- }
49
- ?>
50
- <form id="ux_frm_check_box_control" action="#" method="post" class="layout-form">
51
- <div class="fluid-layout">
52
- <div class="layout-span12">
53
- <div class="widget-layout">
54
- <div class="widget-layout-title">
55
- <h4><?php _e( "Check Boxes", contact_bank ); ?></h4>
56
- </div>
57
- <div class="widget-layout-body">
58
- <div class="layout-control-group">
59
- <label class="layout-control-label"><?php _e( "Label", contact_bank ); ?> :</label>
60
- <div class="layout-controls">
61
- <input type="text" class="layout-span12" id="ux_label_text_<?php echo $dynamicId; ?>" onkeyup="enter_admin_label(<?php echo $dynamicId; ?>);" value="<?php echo isset($form_settings[$dynamicId]["cb_label_value"]) ? $form_settings[$dynamicId]["cb_label_value"] : _e( "Untitled", contact_bank ); ?>" name="ux_label_text_<?php echo $dynamicId; ?>" />
62
- </div>
63
  </div>
64
- <div class="layout-control-group">
65
- <label class="layout-control-label"><?php _e( "Required", contact_bank ); ?> :</label>
66
- <div class="layout-controls" style="margin-top:7px;">
67
- <?php
68
- if(isset($form_settings[$dynamicId]["cb_control_required"]))
69
- {
70
- if($form_settings[$dynamicId]["cb_control_required"] == "1")
 
 
 
 
 
71
  {
72
- ?>
73
- <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" checked="checked" />
74
- <label style="vertical-align: text-bottom;">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  <?php _e( "Required", contact_bank ); ?>
76
- </label>
77
- <input type="radio" id="ux_required_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0"/>
78
- <label style="vertical-align: text-bottom;">
79
- <?php _e( "Not Required", contact_bank ); ?>
80
- </label>
81
- <?php
 
82
  }
83
- else if($form_settings[$dynamicId]["cb_control_required"] == "0")
84
  {
85
- ?>
86
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
87
  <label style="vertical-align: text-bottom;">
88
  <?php _e( "Required", contact_bank ); ?>
89
  </label>
90
- <input type="radio" id="ux_required_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0" checked="checked" />
91
  <label style="vertical-align: text-bottom;">
92
  <?php _e( "Not Required", contact_bank ); ?>
93
  </label>
94
- <?php
95
  }
96
- }
97
- else
98
- {
99
  ?>
100
- <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
101
- <label style="vertical-align: text-bottom;">
102
- <?php _e( "Required", contact_bank ); ?>
103
- </label>
104
- <input type="radio" checked="checked" id="ux_required_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0" checked="checked" />
105
- <label style="vertical-align: text-bottom;">
106
- <?php _e( "Not Required", contact_bank ); ?>
107
- </label>
108
- <?php
109
- }
110
- ?>
111
  </div>
112
- </div>
113
- <div class="layout-control-group">
114
- <label class="layout-control-label"><?php _e("Tooltip Text", contact_bank); ?> :</label>
115
- <div class="layout-controls">
116
- <input type="text" class="layout-span12" readonly="readonly" id="ux_tooltip_control_<?php echo $dynamicId; ?>" placeholder="<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>" name="ux_tooltip_control_<?php echo $dynamicId; ?>" value="<?php echo isset($form_settings[$dynamicId]["cb_tooltip_txt"]) ? $form_settings[$dynamicId]["cb_tooltip_txt"] : ""; ?>"/>
117
  </div>
118
- </div>
119
- <div class="layout-control-group">
120
- <label class="layout-control-label"><?php _e("Options", contact_bank); ?> :</label>
121
- <div class="layout-controls">
122
- <input type="text" class="layout-span9" id="chk_options_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Options", contact_bank ); ?>" name="chk_options_<?php echo $dynamicId; ?>" />
123
- <input value="<?php _e( "Add", contact_bank ); ?>" type="button" style="margin-left:10px;" class="btn btn-info layout-span2" id="chk_options_button_<?php echo $dynamicId; ?>" onclick="add_chk_options(<?php echo $dynamicId; ?>);" name="chk_options_button_<?php echo $dynamicId; ?>" />
124
  </div>
125
- </div>
126
- <?php
127
- if(isset($form_settings[$dynamicId]["cb_checkbox_option_id"]) && isset($form_settings[$dynamicId]["cb_checkbox_option_val"]))
128
- {
129
- $options_value = unserialize($form_settings[$dynamicId]["cb_checkbox_option_val"]);
130
- if(count($options_value) > 0)
131
- {
132
- ?>
133
- <div class="layout-control-group" style="overflow: hidden;max-height: 110px;" id="bind_dropdown_<?php echo $dynamicId; ?>">
134
  <?php
135
- }
136
- else
137
  {
 
 
 
138
  ?>
139
- <div class="layout-control-group" style="overflow: hidden;max-height: 110px;display:none" id="bind_dropdown_<?php echo $dynamicId; ?>">
140
  <?php
141
- }
142
- ?>
 
 
 
 
 
 
143
  <div class="layout-controls">
144
  <select id="dropdown_ddl_option_<?php echo $dynamicId; ?>" class="layout-span9">
145
  <?php
@@ -166,29 +166,29 @@ else
166
  <div class="layout-control-group">
167
  <label class="layout-control-label"><?php _e( "Do not show in the email", contact_bank ); ?> :</label>
168
  <div class="layout-controls">
169
- <?php
170
- if(isset($form_settings[$dynamicId]["cb_show_email"]))
171
- {
172
- if($form_settings[$dynamicId]["cb_show_email"] == "1")
173
  {
174
- ?>
175
- <input type="checkbox" checked="checked" id="ux_show_email_<?php echo $dynamicId; ?>" name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="1">
176
- <?php
 
 
 
 
 
 
 
 
 
177
  }
178
  else
179
  {
180
- ?>
181
  <input type="checkbox" id="ux_show_email_<?php echo $dynamicId; ?>" name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="0">
182
  <?php
183
  }
184
- }
185
- else
186
- {
187
  ?>
188
- <input type="checkbox" id="ux_show_email_<?php echo $dynamicId; ?>" name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="0">
189
- <?php
190
- }
191
- ?>
192
  </div>
193
  </div>
194
  <input type="hidden" id="ux_hd_textbox_dynamic_id" name="ux_hd_textbox_dynamic_id" value="<?php echo $dynamicId; ?>"/>
@@ -199,73 +199,120 @@ else
199
  </div>
200
  </div>
201
  </div>
202
- </div>
203
- </form>
204
- <a class="closeButtonLightbox" onclick="CloseLightbox();"></a>
205
-
206
- <script type="text/javascript">
207
-
208
- var dynamicId = "<?php echo $dynamicId; ?>";
209
- var controlId = "<?php echo $control_id; ?>";
210
- var form_id = "<?php echo $form_id;?>";
211
- var options_ddl = [];
212
- var options_value = [];
213
- jQuery("#ux_frm_check_box_control").validate
214
- ({
215
- submitHandler: function(form)
216
- {
217
- if(jQuery("#dropdown_ddl_option_"+dynamicId).val() != null)
218
  {
219
- jQuery("#ux_chk_checkbox_control_"+dynamicId).hide();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  }
221
- else
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
222
  {
223
- jQuery("#ux_chk_checkbox_control_"+dynamicId).show();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
  }
225
- jQuery("#add_chk_options_here_"+dynamicId).empty();
226
- jQuery("#dropdown_ddl_option_"+dynamicId+" option").each(function()
227
  {
228
- jQuery("#add_chk_options_here_"+dynamicId).append("<span id=\"input_id_"+this.value+"\"><input id=\"ux_chk_checkbox_control_"+this.value+"\" name=\"ux_chk_checkbox_control_"+this.value+"\" type=\"checkbox\"/><label class=\"rdl\">"+this.text+"</label></span>");
229
- options_ddl.push(this.value);
230
- options_value.push(this.text);
231
- });
232
- jQuery.post(ajaxurl, jQuery(form).serialize() + "&controlId="+controlId+"&form_id="+form_id+"&ddl_options_id="+JSON.stringify(options_ddl)+"&options_value="+encodeURIComponent(JSON.stringify(options_value))+"&form_settings="+JSON.stringify(<?php echo json_encode($form_settings) ?>)+"&event=update&param=save_check_box_control&action=add_contact_form_library", function(data)
233
- {
234
- jQuery("#control_label_"+dynamicId).html(jQuery("#ux_label_text_"+dynamicId).val()+" :");
235
- jQuery("#post_back_checkbox_"+dynamicId).attr("data-original-title",jQuery("#ux_tooltip_control_"+dynamicId).val());
236
- if(jQuery("#ux_required_control_"+dynamicId).prop("checked") == true)
237
  {
238
- jQuery("#control_label_"+dynamicId).append("<span class=\"error\">*</span>");
 
 
 
 
 
239
  }
240
- CloseLightbox();
241
- });
242
- }
243
- });
244
- function add_chk_options(dynamicId)
245
- {
246
- var ddl_options = jQuery("#chk_options_"+dynamicId).val();
247
- if(ddl_options=="")
248
- {
249
- alert("<?php _e( "Please Fill an Option.", contact_bank ); ?>");
250
- }
251
- else
252
- {
253
- var optionsId = Math.floor((Math.random()*10000)+1);
254
- jQuery("#dropdown_ddl_option_"+dynamicId).append("<option value=\""+optionsId+"\">"+ddl_options+"</option>");
255
- jQuery("#bind_dropdown_"+dynamicId).css("display","");
256
- jQuery("#chk_options_"+dynamicId).val("");
257
- }
258
- }
259
- function delete_ddl_options(dynamicId)
260
- {
261
- var value = jQuery("#dropdown_ddl_option_"+dynamicId).val();
262
- jQuery("#dropdown_ddl_option_"+dynamicId+ " option[value=\""+value+"\"]").remove();
263
- if(jQuery("#dropdown_ddl_option_"+dynamicId).val() == null)
264
- {
265
- jQuery("#bind_dropdown_"+dynamicId).css("display","none");
266
- }
267
- }
268
- </script>
269
- <?php
270
  }
271
- ?>
10
  case "author":
11
  $cb_user_role_permission = "publish_posts";
12
  break;
13
+
14
  }
15
  if (!current_user_can($cb_user_role_permission))
16
  {
19
  else
20
  {
21
  $form_settings = array();
22
+ $control_id = $wpdb->get_var
 
 
 
 
 
 
 
 
 
 
 
 
23
  (
24
  $wpdb->prepare
25
  (
26
+ "SELECT control_id FROM " .create_control_Table(). " where form_id= %d and field_id = %d and column_dynamicId = %d",
27
+ $form_id,
28
+ $field_type,
29
+ $dynamicId
30
  )
31
  );
32
+ if(count($control_id) != 0)
 
 
33
  {
34
+ $form_data = $wpdb->get_results
35
+ (
36
+ $wpdb->prepare
37
+ (
38
+ "SELECT * FROM " .contact_bank_dynamic_settings_form(). " where dynamicId= %d",
39
+ $control_id
40
+ )
41
+ );
42
+ $form_settings[$dynamicId]["dynamic_id"] = $dynamicId;
43
+ $form_settings[$dynamicId]["control_type"] = "1";
44
+ for($flag = 0; $flag<count($form_data);$flag++)
45
+ {
46
+ $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = $form_data[$flag]->dynamic_settings_value;
47
+ }
48
  }
49
+ ?>
50
+ <form id="ux_frm_check_box_control" action="#" method="post" class="layout-form">
51
+ <div class="fluid-layout">
52
+ <div class="layout-span12">
53
+ <div class="widget-layout">
54
+ <div class="widget-layout-title">
55
+ <h4><?php _e( "Check Boxes", contact_bank ); ?></h4>
 
 
 
 
 
 
 
 
56
  </div>
57
+ <div class="widget-layout-body">
58
+ <div class="layout-control-group">
59
+ <label class="layout-control-label"><?php _e( "Label", contact_bank ); ?> :</label>
60
+ <div class="layout-controls">
61
+ <input type="text" class="layout-span12" id="ux_label_text_<?php echo $dynamicId; ?>" onkeyup="enter_admin_label(<?php echo $dynamicId; ?>);" value="<?php echo isset($form_settings[$dynamicId]["cb_label_value"]) ? $form_settings[$dynamicId]["cb_label_value"] : _e( "Untitled", contact_bank ); ?>" name="ux_label_text_<?php echo $dynamicId; ?>" />
62
+ </div>
63
+ </div>
64
+ <div class="layout-control-group">
65
+ <label class="layout-control-label"><?php _e( "Required", contact_bank ); ?> :</label>
66
+ <div class="layout-controls" style="margin-top:7px;">
67
+ <?php
68
+ if(isset($form_settings[$dynamicId]["cb_control_required"]))
69
  {
70
+ if($form_settings[$dynamicId]["cb_control_required"] == "1")
71
+ {
72
+ ?>
73
+ <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" checked="checked" />
74
+ <label style="vertical-align: text-bottom;">
75
+ <?php _e( "Required", contact_bank ); ?>
76
+ </label>
77
+ <input type="radio" id="ux_required_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0"/>
78
+ <label style="vertical-align: text-bottom;">
79
+ <?php _e( "Not Required", contact_bank ); ?>
80
+ </label>
81
+ <?php
82
+ }
83
+ else if($form_settings[$dynamicId]["cb_control_required"] == "0")
84
+ {
85
+ ?>
86
+ <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
87
+ <label style="vertical-align: text-bottom;">
88
  <?php _e( "Required", contact_bank ); ?>
89
+ </label>
90
+ <input type="radio" id="ux_required_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0" checked="checked" />
91
+ <label style="vertical-align: text-bottom;">
92
+ <?php _e( "Not Required", contact_bank ); ?>
93
+ </label>
94
+ <?php
95
+ }
96
  }
97
+ else
98
  {
99
+ ?>
100
  <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
101
  <label style="vertical-align: text-bottom;">
102
  <?php _e( "Required", contact_bank ); ?>
103
  </label>
104
+ <input type="radio" checked="checked" id="ux_required_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0" checked="checked" />
105
  <label style="vertical-align: text-bottom;">
106
  <?php _e( "Not Required", contact_bank ); ?>
107
  </label>
108
+ <?php
109
  }
 
 
 
110
  ?>
111
+ </div>
 
 
 
 
 
 
 
 
 
 
112
  </div>
113
+ <div class="layout-control-group">
114
+ <label class="layout-control-label"><?php _e("Tooltip Text", contact_bank); ?> :</label>
115
+ <div class="layout-controls">
116
+ <input type="text" class="layout-span12" id="ux_tooltip_control_<?php echo $dynamicId; ?>" placeholder="<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>" name="ux_tooltip_control_<?php echo $dynamicId; ?>" readonly="readonly"/>
117
+ </div>
118
  </div>
119
+ <div class="layout-control-group">
120
+ <label class="layout-control-label"><?php _e("Options", contact_bank); ?> :</label>
121
+ <div class="layout-controls">
122
+ <input type="text" class="layout-span9" id="chk_options_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Options", contact_bank ); ?>" name="chk_options_<?php echo $dynamicId; ?>" />
123
+ <input value="<?php _e( "Add", contact_bank ); ?>" type="button" style="margin-left:10px;" class="btn btn-info layout-span2" id="chk_options_button_<?php echo $dynamicId; ?>" onclick="add_chk_options(<?php echo $dynamicId; ?>);" name="chk_options_button_<?php echo $dynamicId; ?>" />
124
+ </div>
125
  </div>
 
 
 
 
 
 
 
 
 
126
  <?php
127
+ if(isset($form_settings[$dynamicId]["cb_checkbox_option_id"]) && isset($form_settings[$dynamicId]["cb_checkbox_option_val"]))
 
128
  {
129
+ $options_value = unserialize($form_settings[$dynamicId]["cb_checkbox_option_val"]);
130
+ if(count($options_value) > 0)
131
+ {
132
  ?>
133
+ <div class="layout-control-group" style="overflow: hidden;max-height: 110px;" id="bind_dropdown_<?php echo $dynamicId; ?>">
134
  <?php
135
+ }
136
+ else
137
+ {
138
+ ?>
139
+ <div class="layout-control-group" style="overflow: hidden;max-height: 110px;display:none" id="bind_dropdown_<?php echo $dynamicId; ?>">
140
+ <?php
141
+ }
142
+ ?>
143
  <div class="layout-controls">
144
  <select id="dropdown_ddl_option_<?php echo $dynamicId; ?>" class="layout-span9">
145
  <?php
166
  <div class="layout-control-group">
167
  <label class="layout-control-label"><?php _e( "Do not show in the email", contact_bank ); ?> :</label>
168
  <div class="layout-controls">
169
+ <?php
170
+ if(isset($form_settings[$dynamicId]["cb_show_email"]))
 
 
171
  {
172
+ if($form_settings[$dynamicId]["cb_show_email"] == "1")
173
+ {
174
+ ?>
175
+ <input type="checkbox" checked="checked" id="ux_show_email_<?php echo $dynamicId; ?>" name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="1">
176
+ <?php
177
+ }
178
+ else
179
+ {
180
+ ?>
181
+ <input type="checkbox" id="ux_show_email_<?php echo $dynamicId; ?>" name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="0">
182
+ <?php
183
+ }
184
  }
185
  else
186
  {
187
+ ?>
188
  <input type="checkbox" id="ux_show_email_<?php echo $dynamicId; ?>" name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="0">
189
  <?php
190
  }
 
 
 
191
  ?>
 
 
 
 
192
  </div>
193
  </div>
194
  <input type="hidden" id="ux_hd_textbox_dynamic_id" name="ux_hd_textbox_dynamic_id" value="<?php echo $dynamicId; ?>"/>
199
  </div>
200
  </div>
201
  </div>
202
+ </form>
203
+ <a class="closeButtonLightbox" onclick="CloseLightbox();"></a>
204
+ <script type="text/javascript">
205
+ jQuery(".hovertip").tooltip_tip({placement: "left"});
206
+ if (typeof(base64_encode) != "function")
 
 
 
 
 
 
 
 
 
 
 
207
  {
208
+ function base64_encode(data)
209
+ {
210
+ var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
211
+ var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
212
+ ac = 0,
213
+ enc = '',
214
+ tmp_arr = [];
215
+ if (!data)
216
+ {
217
+ return data;
218
+ }
219
+ do
220
+ {
221
+ o1 = data.charCodeAt(i++);
222
+ o2 = data.charCodeAt(i++);
223
+ o3 = data.charCodeAt(i++);
224
+ bits = o1 << 16 | o2 << 8 | o3;
225
+ h1 = bits >> 18 & 0x3f;
226
+ h2 = bits >> 12 & 0x3f;
227
+ h3 = bits >> 6 & 0x3f;
228
+ h4 = bits & 0x3f;
229
+ tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
230
+ }
231
+ while (i < data.length);
232
+ enc = tmp_arr.join('');
233
+ var r = data.length % 3;
234
+ return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
235
+ }
236
  }
237
+ var dynamicId = "<?php echo $dynamicId; ?>";
238
+ var controlId = "<?php echo $control_id; ?>";
239
+ var form_id = "<?php echo $form_id;?>";
240
+ var options_ddl = [];
241
+ var options_value = [];
242
+ jQuery("#ux_frm_check_box_control").validate
243
+ ({
244
+ submitHandler: function(form)
245
+ {
246
+ if(jQuery("#dropdown_ddl_option_"+dynamicId).val() != null)
247
+ {
248
+ jQuery("#ux_chk_checkbox_control_"+dynamicId).hide();
249
+ }
250
+ else
251
+ {
252
+ jQuery("#ux_chk_checkbox_control_"+dynamicId).show();
253
+ }
254
+ jQuery("#add_chk_options_here_"+dynamicId).empty();
255
+ jQuery("#dropdown_ddl_option_"+dynamicId+" option").each(function()
256
+ {
257
+ jQuery("#add_chk_options_here_"+dynamicId).append("<span id=\"input_id_"+this.value+"\"><input id=\"ux_chk_checkbox_control_"+this.value+"\" name=\"ux_chk_checkbox_control_"+this.value+"\" type=\"checkbox\"/><label class=\"rdl\">"+this.text+"</label></span>");
258
+ options_ddl.push(this.value);
259
+ options_value.push(this.text);
260
+ });
261
+ jQuery.post(ajaxurl,
262
+ {
263
+ data: base64_encode(jQuery(form).serialize()),
264
+ controlId: controlId,
265
+ form_id: form_id,
266
+ form_settings: JSON.stringify(<?php echo json_encode($form_settings) ?>),
267
+ ddl_options_id: JSON.stringify(options_ddl),
268
+ options_value: JSON.stringify(options_value),
269
+ events: "update",
270
+ param: "save_check_box_control",
271
+ action: "add_contact_form_library",
272
+ },
273
+ function(data)
274
+ {
275
+ jQuery("#control_label_"+dynamicId).html(jQuery("#ux_label_text_"+dynamicId).val()+" :");
276
+ jQuery("#post_back_checkbox_"+dynamicId).attr("data-original-title",jQuery("#ux_tooltip_control_"+dynamicId).val());
277
+ if(jQuery("#ux_required_control_"+dynamicId).prop("checked") == true)
278
+ {
279
+ jQuery("#control_label_"+dynamicId).append("<span class=\"error_field\">*</span>");
280
+ }
281
+ CloseLightbox();
282
+ });
283
+ }
284
+ });
285
+ if (typeof(add_chk_options) != "function")
286
  {
287
+ function add_chk_options(dynamicId)
288
+ {
289
+ var ddl_options = jQuery("#chk_options_"+dynamicId).val();
290
+ if(ddl_options=="")
291
+ {
292
+ alert("<?php _e( "Please Fill an Option.", contact_bank ); ?>");
293
+ }
294
+ else
295
+ {
296
+ var optionsId = Math.floor((Math.random()*10000)+1);
297
+ jQuery("#dropdown_ddl_option_"+dynamicId).append("<option value=\""+optionsId+"\">"+ddl_options+"</option>");
298
+ jQuery("#bind_dropdown_"+dynamicId).css("display","");
299
+ jQuery("#chk_options_"+dynamicId).val("");
300
+ }
301
+ }
302
  }
303
+ if (typeof(delete_ddl_options) != "function")
 
304
  {
305
+ function delete_ddl_options(dynamicId)
 
 
 
 
 
 
 
 
306
  {
307
+ var value = jQuery("#dropdown_ddl_option_"+dynamicId).val();
308
+ jQuery("#dropdown_ddl_option_"+dynamicId+ " option[value=\""+value+"\"]").remove();
309
+ if(jQuery("#dropdown_ddl_option_"+dynamicId).val() == null)
310
+ {
311
+ jQuery("#bind_dropdown_"+dynamicId).css("display","none");
312
+ }
313
  }
314
+ }
315
+ </script>
316
+ <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
317
  }
318
+ ?>
includes/cb_dropdown.php CHANGED
@@ -10,7 +10,7 @@ switch($cb_role)
10
  case "author":
11
  $cb_user_role_permission = "publish_posts";
12
  break;
13
-
14
  }
15
  if (!current_user_can($cb_user_role_permission))
16
  {
@@ -19,243 +19,293 @@ if (!current_user_can($cb_user_role_permission))
19
  else
20
  {
21
  $form_settings = array();
22
- $control_id = $wpdb->get_var
23
- (
24
- $wpdb->prepare
25
- (
26
- "SELECT control_id FROM " .create_control_Table(). " where form_id= %d and field_id = %d and column_dynamicId = %d",
27
- $form_id,
28
- $field_type,
29
- $dynamicId
30
- )
31
- );
32
- if(count($control_id) != 0)
33
- {
34
- $form_data = $wpdb->get_results
35
  (
36
  $wpdb->prepare
37
  (
38
- "SELECT * FROM " .contact_bank_dynamic_settings_form(). " where dynamicId= %d",
39
- $control_id
 
 
40
  )
41
  );
42
- $form_settings[$dynamicId]["dynamic_id"] = $dynamicId;
43
- $form_settings[$dynamicId]["control_type"] = "1";
44
- for($flag = 0; $flag<count($form_data);$flag++)
45
  {
46
- $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = $form_data[$flag]->dynamic_settings_value;
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  }
48
- }
49
- ?>
50
- <form id="ux_frm_drop_down_control" action="#" method="post" class="layout-form">
51
- <div class="fluid-layout">
52
- <div class="layout-span12">
53
- <div class="widget-layout">
54
- <div class="widget-layout-title">
55
- <h4><?php _e( "Select Box", contact_bank ); ?></h4>
56
- </div>
57
- <div class="widget-layout-body">
58
- <div class="layout-control-group">
59
- <label class="layout-control-label"><?php _e( "Label", contact_bank ); ?> :</label>
60
- <div class="layout-controls">
61
- <input type="text" class="layout-span12" onkeyup="enter_admin_label(<?php echo $dynamicId; ?>);" value="<?php echo isset($form_settings[$dynamicId]["cb_label_value"]) ? $form_settings[$dynamicId]["cb_label_value"] : _e( "Untitled", contact_bank ); ?>" id="ux_label_text_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Label", contact_bank ); ?>" name="ux_label_text_<?php echo $dynamicId; ?>" />
62
  </div>
63
- </div>
64
- <div class="layout-control-group">
65
- <label class="layout-control-label"><?php _e( "Required", contact_bank ); ?> :</label>
66
- <div class="layout-controls" style="margin-top:7px;">
67
- <?php
68
- if(isset($form_settings[$dynamicId]["cb_control_required"]))
69
- {
70
- if($form_settings[$dynamicId]["cb_control_required"] == "1")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  {
 
 
 
72
  ?>
73
- <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" checked="checked" />
74
- <label style="vertical-align: text-bottom;">
75
- <?php _e( "Required", contact_bank ); ?>
76
- </label>
77
- <input type="radio" id="ux_required_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0"/>
78
- <label style="vertical-align: text-bottom;">
79
- <?php _e( "Not Required", contact_bank ); ?>
80
- </label>
81
  <?php
82
- }
83
- else if($form_settings[$dynamicId]["cb_control_required"] == "0")
84
- {
85
  ?>
86
- <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
87
- <label style="vertical-align: text-bottom;">
88
- <?php _e( "Required", contact_bank ); ?>
89
- </label>
90
- <input type="radio" id="ux_required_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0" checked="checked" />
91
- <label style="vertical-align: text-bottom;">
92
- <?php _e( "Not Required", contact_bank ); ?>
93
- </label>
94
  <?php
95
- }
96
- }
97
- else
98
- {
99
- ?>
100
- <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
101
- <label style="vertical-align: text-bottom;">
102
- <?php _e( "Required", contact_bank ); ?>
103
- </label>
104
- <input type="radio" id="ux_required_<?php echo $dynamicId; ?>" checked="checked" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0" checked="checked" />
105
- <label style="vertical-align: text-bottom;">
106
- <?php _e( "Not Required", contact_bank ); ?>
107
- </label>
108
- <?php
109
- }
110
- ?>
111
- </div>
112
- </div>
113
- <div class="layout-control-group">
114
- <label class="layout-control-label"><?php _e("Tooltip Text", contact_bank); ?> : </label>
115
- <div class="layout-controls">
116
- <input type="text" class="layout-span12" id="ux_tooltip_control_<?php echo $dynamicId; ?>" readonly="readonly" placeholder="<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>" name="ux_tooltip_control_<?php echo $dynamicId; ?>" value="<?php echo isset($form_settings[$dynamicId]["cb_tooltip_txt"]) ? $form_settings[$dynamicId]["cb_tooltip_txt"] : ""; ?>"/>
117
- </div>
118
- </div>
119
- <div class="layout-control-group">
120
- <label class="layout-control-label"><?php _e("Options", contact_bank); ?> : </label>
121
- <div class="layout-controls">
122
- <input type="text" class="layout-span9" id="ddl_options_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Option", contact_bank ); ?>" name="ddl_options_<?php echo $dynamicId; ?>" />
123
- <input class="btn btn-info layout-span2" style="margin-left:10px;" value="<?php _e( "Add", contact_bank ); ?>" type="button" id="ddl_options_button_<?php echo $dynamicId; ?>" onclick="add_ddl_options(<?php echo $dynamicId; ?>);" name="ddl_options_button_<?php echo $dynamicId; ?>" />
124
- </div>
125
- </div>
126
- <?php
127
- if(isset($form_settings[$dynamicId]["cb_dropdown_option_id"]) && isset($form_settings[$dynamicId]["cb_dropdown_option_val"]))
128
- {
129
- $options_values = unserialize($form_settings[$dynamicId]["cb_dropdown_option_val"]);
130
- if(count($options_values) > 0)
131
- {
132
- ?>
133
- <div class="layout-control-group" style="overflow: hidden;max-height: 110px;" id="bind_dropdown_<?php echo $dynamicId; ?>">
134
- <?php
135
- }
136
- else
137
- {
138
- ?>
139
- <div class="layout-control-group" style="overflow: hidden;max-height: 110px;display:none" id="bind_dropdown_<?php echo $dynamicId; ?>">
140
  <?php
141
  }
142
  ?>
143
- <div class="layout-controls">
144
- <select id="dropdown_ddl_option_<?php echo $dynamicId; ?>" class="layout-span9">
 
 
 
 
 
 
 
145
  <?php
146
- foreach(unserialize($form_settings[$dynamicId]["cb_dropdown_option_id"]) as $key => $value )
147
  {
148
- ?>
149
- <option value="<?php echo $value; ?>"><?php echo $options_values[$key]; ?></option>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  <?php
151
  }
152
  ?>
153
- </select>
154
- <input class="btn btn-info layout-span2" style="margin-left:10px;" value="<?php _e( "Delete", contact_bank ); ?>" type="button" id="ddl_options_btn_del_<?php echo $dynamicId; ?>" onclick="delete_ddl_options(<?php echo $dynamicId; ?>);" name="ddl_options_btn_del_<?php echo $dynamicId; ?>" />
155
  </div>
156
- </div>
157
- <?php
158
- }
159
- ?>
160
- <div class="layout-control-group">
161
- <label class="layout-control-label"><?php _e( "Admin Label", contact_bank ); ?> : </label>
162
- <div class="layout-controls">
163
- <input type="text" class="layout-span12" id="ux_admin_label_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Admin Label", contact_bank ); ?>" name="ux_admin_label_<?php echo $dynamicId; ?>" value="<?php echo isset($form_settings[$dynamicId]["cb_admin_label"]) ? $form_settings[$dynamicId]["cb_admin_label"] : _e( "Untitled", contact_bank ); ?>"/>
164
  </div>
165
  </div>
166
  <div class="layout-control-group">
167
- <label class="layout-control-label"><?php _e( "Do not show in the email", contact_bank ); ?> :</label>
168
- <div class="layout-controls">
169
- <?php
170
- if(isset($form_settings[$dynamicId]["cb_show_email"]))
171
- {
172
- if($form_settings[$dynamicId]["cb_show_email"] == "1")
173
- {
174
- ?>
175
- <input type="checkbox" checked="checked" id="ux_show_email_<?php echo $dynamicId; ?>" name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="1">
176
- <?php
177
- }
178
- else
179
- {
180
- ?>
181
- <input type="checkbox" id="ux_show_email_<?php echo $dynamicId; ?>" name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="1">
182
- <?php
183
- }
184
- }
185
- else
186
- {
187
- ?>
188
- <input type="checkbox" id="ux_show_email_<?php echo $dynamicId; ?>" name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="1">
189
- <?php
190
- }
191
- ?>
192
- </div>
193
- </div>
194
- <input type="hidden" id="ux_hd_textbox_dynamic_id" name="ux_hd_textbox_dynamic_id" value="<?php echo $dynamicId; ?>"/>
195
  </div>
196
- </div>
197
- <div class="layout-control-group">
198
- <input type="submit" class="btn btn-info layout-span3" value="<?php _e( "Save Settings", contact_bank ); ?>" />
199
- </div>
200
- </div>
201
- </div>
202
- </div>
203
- </form>
204
- <a class="closeButtonLightbox" onclick="CloseLightbox();"></a>
205
- <script type="text/javascript">
206
- var dynamicId = "<?php echo $dynamicId; ?>";
207
- var controlId = "<?php echo $control_id; ?>";
208
- var form_id = "<?php echo $form_id;?>";
209
- var options_ddl = [];
210
- var options_value = [];
211
- jQuery("#ux_frm_drop_down_control").validate
212
- ({
213
- submitHandler: function(form)
214
- {
215
- jQuery("#ux_ddl_select_control"+dynamicId).children("option:not(:first)").remove();
216
- jQuery("#dropdown_ddl_option_"+dynamicId+" option").each(function()
217
  {
218
- jQuery("#ux_ddl_select_control"+dynamicId).append("<option value=\""+this.value+"\">"+this.text+"</option>");
219
- options_ddl.push(this.value);
220
- options_value.push(this.text);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  });
222
- jQuery.post(ajaxurl, jQuery(form).serialize() + "&controlId="+controlId+"&form_id="+form_id+"&form_settings="+JSON.stringify(<?php echo json_encode($form_settings); ?>)+"&ddl_options_id="+JSON.stringify(options_ddl)+"&options_value="+encodeURIComponent(JSON.stringify(options_value))+"&event=update&param=save_drop_down_control&action=add_contact_form_library", function(data)
223
  {
224
- jQuery("#control_label_"+dynamicId).html(jQuery("#ux_label_text_"+dynamicId).val()+" :");
225
- jQuery("#show_tooltip"+dynamicId).attr("data-original-title",jQuery("#ux_tooltip_control_"+dynamicId).val());
226
- if(jQuery("#ux_required_control_"+dynamicId).prop("checked") == true)
227
  {
228
- jQuery("#control_label_"+dynamicId).append("<span class=\"error\">*</span>");
 
 
 
 
 
 
 
 
 
 
 
229
  }
230
- CloseLightbox();
231
- });
232
- }
233
- });
234
- function add_ddl_options(dynamicId)
235
- {
236
- var ddl_options = jQuery("#ddl_options_"+dynamicId).val();
237
- if(ddl_options=="")
238
- {
239
- alert("<?php _e( "Please Fill an Option.", contact_bank ); ?>");
240
- }
241
- else
242
- {
243
- var optionsId = Math.floor((Math.random()*10000)+1);
244
- jQuery("#dropdown_ddl_option_"+dynamicId).append("<option value=\""+optionsId+"\">"+ddl_options+"</option>");
245
- jQuery("#bind_dropdown_"+dynamicId).css("display","");
246
- jQuery("#ddl_options_"+dynamicId).val("");
247
- }
248
- }
249
- function delete_ddl_options(dynamicId)
250
- {
251
- var value = jQuery("#dropdown_ddl_option_"+dynamicId).val();
252
- jQuery("#dropdown_ddl_option_"+dynamicId+ " option[value=\""+value+"\"]").remove();
253
- if(jQuery("#dropdown_ddl_option_"+dynamicId).val() == null)
254
- {
255
- jQuery("#bind_dropdown_"+dynamicId).css("display","none");
256
- }
257
- }
258
- </script>
259
- <?php
260
  }
261
- ?>
10
  case "author":
11
  $cb_user_role_permission = "publish_posts";
12
  break;
13
+
14
  }
15
  if (!current_user_can($cb_user_role_permission))
16
  {
19
  else
20
  {
21
  $form_settings = array();
22
+ $control_id = $wpdb->get_var
 
 
 
 
 
 
 
 
 
 
 
 
23
  (
24
  $wpdb->prepare
25
  (
26
+ "SELECT control_id FROM " .create_control_Table(). " where form_id= %d and field_id = %d and column_dynamicId = %d",
27
+ $form_id,
28
+ $field_type,
29
+ $dynamicId
30
  )
31
  );
32
+ if(count($control_id) != 0)
 
 
33
  {
34
+ $form_data = $wpdb->get_results
35
+ (
36
+ $wpdb->prepare
37
+ (
38
+ "SELECT * FROM " .contact_bank_dynamic_settings_form(). " where dynamicId= %d",
39
+ $control_id
40
+ )
41
+ );
42
+ $form_settings[$dynamicId]["dynamic_id"] = $dynamicId;
43
+ $form_settings[$dynamicId]["control_type"] = "1";
44
+ for($flag = 0; $flag<count($form_data);$flag++)
45
+ {
46
+ $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = $form_data[$flag]->dynamic_settings_value;
47
+ }
48
  }
49
+ ?>
50
+ <form id="ux_frm_drop_down_control" action="#" method="post" class="layout-form">
51
+ <div class="fluid-layout">
52
+ <div class="layout-span12">
53
+ <div class="widget-layout">
54
+ <div class="widget-layout-title">
55
+ <h4><?php _e( "Select Box", contact_bank ); ?></h4>
 
 
 
 
 
 
 
56
  </div>
57
+ <div class="widget-layout-body">
58
+ <div class="layout-control-group">
59
+ <label class="layout-control-label"><?php _e( "Label", contact_bank ); ?> :</label>
60
+ <div class="layout-controls">
61
+ <input type="text" class="layout-span12" onkeyup="enter_admin_label(<?php echo $dynamicId; ?>);" value="<?php echo isset($form_settings[$dynamicId]["cb_label_value"]) ? $form_settings[$dynamicId]["cb_label_value"] : _e( "Untitled", contact_bank ); ?>" id="ux_label_text_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Label", contact_bank ); ?>" name="ux_label_text_<?php echo $dynamicId; ?>" />
62
+ </div>
63
+ </div>
64
+ <div class="layout-control-group">
65
+ <label class="layout-control-label"><?php _e( "Required", contact_bank ); ?> :</label>
66
+ <div class="layout-controls" style="margin-top:7px;">
67
+ <?php
68
+ if(isset($form_settings[$dynamicId]["cb_control_required"]))
69
+ {
70
+ if($form_settings[$dynamicId]["cb_control_required"] == "1")
71
+ {
72
+ ?>
73
+ <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" checked="checked" />
74
+ <label style="vertical-align: text-bottom;">
75
+ <?php _e( "Required", contact_bank ); ?>
76
+ </label>
77
+ <input type="radio" id="ux_required_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0"/>
78
+ <label style="vertical-align: text-bottom;">
79
+ <?php _e( "Not Required", contact_bank ); ?>
80
+ </label>
81
+ <?php
82
+ }
83
+ else if($form_settings[$dynamicId]["cb_control_required"] == "0")
84
+ {
85
+ ?>
86
+ <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
87
+ <label style="vertical-align: text-bottom;">
88
+ <?php _e( "Required", contact_bank ); ?>
89
+ </label>
90
+ <input type="radio" id="ux_required_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0" checked="checked" />
91
+ <label style="vertical-align: text-bottom;">
92
+ <?php _e( "Not Required", contact_bank ); ?>
93
+ </label>
94
+ <?php
95
+ }
96
+ }
97
+ else
98
+ {
99
+ ?>
100
+ <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
101
+ <label style="vertical-align: text-bottom;">
102
+ <?php _e( "Required", contact_bank ); ?>
103
+ </label>
104
+ <input type="radio" id="ux_required_<?php echo $dynamicId; ?>" checked="checked" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0" checked="checked" />
105
+ <label style="vertical-align: text-bottom;">
106
+ <?php _e( "Not Required", contact_bank ); ?>
107
+ </label>
108
+ <?php
109
+ }
110
+ ?>
111
+ </div>
112
+ </div>
113
+ <div class="layout-control-group">
114
+ <label class="layout-control-label"><?php _e("Tooltip Text", contact_bank); ?> : </label>
115
+ <div class="layout-controls">
116
+ <input type="text" class="layout-span12" id="ux_tooltip_control_<?php echo $dynamicId; ?>" placeholder="<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>" name="ux_tooltip_control_<?php echo $dynamicId; ?>" readonly="readonly"/>
117
+ </div>
118
+ </div>
119
+ <div class="layout-control-group">
120
+ <label class="layout-control-label"><?php _e("Options", contact_bank); ?> : </label>
121
+ <div class="layout-controls">
122
+ <input type="text" class="layout-span9" id="ddl_options_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Option", contact_bank ); ?>" name="ddl_options_<?php echo $dynamicId; ?>" />
123
+ <input class="btn btn-info layout-span2" style="margin-left:10px;" value="<?php _e( "Add", contact_bank ); ?>" type="button" id="ddl_options_button_<?php echo $dynamicId; ?>" onclick="add_ddl_options(<?php echo $dynamicId; ?>);" name="ddl_options_button_<?php echo $dynamicId; ?>" />
124
+ </div>
125
+ </div>
126
+ <?php
127
+ if(isset($form_settings[$dynamicId]["cb_dropdown_option_id"]) && isset($form_settings[$dynamicId]["cb_dropdown_option_val"]))
128
  {
129
+ $options_values = unserialize($form_settings[$dynamicId]["cb_dropdown_option_val"]);
130
+ if(count($options_values) > 0)
131
+ {
132
  ?>
133
+ <div class="layout-control-group" style="overflow: hidden;max-height: 110px;" id="bind_dropdown_<?php echo $dynamicId; ?>">
 
 
 
 
 
 
 
134
  <?php
135
+ }
136
+ else
137
+ {
138
  ?>
139
+ <div class="layout-control-group" style="overflow: hidden;max-height: 110px;display:none" id="bind_dropdown_<?php echo $dynamicId; ?>">
 
 
 
 
 
 
 
140
  <?php
141
+ }
142
+
143
+ ?>
144
+ <div class="layout-controls">
145
+ <select id="dropdown_ddl_option_<?php echo $dynamicId; ?>" class="layout-span9">
146
+ <?php
147
+ foreach(unserialize($form_settings[$dynamicId]["cb_dropdown_option_id"]) as $key => $value )
148
+ {
149
+ ?>
150
+ <option value="<?php echo $value; ?>"><?php echo $options_values[$key]; ?></option>
151
+ <?php
152
+ }
153
+ ?>
154
+ </select>
155
+ <input class="btn btn-info layout-span2" style="margin-left:10px;" value="<?php _e( "Delete", contact_bank ); ?>" type="button" id="ddl_options_btn_del_<?php echo $dynamicId; ?>" onclick="delete_ddl_options(<?php echo $dynamicId; ?>);" name="ddl_options_btn_del_<?php echo $dynamicId; ?>" />
156
+ </div>
157
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  <?php
159
  }
160
  ?>
161
+ <div class="layout-control-group">
162
+ <label class="layout-control-label"><?php _e( "Admin Label", contact_bank ); ?> : </label>
163
+ <div class="layout-controls">
164
+ <input type="text" class="layout-span12" id="ux_admin_label_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Admin Label", contact_bank ); ?>" name="ux_admin_label_<?php echo $dynamicId; ?>" value="<?php echo isset($form_settings[$dynamicId]["cb_admin_label"]) ? $form_settings[$dynamicId]["cb_admin_label"] : _e( "Untitled", contact_bank ); ?>"/>
165
+ </div>
166
+ </div>
167
+ <div class="layout-control-group">
168
+ <label class="layout-control-label"><?php _e( "Do not show in the email", contact_bank ); ?> :</label>
169
+ <div class="layout-controls">
170
  <?php
171
+ if(isset($form_settings[$dynamicId]["cb_show_email"]))
172
  {
173
+ if($form_settings[$dynamicId]["cb_show_email"] == "1")
174
+ {
175
+ ?>
176
+ <input type="checkbox" checked="checked" id="ux_show_email_<?php echo $dynamicId; ?>" name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="1">
177
+ <?php
178
+ }
179
+ else
180
+ {
181
+ ?>
182
+ <input type="checkbox" id="ux_show_email_<?php echo $dynamicId; ?>" name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="1">
183
+ <?php
184
+ }
185
+ }
186
+ else
187
+ {
188
+ ?>
189
+ <input type="checkbox" id="ux_show_email_<?php echo $dynamicId; ?>" name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="1">
190
  <?php
191
  }
192
  ?>
193
+ </div>
 
194
  </div>
195
+ <input type="hidden" id="ux_hd_textbox_dynamic_id" name="ux_hd_textbox_dynamic_id" value="<?php echo $dynamicId; ?>"/>
 
 
 
 
 
 
 
196
  </div>
197
  </div>
198
  <div class="layout-control-group">
199
+ <input type="submit" class="btn btn-info layout-span3" value="<?php _e( "Save Settings", contact_bank ); ?>" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
  </div>
201
+ </div>
202
+ </div>
203
+ </form>
204
+ <a class="closeButtonLightbox" onclick="CloseLightbox();"></a>
205
+ <script type="text/javascript">
206
+ jQuery(".hovertip").tooltip_tip({placement: "left"});
207
+ if (typeof(base64_encode) != "function")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
  {
209
+ function base64_encode(data)
210
+ {
211
+ var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
212
+ var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
213
+ ac = 0,
214
+ enc = '',
215
+ tmp_arr = [];
216
+ if (!data)
217
+ {
218
+ return data;
219
+ }
220
+ do
221
+ {
222
+ o1 = data.charCodeAt(i++);
223
+ o2 = data.charCodeAt(i++);
224
+ o3 = data.charCodeAt(i++);
225
+ bits = o1 << 16 | o2 << 8 | o3;
226
+ h1 = bits >> 18 & 0x3f;
227
+ h2 = bits >> 12 & 0x3f;
228
+ h3 = bits >> 6 & 0x3f;
229
+ h4 = bits & 0x3f;
230
+ tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
231
+ }
232
+ while (i < data.length);
233
+ enc = tmp_arr.join('');
234
+ var r = data.length % 3;
235
+ return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
236
+ }
237
+ }
238
+ var dynamicId = "<?php echo $dynamicId; ?>";
239
+ var controlId = "<?php echo $control_id; ?>";
240
+ var form_id = "<?php echo $form_id;?>";
241
+ var options_ddl = [];
242
+ var options_value = [];
243
+ jQuery("#ux_frm_drop_down_control").validate
244
+ ({
245
+ submitHandler: function(form)
246
+ {
247
+ jQuery("#ux_ddl_select_control"+dynamicId).children("option:not(:first)").remove();
248
+ jQuery("#dropdown_ddl_option_"+dynamicId+" option").each(function()
249
+ {
250
+ jQuery("#ux_ddl_select_control"+dynamicId).append("<option value=\""+this.value+"\">"+this.text+"</option>");
251
+ options_ddl.push(this.value);
252
+ options_value.push(this.text);
253
+ });
254
+ jQuery.post(ajaxurl,
255
+ {
256
+ data: base64_encode(jQuery(form).serialize()),
257
+ controlId: controlId,
258
+ form_id: form_id,
259
+ form_settings: JSON.stringify(<?php echo json_encode($form_settings) ?>),
260
+ ddl_options_id: JSON.stringify(options_ddl),
261
+ options_value: JSON.stringify(options_value),
262
+ events: "update",
263
+ param: "save_drop_down_control",
264
+ action: "add_contact_form_library",
265
+ },
266
+ function(data)
267
+ {
268
+ jQuery("#control_label_"+dynamicId).html(jQuery("#ux_label_text_"+dynamicId).val()+" :");
269
+ jQuery("#show_tooltip"+dynamicId).attr("data-original-title",jQuery("#ux_tooltip_control_"+dynamicId).val());
270
+ if(jQuery("#ux_required_control_"+dynamicId).prop("checked") == true)
271
+ {
272
+ jQuery("#control_label_"+dynamicId).append("<span class=\"error_field\">*</span>");
273
+ }
274
+ CloseLightbox();
275
+ });
276
+ }
277
  });
278
+ if (typeof(add_ddl_options) != "function")
279
  {
280
+ function add_ddl_options(dynamicId)
 
 
281
  {
282
+ var ddl_options = jQuery("#ddl_options_"+dynamicId).val();
283
+ if(ddl_options=="")
284
+ {
285
+ alert("<?php _e( "Please Fill an Option.", contact_bank ); ?>");
286
+ }
287
+ else
288
+ {
289
+ var optionsId = Math.floor((Math.random()*10000)+1);
290
+ jQuery("#dropdown_ddl_option_"+dynamicId).append("<option value=\""+optionsId+"\">"+ddl_options+"</option>");
291
+ jQuery("#bind_dropdown_"+dynamicId).css("display","");
292
+ jQuery("#ddl_options_"+dynamicId).val("");
293
+ }
294
  }
295
+ }
296
+ if (typeof(delete_ddl_options) != "function")
297
+ {
298
+ function delete_ddl_options(dynamicId)
299
+ {
300
+ var value = jQuery("#dropdown_ddl_option_"+dynamicId).val();
301
+ jQuery("#dropdown_ddl_option_"+dynamicId+ " option[value=\""+value+"\"]").remove();
302
+ if(jQuery("#dropdown_ddl_option_"+dynamicId).val() == null)
303
+ {
304
+ jQuery("#bind_dropdown_"+dynamicId).css("display","none");
305
+ }
306
+ }
307
+ }
308
+ </script>
309
+ <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
310
  }
311
+ ?>
includes/cb_email.php CHANGED
@@ -10,7 +10,7 @@ switch($cb_role)
10
  case "author":
11
  $cb_user_role_permission = "publish_posts";
12
  break;
13
-
14
  }
15
  if (!current_user_can($cb_user_role_permission))
16
  {
@@ -19,205 +19,247 @@ if (!current_user_can($cb_user_role_permission))
19
  else
20
  {
21
  $form_settings = array();
22
- $control_id = $wpdb->get_var
23
- (
24
- $wpdb->prepare
25
- (
26
- "SELECT control_id FROM " .create_control_Table(). " where form_id= %d and field_id = %d and column_dynamicId = %d",
27
- $form_id,
28
- $field_type,
29
- $dynamicId
30
- )
31
- );
32
- if(count($control_id) != 0)
33
- {
34
- $form_data = $wpdb->get_results
35
  (
36
  $wpdb->prepare
37
  (
38
- "SELECT * FROM " .contact_bank_dynamic_settings_form(). " where dynamicId= %d",
39
- $control_id
 
 
40
  )
41
  );
42
- $form_settings[$dynamicId]["dynamic_id"] = $dynamicId;
43
- $form_settings[$dynamicId]["control_type"] = "1";
44
- for($flag = 0; $flag<count($form_data);$flag++)
45
  {
46
- $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = $form_data[$flag]->dynamic_settings_value;
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  }
48
- }
49
- ?>
50
- <form id="ux_frm_email_control" action="#" method="post" class="layout-form">
51
- <div class="fluid-layout">
52
- <div class="layout-span12">
53
- <div class="widget-layout">
54
- <div class="widget-layout-title">
55
- <h4><?php _e( "Email Address", contact_bank ); ?></h4>
56
- </div>
57
- <div class="widget-layout-body" >
58
- <div class="layout-control-group">
59
- <label class="layout-control-label"><?php _e( "Label", contact_bank ); ?> :</label>
60
- <div class="layout-controls">
61
- <input type="text" onkeyup="enter_admin_label(<?php echo $dynamicId; ?>);"
62
- value="<?php echo isset($form_settings[$dynamicId]["cb_label_value"]) ? $form_settings[$dynamicId]["cb_label_value"] : _e( "Untitled", contact_bank ); ?>"
63
- class="layout-span12" id="ux_label_text_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Label", contact_bank ); ?>"
64
- name="ux_label_text_<?php echo $dynamicId; ?>"/>
65
- </div>
66
- </div>
67
- <div class="layout-control-group">
68
- <label class="layout-control-label"><?php _e("Description", contact_bank); ?> :</label>
69
- <div class="layout-controls">
70
- <textarea class="layout-span12" id="ux_description_control_<?php echo $dynamicId; ?>"
71
- placeholder="<?php _e( "Enter Description", contact_bank ); ?>"
72
- name="ux_description_control_<?php echo $dynamicId; ?>" ><?php echo isset($form_settings[$dynamicId]["cb_description"]) ? $form_settings[$dynamicId]["cb_description"] : ""; ?></textarea>
73
  </div>
74
- </div>
75
- <div class="layout-control-group">
76
- <label class="layout-control-label"><?php _e( "Required", contact_bank ); ?> :</label>
77
- <div class="layout-controls" style="margin-top:7px;">
78
- <?php
79
- if(isset($form_settings[$dynamicId]["cb_control_required"]))
80
- {
81
- if($form_settings[$dynamicId]["cb_control_required"] == "1")
82
- {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  ?>
84
- <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
85
- name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" checked="checked" />
86
- <label style="vertical-align: text-bottom;">
87
- <?php _e( "Required", contact_bank ); ?>
88
- </label>
89
- <input type="radio" id="ux_required_<?php echo $dynamicId; ?>"
90
- name="ux_required_control_radio_<?php echo $dynamicId; ?>" disabled="disabled" value="0"/>
91
- <label style="vertical-align: text-bottom;">
92
- <?php _e( "Not Required", contact_bank ); ?>
93
- </label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  }
96
- else if($form_settings[$dynamicId]["cb_control_required"] == "0")
97
  {
98
  ?>
99
- <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
100
- name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
101
- <label style="vertical-align: text-bottom;">
102
- <?php _e( "Required", contact_bank ); ?>
103
- </label>
104
- <input type="radio" id="ux_required_<?php echo $dynamicId; ?>"
105
- name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0" disabled="disabled" checked="checked" />
106
- <label style="vertical-align: text-bottom;">
107
- <?php _e( "Not Required", contact_bank ); ?>
108
- </label>
109
  <?php
110
  }
111
- }
112
- else
113
- {
114
- ?>
115
- <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
116
- name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
117
- <label style="vertical-align: text-bottom;">
118
- <?php _e( "Required", contact_bank ); ?>
119
- </label>
120
- <input type="radio" id="ux_required_<?php echo $dynamicId; ?>"
121
- name="ux_required_control_radio_<?php echo $dynamicId; ?>" disabled="disabled" value="0" checked="checked" />
122
- <label style="vertical-align: text-bottom;">
123
- <?php _e( "Not Required", contact_bank ); ?>
124
- </label>
125
- <?php
126
- }
127
- ?>
128
- </div>
129
- </div>
130
- <div class="layout-control-group">
131
- <label class="layout-control-label"><?php _e("Tooltip Text", contact_bank); ?> : </label>
132
- <div class="layout-controls">
133
- <input type="text" class="layout-span12" id="ux_tooltip_control_<?php echo $dynamicId; ?>"
134
- placeholder="<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>"
135
- name="ux_tooltip_control_<?php echo $dynamicId; ?>" readonly="readonly"
136
- value="<?php echo isset($form_settings[$dynamicId]["cb_tooltip_txt"]) ? $form_settings[$dynamicId]["cb_tooltip_txt"] : ""; ?>" />
137
- </div>
138
- </div>
139
- <div class="layout-control-group">
140
- <label class="layout-control-label"><?php _e( "Place Holder", contact_bank ); ?> :</label>
141
- <div class="layout-controls">
142
- <input type="text" class="layout-span12" id="ux_default_value_<?php echo $dynamicId; ?>"
143
- placeholder="<?php _e( "Enter Place Holder", contact_bank ); ?>"
144
- name="ux_default_value_<?php echo $dynamicId; ?>"
145
- value="<?php echo isset($form_settings[$dynamicId]["cb_default_txt_val"]) ? $form_settings[$dynamicId]["cb_default_txt_val"] : ""; ?>"/>
146
- </div>
147
- </div>
148
- <div class="layout-control-group">
149
- <label class="layout-control-label"><?php _e( "Admin Label", contact_bank ); ?> : </label>
150
- <div class="layout-controls">
151
- <input type="text" class="layout-span12"
152
- value="<?php echo isset($form_settings[$dynamicId]["cb_admin_label"]) ? $form_settings[$dynamicId]["cb_admin_label"] : _e( "Untitled", contact_bank ); ?>"
153
- id="ux_admin_label_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Admin Label", contact_bank ); ?>"
154
- name="ux_admin_label_<?php echo $dynamicId; ?>" />
155
  </div>
156
  </div>
157
  <div class="layout-control-group">
158
- <label class="layout-control-label"><?php _e( "Do not show in the email", contact_bank ); ?> : </label>
159
- <div class="layout-controls">
160
- <?php
161
- if(isset($form_settings[$dynamicId]["cb_show_email"]))
162
- {
163
- if($form_settings[$dynamicId]["cb_show_email"] == "1")
164
- {
165
- ?>
166
- <input type="checkbox" checked="checked" id="ux_show_email_<?php echo $dynamicId; ?>"
167
- name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="1">
168
- <?php
169
- }
170
- else
171
- {
172
- ?>
173
- <input type="checkbox" id="ux_show_email_<?php echo $dynamicId; ?>"
174
- name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="0">
175
- <?php
176
- }
177
- }
178
- else
179
- {
180
- ?>
181
- <input type="checkbox" id="ux_show_email_<?php echo $dynamicId; ?>"
182
- name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="0">
183
- <?php
184
- }
185
- ?>
186
- </div>
187
  </div>
188
- <input type="hidden" id="ux_hd_textbox_dynamic_id" name="ux_hd_textbox_dynamic_id" value="<?php echo $dynamicId; ?>"/>
189
  </div>
190
  </div>
191
- <div class="layout-control-group">
192
- <input type="submit" class="btn btn-info layout-span3" value="<?php _e( "Save Settings", contact_bank ); ?>" />
193
- </div>
194
- </div>
195
- </div>
196
- </form>
197
- <a class="closeButtonLightbox" onclick="CloseLightbox();"></a>
198
- <script type="text/javascript">
199
- var dynamicId = "<?php echo $dynamicId; ?>";
200
- var controlId = "<?php echo $control_id; ?>";
201
- var form_id = "<?php echo $form_id;?>";
202
- jQuery("#ux_frm_email_control").validate
203
- ({
204
- submitHandler: function(form)
205
- {
206
- jQuery.post(ajaxurl, jQuery(form).serialize() + "&controlId="+controlId+"&form_id="+form_id+"&form_settings="+JSON.stringify(<?php echo json_encode($form_settings) ?>)+"&event=update&param=save_email_control&action=add_contact_form_library", function(data)
207
  {
208
- jQuery("#control_label_"+dynamicId).html(jQuery("#ux_label_text_"+dynamicId).val()+" :");
209
- jQuery("#txt_description_"+dynamicId).html(jQuery("#ux_description_control_"+dynamicId).val());
210
- jQuery("#show_tooltip"+dynamicId).attr("data-original-title",jQuery("#ux_tooltip_control_"+dynamicId).val());
211
- jQuery("#ux_txt_email_"+dynamicId).attr("placeholder",jQuery("#ux_default_value_"+dynamicId).val());
212
- if(jQuery("#ux_required_control_"+dynamicId).prop("checked") == true)
213
  {
214
- jQuery("#control_label_"+dynamicId).append("<span class=\"error\">*</span>");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
215
  }
216
- CloseLightbox();
217
  });
218
- }
219
- });
220
- </script>
221
- <?php
222
  }
223
- ?>
10
  case "author":
11
  $cb_user_role_permission = "publish_posts";
12
  break;
13
+
14
  }
15
  if (!current_user_can($cb_user_role_permission))
16
  {
19
  else
20
  {
21
  $form_settings = array();
22
+ $control_id = $wpdb->get_var
 
 
 
 
 
 
 
 
 
 
 
 
23
  (
24
  $wpdb->prepare
25
  (
26
+ "SELECT control_id FROM " .create_control_Table(). " where form_id= %d and field_id = %d and column_dynamicId = %d",
27
+ $form_id,
28
+ $field_type,
29
+ $dynamicId
30
  )
31
  );
32
+ if(count($control_id) != 0)
 
 
33
  {
34
+ $form_data = $wpdb->get_results
35
+ (
36
+ $wpdb->prepare
37
+ (
38
+ "SELECT * FROM " .contact_bank_dynamic_settings_form(). " where dynamicId= %d",
39
+ $control_id
40
+ )
41
+ );
42
+ $form_settings[$dynamicId]["dynamic_id"] = $dynamicId;
43
+ $form_settings[$dynamicId]["control_type"] = "1";
44
+ for($flag = 0; $flag<count($form_data);$flag++)
45
+ {
46
+ $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = $form_data[$flag]->dynamic_settings_value;
47
+ }
48
  }
49
+ ?>
50
+ <form id="ux_frm_email_control" action="#" method="post" class="layout-form">
51
+ <div class="fluid-layout">
52
+ <div class="layout-span12">
53
+ <div class="widget-layout">
54
+ <div class="widget-layout-title">
55
+ <h4><?php _e( "Email Address", contact_bank ); ?></h4>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  </div>
57
+ <div class="widget-layout-body" >
58
+ <div class="layout-control-group">
59
+ <label class="layout-control-label"><?php _e( "Label", contact_bank ); ?> :</label>
60
+ <div class="layout-controls">
61
+ <input type="text" onkeyup="enter_admin_label(<?php echo $dynamicId; ?>);"
62
+ value="<?php echo isset($form_settings[$dynamicId]["cb_label_value"]) ? $form_settings[$dynamicId]["cb_label_value"] : _e( "Untitled", contact_bank ); ?>"
63
+ class="layout-span12" id="ux_label_text_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Label", contact_bank ); ?>"
64
+ name="ux_label_text_<?php echo $dynamicId; ?>"/>
65
+ </div>
66
+ </div>
67
+ <div class="layout-control-group">
68
+ <label class="layout-control-label"><?php _e("Description", contact_bank); ?> :</label>
69
+ <div class="layout-controls">
70
+ <textarea class="layout-span12" id="ux_description_control_<?php echo $dynamicId; ?>"
71
+ placeholder="<?php _e( "Enter Description", contact_bank ); ?>"
72
+ name="ux_description_control_<?php echo $dynamicId; ?>" ><?php echo isset($form_settings[$dynamicId]["cb_description"]) ? $form_settings[$dynamicId]["cb_description"] : ""; ?></textarea>
73
+ </div>
74
+ </div>
75
+ <div class="layout-control-group">
76
+ <label class="layout-control-label"><?php _e( "Required", contact_bank ); ?> :</label>
77
+ <div class="layout-controls" style="margin-top:7px;">
78
+ <?php
79
+ if(isset($form_settings[$dynamicId]["cb_control_required"]))
80
+ {
81
+ if($form_settings[$dynamicId]["cb_control_required"] == "1")
82
+ {
83
+ ?>
84
+ <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
85
+ name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" checked="checked" />
86
+ <label style="vertical-align: text-bottom;">
87
+ <?php _e( "Required", contact_bank ); ?>
88
+ </label>
89
+ <input type="radio" id="ux_required_<?php echo $dynamicId; ?>"
90
+ name="ux_required_control_radio_<?php echo $dynamicId; ?>" disabled="disabled" value="0"/>
91
+ <label style="vertical-align: text-bottom;">
92
+ <?php _e( "Not Required", contact_bank ); ?>
93
+ </label>
94
+ <?php
95
+ }
96
+ else if($form_settings[$dynamicId]["cb_control_required"] == "0")
97
+ {
98
+ ?>
99
+ <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
100
+ name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
101
+ <label style="vertical-align: text-bottom;">
102
+ <?php _e( "Required", contact_bank ); ?>
103
+ </label>
104
+ <input type="radio" id="ux_required_<?php echo $dynamicId; ?>"
105
+ name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0" disabled="disabled" checked="checked" />
106
+ <label style="vertical-align: text-bottom;">
107
+ <?php _e( "Not Required", contact_bank ); ?>
108
+ </label>
109
+ <?php
110
+ }
111
+ }
112
+ else
113
+ {
114
+ ?>
115
+ <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
116
+ name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
117
+ <label style="vertical-align: text-bottom;">
118
+ <?php _e( "Required", contact_bank ); ?>
119
+ </label>
120
+ <input type="radio" id="ux_required_<?php echo $dynamicId; ?>"
121
+ name="ux_required_control_radio_<?php echo $dynamicId; ?>" disabled="disabled" value="0" checked="checked" />
122
+ <label style="vertical-align: text-bottom;">
123
+ <?php _e( "Not Required", contact_bank ); ?>
124
+ </label>
125
+ <?php
126
+ }
127
  ?>
128
+ </div>
129
+ </div>
130
+ <div class="layout-control-group">
131
+ <label class="layout-control-label"><?php _e("Tooltip Text", contact_bank); ?> : </label>
132
+ <div class="layout-controls">
133
+ <input type="text" class="layout-span12" id="ux_tooltip_control_<?php echo $dynamicId; ?>"
134
+ placeholder="<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>"
135
+ name="ux_tooltip_control_<?php echo $dynamicId; ?>"
136
+ readonly="readonly"/>
137
+ </div>
138
+ </div>
139
+ <div class="layout-control-group">
140
+ <label class="layout-control-label"><?php _e( "Place Holder", contact_bank ); ?> :</label>
141
+ <div class="layout-controls">
142
+ <input type="text" class="layout-span12" id="ux_default_value_<?php echo $dynamicId; ?>"
143
+ placeholder="<?php _e( "Enter Place Holder", contact_bank ); ?>"
144
+ name="ux_default_value_<?php echo $dynamicId; ?>"
145
+ value="<?php echo isset($form_settings[$dynamicId]["cb_default_txt_val"]) ? $form_settings[$dynamicId]["cb_default_txt_val"] : ""; ?>"/>
146
+ </div>
147
+ </div>
148
+ <div class="layout-control-group">
149
+ <label class="layout-control-label"><?php _e( "Admin Label", contact_bank ); ?> : </label>
150
+ <div class="layout-controls">
151
+ <input type="text" class="layout-span12"
152
+ value="<?php echo isset($form_settings[$dynamicId]["cb_admin_label"]) ? $form_settings[$dynamicId]["cb_admin_label"] : _e( "Untitled", contact_bank ); ?>"
153
+ id="ux_admin_label_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Admin Label", contact_bank ); ?>"
154
+ name="ux_admin_label_<?php echo $dynamicId; ?>" />
155
+ </div>
156
+ </div>
157
+ <div class="layout-control-group">
158
+ <label class="layout-control-label"><?php _e( "Do not show in the email", contact_bank ); ?> : </label>
159
+ <div class="layout-controls">
160
  <?php
161
+ if(isset($form_settings[$dynamicId]["cb_show_email"]))
162
+ {
163
+ if($form_settings[$dynamicId]["cb_show_email"] == "1")
164
+ {
165
+ ?>
166
+ <input type="checkbox" checked="checked" id="ux_show_email_<?php echo $dynamicId; ?>"
167
+ name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="1">
168
+ <?php
169
+ }
170
+ else
171
+ {
172
+ ?>
173
+ <input type="checkbox" id="ux_show_email_<?php echo $dynamicId; ?>"
174
+ name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="0">
175
+ <?php
176
+ }
177
  }
178
+ else
179
  {
180
  ?>
181
+ <input type="checkbox" id="ux_show_email_<?php echo $dynamicId; ?>"
182
+ name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="0">
 
 
 
 
 
 
 
 
183
  <?php
184
  }
185
+ ?>
186
+ </div>
187
+ </div>
188
+ <input type="hidden" id="ux_hd_textbox_dynamic_id" name="ux_hd_textbox_dynamic_id" value="<?php echo $dynamicId; ?>"/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
189
  </div>
190
  </div>
191
  <div class="layout-control-group">
192
+ <input type="submit" class="btn btn-info layout-span3" value="<?php _e( "Save Settings", contact_bank ); ?>" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
  </div>
 
194
  </div>
195
  </div>
196
+ </form>
197
+ <a class="closeButtonLightbox" onclick="CloseLightbox();"></a>
198
+ <script type="text/javascript">
199
+ jQuery(".hovertip").tooltip_tip({placement: "left"});
200
+ if (typeof(base64_encode) != "function")
 
 
 
 
 
 
 
 
 
 
 
201
  {
202
+ function base64_encode(data)
 
 
 
 
203
  {
204
+ var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
205
+ var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
206
+ ac = 0,
207
+ enc = '',
208
+ tmp_arr = [];
209
+ if (!data)
210
+ {
211
+ return data;
212
+ }
213
+ do
214
+ {
215
+ o1 = data.charCodeAt(i++);
216
+ o2 = data.charCodeAt(i++);
217
+ o3 = data.charCodeAt(i++);
218
+ bits = o1 << 16 | o2 << 8 | o3;
219
+ h1 = bits >> 18 & 0x3f;
220
+ h2 = bits >> 12 & 0x3f;
221
+ h3 = bits >> 6 & 0x3f;
222
+ h4 = bits & 0x3f;
223
+ tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
224
+ }
225
+ while (i < data.length);
226
+ enc = tmp_arr.join('');
227
+ var r = data.length % 3;
228
+ return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
229
+ }
230
+ }
231
+ var dynamicId = "<?php echo $dynamicId; ?>";
232
+ var controlId = "<?php echo $control_id; ?>";
233
+ var form_id = "<?php echo $form_id;?>";
234
+ jQuery("#ux_frm_email_control").validate
235
+ ({
236
+ submitHandler: function(form)
237
+ {
238
+ jQuery.post(ajaxurl,
239
+ {
240
+ data: base64_encode(jQuery(form).serialize()),
241
+ controlId: controlId,
242
+ form_id: form_id,
243
+ form_settings: JSON.stringify(<?php echo json_encode($form_settings) ?>),
244
+ events: "update",
245
+ param: "save_email_control",
246
+ action: "add_contact_form_library",
247
+ },
248
+ function(data)
249
+ {
250
+ jQuery("#control_label_"+dynamicId).html(jQuery("#ux_label_text_"+dynamicId).val()+" :");
251
+ jQuery("#txt_description_"+dynamicId).html(jQuery("#ux_description_control_"+dynamicId).val());
252
+ jQuery("#show_tooltip"+dynamicId).attr("data-original-title",jQuery("#ux_tooltip_control_"+dynamicId).val());
253
+ jQuery("#ux_txt_email_"+dynamicId).attr("placeholder",jQuery("#ux_default_value_"+dynamicId).val());
254
+ if(jQuery("#ux_required_control_"+dynamicId).prop("checked") == true)
255
+ {
256
+ jQuery("#control_label_"+dynamicId).append("<span class=\"error_field\">*</span>");
257
+ }
258
+ CloseLightbox();
259
+ });
260
  }
 
261
  });
262
+ </script>
263
+ <?php
 
 
264
  }
265
+ ?>
includes/cb_multiple.php CHANGED
@@ -10,7 +10,7 @@ switch($cb_role)
10
  case "author":
11
  $cb_user_role_permission = "publish_posts";
12
  break;
13
-
14
  }
15
  if (!current_user_can($cb_user_role_permission))
16
  {
@@ -19,274 +19,324 @@ if (!current_user_can($cb_user_role_permission))
19
  else
20
  {
21
  $form_settings = array();
22
- $control_id = $wpdb->get_var
23
- (
24
- $wpdb->prepare
25
- (
26
- "SELECT control_id FROM " .create_control_Table(). " where form_id= %d and field_id = %d and column_dynamicId = %d",
27
- $form_id,
28
- $field_type,
29
- $dynamicId
30
- )
31
- );
32
- if(count($control_id) != 0)
33
- {
34
- $form_data = $wpdb->get_results
35
  (
36
  $wpdb->prepare
37
  (
38
- "SELECT * FROM " .contact_bank_dynamic_settings_form(). " where dynamicId= %d",
39
- $control_id
 
 
40
  )
41
  );
42
- $form_settings[$dynamicId]["dynamic_id"] = $dynamicId;
43
- $form_settings[$dynamicId]["control_type"] = $control_id;
44
- for($flag = 0; $flag<count($form_data);$flag++)
45
  {
46
- $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = $form_data[$flag]->dynamic_settings_value;
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  }
48
- }
49
- ?>
50
- <form id="ux_frm_radio_button_control" action="#" method="post" class="layout-form">
51
- <div class="fluid-layout">
52
- <div class="layout-span12">
53
- <div class="widget-layout">
54
- <div class="widget-layout-title">
55
- <h4><?php _e("Radio Buttons", contact_bank ); ?></h4>
56
- </div>
57
- <div class="widget-layout-body">
58
- <div class="layout-control-group">
59
- <label class="layout-control-label"><?php _e( "Label", contact_bank ); ?> :</label>
60
- <div class="layout-controls">
61
- <input type="text" class="layout-span12" id="ux_label_text_<?php echo $dynamicId; ?>"
62
- onkeyup="enter_admin_label(<?php echo $dynamicId; ?>);"
63
- value="<?php echo isset($form_settings[$dynamicId]["cb_label_value"]) ? $form_settings[$dynamicId]["cb_label_value"] : _e( "Untitled", contact_bank ); ?>"
64
- placeholder="<?php _e( "Enter Label", contact_bank ); ?>" name="ux_label_text_<?php echo $dynamicId; ?>" />
65
  </div>
66
- </div>
67
- <div class="layout-control-group">
68
- <label class="layout-control-label"><?php _e("Required", contact_bank); ?> :</label>
69
- <div class="layout-controls" style="margin-top:7px;">
70
- <?php
71
- if(isset($form_settings[$dynamicId]["cb_control_required"]))
72
- {
73
- if($form_settings[$dynamicId]["cb_control_required"] == "1")
74
- {
75
- ?>
76
- <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
77
- name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" checked="checked" />
78
- <label style="vertical-align: text-bottom;">
79
- <?php _e( "Required", contact_bank ); ?>
80
- </label>
81
- <input type="radio" id="ux_required_<?php echo $dynamicId; ?>"
82
- name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0"/>
83
- <label style="vertical-align: text-bottom;">
84
- <?php _e( "Not Required", contact_bank ); ?>
85
- </label>
86
- <?php
87
- }
88
- else if($form_settings[$dynamicId]["cb_control_required"] == "0")
89
- {
90
- ?>
91
- <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
92
- name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
93
- <label style="vertical-align: text-bottom;">
94
- <?php _e( "Required", contact_bank ); ?>
95
- </label>
96
- <input type="radio" id="ux_required_<?php echo $dynamicId; ?>"
97
- name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0" checked="checked" />
98
- <label style="vertical-align: text-bottom;">
99
- <?php _e( "Not Required", contact_bank ); ?>
100
- </label>
101
- <?php
102
- }
103
- }
104
- else
105
- {
106
- ?>
107
- <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
108
- name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
109
- <label style="vertical-align: text-bottom;">
110
- <?php _e( "Required", contact_bank ); ?>
111
- </label>
112
- <input type="radio" id="ux_required_<?php echo $dynamicId; ?>" checked="checked"
113
- name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0" />
114
- <label style="vertical-align: text-bottom;">
115
- <?php _e( "Not Required", contact_bank ); ?>
116
- </label>
117
- <?php
118
- }
119
- ?>
120
- </div>
121
- </div>
122
- <div class="layout-control-group">
123
- <label class="layout-control-label"><?php _e("Tooltip Text", contact_bank); ?> :</label>
124
- <div class="layout-controls">
125
- <input type="text" class="layout-span12" id="ux_tooltip_control_<?php echo $dynamicId; ?>"
126
- name="ux_tooltip_control_<?php echo $dynamicId; ?>" readonly="readonly"
127
- placeholder="<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>"
128
- value="<?php echo isset($form_settings[$dynamicId]["cb_tooltip_txt"]) ? $form_settings[$dynamicId]["cb_tooltip_txt"] : ""; ?>"/>
129
- </div>
130
- </div>
131
- <div class="layout-control-group" >
132
- <label class="layout-control-label"><?php _e("Options", contact_bank); ?> :</label>
133
- <div class="layout-controls">
134
- <input type="text" class="layout-span9"
135
- id="radio_options_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Option", contact_bank ); ?>"
136
- name="radio_options_<?php echo $dynamicId; ?>" />
137
- <input class="btn btn-info layout-span2" style="margin-left: 10px;"
138
- value="<?php _e( "Add", contact_bank ); ?>" type="button"
139
- id="radio_options_button_<?php echo $dynamicId; ?>"
140
- onclick="add_rdl_options(<?php echo $dynamicId; ?>);"/>
141
-
142
- </div>
143
- </div>
144
- <?php
145
- if(isset($form_settings[$dynamicId]["cb_radio_option_id"]) && isset($form_settings[$dynamicId]["cb_radio_option_val"]))
146
- {
147
- $options_value = unserialize($form_settings[$dynamicId]["cb_radio_option_val"]);
148
- if(count($options_value) > 0)
149
- {
150
- ?>
151
- <div class="layout-control-group" style="overflow: hidden;max-height: 110px;" id="bind_dropdown_<?php echo $dynamicId; ?>">
152
- <?php
153
- }
154
- else
155
- {
156
- ?>
157
- <div class="layout-control-group" style="overflow: hidden;max-height: 110px;display:none" id="bind_dropdown_<?php echo $dynamicId; ?>">
158
- <?php
159
- }
160
- ?>
161
- <div class="layout-controls">
162
- <select id="dropdown_ddl_option_<?php echo $dynamicId; ?>" class="layout-span9">
163
  <?php
164
- foreach(unserialize($form_settings[$dynamicId]["cb_radio_option_id"]) as $key => $value )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  {
166
  ?>
167
- <option value="<?php echo $value; ?>"><?php echo $options_value[$key]; ?></option>
 
 
 
 
 
 
 
 
 
168
  <?php
169
  }
170
  ?>
171
- </select>
172
- <input class="btn btn-info layout-span2" style="margin-left:10px;" value="<?php _e( "Delete", contact_bank ); ?>" type="button" id="ddl_options_btn_del_<?php echo $dynamicId; ?>" onclick="delete_rdl_options(<?php echo $dynamicId; ?>);" name="ddl_options_btn_del_<?php echo $dynamicId; ?>" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
  </div>
174
- </div>
175
- <?php
176
- }
177
- ?>
178
- <div class="layout-control-group">
179
- <label class="layout-control-label"><?php _e( "Admin Label", contact_bank ); ?> :</label>
180
- <div class="layout-controls">
181
- <input type="text" class="layout-span12" id="ux_admin_label_<?php echo $dynamicId; ?>" name="ux_admin_label_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Admin Label", contact_bank ); ?>" value="<?php echo isset($form_settings[$dynamicId]["cb_admin_label"]) ? $form_settings[$dynamicId]["cb_admin_label"] : _e( "Untitled", contact_bank ); ?>"/>
182
- </div>
183
- </div>
184
- <div class="layout-control-group">
185
- <label class="layout-control-label"><?php _e( "Do not show in the email", contact_bank ); ?> :</label>
186
- <div class="layout-controls" style="margin-top:10px;">
187
  <?php
188
- if(isset($form_settings[$dynamicId]["cb_show_email"]))
189
  {
190
- if($form_settings[$dynamicId]["cb_show_email"] == "1")
 
191
  {
192
- ?>
193
- <input type="checkbox" checked="checked" id="ux_show_email_<?php echo $dynamicId; ?>"
194
- name="ux_show_email_<?php echo $dynamicId; ?>" value="1">
195
  <?php
196
  }
197
  else
198
  {
199
- ?>
200
- <input type="checkbox" id="ux_show_email_<?php echo $dynamicId; ?>"
201
- name="ux_show_email_<?php echo $dynamicId; ?>" value="0">
202
- <?php
203
  }
204
- }
205
- else
206
- {
207
  ?>
208
- <input type="checkbox" id="ux_show_email_<?php echo $dynamicId; ?>"
209
- name="ux_show_email_<?php echo $dynamicId; ?>" value="0">
 
 
 
 
 
 
 
 
 
 
 
 
210
  <?php
211
  }
212
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  </div>
214
  </div>
215
- <input type="hidden" id="ux_hd_textbox_dynamic_id" name="ux_hd_textbox_dynamic_id" value="<?php echo $dynamicId; ?>"/>
 
216
  </div>
217
  </div>
218
- <div class="layout-control-group">
219
- <input type="submit" class="btn btn-info layout-span3" value="<?php _e( "Save Settings", contact_bank ); ?>" />
220
- </div>
221
  </div>
222
- </div>
223
- </div>
224
- </form>
225
- <a class="closeButtonLightbox" onclick="CloseLightbox();"></a>
226
- <script type="text/javascript">
227
-
228
- var dynamicId = "<?php echo $dynamicId; ?>";
229
- var controlId = "<?php echo $control_id; ?>";
230
- var form_id = "<?php echo $form_id;?>";
231
- var options_ddl = [];
232
- var options_value = [];
233
- jQuery("#ux_frm_radio_button_control").validate
234
- ({
235
- submitHandler: function(form)
236
- {
237
- if(jQuery("#dropdown_ddl_option_"+dynamicId).val() != null)
238
  {
239
- jQuery("#ux_radio_button_control_"+dynamicId).hide();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
  }
241
- else
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  {
243
- jQuery("#ux_radio_button_control_"+dynamicId).show();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
244
  }
245
- jQuery("#add_radio_options_here_"+dynamicId).empty();
246
- jQuery("#dropdown_ddl_option_"+dynamicId+" option").each(function()
247
  {
248
- jQuery("#add_radio_options_here_"+dynamicId).append("<span id=\"input_id_"+this.value+"\"><input id=\"ux_radio_button_control_"+this.value+"\" name=\"ux_radio"+dynamicId+"\" type=\"radio\"/><label class=\"rdl\">"+this.text+"</label></span>");
249
- options_ddl.push(this.value);
250
- options_value.push(this.text);
251
- jQuery("input[name=ux_radio"+dynamicId+"]:first").attr("checked","checked");
252
- });
253
- jQuery.post(ajaxurl, jQuery(form).serialize() + "&controlId="+controlId+"&form_id="+form_id+"&form_settings="+JSON.stringify(<?php echo json_encode($form_settings) ?>)+"&ddl_options_id="+JSON.stringify(options_ddl)+"&options_value="+encodeURIComponent(JSON.stringify(options_value))+"&event=update&param=save_multiple_control&action=add_contact_form_library", function(data)
254
- {
255
- jQuery("#control_label_"+dynamicId).html(jQuery("#ux_label_text_"+dynamicId).val()+" :");
256
- jQuery("#post_back_radio_button_"+dynamicId).attr("data-original-title",jQuery("#ux_tooltip_control_"+dynamicId).val());
257
- if(jQuery("#ux_required_control_"+dynamicId).prop("checked") == true)
258
  {
259
- jQuery("#control_label_"+dynamicId).append("<span class=\"error\">*</span>");
 
 
 
 
 
260
  }
261
- CloseLightbox();
262
- });
263
- }
264
- });
265
- function add_rdl_options(dynamicId)
266
- {
267
- var ddl_options = jQuery("#radio_options_"+dynamicId).val();
268
- if(ddl_options=="")
269
- {
270
- alert("<?php _e( "Please Fill an Option.", contact_bank ); ?>");
271
- }
272
- else
273
- {
274
- var optionsId = Math.floor((Math.random()*10000)+1);
275
- jQuery("#dropdown_ddl_option_"+dynamicId).append("<option value=\""+optionsId+"\">"+ddl_options+"</option>");
276
- jQuery("#bind_dropdown_"+dynamicId).css("display","");
277
- jQuery("#radio_options_"+dynamicId).val("");
278
- }
279
- }
280
- function delete_rdl_options(dynamicId)
281
- {
282
- var value = jQuery("#dropdown_ddl_option_"+dynamicId).val();
283
- jQuery("#dropdown_ddl_option_"+dynamicId+ " option[value=\""+value+"\"]").remove();
284
- if(jQuery("#dropdown_ddl_option_"+dynamicId).val() == null)
285
- {
286
- jQuery("#bind_dropdown_"+dynamicId).css("display","none");
287
- }
288
- }
289
- </script>
290
- <?php
291
  }
292
- ?>
10
  case "author":
11
  $cb_user_role_permission = "publish_posts";
12
  break;
13
+
14
  }
15
  if (!current_user_can($cb_user_role_permission))
16
  {
19
  else
20
  {
21
  $form_settings = array();
22
+ $control_id = $wpdb->get_var
 
 
 
 
 
 
 
 
 
 
 
 
23
  (
24
  $wpdb->prepare
25
  (
26
+ "SELECT control_id FROM " .create_control_Table(). " where form_id= %d and field_id = %d and column_dynamicId = %d",
27
+ $form_id,
28
+ $field_type,
29
+ $dynamicId
30
  )
31
  );
32
+ if(count($control_id) != 0)
 
 
33
  {
34
+ $form_data = $wpdb->get_results
35
+ (
36
+ $wpdb->prepare
37
+ (
38
+ "SELECT * FROM " .contact_bank_dynamic_settings_form(). " where dynamicId= %d",
39
+ $control_id
40
+ )
41
+ );
42
+ $form_settings[$dynamicId]["dynamic_id"] = $dynamicId;
43
+ $form_settings[$dynamicId]["control_type"] = $control_id;
44
+ for($flag = 0; $flag<count($form_data);$flag++)
45
+ {
46
+ $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = $form_data[$flag]->dynamic_settings_value;
47
+ }
48
  }
49
+ ?>
50
+ <form id="ux_frm_radio_button_control" action="#" method="post" class="layout-form">
51
+ <div class="fluid-layout">
52
+ <div class="layout-span12">
53
+ <div class="widget-layout">
54
+ <div class="widget-layout-title">
55
+ <h4><?php _e("Radio Buttons", contact_bank ); ?></h4>
 
 
 
 
 
 
 
 
 
 
56
  </div>
57
+ <div class="widget-layout-body">
58
+ <div class="layout-control-group">
59
+ <label class="layout-control-label"><?php _e( "Label", contact_bank ); ?> :</label>
60
+ <div class="layout-controls">
61
+ <input type="text" class="layout-span12" id="ux_label_text_<?php echo $dynamicId; ?>"
62
+ onkeyup="enter_admin_label(<?php echo $dynamicId; ?>);"
63
+ value="<?php echo isset($form_settings[$dynamicId]["cb_label_value"]) ? $form_settings[$dynamicId]["cb_label_value"] : _e( "Untitled", contact_bank ); ?>"
64
+ placeholder="<?php _e( "Enter Label", contact_bank ); ?>" name="ux_label_text_<?php echo $dynamicId; ?>" />
65
+ </div>
66
+ </div>
67
+ <div class="layout-control-group">
68
+ <label class="layout-control-label"><?php _e("Required", contact_bank); ?> :</label>
69
+ <div class="layout-controls" style="margin-top:7px;">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  <?php
71
+ if(isset($form_settings[$dynamicId]["cb_control_required"]))
72
+ {
73
+ if($form_settings[$dynamicId]["cb_control_required"] == "1")
74
+ {
75
+ ?>
76
+ <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
77
+ name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" checked="checked" />
78
+ <label style="vertical-align: text-bottom;">
79
+ <?php _e( "Required", contact_bank ); ?>
80
+ </label>
81
+ <input type="radio" id="ux_required_<?php echo $dynamicId; ?>"
82
+ name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0"/>
83
+ <label style="vertical-align: text-bottom;">
84
+ <?php _e( "Not Required", contact_bank ); ?>
85
+ </label>
86
+ <?php
87
+ }
88
+ else if($form_settings[$dynamicId]["cb_control_required"] == "0")
89
+ {
90
+ ?>
91
+ <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
92
+ name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
93
+ <label style="vertical-align: text-bottom;">
94
+ <?php _e( "Required", contact_bank ); ?>
95
+ </label>
96
+ <input type="radio" id="ux_required_<?php echo $dynamicId; ?>"
97
+ name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0" checked="checked" />
98
+ <label style="vertical-align: text-bottom;">
99
+ <?php _e( "Not Required", contact_bank ); ?>
100
+ </label>
101
+ <?php
102
+ }
103
+ }
104
+ else
105
  {
106
  ?>
107
+ <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
108
+ name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
109
+ <label style="vertical-align: text-bottom;">
110
+ <?php _e( "Required", contact_bank ); ?>
111
+ </label>
112
+ <input type="radio" id="ux_required_<?php echo $dynamicId; ?>" checked="checked"
113
+ name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0" />
114
+ <label style="vertical-align: text-bottom;">
115
+ <?php _e( "Not Required", contact_bank ); ?>
116
+ </label>
117
  <?php
118
  }
119
  ?>
120
+ </div>
121
+ </div>
122
+ <div class="layout-control-group">
123
+ <label class="layout-control-label"><?php _e("Tooltip Text", contact_bank); ?> :</label>
124
+ <div class="layout-controls">
125
+ <input type="text" class="layout-span12" id="ux_tooltip_control_<?php echo $dynamicId; ?>"
126
+ name="ux_tooltip_control_<?php echo $dynamicId; ?>"
127
+ placeholder="<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>"
128
+ readonly="readonly"/>
129
+ </div>
130
+ </div>
131
+ <div class="layout-control-group" >
132
+ <label class="layout-control-label"><?php _e("Options", contact_bank); ?> :</label>
133
+ <div class="layout-controls">
134
+ <input type="text" class="layout-span9"
135
+ id="radio_options_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Option", contact_bank ); ?>"
136
+ name="radio_options_<?php echo $dynamicId; ?>" />
137
+ <input class="btn btn-info layout-span2" style="margin-left: 10px;"
138
+ value="<?php _e( "Add", contact_bank ); ?>" type="button"
139
+ id="radio_options_button_<?php echo $dynamicId; ?>"
140
+ onclick="add_rdl_options(<?php echo $dynamicId; ?>);"/>
141
+
142
+ </div>
143
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  <?php
145
+ if(isset($form_settings[$dynamicId]["cb_radio_option_id"]) && isset($form_settings[$dynamicId]["cb_radio_option_val"]))
146
  {
147
+ $options_value = unserialize($form_settings[$dynamicId]["cb_radio_option_val"]);
148
+ if(count($options_value) > 0)
149
  {
150
+ ?>
151
+ <div class="layout-control-group" style="overflow: hidden;max-height: 110px;" id="bind_dropdown_<?php echo $dynamicId; ?>">
 
152
  <?php
153
  }
154
  else
155
  {
156
+ ?>
157
+ <div class="layout-control-group" style="overflow: hidden;max-height: 110px;display:none" id="bind_dropdown_<?php echo $dynamicId; ?>">
158
+ <?php
 
159
  }
 
 
 
160
  ?>
161
+ <div class="layout-controls">
162
+ <select id="dropdown_ddl_option_<?php echo $dynamicId; ?>" class="layout-span9">
163
+ <?php
164
+ foreach(unserialize($form_settings[$dynamicId]["cb_radio_option_id"]) as $key => $value )
165
+ {
166
+ ?>
167
+ <option value="<?php echo $value; ?>"><?php echo $options_value[$key]; ?></option>
168
+ <?php
169
+ }
170
+ ?>
171
+ </select>
172
+ <input class="btn btn-info layout-span2" style="margin-left:10px;" value="<?php _e( "Delete", contact_bank ); ?>" type="button" id="ddl_options_btn_del_<?php echo $dynamicId; ?>" onclick="delete_rdl_options(<?php echo $dynamicId; ?>);" name="ddl_options_btn_del_<?php echo $dynamicId; ?>" />
173
+ </div>
174
+ </div>
175
  <?php
176
  }
177
  ?>
178
+ <div class="layout-control-group">
179
+ <label class="layout-control-label"><?php _e( "Admin Label", contact_bank ); ?> :</label>
180
+ <div class="layout-controls">
181
+ <input type="text" class="layout-span12" id="ux_admin_label_<?php echo $dynamicId; ?>"
182
+ name="ux_admin_label_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Admin Label", contact_bank ); ?>"
183
+ value="<?php echo isset($form_settings[$dynamicId]["cb_admin_label"]) ? $form_settings[$dynamicId]["cb_admin_label"] : _e( "Untitled", contact_bank ); ?>"/>
184
+ </div>
185
+ </div>
186
+ <div class="layout-control-group">
187
+ <label class="layout-control-label"><?php _e( "Do not show in the email", contact_bank ); ?> :</label>
188
+ <div class="layout-controls" style="margin-top:10px;">
189
+ <?php
190
+ if(isset($form_settings[$dynamicId]["cb_show_email"]))
191
+ {
192
+ if($form_settings[$dynamicId]["cb_show_email"] == "1")
193
+ {
194
+ ?>
195
+ <input type="checkbox" checked="checked" id="ux_show_email_<?php echo $dynamicId; ?>"
196
+ name="ux_show_email_<?php echo $dynamicId; ?>" value="1">
197
+ <?php
198
+ }
199
+ else
200
+ {
201
+ ?>
202
+ <input type="checkbox" id="ux_show_email_<?php echo $dynamicId; ?>"
203
+ name="ux_show_email_<?php echo $dynamicId; ?>" value="0">
204
+ <?php
205
+ }
206
+ }
207
+ else
208
+ {
209
+ ?>
210
+ <input type="checkbox" id="ux_show_email_<?php echo $dynamicId; ?>"
211
+ name="ux_show_email_<?php echo $dynamicId; ?>" value="0">
212
+ <?php
213
+ }
214
+ ?>
215
+ </div>
216
+ </div>
217
+ <input type="hidden" id="ux_hd_textbox_dynamic_id" name="ux_hd_textbox_dynamic_id" value="<?php echo $dynamicId; ?>"/>
218
  </div>
219
  </div>
220
+ <div class="layout-control-group">
221
+ <input type="submit" class="btn btn-info layout-span3" value="<?php _e( "Save Settings", contact_bank ); ?>" />
222
  </div>
223
  </div>
 
 
 
224
  </div>
225
+ </form>
226
+ <a class="closeButtonLightbox" onclick="CloseLightbox();"></a>
227
+ <script type="text/javascript">
228
+ jQuery(".hovertip").tooltip_tip({placement: "left"});
229
+ if (typeof(base64_encode) != "function")
 
 
 
 
 
 
 
 
 
 
 
230
  {
231
+ function base64_encode(data)
232
+ {
233
+ var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
234
+ var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
235
+ ac = 0,
236
+ enc = '',
237
+ tmp_arr = [];
238
+ if (!data)
239
+ {
240
+ return data;
241
+ }
242
+ do
243
+ {
244
+ o1 = data.charCodeAt(i++);
245
+ o2 = data.charCodeAt(i++);
246
+ o3 = data.charCodeAt(i++);
247
+ bits = o1 << 16 | o2 << 8 | o3;
248
+ h1 = bits >> 18 & 0x3f;
249
+ h2 = bits >> 12 & 0x3f;
250
+ h3 = bits >> 6 & 0x3f;
251
+ h4 = bits & 0x3f;
252
+ tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
253
+ }
254
+ while (i < data.length);
255
+ enc = tmp_arr.join('');
256
+ var r = data.length % 3;
257
+ return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
258
+ }
259
  }
260
+ var dynamicId = "<?php echo $dynamicId; ?>";
261
+ var controlId = "<?php echo $control_id; ?>";
262
+ var form_id = "<?php echo $form_id;?>";
263
+ var options_ddl = [];
264
+ var options_value = [];
265
+ jQuery("#ux_frm_radio_button_control").validate
266
+ ({
267
+ submitHandler: function(form)
268
+ {
269
+ if(jQuery("#dropdown_ddl_option_"+dynamicId).val() != null)
270
+ {
271
+ jQuery("#ux_radio_button_control_"+dynamicId).hide();
272
+ }
273
+ else
274
+ {
275
+ jQuery("#ux_radio_button_control_"+dynamicId).show();
276
+ }
277
+ jQuery("#add_radio_options_here_"+dynamicId).empty();
278
+ jQuery("#dropdown_ddl_option_"+dynamicId+" option").each(function()
279
+ {
280
+ jQuery("#add_radio_options_here_"+dynamicId).append("<span id=\"input_id_"+this.value+"\"><input id=\"ux_radio_button_control_"+this.value+"\" name=\"ux_radio"+dynamicId+"\" type=\"radio\"/><label class=\"rdl\">"+this.text+"</label></span>");
281
+ options_ddl.push(this.value);
282
+ options_value.push(this.text);
283
+ jQuery("input[name=ux_radio"+dynamicId+"]:first").attr("checked","checked");
284
+ });
285
+ jQuery.post(ajaxurl,
286
+ {
287
+ data: base64_encode(jQuery(form).serialize()),
288
+ controlId: controlId,
289
+ form_id: form_id,
290
+ form_settings: JSON.stringify(<?php echo json_encode($form_settings) ?>),
291
+ ddl_options_id: JSON.stringify(options_ddl),
292
+ options_value: JSON.stringify(options_value),
293
+ events: "update",
294
+ param: "save_multiple_control",
295
+ action: "add_contact_form_library",
296
+ },
297
+ function(data)
298
+ {
299
+ jQuery("#control_label_"+dynamicId).html(jQuery("#ux_label_text_"+dynamicId).val()+" :");
300
+ jQuery("#post_back_radio_button_"+dynamicId).attr("data-original-title",jQuery("#ux_tooltip_control_"+dynamicId).val());
301
+ if(jQuery("#ux_required_control_"+dynamicId).prop("checked") == true)
302
+ {
303
+ jQuery("#control_label_"+dynamicId).append("<span class=\"error_field\">*</span>");
304
+ }
305
+ CloseLightbox();
306
+ });
307
+ }
308
+ });
309
+ if (typeof(add_rdl_options) != "function")
310
  {
311
+ function add_rdl_options(dynamicId)
312
+ {
313
+ var ddl_options = jQuery("#radio_options_"+dynamicId).val();
314
+ if(ddl_options=="")
315
+ {
316
+ alert("<?php _e( "Please Fill an Option.", contact_bank ); ?>");
317
+ }
318
+ else
319
+ {
320
+ var optionsId = Math.floor((Math.random()*10000)+1);
321
+ jQuery("#dropdown_ddl_option_"+dynamicId).append("<option value=\""+optionsId+"\">"+ddl_options+"</option>");
322
+ jQuery("#bind_dropdown_"+dynamicId).css("display","");
323
+ jQuery("#radio_options_"+dynamicId).val("");
324
+ }
325
+ }
326
  }
327
+ if (typeof(delete_rdl_options) != "function")
 
328
  {
329
+ function delete_rdl_options(dynamicId)
 
 
 
 
 
 
 
 
 
330
  {
331
+ var value = jQuery("#dropdown_ddl_option_"+dynamicId).val();
332
+ jQuery("#dropdown_ddl_option_"+dynamicId+ " option[value=\""+value+"\"]").remove();
333
+ if(jQuery("#dropdown_ddl_option_"+dynamicId).val() == null)
334
+ {
335
+ jQuery("#bind_dropdown_"+dynamicId).css("display","none");
336
+ }
337
  }
338
+ }
339
+ </script>
340
+ <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
341
  }
342
+ ?>
includes/cb_text.php CHANGED
@@ -10,7 +10,7 @@ switch($cb_role)
10
  case "author":
11
  $cb_user_role_permission = "publish_posts";
12
  break;
13
-
14
  }
15
  if (!current_user_can($cb_user_role_permission))
16
  {
@@ -19,237 +19,278 @@ if (!current_user_can($cb_user_role_permission))
19
  else
20
  {
21
  $form_settings = array();
22
- $control_id = $wpdb->get_var
23
- (
24
- $wpdb->prepare
25
- (
26
- "SELECT control_id FROM " .create_control_Table(). " where form_id= %d and field_id = %d and column_dynamicId = %d",
27
- $form_id,
28
- $field_type,
29
- $dynamicId
30
- )
31
- );
32
- if(count($control_id) != 0)
33
- {
34
- $form_data = $wpdb->get_results
35
  (
36
  $wpdb->prepare
37
  (
38
- "SELECT * FROM " .contact_bank_dynamic_settings_form(). " where dynamicId= %d",
39
- $control_id
 
 
40
  )
41
  );
42
- $form_settings[$dynamicId]["dynamic_id"] = $dynamicId;
43
- $form_settings[$dynamicId]["control_type"] = "1";
44
- for($flag = 0; $flag<count($form_data);$flag++)
45
  {
46
- $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = $form_data[$flag]->dynamic_settings_value;
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  }
48
- }
49
- ?>
50
- <form id="ux_frm_text_box_control" action="#" method="post" class="layout-form">
51
- <div class="fluid-layout">
52
- <div class="layout-span12">
53
- <div class="widget-layout">
54
- <div class="widget-layout-title">
55
- <h4><?php _e( "Single Line Text", contact_bank ); ?></h4>
56
- </div>
57
- <div class="widget-layout-body">
58
- <div class="layout-control-group">
59
- <label class="layout-control-label"><?php _e( "Label", contact_bank ); ?> :</label>
60
- <div class="layout-controls">
61
- <input type="text" class="layout-span12" onkeyup="enter_admin_label(<?php echo $dynamicId; ?>);"
62
- value="<?php echo isset($form_settings[$dynamicId]["cb_label_value"]) ? strip_tags($form_settings[$dynamicId]["cb_label_value"]) : _e( "Untitled", contact_bank ); ?>"
63
- id="ux_label_text_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Label", contact_bank ); ?>" name="ux_label_text_<?php echo $dynamicId; ?>" />
64
  </div>
65
- </div>
66
- <div class="layout-control-group">
67
- <label class="layout-control-label"><?php _e( "Description", contact_bank ); ?> :</label>
68
- <div class="layout-controls">
69
- <textarea id="ux_description_control_<?php echo $dynamicId; ?>" class="layout-span12"
70
- placeholder="<?php _e( "Enter Description", contact_bank ); ?>"
71
- name="ux_description_control_<?php echo $dynamicId; ?>"><?php echo isset($form_settings[$dynamicId]["cb_description"]) ? $form_settings[$dynamicId]["cb_description"] : ""; ?></textarea>
72
- </div>
73
- </div>
74
- <div class="layout-control-group">
75
- <label class="layout-control-label"><?php _e( "Required", contact_bank ); ?> :</label>
76
- <div class="layout-controls" style="margin-top:7px;">
77
- <?php
78
- if(isset($form_settings[$dynamicId]["cb_control_required"]))
79
- {
80
- if($form_settings[$dynamicId]["cb_control_required"] == "1")
81
- {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  ?>
83
- <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
84
- name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" checked="checked" />
85
- <label style="vertical-align: text-bottom;">
86
- <?php _e( "Required", contact_bank ); ?>
87
- </label>
88
- <input type="radio" id="ux_required_<?php echo $dynamicId; ?>"
89
- name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0"/>
90
- <label style="vertical-align: text-bottom;">
91
- <?php _e( "Not Required", contact_bank ); ?>
92
- </label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  }
95
- else if($form_settings[$dynamicId]["cb_control_required"] == "0")
96
  {
97
  ?>
98
- <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
99
- name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
100
- <label style="vertical-align: text-bottom;">
101
- <?php _e( "Required", contact_bank ); ?>
102
- </label>
103
- <input type="radio" id="ux_required_<?php echo $dynamicId; ?>"
104
- name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0" checked="checked" />
105
- <label style="vertical-align: text-bottom;">
106
- <?php _e( "Not Required", contact_bank ); ?>
107
- </label>
108
  <?php
109
  }
110
- }
111
- else
112
- {
113
  ?>
114
- <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
115
- name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
116
- <label style="vertical-align: text-bottom;">
117
- <?php _e( "Required", contact_bank ); ?>
118
- </label>
119
- <input type="radio" id="ux_required_<?php echo $dynamicId; ?>"
120
- name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0" checked="checked" />
121
- <label style="vertical-align: text-bottom;">
122
- <?php _e( "Not Required", contact_bank ); ?>
123
- </label>
124
- <?php
125
- }
126
- ?>
127
- </div>
128
- </div>
129
- <div class="layout-control-group">
130
- <label class="layout-control-label"><?php _e( "Tooltip Text", contact_bank ); ?> :</label>
131
- <div class="layout-controls">
132
- <input type="text" class="layout-span12" id="ux_tooltip_control_<?php echo $dynamicId; ?>"
133
- placeholder="<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>"
134
- name="ux_tooltip_control_<?php echo $dynamicId; ?>" readonly="readonly"
135
- />
136
- </div>
137
- </div>
138
- <div class="layout-control-group">
139
- <label class="layout-control-label"><?php _e("Place Holder", contact_bank ); ?> :</label>
140
- <div class="layout-controls">
141
- <input type="text" class="layout-span12" id="ux_default_value_<?php echo $dynamicId; ?>"
142
- placeholder="<?php _e("Enter Place Holder", contact_bank ); ?>"
143
- name="ux_default_value_<?php echo $dynamicId; ?>"
144
- value="<?php echo isset($form_settings[$dynamicId]["cb_default_txt_val"]) ? $form_settings[$dynamicId]["cb_default_txt_val"] : ""; ?>"/>
145
- </div>
146
- </div>
147
- <div class="layout-control-group">
148
- <label class="layout-control-label"><?php _e( "Admin Label", contact_bank ); ?> :</label>
149
- <div class="layout-controls">
150
- <input type="text" placeholder="<?php _e( "Enter Admin Label", contact_bank ); ?>"
151
- value="<?php echo isset($form_settings[$dynamicId]["cb_admin_label"]) ? $form_settings[$dynamicId]["cb_admin_label"] : _e( "Untitled", contact_bank ); ?>"
152
- class="layout-span12" id="ux_admin_label_<?php echo $dynamicId; ?>" name="ux_admin_label_<?php echo $dynamicId; ?>"/>
153
- </div>
154
- </div>
155
- <div class="layout-control-group">
156
- <label class="layout-control-label"><?php _e( "Do not show in the email", contact_bank ); ?> :</label>
157
- <div class="layout-controls">
158
- <?php
159
- if(isset($form_settings[$dynamicId]["cb_show_email"]))
160
- {
161
- if($form_settings[$dynamicId]["cb_show_email"] == "1")
162
- {
163
- ?>
164
- <input type="checkbox" checked="checked" id="ux_show_email_<?php echo $dynamicId; ?>"
165
- name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="1">
166
- <?php
167
- }
168
- else
169
- {
170
- ?>
171
- <input type="checkbox" id="ux_show_email_<?php echo $dynamicId; ?>"
172
- name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="1">
173
- <?php
174
- }
175
- }
176
- else
177
- {
178
- ?>
179
- <input type="checkbox" id="ux_show_email_<?php echo $dynamicId; ?>"
180
- name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="1">
181
- <?php
182
- }
183
- ?>
184
- </div>
185
- </div>
186
- <div class="layout-control-group">
187
  <label class="layout-control-label" style="padding-top: 5px"><?php _e( "Add a filter", contact_bank ); ?> :</label>
188
  <div class="layout-controls" style="padding-top:5px;">
189
-
190
- <input type="checkbox" value="0" id="ux_checkbox_alpha_filter"
191
  name="ux_checkbox_alpha_filter"/>
192
  <span class="rdl"><?php _e( "Alpha", contact_bank ); ?></span>
193
-
194
- <input type="checkbox" id="ux_checkbox_alpha_num_filter"
195
  name="ux_checkbox_alpha_num_filter" value="0" />
196
  <span class="rdl"><?php _e( "Alpha Numeric", contact_bank ); ?></span>
197
-
198
- <input type="checkbox" value="0" id="ux_checkbox_digit_filter"
199
  name="ux_checkbox_digit_filter" value="Digits" />
200
  <span class="rdl"><?php _e( "Digits", contact_bank ); ?></span>
201
-
202
- <input type="checkbox" id="ux_checkbox_strip_tag_filter"
203
  name="ux_checkbox_strip_tag_filter" value="0" />
204
  <span class="rdl"><?php _e( "Strip Tags", contact_bank ); ?></span>
205
-
206
- <input type="checkbox" id="ux_checkbox_trim_filter"
207
  name="ux_checkbox_trim_filter" value="0" />
208
  <span class="rdl"><?php _e( "Trim", contact_bank ); ?></span>
209
- <br>
210
- <i class="widget_premium_feature_contact"><?php _e(" (Available in Premium Edition)", contact_bank); ?></i>
 
 
 
211
  </div>
212
-
213
-
214
  </div>
215
- <input type="hidden" id="ux_hd_textbox_dynamic_id" name="ux_hd_textbox_dynamic_id" value="<?php echo $dynamicId; ?>"/>
 
 
216
  </div>
217
  </div>
218
- <div class="layout-control-group">
219
- <input type="submit" class="btn btn-info layout-span3" value="<?php _e( "Save Settings", contact_bank ); ?>" />
220
- </div>
221
- </div>
222
- </div>
223
- </form>
224
- <a class="closeButtonLightbox" onclick="CloseLightbox();"></a>
225
- <script type="text/javascript">
226
- var dynamicId = "<?php echo $dynamicId; ?>";
227
- var controlId = "<?php echo $control_id; ?>";
228
- var form_id = "<?php echo $form_id;?>";
229
- jQuery("#ux_frm_text_box_control").validate
230
- ({
231
- submitHandler: function(form)
232
- {
233
- jQuery.post(ajaxurl, jQuery(form).serialize() + "&controlId="+controlId+"&form_id="+form_id+"&form_settings="+JSON.stringify(<?php echo json_encode($form_settings) ?>)+"&event=update&param=save_text_control&action=add_contact_form_library", function(data)
234
  {
235
- jQuery("#control_label_"+dynamicId).html(jQuery("#ux_label_text_"+dynamicId).val()+" :");
236
- jQuery("#txt_description_"+dynamicId).html(jQuery("#ux_description_control_"+dynamicId).val());
237
- jQuery("#show_tooltip"+dynamicId).attr("data-original-title",jQuery("#ux_tooltip_control_"+dynamicId).val());
238
- jQuery("#ux_txt_textbox_control_"+dynamicId).attr("placeholder",jQuery("#ux_default_value_"+dynamicId).val());
239
- if(jQuery("#ux_required_control_"+dynamicId).prop("checked") == true)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
  {
241
- jQuery("#control_label_"+dynamicId).append("<span class=\"error\">*</span>");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  }
243
- CloseLightbox();
244
  });
245
- }
246
- });
247
- jQuery("#ux_checkbox_alpha_filter").attr("disabled","disabled");
248
- jQuery("#ux_checkbox_alpha_num_filter").attr("disabled","disabled");
249
- jQuery("#ux_checkbox_digit_filter").attr("disabled","disabled");
250
- jQuery("#ux_checkbox_strip_tag_filter").attr("disabled","disabled");
251
- jQuery("#ux_checkbox_trim_filter").attr("disabled","disabled");
252
- </script>
253
- <?php
254
  }
255
- ?>
10
  case "author":
11
  $cb_user_role_permission = "publish_posts";
12
  break;
13
+
14
  }
15
  if (!current_user_can($cb_user_role_permission))
16
  {
19
  else
20
  {
21
  $form_settings = array();
22
+ $control_id = $wpdb->get_var
 
 
 
 
 
 
 
 
 
 
 
 
23
  (
24
  $wpdb->prepare
25
  (
26
+ "SELECT control_id FROM " .create_control_Table(). " where form_id= %d and field_id = %d and column_dynamicId = %d",
27
+ $form_id,
28
+ $field_type,
29
+ $dynamicId
30
  )
31
  );
32
+ if(count($control_id) != 0)
 
 
33
  {
34
+ $form_data = $wpdb->get_results
35
+ (
36
+ $wpdb->prepare
37
+ (
38
+ "SELECT * FROM " .contact_bank_dynamic_settings_form(). " where dynamicId= %d",
39
+ $control_id
40
+ )
41
+ );
42
+ $form_settings[$dynamicId]["dynamic_id"] = $dynamicId;
43
+ $form_settings[$dynamicId]["control_type"] = "1";
44
+ for($flag = 0; $flag<count($form_data);$flag++)
45
+ {
46
+ $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = $form_data[$flag]->dynamic_settings_value;
47
+ }
48
  }
49
+ ?>
50
+ <form id="ux_frm_text_box_control" action="#" method="post" class="layout-form">
51
+ <div class="fluid-layout">
52
+ <div class="layout-span12">
53
+ <div class="widget-layout">
54
+ <div class="widget-layout-title">
55
+ <h4><?php _e( "Single Line Text", contact_bank ); ?></h4>
 
 
 
 
 
 
 
 
 
56
  </div>
57
+ <div class="widget-layout-body">
58
+ <div class="layout-control-group">
59
+ <label class="layout-control-label"><?php _e( "Label", contact_bank ); ?> :</label>
60
+ <div class="layout-controls">
61
+ <input type="text" class="layout-span12" onkeyup="enter_admin_label(<?php echo $dynamicId; ?>);"
62
+ value="<?php echo isset($form_settings[$dynamicId]["cb_label_value"]) ? $form_settings[$dynamicId]["cb_label_value"] : _e( "Untitled", contact_bank ); ?>"
63
+ id="ux_label_text_<?php echo $dynamicId; ?>" placeholder="<?php _e( "Enter Label", contact_bank ); ?>" name="ux_label_text_<?php echo $dynamicId; ?>" />
64
+ </div>
65
+ </div>
66
+ <div class="layout-control-group">
67
+ <label class="layout-control-label"><?php _e( "Description", contact_bank ); ?> :</label>
68
+ <div class="layout-controls">
69
+ <textarea id="ux_description_control_<?php echo $dynamicId; ?>" class="layout-span12"
70
+ placeholder="<?php _e( "Enter Description", contact_bank ); ?>"
71
+ name="ux_description_control_<?php echo $dynamicId; ?>"><?php echo isset($form_settings[$dynamicId]["cb_description"]) ? $form_settings[$dynamicId]["cb_description"] : ""; ?></textarea>
72
+ </div>
73
+ </div>
74
+ <div class="layout-control-group">
75
+ <label class="layout-control-label"><?php _e( "Required", contact_bank ); ?> :</label>
76
+ <div class="layout-controls" style="margin-top:7px;">
77
+ <?php
78
+ if(isset($form_settings[$dynamicId]["cb_control_required"]))
79
+ {
80
+ if($form_settings[$dynamicId]["cb_control_required"] == "1")
81
+ {
82
+ ?>
83
+ <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
84
+ name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" checked="checked" />
85
+ <label style="vertical-align: text-bottom;">
86
+ <?php _e( "Required", contact_bank ); ?>
87
+ </label>
88
+ <input type="radio" id="ux_required_<?php echo $dynamicId; ?>"
89
+ name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0"/>
90
+ <label style="vertical-align: text-bottom;">
91
+ <?php _e( "Not Required", contact_bank ); ?>
92
+ </label>
93
+ <?php
94
+ }
95
+ else if($form_settings[$dynamicId]["cb_control_required"] == "0")
96
+ {
97
+ ?>
98
+ <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
99
+ name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
100
+ <label style="vertical-align: text-bottom;">
101
+ <?php _e( "Required", contact_bank ); ?>
102
+ </label>
103
+ <input type="radio" id="ux_required_<?php echo $dynamicId; ?>"
104
+ name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0" checked="checked" />
105
+ <label style="vertical-align: text-bottom;">
106
+ <?php _e( "Not Required", contact_bank ); ?>
107
+ </label>
108
+ <?php
109
+ }
110
+ }
111
+ else
112
+ {
113
+ ?>
114
+ <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
115
+ name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
116
+ <label style="vertical-align: text-bottom;">
117
+ <?php _e( "Required", contact_bank ); ?>
118
+ </label>
119
+ <input type="radio" id="ux_required_<?php echo $dynamicId; ?>"
120
+ name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0" checked="checked" />
121
+ <label style="vertical-align: text-bottom;">
122
+ <?php _e( "Not Required", contact_bank ); ?>
123
+ </label>
124
+ <?php
125
+ }
126
  ?>
127
+ </div>
128
+ </div>
129
+ <div class="layout-control-group">
130
+ <label class="layout-control-label"><?php _e( "Tooltip Text", contact_bank ); ?> :</label>
131
+ <div class="layout-controls">
132
+ <input type="text" class="layout-span12" id="ux_tooltip_control_<?php echo $dynamicId; ?>"
133
+ placeholder="<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>"
134
+ name="ux_tooltip_control_<?php echo $dynamicId; ?>"
135
+ readonly="readonly"/>
136
+ </div>
137
+ </div>
138
+ <div class="layout-control-group">
139
+ <label class="layout-control-label"><?php _e("Place Holder", contact_bank ); ?> :</label>
140
+ <div class="layout-controls">
141
+ <input type="text" class="layout-span12" id="ux_default_value_<?php echo $dynamicId; ?>"
142
+ placeholder="<?php _e("Enter Place Holder", contact_bank ); ?>"
143
+ name="ux_default_value_<?php echo $dynamicId; ?>"
144
+ value="<?php echo isset($form_settings[$dynamicId]["cb_default_txt_val"]) ? $form_settings[$dynamicId]["cb_default_txt_val"] : ""; ?>"/>
145
+ </div>
146
+ </div>
147
+ <div class="layout-control-group">
148
+ <label class="layout-control-label"><?php _e( "Admin Label", contact_bank ); ?> :</label>
149
+ <div class="layout-controls">
150
+ <input type="text" placeholder="<?php _e( "Enter Admin Label", contact_bank ); ?>"
151
+ value="<?php echo isset($form_settings[$dynamicId]["cb_admin_label"]) ? $form_settings[$dynamicId]["cb_admin_label"] : _e( "Untitled", contact_bank ); ?>"
152
+ class="layout-span12" id="ux_admin_label_<?php echo $dynamicId; ?>" name="ux_admin_label_<?php echo $dynamicId; ?>"/>
153
+ </div>
154
+ </div>
155
+ <div class="layout-control-group">
156
+ <label class="layout-control-label"><?php _e( "Do not show in the email", contact_bank ); ?> :</label>
157
+ <div class="layout-controls">
158
  <?php
159
+ if(isset($form_settings[$dynamicId]["cb_show_email"]))
160
+ {
161
+ if($form_settings[$dynamicId]["cb_show_email"] == "1")
162
+ {
163
+ ?>
164
+ <input type="checkbox" checked="checked" id="ux_show_email_<?php echo $dynamicId; ?>"
165
+ name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="1">
166
+ <?php
167
+ }
168
+ else
169
+ {
170
+ ?>
171
+ <input type="checkbox" id="ux_show_email_<?php echo $dynamicId; ?>"
172
+ name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="1">
173
+ <?php
174
+ }
175
  }
176
+ else
177
  {
178
  ?>
179
+ <input type="checkbox" id="ux_show_email_<?php echo $dynamicId; ?>"
180
+ name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="1">
 
 
 
 
 
 
 
 
181
  <?php
182
  }
 
 
 
183
  ?>
184
+ </div>
185
+ </div>
186
+ <div class="layout-control-group">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  <label class="layout-control-label" style="padding-top: 5px"><?php _e( "Add a filter", contact_bank ); ?> :</label>
188
  <div class="layout-controls" style="padding-top:5px;">
189
+ <input type="checkbox" value="0" id="ux_checkbox_alpha_filter"
 
190
  name="ux_checkbox_alpha_filter"/>
191
  <span class="rdl"><?php _e( "Alpha", contact_bank ); ?></span>
192
+
193
+ <input type="checkbox" id="ux_checkbox_alpha_num_filter"
194
  name="ux_checkbox_alpha_num_filter" value="0" />
195
  <span class="rdl"><?php _e( "Alpha Numeric", contact_bank ); ?></span>
196
+
197
+ <input type="checkbox" value="0" id="ux_checkbox_digit_filter"
198
  name="ux_checkbox_digit_filter" value="Digits" />
199
  <span class="rdl"><?php _e( "Digits", contact_bank ); ?></span>
200
+
201
+ <input type="checkbox" id="ux_checkbox_strip_tag_filter"
202
  name="ux_checkbox_strip_tag_filter" value="0" />
203
  <span class="rdl"><?php _e( "Strip Tags", contact_bank ); ?></span>
204
+
205
+ <input type="checkbox" id="ux_checkbox_trim_filter"
206
  name="ux_checkbox_trim_filter" value="0" />
207
  <span class="rdl"><?php _e( "Trim", contact_bank ); ?></span>
208
+ <br>
209
+ <i class="widget_premium_feature_contact"><?php _e(" (Available in Premium Edition)", contact_bank); ?></i>
210
+ </div>
211
+ </div>
212
+ <input type="hidden" id="ux_hd_textbox_dynamic_id" name="ux_hd_textbox_dynamic_id" value="<?php echo $dynamicId; ?>"/>
213
  </div>
 
 
214
  </div>
215
+ <div class="layout-control-group">
216
+ <input type="submit" class="btn btn-info layout-span3" value="<?php _e( "Save Settings", contact_bank ); ?>" />
217
+ </div>
218
  </div>
219
  </div>
220
+ </form>
221
+ <a class="closeButtonLightbox" onclick="CloseLightbox();"></a>
222
+ <script type="text/javascript">
223
+ jQuery(".hovertip").tooltip_tip({placement: "left"});
224
+ jQuery("#ux_checkbox_alpha_filter").attr("disabled","disabled");
225
+ jQuery("#ux_checkbox_alpha_num_filter").attr("disabled","disabled");
226
+ jQuery("#ux_checkbox_digit_filter").attr("disabled","disabled");
227
+ jQuery("#ux_checkbox_strip_tag_filter").attr("disabled","disabled");
228
+ jQuery("#ux_checkbox_trim_filter").attr("disabled","disabled");
229
+ if (typeof(base64_encode) != "function")
 
 
 
 
 
 
230
  {
231
+ function base64_encode(data)
232
+ {
233
+ var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
234
+ var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
235
+ ac = 0,
236
+ enc = '',
237
+ tmp_arr = [];
238
+ if (!data)
239
+ {
240
+ return data;
241
+ }
242
+ do
243
+ {
244
+ o1 = data.charCodeAt(i++);
245
+ o2 = data.charCodeAt(i++);
246
+ o3 = data.charCodeAt(i++);
247
+ bits = o1 << 16 | o2 << 8 | o3;
248
+ h1 = bits >> 18 & 0x3f;
249
+ h2 = bits >> 12 & 0x3f;
250
+ h3 = bits >> 6 & 0x3f;
251
+ h4 = bits & 0x3f;
252
+ tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
253
+ }
254
+ while (i < data.length);
255
+ enc = tmp_arr.join('');
256
+ var r = data.length % 3;
257
+ return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
258
+ }
259
+ }
260
+ var dynamicId = "<?php echo $dynamicId; ?>";
261
+ var controlId = "<?php echo $control_id; ?>";
262
+ var form_id = "<?php echo $form_id;?>";
263
+ jQuery("#ux_frm_text_box_control").validate
264
+ ({
265
+ submitHandler: function(form)
266
  {
267
+ jQuery.post(ajaxurl,
268
+ {
269
+ data: base64_encode(jQuery(form).serialize()),
270
+ controlId: controlId,
271
+ form_id: form_id,
272
+ form_settings: JSON.stringify(<?php echo json_encode($form_settings) ?>),
273
+ events: "update",
274
+ param: "save_text_control",
275
+ action: "add_contact_form_library",
276
+ },
277
+ function(data)
278
+ {
279
+
280
+ jQuery("#control_label_"+dynamicId).html(jQuery("#ux_label_text_"+dynamicId).val()+" :");
281
+ jQuery("#txt_description_"+dynamicId).html(jQuery("#ux_description_control_"+dynamicId).val());
282
+ jQuery("#show_tooltip"+dynamicId).attr("data-original-title",jQuery("#ux_tooltip_control_"+dynamicId).val());
283
+ jQuery("#ux_txt_textbox_control_"+dynamicId).attr("placeholder",jQuery("#ux_default_value_"+dynamicId).val());
284
+ if(jQuery("#ux_required_control_"+dynamicId).prop("checked") == true)
285
+ {
286
+ jQuery("#control_label_"+dynamicId).append("<span class=\"error_field\">*</span>");
287
+ }
288
+ CloseLightbox();
289
+ });
290
  }
 
291
  });
292
+
293
+ </script>
294
+ <?php
 
 
 
 
 
 
295
  }
296
+ ?>
includes/cb_textarea.php CHANGED
@@ -10,7 +10,7 @@ switch($cb_role)
10
  case "author":
11
  $cb_user_role_permission = "publish_posts";
12
  break;
13
-
14
  }
15
  if (!current_user_can($cb_user_role_permission))
16
  {
@@ -19,207 +19,268 @@ if (!current_user_can($cb_user_role_permission))
19
  else
20
  {
21
  $form_settings = array();
22
- $control_id = $wpdb->get_var
23
- (
24
- $wpdb->prepare
25
- (
26
- "SELECT control_id FROM " .create_control_Table(). " where form_id= %d and field_id = %d and column_dynamicId = %d",
27
- $form_id,
28
- $field_type,
29
- $dynamicId
30
- )
31
- );
32
- if(count($control_id) != 0)
33
- {
34
- $form_data = $wpdb->get_results
35
  (
36
  $wpdb->prepare
37
  (
38
- "SELECT * FROM " .contact_bank_dynamic_settings_form(). " where dynamicId= %d",
39
- $control_id
 
 
40
  )
41
  );
42
- $form_settings[$dynamicId]["dynamic_id"] = $dynamicId;
43
- $form_settings[$dynamicId]["control_type"] = "1";
44
- for($flag = 0; $flag<count($form_data);$flag++)
45
  {
46
- $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = $form_data[$flag]->dynamic_settings_value;
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  }
48
- }
49
- ?>
50
- <form id="ux_frm_text_area_control" action="#" method="post" class="layout-form">
51
- <div class="fluid-layout">
52
- <div class="layout-span12">
53
- <div class="widget-layout">
54
- <div class="widget-layout-title">
55
- <h4><?php _e( "Paragraph Text", contact_bank ); ?></h4>
56
- </div>
57
- <div class="widget-layout-body">
58
- <div class="layout-control-group">
59
- <label class="layout-control-label"><?php _e( "Label", contact_bank ); ?> :</label>
60
- <div class="layout-controls">
61
- <input value="<?php echo isset($form_settings[$dynamicId]["cb_label_value"]) ? $form_settings[$dynamicId]["cb_label_value"] : _e( "Untitled", contact_bank ); ?>" onkeyup="enter_admin_label(<?php echo $dynamicId; ?>);" placeholder="<?php _e( "Enter label", contact_bank);?>" type="text" class="layout-span12" id="ux_label_text_<?php echo $dynamicId; ?>" name="ux_label_text_<?php echo $dynamicId; ?>" />
62
- </div>
63
  </div>
64
- <div class="layout-control-group">
65
- <label class="layout-control-label"><?php _e("Description", contact_bank); ?> :</label>
66
- <div class="layout-controls">
67
- <textarea placeholder="<?php _e( "Enter Description", contact_bank);?>" class="layout-span12" id="ux_description_control_<?php echo $dynamicId; ?>" name="ux_description_control_<?php echo $dynamicId; ?>" ><?php echo isset($form_settings[$dynamicId]["cb_description"]) ? $form_settings[$dynamicId]["cb_description"] : ""; ?></textarea>
 
 
 
 
68
  </div>
69
- </div>
70
- <div class="layout-control-group">
71
- <label class="layout-control-label"><?php _e( "Required", contact_bank ); ?> :</label>
72
- <div class="layout-controls" style="margin-top:7px;">
73
- <?php
74
- if(isset($form_settings[$dynamicId]["cb_control_required"]))
75
- {
76
- if($form_settings[$dynamicId]["cb_control_required"] == "1")
77
- {
78
- ?>
79
- <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" checked="checked" />
80
- <label style="vertical-align: text-bottom;">
81
- <?php _e( "Required", contact_bank ); ?>
82
- </label>
83
- <input type="radio" id="ux_required_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0"/>
84
- <label style="vertical-align: text-bottom;">
85
- <?php _e( "Not Required", contact_bank ); ?>
86
- </label>
87
- <?php
88
- }
89
- else if($form_settings[$dynamicId]["cb_control_required"] == "0")
90
- {
91
- ?>
92
- <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
93
- <label style="vertical-align: text-bottom;">
94
- <?php _e( "Required", contact_bank ); ?>
95
- </label>
96
- <input type="radio" id="ux_required_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0" checked="checked" />
97
- <label style="vertical-align: text-bottom;">
98
- <?php _e( "Not Required", contact_bank ); ?>
99
- </label>
100
  <?php
101
- }
102
- }
103
- else
104
- {
105
- ?>
106
- <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
107
- <label style="vertical-align: text-bottom;">
108
- <?php _e( "Required", contact_bank ); ?>
109
- </label>
110
- <input type="radio" id="ux_required_<?php echo $dynamicId; ?>" name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0" checked="checked" />
111
- <label style="vertical-align: text-bottom;">
112
- <?php _e( "Not Required", contact_bank ); ?>
113
- </label>
114
- <?php
115
- }
116
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  </div>
118
- </div>
119
- <div class="layout-control-group">
120
- <label class="layout-control-label"><?php _e("Tooltip text", contact_bank); ?> :</label>
121
- <div class="layout-controls">
122
- <input placeholder="<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank);?>" type="text" class="layout-span12" id="ux_tooltip_control_<?php echo $dynamicId; ?>" name="ux_tooltip_control_<?php echo $dynamicId; ?>" readonly="readonly" />
 
 
 
123
  </div>
124
- </div>
125
- <div class="layout-control-group">
126
- <label class="layout-control-label"><?php _e( "Place Holder", contact_bank ); ?> :</label>
127
- <div class="layout-controls">
128
- <input placeholder="<?php _e( "Enter Place Holder", contact_bank);?>" class="layout-span12" type="text" id="ux_default_value_<?php echo $dynamicId; ?>" name="ux_default_value_<?php echo $dynamicId; ?>" value="<?php echo isset($form_settings[$dynamicId]["cb_default_txt_val"]) ? $form_settings[$dynamicId]["cb_default_txt_val"] : ""; ?>"/>
 
 
129
  </div>
130
- </div>
131
- <div class="layout-control-group">
132
- <label class="layout-control-label"><?php _e( "Admin Label", contact_bank ); ?> : </label>
133
- <div class="layout-controls">
134
- <input value="<?php echo isset($form_settings[$dynamicId]["cb_admin_label"]) ? $form_settings[$dynamicId]["cb_admin_label"] : _e( "Untitled", contact_bank ); ?>" placeholder="<?php _e( "Enter Admin Label", contact_bank);?>" class="layout-span12" type="text" id="ux_admin_label_<?php echo $dynamicId; ?>" name="ux_admin_label_<?php echo $dynamicId; ?>" />
 
135
  </div>
136
- </div>
137
- <div class="layout-control-group">
138
- <label class="layout-control-label"><?php _e( "Do not show in the email", contact_bank ); ?> : </label>
139
- <div class="layout-controls">
140
- <?php
141
- if(isset($form_settings[$dynamicId]["cb_show_email"]))
142
- {
143
- if($form_settings[$dynamicId]["cb_show_email"] == "1")
144
- {
145
- ?>
146
- <input type="checkbox" checked="checked" id="ux_show_email_<?php echo $dynamicId; ?>" name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="1">
147
- <?php
148
- }
149
- else
150
- {
151
- ?>
152
- <input type="checkbox" id="ux_show_email_<?php echo $dynamicId; ?>" name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="0">
153
- <?php
154
- }
155
- }
156
- else
157
- {
158
- ?>
159
- <input type="checkbox" id="ux_show_email_<?php echo $dynamicId; ?>" name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="0">
160
- <?php
161
- }
162
- ?>
 
 
 
163
  </div>
164
- </div>
165
- <div class="layout-control-group">
166
  <label class="layout-control-label" style="padding-top: 5px"><?php _e( "Add a filter", contact_bank ); ?> :</label>
167
  <div class="layout-controls" style="padding-top:5px;">
168
  <input type="checkbox" value="0" id="ux_checkbox_alpha_filter" name="ux_checkbox_alpha_filter"/>
169
  <span class="rdl"><?php _e( "Alpha", contact_bank ); ?></span>
170
-
171
  <input type="checkbox" id="ux_checkbox_alpha_num_filter" name="ux_checkbox_alpha_num_filter" value="0" />
172
  <span class="rdl"><?php _e( "Alpha Numeric", contact_bank ); ?></span>
173
-
174
  <input type="checkbox" value="0" id="ux_checkbox_digit_filter" name="ux_checkbox_digit_filter" value="Digits" />
175
  <span class="rdl"><?php _e( "Digits", contact_bank ); ?></span>
176
-
177
  <input type="checkbox" id="ux_checkbox_strip_tag_filter" name="ux_checkbox_strip_tag_filter" value="0" />
178
  <span class="rdl"><?php _e( "Strip Tags", contact_bank ); ?></span>
179
-
180
  <input type="checkbox" id="ux_checkbox_trim_filter" name="ux_checkbox_trim_filter" value="0" />
181
  <span class="rdl"><?php _e( "Trim", contact_bank ); ?></span>
182
  <br>
183
  <i class="widget_premium_feature_contact"><?php _e(" (Available in Premium Edition)", contact_bank); ?></i>
184
  </div>
185
  </div>
186
- <input type="hidden" id="ux_hd_textbox_dynamic_id" name="ux_hd_textbox_dynamic_id" value="<?php echo $dynamicId; ?>"/>
 
 
 
 
187
  </div>
188
- </div>
189
- <div class="layout-control-group">
190
- <input type="submit" class="btn btn-info layout-span3" value="<?php _e( "Save Settings", contact_bank ); ?>" />
191
  </div>
192
  </div>
193
- </div>
194
- </form>
195
- <a class="closeButtonLightbox" onclick="CloseLightbox();"></a>
196
- <script type="text/javascript">
197
- var dynamicId = "<?php echo $dynamicId; ?>";
198
- var controlId = "<?php echo $control_id; ?>";
199
- jQuery("#ux_frm_text_area_control").validate
200
- ({
201
- submitHandler: function(form)
202
- {
203
- jQuery.post(ajaxurl, jQuery(form).serialize() + "&controlId="+controlId+"&form_id="+form_id+"&form_settings="+JSON.stringify(<?php echo json_encode($form_settings) ?>)+"&event=update&param=save_textarea_control&action=add_contact_form_library", function()
204
  {
205
- jQuery("#control_label_"+dynamicId).html(jQuery("#ux_label_text_"+dynamicId).val()+" :");
206
- jQuery("#txt_description_"+dynamicId).html(jQuery("#ux_description_control_"+dynamicId).val());
207
- jQuery("#ux_textarea_control_"+dynamicId).attr("placeholder",jQuery("#ux_default_value_"+dynamicId).val());
208
- jQuery("#show_tooltip"+dynamicId).attr("data-original-title",jQuery("#ux_tooltip_control_"+dynamicId).val());
209
- if(jQuery("#ux_required_control_"+dynamicId).prop("checked") == true)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  {
211
- jQuery("#control_label_"+dynamicId).append("<span class=\"error\">*</span>");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
212
  }
213
- CloseLightbox();
214
  });
215
- }
216
- });
217
- jQuery("#ux_checkbox_alpha_filter").attr("disabled","disabled");
218
- jQuery("#ux_checkbox_alpha_num_filter").attr("disabled","disabled");
219
- jQuery("#ux_checkbox_digit_filter").attr("disabled","disabled");
220
- jQuery("#ux_checkbox_strip_tag_filter").attr("disabled","disabled");
221
- jQuery("#ux_checkbox_trim_filter").attr("disabled","disabled");
222
- </script>
223
- <?php
224
  }
225
- ?>
10
  case "author":
11
  $cb_user_role_permission = "publish_posts";
12
  break;
13
+
14
  }
15
  if (!current_user_can($cb_user_role_permission))
16
  {
19
  else
20
  {
21
  $form_settings = array();
22
+ $control_id = $wpdb->get_var
 
 
 
 
 
 
 
 
 
 
 
 
23
  (
24
  $wpdb->prepare
25
  (
26
+ "SELECT control_id FROM " .create_control_Table(). " where form_id= %d and field_id = %d and column_dynamicId = %d",
27
+ $form_id,
28
+ $field_type,
29
+ $dynamicId
30
  )
31
  );
32
+ if(count($control_id) != 0)
 
 
33
  {
34
+ $form_data = $wpdb->get_results
35
+ (
36
+ $wpdb->prepare
37
+ (
38
+ "SELECT * FROM " .contact_bank_dynamic_settings_form(). " where dynamicId= %d",
39
+ $control_id
40
+ )
41
+ );
42
+ $form_settings[$dynamicId]["dynamic_id"] = $dynamicId;
43
+ $form_settings[$dynamicId]["control_type"] = "1";
44
+ for($flag = 0; $flag<count($form_data);$flag++)
45
+ {
46
+ $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = $form_data[$flag]->dynamic_settings_value;
47
+ }
48
  }
49
+ ?>
50
+ <form id="ux_frm_text_area_control" action="#" method="post" class="layout-form">
51
+ <div class="fluid-layout">
52
+ <div class="layout-span12">
53
+ <div class="widget-layout">
54
+ <div class="widget-layout-title">
55
+ <h4><?php _e( "Paragraph Text", contact_bank ); ?></h4>
 
 
 
 
 
 
 
 
56
  </div>
57
+ <div class="widget-layout-body">
58
+ <div class="layout-control-group">
59
+ <label class="layout-control-label"><?php _e( "Label", contact_bank ); ?> :</label>
60
+ <div class="layout-controls">
61
+ <input value="<?php echo isset($form_settings[$dynamicId]["cb_label_value"]) ? $form_settings[$dynamicId]["cb_label_value"] : _e( "Untitled", contact_bank ); ?>"
62
+ onkeyup="enter_admin_label(<?php echo $dynamicId; ?>);" placeholder="<?php _e( "Enter label", contact_bank);?>"
63
+ type="text" class="layout-span12" id="ux_label_text_<?php echo $dynamicId; ?>" name="ux_label_text_<?php echo $dynamicId; ?>" />
64
+ </div>
65
  </div>
66
+ <div class="layout-control-group">
67
+ <label class="layout-control-label"><?php _e("Description", contact_bank); ?> :</label>
68
+ <div class="layout-controls">
69
+ <textarea placeholder="<?php _e( "Enter Description", contact_bank);?>"
70
+ class="layout-span12" id="ux_description_control_<?php echo $dynamicId; ?>"
71
+ name="ux_description_control_<?php echo $dynamicId; ?>" ><?php echo isset($form_settings[$dynamicId]["cb_description"]) ? $form_settings[$dynamicId]["cb_description"] : ""; ?></textarea>
72
+ </div>
73
+ </div>
74
+ <div class="layout-control-group">
75
+ <label class="layout-control-label"><?php _e( "Required", contact_bank ); ?> :</label>
76
+ <div class="layout-controls" style="margin-top:7px;">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  <?php
78
+ if(isset($form_settings[$dynamicId]["cb_control_required"]))
79
+ {
80
+ if($form_settings[$dynamicId]["cb_control_required"] == "1")
81
+ {
82
+ ?>
83
+ <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
84
+ name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" checked="checked" />
85
+ <label style="vertical-align: text-bottom;">
86
+ <?php _e( "Required", contact_bank ); ?>
87
+ </label>
88
+ <input type="radio" id="ux_required_<?php echo $dynamicId; ?>"
89
+ name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0"/>
90
+ <label style="vertical-align: text-bottom;">
91
+ <?php _e( "Not Required", contact_bank ); ?>
92
+ </label>
93
+ <?php
94
+ }
95
+ else if($form_settings[$dynamicId]["cb_control_required"] == "0")
96
+ {
97
+ ?>
98
+ <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
99
+ name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
100
+ <label style="vertical-align: text-bottom;">
101
+ <?php _e( "Required", contact_bank ); ?>
102
+ </label>
103
+ <input type="radio" id="ux_required_<?php echo $dynamicId; ?>"
104
+ name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0" checked="checked" />
105
+ <label style="vertical-align: text-bottom;">
106
+ <?php _e( "Not Required", contact_bank ); ?>
107
+ </label>
108
+ <?php
109
+ }
110
+ }
111
+ else
112
+ {
113
+ ?>
114
+ <input type="radio" id="ux_required_control_<?php echo $dynamicId; ?>"
115
+ name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="1" />
116
+ <label style="vertical-align: text-bottom;">
117
+ <?php _e( "Required", contact_bank ); ?>
118
+ </label>
119
+ <input type="radio" id="ux_required_<?php echo $dynamicId; ?>"
120
+ name="ux_required_control_radio_<?php echo $dynamicId; ?>" value="0" checked="checked" />
121
+ <label style="vertical-align: text-bottom;">
122
+ <?php _e( "Not Required", contact_bank ); ?>
123
+ </label>
124
+ <?php
125
+ }
126
+ ?>
127
+ </div>
128
  </div>
129
+ <div class="layout-control-group">
130
+ <label class="layout-control-label"><?php _e("Tooltip text", contact_bank); ?> :</label>
131
+ <div class="layout-controls">
132
+ <input placeholder="<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>" type="text"
133
+ class="layout-span12" id="ux_tooltip_control_<?php echo $dynamicId; ?>"
134
+ name="ux_tooltip_control_<?php echo $dynamicId; ?>"
135
+ readonly="readonly"/>
136
+ </div>
137
  </div>
138
+ <div class="layout-control-group">
139
+ <label class="layout-control-label"><?php _e( "Place Holder", contact_bank ); ?> :</label>
140
+ <div class="layout-controls">
141
+ <input placeholder="<?php _e( "Enter Place Holder", contact_bank);?>" class="layout-span12"
142
+ type="text" id="ux_default_value_<?php echo $dynamicId; ?>" name="ux_default_value_<?php echo $dynamicId; ?>"
143
+ value="<?php echo isset($form_settings[$dynamicId]["cb_default_txt_val"]) ? $form_settings[$dynamicId]["cb_default_txt_val"] : ""; ?>"/>
144
+ </div>
145
  </div>
146
+ <div class="layout-control-group">
147
+ <label class="layout-control-label"><?php _e( "Admin Label", contact_bank ); ?> : </label>
148
+ <div class="layout-controls">
149
+ <input value="<?php echo isset($form_settings[$dynamicId]["cb_admin_label"]) ? $form_settings[$dynamicId]["cb_admin_label"] : _e( "Untitled", contact_bank ); ?>"
150
+ placeholder="<?php _e( "Enter Admin Label", contact_bank);?>" class="layout-span12" type="text" id="ux_admin_label_<?php echo $dynamicId; ?>" name="ux_admin_label_<?php echo $dynamicId; ?>" />
151
+ </div>
152
  </div>
153
+ <div class="layout-control-group">
154
+ <label class="layout-control-label"><?php _e( "Do not show in the email", contact_bank ); ?> : </label>
155
+ <div class="layout-controls">
156
+ <?php
157
+ if(isset($form_settings[$dynamicId]["cb_show_email"]))
158
+ {
159
+ if($form_settings[$dynamicId]["cb_show_email"] == "1")
160
+ {
161
+ ?>
162
+ <input type="checkbox" checked="checked" id="ux_show_email_<?php echo $dynamicId; ?>"
163
+ name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="1">
164
+ <?php
165
+ }
166
+ else
167
+ {
168
+ ?>
169
+ <input type="checkbox" id="ux_show_email_<?php echo $dynamicId; ?>"
170
+ name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="0">
171
+ <?php
172
+ }
173
+ }
174
+ else
175
+ {
176
+ ?>
177
+ <input type="checkbox" id="ux_show_email_<?php echo $dynamicId; ?>"
178
+ name="ux_show_email_<?php echo $dynamicId; ?>" style="margin-top: 10px;" value="0">
179
+ <?php
180
+ }
181
+ ?>
182
+ </div>
183
  </div>
184
+ <div class="layout-control-group">
 
185
  <label class="layout-control-label" style="padding-top: 5px"><?php _e( "Add a filter", contact_bank ); ?> :</label>
186
  <div class="layout-controls" style="padding-top:5px;">
187
  <input type="checkbox" value="0" id="ux_checkbox_alpha_filter" name="ux_checkbox_alpha_filter"/>
188
  <span class="rdl"><?php _e( "Alpha", contact_bank ); ?></span>
189
+
190
  <input type="checkbox" id="ux_checkbox_alpha_num_filter" name="ux_checkbox_alpha_num_filter" value="0" />
191
  <span class="rdl"><?php _e( "Alpha Numeric", contact_bank ); ?></span>
192
+
193
  <input type="checkbox" value="0" id="ux_checkbox_digit_filter" name="ux_checkbox_digit_filter" value="Digits" />
194
  <span class="rdl"><?php _e( "Digits", contact_bank ); ?></span>
195
+
196
  <input type="checkbox" id="ux_checkbox_strip_tag_filter" name="ux_checkbox_strip_tag_filter" value="0" />
197
  <span class="rdl"><?php _e( "Strip Tags", contact_bank ); ?></span>
198
+
199
  <input type="checkbox" id="ux_checkbox_trim_filter" name="ux_checkbox_trim_filter" value="0" />
200
  <span class="rdl"><?php _e( "Trim", contact_bank ); ?></span>
201
  <br>
202
  <i class="widget_premium_feature_contact"><?php _e(" (Available in Premium Edition)", contact_bank); ?></i>
203
  </div>
204
  </div>
205
+ <input type="hidden" id="ux_hd_textbox_dynamic_id" name="ux_hd_textbox_dynamic_id" value="<?php echo $dynamicId; ?>"/>
206
+ </div>
207
+ </div>
208
+ <div class="layout-control-group">
209
+ <input type="submit" class="btn btn-info layout-span3" value="<?php _e( "Save Settings", contact_bank ); ?>" />
210
  </div>
 
 
 
211
  </div>
212
  </div>
213
+ </form>
214
+ <a class="closeButtonLightbox" onclick="CloseLightbox();"></a>
215
+ <script type="text/javascript">
216
+ jQuery(".hovertip").tooltip_tip({placement: "left"});
217
+ if (typeof(base64_encode) != "function")
 
 
 
 
 
 
218
  {
219
+ function base64_encode(data)
220
+ {
221
+ var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
222
+ var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
223
+ ac = 0,
224
+ enc = '',
225
+ tmp_arr = [];
226
+ if (!data)
227
+ {
228
+ return data;
229
+ }
230
+ do
231
+ {
232
+ o1 = data.charCodeAt(i++);
233
+ o2 = data.charCodeAt(i++);
234
+ o3 = data.charCodeAt(i++);
235
+ bits = o1 << 16 | o2 << 8 | o3;
236
+ h1 = bits >> 18 & 0x3f;
237
+ h2 = bits >> 12 & 0x3f;
238
+ h3 = bits >> 6 & 0x3f;
239
+ h4 = bits & 0x3f;
240
+ tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
241
+ }
242
+ while (i < data.length);
243
+ enc = tmp_arr.join('');
244
+ var r = data.length % 3;
245
+ return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
246
+ }
247
+ }
248
+ var dynamicId = "<?php echo $dynamicId; ?>";
249
+ var controlId = "<?php echo $control_id; ?>";
250
+ jQuery("#ux_frm_text_area_control").validate
251
+ ({
252
+ submitHandler: function(form)
253
  {
254
+ jQuery.post(ajaxurl,
255
+ {
256
+ data: base64_encode(jQuery(form).serialize()),
257
+ controlId: controlId,
258
+ form_id: form_id,
259
+ form_settings: JSON.stringify(<?php echo json_encode($form_settings) ?>),
260
+ events: "update",
261
+ param: "save_textarea_control",
262
+ action: "add_contact_form_library",
263
+ },
264
+ function(data)
265
+ {
266
+ jQuery("#control_label_"+dynamicId).html(jQuery("#ux_label_text_"+dynamicId).val()+" :");
267
+ jQuery("#txt_description_"+dynamicId).html(jQuery("#ux_description_control_"+dynamicId).val());
268
+ jQuery("#ux_textarea_control_"+dynamicId).attr("placeholder",jQuery("#ux_default_value_"+dynamicId).val());
269
+ jQuery("#show_tooltip"+dynamicId).attr("data-original-title",jQuery("#ux_tooltip_control_"+dynamicId).val());
270
+ if(jQuery("#ux_required_control_"+dynamicId).prop("checked") == true)
271
+ {
272
+ jQuery("#control_label_"+dynamicId).append("<span class=\"error_field\">*</span>");
273
+ }
274
+ CloseLightbox();
275
+ });
276
  }
 
277
  });
278
+ jQuery("#ux_checkbox_alpha_filter").attr("disabled","disabled");
279
+ jQuery("#ux_checkbox_alpha_num_filter").attr("disabled","disabled");
280
+ jQuery("#ux_checkbox_digit_filter").attr("disabled","disabled");
281
+ jQuery("#ux_checkbox_strip_tag_filter").attr("disabled","disabled");
282
+ jQuery("#ux_checkbox_trim_filter").attr("disabled","disabled");
283
+ </script>
284
+ <?php
 
 
285
  }
286
+ ?>
lib/contact_bank_email-class.php CHANGED
@@ -10,7 +10,7 @@
10
  case "author":
11
  $cb_user_role_permission = "publish_posts";
12
  break;
13
-
14
  }
15
  if (!current_user_can($cb_user_role_permission))
16
  {
@@ -74,13 +74,13 @@ else
74
  break;
75
  case "contributor":
76
  break;
77
-
78
  case "subscriber":
79
  break;
80
-
81
  }
82
  ?>
83
-
84
  </td>
85
  </tr>
86
  <?php
@@ -93,7 +93,7 @@ else
93
  "bAutoWidth": true,
94
  "sPaginationType": "full_numbers",
95
  "sDom": "<\"datatable-header\"fl>t<\"datatable-footer\"ip>",
96
- "oLanguage":
97
  {
98
  "sLengthMenu": "<span>Show entries:</span> _MENU_"
99
  },
@@ -101,29 +101,30 @@ else
101
  });
102
  </script>
103
  <?php
104
- die();
105
  break;
106
  case "insert_email_controls":
107
  $form_id = isset($_REQUEST["form_id"]) ? intval($_REQUEST["form_id"]) : "";
108
  $email_id = isset($_REQUEST["email_id"]) ? intval($_REQUEST["email_id"]) : "";
109
- $email_id = intval($_REQUEST["email_id"]);
110
- $email_name = esc_attr($_REQUEST["ux_txt_name"]);
111
- $send_to = intval($_REQUEST["ux_rdl_send_to"]);
 
112
  if($send_to == 0)
113
  {
114
- $email_address = esc_attr($_REQUEST["ux_txt_email"]);
115
  }
116
  else
117
  {
118
- $email_address = esc_attr($_REQUEST["ux_txt_send_to_field"]);
119
  }
120
- $email_from_name = esc_attr($_REQUEST["ux_txt_from_name"]);
121
- $email_from_email = esc_attr($_REQUEST["ux_txt_from_email"]);
122
- $email_reply_to = esc_attr($_REQUEST["ux_txt_reply_to"]);
123
- $email_cc = esc_attr($_REQUEST["ux_txt_cc"]);
124
- $email_bcc = esc_attr($_REQUEST["ux_txt_bcc"]);
125
- $email_subject = esc_attr($_REQUEST["ux_txt_subject"]);
126
- $uxDescription_email = html_entity_decode($_REQUEST["uxEmailTemplate"]);
127
  $wpdb->query
128
  (
129
  $wpdb->prepare
@@ -143,7 +144,7 @@ else
143
  $email_id
144
  )
145
  );
146
- die();
147
  break;
148
  case "delete_email_settings":
149
  $email_id = intval($_REQUEST["email_id"]);
@@ -155,9 +156,10 @@ else
155
  $email_id
156
  )
157
  );
158
- die();
159
  break;
160
  }
 
161
  }
162
  }
163
- ?>
10
  case "author":
11
  $cb_user_role_permission = "publish_posts";
12
  break;
13
+
14
  }
15
  if (!current_user_can($cb_user_role_permission))
16
  {
74
  break;
75
  case "contributor":
76
  break;
77
+
78
  case "subscriber":
79
  break;
80
+
81
  }
82
  ?>
83
+
84
  </td>
85
  </tr>
86
  <?php
93
  "bAutoWidth": true,
94
  "sPaginationType": "full_numbers",
95
  "sDom": "<\"datatable-header\"fl>t<\"datatable-footer\"ip>",
96
+ "oLanguage":
97
  {
98
  "sLengthMenu": "<span>Show entries:</span> _MENU_"
99
  },
101
  });
102
  </script>
103
  <?php
104
+
105
  break;
106
  case "insert_email_controls":
107
  $form_id = isset($_REQUEST["form_id"]) ? intval($_REQUEST["form_id"]) : "";
108
  $email_id = isset($_REQUEST["email_id"]) ? intval($_REQUEST["email_id"]) : "";
109
+ parse_str(base64_decode($_REQUEST["data"]),$email_settings_data);
110
+ $uxDescription_email = esc_html($email_settings_data["uxEmailTemplate_hidden"]);
111
+ $email_name = esc_html($email_settings_data["ux_txt_name"]);
112
+ $send_to = intval($email_settings_data["ux_rdl_send_to"]);
113
  if($send_to == 0)
114
  {
115
+ $email_address = esc_html($email_settings_data["ux_txt_email"]);
116
  }
117
  else
118
  {
119
+ $email_address = esc_html($email_settings_data["ux_txt_send_to_field"]);
120
  }
121
+ $email_from_name = esc_html($email_settings_data["ux_txt_from_name"]);
122
+ $email_from_email = esc_html($email_settings_data["ux_txt_from_email"]);
123
+ $email_reply_to = esc_html($email_settings_data["ux_txt_reply_to"]);
124
+ $email_cc = esc_html($email_settings_data["ux_txt_cc"]);
125
+ $email_bcc = esc_html($email_settings_data["ux_txt_bcc"]);
126
+ $email_subject = esc_html($email_settings_data["ux_txt_subject"]);
127
+
128
  $wpdb->query
129
  (
130
  $wpdb->prepare
144
  $email_id
145
  )
146
  );
147
+
148
  break;
149
  case "delete_email_settings":
150
  $email_id = intval($_REQUEST["email_id"]);
156
  $email_id
157
  )
158
  );
159
+
160
  break;
161
  }
162
+ die();
163
  }
164
  }
165
+ ?>
lib/contact_bank_email_management.php CHANGED
@@ -23,14 +23,15 @@ if(isset($_REQUEST["param"]))
23
  $form_submit_id
24
  )
25
  );
 
26
  for($flag=0;$flag<count($email_content); $flag++)
27
  {
28
  $email_exits = "";
29
  $email_to = $email_content[$flag]->email_to;
30
- $email_from = stripslashes($email_content[$flag]->email_from);
31
- $messageTxt = stripcslashes($email_content[$flag]->body_content);
32
- $email_subject = stripslashes($email_content[$flag]->subject);
33
- $email_from_name = stripslashes(htmlspecialchars_decode($email_content[$flag]->from_name, ENT_QUOTES));
34
  $email_reply_to = $email_content[$flag]->reply_to;
35
  $email_cc = $email_content[$flag]->cc;
36
  $email_bcc = $email_content[$flag]->bcc;
@@ -49,7 +50,7 @@ if(isset($_REQUEST["param"]))
49
  $chk_options = str_replace("-",", ", $frontend_control_value[$flag1]->dynamic_frontend_value);
50
  $messageTxt = str_replace("[control_".$dynamicId."]",$chk_options, $messageTxt);
51
  }
52
- else
53
  {
54
  $messageTxt = str_replace("[control_".$dynamicId."]",$frontend_control_value[$flag1]->dynamic_frontend_value, $messageTxt);
55
  }
@@ -69,15 +70,15 @@ if(isset($_REQUEST["param"]))
69
  if($email_cc != "")
70
  {
71
  $headers .= "Cc: " .$email_cc. "\r\n";
72
- }
73
  if($email_bcc != "")
74
  {
75
  $headers .= "Bcc: " .$email_bcc."\r\n";
76
- }
77
  get_option("blog_charset") . "\r\n";
78
  wp_mail($email_to, $email_subject, $body_content, $headers);
79
  }
80
  die();
81
  }
82
  }
83
- ?>
23
  $form_submit_id
24
  )
25
  );
26
+
27
  for($flag=0;$flag<count($email_content); $flag++)
28
  {
29
  $email_exits = "";
30
  $email_to = $email_content[$flag]->email_to;
31
+ $email_from = htmlspecialchars_decode($email_content[$flag]->email_from);
32
+ $messageTxt = htmlspecialchars_decode($email_content[$flag]->body_content);
33
+ $email_subject = htmlspecialchars_decode($email_content[$flag]->subject, ENT_QUOTES);
34
+ $email_from_name = htmlspecialchars_decode($email_content[$flag]->from_name, ENT_QUOTES);
35
  $email_reply_to = $email_content[$flag]->reply_to;
36
  $email_cc = $email_content[$flag]->cc;
37
  $email_bcc = $email_content[$flag]->bcc;
50
  $chk_options = str_replace("-",", ", $frontend_control_value[$flag1]->dynamic_frontend_value);
51
  $messageTxt = str_replace("[control_".$dynamicId."]",$chk_options, $messageTxt);
52
  }
53
+ else
54
  {
55
  $messageTxt = str_replace("[control_".$dynamicId."]",$frontend_control_value[$flag1]->dynamic_frontend_value, $messageTxt);
56
  }
70
  if($email_cc != "")
71
  {
72
  $headers .= "Cc: " .$email_cc. "\r\n";
73
+ }
74
  if($email_bcc != "")
75
  {
76
  $headers .= "Bcc: " .$email_bcc."\r\n";
77
+ }
78
  get_option("blog_charset") . "\r\n";
79
  wp_mail($email_to, $email_subject, $body_content, $headers);
80
  }
81
  die();
82
  }
83
  }
84
+ ?>
lib/contact_bank_frontend-class.php CHANGED
@@ -6,6 +6,8 @@ if(isset($_REQUEST["param"]))
6
  {
7
  $form_id = intval($_REQUEST["form_id"]);
8
  $rand = intval($_REQUEST["rand"]);
 
 
9
  $fields = $wpdb->get_results
10
  (
11
  $wpdb->prepare
@@ -40,7 +42,7 @@ if(isset($_REQUEST["param"]))
40
  switch($field_id)
41
  {
42
  case 1:
43
- $ux_txt = esc_attr(stripslashes($_REQUEST["ux_txt_control_".$dynamicId."_".$rand]));
44
  $wpdb->query
45
  (
46
  $wpdb->prepare
@@ -55,7 +57,7 @@ if(isset($_REQUEST["param"]))
55
  );
56
  break;
57
  case 2:
58
- $ux_textarea = esc_attr(stripslashes($_REQUEST["ux_textarea_control_".$dynamicId."_".$rand]));
59
  $wpdb->query
60
  (
61
  $wpdb->prepare
@@ -70,7 +72,7 @@ if(isset($_REQUEST["param"]))
70
  );
71
  break;
72
  case 3:
73
- $ux_email = esc_attr(stripslashes($_REQUEST["ux_txt_email_".$dynamicId."_".$rand]));
74
  $wpdb->query
75
  (
76
  $wpdb->prepare
@@ -85,14 +87,14 @@ if(isset($_REQUEST["param"]))
85
  );
86
  break;
87
  case 4:
88
- $ux_dropdown = "Untitled";
89
- if(esc_attr($_REQUEST["ux_select_default_".$dynamicId."_".$rand]) == " ")
90
  {
91
- $ux_dropdown = "Untitled";
92
  }
93
- else
94
  {
95
- $ux_dropdown = esc_attr($_REQUEST["ux_select_default_".$dynamicId."_".$rand]);
96
  }
97
  $wpdb->query
98
  (
@@ -108,50 +110,36 @@ if(isset($_REQUEST["param"]))
108
  );
109
  break;
110
  case 5:
111
- if(isset($_REQUEST[$dynamicId."_".$rand."_chk"]))
 
 
 
 
 
 
112
  {
113
- $ux_checkbox = esc_sql($_REQUEST[$dynamicId ."_".$rand."_chk"]);
114
- $checkbox_options = "";
115
- for($flag1 =0;$flag1<count($ux_checkbox);$flag1++)
116
  {
117
- $checkbox_options .= $ux_checkbox[$flag1];
118
- if($flag1 < count($ux_checkbox)-1)
119
- {
120
- $checkbox_options .= "-";
121
- }
122
  }
123
- $wpdb->query
124
- (
125
- $wpdb->prepare
126
- (
127
- "INSERT INTO " . frontend_controls_data_Table(). " (form_id,field_id,dynamic_control_id,dynamic_frontend_value,form_submit_id) VALUES(%d,%d,%d,%s,%d)",
128
- $form_id,
129
- $field_id,
130
- $control_dynamicId,
131
- $checkbox_options,
132
- $form_submit_id
133
- )
134
- );
135
  }
136
- else
137
- {
138
- $checkbox_options = "Untitled";
139
- $wpdb->query
140
  (
141
- $wpdb->prepare
142
- (
143
- "INSERT INTO " . frontend_controls_data_Table(). " (form_id,field_id,dynamic_control_id,dynamic_frontend_value,form_submit_id) VALUES(%d,%d,%d,%s,%d)",
144
- $form_id,
145
- $field_id,
146
- $control_dynamicId,
147
- $checkbox_options,
148
- $form_submit_id
149
- )
150
- );
151
- }
152
- break;
153
- case 6:
154
- $ux_multiple = isset($_REQUEST[$dynamicId ."_".$rand."_rdl"]) ? esc_attr($_REQUEST[$dynamicId ."_".$rand."_rdl"]) : "Untitled";
155
  $wpdb->query
156
  (
157
  $wpdb->prepare
@@ -160,14 +148,31 @@ if(isset($_REQUEST["param"]))
160
  $form_id,
161
  $field_id,
162
  $control_dynamicId,
163
- $ux_multiple,
164
  $form_submit_id
165
  )
166
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  break;
168
  }
169
  }
170
  die();
171
  }
172
  }
173
- ?>
6
  {
7
  $form_id = intval($_REQUEST["form_id"]);
8
  $rand = intval($_REQUEST["rand"]);
9
+ parse_str(base64_decode($_REQUEST["data"]),$frontend_form_submit_data);
10
+
11
  $fields = $wpdb->get_results
12
  (
13
  $wpdb->prepare
42
  switch($field_id)
43
  {
44
  case 1:
45
+ $ux_txt = esc_html($frontend_form_submit_data["ux_txt_control_".$dynamicId."_".$rand]);
46
  $wpdb->query
47
  (
48
  $wpdb->prepare
57
  );
58
  break;
59
  case 2:
60
+ $ux_textarea = esc_html($frontend_form_submit_data["ux_textarea_control_".$dynamicId."_".$rand]);
61
  $wpdb->query
62
  (
63
  $wpdb->prepare
72
  );
73
  break;
74
  case 3:
75
+ $ux_email = esc_html($frontend_form_submit_data["ux_txt_email_".$dynamicId."_".$rand]);
76
  $wpdb->query
77
  (
78
  $wpdb->prepare
87
  );
88
  break;
89
  case 4:
90
+
91
+ if(esc_attr($frontend_form_submit_data["ux_select_default_".$dynamicId."_".$rand]) == " ")
92
  {
93
+ $ux_dropdown = "";
94
  }
95
+ else
96
  {
97
+ $ux_dropdown = esc_html($frontend_form_submit_data["ux_select_default_".$dynamicId."_".$rand]);
98
  }
99
  $wpdb->query
100
  (
110
  );
111
  break;
112
  case 5:
113
+
114
+ if(isset($frontend_form_submit_data[$dynamicId."_".$rand."_chk"]))
115
+ {
116
+
117
+ $ux_checkbox = $frontend_form_submit_data[$dynamicId ."_".$rand."_chk"];
118
+ $checkbox_options = "";
119
+ for($flag1 =0;$flag1<count($ux_checkbox);$flag1++)
120
  {
121
+ $checkbox_options .= esc_html($ux_checkbox[$flag1]);
122
+ if($flag1 < count($ux_checkbox)-1)
 
123
  {
124
+ $checkbox_options .= "-";
 
 
 
 
125
  }
 
 
 
 
 
 
 
 
 
 
 
 
126
  }
127
+ $wpdb->query
128
+ (
129
+ $wpdb->prepare
 
130
  (
131
+ "INSERT INTO " . frontend_controls_data_Table(). " (form_id,field_id,dynamic_control_id,dynamic_frontend_value,form_submit_id) VALUES(%d,%d,%d,%s,%d)",
132
+ $form_id,
133
+ $field_id,
134
+ $control_dynamicId,
135
+ $checkbox_options,
136
+ $form_submit_id
137
+ )
138
+ );
139
+ }
140
+ else
141
+ {
142
+ $checkbox_options = "";
 
 
143
  $wpdb->query
144
  (
145
  $wpdb->prepare
148
  $form_id,
149
  $field_id,
150
  $control_dynamicId,
151
+ $checkbox_options,
152
  $form_submit_id
153
  )
154
  );
155
+ }
156
+ break;
157
+ case 6:
158
+
159
+ $ux_multiple = isset($frontend_form_submit_data[$dynamicId ."_".$rand."_rdl"]) ? esc_html($frontend_form_submit_data[$dynamicId ."_".$rand."_rdl"]) : "Untitled";
160
+ $wpdb->query
161
+ (
162
+ $wpdb->prepare
163
+ (
164
+ "INSERT INTO " . frontend_controls_data_Table(). " (form_id,field_id,dynamic_control_id,dynamic_frontend_value,form_submit_id) VALUES(%d,%d,%d,%s,%d)",
165
+ $form_id,
166
+ $field_id,
167
+ $control_dynamicId,
168
+ $ux_multiple,
169
+ $form_submit_id
170
+ )
171
+ );
172
  break;
173
  }
174
  }
175
  die();
176
  }
177
  }
178
+ ?>
lib/contact_bank_show_form_control_data-class.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
-
3
  switch($cb_role)
4
  {
5
  case "administrator":
@@ -11,7 +11,7 @@
11
  case "author":
12
  $cb_user_role_permission = "publish_posts";
13
  break;
14
-
15
  }
16
  if (!current_user_can($cb_user_role_permission))
17
  {
@@ -51,13 +51,13 @@ else
51
  $form_settings[$dynamicId]["control_id"] = intval($control_id);
52
  for($flag = 0; $flag<count($form_data);$flag++)
53
  {
54
- if($form_data[$flag]->dynamic_settings_key == "cb_dropdown_option_id" || $form_data[$flag]->dynamic_settings_key == "cb_dropdown_option_val"
55
  || $form_data[$flag]->dynamic_settings_key == "cb_checkbox_option_id" || $form_data[$flag]->dynamic_settings_key == "cb_checkbox_option_val"
56
  || $form_data[$flag]->dynamic_settings_key == "cb_radio_option_id" || $form_data[$flag]->dynamic_settings_key == "cb_radio_option_val")
57
  {
58
  $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = unserialize($form_data[$flag]->dynamic_settings_value);
59
  }
60
- else
61
  {
62
  $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = $form_data[$flag]->dynamic_settings_value;
63
  }
@@ -65,6 +65,6 @@ else
65
  }
66
  echo json_encode($form_settings);
67
  die();
68
- }
69
  }
70
- }
1
  <?php
2
+
3
  switch($cb_role)
4
  {
5
  case "administrator":
11
  case "author":
12
  $cb_user_role_permission = "publish_posts";
13
  break;
14
+
15
  }
16
  if (!current_user_can($cb_user_role_permission))
17
  {
51
  $form_settings[$dynamicId]["control_id"] = intval($control_id);
52
  for($flag = 0; $flag<count($form_data);$flag++)
53
  {
54
+ if($form_data[$flag]->dynamic_settings_key == "cb_dropdown_option_id" || $form_data[$flag]->dynamic_settings_key == "cb_dropdown_option_val"
55
  || $form_data[$flag]->dynamic_settings_key == "cb_checkbox_option_id" || $form_data[$flag]->dynamic_settings_key == "cb_checkbox_option_val"
56
  || $form_data[$flag]->dynamic_settings_key == "cb_radio_option_id" || $form_data[$flag]->dynamic_settings_key == "cb_radio_option_val")
57
  {
58
  $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = unserialize($form_data[$flag]->dynamic_settings_value);
59
  }
60
+ else
61
  {
62
  $form_settings[$dynamicId][$form_data[$flag]->dynamic_settings_key] = $form_data[$flag]->dynamic_settings_value;
63
  }
65
  }
66
  echo json_encode($form_settings);
67
  die();
68
+ }
69
  }
70
+ }
lib/contact_view-class.php CHANGED
@@ -10,7 +10,7 @@
10
  case "author":
11
  $cb_user_role_permission = "publish_posts";
12
  break;
13
-
14
  }
15
  if(!current_user_can($cb_user_role_permission))
16
  {
@@ -30,56 +30,25 @@ else
30
  {
31
  case 1:
32
  include_once CONTACT_BK_PLUGIN_DIR ."/includes/cb_text.php";
33
- break;
34
  case 2:
35
  include_once CONTACT_BK_PLUGIN_DIR ."/includes/cb_textarea.php";
36
- break;
37
  case 3:
38
  include_once CONTACT_BK_PLUGIN_DIR ."/includes/cb_email.php";
39
- break;
40
  case 4:
41
  include_once CONTACT_BK_PLUGIN_DIR ."/includes/cb_dropdown.php";
42
- break;
43
  case 5:
44
  include_once CONTACT_BK_PLUGIN_DIR ."/includes/cb_checkbox.php";
45
- break;
46
  case 6:
47
  include_once CONTACT_BK_PLUGIN_DIR ."/includes/cb_multiple.php";
48
  break;
49
- case 7:
50
- include_once CONTACT_BK_PLUGIN_DIR ."/includes/cb_number.php";
51
- break;
52
- case 8:
53
- include_once CONTACT_BK_PLUGIN_DIR ."/includes/cb_name.php";
54
- break;
55
- case 9:
56
- include_once CONTACT_BK_PLUGIN_DIR ."/includes/cb_file_upload.php";
57
- break;
58
- case 10:
59
- include_once CONTACT_BK_PLUGIN_DIR ."/includes/cb_phone.php";
60
- break;
61
- case 11:
62
- include_once CONTACT_BK_PLUGIN_DIR ."/includes/cb_address.php";
63
- break;
64
- case 12:
65
- include_once CONTACT_BK_PLUGIN_DIR ."/includes/cb_date.php";
66
- break;
67
- case 13:
68
- include_once CONTACT_BK_PLUGIN_DIR ."/includes/cb_time.php";
69
- break;
70
- case 14:
71
- include_once CONTACT_BK_PLUGIN_DIR ."/includes/cb_hidden.php";
72
- break;
73
- case 15:
74
- include_once CONTACT_BK_PLUGIN_DIR ."/includes/cb_password.php";
75
- break;
76
- case 16:
77
- include_once CONTACT_BK_PLUGIN_DIR ."/includes/cb_url.php";
78
- break;
79
  }
80
- die();
81
  break;
82
-
83
  case "delete_form":
84
  $form_id = intval($_REQUEST["id"]);
85
  $control_id = $wpdb->get_results
@@ -162,11 +131,11 @@ else
162
  $form_id
163
  )
164
  );
165
- die();
166
  break;
167
-
168
  case "delete_forms":
169
-
170
  global $wpdb;
171
  $wpdb->query
172
  (
@@ -200,753 +169,735 @@ else
200
  (
201
  "TRUNCATE Table ".contact_bank_contact_form()
202
  );
203
- die();
204
  break;
205
-
206
  case "submit_form_messages_settings":
207
-
208
- $sql= "";
209
- $labels_for_email = "";
210
- $sql1=array();
211
- $form_id = intval($_REQUEST["form_id"]);
212
- $form_settings = json_decode(urldecode(stripcslashes($_REQUEST["form_settings"])),true);
213
- $array_delete_form_controls = json_decode(stripcslashes($_REQUEST["array_delete_form_controls"]),true);
214
- foreach($array_delete_form_controls as $element)
215
- {
216
- $sql1[] = $element;
217
- }
218
- if(count($sql1) > 0)
219
- {
220
- $wpdb->query
221
- (
222
- $wpdb->prepare
 
 
 
 
 
223
  (
224
- "Delete FROM " . contact_bank_dynamic_settings_form() . " where dynamicId in (".implode(',', $sql1).")",""
225
- )
226
- );
227
- $wpdb->query
228
- (
229
- $wpdb->prepare
 
230
  (
231
- "Delete FROM " . create_control_Table() . " where control_id in (".implode(',', $sql1).")",""
232
- )
233
- );
234
- }
235
- foreach($form_settings as $element)
236
- {
237
- foreach ($element as $val => $keyInner)
238
  {
239
- if($val == "form_name")
240
  {
241
- $form_name=htmlspecialchars(htmlspecialchars_decode($keyInner));
242
  $wpdb->query
243
  (
244
  $wpdb->prepare
245
  (
246
- "UPDATE " . contact_bank_contact_form() . " SET `form_name` =%s where form_id = %d ",
247
- $form_name,
248
  $form_id
249
  )
250
  );
251
  }
252
  else
253
  {
254
- $labels_for_email = $val;
255
- if($val == "redirect_url")
256
- {
257
- $sql .= ' WHEN `form_message_key` = "'.($val).'" THEN "'.html_entity_decode($keyInner).'"';
258
- }
259
- else
260
- {
261
- $sql .= ' WHEN `form_message_key` = "'.($val).'" THEN "'.htmlspecialchars(htmlspecialchars_decode($keyInner)).'"';
262
- }
 
263
  }
264
  }
265
- $wpdb->query
266
  (
267
  $wpdb->prepare
268
  (
269
- "UPDATE " . contact_bank_form_settings_Table() . " SET `form_message_value` = CASE ". strip_tags($sql) . " END where form_id = %d ",
270
- $form_id
 
 
271
  )
272
  );
273
- }
274
- $fields_created = $wpdb->get_results
275
- (
276
- $wpdb->prepare
277
- (
278
- "SELECT dynamicId, dynamic_settings_value,field_id FROM ". contact_bank_dynamic_settings_form(). " JOIN " . create_control_Table(). " ON " . contact_bank_dynamic_settings_form().". dynamicId = ". create_control_Table(). ".control_id WHERE `dynamic_settings_key` = 'cb_admin_label' and form_id = %d Order By ".create_control_Table().".sorting_order",
279
- $form_id
280
- )
281
- );
282
- $controls = "";
283
- $email_dynamicId = "";
284
- for($flag=0;$flag<count($fields_created);$flag++)
285
- {
286
- $show_in_email = $wpdb->get_var
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  (
288
  $wpdb->prepare
289
  (
290
- "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
291
- $fields_created[$flag]->dynamicId
 
 
 
292
  )
293
  );
294
- if($show_in_email == "0")
295
- {
296
- $controls .= "<strong>".$fields_created[$flag]->dynamic_settings_value ."</strong>: ". "[control_".$fields_created[$flag]->dynamicId."] <br>";
297
- }
298
- if($fields_created[$flag]->field_id == 3)
299
- {
300
- $email_dynamicId = $fields_created[$flag]->dynamicId;
301
- }
302
- }
303
- $body_message = "Hello Admin,<br><br>
304
- A new user visited your website.<br><br>
305
- Here are the details :<br><br>
306
- ".$controls."
307
- <br>Thanks,<br><br>
308
- <strong>Technical Support Team</strong>";
309
- $wpdb->query
310
- (
311
- $wpdb->prepare
312
- (
313
- "UPDATE " . contact_bank_email_template_admin() . " SET `body_content` = %s where form_id = %d and name = %s",
314
- $body_message,
315
- $form_id,
316
- "Admin Notification"
317
- )
318
- );
319
- $wpdb->query
320
- (
321
- $wpdb->prepare
322
  (
323
- "UPDATE " . contact_bank_email_template_admin() . " SET `email_to` = %s where form_id = %d and name = %s",
324
- "[control_".$email_dynamicId."]",
325
- $form_id,
326
- "Client Notification"
327
- )
328
- );
329
- $wpdb->query
330
- (
331
- $wpdb->prepare
332
  (
333
- "UPDATE " . contact_bank_email_template_admin() . " SET `send_to` = %d where form_id = %d and name = %s",
334
- 1,
335
- $form_id,
336
- "Client Notification"
337
- )
338
- );
339
- die();
340
- break;
341
-
342
- case "restore_factory_settings":
343
-
344
- include_once CONTACT_BK_PLUGIN_DIR ."/lib/restore_factory_settings.php";
345
- die();
346
-
347
  break;
348
-
349
  case "save_text_control":
350
-
351
- $dynamic_Id = intval($_REQUEST["ux_hd_textbox_dynamic_id"]);
352
- $form_id = intval($_REQUEST["form_id"]);
353
- $event = esc_attr($_REQUEST["event"]);
354
- $controlId = isset($_REQUEST["controlId"]) ? intval($_REQUEST["controlId"]) : 0;
355
- $form_settings = isset($_REQUEST["form_settings"]) ? json_decode(stripcslashes($_REQUEST["form_settings"]),true) : array();
356
- $form_settings[$dynamic_Id]["dynamic_id"] = $dynamic_Id;
357
- $form_settings[$dynamic_Id]["control_type"] = "1";
358
- $form_settings[$dynamic_Id]["cb_label_value"] = isset($_REQUEST["ux_label_text_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_label_text_".$dynamic_Id]) : "Untitled";
359
- $form_settings[$dynamic_Id]["cb_description"] = isset($_REQUEST["ux_description_control_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_description_control_".$dynamic_Id]) : "";
360
- $form_settings[$dynamic_Id]["cb_control_required"] = isset($_REQUEST["ux_required_control_radio_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_required_control_radio_".$dynamic_Id]) : "0";
361
- $form_settings[$dynamic_Id]["cb_tooltip_txt"] = isset($_REQUEST["ux_tooltip_control_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_tooltip_control_".$dynamic_Id]) : "";
362
- $form_settings[$dynamic_Id]["cb_default_txt_val"] = isset($_REQUEST["ux_default_value_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_default_value_".$dynamic_Id]) : "";
363
- $form_settings[$dynamic_Id]["cb_admin_label"] = isset($_REQUEST["ux_admin_label_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_admin_label_".$dynamic_Id]) : "Untitled";
364
- $form_settings[$dynamic_Id]["cb_show_email"] = isset($_REQUEST["ux_show_email_".$dynamic_Id]) ? "1" : "0";
365
- $form_settings[$dynamic_Id]["cb_checkbox_alpha_filter"] = isset($_REQUEST["ux_checkbox_alpha_filter_".$dynamic_Id]) ? "1" : "0";
366
- $form_settings[$dynamic_Id]["cb_ux_checkbox_alpha_num_filter"] = isset($_REQUEST["ux_checkbox_alpha_num_filter_".$dynamic_Id]) ? "1" : "0";
367
- $form_settings[$dynamic_Id]["cb_checkbox_digit_filter"] = isset($_REQUEST["ux_checkbox_digit_filter_".$dynamic_Id]) ? "1" : "0";
368
- $form_settings[$dynamic_Id]["cb_checkbox_strip_tag_filter"] = isset($_REQUEST["ux_checkbox_strip_tag_filter_".$dynamic_Id]) ? "1" : "0";
369
- $form_settings[$dynamic_Id]["cb_checkbox_trim_filter"] = isset($_REQUEST["ux_checkbox_trim_filter_".$dynamic_Id]) ? "1" : "0";
370
-
371
- foreach($form_settings as $element)
372
- {
373
- $id = $element["dynamic_id"];
374
- $control_type = $element["control_type"];
375
- if($event == "add")
376
  {
377
- $wpdb->query
378
- (
379
- $wpdb->prepare
380
- (
381
- "INSERT INTO " . create_control_Table() . "(form_id,field_id,column_dynamicId) VALUES(%d,%d,%d)",
382
- $form_id,
383
- $control_type,
384
- $id
385
- )
386
- );
387
- echo $dynamic_control_id=$wpdb->insert_id;
388
- $wpdb->query
389
- (
390
- $wpdb->prepare
391
- (
392
- "UPDATE " . create_control_Table() . " SET `sorting_order` = %d where form_id = %d and field_id = %d and column_dynamicId = %d",
393
- $dynamic_control_id,
394
- $form_id,
395
- $control_type,
396
- $id
397
- )
398
- );
399
  }
400
  else
401
  {
402
- $sql= "";
403
- }
404
- foreach($element as $key => $value)
405
- {
406
- if($key == "dynamic_id" || $key == "control_type")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
407
  {
408
- continue;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
409
  }
410
- else
411
  {
412
- if($event == "add")
413
  {
414
- $sql[] = '('.$dynamic_control_id.',"'.$key.'", "'.$value.'")';
415
  }
416
- else {
417
- $sql .= 'WHEN `dynamic_settings_key` = "'.$key.'" THEN "'.$value.'"';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
418
  }
419
  }
420
  }
421
- if($event == "add")
 
 
 
 
 
 
 
422
  {
423
- $wpdb->query
424
- (
425
- $wpdb->prepare
426
- (
427
- "INSERT INTO " . contact_bank_dynamic_settings_form() . "(dynamicId,dynamic_settings_key,dynamic_settings_value) VALUES ".implode(',', $sql),""
428
- )
429
- );
430
  }
431
  else
432
  {
433
- $wpdb->query
434
- (
435
- $wpdb->prepare
436
- (
437
- "UPDATE " . contact_bank_dynamic_settings_form() . " SET `dynamic_settings_value` = CASE ".strip_tags($sql). " END where dynamicId = %d ",
438
- $controlId
439
- )
440
- );
441
- }
442
- }
443
- die();
444
- break;
445
-
446
- case "save_textarea_control":
447
-
448
- $dynamic_Id = intval($_REQUEST["ux_hd_textbox_dynamic_id"]);
449
- $form_id = intval($_REQUEST["form_id"]);
450
- $event = esc_attr($_REQUEST["event"]);
451
- $controlId = isset($_REQUEST["controlId"]) ? intval($_REQUEST["controlId"]) : 0;
452
- $form_settings = isset($_REQUEST["form_settings"]) ? json_decode(stripcslashes($_REQUEST["form_settings"]),true) : array();
453
- $form_settings[$dynamic_Id]["dynamic_id"] = $dynamic_Id;
454
- $form_settings[$dynamic_Id]["control_type"] = "2";
455
- $form_settings[$dynamic_Id]["cb_label_value"] = isset($_REQUEST["ux_label_text_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_label_text_".$dynamic_Id]) : "Untitled";
456
- $form_settings[$dynamic_Id]["cb_description"] = isset($_REQUEST["ux_description_control_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_description_control_".$dynamic_Id]) : "";
457
- $form_settings[$dynamic_Id]["cb_control_required"] = isset($_REQUEST["ux_required_control_radio_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_required_control_radio_".$dynamic_Id]) : "0";
458
- $form_settings[$dynamic_Id]["cb_tooltip_txt"] = isset($_REQUEST["ux_tooltip_control_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_tooltip_control_".$dynamic_Id]) : "";
459
- $form_settings[$dynamic_Id]["cb_default_txt_val"] = isset($_REQUEST["ux_default_value_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_default_value_".$dynamic_Id]) : "";
460
- $form_settings[$dynamic_Id]["cb_admin_label"] = isset($_REQUEST["ux_admin_label_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_admin_label_".$dynamic_Id]) : "Untitled";
461
- $form_settings[$dynamic_Id]["cb_show_email"] = isset($_REQUEST["ux_show_email_".$dynamic_Id]) ? "1" : "0";
462
- $form_settings[$dynamic_Id]["cb_checkbox_alpha_filter"] = isset($_REQUEST["ux_checkbox_alpha_filter_".$dynamic_Id]) ? "1" : "0";
463
- $form_settings[$dynamic_Id]["cb_ux_checkbox_alpha_num_filter"] = isset($_REQUEST["ux_checkbox_alpha_num_filter_".$dynamic_Id]) ? "1" : "0";
464
- $form_settings[$dynamic_Id]["cb_checkbox_digit_filter"] = isset($_REQUEST["ux_checkbox_digit_filter_".$dynamic_Id]) ? "1" : "0";
465
- $form_settings[$dynamic_Id]["cb_checkbox_strip_tag_filter"] = isset($_REQUEST["ux_checkbox_strip_tag_filter_".$dynamic_Id]) ? "1" : "0";
466
- $form_settings[$dynamic_Id]["cb_checkbox_trim_filter"] = isset($_REQUEST["ux_checkbox_trim_filter_".$dynamic_Id]) ? "1" : "0";
467
-
468
- foreach($form_settings as $element)
469
- {
470
- $id = $element["dynamic_id"];
471
- $control_type = $element["control_type"];
472
- if($event == "add")
473
- {
474
- $wpdb->query
475
- (
476
- $wpdb->prepare
477
  (
478
- "INSERT INTO " . create_control_Table() . "(form_id,field_id,column_dynamicId) VALUES(%d,%d,%d)",
479
- $form_id,
480
- $control_type,
481
- $id
482
- )
483
- );
484
- echo $dynamic_control_id=$wpdb->insert_id;
485
- $wpdb->query
486
- (
487
- $wpdb->prepare
488
  (
489
- "UPDATE " . create_control_Table() . " SET `sorting_order` = %d where form_id = %d and field_id = %d and column_dynamicId = %d",
490
- $dynamic_control_id,
491
- $form_id,
492
- $control_type,
493
- $id
494
- )
495
- );
496
- }
497
- else
498
- {
499
- $sql= "";
500
- }
501
- foreach($element as $key => $value)
502
- {
503
- if($key == "dynamic_id" || $key == "control_type")
504
- {
505
- continue;
506
  }
507
- else
508
  {
509
- if($event == "add")
510
  {
511
- $sql[] = '('.$dynamic_control_id.',"'.$key.'", "'.$value.'")';
512
  }
513
  else
514
  {
515
- $sql .= 'WHEN `dynamic_settings_key` = "'.$key.'" THEN "'.$value.'"';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
516
  }
517
  }
518
  }
519
- if($event == "add")
 
 
 
 
 
 
 
520
  {
521
- $wpdb->query
522
- (
523
- $wpdb->prepare
524
- (
525
- "INSERT INTO " . contact_bank_dynamic_settings_form() . "(dynamicId,dynamic_settings_key,dynamic_settings_value) VALUES ".implode(',', $sql),""
526
- )
527
- );
528
  }
529
  else
530
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
531
  $wpdb->query
532
- (
533
- $wpdb->prepare
534
- (
535
- "UPDATE " . contact_bank_dynamic_settings_form() . " SET `dynamic_settings_value` = CASE ".$sql . " END where dynamicId = %d ",
536
- $controlId
537
- )
538
- );
539
- }
540
- }
541
- die();
542
- break;
543
-
544
- case "save_email_control":
545
-
546
- $dynamic_Id = intval($_REQUEST["ux_hd_textbox_dynamic_id"]);
547
- $form_id = intval($_REQUEST["form_id"]);
548
- $event = esc_attr($_REQUEST["event"]);
549
- $controlId = isset($_REQUEST["controlId"]) ? intval($_REQUEST["controlId"]) : 0;
550
- $form_settings = isset($_REQUEST["form_settings"]) ? json_decode(stripcslashes($_REQUEST["form_settings"]),true) : array();
551
- $form_settings[$dynamic_Id]["dynamic_id"] = $dynamic_Id;
552
- $form_settings[$dynamic_Id]["control_type"] = "3";
553
- $form_settings[$dynamic_Id]["cb_label_value"] = isset($_REQUEST["ux_label_text_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_label_text_".$dynamic_Id]) : "Email";
554
- $form_settings[$dynamic_Id]["cb_description"] = isset($_REQUEST["ux_description_control_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_description_control_".$dynamic_Id]) : "";
555
- $form_settings[$dynamic_Id]["cb_control_required"] = isset($_REQUEST["ux_required_control_radio_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_required_control_radio_".$dynamic_Id]) : "1";
556
- $form_settings[$dynamic_Id]["cb_tooltip_txt"] = isset($_REQUEST["ux_tooltip_control_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_tooltip_control_".$dynamic_Id]) : "";
557
- $form_settings[$dynamic_Id]["cb_default_txt_val"] = isset($_REQUEST["ux_default_value_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_default_value_".$dynamic_Id]) : "";
558
- $form_settings[$dynamic_Id]["cb_admin_label"] = isset($_REQUEST["ux_default_value_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_admin_label_".$dynamic_Id]) : "Email";
559
- $form_settings[$dynamic_Id]["cb_show_email"] = isset($_REQUEST["ux_show_email_".$dynamic_Id]) ? "1" : "0";
560
-
561
- foreach($form_settings as $element)
562
- {
563
- $id = $element["dynamic_id"];
564
- $control_type = $element["control_type"];
565
- if($event == "add")
566
- {
567
- $wpdb->query
568
- (
569
- $wpdb->prepare
570
  (
571
- "INSERT INTO " . create_control_Table() . "(form_id,field_id,column_dynamicId) VALUES(%d,%d,%d)",
572
- $form_id,
573
- $control_type,
574
- $id
575
- )
576
- );
577
- echo $dynamic_control_id=$wpdb->insert_id;
578
- $wpdb->query
579
- (
580
- $wpdb->prepare
581
  (
582
- "UPDATE " . create_control_Table() . " SET `sorting_order` = %d where form_id = %d and field_id = %d and column_dynamicId = %d",
583
- $dynamic_control_id,
584
- $form_id,
585
- $control_type,
586
- $id
587
- )
588
- );
589
- }
590
- else
591
- {
592
- $sql= "";
593
- }
594
- foreach($element as $key => $value)
595
- {
596
- if($key == "dynamic_id" || $key == "control_type")
597
- {
598
- continue;
599
  }
600
- else
601
  {
602
- if($event == "add")
603
  {
604
- $sql[] = '('.$dynamic_control_id.',"'.$key.'", "'.$value.'")';
605
  }
606
  else
607
  {
608
- $sql .= 'WHEN `dynamic_settings_key` = "'.$key.'" THEN "'.$value.'"';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
609
  }
610
  }
611
  }
612
- if($event == "add")
 
 
 
 
 
 
 
613
  {
614
- $wpdb->query
615
- (
616
- $wpdb->prepare
617
- (
618
- "INSERT INTO " . contact_bank_dynamic_settings_form() . "(dynamicId,dynamic_settings_key,dynamic_settings_value) VALUES ".implode(',', $sql),""
619
- )
620
- );
621
  }
622
  else
623
  {
624
- $wpdb->query
625
- (
626
- $wpdb->prepare
627
- (
628
- "UPDATE " . contact_bank_dynamic_settings_form() . " SET `dynamic_settings_value` = CASE ".$sql . " END where dynamicId = %d ",
629
- $controlId
630
- )
631
- );
632
- }
633
- }
634
- die();
635
- break;
636
-
637
- case "save_drop_down_control":
638
-
639
- $dynamic_Id = intval($_REQUEST["ux_hd_textbox_dynamic_id"]);
640
- $form_id = intval($_REQUEST["form_id"]);
641
- $event = esc_attr($_REQUEST["event"]);
642
- $controlId = isset($_REQUEST["controlId"]) ? intval($_REQUEST["controlId"]) : 0;
643
- $form_settings = isset($_REQUEST["form_settings"]) ? json_decode(stripcslashes($_REQUEST["form_settings"]),true) : array();
644
- $ddl_options_id = isset($_REQUEST["ddl_options_id"]) ? json_decode(stripcslashes($_REQUEST["ddl_options_id"]),true) : array();
645
- $options_value = isset($_REQUEST["options_value"]) ? json_decode(stripcslashes($_REQUEST["options_value"]),true) : array();
646
- $form_settings[$dynamic_Id]["dynamic_id"] = $dynamic_Id;
647
- $form_settings[$dynamic_Id]["control_type"] = "4";
648
- $form_settings[$dynamic_Id]["cb_label_value"] = isset($_REQUEST["ux_label_text_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_label_text_".$dynamic_Id]) :"Untitled";
649
- $form_settings[$dynamic_Id]["cb_control_required"] = isset($_REQUEST["ux_required_control_radio_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_required_control_radio_".$dynamic_Id]) : "0";
650
- $form_settings[$dynamic_Id]["cb_tooltip_txt"] = isset($_REQUEST["ux_tooltip_control_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_tooltip_control_".$dynamic_Id]) : "";
651
- $form_settings[$dynamic_Id]["cb_admin_label"] = isset($_REQUEST["ux_admin_label_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_admin_label_".$dynamic_Id]) : "Untitled";
652
- $form_settings[$dynamic_Id]["cb_show_email"] = isset($_REQUEST["ux_show_email_".$dynamic_Id]) ? "1" : "0";
653
-
654
- $options = serialize($ddl_options_id);
655
- $options_val = serialize($options_value);
656
- $form_settings[$dynamic_Id]["cb_dropdown_option_id"] = str_replace('"','\"',"$options");
657
- $form_settings[$dynamic_Id]["cb_dropdown_option_val"] = str_replace('"','\"',"$options_val");
658
- foreach($form_settings as $element)
659
- {
660
- $id = $element["dynamic_id"];
661
- $control_type = $element["control_type"];
662
- if($event == "add")
663
- {
664
- $wpdb->query
665
- (
666
- $wpdb->prepare
667
  (
668
- "INSERT INTO " . create_control_Table() . "(form_id,field_id,column_dynamicId) VALUES(%d,%d,%d)",
669
- $form_id,
670
- $control_type,
671
- $id
672
- )
673
- );
674
- echo $dynamic_control_id=$wpdb->insert_id;
675
- $wpdb->query
676
- (
677
- $wpdb->prepare
678
  (
679
- "UPDATE " . create_control_Table() . " SET `sorting_order` = %d where form_id = %d and field_id = %d and column_dynamicId = %d",
680
- $dynamic_control_id,
681
- $form_id,
682
- $control_type,
683
- $id
684
- )
685
- );
686
- }
687
- else
688
- {
689
- $sql= "";
690
- }
691
- foreach($element as $key => $value)
692
- {
693
- if($key == "dynamic_id" || $key == "control_type")
694
- {
695
- continue;
696
  }
697
- else
698
  {
699
- if($event == "add")
700
  {
701
- $sql[] = '('.$dynamic_control_id.',"'.$key.'", "'.$value.'")';
702
  }
703
- else {
704
- $sql .= 'WHEN `dynamic_settings_key` = "'.$key.'" THEN "'.$value.'"';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
705
  }
706
  }
707
  }
708
- if($event == "add")
 
 
 
 
 
 
 
 
709
  {
710
- $wpdb->query
711
- (
712
- $wpdb->prepare
713
- (
714
- "INSERT INTO " . contact_bank_dynamic_settings_form() . "(dynamicId,dynamic_settings_key,dynamic_settings_value) VALUES ".implode(',', $sql),""
715
- )
716
- );
717
  }
718
  else
719
  {
720
- $wpdb->query
721
- (
722
- $wpdb->prepare
723
- (
724
- "UPDATE " . contact_bank_dynamic_settings_form() . " SET `dynamic_settings_value` = CASE ".$sql . " END where dynamicId = %d ",
725
- $controlId
726
- )
727
- );
728
- }
729
- }
730
- die();
731
- break;
732
-
733
- case "save_check_box_control":
734
-
735
- $dynamic_Id = intval($_REQUEST["ux_hd_textbox_dynamic_id"]);
736
- $form_id = intval($_REQUEST["form_id"]);
737
- $event = esc_attr($_REQUEST["event"]);
738
- $controlId = isset($_REQUEST["controlId"]) ? intval($_REQUEST["controlId"]) : 0;
739
- $form_settings = isset($_REQUEST["form_settings"]) ? json_decode(stripcslashes($_REQUEST["form_settings"]),true) : array();
740
- $ddl_options_id = isset($_REQUEST["ddl_options_id"]) ? json_decode(stripcslashes($_REQUEST["ddl_options_id"]),true) : array();
741
- $options_value = isset($_REQUEST["options_value"]) ? json_decode(stripcslashes($_REQUEST["options_value"]),true) : array();
742
- $form_settings[$dynamic_Id]["dynamic_id"] = $dynamic_Id;
743
- $form_settings[$dynamic_Id]["control_type"] = "5";
744
- $form_settings[$dynamic_Id]["cb_label_value"] = isset($_REQUEST["ux_label_text_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_label_text_".$dynamic_Id]) : "Untitled";
745
- $form_settings[$dynamic_Id]["cb_control_required"] = isset($_REQUEST["ux_required_control_radio_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_required_control_radio_".$dynamic_Id]) : "0";
746
- $form_settings[$dynamic_Id]["cb_tooltip_txt"] = isset($_REQUEST["ux_tooltip_control_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_tooltip_control_".$dynamic_Id]) : "";
747
- $form_settings[$dynamic_Id]["cb_admin_label"] = isset($_REQUEST["ux_admin_label_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_admin_label_".$dynamic_Id]) : "Untitled";
748
- $form_settings[$dynamic_Id]["cb_show_email"] = isset($_REQUEST["ux_show_email_".$dynamic_Id]) ? "1" : "0";
749
- $options = serialize($ddl_options_id);
750
- $options_val = serialize($options_value);
751
- $form_settings[$dynamic_Id]["cb_checkbox_option_id"] = str_replace('"','\"',"$options");
752
- $form_settings[$dynamic_Id]["cb_checkbox_option_val"] = str_replace('"','\"',"$options_val");
753
- foreach($form_settings as $element)
754
- {
755
- $id = $element["dynamic_id"];
756
- $control_type = $element["control_type"];
757
- if($event == "add")
758
- {
759
- $wpdb->query
760
- (
761
- $wpdb->prepare
762
  (
763
- "INSERT INTO " . create_control_Table() . "(form_id,field_id,column_dynamicId) VALUES(%d,%d,%d)",
764
- $form_id,
765
- $control_type,
766
- $id
767
- )
768
- );
769
- echo $dynamic_control_id=$wpdb->insert_id;
770
- $wpdb->query
771
- (
772
- $wpdb->prepare
773
  (
774
- "UPDATE " . create_control_Table() . " SET `sorting_order` = %d where form_id = %d and field_id = %d and column_dynamicId = %d",
775
- $dynamic_control_id,
776
- $form_id,
777
- $control_type,
778
- $id
779
- )
780
- );
781
- }
782
- else {
783
- $sql= "";
784
- }
785
- foreach($element as $key => $value)
786
- {
787
- if($key == "dynamic_id" || $key == "control_type")
788
- {
789
- continue;
790
  }
791
- else
 
792
  {
793
- if($event == "add")
794
  {
795
- $sql[] = '('.$dynamic_control_id.',"'.$key.'", "'.$value.'")';
796
  }
797
  else
798
  {
799
- $sql .= 'WHEN `dynamic_settings_key` = "'.$key.'" THEN "'.$value.'"';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
800
  }
801
  }
802
  }
803
- if($event == "add")
 
 
 
 
 
 
 
 
804
  {
805
- $wpdb->query
806
- (
807
- $wpdb->prepare
808
- (
809
- "INSERT INTO " . contact_bank_dynamic_settings_form() . "(dynamicId,dynamic_settings_key,dynamic_settings_value) VALUES ".implode(',', $sql),""
810
- )
811
- );
812
  }
813
  else
814
  {
815
- $wpdb->query
816
- (
817
- $wpdb->prepare
818
- (
819
- "UPDATE " . contact_bank_dynamic_settings_form() . " SET `dynamic_settings_value` = CASE ".$sql . " END where dynamicId = %d ",
820
- $controlId
821
- )
822
- );
823
- }
824
- }
825
- die();
826
- break;
827
- case "save_multiple_control":
828
- $dynamic_Id = intval($_REQUEST["ux_hd_textbox_dynamic_id"]);
829
- $form_id = intval($_REQUEST["form_id"]);
830
- $event = esc_attr($_REQUEST["event"]);
831
- $controlId = isset($_REQUEST["controlId"]) ? intval($_REQUEST["controlId"]) : 0;
832
- $form_settings = isset($_REQUEST["form_settings"]) ? json_decode(stripcslashes($_REQUEST["form_settings"]),true) : array();
833
- $ddl_options_id = isset($_REQUEST["ddl_options_id"]) ? json_decode(stripcslashes($_REQUEST["ddl_options_id"]),true) : array();
834
- $options_value = isset($_REQUEST["options_value"]) ? json_decode(stripcslashes($_REQUEST["options_value"]),true) : array();
835
- $form_settings[$dynamic_Id]["dynamic_id"] = $dynamic_Id;
836
- $form_settings[$dynamic_Id]["control_type"] = "6";
837
- $form_settings[$dynamic_Id]["cb_label_value"] = isset($_REQUEST["ux_label_text_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_label_text_".$dynamic_Id]) : "Untitled";
838
- $form_settings[$dynamic_Id]["cb_control_required"] = isset($_REQUEST["ux_required_control_radio_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_required_control_radio_".$dynamic_Id]) : "0";
839
- $form_settings[$dynamic_Id]["cb_tooltip_txt"] = isset($_REQUEST["ux_tooltip_control_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_tooltip_control_".$dynamic_Id]) : "";
840
- $form_settings[$dynamic_Id]["cb_admin_label"] = isset($_REQUEST["ux_admin_label_".$dynamic_Id]) ? esc_attr($_REQUEST["ux_admin_label_".$dynamic_Id]) : "Untitled";
841
- $form_settings[$dynamic_Id]["cb_show_email"] = isset($_REQUEST["ux_show_email_".$dynamic_Id]) ? "1" : "0";
842
- $options = serialize($ddl_options_id);
843
- $options_val = serialize($options_value);
844
- $form_settings[$dynamic_Id]["cb_radio_option_id"] = str_replace('"','\"',"$options");
845
- $form_settings[$dynamic_Id]["cb_radio_option_val"] = str_replace('"','\"',"$options_val");
846
-
847
- foreach($form_settings as $element)
848
- {
849
- $id = $element["dynamic_id"];
850
- $control_type = $element["control_type"];
851
- if($event == "add")
852
- {
853
- $wpdb->query
854
- (
855
- $wpdb->prepare
856
  (
857
- "INSERT INTO " . create_control_Table() . "(form_id,field_id,column_dynamicId) VALUES(%d,%d,%d)",
858
- $form_id,
859
- $control_type,
860
- $id
861
- )
862
- );
863
- echo $dynamic_control_id=$wpdb->insert_id;
864
- $wpdb->query
865
- (
866
- $wpdb->prepare
867
  (
868
- "UPDATE " . create_control_Table() . " SET `sorting_order` = %d where form_id = %d and field_id = %d and column_dynamicId = %d",
869
- $dynamic_control_id,
870
- $form_id,
871
- $control_type,
872
- $id
873
- )
874
- );
875
- }
876
- else {
877
- $sql= "";
878
- }
879
- foreach($element as $key => $value)
880
- {
881
- if($key == "dynamic_id" || $key == "control_type")
882
- {
883
- continue;
884
  }
885
- else
886
  {
887
- if($event == "add")
888
  {
889
- $sql[] = '('.$dynamic_control_id.',"'.$key.'", "'.$value.'")';
890
- }
891
  else
892
  {
893
- $sql .= 'WHEN `dynamic_settings_key` = "'.$key.'" THEN "'.$value.'"';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
894
  }
895
  }
896
  }
897
- if($event == "add")
898
- {
899
- $wpdb->query
900
- (
901
- $wpdb->prepare
902
- (
903
- "INSERT INTO " . contact_bank_dynamic_settings_form() . "(dynamicId,dynamic_settings_key,dynamic_settings_value) VALUES ".implode(',', $sql),""
904
- )
905
- );
906
- }
907
- else
908
- {
909
- $wpdb->query
910
- (
911
- $wpdb->prepare
912
- (
913
- "UPDATE " . contact_bank_dynamic_settings_form() . " SET `dynamic_settings_value` = CASE ".$sql . " END where dynamicId = %d ",
914
- $controlId
915
- )
916
- );
917
- }
918
- }
919
- die();
920
- break;
921
-
922
- case "":
923
-
924
- $form_id = intval($_REQUEST["form_id"]);
925
- $field_dynamic_id = isset($_REQUEST["field_dynamic_id"]) ? json_decode(stripcslashes($_REQUEST["field_dynamic_id"]),true) : array();
926
- $sql= "";
927
- foreach($field_dynamic_id as $key => $val)
928
- {
929
- $sql .= ' WHEN `column_dynamicId` = "'.$val.'" THEN "'.$key.'"';
930
- }
931
- $wpdb->query
932
- (
933
- $wpdb->prepare
934
- (
935
- "UPDATE " . create_control_Table() . " SET `sorting_order` = CASE " . $sql . " END where form_id = %d ",
936
- $form_id
937
- )
938
- );
939
- die();
940
- break;
941
-
942
  case "update_option":
943
-
944
  update_option("contact-bank-info-popup", "no");
945
- die();
946
  break;
947
-
948
  case "form_fields_sorting_order":
949
-
950
  $form_id = intval($_REQUEST["form_id"]);
951
  $field_dynamic_id = isset($_REQUEST["field_dynamic_id"]) ? json_decode(stripcslashes($_REQUEST["field_dynamic_id"]),true) : array();
952
  $sql= "";
@@ -962,16 +913,17 @@ else
962
  $form_id
963
  )
964
  );
965
- die();
966
  break;
967
-
968
  case "contact_plugin_updates":
969
-
970
  $contact_updates = intval($_REQUEST["contact_updates"]);
971
  update_option("contact-bank-automatic_update",$contact_updates);
972
- die();
973
  break;
974
  }
 
975
  }
976
  }
977
- ?>
10
  case "author":
11
  $cb_user_role_permission = "publish_posts";
12
  break;
13
+
14
  }
15
  if(!current_user_can($cb_user_role_permission))
16
  {
30
  {
31
  case 1:
32
  include_once CONTACT_BK_PLUGIN_DIR ."/includes/cb_text.php";
33
+ break;
34
  case 2:
35
  include_once CONTACT_BK_PLUGIN_DIR ."/includes/cb_textarea.php";
36
+ break;
37
  case 3:
38
  include_once CONTACT_BK_PLUGIN_DIR ."/includes/cb_email.php";
39
+ break;
40
  case 4:
41
  include_once CONTACT_BK_PLUGIN_DIR ."/includes/cb_dropdown.php";
42
+ break;
43
  case 5:
44
  include_once CONTACT_BK_PLUGIN_DIR ."/includes/cb_checkbox.php";
45
+ break;
46
  case 6:
47
  include_once CONTACT_BK_PLUGIN_DIR ."/includes/cb_multiple.php";
48
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  }
 
50
  break;
51
+
52
  case "delete_form":
53
  $form_id = intval($_REQUEST["id"]);
54
  $control_id = $wpdb->get_results
131
  $form_id
132
  )
133
  );
134
+
135
  break;
136
+
137
  case "delete_forms":
138
+
139
  global $wpdb;
140
  $wpdb->query
141
  (
169
  (
170
  "TRUNCATE Table ".contact_bank_contact_form()
171
  );
172
+
173
  break;
174
+
175
  case "submit_form_messages_settings":
176
+
177
+ $sql1 = array();
178
+ $form_settings_data = array();
179
+ $form_id = intval($_REQUEST["form_id"]);
180
+ parse_str(base64_decode($_REQUEST["form_settings"]),$form_settings);
181
+ $form_settings_data["blank_field_message"] = esc_html($form_settings["ux_txt_blank_message"]);
182
+ $form_settings_data["incorrect_email_message"] = esc_html($form_settings["ux_txt_incorrect_email_message"]);
183
+ $form_settings_data["success_message"] = esc_html($form_settings["ux_txt_success_message"]);
184
+ $form_settings_data["form_description"] = esc_html($form_settings["ux_txt_form_description"]);
185
+ $form_settings_data["redirect"] = esc_html($form_settings["ux_rdl_redirect"]);
186
+ $form_settings_data["redirect_url"] = esc_html($form_settings["ux_ddl_page_url"]);
187
+ $form_settings_data["form_name"] = esc_html($form_settings["ux_txt_form_name"]);
188
+
189
+ $array_delete_form_controls = json_decode(stripcslashes($_REQUEST["array_delete_form_controls"]),true);
190
+ foreach($array_delete_form_controls as $element)
191
+ {
192
+ $sql1[] = $element;
193
+ }
194
+ if(count($sql1) > 0)
195
+ {
196
+ $wpdb->query
197
  (
198
+ $wpdb->prepare
199
+ (
200
+ "Delete FROM " . contact_bank_dynamic_settings_form() . " where dynamicId in (".implode(',', $sql1).")",
201
+ ""
202
+ )
203
+ );
204
+ $wpdb->query
205
  (
206
+ $wpdb->prepare
207
+ (
208
+ "Delete FROM " . create_control_Table() . " where control_id in (".implode(',', $sql1).")",""
209
+ )
210
+ );
211
+ }
212
+ foreach($form_settings_data as $element => $value)
213
  {
214
+ if($element == "form_name")
215
  {
 
216
  $wpdb->query
217
  (
218
  $wpdb->prepare
219
  (
220
+ "UPDATE " . contact_bank_contact_form() . " SET `form_name` = %s where form_id = %d ",
221
+ $value,
222
  $form_id
223
  )
224
  );
225
  }
226
  else
227
  {
228
+ $wpdb->query
229
+ (
230
+ $wpdb->prepare
231
+ (
232
+ "UPDATE " . contact_bank_form_settings_Table() . " SET `form_message_value` = %s where form_message_key = %s and form_id = %d ",
233
+ $value,
234
+ $element,
235
+ $form_id
236
+ )
237
+ );
238
  }
239
  }
240
+ $fields_created = $wpdb->get_results
241
  (
242
  $wpdb->prepare
243
  (
244
+ "SELECT dynamicId, dynamic_settings_value,field_id FROM ". contact_bank_dynamic_settings_form(). " JOIN " . create_control_Table(). " ON " . contact_bank_dynamic_settings_form().". dynamicId = ". create_control_Table(). ".control_id WHERE `dynamic_settings_key` = 'cb_admin_label' and form_id = %d and field_id != %d and field_id != %d Order By ".create_control_Table().".sorting_order",
245
+ $form_id,
246
+ 9,
247
+ 17
248
  )
249
  );
250
+ $controls = "";
251
+ $email_dynamicId = "";
252
+ for($flag=0;$flag<count($fields_created);$flag++)
253
+ {
254
+ $show_in_email = $wpdb->get_var
255
+ (
256
+ $wpdb->prepare
257
+ (
258
+ "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
259
+ $fields_created[$flag]->dynamicId
260
+ )
261
+ );
262
+ if($show_in_email == "0")
263
+ {
264
+ $controls .= "<strong>".$fields_created[$flag]->dynamic_settings_value ."</strong>: ". "[control_".$fields_created[$flag]->dynamicId."] <br>";
265
+ }
266
+ if($fields_created[$flag]->field_id == 3)
267
+ {
268
+ $email_dynamicId = $fields_created[$flag]->dynamicId;
269
+ }
270
+ }
271
+ $body_message = "Hello Admin,<br><br>
272
+ A new user visited your website.<br><br>
273
+ Here are the details :<br><br>
274
+ ".$controls."
275
+ <br>Thanks,<br><br>
276
+ <strong>Technical Support Team</strong>";
277
+ $wpdb->query
278
  (
279
  $wpdb->prepare
280
  (
281
+
282
+ "UPDATE " . contact_bank_email_template_admin() . " SET `body_content` = %s where form_id = %d and name = %s",
283
+ $body_message,
284
+ $form_id,
285
+ "Admin Notification"
286
  )
287
  );
288
+ $wpdb->query
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
289
  (
290
+ $wpdb->prepare
291
+ (
292
+ "UPDATE " . contact_bank_email_template_admin() . " SET `email_to` = %s where form_id = %d and name = %s",
293
+ "[control_".$email_dynamicId."]",
294
+ $form_id,
295
+ "Client Notification"
296
+ )
297
+ );
298
+ $wpdb->query
299
  (
300
+ $wpdb->prepare
301
+ (
302
+ "UPDATE " . contact_bank_email_template_admin() . " SET `send_to` = %d where form_id = %d and name = %s",
303
+ 1,
304
+ $form_id,
305
+ "Client Notification"
306
+ )
307
+ );
 
 
 
 
 
 
308
  break;
309
+
310
  case "save_text_control":
311
+
312
+ $form_id = intval($_REQUEST["form_id"]);
313
+ $event = esc_attr($_REQUEST["events"]);
314
+ $controlId = isset($_REQUEST["controlId"]) ? intval($_REQUEST["controlId"]) : 0;
315
+ if(isset($_REQUEST["data"]))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
316
  {
317
+ parse_str(base64_decode($_REQUEST["data"]),$form_settings_data);
318
+ $dynamic_Id = intval($form_settings_data["ux_hd_textbox_dynamic_id"]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
319
  }
320
  else
321
  {
322
+ $dynamic_Id = intval($_REQUEST["ux_hd_textbox_dynamic_id"]);
323
+ }
324
+ $form_settings = isset($_REQUEST["form_settings"]) ? json_decode(stripcslashes($_REQUEST["form_settings"]),true) : array();
325
+ $form_settings[$dynamic_Id]["dynamic_id"] = $dynamic_Id;
326
+ $form_settings[$dynamic_Id]["control_type"] = "1";
327
+ $form_settings[$dynamic_Id]["cb_label_value"] = isset($form_settings_data["ux_label_text_".$dynamic_Id]) ? esc_html($form_settings_data["ux_label_text_".$dynamic_Id]) : "Untitled";
328
+ $form_settings[$dynamic_Id]["cb_description"] = isset($form_settings_data["ux_description_control_".$dynamic_Id]) ? esc_html($form_settings_data["ux_description_control_".$dynamic_Id]) : "";
329
+ $form_settings[$dynamic_Id]["cb_control_required"] = isset($form_settings_data["ux_required_control_radio_".$dynamic_Id]) ? esc_html($form_settings_data["ux_required_control_radio_".$dynamic_Id]) : "0";
330
+ $form_settings[$dynamic_Id]["cb_tooltip_txt"] = isset($form_settings_data["ux_tooltip_control_".$dynamic_Id]) ? esc_html($form_settings_data["ux_tooltip_control_".$dynamic_Id]) : "";
331
+ $form_settings[$dynamic_Id]["cb_default_txt_val"] = isset($form_settings_data["ux_default_value_".$dynamic_Id]) ? esc_html($form_settings_data["ux_default_value_".$dynamic_Id]) : "";
332
+ $form_settings[$dynamic_Id]["cb_admin_label"] = isset($form_settings_data["ux_admin_label_".$dynamic_Id]) ? esc_html($form_settings_data["ux_admin_label_".$dynamic_Id]) : "Untitled";
333
+ $form_settings[$dynamic_Id]["cb_show_email"] = isset($form_settings_data["ux_show_email_".$dynamic_Id]) ? "1" : "0";
334
+ $form_settings[$dynamic_Id]["cb_checkbox_alpha_filter"] = isset($form_settings_data["ux_checkbox_alpha_filter_".$dynamic_Id]) ? "1" : "0";
335
+ $form_settings[$dynamic_Id]["cb_ux_checkbox_alpha_num_filter"] = isset($form_settings_data["ux_checkbox_alpha_num_filter_".$dynamic_Id]) ? "1" : "0";
336
+ $form_settings[$dynamic_Id]["cb_checkbox_digit_filter"] = isset($form_settings_data["ux_checkbox_digit_filter_".$dynamic_Id]) ? "1" : "0";
337
+ $form_settings[$dynamic_Id]["cb_checkbox_strip_tag_filter"] = isset($form_settings_data["ux_checkbox_strip_tag_filter_".$dynamic_Id]) ? "1" : "0";
338
+ $form_settings[$dynamic_Id]["cb_checkbox_trim_filter"] = isset($form_settings_data["ux_checkbox_trim_filter_".$dynamic_Id]) ? "1" : "0";
339
+
340
+ foreach($form_settings as $element)
341
+ {
342
+ $id = $element["dynamic_id"];
343
+ $control_type = $element["control_type"];
344
+ echo $event;
345
+ if($event == "add")
346
  {
347
+ $wpdb->query
348
+ (
349
+ $wpdb->prepare
350
+ (
351
+ "INSERT INTO " . create_control_Table() . "(form_id,field_id,column_dynamicId) VALUES(%d,%d,%d)",
352
+ $form_id,
353
+ $control_type,
354
+ $id
355
+ )
356
+ );
357
+ echo $dynamic_control_id=$wpdb->insert_id;
358
+ $wpdb->query
359
+ (
360
+ $wpdb->prepare
361
+ (
362
+ "UPDATE " . create_control_Table() . " SET `sorting_order` = %d where form_id = %d and field_id = %d and column_dynamicId = %d",
363
+ $dynamic_control_id,
364
+ $form_id,
365
+ $control_type,
366
+ $id
367
+ )
368
+ );
369
  }
370
+ foreach($element as $key => $value)
371
  {
372
+ if($key == "dynamic_id" || $key == "control_type")
373
  {
374
+ continue;
375
  }
376
+ else
377
+ {
378
+ if($event == "add")
379
+ {
380
+ $wpdb->query
381
+ (
382
+ $wpdb->prepare
383
+ (
384
+ "INSERT INTO " . contact_bank_dynamic_settings_form() . "(dynamicId,dynamic_settings_key,dynamic_settings_value) VALUES (%d,%s,%s)",
385
+ $dynamic_control_id,
386
+ $key,
387
+ $value
388
+ )
389
+ );
390
+ }
391
+ else
392
+ {
393
+ $wpdb->query
394
+ (
395
+ $wpdb->prepare
396
+ (
397
+ "UPDATE " . contact_bank_dynamic_settings_form() . " SET `dynamic_settings_value` = %s where dynamic_settings_key = %s and dynamicId = %d ",
398
+ $value,
399
+ $key,
400
+ $controlId
401
+ )
402
+ );
403
+ }
404
  }
405
  }
406
  }
407
+ break;
408
+
409
+ case "save_textarea_control":
410
+
411
+ $form_id = intval($_REQUEST["form_id"]);
412
+ $event = esc_attr($_REQUEST["events"]);
413
+ $controlId = isset($_REQUEST["controlId"]) ? intval($_REQUEST["controlId"]) : 0;
414
+ if(isset($_REQUEST["data"]))
415
  {
416
+ parse_str(base64_decode($_REQUEST["data"]),$form_settings_data);
417
+ $dynamic_Id = intval($form_settings_data["ux_hd_textbox_dynamic_id"]);
 
 
 
 
 
418
  }
419
  else
420
  {
421
+ $dynamic_Id = intval($_REQUEST["ux_hd_textbox_dynamic_id"]);
422
+ }
423
+ $form_settings = isset($_REQUEST["form_settings"]) ? json_decode(stripcslashes($_REQUEST["form_settings"]),true) : array();
424
+ $form_settings[$dynamic_Id]["dynamic_id"] = $dynamic_Id;
425
+ $form_settings[$dynamic_Id]["control_type"] = "2";
426
+ $form_settings[$dynamic_Id]["cb_label_value"] = isset($form_settings_data["ux_label_text_".$dynamic_Id]) ? esc_html($form_settings_data["ux_label_text_".$dynamic_Id]) : "Untitled";
427
+ $form_settings[$dynamic_Id]["cb_description"] = isset($form_settings_data["ux_description_control_".$dynamic_Id]) ? esc_html($form_settings_data["ux_description_control_".$dynamic_Id]) : "";
428
+ $form_settings[$dynamic_Id]["cb_control_required"] = isset($form_settings_data["ux_required_control_radio_".$dynamic_Id]) ? esc_html($form_settings_data["ux_required_control_radio_".$dynamic_Id]) : "0";
429
+ $form_settings[$dynamic_Id]["cb_tooltip_txt"] = isset($form_settings_data["ux_tooltip_control_".$dynamic_Id]) ? esc_html($form_settings_data["ux_tooltip_control_".$dynamic_Id]) : "";
430
+ $form_settings[$dynamic_Id]["cb_default_txt_val"] = isset($form_settings_data["ux_default_value_".$dynamic_Id]) ? esc_html($form_settings_data["ux_default_value_".$dynamic_Id]) : "";
431
+ $form_settings[$dynamic_Id]["cb_admin_label"] = isset($form_settings_data["ux_admin_label_".$dynamic_Id]) ? esc_html($form_settings_data["ux_admin_label_".$dynamic_Id]) : "Untitled";
432
+ $form_settings[$dynamic_Id]["cb_show_email"] = isset($form_settings_data["ux_show_email_".$dynamic_Id]) ? "1" : "0";
433
+ $form_settings[$dynamic_Id]["cb_checkbox_alpha_filter"] = isset($form_settings_data["ux_checkbox_alpha_filter_".$dynamic_Id]) ? "1" : "0";
434
+ $form_settings[$dynamic_Id]["cb_ux_checkbox_alpha_num_filter"] = isset($form_settings_data["ux_checkbox_alpha_num_filter_".$dynamic_Id]) ? "1" : "0";
435
+ $form_settings[$dynamic_Id]["cb_checkbox_digit_filter"] = isset($form_settings_data["ux_checkbox_digit_filter_".$dynamic_Id]) ? "1" : "0";
436
+ $form_settings[$dynamic_Id]["cb_checkbox_strip_tag_filter"] = isset($form_settings_data["ux_checkbox_strip_tag_filter_".$dynamic_Id]) ? "1" : "0";
437
+ $form_settings[$dynamic_Id]["cb_checkbox_trim_filter"] = isset($form_settings_data["ux_checkbox_trim_filter_".$dynamic_Id]) ? "1" : "0";
438
+
439
+ foreach($form_settings as $element)
440
+ {
441
+ $id = $element["dynamic_id"];
442
+ $control_type = $element["control_type"];
443
+ if($event == "add")
444
+ {
445
+ $wpdb->query
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
446
  (
447
+ $wpdb->prepare
448
+ (
449
+ "INSERT INTO " . create_control_Table() . "(form_id,field_id,column_dynamicId) VALUES(%d,%d,%d)",
450
+ $form_id,
451
+ $control_type,
452
+ $id
453
+ )
454
+ );
455
+ echo $dynamic_control_id=$wpdb->insert_id;
456
+ $wpdb->query
457
  (
458
+ $wpdb->prepare
459
+ (
460
+ "UPDATE " . create_control_Table() . " SET `sorting_order` = %d where form_id = %d and field_id = %d and column_dynamicId = %d",
461
+ $dynamic_control_id,
462
+ $form_id,
463
+ $control_type,
464
+ $id
465
+ )
466
+ );
 
 
 
 
 
 
 
 
467
  }
468
+ foreach($element as $key => $value)
469
  {
470
+ if($key == "dynamic_id" || $key == "control_type")
471
  {
472
+ continue;
473
  }
474
  else
475
  {
476
+ if($event == "add")
477
+ {
478
+ $wpdb->query
479
+ (
480
+ $wpdb->prepare
481
+ (
482
+ "INSERT INTO " . contact_bank_dynamic_settings_form() . "(dynamicId,dynamic_settings_key,dynamic_settings_value) VALUES (%d,%s,%s)",
483
+ $dynamic_control_id,
484
+ $key,
485
+ $value
486
+ )
487
+ );
488
+ }
489
+ else
490
+ {
491
+ $wpdb->query
492
+ (
493
+ $wpdb->prepare
494
+ (
495
+ "UPDATE " . contact_bank_dynamic_settings_form() . " SET `dynamic_settings_value` = %s where dynamic_settings_key = %s and dynamicId = %d ",
496
+ $value,
497
+ $key,
498
+ $controlId
499
+ )
500
+ );
501
+ }
502
  }
503
  }
504
  }
505
+ break;
506
+
507
+ case "save_email_control":
508
+
509
+ $form_id = intval($_REQUEST["form_id"]);
510
+ $event = esc_attr($_REQUEST["events"]);
511
+ $controlId = isset($_REQUEST["controlId"]) ? intval($_REQUEST["controlId"]) : 0;
512
+ if(isset($_REQUEST["data"]))
513
  {
514
+ parse_str(base64_decode($_REQUEST["data"]),$form_settings_data);
515
+ $dynamic_Id = intval($form_settings_data["ux_hd_textbox_dynamic_id"]);
 
 
 
 
 
516
  }
517
  else
518
  {
519
+ $dynamic_Id = intval($_REQUEST["ux_hd_textbox_dynamic_id"]);
520
+ }
521
+ $form_settings = isset($_REQUEST["form_settings"]) ? json_decode(stripcslashes($_REQUEST["form_settings"]),true) : array();
522
+ $form_settings[$dynamic_Id]["dynamic_id"] = $dynamic_Id;
523
+ $form_settings[$dynamic_Id]["control_type"] = "3";
524
+ $form_settings[$dynamic_Id]["cb_label_value"] = isset($form_settings_data["ux_label_text_".$dynamic_Id]) ? esc_html($form_settings_data["ux_label_text_".$dynamic_Id]) : "Email";
525
+ $form_settings[$dynamic_Id]["cb_description"] = isset($form_settings_data["ux_description_control_".$dynamic_Id]) ? esc_html($form_settings_data["ux_description_control_".$dynamic_Id]) : "";
526
+ $form_settings[$dynamic_Id]["cb_control_required"] = isset($form_settings_data["ux_required_control_radio_".$dynamic_Id]) ? esc_html($form_settings_data["ux_required_control_radio_".$dynamic_Id]) : "1";
527
+ $form_settings[$dynamic_Id]["cb_tooltip_txt"] = isset($form_settings_data["ux_tooltip_control_".$dynamic_Id]) ? esc_html($form_settings_data["ux_tooltip_control_".$dynamic_Id]) : "";
528
+ $form_settings[$dynamic_Id]["cb_default_txt_val"] = isset($form_settings_data["ux_default_value_".$dynamic_Id]) ? esc_html($form_settings_data["ux_default_value_".$dynamic_Id]) : "";
529
+ $form_settings[$dynamic_Id]["cb_admin_label"] = isset($form_settings_data["ux_default_value_".$dynamic_Id]) ? esc_html($form_settings_data["ux_admin_label_".$dynamic_Id]) : "Email";
530
+ $form_settings[$dynamic_Id]["cb_show_email"] = isset($form_settings_data["ux_show_email_".$dynamic_Id]) ? "1" : "0";
531
+
532
+ foreach($form_settings as $element)
533
+ {
534
+ $id = $element["dynamic_id"];
535
+ $control_type = $element["control_type"];
536
+ if($event == "add")
537
+ {
538
  $wpdb->query
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
539
  (
540
+ $wpdb->prepare
541
+ (
542
+ "INSERT INTO " . create_control_Table() . "(form_id,field_id,column_dynamicId) VALUES(%d,%d,%d)",
543
+ $form_id,
544
+ $control_type,
545
+ $id
546
+ )
547
+ );
548
+ echo $dynamic_control_id=$wpdb->insert_id;
549
+ $wpdb->query
550
  (
551
+ $wpdb->prepare
552
+ (
553
+ "UPDATE " . create_control_Table() . " SET `sorting_order` = %d where form_id = %d and field_id = %d and column_dynamicId = %d",
554
+ $dynamic_control_id,
555
+ $form_id,
556
+ $control_type,
557
+ $id
558
+ )
559
+ );
 
 
 
 
 
 
 
 
560
  }
561
+ foreach($element as $key => $value)
562
  {
563
+ if($key == "dynamic_id" || $key == "control_type")
564
  {
565
+ continue;
566
  }
567
  else
568
  {
569
+ if($event == "add")
570
+ {
571
+ $wpdb->query
572
+ (
573
+ $wpdb->prepare
574
+ (
575
+ "INSERT INTO " . contact_bank_dynamic_settings_form() . "(dynamicId,dynamic_settings_key,dynamic_settings_value) VALUES (%d,%s,%s)",
576
+ $dynamic_control_id,
577
+ $key,
578
+ $value
579
+ )
580
+ );
581
+ }
582
+ else
583
+ {
584
+ $wpdb->query
585
+ (
586
+ $wpdb->prepare
587
+ (
588
+ "UPDATE " . contact_bank_dynamic_settings_form() . " SET `dynamic_settings_value` = %s where dynamic_settings_key = %s and dynamicId = %d ",
589
+ $value,
590
+ $key,
591
+ $controlId
592
+ )
593
+ );
594
+ }
595
  }
596
  }
597
  }
598
+ break;
599
+
600
+ case "save_drop_down_control":
601
+
602
+ $form_id = intval($_REQUEST["form_id"]);
603
+ $event = esc_attr($_REQUEST["events"]);
604
+ $controlId = isset($_REQUEST["controlId"]) ? intval($_REQUEST["controlId"]) : 0;
605
+ if(isset($_REQUEST["data"]))
606
  {
607
+ parse_str(base64_decode($_REQUEST["data"]),$form_settings_data);
608
+ $dynamic_Id = intval($form_settings_data["ux_hd_textbox_dynamic_id"]);
 
 
 
 
 
609
  }
610
  else
611
  {
612
+ $dynamic_Id = intval($_REQUEST["ux_hd_textbox_dynamic_id"]);
613
+ }
614
+
615
+ $form_settings = isset($_REQUEST["form_settings"]) ? json_decode(stripcslashes($_REQUEST["form_settings"]),true) : array();
616
+ $ddl_options_id = isset($_REQUEST["ddl_options_id"]) ? json_decode(stripcslashes($_REQUEST["ddl_options_id"]),true) : array();
617
+ $options_value = isset($_REQUEST["options_value"]) ? json_decode(stripcslashes($_REQUEST["options_value"])) : array();
618
+
619
+ $form_settings[$dynamic_Id]["dynamic_id"] = $dynamic_Id;
620
+ $form_settings[$dynamic_Id]["control_type"] = "4";
621
+ $form_settings[$dynamic_Id]["cb_label_value"] = isset($form_settings_data["ux_label_text_".$dynamic_Id]) ? esc_html($form_settings_data["ux_label_text_".$dynamic_Id]) :"Untitled";
622
+ $form_settings[$dynamic_Id]["cb_control_required"] = isset($form_settings_data["ux_required_control_radio_".$dynamic_Id]) ? esc_html($form_settings_data["ux_required_control_radio_".$dynamic_Id]) : "0";
623
+ $form_settings[$dynamic_Id]["cb_tooltip_txt"] = isset($form_settings_data["ux_tooltip_control_".$dynamic_Id]) ? esc_html($form_settings_data["ux_tooltip_control_".$dynamic_Id]) : "";
624
+ $form_settings[$dynamic_Id]["cb_admin_label"] = isset($form_settings_data["ux_admin_label_".$dynamic_Id]) ? esc_html($form_settings_data["ux_admin_label_".$dynamic_Id]) : "Untitled";
625
+ $form_settings[$dynamic_Id]["cb_show_email"] = isset($form_settings_data["ux_show_email_".$dynamic_Id]) ? "1" : "0";
626
+
627
+ $form_settings[$dynamic_Id]["cb_dropdown_option_id"] = serialize($ddl_options_id);
628
+ $form_settings[$dynamic_Id]["cb_dropdown_option_val"] = serialize($options_value);
629
+
630
+ foreach($form_settings as $element)
631
+ {
632
+ $id = $element["dynamic_id"];
633
+ $control_type = $element["control_type"];
634
+ if($event == "add")
635
+ {
636
+ $wpdb->query
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
637
  (
638
+ $wpdb->prepare
639
+ (
640
+ "INSERT INTO " . create_control_Table() . "(form_id,field_id,column_dynamicId) VALUES(%d,%d,%d)",
641
+ $form_id,
642
+ $control_type,
643
+ $id
644
+ )
645
+ );
646
+ echo $dynamic_control_id=$wpdb->insert_id;
647
+ $wpdb->query
648
  (
649
+ $wpdb->prepare
650
+ (
651
+ "UPDATE " . create_control_Table() . " SET `sorting_order` = %d where form_id = %d and field_id = %d and column_dynamicId = %d",
652
+ $dynamic_control_id,
653
+ $form_id,
654
+ $control_type,
655
+ $id
656
+ )
657
+ );
 
 
 
 
 
 
 
 
658
  }
659
+ foreach($element as $key => $value)
660
  {
661
+ if($key == "dynamic_id" || $key == "control_type")
662
  {
663
+ continue;
664
  }
665
+ else
666
+ {
667
+ if($event == "add")
668
+ {
669
+ $wpdb->query
670
+ (
671
+ $wpdb->prepare
672
+ (
673
+ "INSERT INTO " . contact_bank_dynamic_settings_form() . "(dynamicId,dynamic_settings_key,dynamic_settings_value) VALUES (%d,%s,%s)",
674
+ $dynamic_control_id,
675
+ $key,
676
+ $value
677
+ )
678
+ );
679
+ }
680
+ else
681
+ {
682
+ $wpdb->query
683
+ (
684
+ $wpdb->prepare
685
+ (
686
+ "UPDATE " . contact_bank_dynamic_settings_form() . " SET `dynamic_settings_value` = %s where dynamic_settings_key = %s and dynamicId = %d ",
687
+ $value,
688
+ $key,
689
+ $controlId
690
+ )
691
+ );
692
+ }
693
  }
694
  }
695
  }
696
+
697
+ break;
698
+
699
+ case "save_check_box_control":
700
+
701
+ $form_id = intval($_REQUEST["form_id"]);
702
+ $event = esc_attr($_REQUEST["events"]);
703
+ $controlId = isset($_REQUEST["controlId"]) ? intval($_REQUEST["controlId"]) : 0;
704
+ if(isset($_REQUEST["data"]))
705
  {
706
+ parse_str(base64_decode($_REQUEST["data"]),$form_settings_data);
707
+ $dynamic_Id = intval($form_settings_data["ux_hd_textbox_dynamic_id"]);
 
 
 
 
 
708
  }
709
  else
710
  {
711
+ $dynamic_Id = intval($_REQUEST["ux_hd_textbox_dynamic_id"]);
712
+ }
713
+ $form_settings = isset($_REQUEST["form_settings"]) ? json_decode(stripcslashes($_REQUEST["form_settings"]),true) : array();
714
+ $ddl_options_id = isset($_REQUEST["ddl_options_id"]) ? json_decode(stripcslashes($_REQUEST["ddl_options_id"]),true) : array();
715
+ $options_value = isset($_REQUEST["options_value"]) ? json_decode(stripcslashes($_REQUEST["options_value"]),true) : array();
716
+ $form_settings[$dynamic_Id]["dynamic_id"] = $dynamic_Id;
717
+ $form_settings[$dynamic_Id]["control_type"] = "5";
718
+ $form_settings[$dynamic_Id]["cb_label_value"] = isset($form_settings_data["ux_label_text_".$dynamic_Id]) ? esc_html($form_settings_data["ux_label_text_".$dynamic_Id]) : "Untitled";
719
+ $form_settings[$dynamic_Id]["cb_control_required"] = isset($form_settings_data["ux_required_control_radio_".$dynamic_Id]) ? esc_html($form_settings_data["ux_required_control_radio_".$dynamic_Id]) : "0";
720
+ $form_settings[$dynamic_Id]["cb_tooltip_txt"] = isset($form_settings_data["ux_tooltip_control_".$dynamic_Id]) ? esc_html($form_settings_data["ux_tooltip_control_".$dynamic_Id]) : "";
721
+ $form_settings[$dynamic_Id]["cb_admin_label"] = isset($form_settings_data["ux_admin_label_".$dynamic_Id]) ? esc_html($form_settings_data["ux_admin_label_".$dynamic_Id]) : "Untitled";
722
+ $form_settings[$dynamic_Id]["cb_show_email"] = isset($form_settings_data["ux_show_email_".$dynamic_Id]) ? "1" : "0";
723
+
724
+ $form_settings[$dynamic_Id]["cb_checkbox_option_id"] = serialize($ddl_options_id);
725
+ $form_settings[$dynamic_Id]["cb_checkbox_option_val"] = serialize($options_value);
726
+
727
+ foreach($form_settings as $element)
728
+ {
729
+ $id = $element["dynamic_id"];
730
+ $control_type = $element["control_type"];
731
+ if($event == "add")
732
+ {
733
+ $wpdb->query
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
734
  (
735
+ $wpdb->prepare
736
+ (
737
+ "INSERT INTO " . create_control_Table() . "(form_id,field_id,column_dynamicId) VALUES(%d,%d,%d)",
738
+ $form_id,
739
+ $control_type,
740
+ $id
741
+ )
742
+ );
743
+ echo $dynamic_control_id=$wpdb->insert_id;
744
+ $wpdb->query
745
  (
746
+ $wpdb->prepare
747
+ (
748
+ "UPDATE " . create_control_Table() . " SET `sorting_order` = %d where form_id = %d and field_id = %d and column_dynamicId = %d",
749
+ $dynamic_control_id,
750
+ $form_id,
751
+ $control_type,
752
+ $id
753
+ )
754
+ );
 
 
 
 
 
 
 
755
  }
756
+
757
+ foreach($element as $key => $value)
758
  {
759
+ if($key == "dynamic_id" || $key == "control_type")
760
  {
761
+ continue;
762
  }
763
  else
764
  {
765
+ if($event == "add")
766
+ {
767
+ $wpdb->query
768
+ (
769
+ $wpdb->prepare
770
+ (
771
+ "INSERT INTO " . contact_bank_dynamic_settings_form() . "(dynamicId,dynamic_settings_key,dynamic_settings_value) VALUES (%d,%s,%s)",
772
+ $dynamic_control_id,
773
+ $key,
774
+ $value
775
+ )
776
+ );
777
+ }
778
+ else
779
+ {
780
+ $wpdb->query
781
+ (
782
+ $wpdb->prepare
783
+ (
784
+ "UPDATE " . contact_bank_dynamic_settings_form() . " SET `dynamic_settings_value` = %s where dynamic_settings_key = %s and dynamicId = %d ",
785
+ $value,
786
+ $key,
787
+ $controlId
788
+ )
789
+ );
790
+ }
791
  }
792
  }
793
  }
794
+
795
+ break;
796
+
797
+ case "save_multiple_control":
798
+
799
+ $form_id = intval($_REQUEST["form_id"]);
800
+ $event = esc_attr($_REQUEST["events"]);
801
+ $controlId = isset($_REQUEST["controlId"]) ? intval($_REQUEST["controlId"]) : 0;
802
+ if(isset($_REQUEST["data"]))
803
  {
804
+ parse_str(base64_decode($_REQUEST["data"]),$form_settings_data);
805
+ $dynamic_Id = intval($form_settings_data["ux_hd_textbox_dynamic_id"]);
 
 
 
 
 
806
  }
807
  else
808
  {
809
+ $dynamic_Id = intval($_REQUEST["ux_hd_textbox_dynamic_id"]);
810
+ }
811
+ $form_settings = isset($_REQUEST["form_settings"]) ? json_decode(stripcslashes($_REQUEST["form_settings"]),true) : array();
812
+ $ddl_options_id = isset($_REQUEST["ddl_options_id"]) ? json_decode(stripcslashes($_REQUEST["ddl_options_id"]),true) : array();
813
+ $options_value = isset($_REQUEST["options_value"]) ? json_decode(stripcslashes($_REQUEST["options_value"]),true) : array();
814
+ $form_settings[$dynamic_Id]["dynamic_id"] = $dynamic_Id;
815
+ $form_settings[$dynamic_Id]["control_type"] = "6";
816
+ $form_settings[$dynamic_Id]["cb_label_value"] = isset($form_settings_data["ux_label_text_".$dynamic_Id]) ? esc_html($form_settings_data["ux_label_text_".$dynamic_Id]) : "Untitled";
817
+ $form_settings[$dynamic_Id]["cb_control_required"] = isset($form_settings_data["ux_required_control_radio_".$dynamic_Id]) ? esc_html($form_settings_data["ux_required_control_radio_".$dynamic_Id]) : "0";
818
+ $form_settings[$dynamic_Id]["cb_tooltip_txt"] = isset($form_settings_data["ux_tooltip_control_".$dynamic_Id]) ? esc_html($form_settings_data["ux_tooltip_control_".$dynamic_Id]) : "";
819
+ $form_settings[$dynamic_Id]["cb_admin_label"] = isset($form_settings_data["ux_admin_label_".$dynamic_Id]) ? esc_html($form_settings_data["ux_admin_label_".$dynamic_Id]) : "Untitled";
820
+ $form_settings[$dynamic_Id]["cb_show_email"] = isset($form_settings_data["ux_show_email_".$dynamic_Id]) ? "1" : "0";
821
+
822
+ $form_settings[$dynamic_Id]["cb_radio_option_id"] = serialize($ddl_options_id);
823
+ $form_settings[$dynamic_Id]["cb_radio_option_val"] = serialize($options_value);
824
+
825
+ foreach($form_settings as $element)
826
+ {
827
+ $id = $element["dynamic_id"];
828
+ $control_type = $element["control_type"];
829
+ if($event == "add")
830
+ {
831
+ $wpdb->query
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
832
  (
833
+ $wpdb->prepare
834
+ (
835
+ "INSERT INTO " . create_control_Table() . "(form_id,field_id,column_dynamicId) VALUES(%d,%d,%d)",
836
+ $form_id,
837
+ $control_type,
838
+ $id
839
+ )
840
+ );
841
+ echo $dynamic_control_id=$wpdb->insert_id;
842
+ $wpdb->query
843
  (
844
+ $wpdb->prepare
845
+ (
846
+ "UPDATE " . create_control_Table() . " SET `sorting_order` = %d where form_id = %d and field_id = %d and column_dynamicId = %d",
847
+ $dynamic_control_id,
848
+ $form_id,
849
+ $control_type,
850
+ $id
851
+ )
852
+ );
 
 
 
 
 
 
 
853
  }
854
+ foreach($element as $key => $value)
855
  {
856
+ if($key == "dynamic_id" || $key == "control_type")
857
  {
858
+ continue;
859
+ }
860
  else
861
  {
862
+ if($event == "add")
863
+ {
864
+ $wpdb->query
865
+ (
866
+ $wpdb->prepare
867
+ (
868
+ "INSERT INTO " . contact_bank_dynamic_settings_form() . "(dynamicId,dynamic_settings_key,dynamic_settings_value) VALUES (%d,%s,%s)",
869
+ $dynamic_control_id,
870
+ $key,
871
+ $value
872
+ )
873
+ );
874
+ }
875
+ else
876
+ {
877
+ $wpdb->query
878
+ (
879
+ $wpdb->prepare
880
+ (
881
+ "UPDATE " . contact_bank_dynamic_settings_form() . " SET `dynamic_settings_value` = %s where dynamic_settings_key = %s and dynamicId = %d ",
882
+ $value,
883
+ $key,
884
+ $controlId
885
+ )
886
+ );
887
+ }
888
  }
889
  }
890
  }
891
+ break;
892
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
893
  case "update_option":
894
+
895
  update_option("contact-bank-info-popup", "no");
896
+
897
  break;
898
+
899
  case "form_fields_sorting_order":
900
+
901
  $form_id = intval($_REQUEST["form_id"]);
902
  $field_dynamic_id = isset($_REQUEST["field_dynamic_id"]) ? json_decode(stripcslashes($_REQUEST["field_dynamic_id"]),true) : array();
903
  $sql= "";
913
  $form_id
914
  )
915
  );
916
+
917
  break;
918
+
919
  case "contact_plugin_updates":
920
+
921
  $contact_updates = intval($_REQUEST["contact_updates"]);
922
  update_option("contact-bank-automatic_update",$contact_updates);
923
+
924
  break;
925
  }
926
+ die();
927
  }
928
  }
929
+ ?>
lib/install-script.php CHANGED
@@ -335,7 +335,7 @@ if($version == "" || $version == "1.0")
335
  )
336
  );
337
  }
338
-
339
  if(count($contact_forms_dynamic_settings) > 0)
340
  {
341
  $settings_keys = array();
@@ -358,9 +358,9 @@ if($version == "" || $version == "1.0")
358
  array_push($settings_keys, "cb_button_set_time_minute_dropdown");
359
  array_push($settings_keys, "cb_button_set_time_am_pm_dropdown");
360
  array_push($settings_keys, "cb_error_invalid");
361
-
362
  $settings_keys_email = array();
363
-
364
  array_push($settings_keys_email, "");
365
  array_push($settings_keys_email, "cb_checkbox_alpha_filter");
366
  array_push($settings_keys_email, "cb_ux_checkbox_alpha_num_filter");
@@ -389,7 +389,7 @@ if($version == "" || $version == "1.0")
389
  dynamic_settings_key,dynamic_settings_value) VALUES(%d, %s, %s)",
390
  $contact_forms_dynamic_settings[$flag]->control_id,
391
  $contact_forms_dynamic_settings[$flag]->dynamic_settings_key,
392
- array_search($contact_forms_dynamic_settings[$flag]->dynamic_settings_key,$settings_keys_multiple_options)
393
  ? serialize(explode(";",$contact_forms_dynamic_settings[$flag]->dynamic_settings_value)) : $contact_forms_dynamic_settings[$flag]->dynamic_settings_value
394
  )
395
  );
@@ -408,10 +408,10 @@ else
408
  (
409
  "SELECT * FROM ".contact_bank_email_template_admin()
410
  );
411
-
412
  $sql = "DROP TABLE " . contact_bank_email_template_admin();
413
  $wpdb->query($sql);
414
-
415
  create_table_contact_bank_email_templates();
416
 
417
  if(count($contact_forms_emails) > 0)
@@ -456,9 +456,9 @@ else
456
 
457
  $sql = "DROP TABLE " . contact_bank_frontend_forms_Table();
458
  $wpdb->query($sql);
459
-
460
  create_table_contact_bank_front_end_forms();
461
-
462
  for($flag = 0; $flag < count($contact_front_end_forms);$flag++)
463
  {
464
  $wpdb->query
@@ -486,9 +486,9 @@ else
486
 
487
  $sql = "DROP TABLE " . frontend_controls_data_Table();
488
  $wpdb->query($sql);
489
-
490
  create_table_front_end_data();
491
-
492
  for($flag = 0; $flag < count($contact_front_end_forms_data);$flag++)
493
  {
494
  $wpdb->query
@@ -520,7 +520,7 @@ if (count($wpdb->get_var('SHOW TABLES LIKE "' . contact_bank_layout_settings_Tab
520
  $settings["label_setting_field_align"] = "left";
521
  $settings["label_setting_hide_label"] = "0";
522
  $settings["label_setting_text_direction"] = "inherit";
523
-
524
  $settings["input_field_font_family"] = "inherit";
525
  $settings["input_field_font_color"] = "#000000";
526
  $settings["input_field_font_style"] = "normal";
@@ -534,7 +534,7 @@ if (count($wpdb->get_var('SHOW TABLES LIKE "' . contact_bank_layout_settings_Tab
534
  $settings["input_field_rdl_text_align"] = "0";
535
  $settings["input_field_text_direction"] = "inherit";
536
  $settings["input_field_input_size"] = "layout-span10";
537
-
538
  $settings["submit_button_font_family"] = "inherit";
539
  $settings["submit_button_text"] = "Submit";
540
  $settings["submit_button_font_style"] = "normal";
@@ -548,7 +548,7 @@ if (count($wpdb->get_var('SHOW TABLES LIKE "' . contact_bank_layout_settings_Tab
548
  $settings["submit_button_border_radius"] = "0";
549
  $settings["submit_button_rdl_text_align"] = "0";
550
  $settings["submit_button_text_direction"] = "inherit";
551
-
552
  $settings["success_msg_font_family"] = "inherit";
553
  $settings["success_msg_font_size"] = "12";
554
  $settings["success_msg_bg_color"] = "#e5ffd5";
@@ -556,7 +556,7 @@ if (count($wpdb->get_var('SHOW TABLES LIKE "' . contact_bank_layout_settings_Tab
556
  $settings["success_msg_text_color"] = "#6aa500";
557
  $settings["success_msg_rdl_text_align"] = "0";
558
  $settings["success_msg_text_direction"] = "inherit";
559
-
560
  $settings["error_msg_font_family"] = "inherit";
561
  $settings["error_msg_font_size"] = "12";
562
  $settings["error_msg_bg_color"] = "#ffcaca";
@@ -564,7 +564,7 @@ if (count($wpdb->get_var('SHOW TABLES LIKE "' . contact_bank_layout_settings_Tab
564
  $settings["error_msg_text_color"] = "#ff2c38";
565
  $settings["error_msg_rdl_text_align"] = "0";
566
  $settings["error_msg_text_direction"] = "inherit";
567
-
568
  $contact_forms_for_settings = $wpdb->get_results
569
  (
570
  "SELECT * FROM ".contact_bank_contact_form()
@@ -1016,7 +1016,7 @@ for($flag = 0; $flag < count($contact_forms_for_settings); $flag++)
1016
  $send_to
1017
  )
1018
  );
1019
-
1020
  $email_name_client = "Client Notification";
1021
  $email_subject_client = "Thanks for visiting our website";
1022
  $email_from_name = "Site Administration";
@@ -1040,7 +1040,7 @@ for($flag = 0; $flag < count($contact_forms_for_settings); $flag++)
1040
  ""
1041
  )
1042
  );
1043
-
1044
  }
1045
  else if($version == "2.0")
1046
  {
@@ -1080,13 +1080,13 @@ else if($version == "2.0")
1080
  {
1081
  create_contact_bank_form_settings();
1082
  }
1083
- else
1084
  {
1085
  $contact_forms_settings_table = $wpdb->get_results
1086
  (
1087
  "SELECT * FROM ".contact_bank_form_settings_Table()
1088
  );
1089
-
1090
  $sql = "DROP TABLE " . contact_bank_form_settings_Table();
1091
  $wpdb->query($sql);
1092
  $contact_forms_count = $wpdb->get_results
@@ -1095,7 +1095,7 @@ else if($version == "2.0")
1095
  );
1096
 
1097
  create_contact_bank_form_settings();
1098
-
1099
  if(count($contact_forms_settings_table) > 0)
1100
  {
1101
  for($flag = 0; $flag < count($contact_forms_settings_table); $flag++)
@@ -1168,4 +1168,4 @@ if($option_auto_update_contact == "")
1168
  {
1169
  update_option("contact-bank-automatic_update", "1");
1170
  }
1171
- ?>
335
  )
336
  );
337
  }
338
+
339
  if(count($contact_forms_dynamic_settings) > 0)
340
  {
341
  $settings_keys = array();
358
  array_push($settings_keys, "cb_button_set_time_minute_dropdown");
359
  array_push($settings_keys, "cb_button_set_time_am_pm_dropdown");
360
  array_push($settings_keys, "cb_error_invalid");
361
+
362
  $settings_keys_email = array();
363
+
364
  array_push($settings_keys_email, "");
365
  array_push($settings_keys_email, "cb_checkbox_alpha_filter");
366
  array_push($settings_keys_email, "cb_ux_checkbox_alpha_num_filter");
389
  dynamic_settings_key,dynamic_settings_value) VALUES(%d, %s, %s)",
390
  $contact_forms_dynamic_settings[$flag]->control_id,
391
  $contact_forms_dynamic_settings[$flag]->dynamic_settings_key,
392
+ array_search($contact_forms_dynamic_settings[$flag]->dynamic_settings_key,$settings_keys_multiple_options)
393
  ? serialize(explode(";",$contact_forms_dynamic_settings[$flag]->dynamic_settings_value)) : $contact_forms_dynamic_settings[$flag]->dynamic_settings_value
394
  )
395
  );
408
  (
409
  "SELECT * FROM ".contact_bank_email_template_admin()
410
  );
411
+
412
  $sql = "DROP TABLE " . contact_bank_email_template_admin();
413
  $wpdb->query($sql);
414
+
415
  create_table_contact_bank_email_templates();
416
 
417
  if(count($contact_forms_emails) > 0)
456
 
457
  $sql = "DROP TABLE " . contact_bank_frontend_forms_Table();
458
  $wpdb->query($sql);
459
+
460
  create_table_contact_bank_front_end_forms();
461
+
462
  for($flag = 0; $flag < count($contact_front_end_forms);$flag++)
463
  {
464
  $wpdb->query
486
 
487
  $sql = "DROP TABLE " . frontend_controls_data_Table();
488
  $wpdb->query($sql);
489
+
490
  create_table_front_end_data();
491
+
492
  for($flag = 0; $flag < count($contact_front_end_forms_data);$flag++)
493
  {
494
  $wpdb->query
520
  $settings["label_setting_field_align"] = "left";
521
  $settings["label_setting_hide_label"] = "0";
522
  $settings["label_setting_text_direction"] = "inherit";
523
+
524
  $settings["input_field_font_family"] = "inherit";
525
  $settings["input_field_font_color"] = "#000000";
526
  $settings["input_field_font_style"] = "normal";
534
  $settings["input_field_rdl_text_align"] = "0";
535
  $settings["input_field_text_direction"] = "inherit";
536
  $settings["input_field_input_size"] = "layout-span10";
537
+
538
  $settings["submit_button_font_family"] = "inherit";
539
  $settings["submit_button_text"] = "Submit";
540
  $settings["submit_button_font_style"] = "normal";
548
  $settings["submit_button_border_radius"] = "0";
549
  $settings["submit_button_rdl_text_align"] = "0";
550
  $settings["submit_button_text_direction"] = "inherit";
551
+
552
  $settings["success_msg_font_family"] = "inherit";
553
  $settings["success_msg_font_size"] = "12";
554
  $settings["success_msg_bg_color"] = "#e5ffd5";
556
  $settings["success_msg_text_color"] = "#6aa500";
557
  $settings["success_msg_rdl_text_align"] = "0";
558
  $settings["success_msg_text_direction"] = "inherit";
559
+
560
  $settings["error_msg_font_family"] = "inherit";
561
  $settings["error_msg_font_size"] = "12";
562
  $settings["error_msg_bg_color"] = "#ffcaca";
564
  $settings["error_msg_text_color"] = "#ff2c38";
565
  $settings["error_msg_rdl_text_align"] = "0";
566
  $settings["error_msg_text_direction"] = "inherit";
567
+
568
  $contact_forms_for_settings = $wpdb->get_results
569
  (
570
  "SELECT * FROM ".contact_bank_contact_form()
1016
  $send_to
1017
  )
1018
  );
1019
+
1020
  $email_name_client = "Client Notification";
1021
  $email_subject_client = "Thanks for visiting our website";
1022
  $email_from_name = "Site Administration";
1040
  ""
1041
  )
1042
  );
1043
+
1044
  }
1045
  else if($version == "2.0")
1046
  {
1080
  {
1081
  create_contact_bank_form_settings();
1082
  }
1083
+ else
1084
  {
1085
  $contact_forms_settings_table = $wpdb->get_results
1086
  (
1087
  "SELECT * FROM ".contact_bank_form_settings_Table()
1088
  );
1089
+
1090
  $sql = "DROP TABLE " . contact_bank_form_settings_Table();
1091
  $wpdb->query($sql);
1092
  $contact_forms_count = $wpdb->get_results
1095
  );
1096
 
1097
  create_contact_bank_form_settings();
1098
+
1099
  if(count($contact_forms_settings_table) > 0)
1100
  {
1101
  for($flag = 0; $flag < count($contact_forms_settings_table); $flag++)
1168
  {
1169
  update_option("contact-bank-automatic_update", "1");
1170
  }
1171
+ ?>
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: contact-banker, Gallery-Bank
3
  Tags: admin, advanced form, best contact form plugin, contact, contact button, contact form, contact form builder, Contact Form Builder with recaptcha, contact form plugin, contact forms, contact forms plugin, contact manager, contact us, contact us form, contacts form plugin, custom form, feedback, feedback form, feedback forms, form, forms, forms plugin, post feedback, web form, wordpress contact form
4
  Requires at least: 3.1
5
  Tested up to: 4.4.2
6
- Stable tag: 2.0.353
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -45,7 +45,7 @@ https://www.youtube.com/watch?v=yDYlsMhA3G0
45
 
46
 
47
  = Key Features in Contact Bank Lite Edition =
48
-
49
  * Multi-Lingual. Available now in 36 Languages.
50
  * Responsive Forms
51
  * Shortcode Wizard in your Page/Post.
@@ -140,26 +140,26 @@ Visit [here](http://tech-banker.com/products/wp-contact-bank/) to upgrade to Pro
140
 
141
  == Installation ==
142
 
143
- ### Performing a new installation
144
 
145
- After downloading the ZIP file,
146
 
147
- 1. Log in to the administrator panel.
148
- 2. Go to Plugins Add > New > Upload.
149
- 3. Click "Choose file" ("Browse") and select the downloaded zip file.
150
 
151
- *For Mac Users*
152
- *Go to your Downloads folder and locate the folder with the plugin. Right-click on the folder and select Compress. Now you have a newly created .zip file which can be installed as described here.*
153
 
154
- 1. Click "Install Now" button.
155
- 2. Click "Activate Plugin" button for activating the plugin.
156
 
157
  If any problem occurs, please contact us at [support@tech-banker.com](mailto:support@tech-banker.com).
158
 
159
  == Other Notes ==
160
 
161
- = Minimum requirements for Contact Bank. =
162
- * Wordpress 3.3+
163
  * PHP 5.x
164
  * MySQL 5.x
165
 
@@ -169,7 +169,7 @@ If any problem occurs, please contact us at [support@tech-banker.com](mailto:sup
169
 
170
  = How to add New Contact Form in Contact Bank Plugin? =
171
 
172
- In order to add New Form in your Contact Bank, you need go to your Contact Bank
173
  Dashboard Page located on the left side of WordPress Dashboard Menus.
174
 
175
  [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/add_form_1.png)
@@ -262,7 +262,7 @@ appear in the Form Layout Preview.
262
  [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/paragragh_control4.png)
263
 
264
 
265
- = How to add Email Address Control in a Form? =
266
 
267
  In order to add Email Address control in a Form, click on the Email Address button.
268
 
@@ -549,6 +549,14 @@ In order to set Shortcode for a Form, you need to follow these steps :
549
 
550
  == Changelog ==
551
 
 
 
 
 
 
 
 
 
552
  = 2.0.353 =
553
 
554
  * Few Bugs Fixed
@@ -1013,7 +1021,7 @@ In order to set Shortcode for a Form, you need to follow these steps :
1013
  * Few Bugs Fixed
1014
  * Banners Updated
1015
 
1016
- = 2.0.51 =
1017
 
1018
  * Few Possible Security Issues Addressed
1019
 
@@ -1340,4 +1348,4 @@ In order to set Shortcode for a Form, you need to follow these steps :
1340
  * Records of forms filled shown
1341
 
1342
  = 1.0 =
1343
- * Initial Release
3
  Tags: admin, advanced form, best contact form plugin, contact, contact button, contact form, contact form builder, Contact Form Builder with recaptcha, contact form plugin, contact forms, contact forms plugin, contact manager, contact us, contact us form, contacts form plugin, custom form, feedback, feedback form, feedback forms, form, forms, forms plugin, post feedback, web form, wordpress contact form
4
  Requires at least: 3.1
5
  Tested up to: 4.4.2
6
+ Stable tag: 2.1.0
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
45
 
46
 
47
  = Key Features in Contact Bank Lite Edition =
48
+
49
  * Multi-Lingual. Available now in 36 Languages.
50
  * Responsive Forms
51
  * Shortcode Wizard in your Page/Post.
140
 
141
  == Installation ==
142
 
143
+ ### Performing a new installation
144
 
145
+ After downloading the ZIP file,
146
 
147
+ 1. Log in to the administrator panel.
148
+ 2. Go to Plugins Add > New > Upload.
149
+ 3. Click "Choose file" ("Browse") and select the downloaded zip file.
150
 
151
+ *For Mac Users*
152
+ *Go to your Downloads folder and locate the folder with the plugin. Right-click on the folder and select Compress. Now you have a newly created .zip file which can be installed as described here.*
153
 
154
+ 1. Click "Install Now" button.
155
+ 2. Click "Activate Plugin" button for activating the plugin.
156
 
157
  If any problem occurs, please contact us at [support@tech-banker.com](mailto:support@tech-banker.com).
158
 
159
  == Other Notes ==
160
 
161
+ = Minimum requirements for Contact Bank. =
162
+ * Wordpress 3.3+
163
  * PHP 5.x
164
  * MySQL 5.x
165
 
169
 
170
  = How to add New Contact Form in Contact Bank Plugin? =
171
 
172
+ In order to add New Form in your Contact Bank, you need go to your Contact Bank
173
  Dashboard Page located on the left side of WordPress Dashboard Menus.
174
 
175
  [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/add_form_1.png)
262
  [Click here to view the Image](http://tech-banker.com/wp-content/uploads/2013/11/paragragh_control4.png)
263
 
264
 
265
+ = How to add Email Address Control in a Form? =
266
 
267
  In order to add Email Address control in a Form, click on the Email Address button.
268
 
549
 
550
  == Changelog ==
551
 
552
+ = 2.1.0 =
553
+
554
+ * Major Version Release
555
+ * Code Optimized
556
+ * Saving of Data Changed
557
+ * Removed Unwanted Javascript Functions
558
+ * Forms are Serialized and Encoded with a Secure Algorithm
559
+
560
  = 2.0.353 =
561
 
562
  * Few Bugs Fixed
1021
  * Few Bugs Fixed
1022
  * Banners Updated
1023
 
1024
+ = 2.0.51 =
1025
 
1026
  * Few Possible Security Issues Addressed
1027
 
1348
  * Records of forms filled shown
1349
 
1350
  = 1.0 =
1351
+ * Initial Release
views/add_contact_email.php CHANGED
@@ -11,34 +11,53 @@ switch($cb_role)
11
  case "author":
12
  $cb_user_role_permission = "publish_posts";
13
  break;
14
-
15
  }
16
  if (!current_user_can($cb_user_role_permission))
17
  {
18
  return;
19
  }
20
- else
21
  {
22
- $form_id = intval($_REQUEST["form_id"]);
23
- isset($_REQUEST["email_id"]) ? $email_id = intval($_REQUEST["email_id"]) : $email_id = "";
24
- $fields_email = $wpdb->get_results
25
- (
26
- $wpdb->prepare
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  (
28
- "SELECT * FROM " .create_control_Table()." WHERE form_id = %d and field_id = %d ORDER BY " .create_control_Table().".sorting_order",
29
- $form_id,
30
- 3
31
- )
32
- );
33
- $email_data = $wpdb->get_row
34
- (
35
- $wpdb->prepare
 
36
  (
37
- "SELECT * FROM " .contact_bank_email_template_admin(). " where form_id= %d and email_id = %d",
38
- $form_id,
39
- $email_id
40
- )
41
- );
 
42
  ?>
43
  <form id="ux_frm_add_email" class="layout-form">
44
  <div id="poststuff" style="width: 99% !important;">
@@ -67,9 +86,9 @@ else
67
  <div class="widget-layout-body">
68
  <div class="layout-control-group">
69
  <label class="layout-control-label"><?php _e( "Name", contact_bank ); ?> :
70
- <span class="error">*</span>
71
  </label>
72
- <div class="layout-controls">
73
  <input type="text" class="layout-span12" id="ux_txt_name" name="ux_txt_name" value="<?php echo isset($email_data->name) ? $email_data->name : ""; ?>" placeholder="<?php _e( "Enter Name", contact_bank ); ?>"/>
74
  </div>
75
  </div>
@@ -83,7 +102,7 @@ else
83
  if($email_data->send_to == "0")
84
  {
85
  ?>
86
- <div class="layout-controls" style="padding-top:5px;">
87
  <input type="radio" name="ux_rdl_send_to" id="ux_rdl_email" value="0" checked="checked" onclick="show_send_to_div();">
88
  <label class="rdl"><?php _e( "Enter Email", contact_bank ); ?></label>
89
  <input type="radio" name="ux_rdl_send_to" id="ux_rdl_field" value="1" onclick="show_send_to_div(); ">
@@ -91,10 +110,10 @@ else
91
  </div>
92
  <?php
93
  }
94
- else
95
  {
96
  ?>
97
- <div class="layout-controls" style="padding-top:5px;">
98
  <input type="radio" name="ux_rdl_send_to" id="ux_rdl_email" value="0" onclick="show_send_to_div();">
99
  <label class="rdl"><?php _e( "Enter Email", contact_bank ); ?></label>
100
  <input type="radio" name="ux_rdl_send_to" id="ux_rdl_field" value="1" checked="checked" onclick="show_send_to_div(); ">
@@ -103,10 +122,10 @@ else
103
  <?php
104
  }
105
  }
106
- else
107
  {
108
  ?>
109
- <div class="layout-controls" style="padding-top:5px;">
110
  <input type="radio" name="ux_rdl_send_to" id="ux_rdl_email" value="0" checked="checked" onclick="show_send_to_div();">
111
  <label class="rdl"><?php _e( "Enter Email", contact_bank ); ?></label>
112
  <input type="radio" name="ux_rdl_send_to" id="ux_rdl_field" value="1" onclick="show_send_to_div(); ">
@@ -120,20 +139,40 @@ else
120
  <div class="widget-layout-body">
121
  <div class="layout-control-group" id="div_email" style="display: none;">
122
  <label class="layout-control-label"><?php _e( "Email", contact_bank ); ?> :
123
- <span class="error">*</span>
124
  </label>
125
- <div class="layout-controls">
126
  <input type="text" class="layout-span12" id="ux_txt_email" name="ux_txt_email" value="<?php echo isset($email_data->email_to) ? $email_data->email_to : ""; ?>" placeholder="<?php _e( "Enter Email ", contact_bank ); ?>"/>
127
  </div>
128
  </div>
129
- <div class="layout-control-group" id="div_field" style="display: none;">
130
  <label class="layout-control-label"><?php _e( "Send To Field", contact_bank ); ?> :
131
- <span class="error">*</span>
132
  </label>
133
- <div class="layout-controls">
134
  <input type="text" class="layout-span8" id="ux_txt_send_to_field" name="ux_txt_send_to_field" value="<?php echo isset($email_data->email_to) ? $email_data->email_to : ""; ?>" placeholder="<?php _e( "Enter Field ", contact_bank ); ?>"/>
135
- <select class="layout-span4" id="ux_ddl_send_to_field" name="ux_ddl_send_to_field" style="float: right;" onchange="append_control_shortcode(this.id,'ux_txt_send_to_field');">
136
  <option value=""><?php _e("Select a field", contact_bank);?></option>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  </select>
138
  </div>
139
  </div>
@@ -141,12 +180,32 @@ else
141
  <div class="widget-layout-body">
142
  <div class="layout-control-group">
143
  <label class="layout-control-label"><?php _e( "From Name", contact_bank ); ?> :
144
- <span class="error">*</span>
145
  </label>
146
- <div class="layout-controls">
147
- <input type="text" class="layout-span8" id="ux_txt_from_name" name="ux_txt_from_name" value="<?php echo isset($email_data->from_name) ? stripslashes($email_data->from_name) : ""; ?>" placeholder="<?php _e( "Enter from name ", contact_bank ); ?>"/>
148
- <select class="layout-span4" id="ux_ddl_from_name" name="ux_ddl_from_name" style=" float: right; " onchange="append_control_shortcode(this.id,'ux_txt_from_name');">
149
  <option value=""><?php _e("Select a field", contact_bank);?></option>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  </select>
151
  </div>
152
  </div>
@@ -154,12 +213,32 @@ else
154
  <div class="widget-layout-body">
155
  <div class="layout-control-group">
156
  <label class="layout-control-label"><?php _e( "From Email", contact_bank ); ?> :
157
- <span class="error" >*</span>
158
  </label>
159
- <div class="layout-controls">
160
  <input type="text" class="layout-span8" id="ux_txt_from_email" name="ux_txt_from_email" value="<?php echo isset($email_data->email_from) ? $email_data->email_from : ""; ?>" placeholder="<?php _e( "Enter from email", contact_bank ); ?>"/>
161
  <select class="layout-span4" id="ux_ddl_from_email" name="ux_ddl_from_email" style=" float: right;" onchange="append_control_shortcode(this.id,'ux_txt_from_email');">
162
  <option value=""><?php _e("Select a field", contact_bank);?></option>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  </select>
164
  </div>
165
  </div>
@@ -167,10 +246,30 @@ else
167
  <div class="widget-layout-body">
168
  <div class="layout-control-group">
169
  <label class="layout-control-label"><?php _e( "Reply To", contact_bank ); ?> :</label>
170
- <div class="layout-controls">
171
  <input type="text" class="layout-span8" id="ux_txt_reply_to" name="ux_txt_reply_to" value="<?php echo isset($email_data->reply_to) ? $email_data->reply_to : ""; ?>" placeholder="<?php _e( "Enter Email", contact_bank ); ?>"/>
172
- <select class="layout-span4" id="ux_ddl_reply_to" name="ux_ddl_replt_to" style=" float: right;" onchange="append_control_shortcode(this.id,'ux_txt_reply_to');">
173
  <option value=""><?php _e("Select a field", contact_bank);?></option>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
  </select>
175
  </div>
176
  </div>
@@ -178,10 +277,30 @@ else
178
  <div class="widget-layout-body">
179
  <div class="layout-control-group">
180
  <label class="layout-control-label"><?php _e( "CC", contact_bank ); ?> :</label>
181
- <div class="layout-controls">
182
  <input type="text" class="layout-span8" id="ux_txt_cc" name="ux_txt_cc" value="<?php echo isset($email_data->cc) ? $email_data->cc : ""; ?>" placeholder="<?php _e( "Enter CC Email ", contact_bank ); ?>"/>
183
- <select class="layout-span4" id="ux_ddl_cc" name="ux_ddl_cc" style=" float: right;" onchange="append_control_shortcode(this.id,'ux_txt_cc');">
184
  <option value=""><?php _e("Select a field", contact_bank);?></option>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
185
  </select>
186
  </div>
187
  </div>
@@ -189,10 +308,30 @@ else
189
  <div class="widget-layout-body">
190
  <div class="layout-control-group">
191
  <label class="layout-control-label"><?php _e( "BCC", contact_bank ); ?> :</label>
192
- <div class="layout-controls">
193
  <input type="text" class="layout-span8" id="ux_txt_bcc" name="ux_txt_bcc" value="<?php echo isset($email_data->bcc) ? $email_data->bcc : ""; ?>" placeholder="<?php _e( "Enter Bcc Email", contact_bank ); ?>"/>
194
- <select class="layout-span4" id="ux_ddl_bcc" name="ux_ddl_bcc" style=" float: right;" onchange="append_control_shortcode(this.id,'ux_txt_bcc');">
195
  <option value=""><?php _e("Select a field", contact_bank);?></option>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  </select>
197
  </div>
198
  </div>
@@ -200,12 +339,32 @@ else
200
  <div class="widget-layout-body">
201
  <div class="layout-control-group">
202
  <label class="layout-control-label"><?php _e( "Subject", contact_bank ); ?> :
203
- <span class="error">*</span>
204
  </label>
205
- <div class="layout-controls">
206
- <input type="text" class="layout-span8" id="ux_txt_subject" name="ux_txt_subject" value="<?php echo isset($email_data->subject) ? stripslashes($email_data->subject) : ""; ?>" placeholder="<?php _e( "Enter Subject", contact_bank ); ?>"/>
207
- <select class="layout-span4" id="ux_ddl_subject" name="ux_ddl_subject" style=" float: right;" onchange="append_control_shortcode(this.id,'ux_txt_subject');">
208
  <option value=""><?php _e("Select a field", contact_bank);?></option>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
209
  </select>
210
  </div>
211
  </div>
@@ -215,14 +374,36 @@ else
215
  <label class="layout-control-label"><?php _e( "Message", contact_bank ); ?> :</label>
216
  <div class="layout-controls">
217
  <div class="layout-span8">
 
218
  <?php
219
- $distribution = isset($email_data->body_content) ? stripslashes(html_entity_decode($email_data->body_content)) : "";
220
- wp_editor( $distribution, $id ="uxEmailTemplate", array("media_buttons" => true, "textarea_rows" => 8, "tabindex" => 4 ) );
221
  ?>
 
222
  </div>
223
  <div class="layout-span4">
224
- <select class="layout-span12" id="ux_ddl_message" name="ux_ddl_message" style=" float: right;" onchange="append_add_control_shortcode(this.id);">
225
  <option value=""><?php _e("Insert a Field into Your Form Message", contact_bank);?></option>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  </select>
227
  </div>
228
  </div>
@@ -242,100 +423,72 @@ else
242
  </div>
243
  </form>
244
  <script type="text/javascript">
245
- <?php
246
- $fields_email_controls = $wpdb->get_results
247
- (
248
- $wpdb->prepare
249
- (
250
- "SELECT dynamicId, dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " JOIN " . create_control_Table(). " ON " . contact_bank_dynamic_settings_form().". dynamicId = ". create_control_Table(). ".control_id WHERE `dynamic_settings_key` = 'cb_admin_label' and field_id = 3 and form_id = %d",
251
- $form_id
252
- )
253
- );
254
-
255
- $fields_controls = $wpdb->get_results
256
- (
257
- $wpdb->prepare
258
- (
259
- "SELECT dynamicId, dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " JOIN " . create_control_Table(). " ON " . contact_bank_dynamic_settings_form().". dynamicId = ". create_control_Table(). ".control_id WHERE `dynamic_settings_key` = 'cb_admin_label' and form_id = %d Order By ".create_control_Table().".sorting_order",
260
- $form_id
261
- )
262
- );
263
- for($flag = 0; $flag < count($fields_email_controls); $flag++)
264
- {
265
- $show_in_email = $wpdb->get_var
266
- (
267
- $wpdb->prepare
268
- (
269
- "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
270
- $fields_email_controls[$flag]->dynamicId
271
- )
272
- );
273
- if($show_in_email == "0")
274
- {
275
- ?>
276
- jQuery("#ux_ddl_from_email").append(jQuery("<option></option>").attr("value", "<?php echo $fields_email_controls[$flag]->dynamicId; ?>").text("<?php echo $fields_email_controls[$flag]->dynamic_settings_value; ?>"));
277
- jQuery("#ux_ddl_send_to_field").append(jQuery("<option></option>").attr("value", "<?php echo $fields_email_controls[$flag]->dynamicId; ?>").text("<?php echo $fields_email_controls[$flag]->dynamic_settings_value; ?>"));
278
- jQuery("#ux_ddl_reply_to").append(jQuery("<option></option>").attr("value", "<?php echo $fields_email_controls[$flag]->dynamicId; ?>").text("<?php echo $fields_email_controls[$flag]->dynamic_settings_value; ?>"));
279
- jQuery("#ux_ddl_cc").append(jQuery("<option></option>").attr("value", "<?php echo $fields_email_controls[$flag]->dynamicId; ?>").text("<?php echo $fields_email_controls[$flag]->dynamic_settings_value; ?>"));
280
- jQuery("#ux_ddl_bcc").append(jQuery("<option></option>").attr("value", "<?php echo $fields_email_controls[$flag]->dynamicId; ?>").text("<?php echo $fields_email_controls[$flag]->dynamic_settings_value; ?>"));
281
- <?php
282
- }
283
- }
284
- for($flag = 0; $flag < count($fields_controls); $flag++)
285
  {
286
- $show_in_email = $wpdb->get_var
287
- (
288
- $wpdb->prepare
289
- (
290
- "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
291
- $fields_controls[$flag]->dynamicId
292
- )
293
- );
294
- if($show_in_email == "0")
295
  {
296
- ?>
297
- jQuery("#ux_ddl_from_name").append(jQuery("<option></option>").attr("value", "<?php echo $fields_controls[$flag]->dynamicId; ?>").text("<?php echo stripslashes(htmlspecialchars_decode($fields_controls[$flag]->dynamic_settings_value, ENT_QUOTES)); ?>"));
298
- jQuery("#ux_ddl_subject").append(jQuery("<option></option>").attr("value", "<?php echo $fields_controls[$flag]->dynamicId; ?>").text("<?php echo stripslashes(htmlspecialchars_decode($fields_controls[$flag]->dynamic_settings_value, ENT_QUOTES)); ?>"));
299
- jQuery("#ux_ddl_message").append(jQuery("<option></option>").attr("value", "<?php echo $fields_controls[$flag]->dynamicId; ?>").text("<?php echo stripslashes(htmlspecialchars_decode($fields_controls[$flag]->dynamic_settings_value, ENT_QUOTES)); ?>"));
300
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
301
  }
302
  }
303
- ?>
304
  jQuery("#ux_frm_add_email").validate
305
  ({
306
- rules:
307
  {
308
- ux_txt_name :
309
  {
310
  required : true
311
  },
312
- ux_txt_email :
313
  {
314
  required : true,
315
  email : true
316
  },
317
- ux_txt_send_to_field :
318
  {
319
  required : true
320
  },
321
- ux_txt_from_name :
322
  {
323
  required : true
324
  },
325
- ux_txt_from_email :
326
  {
327
  required : true
328
  },
329
- ux_txt_subject :
330
  {
331
  required : true
332
  }
333
  },
334
- errorPlacement: function(error, element)
335
  {
336
  if(jQuery(element).attr("id") == "ux_txt_email" || jQuery(element).attr("id") == "ux_txt_name")
337
  {
338
- error.insertAfter(element);
339
  }
340
  else
341
  {
@@ -345,7 +498,7 @@ else
345
  jQuery(".error_field").css("float","left");
346
  jQuery(".error_field").css("position","static");
347
  }
348
- },
349
  submitHandler: function(form)
350
  {
351
  var form_id = "<?php echo $form_id;?>";
@@ -355,67 +508,84 @@ else
355
  scrollTop: jQuery("body,html").position().top}, "slow");
356
  if (jQuery("#wp-uxEmailTemplate-wrap").hasClass("tmce-active"))
357
  {
358
- var uxEmailTemplate = encodeURIComponent(tinyMCE.get("uxEmailTemplate").getContent());
359
  }
360
  else
361
  {
362
- var uxEmailTemplate = encodeURIComponent(jQuery("#uxEmailTemplate").val());
363
  }
364
- jQuery.post(ajaxurl, jQuery(form).serialize() +"&form_id="+form_id+"&email_id="+email_id+"&uxEmailTemplate="+uxEmailTemplate+"&param=insert_email_controls&action=email_contact_form_library", function(data)
 
 
 
 
 
 
 
 
365
  {
366
  setTimeout(function()
367
  {
368
  jQuery("#email_success_message").css("display","none");
369
- window.location.href = "admin.php?page=contact_email";
370
  }, 2000);
371
  });
372
  }
373
  });
374
- function show_send_to_div()
375
  {
376
- var ux_rdl_email = jQuery("#ux_rdl_email").prop("checked");
377
- if(ux_rdl_email == true)
378
  {
379
- jQuery("#div_field").css("display","none");
380
- jQuery("#div_email").css("display","block");
381
- }
382
- else
383
- {
384
- jQuery("#div_email").css("display","none");
385
- jQuery("#div_field").css("display","block");
 
 
 
 
386
  }
387
  }
388
- function append_control_shortcode(ddl_id,input_id)
389
- {
390
- var dynamicId = jQuery("#"+ddl_id).val();
391
- var label = jQuery("#"+ddl_id+" option:selected").text();
392
- if(dynamicId != "")
393
  {
394
- var selected_fields = jQuery("#"+input_id).val();
395
- var fields_shortCodes = selected_fields +"[control_"+dynamicId+"]";
396
- jQuery("#"+input_id).val(fields_shortCodes);
397
- jQuery("#"+ddl_id).val("");
 
 
 
 
 
398
  }
399
  }
400
- function append_add_control_shortcode(ddl_id)
401
- {
402
- var dynamicId = jQuery("#"+ddl_id).val();
403
- var label = jQuery("#"+ddl_id+" option:selected").text();
404
- if(dynamicId != "")
405
  {
406
- if (jQuery("#wp-uxEmailTemplate-wrap").hasClass("tmce-active"))
407
- {
408
- var selected_fields = tinyMCE.get("uxEmailTemplate").getContent();
409
- var fields_shortCodes = "<strong>"+selected_fields+label +"</strong> : [control_"+dynamicId+"]<br />";
410
- tinyMCE.get("uxEmailTemplate").setContent(fields_shortCodes);
411
- }
412
- else
413
  {
414
- var selected_fields = jQuery("#uxEmailTemplate").val();
415
- var fields_shortCodes = selected_fields+label +" : [control_"+dynamicId+"]<br />";
416
- jQuery("#uxEmailTemplate").val(fields_shortCodes);
 
 
 
 
 
 
 
 
 
 
417
  }
418
- jQuery("#"+ddl_id).val("");
419
  }
420
  }
421
  jQuery(document).ready(function()
@@ -423,6 +593,6 @@ else
423
  show_send_to_div();
424
  });
425
  </script>
426
- <?php
427
  }
428
- ?>
11
  case "author":
12
  $cb_user_role_permission = "publish_posts";
13
  break;
14
+
15
  }
16
  if (!current_user_can($cb_user_role_permission))
17
  {
18
  return;
19
  }
20
+ else
21
  {
22
+ $form_id = intval($_REQUEST["form_id"]);
23
+ isset($_REQUEST["email_id"]) ? $email_id = intval($_REQUEST["email_id"]) : $email_id = "";
24
+
25
+ $fields_email = $wpdb->get_results
26
+ (
27
+ $wpdb->prepare
28
+ (
29
+ "SELECT * FROM " .create_control_Table()." WHERE form_id = %d and field_id = %d ORDER BY " .create_control_Table().".sorting_order",
30
+ $form_id,
31
+ 3
32
+ )
33
+ );
34
+ $email_data = $wpdb->get_row
35
+ (
36
+ $wpdb->prepare
37
+ (
38
+ "SELECT * FROM " .contact_bank_email_template_admin(). " where form_id= %d and email_id = %d",
39
+ $form_id,
40
+ $email_id
41
+ )
42
+ );
43
+ $fields_controls = $wpdb->get_results
44
  (
45
+ $wpdb->prepare
46
+ (
47
+ "SELECT dynamicId, dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " JOIN " . create_control_Table(). " ON " . contact_bank_dynamic_settings_form().". dynamicId = ". create_control_Table(). ".control_id WHERE `dynamic_settings_key` = 'cb_admin_label' and form_id = %d and " . create_control_Table(). ".field_id != %d and " . create_control_Table(). ".field_id != %d Order By ".create_control_Table().".sorting_order",
48
+ $form_id,
49
+ 9,
50
+ 17
51
+ )
52
+ );
53
+ $fields_email_controls = $wpdb->get_results
54
  (
55
+ $wpdb->prepare
56
+ (
57
+ "SELECT dynamicId, dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " JOIN " . create_control_Table(). " ON " . contact_bank_dynamic_settings_form().". dynamicId = ". create_control_Table(). ".control_id WHERE `dynamic_settings_key` = 'cb_admin_label' and field_id = 3 and form_id = %d",
58
+ $form_id
59
+ )
60
+ );
61
  ?>
62
  <form id="ux_frm_add_email" class="layout-form">
63
  <div id="poststuff" style="width: 99% !important;">
86
  <div class="widget-layout-body">
87
  <div class="layout-control-group">
88
  <label class="layout-control-label"><?php _e( "Name", contact_bank ); ?> :
89
+ <span class="error_field">*</span>
90
  </label>
91
+ <div class="layout-controls">
92
  <input type="text" class="layout-span12" id="ux_txt_name" name="ux_txt_name" value="<?php echo isset($email_data->name) ? $email_data->name : ""; ?>" placeholder="<?php _e( "Enter Name", contact_bank ); ?>"/>
93
  </div>
94
  </div>
102
  if($email_data->send_to == "0")
103
  {
104
  ?>
105
+ <div class="layout-controls" style="padding-top:5px;">
106
  <input type="radio" name="ux_rdl_send_to" id="ux_rdl_email" value="0" checked="checked" onclick="show_send_to_div();">
107
  <label class="rdl"><?php _e( "Enter Email", contact_bank ); ?></label>
108
  <input type="radio" name="ux_rdl_send_to" id="ux_rdl_field" value="1" onclick="show_send_to_div(); ">
110
  </div>
111
  <?php
112
  }
113
+ else
114
  {
115
  ?>
116
+ <div class="layout-controls" style="padding-top:5px;">
117
  <input type="radio" name="ux_rdl_send_to" id="ux_rdl_email" value="0" onclick="show_send_to_div();">
118
  <label class="rdl"><?php _e( "Enter Email", contact_bank ); ?></label>
119
  <input type="radio" name="ux_rdl_send_to" id="ux_rdl_field" value="1" checked="checked" onclick="show_send_to_div(); ">
122
  <?php
123
  }
124
  }
125
+ else
126
  {
127
  ?>
128
+ <div class="layout-controls" style="padding-top:5px;">
129
  <input type="radio" name="ux_rdl_send_to" id="ux_rdl_email" value="0" checked="checked" onclick="show_send_to_div();">
130
  <label class="rdl"><?php _e( "Enter Email", contact_bank ); ?></label>
131
  <input type="radio" name="ux_rdl_send_to" id="ux_rdl_field" value="1" onclick="show_send_to_div(); ">
139
  <div class="widget-layout-body">
140
  <div class="layout-control-group" id="div_email" style="display: none;">
141
  <label class="layout-control-label"><?php _e( "Email", contact_bank ); ?> :
142
+ <span class="error_field">*</span>
143
  </label>
144
+ <div class="layout-controls">
145
  <input type="text" class="layout-span12" id="ux_txt_email" name="ux_txt_email" value="<?php echo isset($email_data->email_to) ? $email_data->email_to : ""; ?>" placeholder="<?php _e( "Enter Email ", contact_bank ); ?>"/>
146
  </div>
147
  </div>
148
+ <div class="layout-control-group" id="div_field" style="display: none;">
149
  <label class="layout-control-label"><?php _e( "Send To Field", contact_bank ); ?> :
150
+ <span class="error_field">*</span>
151
  </label>
152
+ <div class="layout-controls">
153
  <input type="text" class="layout-span8" id="ux_txt_send_to_field" name="ux_txt_send_to_field" value="<?php echo isset($email_data->email_to) ? $email_data->email_to : ""; ?>" placeholder="<?php _e( "Enter Field ", contact_bank ); ?>"/>
154
+ <select class="layout-span4" id="ux_ddl_send_to_field" name="ux_ddl_send_to_field" style="float: right;" onchange="append_control_shortcode('ux_ddl_send_to_field','ux_txt_send_to_field');">
155
  <option value=""><?php _e("Select a field", contact_bank);?></option>
156
+ <?php
157
+ for($flag = 0; $flag < count($fields_controls); $flag++)
158
+ {
159
+ $show_in_email = $wpdb->get_var
160
+ (
161
+ $wpdb->prepare
162
+ (
163
+ "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
164
+ $fields_controls[$flag]->dynamicId
165
+ )
166
+ );
167
+ if($show_in_email == "0")
168
+ {
169
+ $option_values = htmlspecialchars_decode($fields_controls[$flag]->dynamic_settings_value);
170
+ ?>
171
+ <option value="<?php echo $fields_controls[$flag]->dynamicId;?>"><?php echo $option_values;?></option>
172
+ <?php
173
+ }
174
+ }
175
+ ?>
176
  </select>
177
  </div>
178
  </div>
180
  <div class="widget-layout-body">
181
  <div class="layout-control-group">
182
  <label class="layout-control-label"><?php _e( "From Name", contact_bank ); ?> :
183
+ <span class="error_field">*</span>
184
  </label>
185
+ <div class="layout-controls">
186
+ <input type="text" class="layout-span8" id="ux_txt_from_name" name="ux_txt_from_name" value="<?php echo isset($email_data->from_name) ? $email_data->from_name : ""; ?>" placeholder="<?php _e( "Enter from name ", contact_bank ); ?>"/>
187
+ <select class="layout-span4" id="ux_ddl_from_name" name="ux_ddl_from_name" style=" float: right; " onchange="append_control_shortcode('ux_ddl_from_name','ux_txt_from_name');">
188
  <option value=""><?php _e("Select a field", contact_bank);?></option>
189
+ <?php
190
+ for($flag = 0; $flag < count($fields_controls); $flag++)
191
+ {
192
+ $show_in_email = $wpdb->get_var
193
+ (
194
+ $wpdb->prepare
195
+ (
196
+ "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
197
+ $fields_controls[$flag]->dynamicId
198
+ )
199
+ );
200
+ if($show_in_email == "0")
201
+ {
202
+ $option_values = htmlspecialchars_decode($fields_controls[$flag]->dynamic_settings_value);
203
+ ?>
204
+ <option value="<?php echo $fields_controls[$flag]->dynamicId;?>"><?php echo $option_values;?></option>
205
+ <?php
206
+ }
207
+ }
208
+ ?>
209
  </select>
210
  </div>
211
  </div>
213
  <div class="widget-layout-body">
214
  <div class="layout-control-group">
215
  <label class="layout-control-label"><?php _e( "From Email", contact_bank ); ?> :
216
+ <span class="error_field" >*</span>
217
  </label>
218
+ <div class="layout-controls">
219
  <input type="text" class="layout-span8" id="ux_txt_from_email" name="ux_txt_from_email" value="<?php echo isset($email_data->email_from) ? $email_data->email_from : ""; ?>" placeholder="<?php _e( "Enter from email", contact_bank ); ?>"/>
220
  <select class="layout-span4" id="ux_ddl_from_email" name="ux_ddl_from_email" style=" float: right;" onchange="append_control_shortcode(this.id,'ux_txt_from_email');">
221
  <option value=""><?php _e("Select a field", contact_bank);?></option>
222
+ <?php
223
+ for($flag = 0; $flag < count($fields_email_controls); $flag++)
224
+ {
225
+ $show_in_email = $wpdb->get_var
226
+ (
227
+ $wpdb->prepare
228
+ (
229
+ "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
230
+ $fields_email_controls[$flag]->dynamicId
231
+ )
232
+ );
233
+ if($show_in_email == "0")
234
+ {
235
+ $option_values = htmlspecialchars_decode($fields_email_controls[$flag]->dynamic_settings_value);
236
+ ?>
237
+ <option value="<?php echo $fields_email_controls[$flag]->dynamicId;?>"><?php echo $option_values;?></option>
238
+ <?php
239
+ }
240
+ }
241
+ ?>
242
  </select>
243
  </div>
244
  </div>
246
  <div class="widget-layout-body">
247
  <div class="layout-control-group">
248
  <label class="layout-control-label"><?php _e( "Reply To", contact_bank ); ?> :</label>
249
+ <div class="layout-controls">
250
  <input type="text" class="layout-span8" id="ux_txt_reply_to" name="ux_txt_reply_to" value="<?php echo isset($email_data->reply_to) ? $email_data->reply_to : ""; ?>" placeholder="<?php _e( "Enter Email", contact_bank ); ?>"/>
251
+ <select class="layout-span4" id="ux_ddl_reply_to" name="ux_ddl_reply_to" style=" float: right;" onchange="append_control_shortcode('ux_ddl_reply_to','ux_txt_reply_to');">
252
  <option value=""><?php _e("Select a field", contact_bank);?></option>
253
+ <?php
254
+ for($flag = 0; $flag < count($fields_email_controls); $flag++)
255
+ {
256
+ $show_in_email = $wpdb->get_var
257
+ (
258
+ $wpdb->prepare
259
+ (
260
+ "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
261
+ $fields_email_controls[$flag]->dynamicId
262
+ )
263
+ );
264
+ if($show_in_email == "0")
265
+ {
266
+ $option_values = htmlspecialchars_decode($fields_email_controls[$flag]->dynamic_settings_value);
267
+ ?>
268
+ <option value="<?php echo $fields_email_controls[$flag]->dynamicId;?>"><?php echo $option_values;?></option>
269
+ <?php
270
+ }
271
+ }
272
+ ?>
273
  </select>
274
  </div>
275
  </div>
277
  <div class="widget-layout-body">
278
  <div class="layout-control-group">
279
  <label class="layout-control-label"><?php _e( "CC", contact_bank ); ?> :</label>
280
+ <div class="layout-controls">
281
  <input type="text" class="layout-span8" id="ux_txt_cc" name="ux_txt_cc" value="<?php echo isset($email_data->cc) ? $email_data->cc : ""; ?>" placeholder="<?php _e( "Enter CC Email ", contact_bank ); ?>"/>
282
+ <select class="layout-span4" id="ux_ddl_cc" name="ux_ddl_cc" style=" float: right;" onchange="append_control_shortcode('ux_ddl_cc','ux_txt_cc');">
283
  <option value=""><?php _e("Select a field", contact_bank);?></option>
284
+ <?php
285
+ for($flag = 0; $flag < count($fields_email_controls); $flag++)
286
+ {
287
+ $show_in_email = $wpdb->get_var
288
+ (
289
+ $wpdb->prepare
290
+ (
291
+ "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
292
+ $fields_email_controls[$flag]->dynamicId
293
+ )
294
+ );
295
+ if($show_in_email == "0")
296
+ {
297
+ $option_values = htmlspecialchars_decode($fields_email_controls[$flag]->dynamic_settings_value);
298
+ ?>
299
+ <option value="<?php echo $fields_email_controls[$flag]->dynamicId;?>"><?php echo $option_values;?></option>
300
+ <?php
301
+ }
302
+ }
303
+ ?>
304
  </select>
305
  </div>
306
  </div>
308
  <div class="widget-layout-body">
309
  <div class="layout-control-group">
310
  <label class="layout-control-label"><?php _e( "BCC", contact_bank ); ?> :</label>
311
+ <div class="layout-controls">
312
  <input type="text" class="layout-span8" id="ux_txt_bcc" name="ux_txt_bcc" value="<?php echo isset($email_data->bcc) ? $email_data->bcc : ""; ?>" placeholder="<?php _e( "Enter Bcc Email", contact_bank ); ?>"/>
313
+ <select class="layout-span4" id="ux_ddl_bcc" name="ux_ddl_bcc" style=" float: right;" onchange="append_control_shortcode('ux_ddl_bcc','ux_txt_bcc');">
314
  <option value=""><?php _e("Select a field", contact_bank);?></option>
315
+ <?php
316
+ for($flag = 0; $flag < count($fields_email_controls); $flag++)
317
+ {
318
+ $show_in_email = $wpdb->get_var
319
+ (
320
+ $wpdb->prepare
321
+ (
322
+ "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
323
+ $fields_email_controls[$flag]->dynamicId
324
+ )
325
+ );
326
+ if($show_in_email == "0")
327
+ {
328
+ $option_values = htmlspecialchars_decode($fields_email_controls[$flag]->dynamic_settings_value);
329
+ ?>
330
+ <option value="<?php echo $fields_email_controls[$flag]->dynamicId;?>"><?php echo $option_values;?></option>
331
+ <?php
332
+ }
333
+ }
334
+ ?>
335
  </select>
336
  </div>
337
  </div>
339
  <div class="widget-layout-body">
340
  <div class="layout-control-group">
341
  <label class="layout-control-label"><?php _e( "Subject", contact_bank ); ?> :
342
+ <span class="error_field">*</span>
343
  </label>
344
+ <div class="layout-controls">
345
+ <input type="text" class="layout-span8" id="ux_txt_subject" name="ux_txt_subject" value="<?php echo isset($email_data->subject) ? $email_data->subject : ""; ?>" placeholder="<?php _e( "Enter Subject", contact_bank ); ?>"/>
346
+ <select class="layout-span4" id="ux_ddl_subject" name="ux_ddl_subject" style=" float: right;" onchange="append_control_shortcode('ux_ddl_subject','ux_txt_subject');">
347
  <option value=""><?php _e("Select a field", contact_bank);?></option>
348
+ <?php
349
+ for($flag = 0; $flag < count($fields_controls); $flag++)
350
+ {
351
+ $show_in_email = $wpdb->get_var
352
+ (
353
+ $wpdb->prepare
354
+ (
355
+ "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
356
+ $fields_controls[$flag]->dynamicId
357
+ )
358
+ );
359
+ if($show_in_email == "0")
360
+ {
361
+ $option_values = htmlspecialchars_decode($fields_controls[$flag]->dynamic_settings_value);
362
+ ?>
363
+ <option value="<?php echo $fields_controls[$flag]->dynamicId;?>"><?php echo $option_values;?></option>
364
+ <?php
365
+ }
366
+ }
367
+ ?>
368
  </select>
369
  </div>
370
  </div>
374
  <label class="layout-control-label"><?php _e( "Message", contact_bank ); ?> :</label>
375
  <div class="layout-controls">
376
  <div class="layout-span8">
377
+
378
  <?php
379
+ $distribution = isset($email_data->body_content) ? htmlspecialchars_decode($email_data->body_content) : "";
380
+ wp_editor( $distribution, $id ="uxEmailTemplate", array("media_buttons" => true, "textarea_rows" => 8, "tabindex" => 4 ) );
381
  ?>
382
+ <textarea style="display:none;" id="uxEmailTemplate_hidden" name="uxEmailTemplate_hidden" ><?php echo $distribution;?></textarea>
383
  </div>
384
  <div class="layout-span4">
385
+ <select class="layout-span12" id="ux_ddl_message" name="ux_ddl_message" style=" float: right;" onchange="append_add_control_shortcode('ux_ddl_message');">
386
  <option value=""><?php _e("Insert a Field into Your Form Message", contact_bank);?></option>
387
+ <?php
388
+ for($flag = 0; $flag < count($fields_controls); $flag++)
389
+ {
390
+ $show_in_email = $wpdb->get_var
391
+ (
392
+ $wpdb->prepare
393
+ (
394
+ "SELECT dynamic_settings_value FROM ". contact_bank_dynamic_settings_form(). " WHERE `dynamic_settings_key` = 'cb_show_email' and dynamicId = %d",
395
+ $fields_controls[$flag]->dynamicId
396
+ )
397
+ );
398
+ if($show_in_email == "0")
399
+ {
400
+ $option_values = htmlspecialchars_decode($fields_controls[$flag]->dynamic_settings_value);
401
+ ?>
402
+ <option value="<?php echo $fields_controls[$flag]->dynamicId;?>"><?php echo $option_values;?></option>
403
+ <?php
404
+ }
405
+ }
406
+ ?>
407
  </select>
408
  </div>
409
  </div>
423
  </div>
424
  </form>
425
  <script type="text/javascript">
426
+ if (typeof(base64_encode) != "function")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
427
  {
428
+ function base64_encode(data)
 
 
 
 
 
 
 
 
429
  {
430
+ var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
431
+ var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
432
+ ac = 0,
433
+ enc = '',
434
+ tmp_arr = [];
435
+ if (!data)
436
+ {
437
+ return data;
438
+ }
439
+ do
440
+ {
441
+ o1 = data.charCodeAt(i++);
442
+ o2 = data.charCodeAt(i++);
443
+ o3 = data.charCodeAt(i++);
444
+ bits = o1 << 16 | o2 << 8 | o3;
445
+ h1 = bits >> 18 & 0x3f;
446
+ h2 = bits >> 12 & 0x3f;
447
+ h3 = bits >> 6 & 0x3f;
448
+ h4 = bits & 0x3f;
449
+ tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
450
+ }
451
+ while (i < data.length);
452
+ enc = tmp_arr.join('');
453
+ var r = data.length % 3;
454
+ return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
455
  }
456
  }
 
457
  jQuery("#ux_frm_add_email").validate
458
  ({
459
+ rules:
460
  {
461
+ ux_txt_name :
462
  {
463
  required : true
464
  },
465
+ ux_txt_email :
466
  {
467
  required : true,
468
  email : true
469
  },
470
+ ux_txt_send_to_field :
471
  {
472
  required : true
473
  },
474
+ ux_txt_from_name :
475
  {
476
  required : true
477
  },
478
+ ux_txt_from_email :
479
  {
480
  required : true
481
  },
482
+ ux_txt_subject :
483
  {
484
  required : true
485
  }
486
  },
487
+ errorPlacement: function(error, element)
488
  {
489
  if(jQuery(element).attr("id") == "ux_txt_email" || jQuery(element).attr("id") == "ux_txt_name")
490
  {
491
+ error.insertAfter(element);
492
  }
493
  else
494
  {
498
  jQuery(".error_field").css("float","left");
499
  jQuery(".error_field").css("position","static");
500
  }
501
+ },
502
  submitHandler: function(form)
503
  {
504
  var form_id = "<?php echo $form_id;?>";
508
  scrollTop: jQuery("body,html").position().top}, "slow");
509
  if (jQuery("#wp-uxEmailTemplate-wrap").hasClass("tmce-active"))
510
  {
511
+ jQuery("#uxEmailTemplate_hidden").val(tinyMCE.get("uxEmailTemplate").getContent());
512
  }
513
  else
514
  {
515
+ jQuery("#uxEmailTemplate_hidden").val(jQuery("#uxEmailTemplate").val());
516
  }
517
+ jQuery.post(ajaxurl,
518
+ {
519
+ data: base64_encode(jQuery(form).serialize()),
520
+ email_id: email_id,
521
+ form_id: form_id,
522
+ param: "insert_email_controls",
523
+ action: "email_contact_form_library"
524
+ },
525
+ function(data)
526
  {
527
  setTimeout(function()
528
  {
529
  jQuery("#email_success_message").css("display","none");
530
+ window.location.href = "admin.php?page=contact_dashboard";
531
  }, 2000);
532
  });
533
  }
534
  });
535
+ if (typeof(show_send_to_div) != "function")
536
  {
537
+ function show_send_to_div()
 
538
  {
539
+ var ux_rdl_email = jQuery("#ux_rdl_email").prop("checked");
540
+ if(ux_rdl_email == true)
541
+ {
542
+ jQuery("#div_field").css("display","none");
543
+ jQuery("#div_email").css("display","block");
544
+ }
545
+ else
546
+ {
547
+ jQuery("#div_email").css("display","none");
548
+ jQuery("#div_field").css("display","block");
549
+ }
550
  }
551
  }
552
+ if (typeof(append_control_shortcode) != "function")
553
+ {
554
+ function append_control_shortcode(ddl_id,input_id)
 
 
555
  {
556
+ var dynamicId = jQuery("#"+ddl_id).val();
557
+ var label = jQuery("#"+ddl_id+" option:selected").text();
558
+ if(dynamicId != "")
559
+ {
560
+ var selected_fields = jQuery("#"+input_id).val();
561
+ var fields_shortCodes = selected_fields +"[control_"+dynamicId+"]";
562
+ jQuery("#"+input_id).val(fields_shortCodes);
563
+ jQuery("#"+ddl_id).val("");
564
+ }
565
  }
566
  }
567
+ if (typeof(append_add_control_shortcode) != "function")
568
+ {
569
+ function append_add_control_shortcode(ddl_id)
 
 
570
  {
571
+ var dynamicId = jQuery("#"+ddl_id).val();
572
+ var label = jQuery("#"+ddl_id+" option:selected").text();
573
+ if(dynamicId != "")
 
 
 
 
574
  {
575
+ if (jQuery("#wp-uxEmailTemplate-wrap").hasClass("tmce-active"))
576
+ {
577
+ var selected_fields = tinyMCE.get("uxEmailTemplate").getContent();
578
+ var fields_shortCodes = "<strong>"+selected_fields+label +"</strong> : [control_"+dynamicId+"]<br />";
579
+ tinyMCE.get("uxEmailTemplate").setContent(fields_shortCodes);
580
+ }
581
+ else
582
+ {
583
+ var selected_fields = jQuery("#uxEmailTemplate").val();
584
+ var fields_shortCodes = selected_fields+label +" : [control_"+dynamicId+"]<br />";
585
+ jQuery("#uxEmailTemplate").val(fields_shortCodes);
586
+ }
587
+ jQuery("#"+ddl_id).val("");
588
  }
 
589
  }
590
  }
591
  jQuery(document).ready(function()
593
  show_send_to_div();
594
  });
595
  </script>
596
+ <?php
597
  }
598
+ ?>
views/automatic-plugin-update.php CHANGED
@@ -10,7 +10,7 @@ switch($cb_role)
10
  case "author":
11
  $cb_user_role_permission = "publish_posts";
12
  break;
13
-
14
  }
15
  if (!current_user_can($cb_user_role_permission))
16
  {
@@ -48,6 +48,8 @@ else
48
  </div>
49
  </form>
50
  <script type="text/javascript">
 
 
51
  function contact_bank_autoupdate(control)
52
  {
53
  var contact_updates = jQuery(control).val();
@@ -55,7 +57,8 @@ else
55
  {
56
  });
57
  }
 
58
  </script>
59
- <?php
60
  }
61
- ?>
10
  case "author":
11
  $cb_user_role_permission = "publish_posts";
12
  break;
13
+
14
  }
15
  if (!current_user_can($cb_user_role_permission))
16
  {
48
  </div>
49
  </form>
50
  <script type="text/javascript">
51
+ if (typeof(contact_bank_autoupdate) != "function")
52
+ {
53
  function contact_bank_autoupdate(control)
54
  {
55
  var contact_updates = jQuery(control).val();
57
  {
58
  });
59
  }
60
+ }
61
  </script>
62
+ <?php
63
  }
64
+ ?>
views/contact_bank_form_preview.php CHANGED
@@ -54,7 +54,7 @@ else
54
  $control_settings_array[$column_dynamicId][$control_settings[$flag1]->dynamic_settings_key] = $control_settings[$flag1]->dynamic_settings_value;
55
  }
56
  }
57
-
58
  $form_settings = $wpdb->get_results
59
  (
60
  $wpdb->prepare
@@ -67,7 +67,7 @@ else
67
  {
68
  $form_settings_array[$form_id][$form_settings[$flag2]->form_message_key] = $form_settings[$flag2]->form_message_value;
69
  }
70
-
71
  $forms_layout_settings = $wpdb->get_results
72
  (
73
  $wpdb->prepare
@@ -80,7 +80,7 @@ else
80
  {
81
  $layout_settings_array[$form_id][$forms_layout_settings[$flag3]->form_settings_key] = $forms_layout_settings[$flag3]->form_settings_value;
82
  }
83
-
84
  $forms_email_settings = $wpdb->get_row
85
  (
86
  $wpdb->prepare
@@ -91,7 +91,7 @@ else
91
  );
92
  ?>
93
  <style type="text/css">
94
-
95
  .main_container_form
96
  {
97
  display: inline-block !important;
@@ -133,7 +133,7 @@ else
133
  text-align: right !important;
134
  <?php
135
  }
136
- else
137
  {
138
  ?>
139
  text-align: <?php echo $layout_settings_array[$form_id]["label_setting_font_align_left"] == "0" ? "left" : "right"; ?> !important;
@@ -141,13 +141,13 @@ else
141
  }
142
  ?>
143
  font-size: <?php echo $layout_settings_array[$form_id]["label_setting_font_size"] . "px"; ?> !important;
144
-
145
  display: <?php echo $layout_settings_array[$form_id]["label_setting_hide_label"] == "0" ? "inline-block" : "none"; ?> !important;
146
  direction: <?php echo $layout_settings_array[$form_id]["label_setting_text_direction"]; ?> !important;
147
  }
148
  .input_control
149
  {
150
-
151
  font-family: <?php echo $layout_settings_array[$form_id]["input_field_font_family"]; ?> !important;
152
  color: <?php echo $layout_settings_array[$form_id]["input_field_font_color"]; ?> !important;
153
  <?php
@@ -184,7 +184,7 @@ else
184
  margin-left: 0px !important;
185
  <?php
186
  }
187
-
188
  ?>
189
  }
190
  .field_description
@@ -207,7 +207,7 @@ else
207
  }
208
  ?>
209
  font-size: <?php echo $layout_settings_array[$form_id]["label_setting_field_size"] . "px"; ?> !important;
210
- text-align: <?php echo $layout_settings_array[$form_id]["label_setting_field_align"]; ?> !important;
211
  }
212
  .btn_submit
213
  {
@@ -245,7 +245,7 @@ else
245
  }
246
  .success_message
247
  {
248
-
249
  background-color: <?php echo $layout_settings_array[$form_id]["success_msg_bg_color"]; ?> !important;
250
  border: <?php echo "2px Solid ".$layout_settings_array[$form_id]["success_msg_border_color"]; ?> !important;
251
  color: <?php echo $layout_settings_array[$form_id]["success_msg_text_color"]; ?> !important;
@@ -330,7 +330,7 @@ else
330
  <?php
331
  switch($form_fields[$flag]->field_id)
332
  {
333
-
334
  case 1:
335
  ?>
336
  <div class="layout-controls layout_according_label_position">
@@ -344,7 +344,7 @@ else
344
  data-digit="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_digit_filter"];?>"
345
  data-strip="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_strip_tag_filter"];?>"
346
  data-trim="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_trim_filter"];?>"
347
-
348
  onfocus="prevent_paste(this.id);"/>
349
  <br/>
350
  <span class="field_description" id="txt_description_"><?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_description"]; ?></span>
@@ -356,13 +356,13 @@ else
356
  <div class="layout-controls layout_according_label_position">
357
  <textarea class="hovertip input_control <?php echo $layout_settings_array[$form_id]["input_field_input_size"]; ?>" id="ux_textarea_control_<?php echo $form_fields[$flag]->column_dynamicId; ?>"
358
  placeholder="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_default_txt_val"];?>" name="ux_textarea_control_<?php echo $form_fields[$flag]->column_dynamicId; ?>"
359
- onfocus="prevent_paste(this.id);"
360
  data-alpha="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_alpha_filter"];?>"
361
  data-alpha_num="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_ux_checkbox_alpha_num_filter"];?>"
362
  data-digit="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_digit_filter"];?>"
363
  data-strip="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_strip_tag_filter"];?>"
364
  data-trim="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_trim_filter"];?>"
365
-
366
  data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>"></textarea>
367
  <br/>
368
  <span class="field_description" id="txt_description_"><?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_description"]; ?></span>
@@ -381,13 +381,13 @@ else
381
  <br/>
382
  <span class="field_description" id="txt_description_"><?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_description"]; ?></span>
383
  </div>
384
- <?php
385
  break;
386
  case 4:
387
  $ddl_values = unserialize($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_dropdown_option_val"]);
388
  $ddl_ids = unserialize($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_dropdown_option_id"]);
389
  ?>
390
-
391
  <div class="layout-controls layout_according_label_position">
392
  <select class="hovertip input_control <?php echo $layout_settings_array[$form_id]["input_field_input_size"]; ?>" type="select" id="ux_select_default_<?php echo $form_fields[$flag]->column_dynamicId; ?>"
393
  data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>"
@@ -416,7 +416,7 @@ else
416
  foreach($chk_ids as $key => $value )
417
  {
418
  ?>
419
-
420
  <input type="checkbox" class="hovertip" id="ux_chk_control_<?php echo $value; ?>"
421
  data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>"
422
  name="<?php echo $form_fields[$flag]->column_dynamicId; ?>_chk[]"
@@ -424,14 +424,14 @@ else
424
  <label style="margin:0px;vertical-align: middle;" id="chk_id_<?php echo $value; ?>">
425
  <?php echo $chk_values[$key]; ?>
426
  </label>
427
-
428
  <?php
429
  }
430
  ?>
431
  </div>
432
  <?php
433
  }
434
- else
435
  {
436
  ?>
437
  <div class="layout-controls layout_according_label_position">
@@ -465,7 +465,7 @@ else
465
  else
466
  {
467
  ?>
468
-
469
  <input type="radio" class="hovertip" id="ux_rdl_control_<?php echo $value; ?>"
470
  name="<?php echo $form_fields[$flag]->column_dynamicId; ?>_rdl"
471
  data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>"
@@ -473,8 +473,8 @@ else
473
  <label style="margin:0px;vertical-align: middle;" id="rdl_id_<?php echo $value; ?>">
474
  <?php echo $rdl_values[$key]; ?>
475
  </label>
476
-
477
-
478
  <?php
479
  }
480
  }
@@ -482,7 +482,7 @@ else
482
  </div>
483
  <?php
484
  }
485
- else
486
  {
487
  ?>
488
  <div class="layout-controls layout_according_label_position">
@@ -490,7 +490,7 @@ else
490
  </div>
491
  <?php
492
  }
493
-
494
  break;
495
  }
496
  ?>
@@ -511,17 +511,19 @@ else
511
  </div>
512
  </form>
513
  </div>
514
-
515
  <script type="text/javascript">
516
- function prevent_paste(control_id)
517
  {
518
- jQuery("#"+control_id).live("paste",function(e)
519
  {
520
- e.preventDefault();
521
- });
 
 
 
522
  }
523
-
524
  </script>
525
- <?php
526
  }
527
- ?>
54
  $control_settings_array[$column_dynamicId][$control_settings[$flag1]->dynamic_settings_key] = $control_settings[$flag1]->dynamic_settings_value;
55
  }
56
  }
57
+
58
  $form_settings = $wpdb->get_results
59
  (
60
  $wpdb->prepare
67
  {
68
  $form_settings_array[$form_id][$form_settings[$flag2]->form_message_key] = $form_settings[$flag2]->form_message_value;
69
  }
70
+
71
  $forms_layout_settings = $wpdb->get_results
72
  (
73
  $wpdb->prepare
80
  {
81
  $layout_settings_array[$form_id][$forms_layout_settings[$flag3]->form_settings_key] = $forms_layout_settings[$flag3]->form_settings_value;
82
  }
83
+
84
  $forms_email_settings = $wpdb->get_row
85
  (
86
  $wpdb->prepare
91
  );
92
  ?>
93
  <style type="text/css">
94
+
95
  .main_container_form
96
  {
97
  display: inline-block !important;
133
  text-align: right !important;
134
  <?php
135
  }
136
+ else
137
  {
138
  ?>
139
  text-align: <?php echo $layout_settings_array[$form_id]["label_setting_font_align_left"] == "0" ? "left" : "right"; ?> !important;
141
  }
142
  ?>
143
  font-size: <?php echo $layout_settings_array[$form_id]["label_setting_font_size"] . "px"; ?> !important;
144
+
145
  display: <?php echo $layout_settings_array[$form_id]["label_setting_hide_label"] == "0" ? "inline-block" : "none"; ?> !important;
146
  direction: <?php echo $layout_settings_array[$form_id]["label_setting_text_direction"]; ?> !important;
147
  }
148
  .input_control
149
  {
150
+
151
  font-family: <?php echo $layout_settings_array[$form_id]["input_field_font_family"]; ?> !important;
152
  color: <?php echo $layout_settings_array[$form_id]["input_field_font_color"]; ?> !important;
153
  <?php
184
  margin-left: 0px !important;
185
  <?php
186
  }
187
+
188
  ?>
189
  }
190
  .field_description
207
  }
208
  ?>
209
  font-size: <?php echo $layout_settings_array[$form_id]["label_setting_field_size"] . "px"; ?> !important;
210
+ text-align: <?php echo $layout_settings_array[$form_id]["label_setting_field_align"]; ?> !important;
211
  }
212
  .btn_submit
213
  {
245
  }
246
  .success_message
247
  {
248
+
249
  background-color: <?php echo $layout_settings_array[$form_id]["success_msg_bg_color"]; ?> !important;
250
  border: <?php echo "2px Solid ".$layout_settings_array[$form_id]["success_msg_border_color"]; ?> !important;
251
  color: <?php echo $layout_settings_array[$form_id]["success_msg_text_color"]; ?> !important;
330
  <?php
331
  switch($form_fields[$flag]->field_id)
332
  {
333
+
334
  case 1:
335
  ?>
336
  <div class="layout-controls layout_according_label_position">
344
  data-digit="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_digit_filter"];?>"
345
  data-strip="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_strip_tag_filter"];?>"
346
  data-trim="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_trim_filter"];?>"
347
+
348
  onfocus="prevent_paste(this.id);"/>
349
  <br/>
350
  <span class="field_description" id="txt_description_"><?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_description"]; ?></span>
356
  <div class="layout-controls layout_according_label_position">
357
  <textarea class="hovertip input_control <?php echo $layout_settings_array[$form_id]["input_field_input_size"]; ?>" id="ux_textarea_control_<?php echo $form_fields[$flag]->column_dynamicId; ?>"
358
  placeholder="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_default_txt_val"];?>" name="ux_textarea_control_<?php echo $form_fields[$flag]->column_dynamicId; ?>"
359
+ onfocus="prevent_paste(this.id);"
360
  data-alpha="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_alpha_filter"];?>"
361
  data-alpha_num="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_ux_checkbox_alpha_num_filter"];?>"
362
  data-digit="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_digit_filter"];?>"
363
  data-strip="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_strip_tag_filter"];?>"
364
  data-trim="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_checkbox_trim_filter"];?>"
365
+
366
  data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>"></textarea>
367
  <br/>
368
  <span class="field_description" id="txt_description_"><?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_description"]; ?></span>
381
  <br/>
382
  <span class="field_description" id="txt_description_"><?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_description"]; ?></span>
383
  </div>
384
+ <?php
385
  break;
386
  case 4:
387
  $ddl_values = unserialize($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_dropdown_option_val"]);
388
  $ddl_ids = unserialize($control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_dropdown_option_id"]);
389
  ?>
390
+
391
  <div class="layout-controls layout_according_label_position">
392
  <select class="hovertip input_control <?php echo $layout_settings_array[$form_id]["input_field_input_size"]; ?>" type="select" id="ux_select_default_<?php echo $form_fields[$flag]->column_dynamicId; ?>"
393
  data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>"
416
  foreach($chk_ids as $key => $value )
417
  {
418
  ?>
419
+
420
  <input type="checkbox" class="hovertip" id="ux_chk_control_<?php echo $value; ?>"
421
  data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>"
422
  name="<?php echo $form_fields[$flag]->column_dynamicId; ?>_chk[]"
424
  <label style="margin:0px;vertical-align: middle;" id="chk_id_<?php echo $value; ?>">
425
  <?php echo $chk_values[$key]; ?>
426
  </label>
427
+
428
  <?php
429
  }
430
  ?>
431
  </div>
432
  <?php
433
  }
434
+ else
435
  {
436
  ?>
437
  <div class="layout-controls layout_according_label_position">
465
  else
466
  {
467
  ?>
468
+
469
  <input type="radio" class="hovertip" id="ux_rdl_control_<?php echo $value; ?>"
470
  name="<?php echo $form_fields[$flag]->column_dynamicId; ?>_rdl"
471
  data-original-title="<?php echo $control_settings_array[$form_fields[$flag]->column_dynamicId]["cb_tooltip_txt"]; ?>"
473
  <label style="margin:0px;vertical-align: middle;" id="rdl_id_<?php echo $value; ?>">
474
  <?php echo $rdl_values[$key]; ?>
475
  </label>
476
+
477
+
478
  <?php
479
  }
480
  }
482
  </div>
483
  <?php
484
  }
485
+ else
486
  {
487
  ?>
488
  <div class="layout-controls layout_according_label_position">
490
  </div>
491
  <?php
492
  }
493
+
494
  break;
495
  }
496
  ?>
511
  </div>
512
  </form>
513
  </div>
514
+
515
  <script type="text/javascript">
516
+ if (typeof(base64_encode) != "function")
517
  {
518
+ function prevent_paste(control_id)
519
  {
520
+ jQuery("#"+control_id).live("paste",function(e)
521
+ {
522
+ e.preventDefault();
523
+ });
524
+ }
525
  }
 
526
  </script>
527
+ <?php
528
  }
529
+ ?>
views/contact_bank_layout_settings.php CHANGED
@@ -1,4 +1,4 @@
1
- <?php
2
 
3
  switch($cb_role)
4
  {
@@ -18,7 +18,7 @@ if (!current_user_can($cb_user_role_permission))
18
  }
19
  else
20
  {
21
- ?>
22
  <form id="ux_frm_form_settings" class="layout-form">
23
  <div id="poststuff" style="width: 99% !important;">
24
  <div id="post-body" class="metabox-holder">
@@ -127,7 +127,7 @@ else
127
  </div>
128
  <div class="widget-layout-body">
129
  <div class="layout-control-group" >
130
- <label class="layout-control-label"><?php _e("Font Style :", contact_bank);?>
131
  <span class="error">*</span>
132
  </label>
133
  <div class="layout-controls">
@@ -141,7 +141,7 @@ else
141
  </div>
142
  <div class="widget-layout-body">
143
  <div class="layout-control-group">
144
- <label class="layout-control-label"><?php _e("Font Size (px) :", contact_bank);?>
145
  <span class="error">*</span>
146
  </label>
147
  <div class="layout-controls">
@@ -185,7 +185,7 @@ else
185
  </div>
186
  <div class="widget-layout-body">
187
  <div class="layout-control-group" >
188
- <label class="layout-control-label"><?php _e("Label Position :", contact_bank);?>
189
  <span class="error">*</span>
190
  </label>
191
  <div class="layout-controls" >
@@ -199,7 +199,7 @@ else
199
  </div>
200
  <div class="widget-layout-body">
201
  <div class="layout-control-group" >
202
- <label class="layout-control-label"><?php _e("Field Desc Font Size :", contact_bank);?>
203
  <span class="error">*</span>
204
  </label>
205
  <div class="layout-controls">
@@ -230,7 +230,7 @@ else
230
  </div>
231
  <div class="widget-layout-body">
232
  <div class="layout-control-group" >
233
- <label class="layout-control-label"><?php _e("Field Description Align :", contact_bank);?>
234
  <span class="error">*</span>
235
  </label>
236
  <div class="layout-controls">
@@ -252,7 +252,7 @@ else
252
  </div>
253
  <div class="widget-layout-body">
254
  <div class="layout-control-group" >
255
- <label class="layout-control-label"><?php _e("Text Direction :", contact_bank);?>
256
  <span class="error">*</span>
257
  </label>
258
  <div class="layout-controls">
@@ -278,7 +278,7 @@ else
278
  <div id="input_settings" class="collapse in">
279
  <div class="widget-layout-body">
280
  <div class="layout-control-group " >
281
- <label class="layout-control-label"><?php _e("Font Family :", contact_bank);?>
282
  <span class="error">*</span>
283
  </label>
284
  <div class="layout-controls">
@@ -303,7 +303,7 @@ else
303
  </div>
304
  <div class="widget-layout-body">
305
  <div class="layout-control-group ">
306
- <label class="layout-control-label"><?php _e("Text Color :", contact_bank);?>
307
  <span class="error">*</span>
308
  </label>
309
  <div class="layout-controls">
@@ -328,7 +328,7 @@ else
328
  </div>
329
  <div class="widget-layout-body">
330
  <div class="layout-control-group">
331
- <label class="layout-control-label"><?php _e("Font Size (px) :", contact_bank);?>
332
  <span class="error">*</span>
333
  </label>
334
  <div class="layout-controls">
@@ -369,7 +369,7 @@ else
369
  </div>
370
  <div class="widget-layout-body">
371
  <div class="layout-control-group ">
372
- <label class="layout-control-label"><?php _e("Border Color :", contact_bank);?>
373
  <span class="error">*</span>
374
  </label>
375
  <div class="layout-controls">
@@ -390,7 +390,7 @@ else
390
  </div>
391
  <div class="widget-layout-body">
392
  <div class="layout-control-group">
393
- <label class="layout-control-label"><?php _e("Border Style :", contact_bank);?>
394
  <span class="error">*</span>
395
  </label>
396
  <div class="layout-controls">
@@ -402,10 +402,10 @@ else
402
  </div>
403
  </div>
404
  </div>
405
-
406
  <div class="widget-layout-body">
407
  <div class="layout-control-group" >
408
- <label class="layout-control-label"><?php _e("Background Color :", contact_bank);?>
409
  <span class="error">*</span>
410
  </label>
411
  <div class="layout-controls">
@@ -442,7 +442,7 @@ else
442
  </div>
443
  <div class="widget-layout-body">
444
  <div class="layout-control-group" >
445
- <label class="layout-control-label"><?php _e("Text Direction :", contact_bank);?>
446
  <span class="error">*</span>
447
  </label>
448
  <div class="layout-controls">
@@ -456,7 +456,7 @@ else
456
  </div>
457
  <div class="widget-layout-body">
458
  <div class="layout-control-group">
459
- <label class="layout-control-label"><?php _e("Input Size :", contact_bank);?>
460
  <span class="error">*</span>
461
  </label>
462
  <div class="layout-controls">
@@ -473,7 +473,7 @@ else
473
  </div>
474
  </div>
475
  </div>
476
-
477
  </div>
478
  <div class="layout-span6">
479
  <div class="widget-layout">
@@ -523,7 +523,7 @@ else
523
  </div>
524
  <div class="widget-layout-body">
525
  <div class="layout-control-group" >
526
- <label class="layout-control-label"><?php _e("Style :", contact_bank);?>
527
  <span class="error">*</span>
528
  </label>
529
  <div class="layout-controls">
@@ -537,7 +537,7 @@ else
537
  </div>
538
  <div class="widget-layout-body">
539
  <div class="layout-control-group">
540
- <label class="layout-control-label"><?php _e("Font Size (px) :", contact_bank);?>
541
  <span class="error">*</span>
542
  </label>
543
  <div class="layout-controls">
@@ -578,7 +578,7 @@ else
578
  </div>
579
  <div class="widget-layout-body">
580
  <div class="layout-control-group ">
581
- <label class="layout-control-label"><?php _e("Background Color :", contact_bank);?>
582
  <span class="error">*</span>
583
  </label>
584
  <div class="layout-controls">
@@ -589,7 +589,7 @@ else
589
  </div>
590
  <div class="widget-layout-body">
591
  <div class="layout-control-group ">
592
- <label class="layout-control-label"><?php _e("Hover Background Color:", contact_bank);?>
593
  <span class="error">*</span>
594
  </label>
595
  <div class="layout-controls">
@@ -600,7 +600,7 @@ else
600
  </div>
601
  <div class="widget-layout-body">
602
  <div class="layout-control-group" >
603
- <label class="layout-control-label"><?php _e("Text Color :", contact_bank);?>
604
  <span class="error">*</span>
605
  </label>
606
  <div class="layout-controls">
@@ -611,7 +611,7 @@ else
611
  </div>
612
  <div class="widget-layout-body">
613
  <div class="layout-control-group ">
614
- <label class="layout-control-label"><?php _e("Border Color :", contact_bank);?>
615
  <span class="error">*</span>
616
  </label>
617
  <div class="layout-controls">
@@ -622,7 +622,7 @@ else
622
  </div>
623
  <div class="widget-layout-body">
624
  <div class="layout-control-group " >
625
- <label class="layout-control-label"><?php _e("Border Size (px) :", contact_bank);?>
626
  <span class="error">*</span>
627
  </label>
628
  <div class="layout-controls">
@@ -632,7 +632,7 @@ else
632
  </div>
633
  <div class="widget-layout-body">
634
  <div class="layout-control-group ">
635
- <label class="layout-control-label"><?php _e("Border Radius (px) :", contact_bank);?>
636
  <span class="error">*</span>
637
  </label>
638
  <div class="layout-controls">
@@ -655,7 +655,7 @@ else
655
  </div>
656
  <div class="widget-layout-body">
657
  <div class="layout-control-group" >
658
- <label class="layout-control-label"><?php _e("Text Direction :", contact_bank);?>
659
  <span class="error">*</span>
660
  </label>
661
  <div class="layout-controls">
@@ -681,7 +681,7 @@ else
681
  <div id="success_settings" class="collapse in">
682
  <div class="widget-layout-body">
683
  <div class="layout-control-group" >
684
- <label class="layout-control-label"><?php _e("Font Family :", contact_bank);?>
685
  <span class="error">*</span>
686
  </label>
687
  <div class="layout-controls">
@@ -737,7 +737,7 @@ else
737
  </div>
738
  <div class="widget-layout-body">
739
  <div class="layout-control-group">
740
- <label class="layout-control-label"><?php _e("Background Color :", contact_bank);?>
741
  <span class="error">*</span>
742
  </label>
743
  <div class="layout-controls">
@@ -748,7 +748,7 @@ else
748
  </div>
749
  <div class="widget-layout-body">
750
  <div class="layout-control-group" >
751
- <label class="layout-control-label"><?php _e("Border Color :", contact_bank);?>
752
  <span class="error">*</span>
753
  </label>
754
  <div class="layout-controls">
@@ -759,7 +759,7 @@ else
759
  </div>
760
  <div class="widget-layout-body">
761
  <div class="layout-control-group">
762
- <label class="layout-control-label"><?php _e("Text Color :", contact_bank);?>
763
  <span class="error">*</span>
764
  </label>
765
  <div class="layout-controls">
@@ -783,7 +783,7 @@ else
783
  </div>
784
  <div class="widget-layout-body">
785
  <div class="layout-control-group" >
786
- <label class="layout-control-label"><?php _e("Text Direction :", contact_bank);?>
787
  <span class="error">*</span>
788
  </label>
789
  <div class="layout-controls">
@@ -834,7 +834,7 @@ else
834
  </div>
835
  <div class="widget-layout-body">
836
  <div class="layout-control-group " >
837
- <label class="layout-control-label"><?php _e("Font Size (px) :", contact_bank);?>
838
  <span class="error">*</span>
839
  </label>
840
  <div class="layout-controls">
@@ -865,7 +865,7 @@ else
865
  </div>
866
  <div class="widget-layout-body">
867
  <div class="layout-control-group" >
868
- <label class="layout-control-label"><?php _e("Background Color :", contact_bank);?>
869
  <span class="error">*</span>
870
  </label>
871
  <div class="layout-controls">
@@ -876,7 +876,7 @@ else
876
  </div>
877
  <div class="widget-layout-body">
878
  <div class="layout-control-group" >
879
- <label class="layout-control-label"><?php _e("Border Color :", contact_bank);?>
880
  <span class="error">*</span>
881
  </label>
882
  <div class="layout-controls">
@@ -887,7 +887,7 @@ else
887
  </div>
888
  <div class="widget-layout-body">
889
  <div class="layout-control-group ">
890
- <label class="layout-control-label"><?php _e("Text Color :", contact_bank);?>
891
  <span class="error">*</span>
892
  </label>
893
  <div class="layout-controls">
@@ -911,7 +911,7 @@ else
911
  </div>
912
  <div class="widget-layout-body">
913
  <div class="layout-control-group" >
914
- <label class="layout-control-label"><?php _e("Text Direction :", contact_bank);?>
915
  <span class="error">*</span>
916
  </label>
917
  <div class="layout-controls">
@@ -938,82 +938,126 @@ else
938
  </div>
939
  </div>
940
  </div>
941
- </form>
942
  <script type="text/javascript">
943
-
944
- function ux_button_pro_version()
945
  {
946
- alert("<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>");
 
 
 
947
  }
948
- function ux_clr_font_color_label_setting()
949
  {
950
- jQuery("#clr_font_color").farbtastic("#ux_clr_font_color").slideDown();
951
- jQuery("#ux_clr_font_color").focus();
 
 
 
952
  }
953
- function ux_clr_font_color_input_settings()
954
  {
955
- jQuery("#clr_text_color").farbtastic("#ux_clr_text_color_input_field").slideDown();
956
- jQuery("#ux_clr_text_color_input_field").focus();
 
 
 
957
  }
958
- function ux_clr_border_color_input_settings()
959
  {
960
- jQuery("#clr_border_color").farbtastic("#ux_clr_border_color_input_field").slideDown();
961
- jQuery("#ux_clr_border_color_input_field").focus();
 
 
 
962
  }
963
- function ux_clr_BG_color_input_settings()
964
  {
965
- jQuery("#clr_bg_color").farbtastic("#ux_clr_bg_color_input_field").slideDown();
966
- jQuery("#ux_clr_bg_color_input_field").focus();
 
 
 
967
  }
968
- function ux_clr_BG_color_submit_btn_settings()
969
  {
970
- jQuery("#clr_bg_color_submit_button").farbtastic("#ux_clr_bg_color_submit_button").slideDown();
971
- jQuery("#ux_clr_bg_color_submit_button").focus();
 
 
 
972
  }
973
- function ux_clr_hover_BG_color_submit_btn_settings()
974
  {
975
- jQuery("#clr_hover_bg_color_submit_button").farbtastic("#ux_clr_hover_bg_color_submit_button").slideDown();
976
- jQuery("#ux_clr_hover_bg_color_submit_button").focus();
 
 
 
977
  }
978
- function ux_clr_text_color_submit_btn_settings()
979
  {
980
- jQuery("#clr_text_color_submit_button").farbtastic("#ux_clr_text_color_submit_button").slideDown();
981
- jQuery("#ux_clr_text_color_submit_button").focus();
 
 
 
982
  }
983
- function ux_clr_hover_border_color_submit_btn_settings()
984
  {
985
- jQuery("#clr_border_color_submit_button").farbtastic("#ux_clr_border_color_submit_button").slideDown();
986
- jQuery("#ux_clr_border_color_submit_button").focus();
 
 
 
987
  }
988
- function ux_clr_bg_color_sucess_msg_settings()
989
  {
990
- jQuery("#clr_bg_color_success_msg").farbtastic("#ux_clr_bg_color_success_msg").slideDown();
991
- jQuery("#ux_clr_bg_color_success_msg").focus();
 
 
 
992
  }
993
- function ux_clr_border_color_sucess_msg_settings()
994
  {
995
- jQuery("#clr_border_color_success_msg").farbtastic("#ux_clr_border_color_success_msg").slideDown();
996
- jQuery("#ux_clr_border_color_success_msg").focus();
 
 
 
997
  }
998
- function ux_clr_text_color_sucess_msg_settings()
999
  {
1000
- jQuery("#clr_text_color_success_msg").farbtastic("#ux_clr_text_color_success_msg").slideDown();
1001
- jQuery("#ux_clr_text_color_success_msg").focus();
 
 
 
1002
  }
1003
- function ux_clr_BG_color_error_msg_settings()
1004
  {
1005
- jQuery("#clr_bg_color_error_msg").farbtastic("#ux_clr_bg_color_error_msg").slideDown();
1006
- jQuery("#ux_clr_bg_color_error_msg").focus();
 
 
 
1007
  }
1008
- function ux_clr_border_color_error_msg_settings()
1009
  {
1010
- jQuery("#clr_border_color_error_msg").farbtastic("#ux_clr_border_color_error_msg").slideDown();
1011
- jQuery("#ux_clr_border_color_error_msg").focus();
 
 
 
1012
  }
1013
- function ux_clr_text_color_error_msg_settings()
1014
  {
1015
- jQuery("#clr_text_color_error_msg").farbtastic("#ux_clr_text_color_error_msg").slideDown();
1016
- jQuery("#ux_clr_text_color_error_msg").focus();
 
 
 
1017
  }
1018
  jQuery("#ux_clr_font_color").blur(function(){jQuery("#clr_font_color").slideUp()});
1019
  jQuery("#ux_clr_text_color_input_field").blur(function(){jQuery("#clr_text_color").slideUp()});
@@ -1030,113 +1074,119 @@ jQuery("#ux_clr_bg_color_error_msg").blur(function(){jQuery("#clr_bg_color_error
1030
  jQuery("#ux_clr_border_color_error_msg").blur(function(){jQuery("#clr_border_color_error_msg").slideUp()});
1031
  jQuery("#ux_clr_text_color_error_msg").blur(function(){jQuery("#clr_text_color_error_msg").slideUp()});
1032
 
1033
- function OnlyNumbers(e) ///////////////////////////////////allow only digits
1034
  {
1035
- var regex = new RegExp("^[0-9 \b]*$");
1036
- var str = String.fromCharCode(!e.charCode ? e.which : e.charCode);
1037
- if (regex.test(str)) {
1038
- return true;
 
 
 
 
 
1039
  }
1040
- e.preventDefault();
1041
- return false;
1042
  }
1043
- function select_form_layout()
1044
  {
1045
- var form_id = jQuery("#ux_ddl_select_form").val();
1046
-
1047
- jQuery.post(ajaxurl, "form_id="+form_id+"&param=fetch_control_values&action=layout_settings_contact_library", function(data)
1048
- {
1049
-
1050
- if(data != "undefined")
1051
  {
1052
-
1053
- var dataJson = jQuery.parseJSON(data);
1054
- jQuery("#ux_ddl_font_family").val(dataJson.label_setting_font_family);
1055
- jQuery("#ux_clr_font_color").val(dataJson.label_setting_font_color);
1056
- jQuery("#ux_clr_font_color").css("background-color",dataJson.label_setting_font_color);
1057
- jQuery("#ux_clr_font_color").css("color","#ffffff");
1058
- jQuery("#ux_ddl_font_style").val(dataJson.label_setting_font_style);
1059
- jQuery("#ux_txt_font_size").val(dataJson.label_setting_font_size);
1060
- dataJson.label_setting_font_align_left == "0" ? jQuery("#ux_rdl_font_align_left").attr("checked","checked") : jQuery("#ux_rdl_font_align_right").attr("checked","checked") ;
1061
- jQuery("#ux_ddl_label_position").val(dataJson.label_setting_label_position);
1062
- jQuery("#ux_ddl_field_size").val(dataJson.label_setting_field_size);
1063
- jQuery("#ux_ddl_field_align").val(dataJson.label_setting_field_align);
1064
- dataJson.label_setting_hide_label == "1" ? jQuery("#ux_chk_hide_label").attr("checked","checked") : jQuery("#ux_chk_hide_label").removeAttr("checked");
1065
- jQuery("#ux_ddl_direction").val(dataJson.label_setting_text_direction);
1066
-
1067
- jQuery("#ux_ddl_font_family_input_field").val(dataJson.input_field_font_family);
1068
- jQuery("#ux_clr_text_color_input_field").val(dataJson.input_field_font_color);
1069
- jQuery("#ux_clr_text_color_input_field").css("background-color",dataJson.input_field_font_color);
1070
- jQuery("#ux_clr_text_color_input_field").css("color","#ffffff");
1071
- jQuery("#ux_ddl_font_style_input_field").val(dataJson.input_field_font_style);
1072
- jQuery("#ux_txt_font_size_input_field").val(dataJson.input_field_font_size);
1073
- jQuery("#ux_txt_border_radius_input_field").val(dataJson.input_field_border_radius);
1074
- jQuery("#ux_clr_border_color_input_field").val(dataJson.input_field_border_color);
1075
- jQuery("#ux_clr_border_color_input_field").css("background-color",dataJson.input_field_border_color);
1076
- jQuery("#ux_clr_border_color_input_field").css("color","#ffffff");
1077
- jQuery("#ux_txt_border_size_input_field").val(dataJson.input_field_border_size);
1078
- jQuery("#ux_ddl_border_style_input_field").val(dataJson.input_field_border_style);
1079
- jQuery("#ux_clr_bg_color_input_field").val(dataJson.input_field_clr_bg_color);
1080
- jQuery("#ux_clr_bg_color_input_field").css("background-color",dataJson.input_field_clr_bg_color);
1081
- jQuery("#ux_clr_bg_color_input_field").css("color","#000000");
1082
- dataJson.input_field_rdl_multiple_row == "0" ? jQuery("#ux_rdl_multiple_row_input_field").attr("checked","checked") : jQuery("#ux_rdl_single_row_input_field").attr("checked","checked");
1083
- dataJson.input_field_rdl_text_align == "0" ? jQuery("#ux_rdl_font_align_left_input_field").attr("checked","checked") : jQuery("#ux_rdl_font_align_right_input_field").attr("checked","checked") ;
1084
- jQuery("#ux_ddl_input_field_direction").val(dataJson.input_field_text_direction);
1085
- jQuery("#ux_input_size_input_field").val(dataJson.input_field_input_size);
1086
-
1087
-
1088
- jQuery("#ux_ddl_font_family_submit_button").val(dataJson.submit_button_font_family);
1089
- jQuery("#ux_txt_text_submit_button").val(dataJson.submit_button_text);
1090
- jQuery("#ux_ddl_font_style_submit_button").val(dataJson.submit_button_font_style);
1091
- jQuery("#ux_ddl_font_size_submit_button").val(dataJson.submit_button_font_size);
1092
- jQuery("#ux_txt_button_width_submit_button").val(dataJson.submit_button_button_width);
1093
- jQuery("#ux_clr_bg_color_submit_button").val(dataJson.submit_button_bg_color);
1094
- jQuery("#ux_clr_bg_color_submit_button").css("background-color",dataJson.submit_button_bg_color);
1095
- jQuery("#ux_clr_bg_color_submit_button").css("color","#ffffff");
1096
- jQuery("#ux_clr_hover_bg_color_submit_button").val(dataJson.submit_button_hover_bg_color);
1097
- jQuery("#ux_clr_hover_bg_color_submit_button").css("background-color",dataJson.submit_button_hover_bg_color);
1098
- jQuery("#ux_clr_hover_bg_color_submit_button").css("color","#ffffff");
1099
- jQuery("#ux_clr_text_color_submit_button").val(dataJson.submit_button_text_color);
1100
- jQuery("#ux_clr_text_color_submit_button").css("background-color",dataJson.submit_button_text_color);
1101
- jQuery("#ux_clr_text_color_submit_button").css("color","#000000");
1102
- jQuery("#ux_clr_border_color_submit_button").val(dataJson.submit_button_border_color);
1103
- jQuery("#ux_clr_border_color_submit_button").css("background-color",dataJson.submit_button_border_color);
1104
- jQuery("#ux_clr_border_color_submit_button").css("color","#ffffff");
1105
- jQuery("#ux_clr_border_size_submit_button").val(dataJson.submit_button_border_size);
1106
- jQuery("#ux_txt_border_radius_submit_button").val(dataJson.submit_button_border_radius);
1107
- dataJson.submit_button_rdl_text_align == "0" ? jQuery("#ux_rdl_font_align_left_submit_button").attr("checked","checked") : jQuery("#ux_rdl_font_align_right_submit_button").attr("checked","checked") ;
1108
- jQuery("#ux_ddl_submit_button_direction").val(dataJson.submit_button_text_direction);
1109
-
1110
- jQuery("#ux_ddl_font_family_success_msg").val(dataJson.success_msg_font_family);
1111
- jQuery("#ux_ddl_font_size_success_msg").val(dataJson.success_msg_font_size);
1112
- jQuery("#ux_clr_bg_color_success_msg").val(dataJson.success_msg_bg_color);
1113
- jQuery("#ux_clr_bg_color_success_msg").css("background-color",dataJson.success_msg_bg_color);
1114
- jQuery("#ux_clr_bg_color_success_msg").css("color","#ffffff");
1115
- jQuery("#ux_clr_border_color_success_msg").val(dataJson.success_msg_border_color);
1116
- jQuery("#ux_clr_border_color_success_msg").css("background-color",dataJson.success_msg_border_color);
1117
- jQuery("#ux_clr_border_color_success_msg").css("color","#ffffff");
1118
- jQuery("#ux_clr_text_color_success_msg").val(dataJson.success_msg_text_color);
1119
- jQuery("#ux_clr_text_color_success_msg").css("background-color",dataJson.success_msg_text_color);
1120
- jQuery("#ux_clr_text_color_success_msg").css("color","#ffffff");
1121
- dataJson.success_msg_rdl_text_align == "0" ? jQuery("#ux_rdl_font_align_left_success_msg").attr("checked","checked") : jQuery("#ux_rdl_font_align_right_success_msg").attr("checked","checked") ;
1122
- jQuery("#ux_ddl_success_msg_direction").val(dataJson.success_msg_text_direction);
1123
-
1124
- jQuery("#ux_ddl_font_family_error_msg").val(dataJson.error_msg_font_family);
1125
- jQuery("#ux_ddl_font_size_error_msg").val(dataJson.error_msg_font_size);
1126
- jQuery("#ux_clr_bg_color_error_msg").val(dataJson.error_msg_bg_color);
1127
- jQuery("#ux_clr_bg_color_error_msg").css("background-color",dataJson.error_msg_bg_color);
1128
- jQuery("#ux_clr_bg_color_error_msg").css("color","#ffffff");
1129
- jQuery("#ux_clr_border_color_error_msg").val(dataJson.error_msg_border_color);
1130
- jQuery("#ux_clr_border_color_error_msg").css("background-color",dataJson.error_msg_border_color);
1131
- jQuery("#ux_clr_border_color_error_msg").css("color","#ffffff");
1132
- jQuery("#ux_clr_text_color_error_msg").val(dataJson.error_msg_text_color);
1133
- jQuery("#ux_clr_text_color_error_msg").css("background-color",dataJson.error_msg_text_color);
1134
- jQuery("#ux_clr_text_color_error_msg").css("color","#ffffff");
1135
- dataJson.error_msg_rdl_text_align == "0" ? jQuery("#ux_rdl_font_align_left_error_msg").attr("checked","checked") : jQuery("#ux_rdl_font_align_right_error_msg").attr("checked","checked") ;
1136
- jQuery("#ux_ddl_error_msg_direction").val(dataJson.error_msg_text_direction);
 
 
 
 
 
 
 
 
 
1137
  }
1138
- });
1139
- }
1140
 
1141
  jQuery(document).ready(function()
1142
  {
@@ -1159,6 +1209,6 @@ jQuery(document).ready(function()
1159
  }
1160
  });
1161
  </script>
1162
- <?php
1163
  }
1164
- ?>
1
+ <?php
2
 
3
  switch($cb_role)
4
  {
18
  }
19
  else
20
  {
21
+ ?>
22
  <form id="ux_frm_form_settings" class="layout-form">
23
  <div id="poststuff" style="width: 99% !important;">
24
  <div id="post-body" class="metabox-holder">
127
  </div>
128
  <div class="widget-layout-body">
129
  <div class="layout-control-group" >
130
+ <label class="layout-control-label"><?php _e("Font Style :", contact_bank);?>
131
  <span class="error">*</span>
132
  </label>
133
  <div class="layout-controls">
141
  </div>
142
  <div class="widget-layout-body">
143
  <div class="layout-control-group">
144
+ <label class="layout-control-label"><?php _e("Font Size (px) :", contact_bank);?>
145
  <span class="error">*</span>
146
  </label>
147
  <div class="layout-controls">
185
  </div>
186
  <div class="widget-layout-body">
187
  <div class="layout-control-group" >
188
+ <label class="layout-control-label"><?php _e("Label Position :", contact_bank);?>
189
  <span class="error">*</span>
190
  </label>
191
  <div class="layout-controls" >
199
  </div>
200
  <div class="widget-layout-body">
201
  <div class="layout-control-group" >
202
+ <label class="layout-control-label"><?php _e("Field Desc Font Size :", contact_bank);?>
203
  <span class="error">*</span>
204
  </label>
205
  <div class="layout-controls">
230
  </div>
231
  <div class="widget-layout-body">
232
  <div class="layout-control-group" >
233
+ <label class="layout-control-label"><?php _e("Field Description Align :", contact_bank);?>
234
  <span class="error">*</span>
235
  </label>
236
  <div class="layout-controls">
252
  </div>
253
  <div class="widget-layout-body">
254
  <div class="layout-control-group" >
255
+ <label class="layout-control-label"><?php _e("Text Direction :", contact_bank);?>
256
  <span class="error">*</span>
257
  </label>
258
  <div class="layout-controls">
278
  <div id="input_settings" class="collapse in">
279
  <div class="widget-layout-body">
280
  <div class="layout-control-group " >
281
+ <label class="layout-control-label"><?php _e("Font Family :", contact_bank);?>
282
  <span class="error">*</span>
283
  </label>
284
  <div class="layout-controls">
303
  </div>
304
  <div class="widget-layout-body">
305
  <div class="layout-control-group ">
306
+ <label class="layout-control-label"><?php _e("Text Color :", contact_bank);?>
307
  <span class="error">*</span>
308
  </label>
309
  <div class="layout-controls">
328
  </div>
329
  <div class="widget-layout-body">
330
  <div class="layout-control-group">
331
+ <label class="layout-control-label"><?php _e("Font Size (px) :", contact_bank);?>
332
  <span class="error">*</span>
333
  </label>
334
  <div class="layout-controls">
369
  </div>
370
  <div class="widget-layout-body">
371
  <div class="layout-control-group ">
372
+ <label class="layout-control-label"><?php _e("Border Color :", contact_bank);?>
373
  <span class="error">*</span>
374
  </label>
375
  <div class="layout-controls">
390
  </div>
391
  <div class="widget-layout-body">
392
  <div class="layout-control-group">
393
+ <label class="layout-control-label"><?php _e("Border Style :", contact_bank);?>
394
  <span class="error">*</span>
395
  </label>
396
  <div class="layout-controls">
402
  </div>
403
  </div>
404
  </div>
405
+
406
  <div class="widget-layout-body">
407
  <div class="layout-control-group" >
408
+ <label class="layout-control-label"><?php _e("Background Color :", contact_bank);?>
409
  <span class="error">*</span>
410
  </label>
411
  <div class="layout-controls">
442
  </div>
443
  <div class="widget-layout-body">
444
  <div class="layout-control-group" >
445
+ <label class="layout-control-label"><?php _e("Text Direction :", contact_bank);?>
446
  <span class="error">*</span>
447
  </label>
448
  <div class="layout-controls">
456
  </div>
457
  <div class="widget-layout-body">
458
  <div class="layout-control-group">
459
+ <label class="layout-control-label"><?php _e("Input Size :", contact_bank);?>
460
  <span class="error">*</span>
461
  </label>
462
  <div class="layout-controls">
473
  </div>
474
  </div>
475
  </div>
476
+
477
  </div>
478
  <div class="layout-span6">
479
  <div class="widget-layout">
523
  </div>
524
  <div class="widget-layout-body">
525
  <div class="layout-control-group" >
526
+ <label class="layout-control-label"><?php _e("Style :", contact_bank);?>
527
  <span class="error">*</span>
528
  </label>
529
  <div class="layout-controls">
537
  </div>
538
  <div class="widget-layout-body">
539
  <div class="layout-control-group">
540
+ <label class="layout-control-label"><?php _e("Font Size (px) :", contact_bank);?>
541
  <span class="error">*</span>
542
  </label>
543
  <div class="layout-controls">
578
  </div>
579
  <div class="widget-layout-body">
580
  <div class="layout-control-group ">
581
+ <label class="layout-control-label"><?php _e("Background Color :", contact_bank);?>
582
  <span class="error">*</span>
583
  </label>
584
  <div class="layout-controls">
589
  </div>
590
  <div class="widget-layout-body">
591
  <div class="layout-control-group ">
592
+ <label class="layout-control-label"><?php _e("Hover Background Color:", contact_bank);?>
593
  <span class="error">*</span>
594
  </label>
595
  <div class="layout-controls">
600
  </div>
601
  <div class="widget-layout-body">
602
  <div class="layout-control-group" >
603
+ <label class="layout-control-label"><?php _e("Text Color :", contact_bank);?>
604
  <span class="error">*</span>
605
  </label>
606
  <div class="layout-controls">
611
  </div>
612
  <div class="widget-layout-body">
613
  <div class="layout-control-group ">
614
+ <label class="layout-control-label"><?php _e("Border Color :", contact_bank);?>
615
  <span class="error">*</span>
616
  </label>
617
  <div class="layout-controls">
622
  </div>
623
  <div class="widget-layout-body">
624
  <div class="layout-control-group " >
625
+ <label class="layout-control-label"><?php _e("Border Size (px) :", contact_bank);?>
626
  <span class="error">*</span>
627
  </label>
628
  <div class="layout-controls">
632
  </div>
633
  <div class="widget-layout-body">
634
  <div class="layout-control-group ">
635
+ <label class="layout-control-label"><?php _e("Border Radius (px) :", contact_bank);?>
636
  <span class="error">*</span>
637
  </label>
638
  <div class="layout-controls">
655
  </div>
656
  <div class="widget-layout-body">
657
  <div class="layout-control-group" >
658
+ <label class="layout-control-label"><?php _e("Text Direction :", contact_bank);?>
659
  <span class="error">*</span>
660
  </label>
661
  <div class="layout-controls">
681
  <div id="success_settings" class="collapse in">
682
  <div class="widget-layout-body">
683
  <div class="layout-control-group" >
684
+ <label class="layout-control-label"><?php _e("Font Family :", contact_bank);?>
685
  <span class="error">*</span>
686
  </label>
687
  <div class="layout-controls">
737
  </div>
738
  <div class="widget-layout-body">
739
  <div class="layout-control-group">
740
+ <label class="layout-control-label"><?php _e("Background Color :", contact_bank);?>
741
  <span class="error">*</span>
742
  </label>
743
  <div class="layout-controls">
748
  </div>
749
  <div class="widget-layout-body">
750
  <div class="layout-control-group" >
751
+ <label class="layout-control-label"><?php _e("Border Color :", contact_bank);?>
752
  <span class="error">*</span>
753
  </label>
754
  <div class="layout-controls">
759
  </div>
760
  <div class="widget-layout-body">
761
  <div class="layout-control-group">
762
+ <label class="layout-control-label"><?php _e("Text Color :", contact_bank);?>
763
  <span class="error">*</span>
764
  </label>
765
  <div class="layout-controls">
783
  </div>
784
  <div class="widget-layout-body">
785
  <div class="layout-control-group" >
786
+ <label class="layout-control-label"><?php _e("Text Direction :", contact_bank);?>
787
  <span class="error">*</span>
788
  </label>
789
  <div class="layout-controls">
834
  </div>
835
  <div class="widget-layout-body">
836
  <div class="layout-control-group " >
837
+ <label class="layout-control-label"><?php _e("Font Size (px) :", contact_bank);?>
838
  <span class="error">*</span>
839
  </label>
840
  <div class="layout-controls">
865
  </div>
866
  <div class="widget-layout-body">
867
  <div class="layout-control-group" >
868
+ <label class="layout-control-label"><?php _e("Background Color :", contact_bank);?>
869
  <span class="error">*</span>
870
  </label>
871
  <div class="layout-controls">
876
  </div>
877
  <div class="widget-layout-body">
878
  <div class="layout-control-group" >
879
+ <label class="layout-control-label"><?php _e("Border Color :", contact_bank);?>
880
  <span class="error">*</span>
881
  </label>
882
  <div class="layout-controls">
887
  </div>
888
  <div class="widget-layout-body">
889
  <div class="layout-control-group ">
890
+ <label class="layout-control-label"><?php _e("Text Color :", contact_bank);?>
891
  <span class="error">*</span>
892
  </label>
893
  <div class="layout-controls">
911
  </div>
912
  <div class="widget-layout-body">
913
  <div class="layout-control-group" >
914
+ <label class="layout-control-label"><?php _e("Text Direction :", contact_bank);?>
915
  <span class="error">*</span>
916
  </label>
917
  <div class="layout-controls">
938
  </div>
939
  </div>
940
  </div>
941
+ </form>
942
  <script type="text/javascript">
943
+ if (typeof(ux_button_pro_version) != "function")
 
944
  {
945
+ function ux_button_pro_version()
946
+ {
947
+ alert("<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>");
948
+ }
949
  }
950
+ if (typeof(ux_clr_font_color_label_setting) != "function")
951
  {
952
+ function ux_clr_font_color_label_setting()
953
+ {
954
+ jQuery("#clr_font_color").farbtastic("#ux_clr_font_color").slideDown();
955
+ jQuery("#ux_clr_font_color").focus();
956
+ }
957
  }
958
+ if (typeof(ux_clr_font_color_input_settings) != "function")
959
  {
960
+ function ux_clr_font_color_input_settings()
961
+ {
962
+ jQuery("#clr_text_color").farbtastic("#ux_clr_text_color_input_field").slideDown();
963
+ jQuery("#ux_clr_text_color_input_field").focus();
964
+ }
965
  }
966
+ if (typeof(ux_clr_border_color_input_settings) != "function")
967
  {
968
+ function ux_clr_border_color_input_settings()
969
+ {
970
+ jQuery("#clr_border_color").farbtastic("#ux_clr_border_color_input_field").slideDown();
971
+ jQuery("#ux_clr_border_color_input_field").focus();
972
+ }
973
  }
974
+ if (typeof(ux_clr_BG_color_input_settings) != "function")
975
  {
976
+ function ux_clr_BG_color_input_settings()
977
+ {
978
+ jQuery("#clr_bg_color").farbtastic("#ux_clr_bg_color_input_field").slideDown();
979
+ jQuery("#ux_clr_bg_color_input_field").focus();
980
+ }
981
  }
982
+ if (typeof(ux_clr_BG_color_submit_btn_settings) != "function")
983
  {
984
+ function ux_clr_BG_color_submit_btn_settings()
985
+ {
986
+ jQuery("#clr_bg_color_submit_button").farbtastic("#ux_clr_bg_color_submit_button").slideDown();
987
+ jQuery("#ux_clr_bg_color_submit_button").focus();
988
+ }
989
  }
990
+ if (typeof(ux_clr_hover_BG_color_submit_btn_settings) != "function")
991
  {
992
+ function ux_clr_hover_BG_color_submit_btn_settings()
993
+ {
994
+ jQuery("#clr_hover_bg_color_submit_button").farbtastic("#ux_clr_hover_bg_color_submit_button").slideDown();
995
+ jQuery("#ux_clr_hover_bg_color_submit_button").focus();
996
+ }
997
  }
998
+ if (typeof(ux_clr_text_color_submit_btn_settings) != "function")
999
  {
1000
+ function ux_clr_text_color_submit_btn_settings()
1001
+ {
1002
+ jQuery("#clr_text_color_submit_button").farbtastic("#ux_clr_text_color_submit_button").slideDown();
1003
+ jQuery("#ux_clr_text_color_submit_button").focus();
1004
+ }
1005
  }
1006
+ if (typeof(ux_clr_hover_border_color_submit_btn_settings) != "function")
1007
  {
1008
+ function ux_clr_hover_border_color_submit_btn_settings()
1009
+ {
1010
+ jQuery("#clr_border_color_submit_button").farbtastic("#ux_clr_border_color_submit_button").slideDown();
1011
+ jQuery("#ux_clr_border_color_submit_button").focus();
1012
+ }
1013
  }
1014
+ if (typeof(ux_clr_bg_color_sucess_msg_settings) != "function")
1015
  {
1016
+ function ux_clr_bg_color_sucess_msg_settings()
1017
+ {
1018
+ jQuery("#clr_bg_color_success_msg").farbtastic("#ux_clr_bg_color_success_msg").slideDown();
1019
+ jQuery("#ux_clr_bg_color_success_msg").focus();
1020
+ }
1021
  }
1022
+ if (typeof(ux_clr_border_color_sucess_msg_settings) != "function")
1023
  {
1024
+ function ux_clr_border_color_sucess_msg_settings()
1025
+ {
1026
+ jQuery("#clr_border_color_success_msg").farbtastic("#ux_clr_border_color_success_msg").slideDown();
1027
+ jQuery("#ux_clr_border_color_success_msg").focus();
1028
+ }
1029
  }
1030
+ if (typeof(ux_clr_text_color_sucess_msg_settings) != "function")
1031
  {
1032
+ function ux_clr_text_color_sucess_msg_settings()
1033
+ {
1034
+ jQuery("#clr_text_color_success_msg").farbtastic("#ux_clr_text_color_success_msg").slideDown();
1035
+ jQuery("#ux_clr_text_color_success_msg").focus();
1036
+ }
1037
  }
1038
+ if (typeof(ux_clr_BG_color_error_msg_settings) != "function")
1039
  {
1040
+ function ux_clr_BG_color_error_msg_settings()
1041
+ {
1042
+ jQuery("#clr_bg_color_error_msg").farbtastic("#ux_clr_bg_color_error_msg").slideDown();
1043
+ jQuery("#ux_clr_bg_color_error_msg").focus();
1044
+ }
1045
  }
1046
+ if (typeof(ux_clr_border_color_error_msg_settings) != "function")
1047
  {
1048
+ function ux_clr_border_color_error_msg_settings()
1049
+ {
1050
+ jQuery("#clr_border_color_error_msg").farbtastic("#ux_clr_border_color_error_msg").slideDown();
1051
+ jQuery("#ux_clr_border_color_error_msg").focus();
1052
+ }
1053
  }
1054
+ if (typeof(ux_clr_text_color_error_msg_settings) != "function")
1055
  {
1056
+ function ux_clr_text_color_error_msg_settings()
1057
+ {
1058
+ jQuery("#clr_text_color_error_msg").farbtastic("#ux_clr_text_color_error_msg").slideDown();
1059
+ jQuery("#ux_clr_text_color_error_msg").focus();
1060
+ }
1061
  }
1062
  jQuery("#ux_clr_font_color").blur(function(){jQuery("#clr_font_color").slideUp()});
1063
  jQuery("#ux_clr_text_color_input_field").blur(function(){jQuery("#clr_text_color").slideUp()});
1074
  jQuery("#ux_clr_border_color_error_msg").blur(function(){jQuery("#clr_border_color_error_msg").slideUp()});
1075
  jQuery("#ux_clr_text_color_error_msg").blur(function(){jQuery("#clr_text_color_error_msg").slideUp()});
1076
 
1077
+ if (typeof(OnlyNumbers) != "function")
1078
  {
1079
+ function OnlyNumbers(e) ///////////////////////////////////allow only digits
1080
+ {
1081
+ var regex = new RegExp("^[0-9 \b]*$");
1082
+ var str = String.fromCharCode(!e.charCode ? e.which : e.charCode);
1083
+ if (regex.test(str)) {
1084
+ return true;
1085
+ }
1086
+ e.preventDefault();
1087
+ return false;
1088
  }
 
 
1089
  }
1090
+ if (typeof(select_form_layout) != "function")
1091
  {
1092
+ function select_form_layout()
 
 
 
 
 
1093
  {
1094
+ var form_id = jQuery("#ux_ddl_select_form").val();
1095
+
1096
+ jQuery.post(ajaxurl, "form_id="+form_id+"&param=fetch_control_values&action=layout_settings_contact_library", function(data)
1097
+ {
1098
+
1099
+ if(data != "undefined")
1100
+ {
1101
+
1102
+ var dataJson = jQuery.parseJSON(data);
1103
+ jQuery("#ux_ddl_font_family").val(dataJson.label_setting_font_family);
1104
+ jQuery("#ux_clr_font_color").val(dataJson.label_setting_font_color);
1105
+ jQuery("#ux_clr_font_color").css("background-color",dataJson.label_setting_font_color);
1106
+ jQuery("#ux_clr_font_color").css("color","#ffffff");
1107
+ jQuery("#ux_ddl_font_style").val(dataJson.label_setting_font_style);
1108
+ jQuery("#ux_txt_font_size").val(dataJson.label_setting_font_size);
1109
+ dataJson.label_setting_font_align_left == "0" ? jQuery("#ux_rdl_font_align_left").attr("checked","checked") : jQuery("#ux_rdl_font_align_right").attr("checked","checked") ;
1110
+ jQuery("#ux_ddl_label_position").val(dataJson.label_setting_label_position);
1111
+ jQuery("#ux_ddl_field_size").val(dataJson.label_setting_field_size);
1112
+ jQuery("#ux_ddl_field_align").val(dataJson.label_setting_field_align);
1113
+ dataJson.label_setting_hide_label == "1" ? jQuery("#ux_chk_hide_label").attr("checked","checked") : jQuery("#ux_chk_hide_label").removeAttr("checked");
1114
+ jQuery("#ux_ddl_direction").val(dataJson.label_setting_text_direction);
1115
+
1116
+ jQuery("#ux_ddl_font_family_input_field").val(dataJson.input_field_font_family);
1117
+ jQuery("#ux_clr_text_color_input_field").val(dataJson.input_field_font_color);
1118
+ jQuery("#ux_clr_text_color_input_field").css("background-color",dataJson.input_field_font_color);
1119
+ jQuery("#ux_clr_text_color_input_field").css("color","#ffffff");
1120
+ jQuery("#ux_ddl_font_style_input_field").val(dataJson.input_field_font_style);
1121
+ jQuery("#ux_txt_font_size_input_field").val(dataJson.input_field_font_size);
1122
+ jQuery("#ux_txt_border_radius_input_field").val(dataJson.input_field_border_radius);
1123
+ jQuery("#ux_clr_border_color_input_field").val(dataJson.input_field_border_color);
1124
+ jQuery("#ux_clr_border_color_input_field").css("background-color",dataJson.input_field_border_color);
1125
+ jQuery("#ux_clr_border_color_input_field").css("color","#ffffff");
1126
+ jQuery("#ux_txt_border_size_input_field").val(dataJson.input_field_border_size);
1127
+ jQuery("#ux_ddl_border_style_input_field").val(dataJson.input_field_border_style);
1128
+ jQuery("#ux_clr_bg_color_input_field").val(dataJson.input_field_clr_bg_color);
1129
+ jQuery("#ux_clr_bg_color_input_field").css("background-color",dataJson.input_field_clr_bg_color);
1130
+ jQuery("#ux_clr_bg_color_input_field").css("color","#000000");
1131
+ dataJson.input_field_rdl_multiple_row == "0" ? jQuery("#ux_rdl_multiple_row_input_field").attr("checked","checked") : jQuery("#ux_rdl_single_row_input_field").attr("checked","checked");
1132
+ dataJson.input_field_rdl_text_align == "0" ? jQuery("#ux_rdl_font_align_left_input_field").attr("checked","checked") : jQuery("#ux_rdl_font_align_right_input_field").attr("checked","checked") ;
1133
+ jQuery("#ux_ddl_input_field_direction").val(dataJson.input_field_text_direction);
1134
+ jQuery("#ux_input_size_input_field").val(dataJson.input_field_input_size);
1135
+
1136
+
1137
+ jQuery("#ux_ddl_font_family_submit_button").val(dataJson.submit_button_font_family);
1138
+ jQuery("#ux_txt_text_submit_button").val(dataJson.submit_button_text);
1139
+ jQuery("#ux_ddl_font_style_submit_button").val(dataJson.submit_button_font_style);
1140
+ jQuery("#ux_ddl_font_size_submit_button").val(dataJson.submit_button_font_size);
1141
+ jQuery("#ux_txt_button_width_submit_button").val(dataJson.submit_button_button_width);
1142
+ jQuery("#ux_clr_bg_color_submit_button").val(dataJson.submit_button_bg_color);
1143
+ jQuery("#ux_clr_bg_color_submit_button").css("background-color",dataJson.submit_button_bg_color);
1144
+ jQuery("#ux_clr_bg_color_submit_button").css("color","#ffffff");
1145
+ jQuery("#ux_clr_hover_bg_color_submit_button").val(dataJson.submit_button_hover_bg_color);
1146
+ jQuery("#ux_clr_hover_bg_color_submit_button").css("background-color",dataJson.submit_button_hover_bg_color);
1147
+ jQuery("#ux_clr_hover_bg_color_submit_button").css("color","#ffffff");
1148
+ jQuery("#ux_clr_text_color_submit_button").val(dataJson.submit_button_text_color);
1149
+ jQuery("#ux_clr_text_color_submit_button").css("background-color",dataJson.submit_button_text_color);
1150
+ jQuery("#ux_clr_text_color_submit_button").css("color","#000000");
1151
+ jQuery("#ux_clr_border_color_submit_button").val(dataJson.submit_button_border_color);
1152
+ jQuery("#ux_clr_border_color_submit_button").css("background-color",dataJson.submit_button_border_color);
1153
+ jQuery("#ux_clr_border_color_submit_button").css("color","#ffffff");
1154
+ jQuery("#ux_clr_border_size_submit_button").val(dataJson.submit_button_border_size);
1155
+ jQuery("#ux_txt_border_radius_submit_button").val(dataJson.submit_button_border_radius);
1156
+ dataJson.submit_button_rdl_text_align == "0" ? jQuery("#ux_rdl_font_align_left_submit_button").attr("checked","checked") : jQuery("#ux_rdl_font_align_right_submit_button").attr("checked","checked") ;
1157
+ jQuery("#ux_ddl_submit_button_direction").val(dataJson.submit_button_text_direction);
1158
+
1159
+ jQuery("#ux_ddl_font_family_success_msg").val(dataJson.success_msg_font_family);
1160
+ jQuery("#ux_ddl_font_size_success_msg").val(dataJson.success_msg_font_size);
1161
+ jQuery("#ux_clr_bg_color_success_msg").val(dataJson.success_msg_bg_color);
1162
+ jQuery("#ux_clr_bg_color_success_msg").css("background-color",dataJson.success_msg_bg_color);
1163
+ jQuery("#ux_clr_bg_color_success_msg").css("color","#ffffff");
1164
+ jQuery("#ux_clr_border_color_success_msg").val(dataJson.success_msg_border_color);
1165
+ jQuery("#ux_clr_border_color_success_msg").css("background-color",dataJson.success_msg_border_color);
1166
+ jQuery("#ux_clr_border_color_success_msg").css("color","#ffffff");
1167
+ jQuery("#ux_clr_text_color_success_msg").val(dataJson.success_msg_text_color);
1168
+ jQuery("#ux_clr_text_color_success_msg").css("background-color",dataJson.success_msg_text_color);
1169
+ jQuery("#ux_clr_text_color_success_msg").css("color","#ffffff");
1170
+ dataJson.success_msg_rdl_text_align == "0" ? jQuery("#ux_rdl_font_align_left_success_msg").attr("checked","checked") : jQuery("#ux_rdl_font_align_right_success_msg").attr("checked","checked") ;
1171
+ jQuery("#ux_ddl_success_msg_direction").val(dataJson.success_msg_text_direction);
1172
+
1173
+ jQuery("#ux_ddl_font_family_error_msg").val(dataJson.error_msg_font_family);
1174
+ jQuery("#ux_ddl_font_size_error_msg").val(dataJson.error_msg_font_size);
1175
+ jQuery("#ux_clr_bg_color_error_msg").val(dataJson.error_msg_bg_color);
1176
+ jQuery("#ux_clr_bg_color_error_msg").css("background-color",dataJson.error_msg_bg_color);
1177
+ jQuery("#ux_clr_bg_color_error_msg").css("color","#ffffff");
1178
+ jQuery("#ux_clr_border_color_error_msg").val(dataJson.error_msg_border_color);
1179
+ jQuery("#ux_clr_border_color_error_msg").css("background-color",dataJson.error_msg_border_color);
1180
+ jQuery("#ux_clr_border_color_error_msg").css("color","#ffffff");
1181
+ jQuery("#ux_clr_text_color_error_msg").val(dataJson.error_msg_text_color);
1182
+ jQuery("#ux_clr_text_color_error_msg").css("background-color",dataJson.error_msg_text_color);
1183
+ jQuery("#ux_clr_text_color_error_msg").css("color","#ffffff");
1184
+ dataJson.error_msg_rdl_text_align == "0" ? jQuery("#ux_rdl_font_align_left_error_msg").attr("checked","checked") : jQuery("#ux_rdl_font_align_right_error_msg").attr("checked","checked") ;
1185
+ jQuery("#ux_ddl_error_msg_direction").val(dataJson.error_msg_text_direction);
1186
+ }
1187
+ });
1188
  }
1189
+ }
 
1190
 
1191
  jQuery(document).ready(function()
1192
  {
1209
  }
1210
  });
1211
  </script>
1212
+ <?php
1213
  }
1214
+ ?>
views/contact_controls_files.php CHANGED
@@ -41,10 +41,12 @@ else
41
  <?php _e("Settings", contact_bank); ?>
42
  </a>
43
  <a style="cursor:pointer;" id="anchor_del_">
44
- <img class="delete_control" src="<?php echo plugins_url("/assets/images/delete-bg.png" , dirname(__FILE__));?>"/>
45
  </a>
46
  <br/>
47
  <span class="span-description" id="txt_description_"></span>
 
 
48
  </div>
49
  </div>
50
  <div class="layout-control-group div_border" id="div_2_2" style="display: none;">
@@ -57,16 +59,18 @@ else
57
  <?php _e("Settings", contact_bank); ?>
58
  </a>
59
  <a style="cursor:pointer;" id="anchor_del_">
60
- <img class="delete_control" src="<?php echo plugins_url("/assets/images/delete-bg.png" , dirname(__FILE__));?>"/>
61
  </a>
62
  <br/>
63
  <span class="span-description" id="txt_description_"></span>
 
 
64
  </div>
65
  </div>
66
  <div class="layout-control-group div_border" id="div_3_3" style="display: none;">
67
  <label class="layout-control-label" id="control_label_">
68
  <?php _e("Email", contact_bank); ?> :
69
- <span id="txt_required_" class="error">*</span>
70
  </label>
71
  <div class="layout-controls hovertip" id="show_tooltip">
72
  <input type="text" class="layout-span7" id="ux_txt_email_" name="ux_txt_email_"/>
@@ -74,10 +78,12 @@ else
74
  <?php _e("Settings", contact_bank); ?>
75
  </a>
76
  <a style="cursor:pointer;" id="anchor_del_">
77
- <img class="delete_control" src="<?php echo plugins_url("/assets/images/delete-bg.png" , dirname(__FILE__));?>"/>
78
  </a>
79
  <br/>
80
  <span class="span-description" id="txt_description_"></span>
 
 
81
  </div>
82
  </div>
83
  <div class="layout-control-group div_border" id="div_4_4" style="display: none;">
@@ -92,8 +98,9 @@ else
92
  <?php _e("Settings", contact_bank); ?>
93
  </a>
94
  <a style="cursor:pointer;" id="anchor_del_">
95
- <img class="delete_control" src="<?php echo plugins_url("/assets/images/delete-bg.png" , dirname(__FILE__));?>"/>
96
  </a>
 
97
  </div>
98
  </div>
99
  <div class="layout-control-group div_border" id="div_5_5" style="display: none;">
@@ -108,8 +115,9 @@ else
108
  <?php _e("Settings", contact_bank); ?>
109
  </a>
110
  <a style="cursor:pointer;" id="anchor_del_">
111
- <img class="delete_control" src="<?php echo plugins_url("/assets/images/delete-bg.png" , dirname(__FILE__));?>"/>
112
  </a>
 
113
  </div>
114
  </div>
115
  </div>
@@ -125,11 +133,12 @@ else
125
  <?php _e("Settings", contact_bank); ?>
126
  </a>
127
  <a style="cursor:pointer;" id="anchor_del_">
128
- <img class="delete_control" src="<?php echo plugins_url("/assets/images/delete-bg.png" , dirname(__FILE__));?>"/>
129
  </a>
 
130
  </div>
131
  </div>
132
  </div>
133
- <?php
134
  }
135
  ?>
41
  <?php _e("Settings", contact_bank); ?>
42
  </a>
43
  <a style="cursor:pointer;" id="anchor_del_">
44
+ <img class="delete_control" src="<?php echo plugins_url("/assets/images/delete-bg.png",dirname(__FILE__)); ?>" />
45
  </a>
46
  <br/>
47
  <span class="span-description" id="txt_description_"></span>
48
+ <div id="ux_text_control_tooltip_"></div>
49
+ <div id="ux_text_control_placeholder_"></div>
50
  </div>
51
  </div>
52
  <div class="layout-control-group div_border" id="div_2_2" style="display: none;">
59
  <?php _e("Settings", contact_bank); ?>
60
  </a>
61
  <a style="cursor:pointer;" id="anchor_del_">
62
+ <img class="delete_control" src="<?php echo plugins_url("/assets/images/delete-bg.png",dirname(__FILE__)); ?>"/>
63
  </a>
64
  <br/>
65
  <span class="span-description" id="txt_description_"></span>
66
+ <div id="ux_txtarea_control_tooltip"></div>
67
+ <div id="ux_txtarea_control_placeholder"></div>
68
  </div>
69
  </div>
70
  <div class="layout-control-group div_border" id="div_3_3" style="display: none;">
71
  <label class="layout-control-label" id="control_label_">
72
  <?php _e("Email", contact_bank); ?> :
73
+ <span id="txt_required_" class="error_field">*</span>
74
  </label>
75
  <div class="layout-controls hovertip" id="show_tooltip">
76
  <input type="text" class="layout-span7" id="ux_txt_email_" name="ux_txt_email_"/>
78
  <?php _e("Settings", contact_bank); ?>
79
  </a>
80
  <a style="cursor:pointer;" id="anchor_del_">
81
+ <img class="delete_control" src="<?php echo plugins_url("/assets/images/delete-bg.png",dirname(__FILE__)); ?>" />
82
  </a>
83
  <br/>
84
  <span class="span-description" id="txt_description_"></span>
85
+ <div id="ux_email_control_tooltip_"></div>
86
+ <div id="ux_email_control_placeholder_"></div>
87
  </div>
88
  </div>
89
  <div class="layout-control-group div_border" id="div_4_4" style="display: none;">
98
  <?php _e("Settings", contact_bank); ?>
99
  </a>
100
  <a style="cursor:pointer;" id="anchor_del_">
101
+ <img class="delete_control" src="<?php echo plugins_url("/assets/images/delete-bg.png",dirname(__FILE__)); ?> "/>
102
  </a>
103
+ <div id="ux_ddl_control_tooltip_"></div>
104
  </div>
105
  </div>
106
  <div class="layout-control-group div_border" id="div_5_5" style="display: none;">
115
  <?php _e("Settings", contact_bank); ?>
116
  </a>
117
  <a style="cursor:pointer;" id="anchor_del_">
118
+ <img class="delete_control" src="<?php echo plugins_url("/assets/images/delete-bg.png",dirname(__FILE__)); ?>"/>
119
  </a>
120
+ <div id="ux_chk_control_tooltip_"></div>
121
  </div>
122
  </div>
123
  </div>
133
  <?php _e("Settings", contact_bank); ?>
134
  </a>
135
  <a style="cursor:pointer;" id="anchor_del_">
136
+ <img class="delete_control" src="<?php echo plugins_url("/assets/images/delete-bg.png",dirname(__FILE__)); ?>"/>
137
  </a>
138
+ <div id="ux_rdl_control_tooltip_"></div>
139
  </div>
140
  </div>
141
  </div>
142
+ <?php
143
  }
144
  ?>
views/contact_email_settings.php CHANGED
@@ -40,13 +40,13 @@ else
40
  $forms = $wpdb->get_results
41
  (
42
  "SELECT form_id,form_name FROM " .contact_bank_contact_form()
43
-
44
  );
45
  $email_count = $wpdb->get_var
46
  (
47
  "SELECT count(email_id) FROM ".contact_bank_email_template_admin()
48
  );
49
-
50
  ?>
51
  <select class=" layout-span10" id="ux_ddl_select_form" name="ux_ddl_select_form" onchange="select_form();">
52
  <option value="0"><?php _e("Select Form",contact_bank); ?></option>
@@ -65,10 +65,10 @@ else
65
  <option value="<?php echo $forms[$flag]->form_id ;?>"><?php echo $forms[$flag]->form_name ;?></option>
66
  <?php
67
  }
68
-
69
  }
70
  ?>
71
-
72
  </select>
73
  <?php
74
  if($email_count < 1)
@@ -94,7 +94,7 @@ else
94
  <th style="width:20%;"></th>
95
  </thead>
96
  <tbody id="ux_email_settings_postback">
97
-
98
  </tbody>
99
  </table>
100
  </div>
@@ -110,73 +110,80 @@ else
110
  </div>
111
  </div>
112
  </form>
113
-
114
  <script type="text/javascript">
115
-
116
  jQuery(document).ready(function()
117
  {
118
  select_form();
119
  });
120
 
121
  jQuery(".fluid-layout .table thead th").css("vertical-align","top");
122
- function select_form()
123
  {
124
- var form_id = jQuery("#ux_ddl_select_form").val();
125
- if(form_id != 0)
126
  {
127
- jQuery.post(ajaxurl, "form_id="+form_id+"&param=email_settings&action=email_contact_form_library", function(data)
 
128
  {
129
- var oTable = jQuery("#data-table-email-settings").dataTable();
130
- oTable.fnDestroy();
131
- jQuery("#ux_email_settings_postback").empty();
132
- jQuery("#ux_email_settings_postback").append(data);
133
-
134
- oTable.fnDraw();
135
- });
136
- }
137
- else
138
- {
139
- jQuery("#ux_email_settings_postback").empty();
140
- oTable = jQuery("#data-table-email-settings").dataTable
141
- ({
142
- "bJQueryUI": false,
143
- "bAutoWidth": true,
144
- "bPaginate": false,
145
- "bDestroy": true,
146
- "sDom": "<\"datatable-header\"fl>t<\"datatable-footer\"ip>",
147
- "oLanguage":
148
  {
149
- "sLengthMenu": "<span>Show entries:</span> _MENU_"
150
- },
151
- "aaSorting": [[ 0, "asc" ]]
152
- });
153
- oTable.fnClearTable();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  }
155
  }
156
- function delete_email_settings(email_id)
157
  {
158
- var checkstr = confirm("<?php _e( "Are you sure, you want to delete this Email Setting?", contact_bank ); ?>");
159
- if(checkstr == true)
160
  {
161
- jQuery.post(ajaxurl, "email_id="+email_id+"&param=delete_email_settings&action=email_contact_form_library", function(data)
 
162
  {
163
- location.reload();
164
- });
 
 
 
165
  }
166
  }
167
- function add_new_settings()
168
  {
169
- var form_id = jQuery("#ux_ddl_select_form").val();
170
- if(form_id != 0)
171
- {
172
- window.location.href = "admin.php?page=add_contact_email_settings&form_id="+form_id;
173
- }
174
- else
175
  {
176
- alert("<?php _e( "Please select the Form first.", contact_bank ); ?>");
 
 
 
 
 
 
 
 
177
  }
178
  }
179
  </script>
180
- <?php
181
  }
182
- ?>
40
  $forms = $wpdb->get_results
41
  (
42
  "SELECT form_id,form_name FROM " .contact_bank_contact_form()
43
+
44
  );
45
  $email_count = $wpdb->get_var
46
  (
47
  "SELECT count(email_id) FROM ".contact_bank_email_template_admin()
48
  );
49
+
50
  ?>
51
  <select class=" layout-span10" id="ux_ddl_select_form" name="ux_ddl_select_form" onchange="select_form();">
52
  <option value="0"><?php _e("Select Form",contact_bank); ?></option>
65
  <option value="<?php echo $forms[$flag]->form_id ;?>"><?php echo $forms[$flag]->form_name ;?></option>
66
  <?php
67
  }
68
+
69
  }
70
  ?>
71
+
72
  </select>
73
  <?php
74
  if($email_count < 1)
94
  <th style="width:20%;"></th>
95
  </thead>
96
  <tbody id="ux_email_settings_postback">
97
+
98
  </tbody>
99
  </table>
100
  </div>
110
  </div>
111
  </div>
112
  </form>
 
113
  <script type="text/javascript">
 
114
  jQuery(document).ready(function()
115
  {
116
  select_form();
117
  });
118
 
119
  jQuery(".fluid-layout .table thead th").css("vertical-align","top");
120
+ if (typeof(select_form) != "function")
121
  {
122
+ function select_form()
 
123
  {
124
+ var form_id = jQuery("#ux_ddl_select_form").val();
125
+ if(form_id != 0)
126
  {
127
+ jQuery.post(ajaxurl, "form_id="+form_id+"&param=email_settings&action=email_contact_form_library", function(data)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
  {
129
+ var oTable = jQuery("#data-table-email-settings").dataTable();
130
+ oTable.fnDestroy();
131
+ jQuery("#ux_email_settings_postback").empty();
132
+ jQuery("#ux_email_settings_postback").append(data);
133
+
134
+ oTable.fnDraw();
135
+ });
136
+ }
137
+ else
138
+ {
139
+ jQuery("#ux_email_settings_postback").empty();
140
+ oTable = jQuery("#data-table-email-settings").dataTable
141
+ ({
142
+ "bJQueryUI": false,
143
+ "bAutoWidth": true,
144
+ "bPaginate": false,
145
+ "bDestroy": true,
146
+ "sDom": "<\"datatable-header\"fl>t<\"datatable-footer\"ip>",
147
+ "oLanguage":
148
+ {
149
+ "sLengthMenu": "<span>Show entries:</span> _MENU_"
150
+ },
151
+ "aaSorting": [[ 0, "asc" ]]
152
+ });
153
+ oTable.fnClearTable();
154
+ }
155
  }
156
  }
157
+ if (typeof(delete_email_settings) != "function")
158
  {
159
+ function delete_email_settings(email_id)
 
160
  {
161
+ var checkstr = confirm("<?php _e( "Are you sure, you want to delete this Email Setting?", contact_bank ); ?>");
162
+ if(checkstr == true)
163
  {
164
+ jQuery.post(ajaxurl, "email_id="+email_id+"&param=delete_email_settings&action=email_contact_form_library", function(data)
165
+ {
166
+ location.reload();
167
+ });
168
+ }
169
  }
170
  }
171
+ if (typeof(add_new_settings) != "function")
172
  {
173
+ function add_new_settings()
 
 
 
 
 
174
  {
175
+ var form_id = jQuery("#ux_ddl_select_form").val();
176
+ if(form_id != 0)
177
+ {
178
+ window.location.href = "admin.php?page=add_contact_email_settings&form_id="+form_id;
179
+ }
180
+ else
181
+ {
182
+ alert("<?php _e( "Please select the Form first.", contact_bank ); ?>");
183
+ }
184
  }
185
  }
186
  </script>
187
+ <?php
188
  }
189
+ ?>
views/contact_frontend_data.php CHANGED
@@ -11,7 +11,7 @@ switch($cb_role)
11
  case "author":
12
  $cb_user_role_permission = "publish_posts";
13
  break;
14
-
15
  }
16
  if (!current_user_can($cb_user_role_permission))
17
  {
@@ -43,7 +43,7 @@ else
43
  <div class="fluid-layout">
44
  <div class="layout-control-group">
45
  <label class="layout-control-label"><?php _e( "Select Form", contact_bank ); ?> :</label>
46
- <div class="layout-controls">
47
  <?php
48
  global $wpdb;
49
  $form_data = $wpdb->get_results
@@ -91,33 +91,33 @@ else
91
  jQuery(document).ready(function()
92
  {
93
  select_form_id();
94
-
95
- function exportTableToCSV(table, filename)
 
96
  {
97
-
98
  var rows = table.find('tr:has(td)'),
99
  csv = "";
100
  tmpColDelim = String.fromCharCode(11),
101
- tmpRowDelim = String.fromCharCode(0),
102
  colDelim = '","',
103
  rowDelim = '"\r\n"',
104
  csv = '"' + rows.map(function (i, row) {
105
  var row = jQuery(row),
106
- cols = row.find('td');
107
  return cols.map(function (j, col) {
108
  var col = jQuery(col),
109
  text = col.text();
110
-
111
  return text.replace('"', '""');
112
-
113
  }).get().join(tmpColDelim);
114
-
115
  }).get().join(tmpRowDelim)
116
-
117
  .split(tmpRowDelim).join(rowDelim)
118
  .split(tmpColDelim).join(colDelim) + '"',
119
  csvData = 'data:application/csv;charset=utf-8,' + encodeURIComponent(csv);
120
-
121
  jQuery(this)
122
  .attr({
123
  'download': filename,
@@ -125,7 +125,8 @@ jQuery(document).ready(function()
125
  'target': '_blank'
126
  });
127
  }
128
- jQuery("#export").on('click', function (event)
 
129
  {
130
  var form_id = jQuery("#select_form").val();
131
  if(form_id != 0)
@@ -137,37 +138,43 @@ jQuery(document).ready(function()
137
  alert("<?php _e( "Please select the Form first.", contact_bank ); ?>");
138
  }
139
  });
140
-
141
-
142
  });
143
- function select_form_id()
144
  {
145
- var form_id = jQuery("#select_form").val();
146
- if(form_id != 0)
147
  {
148
- jQuery.post(ajaxurl, "form_id="+form_id+"&param=frontend_form_data&action=frontend_data_contact_library", function(data)
 
149
  {
150
- if(jQuery('#data-table-frontend').length > 0)
151
  {
152
- oTable = jQuery('#data-table-frontend').dataTable();
153
- oTable.fnDestroy();
154
- jQuery("#ux_frontend_data_postback").empty();
155
-
156
- jQuery("#ux_frontend_data_postback").append(data);
157
- jQuery(".fluid-layout .table thead th").css('vertical-align','top');
158
- oTable.fnDraw();
159
- }
160
- else
161
- {
162
- jQuery("#ux_frontend_data_postback").append(data);
163
- jQuery(".fluid-layout .table thead th").css('vertical-align','top');
164
- }
165
- });
 
 
 
166
  }
167
  }
168
- function delete_form_entry()
169
  {
170
- alert("<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>");
 
 
 
171
  }
172
 
173
 
@@ -176,6 +183,6 @@ function delete_form_entry()
176
 
177
 
178
  </script>
179
- <?php
180
  }
181
- ?>
11
  case "author":
12
  $cb_user_role_permission = "publish_posts";
13
  break;
14
+
15
  }
16
  if (!current_user_can($cb_user_role_permission))
17
  {
43
  <div class="fluid-layout">
44
  <div class="layout-control-group">
45
  <label class="layout-control-label"><?php _e( "Select Form", contact_bank ); ?> :</label>
46
+ <div class="layout-controls">
47
  <?php
48
  global $wpdb;
49
  $form_data = $wpdb->get_results
91
  jQuery(document).ready(function()
92
  {
93
  select_form_id();
94
+ if (typeof(exportTableToCSV) != "function")
95
+ {
96
+ function exportTableToCSV(table, filename)
97
  {
 
98
  var rows = table.find('tr:has(td)'),
99
  csv = "";
100
  tmpColDelim = String.fromCharCode(11),
101
+ tmpRowDelim = String.fromCharCode(0),
102
  colDelim = '","',
103
  rowDelim = '"\r\n"',
104
  csv = '"' + rows.map(function (i, row) {
105
  var row = jQuery(row),
106
+ cols = row.find('td');
107
  return cols.map(function (j, col) {
108
  var col = jQuery(col),
109
  text = col.text();
110
+
111
  return text.replace('"', '""');
112
+
113
  }).get().join(tmpColDelim);
114
+
115
  }).get().join(tmpRowDelim)
116
+
117
  .split(tmpRowDelim).join(rowDelim)
118
  .split(tmpColDelim).join(colDelim) + '"',
119
  csvData = 'data:application/csv;charset=utf-8,' + encodeURIComponent(csv);
120
+
121
  jQuery(this)
122
  .attr({
123
  'download': filename,
125
  'target': '_blank'
126
  });
127
  }
128
+ }
129
+ jQuery("#export").on('click', function (event)
130
  {
131
  var form_id = jQuery("#select_form").val();
132
  if(form_id != 0)
138
  alert("<?php _e( "Please select the Form first.", contact_bank ); ?>");
139
  }
140
  });
141
+
142
+
143
  });
144
+ if (typeof(select_form_id) != "function")
145
  {
146
+ function select_form_id()
 
147
  {
148
+ var form_id = jQuery("#select_form").val();
149
+ if(form_id != 0)
150
  {
151
+ jQuery.post(ajaxurl, "form_id="+form_id+"&param=frontend_form_data&action=frontend_data_contact_library", function(data)
152
  {
153
+ if(jQuery('#data-table-frontend').length > 0)
154
+ {
155
+ oTable = jQuery('#data-table-frontend').dataTable();
156
+ oTable.fnDestroy();
157
+ jQuery("#ux_frontend_data_postback").empty();
158
+
159
+ jQuery("#ux_frontend_data_postback").append(data);
160
+ jQuery(".fluid-layout .table thead th").css('vertical-align','top');
161
+ oTable.fnDraw();
162
+ }
163
+ else
164
+ {
165
+ jQuery("#ux_frontend_data_postback").append(data);
166
+ jQuery(".fluid-layout .table thead th").css('vertical-align','top');
167
+ }
168
+ });
169
+ }
170
  }
171
  }
172
+ if (typeof(delete_form_entry) != "function")
173
  {
174
+ function delete_form_entry()
175
+ {
176
+ alert("<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>");
177
+ }
178
  }
179
 
180
 
183
 
184
 
185
  </script>
186
+ <?php
187
  }
188
+ ?>
views/contact_view.php CHANGED
@@ -11,7 +11,6 @@ switch($cb_role)
11
  case "author":
12
  $cb_user_role_permission = "publish_posts";
13
  break;
14
-
15
  }
16
  if (!current_user_can($cb_user_role_permission))
17
  {
@@ -25,10 +24,9 @@ else
25
  (
26
  "SELECT count(form_id) FROM ". contact_bank_contact_form()
27
  );
28
-
29
  if($count_forms < 2)
30
  {
31
-
32
  $last_form_id = $wpdb->get_var
33
  (
34
  $wpdb->prepare
@@ -39,13 +37,12 @@ else
39
  );
40
  if(count($last_form_id) == 0)
41
  {
42
-
43
  $wpdb->query
44
  (
45
  $wpdb->prepare
46
  (
47
  "INSERT INTO ".contact_bank_contact_form()."(form_id,form_name) VALUES(%d,%s)",
48
- $form_id,
49
  "Untitled Form (Draft)"
50
  )
51
  );
@@ -109,59 +106,59 @@ else
109
  ""
110
  )
111
  );
112
- $settings = array();
113
- $settings["label_setting_font_family"] = "inherit";
114
- $settings["label_setting_font_color"] = "#000000";
115
- $settings["label_setting_font_style"] = "normal";
116
- $settings["label_setting_font_size"] = "16";
117
- $settings["label_setting_font_align_left"] = "0";
118
- $settings["label_setting_label_position"] = "top";
119
- $settings["label_setting_field_size"] = "11";
120
- $settings["label_setting_field_align"] = "left";
121
- $settings["label_setting_hide_label"] = "0";
122
  $settings["label_setting_text_direction"] = "inherit";
123
-
124
- $settings["input_field_font_family"] = "inherit";
125
- $settings["input_field_font_color"] = "#000000";
126
- $settings["input_field_font_style"] = "normal";
127
- $settings["input_field_font_size"] = "14";
128
- $settings["input_field_border_radius"] = "0";
129
- $settings["input_field_border_color"] = "#e5e5e5";
130
- $settings["input_field_border_size"] = "1";
131
- $settings["input_field_border_style"] = "solid";
132
- $settings["input_field_clr_bg_color"] = "#ffffff";
133
- $settings["input_field_rdl_multiple_row"] = "1";
134
  $settings["input_field_rdl_text_align"] = "0";
135
  $settings["input_field_text_direction"] = "inherit";
136
  $settings["input_field_input_size"] = "layout-span10";
137
-
138
  $settings["submit_button_font_family"] = "inherit";
139
- $settings["submit_button_text"] = "Submit ";
140
- $settings["submit_button_font_style"] = "normal";
141
- $settings["submit_button_font_size"] = "12";
142
- $settings["submit_button_button_width"] = "110";
143
- $settings["submit_button_bg_color"] = "#B8B8B8";
144
- $settings["submit_button_hover_bg_color"] = "#e5e5e5";
145
- $settings["submit_button_text_color"] = "#000000";
146
- $settings["submit_button_border_color"] = "#B8B8B8";
147
- $settings["submit_button_border_size"] = "1";
148
- $settings["submit_button_border_radius"] = "2";
149
  $settings["submit_button_rdl_text_align"] = "0";
150
  $settings["submit_button_text_direction"] = "inherit";
151
-
152
- $settings["success_msg_font_family"] = "inherit";
153
- $settings["success_msg_font_size"] = "12";
154
- $settings["success_msg_bg_color"] = "#e5ffd5";
155
- $settings["success_msg_border_color"] = "#e5ffd5";
156
- $settings["success_msg_text_color"] = "#6aa500";
157
  $settings["success_msg_rdl_text_align"] = "0";
158
  $settings["success_msg_text_direction"] = "inherit";
159
-
160
- $settings["error_msg_font_family"] = "inherit";
161
- $settings["error_msg_font_size"] = "12";
162
- $settings["error_msg_bg_color"] = "#ffcaca";
163
- $settings["error_msg_border_color"] = "#ffcaca";
164
- $settings["error_msg_text_color"] = "#ff2c38";
165
  $settings["error_msg_rdl_text_align"] = "0";
166
  $settings["error_msg_text_direction"] = "inherit";
167
  foreach($settings as $key => $value)
@@ -223,9 +220,9 @@ else
223
  )
224
  );
225
  }
226
-
227
  }
228
-
229
  $form_data = $wpdb->get_results
230
  (
231
  $wpdb->prepare
@@ -246,7 +243,7 @@ else
246
  $form_id
247
  )
248
  );
249
-
250
  //}
251
  ?>
252
  <form id="ux_dynamic_form_submit" class="layout-form">
@@ -272,172 +269,172 @@ else
272
  </div>
273
  <div class="fluid-layout">
274
  <div class="layout-span12">
275
- <div class="fluid-layout">
276
- <div class="layout-span8">
277
- <div class="widget-layout">
278
- <div class="widget-layout-title">
279
- <h4><?php _e("Form Settings", contact_bank); ?></h4>
280
- </div>
281
- <div class="widget-layout-body">
282
- <div class="layout-control-group div_border" id="div_100">
283
- <label class="layout-control-label"><?php _e("Form Name :", contact_bank); ?>
284
- <span class="error">*</span>
285
- </label>
286
- <div class="layout-controls">
287
- <input type="text" name="ux_txt_form_name" class="layout-span7" id="ux_txt_form_name"
288
- value="<?php echo isset($form_name) ? $form_name : ""; ?>"
289
- placeholder="<?php _e("Enter Form Name", contact_bank); ?>"/>
290
  </div>
291
- </div>
292
- <div class="layout-control-group div_border">
293
- <label class="layout-control-label"><?php _e("Form Description :", contact_bank); ?></label>
294
- <div class="layout-controls">
295
- <textarea type="textarea" rows="5" name="ux_txt_form_description" class="layout-span7" id="ux_txt_form_description" placeholder="<?php _e("Enter Form Description", contact_bank); ?>"><?php echo isset($form_settings[$form_id]["form_description"]) ? $form_settings[$form_id]["form_description"] : "" ;?></textarea>
296
- </div>
297
- </div>
298
- <div class="layout-control-group div_border">
299
- <label class="layout-control-label"><?php _e("Blank Field Message:", contact_bank); ?>
300
- <span class="error">*</span>
301
- </label>
302
- <div class="layout-controls">
303
- <input type="text" name="ux_txt_blank_message" class="layout-span7"
304
- value="<?php echo isset($form_settings[$form_id]["blank_field_message"]) ? $form_settings[$form_id]["blank_field_message"]
305
- : _e("Required field must not be blank", contact_bank); ?>"
306
- id="ux_txt_blank_message"
307
- placeholder="<?php _e("Enter Blank Field Message", contact_bank); ?>"/>
308
- </div>
309
- </div>
310
- <div class="layout-control-group div_border">
311
- <label class="layout-control-label"><?php _e("Incorrect Email Message:", contact_bank); ?>
312
- <span class="error">*</span>
313
- </label>
314
- <div class="layout-controls ">
315
- <input type="text" name="ux_txt_incorrect_email_message" class="layout-span7"
316
- value="<?php echo isset($form_settings[$form_id]["incorrect_email_message"]) ? $form_settings[$form_id]["incorrect_email_message"]
317
- : _e("Please enter a valid email address", contact_bank); ?>"
318
- id="ux_txt_incorrect_email_message"
319
- placeholder="<?php _e("Enter Incorrect Email Message", contact_bank); ?>"/>
320
- </div>
321
- </div>
322
- <div class="layout-control-group div_border">
323
- <label class="layout-control-label"><?php _e("Success Message :", contact_bank); ?>
324
- <span class="error">*</span>
325
- </label>
326
- <div class="layout-controls">
327
- <textarea type="textarea" name="ux_txt_success_message" class="layout-span7" id="ux_txt_success_message" placeholder="<?php _e("Enter Success Message", contact_bank); ?>"><?php echo isset($form_settings[$form_id]["success_message"]) ? $form_settings[$form_id]["success_message"] : "" ;?></textarea>
328
- </div>
329
- </div>
330
- <div class="layout-control-group div_border">
331
- <label class="layout-control-label"><?php _e("Redirect :", contact_bank); ?>
332
- <span class="error">*</span>
333
- </label>
334
- <div class="layout-controls" style=" padding-top: 7px; ">
335
- <?php
336
- if(isset($form_settings[$form_id]["redirect"]))
337
- {
338
- if($form_settings[$form_id]["redirect"] == "0")
339
- {
340
- ?>
341
- <input type="radio" id="ux_rdl_page" checked="checked" name="ux_rdl_redirect"
342
- onclick="show_url_control();"
343
- value="0"/><label style="vertical-align: text-bottom;"><?php _e("Page", contact_bank); ?></label>
344
- <input type="radio" id="ux_rdl_redirect_url" name="ux_rdl_redirect"
345
- onclick="show_url_control();"
346
- value="1"/><label style="vertical-align: text-bottom;"><?php _e("URL", contact_bank); ?></label>
347
  <?php
348
- }
349
- else
350
- {
351
- ?>
352
- <input type="radio" id="ux_rdl_page" name="ux_rdl_redirect"
353
- onclick="show_url_control();"
354
- value="0"/><label style="vertical-align: text-bottom;"><?php _e("Page", contact_bank); ?></label>
355
- <input type="radio" id="ux_rdl_redirect_url" checked="checked" name="ux_rdl_redirect"
356
- onclick="show_url_control();"
357
- value="1"/><label style="vertical-align: text-bottom;"><?php _e("URL", contact_bank); ?></label>
358
- <?php
359
- }
360
- }
361
- else
362
- {
363
- ?>
364
- <input type="radio" id="ux_rdl_page" name="ux_rdl_redirect" checked="checked"
365
- onclick="show_url_control();"
366
- value="0"/><label style="vertical-align: text-bottom;"><?php _e("Page", contact_bank); ?></label>
367
- <input type="radio" id="ux_rdl_redirect_url" name="ux_rdl_redirect"
368
- onclick="show_url_control();"
369
- value="1"/><label style="vertical-align: text-bottom;"><?php _e("URL", contact_bank); ?></label>
370
- <?php
371
- }
372
- ?>
373
- </div>
374
- </div>
375
- <div class="layout-control-group div_border" id="div_page">
376
- <label class="layout-control-label"><?php _e("Page :", contact_bank); ?>
377
- <span class="error">*</span>
378
- </label>
379
- <div class="layout-controls">
380
- <?php
381
- $publish_pages = $wpdb->get_results
382
- (
383
- "SELECT ID,post_name FROM " . $wpdb->posts . " WHERE (post_type = \"page\" OR post_type=\"post\") AND post_status = \"publish\""
384
- );
385
- ?>
386
- <select class="layout-span7" id="ux_ddl_page_url" name="ux_ddl_page_url">
387
- <?php
388
- for($flag=0;$flag<count($publish_pages);$flag++)
389
- {
390
- if(isset($form_settings[$form_id]["redirect_url"]))
391
- {
392
- $permalink = get_permalink( $publish_pages[$flag]->ID);
393
- if($permalink == $form_settings[$form_id]["redirect_url"])
394
  {
 
 
395
  ?>
396
- <option selected="selected" value="<?php echo $permalink ; ?>"><?php echo $publish_pages[$flag]->post_name; ?></option>
 
 
 
 
 
397
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
398
  }
399
  else
400
  {
401
  ?>
402
- <option value="<?php echo $permalink ; ?>"><?php echo $publish_pages[$flag]->post_name; ?></option>
 
 
 
 
 
403
  <?php
404
  }
405
- }
406
- else
407
- {
408
- $permalink = get_permalink( $publish_pages[$flag]->ID);
409
  ?>
410
- <option value="<?php echo $permalink ; ?>"><?php echo $publish_pages[$flag]->post_name; ?></option>
 
 
 
 
 
 
 
 
 
 
 
 
 
411
  <?php
412
- }
413
- }
414
- ?>
415
- </select>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
416
  </div>
417
  </div>
418
- <div class="layout-control-group div_border" id="div_url">
419
- <label class="layout-control-label"><?php _e("URL :", contact_bank); ?>
420
- <span class="error">*</span>
421
- </label>
422
- <div class="layout-controls">
423
- <input type="text" name="ux_txt_redirect_url" class="layout-span7" id="ux_txt_redirect_url"
424
- value="<?php echo isset($form_settings[$form_id]["redirect_url"]) ? $form_settings[$form_id]["redirect_url"]
425
- : ""; ?>"
426
- placeholder="<?php _e("Enter Redirect URL", contact_bank); ?>"/>
427
  </div>
428
  </div>
429
  </div>
430
- </div>
431
- <div class="widget-layout">
432
- <div class="widget-layout-title">
433
- <h4><?php _e("Form Layout Preview", contact_bank); ?></h4>
434
- </div>
435
- <div class="widget-layout-body">
436
- <?php include_once CONTACT_BK_PLUGIN_DIR . "/views/contact_controls_files.php"; ?>
437
- <div id="left_block"></div>
438
- </div>
439
- </div>
440
- </div>
441
  <div class="layout-span4">
442
  <div class="widget-layout" style="margin-top: 4px;">
443
  <div class="widget-layout-title">
@@ -522,7 +519,6 @@ else
522
  </div>
523
  </div>
524
  </div>
525
-
526
  <input type="hidden" id="hidden_file_upload_count" name="hidden_file_upload_count" value="0" />
527
  <div class="separator-doubled"></div>
528
  <input class="btn btn-info layout-span2" type="submit" id="submit_button" name="submit_button"
@@ -536,20 +532,51 @@ else
536
  </div>
537
  </div>
538
  </div>
539
- </form>
540
  <script type="text/javascript">
541
  jQuery(document).ready(function()
542
  {
543
  jQuery("a[rel^=\"prettyPhoto\"]").prettyPhoto
544
  ({
545
- animation_speed: 1000,
546
- slideshow: 4000,
547
  autoplay_slideshow: false,
548
- opacity: 0.80,
549
  show_title: false,
550
  allow_resize: true
551
  });
552
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
553
  jQuery("#ux_dynamic_form_submit").validate
554
  ({
555
  rules:
@@ -572,40 +599,26 @@ jQuery("#ux_dynamic_form_submit").validate
572
  jQuery("#form_success_message").css("display","block");
573
  jQuery("body,html").animate({
574
  scrollTop: jQuery("body,html").position().top}, "slow");
575
- var form_name = jQuery("#ux_txt_form_name").val();
576
  var form_id = "<?php echo $form_id; ?>";
577
- var array_new_form_settings = [];
578
- array_new_form_settings.push({"blank_field_message" : jQuery("#ux_txt_blank_message").val()});
579
- array_new_form_settings.push({"incorrect_email_message" : jQuery("#ux_txt_incorrect_email_message").val()});
580
- array_new_form_settings.push({"success_message" : jQuery("#ux_txt_success_message").val()});
581
- array_new_form_settings.push({"form_description" : jQuery("#ux_txt_form_description").val()});
582
- jQuery("#ux_rdl_page").prop("checked")== true ? array_new_form_settings.push({"redirect" : "0"}) :array_new_form_settings.push({"redirect" : "1"});
583
-
584
- if(jQuery("#ux_rdl_page").prop("checked")== true)
585
  {
586
- array_new_form_settings.push({"redirect_url" : encodeURIComponent(jQuery("#ux_ddl_page_url").val())});
587
- }
588
- else
 
 
 
 
589
  {
590
- array_new_form_settings.push({"redirect_url" : encodeURIComponent(jQuery("#ux_txt_redirect_url").val())});
591
- }
592
- array_new_form_settings.push({"form_name" : form_name});
593
- jQuery.ajax
594
- ({
595
- type: "POST",
596
- url: ajaxurl + "?form_settings="+encodeURIComponent(JSON.stringify(array_new_form_settings))+"&form_id="+form_id+"&array_delete_form_controls="+JSON.stringify(array_delete_form_controls)+"&param=submit_form_messages_settings&action=add_contact_form_library",
597
- success : function(data)
598
  {
599
- setTimeout(function()
600
- {
601
- jQuery("#form_success_message").css("display","none");
602
- window.location.href = "admin.php?page=contact_dashboard";
603
- }, 2000);
604
- }
605
  });
606
  }
607
  });
608
  </script>
609
- <?php
610
  }
611
- ?>
11
  case "author":
12
  $cb_user_role_permission = "publish_posts";
13
  break;
 
14
  }
15
  if (!current_user_can($cb_user_role_permission))
16
  {
24
  (
25
  "SELECT count(form_id) FROM ". contact_bank_contact_form()
26
  );
27
+
28
  if($count_forms < 2)
29
  {
 
30
  $last_form_id = $wpdb->get_var
31
  (
32
  $wpdb->prepare
37
  );
38
  if(count($last_form_id) == 0)
39
  {
 
40
  $wpdb->query
41
  (
42
  $wpdb->prepare
43
  (
44
  "INSERT INTO ".contact_bank_contact_form()."(form_id,form_name) VALUES(%d,%s)",
45
+ $form_id,
46
  "Untitled Form (Draft)"
47
  )
48
  );
106
  ""
107
  )
108
  );
109
+ $settings = array();
110
+ $settings["label_setting_font_family"] = "inherit";
111
+ $settings["label_setting_font_color"] = "#000000";
112
+ $settings["label_setting_font_style"] = "normal";
113
+ $settings["label_setting_font_size"] = "16";
114
+ $settings["label_setting_font_align_left"] = "0";
115
+ $settings["label_setting_label_position"] = "top";
116
+ $settings["label_setting_field_size"] = "11";
117
+ $settings["label_setting_field_align"] = "left";
118
+ $settings["label_setting_hide_label"] = "0";
119
  $settings["label_setting_text_direction"] = "inherit";
120
+
121
+ $settings["input_field_font_family"] = "inherit";
122
+ $settings["input_field_font_color"] = "#000000";
123
+ $settings["input_field_font_style"] = "normal";
124
+ $settings["input_field_font_size"] = "14";
125
+ $settings["input_field_border_radius"] = "0";
126
+ $settings["input_field_border_color"] = "#e5e5e5";
127
+ $settings["input_field_border_size"] = "1";
128
+ $settings["input_field_border_style"] = "solid";
129
+ $settings["input_field_clr_bg_color"] = "#ffffff";
130
+ $settings["input_field_rdl_multiple_row"] = "1";
131
  $settings["input_field_rdl_text_align"] = "0";
132
  $settings["input_field_text_direction"] = "inherit";
133
  $settings["input_field_input_size"] = "layout-span10";
134
+
135
  $settings["submit_button_font_family"] = "inherit";
136
+ $settings["submit_button_text"] = "Submit ";
137
+ $settings["submit_button_font_style"] = "normal";
138
+ $settings["submit_button_font_size"] = "12";
139
+ $settings["submit_button_button_width"] = "110";
140
+ $settings["submit_button_bg_color"] = "#B8B8B8";
141
+ $settings["submit_button_hover_bg_color"] = "#e5e5e5";
142
+ $settings["submit_button_text_color"] = "#000000";
143
+ $settings["submit_button_border_color"] = "#B8B8B8";
144
+ $settings["submit_button_border_size"] = "1";
145
+ $settings["submit_button_border_radius"] = "2";
146
  $settings["submit_button_rdl_text_align"] = "0";
147
  $settings["submit_button_text_direction"] = "inherit";
148
+
149
+ $settings["success_msg_font_family"] = "inherit";
150
+ $settings["success_msg_font_size"] = "12";
151
+ $settings["success_msg_bg_color"] = "#e5ffd5";
152
+ $settings["success_msg_border_color"] = "#e5ffd5";
153
+ $settings["success_msg_text_color"] = "#6aa500";
154
  $settings["success_msg_rdl_text_align"] = "0";
155
  $settings["success_msg_text_direction"] = "inherit";
156
+
157
+ $settings["error_msg_font_family"] = "inherit";
158
+ $settings["error_msg_font_size"] = "12";
159
+ $settings["error_msg_bg_color"] = "#ffcaca";
160
+ $settings["error_msg_border_color"] = "#ffcaca";
161
+ $settings["error_msg_text_color"] = "#ff2c38";
162
  $settings["error_msg_rdl_text_align"] = "0";
163
  $settings["error_msg_text_direction"] = "inherit";
164
  foreach($settings as $key => $value)
220
  )
221
  );
222
  }
223
+
224
  }
225
+
226
  $form_data = $wpdb->get_results
227
  (
228
  $wpdb->prepare
243
  $form_id
244
  )
245
  );
246
+
247
  //}
248
  ?>
249
  <form id="ux_dynamic_form_submit" class="layout-form">
269
  </div>
270
  <div class="fluid-layout">
271
  <div class="layout-span12">
272
+ <div class="fluid-layout">
273
+ <div class="layout-span8">
274
+ <div class="widget-layout">
275
+ <div class="widget-layout-title">
276
+ <h4><?php _e("Form Settings", contact_bank); ?></h4>
 
 
 
 
 
 
 
 
 
 
277
  </div>
278
+ <div class="widget-layout-body">
279
+ <div class="layout-control-group div_border" id="div_100">
280
+ <label class="layout-control-label"><?php _e("Form Name :", contact_bank); ?>
281
+ <span class="error_field">*</span>
282
+ </label>
283
+ <div class="layout-controls">
284
+ <input type="text" name="ux_txt_form_name" class="layout-span7" id="ux_txt_form_name"
285
+ value="<?php echo isset($form_name) ? esc_attr($form_name) : ""; ?>"
286
+ placeholder="<?php _e("Enter Form Name", contact_bank); ?>"/>
287
+ </div>
288
+ </div>
289
+ <div class="layout-control-group div_border">
290
+ <label class="layout-control-label"><?php _e("Form Description :", contact_bank); ?></label>
291
+ <div class="layout-controls">
292
+ <textarea type="textarea" rows="5" name="ux_txt_form_description" class="layout-span7" id="ux_txt_form_description" placeholder="<?php _e("Enter Form Description", contact_bank); ?>"><?php echo isset($form_settings[$form_id]["form_description"])? $form_settings[$form_id]["form_description"] : "" ;?></textarea>
293
+ </div>
294
+ </div>
295
+ <div class="layout-control-group div_border">
296
+ <label class="layout-control-label"><?php _e("Blank Field Message:", contact_bank); ?>
297
+ <span class="error_field">*</span>
298
+ </label>
299
+ <div class="layout-controls">
300
+ <input type="text" name="ux_txt_blank_message" class="layout-span7"
301
+ value="<?php echo isset($form_settings[$form_id]["blank_field_message"])? esc_attr($form_settings[$form_id]["blank_field_message"])
302
+ : _e("Required field must not be blank", contact_bank); ?>"
303
+ id="ux_txt_blank_message"
304
+ placeholder="<?php _e("Enter Blank Field Message", contact_bank); ?>"/>
305
+ </div>
306
+ </div>
307
+ <div class="layout-control-group div_border">
308
+ <label class="layout-control-label"><?php _e("Incorrect Email Message:", contact_bank); ?>
309
+ <span class="error_field">*</span>
310
+ </label>
311
+ <div class="layout-controls ">
312
+ <input type="text" name="ux_txt_incorrect_email_message" class="layout-span7"
313
+ value="<?php echo isset($form_settings[$form_id]["incorrect_email_message"])? esc_attr($form_settings[$form_id]["incorrect_email_message"])
314
+ : _e("Please enter a valid email address", contact_bank); ?>"
315
+ id="ux_txt_incorrect_email_message"
316
+ placeholder="<?php _e("Enter Incorrect Email Message", contact_bank); ?>"/>
317
+ </div>
318
+ </div>
319
+ <div class="layout-control-group div_border">
320
+ <label class="layout-control-label"><?php _e("Success Message :", contact_bank); ?>
321
+ <span class="error_field">*</span>
322
+ </label>
323
+ <div class="layout-controls">
324
+ <textarea type="textarea" name="ux_txt_success_message" class="layout-span7" id="ux_txt_success_message" placeholder="<?php _e("Enter Success Message", contact_bank); ?>"><?php echo isset($form_settings[$form_id]["success_message"])? $form_settings[$form_id]["success_message"] : "" ;?></textarea>
325
+ </div>
326
+ </div>
327
+ <div class="layout-control-group div_border">
328
+ <label class="layout-control-label"><?php _e("Redirect :", contact_bank); ?>
329
+ <span class="error_field">*</span>
330
+ </label>
331
+ <div class="layout-controls" style=" padding-top: 7px; ">
 
 
332
  <?php
333
+ if(isset($form_settings[$form_id]["redirect"]))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
334
  {
335
+ if($form_settings[$form_id]["redirect"] == "0")
336
+ {
337
  ?>
338
+ <input type="radio" id="ux_rdl_page" checked="checked" name="ux_rdl_redirect"
339
+ onclick="show_url_control();"
340
+ value="0"/><label style="vertical-align: text-bottom;"><?php _e("Page", contact_bank); ?></label>
341
+ <input type="radio" id="ux_rdl_redirect_url" name="ux_rdl_redirect"
342
+ onclick="show_url_control();"
343
+ value="1"/><label style="vertical-align: text-bottom;"><?php _e("URL", contact_bank); ?></label>
344
  <?php
345
+ }
346
+ else
347
+ {
348
+ ?>
349
+ <input type="radio" id="ux_rdl_page" name="ux_rdl_redirect"
350
+ onclick="show_url_control();"
351
+ value="0"/><label style="vertical-align: text-bottom;"><?php _e("Page", contact_bank); ?></label>
352
+ <input type="radio" id="ux_rdl_redirect_url" checked="checked"name="ux_rdl_redirect"
353
+ onclick="show_url_control();"
354
+ value="1"/><label style="vertical-align: text-bottom;"><?php _e("URL", contact_bank); ?></label>
355
+ <?php
356
+ }
357
  }
358
  else
359
  {
360
  ?>
361
+ <input type="radio" id="ux_rdl_page" name="ux_rdl_redirect" checked="checked"
362
+ onclick="show_url_control();"
363
+ value="0"/><label style="vertical-align: text-bottom;"><?php _e("Page", contact_bank); ?></label>
364
+ <input type="radio" id="ux_rdl_redirect_url" name="ux_rdl_redirect"
365
+ onclick="show_url_control();"
366
+ value="1"/><label style="vertical-align: text-bottom;"><?php _e("URL", contact_bank); ?></label>
367
  <?php
368
  }
 
 
 
 
369
  ?>
370
+ </div>
371
+ </div>
372
+ <div class="layout-control-group div_border" id="div_page">
373
+ <label class="layout-control-label"><?php _e("Page :", contact_bank); ?>
374
+ <span class="error_field">*</span>
375
+ </label>
376
+ <div class="layout-controls">
377
+ <?php
378
+ $publish_pages = $wpdb->get_results
379
+ (
380
+ "SELECT ID,post_name FROM " . $wpdb->posts . " WHERE (post_type = \"page\" OR post_type=\"post\") AND post_status = \"publish\""
381
+ );
382
+ ?>
383
+ <select class="layout-span7" id="ux_ddl_page_url" name="ux_ddl_page_url">
384
  <?php
385
+ for($flag=0;$flag<count($publish_pages);$flag++)
386
+ {
387
+ if(isset($form_settings[$form_id]["redirect_url"]))
388
+ {
389
+ $permalink = get_permalink( $publish_pages[$flag]->ID);
390
+ if($permalink == $form_settings[$form_id]["redirect_url"])
391
+ {
392
+ ?>
393
+ <option selected="selected" value="<?php echo $permalink ; ?>"><?php echo $publish_pages[$flag]->post_name; ?></option>
394
+ <?php
395
+ }
396
+ else
397
+ {
398
+ ?>
399
+ <option value="<?php echo $permalink ; ?>"><?php echo $publish_pages[$flag]->post_name; ?></option>
400
+ <?php
401
+ }
402
+ }
403
+ else
404
+ {
405
+ $permalink = get_permalink( $publish_pages[$flag]->ID);
406
+ ?>
407
+ <option value="<?php echo $permalink ; ?>"><?php echo $publish_pages[$flag]->post_name; ?></option>
408
+ <?php
409
+ }
410
+ }
411
+ ?>
412
+ </select>
413
+ </div>
414
+ </div>
415
+ <div class="layout-control-group div_border" id="div_url">
416
+ <label class="layout-control-label"><?php _e("URL :", contact_bank); ?>
417
+ <span class="error_field">*</span>
418
+ </label>
419
+ <div class="layout-controls">
420
+ <input type="text" name="ux_txt_redirect_url" class="layout-span7" id="ux_txt_redirect_url"
421
+ value="<?php echo isset($form_settings[$form_id]["redirect_url"])? $form_settings[$form_id]["redirect_url"]
422
+ : ""; ?>"
423
+ placeholder="<?php _e("Enter Redirect URL", contact_bank); ?>"/>
424
+ </div>
425
+ </div>
426
  </div>
427
  </div>
428
+ <div class="widget-layout">
429
+ <div class="widget-layout-title">
430
+ <h4><?php _e("Form Layout Preview", contact_bank); ?></h4>
431
+ </div>
432
+ <div class="widget-layout-body">
433
+ <?php include_once CONTACT_BK_PLUGIN_DIR . "/views/contact_controls_files.php"; ?>
434
+ <div id="left_block"></div>
 
 
435
  </div>
436
  </div>
437
  </div>
 
 
 
 
 
 
 
 
 
 
 
438
  <div class="layout-span4">
439
  <div class="widget-layout" style="margin-top: 4px;">
440
  <div class="widget-layout-title">
519
  </div>
520
  </div>
521
  </div>
 
522
  <input type="hidden" id="hidden_file_upload_count" name="hidden_file_upload_count" value="0" />
523
  <div class="separator-doubled"></div>
524
  <input class="btn btn-info layout-span2" type="submit" id="submit_button" name="submit_button"
532
  </div>
533
  </div>
534
  </div>
535
+ </form>
536
  <script type="text/javascript">
537
  jQuery(document).ready(function()
538
  {
539
  jQuery("a[rel^=\"prettyPhoto\"]").prettyPhoto
540
  ({
541
+ animation_speed: 1000,
542
+ slideshow: 4000,
543
  autoplay_slideshow: false,
544
+ opacity: 0.80,
545
  show_title: false,
546
  allow_resize: true
547
  });
548
  });
549
+ if (typeof(base64_encode) != "function")
550
+ {
551
+ function base64_encode(data)
552
+ {
553
+ var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
554
+ var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
555
+ ac = 0,
556
+ enc = '',
557
+ tmp_arr = [];
558
+ if (!data)
559
+ {
560
+ return data;
561
+ }
562
+ do
563
+ {
564
+ o1 = data.charCodeAt(i++);
565
+ o2 = data.charCodeAt(i++);
566
+ o3 = data.charCodeAt(i++);
567
+ bits = o1 << 16 | o2 << 8 | o3;
568
+ h1 = bits >> 18 & 0x3f;
569
+ h2 = bits >> 12 & 0x3f;
570
+ h3 = bits >> 6 & 0x3f;
571
+ h4 = bits & 0x3f;
572
+ tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
573
+ }
574
+ while (i < data.length);
575
+ enc = tmp_arr.join('');
576
+ var r = data.length % 3;
577
+ return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
578
+ }
579
+ }
580
  jQuery("#ux_dynamic_form_submit").validate
581
  ({
582
  rules:
599
  jQuery("#form_success_message").css("display","block");
600
  jQuery("body,html").animate({
601
  scrollTop: jQuery("body,html").position().top}, "slow");
 
602
  var form_id = "<?php echo $form_id; ?>";
603
+ jQuery.post(ajaxurl,
 
 
 
 
 
 
 
604
  {
605
+ form_settings: base64_encode(jQuery("#ux_dynamic_form_submit").serialize()),
606
+ form_id: form_id,
607
+ array_delete_form_controls: JSON.stringify(array_delete_form_controls),
608
+ param: "submit_form_messages_settings",
609
+ action: "add_contact_form_library",
610
+ },
611
+ function(data)
612
  {
613
+ setTimeout(function()
 
 
 
 
 
 
 
614
  {
615
+ jQuery("#form_success_message").css("display","none");
616
+ window.location.href = "admin.php?page=contact_dashboard";
617
+ }, 3000);
 
 
 
618
  });
619
  }
620
  });
621
  </script>
622
+ <?php
623
  }
624
+ ?>
views/dashboard.php CHANGED
@@ -10,7 +10,7 @@ switch($cb_role)
10
  case "author":
11
  $cb_user_role_permission = "publish_posts";
12
  break;
13
-
14
  }
15
  if (!current_user_can($cb_user_role_permission))
16
  {
@@ -81,13 +81,13 @@ else
81
  (
82
  "SELECT * FROM " . contact_bank_contact_form()
83
  );
84
- for ($flag = 0; $flag < count($form_data); $flag++)
85
  {
86
  $total_control = $wpdb->get_var
87
  (
88
  $wpdb->prepare
89
  (
90
- " SELECT count(" . contact_bank_contact_form() . ".form_id) FROM " . contact_bank_contact_form() . " JOIN ". create_control_Table() . " ON " . create_control_Table() .".form_id = ".contact_bank_contact_form().
91
  ".form_id WHERE " . contact_bank_contact_form() . ".form_id = %d",
92
  $form_data[$flag]->form_id
93
  )
@@ -134,7 +134,7 @@ else
134
  data-original-title="<?php _e("Delete Form", contact_bank) ?>">
135
  <i class="icon-trash"></i>
136
  </a>
137
-
138
  </td>
139
  </tr>
140
  <?php
@@ -155,19 +155,19 @@ else
155
  </div>
156
  </form>
157
  <script type="text/javascript">
158
-
159
  jQuery(document).ready(function()
160
  {
161
 
162
  jQuery("a[rel^=\"prettyPhoto\"]").prettyPhoto
163
  ({
164
- animation_speed: 1000,
165
- slideshow: 4000,
166
  autoplay_slideshow: false,
167
- opacity: 0.80,
168
  show_title: false,
169
  allow_resize: true
170
- });
171
  });
172
  oTable = jQuery("#data-table-form").dataTable
173
  ({
@@ -185,36 +185,49 @@ else
185
  { "bSortable": false, "aTargets": [2] }
186
  ]
187
  });
188
- function delete_form(form_Id) {
189
- var check_str = confirm("<?php _e( "Are you sure, you want to delete this Form?", contact_bank ); ?>");
190
- if (check_str == true)
191
  {
192
- jQuery.post(ajaxurl, "id=" + form_Id + "&param=delete_form&action=add_contact_form_library", function (data)
 
193
  {
194
- location.reload();
195
- });
 
 
 
196
  }
197
  }
198
- function delete_forms() {
199
- var checkstr = confirm("<?php _e( "Are you sure, you want to delete all Forms?", contact_bank ); ?>");
200
- if (checkstr == true)
201
- {
202
- jQuery.post(ajaxurl, "param=delete_forms&action=add_contact_form_library", function (data) {
203
- location.reload();
204
- });
 
 
 
205
  }
206
  }
207
- function restore_factory_settings() {
208
- alert("<?php _e("This Feature is only available in Paid Premium Edition!", contact_bank ); ?>");
 
 
 
209
  }
210
- function close_popup()
211
  {
212
- jQuery( "#contact_bank_popup" ).dialog( "close" );
213
- jQuery.post(ajaxurl, "param=update_option&action=add_new_album_library", function()
214
  {
215
- });
 
 
 
 
216
  }
217
  </script>
218
- <?php
219
  }
220
- ?>
10
  case "author":
11
  $cb_user_role_permission = "publish_posts";
12
  break;
13
+
14
  }
15
  if (!current_user_can($cb_user_role_permission))
16
  {
81
  (
82
  "SELECT * FROM " . contact_bank_contact_form()
83
  );
84
+ for ($flag = 0; $flag < count($form_data); $flag++)
85
  {
86
  $total_control = $wpdb->get_var
87
  (
88
  $wpdb->prepare
89
  (
90
+ " SELECT count(" . contact_bank_contact_form() . ".form_id) FROM " . contact_bank_contact_form() . " JOIN ". create_control_Table() . " ON " . create_control_Table() .".form_id = ".contact_bank_contact_form().
91
  ".form_id WHERE " . contact_bank_contact_form() . ".form_id = %d",
92
  $form_data[$flag]->form_id
93
  )
134
  data-original-title="<?php _e("Delete Form", contact_bank) ?>">
135
  <i class="icon-trash"></i>
136
  </a>
137
+
138
  </td>
139
  </tr>
140
  <?php
155
  </div>
156
  </form>
157
  <script type="text/javascript">
158
+
159
  jQuery(document).ready(function()
160
  {
161
 
162
  jQuery("a[rel^=\"prettyPhoto\"]").prettyPhoto
163
  ({
164
+ animation_speed: 1000,
165
+ slideshow: 4000,
166
  autoplay_slideshow: false,
167
+ opacity: 0.80,
168
  show_title: false,
169
  allow_resize: true
170
+ });
171
  });
172
  oTable = jQuery("#data-table-form").dataTable
173
  ({
185
  { "bSortable": false, "aTargets": [2] }
186
  ]
187
  });
188
+ if (typeof(delete_form) != "function")
189
+ {
190
+ function delete_form(form_Id)
191
  {
192
+ var check_str = confirm("<?php _e( "Are you sure, you want to delete this Form?", contact_bank ); ?>");
193
+ if (check_str == true)
194
  {
195
+ jQuery.post(ajaxurl, "id=" + form_Id + "&param=delete_form&action=add_contact_form_library", function (data)
196
+ {
197
+ location.reload();
198
+ });
199
+ }
200
  }
201
  }
202
+ if (typeof(delete_forms) != "function")
203
+ {
204
+ function delete_forms() {
205
+ var checkstr = confirm("<?php _e( "Are you sure, you want to delete all Forms?", contact_bank ); ?>");
206
+ if (checkstr == true)
207
+ {
208
+ jQuery.post(ajaxurl, "param=delete_forms&action=add_contact_form_library", function (data) {
209
+ location.reload();
210
+ });
211
+ }
212
  }
213
  }
214
+ if (typeof(restore_factory_settings) != "function")
215
+ {
216
+ function restore_factory_settings() {
217
+ alert("<?php _e("This Feature is only available in Paid Premium Edition!", contact_bank ); ?>");
218
+ }
219
  }
220
+ if (typeof(close_popup) != "function")
221
  {
222
+ function close_popup()
 
223
  {
224
+ jQuery( "#contact_bank_popup" ).dialog( "close" );
225
+ jQuery.post(ajaxurl, "param=update_option&action=add_new_album_library", function()
226
+ {
227
+ });
228
+ }
229
  }
230
  </script>
231
+ <?php
232
  }
233
+ ?>
views/includes_common_after.php CHANGED
@@ -9,7 +9,7 @@ var array_delete_form_controls = [];
9
  var form_id = "<?php echo $form_id;?>";
10
  jQuery(document).ready(function()
11
  {
12
-
13
  jQuery(window).resize(function()
14
  {
15
  var windowHeight = window.innerHeight - 200;
@@ -43,336 +43,430 @@ jQuery(document).ready(function()
43
  });
44
  show_url_control();
45
  });
46
- function enter_admin_label(dynamicId)
47
  {
48
- var ux_label = jQuery("#ux_label_text_"+dynamicId).val();
49
- jQuery("#ux_admin_label_"+dynamicId).val(ux_label);
 
 
 
50
  }
51
-
52
- function delete_textbox(dynamicId,control_type,control_id)
53
  {
54
- array_delete_form_controls.push(control_id);
55
- jQuery("#div_"+dynamicId+"_"+control_type).remove();
 
 
 
56
  }
57
- function add_settings(dynamicId,field_type)
58
  {
59
- jQuery.post(ajaxurl, "form_id="+form_id+"&dynamicId="+dynamicId+"&field_type="+field_type+"&param=add_settings_div&action=add_contact_form_library", function(data)
60
- {
61
- jQuery("#setting_controls_postback").html(data);
62
- show_Popup();
63
- });
 
 
 
64
  }
65
- function show_Popup()
66
  {
67
- jQuery(".black_overlay").css("display","block");
68
- jQuery(".white_content").css("display","block");
69
- var windowHeight = window.innerHeight - 200;
70
- var windowWidth = window.innerWidth - 200;
71
- var anchor = jQuery("<a class=\"closeButtonLightbox\" onclick=\"CloseLightbox();\"></a>");
72
- jQuery("#setting_controls_postback").append(anchor);
73
- var lightboxHeight = jQuery("#setting_controls_postback").height();
74
- var lightboxWidth = jQuery("#setting_controls_postback").width();
75
- var proposedTop = (window.innerHeight - lightboxHeight - 40) / 2 ;
76
- var proposedLeft = (window.innerWidth - lightboxWidth - 40) / 2 ;
77
- jQuery("#setting_controls_postback").css("top",proposedTop + "px");
78
- jQuery("#setting_controls_postback").css("left",proposedLeft + "px");
79
- jQuery("#setting_controls_postback").fadeIn(200);
 
 
 
80
  }
81
- function CloseLightbox()
82
  {
83
- jQuery("#setting_controls_postback").css("display","none");
84
- jQuery(".black_overlay").css("display","none");
85
- jQuery("#fade").fadeOut(200);
 
 
 
86
  }
87
- function show_url_control()
88
  {
89
- if(jQuery("#ux_rdl_page").prop("checked") == true)
90
- {
91
- jQuery("#div_url").hide();
92
- jQuery("#div_page").show();
93
- }
94
- else
95
- {
96
- jQuery("#div_page").hide();
97
- jQuery("#div_url").show();
98
- }
 
 
 
99
  }
100
- function create_control(control_type,dynamicId,type)
101
  {
102
-
103
- dynamicId = typeof dynamicId !== "undefined" ? dynamicId : Math.floor((Math.random()*100000)+1);
104
- switch(parseInt(control_type))
105
- {
106
- case 1:
107
- jQuery("#div_1_1").clone(false).attr("id","div_"+dynamicId+"_1").appendTo("#left_block");
108
- jQuery("#div_"+dynamicId+"_1").children("label").attr("id","control_label_"+dynamicId);
109
- jQuery("#div_"+dynamicId+"_1").children("div").attr("id","show_tooltip"+dynamicId);
110
- jQuery("#show_tooltip"+dynamicId ).children("input[type=\"text\"]").attr("id","ux_txt_textbox_control_"+dynamicId);
111
- jQuery("#show_tooltip"+dynamicId ).children("input[type=\"text\"]").attr("name","ux_txt_textbox_control_"+dynamicId);
112
- jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("id","add_setting_control_"+dynamicId);
113
- jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("onclick","add_settings("+dynamicId+",1)");
114
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_").attr("id","anchor_del_"+dynamicId);
115
- jQuery("#show_tooltip"+dynamicId).children("span").attr("id","txt_description_"+dynamicId);
116
- jQuery("#div_"+dynamicId+"_1").attr("style","display:block");
117
-
118
- if(typeof type == "undefined")
119
- {
120
- jQuery.post(ajaxurl,"form_id="+form_id+"&ux_hd_textbox_dynamic_id="+dynamicId+"&event=add&param=save_text_control&action=add_contact_form_library", function(data)
121
- {
122
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+",1,"+data+");");
123
- });
124
- }
125
- else
126
- {
127
-
128
- jQuery.post(ajaxurl,"form_id="+form_id+"&dynamicId="+dynamicId+"&control_type="+control_type+"&param=bind_text_control&action=show_form_control_data_contact_library", function(data)
129
- {
130
- var bind_data = JSON.parse(data);
131
- jQuery("#control_label_"+dynamicId).html(bind_data[dynamicId].cb_label_value+" :");
132
- jQuery("#txt_description_"+dynamicId).html(bind_data[dynamicId].cb_description);
133
- jQuery("#show_tooltip"+dynamicId).attr("data-original-title",bind_data[dynamicId].cb_tooltip_txt);
134
- jQuery("#ux_txt_textbox_control_"+dynamicId).attr("placeholder",bind_data[dynamicId].cb_default_txt_val);
135
- if(bind_data[dynamicId].cb_control_required == "1")
136
- {
137
- jQuery("#control_label_"+dynamicId).append("<span class=\"error\">*</span>");
138
- }
139
- var control_id = bind_data[dynamicId].control_id;
140
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+","+control_type+","+control_id+");");
141
- });
142
- }
143
- break;
144
- case 2:
145
- jQuery("#div_2_2").clone(false).attr("id","div_"+dynamicId+"_2").appendTo("#left_block");
146
- jQuery("#div_"+dynamicId+"_2").children("label").attr("id","control_label_"+dynamicId);
147
- jQuery("#div_"+dynamicId+"_2").children("div").attr("id","show_tooltip"+dynamicId);
148
- jQuery("#show_tooltip"+dynamicId ).children("textarea[type=\"textarea\"]").attr("id","ux_textarea_control_"+dynamicId);
149
- jQuery("#show_tooltip"+dynamicId ).children("textarea[type=\"textarea\"]").attr("name","ux_textarea_control_"+dynamicId);
150
- jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("id","add_setting_control_"+dynamicId);
151
- jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("onclick","add_settings("+dynamicId+",2)");
152
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_").attr("id","anchor_del_"+dynamicId);
153
- jQuery("#show_tooltip"+dynamicId).children("span").attr("id","txt_description_"+dynamicId);
154
- jQuery("#div_"+dynamicId+"_2").attr("style","display:block");
155
-
156
- if(typeof type == "undefined")
157
- {
158
- jQuery.post(ajaxurl,"form_id="+form_id+"&ux_hd_textbox_dynamic_id="+dynamicId+"&event=add&param=save_textarea_control&action=add_contact_form_library", function(data)
159
- {
160
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+",2,"+data+");");
161
- });
162
- }
163
- else
164
- {
165
- jQuery.post(ajaxurl,"form_id="+form_id+"&dynamicId="+dynamicId+"&control_type="+control_type+"&param=bind_text_control&action=show_form_control_data_contact_library", function(data)
166
- {
167
- var bind_data = JSON.parse(data);
168
- jQuery("#control_label_"+dynamicId).html(bind_data[dynamicId].cb_label_value+" :");
169
- jQuery("#txt_description_"+dynamicId).html(bind_data[dynamicId].cb_description);
170
- jQuery("#show_tooltip"+dynamicId).attr("data-original-title",bind_data[dynamicId].cb_tooltip_txt);
171
- jQuery("#ux_textarea_control_"+dynamicId).attr("placeholder",bind_data[dynamicId].cb_default_txt_val);
172
- if(bind_data[dynamicId].cb_control_required == "1")
173
- {
174
- jQuery("#control_label_"+dynamicId).append("<span class=\"error\">*</span>");
175
- }
176
- var control_id = bind_data[dynamicId].control_id;
177
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+","+control_type+","+control_id+");");
178
- });
179
- }
180
- break;
181
- case 3:
182
- jQuery("#div_3_3").clone(false).attr("id","div_"+dynamicId+"_3").appendTo("#left_block");
183
- jQuery("#div_"+dynamicId+"_3").children("label").attr("id","control_label_"+dynamicId);
184
- jQuery("#div_"+dynamicId+"_3").children("div").attr("id","show_tooltip"+dynamicId);
185
- jQuery("#show_tooltip"+dynamicId).children("input[type=\"text\"]").attr("id","ux_txt_email_"+dynamicId);
186
- jQuery("#show_tooltip"+dynamicId).children("input[type=\"text\"]").attr("name","ux_txt_email_"+dynamicId);
187
- jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("id","add_setting_control_"+dynamicId);
188
- jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("onclick","add_settings("+dynamicId+",3)");
189
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_").attr("id","anchor_del_"+dynamicId);
190
- jQuery("#show_tooltip"+dynamicId).children("span").attr("id","txt_description_"+dynamicId);
191
- jQuery("#div_"+dynamicId+"_3").attr("style","display:block");
192
-
193
- if(typeof type == "undefined")
194
- {
195
- jQuery.post(ajaxurl,"form_id="+form_id+"&ux_hd_textbox_dynamic_id="+dynamicId+"&event=add&param=save_email_control&action=add_contact_form_library", function(data)
196
- {
197
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+",3,"+data+");");
198
- });
199
- }
200
- else
201
- {
202
- jQuery.post(ajaxurl,"form_id="+form_id+"&dynamicId="+dynamicId+"&control_type="+control_type+"&param=bind_text_control&action=show_form_control_data_contact_library", function(data)
203
- {
204
- var bind_data = JSON.parse(data);
205
- jQuery("#control_label_"+dynamicId).html(bind_data[dynamicId].cb_label_value+" :");
206
- jQuery("#txt_description_"+dynamicId).html(bind_data[dynamicId].cb_description);
207
- jQuery("#show_tooltip"+dynamicId).attr("data-original-title",bind_data[dynamicId].cb_tooltip_txt);
208
- jQuery("#ux_txt_email_"+dynamicId).attr("placeholder",bind_data[dynamicId].cb_default_txt_val);
209
- if(bind_data[dynamicId].cb_control_required == "1")
210
- {
211
- jQuery("#control_label_"+dynamicId).append("<span class=\"error\">*</span>");
212
- }
213
- var control_id = bind_data[dynamicId].control_id;
214
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+","+control_type+","+control_id+");");
215
- });
216
- }
217
- break;
218
- case 4:
219
- jQuery("#div_4_4").clone(false).attr("id","div_"+dynamicId+"_4").appendTo("#left_block");
220
- jQuery("#div_"+dynamicId+"_4").children("label").attr("id","control_label_"+dynamicId);
221
- jQuery("#div_"+dynamicId+"_4").children("div").attr("id","show_tooltip"+dynamicId);
222
- jQuery("#show_tooltip"+dynamicId ).children("select[type=\"select\"]").attr("id","ux_ddl_select_control"+dynamicId);
223
- jQuery("#show_tooltip"+dynamicId ).children("select[type=\"select\"]").attr("name","ux_ddl_select_control"+dynamicId);
224
- jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("id","add_setting_control_"+dynamicId);
225
- jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("onclick","add_settings("+dynamicId+",4)");
226
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_").attr("id","anchor_del_"+dynamicId);
227
- jQuery("#div_"+dynamicId+"_4").attr("style","display:block");
228
-
229
- if(typeof type == "undefined")
230
- {
231
- jQuery.post(ajaxurl,"form_id="+form_id+"&ux_hd_textbox_dynamic_id="+dynamicId+"&event=add&param=save_drop_down_control&action=add_contact_form_library", function(data)
232
- {
233
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+",4,"+data+");");
234
- });
235
- }
236
- else
237
- {
238
- jQuery.post(ajaxurl,"form_id="+form_id+"&dynamicId="+dynamicId+"&control_type="+control_type+"&param=bind_text_control&action=show_form_control_data_contact_library", function(data)
239
- {
240
- var bind_data = JSON.parse(data);
241
- jQuery("#control_label_"+dynamicId).html(bind_data[dynamicId].cb_label_value+" :");
242
- jQuery("#txt_description_"+dynamicId).html(bind_data[dynamicId].cb_description);
243
- jQuery("#show_tooltip"+dynamicId).attr("data-original-title",bind_data[dynamicId].cb_tooltip_txt);
244
- if(bind_data[dynamicId].cb_control_required == "1")
245
- {
246
- jQuery("#control_label_"+dynamicId).append("<span class=\"error\">*</span>");
247
- }
248
- var bind_data_list = bind_data[dynamicId].cb_dropdown_option_id;
249
- for(var flag = 0; flag<bind_data_list.length;flag++)
250
- {
251
- jQuery("#ux_ddl_select_control"+dynamicId).append("<option value=\""+bind_data_list[flag]+"\">"+bind_data[dynamicId].cb_dropdown_option_val[flag]+"</option>");
252
- }
253
- var control_id = bind_data[dynamicId].control_id;
254
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+","+control_type+","+control_id+");");
255
- });
256
- }
257
- break;
258
- case 5:
259
- jQuery("#div_5_5").clone(false).attr("id","div_"+dynamicId+"_5").appendTo("#left_block");
260
- jQuery("#div_"+dynamicId+"_5").children("label").attr("id","control_label_"+dynamicId);
261
- jQuery("#div_"+dynamicId+"_5").children("div").attr("id","post_back_checkbox_"+dynamicId);
262
- jQuery("#post_back_checkbox_"+dynamicId).children("div").attr("id","show_tooltip"+dynamicId);
263
- jQuery("#show_tooltip"+dynamicId ).children("input[type=\"checkbox\"]").attr("id","ux_chk_checkbox_control_"+dynamicId);
264
- jQuery("#show_tooltip"+dynamicId ).children("input[type=\"checkbox\"]").attr("name","ux_chk_checkbox_control_"+dynamicId);
265
- jQuery("#show_tooltip"+dynamicId ).children("span").attr("id","add_chk_options_here_"+dynamicId);
266
- jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("id","add_setting_control_"+dynamicId);
267
- jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("onclick","add_settings("+dynamicId+",5)");
268
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_").attr("id","anchor_del_"+dynamicId);
269
- jQuery("#div_"+dynamicId+"_5").attr("style","display:block");
270
-
271
- if(typeof type == "undefined")
272
- {
273
- jQuery.post(ajaxurl,"form_id="+form_id+"&ux_hd_textbox_dynamic_id="+dynamicId+"&event=add&param=save_check_box_control&action=add_contact_form_library", function(data)
274
- {
275
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+",5,"+data+");");
276
- });
277
- }
278
- else
279
- {
280
- jQuery.post(ajaxurl,"form_id="+form_id+"&dynamicId="+dynamicId+"&control_type="+control_type+"&param=bind_text_control&action=show_form_control_data_contact_library", function(data)
281
- {
282
- var bind_data = JSON.parse(data);
283
- jQuery("#control_label_"+dynamicId).html(bind_data[dynamicId].cb_label_value+" :");
284
- jQuery("#txt_description_"+dynamicId).html(bind_data[dynamicId].cb_description);
285
- jQuery("#post_back_checkbox_"+dynamicId).attr("data-original-title",bind_data[dynamicId].cb_tooltip_txt);
286
- if(bind_data[dynamicId].cb_control_required == "1")
287
- {
288
- jQuery("#control_label_"+dynamicId).append("<span class=\"error\">*</span>");
289
- }
290
- var bind_chk_list = bind_data[dynamicId].cb_checkbox_option_id;
291
- for(var flag = 0; flag<bind_chk_list.length;flag++)
292
- {
293
- jQuery("#ux_chk_checkbox_control_"+dynamicId).hide();
294
- jQuery("#add_chk_options_here_"+dynamicId).append("<span id=\"input_id_"+bind_chk_list[flag]+"\"><input id=\"ux_chk_checkbox_control_"+bind_chk_list[flag]+"\" name=\"ux_chk_checkbox_control_"+bind_chk_list[flag]+"\" type=\"checkbox\"/><label class=\"rdl\">"+bind_data[dynamicId].cb_checkbox_option_val[flag]+"</label></span>");
295
- }
296
- var control_id = bind_data[dynamicId].control_id;
297
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+","+control_type+","+control_id+");");
298
- });
299
- }
300
- break;
301
- case 6:
302
- jQuery("#div_6_6").clone(false).attr("id","div_"+dynamicId+"_6").appendTo("#left_block");
303
- jQuery("#div_"+dynamicId+"_6").children("label").attr("id","control_label_"+dynamicId);
304
- jQuery("#div_"+dynamicId+"_6").children("div").attr("id","post_back_radio_button_"+dynamicId);
305
- jQuery("#post_back_radio_button_"+dynamicId).children("div").attr("id","show_tooltip"+dynamicId);
306
- jQuery("#show_tooltip"+dynamicId ).children("input[type=\"radio\"]").attr("id","ux_radio_button_control_"+dynamicId);
307
- jQuery("#show_tooltip"+dynamicId ).children("input[type=\"radio\"]").attr("name","ux_radio_button_control_"+dynamicId);
308
- jQuery("#show_tooltip"+dynamicId ).children("span").attr("id","add_radio_options_here_"+dynamicId);
309
- jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("id","add_setting_control_"+dynamicId);
310
- jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("onclick","add_settings("+dynamicId+",6)");
311
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_").attr("id","anchor_del_"+dynamicId);
312
- jQuery("#div_"+dynamicId+"_6").attr("style","display:block");
313
-
314
- if(typeof type == "undefined")
315
- {
316
- jQuery.post(ajaxurl,"form_id="+form_id+"&ux_hd_textbox_dynamic_id="+dynamicId+"&event=add&param=save_multiple_control&action=add_contact_form_library", function(data)
317
- {
318
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+",6,"+data+");");
319
- });
320
- }
321
- else
322
- {
323
- jQuery.post(ajaxurl,"form_id="+form_id+"&dynamicId="+dynamicId+"&control_type="+control_type+"&param=bind_text_control&action=show_form_control_data_contact_library", function(data)
324
- {
325
- var bind_data = JSON.parse(data);
326
- jQuery("#control_label_"+dynamicId).html(bind_data[dynamicId].cb_label_value+" :");
327
- jQuery("#txt_description_"+dynamicId).html(bind_data[dynamicId].cb_description);
328
- jQuery("#post_back_radio_button_"+dynamicId).attr("data-original-title",bind_data[dynamicId].cb_tooltip_txt);
329
- if(bind_data[dynamicId].cb_control_required == "1")
330
- {
331
- jQuery("#control_label_"+dynamicId).append("<span class=\"error\">*</span>");
332
- }
333
- var bind_rdl_list = bind_data[dynamicId].cb_radio_option_id;
334
- for(var flag = 0; flag<bind_rdl_list.length;flag++)
335
- {
336
- jQuery("#ux_radio_button_control_"+dynamicId).hide();
337
- jQuery("#add_radio_options_here_"+dynamicId).append("<span id=\"input_id_"+bind_rdl_list[flag]+"\"><input id=\"ux_radio_button_control_"+bind_rdl_list[flag]+"\" name=\"ux_radio"+dynamicId+"\" type=\"radio\"/><label class=\"rdl\">"+bind_data[dynamicId].cb_radio_option_val[flag]+"</label></span>");
338
- if(flag == 0)
339
- {
340
- jQuery("#ux_radio_button_control_"+bind_rdl_list[flag]).attr("checked","checked");
341
- }
342
- }
343
- var control_id = bind_data[dynamicId].control_id;
344
- jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+","+control_type+","+control_id+");");
345
- });
346
- }
347
- break;
348
- case 7:
349
- alert("<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>");
350
- break;
351
- case 8:
352
- alert("<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>");
353
- break;
354
- case 9:
355
- alert("<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>");
356
- break;
357
- case 10:
358
- alert("<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>");
359
- break;
360
- case 11:
361
- alert("<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>");
362
- break;
363
- case 12:
364
- alert("<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>");
365
- break;
366
- case 13:
367
- alert("<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>");
368
- break;
369
- case 15:
370
- alert("<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>");
371
- break;
372
- case 16:
373
- alert("<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>");
374
- break;
375
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
376
  }
377
  <?php
378
  $form_data = $wpdb->get_results
@@ -390,12 +484,14 @@ for($flag = 0; $flag < count($form_data);$flag++)
390
  <?php
391
  }
392
  ?>
393
- function prevent_paste(control_id)
394
  {
395
- jQuery("#"+control_id).live("paste",function(e)
396
- {
397
- e.preventDefault();
398
- });
 
 
 
399
  }
400
-
401
- </script>
9
  var form_id = "<?php echo $form_id;?>";
10
  jQuery(document).ready(function()
11
  {
12
+
13
  jQuery(window).resize(function()
14
  {
15
  var windowHeight = window.innerHeight - 200;
43
  });
44
  show_url_control();
45
  });
46
+ if (typeof(enter_admin_label) != "function")
47
  {
48
+ function enter_admin_label(dynamicId)
49
+ {
50
+ var ux_label = jQuery("#ux_label_text_"+dynamicId).val();
51
+ jQuery("#ux_admin_label_"+dynamicId).val(ux_label);
52
+ }
53
  }
54
+ if (typeof(delete_textbox) != "function")
 
55
  {
56
+ function delete_textbox(dynamicId,control_type,control_id)
57
+ {
58
+ array_delete_form_controls.push(control_id);
59
+ jQuery("#div_"+dynamicId+"_"+control_type).remove();
60
+ }
61
  }
62
+ if (typeof(add_settings) != "function")
63
  {
64
+ function add_settings(dynamicId,field_type)
65
+ {
66
+ jQuery.post(ajaxurl, "form_id="+form_id+"&dynamicId="+dynamicId+"&field_type="+field_type+"&param=add_settings_div&action=add_contact_form_library", function(data)
67
+ {
68
+ jQuery("#setting_controls_postback").html(data);
69
+ show_Popup();
70
+ });
71
+ }
72
  }
73
+ if (typeof(show_Popup) != "function")
74
  {
75
+ function show_Popup()
76
+ {
77
+ jQuery(".black_overlay").css("display","block");
78
+ jQuery(".white_content").css("display","block");
79
+ var windowHeight = window.innerHeight - 200;
80
+ var windowWidth = window.innerWidth - 200;
81
+ var anchor = jQuery("<a class=\"closeButtonLightbox\" onclick=\"CloseLightbox();\"></a>");
82
+ jQuery("#setting_controls_postback").append(anchor);
83
+ var lightboxHeight = jQuery("#setting_controls_postback").height();
84
+ var lightboxWidth = jQuery("#setting_controls_postback").width();
85
+ var proposedTop = (window.innerHeight - lightboxHeight - 40) / 2 ;
86
+ var proposedLeft = (window.innerWidth - lightboxWidth - 40) / 2 ;
87
+ jQuery("#setting_controls_postback").css("top",proposedTop + "px");
88
+ jQuery("#setting_controls_postback").css("left",proposedLeft + "px");
89
+ jQuery("#setting_controls_postback").fadeIn(200);
90
+ }
91
  }
92
+ if (typeof(CloseLightbox) != "function")
93
  {
94
+ function CloseLightbox()
95
+ {
96
+ jQuery("#setting_controls_postback").css("display","none");
97
+ jQuery(".black_overlay").css("display","none");
98
+ jQuery("#fade").fadeOut(200);
99
+ }
100
  }
101
+ if (typeof(show_url_control) != "function")
102
  {
103
+ function show_url_control()
104
+ {
105
+ if(jQuery("#ux_rdl_page").prop("checked") == true)
106
+ {
107
+ jQuery("#div_url").hide();
108
+ jQuery("#div_page").show();
109
+ }
110
+ else
111
+ {
112
+ jQuery("#div_page").hide();
113
+ jQuery("#div_url").show();
114
+ }
115
+ }
116
  }
117
+ if (typeof(create_control) != "function")
118
  {
119
+ function create_control(control_type,dynamicId,type)
120
+ {
121
+
122
+ dynamicId = typeof dynamicId !== "undefined" ? dynamicId : Math.floor((Math.random()*100000)+1);
123
+ switch(parseInt(control_type))
124
+ {
125
+ case 1:
126
+ jQuery("#div_1_1").clone(false).attr("id","div_"+dynamicId+"_1").appendTo("#left_block");
127
+ jQuery("#div_"+dynamicId+"_1").children("label").attr("id","control_label_"+dynamicId);
128
+ jQuery("#div_"+dynamicId+"_1").children("div").attr("id","show_tooltip"+dynamicId);
129
+ jQuery("#show_tooltip"+dynamicId ).children("input[type=\"text\"]").attr("id","ux_txt_textbox_control_"+dynamicId);
130
+ jQuery("#show_tooltip"+dynamicId ).children("input[type=\"text\"]").attr("name","ux_txt_textbox_control_"+dynamicId);
131
+ jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("id","add_setting_control_"+dynamicId);
132
+ jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("onclick","add_settings("+dynamicId+",1)");
133
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_").attr("id","anchor_del_"+dynamicId);
134
+ jQuery("#show_tooltip"+dynamicId).children("span").attr("id","txt_description_"+dynamicId);
135
+ jQuery("#show_tooltip"+dynamicId).children("div:first").attr("id","ux_text_control_tooltip_"+dynamicId).css("display","none");
136
+ jQuery("#show_tooltip"+dynamicId).children("div:eq(1)").attr("id","ux_text_control_placeholder_"+dynamicId).css("display","none");
137
+
138
+ jQuery("#div_"+dynamicId+"_1").attr("style","display:block");
139
+ jQuery(".hovertip").tooltip_tip({placement: "left"});
140
+
141
+ if(typeof type == "undefined")
142
+ {
143
+ jQuery.post(ajaxurl,
144
+ {
145
+ ux_hd_textbox_dynamic_id: dynamicId,
146
+ form_id: form_id,
147
+ events: "add",
148
+ param: "save_text_control",
149
+ action: "add_contact_form_library",
150
+ },
151
+ function(data)
152
+ {
153
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+",1,"+data+");");
154
+ });
155
+ }
156
+ else
157
+ {
158
+
159
+ jQuery.post(ajaxurl,"form_id="+form_id+"&dynamicId="+dynamicId+"&control_type="+control_type+"&param=bind_text_control&action=show_form_control_data_contact_library", function(data)
160
+ {
161
+ var bind_data = JSON.parse(data);
162
+ jQuery("#control_label_"+dynamicId).html(bind_data[dynamicId].cb_label_value+" :");
163
+ jQuery("#txt_description_"+dynamicId).html(bind_data[dynamicId].cb_description);
164
+
165
+ jQuery("#ux_text_control_tooltip_"+dynamicId).html(bind_data[dynamicId].cb_tooltip_txt);
166
+ jQuery("#ux_text_control_placeholder_"+dynamicId).html(bind_data[dynamicId].cb_default_txt_val);
167
+ jQuery("#show_tooltip"+dynamicId).attr("data-original-title",jQuery("#ux_text_control_tooltip_"+dynamicId).text());
168
+ jQuery("#ux_txt_textbox_control_"+dynamicId).attr("placeholder",jQuery("#ux_text_control_placeholder_"+dynamicId).text());
169
+ if(bind_data[dynamicId].cb_control_required == "1")
170
+ {
171
+ jQuery("#control_label_"+dynamicId).append("<span class=\"error_field\">*</span>");
172
+ }
173
+ var control_id = bind_data[dynamicId].control_id;
174
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+","+control_type+","+control_id+");");
175
+ });
176
+ }
177
+ break;
178
+ case 2:
179
+ jQuery("#div_2_2").clone(false).attr("id","div_"+dynamicId+"_2").appendTo("#left_block");
180
+ jQuery("#div_"+dynamicId+"_2").children("label").attr("id","control_label_"+dynamicId);
181
+ jQuery("#div_"+dynamicId+"_2").children("div").attr("id","show_tooltip"+dynamicId);
182
+ jQuery("#show_tooltip"+dynamicId ).children("textarea[type=\"textarea\"]").attr("id","ux_textarea_control_"+dynamicId);
183
+ jQuery("#show_tooltip"+dynamicId ).children("textarea[type=\"textarea\"]").attr("name","ux_textarea_control_"+dynamicId);
184
+ jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("id","add_setting_control_"+dynamicId);
185
+ jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("onclick","add_settings("+dynamicId+",2)");
186
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_").attr("id","anchor_del_"+dynamicId);
187
+ jQuery("#show_tooltip"+dynamicId).children("span").attr("id","txt_description_"+dynamicId);
188
+ jQuery("#show_tooltip"+dynamicId).children("div:first").attr("id","ux_txtarea_control_tooltip_"+dynamicId).css("display","none");
189
+ jQuery("#show_tooltip"+dynamicId).children("div:eq(1)").attr("id","ux_txtarea_control_placeholder_"+dynamicId).css("display","none");
190
+
191
+ jQuery("#div_"+dynamicId+"_2").attr("style","display:block");
192
+ jQuery(".hovertip").tooltip_tip({placement: "left"});
193
+ if(typeof type == "undefined")
194
+ {
195
+ jQuery.post(ajaxurl,
196
+ {
197
+ ux_hd_textbox_dynamic_id: dynamicId,
198
+ form_id: form_id,
199
+ events: "add",
200
+ param: "save_textarea_control",
201
+ action: "add_contact_form_library",
202
+ },
203
+ function(data)
204
+ {
205
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+",2,"+data+");");
206
+ });
207
+ }
208
+ else
209
+ {
210
+ jQuery.post(ajaxurl,"form_id="+form_id+"&dynamicId="+dynamicId+"&control_type="+control_type+"&param=bind_text_control&action=show_form_control_data_contact_library", function(data)
211
+ {
212
+ var bind_data = JSON.parse(data);
213
+ jQuery("#control_label_"+dynamicId).html(bind_data[dynamicId].cb_label_value+" :");
214
+ jQuery("#txt_description_"+dynamicId).html(bind_data[dynamicId].cb_description);
215
+
216
+ jQuery("#ux_txtarea_control_tooltip_"+dynamicId).html(bind_data[dynamicId].cb_tooltip_txt);
217
+ jQuery("#ux_txtarea_control_placeholder_"+dynamicId).html(bind_data[dynamicId].cb_default_txt_val);
218
+
219
+ jQuery("#show_tooltip"+dynamicId).attr("data-original-title",jQuery("#ux_txtarea_control_tooltip_"+dynamicId).text());
220
+ jQuery("#ux_textarea_control_"+dynamicId).attr("placeholder",jQuery("#ux_txtarea_control_placeholder_"+dynamicId).text());
221
+
222
+ if(bind_data[dynamicId].cb_control_required == "1")
223
+ {
224
+ jQuery("#control_label_"+dynamicId).append("<span class=\"error_field\">*</span>");
225
+ }
226
+ var control_id = bind_data[dynamicId].control_id;
227
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+","+control_type+","+control_id+");");
228
+ });
229
+ }
230
+ break;
231
+ case 3:
232
+ jQuery("#div_3_3").clone(false).attr("id","div_"+dynamicId+"_3").appendTo("#left_block");
233
+ jQuery("#div_"+dynamicId+"_3").children("label").attr("id","control_label_"+dynamicId);
234
+ jQuery("#div_"+dynamicId+"_3").children("div").attr("id","show_tooltip"+dynamicId);
235
+ jQuery("#show_tooltip"+dynamicId).children("input[type=\"text\"]").attr("id","ux_txt_email_"+dynamicId);
236
+ jQuery("#show_tooltip"+dynamicId).children("input[type=\"text\"]").attr("name","ux_txt_email_"+dynamicId);
237
+ jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("id","add_setting_control_"+dynamicId);
238
+ jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("onclick","add_settings("+dynamicId+",3)");
239
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_").attr("id","anchor_del_"+dynamicId);
240
+ jQuery("#show_tooltip"+dynamicId).children("span").attr("id","txt_description_"+dynamicId);
241
+ jQuery("#show_tooltip"+dynamicId).children("div:first").attr("id","ux_email_control_tooltip_"+dynamicId).css("display","none");
242
+ jQuery("#show_tooltip"+dynamicId).children("div:eq(1)").attr("id","ux_email_control_placeholder_"+dynamicId).css("display","none");
243
+ jQuery("#div_"+dynamicId+"_3").attr("style","display:block");
244
+ jQuery(".hovertip").tooltip_tip({placement: "left"});
245
+ if(typeof type == "undefined")
246
+ {
247
+ jQuery.post(ajaxurl,
248
+ {
249
+ ux_hd_textbox_dynamic_id: dynamicId,
250
+ form_id: form_id,
251
+ events: "add",
252
+ param: "save_email_control",
253
+ action: "add_contact_form_library",
254
+ },
255
+ function(data)
256
+ {
257
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+",3,"+data+");");
258
+ });
259
+ }
260
+ else
261
+ {
262
+ jQuery.post(ajaxurl,"form_id="+form_id+"&dynamicId="+dynamicId+"&control_type="+control_type+"&param=bind_text_control&action=show_form_control_data_contact_library", function(data)
263
+ {
264
+ var bind_data = JSON.parse(data);
265
+ jQuery("#control_label_"+dynamicId).html(bind_data[dynamicId].cb_label_value+" :");
266
+ jQuery("#txt_description_"+dynamicId).html(bind_data[dynamicId].cb_description);
267
+
268
+ jQuery("#ux_email_control_tooltip_"+dynamicId).html(bind_data[dynamicId].cb_tooltip_txt);
269
+ jQuery("#ux_email_control_placeholder_"+dynamicId).html(bind_data[dynamicId].cb_default_txt_val);
270
+ jQuery("#show_tooltip"+dynamicId).attr("data-original-title",jQuery("#ux_email_control_tooltip_"+dynamicId).text());
271
+ jQuery("#ux_txt_email_"+dynamicId).attr("placeholder",jQuery("#ux_email_control_placeholder_"+dynamicId).text());
272
+
273
+ if(bind_data[dynamicId].cb_control_required == "1")
274
+ {
275
+ jQuery("#control_label_"+dynamicId).append("<span class=\"error_field\">*</span>");
276
+ }
277
+ var control_id = bind_data[dynamicId].control_id;
278
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+","+control_type+","+control_id+");");
279
+ });
280
+ }
281
+ break;
282
+ case 4:
283
+ jQuery("#div_4_4").clone(false).attr("id","div_"+dynamicId+"_4").appendTo("#left_block");
284
+ jQuery("#div_"+dynamicId+"_4").children("label").attr("id","control_label_"+dynamicId);
285
+ jQuery("#div_"+dynamicId+"_4").children("div").attr("id","show_tooltip"+dynamicId);
286
+ jQuery("#show_tooltip"+dynamicId ).children("select[type=\"select\"]").attr("id","ux_ddl_select_control"+dynamicId);
287
+ jQuery("#show_tooltip"+dynamicId ).children("select[type=\"select\"]").attr("name","ux_ddl_select_control"+dynamicId);
288
+ jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("id","add_setting_control_"+dynamicId);
289
+ jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("onclick","add_settings("+dynamicId+",4)");
290
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_").attr("id","anchor_del_"+dynamicId);
291
+ jQuery("#show_tooltip"+dynamicId).children("div:first").attr("id","ux_ddl_control_tooltip_"+dynamicId).css("display","none");
292
+ jQuery("#div_"+dynamicId+"_4").attr("style","display:block");
293
+ jQuery(".hovertip").tooltip_tip({placement: "left"});
294
+ if(typeof type == "undefined")
295
+ {
296
+ jQuery.post(ajaxurl,
297
+ {
298
+ ux_hd_textbox_dynamic_id: dynamicId,
299
+ form_id: form_id,
300
+ events: "add",
301
+ param: "save_drop_down_control",
302
+ action: "add_contact_form_library",
303
+ },
304
+ function(data)
305
+ {
306
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+",4,"+data+");");
307
+ });
308
+ }
309
+ else
310
+ {
311
+ jQuery.post(ajaxurl,"form_id="+form_id+"&dynamicId="+dynamicId+"&control_type="+control_type+"&param=bind_text_control&action=show_form_control_data_contact_library", function(data)
312
+ {
313
+ var bind_data = JSON.parse(data);
314
+ jQuery("#control_label_"+dynamicId).html(bind_data[dynamicId].cb_label_value+" :");
315
+ jQuery("#ux_ddl_control_tooltip_"+dynamicId).html(bind_data[dynamicId].cb_tooltip_txt);
316
+ jQuery("#show_tooltip"+dynamicId).attr("data-original-title",jQuery("#ux_ddl_control_tooltip_"+dynamicId).text());
317
+ if(bind_data[dynamicId].cb_control_required == "1")
318
+ {
319
+ jQuery("#control_label_"+dynamicId).append("<span class=\"error_field\">*</span>");
320
+ }
321
+ var bind_data_list = bind_data[dynamicId].cb_dropdown_option_id;
322
+ for(var flag = 0; flag<bind_data_list.length;flag++)
323
+ {
324
+ jQuery("#ux_ddl_select_control"+dynamicId).append("<option value=\""+bind_data_list[flag]+"\">"+bind_data[dynamicId].cb_dropdown_option_val[flag]+"</option>");
325
+ }
326
+ var control_id = bind_data[dynamicId].control_id;
327
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+","+control_type+","+control_id+");");
328
+ });
329
+ }
330
+ break;
331
+ case 5:
332
+ jQuery("#div_5_5").clone(false).attr("id","div_"+dynamicId+"_5").appendTo("#left_block");
333
+ jQuery("#div_"+dynamicId+"_5").children("label").attr("id","control_label_"+dynamicId);
334
+ jQuery("#div_"+dynamicId+"_5").children("div").attr("id","post_back_checkbox_"+dynamicId);
335
+ jQuery("#post_back_checkbox_"+dynamicId).children("div").attr("id","show_tooltip"+dynamicId);
336
+ jQuery("#show_tooltip"+dynamicId ).children("input[type=\"checkbox\"]").attr("id","ux_chk_checkbox_control_"+dynamicId);
337
+ jQuery("#show_tooltip"+dynamicId ).children("input[type=\"checkbox\"]").attr("name","ux_chk_checkbox_control_"+dynamicId);
338
+ jQuery("#show_tooltip"+dynamicId ).children("span").attr("id","add_chk_options_here_"+dynamicId);
339
+ jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("id","add_setting_control_"+dynamicId);
340
+ jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("onclick","add_settings("+dynamicId+",5)");
341
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_").attr("id","anchor_del_"+dynamicId);
342
+ jQuery("#show_tooltip"+dynamicId).children("div:first").attr("id","ux_chk_control_tooltip_"+dynamicId).css("display","none");
343
+ jQuery("#div_"+dynamicId+"_5").attr("style","display:block");
344
+ jQuery(".hovertip").tooltip_tip({placement: "left"});
345
+ if(typeof type == "undefined")
346
+ {
347
+ jQuery.post(ajaxurl,
348
+ {
349
+ ux_hd_textbox_dynamic_id: dynamicId,
350
+ form_id: form_id,
351
+ events: "add",
352
+ param: "save_check_box_control",
353
+ action: "add_contact_form_library",
354
+ },
355
+ function(data)
356
+ {
357
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+",5,"+data+");");
358
+ });
359
+ }
360
+ else
361
+ {
362
+ jQuery.post(ajaxurl,"form_id="+form_id+"&dynamicId="+dynamicId+"&control_type="+control_type+"&param=bind_text_control&action=show_form_control_data_contact_library", function(data)
363
+ {
364
+ var bind_data = JSON.parse(data);
365
+ jQuery("#control_label_"+dynamicId).html(bind_data[dynamicId].cb_label_value+" :");
366
+ jQuery("#ux_chk_control_tooltip_"+dynamicId).html(bind_data[dynamicId].cb_tooltip_txt);
367
+ jQuery("#post_back_checkbox_"+dynamicId).attr("data-original-title",jQuery("#ux_chk_control_tooltip_"+dynamicId).text());
368
+ if(bind_data[dynamicId].cb_control_required == "1")
369
+ {
370
+ jQuery("#control_label_"+dynamicId).append("<span class=\"error_field\">*</span>");
371
+ }
372
+ var bind_chk_list = bind_data[dynamicId].cb_checkbox_option_id;
373
+ for(var flag = 0; flag<bind_chk_list.length;flag++)
374
+ {
375
+ jQuery("#ux_chk_checkbox_control_"+dynamicId).hide();
376
+ jQuery("#add_chk_options_here_"+dynamicId).append("<span id=\"input_id_"+bind_chk_list[flag]+"\"><input id=\"ux_chk_checkbox_control_"+bind_chk_list[flag]+"\" name=\"ux_chk_checkbox_control_"+bind_chk_list[flag]+"\" type=\"checkbox\"/><label class=\"rdl\">"+bind_data[dynamicId].cb_checkbox_option_val[flag]+"</label></span>");
377
+ }
378
+ var control_id = bind_data[dynamicId].control_id;
379
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+","+control_type+","+control_id+");");
380
+ });
381
+ }
382
+ break;
383
+ case 6:
384
+ jQuery("#div_6_6").clone(false).attr("id","div_"+dynamicId+"_6").appendTo("#left_block");
385
+ jQuery("#div_"+dynamicId+"_6").children("label").attr("id","control_label_"+dynamicId);
386
+ jQuery("#div_"+dynamicId+"_6").children("div").attr("id","post_back_radio_button_"+dynamicId);
387
+ jQuery("#post_back_radio_button_"+dynamicId).children("div").attr("id","show_tooltip"+dynamicId);
388
+ jQuery("#show_tooltip"+dynamicId ).children("input[type=\"radio\"]").attr("id","ux_radio_button_control_"+dynamicId);
389
+ jQuery("#show_tooltip"+dynamicId ).children("input[type=\"radio\"]").attr("name","ux_radio_button_control_"+dynamicId);
390
+ jQuery("#show_tooltip"+dynamicId ).children("span").attr("id","add_radio_options_here_"+dynamicId);
391
+ jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("id","add_setting_control_"+dynamicId);
392
+ jQuery("#show_tooltip"+dynamicId).children("a.btn").attr("onclick","add_settings("+dynamicId+",6)");
393
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_").attr("id","anchor_del_"+dynamicId);
394
+ jQuery("#show_tooltip"+dynamicId).children("div:first").attr("id","ux_rdl_control_tooltip_"+dynamicId).css("display","none");
395
+ jQuery("#div_"+dynamicId+"_6").attr("style","display:block");
396
+ jQuery(".hovertip").tooltip_tip({placement: "left"});
397
+ if(typeof type == "undefined")
398
+ {
399
+ jQuery.post(ajaxurl,
400
+ {
401
+ ux_hd_textbox_dynamic_id: dynamicId,
402
+ form_id: form_id,
403
+ events: "add",
404
+ param: "save_multiple_control",
405
+ action: "add_contact_form_library",
406
+ },
407
+ function(data)
408
+ {
409
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+",6,"+data+");");
410
+ });
411
+ }
412
+ else
413
+ {
414
+ jQuery.post(ajaxurl,"form_id="+form_id+"&dynamicId="+dynamicId+"&control_type="+control_type+"&param=bind_text_control&action=show_form_control_data_contact_library", function(data)
415
+ {
416
+
417
+ var bind_data = JSON.parse(data);
418
+ jQuery("#control_label_"+dynamicId).html(bind_data[dynamicId].cb_label_value+" :");
419
+ jQuery("#ux_rdl_control_tooltip_"+dynamicId).html(bind_data[dynamicId].cb_tooltip_txt);
420
+ jQuery("#post_back_radio_button_"+dynamicId).attr("data-original-title",jQuery("#ux_rdl_control_tooltip_"+dynamicId).text());
421
+
422
+ if(bind_data[dynamicId].cb_control_required == "1")
423
+ {
424
+ jQuery("#control_label_"+dynamicId).append("<span class=\"error_field\">*</span>");
425
+ }
426
+ var bind_rdl_list = bind_data[dynamicId].cb_radio_option_id;
427
+ for(var flag = 0; flag<bind_rdl_list.length;flag++)
428
+ {
429
+ jQuery("#ux_radio_button_control_"+dynamicId).hide();
430
+ jQuery("#add_radio_options_here_"+dynamicId).append("<span id=\"input_id_"+bind_rdl_list[flag]+"\"><input id=\"ux_radio_button_control_"+bind_rdl_list[flag]+"\" name=\"ux_radio"+dynamicId+"\" type=\"radio\"/><label class=\"rdl\">"+bind_data[dynamicId].cb_radio_option_val[flag]+"</label></span>");
431
+ if(flag == 0)
432
+ {
433
+ jQuery("#ux_radio_button_control_"+bind_rdl_list[flag]).attr("checked","checked");
434
+ }
435
+ }
436
+ var control_id = bind_data[dynamicId].control_id;
437
+ jQuery("#show_tooltip"+dynamicId).children("#anchor_del_"+dynamicId).attr("onclick","delete_textbox("+dynamicId+","+control_type+","+control_id+");");
438
+ });
439
+ }
440
+ break;
441
+ case 7:
442
+ alert("<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>");
443
+ break;
444
+ case 8:
445
+ alert("<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>");
446
+ break;
447
+ case 9:
448
+ alert("<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>");
449
+ break;
450
+ case 10:
451
+ alert("<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>");
452
+ break;
453
+ case 11:
454
+ alert("<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>");
455
+ break;
456
+ case 12:
457
+ alert("<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>");
458
+ break;
459
+ case 13:
460
+ alert("<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>");
461
+ break;
462
+ case 15:
463
+ alert("<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>");
464
+ break;
465
+ case 16:
466
+ alert("<?php _e( "This Feature is only available in Paid Premium Edition!", contact_bank ); ?>");
467
+ break;
468
+ }
469
+ }
470
  }
471
  <?php
472
  $form_data = $wpdb->get_results
484
  <?php
485
  }
486
  ?>
487
+ if (typeof(prevent_paste) != "function")
488
  {
489
+ function prevent_paste(control_id)
490
+ {
491
+ jQuery("#"+control_id).live("paste",function(e)
492
+ {
493
+ e.preventDefault();
494
+ });
495
+ }
496
  }
497
+ </script>
 
views/shortcode.php CHANGED
@@ -17,7 +17,7 @@ if (!current_user_can($cb_user_role_permission))
17
  return;
18
  }
19
  else
20
- {
21
  ?>
22
  <form id="shortcode" class="layout-form" method="post">
23
  <div id="poststuff" style="width: 99% !important;">
@@ -38,6 +38,6 @@ else
38
  </div>
39
  </div>
40
  </form>
41
- <?php
42
  }
43
- ?>
17
  return;
18
  }
19
  else
20
+ {
21
  ?>
22
  <form id="shortcode" class="layout-form" method="post">
23
  <div id="poststuff" style="width: 99% !important;">
38
  </div>
39
  </div>
40
  </form>
41
+ <?php
42
  }
43
+ ?>