Version Description
- Fixed: Bug on color picker when choosing transparency
- Fixed: Bug on submissions edit
- Fixed: Bug on "Inherit from website" theme
- Fixed: Bug on Paypal notifications
- Changed: Form Options tab id to avoid conflict with some plugins
Download this release
Release Info
| Developer | webdorado |
| Plugin | |
| Version | 1.11.4 |
| Comparing to | |
| See all releases | |
Code changes from version 1.11.3 to 1.11.4
- admin/controllers/FMControllerBlocked_ips_fm.php +147 -147
- admin/controllers/FMControllerFormMakerPreview.php +42 -42
- admin/controllers/FMControllerFormMakerSQLMapping.php +111 -111
- admin/controllers/FMControllerFormMakerSubmits.php +42 -42
- admin/controllers/FMControllerFormmakerwdcaptcha.php +42 -42
- admin/controllers/FMControllerFormmakerwdmathcaptcha.php +42 -42
- admin/controllers/FMControllerFormmakerwindow.php +42 -42
- admin/controllers/FMControllerFromeditcountryinpopup.php +42 -42
- admin/controllers/FMControllerFromipinfoinpopup.php +42 -42
- admin/controllers/FMControllerFrommapeditinpopup.php +42 -42
- admin/controllers/FMControllerGenerete_csv.php +42 -42
- admin/controllers/FMControllerGenerete_xml.php +42 -42
- admin/controllers/FMControllerGoptions_fm.php +43 -43
- admin/controllers/FMControllerLicensing_fm.php +48 -48
- admin/controllers/FMControllerManage_fm.php +1195 -1195
- admin/controllers/FMControllerSelect_data_from_db.php +69 -69
- admin/controllers/FMControllerShow_matrix.php +42 -42
- admin/controllers/FMControllerSubmissions_fm.php +290 -775
- admin/controllers/FMControllerThemes_fm.php +219 -219
- admin/controllers/FMControllerUninstall_fm.php +65 -65
- admin/controllers/FMControllerWidget.php +60 -60
- admin/models/FMModelBlocked_ips_fm.php +74 -74
- admin/models/FMModelFormMakerPreview.php +35 -35
- admin/models/FMModelFormMakerSQLMapping.php +120 -120
- admin/models/FMModelFormMakerSubmits.php +42 -42
- admin/models/FMModelFormmakerwdcaptcha.php +30 -30
- admin/models/FMModelFormmakerwdmathcaptcha.php +30 -30
- admin/models/FMModelFormmakerwindow.php +35 -35
- admin/models/FMModelFromeditcountryinpopup.php +30 -30
- admin/models/FMModelFromipinfoinpopup.php +30 -30
- admin/models/FMModelFrommapeditinpopup.php +30 -30
- admin/models/FMModelGenerete_csv.php +299 -299
- admin/models/FMModelGenerete_xml.php +300 -300
- admin/models/FMModelGoptions_fm.php +3 -3
- admin/models/FMModelLicensing_fm.php +29 -29
- admin/models/FMModelManage_fm.php +2886 -2886
- admin/models/FMModelSelect_data_from_db.php +110 -110
- admin/models/FMModelShow_matrix.php +30 -30
- admin/models/FMModelSubmissions_fm.php +744 -744
- admin/models/FMModelThemes_fm.php +99 -99
- admin/models/FMModelUninstall_fm.php +51 -51
- admin/models/FMModelWidget.php +37 -37
- admin/views/FMViewBlocked_ips_fm.php +101 -149
admin/controllers/FMControllerBlocked_ips_fm.php
CHANGED
|
@@ -1,148 +1,148 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMControllerBlocked_ips_fm {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
public function execute() {
|
| 22 |
-
$task = WDW_FM_Library::get('task');
|
| 23 |
-
$id = (int)WDW_FM_Library::get('current_id', 0);
|
| 24 |
-
$message = WDW_FM_Library::get('message');
|
| 25 |
-
echo WDW_FM_Library::message_id($message);
|
| 26 |
-
if (method_exists($this, $task)) {
|
| 27 |
-
check_admin_referer('nonce_fm', 'nonce_fm');
|
| 28 |
-
$this->$task($id);
|
| 29 |
-
}
|
| 30 |
-
else {
|
| 31 |
-
$this->display();
|
| 32 |
-
}
|
| 33 |
-
}
|
| 34 |
-
|
| 35 |
-
public function display() {
|
| 36 |
-
require_once WD_FM_DIR . "/admin/models/FMModelBlocked_ips_fm.php";
|
| 37 |
-
$model = new FMModelBlocked_ips_fm();
|
| 38 |
-
|
| 39 |
-
require_once WD_FM_DIR . "/admin/views/FMViewBlocked_ips_fm.php";
|
| 40 |
-
$view = new FMViewBlocked_ips_fm($model);
|
| 41 |
-
$view->display();
|
| 42 |
-
}
|
| 43 |
-
|
| 44 |
-
public function save() {
|
| 45 |
-
$message = $this->save_db();
|
| 46 |
-
// $this->display();
|
| 47 |
-
$page = WDW_FM_Library::get('page');
|
| 48 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 49 |
-
}
|
| 50 |
-
|
| 51 |
-
public function save_db() {
|
| 52 |
-
global $wpdb;
|
| 53 |
-
$id = (isset($_POST['current_id']) ? (int) $_POST['current_id'] : 0);
|
| 54 |
-
$ip = (isset($_POST['ip']) ? esc_html(stripslashes($_POST['ip'])) : '');
|
| 55 |
-
if ($id != 0) {
|
| 56 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker_blocked', array(
|
| 57 |
-
'ip' => $ip,
|
| 58 |
-
), array('id' => $id));
|
| 59 |
-
}
|
| 60 |
-
else {
|
| 61 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker_blocked', array(
|
| 62 |
-
'ip' => $ip,
|
| 63 |
-
), array(
|
| 64 |
-
'%s',
|
| 65 |
-
));
|
| 66 |
-
}
|
| 67 |
-
if ($save !== FALSE) {
|
| 68 |
-
$message = 1;
|
| 69 |
-
}
|
| 70 |
-
else {
|
| 71 |
-
$message = 2;
|
| 72 |
-
}
|
| 73 |
-
}
|
| 74 |
-
|
| 75 |
-
public function save_all() {
|
| 76 |
-
global $wpdb;
|
| 77 |
-
$flag = FALSE;
|
| 78 |
-
$ips_id_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_blocked');
|
| 79 |
-
foreach ($ips_id_col as $ip_id) {
|
| 80 |
-
if (isset($_POST['ip' . $ip_id])) {
|
| 81 |
-
$ip = esc_html(stripslashes($_POST['ip' . $ip_id]));
|
| 82 |
-
if ($ip == '') {
|
| 83 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $ip_id));
|
| 84 |
-
}
|
| 85 |
-
else {
|
| 86 |
-
$flag = TRUE;
|
| 87 |
-
$wpdb->update($wpdb->prefix . 'formmaker_blocked', array(
|
| 88 |
-
'ip' => $ip,
|
| 89 |
-
), array('id' => $ip_id));
|
| 90 |
-
}
|
| 91 |
-
}
|
| 92 |
-
}
|
| 93 |
-
if ($flag) {
|
| 94 |
-
$message = 1;
|
| 95 |
-
}
|
| 96 |
-
else {
|
| 97 |
-
$message = 0;
|
| 98 |
-
}
|
| 99 |
-
// $this->display();
|
| 100 |
-
$page = WDW_FM_Library::get('page');
|
| 101 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 102 |
-
}
|
| 103 |
-
|
| 104 |
-
public function delete($id) {
|
| 105 |
-
global $wpdb;
|
| 106 |
-
$query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $id);
|
| 107 |
-
if ($wpdb->query($query)) {
|
| 108 |
-
$message = 3;
|
| 109 |
-
}
|
| 110 |
-
else {
|
| 111 |
-
$message = 2;
|
| 112 |
-
}
|
| 113 |
-
// $this->display();
|
| 114 |
-
$page = WDW_FM_Library::get('page');
|
| 115 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 116 |
-
}
|
| 117 |
-
|
| 118 |
-
public function delete_all() {
|
| 119 |
-
global $wpdb;
|
| 120 |
-
$flag = FALSE;
|
| 121 |
-
$ips_id_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_blocked');
|
| 122 |
-
foreach ($ips_id_col as $ip_id) {
|
| 123 |
-
if (isset($_POST['check_' . $ip_id])) {
|
| 124 |
-
$flag = TRUE;
|
| 125 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $ip_id));
|
| 126 |
-
}
|
| 127 |
-
}
|
| 128 |
-
if ($flag) {
|
| 129 |
-
$message = 5;
|
| 130 |
-
}
|
| 131 |
-
else {
|
| 132 |
-
$message = 2;
|
| 133 |
-
}
|
| 134 |
-
// $this->display();
|
| 135 |
-
$page = WDW_FM_Library::get('page');
|
| 136 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 137 |
-
}
|
| 138 |
-
|
| 139 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 140 |
-
// Getters & Setters //
|
| 141 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 142 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 143 |
-
// Private Methods //
|
| 144 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 145 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 146 |
-
// Listeners //
|
| 147 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 148 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMControllerBlocked_ips_fm {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
public function execute() {
|
| 22 |
+
$task = WDW_FM_Library::get('task');
|
| 23 |
+
$id = (int)WDW_FM_Library::get('current_id', 0);
|
| 24 |
+
$message = WDW_FM_Library::get('message');
|
| 25 |
+
echo WDW_FM_Library::message_id($message);
|
| 26 |
+
if (method_exists($this, $task)) {
|
| 27 |
+
check_admin_referer('nonce_fm', 'nonce_fm');
|
| 28 |
+
$this->$task($id);
|
| 29 |
+
}
|
| 30 |
+
else {
|
| 31 |
+
$this->display();
|
| 32 |
+
}
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
public function display() {
|
| 36 |
+
require_once WD_FM_DIR . "/admin/models/FMModelBlocked_ips_fm.php";
|
| 37 |
+
$model = new FMModelBlocked_ips_fm();
|
| 38 |
+
|
| 39 |
+
require_once WD_FM_DIR . "/admin/views/FMViewBlocked_ips_fm.php";
|
| 40 |
+
$view = new FMViewBlocked_ips_fm($model);
|
| 41 |
+
$view->display();
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
public function save() {
|
| 45 |
+
$message = $this->save_db();
|
| 46 |
+
// $this->display();
|
| 47 |
+
$page = WDW_FM_Library::get('page');
|
| 48 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
public function save_db() {
|
| 52 |
+
global $wpdb;
|
| 53 |
+
$id = (isset($_POST['current_id']) ? (int) $_POST['current_id'] : 0);
|
| 54 |
+
$ip = (isset($_POST['ip']) ? esc_html(stripslashes($_POST['ip'])) : '');
|
| 55 |
+
if ($id != 0) {
|
| 56 |
+
$save = $wpdb->update($wpdb->prefix . 'formmaker_blocked', array(
|
| 57 |
+
'ip' => $ip,
|
| 58 |
+
), array('id' => $id));
|
| 59 |
+
}
|
| 60 |
+
else {
|
| 61 |
+
$save = $wpdb->insert($wpdb->prefix . 'formmaker_blocked', array(
|
| 62 |
+
'ip' => $ip,
|
| 63 |
+
), array(
|
| 64 |
+
'%s',
|
| 65 |
+
));
|
| 66 |
+
}
|
| 67 |
+
if ($save !== FALSE) {
|
| 68 |
+
$message = 1;
|
| 69 |
+
}
|
| 70 |
+
else {
|
| 71 |
+
$message = 2;
|
| 72 |
+
}
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
public function save_all() {
|
| 76 |
+
global $wpdb;
|
| 77 |
+
$flag = FALSE;
|
| 78 |
+
$ips_id_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_blocked');
|
| 79 |
+
foreach ($ips_id_col as $ip_id) {
|
| 80 |
+
if (isset($_POST['ip' . $ip_id])) {
|
| 81 |
+
$ip = esc_html(stripslashes($_POST['ip' . $ip_id]));
|
| 82 |
+
if ($ip == '') {
|
| 83 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $ip_id));
|
| 84 |
+
}
|
| 85 |
+
else {
|
| 86 |
+
$flag = TRUE;
|
| 87 |
+
$wpdb->update($wpdb->prefix . 'formmaker_blocked', array(
|
| 88 |
+
'ip' => $ip,
|
| 89 |
+
), array('id' => $ip_id));
|
| 90 |
+
}
|
| 91 |
+
}
|
| 92 |
+
}
|
| 93 |
+
if ($flag) {
|
| 94 |
+
$message = 1;
|
| 95 |
+
}
|
| 96 |
+
else {
|
| 97 |
+
$message = 0;
|
| 98 |
+
}
|
| 99 |
+
// $this->display();
|
| 100 |
+
$page = WDW_FM_Library::get('page');
|
| 101 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
public function delete($id) {
|
| 105 |
+
global $wpdb;
|
| 106 |
+
$query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $id);
|
| 107 |
+
if ($wpdb->query($query)) {
|
| 108 |
+
$message = 3;
|
| 109 |
+
}
|
| 110 |
+
else {
|
| 111 |
+
$message = 2;
|
| 112 |
+
}
|
| 113 |
+
// $this->display();
|
| 114 |
+
$page = WDW_FM_Library::get('page');
|
| 115 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
public function delete_all() {
|
| 119 |
+
global $wpdb;
|
| 120 |
+
$flag = FALSE;
|
| 121 |
+
$ips_id_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_blocked');
|
| 122 |
+
foreach ($ips_id_col as $ip_id) {
|
| 123 |
+
if (isset($_POST['check_' . $ip_id])) {
|
| 124 |
+
$flag = TRUE;
|
| 125 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $ip_id));
|
| 126 |
+
}
|
| 127 |
+
}
|
| 128 |
+
if ($flag) {
|
| 129 |
+
$message = 5;
|
| 130 |
+
}
|
| 131 |
+
else {
|
| 132 |
+
$message = 2;
|
| 133 |
+
}
|
| 134 |
+
// $this->display();
|
| 135 |
+
$page = WDW_FM_Library::get('page');
|
| 136 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 140 |
+
// Getters & Setters //
|
| 141 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 142 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 143 |
+
// Private Methods //
|
| 144 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 145 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 146 |
+
// Listeners //
|
| 147 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 148 |
}
|
admin/controllers/FMControllerFormMakerPreview.php
CHANGED
|
@@ -1,43 +1,43 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMControllerFormMakerPreview {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
public function execute() {
|
| 22 |
-
$this->display();
|
| 23 |
-
}
|
| 24 |
-
|
| 25 |
-
public function display() {
|
| 26 |
-
require_once WD_FM_DIR . "/admin/models/FMModelFormMakerPreview.php";
|
| 27 |
-
$model = new FMModelFormMakerPreview();
|
| 28 |
-
|
| 29 |
-
require_once WD_FM_DIR . "/admin/views/FMViewFormMakerPreview.php";
|
| 30 |
-
$view = new FMViewFormMakerPreview($model);
|
| 31 |
-
$view->display();
|
| 32 |
-
}
|
| 33 |
-
|
| 34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
-
// Getters & Setters //
|
| 36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
-
// Private Methods //
|
| 39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
-
// Listeners //
|
| 42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMControllerFormMakerPreview {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
public function execute() {
|
| 22 |
+
$this->display();
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
public function display() {
|
| 26 |
+
require_once WD_FM_DIR . "/admin/models/FMModelFormMakerPreview.php";
|
| 27 |
+
$model = new FMModelFormMakerPreview();
|
| 28 |
+
|
| 29 |
+
require_once WD_FM_DIR . "/admin/views/FMViewFormMakerPreview.php";
|
| 30 |
+
$view = new FMViewFormMakerPreview($model);
|
| 31 |
+
$view->display();
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
+
// Getters & Setters //
|
| 36 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 37 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
+
// Private Methods //
|
| 39 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 40 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
+
// Listeners //
|
| 42 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
}
|
admin/controllers/FMControllerFormMakerSQLMapping.php
CHANGED
|
@@ -1,112 +1,112 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMControllerFormMakerSQLMapping {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
public function execute() {
|
| 22 |
-
$task = ((isset($_GET['task'])) ? esc_html($_GET['task']) : 0);
|
| 23 |
-
$id = ((isset($_GET['id'])) ? (int) $_GET['id'] : 0);
|
| 24 |
-
$form_id = ((isset($_GET['form_id'])) ? (int) $_GET['form_id'] : 0);
|
| 25 |
-
if ($task && method_exists($this, $task)) {
|
| 26 |
-
$this->$task($form_id);
|
| 27 |
-
}
|
| 28 |
-
else {
|
| 29 |
-
if ($id) {
|
| 30 |
-
$this->edit_query($id, $form_id);
|
| 31 |
-
}
|
| 32 |
-
else {
|
| 33 |
-
$this->add_query($form_id);
|
| 34 |
-
}
|
| 35 |
-
}
|
| 36 |
-
}
|
| 37 |
-
|
| 38 |
-
public function add_query($form_id) {
|
| 39 |
-
require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
|
| 40 |
-
$model = new FMModelFormMakerSQLMapping();
|
| 41 |
-
|
| 42 |
-
require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
|
| 43 |
-
$view = new FMViewFormMakerSQLMapping($model);
|
| 44 |
-
$view->add_query($form_id);
|
| 45 |
-
}
|
| 46 |
-
|
| 47 |
-
public function edit_query($id, $form_id) {
|
| 48 |
-
require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
|
| 49 |
-
$model = new FMModelFormMakerSQLMapping();
|
| 50 |
-
|
| 51 |
-
require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
|
| 52 |
-
$view = new FMViewFormMakerSQLMapping($model);
|
| 53 |
-
$view->edit_query($id, $form_id);
|
| 54 |
-
}
|
| 55 |
-
|
| 56 |
-
public function db_tables($form_id) {
|
| 57 |
-
require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
|
| 58 |
-
$model = new FMModelFormMakerSQLMapping();
|
| 59 |
-
|
| 60 |
-
require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
|
| 61 |
-
$view = new FMViewFormMakerSQLMapping($model);
|
| 62 |
-
$view->db_tables($form_id);
|
| 63 |
-
}
|
| 64 |
-
|
| 65 |
-
public function db_table_struct($form_id) {
|
| 66 |
-
require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
|
| 67 |
-
$model = new FMModelFormMakerSQLMapping();
|
| 68 |
-
|
| 69 |
-
require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
|
| 70 |
-
$view = new FMViewFormMakerSQLMapping($model);
|
| 71 |
-
$view->db_table_struct($form_id);
|
| 72 |
-
}
|
| 73 |
-
|
| 74 |
-
public function save_query() {
|
| 75 |
-
global $wpdb;
|
| 76 |
-
$form_id = ((isset($_GET['form_id'])) ? (int) $_GET['form_id'] : 0);
|
| 77 |
-
$query = ((isset($_POST['query'])) ? stripslashes(wp_specialchars_decode($_POST['query'])) : "");
|
| 78 |
-
$details = ((isset($_POST['details'])) ? esc_html($_POST['details']) : "");
|
| 79 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker_query', array(
|
| 80 |
-
'form_id' => $form_id,
|
| 81 |
-
'query' => $query,
|
| 82 |
-
'details' => $details,
|
| 83 |
-
), array(
|
| 84 |
-
'%d',
|
| 85 |
-
'%s',
|
| 86 |
-
'%s',
|
| 87 |
-
));
|
| 88 |
-
}
|
| 89 |
-
|
| 90 |
-
public function update_query() {
|
| 91 |
-
global $wpdb;
|
| 92 |
-
$id = ((isset($_GET['id'])) ? (int) $_GET['id'] : 0);
|
| 93 |
-
$form_id = ((isset($_GET['form_id'])) ? (int) $_GET['form_id'] : 0);
|
| 94 |
-
$query = ((isset($_POST['query'])) ? stripslashes(wp_specialchars_decode($_POST['query'])) : "");
|
| 95 |
-
$details = ((isset($_POST['details'])) ? esc_html($_POST['details']) : "");
|
| 96 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker_query', array(
|
| 97 |
-
'form_id' => $form_id,
|
| 98 |
-
'query' => $query,
|
| 99 |
-
'details' => $details,
|
| 100 |
-
), array('id' => $id));
|
| 101 |
-
}
|
| 102 |
-
|
| 103 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 104 |
-
// Getters & Setters //
|
| 105 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 106 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 107 |
-
// Private Methods //
|
| 108 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 109 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 110 |
-
// Listeners //
|
| 111 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 112 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMControllerFormMakerSQLMapping {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
public function execute() {
|
| 22 |
+
$task = ((isset($_GET['task'])) ? esc_html($_GET['task']) : 0);
|
| 23 |
+
$id = ((isset($_GET['id'])) ? (int) $_GET['id'] : 0);
|
| 24 |
+
$form_id = ((isset($_GET['form_id'])) ? (int) $_GET['form_id'] : 0);
|
| 25 |
+
if ($task && method_exists($this, $task)) {
|
| 26 |
+
$this->$task($form_id);
|
| 27 |
+
}
|
| 28 |
+
else {
|
| 29 |
+
if ($id) {
|
| 30 |
+
$this->edit_query($id, $form_id);
|
| 31 |
+
}
|
| 32 |
+
else {
|
| 33 |
+
$this->add_query($form_id);
|
| 34 |
+
}
|
| 35 |
+
}
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
public function add_query($form_id) {
|
| 39 |
+
require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
|
| 40 |
+
$model = new FMModelFormMakerSQLMapping();
|
| 41 |
+
|
| 42 |
+
require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
|
| 43 |
+
$view = new FMViewFormMakerSQLMapping($model);
|
| 44 |
+
$view->add_query($form_id);
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
public function edit_query($id, $form_id) {
|
| 48 |
+
require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
|
| 49 |
+
$model = new FMModelFormMakerSQLMapping();
|
| 50 |
+
|
| 51 |
+
require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
|
| 52 |
+
$view = new FMViewFormMakerSQLMapping($model);
|
| 53 |
+
$view->edit_query($id, $form_id);
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
public function db_tables($form_id) {
|
| 57 |
+
require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
|
| 58 |
+
$model = new FMModelFormMakerSQLMapping();
|
| 59 |
+
|
| 60 |
+
require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
|
| 61 |
+
$view = new FMViewFormMakerSQLMapping($model);
|
| 62 |
+
$view->db_tables($form_id);
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
public function db_table_struct($form_id) {
|
| 66 |
+
require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
|
| 67 |
+
$model = new FMModelFormMakerSQLMapping();
|
| 68 |
+
|
| 69 |
+
require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
|
| 70 |
+
$view = new FMViewFormMakerSQLMapping($model);
|
| 71 |
+
$view->db_table_struct($form_id);
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
public function save_query() {
|
| 75 |
+
global $wpdb;
|
| 76 |
+
$form_id = ((isset($_GET['form_id'])) ? (int) $_GET['form_id'] : 0);
|
| 77 |
+
$query = ((isset($_POST['query'])) ? stripslashes(wp_specialchars_decode($_POST['query'])) : "");
|
| 78 |
+
$details = ((isset($_POST['details'])) ? esc_html($_POST['details']) : "");
|
| 79 |
+
$save = $wpdb->insert($wpdb->prefix . 'formmaker_query', array(
|
| 80 |
+
'form_id' => $form_id,
|
| 81 |
+
'query' => $query,
|
| 82 |
+
'details' => $details,
|
| 83 |
+
), array(
|
| 84 |
+
'%d',
|
| 85 |
+
'%s',
|
| 86 |
+
'%s',
|
| 87 |
+
));
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
public function update_query() {
|
| 91 |
+
global $wpdb;
|
| 92 |
+
$id = ((isset($_GET['id'])) ? (int) $_GET['id'] : 0);
|
| 93 |
+
$form_id = ((isset($_GET['form_id'])) ? (int) $_GET['form_id'] : 0);
|
| 94 |
+
$query = ((isset($_POST['query'])) ? stripslashes(wp_specialchars_decode($_POST['query'])) : "");
|
| 95 |
+
$details = ((isset($_POST['details'])) ? esc_html($_POST['details']) : "");
|
| 96 |
+
$save = $wpdb->update($wpdb->prefix . 'formmaker_query', array(
|
| 97 |
+
'form_id' => $form_id,
|
| 98 |
+
'query' => $query,
|
| 99 |
+
'details' => $details,
|
| 100 |
+
), array('id' => $id));
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 104 |
+
// Getters & Setters //
|
| 105 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 106 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 107 |
+
// Private Methods //
|
| 108 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 109 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 110 |
+
// Listeners //
|
| 111 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 112 |
}
|
admin/controllers/FMControllerFormMakerSubmits.php
CHANGED
|
@@ -1,43 +1,43 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMControllerFormMakerSubmits {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
public function execute() {
|
| 22 |
-
$this->display();
|
| 23 |
-
}
|
| 24 |
-
|
| 25 |
-
public function display() {
|
| 26 |
-
require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSubmits.php";
|
| 27 |
-
$model = new FMModelFormMakerSubmits();
|
| 28 |
-
|
| 29 |
-
require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSubmits.php";
|
| 30 |
-
$view = new FMViewFormMakerSubmits($model);
|
| 31 |
-
$view->display();
|
| 32 |
-
}
|
| 33 |
-
|
| 34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
-
// Getters & Setters //
|
| 36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
-
// Private Methods //
|
| 39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
-
// Listeners //
|
| 42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMControllerFormMakerSubmits {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
public function execute() {
|
| 22 |
+
$this->display();
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
public function display() {
|
| 26 |
+
require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSubmits.php";
|
| 27 |
+
$model = new FMModelFormMakerSubmits();
|
| 28 |
+
|
| 29 |
+
require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSubmits.php";
|
| 30 |
+
$view = new FMViewFormMakerSubmits($model);
|
| 31 |
+
$view->display();
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
+
// Getters & Setters //
|
| 36 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 37 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
+
// Private Methods //
|
| 39 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 40 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
+
// Listeners //
|
| 42 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
}
|
admin/controllers/FMControllerFormmakerwdcaptcha.php
CHANGED
|
@@ -1,43 +1,43 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMControllerFormmakerwdcaptcha {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
public function execute() {
|
| 22 |
-
$this->display();
|
| 23 |
-
}
|
| 24 |
-
|
| 25 |
-
public function display() {
|
| 26 |
-
require_once WD_FM_DIR . "/admin/models/FMModelFormmakerwdcaptcha.php";
|
| 27 |
-
$model = new FMModelFormmakerwdcaptcha();
|
| 28 |
-
|
| 29 |
-
require_once WD_FM_DIR . "/admin/views/FMViewFormmakerwdcaptcha.php";
|
| 30 |
-
$view = new FMViewFormmakerwdcaptcha($model);
|
| 31 |
-
$view->display();
|
| 32 |
-
}
|
| 33 |
-
|
| 34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
-
// Getters & Setters //
|
| 36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
-
// Private Methods //
|
| 39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
-
// Listeners //
|
| 42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMControllerFormmakerwdcaptcha {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
public function execute() {
|
| 22 |
+
$this->display();
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
public function display() {
|
| 26 |
+
require_once WD_FM_DIR . "/admin/models/FMModelFormmakerwdcaptcha.php";
|
| 27 |
+
$model = new FMModelFormmakerwdcaptcha();
|
| 28 |
+
|
| 29 |
+
require_once WD_FM_DIR . "/admin/views/FMViewFormmakerwdcaptcha.php";
|
| 30 |
+
$view = new FMViewFormmakerwdcaptcha($model);
|
| 31 |
+
$view->display();
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
+
// Getters & Setters //
|
| 36 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 37 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
+
// Private Methods //
|
| 39 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 40 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
+
// Listeners //
|
| 42 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
}
|
admin/controllers/FMControllerFormmakerwdmathcaptcha.php
CHANGED
|
@@ -1,43 +1,43 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMControllerFormmakerwdmathcaptcha {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
public function execute() {
|
| 22 |
-
$this->display();
|
| 23 |
-
}
|
| 24 |
-
|
| 25 |
-
public function display() {
|
| 26 |
-
require_once WD_FM_DIR . "/admin/models/FMModelFormmakerwdmathcaptcha.php";
|
| 27 |
-
$model = new FMModelFormmakerwdmathcaptcha();
|
| 28 |
-
|
| 29 |
-
require_once WD_FM_DIR . "/admin/views/FMViewFormmakerwdmathcaptcha.php";
|
| 30 |
-
$view = new FMViewFormmakerwdmathcaptcha($model);
|
| 31 |
-
$view->display();
|
| 32 |
-
}
|
| 33 |
-
|
| 34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
-
// Getters & Setters //
|
| 36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
-
// Private Methods //
|
| 39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
-
// Listeners //
|
| 42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMControllerFormmakerwdmathcaptcha {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
public function execute() {
|
| 22 |
+
$this->display();
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
public function display() {
|
| 26 |
+
require_once WD_FM_DIR . "/admin/models/FMModelFormmakerwdmathcaptcha.php";
|
| 27 |
+
$model = new FMModelFormmakerwdmathcaptcha();
|
| 28 |
+
|
| 29 |
+
require_once WD_FM_DIR . "/admin/views/FMViewFormmakerwdmathcaptcha.php";
|
| 30 |
+
$view = new FMViewFormmakerwdmathcaptcha($model);
|
| 31 |
+
$view->display();
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
+
// Getters & Setters //
|
| 36 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 37 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
+
// Private Methods //
|
| 39 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 40 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
+
// Listeners //
|
| 42 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
}
|
admin/controllers/FMControllerFormmakerwindow.php
CHANGED
|
@@ -1,43 +1,43 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMControllerFormmakerwindow {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
public function execute() {
|
| 22 |
-
$this->display();
|
| 23 |
-
}
|
| 24 |
-
|
| 25 |
-
public function display() {
|
| 26 |
-
require_once WD_FM_DIR . "/admin/models/FMModelFormmakerwindow.php";
|
| 27 |
-
$model = new FMModelFormmakerwindow();
|
| 28 |
-
|
| 29 |
-
require_once WD_FM_DIR . "/admin/views/FMViewFormmakerwindow.php";
|
| 30 |
-
$view = new FMViewFormmakerwindow($model);
|
| 31 |
-
$view->display();
|
| 32 |
-
}
|
| 33 |
-
|
| 34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
-
// Getters & Setters //
|
| 36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
-
// Private Methods //
|
| 39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
-
// Listeners //
|
| 42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMControllerFormmakerwindow {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
public function execute() {
|
| 22 |
+
$this->display();
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
public function display() {
|
| 26 |
+
require_once WD_FM_DIR . "/admin/models/FMModelFormmakerwindow.php";
|
| 27 |
+
$model = new FMModelFormmakerwindow();
|
| 28 |
+
|
| 29 |
+
require_once WD_FM_DIR . "/admin/views/FMViewFormmakerwindow.php";
|
| 30 |
+
$view = new FMViewFormmakerwindow($model);
|
| 31 |
+
$view->display();
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
+
// Getters & Setters //
|
| 36 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 37 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
+
// Private Methods //
|
| 39 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 40 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
+
// Listeners //
|
| 42 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
}
|
admin/controllers/FMControllerFromeditcountryinpopup.php
CHANGED
|
@@ -1,43 +1,43 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMControllerFromeditcountryinpopup {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
public function execute() {
|
| 22 |
-
$this->display();
|
| 23 |
-
}
|
| 24 |
-
|
| 25 |
-
public function display() {
|
| 26 |
-
require_once WD_FM_DIR . "/admin/models/FMModelFromeditcountryinpopup.php";
|
| 27 |
-
$model = new FMModelFromeditcountryinpopup();
|
| 28 |
-
|
| 29 |
-
require_once WD_FM_DIR . "/admin/views/FMViewFromeditcountryinpopup.php";
|
| 30 |
-
$view = new FMViewFromeditcountryinpopup($model);
|
| 31 |
-
$view->display();
|
| 32 |
-
}
|
| 33 |
-
|
| 34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
-
// Getters & Setters //
|
| 36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
-
// Private Methods //
|
| 39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
-
// Listeners //
|
| 42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMControllerFromeditcountryinpopup {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
public function execute() {
|
| 22 |
+
$this->display();
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
public function display() {
|
| 26 |
+
require_once WD_FM_DIR . "/admin/models/FMModelFromeditcountryinpopup.php";
|
| 27 |
+
$model = new FMModelFromeditcountryinpopup();
|
| 28 |
+
|
| 29 |
+
require_once WD_FM_DIR . "/admin/views/FMViewFromeditcountryinpopup.php";
|
| 30 |
+
$view = new FMViewFromeditcountryinpopup($model);
|
| 31 |
+
$view->display();
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
+
// Getters & Setters //
|
| 36 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 37 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
+
// Private Methods //
|
| 39 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 40 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
+
// Listeners //
|
| 42 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
}
|
admin/controllers/FMControllerFromipinfoinpopup.php
CHANGED
|
@@ -1,43 +1,43 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMControllerFromipinfoinpopup {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
public function execute() {
|
| 22 |
-
$this->display();
|
| 23 |
-
}
|
| 24 |
-
|
| 25 |
-
public function display() {
|
| 26 |
-
require_once WD_FM_DIR . "/admin/models/FMModelFromipinfoinpopup.php";
|
| 27 |
-
$model = new FMModelFromipinfoinpopup();
|
| 28 |
-
|
| 29 |
-
require_once WD_FM_DIR . "/admin/views/FMViewFromipinfoinpopup.php";
|
| 30 |
-
$view = new FMViewFromipinfoinpopup($model);
|
| 31 |
-
$view->display();
|
| 32 |
-
}
|
| 33 |
-
|
| 34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
-
// Getters & Setters //
|
| 36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
-
// Private Methods //
|
| 39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
-
// Listeners //
|
| 42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMControllerFromipinfoinpopup {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
public function execute() {
|
| 22 |
+
$this->display();
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
public function display() {
|
| 26 |
+
require_once WD_FM_DIR . "/admin/models/FMModelFromipinfoinpopup.php";
|
| 27 |
+
$model = new FMModelFromipinfoinpopup();
|
| 28 |
+
|
| 29 |
+
require_once WD_FM_DIR . "/admin/views/FMViewFromipinfoinpopup.php";
|
| 30 |
+
$view = new FMViewFromipinfoinpopup($model);
|
| 31 |
+
$view->display();
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
+
// Getters & Setters //
|
| 36 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 37 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
+
// Private Methods //
|
| 39 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 40 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
+
// Listeners //
|
| 42 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
}
|
admin/controllers/FMControllerFrommapeditinpopup.php
CHANGED
|
@@ -1,43 +1,43 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMControllerFrommapeditinpopup {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
public function execute() {
|
| 22 |
-
$this->display();
|
| 23 |
-
}
|
| 24 |
-
|
| 25 |
-
public function display() {
|
| 26 |
-
require_once WD_FM_DIR . "/admin/models/FMModelFrommapeditinpopup.php";
|
| 27 |
-
$model = new FMModelFrommapeditinpopup();
|
| 28 |
-
|
| 29 |
-
require_once WD_FM_DIR . "/admin/views/FMViewFrommapeditinpopup.php";
|
| 30 |
-
$view = new FMViewFrommapeditinpopup($model);
|
| 31 |
-
$view->display();
|
| 32 |
-
}
|
| 33 |
-
|
| 34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
-
// Getters & Setters //
|
| 36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
-
// Private Methods //
|
| 39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
-
// Listeners //
|
| 42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMControllerFrommapeditinpopup {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
public function execute() {
|
| 22 |
+
$this->display();
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
public function display() {
|
| 26 |
+
require_once WD_FM_DIR . "/admin/models/FMModelFrommapeditinpopup.php";
|
| 27 |
+
$model = new FMModelFrommapeditinpopup();
|
| 28 |
+
|
| 29 |
+
require_once WD_FM_DIR . "/admin/views/FMViewFrommapeditinpopup.php";
|
| 30 |
+
$view = new FMViewFrommapeditinpopup($model);
|
| 31 |
+
$view->display();
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
+
// Getters & Setters //
|
| 36 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 37 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
+
// Private Methods //
|
| 39 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 40 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
+
// Listeners //
|
| 42 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
}
|
admin/controllers/FMControllerGenerete_csv.php
CHANGED
|
@@ -1,43 +1,43 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMControllerGenerete_csv {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
public function execute() {
|
| 22 |
-
$this->display();
|
| 23 |
-
}
|
| 24 |
-
|
| 25 |
-
public function display() {
|
| 26 |
-
require_once WD_FM_DIR . "/admin/models/FMModelGenerete_csv.php";
|
| 27 |
-
$model = new FMModelGenerete_csv();
|
| 28 |
-
|
| 29 |
-
require_once WD_FM_DIR . "/admin/views/FMViewGenerete_csv.php";
|
| 30 |
-
$view = new FMViewGenerete_csv($model);
|
| 31 |
-
$view->display();
|
| 32 |
-
}
|
| 33 |
-
|
| 34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
-
// Getters & Setters //
|
| 36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
-
// Private Methods //
|
| 39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
-
// Listeners //
|
| 42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMControllerGenerete_csv {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
public function execute() {
|
| 22 |
+
$this->display();
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
public function display() {
|
| 26 |
+
require_once WD_FM_DIR . "/admin/models/FMModelGenerete_csv.php";
|
| 27 |
+
$model = new FMModelGenerete_csv();
|
| 28 |
+
|
| 29 |
+
require_once WD_FM_DIR . "/admin/views/FMViewGenerete_csv.php";
|
| 30 |
+
$view = new FMViewGenerete_csv($model);
|
| 31 |
+
$view->display();
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
+
// Getters & Setters //
|
| 36 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 37 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
+
// Private Methods //
|
| 39 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 40 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
+
// Listeners //
|
| 42 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
}
|
admin/controllers/FMControllerGenerete_xml.php
CHANGED
|
@@ -1,43 +1,43 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMControllerGenerete_xml {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
public function execute() {
|
| 22 |
-
$this->display();
|
| 23 |
-
}
|
| 24 |
-
|
| 25 |
-
public function display() {
|
| 26 |
-
require_once WD_FM_DIR . "/admin/models/FMModelGenerete_xml.php";
|
| 27 |
-
$model = new FMModelGenerete_xml();
|
| 28 |
-
|
| 29 |
-
require_once WD_FM_DIR . "/admin/views/FMViewGenerete_xml.php";
|
| 30 |
-
$view = new FMViewGenerete_xml($model);
|
| 31 |
-
$view->display();
|
| 32 |
-
}
|
| 33 |
-
|
| 34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
-
// Getters & Setters //
|
| 36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
-
// Private Methods //
|
| 39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
-
// Listeners //
|
| 42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMControllerGenerete_xml {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
public function execute() {
|
| 22 |
+
$this->display();
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
public function display() {
|
| 26 |
+
require_once WD_FM_DIR . "/admin/models/FMModelGenerete_xml.php";
|
| 27 |
+
$model = new FMModelGenerete_xml();
|
| 28 |
+
|
| 29 |
+
require_once WD_FM_DIR . "/admin/views/FMViewGenerete_xml.php";
|
| 30 |
+
$view = new FMViewGenerete_xml($model);
|
| 31 |
+
$view->display();
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
+
// Getters & Setters //
|
| 36 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 37 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
+
// Private Methods //
|
| 39 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 40 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
+
// Listeners //
|
| 42 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
}
|
admin/controllers/FMControllerGoptions_fm.php
CHANGED
|
@@ -1,44 +1,44 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMControllerGoptions_fm {
|
| 4 |
-
public function execute() {
|
| 5 |
-
$task = WDW_FM_Library::get('task');
|
| 6 |
-
$id = (int)WDW_FM_Library::get('current_id', 0);
|
| 7 |
-
$message = WDW_FM_Library::get('message');
|
| 8 |
-
echo WDW_FM_Library::message_id($message);
|
| 9 |
-
if (method_exists($this, $task)) {
|
| 10 |
-
check_admin_referer('nonce_fm', 'nonce_fm');
|
| 11 |
-
$this->$task($id);
|
| 12 |
-
}
|
| 13 |
-
else {
|
| 14 |
-
$this->display();
|
| 15 |
-
}
|
| 16 |
-
}
|
| 17 |
-
|
| 18 |
-
public function display() {
|
| 19 |
-
require_once WD_FM_DIR . "/admin/models/FMModelGoptions_fm.php";
|
| 20 |
-
$model = new FMModelGoptions_fm();
|
| 21 |
-
|
| 22 |
-
require_once WD_FM_DIR . "/admin/views/FMViewGoptions_fm.php";
|
| 23 |
-
$view = new FMViewGoptions_fm($model);
|
| 24 |
-
$view->display();
|
| 25 |
-
}
|
| 26 |
-
|
| 27 |
-
public function save() {
|
| 28 |
-
$message = $this->save_db();
|
| 29 |
-
$page = WDW_FM_Library::get('page');
|
| 30 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 31 |
-
}
|
| 32 |
-
|
| 33 |
-
public function save_db() {
|
| 34 |
-
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
| 35 |
-
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
| 36 |
-
$csv_delimiter = (isset($_POST['csv_delimiter']) && $_POST['csv_delimiter'] != '' ? esc_html(stripslashes($_POST['csv_delimiter'])) : ',');
|
| 37 |
-
$fm_shortcode = (isset($_POST['fm_shortcode']) ? "old" : '');
|
| 38 |
-
$fm_advanced_layout = (isset($_POST['fm_advanced_layout']) ? '1' : '');
|
| 39 |
-
|
| 40 |
-
$map_key = (isset($_POST['map_key']) ? esc_html(stripslashes($_POST['map_key'])) : '');
|
| 41 |
-
update_option('fm_settings', array('public_key' => $public_key, 'private_key' => $private_key, 'csv_delimiter' => $csv_delimiter, 'map_key' => $map_key, 'fm_shortcode' => $fm_shortcode, 'fm_advanced_layout' => $fm_advanced_layout,));
|
| 42 |
-
}
|
| 43 |
-
|
| 44 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMControllerGoptions_fm {
|
| 4 |
+
public function execute() {
|
| 5 |
+
$task = WDW_FM_Library::get('task');
|
| 6 |
+
$id = (int)WDW_FM_Library::get('current_id', 0);
|
| 7 |
+
$message = WDW_FM_Library::get('message');
|
| 8 |
+
echo WDW_FM_Library::message_id($message);
|
| 9 |
+
if (method_exists($this, $task)) {
|
| 10 |
+
check_admin_referer('nonce_fm', 'nonce_fm');
|
| 11 |
+
$this->$task($id);
|
| 12 |
+
}
|
| 13 |
+
else {
|
| 14 |
+
$this->display();
|
| 15 |
+
}
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
public function display() {
|
| 19 |
+
require_once WD_FM_DIR . "/admin/models/FMModelGoptions_fm.php";
|
| 20 |
+
$model = new FMModelGoptions_fm();
|
| 21 |
+
|
| 22 |
+
require_once WD_FM_DIR . "/admin/views/FMViewGoptions_fm.php";
|
| 23 |
+
$view = new FMViewGoptions_fm($model);
|
| 24 |
+
$view->display();
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
public function save() {
|
| 28 |
+
$message = $this->save_db();
|
| 29 |
+
$page = WDW_FM_Library::get('page');
|
| 30 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
public function save_db() {
|
| 34 |
+
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
| 35 |
+
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
| 36 |
+
$csv_delimiter = (isset($_POST['csv_delimiter']) && $_POST['csv_delimiter'] != '' ? esc_html(stripslashes($_POST['csv_delimiter'])) : ',');
|
| 37 |
+
$fm_shortcode = (isset($_POST['fm_shortcode']) ? "old" : '');
|
| 38 |
+
$fm_advanced_layout = (isset($_POST['fm_advanced_layout']) ? '1' : '');
|
| 39 |
+
|
| 40 |
+
$map_key = (isset($_POST['map_key']) ? esc_html(stripslashes($_POST['map_key'])) : '');
|
| 41 |
+
update_option('fm_settings', array('public_key' => $public_key, 'private_key' => $private_key, 'csv_delimiter' => $csv_delimiter, 'map_key' => $map_key, 'fm_shortcode' => $fm_shortcode, 'fm_advanced_layout' => $fm_advanced_layout,));
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
}
|
admin/controllers/FMControllerLicensing_fm.php
CHANGED
|
@@ -1,49 +1,49 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMControllerLicensing_fm {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
public function execute() {
|
| 22 |
-
$task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
|
| 23 |
-
if (method_exists($this, $task)) {
|
| 24 |
-
$this->$task($id);
|
| 25 |
-
}
|
| 26 |
-
else {
|
| 27 |
-
$this->display();
|
| 28 |
-
}
|
| 29 |
-
}
|
| 30 |
-
|
| 31 |
-
public function display() {
|
| 32 |
-
require_once WD_FM_DIR . "/admin/models/FMModelLicensing_fm.php";
|
| 33 |
-
$model = new FMModelLicensing_fm();
|
| 34 |
-
|
| 35 |
-
require_once WD_FM_DIR . "/admin/views/FMViewLicensing_fm.php";
|
| 36 |
-
$view = new FMViewLicensing_fm($model);
|
| 37 |
-
$view->display();
|
| 38 |
-
}
|
| 39 |
-
|
| 40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
-
// Getters & Setters //
|
| 42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 44 |
-
// Private Methods //
|
| 45 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 46 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 47 |
-
// Listeners //
|
| 48 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 49 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMControllerLicensing_fm {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
public function execute() {
|
| 22 |
+
$task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
|
| 23 |
+
if (method_exists($this, $task)) {
|
| 24 |
+
$this->$task($id);
|
| 25 |
+
}
|
| 26 |
+
else {
|
| 27 |
+
$this->display();
|
| 28 |
+
}
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
public function display() {
|
| 32 |
+
require_once WD_FM_DIR . "/admin/models/FMModelLicensing_fm.php";
|
| 33 |
+
$model = new FMModelLicensing_fm();
|
| 34 |
+
|
| 35 |
+
require_once WD_FM_DIR . "/admin/views/FMViewLicensing_fm.php";
|
| 36 |
+
$view = new FMViewLicensing_fm($model);
|
| 37 |
+
$view->display();
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
+
// Getters & Setters //
|
| 42 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 44 |
+
// Private Methods //
|
| 45 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 46 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 47 |
+
// Listeners //
|
| 48 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 49 |
}
|
admin/controllers/FMControllerManage_fm.php
CHANGED
|
@@ -1,1196 +1,1196 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMControllerManage_fm {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
public function execute() {
|
| 22 |
-
$task = WDW_FM_Library::get('task');
|
| 23 |
-
$id = (int)WDW_FM_Library::get('current_id', 0);
|
| 24 |
-
$message = WDW_FM_Library::get('message');
|
| 25 |
-
echo WDW_FM_Library::message_id($message);
|
| 26 |
-
if (method_exists($this, $task)) {
|
| 27 |
-
check_admin_referer('nonce_fm', 'nonce_fm');
|
| 28 |
-
$this->$task($id);
|
| 29 |
-
}
|
| 30 |
-
else {
|
| 31 |
-
$this->display();
|
| 32 |
-
}
|
| 33 |
-
}
|
| 34 |
-
|
| 35 |
-
public function undo() {
|
| 36 |
-
require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
| 37 |
-
$model = new FMModelManage_fm();
|
| 38 |
-
|
| 39 |
-
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
| 40 |
-
|
| 41 |
-
global $wpdb;
|
| 42 |
-
$backup_id = (int)WDW_FM_Library::get('backup_id');
|
| 43 |
-
$id = (int)WDW_FM_Library::get('id');
|
| 44 |
-
|
| 45 |
-
$query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id < $backup_id AND id = $id ORDER BY backup_id DESC LIMIT 0 , 1 ";
|
| 46 |
-
$backup_id = $wpdb->get_var($query);
|
| 47 |
-
|
| 48 |
-
$view = new FMViewManage_fm($model);
|
| 49 |
-
$view->edit($backup_id);
|
| 50 |
-
}
|
| 51 |
-
|
| 52 |
-
public function redo() {
|
| 53 |
-
require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
| 54 |
-
$model = new FMModelManage_fm();
|
| 55 |
-
|
| 56 |
-
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
| 57 |
-
global $wpdb;
|
| 58 |
-
$backup_id = (int)WDW_FM_Library::get('backup_id');
|
| 59 |
-
$id = (int)WDW_FM_Library::get('id');
|
| 60 |
-
|
| 61 |
-
$query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id > $backup_id AND id = $id ORDER BY backup_id ASC LIMIT 0 , 1 ";
|
| 62 |
-
$backup_id = $wpdb->get_var($query);
|
| 63 |
-
|
| 64 |
-
$view = new FMViewManage_fm($model);
|
| 65 |
-
$view->edit($backup_id);
|
| 66 |
-
}
|
| 67 |
-
|
| 68 |
-
public function display() {
|
| 69 |
-
require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
| 70 |
-
$model = new FMModelManage_fm();
|
| 71 |
-
|
| 72 |
-
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
| 73 |
-
$view = new FMViewManage_fm($model);
|
| 74 |
-
$view->display();
|
| 75 |
-
}
|
| 76 |
-
|
| 77 |
-
public function add() {
|
| 78 |
-
require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
| 79 |
-
$model = new FMModelManage_fm();
|
| 80 |
-
|
| 81 |
-
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
| 82 |
-
$view = new FMViewManage_fm($model);
|
| 83 |
-
$view->edit(0);
|
| 84 |
-
}
|
| 85 |
-
|
| 86 |
-
public function edit() {
|
| 87 |
-
require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
| 88 |
-
$model = new FMModelManage_fm();
|
| 89 |
-
|
| 90 |
-
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
| 91 |
-
$view = new FMViewManage_fm($model);
|
| 92 |
-
$id = (int)WDW_FM_Library::get('current_id', 0);
|
| 93 |
-
|
| 94 |
-
global $wpdb;
|
| 95 |
-
$query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE cur=1 and id=".$id;
|
| 96 |
-
$backup_id = $wpdb->get_var($query);
|
| 97 |
-
|
| 98 |
-
if(!$backup_id) {
|
| 99 |
-
$query = "SELECT max(backup_id) FROM ".$wpdb->prefix."formmaker_backup";
|
| 100 |
-
$backup_id = $wpdb->get_var($query);
|
| 101 |
-
if($backup_id)
|
| 102 |
-
$backup_id++;
|
| 103 |
-
else
|
| 104 |
-
$backup_id=1;
|
| 105 |
-
$query = "INSERT INTO ".$wpdb->prefix."formmaker_backup SELECT ".$backup_id." AS backup_id, 1 AS cur, formmakerbkup.id, formmakerbkup.title, formmakerbkup.type, formmakerbkup.mail, formmakerbkup.form_front, formmakerbkup.theme, formmakerbkup.javascript, formmakerbkup.submit_text, formmakerbkup.url, formmakerbkup.submit_text_type, formmakerbkup.script_mail, formmakerbkup.script_mail_user, formmakerbkup.counter, formmakerbkup.published, formmakerbkup.label_order, formmakerbkup.label_order_current, formmakerbkup.article_id, formmakerbkup.pagination, formmakerbkup.show_title, formmakerbkup.show_numbers, formmakerbkup.public_key, formmakerbkup.private_key, formmakerbkup.recaptcha_theme, formmakerbkup.paypal_mode, formmakerbkup.checkout_mode, formmakerbkup.paypal_email, formmakerbkup.payment_currency, formmakerbkup.tax, formmakerbkup.form_fields, formmakerbkup.savedb, formmakerbkup.sendemail, formmakerbkup.requiredmark, formmakerbkup.from_mail, formmakerbkup.from_name, formmakerbkup.reply_to, formmakerbkup.send_to, formmakerbkup.autogen_layout, formmakerbkup.custom_front, formmakerbkup.mail_from_user, formmakerbkup.mail_from_name_user, formmakerbkup.reply_to_user, formmakerbkup.condition, formmakerbkup.mail_cc, formmakerbkup.mail_cc_user, formmakerbkup.mail_bcc, formmakerbkup.mail_bcc_user, formmakerbkup.mail_subject, formmakerbkup.mail_subject_user, formmakerbkup.mail_mode, formmakerbkup.mail_mode_user, formmakerbkup.mail_attachment, formmakerbkup.mail_attachment_user, formmakerbkup.user_id_wd, formmakerbkup.sortable, formmakerbkup.frontend_submit_fields, formmakerbkup.frontend_submit_stat_fields, formmakerbkup.mail_emptyfields, formmakerbkup.mail_verify, formmakerbkup.mail_verify_expiretime, formmakerbkup.mail_verification_post_id, formmakerbkup.save_uploads, formmakerbkup.header_title, formmakerbkup.header_description, formmakerbkup.header_image_url, formmakerbkup.header_image_animation, formmakerbkup.header_hide_image FROM ".$wpdb->prefix."formmaker as formmakerbkup WHERE id=".$id;
|
| 106 |
-
$wpdb->query($query);
|
| 107 |
-
}
|
| 108 |
-
$view->edit($backup_id);
|
| 109 |
-
}
|
| 110 |
-
|
| 111 |
-
public function form_layout() {
|
| 112 |
-
if (!isset($_GET['task'])) {
|
| 113 |
-
$this->save_db();
|
| 114 |
-
}
|
| 115 |
-
require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
| 116 |
-
$model = new FMModelManage_fm();
|
| 117 |
-
|
| 118 |
-
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
| 119 |
-
$view = new FMViewManage_fm($model);
|
| 120 |
-
global $wpdb;
|
| 121 |
-
$id = (int)WDW_FM_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
|
| 122 |
-
$view->form_layout($id);
|
| 123 |
-
}
|
| 124 |
-
|
| 125 |
-
public function save_layout() {
|
| 126 |
-
$message = $this->save_db_layout();
|
| 127 |
-
$page = WDW_FM_Library::get('page');
|
| 128 |
-
$current_id = (int)WDW_FM_Library::get('current_id', 0);
|
| 129 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
| 130 |
-
}
|
| 131 |
-
|
| 132 |
-
public function apply_layout() {
|
| 133 |
-
$message = $this->save_db_layout();
|
| 134 |
-
$page = WDW_FM_Library::get('page');
|
| 135 |
-
$current_id = (int)WDW_FM_Library::get('current_id', 0);
|
| 136 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'form_layout', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
| 137 |
-
}
|
| 138 |
-
|
| 139 |
-
public function save_db_layout() {
|
| 140 |
-
global $wpdb;
|
| 141 |
-
$id = (int)WDW_FM_Library::get('current_id', 0);
|
| 142 |
-
$custom_front = (isset($_POST['custom_front']) ? stripslashes($_POST['custom_front']) : '');
|
| 143 |
-
$autogen_layout = (isset($_POST['autogen_layout']) ? 1 : 0);
|
| 144 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
| 145 |
-
'custom_front' => $custom_front,
|
| 146 |
-
'autogen_layout' => $autogen_layout
|
| 147 |
-
), array('id' => $id));
|
| 148 |
-
if ($save !== FALSE) {
|
| 149 |
-
return 1;
|
| 150 |
-
}
|
| 151 |
-
else {
|
| 152 |
-
return 2;
|
| 153 |
-
}
|
| 154 |
-
}
|
| 155 |
-
|
| 156 |
-
public function form_options() {
|
| 157 |
-
require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
| 158 |
-
$model = new FMModelManage_fm();
|
| 159 |
-
|
| 160 |
-
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
| 161 |
-
$view = new FMViewManage_fm($model);
|
| 162 |
-
|
| 163 |
-
global $wpdb;
|
| 164 |
-
$id = (int)WDW_FM_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
|
| 165 |
-
$view->form_options($id);
|
| 166 |
-
}
|
| 167 |
-
|
| 168 |
-
public function display_options() {
|
| 169 |
-
require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
| 170 |
-
$model = new FMModelManage_fm();
|
| 171 |
-
|
| 172 |
-
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
| 173 |
-
$view = new FMViewManage_fm($model);
|
| 174 |
-
|
| 175 |
-
global $wpdb;
|
| 176 |
-
$id = (int)WDW_FM_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
|
| 177 |
-
$view->display_options($id);
|
| 178 |
-
}
|
| 179 |
-
|
| 180 |
-
public function save_options() {
|
| 181 |
-
$message = $this->save_db_options();
|
| 182 |
-
// $this->edit();
|
| 183 |
-
$page = WDW_FM_Library::get('page');
|
| 184 |
-
$current_id = (int)WDW_FM_Library::get('current_id', 0);
|
| 185 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
| 186 |
-
}
|
| 187 |
-
|
| 188 |
-
public function save_display_options() {
|
| 189 |
-
$message = $this->save_dis_options();
|
| 190 |
-
$page = WDW_FM_Library::get('page');
|
| 191 |
-
$current_id = (int)WDW_FM_Library::get('current_id', 0);
|
| 192 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
| 193 |
-
}
|
| 194 |
-
|
| 195 |
-
public function view_options() {
|
| 196 |
-
if (!isset($_GET['task'])) {
|
| 197 |
-
$this->save_db();
|
| 198 |
-
}
|
| 199 |
-
global $wpdb;
|
| 200 |
-
$page = WDW_FM_Library::get('page');
|
| 201 |
-
$current_id = (int)WDW_FM_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
|
| 202 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'form_options', 'current_id' => $current_id), admin_url('admin.php')));
|
| 203 |
-
}
|
| 204 |
-
|
| 205 |
-
public function view_display_options() {
|
| 206 |
-
if (!isset($_GET['task'])) {
|
| 207 |
-
$this->save_db();
|
| 208 |
-
}
|
| 209 |
-
global $wpdb;
|
| 210 |
-
$page = WDW_FM_Library::get('page');
|
| 211 |
-
$current_id = (int)WDW_FM_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
|
| 212 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display_options', 'current_id' => $current_id), admin_url('admin.php')));
|
| 213 |
-
}
|
| 214 |
-
|
| 215 |
-
public function apply_options() {
|
| 216 |
-
$message = $this->save_db_options();
|
| 217 |
-
$page = WDW_FM_Library::get('page');
|
| 218 |
-
$current_id = (int)WDW_FM_Library::get('current_id', 0);
|
| 219 |
-
$fieldset_id = WDW_FM_Library::get('fieldset_id', 'general');
|
| 220 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'form_options', 'current_id' => $current_id, 'message' => $message, 'fieldset_id' => $fieldset_id), admin_url('admin.php')));
|
| 221 |
-
}
|
| 222 |
-
|
| 223 |
-
public function apply_display_options() {
|
| 224 |
-
$message = $this->save_dis_options();
|
| 225 |
-
$page = WDW_FM_Library::get('page');
|
| 226 |
-
$current_id = (int)WDW_FM_Library::get('current_id', 0);
|
| 227 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display_options', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
| 228 |
-
}
|
| 229 |
-
|
| 230 |
-
public function remove_query() {
|
| 231 |
-
global $wpdb;
|
| 232 |
-
$cid = ((isset($_POST['cid']) && $_POST['cid'] != '') ? $_POST['cid'] : NULL);
|
| 233 |
-
if (count($cid)) {
|
| 234 |
-
array_walk($cid, create_function('&$value', '$value = (int)$value;'));
|
| 235 |
-
$cids = implode(',', $cid);
|
| 236 |
-
$query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_query WHERE id IN ( ' . $cids . ' )';
|
| 237 |
-
if ($wpdb->query($query)) {
|
| 238 |
-
echo WDW_FM_Library::message('Items Succesfully Deleted.', 'updated');
|
| 239 |
-
}
|
| 240 |
-
else {
|
| 241 |
-
echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
|
| 242 |
-
}
|
| 243 |
-
}
|
| 244 |
-
else {
|
| 245 |
-
echo WDW_FM_Library::message('You must select at least one item.', 'error');
|
| 246 |
-
}
|
| 247 |
-
$this->apply_options();
|
| 248 |
-
}
|
| 249 |
-
|
| 250 |
-
public function cancel_options() {
|
| 251 |
-
$this->edit();
|
| 252 |
-
}
|
| 253 |
-
|
| 254 |
-
public function save_db_options() {
|
| 255 |
-
$javascript = "// Occurs before the form is loaded
|
| 256 |
-
function before_load() {
|
| 257 |
-
|
| 258 |
-
}
|
| 259 |
-
// Occurs just before submitting the form
|
| 260 |
-
function before_submit() {
|
| 261 |
-
// IMPORTANT! If you want to interrupt (stop) the submitting of the form, this function should return true. You don't need to return any value if you don't want to stop the submission.
|
| 262 |
-
}
|
| 263 |
-
// Occurs just before resetting the form
|
| 264 |
-
function before_reset() {
|
| 265 |
-
|
| 266 |
-
}";
|
| 267 |
-
global $wpdb;
|
| 268 |
-
// $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
|
| 269 |
-
$id = (int)WDW_FM_Library::get('current_id', 0);
|
| 270 |
-
$published = (isset($_POST['published']) ? esc_html(stripslashes($_POST['published'])) : 1);
|
| 271 |
-
$savedb = (isset($_POST['savedb']) ? esc_html(stripslashes($_POST['savedb'])) : 1);
|
| 272 |
-
$theme = (int)(
|
| 273 |
-
$requiredmark = (isset($_POST['requiredmark']) ? esc_html(stripslashes($_POST['requiredmark'])) : '*');
|
| 274 |
-
$sendemail = (isset($_POST['sendemail']) ? esc_html(stripslashes($_POST['sendemail'])) : 1);
|
| 275 |
-
$save_uploads = (isset($_POST['save_uploads']) ? esc_html(stripslashes($_POST['save_uploads'])) : 1);
|
| 276 |
-
$mail = (isset($_POST['mail']) ? esc_html(stripslashes($_POST['mail'])) : '');
|
| 277 |
-
if (isset($_POST['mailToAdd']) && esc_html(stripslashes($_POST['mailToAdd'])) != '') {
|
| 278 |
-
$mail .= esc_html(stripslashes($_POST['mailToAdd'])) . ',';
|
| 279 |
-
}
|
| 280 |
-
$from_mail = (isset($_POST['from_mail']) ? esc_html(stripslashes($_POST['from_mail'])) : '');
|
| 281 |
-
$from_name = (isset($_POST['from_name']) ? esc_html(stripslashes($_POST['from_name'])) : '');
|
| 282 |
-
$reply_to = (isset($_POST['reply_to']) ? esc_html(stripslashes($_POST['reply_to'])) : '');
|
| 283 |
-
if ($from_mail == "other") {
|
| 284 |
-
$from_mail = (isset($_POST['mail_from_other']) ? esc_html(stripslashes($_POST['mail_from_other'])) : '');
|
| 285 |
-
}
|
| 286 |
-
if ($reply_to == "other") {
|
| 287 |
-
$reply_to = (isset($_POST['reply_to_other']) ? esc_html(stripslashes($_POST['reply_to_other'])) : '');
|
| 288 |
-
}
|
| 289 |
-
$script_mail = (isset($_POST['script_mail']) ? stripslashes($_POST['script_mail']) : '%all%');
|
| 290 |
-
$mail_from_user = (isset($_POST['mail_from_user']) ? esc_html(stripslashes($_POST['mail_from_user'])) : '');
|
| 291 |
-
$mail_from_name_user = (isset($_POST['mail_from_name_user']) ? esc_html(stripslashes($_POST['mail_from_name_user'])) : '');
|
| 292 |
-
$reply_to_user = (isset($_POST['reply_to_user']) ? esc_html(stripslashes($_POST['reply_to_user'])) : '');
|
| 293 |
-
$condition = (isset($_POST['condition']) ? esc_html(stripslashes($_POST['condition'])) : '');
|
| 294 |
-
$mail_cc = (isset($_POST['mail_cc']) ? esc_html(stripslashes($_POST['mail_cc'])) : '');
|
| 295 |
-
$mail_cc_user = (isset($_POST['mail_cc_user']) ? esc_html(stripslashes($_POST['mail_cc_user'])) : '');
|
| 296 |
-
$mail_bcc = (isset($_POST['mail_bcc']) ? esc_html(stripslashes($_POST['mail_bcc'])) : '');
|
| 297 |
-
$mail_bcc_user = (isset($_POST['mail_bcc_user']) ? esc_html(stripslashes($_POST['mail_bcc_user'])) : '');
|
| 298 |
-
$mail_subject = (isset($_POST['mail_subject']) ? esc_html(stripslashes($_POST['mail_subject'])) : '');
|
| 299 |
-
$mail_subject_user = (isset($_POST['mail_subject_user']) ? esc_html(stripslashes($_POST['mail_subject_user'])) : '');
|
| 300 |
-
$mail_mode = (isset($_POST['mail_mode']) ? esc_html(stripslashes($_POST['mail_mode'])) : 1);
|
| 301 |
-
$mail_mode_user = (isset($_POST['mail_mode_user']) ? esc_html(stripslashes($_POST['mail_mode_user'])) : 1);
|
| 302 |
-
$mail_attachment = (isset($_POST['mail_attachment']) ? esc_html(stripslashes($_POST['mail_attachment'])) : 1);
|
| 303 |
-
$mail_attachment_user = (isset($_POST['mail_attachment_user']) ? esc_html(stripslashes($_POST['mail_attachment_user'])) : 1);
|
| 304 |
-
$script_mail_user = (isset($_POST['script_mail_user']) ? stripslashes($_POST['script_mail_user']) : '%all%');
|
| 305 |
-
$submit_text = (isset($_POST['submit_text']) ? stripslashes($_POST['submit_text']) : '');
|
| 306 |
-
$url = (isset($_POST['url']) ? esc_html(stripslashes($_POST['url'])) : '');
|
| 307 |
-
$tax = (isset($_POST['tax']) ? esc_html(stripslashes($_POST['tax'])) : 0);
|
| 308 |
-
$payment_currency = (isset($_POST['payment_currency']) ? stripslashes($_POST['payment_currency']) : '');
|
| 309 |
-
$paypal_email = (isset($_POST['paypal_email']) ? esc_html(stripslashes($_POST['paypal_email'])) : '');
|
| 310 |
-
$checkout_mode = (isset($_POST['checkout_mode']) ? esc_html(stripslashes($_POST['checkout_mode'])) : 'testmode');
|
| 311 |
-
$paypal_mode = (isset($_POST['paypal_mode']) ? esc_html(stripslashes($_POST['paypal_mode'])) : 0);
|
| 312 |
-
$javascript = (isset($_POST['javascript']) ? stripslashes($_POST['javascript']) : $javascript);
|
| 313 |
-
$user_id_wd = (isset($_POST['user_id_wd']) ? stripslashes($_POST['user_id_wd']) : 'administrator,');
|
| 314 |
-
$frontend_submit_fields = (isset($_POST['frontend_submit_fields']) ? stripslashes($_POST['frontend_submit_fields']) : '');
|
| 315 |
-
$frontend_submit_stat_fields = (isset($_POST['frontend_submit_stat_fields']) ? stripslashes($_POST['frontend_submit_stat_fields']) : '');
|
| 316 |
-
$mail_emptyfields = (isset($_POST['mail_emptyfields']) ? esc_html(stripslashes($_POST['mail_emptyfields'])) : 0);
|
| 317 |
-
$mail_verify = (isset($_POST['mail_verify']) ? esc_html(stripslashes($_POST['mail_verify'])) : 0);
|
| 318 |
-
$mail_verify_expiretime = (isset($_POST['mail_verify_expiretime']) ? esc_html(stripslashes($_POST['mail_verify_expiretime'])) : '');
|
| 319 |
-
$send_to = '';
|
| 320 |
-
for ($i = 0; $i < 20; $i++) {
|
| 321 |
-
if (isset($_POST['send_to' . $i])) {
|
| 322 |
-
$send_to .= '*' . esc_html(stripslashes($_POST['send_to' . $i])) . '*';
|
| 323 |
-
}
|
| 324 |
-
}
|
| 325 |
-
if (isset($_POST['submit_text_type'])) {
|
| 326 |
-
$submit_text_type = esc_html(stripslashes($_POST['submit_text_type']));
|
| 327 |
-
if ($submit_text_type == 5) {
|
| 328 |
-
$article_id = (isset($_POST['page_name']) ? esc_html(stripslashes($_POST['page_name'])) : 0);
|
| 329 |
-
}
|
| 330 |
-
else {
|
| 331 |
-
$article_id = (isset($_POST['post_name']) ? esc_html(stripslashes($_POST['post_name'])) : 0);
|
| 332 |
-
}
|
| 333 |
-
}
|
| 334 |
-
else {
|
| 335 |
-
$submit_text_type = 1;
|
| 336 |
-
$article_id = 0;
|
| 337 |
-
}
|
| 338 |
-
|
| 339 |
-
$mail_verification_post_id = (int)$wpdb->get_var('SELECT mail_verification_post_id FROM ' . $wpdb->prefix . 'formmaker WHERE mail_verification_post_id!=0');
|
| 340 |
-
if($mail_verify) {
|
| 341 |
-
$email_verification_post = array(
|
| 342 |
-
'post_title' => 'Email Verification',
|
| 343 |
-
'post_content' => '[email_verification]',
|
| 344 |
-
'post_status' => 'publish',
|
| 345 |
-
'post_author' => 1,
|
| 346 |
-
'post_type' => 'fmemailverification',
|
| 347 |
-
);
|
| 348 |
-
|
| 349 |
-
if(!$mail_verification_post_id || get_post( $mail_verification_post_id )===NULL)
|
| 350 |
-
$mail_verification_post_id = wp_insert_post( $email_verification_post );
|
| 351 |
-
}
|
| 352 |
-
$paypal_mode = $paypal_mode == 'paypal' ? 1 : 0;
|
| 353 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
| 354 |
-
'published' => $published,
|
| 355 |
-
'savedb' => $savedb,
|
| 356 |
-
'theme' => $theme,
|
| 357 |
-
'requiredmark' => $requiredmark,
|
| 358 |
-
'sendemail' => $sendemail,
|
| 359 |
-
'save_uploads' => $save_uploads,
|
| 360 |
-
'mail' => $mail,
|
| 361 |
-
'from_mail' => $from_mail,
|
| 362 |
-
'from_name' => $from_name,
|
| 363 |
-
'reply_to' => $reply_to,
|
| 364 |
-
'script_mail' => $script_mail,
|
| 365 |
-
'mail_from_user' => $mail_from_user,
|
| 366 |
-
'mail_from_name_user' => $mail_from_name_user,
|
| 367 |
-
'reply_to_user' => $reply_to_user,
|
| 368 |
-
'condition' => $condition,
|
| 369 |
-
'mail_cc' => $mail_cc,
|
| 370 |
-
'mail_cc_user' => $mail_cc_user,
|
| 371 |
-
'mail_bcc' => $mail_bcc,
|
| 372 |
-
'mail_bcc_user' => $mail_bcc_user,
|
| 373 |
-
'mail_subject' => $mail_subject,
|
| 374 |
-
'mail_subject_user' => $mail_subject_user,
|
| 375 |
-
'mail_mode' => $mail_mode,
|
| 376 |
-
'mail_mode_user' => $mail_mode_user,
|
| 377 |
-
'mail_attachment' => $mail_attachment,
|
| 378 |
-
'mail_attachment_user' => $mail_attachment_user,
|
| 379 |
-
'script_mail_user' => $script_mail_user,
|
| 380 |
-
'submit_text' => $submit_text,
|
| 381 |
-
'url' => $url,
|
| 382 |
-
'submit_text_type' => $submit_text_type,
|
| 383 |
-
'article_id' => $article_id,
|
| 384 |
-
'tax' => $tax,
|
| 385 |
-
'payment_currency' => $payment_currency,
|
| 386 |
-
'paypal_email' => $paypal_email,
|
| 387 |
-
'checkout_mode' => $checkout_mode,
|
| 388 |
-
'paypal_mode' => $paypal_mode,
|
| 389 |
-
'javascript' => $javascript,
|
| 390 |
-
'user_id_wd' => $user_id_wd,
|
| 391 |
-
'send_to' => $send_to,
|
| 392 |
-
'frontend_submit_fields' => $frontend_submit_fields,
|
| 393 |
-
'frontend_submit_stat_fields' => $frontend_submit_stat_fields,
|
| 394 |
-
'mail_emptyfields' => $mail_emptyfields,
|
| 395 |
-
'mail_verify' => $mail_verify,
|
| 396 |
-
'mail_verify_expiretime' => $mail_verify_expiretime,
|
| 397 |
-
'mail_verification_post_id' => $mail_verification_post_id,
|
| 398 |
-
), array('id' => $id));
|
| 399 |
-
if ($save !== FALSE) {
|
| 400 |
-
$save_theme_in_backup = $wpdb->update($wpdb->prefix . 'formmaker_backup', array(
|
| 401 |
-
'theme' => $theme
|
| 402 |
-
), array('id' => $id));
|
| 403 |
-
return 8;
|
| 404 |
-
}
|
| 405 |
-
else {
|
| 406 |
-
return 2;
|
| 407 |
-
}
|
| 408 |
-
}
|
| 409 |
-
|
| 410 |
-
public function save_dis_options() {
|
| 411 |
-
global $wpdb;
|
| 412 |
-
$id = (int)WDW_FM_Library::get('current_id', 0);
|
| 413 |
-
$scrollbox_loading_delay = (isset($_POST['scrollbox_loading_delay']) ? esc_html(stripslashes($_POST['scrollbox_loading_delay'])) : 0);
|
| 414 |
-
$popover_animate_effect = (isset($_POST['popover_animate_effect']) ? esc_html(stripslashes($_POST['popover_animate_effect'])) : '');
|
| 415 |
-
$popover_loading_delay = (isset($_POST['popover_loading_delay']) ? esc_html(stripslashes($_POST['popover_loading_delay'])) : 0);
|
| 416 |
-
$popover_frequency = (isset($_POST['popover_frequency']) ? esc_html(stripslashes($_POST['popover_frequency'])) : 0);
|
| 417 |
-
$topbar_position = (isset($_POST['topbar_position']) ? esc_html(stripslashes($_POST['topbar_position'])) : 1);
|
| 418 |
-
$topbar_remain_top = (isset($_POST['topbar_remain_top']) ? esc_html(stripslashes($_POST['topbar_remain_top'])) : 1);
|
| 419 |
-
$topbar_closing = (isset($_POST['topbar_closing']) ? esc_html(stripslashes($_POST['topbar_closing'])) : 1);
|
| 420 |
-
$topbar_hide_duration = (isset($_POST['topbar_hide_duration']) ? esc_html(stripslashes($_POST['topbar_hide_duration'])) : 0);
|
| 421 |
-
$scrollbox_position = (isset($_POST['scrollbox_position']) ? esc_html(stripslashes($_POST['scrollbox_position'])) : 1);
|
| 422 |
-
$scrollbox_trigger_point = (isset($_POST['scrollbox_trigger_point']) ? esc_html(stripslashes($_POST['scrollbox_trigger_point'])) : 20);
|
| 423 |
-
$scrollbox_hide_duration = (isset($_POST['scrollbox_hide_duration']) ? esc_html(stripslashes($_POST['scrollbox_hide_duration'])) : 0);
|
| 424 |
-
$scrollbox_auto_hide = (isset($_POST['scrollbox_auto_hide']) ? esc_html(stripslashes($_POST['scrollbox_auto_hide'])) :1);
|
| 425 |
-
$hide_mobile = (isset($_POST['hide_mobile']) ? esc_html(stripslashes($_POST['hide_mobile'])) : 0);
|
| 426 |
-
$scrollbox_closing = (isset($_POST['scrollbox_closing']) ? esc_html(stripslashes($_POST['scrollbox_closing'])) : 1);
|
| 427 |
-
$scrollbox_minimize = (isset($_POST['scrollbox_minimize']) ? esc_html(stripslashes($_POST['scrollbox_minimize'])) : 1);
|
| 428 |
-
$scrollbox_minimize_text = (isset($_POST['scrollbox_minimize_text']) ? esc_html(stripslashes($_POST['scrollbox_minimize_text'])) : '');
|
| 429 |
-
|
| 430 |
-
$type = (isset($_POST['form_type']) ? esc_html(stripslashes($_POST['form_type'])) : 'embadded');
|
| 431 |
-
$display_on = (isset($_POST['display_on']) ? esc_html(implode(',', $_POST['display_on'])) : '');
|
| 432 |
-
$posts_include = (isset($_POST['posts_include']) ? esc_html(stripslashes($_POST['posts_include'])) : '');
|
| 433 |
-
$pages_include = (isset($_POST['pages_include']) ? esc_html(stripslashes($_POST['pages_include'])) : '');
|
| 434 |
-
$display_on_categories = (isset($_POST['display_on_categories']) ? esc_html(implode(',', $_POST['display_on_categories'])) : '');
|
| 435 |
-
$current_categories = (isset($_POST['current_categories']) ? esc_html(stripslashes($_POST['current_categories'])) : '');
|
| 436 |
-
$show_for_admin = (isset($_POST['show_for_admin']) ? esc_html(stripslashes($_POST['show_for_admin'])) : 0);
|
| 437 |
-
|
| 438 |
-
$save = $wpdb->replace($wpdb->prefix . 'formmaker_display_options', array(
|
| 439 |
-
'form_id' => $id,
|
| 440 |
-
'type' => $type,
|
| 441 |
-
'scrollbox_loading_delay' => $scrollbox_loading_delay,
|
| 442 |
-
'popover_animate_effect' => $popover_animate_effect,
|
| 443 |
-
'popover_loading_delay' => $popover_loading_delay,
|
| 444 |
-
'popover_frequency' => $popover_frequency,
|
| 445 |
-
'topbar_position' => $topbar_position,
|
| 446 |
-
'topbar_remain_top' => $topbar_remain_top,
|
| 447 |
-
'topbar_closing' => $topbar_closing,
|
| 448 |
-
'topbar_hide_duration' => $topbar_hide_duration,
|
| 449 |
-
'scrollbox_position' => $scrollbox_position,
|
| 450 |
-
'scrollbox_trigger_point' => $scrollbox_trigger_point,
|
| 451 |
-
'scrollbox_hide_duration' => $scrollbox_hide_duration,
|
| 452 |
-
'scrollbox_auto_hide' => $scrollbox_auto_hide,
|
| 453 |
-
'hide_mobile' => $hide_mobile,
|
| 454 |
-
'scrollbox_closing' => $scrollbox_closing,
|
| 455 |
-
'scrollbox_minimize' => $scrollbox_minimize,
|
| 456 |
-
'scrollbox_minimize_text' => $scrollbox_minimize_text,
|
| 457 |
-
'display_on' => $display_on,
|
| 458 |
-
'posts_include' => $posts_include,
|
| 459 |
-
'pages_include' => $pages_include,
|
| 460 |
-
'display_on_categories' => $display_on_categories,
|
| 461 |
-
'current_categories' => $current_categories,
|
| 462 |
-
'show_for_admin' => $show_for_admin,
|
| 463 |
-
));
|
| 464 |
-
|
| 465 |
-
if ($save !== FALSE) {
|
| 466 |
-
$save_in_backup = $wpdb->update($wpdb->prefix . 'formmaker_backup', array(
|
| 467 |
-
'type' => $type
|
| 468 |
-
), array('id' => $id));
|
| 469 |
-
|
| 470 |
-
$save_in_form = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
| 471 |
-
'type' => $type
|
| 472 |
-
), array('id' => $id));
|
| 473 |
-
return 8;
|
| 474 |
-
}
|
| 475 |
-
else {
|
| 476 |
-
return 2;
|
| 477 |
-
}
|
| 478 |
-
}
|
| 479 |
-
|
| 480 |
-
public function save_as_copy() {
|
| 481 |
-
$message = $this->save_db_as_copy();
|
| 482 |
-
$page = WDW_FM_Library::get('page');
|
| 483 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 484 |
-
}
|
| 485 |
-
|
| 486 |
-
public function save() {
|
| 487 |
-
$message = $this->save_db();
|
| 488 |
-
$page = WDW_FM_Library::get('page');
|
| 489 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 490 |
-
}
|
| 491 |
-
|
| 492 |
-
public function apply() {
|
| 493 |
-
$message = $this->save_db();
|
| 494 |
-
global $wpdb;
|
| 495 |
-
$id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
| 496 |
-
$current_id = (int)WDW_FM_Library::get('current_id', $id);
|
| 497 |
-
$page = WDW_FM_Library::get('page');
|
| 498 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
| 499 |
-
}
|
| 500 |
-
|
| 501 |
-
public function save_db() {
|
| 502 |
-
global $wpdb;
|
| 503 |
-
$javascript = "// Occurs before the form is loaded
|
| 504 |
-
function before_load() {
|
| 505 |
-
}
|
| 506 |
-
// Occurs just before submitting the form
|
| 507 |
-
function before_submit() {
|
| 508 |
-
// IMPORTANT! If you want to interrupt (stop) the submitting of the form, this function should return true. You don't need to return any value if you don't want to stop the submission.
|
| 509 |
-
}
|
| 510 |
-
// Occurs just before resetting the form
|
| 511 |
-
function before_reset() {
|
| 512 |
-
}";
|
| 513 |
-
$id = (int)WDW_FM_Library::get('current_id', 0);
|
| 514 |
-
$title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
|
| 515 |
-
$theme = (isset($_POST['theme']) ? esc_html(stripslashes($_POST['theme'])) : $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'"));
|
| 516 |
-
$form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
|
| 517 |
-
$sortable = (isset($_POST['sortable']) ? stripslashes($_POST['sortable']) : 1);
|
| 518 |
-
$counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
|
| 519 |
-
$label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
|
| 520 |
-
$pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
|
| 521 |
-
$show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
|
| 522 |
-
$show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
|
| 523 |
-
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
| 524 |
-
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
| 525 |
-
$recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
|
| 526 |
-
$label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
|
| 527 |
-
$form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
|
| 528 |
-
|
| 529 |
-
$header_title = (isset($_POST['header_title']) ? esc_html(stripslashes($_POST['header_title'])) : '');
|
| 530 |
-
$header_description = (isset($_POST['header_description']) ? htmlspecialchars_decode(esc_html(stripslashes($_POST['header_description']))) : '');
|
| 531 |
-
$header_image_url = (isset($_POST['header_image_url']) ? esc_html(stripslashes($_POST['header_image_url'])) : '');
|
| 532 |
-
$header_image_animation = (isset($_POST['header_image_animation']) ? esc_html(stripslashes($_POST['header_image_animation'])) : '');
|
| 533 |
-
$header_hide_image = (isset($_POST['header_hide_image']) ? esc_html(stripslashes($_POST['header_hide_image'])) : 0);
|
| 534 |
-
$type = (isset($_POST['form_type']) ? esc_html(stripslashes($_POST['form_type'])) : 'embedded');
|
| 535 |
-
$scrollbox_minimize_text = $header_title ? $header_title : 'The form is minimized.';
|
| 536 |
-
|
| 537 |
-
if ($id != 0) {
|
| 538 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
| 539 |
-
'title' => $title,
|
| 540 |
-
'theme' => $theme,
|
| 541 |
-
'form_front' => $form_front,
|
| 542 |
-
'sortable' => $sortable,
|
| 543 |
-
'counter' => $counter,
|
| 544 |
-
'label_order' => $label_order,
|
| 545 |
-
'label_order_current' => $label_order_current,
|
| 546 |
-
'pagination' => $pagination,
|
| 547 |
-
'show_title' => $show_title,
|
| 548 |
-
'show_numbers' => $show_numbers,
|
| 549 |
-
'public_key' => $public_key,
|
| 550 |
-
'private_key' => $private_key,
|
| 551 |
-
'recaptcha_theme' => $recaptcha_theme,
|
| 552 |
-
'form_fields' => $form_fields,
|
| 553 |
-
'header_title' => $header_title,
|
| 554 |
-
'header_description' => $header_description,
|
| 555 |
-
'header_image_url' => $header_image_url,
|
| 556 |
-
'header_image_animation' => $header_image_animation,
|
| 557 |
-
'header_hide_image' => $header_hide_image,
|
| 558 |
-
), array('id' => $id));
|
| 559 |
-
}
|
| 560 |
-
else {
|
| 561 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
|
| 562 |
-
'title' => $title,
|
| 563 |
-
'type' => $type,
|
| 564 |
-
'mail' => '',
|
| 565 |
-
'form_front' => $form_front,
|
| 566 |
-
'theme' => $theme,
|
| 567 |
-
'counter' => $counter,
|
| 568 |
-
'label_order' => $label_order,
|
| 569 |
-
'pagination' => $pagination,
|
| 570 |
-
'show_title' => $show_title,
|
| 571 |
-
'show_numbers' => $show_numbers,
|
| 572 |
-
'public_key' => $public_key,
|
| 573 |
-
'private_key' => $private_key,
|
| 574 |
-
'recaptcha_theme' => $recaptcha_theme,
|
| 575 |
-
'javascript' => $javascript,
|
| 576 |
-
'submit_text' => '',
|
| 577 |
-
'url' => '',
|
| 578 |
-
'article_id' => 0,
|
| 579 |
-
'submit_text_type' => 1,
|
| 580 |
-
'script_mail' => '%all%',
|
| 581 |
-
'script_mail_user' => '%all%',
|
| 582 |
-
'label_order_current' => $label_order_current,
|
| 583 |
-
'tax' => 0,
|
| 584 |
-
'payment_currency' => '',
|
| 585 |
-
'paypal_email' => '',
|
| 586 |
-
'checkout_mode' => 'testmode',
|
| 587 |
-
'paypal_mode' => 0,
|
| 588 |
-
'published' => 1,
|
| 589 |
-
'form_fields' => $form_fields,
|
| 590 |
-
'savedb' => 1,
|
| 591 |
-
'sendemail' => 1,
|
| 592 |
-
'requiredmark' => '*',
|
| 593 |
-
'from_mail' => '',
|
| 594 |
-
'from_name' => '',
|
| 595 |
-
'reply_to' => '',
|
| 596 |
-
'send_to' => '',
|
| 597 |
-
'autogen_layout' => 1,
|
| 598 |
-
'custom_front' => '',
|
| 599 |
-
'mail_from_user' => '',
|
| 600 |
-
'mail_from_name_user' => '',
|
| 601 |
-
'reply_to_user' => '',
|
| 602 |
-
'condition' => '',
|
| 603 |
-
'mail_cc' => '',
|
| 604 |
-
'mail_cc_user' => '',
|
| 605 |
-
'mail_bcc' => '',
|
| 606 |
-
'mail_bcc_user' => '',
|
| 607 |
-
'mail_subject' => '',
|
| 608 |
-
'mail_subject_user' => '',
|
| 609 |
-
'mail_mode' => 1,
|
| 610 |
-
'mail_mode_user' => 1,
|
| 611 |
-
'mail_attachment' => 1,
|
| 612 |
-
'mail_attachment_user' => 1,
|
| 613 |
-
'sortable' => $sortable,
|
| 614 |
-
'user_id_wd' => 'administrator,',
|
| 615 |
-
'frontend_submit_fields' => '',
|
| 616 |
-
'frontend_submit_stat_fields' => '',
|
| 617 |
-
'save_uploads' => 1,
|
| 618 |
-
|
| 619 |
-
'header_title' => $header_title,
|
| 620 |
-
'header_description' => $header_description,
|
| 621 |
-
'header_image_url' => $header_image_url,
|
| 622 |
-
'header_image_animation' => $header_image_animation,
|
| 623 |
-
'header_hide_image' => $header_hide_image,
|
| 624 |
-
));
|
| 625 |
-
$id = (int)$wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
| 626 |
-
// $_POST['current_id'] = $id;
|
| 627 |
-
$save_display_options = $wpdb->insert($wpdb->prefix . 'formmaker_display_options', array(
|
| 628 |
-
'form_id' => $id,
|
| 629 |
-
'type' => $type,
|
| 630 |
-
'scrollbox_loading_delay' => 0,
|
| 631 |
-
'popover_animate_effect' => '',
|
| 632 |
-
'popover_loading_delay' => 0,
|
| 633 |
-
'popover_frequency' => 0,
|
| 634 |
-
'topbar_position' => 1,
|
| 635 |
-
'topbar_remain_top' => 1,
|
| 636 |
-
'topbar_closing' => 1,
|
| 637 |
-
'topbar_hide_duration' => 0,
|
| 638 |
-
'scrollbox_position' => 1,
|
| 639 |
-
'scrollbox_trigger_point' => 20,
|
| 640 |
-
'scrollbox_hide_duration' => 0,
|
| 641 |
-
'scrollbox_auto_hide' => 1,
|
| 642 |
-
'hide_mobile' => 0,
|
| 643 |
-
'scrollbox_closing' => 1,
|
| 644 |
-
'scrollbox_minimize' => 1,
|
| 645 |
-
'scrollbox_minimize_text' => $scrollbox_minimize_text,
|
| 646 |
-
'display_on' => 'home,post,page',
|
| 647 |
-
'posts_include' => '',
|
| 648 |
-
'pages_include' => '',
|
| 649 |
-
'display_on_categories' => '',
|
| 650 |
-
'current_categories' => '',
|
| 651 |
-
'show_for_admin' => 0,
|
| 652 |
-
), array(
|
| 653 |
-
'%d',
|
| 654 |
-
'%s',
|
| 655 |
-
'%d',
|
| 656 |
-
'%s',
|
| 657 |
-
'%d',
|
| 658 |
-
'%d',
|
| 659 |
-
'%d',
|
| 660 |
-
'%d',
|
| 661 |
-
'%d',
|
| 662 |
-
'%d',
|
| 663 |
-
'%d',
|
| 664 |
-
'%d',
|
| 665 |
-
'%d',
|
| 666 |
-
'%d',
|
| 667 |
-
'%d',
|
| 668 |
-
'%d',
|
| 669 |
-
'%d',
|
| 670 |
-
'%s',
|
| 671 |
-
'%s',
|
| 672 |
-
'%s',
|
| 673 |
-
'%s',
|
| 674 |
-
'%s',
|
| 675 |
-
'%s',
|
| 676 |
-
'%d',
|
| 677 |
-
));
|
| 678 |
-
$wpdb->insert($wpdb->prefix . 'formmaker_views', array(
|
| 679 |
-
'form_id' => $id,
|
| 680 |
-
'views' => 0
|
| 681 |
-
), array(
|
| 682 |
-
'%d',
|
| 683 |
-
'%d'
|
| 684 |
-
));
|
| 685 |
-
}
|
| 686 |
-
|
| 687 |
-
$backup_id = (isset($_POST['backup_id']) ? (int)esc_html(stripslashes($_POST['backup_id'])) : '');
|
| 688 |
-
|
| 689 |
-
if($backup_id)
|
| 690 |
-
{
|
| 691 |
-
$query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id > ".$backup_id." AND id = ".$id." ORDER BY backup_id ASC LIMIT 0 , 1 ";
|
| 692 |
-
|
| 693 |
-
if($wpdb->get_var($query))
|
| 694 |
-
{
|
| 695 |
-
$query = "DELETE FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id > ".$backup_id." AND id = ".$id;
|
| 696 |
-
$wpdb->query($query);
|
| 697 |
-
}
|
| 698 |
-
|
| 699 |
-
$row = $wpdb->get_row($wpdb->prepare("SELECT form_fields, form_front FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id = '%d'", $backup_id));
|
| 700 |
-
|
| 701 |
-
if($row->form_fields==$form_fields and $row->form_front==$form_front)
|
| 702 |
-
{
|
| 703 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker_backup', array(
|
| 704 |
-
'cur' => 1,
|
| 705 |
-
'title' => $title,
|
| 706 |
-
'theme' => $theme,
|
| 707 |
-
'form_front' => $form_front,
|
| 708 |
-
'sortable' => $sortable,
|
| 709 |
-
'counter' => $counter,
|
| 710 |
-
'label_order' => $label_order,
|
| 711 |
-
'label_order_current' => $label_order_current,
|
| 712 |
-
'pagination' => $pagination,
|
| 713 |
-
'show_title' => $show_title,
|
| 714 |
-
'show_numbers' => $show_numbers,
|
| 715 |
-
'public_key' => $public_key,
|
| 716 |
-
'private_key' => $private_key,
|
| 717 |
-
'recaptcha_theme' => $recaptcha_theme,
|
| 718 |
-
'form_fields' => $form_fields,
|
| 719 |
-
'header_title' => $header_title,
|
| 720 |
-
'header_description' => $header_description,
|
| 721 |
-
'header_image_url' => $header_image_url,
|
| 722 |
-
'header_image_animation' => $header_image_animation,
|
| 723 |
-
'header_hide_image' => $header_hide_image,
|
| 724 |
-
), array('backup_id' => $backup_id));
|
| 725 |
-
|
| 726 |
-
|
| 727 |
-
if ($save !== FALSE) {
|
| 728 |
-
return 1;
|
| 729 |
-
}
|
| 730 |
-
else {
|
| 731 |
-
return 2;
|
| 732 |
-
}
|
| 733 |
-
}
|
| 734 |
-
}
|
| 735 |
-
|
| 736 |
-
$wpdb->query("UPDATE ".$wpdb->prefix."formmaker_backup SET cur=0 WHERE id=".$id );
|
| 737 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker_backup', array(
|
| 738 |
-
'cur' => 1,
|
| 739 |
-
'id' => $id,
|
| 740 |
-
'title' => $title,
|
| 741 |
-
'mail' => '',
|
| 742 |
-
'form_front' => $form_front,
|
| 743 |
-
'theme' => $theme,
|
| 744 |
-
'counter' => $counter,
|
| 745 |
-
'label_order' => $label_order,
|
| 746 |
-
'pagination' => $pagination,
|
| 747 |
-
'show_title' => $show_title,
|
| 748 |
-
'show_numbers' => $show_numbers,
|
| 749 |
-
'public_key' => $public_key,
|
| 750 |
-
'private_key' => $private_key,
|
| 751 |
-
'recaptcha_theme' => $recaptcha_theme,
|
| 752 |
-
'javascript' => $javascript,
|
| 753 |
-
'submit_text' => '',
|
| 754 |
-
'url' => '',
|
| 755 |
-
'article_id' => 0,
|
| 756 |
-
'submit_text_type' => 1,
|
| 757 |
-
'script_mail' => '%all%',
|
| 758 |
-
'script_mail_user' => '%all%',
|
| 759 |
-
'label_order_current' => $label_order_current,
|
| 760 |
-
'tax' => 0,
|
| 761 |
-
'payment_currency' => '',
|
| 762 |
-
'paypal_email' => '',
|
| 763 |
-
'checkout_mode' => 'testmode',
|
| 764 |
-
'paypal_mode' => 0,
|
| 765 |
-
'published' => 1,
|
| 766 |
-
'form_fields' => $form_fields,
|
| 767 |
-
'savedb' => 1,
|
| 768 |
-
'sendemail' => 1,
|
| 769 |
-
'requiredmark' => '*',
|
| 770 |
-
'from_mail' => '',
|
| 771 |
-
'from_name' => '',
|
| 772 |
-
'reply_to' => '',
|
| 773 |
-
'send_to' => '',
|
| 774 |
-
'autogen_layout' => 1,
|
| 775 |
-
'custom_front' => '',
|
| 776 |
-
'mail_from_user' => '',
|
| 777 |
-
'mail_from_name_user' => '',
|
| 778 |
-
'reply_to_user' => '',
|
| 779 |
-
'condition' => '',
|
| 780 |
-
'mail_cc' => '',
|
| 781 |
-
'mail_cc_user' => '',
|
| 782 |
-
'mail_bcc' => '',
|
| 783 |
-
'mail_bcc_user' => '',
|
| 784 |
-
'mail_subject' => '',
|
| 785 |
-
'mail_subject_user' => '',
|
| 786 |
-
'mail_mode' => 1,
|
| 787 |
-
'mail_mode_user' => 1,
|
| 788 |
-
'mail_attachment' => 1,
|
| 789 |
-
'mail_attachment_user' => 1,
|
| 790 |
-
'sortable' => $sortable,
|
| 791 |
-
'user_id_wd' => 'administrator,',
|
| 792 |
-
'frontend_submit_fields' => '',
|
| 793 |
-
'frontend_submit_stat_fields' => '',
|
| 794 |
-
'header_title' => $header_title,
|
| 795 |
-
'header_description' => $header_description,
|
| 796 |
-
'header_image_url' => $header_image_url,
|
| 797 |
-
'header_image_animation' => $header_image_animation,
|
| 798 |
-
'header_hide_image' => $header_hide_image,
|
| 799 |
-
), array(
|
| 800 |
-
'%d',
|
| 801 |
-
'%d',
|
| 802 |
-
'%s',
|
| 803 |
-
'%s',
|
| 804 |
-
'%s',
|
| 805 |
-
'%d',
|
| 806 |
-
'%d',
|
| 807 |
-
'%s',
|
| 808 |
-
'%s',
|
| 809 |
-
'%s',
|
| 810 |
-
'%s',
|
| 811 |
-
'%s',
|
| 812 |
-
'%s',
|
| 813 |
-
'%s',
|
| 814 |
-
'%s',
|
| 815 |
-
'%s',
|
| 816 |
-
'%s',
|
| 817 |
-
'%d',
|
| 818 |
-
'%d',
|
| 819 |
-
'%s',
|
| 820 |
-
'%s',
|
| 821 |
-
'%s',
|
| 822 |
-
'%s',
|
| 823 |
-
'%s',
|
| 824 |
-
'%s',
|
| 825 |
-
'%s',
|
| 826 |
-
'%d',
|
| 827 |
-
'%d',
|
| 828 |
-
'%s',
|
| 829 |
-
'%d',
|
| 830 |
-
'%d',
|
| 831 |
-
'%s',
|
| 832 |
-
'%s',
|
| 833 |
-
'%s',
|
| 834 |
-
'%s',
|
| 835 |
-
'%s',
|
| 836 |
-
'%d',
|
| 837 |
-
'%s',
|
| 838 |
-
'%s',
|
| 839 |
-
'%s',
|
| 840 |
-
'%s',
|
| 841 |
-
'%s',
|
| 842 |
-
'%s',
|
| 843 |
-
'%s',
|
| 844 |
-
'%s',
|
| 845 |
-
'%s',
|
| 846 |
-
'%s',
|
| 847 |
-
'%s',
|
| 848 |
-
'%d',
|
| 849 |
-
'%d',
|
| 850 |
-
'%d',
|
| 851 |
-
'%d',
|
| 852 |
-
'%d',
|
| 853 |
-
'%s',
|
| 854 |
-
'%s',
|
| 855 |
-
'%s',
|
| 856 |
-
'%s',
|
| 857 |
-
'%s',
|
| 858 |
-
'%s',
|
| 859 |
-
'%s',
|
| 860 |
-
'%d',
|
| 861 |
-
)) ;
|
| 862 |
-
|
| 863 |
-
$query = "SELECT count(backup_id) FROM ".$wpdb->prefix."formmaker_backup WHERE id = ".$id;
|
| 864 |
-
$wpdb->get_var($query);
|
| 865 |
-
if($wpdb->get_var($query)>10)
|
| 866 |
-
{
|
| 867 |
-
$query = "DELETE FROM ".$wpdb->prefix."formmaker_backup WHERE id = ".$id." ORDER BY backup_id ASC LIMIT 1 ";
|
| 868 |
-
$wpdb->query($query);
|
| 869 |
-
}
|
| 870 |
-
|
| 871 |
-
if ($save !== FALSE) {
|
| 872 |
-
return 1;
|
| 873 |
-
}
|
| 874 |
-
else {
|
| 875 |
-
return 2;
|
| 876 |
-
}
|
| 877 |
-
}
|
| 878 |
-
|
| 879 |
-
public function save_db_as_copy() {
|
| 880 |
-
global $wpdb;
|
| 881 |
-
$id = (int)WDW_FM_Library::get('current_id', 0);
|
| 882 |
-
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
|
| 883 |
-
require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
| 884 |
-
$model = new FMModelManage_fm();
|
| 885 |
-
$row_display = $model->get_display_options($id);
|
| 886 |
-
$title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
|
| 887 |
-
$theme = (isset($_POST['theme']) ? esc_html(stripslashes($_POST['theme'])) : 0);
|
| 888 |
-
$form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
|
| 889 |
-
$sortable = (isset($_POST['sortable']) ? stripslashes($_POST['sortable']) : 1);
|
| 890 |
-
$counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
|
| 891 |
-
$label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
|
| 892 |
-
$label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
|
| 893 |
-
$pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
|
| 894 |
-
$show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
|
| 895 |
-
$show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
|
| 896 |
-
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
| 897 |
-
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
| 898 |
-
$recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
|
| 899 |
-
$form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
|
| 900 |
-
|
| 901 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
|
| 902 |
-
'title' => $title,
|
| 903 |
-
'type' => $row->type,
|
| 904 |
-
'mail' => $row->mail,
|
| 905 |
-
'form_front' => $form_front,
|
| 906 |
-
'theme' => $theme,
|
| 907 |
-
'counter' => $counter,
|
| 908 |
-
'label_order' => $label_order,
|
| 909 |
-
'pagination' => $pagination,
|
| 910 |
-
'show_title' => $show_title,
|
| 911 |
-
'show_numbers' => $show_numbers,
|
| 912 |
-
'public_key' => $public_key,
|
| 913 |
-
'private_key' => $private_key,
|
| 914 |
-
'recaptcha_theme' => $recaptcha_theme,
|
| 915 |
-
'javascript' => $row->javascript,
|
| 916 |
-
'submit_text' => $row->submit_text,
|
| 917 |
-
'url' => $row->url,
|
| 918 |
-
'article_id' => $row->article_id,
|
| 919 |
-
'submit_text_type' => $row->submit_text_type,
|
| 920 |
-
'script_mail' => $row->script_mail,
|
| 921 |
-
'script_mail_user' => $row->script_mail_user,
|
| 922 |
-
'label_order_current' => $label_order_current,
|
| 923 |
-
'tax' => $row->tax,
|
| 924 |
-
'payment_currency' => $row->payment_currency,
|
| 925 |
-
'paypal_email' => $row->paypal_email,
|
| 926 |
-
'checkout_mode' => $row->checkout_mode,
|
| 927 |
-
'paypal_mode' => $row->paypal_mode,
|
| 928 |
-
'published' => $row->published,
|
| 929 |
-
'form_fields' => $form_fields,
|
| 930 |
-
'savedb' => $row->savedb,
|
| 931 |
-
'sendemail' => $row->sendemail,
|
| 932 |
-
'requiredmark' => $row->requiredmark,
|
| 933 |
-
'from_mail' => $row->from_mail,
|
| 934 |
-
'from_name' => $row->from_name,
|
| 935 |
-
'reply_to' => $row->reply_to,
|
| 936 |
-
'send_to' => $row->send_to,
|
| 937 |
-
'autogen_layout' => $row->autogen_layout,
|
| 938 |
-
'custom_front' => $row->custom_front,
|
| 939 |
-
'mail_from_user' => $row->mail_from_user,
|
| 940 |
-
'mail_from_name_user' => $row->mail_from_name_user,
|
| 941 |
-
'reply_to_user' => $row->reply_to_user,
|
| 942 |
-
'condition' => $row->condition,
|
| 943 |
-
'mail_cc' => $row->mail_cc,
|
| 944 |
-
'mail_cc_user' => $row->mail_cc_user,
|
| 945 |
-
'mail_bcc' => $row->mail_bcc,
|
| 946 |
-
'mail_bcc_user' => $row->mail_bcc_user,
|
| 947 |
-
'mail_subject' => $row->mail_subject,
|
| 948 |
-
'mail_subject_user' => $row->mail_subject_user,
|
| 949 |
-
'mail_mode' => $row->mail_mode,
|
| 950 |
-
'mail_mode_user' => $row->mail_mode_user,
|
| 951 |
-
'mail_attachment' => $row->mail_attachment,
|
| 952 |
-
'mail_attachment_user' => $row->mail_attachment_user,
|
| 953 |
-
'sortable' => $sortable,
|
| 954 |
-
'user_id_wd' => $row->user_id_wd,
|
| 955 |
-
'frontend_submit_fields' => $row->frontend_submit_fields,
|
| 956 |
-
'frontend_submit_stat_fields' => $row->frontend_submit_stat_fields,
|
| 957 |
-
'save_uploads' => $row->save_uploads,
|
| 958 |
-
|
| 959 |
-
'header_title' => $row->header_title,
|
| 960 |
-
'header_description' => $row->header_description,
|
| 961 |
-
'header_image_url' => $row->header_image_url,
|
| 962 |
-
'header_image_animation' => $row->header_image_animation,
|
| 963 |
-
'header_hide_image' => $row->header_hide_image,
|
| 964 |
-
));
|
| 965 |
-
$new_id = (int)$wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
| 966 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker_display_options', array(
|
| 967 |
-
'form_id' => $new_id,
|
| 968 |
-
'type' => $row_display->type,
|
| 969 |
-
'scrollbox_loading_delay' => $row_display->scrollbox_loading_delay,
|
| 970 |
-
'popover_animate_effect' => $row_display->popover_animate_effect,
|
| 971 |
-
'popover_loading_delay' => $row_display->popover_loading_delay,
|
| 972 |
-
'popover_frequency' => $row_display->popover_frequency,
|
| 973 |
-
'topbar_position' => $row_display->topbar_position,
|
| 974 |
-
'topbar_remain_top' => $row_display->topbar_remain_top,
|
| 975 |
-
'topbar_closing' => $row_display->topbar_closing,
|
| 976 |
-
'topbar_hide_duration' => $row_display->topbar_hide_duration,
|
| 977 |
-
'scrollbox_position' => $row_display->scrollbox_position,
|
| 978 |
-
'scrollbox_trigger_point' => $row_display->scrollbox_trigger_point,
|
| 979 |
-
'scrollbox_hide_duration' => $row_display->scrollbox_hide_duration,
|
| 980 |
-
'scrollbox_auto_hide' => $row_display->scrollbox_auto_hide,
|
| 981 |
-
'hide_mobile' => $row_display->hide_mobile,
|
| 982 |
-
'scrollbox_closing' => $row_display->scrollbox_closing,
|
| 983 |
-
'scrollbox_minimize' => $row_display->scrollbox_minimize,
|
| 984 |
-
'scrollbox_minimize_text' => $row_display->scrollbox_minimize_text,
|
| 985 |
-
'display_on' => $row_display->display_on,
|
| 986 |
-
'posts_include' => $row_display->posts_include,
|
| 987 |
-
'pages_include' => $row_display->pages_include,
|
| 988 |
-
'display_on_categories' => $row_display->display_on_categories,
|
| 989 |
-
'current_categories' => $row_display->current_categories,
|
| 990 |
-
'show_for_admin' => $row_display->show_for_admin,
|
| 991 |
-
), array(
|
| 992 |
-
'%d',
|
| 993 |
-
'%s',
|
| 994 |
-
'%d',
|
| 995 |
-
'%s',
|
| 996 |
-
'%d',
|
| 997 |
-
'%d',
|
| 998 |
-
'%d',
|
| 999 |
-
'%d',
|
| 1000 |
-
'%d',
|
| 1001 |
-
'%d',
|
| 1002 |
-
'%d',
|
| 1003 |
-
'%d',
|
| 1004 |
-
'%d',
|
| 1005 |
-
'%d',
|
| 1006 |
-
'%d',
|
| 1007 |
-
'%d',
|
| 1008 |
-
'%d',
|
| 1009 |
-
'%s',
|
| 1010 |
-
'%s',
|
| 1011 |
-
'%s',
|
| 1012 |
-
'%s',
|
| 1013 |
-
'%s',
|
| 1014 |
-
'%s',
|
| 1015 |
-
'%d'
|
| 1016 |
-
));
|
| 1017 |
-
$wpdb->insert($wpdb->prefix . 'formmaker_views', array(
|
| 1018 |
-
'form_id' => $new_id,
|
| 1019 |
-
'views' => 0
|
| 1020 |
-
), array(
|
| 1021 |
-
'%d',
|
| 1022 |
-
'%d'
|
| 1023 |
-
));
|
| 1024 |
-
if ($save !== FALSE) {
|
| 1025 |
-
$addons = array('WD_FM_EMAIL_COND' => 'Conditional Emails', 'WD_FM_PDF' => 'PDF Integration', 'WD_FM_SAVE_PROG' => 'Save Form Progress', 'WD_FM_CALCULATOR' => 'Calculator');
|
| 1026 |
-
$addons_array = array();
|
| 1027 |
-
foreach($addons as $addon => $addon_name) {
|
| 1028 |
-
if (defined($addon) && is_plugin_active(constant($addon))) {
|
| 1029 |
-
$_GET['addon_task'] = 'save_as_copy';
|
| 1030 |
-
$_GET['form_id'] = $id;
|
| 1031 |
-
$_GET['form_id_new'] = $new_id;
|
| 1032 |
-
do_action($addon.'_init');
|
| 1033 |
-
}
|
| 1034 |
-
}
|
| 1035 |
-
return 1;
|
| 1036 |
-
}
|
| 1037 |
-
else {
|
| 1038 |
-
return 2;
|
| 1039 |
-
}
|
| 1040 |
-
}
|
| 1041 |
-
|
| 1042 |
-
public function delete($id) {
|
| 1043 |
-
global $wpdb;
|
| 1044 |
-
$query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id);
|
| 1045 |
-
if ($wpdb->query($query)) {
|
| 1046 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $id));
|
| 1047 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $id));
|
| 1048 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE form_id="%d"', $id));
|
| 1049 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_backup WHERE id="%d"', $id));
|
| 1050 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_display_options WHERE form_id="%d"', $id));
|
| 1051 |
-
$addons = array('WD_FM_EMAIL_COND' => 'Conditional Emails', 'WD_FM_PDF' => 'PDF Integration', 'WD_FM_SAVE_PROG' => 'Save Form Progress', 'WD_FM_CALCULATOR' => 'Calculator');
|
| 1052 |
-
$addons_array = array();
|
| 1053 |
-
foreach($addons as $addon => $addon_name) {
|
| 1054 |
-
if (defined($addon) && is_plugin_active(constant($addon))) {
|
| 1055 |
-
$_GET['addon_task'] = 'delete';
|
| 1056 |
-
$_GET['form_id'] = $id;
|
| 1057 |
-
do_action($addon.'_init');
|
| 1058 |
-
}
|
| 1059 |
-
}
|
| 1060 |
-
$message = 3;
|
| 1061 |
-
}
|
| 1062 |
-
else {
|
| 1063 |
-
$message = 2;
|
| 1064 |
-
}
|
| 1065 |
-
$page = WDW_FM_Library::get('page');
|
| 1066 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 1067 |
-
}
|
| 1068 |
-
|
| 1069 |
-
public function delete_all() {
|
| 1070 |
-
global $wpdb;
|
| 1071 |
-
$flag = FALSE;
|
| 1072 |
-
$isDefault = FALSE;
|
| 1073 |
-
$form_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker');
|
| 1074 |
-
foreach ($form_ids_col as $form_id) {
|
| 1075 |
-
if (isset($_POST['check_' . $form_id])) {
|
| 1076 |
-
$flag = TRUE;
|
| 1077 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
|
| 1078 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $form_id));
|
| 1079 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $form_id));
|
| 1080 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE form_id="%d"', $form_id));
|
| 1081 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_backup WHERE id="%d"', $form_id));
|
| 1082 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_display_options WHERE form_id="%d"', $form_id));
|
| 1083 |
-
}
|
| 1084 |
-
}
|
| 1085 |
-
if ($flag) {
|
| 1086 |
-
$message = 5;
|
| 1087 |
-
}
|
| 1088 |
-
else {
|
| 1089 |
-
$message = 6;
|
| 1090 |
-
}
|
| 1091 |
-
$page = WDW_FM_Library::get('page');
|
| 1092 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 1093 |
-
}
|
| 1094 |
-
|
| 1095 |
-
public function fm_live_search() {
|
| 1096 |
-
$search_string = ! empty( $_POST['pp_live_search'] ) ? sanitize_text_field( $_POST['pp_live_search'] ) : '';
|
| 1097 |
-
$post_type = ! empty( $_POST['pp_post_type'] ) ? sanitize_text_field( $_POST['pp_post_type'] ) : 'any';
|
| 1098 |
-
$full_content = ! empty( $_POST['pp_full_content'] ) ? sanitize_text_field( $_POST['pp_full_content'] ) : 'true';
|
| 1099 |
-
|
| 1100 |
-
$args['s'] = $search_string;
|
| 1101 |
-
|
| 1102 |
-
$results = $this->fm_posts_query( $args, $post_type );
|
| 1103 |
-
/* if ('true' === $full_content) { */
|
| 1104 |
-
$output = '<ul class="pp_search_results">';
|
| 1105 |
-
/* } else {
|
| 1106 |
-
$output = '';
|
| 1107 |
-
} */
|
| 1108 |
-
|
| 1109 |
-
if (empty($results)) {
|
| 1110 |
-
/* if ( 'true' === $full_content ) { */
|
| 1111 |
-
$output .= sprintf(
|
| 1112 |
-
'<li class="pp_no_res">%1$s</li>',
|
| 1113 |
-
esc_html__( 'No results found', 'fm-text' )
|
| 1114 |
-
);
|
| 1115 |
-
/* } */
|
| 1116 |
-
} else {
|
| 1117 |
-
foreach( $results as $single_post ) {
|
| 1118 |
-
$output .= sprintf(
|
| 1119 |
-
'<li data-post_id="%2$s">[%3$s] - %1$s</li>',
|
| 1120 |
-
esc_html( $single_post['title'] ),
|
| 1121 |
-
esc_attr( $single_post['id'] ),
|
| 1122 |
-
esc_html( $single_post['post_type'] )
|
| 1123 |
-
);
|
| 1124 |
-
}
|
| 1125 |
-
}
|
| 1126 |
-
|
| 1127 |
-
/* if ( 'true' === $full_content ) { */
|
| 1128 |
-
$output .= '</ul>';
|
| 1129 |
-
/* } */
|
| 1130 |
-
|
| 1131 |
-
die( $output );
|
| 1132 |
-
}
|
| 1133 |
-
|
| 1134 |
-
public function fm_posts_query( $args = array(), $include_post_type = '' ) {
|
| 1135 |
-
if ( 'only_pages' === $include_post_type ) {
|
| 1136 |
-
$pt_names = array( 'page' );
|
| 1137 |
-
} elseif ( 'any' === $include_post_type || 'only_posts' === $include_post_type ) {
|
| 1138 |
-
$default_post_types = array( 'post', 'page' );
|
| 1139 |
-
$custom_post_types = get_post_types( array(
|
| 1140 |
-
'public' => true,
|
| 1141 |
-
'_builtin' => false,
|
| 1142 |
-
) );
|
| 1143 |
-
|
| 1144 |
-
$post_types = array_merge($default_post_types, $custom_post_types);
|
| 1145 |
-
$pt_names = array_values($post_types);
|
| 1146 |
-
|
| 1147 |
-
if ( 'only_posts' === $include_post_type ) {
|
| 1148 |
-
unset($pt_names[1]);
|
| 1149 |
-
}
|
| 1150 |
-
} else {
|
| 1151 |
-
$pt_names = $include_post_type;
|
| 1152 |
-
}
|
| 1153 |
-
|
| 1154 |
-
$query = array(
|
| 1155 |
-
'post_type' => $pt_names,
|
| 1156 |
-
'suppress_filters' => true,
|
| 1157 |
-
'update_post_term_cache' => false,
|
| 1158 |
-
'update_post_meta_cache' => false,
|
| 1159 |
-
'post_status' => 'publish',
|
| 1160 |
-
'posts_per_page' => -1,
|
| 1161 |
-
);
|
| 1162 |
-
|
| 1163 |
-
if ( isset( $args['s'] ) ) {
|
| 1164 |
-
$query['s'] = $args['s'];
|
| 1165 |
-
}
|
| 1166 |
-
|
| 1167 |
-
$get_posts = new WP_Query;
|
| 1168 |
-
$posts = $get_posts->query( $query );
|
| 1169 |
-
if ( ! $get_posts->post_count ) {
|
| 1170 |
-
return false;
|
| 1171 |
-
}
|
| 1172 |
-
|
| 1173 |
-
$results = array();
|
| 1174 |
-
foreach ($posts as $post) {
|
| 1175 |
-
$results[] = array(
|
| 1176 |
-
'id' => (int) $post->ID,
|
| 1177 |
-
'title' => trim( esc_html( strip_tags( get_the_title( $post ) ) ) ),
|
| 1178 |
-
'post_type' => $post->post_type,
|
| 1179 |
-
);
|
| 1180 |
-
}
|
| 1181 |
-
|
| 1182 |
-
wp_reset_postdata();
|
| 1183 |
-
|
| 1184 |
-
return $results;
|
| 1185 |
-
}
|
| 1186 |
-
|
| 1187 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 1188 |
-
// Getters & Setters //
|
| 1189 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 1190 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 1191 |
-
// Private Methods //
|
| 1192 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 1193 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 1194 |
-
// Listeners //
|
| 1195 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 1196 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMControllerManage_fm {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
public function execute() {
|
| 22 |
+
$task = WDW_FM_Library::get('task');
|
| 23 |
+
$id = (int)WDW_FM_Library::get('current_id', 0);
|
| 24 |
+
$message = WDW_FM_Library::get('message');
|
| 25 |
+
echo WDW_FM_Library::message_id($message);
|
| 26 |
+
if (method_exists($this, $task)) {
|
| 27 |
+
check_admin_referer('nonce_fm', 'nonce_fm');
|
| 28 |
+
$this->$task($id);
|
| 29 |
+
}
|
| 30 |
+
else {
|
| 31 |
+
$this->display();
|
| 32 |
+
}
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
public function undo() {
|
| 36 |
+
require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
| 37 |
+
$model = new FMModelManage_fm();
|
| 38 |
+
|
| 39 |
+
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
| 40 |
+
|
| 41 |
+
global $wpdb;
|
| 42 |
+
$backup_id = (int)WDW_FM_Library::get('backup_id');
|
| 43 |
+
$id = (int)WDW_FM_Library::get('id');
|
| 44 |
+
|
| 45 |
+
$query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id < $backup_id AND id = $id ORDER BY backup_id DESC LIMIT 0 , 1 ";
|
| 46 |
+
$backup_id = $wpdb->get_var($query);
|
| 47 |
+
|
| 48 |
+
$view = new FMViewManage_fm($model);
|
| 49 |
+
$view->edit($backup_id);
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
public function redo() {
|
| 53 |
+
require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
| 54 |
+
$model = new FMModelManage_fm();
|
| 55 |
+
|
| 56 |
+
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
| 57 |
+
global $wpdb;
|
| 58 |
+
$backup_id = (int)WDW_FM_Library::get('backup_id');
|
| 59 |
+
$id = (int)WDW_FM_Library::get('id');
|
| 60 |
+
|
| 61 |
+
$query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id > $backup_id AND id = $id ORDER BY backup_id ASC LIMIT 0 , 1 ";
|
| 62 |
+
$backup_id = $wpdb->get_var($query);
|
| 63 |
+
|
| 64 |
+
$view = new FMViewManage_fm($model);
|
| 65 |
+
$view->edit($backup_id);
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
public function display() {
|
| 69 |
+
require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
| 70 |
+
$model = new FMModelManage_fm();
|
| 71 |
+
|
| 72 |
+
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
| 73 |
+
$view = new FMViewManage_fm($model);
|
| 74 |
+
$view->display();
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
public function add() {
|
| 78 |
+
require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
| 79 |
+
$model = new FMModelManage_fm();
|
| 80 |
+
|
| 81 |
+
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
| 82 |
+
$view = new FMViewManage_fm($model);
|
| 83 |
+
$view->edit(0);
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
public function edit() {
|
| 87 |
+
require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
| 88 |
+
$model = new FMModelManage_fm();
|
| 89 |
+
|
| 90 |
+
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
| 91 |
+
$view = new FMViewManage_fm($model);
|
| 92 |
+
$id = (int)WDW_FM_Library::get('current_id', 0);
|
| 93 |
+
|
| 94 |
+
global $wpdb;
|
| 95 |
+
$query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE cur=1 and id=".$id;
|
| 96 |
+
$backup_id = $wpdb->get_var($query);
|
| 97 |
+
|
| 98 |
+
if(!$backup_id) {
|
| 99 |
+
$query = "SELECT max(backup_id) FROM ".$wpdb->prefix."formmaker_backup";
|
| 100 |
+
$backup_id = $wpdb->get_var($query);
|
| 101 |
+
if($backup_id)
|
| 102 |
+
$backup_id++;
|
| 103 |
+
else
|
| 104 |
+
$backup_id=1;
|
| 105 |
+
$query = "INSERT INTO ".$wpdb->prefix."formmaker_backup SELECT ".$backup_id." AS backup_id, 1 AS cur, formmakerbkup.id, formmakerbkup.title, formmakerbkup.type, formmakerbkup.mail, formmakerbkup.form_front, formmakerbkup.theme, formmakerbkup.javascript, formmakerbkup.submit_text, formmakerbkup.url, formmakerbkup.submit_text_type, formmakerbkup.script_mail, formmakerbkup.script_mail_user, formmakerbkup.counter, formmakerbkup.published, formmakerbkup.label_order, formmakerbkup.label_order_current, formmakerbkup.article_id, formmakerbkup.pagination, formmakerbkup.show_title, formmakerbkup.show_numbers, formmakerbkup.public_key, formmakerbkup.private_key, formmakerbkup.recaptcha_theme, formmakerbkup.paypal_mode, formmakerbkup.checkout_mode, formmakerbkup.paypal_email, formmakerbkup.payment_currency, formmakerbkup.tax, formmakerbkup.form_fields, formmakerbkup.savedb, formmakerbkup.sendemail, formmakerbkup.requiredmark, formmakerbkup.from_mail, formmakerbkup.from_name, formmakerbkup.reply_to, formmakerbkup.send_to, formmakerbkup.autogen_layout, formmakerbkup.custom_front, formmakerbkup.mail_from_user, formmakerbkup.mail_from_name_user, formmakerbkup.reply_to_user, formmakerbkup.condition, formmakerbkup.mail_cc, formmakerbkup.mail_cc_user, formmakerbkup.mail_bcc, formmakerbkup.mail_bcc_user, formmakerbkup.mail_subject, formmakerbkup.mail_subject_user, formmakerbkup.mail_mode, formmakerbkup.mail_mode_user, formmakerbkup.mail_attachment, formmakerbkup.mail_attachment_user, formmakerbkup.user_id_wd, formmakerbkup.sortable, formmakerbkup.frontend_submit_fields, formmakerbkup.frontend_submit_stat_fields, formmakerbkup.mail_emptyfields, formmakerbkup.mail_verify, formmakerbkup.mail_verify_expiretime, formmakerbkup.mail_verification_post_id, formmakerbkup.save_uploads, formmakerbkup.header_title, formmakerbkup.header_description, formmakerbkup.header_image_url, formmakerbkup.header_image_animation, formmakerbkup.header_hide_image FROM ".$wpdb->prefix."formmaker as formmakerbkup WHERE id=".$id;
|
| 106 |
+
$wpdb->query($query);
|
| 107 |
+
}
|
| 108 |
+
$view->edit($backup_id);
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
public function form_layout() {
|
| 112 |
+
if (!isset($_GET['task'])) {
|
| 113 |
+
$this->save_db();
|
| 114 |
+
}
|
| 115 |
+
require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
| 116 |
+
$model = new FMModelManage_fm();
|
| 117 |
+
|
| 118 |
+
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
| 119 |
+
$view = new FMViewManage_fm($model);
|
| 120 |
+
global $wpdb;
|
| 121 |
+
$id = (int)WDW_FM_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
|
| 122 |
+
$view->form_layout($id);
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
public function save_layout() {
|
| 126 |
+
$message = $this->save_db_layout();
|
| 127 |
+
$page = WDW_FM_Library::get('page');
|
| 128 |
+
$current_id = (int)WDW_FM_Library::get('current_id', 0);
|
| 129 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
public function apply_layout() {
|
| 133 |
+
$message = $this->save_db_layout();
|
| 134 |
+
$page = WDW_FM_Library::get('page');
|
| 135 |
+
$current_id = (int)WDW_FM_Library::get('current_id', 0);
|
| 136 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'form_layout', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
public function save_db_layout() {
|
| 140 |
+
global $wpdb;
|
| 141 |
+
$id = (int)WDW_FM_Library::get('current_id', 0);
|
| 142 |
+
$custom_front = (isset($_POST['custom_front']) ? stripslashes($_POST['custom_front']) : '');
|
| 143 |
+
$autogen_layout = (isset($_POST['autogen_layout']) ? 1 : 0);
|
| 144 |
+
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
| 145 |
+
'custom_front' => $custom_front,
|
| 146 |
+
'autogen_layout' => $autogen_layout
|
| 147 |
+
), array('id' => $id));
|
| 148 |
+
if ($save !== FALSE) {
|
| 149 |
+
return 1;
|
| 150 |
+
}
|
| 151 |
+
else {
|
| 152 |
+
return 2;
|
| 153 |
+
}
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
public function form_options() {
|
| 157 |
+
require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
| 158 |
+
$model = new FMModelManage_fm();
|
| 159 |
+
|
| 160 |
+
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
| 161 |
+
$view = new FMViewManage_fm($model);
|
| 162 |
+
|
| 163 |
+
global $wpdb;
|
| 164 |
+
$id = (int)WDW_FM_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
|
| 165 |
+
$view->form_options($id);
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
public function display_options() {
|
| 169 |
+
require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
| 170 |
+
$model = new FMModelManage_fm();
|
| 171 |
+
|
| 172 |
+
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
| 173 |
+
$view = new FMViewManage_fm($model);
|
| 174 |
+
|
| 175 |
+
global $wpdb;
|
| 176 |
+
$id = (int)WDW_FM_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
|
| 177 |
+
$view->display_options($id);
|
| 178 |
+
}
|
| 179 |
+
|
| 180 |
+
public function save_options() {
|
| 181 |
+
$message = $this->save_db_options();
|
| 182 |
+
// $this->edit();
|
| 183 |
+
$page = WDW_FM_Library::get('page');
|
| 184 |
+
$current_id = (int)WDW_FM_Library::get('current_id', 0);
|
| 185 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
public function save_display_options() {
|
| 189 |
+
$message = $this->save_dis_options();
|
| 190 |
+
$page = WDW_FM_Library::get('page');
|
| 191 |
+
$current_id = (int)WDW_FM_Library::get('current_id', 0);
|
| 192 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
public function view_options() {
|
| 196 |
+
if (!isset($_GET['task'])) {
|
| 197 |
+
$this->save_db();
|
| 198 |
+
}
|
| 199 |
+
global $wpdb;
|
| 200 |
+
$page = WDW_FM_Library::get('page');
|
| 201 |
+
$current_id = (int)WDW_FM_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
|
| 202 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'form_options', 'current_id' => $current_id), admin_url('admin.php')));
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
public function view_display_options() {
|
| 206 |
+
if (!isset($_GET['task'])) {
|
| 207 |
+
$this->save_db();
|
| 208 |
+
}
|
| 209 |
+
global $wpdb;
|
| 210 |
+
$page = WDW_FM_Library::get('page');
|
| 211 |
+
$current_id = (int)WDW_FM_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
|
| 212 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display_options', 'current_id' => $current_id), admin_url('admin.php')));
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
public function apply_options() {
|
| 216 |
+
$message = $this->save_db_options();
|
| 217 |
+
$page = WDW_FM_Library::get('page');
|
| 218 |
+
$current_id = (int)WDW_FM_Library::get('current_id', 0);
|
| 219 |
+
$fieldset_id = WDW_FM_Library::get('fieldset_id', 'general');
|
| 220 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'form_options', 'current_id' => $current_id, 'message' => $message, 'fieldset_id' => $fieldset_id), admin_url('admin.php')));
|
| 221 |
+
}
|
| 222 |
+
|
| 223 |
+
public function apply_display_options() {
|
| 224 |
+
$message = $this->save_dis_options();
|
| 225 |
+
$page = WDW_FM_Library::get('page');
|
| 226 |
+
$current_id = (int)WDW_FM_Library::get('current_id', 0);
|
| 227 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display_options', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
| 228 |
+
}
|
| 229 |
+
|
| 230 |
+
public function remove_query() {
|
| 231 |
+
global $wpdb;
|
| 232 |
+
$cid = ((isset($_POST['cid']) && $_POST['cid'] != '') ? $_POST['cid'] : NULL);
|
| 233 |
+
if (count($cid)) {
|
| 234 |
+
array_walk($cid, create_function('&$value', '$value = (int)$value;'));
|
| 235 |
+
$cids = implode(',', $cid);
|
| 236 |
+
$query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_query WHERE id IN ( ' . $cids . ' )';
|
| 237 |
+
if ($wpdb->query($query)) {
|
| 238 |
+
echo WDW_FM_Library::message('Items Succesfully Deleted.', 'updated');
|
| 239 |
+
}
|
| 240 |
+
else {
|
| 241 |
+
echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
|
| 242 |
+
}
|
| 243 |
+
}
|
| 244 |
+
else {
|
| 245 |
+
echo WDW_FM_Library::message('You must select at least one item.', 'error');
|
| 246 |
+
}
|
| 247 |
+
$this->apply_options();
|
| 248 |
+
}
|
| 249 |
+
|
| 250 |
+
public function cancel_options() {
|
| 251 |
+
$this->edit();
|
| 252 |
+
}
|
| 253 |
+
|
| 254 |
+
public function save_db_options() {
|
| 255 |
+
$javascript = "// Occurs before the form is loaded
|
| 256 |
+
function before_load() {
|
| 257 |
+
|
| 258 |
+
}
|
| 259 |
+
// Occurs just before submitting the form
|
| 260 |
+
function before_submit() {
|
| 261 |
+
// IMPORTANT! If you want to interrupt (stop) the submitting of the form, this function should return true. You don't need to return any value if you don't want to stop the submission.
|
| 262 |
+
}
|
| 263 |
+
// Occurs just before resetting the form
|
| 264 |
+
function before_reset() {
|
| 265 |
+
|
| 266 |
+
}";
|
| 267 |
+
global $wpdb;
|
| 268 |
+
// $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
|
| 269 |
+
$id = (int)WDW_FM_Library::get('current_id', 0);
|
| 270 |
+
$published = (isset($_POST['published']) ? esc_html(stripslashes($_POST['published'])) : 1);
|
| 271 |
+
$savedb = (isset($_POST['savedb']) ? esc_html(stripslashes($_POST['savedb'])) : 1);
|
| 272 |
+
$theme = (int)(isset($_POST['theme']) ? esc_html(stripslashes($_POST['theme'])) : $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'"));
|
| 273 |
+
$requiredmark = (isset($_POST['requiredmark']) ? esc_html(stripslashes($_POST['requiredmark'])) : '*');
|
| 274 |
+
$sendemail = (isset($_POST['sendemail']) ? esc_html(stripslashes($_POST['sendemail'])) : 1);
|
| 275 |
+
$save_uploads = (isset($_POST['save_uploads']) ? esc_html(stripslashes($_POST['save_uploads'])) : 1);
|
| 276 |
+
$mail = (isset($_POST['mail']) ? esc_html(stripslashes($_POST['mail'])) : '');
|
| 277 |
+
if (isset($_POST['mailToAdd']) && esc_html(stripslashes($_POST['mailToAdd'])) != '') {
|
| 278 |
+
$mail .= esc_html(stripslashes($_POST['mailToAdd'])) . ',';
|
| 279 |
+
}
|
| 280 |
+
$from_mail = (isset($_POST['from_mail']) ? esc_html(stripslashes($_POST['from_mail'])) : '');
|
| 281 |
+
$from_name = (isset($_POST['from_name']) ? esc_html(stripslashes($_POST['from_name'])) : '');
|
| 282 |
+
$reply_to = (isset($_POST['reply_to']) ? esc_html(stripslashes($_POST['reply_to'])) : '');
|
| 283 |
+
if ($from_mail == "other") {
|
| 284 |
+
$from_mail = (isset($_POST['mail_from_other']) ? esc_html(stripslashes($_POST['mail_from_other'])) : '');
|
| 285 |
+
}
|
| 286 |
+
if ($reply_to == "other") {
|
| 287 |
+
$reply_to = (isset($_POST['reply_to_other']) ? esc_html(stripslashes($_POST['reply_to_other'])) : '');
|
| 288 |
+
}
|
| 289 |
+
$script_mail = (isset($_POST['script_mail']) ? stripslashes($_POST['script_mail']) : '%all%');
|
| 290 |
+
$mail_from_user = (isset($_POST['mail_from_user']) ? esc_html(stripslashes($_POST['mail_from_user'])) : '');
|
| 291 |
+
$mail_from_name_user = (isset($_POST['mail_from_name_user']) ? esc_html(stripslashes($_POST['mail_from_name_user'])) : '');
|
| 292 |
+
$reply_to_user = (isset($_POST['reply_to_user']) ? esc_html(stripslashes($_POST['reply_to_user'])) : '');
|
| 293 |
+
$condition = (isset($_POST['condition']) ? esc_html(stripslashes($_POST['condition'])) : '');
|
| 294 |
+
$mail_cc = (isset($_POST['mail_cc']) ? esc_html(stripslashes($_POST['mail_cc'])) : '');
|
| 295 |
+
$mail_cc_user = (isset($_POST['mail_cc_user']) ? esc_html(stripslashes($_POST['mail_cc_user'])) : '');
|
| 296 |
+
$mail_bcc = (isset($_POST['mail_bcc']) ? esc_html(stripslashes($_POST['mail_bcc'])) : '');
|
| 297 |
+
$mail_bcc_user = (isset($_POST['mail_bcc_user']) ? esc_html(stripslashes($_POST['mail_bcc_user'])) : '');
|
| 298 |
+
$mail_subject = (isset($_POST['mail_subject']) ? esc_html(stripslashes($_POST['mail_subject'])) : '');
|
| 299 |
+
$mail_subject_user = (isset($_POST['mail_subject_user']) ? esc_html(stripslashes($_POST['mail_subject_user'])) : '');
|
| 300 |
+
$mail_mode = (isset($_POST['mail_mode']) ? esc_html(stripslashes($_POST['mail_mode'])) : 1);
|
| 301 |
+
$mail_mode_user = (isset($_POST['mail_mode_user']) ? esc_html(stripslashes($_POST['mail_mode_user'])) : 1);
|
| 302 |
+
$mail_attachment = (isset($_POST['mail_attachment']) ? esc_html(stripslashes($_POST['mail_attachment'])) : 1);
|
| 303 |
+
$mail_attachment_user = (isset($_POST['mail_attachment_user']) ? esc_html(stripslashes($_POST['mail_attachment_user'])) : 1);
|
| 304 |
+
$script_mail_user = (isset($_POST['script_mail_user']) ? stripslashes($_POST['script_mail_user']) : '%all%');
|
| 305 |
+
$submit_text = (isset($_POST['submit_text']) ? stripslashes($_POST['submit_text']) : '');
|
| 306 |
+
$url = (isset($_POST['url']) ? esc_html(stripslashes($_POST['url'])) : '');
|
| 307 |
+
$tax = (isset($_POST['tax']) ? esc_html(stripslashes($_POST['tax'])) : 0);
|
| 308 |
+
$payment_currency = (isset($_POST['payment_currency']) ? stripslashes($_POST['payment_currency']) : '');
|
| 309 |
+
$paypal_email = (isset($_POST['paypal_email']) ? esc_html(stripslashes($_POST['paypal_email'])) : '');
|
| 310 |
+
$checkout_mode = (isset($_POST['checkout_mode']) ? esc_html(stripslashes($_POST['checkout_mode'])) : 'testmode');
|
| 311 |
+
$paypal_mode = (isset($_POST['paypal_mode']) ? esc_html(stripslashes($_POST['paypal_mode'])) : 0);
|
| 312 |
+
$javascript = (isset($_POST['javascript']) ? stripslashes($_POST['javascript']) : $javascript);
|
| 313 |
+
$user_id_wd = (isset($_POST['user_id_wd']) ? stripslashes($_POST['user_id_wd']) : 'administrator,');
|
| 314 |
+
$frontend_submit_fields = (isset($_POST['frontend_submit_fields']) ? stripslashes($_POST['frontend_submit_fields']) : '');
|
| 315 |
+
$frontend_submit_stat_fields = (isset($_POST['frontend_submit_stat_fields']) ? stripslashes($_POST['frontend_submit_stat_fields']) : '');
|
| 316 |
+
$mail_emptyfields = (isset($_POST['mail_emptyfields']) ? esc_html(stripslashes($_POST['mail_emptyfields'])) : 0);
|
| 317 |
+
$mail_verify = (isset($_POST['mail_verify']) ? esc_html(stripslashes($_POST['mail_verify'])) : 0);
|
| 318 |
+
$mail_verify_expiretime = (isset($_POST['mail_verify_expiretime']) ? esc_html(stripslashes($_POST['mail_verify_expiretime'])) : '');
|
| 319 |
+
$send_to = '';
|
| 320 |
+
for ($i = 0; $i < 20; $i++) {
|
| 321 |
+
if (isset($_POST['send_to' . $i])) {
|
| 322 |
+
$send_to .= '*' . esc_html(stripslashes($_POST['send_to' . $i])) . '*';
|
| 323 |
+
}
|
| 324 |
+
}
|
| 325 |
+
if (isset($_POST['submit_text_type'])) {
|
| 326 |
+
$submit_text_type = esc_html(stripslashes($_POST['submit_text_type']));
|
| 327 |
+
if ($submit_text_type == 5) {
|
| 328 |
+
$article_id = (isset($_POST['page_name']) ? esc_html(stripslashes($_POST['page_name'])) : 0);
|
| 329 |
+
}
|
| 330 |
+
else {
|
| 331 |
+
$article_id = (isset($_POST['post_name']) ? esc_html(stripslashes($_POST['post_name'])) : 0);
|
| 332 |
+
}
|
| 333 |
+
}
|
| 334 |
+
else {
|
| 335 |
+
$submit_text_type = 1;
|
| 336 |
+
$article_id = 0;
|
| 337 |
+
}
|
| 338 |
+
|
| 339 |
+
$mail_verification_post_id = (int)$wpdb->get_var('SELECT mail_verification_post_id FROM ' . $wpdb->prefix . 'formmaker WHERE mail_verification_post_id!=0');
|
| 340 |
+
if($mail_verify) {
|
| 341 |
+
$email_verification_post = array(
|
| 342 |
+
'post_title' => 'Email Verification',
|
| 343 |
+
'post_content' => '[email_verification]',
|
| 344 |
+
'post_status' => 'publish',
|
| 345 |
+
'post_author' => 1,
|
| 346 |
+
'post_type' => 'fmemailverification',
|
| 347 |
+
);
|
| 348 |
+
|
| 349 |
+
if(!$mail_verification_post_id || get_post( $mail_verification_post_id )===NULL)
|
| 350 |
+
$mail_verification_post_id = wp_insert_post( $email_verification_post );
|
| 351 |
+
}
|
| 352 |
+
$paypal_mode = $paypal_mode == 'paypal' ? 1 : 0;
|
| 353 |
+
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
| 354 |
+
'published' => $published,
|
| 355 |
+
'savedb' => $savedb,
|
| 356 |
+
'theme' => $theme,
|
| 357 |
+
'requiredmark' => $requiredmark,
|
| 358 |
+
'sendemail' => $sendemail,
|
| 359 |
+
'save_uploads' => $save_uploads,
|
| 360 |
+
'mail' => $mail,
|
| 361 |
+
'from_mail' => $from_mail,
|
| 362 |
+
'from_name' => $from_name,
|
| 363 |
+
'reply_to' => $reply_to,
|
| 364 |
+
'script_mail' => $script_mail,
|
| 365 |
+
'mail_from_user' => $mail_from_user,
|
| 366 |
+
'mail_from_name_user' => $mail_from_name_user,
|
| 367 |
+
'reply_to_user' => $reply_to_user,
|
| 368 |
+
'condition' => $condition,
|
| 369 |
+
'mail_cc' => $mail_cc,
|
| 370 |
+
'mail_cc_user' => $mail_cc_user,
|
| 371 |
+
'mail_bcc' => $mail_bcc,
|
| 372 |
+
'mail_bcc_user' => $mail_bcc_user,
|
| 373 |
+
'mail_subject' => $mail_subject,
|
| 374 |
+
'mail_subject_user' => $mail_subject_user,
|
| 375 |
+
'mail_mode' => $mail_mode,
|
| 376 |
+
'mail_mode_user' => $mail_mode_user,
|
| 377 |
+
'mail_attachment' => $mail_attachment,
|
| 378 |
+
'mail_attachment_user' => $mail_attachment_user,
|
| 379 |
+
'script_mail_user' => $script_mail_user,
|
| 380 |
+
'submit_text' => $submit_text,
|
| 381 |
+
'url' => $url,
|
| 382 |
+
'submit_text_type' => $submit_text_type,
|
| 383 |
+
'article_id' => $article_id,
|
| 384 |
+
'tax' => $tax,
|
| 385 |
+
'payment_currency' => $payment_currency,
|
| 386 |
+
'paypal_email' => $paypal_email,
|
| 387 |
+
'checkout_mode' => $checkout_mode,
|
| 388 |
+
'paypal_mode' => $paypal_mode,
|
| 389 |
+
'javascript' => $javascript,
|
| 390 |
+
'user_id_wd' => $user_id_wd,
|
| 391 |
+
'send_to' => $send_to,
|
| 392 |
+
'frontend_submit_fields' => $frontend_submit_fields,
|
| 393 |
+
'frontend_submit_stat_fields' => $frontend_submit_stat_fields,
|
| 394 |
+
'mail_emptyfields' => $mail_emptyfields,
|
| 395 |
+
'mail_verify' => $mail_verify,
|
| 396 |
+
'mail_verify_expiretime' => $mail_verify_expiretime,
|
| 397 |
+
'mail_verification_post_id' => $mail_verification_post_id,
|
| 398 |
+
), array('id' => $id));
|
| 399 |
+
if ($save !== FALSE) {
|
| 400 |
+
$save_theme_in_backup = $wpdb->update($wpdb->prefix . 'formmaker_backup', array(
|
| 401 |
+
'theme' => $theme
|
| 402 |
+
), array('id' => $id));
|
| 403 |
+
return 8;
|
| 404 |
+
}
|
| 405 |
+
else {
|
| 406 |
+
return 2;
|
| 407 |
+
}
|
| 408 |
+
}
|
| 409 |
+
|
| 410 |
+
public function save_dis_options() {
|
| 411 |
+
global $wpdb;
|
| 412 |
+
$id = (int)WDW_FM_Library::get('current_id', 0);
|
| 413 |
+
$scrollbox_loading_delay = (isset($_POST['scrollbox_loading_delay']) ? esc_html(stripslashes($_POST['scrollbox_loading_delay'])) : 0);
|
| 414 |
+
$popover_animate_effect = (isset($_POST['popover_animate_effect']) ? esc_html(stripslashes($_POST['popover_animate_effect'])) : '');
|
| 415 |
+
$popover_loading_delay = (isset($_POST['popover_loading_delay']) ? esc_html(stripslashes($_POST['popover_loading_delay'])) : 0);
|
| 416 |
+
$popover_frequency = (isset($_POST['popover_frequency']) ? esc_html(stripslashes($_POST['popover_frequency'])) : 0);
|
| 417 |
+
$topbar_position = (isset($_POST['topbar_position']) ? esc_html(stripslashes($_POST['topbar_position'])) : 1);
|
| 418 |
+
$topbar_remain_top = (isset($_POST['topbar_remain_top']) ? esc_html(stripslashes($_POST['topbar_remain_top'])) : 1);
|
| 419 |
+
$topbar_closing = (isset($_POST['topbar_closing']) ? esc_html(stripslashes($_POST['topbar_closing'])) : 1);
|
| 420 |
+
$topbar_hide_duration = (isset($_POST['topbar_hide_duration']) ? esc_html(stripslashes($_POST['topbar_hide_duration'])) : 0);
|
| 421 |
+
$scrollbox_position = (isset($_POST['scrollbox_position']) ? esc_html(stripslashes($_POST['scrollbox_position'])) : 1);
|
| 422 |
+
$scrollbox_trigger_point = (isset($_POST['scrollbox_trigger_point']) ? esc_html(stripslashes($_POST['scrollbox_trigger_point'])) : 20);
|
| 423 |
+
$scrollbox_hide_duration = (isset($_POST['scrollbox_hide_duration']) ? esc_html(stripslashes($_POST['scrollbox_hide_duration'])) : 0);
|
| 424 |
+
$scrollbox_auto_hide = (isset($_POST['scrollbox_auto_hide']) ? esc_html(stripslashes($_POST['scrollbox_auto_hide'])) :1);
|
| 425 |
+
$hide_mobile = (isset($_POST['hide_mobile']) ? esc_html(stripslashes($_POST['hide_mobile'])) : 0);
|
| 426 |
+
$scrollbox_closing = (isset($_POST['scrollbox_closing']) ? esc_html(stripslashes($_POST['scrollbox_closing'])) : 1);
|
| 427 |
+
$scrollbox_minimize = (isset($_POST['scrollbox_minimize']) ? esc_html(stripslashes($_POST['scrollbox_minimize'])) : 1);
|
| 428 |
+
$scrollbox_minimize_text = (isset($_POST['scrollbox_minimize_text']) ? esc_html(stripslashes($_POST['scrollbox_minimize_text'])) : '');
|
| 429 |
+
|
| 430 |
+
$type = (isset($_POST['form_type']) ? esc_html(stripslashes($_POST['form_type'])) : 'embadded');
|
| 431 |
+
$display_on = (isset($_POST['display_on']) ? esc_html(implode(',', $_POST['display_on'])) : '');
|
| 432 |
+
$posts_include = (isset($_POST['posts_include']) ? esc_html(stripslashes($_POST['posts_include'])) : '');
|
| 433 |
+
$pages_include = (isset($_POST['pages_include']) ? esc_html(stripslashes($_POST['pages_include'])) : '');
|
| 434 |
+
$display_on_categories = (isset($_POST['display_on_categories']) ? esc_html(implode(',', $_POST['display_on_categories'])) : '');
|
| 435 |
+
$current_categories = (isset($_POST['current_categories']) ? esc_html(stripslashes($_POST['current_categories'])) : '');
|
| 436 |
+
$show_for_admin = (isset($_POST['show_for_admin']) ? esc_html(stripslashes($_POST['show_for_admin'])) : 0);
|
| 437 |
+
|
| 438 |
+
$save = $wpdb->replace($wpdb->prefix . 'formmaker_display_options', array(
|
| 439 |
+
'form_id' => $id,
|
| 440 |
+
'type' => $type,
|
| 441 |
+
'scrollbox_loading_delay' => $scrollbox_loading_delay,
|
| 442 |
+
'popover_animate_effect' => $popover_animate_effect,
|
| 443 |
+
'popover_loading_delay' => $popover_loading_delay,
|
| 444 |
+
'popover_frequency' => $popover_frequency,
|
| 445 |
+
'topbar_position' => $topbar_position,
|
| 446 |
+
'topbar_remain_top' => $topbar_remain_top,
|
| 447 |
+
'topbar_closing' => $topbar_closing,
|
| 448 |
+
'topbar_hide_duration' => $topbar_hide_duration,
|
| 449 |
+
'scrollbox_position' => $scrollbox_position,
|
| 450 |
+
'scrollbox_trigger_point' => $scrollbox_trigger_point,
|
| 451 |
+
'scrollbox_hide_duration' => $scrollbox_hide_duration,
|
| 452 |
+
'scrollbox_auto_hide' => $scrollbox_auto_hide,
|
| 453 |
+
'hide_mobile' => $hide_mobile,
|
| 454 |
+
'scrollbox_closing' => $scrollbox_closing,
|
| 455 |
+
'scrollbox_minimize' => $scrollbox_minimize,
|
| 456 |
+
'scrollbox_minimize_text' => $scrollbox_minimize_text,
|
| 457 |
+
'display_on' => $display_on,
|
| 458 |
+
'posts_include' => $posts_include,
|
| 459 |
+
'pages_include' => $pages_include,
|
| 460 |
+
'display_on_categories' => $display_on_categories,
|
| 461 |
+
'current_categories' => $current_categories,
|
| 462 |
+
'show_for_admin' => $show_for_admin,
|
| 463 |
+
));
|
| 464 |
+
|
| 465 |
+
if ($save !== FALSE) {
|
| 466 |
+
$save_in_backup = $wpdb->update($wpdb->prefix . 'formmaker_backup', array(
|
| 467 |
+
'type' => $type
|
| 468 |
+
), array('id' => $id));
|
| 469 |
+
|
| 470 |
+
$save_in_form = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
| 471 |
+
'type' => $type
|
| 472 |
+
), array('id' => $id));
|
| 473 |
+
return 8;
|
| 474 |
+
}
|
| 475 |
+
else {
|
| 476 |
+
return 2;
|
| 477 |
+
}
|
| 478 |
+
}
|
| 479 |
+
|
| 480 |
+
public function save_as_copy() {
|
| 481 |
+
$message = $this->save_db_as_copy();
|
| 482 |
+
$page = WDW_FM_Library::get('page');
|
| 483 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 484 |
+
}
|
| 485 |
+
|
| 486 |
+
public function save() {
|
| 487 |
+
$message = $this->save_db();
|
| 488 |
+
$page = WDW_FM_Library::get('page');
|
| 489 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 490 |
+
}
|
| 491 |
+
|
| 492 |
+
public function apply() {
|
| 493 |
+
$message = $this->save_db();
|
| 494 |
+
global $wpdb;
|
| 495 |
+
$id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
| 496 |
+
$current_id = (int)WDW_FM_Library::get('current_id', $id);
|
| 497 |
+
$page = WDW_FM_Library::get('page');
|
| 498 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
| 499 |
+
}
|
| 500 |
+
|
| 501 |
+
public function save_db() {
|
| 502 |
+
global $wpdb;
|
| 503 |
+
$javascript = "// Occurs before the form is loaded
|
| 504 |
+
function before_load() {
|
| 505 |
+
}
|
| 506 |
+
// Occurs just before submitting the form
|
| 507 |
+
function before_submit() {
|
| 508 |
+
// IMPORTANT! If you want to interrupt (stop) the submitting of the form, this function should return true. You don't need to return any value if you don't want to stop the submission.
|
| 509 |
+
}
|
| 510 |
+
// Occurs just before resetting the form
|
| 511 |
+
function before_reset() {
|
| 512 |
+
}";
|
| 513 |
+
$id = (int)WDW_FM_Library::get('current_id', 0);
|
| 514 |
+
$title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
|
| 515 |
+
$theme = (isset($_POST['theme']) ? esc_html(stripslashes($_POST['theme'])) : $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'"));
|
| 516 |
+
$form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
|
| 517 |
+
$sortable = (isset($_POST['sortable']) ? stripslashes($_POST['sortable']) : 1);
|
| 518 |
+
$counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
|
| 519 |
+
$label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
|
| 520 |
+
$pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
|
| 521 |
+
$show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
|
| 522 |
+
$show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
|
| 523 |
+
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
| 524 |
+
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
| 525 |
+
$recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
|
| 526 |
+
$label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
|
| 527 |
+
$form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
|
| 528 |
+
|
| 529 |
+
$header_title = (isset($_POST['header_title']) ? esc_html(stripslashes($_POST['header_title'])) : '');
|
| 530 |
+
$header_description = (isset($_POST['header_description']) ? htmlspecialchars_decode(esc_html(stripslashes($_POST['header_description']))) : '');
|
| 531 |
+
$header_image_url = (isset($_POST['header_image_url']) ? esc_html(stripslashes($_POST['header_image_url'])) : '');
|
| 532 |
+
$header_image_animation = (isset($_POST['header_image_animation']) ? esc_html(stripslashes($_POST['header_image_animation'])) : '');
|
| 533 |
+
$header_hide_image = (isset($_POST['header_hide_image']) ? esc_html(stripslashes($_POST['header_hide_image'])) : 0);
|
| 534 |
+
$type = (isset($_POST['form_type']) ? esc_html(stripslashes($_POST['form_type'])) : 'embedded');
|
| 535 |
+
$scrollbox_minimize_text = $header_title ? $header_title : 'The form is minimized.';
|
| 536 |
+
|
| 537 |
+
if ($id != 0) {
|
| 538 |
+
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
| 539 |
+
'title' => $title,
|
| 540 |
+
'theme' => $theme,
|
| 541 |
+
'form_front' => $form_front,
|
| 542 |
+
'sortable' => $sortable,
|
| 543 |
+
'counter' => $counter,
|
| 544 |
+
'label_order' => $label_order,
|
| 545 |
+
'label_order_current' => $label_order_current,
|
| 546 |
+
'pagination' => $pagination,
|
| 547 |
+
'show_title' => $show_title,
|
| 548 |
+
'show_numbers' => $show_numbers,
|
| 549 |
+
'public_key' => $public_key,
|
| 550 |
+
'private_key' => $private_key,
|
| 551 |
+
'recaptcha_theme' => $recaptcha_theme,
|
| 552 |
+
'form_fields' => $form_fields,
|
| 553 |
+
'header_title' => $header_title,
|
| 554 |
+
'header_description' => $header_description,
|
| 555 |
+
'header_image_url' => $header_image_url,
|
| 556 |
+
'header_image_animation' => $header_image_animation,
|
| 557 |
+
'header_hide_image' => $header_hide_image,
|
| 558 |
+
), array('id' => $id));
|
| 559 |
+
}
|
| 560 |
+
else {
|
| 561 |
+
$save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
|
| 562 |
+
'title' => $title,
|
| 563 |
+
'type' => $type,
|
| 564 |
+
'mail' => '',
|
| 565 |
+
'form_front' => $form_front,
|
| 566 |
+
'theme' => $theme,
|
| 567 |
+
'counter' => $counter,
|
| 568 |
+
'label_order' => $label_order,
|
| 569 |
+
'pagination' => $pagination,
|
| 570 |
+
'show_title' => $show_title,
|
| 571 |
+
'show_numbers' => $show_numbers,
|
| 572 |
+
'public_key' => $public_key,
|
| 573 |
+
'private_key' => $private_key,
|
| 574 |
+
'recaptcha_theme' => $recaptcha_theme,
|
| 575 |
+
'javascript' => $javascript,
|
| 576 |
+
'submit_text' => '',
|
| 577 |
+
'url' => '',
|
| 578 |
+
'article_id' => 0,
|
| 579 |
+
'submit_text_type' => 1,
|
| 580 |
+
'script_mail' => '%all%',
|
| 581 |
+
'script_mail_user' => '%all%',
|
| 582 |
+
'label_order_current' => $label_order_current,
|
| 583 |
+
'tax' => 0,
|
| 584 |
+
'payment_currency' => '',
|
| 585 |
+
'paypal_email' => '',
|
| 586 |
+
'checkout_mode' => 'testmode',
|
| 587 |
+
'paypal_mode' => 0,
|
| 588 |
+
'published' => 1,
|
| 589 |
+
'form_fields' => $form_fields,
|
| 590 |
+
'savedb' => 1,
|
| 591 |
+
'sendemail' => 1,
|
| 592 |
+
'requiredmark' => '*',
|
| 593 |
+
'from_mail' => '',
|
| 594 |
+
'from_name' => '',
|
| 595 |
+
'reply_to' => '',
|
| 596 |
+
'send_to' => '',
|
| 597 |
+
'autogen_layout' => 1,
|
| 598 |
+
'custom_front' => '',
|
| 599 |
+
'mail_from_user' => '',
|
| 600 |
+
'mail_from_name_user' => '',
|
| 601 |
+
'reply_to_user' => '',
|
| 602 |
+
'condition' => '',
|
| 603 |
+
'mail_cc' => '',
|
| 604 |
+
'mail_cc_user' => '',
|
| 605 |
+
'mail_bcc' => '',
|
| 606 |
+
'mail_bcc_user' => '',
|
| 607 |
+
'mail_subject' => '',
|
| 608 |
+
'mail_subject_user' => '',
|
| 609 |
+
'mail_mode' => 1,
|
| 610 |
+
'mail_mode_user' => 1,
|
| 611 |
+
'mail_attachment' => 1,
|
| 612 |
+
'mail_attachment_user' => 1,
|
| 613 |
+
'sortable' => $sortable,
|
| 614 |
+
'user_id_wd' => 'administrator,',
|
| 615 |
+
'frontend_submit_fields' => '',
|
| 616 |
+
'frontend_submit_stat_fields' => '',
|
| 617 |
+
'save_uploads' => 1,
|
| 618 |
+
|
| 619 |
+
'header_title' => $header_title,
|
| 620 |
+
'header_description' => $header_description,
|
| 621 |
+
'header_image_url' => $header_image_url,
|
| 622 |
+
'header_image_animation' => $header_image_animation,
|
| 623 |
+
'header_hide_image' => $header_hide_image,
|
| 624 |
+
));
|
| 625 |
+
$id = (int)$wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
| 626 |
+
// $_POST['current_id'] = $id;
|
| 627 |
+
$save_display_options = $wpdb->insert($wpdb->prefix . 'formmaker_display_options', array(
|
| 628 |
+
'form_id' => $id,
|
| 629 |
+
'type' => $type,
|
| 630 |
+
'scrollbox_loading_delay' => 0,
|
| 631 |
+
'popover_animate_effect' => '',
|
| 632 |
+
'popover_loading_delay' => 0,
|
| 633 |
+
'popover_frequency' => 0,
|
| 634 |
+
'topbar_position' => 1,
|
| 635 |
+
'topbar_remain_top' => 1,
|
| 636 |
+
'topbar_closing' => 1,
|
| 637 |
+
'topbar_hide_duration' => 0,
|
| 638 |
+
'scrollbox_position' => 1,
|
| 639 |
+
'scrollbox_trigger_point' => 20,
|
| 640 |
+
'scrollbox_hide_duration' => 0,
|
| 641 |
+
'scrollbox_auto_hide' => 1,
|
| 642 |
+
'hide_mobile' => 0,
|
| 643 |
+
'scrollbox_closing' => 1,
|
| 644 |
+
'scrollbox_minimize' => 1,
|
| 645 |
+
'scrollbox_minimize_text' => $scrollbox_minimize_text,
|
| 646 |
+
'display_on' => 'home,post,page',
|
| 647 |
+
'posts_include' => '',
|
| 648 |
+
'pages_include' => '',
|
| 649 |
+
'display_on_categories' => '',
|
| 650 |
+
'current_categories' => '',
|
| 651 |
+
'show_for_admin' => 0,
|
| 652 |
+
), array(
|
| 653 |
+
'%d',
|
| 654 |
+
'%s',
|
| 655 |
+
'%d',
|
| 656 |
+
'%s',
|
| 657 |
+
'%d',
|
| 658 |
+
'%d',
|
| 659 |
+
'%d',
|
| 660 |
+
'%d',
|
| 661 |
+
'%d',
|
| 662 |
+
'%d',
|
| 663 |
+
'%d',
|
| 664 |
+
'%d',
|
| 665 |
+
'%d',
|
| 666 |
+
'%d',
|
| 667 |
+
'%d',
|
| 668 |
+
'%d',
|
| 669 |
+
'%d',
|
| 670 |
+
'%s',
|
| 671 |
+
'%s',
|
| 672 |
+
'%s',
|
| 673 |
+
'%s',
|
| 674 |
+
'%s',
|
| 675 |
+
'%s',
|
| 676 |
+
'%d',
|
| 677 |
+
));
|
| 678 |
+
$wpdb->insert($wpdb->prefix . 'formmaker_views', array(
|
| 679 |
+
'form_id' => $id,
|
| 680 |
+
'views' => 0
|
| 681 |
+
), array(
|
| 682 |
+
'%d',
|
| 683 |
+
'%d'
|
| 684 |
+
));
|
| 685 |
+
}
|
| 686 |
+
|
| 687 |
+
$backup_id = (isset($_POST['backup_id']) ? (int)esc_html(stripslashes($_POST['backup_id'])) : '');
|
| 688 |
+
|
| 689 |
+
if($backup_id)
|
| 690 |
+
{
|
| 691 |
+
$query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id > ".$backup_id." AND id = ".$id." ORDER BY backup_id ASC LIMIT 0 , 1 ";
|
| 692 |
+
|
| 693 |
+
if($wpdb->get_var($query))
|
| 694 |
+
{
|
| 695 |
+
$query = "DELETE FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id > ".$backup_id." AND id = ".$id;
|
| 696 |
+
$wpdb->query($query);
|
| 697 |
+
}
|
| 698 |
+
|
| 699 |
+
$row = $wpdb->get_row($wpdb->prepare("SELECT form_fields, form_front FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id = '%d'", $backup_id));
|
| 700 |
+
|
| 701 |
+
if($row->form_fields==$form_fields and $row->form_front==$form_front)
|
| 702 |
+
{
|
| 703 |
+
$save = $wpdb->update($wpdb->prefix . 'formmaker_backup', array(
|
| 704 |
+
'cur' => 1,
|
| 705 |
+
'title' => $title,
|
| 706 |
+
'theme' => $theme,
|
| 707 |
+
'form_front' => $form_front,
|
| 708 |
+
'sortable' => $sortable,
|
| 709 |
+
'counter' => $counter,
|
| 710 |
+
'label_order' => $label_order,
|
| 711 |
+
'label_order_current' => $label_order_current,
|
| 712 |
+
'pagination' => $pagination,
|
| 713 |
+
'show_title' => $show_title,
|
| 714 |
+
'show_numbers' => $show_numbers,
|
| 715 |
+
'public_key' => $public_key,
|
| 716 |
+
'private_key' => $private_key,
|
| 717 |
+
'recaptcha_theme' => $recaptcha_theme,
|
| 718 |
+
'form_fields' => $form_fields,
|
| 719 |
+
'header_title' => $header_title,
|
| 720 |
+
'header_description' => $header_description,
|
| 721 |
+
'header_image_url' => $header_image_url,
|
| 722 |
+
'header_image_animation' => $header_image_animation,
|
| 723 |
+
'header_hide_image' => $header_hide_image,
|
| 724 |
+
), array('backup_id' => $backup_id));
|
| 725 |
+
|
| 726 |
+
|
| 727 |
+
if ($save !== FALSE) {
|
| 728 |
+
return 1;
|
| 729 |
+
}
|
| 730 |
+
else {
|
| 731 |
+
return 2;
|
| 732 |
+
}
|
| 733 |
+
}
|
| 734 |
+
}
|
| 735 |
+
|
| 736 |
+
$wpdb->query("UPDATE ".$wpdb->prefix."formmaker_backup SET cur=0 WHERE id=".$id );
|
| 737 |
+
$save = $wpdb->insert($wpdb->prefix . 'formmaker_backup', array(
|
| 738 |
+
'cur' => 1,
|
| 739 |
+
'id' => $id,
|
| 740 |
+
'title' => $title,
|
| 741 |
+
'mail' => '',
|
| 742 |
+
'form_front' => $form_front,
|
| 743 |
+
'theme' => $theme,
|
| 744 |
+
'counter' => $counter,
|
| 745 |
+
'label_order' => $label_order,
|
| 746 |
+
'pagination' => $pagination,
|
| 747 |
+
'show_title' => $show_title,
|
| 748 |
+
'show_numbers' => $show_numbers,
|
| 749 |
+
'public_key' => $public_key,
|
| 750 |
+
'private_key' => $private_key,
|
| 751 |
+
'recaptcha_theme' => $recaptcha_theme,
|
| 752 |
+
'javascript' => $javascript,
|
| 753 |
+
'submit_text' => '',
|
| 754 |
+
'url' => '',
|
| 755 |
+
'article_id' => 0,
|
| 756 |
+
'submit_text_type' => 1,
|
| 757 |
+
'script_mail' => '%all%',
|
| 758 |
+
'script_mail_user' => '%all%',
|
| 759 |
+
'label_order_current' => $label_order_current,
|
| 760 |
+
'tax' => 0,
|
| 761 |
+
'payment_currency' => '',
|
| 762 |
+
'paypal_email' => '',
|
| 763 |
+
'checkout_mode' => 'testmode',
|
| 764 |
+
'paypal_mode' => 0,
|
| 765 |
+
'published' => 1,
|
| 766 |
+
'form_fields' => $form_fields,
|
| 767 |
+
'savedb' => 1,
|
| 768 |
+
'sendemail' => 1,
|
| 769 |
+
'requiredmark' => '*',
|
| 770 |
+
'from_mail' => '',
|
| 771 |
+
'from_name' => '',
|
| 772 |
+
'reply_to' => '',
|
| 773 |
+
'send_to' => '',
|
| 774 |
+
'autogen_layout' => 1,
|
| 775 |
+
'custom_front' => '',
|
| 776 |
+
'mail_from_user' => '',
|
| 777 |
+
'mail_from_name_user' => '',
|
| 778 |
+
'reply_to_user' => '',
|
| 779 |
+
'condition' => '',
|
| 780 |
+
'mail_cc' => '',
|
| 781 |
+
'mail_cc_user' => '',
|
| 782 |
+
'mail_bcc' => '',
|
| 783 |
+
'mail_bcc_user' => '',
|
| 784 |
+
'mail_subject' => '',
|
| 785 |
+
'mail_subject_user' => '',
|
| 786 |
+
'mail_mode' => 1,
|
| 787 |
+
'mail_mode_user' => 1,
|
| 788 |
+
'mail_attachment' => 1,
|
| 789 |
+
'mail_attachment_user' => 1,
|
| 790 |
+
'sortable' => $sortable,
|
| 791 |
+
'user_id_wd' => 'administrator,',
|
| 792 |
+
'frontend_submit_fields' => '',
|
| 793 |
+
'frontend_submit_stat_fields' => '',
|
| 794 |
+
'header_title' => $header_title,
|
| 795 |
+
'header_description' => $header_description,
|
| 796 |
+
'header_image_url' => $header_image_url,
|
| 797 |
+
'header_image_animation' => $header_image_animation,
|
| 798 |
+
'header_hide_image' => $header_hide_image,
|
| 799 |
+
), array(
|
| 800 |
+
'%d',
|
| 801 |
+
'%d',
|
| 802 |
+
'%s',
|
| 803 |
+
'%s',
|
| 804 |
+
'%s',
|
| 805 |
+
'%d',
|
| 806 |
+
'%d',
|
| 807 |
+
'%s',
|
| 808 |
+
'%s',
|
| 809 |
+
'%s',
|
| 810 |
+
'%s',
|
| 811 |
+
'%s',
|
| 812 |
+
'%s',
|
| 813 |
+
'%s',
|
| 814 |
+
'%s',
|
| 815 |
+
'%s',
|
| 816 |
+
'%s',
|
| 817 |
+
'%d',
|
| 818 |
+
'%d',
|
| 819 |
+
'%s',
|
| 820 |
+
'%s',
|
| 821 |
+
'%s',
|
| 822 |
+
'%s',
|
| 823 |
+
'%s',
|
| 824 |
+
'%s',
|
| 825 |
+
'%s',
|
| 826 |
+
'%d',
|
| 827 |
+
'%d',
|
| 828 |
+
'%s',
|
| 829 |
+
'%d',
|
| 830 |
+
'%d',
|
| 831 |
+
'%s',
|
| 832 |
+
'%s',
|
| 833 |
+
'%s',
|
| 834 |
+
'%s',
|
| 835 |
+
'%s',
|
| 836 |
+
'%d',
|
| 837 |
+
'%s',
|
| 838 |
+
'%s',
|
| 839 |
+
'%s',
|
| 840 |
+
'%s',
|
| 841 |
+
'%s',
|
| 842 |
+
'%s',
|
| 843 |
+
'%s',
|
| 844 |
+
'%s',
|
| 845 |
+
'%s',
|
| 846 |
+
'%s',
|
| 847 |
+
'%s',
|
| 848 |
+
'%d',
|
| 849 |
+
'%d',
|
| 850 |
+
'%d',
|
| 851 |
+
'%d',
|
| 852 |
+
'%d',
|
| 853 |
+
'%s',
|
| 854 |
+
'%s',
|
| 855 |
+
'%s',
|
| 856 |
+
'%s',
|
| 857 |
+
'%s',
|
| 858 |
+
'%s',
|
| 859 |
+
'%s',
|
| 860 |
+
'%d',
|
| 861 |
+
)) ;
|
| 862 |
+
|
| 863 |
+
$query = "SELECT count(backup_id) FROM ".$wpdb->prefix."formmaker_backup WHERE id = ".$id;
|
| 864 |
+
$wpdb->get_var($query);
|
| 865 |
+
if($wpdb->get_var($query)>10)
|
| 866 |
+
{
|
| 867 |
+
$query = "DELETE FROM ".$wpdb->prefix."formmaker_backup WHERE id = ".$id." ORDER BY backup_id ASC LIMIT 1 ";
|
| 868 |
+
$wpdb->query($query);
|
| 869 |
+
}
|
| 870 |
+
|
| 871 |
+
if ($save !== FALSE) {
|
| 872 |
+
return 1;
|
| 873 |
+
}
|
| 874 |
+
else {
|
| 875 |
+
return 2;
|
| 876 |
+
}
|
| 877 |
+
}
|
| 878 |
+
|
| 879 |
+
public function save_db_as_copy() {
|
| 880 |
+
global $wpdb;
|
| 881 |
+
$id = (int)WDW_FM_Library::get('current_id', 0);
|
| 882 |
+
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
|
| 883 |
+
require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
| 884 |
+
$model = new FMModelManage_fm();
|
| 885 |
+
$row_display = $model->get_display_options($id);
|
| 886 |
+
$title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
|
| 887 |
+
$theme = (isset($_POST['theme']) ? esc_html(stripslashes($_POST['theme'])) : 0);
|
| 888 |
+
$form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
|
| 889 |
+
$sortable = (isset($_POST['sortable']) ? stripslashes($_POST['sortable']) : 1);
|
| 890 |
+
$counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
|
| 891 |
+
$label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
|
| 892 |
+
$label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
|
| 893 |
+
$pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
|
| 894 |
+
$show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
|
| 895 |
+
$show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
|
| 896 |
+
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
| 897 |
+
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
| 898 |
+
$recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
|
| 899 |
+
$form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
|
| 900 |
+
|
| 901 |
+
$save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
|
| 902 |
+
'title' => $title,
|
| 903 |
+
'type' => $row->type,
|
| 904 |
+
'mail' => $row->mail,
|
| 905 |
+
'form_front' => $form_front,
|
| 906 |
+
'theme' => $theme,
|
| 907 |
+
'counter' => $counter,
|
| 908 |
+
'label_order' => $label_order,
|
| 909 |
+
'pagination' => $pagination,
|
| 910 |
+
'show_title' => $show_title,
|
| 911 |
+
'show_numbers' => $show_numbers,
|
| 912 |
+
'public_key' => $public_key,
|
| 913 |
+
'private_key' => $private_key,
|
| 914 |
+
'recaptcha_theme' => $recaptcha_theme,
|
| 915 |
+
'javascript' => $row->javascript,
|
| 916 |
+
'submit_text' => $row->submit_text,
|
| 917 |
+
'url' => $row->url,
|
| 918 |
+
'article_id' => $row->article_id,
|
| 919 |
+
'submit_text_type' => $row->submit_text_type,
|
| 920 |
+
'script_mail' => $row->script_mail,
|
| 921 |
+
'script_mail_user' => $row->script_mail_user,
|
| 922 |
+
'label_order_current' => $label_order_current,
|
| 923 |
+
'tax' => $row->tax,
|
| 924 |
+
'payment_currency' => $row->payment_currency,
|
| 925 |
+
'paypal_email' => $row->paypal_email,
|
| 926 |
+
'checkout_mode' => $row->checkout_mode,
|
| 927 |
+
'paypal_mode' => $row->paypal_mode,
|
| 928 |
+
'published' => $row->published,
|
| 929 |
+
'form_fields' => $form_fields,
|
| 930 |
+
'savedb' => $row->savedb,
|
| 931 |
+
'sendemail' => $row->sendemail,
|
| 932 |
+
'requiredmark' => $row->requiredmark,
|
| 933 |
+
'from_mail' => $row->from_mail,
|
| 934 |
+
'from_name' => $row->from_name,
|
| 935 |
+
'reply_to' => $row->reply_to,
|
| 936 |
+
'send_to' => $row->send_to,
|
| 937 |
+
'autogen_layout' => $row->autogen_layout,
|
| 938 |
+
'custom_front' => $row->custom_front,
|
| 939 |
+
'mail_from_user' => $row->mail_from_user,
|
| 940 |
+
'mail_from_name_user' => $row->mail_from_name_user,
|
| 941 |
+
'reply_to_user' => $row->reply_to_user,
|
| 942 |
+
'condition' => $row->condition,
|
| 943 |
+
'mail_cc' => $row->mail_cc,
|
| 944 |
+
'mail_cc_user' => $row->mail_cc_user,
|
| 945 |
+
'mail_bcc' => $row->mail_bcc,
|
| 946 |
+
'mail_bcc_user' => $row->mail_bcc_user,
|
| 947 |
+
'mail_subject' => $row->mail_subject,
|
| 948 |
+
'mail_subject_user' => $row->mail_subject_user,
|
| 949 |
+
'mail_mode' => $row->mail_mode,
|
| 950 |
+
'mail_mode_user' => $row->mail_mode_user,
|
| 951 |
+
'mail_attachment' => $row->mail_attachment,
|
| 952 |
+
'mail_attachment_user' => $row->mail_attachment_user,
|
| 953 |
+
'sortable' => $sortable,
|
| 954 |
+
'user_id_wd' => $row->user_id_wd,
|
| 955 |
+
'frontend_submit_fields' => $row->frontend_submit_fields,
|
| 956 |
+
'frontend_submit_stat_fields' => $row->frontend_submit_stat_fields,
|
| 957 |
+
'save_uploads' => $row->save_uploads,
|
| 958 |
+
|
| 959 |
+
'header_title' => $row->header_title,
|
| 960 |
+
'header_description' => $row->header_description,
|
| 961 |
+
'header_image_url' => $row->header_image_url,
|
| 962 |
+
'header_image_animation' => $row->header_image_animation,
|
| 963 |
+
'header_hide_image' => $row->header_hide_image,
|
| 964 |
+
));
|
| 965 |
+
$new_id = (int)$wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
| 966 |
+
$save = $wpdb->insert($wpdb->prefix . 'formmaker_display_options', array(
|
| 967 |
+
'form_id' => $new_id,
|
| 968 |
+
'type' => $row_display->type,
|
| 969 |
+
'scrollbox_loading_delay' => $row_display->scrollbox_loading_delay,
|
| 970 |
+
'popover_animate_effect' => $row_display->popover_animate_effect,
|
| 971 |
+
'popover_loading_delay' => $row_display->popover_loading_delay,
|
| 972 |
+
'popover_frequency' => $row_display->popover_frequency,
|
| 973 |
+
'topbar_position' => $row_display->topbar_position,
|
| 974 |
+
'topbar_remain_top' => $row_display->topbar_remain_top,
|
| 975 |
+
'topbar_closing' => $row_display->topbar_closing,
|
| 976 |
+
'topbar_hide_duration' => $row_display->topbar_hide_duration,
|
| 977 |
+
'scrollbox_position' => $row_display->scrollbox_position,
|
| 978 |
+
'scrollbox_trigger_point' => $row_display->scrollbox_trigger_point,
|
| 979 |
+
'scrollbox_hide_duration' => $row_display->scrollbox_hide_duration,
|
| 980 |
+
'scrollbox_auto_hide' => $row_display->scrollbox_auto_hide,
|
| 981 |
+
'hide_mobile' => $row_display->hide_mobile,
|
| 982 |
+
'scrollbox_closing' => $row_display->scrollbox_closing,
|
| 983 |
+
'scrollbox_minimize' => $row_display->scrollbox_minimize,
|
| 984 |
+
'scrollbox_minimize_text' => $row_display->scrollbox_minimize_text,
|
| 985 |
+
'display_on' => $row_display->display_on,
|
| 986 |
+
'posts_include' => $row_display->posts_include,
|
| 987 |
+
'pages_include' => $row_display->pages_include,
|
| 988 |
+
'display_on_categories' => $row_display->display_on_categories,
|
| 989 |
+
'current_categories' => $row_display->current_categories,
|
| 990 |
+
'show_for_admin' => $row_display->show_for_admin,
|
| 991 |
+
), array(
|
| 992 |
+
'%d',
|
| 993 |
+
'%s',
|
| 994 |
+
'%d',
|
| 995 |
+
'%s',
|
| 996 |
+
'%d',
|
| 997 |
+
'%d',
|
| 998 |
+
'%d',
|
| 999 |
+
'%d',
|
| 1000 |
+
'%d',
|
| 1001 |
+
'%d',
|
| 1002 |
+
'%d',
|
| 1003 |
+
'%d',
|
| 1004 |
+
'%d',
|
| 1005 |
+
'%d',
|
| 1006 |
+
'%d',
|
| 1007 |
+
'%d',
|
| 1008 |
+
'%d',
|
| 1009 |
+
'%s',
|
| 1010 |
+
'%s',
|
| 1011 |
+
'%s',
|
| 1012 |
+
'%s',
|
| 1013 |
+
'%s',
|
| 1014 |
+
'%s',
|
| 1015 |
+
'%d'
|
| 1016 |
+
));
|
| 1017 |
+
$wpdb->insert($wpdb->prefix . 'formmaker_views', array(
|
| 1018 |
+
'form_id' => $new_id,
|
| 1019 |
+
'views' => 0
|
| 1020 |
+
), array(
|
| 1021 |
+
'%d',
|
| 1022 |
+
'%d'
|
| 1023 |
+
));
|
| 1024 |
+
if ($save !== FALSE) {
|
| 1025 |
+
$addons = array('WD_FM_EMAIL_COND' => 'Conditional Emails', 'WD_FM_PDF' => 'PDF Integration', 'WD_FM_SAVE_PROG' => 'Save Form Progress', 'WD_FM_CALCULATOR' => 'Calculator');
|
| 1026 |
+
$addons_array = array();
|
| 1027 |
+
foreach($addons as $addon => $addon_name) {
|
| 1028 |
+
if (defined($addon) && is_plugin_active(constant($addon))) {
|
| 1029 |
+
$_GET['addon_task'] = 'save_as_copy';
|
| 1030 |
+
$_GET['form_id'] = $id;
|
| 1031 |
+
$_GET['form_id_new'] = $new_id;
|
| 1032 |
+
do_action($addon.'_init');
|
| 1033 |
+
}
|
| 1034 |
+
}
|
| 1035 |
+
return 1;
|
| 1036 |
+
}
|
| 1037 |
+
else {
|
| 1038 |
+
return 2;
|
| 1039 |
+
}
|
| 1040 |
+
}
|
| 1041 |
+
|
| 1042 |
+
public function delete($id) {
|
| 1043 |
+
global $wpdb;
|
| 1044 |
+
$query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id);
|
| 1045 |
+
if ($wpdb->query($query)) {
|
| 1046 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $id));
|
| 1047 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $id));
|
| 1048 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE form_id="%d"', $id));
|
| 1049 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_backup WHERE id="%d"', $id));
|
| 1050 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_display_options WHERE form_id="%d"', $id));
|
| 1051 |
+
$addons = array('WD_FM_EMAIL_COND' => 'Conditional Emails', 'WD_FM_PDF' => 'PDF Integration', 'WD_FM_SAVE_PROG' => 'Save Form Progress', 'WD_FM_CALCULATOR' => 'Calculator');
|
| 1052 |
+
$addons_array = array();
|
| 1053 |
+
foreach($addons as $addon => $addon_name) {
|
| 1054 |
+
if (defined($addon) && is_plugin_active(constant($addon))) {
|
| 1055 |
+
$_GET['addon_task'] = 'delete';
|
| 1056 |
+
$_GET['form_id'] = $id;
|
| 1057 |
+
do_action($addon.'_init');
|
| 1058 |
+
}
|
| 1059 |
+
}
|
| 1060 |
+
$message = 3;
|
| 1061 |
+
}
|
| 1062 |
+
else {
|
| 1063 |
+
$message = 2;
|
| 1064 |
+
}
|
| 1065 |
+
$page = WDW_FM_Library::get('page');
|
| 1066 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 1067 |
+
}
|
| 1068 |
+
|
| 1069 |
+
public function delete_all() {
|
| 1070 |
+
global $wpdb;
|
| 1071 |
+
$flag = FALSE;
|
| 1072 |
+
$isDefault = FALSE;
|
| 1073 |
+
$form_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker');
|
| 1074 |
+
foreach ($form_ids_col as $form_id) {
|
| 1075 |
+
if (isset($_POST['check_' . $form_id])) {
|
| 1076 |
+
$flag = TRUE;
|
| 1077 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
|
| 1078 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $form_id));
|
| 1079 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $form_id));
|
| 1080 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE form_id="%d"', $form_id));
|
| 1081 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_backup WHERE id="%d"', $form_id));
|
| 1082 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_display_options WHERE form_id="%d"', $form_id));
|
| 1083 |
+
}
|
| 1084 |
+
}
|
| 1085 |
+
if ($flag) {
|
| 1086 |
+
$message = 5;
|
| 1087 |
+
}
|
| 1088 |
+
else {
|
| 1089 |
+
$message = 6;
|
| 1090 |
+
}
|
| 1091 |
+
$page = WDW_FM_Library::get('page');
|
| 1092 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 1093 |
+
}
|
| 1094 |
+
|
| 1095 |
+
public function fm_live_search() {
|
| 1096 |
+
$search_string = ! empty( $_POST['pp_live_search'] ) ? sanitize_text_field( $_POST['pp_live_search'] ) : '';
|
| 1097 |
+
$post_type = ! empty( $_POST['pp_post_type'] ) ? sanitize_text_field( $_POST['pp_post_type'] ) : 'any';
|
| 1098 |
+
$full_content = ! empty( $_POST['pp_full_content'] ) ? sanitize_text_field( $_POST['pp_full_content'] ) : 'true';
|
| 1099 |
+
|
| 1100 |
+
$args['s'] = $search_string;
|
| 1101 |
+
|
| 1102 |
+
$results = $this->fm_posts_query( $args, $post_type );
|
| 1103 |
+
/* if ('true' === $full_content) { */
|
| 1104 |
+
$output = '<ul class="pp_search_results">';
|
| 1105 |
+
/* } else {
|
| 1106 |
+
$output = '';
|
| 1107 |
+
} */
|
| 1108 |
+
|
| 1109 |
+
if (empty($results)) {
|
| 1110 |
+
/* if ( 'true' === $full_content ) { */
|
| 1111 |
+
$output .= sprintf(
|
| 1112 |
+
'<li class="pp_no_res">%1$s</li>',
|
| 1113 |
+
esc_html__( 'No results found', 'fm-text' )
|
| 1114 |
+
);
|
| 1115 |
+
/* } */
|
| 1116 |
+
} else {
|
| 1117 |
+
foreach( $results as $single_post ) {
|
| 1118 |
+
$output .= sprintf(
|
| 1119 |
+
'<li data-post_id="%2$s">[%3$s] - %1$s</li>',
|
| 1120 |
+
esc_html( $single_post['title'] ),
|
| 1121 |
+
esc_attr( $single_post['id'] ),
|
| 1122 |
+
esc_html( $single_post['post_type'] )
|
| 1123 |
+
);
|
| 1124 |
+
}
|
| 1125 |
+
}
|
| 1126 |
+
|
| 1127 |
+
/* if ( 'true' === $full_content ) { */
|
| 1128 |
+
$output .= '</ul>';
|
| 1129 |
+
/* } */
|
| 1130 |
+
|
| 1131 |
+
die( $output );
|
| 1132 |
+
}
|
| 1133 |
+
|
| 1134 |
+
public function fm_posts_query( $args = array(), $include_post_type = '' ) {
|
| 1135 |
+
if ( 'only_pages' === $include_post_type ) {
|
| 1136 |
+
$pt_names = array( 'page' );
|
| 1137 |
+
} elseif ( 'any' === $include_post_type || 'only_posts' === $include_post_type ) {
|
| 1138 |
+
$default_post_types = array( 'post', 'page' );
|
| 1139 |
+
$custom_post_types = get_post_types( array(
|
| 1140 |
+
'public' => true,
|
| 1141 |
+
'_builtin' => false,
|
| 1142 |
+
) );
|
| 1143 |
+
|
| 1144 |
+
$post_types = array_merge($default_post_types, $custom_post_types);
|
| 1145 |
+
$pt_names = array_values($post_types);
|
| 1146 |
+
|
| 1147 |
+
if ( 'only_posts' === $include_post_type ) {
|
| 1148 |
+
unset($pt_names[1]);
|
| 1149 |
+
}
|
| 1150 |
+
} else {
|
| 1151 |
+
$pt_names = $include_post_type;
|
| 1152 |
+
}
|
| 1153 |
+
|
| 1154 |
+
$query = array(
|
| 1155 |
+
'post_type' => $pt_names,
|
| 1156 |
+
'suppress_filters' => true,
|
| 1157 |
+
'update_post_term_cache' => false,
|
| 1158 |
+
'update_post_meta_cache' => false,
|
| 1159 |
+
'post_status' => 'publish',
|
| 1160 |
+
'posts_per_page' => -1,
|
| 1161 |
+
);
|
| 1162 |
+
|
| 1163 |
+
if ( isset( $args['s'] ) ) {
|
| 1164 |
+
$query['s'] = $args['s'];
|
| 1165 |
+
}
|
| 1166 |
+
|
| 1167 |
+
$get_posts = new WP_Query;
|
| 1168 |
+
$posts = $get_posts->query( $query );
|
| 1169 |
+
if ( ! $get_posts->post_count ) {
|
| 1170 |
+
return false;
|
| 1171 |
+
}
|
| 1172 |
+
|
| 1173 |
+
$results = array();
|
| 1174 |
+
foreach ($posts as $post) {
|
| 1175 |
+
$results[] = array(
|
| 1176 |
+
'id' => (int) $post->ID,
|
| 1177 |
+
'title' => trim( esc_html( strip_tags( get_the_title( $post ) ) ) ),
|
| 1178 |
+
'post_type' => $post->post_type,
|
| 1179 |
+
);
|
| 1180 |
+
}
|
| 1181 |
+
|
| 1182 |
+
wp_reset_postdata();
|
| 1183 |
+
|
| 1184 |
+
return $results;
|
| 1185 |
+
}
|
| 1186 |
+
|
| 1187 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 1188 |
+
// Getters & Setters //
|
| 1189 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 1190 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 1191 |
+
// Private Methods //
|
| 1192 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 1193 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 1194 |
+
// Listeners //
|
| 1195 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 1196 |
}
|
admin/controllers/FMControllerSelect_data_from_db.php
CHANGED
|
@@ -1,70 +1,70 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMControllerSelect_data_from_db {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
public function execute() {
|
| 22 |
-
$task = ((isset($_GET['task'])) ? esc_html($_GET['task']) : 0);
|
| 23 |
-
$id = ((isset($_GET['id'])) ? (int)esc_html($_GET['id']) : 0);
|
| 24 |
-
$form_id = ((isset($_GET['form_id'])) ? (int)esc_html($_GET['form_id']) : 0);
|
| 25 |
-
$field_id = ((isset($_GET['field_id'])) ? esc_html($_GET['field_id']) : 0);
|
| 26 |
-
$field_type = ((isset($_GET['field_type'])) ? esc_html($_GET['field_type']) : 0);
|
| 27 |
-
$value_disabled = ((isset($_GET['value_disabled'])) ? esc_html($_GET['value_disabled']) : 0);
|
| 28 |
-
if ($task && method_exists($this, $task)) {
|
| 29 |
-
$this->$task($form_id,$field_type="");
|
| 30 |
-
}
|
| 31 |
-
else
|
| 32 |
-
$this->display($id, $field_id, $field_type, $value_disabled,$form_id);
|
| 33 |
-
}
|
| 34 |
-
|
| 35 |
-
public function display($id, $field_id, $field_type, $value_disabled,$form_id) {
|
| 36 |
-
require_once WD_FM_DIR . "/admin/models/FMModelSelect_data_from_db.php";
|
| 37 |
-
$model = new FMModelSelect_data_from_db();
|
| 38 |
-
|
| 39 |
-
require_once WD_FM_DIR . "/admin/views/FMViewSelect_data_from_db.php";
|
| 40 |
-
$view = new FMViewSelect_data_from_db($model);
|
| 41 |
-
$view->display($id, $field_id, $field_type, $value_disabled,$form_id);
|
| 42 |
-
}
|
| 43 |
-
|
| 44 |
-
public function db_tables($form_id,$field_type) {
|
| 45 |
-
require_once WD_FM_DIR . "/admin/models/FMModelSelect_data_from_db.php";
|
| 46 |
-
$model = new FMModelSelect_data_from_db();
|
| 47 |
-
|
| 48 |
-
require_once WD_FM_DIR . "/admin/views/FMViewSelect_data_from_db.php";
|
| 49 |
-
$view = new FMViewSelect_data_from_db($model);
|
| 50 |
-
$view->db_tables((int)$form_id, $field_type);
|
| 51 |
-
}
|
| 52 |
-
public function db_table_struct_select($form_id,$field_type) {
|
| 53 |
-
require_once WD_FM_DIR . "/admin/models/FMModelSelect_data_from_db.php";
|
| 54 |
-
$model = new FMModelSelect_data_from_db();
|
| 55 |
-
|
| 56 |
-
require_once WD_FM_DIR . "/admin/views/FMViewSelect_data_from_db.php";
|
| 57 |
-
$view = new FMViewSelect_data_from_db($model);
|
| 58 |
-
$view->db_table_struct_select((int)$form_id,$field_type);
|
| 59 |
-
}
|
| 60 |
-
|
| 61 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 62 |
-
// Getters & Setters //
|
| 63 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 64 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 65 |
-
// Private Methods //
|
| 66 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 67 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 68 |
-
// Listeners //
|
| 69 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 70 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMControllerSelect_data_from_db {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
public function execute() {
|
| 22 |
+
$task = ((isset($_GET['task'])) ? esc_html($_GET['task']) : 0);
|
| 23 |
+
$id = ((isset($_GET['id'])) ? (int)esc_html($_GET['id']) : 0);
|
| 24 |
+
$form_id = ((isset($_GET['form_id'])) ? (int)esc_html($_GET['form_id']) : 0);
|
| 25 |
+
$field_id = ((isset($_GET['field_id'])) ? esc_html($_GET['field_id']) : 0);
|
| 26 |
+
$field_type = ((isset($_GET['field_type'])) ? esc_html($_GET['field_type']) : 0);
|
| 27 |
+
$value_disabled = ((isset($_GET['value_disabled'])) ? esc_html($_GET['value_disabled']) : 0);
|
| 28 |
+
if ($task && method_exists($this, $task)) {
|
| 29 |
+
$this->$task($form_id,$field_type="");
|
| 30 |
+
}
|
| 31 |
+
else
|
| 32 |
+
$this->display($id, $field_id, $field_type, $value_disabled,$form_id);
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
public function display($id, $field_id, $field_type, $value_disabled,$form_id) {
|
| 36 |
+
require_once WD_FM_DIR . "/admin/models/FMModelSelect_data_from_db.php";
|
| 37 |
+
$model = new FMModelSelect_data_from_db();
|
| 38 |
+
|
| 39 |
+
require_once WD_FM_DIR . "/admin/views/FMViewSelect_data_from_db.php";
|
| 40 |
+
$view = new FMViewSelect_data_from_db($model);
|
| 41 |
+
$view->display($id, $field_id, $field_type, $value_disabled,$form_id);
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
public function db_tables($form_id,$field_type) {
|
| 45 |
+
require_once WD_FM_DIR . "/admin/models/FMModelSelect_data_from_db.php";
|
| 46 |
+
$model = new FMModelSelect_data_from_db();
|
| 47 |
+
|
| 48 |
+
require_once WD_FM_DIR . "/admin/views/FMViewSelect_data_from_db.php";
|
| 49 |
+
$view = new FMViewSelect_data_from_db($model);
|
| 50 |
+
$view->db_tables((int)$form_id, $field_type);
|
| 51 |
+
}
|
| 52 |
+
public function db_table_struct_select($form_id,$field_type) {
|
| 53 |
+
require_once WD_FM_DIR . "/admin/models/FMModelSelect_data_from_db.php";
|
| 54 |
+
$model = new FMModelSelect_data_from_db();
|
| 55 |
+
|
| 56 |
+
require_once WD_FM_DIR . "/admin/views/FMViewSelect_data_from_db.php";
|
| 57 |
+
$view = new FMViewSelect_data_from_db($model);
|
| 58 |
+
$view->db_table_struct_select((int)$form_id,$field_type);
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 62 |
+
// Getters & Setters //
|
| 63 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 64 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 65 |
+
// Private Methods //
|
| 66 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 67 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 68 |
+
// Listeners //
|
| 69 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 70 |
}
|
admin/controllers/FMControllerShow_matrix.php
CHANGED
|
@@ -1,43 +1,43 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMControllerShow_matrix {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
public function execute() {
|
| 22 |
-
$this->display();
|
| 23 |
-
}
|
| 24 |
-
|
| 25 |
-
public function display() {
|
| 26 |
-
require_once WD_FM_DIR . "/admin/models/FMModelShow_matrix.php";
|
| 27 |
-
$model = new FMModelShow_matrix();
|
| 28 |
-
|
| 29 |
-
require_once WD_FM_DIR . "/admin/views/FMViewShow_matrix.php";
|
| 30 |
-
$view = new FMViewShow_matrix($model);
|
| 31 |
-
$view->display();
|
| 32 |
-
}
|
| 33 |
-
|
| 34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
-
// Getters & Setters //
|
| 36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
-
// Private Methods //
|
| 39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
-
// Listeners //
|
| 42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMControllerShow_matrix {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
public function execute() {
|
| 22 |
+
$this->display();
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
public function display() {
|
| 26 |
+
require_once WD_FM_DIR . "/admin/models/FMModelShow_matrix.php";
|
| 27 |
+
$model = new FMModelShow_matrix();
|
| 28 |
+
|
| 29 |
+
require_once WD_FM_DIR . "/admin/views/FMViewShow_matrix.php";
|
| 30 |
+
$view = new FMViewShow_matrix($model);
|
| 31 |
+
$view->display();
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
+
// Getters & Setters //
|
| 36 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 37 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
+
// Private Methods //
|
| 39 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 40 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
+
// Listeners //
|
| 42 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
}
|
admin/controllers/FMControllerSubmissions_fm.php
CHANGED
|
@@ -1,776 +1,291 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMControllerSubmissions_fm {
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
$
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
$form_id = ((
|
| 75 |
-
$
|
| 76 |
-
$
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
$
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
$
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
for($j=$start; $j<100; $j++) {
|
| 292 |
-
$element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
|
| 293 |
-
if(isset($element))
|
| 294 |
-
if($j == $other_element_id) {
|
| 295 |
-
$value = $value . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL) . '***br***';
|
| 296 |
-
}
|
| 297 |
-
else
|
| 298 |
-
$value = $value . (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL) . '***br***';
|
| 299 |
-
}
|
| 300 |
-
}
|
| 301 |
-
|
| 302 |
-
break;
|
| 303 |
-
}
|
| 304 |
-
|
| 305 |
-
case "type_paypal_price": {
|
| 306 |
-
$value=0;
|
| 307 |
-
if((isset($_POST['wdform_'.$i."_element_dollars".$id]) ? $_POST['wdform_'.$i."_element_dollars".$id] : NULL))
|
| 308 |
-
$value = (isset($_POST['wdform_'.$i."_element_dollars".$id]) ? $_POST['wdform_'.$i."_element_dollars".$id] : NULL);
|
| 309 |
-
|
| 310 |
-
$value = (int) preg_replace('/\D/', '', $value);
|
| 311 |
-
|
| 312 |
-
if((isset($_POST['wdform_'.$i."_element_cents".$id]) ? $_POST['wdform_'.$i."_element_cents".$id] : NULL))
|
| 313 |
-
$value = $value . '.' . ( preg_replace('/\D/', '', (isset($_POST['wdform_'.$i."_element_cents".$id]) ? $_POST['wdform_'.$i."_element_cents".$id] : NULL)));
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
$value = $value;
|
| 317 |
-
break;
|
| 318 |
-
}
|
| 319 |
-
|
| 320 |
-
case "type_paypal_price_new": {
|
| 321 |
-
|
| 322 |
-
$value = isset($_POST['wdform_'.$i."_element".$id]) ? $form_currency.$_POST['wdform_'.$i."_element".$id] : $form_currency.'0';
|
| 323 |
-
break;
|
| 324 |
-
}
|
| 325 |
-
case "type_paypal_select": {
|
| 326 |
-
|
| 327 |
-
if(isset($_POST['wdform_'.$i."_element".$id]) && $_POST['wdform_'.$i."_element".$id]) {
|
| 328 |
-
$value = (isset($_POST['wdform_'.$i."_element_label".$id]) && $_POST['wdform_'.$i."_element_label".$id] ? $_POST['wdform_'.$i."_element_label".$id] : '' ) . ' : ' . $form_currency . $_POST['wdform_'.$i."_element".$id];
|
| 329 |
-
}
|
| 330 |
-
else {
|
| 331 |
-
$value = '';
|
| 332 |
-
}
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
$element_quantity = isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL;
|
| 336 |
-
if(isset($element_quantity) && $value != '') {
|
| 337 |
-
$value .= '***br***' . (isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : "") . ': ' . $_POST['wdform_'.$i."_element_quantity".$id] . '***quantity***';
|
| 338 |
-
}
|
| 339 |
-
for($k=0; $k<50; $k++) {
|
| 340 |
-
$temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
|
| 341 |
-
if(isset($temp_val) && $value!='') {
|
| 342 |
-
$value .= '***br***' . (isset($_POST['wdform_'.$i."_element_property_label".$id]) ? $_POST['wdform_'.$i."_element_property_label".$id] : NULL) . ': ' . (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL) . '***property***';
|
| 343 |
-
}
|
| 344 |
-
}
|
| 345 |
-
|
| 346 |
-
break;
|
| 347 |
-
}
|
| 348 |
-
|
| 349 |
-
case "type_paypal_radio": {
|
| 350 |
-
|
| 351 |
-
if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
|
| 352 |
-
$value = (isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL) . ' : ' . $form_currency . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
|
| 353 |
-
else
|
| 354 |
-
$value='';
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
$element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
|
| 358 |
-
if(isset($element_quantity) && $value!='')
|
| 359 |
-
$value .= '***br***' . (isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : NULL) . ': ' . (isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL) . '***quantity***';
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
for($k=0; $k<50; $k++) {
|
| 363 |
-
$temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
|
| 364 |
-
if(isset($temp_val) && $value!='') {
|
| 365 |
-
|
| 366 |
-
$value .= '***br***' . (isset($_POST['wdform_'.$i."_element_property_label".$id]) ? $_POST['wdform_'.$i."_element_property_label".$id] : NULL) . ': ' . (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL) . '***property***';
|
| 367 |
-
}
|
| 368 |
-
}
|
| 369 |
-
|
| 370 |
-
break;
|
| 371 |
-
}
|
| 372 |
-
|
| 373 |
-
case "type_paypal_shipping": {
|
| 374 |
-
|
| 375 |
-
if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
|
| 376 |
-
$value = (isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL) . ' : ' . $form_currency . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
|
| 377 |
-
else
|
| 378 |
-
$value='';
|
| 379 |
-
|
| 380 |
-
$paypal['shipping'] = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
|
| 381 |
-
|
| 382 |
-
break;
|
| 383 |
-
}
|
| 384 |
-
|
| 385 |
-
case "type_paypal_checkbox": {
|
| 386 |
-
$start=-1;
|
| 387 |
-
$value='';
|
| 388 |
-
for($j=0; $j<100; $j++) {
|
| 389 |
-
|
| 390 |
-
$element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
|
| 391 |
-
|
| 392 |
-
if(isset($element)) {
|
| 393 |
-
$start=$j;
|
| 394 |
-
break;
|
| 395 |
-
}
|
| 396 |
-
}
|
| 397 |
-
|
| 398 |
-
$other_element_id = -1;
|
| 399 |
-
$is_other = (isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : NULL);
|
| 400 |
-
if($is_other=="yes") {
|
| 401 |
-
$other_element_id = (isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : NULL);
|
| 402 |
-
}
|
| 403 |
-
|
| 404 |
-
if($start!=-1) {
|
| 405 |
-
for($j=$start; $j<100; $j++) {
|
| 406 |
-
$element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
|
| 407 |
-
if(isset($element))
|
| 408 |
-
$value = $value . (isset($_POST['wdform_'.$i."_element".$id.$j."_label"]) ? $_POST['wdform_'.$i."_element".$id.$j."_label"] : NULL) . ' - ' . $form_currency . (isset($_POST['wdform_'.$i."_element".$id.$j]) && $_POST['wdform_'.$i."_element".$id.$j] ? $_POST['wdform_'.$i."_element".$id.$j] : 0 ). '***br***';
|
| 409 |
-
|
| 410 |
-
}
|
| 411 |
-
|
| 412 |
-
$element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
|
| 413 |
-
if(isset($element_quantity))
|
| 414 |
-
$value .= (isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : NULL) . ': '. (isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL) . '***quantity***';
|
| 415 |
-
|
| 416 |
-
for($k=0; $k<50; $k++) {
|
| 417 |
-
$temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
|
| 418 |
-
if(isset($temp_val)) {
|
| 419 |
-
|
| 420 |
-
$value .= '***br***' . (isset($_POST['wdform_'.$i."_element_property_label".$id]) ? $_POST['wdform_'.$i."_element_property_label".$id] : NULL) . ': ' . (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL) . '***property***';
|
| 421 |
-
}
|
| 422 |
-
}
|
| 423 |
-
|
| 424 |
-
}
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
break;
|
| 428 |
-
}
|
| 429 |
-
|
| 430 |
-
case "type_star_rating": {
|
| 431 |
-
|
| 432 |
-
if((isset($_POST['wdform_'.$i."_selected_star_amount".$id]) ? $_POST['wdform_'.$i."_selected_star_amount".$id] : NULL) == "")
|
| 433 |
-
$selected_star_amount = 0;
|
| 434 |
-
else {
|
| 435 |
-
$selected_star_amount = (isset($_POST['wdform_'.$i."_selected_star_amount".$id]) ? $_POST['wdform_'.$i."_selected_star_amount".$id] : NULL);
|
| 436 |
-
}
|
| 437 |
-
$value = $selected_star_amount . '/' . (isset($_POST['wdform_'.$i."_star_amount".$id]) ? $_POST['wdform_'.$i."_star_amount".$id] : NULL);
|
| 438 |
-
break;
|
| 439 |
-
}
|
| 440 |
-
|
| 441 |
-
case "type_scale_rating": {
|
| 442 |
-
|
| 443 |
-
$value = (isset($_POST['wdform_'.$i."_scale_radio".$id]) ? $_POST['wdform_'.$i."_scale_radio".$id] : 0) . '/' . (isset($_POST['wdform_'.$i."_scale_amount".$id]) ? $_POST['wdform_'.$i."_scale_amount".$id] : NULL);
|
| 444 |
-
break;
|
| 445 |
-
}
|
| 446 |
-
|
| 447 |
-
case "type_spinner": {
|
| 448 |
-
$value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
|
| 449 |
-
|
| 450 |
-
break;
|
| 451 |
-
}
|
| 452 |
-
|
| 453 |
-
case "type_slider": {
|
| 454 |
-
$value = (isset($_POST['wdform_'.$i."_slider_value".$id]) ? $_POST['wdform_'.$i."_slider_value".$id] : NULL);
|
| 455 |
-
|
| 456 |
-
break;
|
| 457 |
-
}
|
| 458 |
-
case "type_range": {
|
| 459 |
-
$value = (isset($_POST['wdform_'.$i."_element".$id.'0']) ? $_POST['wdform_'.$i."_element".$id.'0'] : NULL) . '-' . (isset($_POST['wdform_'.$i."_element".$id.'1']) ? $_POST['wdform_'.$i."_element".$id.'1'] : NULL);
|
| 460 |
-
|
| 461 |
-
break;
|
| 462 |
-
}
|
| 463 |
-
case "type_grading": {
|
| 464 |
-
$value ="";
|
| 465 |
-
$items = explode(":",(isset($_POST['wdform_'.$i."_hidden_item".$id]) ? $_POST['wdform_'.$i."_hidden_item".$id] : NULL));
|
| 466 |
-
for($k=0; $k<sizeof($items)-1; $k++)
|
| 467 |
-
$value .= (isset($_POST['wdform_'.$i."_element".$id.'_'.$k]) ? $_POST['wdform_'.$i."_element".$id.'_'.$k] : NULL) . ':';
|
| 468 |
-
|
| 469 |
-
$value .= (isset($_POST['wdform_'.$i."_hidden_item".$id]) ? $_POST['wdform_'.$i."_hidden_item".$id] : NULL) . '***grading***';
|
| 470 |
-
|
| 471 |
-
break;
|
| 472 |
-
}
|
| 473 |
-
|
| 474 |
-
case "type_matrix": {
|
| 475 |
-
|
| 476 |
-
$rows_of_matrix = explode("***",(isset($_POST['wdform_'.$i."_hidden_row".$id]) ? $_POST['wdform_'.$i."_hidden_row".$id] : NULL));
|
| 477 |
-
$rows_count = sizeof($rows_of_matrix)-1;
|
| 478 |
-
$column_of_matrix = explode("***",(isset($_POST['wdform_'.$i."_hidden_column".$id]) ? $_POST['wdform_'.$i."_hidden_column".$id] : NULL));
|
| 479 |
-
$columns_count = sizeof($column_of_matrix)-1;
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "radio") {
|
| 483 |
-
$input_value="";
|
| 484 |
-
|
| 485 |
-
for($k=1; $k<=$rows_count; $k++)
|
| 486 |
-
$input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k]) ? $_POST['wdform_'.$i."_input_element".$id.$k] : 0) ."***";
|
| 487 |
-
|
| 488 |
-
}
|
| 489 |
-
if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "checkbox") {
|
| 490 |
-
$input_value="";
|
| 491 |
-
|
| 492 |
-
for($k=1; $k<=$rows_count; $k++)
|
| 493 |
-
for($j=1; $j<=$columns_count; $j++)
|
| 494 |
-
$input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j] : 0) . "***";
|
| 495 |
-
}
|
| 496 |
-
|
| 497 |
-
if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "text") {
|
| 498 |
-
$input_value="";
|
| 499 |
-
for($k=1; $k<=$rows_count; $k++)
|
| 500 |
-
for($j=1; $j<=$columns_count; $j++)
|
| 501 |
-
$input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j] : NULL) . "***";
|
| 502 |
-
}
|
| 503 |
-
|
| 504 |
-
if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "select") {
|
| 505 |
-
$input_value="";
|
| 506 |
-
for($k=1; $k<=$rows_count; $k++)
|
| 507 |
-
for($j=1; $j<=$columns_count; $j++)
|
| 508 |
-
$input_value .= (isset($_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j] : NULL) . "***";
|
| 509 |
-
}
|
| 510 |
-
|
| 511 |
-
$value = $rows_count . (isset($_POST['wdform_'.$i."_hidden_row".$id]) ? $_POST['wdform_'.$i."_hidden_row".$id] : NULL) . '***' . $columns_count . (isset($_POST['wdform_'.$i."_hidden_column".$id]) ? $_POST['wdform_'.$i."_hidden_column".$id] : NULL) . '***' . (isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) . '***' . $input_value . '***matrix***';
|
| 512 |
-
|
| 513 |
-
break;
|
| 514 |
-
}
|
| 515 |
-
|
| 516 |
-
}
|
| 517 |
-
|
| 518 |
-
if($type == "type_address")
|
| 519 |
-
if($value == '*#*#*#')
|
| 520 |
-
continue;
|
| 521 |
-
|
| 522 |
-
|
| 523 |
-
if($value) {
|
| 524 |
-
$query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $group_id . "' AND element_label='" . $i . "'";
|
| 525 |
-
$result = $wpdb->get_var($query);
|
| 526 |
-
|
| 527 |
-
if($result) {
|
| 528 |
-
$save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
|
| 529 |
-
'element_value' => stripslashes($value),
|
| 530 |
-
), array(
|
| 531 |
-
'group_id' => $group_id,
|
| 532 |
-
'element_label' => $i
|
| 533 |
-
), array(
|
| 534 |
-
'%s',
|
| 535 |
-
), array(
|
| 536 |
-
'%d',
|
| 537 |
-
'%s'
|
| 538 |
-
));
|
| 539 |
-
}
|
| 540 |
-
else {
|
| 541 |
-
|
| 542 |
-
$save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
|
| 543 |
-
'form_id' => $form_id,
|
| 544 |
-
'element_label' => $i,
|
| 545 |
-
'element_value' => stripslashes($value),
|
| 546 |
-
'group_id' => $group_id,
|
| 547 |
-
'date' => $date,
|
| 548 |
-
'ip' => $ip
|
| 549 |
-
), array(
|
| 550 |
-
'%d',
|
| 551 |
-
'%s',
|
| 552 |
-
'%s',
|
| 553 |
-
'%d',
|
| 554 |
-
'%s',
|
| 555 |
-
'%s'
|
| 556 |
-
)
|
| 557 |
-
);
|
| 558 |
-
|
| 559 |
-
|
| 560 |
-
}
|
| 561 |
-
}
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
}
|
| 566 |
-
}
|
| 567 |
-
|
| 568 |
-
else {
|
| 569 |
-
|
| 570 |
-
foreach ($label_id as $key => $label_id_1) {
|
| 571 |
-
$element_value = (isset($_POST["submission_" . $label_id_1]) ? esc_html(stripslashes($_POST["submission_" . $label_id_1])) : " ");
|
| 572 |
-
if (isset($_POST["submission_" . $label_id_1])) {
|
| 573 |
-
$query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
|
| 574 |
-
$result = $wpdb->get_var($query);
|
| 575 |
-
if ($label_type[$key] == 'type_file_upload')
|
| 576 |
-
if ($element_value)
|
| 577 |
-
$element_value = $element_value . "*@@url@@*";
|
| 578 |
-
if ($result) {
|
| 579 |
-
$save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
|
| 580 |
-
'element_value' => stripslashes($element_value),
|
| 581 |
-
), array(
|
| 582 |
-
'group_id' => $id,
|
| 583 |
-
'element_label' => $label_id_1
|
| 584 |
-
), array(
|
| 585 |
-
'%s',
|
| 586 |
-
), array(
|
| 587 |
-
'%d',
|
| 588 |
-
'%s'
|
| 589 |
-
));
|
| 590 |
-
}
|
| 591 |
-
else {
|
| 592 |
-
$save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
|
| 593 |
-
'form_id' => $form_id,
|
| 594 |
-
'element_label' => $label_id_1,
|
| 595 |
-
'element_value' => stripslashes($element_value),
|
| 596 |
-
'group_id' => $id,
|
| 597 |
-
'date' => $date,
|
| 598 |
-
'ip' => $ip
|
| 599 |
-
), array(
|
| 600 |
-
'%d',
|
| 601 |
-
'%s',
|
| 602 |
-
'%s',
|
| 603 |
-
'%d',
|
| 604 |
-
'%s',
|
| 605 |
-
'%s'
|
| 606 |
-
)
|
| 607 |
-
);
|
| 608 |
-
}
|
| 609 |
-
}
|
| 610 |
-
else {
|
| 611 |
-
$element_value_ch = (isset($_POST["submission_" . $label_id_1 . '_0']) ? esc_html(stripslashes($_POST["submission_" . $label_id_1 . '_0'])) : " ");
|
| 612 |
-
if (isset($_POST["submission_" . $label_id_1 . '_0'])) {
|
| 613 |
-
for ($z = 0; $z < 21; $z++) {
|
| 614 |
-
$element_value_ch = $_POST["submission_" . $label_id_1 . '_' . $z];
|
| 615 |
-
if (isset($element_value_ch))
|
| 616 |
-
$element_value = $element_value . $element_value_ch . '***br***';
|
| 617 |
-
else
|
| 618 |
-
break;
|
| 619 |
-
}
|
| 620 |
-
$query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
|
| 621 |
-
$result = $wpdb->get_var($query);
|
| 622 |
-
if ($result) {
|
| 623 |
-
$query = "UPDATE " . $wpdb->prefix . "formmaker_submits SET `element_value`='" . stripslashes($element_value) . "' WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
|
| 624 |
-
$save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
|
| 625 |
-
'element_value' => stripslashes($element_value),
|
| 626 |
-
), array(
|
| 627 |
-
'group_id' => $id,
|
| 628 |
-
'element_label' => $label_id_1
|
| 629 |
-
), array(
|
| 630 |
-
'%s',
|
| 631 |
-
), array(
|
| 632 |
-
'%d',
|
| 633 |
-
'%s'
|
| 634 |
-
));
|
| 635 |
-
}
|
| 636 |
-
else {
|
| 637 |
-
$query = "INSERT INTO " . $wpdb->prefix . "formmaker_submits (form_id, element_label, element_value, group_id, date, ip) VALUES('" . $form_id . "', '" . $label_id_1 . "', '" . stripslashes($element_value) . "','" . $id . "', '" . $date . "', '" . $ip . "')";
|
| 638 |
-
$save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
|
| 639 |
-
'form_id' => $form_id,
|
| 640 |
-
'element_label' => $label_id_1,
|
| 641 |
-
'element_value' => stripslashes($element_value),
|
| 642 |
-
'group_id' => $id,
|
| 643 |
-
'date' => $date,
|
| 644 |
-
'ip' => $ip
|
| 645 |
-
), array(
|
| 646 |
-
'%d',
|
| 647 |
-
'%s',
|
| 648 |
-
'%s',
|
| 649 |
-
'%d',
|
| 650 |
-
'%s',
|
| 651 |
-
'%s'
|
| 652 |
-
)
|
| 653 |
-
);
|
| 654 |
-
}
|
| 655 |
-
}
|
| 656 |
-
}
|
| 657 |
-
}
|
| 658 |
-
}
|
| 659 |
-
if ($save !== FALSE) {
|
| 660 |
-
echo WDW_FM_Library::message('Submission Succesfully Saved.', 'updated');
|
| 661 |
-
}
|
| 662 |
-
else {
|
| 663 |
-
echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
|
| 664 |
-
}
|
| 665 |
-
}
|
| 666 |
-
|
| 667 |
-
public function delete($id) {
|
| 668 |
-
global $wpdb;
|
| 669 |
-
$form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
|
| 670 |
-
$query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id="%d"', $id);
|
| 671 |
-
if ($wpdb->query($query)) {
|
| 672 |
-
echo WDW_FM_Library::message('Item Succesfully Deleted.', 'updated');
|
| 673 |
-
}
|
| 674 |
-
else {
|
| 675 |
-
echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
|
| 676 |
-
}
|
| 677 |
-
|
| 678 |
-
$query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE form_id="%d" AND group_id="%d"', $form_id, $id);
|
| 679 |
-
$wpdb->query($query);
|
| 680 |
-
|
| 681 |
-
$this->display($form_id);
|
| 682 |
-
}
|
| 683 |
-
|
| 684 |
-
public function delete_all() {
|
| 685 |
-
global $wpdb;
|
| 686 |
-
$form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
|
| 687 |
-
$cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
|
| 688 |
-
if (count($cid)) {
|
| 689 |
-
array_walk($cid, create_function('&$value', '$value = (int)$value;'));
|
| 690 |
-
$cids = implode(',', $cid);
|
| 691 |
-
$query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )';
|
| 692 |
-
|
| 693 |
-
if ($wpdb->query($query)) {
|
| 694 |
-
echo WDW_FM_Library::message('Items Succesfully Deleted.', 'updated');
|
| 695 |
-
}
|
| 696 |
-
else {
|
| 697 |
-
echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
|
| 698 |
-
}
|
| 699 |
-
|
| 700 |
-
$query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE form_id="%d" AND group_id IN ( "%s" )', $form_id, $cids );
|
| 701 |
-
$wpdb->query($query);
|
| 702 |
-
}
|
| 703 |
-
else {
|
| 704 |
-
echo WDW_FM_Library::message('You must select at least one item.', 'error');
|
| 705 |
-
}
|
| 706 |
-
$this->display($form_id);
|
| 707 |
-
}
|
| 708 |
-
|
| 709 |
-
public function block_ip() {
|
| 710 |
-
global $wpdb;
|
| 711 |
-
$flag = FALSE;
|
| 712 |
-
$form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
|
| 713 |
-
$cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
|
| 714 |
-
if (count($cid)) {
|
| 715 |
-
array_walk($cid, create_function('&$value', '$value = (int)$value;'));
|
| 716 |
-
$cids = implode(',', $cid);
|
| 717 |
-
$query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( '. $cids .' )';
|
| 718 |
-
$rows = $wpdb->get_results($query);
|
| 719 |
-
foreach ($rows as $row) {
|
| 720 |
-
$ips = $wpdb->get_var($wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $row->ip));
|
| 721 |
-
$flag = TRUE;
|
| 722 |
-
if (!$ips) {
|
| 723 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker_blocked', array(
|
| 724 |
-
'ip' => $row->ip,
|
| 725 |
-
), array(
|
| 726 |
-
'%s',
|
| 727 |
-
));
|
| 728 |
-
}
|
| 729 |
-
}
|
| 730 |
-
}
|
| 731 |
-
if ($flag) {
|
| 732 |
-
echo WDW_FM_Library::message('IPs Succesfully Blocked.', 'updated');
|
| 733 |
-
}
|
| 734 |
-
else {
|
| 735 |
-
echo WDW_FM_Library::message('You must select at least one item.', 'error');
|
| 736 |
-
}
|
| 737 |
-
$this->display($form_id);
|
| 738 |
-
}
|
| 739 |
-
|
| 740 |
-
public function unblock_ip() {
|
| 741 |
-
global $wpdb;
|
| 742 |
-
$flag = FALSE;
|
| 743 |
-
$form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
|
| 744 |
-
$cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
|
| 745 |
-
if (count($cid)) {
|
| 746 |
-
array_walk($cid, create_function('&$value', '$value = (int)$value;'));
|
| 747 |
-
$cids = implode(',', $cid);
|
| 748 |
-
$query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( '. $cids .' )';
|
| 749 |
-
$rows = $wpdb->get_results($query);
|
| 750 |
-
foreach ($rows as $row) {
|
| 751 |
-
$flag = TRUE;
|
| 752 |
-
$ips = $wpdb->get_var($wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $row->ip));
|
| 753 |
-
if ($ips) {
|
| 754 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $ips));
|
| 755 |
-
}
|
| 756 |
-
}
|
| 757 |
-
}
|
| 758 |
-
if ($flag) {
|
| 759 |
-
echo WDW_FM_Library::message('IPs Succesfully Unblocked.', 'updated');
|
| 760 |
-
}
|
| 761 |
-
else {
|
| 762 |
-
echo WDW_FM_Library::message('You must select at least one item.', 'error');
|
| 763 |
-
}
|
| 764 |
-
$this->display($form_id);
|
| 765 |
-
}
|
| 766 |
-
|
| 767 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 768 |
-
// Getters & Setters //
|
| 769 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 770 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 771 |
-
// Private Methods //
|
| 772 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 773 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 774 |
-
// Listeners //
|
| 775 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 776 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMControllerSubmissions_fm {
|
| 4 |
+
public function execute() {
|
| 5 |
+
$task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
|
| 6 |
+
$id = ((isset($_POST['current_id'])) ? (int)esc_html($_POST['current_id']) : 0);
|
| 7 |
+
$form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
|
| 8 |
+
|
| 9 |
+
if (method_exists($this, $task)) {
|
| 10 |
+
if ($task != 'show_stats') {
|
| 11 |
+
check_admin_referer('nonce_fm', 'nonce_fm');
|
| 12 |
+
}
|
| 13 |
+
else {
|
| 14 |
+
check_ajax_referer('nonce_fm_ajax', 'nonce_fm_ajax');
|
| 15 |
+
}
|
| 16 |
+
$this->$task($id);
|
| 17 |
+
}
|
| 18 |
+
else {
|
| 19 |
+
$this->display($form_id);
|
| 20 |
+
}
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
public function display($form_id) {
|
| 24 |
+
$form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
|
| 25 |
+
require_once WD_FM_DIR . "/admin/models/FMModelSubmissions_fm.php";
|
| 26 |
+
$model = new FMModelSubmissions_fm();
|
| 27 |
+
|
| 28 |
+
require_once WD_FM_DIR . "/admin/views/FMViewSubmissions_fm.php";
|
| 29 |
+
$view = new FMViewSubmissions_fm($model);
|
| 30 |
+
$view->display($form_id);
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
public function show_stats() {
|
| 34 |
+
$form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
|
| 35 |
+
require_once WD_FM_DIR . "/admin/models/FMModelSubmissions_fm.php";
|
| 36 |
+
$model = new FMModelSubmissions_fm();
|
| 37 |
+
|
| 38 |
+
require_once WD_FM_DIR . "/admin/views/FMViewSubmissions_fm.php";
|
| 39 |
+
$view = new FMViewSubmissions_fm($model);
|
| 40 |
+
$view->show_stats($form_id);
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
public function edit() {
|
| 44 |
+
global $wpdb;
|
| 45 |
+
require_once WD_FM_DIR . "/admin/models/FMModelSubmissions_fm.php";
|
| 46 |
+
$model = new FMModelSubmissions_fm();
|
| 47 |
+
|
| 48 |
+
require_once WD_FM_DIR . "/admin/views/FMViewSubmissions_fm.php";
|
| 49 |
+
$view = new FMViewSubmissions_fm($model);
|
| 50 |
+
$id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? (int)$_POST['current_id'] : 0);
|
| 51 |
+
|
| 52 |
+
$form_id = (int)$wpdb->get_var("SELECT form_id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "'");
|
| 53 |
+
$form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'");
|
| 54 |
+
|
| 55 |
+
$view->edit($id);
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
public function save() {
|
| 59 |
+
$form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
|
| 60 |
+
$this->save_db();
|
| 61 |
+
$this->display($form_id);
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
public function apply() {
|
| 65 |
+
$this->save_db();
|
| 66 |
+
$this->edit();
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
public function save_db() {
|
| 70 |
+
global $wpdb;
|
| 71 |
+
$id = (isset($_POST['current_id']) ? (int)esc_html(stripslashes($_POST['current_id'])) : 0);
|
| 72 |
+
$date = esc_html($_POST['date']);
|
| 73 |
+
$ip = esc_html($_POST['ip']);
|
| 74 |
+
$form_id = (int)$wpdb->get_var("SELECT form_id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "'");
|
| 75 |
+
$form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'");
|
| 76 |
+
$label_id = array();
|
| 77 |
+
$label_order_original = array();
|
| 78 |
+
$label_type = array();
|
| 79 |
+
|
| 80 |
+
if (strpos($form->label_order, 'type_paypal_')) {
|
| 81 |
+
$form->label_order = $form->label_order . "0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
|
| 82 |
+
}
|
| 83 |
+
$label_all = explode('#****#', $form->label_order);
|
| 84 |
+
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
| 85 |
+
foreach ($label_all as $key => $label_each) {
|
| 86 |
+
$label_id_each = explode('#**id**#', $label_each);
|
| 87 |
+
array_push($label_id, $label_id_each[0]);
|
| 88 |
+
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
| 89 |
+
array_push($label_order_original, $label_oder_each[0]);
|
| 90 |
+
array_push($label_type, $label_oder_each[1]);
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
foreach ($label_id as $key => $label_id_1) {
|
| 94 |
+
if (isset($_POST["submission_" . $label_id_1])) {
|
| 95 |
+
$element_value = (isset($_POST["submission_" . $label_id_1]) ? esc_html(stripslashes($_POST["submission_" . $label_id_1])) : " ");
|
| 96 |
+
$query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
|
| 97 |
+
$result = $wpdb->get_var($query);
|
| 98 |
+
if ($label_type[$key] == 'type_file_upload') {
|
| 99 |
+
if ($element_value) {
|
| 100 |
+
$element_value = $element_value . "*@@url@@*";
|
| 101 |
+
}
|
| 102 |
+
}
|
| 103 |
+
if ($result) {
|
| 104 |
+
$save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
|
| 105 |
+
'element_value' => stripslashes($element_value),
|
| 106 |
+
), array(
|
| 107 |
+
'group_id' => $id,
|
| 108 |
+
'element_label' => $label_id_1
|
| 109 |
+
), array(
|
| 110 |
+
'%s',
|
| 111 |
+
), array(
|
| 112 |
+
'%d',
|
| 113 |
+
'%s'
|
| 114 |
+
));
|
| 115 |
+
}
|
| 116 |
+
else {
|
| 117 |
+
$save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
|
| 118 |
+
'form_id' => $form_id,
|
| 119 |
+
'element_label' => $label_id_1,
|
| 120 |
+
'element_value' => stripslashes($element_value),
|
| 121 |
+
'group_id' => $id,
|
| 122 |
+
'date' => $date,
|
| 123 |
+
'ip' => $ip
|
| 124 |
+
), array(
|
| 125 |
+
'%d',
|
| 126 |
+
'%s',
|
| 127 |
+
'%s',
|
| 128 |
+
'%d',
|
| 129 |
+
'%s',
|
| 130 |
+
'%s'
|
| 131 |
+
)
|
| 132 |
+
);
|
| 133 |
+
}
|
| 134 |
+
}
|
| 135 |
+
else {
|
| 136 |
+
if (isset($_POST["submission_" . $label_id_1 . '_0'])) {
|
| 137 |
+
$element_value = '';
|
| 138 |
+
for ($z = 0; $z < 21; $z++) {
|
| 139 |
+
$element_value_ch = isset($_POST["submission_" . $label_id_1 . '_' . $z]) ? $_POST["submission_" . $label_id_1 . '_' . $z] : null;
|
| 140 |
+
if (isset($element_value_ch)) {
|
| 141 |
+
$element_value = $element_value . $element_value_ch . '***br***';
|
| 142 |
+
}
|
| 143 |
+
else {
|
| 144 |
+
break;
|
| 145 |
+
}
|
| 146 |
+
}
|
| 147 |
+
$query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
|
| 148 |
+
$result = $wpdb->get_var($query);
|
| 149 |
+
if ($result) {
|
| 150 |
+
$save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
|
| 151 |
+
'element_value' => stripslashes($element_value),
|
| 152 |
+
), array(
|
| 153 |
+
'group_id' => $id,
|
| 154 |
+
'element_label' => $label_id_1
|
| 155 |
+
), array(
|
| 156 |
+
'%s',
|
| 157 |
+
), array(
|
| 158 |
+
'%d',
|
| 159 |
+
'%s'
|
| 160 |
+
));
|
| 161 |
+
}
|
| 162 |
+
else {
|
| 163 |
+
$save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
|
| 164 |
+
'form_id' => $form_id,
|
| 165 |
+
'element_label' => $label_id_1,
|
| 166 |
+
'element_value' => stripslashes($element_value),
|
| 167 |
+
'group_id' => $id,
|
| 168 |
+
'date' => $date,
|
| 169 |
+
'ip' => $ip
|
| 170 |
+
), array(
|
| 171 |
+
'%d',
|
| 172 |
+
'%s',
|
| 173 |
+
'%s',
|
| 174 |
+
'%d',
|
| 175 |
+
'%s',
|
| 176 |
+
'%s'
|
| 177 |
+
)
|
| 178 |
+
);
|
| 179 |
+
}
|
| 180 |
+
}
|
| 181 |
+
}
|
| 182 |
+
}
|
| 183 |
+
if ($save !== FALSE) {
|
| 184 |
+
echo WDW_FM_Library::message('Submission Succesfully Saved.', 'updated');
|
| 185 |
+
}
|
| 186 |
+
else {
|
| 187 |
+
echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
|
| 188 |
+
}
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
public function delete($id) {
|
| 192 |
+
global $wpdb;
|
| 193 |
+
$form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
|
| 194 |
+
$query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id="%d"', $id);
|
| 195 |
+
if ($wpdb->query($query)) {
|
| 196 |
+
echo WDW_FM_Library::message('Item Succesfully Deleted.', 'updated');
|
| 197 |
+
}
|
| 198 |
+
else {
|
| 199 |
+
echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
|
| 200 |
+
}
|
| 201 |
+
|
| 202 |
+
$query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE form_id="%d" AND group_id="%d"', $form_id, $id);
|
| 203 |
+
$wpdb->query($query);
|
| 204 |
+
|
| 205 |
+
$this->display($form_id);
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
public function delete_all() {
|
| 209 |
+
global $wpdb;
|
| 210 |
+
$form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
|
| 211 |
+
$cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
|
| 212 |
+
if (count($cid)) {
|
| 213 |
+
array_walk($cid, create_function('&$value', '$value = (int)$value;'));
|
| 214 |
+
$cids = implode(',', $cid);
|
| 215 |
+
$query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )';
|
| 216 |
+
|
| 217 |
+
if ($wpdb->query($query)) {
|
| 218 |
+
echo WDW_FM_Library::message('Items Succesfully Deleted.', 'updated');
|
| 219 |
+
}
|
| 220 |
+
else {
|
| 221 |
+
echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
$query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE form_id="%d" AND group_id IN ( "%s" )', $form_id, $cids);
|
| 225 |
+
$wpdb->query($query);
|
| 226 |
+
}
|
| 227 |
+
else {
|
| 228 |
+
echo WDW_FM_Library::message('You must select at least one item.', 'error');
|
| 229 |
+
}
|
| 230 |
+
$this->display($form_id);
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
public function block_ip() {
|
| 234 |
+
global $wpdb;
|
| 235 |
+
$flag = FALSE;
|
| 236 |
+
$form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
|
| 237 |
+
$cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
|
| 238 |
+
if (count($cid)) {
|
| 239 |
+
array_walk($cid, create_function('&$value', '$value = (int)$value;'));
|
| 240 |
+
$cids = implode(',', $cid);
|
| 241 |
+
$query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )';
|
| 242 |
+
$rows = $wpdb->get_results($query);
|
| 243 |
+
foreach ($rows as $row) {
|
| 244 |
+
$ips = $wpdb->get_var($wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $row->ip));
|
| 245 |
+
$flag = TRUE;
|
| 246 |
+
if (!$ips) {
|
| 247 |
+
$save = $wpdb->insert($wpdb->prefix . 'formmaker_blocked', array(
|
| 248 |
+
'ip' => $row->ip,
|
| 249 |
+
), array(
|
| 250 |
+
'%s',
|
| 251 |
+
));
|
| 252 |
+
}
|
| 253 |
+
}
|
| 254 |
+
}
|
| 255 |
+
if ($flag) {
|
| 256 |
+
echo WDW_FM_Library::message('IPs Succesfully Blocked.', 'updated');
|
| 257 |
+
}
|
| 258 |
+
else {
|
| 259 |
+
echo WDW_FM_Library::message('You must select at least one item.', 'error');
|
| 260 |
+
}
|
| 261 |
+
$this->display($form_id);
|
| 262 |
+
}
|
| 263 |
+
|
| 264 |
+
public function unblock_ip() {
|
| 265 |
+
global $wpdb;
|
| 266 |
+
$flag = FALSE;
|
| 267 |
+
$form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
|
| 268 |
+
$cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
|
| 269 |
+
if (count($cid)) {
|
| 270 |
+
array_walk($cid, create_function('&$value', '$value = (int)$value;'));
|
| 271 |
+
$cids = implode(',', $cid);
|
| 272 |
+
$query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )';
|
| 273 |
+
$rows = $wpdb->get_results($query);
|
| 274 |
+
foreach ($rows as $row) {
|
| 275 |
+
$flag = TRUE;
|
| 276 |
+
$ips = $wpdb->get_var($wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $row->ip));
|
| 277 |
+
if ($ips) {
|
| 278 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $ips));
|
| 279 |
+
}
|
| 280 |
+
}
|
| 281 |
+
}
|
| 282 |
+
if ($flag) {
|
| 283 |
+
echo WDW_FM_Library::message('IPs Succesfully Unblocked.', 'updated');
|
| 284 |
+
}
|
| 285 |
+
else {
|
| 286 |
+
echo WDW_FM_Library::message('You must select at least one item.', 'error');
|
| 287 |
+
}
|
| 288 |
+
$this->display($form_id);
|
| 289 |
+
}
|
| 290 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 291 |
}
|
admin/controllers/FMControllerThemes_fm.php
CHANGED
|
@@ -1,219 +1,219 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMControllerThemes_fm {
|
| 4 |
-
|
| 5 |
-
public function execute() {
|
| 6 |
-
$task = WDW_FM_Library::get('task');
|
| 7 |
-
$id = (int)WDW_FM_Library::get('current_id', 0);
|
| 8 |
-
$message = WDW_FM_Library::get('message');
|
| 9 |
-
echo WDW_FM_Library::message_id($message);
|
| 10 |
-
if (method_exists($this, $task)) {
|
| 11 |
-
check_admin_referer('nonce_fm', 'nonce_fm');
|
| 12 |
-
$this->$task($id);
|
| 13 |
-
}
|
| 14 |
-
else {
|
| 15 |
-
$this->display();
|
| 16 |
-
}
|
| 17 |
-
}
|
| 18 |
-
|
| 19 |
-
public function display() {
|
| 20 |
-
require_once WD_FM_DIR . "/admin/models/FMModelThemes_fm.php";
|
| 21 |
-
$model = new FMModelThemes_fm();
|
| 22 |
-
|
| 23 |
-
require_once WD_FM_DIR . "/admin/views/FMViewThemes_fm.php";
|
| 24 |
-
$view = new FMViewThemes_fm($model);
|
| 25 |
-
$view->display();
|
| 26 |
-
}
|
| 27 |
-
|
| 28 |
-
public function add() {
|
| 29 |
-
require_once WD_FM_DIR . "/admin/models/FMModelThemes_fm.php";
|
| 30 |
-
$model = new FMModelThemes_fm();
|
| 31 |
-
|
| 32 |
-
require_once WD_FM_DIR . "/admin/views/FMViewThemes_fm.php";
|
| 33 |
-
$view = new FMViewThemes_fm($model);
|
| 34 |
-
$view->edit(0, FALSE);
|
| 35 |
-
}
|
| 36 |
-
|
| 37 |
-
public function edit() {
|
| 38 |
-
require_once WD_FM_DIR . "/admin/models/FMModelThemes_fm.php";
|
| 39 |
-
$model = new FMModelThemes_fm();
|
| 40 |
-
|
| 41 |
-
require_once WD_FM_DIR . "/admin/views/FMViewThemes_fm.php";
|
| 42 |
-
$view = new FMViewThemes_fm($model);
|
| 43 |
-
$id = (int)WDW_FM_Library::get('current_id', 0);
|
| 44 |
-
$view->edit($id, FALSE);
|
| 45 |
-
}
|
| 46 |
-
|
| 47 |
-
public function save() {
|
| 48 |
-
$message = $this->save_db();
|
| 49 |
-
$page = WDW_FM_Library::get('page');
|
| 50 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 51 |
-
}
|
| 52 |
-
|
| 53 |
-
public function apply() {
|
| 54 |
-
$message = $this->save_db();
|
| 55 |
-
global $wpdb;
|
| 56 |
-
$id = (int) $wpdb->get_var('SELECT MAX(`id`) FROM ' . $wpdb->prefix . 'formmaker_themes');
|
| 57 |
-
$current_id = (int)WDW_FM_Library::get('current_id', $id);
|
| 58 |
-
$page = WDW_FM_Library::get('page');
|
| 59 |
-
$active_tab = WDW_FM_Library::get('active_tab');
|
| 60 |
-
$pagination = WDW_FM_Library::get('pagination-type');
|
| 61 |
-
$form_type = WDW_FM_Library::get('form_type');
|
| 62 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message, 'active_tab' => $active_tab, 'pagination' => $pagination, 'form_type' => $form_type), admin_url('admin.php')));
|
| 63 |
-
}
|
| 64 |
-
|
| 65 |
-
public function copy_themes() {
|
| 66 |
-
global $wpdb;
|
| 67 |
-
$theme_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_themes');
|
| 68 |
-
foreach ($theme_ids_col as $theme_id) {
|
| 69 |
-
if (isset($_POST['check_' . $theme_id])) {
|
| 70 |
-
$theme = $wpdb->get_row('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes where id=' . $theme_id);
|
| 71 |
-
$title = $theme->title;
|
| 72 |
-
$params = $theme->css;
|
| 73 |
-
$version = $theme->version;
|
| 74 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker_themes',
|
| 75 |
-
array(
|
| 76 |
-
'title' => $title,
|
| 77 |
-
'css' => $params,
|
| 78 |
-
'version' => $version,
|
| 79 |
-
'default' => 0
|
| 80 |
-
));
|
| 81 |
-
}
|
| 82 |
-
}
|
| 83 |
-
|
| 84 |
-
if ($save !== FALSE) {
|
| 85 |
-
$message = 1;
|
| 86 |
-
}
|
| 87 |
-
else {
|
| 88 |
-
$message = 2;
|
| 89 |
-
}
|
| 90 |
-
|
| 91 |
-
$page = WDW_FM_Library::get('page');
|
| 92 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 93 |
-
}
|
| 94 |
-
|
| 95 |
-
public function save_as_copy() {
|
| 96 |
-
$message = $this->save_db_as_copy();
|
| 97 |
-
$page = WDW_FM_Library::get('page');
|
| 98 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 99 |
-
}
|
| 100 |
-
|
| 101 |
-
public function save_db() {
|
| 102 |
-
global $wpdb;
|
| 103 |
-
$id = (int) WDW_FM_Library::get('current_id', 0);
|
| 104 |
-
$title = (isset($_POST['title']) ? esc_html(stripslashes( $_POST['title'])) : '');
|
| 105 |
-
$version = 2;
|
| 106 |
-
$params = (isset($_POST['params']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['params'])) : '');
|
| 107 |
-
$default = (isset($_POST['default']) ? esc_html(stripslashes( $_POST['default'])) : 0);
|
| 108 |
-
if ($id != 0) {
|
| 109 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker_themes', array(
|
| 110 |
-
'title' => $title,
|
| 111 |
-
'css' => $params,
|
| 112 |
-
'default' => $default,
|
| 113 |
-
), array('id' => $id));
|
| 114 |
-
$version = $wpdb->get_var($wpdb->prepare("SELECT version FROM " . $wpdb->prefix . "formmaker_themes WHERE id=%d", $id));
|
| 115 |
-
}
|
| 116 |
-
else {
|
| 117 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker_themes', array(
|
| 118 |
-
'title' => $title,
|
| 119 |
-
'css' => $params,
|
| 120 |
-
'default' => $default,
|
| 121 |
-
'version' => $version,
|
| 122 |
-
));
|
| 123 |
-
$id = $wpdb->insert_id;
|
| 124 |
-
}
|
| 125 |
-
if ($save !== FALSE) {
|
| 126 |
-
require_once WD_FM_DIR . "/frontend/models/FMModelForm_maker.php";
|
| 127 |
-
$model_frontend = new FMModelForm_maker();
|
| 128 |
-
$form_theme = json_decode(html_entity_decode($params), true);
|
| 129 |
-
$model_frontend->create_css($id, $form_theme, $version == 1, true);
|
| 130 |
-
return 1;
|
| 131 |
-
}
|
| 132 |
-
else {
|
| 133 |
-
return 2;
|
| 134 |
-
}
|
| 135 |
-
}
|
| 136 |
-
|
| 137 |
-
public function save_db_as_copy() {
|
| 138 |
-
global $wpdb;
|
| 139 |
-
$id = (int) WDW_FM_Library::get('current_id', 0);
|
| 140 |
-
$title = isset($_POST['title']) ? esc_html(stripslashes( $_POST['title'])) : '';
|
| 141 |
-
$params = isset($_POST['params']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['params'])) : '';
|
| 142 |
-
$version = $wpdb->get_var($wpdb->prepare("SELECT version FROM " . $wpdb->prefix . "formmaker_themes WHERE id=%d", $id));
|
| 143 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker_themes',
|
| 144 |
-
array(
|
| 145 |
-
'title' => $title,
|
| 146 |
-
'css' => $params,
|
| 147 |
-
'version' => $version,
|
| 148 |
-
'default' => 0
|
| 149 |
-
));
|
| 150 |
-
|
| 151 |
-
if ($save !== FALSE) {
|
| 152 |
-
return 1;
|
| 153 |
-
}
|
| 154 |
-
else {
|
| 155 |
-
return 2;
|
| 156 |
-
}
|
| 157 |
-
}
|
| 158 |
-
|
| 159 |
-
public function delete($id) {
|
| 160 |
-
global $wpdb;
|
| 161 |
-
$isDefault = $wpdb->get_var($wpdb->prepare('SELECT `default` FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
|
| 162 |
-
if ($isDefault) {
|
| 163 |
-
$message = 4;
|
| 164 |
-
}
|
| 165 |
-
else {
|
| 166 |
-
$query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id);
|
| 167 |
-
if ($wpdb->query($query)) {
|
| 168 |
-
$message = 3;
|
| 169 |
-
}
|
| 170 |
-
else {
|
| 171 |
-
$message = 2;
|
| 172 |
-
}
|
| 173 |
-
}
|
| 174 |
-
$page = WDW_FM_Library::get('page');
|
| 175 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 176 |
-
}
|
| 177 |
-
|
| 178 |
-
public function delete_all() {
|
| 179 |
-
global $wpdb;
|
| 180 |
-
$flag = FALSE;
|
| 181 |
-
$isDefault = FALSE;
|
| 182 |
-
$theme_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_themes');
|
| 183 |
-
foreach ($theme_ids_col as $theme_id) {
|
| 184 |
-
if (isset($_POST['check_' . $theme_id])) {
|
| 185 |
-
$isDefault = $wpdb->get_var($wpdb->prepare('SELECT `default` FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $theme_id));
|
| 186 |
-
if ($isDefault) {
|
| 187 |
-
$message = 4;
|
| 188 |
-
}
|
| 189 |
-
else {
|
| 190 |
-
$flag = TRUE;
|
| 191 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $theme_id));
|
| 192 |
-
}
|
| 193 |
-
}
|
| 194 |
-
}
|
| 195 |
-
if ($flag) {
|
| 196 |
-
$message = 5;
|
| 197 |
-
}
|
| 198 |
-
else {
|
| 199 |
-
$message = 6;
|
| 200 |
-
}
|
| 201 |
-
$page = WDW_FM_Library::get('page');
|
| 202 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 203 |
-
}
|
| 204 |
-
|
| 205 |
-
public function setdefault($id) {
|
| 206 |
-
global $wpdb;
|
| 207 |
-
$wpdb->update($wpdb->prefix . 'formmaker_themes', array('default' => 0), array('default' => 1));
|
| 208 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker_themes', array('default' => 1), array('id' => $id));
|
| 209 |
-
if ($save !== FALSE) {
|
| 210 |
-
$message = 7;
|
| 211 |
-
}
|
| 212 |
-
else {
|
| 213 |
-
$message = 2;
|
| 214 |
-
}
|
| 215 |
-
$page = WDW_FM_Library::get('page');
|
| 216 |
-
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 217 |
-
}
|
| 218 |
-
|
| 219 |
-
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMControllerThemes_fm {
|
| 4 |
+
|
| 5 |
+
public function execute() {
|
| 6 |
+
$task = WDW_FM_Library::get('task');
|
| 7 |
+
$id = (int)WDW_FM_Library::get('current_id', 0);
|
| 8 |
+
$message = WDW_FM_Library::get('message');
|
| 9 |
+
echo WDW_FM_Library::message_id($message);
|
| 10 |
+
if (method_exists($this, $task)) {
|
| 11 |
+
check_admin_referer('nonce_fm', 'nonce_fm');
|
| 12 |
+
$this->$task($id);
|
| 13 |
+
}
|
| 14 |
+
else {
|
| 15 |
+
$this->display();
|
| 16 |
+
}
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
public function display() {
|
| 20 |
+
require_once WD_FM_DIR . "/admin/models/FMModelThemes_fm.php";
|
| 21 |
+
$model = new FMModelThemes_fm();
|
| 22 |
+
|
| 23 |
+
require_once WD_FM_DIR . "/admin/views/FMViewThemes_fm.php";
|
| 24 |
+
$view = new FMViewThemes_fm($model);
|
| 25 |
+
$view->display();
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
public function add() {
|
| 29 |
+
require_once WD_FM_DIR . "/admin/models/FMModelThemes_fm.php";
|
| 30 |
+
$model = new FMModelThemes_fm();
|
| 31 |
+
|
| 32 |
+
require_once WD_FM_DIR . "/admin/views/FMViewThemes_fm.php";
|
| 33 |
+
$view = new FMViewThemes_fm($model);
|
| 34 |
+
$view->edit(0, FALSE);
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
public function edit() {
|
| 38 |
+
require_once WD_FM_DIR . "/admin/models/FMModelThemes_fm.php";
|
| 39 |
+
$model = new FMModelThemes_fm();
|
| 40 |
+
|
| 41 |
+
require_once WD_FM_DIR . "/admin/views/FMViewThemes_fm.php";
|
| 42 |
+
$view = new FMViewThemes_fm($model);
|
| 43 |
+
$id = (int)WDW_FM_Library::get('current_id', 0);
|
| 44 |
+
$view->edit($id, FALSE);
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
public function save() {
|
| 48 |
+
$message = $this->save_db();
|
| 49 |
+
$page = WDW_FM_Library::get('page');
|
| 50 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
public function apply() {
|
| 54 |
+
$message = $this->save_db();
|
| 55 |
+
global $wpdb;
|
| 56 |
+
$id = (int) $wpdb->get_var('SELECT MAX(`id`) FROM ' . $wpdb->prefix . 'formmaker_themes');
|
| 57 |
+
$current_id = (int)WDW_FM_Library::get('current_id', $id);
|
| 58 |
+
$page = WDW_FM_Library::get('page');
|
| 59 |
+
$active_tab = WDW_FM_Library::get('active_tab');
|
| 60 |
+
$pagination = WDW_FM_Library::get('pagination-type');
|
| 61 |
+
$form_type = WDW_FM_Library::get('form_type');
|
| 62 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message, 'active_tab' => $active_tab, 'pagination' => $pagination, 'form_type' => $form_type), admin_url('admin.php')));
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
public function copy_themes() {
|
| 66 |
+
global $wpdb;
|
| 67 |
+
$theme_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_themes');
|
| 68 |
+
foreach ($theme_ids_col as $theme_id) {
|
| 69 |
+
if (isset($_POST['check_' . $theme_id])) {
|
| 70 |
+
$theme = $wpdb->get_row('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes where id=' . $theme_id);
|
| 71 |
+
$title = $theme->title;
|
| 72 |
+
$params = $theme->css;
|
| 73 |
+
$version = $theme->version;
|
| 74 |
+
$save = $wpdb->insert($wpdb->prefix . 'formmaker_themes',
|
| 75 |
+
array(
|
| 76 |
+
'title' => $title,
|
| 77 |
+
'css' => $params,
|
| 78 |
+
'version' => $version,
|
| 79 |
+
'default' => 0
|
| 80 |
+
));
|
| 81 |
+
}
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
if ($save !== FALSE) {
|
| 85 |
+
$message = 1;
|
| 86 |
+
}
|
| 87 |
+
else {
|
| 88 |
+
$message = 2;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
$page = WDW_FM_Library::get('page');
|
| 92 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
public function save_as_copy() {
|
| 96 |
+
$message = $this->save_db_as_copy();
|
| 97 |
+
$page = WDW_FM_Library::get('page');
|
| 98 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
public function save_db() {
|
| 102 |
+
global $wpdb;
|
| 103 |
+
$id = (int) WDW_FM_Library::get('current_id', 0);
|
| 104 |
+
$title = (isset($_POST['title']) ? esc_html(stripslashes( $_POST['title'])) : '');
|
| 105 |
+
$version = 2;
|
| 106 |
+
$params = (isset($_POST['params']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['params'])) : '');
|
| 107 |
+
$default = (isset($_POST['default']) ? esc_html(stripslashes( $_POST['default'])) : 0);
|
| 108 |
+
if ($id != 0) {
|
| 109 |
+
$save = $wpdb->update($wpdb->prefix . 'formmaker_themes', array(
|
| 110 |
+
'title' => $title,
|
| 111 |
+
'css' => $params,
|
| 112 |
+
'default' => $default,
|
| 113 |
+
), array('id' => $id));
|
| 114 |
+
$version = $wpdb->get_var($wpdb->prepare("SELECT version FROM " . $wpdb->prefix . "formmaker_themes WHERE id=%d", $id));
|
| 115 |
+
}
|
| 116 |
+
else {
|
| 117 |
+
$save = $wpdb->insert($wpdb->prefix . 'formmaker_themes', array(
|
| 118 |
+
'title' => $title,
|
| 119 |
+
'css' => $params,
|
| 120 |
+
'default' => $default,
|
| 121 |
+
'version' => $version,
|
| 122 |
+
));
|
| 123 |
+
$id = $wpdb->insert_id;
|
| 124 |
+
}
|
| 125 |
+
if ($save !== FALSE) {
|
| 126 |
+
require_once WD_FM_DIR . "/frontend/models/FMModelForm_maker.php";
|
| 127 |
+
$model_frontend = new FMModelForm_maker();
|
| 128 |
+
$form_theme = json_decode(html_entity_decode($params), true);
|
| 129 |
+
$model_frontend->create_css($id, $form_theme, $version == 1, true);
|
| 130 |
+
return 1;
|
| 131 |
+
}
|
| 132 |
+
else {
|
| 133 |
+
return 2;
|
| 134 |
+
}
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
public function save_db_as_copy() {
|
| 138 |
+
global $wpdb;
|
| 139 |
+
$id = (int) WDW_FM_Library::get('current_id', 0);
|
| 140 |
+
$title = isset($_POST['title']) ? esc_html(stripslashes( $_POST['title'])) : '';
|
| 141 |
+
$params = isset($_POST['params']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['params'])) : '';
|
| 142 |
+
$version = $wpdb->get_var($wpdb->prepare("SELECT version FROM " . $wpdb->prefix . "formmaker_themes WHERE id=%d", $id));
|
| 143 |
+
$save = $wpdb->insert($wpdb->prefix . 'formmaker_themes',
|
| 144 |
+
array(
|
| 145 |
+
'title' => $title,
|
| 146 |
+
'css' => $params,
|
| 147 |
+
'version' => $version,
|
| 148 |
+
'default' => 0
|
| 149 |
+
));
|
| 150 |
+
|
| 151 |
+
if ($save !== FALSE) {
|
| 152 |
+
return 1;
|
| 153 |
+
}
|
| 154 |
+
else {
|
| 155 |
+
return 2;
|
| 156 |
+
}
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
public function delete($id) {
|
| 160 |
+
global $wpdb;
|
| 161 |
+
$isDefault = $wpdb->get_var($wpdb->prepare('SELECT `default` FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
|
| 162 |
+
if ($isDefault) {
|
| 163 |
+
$message = 4;
|
| 164 |
+
}
|
| 165 |
+
else {
|
| 166 |
+
$query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id);
|
| 167 |
+
if ($wpdb->query($query)) {
|
| 168 |
+
$message = 3;
|
| 169 |
+
}
|
| 170 |
+
else {
|
| 171 |
+
$message = 2;
|
| 172 |
+
}
|
| 173 |
+
}
|
| 174 |
+
$page = WDW_FM_Library::get('page');
|
| 175 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
public function delete_all() {
|
| 179 |
+
global $wpdb;
|
| 180 |
+
$flag = FALSE;
|
| 181 |
+
$isDefault = FALSE;
|
| 182 |
+
$theme_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_themes');
|
| 183 |
+
foreach ($theme_ids_col as $theme_id) {
|
| 184 |
+
if (isset($_POST['check_' . $theme_id])) {
|
| 185 |
+
$isDefault = $wpdb->get_var($wpdb->prepare('SELECT `default` FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $theme_id));
|
| 186 |
+
if ($isDefault) {
|
| 187 |
+
$message = 4;
|
| 188 |
+
}
|
| 189 |
+
else {
|
| 190 |
+
$flag = TRUE;
|
| 191 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $theme_id));
|
| 192 |
+
}
|
| 193 |
+
}
|
| 194 |
+
}
|
| 195 |
+
if ($flag) {
|
| 196 |
+
$message = 5;
|
| 197 |
+
}
|
| 198 |
+
else {
|
| 199 |
+
$message = 6;
|
| 200 |
+
}
|
| 201 |
+
$page = WDW_FM_Library::get('page');
|
| 202 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
public function setdefault($id) {
|
| 206 |
+
global $wpdb;
|
| 207 |
+
$wpdb->update($wpdb->prefix . 'formmaker_themes', array('default' => 0), array('default' => 1));
|
| 208 |
+
$save = $wpdb->update($wpdb->prefix . 'formmaker_themes', array('default' => 1), array('id' => $id));
|
| 209 |
+
if ($save !== FALSE) {
|
| 210 |
+
$message = 7;
|
| 211 |
+
}
|
| 212 |
+
else {
|
| 213 |
+
$message = 2;
|
| 214 |
+
}
|
| 215 |
+
$page = WDW_FM_Library::get('page');
|
| 216 |
+
WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
}
|
admin/controllers/FMControllerUninstall_fm.php
CHANGED
|
@@ -1,66 +1,66 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMControllerUninstall_fm {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
global $fm_options;
|
| 18 |
-
if (!class_exists("DoradoWebConfig")) {
|
| 19 |
-
include_once(WD_FM_DIR . "/wd/config.php");
|
| 20 |
-
}
|
| 21 |
-
$config = new DoradoWebConfig();
|
| 22 |
-
$config->set_options($fm_options);
|
| 23 |
-
$deactivate_reasons = new DoradoWebDeactivate($config);
|
| 24 |
-
$deactivate_reasons->submit_and_deactivate();
|
| 25 |
-
}
|
| 26 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 27 |
-
// Public Methods //
|
| 28 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 29 |
-
public function execute() {
|
| 30 |
-
$task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
|
| 31 |
-
if (method_exists($this, $task)) {
|
| 32 |
-
check_admin_referer('nonce_fm', 'nonce_fm');
|
| 33 |
-
$this->$task();
|
| 34 |
-
}
|
| 35 |
-
else {
|
| 36 |
-
$this->display();
|
| 37 |
-
}
|
| 38 |
-
}
|
| 39 |
-
|
| 40 |
-
public function display() {
|
| 41 |
-
require_once WD_FM_DIR . "/admin/models/FMModelUninstall_fm.php";
|
| 42 |
-
$model = new FMModelUninstall_fm();
|
| 43 |
-
|
| 44 |
-
require_once WD_FM_DIR . "/admin/views/FMViewUninstall_fm.php";
|
| 45 |
-
$view = new FMViewUninstall_fm($model);
|
| 46 |
-
$view->display();
|
| 47 |
-
}
|
| 48 |
-
|
| 49 |
-
public function uninstall() {
|
| 50 |
-
require_once WD_FM_DIR . "/admin/models/FMModelUninstall_fm.php";
|
| 51 |
-
$model = new FMModelUninstall_fm();
|
| 52 |
-
|
| 53 |
-
require_once WD_FM_DIR . "/admin/views/FMViewUninstall_fm.php";
|
| 54 |
-
$view = new FMViewUninstall_fm($model);
|
| 55 |
-
$view->uninstall();
|
| 56 |
-
}
|
| 57 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 58 |
-
// Getters & Setters //
|
| 59 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 60 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 61 |
-
// Private Methods //
|
| 62 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 63 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 64 |
-
// Listeners //
|
| 65 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 66 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMControllerUninstall_fm {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
global $fm_options;
|
| 18 |
+
if (!class_exists("DoradoWebConfig")) {
|
| 19 |
+
include_once(WD_FM_DIR . "/wd/config.php");
|
| 20 |
+
}
|
| 21 |
+
$config = new DoradoWebConfig();
|
| 22 |
+
$config->set_options($fm_options);
|
| 23 |
+
$deactivate_reasons = new DoradoWebDeactivate($config);
|
| 24 |
+
$deactivate_reasons->submit_and_deactivate();
|
| 25 |
+
}
|
| 26 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 27 |
+
// Public Methods //
|
| 28 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 29 |
+
public function execute() {
|
| 30 |
+
$task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
|
| 31 |
+
if (method_exists($this, $task)) {
|
| 32 |
+
check_admin_referer('nonce_fm', 'nonce_fm');
|
| 33 |
+
$this->$task();
|
| 34 |
+
}
|
| 35 |
+
else {
|
| 36 |
+
$this->display();
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
public function display() {
|
| 41 |
+
require_once WD_FM_DIR . "/admin/models/FMModelUninstall_fm.php";
|
| 42 |
+
$model = new FMModelUninstall_fm();
|
| 43 |
+
|
| 44 |
+
require_once WD_FM_DIR . "/admin/views/FMViewUninstall_fm.php";
|
| 45 |
+
$view = new FMViewUninstall_fm($model);
|
| 46 |
+
$view->display();
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
public function uninstall() {
|
| 50 |
+
require_once WD_FM_DIR . "/admin/models/FMModelUninstall_fm.php";
|
| 51 |
+
$model = new FMModelUninstall_fm();
|
| 52 |
+
|
| 53 |
+
require_once WD_FM_DIR . "/admin/views/FMViewUninstall_fm.php";
|
| 54 |
+
$view = new FMViewUninstall_fm($model);
|
| 55 |
+
$view->uninstall();
|
| 56 |
+
}
|
| 57 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 58 |
+
// Getters & Setters //
|
| 59 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 60 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 61 |
+
// Private Methods //
|
| 62 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 63 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 64 |
+
// Listeners //
|
| 65 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 66 |
}
|
admin/controllers/FMControllerWidget.php
CHANGED
|
@@ -1,61 +1,61 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMControllerWidget extends WP_Widget {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
private $view;
|
| 14 |
-
private $model;
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
// Constructor & Destructor //
|
| 17 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 18 |
-
public function __construct() {
|
| 19 |
-
$widget_ops = array(
|
| 20 |
-
'classname' => 'form_maker_widget',
|
| 21 |
-
'description' => 'Add Form Maker widget.'
|
| 22 |
-
);
|
| 23 |
-
// Widget Control Settings.
|
| 24 |
-
$control_ops = array('id_base' => 'form_maker_widget');
|
| 25 |
-
// Create the widget.
|
| 26 |
-
parent::__construct('form_maker_widget', 'Form Maker', $widget_ops, $control_ops);
|
| 27 |
-
require_once WD_FM_DIR . "/admin/models/FMModelWidget.php";
|
| 28 |
-
$this->model = new FMModelWidget();
|
| 29 |
-
|
| 30 |
-
require_once WD_FM_DIR . "/admin/views/FMViewWidget.php";
|
| 31 |
-
$this->view = new FMViewWidget($this->model);
|
| 32 |
-
}
|
| 33 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 34 |
-
// Public Methods //
|
| 35 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 36 |
-
|
| 37 |
-
public function widget($args, $instance) {
|
| 38 |
-
$this->view->widget($args, $instance);
|
| 39 |
-
}
|
| 40 |
-
|
| 41 |
-
public function form( $instance ) {
|
| 42 |
-
$this->view->form($instance, parent::get_field_id('title'), parent::get_field_name('title'), parent::get_field_id('form_id'), parent::get_field_name('form_id'));
|
| 43 |
-
}
|
| 44 |
-
|
| 45 |
-
// Update Settings.
|
| 46 |
-
public function update($new_instance, $old_instance) {
|
| 47 |
-
$instance['title'] = $new_instance['title'];
|
| 48 |
-
$instance['form_id'] = $new_instance['form_id'];
|
| 49 |
-
return $instance;
|
| 50 |
-
}
|
| 51 |
-
|
| 52 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 53 |
-
// Getters & Setters //
|
| 54 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 55 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 56 |
-
// Private Methods //
|
| 57 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 58 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 59 |
-
// Listeners //
|
| 60 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 61 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMControllerWidget extends WP_Widget {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
private $view;
|
| 14 |
+
private $model;
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
// Constructor & Destructor //
|
| 17 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 18 |
+
public function __construct() {
|
| 19 |
+
$widget_ops = array(
|
| 20 |
+
'classname' => 'form_maker_widget',
|
| 21 |
+
'description' => 'Add Form Maker widget.'
|
| 22 |
+
);
|
| 23 |
+
// Widget Control Settings.
|
| 24 |
+
$control_ops = array('id_base' => 'form_maker_widget');
|
| 25 |
+
// Create the widget.
|
| 26 |
+
parent::__construct('form_maker_widget', 'Form Maker', $widget_ops, $control_ops);
|
| 27 |
+
require_once WD_FM_DIR . "/admin/models/FMModelWidget.php";
|
| 28 |
+
$this->model = new FMModelWidget();
|
| 29 |
+
|
| 30 |
+
require_once WD_FM_DIR . "/admin/views/FMViewWidget.php";
|
| 31 |
+
$this->view = new FMViewWidget($this->model);
|
| 32 |
+
}
|
| 33 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 34 |
+
// Public Methods //
|
| 35 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 36 |
+
|
| 37 |
+
public function widget($args, $instance) {
|
| 38 |
+
$this->view->widget($args, $instance);
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
public function form( $instance ) {
|
| 42 |
+
$this->view->form($instance, parent::get_field_id('title'), parent::get_field_name('title'), parent::get_field_id('form_id'), parent::get_field_name('form_id'));
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
// Update Settings.
|
| 46 |
+
public function update($new_instance, $old_instance) {
|
| 47 |
+
$instance['title'] = $new_instance['title'];
|
| 48 |
+
$instance['form_id'] = $new_instance['form_id'];
|
| 49 |
+
return $instance;
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 53 |
+
// Getters & Setters //
|
| 54 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 55 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 56 |
+
// Private Methods //
|
| 57 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 58 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 59 |
+
// Listeners //
|
| 60 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 61 |
}
|
admin/models/FMModelBlocked_ips_fm.php
CHANGED
|
@@ -1,75 +1,75 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMModelBlocked_ips_fm {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
public function get_rows_data() {
|
| 22 |
-
global $wpdb;
|
| 23 |
-
$where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE `ip` LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
|
| 24 |
-
$asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
|
| 25 |
-
$order_by_array = array('id', 'ip');
|
| 26 |
-
$order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
|
| 27 |
-
$order_by = ' ORDER BY `' . $order_by . '` ' . $asc_or_desc;
|
| 28 |
-
if (isset($_POST['page_number']) && $_POST['page_number']) {
|
| 29 |
-
$limit = ((int) $_POST['page_number'] - 1) * 20;
|
| 30 |
-
}
|
| 31 |
-
else {
|
| 32 |
-
$limit = 0;
|
| 33 |
-
}
|
| 34 |
-
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker_blocked " . $where . $order_by . " LIMIT " . $limit . ",20";
|
| 35 |
-
$rows = $wpdb->get_results($query);
|
| 36 |
-
return $rows;
|
| 37 |
-
}
|
| 38 |
-
|
| 39 |
-
public function get_row_data($id) {
|
| 40 |
-
global $wpdb;
|
| 41 |
-
if ($id != 0) {
|
| 42 |
-
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $id));
|
| 43 |
-
}
|
| 44 |
-
else {
|
| 45 |
-
$row->id = 0;
|
| 46 |
-
$row->ip = '';
|
| 47 |
-
}
|
| 48 |
-
return $row;
|
| 49 |
-
}
|
| 50 |
-
|
| 51 |
-
public function page_nav() {
|
| 52 |
-
global $wpdb;
|
| 53 |
-
$where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE `ip` LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
|
| 54 |
-
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_blocked " . $where;
|
| 55 |
-
$total = $wpdb->get_var($query);
|
| 56 |
-
$page_nav['total'] = $total;
|
| 57 |
-
if (isset($_POST['page_number']) && $_POST['page_number']) {
|
| 58 |
-
$limit = ((int) $_POST['page_number'] - 1) * 20;
|
| 59 |
-
}
|
| 60 |
-
else {
|
| 61 |
-
$limit = 0;
|
| 62 |
-
}
|
| 63 |
-
$page_nav['limit'] = (int) ($limit / 20 + 1);
|
| 64 |
-
return $page_nav;
|
| 65 |
-
}
|
| 66 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 67 |
-
// Getters & Setters //
|
| 68 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 69 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 70 |
-
// Private Methods //
|
| 71 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 72 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 73 |
-
// Listeners //
|
| 74 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 75 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMModelBlocked_ips_fm {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
public function get_rows_data() {
|
| 22 |
+
global $wpdb;
|
| 23 |
+
$where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE `ip` LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
|
| 24 |
+
$asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
|
| 25 |
+
$order_by_array = array('id', 'ip');
|
| 26 |
+
$order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
|
| 27 |
+
$order_by = ' ORDER BY `' . $order_by . '` ' . $asc_or_desc;
|
| 28 |
+
if (isset($_POST['page_number']) && $_POST['page_number']) {
|
| 29 |
+
$limit = ((int) $_POST['page_number'] - 1) * 20;
|
| 30 |
+
}
|
| 31 |
+
else {
|
| 32 |
+
$limit = 0;
|
| 33 |
+
}
|
| 34 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker_blocked " . $where . $order_by . " LIMIT " . $limit . ",20";
|
| 35 |
+
$rows = $wpdb->get_results($query);
|
| 36 |
+
return $rows;
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
public function get_row_data($id) {
|
| 40 |
+
global $wpdb;
|
| 41 |
+
if ($id != 0) {
|
| 42 |
+
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $id));
|
| 43 |
+
}
|
| 44 |
+
else {
|
| 45 |
+
$row->id = 0;
|
| 46 |
+
$row->ip = '';
|
| 47 |
+
}
|
| 48 |
+
return $row;
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
public function page_nav() {
|
| 52 |
+
global $wpdb;
|
| 53 |
+
$where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE `ip` LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
|
| 54 |
+
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_blocked " . $where;
|
| 55 |
+
$total = $wpdb->get_var($query);
|
| 56 |
+
$page_nav['total'] = $total;
|
| 57 |
+
if (isset($_POST['page_number']) && $_POST['page_number']) {
|
| 58 |
+
$limit = ((int) $_POST['page_number'] - 1) * 20;
|
| 59 |
+
}
|
| 60 |
+
else {
|
| 61 |
+
$limit = 0;
|
| 62 |
+
}
|
| 63 |
+
$page_nav['limit'] = (int) ($limit / 20 + 1);
|
| 64 |
+
return $page_nav;
|
| 65 |
+
}
|
| 66 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 67 |
+
// Getters & Setters //
|
| 68 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 69 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 70 |
+
// Private Methods //
|
| 71 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 72 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 73 |
+
// Listeners //
|
| 74 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 75 |
}
|
admin/models/FMModelFormMakerPreview.php
CHANGED
|
@@ -1,36 +1,36 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMModelFormMakerPreview {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
|
| 22 |
-
public function get_form($form_id) {
|
| 23 |
-
global $wpdb;
|
| 24 |
-
$form = $wpdb->get_var($wpdb->prepare('SELECT form_front FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
|
| 25 |
-
return $form;
|
| 26 |
-
}
|
| 27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 28 |
-
// Getters & Setters //
|
| 29 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 30 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 31 |
-
// Private Methods //
|
| 32 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 33 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 34 |
-
// Listeners //
|
| 35 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 36 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMModelFormMakerPreview {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
|
| 22 |
+
public function get_form($form_id) {
|
| 23 |
+
global $wpdb;
|
| 24 |
+
$form = $wpdb->get_var($wpdb->prepare('SELECT form_front FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
|
| 25 |
+
return $form;
|
| 26 |
+
}
|
| 27 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 28 |
+
// Getters & Setters //
|
| 29 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 30 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 31 |
+
// Private Methods //
|
| 32 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 33 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 34 |
+
// Listeners //
|
| 35 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 36 |
}
|
admin/models/FMModelFormMakerSQLMapping.php
CHANGED
|
@@ -1,121 +1,121 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMModelFormMakerSQLMapping {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
|
| 22 |
-
function get_query($id) {
|
| 23 |
-
global $wpdb;
|
| 24 |
-
$rows = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker_query where id=" . $id);
|
| 25 |
-
return $rows;
|
| 26 |
-
}
|
| 27 |
-
|
| 28 |
-
function get_labels($form_id) {
|
| 29 |
-
global $wpdb;
|
| 30 |
-
// $wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
| 31 |
-
// wp_set_wpdb_vars();
|
| 32 |
-
$rows = $wpdb->get_var("SELECT label_order_current FROM " . $wpdb->prefix . "formmaker where id=" . $form_id);
|
| 33 |
-
return $rows;
|
| 34 |
-
}
|
| 35 |
-
|
| 36 |
-
function get_tables() {
|
| 37 |
-
global $wpdb;
|
| 38 |
-
$con_type = $_POST['con_type'];
|
| 39 |
-
|
| 40 |
-
if($con_type == 'local') {
|
| 41 |
-
$query = "SHOW TABLES";
|
| 42 |
-
$tables = $wpdb->get_col($query);
|
| 43 |
-
}
|
| 44 |
-
else if($con_type == 'remote') {
|
| 45 |
-
$username = isset($_POST['username']) ? $_POST['username'] : '';
|
| 46 |
-
$password = isset($_POST['password']) ? $_POST['password'] : '';
|
| 47 |
-
$database = isset($_POST['database']) ? $_POST['database'] : '';
|
| 48 |
-
$host = isset($_POST['host']) ? $_POST['host'] : '';
|
| 49 |
-
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
| 50 |
-
$query = "SHOW TABLES";
|
| 51 |
-
$tables = $wpdb_temp->get_col($query);
|
| 52 |
-
}
|
| 53 |
-
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
| 54 |
-
return $tables;
|
| 55 |
-
}
|
| 56 |
-
|
| 57 |
-
function get_tables_saved($con_type, $username, $password, $database, $host) {
|
| 58 |
-
global $wpdb;
|
| 59 |
-
|
| 60 |
-
if($con_type == 'local') {
|
| 61 |
-
$query = "SHOW TABLES";
|
| 62 |
-
$tables = $wpdb->get_col($query);
|
| 63 |
-
}
|
| 64 |
-
else if($con_type == 'remote') {
|
| 65 |
-
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
| 66 |
-
$query = "SHOW TABLES";
|
| 67 |
-
$tables = $wpdb_temp->get_col($query);
|
| 68 |
-
}
|
| 69 |
-
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
| 70 |
-
return $tables;
|
| 71 |
-
}
|
| 72 |
-
|
| 73 |
-
function get_table_struct() {
|
| 74 |
-
global $wpdb;
|
| 75 |
-
$name = isset($_POST['name']) ? $_POST['name'] : NULL;
|
| 76 |
-
if(!$name)
|
| 77 |
-
return array();
|
| 78 |
-
$con_method = $_POST['con_method'];
|
| 79 |
-
$con_type = $_POST['con_type'];
|
| 80 |
-
$query = "SHOW COLUMNS FROM " . $name;
|
| 81 |
-
if($con_type == 'remote') {
|
| 82 |
-
$username = isset($_POST['username']) ? $_POST['username'] : '';
|
| 83 |
-
$password = isset($_POST['password']) ? $_POST['password'] : '';
|
| 84 |
-
$database = isset($_POST['database']) ? $_POST['database'] : '';
|
| 85 |
-
$host = isset($_POST['host']) ? $_POST['host'] : '';
|
| 86 |
-
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
| 87 |
-
$table_struct = $wpdb_temp->get_results($query);
|
| 88 |
-
}
|
| 89 |
-
else {
|
| 90 |
-
$table_struct = $wpdb->get_results($query);
|
| 91 |
-
}
|
| 92 |
-
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
| 93 |
-
return $table_struct;
|
| 94 |
-
}
|
| 95 |
-
|
| 96 |
-
function get_table_struct_saved($con_type, $username, $password, $database, $host, $name, $con_method) {
|
| 97 |
-
global $wpdb;
|
| 98 |
-
if(!$name)
|
| 99 |
-
return array();
|
| 100 |
-
$query = "SHOW COLUMNS FROM " . $name;
|
| 101 |
-
if($con_type == 'remote') {
|
| 102 |
-
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
| 103 |
-
$table_struct = $wpdb_temp->get_results($query);
|
| 104 |
-
}
|
| 105 |
-
else {
|
| 106 |
-
$table_struct = $wpdb->get_results($query);
|
| 107 |
-
}
|
| 108 |
-
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
| 109 |
-
return $table_struct;
|
| 110 |
-
}
|
| 111 |
-
|
| 112 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 113 |
-
// Getters & Setters //
|
| 114 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 115 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 116 |
-
// Private Methods //
|
| 117 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 118 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 119 |
-
// Listeners //
|
| 120 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 121 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMModelFormMakerSQLMapping {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
|
| 22 |
+
function get_query($id) {
|
| 23 |
+
global $wpdb;
|
| 24 |
+
$rows = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker_query where id=" . $id);
|
| 25 |
+
return $rows;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
function get_labels($form_id) {
|
| 29 |
+
global $wpdb;
|
| 30 |
+
// $wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
| 31 |
+
// wp_set_wpdb_vars();
|
| 32 |
+
$rows = $wpdb->get_var("SELECT label_order_current FROM " . $wpdb->prefix . "formmaker where id=" . $form_id);
|
| 33 |
+
return $rows;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
function get_tables() {
|
| 37 |
+
global $wpdb;
|
| 38 |
+
$con_type = $_POST['con_type'];
|
| 39 |
+
|
| 40 |
+
if($con_type == 'local') {
|
| 41 |
+
$query = "SHOW TABLES";
|
| 42 |
+
$tables = $wpdb->get_col($query);
|
| 43 |
+
}
|
| 44 |
+
else if($con_type == 'remote') {
|
| 45 |
+
$username = isset($_POST['username']) ? $_POST['username'] : '';
|
| 46 |
+
$password = isset($_POST['password']) ? $_POST['password'] : '';
|
| 47 |
+
$database = isset($_POST['database']) ? $_POST['database'] : '';
|
| 48 |
+
$host = isset($_POST['host']) ? $_POST['host'] : '';
|
| 49 |
+
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
| 50 |
+
$query = "SHOW TABLES";
|
| 51 |
+
$tables = $wpdb_temp->get_col($query);
|
| 52 |
+
}
|
| 53 |
+
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
| 54 |
+
return $tables;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
function get_tables_saved($con_type, $username, $password, $database, $host) {
|
| 58 |
+
global $wpdb;
|
| 59 |
+
|
| 60 |
+
if($con_type == 'local') {
|
| 61 |
+
$query = "SHOW TABLES";
|
| 62 |
+
$tables = $wpdb->get_col($query);
|
| 63 |
+
}
|
| 64 |
+
else if($con_type == 'remote') {
|
| 65 |
+
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
| 66 |
+
$query = "SHOW TABLES";
|
| 67 |
+
$tables = $wpdb_temp->get_col($query);
|
| 68 |
+
}
|
| 69 |
+
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
| 70 |
+
return $tables;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
function get_table_struct() {
|
| 74 |
+
global $wpdb;
|
| 75 |
+
$name = isset($_POST['name']) ? $_POST['name'] : NULL;
|
| 76 |
+
if(!$name)
|
| 77 |
+
return array();
|
| 78 |
+
$con_method = $_POST['con_method'];
|
| 79 |
+
$con_type = $_POST['con_type'];
|
| 80 |
+
$query = "SHOW COLUMNS FROM " . $name;
|
| 81 |
+
if($con_type == 'remote') {
|
| 82 |
+
$username = isset($_POST['username']) ? $_POST['username'] : '';
|
| 83 |
+
$password = isset($_POST['password']) ? $_POST['password'] : '';
|
| 84 |
+
$database = isset($_POST['database']) ? $_POST['database'] : '';
|
| 85 |
+
$host = isset($_POST['host']) ? $_POST['host'] : '';
|
| 86 |
+
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
| 87 |
+
$table_struct = $wpdb_temp->get_results($query);
|
| 88 |
+
}
|
| 89 |
+
else {
|
| 90 |
+
$table_struct = $wpdb->get_results($query);
|
| 91 |
+
}
|
| 92 |
+
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
| 93 |
+
return $table_struct;
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
function get_table_struct_saved($con_type, $username, $password, $database, $host, $name, $con_method) {
|
| 97 |
+
global $wpdb;
|
| 98 |
+
if(!$name)
|
| 99 |
+
return array();
|
| 100 |
+
$query = "SHOW COLUMNS FROM " . $name;
|
| 101 |
+
if($con_type == 'remote') {
|
| 102 |
+
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
| 103 |
+
$table_struct = $wpdb_temp->get_results($query);
|
| 104 |
+
}
|
| 105 |
+
else {
|
| 106 |
+
$table_struct = $wpdb->get_results($query);
|
| 107 |
+
}
|
| 108 |
+
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
| 109 |
+
return $table_struct;
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 113 |
+
// Getters & Setters //
|
| 114 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 115 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 116 |
+
// Private Methods //
|
| 117 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 118 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 119 |
+
// Listeners //
|
| 120 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 121 |
}
|
admin/models/FMModelFormMakerSubmits.php
CHANGED
|
@@ -1,43 +1,43 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMModelFormMakerSubmits {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
|
| 22 |
-
public function get_from_label_order($form_id) {
|
| 23 |
-
global $wpdb;
|
| 24 |
-
$label_order = $wpdb->get_var($wpdb->prepare('SELECT `label_order` FROM `' . $wpdb->prefix . 'formmaker` WHERE id="%d"', $form_id));
|
| 25 |
-
return $label_order;
|
| 26 |
-
}
|
| 27 |
-
|
| 28 |
-
public function get_submissions($group_id) {
|
| 29 |
-
global $wpdb;
|
| 30 |
-
$row = $wpdb->get_results($wpdb->prepare('SELECT * FROM `' . $wpdb->prefix . 'formmaker_submits` WHERE group_id="%d"', $group_id));
|
| 31 |
-
return $row;
|
| 32 |
-
}
|
| 33 |
-
|
| 34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
-
// Getters & Setters //
|
| 36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
-
// Private Methods //
|
| 39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
-
// Listeners //
|
| 42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMModelFormMakerSubmits {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
|
| 22 |
+
public function get_from_label_order($form_id) {
|
| 23 |
+
global $wpdb;
|
| 24 |
+
$label_order = $wpdb->get_var($wpdb->prepare('SELECT `label_order` FROM `' . $wpdb->prefix . 'formmaker` WHERE id="%d"', $form_id));
|
| 25 |
+
return $label_order;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
public function get_submissions($group_id) {
|
| 29 |
+
global $wpdb;
|
| 30 |
+
$row = $wpdb->get_results($wpdb->prepare('SELECT * FROM `' . $wpdb->prefix . 'formmaker_submits` WHERE group_id="%d"', $group_id));
|
| 31 |
+
return $row;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
+
// Getters & Setters //
|
| 36 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 37 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
+
// Private Methods //
|
| 39 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 40 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 41 |
+
// Listeners //
|
| 42 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 43 |
}
|
admin/models/FMModelFormmakerwdcaptcha.php
CHANGED
|
@@ -1,31 +1,31 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMModelFormmakerwdcaptcha {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
|
| 22 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 23 |
-
// Getters & Setters //
|
| 24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 25 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 26 |
-
// Private Methods //
|
| 27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 28 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 29 |
-
// Listeners //
|
| 30 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 31 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMModelFormmakerwdcaptcha {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
|
| 22 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 23 |
+
// Getters & Setters //
|
| 24 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 25 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 26 |
+
// Private Methods //
|
| 27 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 28 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 29 |
+
// Listeners //
|
| 30 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 31 |
}
|
admin/models/FMModelFormmakerwdmathcaptcha.php
CHANGED
|
@@ -1,31 +1,31 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMModelFormmakerwdmathcaptcha {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
|
| 22 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 23 |
-
// Getters & Setters //
|
| 24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 25 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 26 |
-
// Private Methods //
|
| 27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 28 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 29 |
-
// Listeners //
|
| 30 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 31 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMModelFormmakerwdmathcaptcha {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
|
| 22 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 23 |
+
// Getters & Setters //
|
| 24 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 25 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 26 |
+
// Private Methods //
|
| 27 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 28 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 29 |
+
// Listeners //
|
| 30 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 31 |
}
|
admin/models/FMModelFormmakerwindow.php
CHANGED
|
@@ -1,36 +1,36 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMModelFormmakerwindow {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
|
| 22 |
-
public function get_form_data() {
|
| 23 |
-
global $wpdb;
|
| 24 |
-
$row = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN(" . get_option('contact_form_forms', 0) . ") order by `title`");
|
| 25 |
-
return $row;
|
| 26 |
-
}
|
| 27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 28 |
-
// Getters & Setters //
|
| 29 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 30 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 31 |
-
// Private Methods //
|
| 32 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 33 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 34 |
-
// Listeners //
|
| 35 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 36 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMModelFormmakerwindow {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
|
| 22 |
+
public function get_form_data() {
|
| 23 |
+
global $wpdb;
|
| 24 |
+
$row = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN(" . get_option('contact_form_forms', 0) . ") order by `title`");
|
| 25 |
+
return $row;
|
| 26 |
+
}
|
| 27 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 28 |
+
// Getters & Setters //
|
| 29 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 30 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 31 |
+
// Private Methods //
|
| 32 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 33 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 34 |
+
// Listeners //
|
| 35 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 36 |
}
|
admin/models/FMModelFromeditcountryinpopup.php
CHANGED
|
@@ -1,31 +1,31 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMModelFromeditcountryinpopup {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
|
| 22 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 23 |
-
// Getters & Setters //
|
| 24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 25 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 26 |
-
// Private Methods //
|
| 27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 28 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 29 |
-
// Listeners //
|
| 30 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 31 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMModelFromeditcountryinpopup {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
|
| 22 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 23 |
+
// Getters & Setters //
|
| 24 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 25 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 26 |
+
// Private Methods //
|
| 27 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 28 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 29 |
+
// Listeners //
|
| 30 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 31 |
}
|
admin/models/FMModelFromipinfoinpopup.php
CHANGED
|
@@ -1,31 +1,31 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMModelFromipinfoinpopup {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
|
| 22 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 23 |
-
// Getters & Setters //
|
| 24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 25 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 26 |
-
// Private Methods //
|
| 27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 28 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 29 |
-
// Listeners //
|
| 30 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 31 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMModelFromipinfoinpopup {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
|
| 22 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 23 |
+
// Getters & Setters //
|
| 24 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 25 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 26 |
+
// Private Methods //
|
| 27 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 28 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 29 |
+
// Listeners //
|
| 30 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 31 |
}
|
admin/models/FMModelFrommapeditinpopup.php
CHANGED
|
@@ -1,31 +1,31 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMModelFrommapeditinpopup {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
|
| 22 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 23 |
-
// Getters & Setters //
|
| 24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 25 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 26 |
-
// Private Methods //
|
| 27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 28 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 29 |
-
// Listeners //
|
| 30 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 31 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMModelFrommapeditinpopup {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
|
| 22 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 23 |
+
// Getters & Setters //
|
| 24 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 25 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 26 |
+
// Private Methods //
|
| 27 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 28 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 29 |
+
// Listeners //
|
| 30 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 31 |
}
|
admin/models/FMModelGenerete_csv.php
CHANGED
|
@@ -1,300 +1,300 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMModelGenerete_csv {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
public function get_data() {
|
| 22 |
-
global $wpdb;
|
| 23 |
-
$is_paypal_info = FALSE;
|
| 24 |
-
$params = array();
|
| 25 |
-
$group_id_s = array();
|
| 26 |
-
$form_id = (int)$_REQUEST['form_id'];
|
| 27 |
-
$limitstart = (int)$_REQUEST['limitstart'];
|
| 28 |
-
$search_labels = isset($_REQUEST['search_labels']) ? $_REQUEST['search_labels'] : '';
|
| 29 |
-
$verified_emails = isset($_REQUEST['verified_emails']) ? json_decode(stripslashes($_REQUEST['verified_emails']), true) : array();
|
| 30 |
-
|
| 31 |
-
$paypal_info_fields = array('currency', 'ord_last_modified', 'status', 'full_name', 'fax', 'mobile_phone', 'email', 'phone', 'address', 'paypal_info', 'ipn', 'tax', 'shipping');
|
| 32 |
-
$paypal_info_labels = array( 'Currency', 'Last modified', 'Status', 'Full Name', 'Fax', 'Mobile phone', 'Email', 'Phone', 'Address', 'Paypal info', 'IPN', 'Tax', 'Shipping');
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
if($search_labels){
|
| 36 |
-
$query = $wpdb->prepare("SELECT distinct group_id FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d and group_id IN(".$search_labels.")", $form_id);
|
| 37 |
-
$group_id_s = $wpdb->get_col($query);
|
| 38 |
-
}
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
$query = $wpdb->prepare("SELECT distinct element_label FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d",$form_id);
|
| 42 |
-
$labels = $wpdb->get_col($query);
|
| 43 |
-
|
| 44 |
-
$query_lable = $wpdb->prepare("SELECT label_order,title FROM " . $wpdb->prefix . "formmaker where id=%d", $form_id);
|
| 45 |
-
$rows_lable = $wpdb->get_results($query_lable);
|
| 46 |
-
$ptn = "/[^a-zA-Z0-9_]/";
|
| 47 |
-
$rpltxt = "";
|
| 48 |
-
$title = isset($rows_lable[0]) ? preg_replace($ptn, $rpltxt, $rows_lable[0]->title) : '';
|
| 49 |
-
|
| 50 |
-
$sorted_labels_id = array();
|
| 51 |
-
$sorted_labels = array();
|
| 52 |
-
$sorted_types = array();
|
| 53 |
-
$label_titles = array();
|
| 54 |
-
$label_id = array();
|
| 55 |
-
$label_order = array();
|
| 56 |
-
$label_order_original = array();
|
| 57 |
-
$label_type = array();
|
| 58 |
-
if ($labels) {
|
| 59 |
-
$label_all = explode('#****#', $rows_lable[0]->label_order);
|
| 60 |
-
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
| 61 |
-
foreach ($label_all as $key => $label_each) {
|
| 62 |
-
$label_id_each = explode('#**id**#', $label_each);
|
| 63 |
-
array_push($label_id, $label_id_each[0]);
|
| 64 |
-
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
| 65 |
-
array_push($label_order_original, $label_oder_each[0]);
|
| 66 |
-
$label_temp = preg_replace($ptn, $rpltxt, $label_oder_each[0]);
|
| 67 |
-
array_push($label_order, $label_temp);
|
| 68 |
-
array_push($label_type, $label_oder_each[1]);
|
| 69 |
-
}
|
| 70 |
-
foreach ($label_id as $key => $label) {
|
| 71 |
-
if (in_array($label, $labels) && $label_type[$key] !='type_arithmetic_captcha') {
|
| 72 |
-
array_push($sorted_labels, $label_order[$key]);
|
| 73 |
-
array_push($sorted_labels_id, $label);
|
| 74 |
-
array_push($label_titles, stripslashes($label_order_original[$key]));
|
| 75 |
-
array_push($sorted_types, $label_type[$key]);
|
| 76 |
-
}
|
| 77 |
-
}
|
| 78 |
-
}
|
| 79 |
-
|
| 80 |
-
$m = count($sorted_labels);
|
| 81 |
-
$wpdb->query("SET SESSION group_concat_max_len = 1000000");
|
| 82 |
-
|
| 83 |
-
$rows = array();
|
| 84 |
-
|
| 85 |
-
if($search_labels){
|
| 86 |
-
$query = $wpdb->prepare("SELECT group_id, ip, date, user_id_wd, GROUP_CONCAT( element_label SEPARATOR ',') as element_label, GROUP_CONCAT( element_value SEPARATOR '*:*el_value*:*') as element_value FROM " . $wpdb->prefix . "formmaker_submits where form_id= %d and group_id IN (".$search_labels.") GROUP BY group_id ORDER BY date ASC limit %d, %d", $form_id, $limitstart, 1000);
|
| 87 |
-
$rows = $wpdb->get_results($query, OBJECT_K);
|
| 88 |
-
}
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
$data = array();
|
| 92 |
-
$group_id_s_count = $limitstart + 1000 < count($group_id_s) ? $limitstart + 1000 : count($group_id_s);
|
| 93 |
-
|
| 94 |
-
sort($group_id_s,SORT_NUMERIC);
|
| 95 |
-
for ($www = $limitstart; $www < $group_id_s_count; $www++) {
|
| 96 |
-
$i = $group_id_s[$www];
|
| 97 |
-
$field_key = array_search($i, $label_id);
|
| 98 |
-
if($label_type[$field_key] != 'type_arithmetic_captcha') {
|
| 99 |
-
$data_temp = array();
|
| 100 |
-
$tt = $rows[$i];
|
| 101 |
-
|
| 102 |
-
$date = $tt->date;
|
| 103 |
-
$ip = $tt->ip;
|
| 104 |
-
$user_id = get_userdata($tt->user_id_wd);
|
| 105 |
-
$username = $user_id ? $user_id->display_name : "";
|
| 106 |
-
$useremail = $user_id ? $user_id->user_email : "";
|
| 107 |
-
$data_temp['Submission ID'] = $i;
|
| 108 |
-
$data_temp['Submit date'] = $date;
|
| 109 |
-
$data_temp['Ip']=$ip;
|
| 110 |
-
$data_temp['Submitter\'s Username']=$username;
|
| 111 |
-
$data_temp['Submitter\'s Email Address']=$useremail;
|
| 112 |
-
|
| 113 |
-
$element_labels = explode(',', $tt->element_label);
|
| 114 |
-
$element_values = explode('*:*el_value*:*', $tt->element_value);
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
for ($h = 0; $h < $m; $h++) {
|
| 118 |
-
if(isset($data_temp[$label_titles[$h]]))
|
| 119 |
-
$label_titles[$h] .= '(1)';
|
| 120 |
-
|
| 121 |
-
if(in_array($sorted_labels_id[$h], $element_labels)) {
|
| 122 |
-
$element_value = $element_values[array_search($sorted_labels_id[$h], $element_labels)];
|
| 123 |
-
|
| 124 |
-
if (strpos($element_value, "*@@url@@*")) {
|
| 125 |
-
$file_names = '';
|
| 126 |
-
$new_files = explode("*@@url@@*", $element_value);
|
| 127 |
-
foreach ($new_files as $new_file) {
|
| 128 |
-
if ($new_file) {
|
| 129 |
-
$file_names .= $new_file . ", ";
|
| 130 |
-
}
|
| 131 |
-
}
|
| 132 |
-
$data_temp[stripslashes($label_titles[$h])] = $file_names;
|
| 133 |
-
}
|
| 134 |
-
elseif (strpos($element_value, "***br***")) {
|
| 135 |
-
$element_value = str_replace("***br***", ', ', $element_value);
|
| 136 |
-
if (strpos($element_value, "***quantity***")) {
|
| 137 |
-
$element_value = str_replace("***quantity***", '', $element_value);
|
| 138 |
-
}
|
| 139 |
-
if (strpos($element_value, "***property***")) {
|
| 140 |
-
$element_value = str_replace("***property***", '', $element_value);
|
| 141 |
-
}
|
| 142 |
-
if(substr($element_value, -2) == ', ') {
|
| 143 |
-
$data_temp[stripslashes($label_titles[$h])]= substr($element_value, 0, -2);
|
| 144 |
-
}
|
| 145 |
-
else {
|
| 146 |
-
$data_temp[stripslashes($label_titles[$h])]= $element_value;
|
| 147 |
-
}
|
| 148 |
-
}
|
| 149 |
-
elseif (strpos($element_value, "***map***")) {
|
| 150 |
-
$data_temp[stripslashes($label_titles[$h])] = 'Longitude:' . str_replace("***map***", ', Latitude:', $element_value);
|
| 151 |
-
}
|
| 152 |
-
elseif (strpos($element_value, "***star_rating***")) {
|
| 153 |
-
$element = str_replace("***star_rating***", '', $element_value);
|
| 154 |
-
$element = explode("***", $element);
|
| 155 |
-
$data_temp[stripslashes($label_titles[$h])] = ' ' . $element[1] . '/' . $element[0];
|
| 156 |
-
}
|
| 157 |
-
elseif (strpos($element_value, "@@@") || $element_value == "@@@" || $element_value == "@@@@@@@@@") {
|
| 158 |
-
$data_temp[stripslashes($label_titles[$h])] = str_replace("@@@", ' ', $element_value);
|
| 159 |
-
}
|
| 160 |
-
elseif (strpos($element_value, "***grading***")) {
|
| 161 |
-
$element = str_replace("***grading***", '', $element_value);
|
| 162 |
-
$grading = explode(":", $element);
|
| 163 |
-
$items_count = sizeof($grading) - 1;
|
| 164 |
-
$items = "";
|
| 165 |
-
$total = "";
|
| 166 |
-
for ($k = 0; $k < $items_count / 2; $k++) {
|
| 167 |
-
$items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . ", ";
|
| 168 |
-
$total += $grading[$k];
|
| 169 |
-
}
|
| 170 |
-
$items .= "Total: " . $total;
|
| 171 |
-
$data_temp[stripslashes($label_titles[$h])] = $items;
|
| 172 |
-
}
|
| 173 |
-
elseif (strpos($element_value, "***matrix***")) {
|
| 174 |
-
$element = str_replace("***matrix***", '', $element_value);
|
| 175 |
-
$matrix_value = explode('***', $element);
|
| 176 |
-
$matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
|
| 177 |
-
$mat_rows = $matrix_value[0];
|
| 178 |
-
$mat_columns = $matrix_value[$mat_rows + 1];
|
| 179 |
-
$matrix = "";
|
| 180 |
-
$aaa = array();
|
| 181 |
-
$var_checkbox = 1;
|
| 182 |
-
$selected_value = "";
|
| 183 |
-
$selected_value_yes = "";
|
| 184 |
-
$selected_value_no = "";
|
| 185 |
-
for ($k = 1; $k <= $mat_rows; $k++) {
|
| 186 |
-
if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
|
| 187 |
-
if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
|
| 188 |
-
$checked = "0";
|
| 189 |
-
$aaa[1] = "";
|
| 190 |
-
}
|
| 191 |
-
else {
|
| 192 |
-
$aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
|
| 193 |
-
}
|
| 194 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
| 195 |
-
$checked = $aaa[1] == $l ? '1' : '0';
|
| 196 |
-
$matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
|
| 197 |
-
}
|
| 198 |
-
}
|
| 199 |
-
else {
|
| 200 |
-
if ($matrix_value[$mat_rows+$mat_columns + 2] == "checkbox") {
|
| 201 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
| 202 |
-
$checked = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox] == 1 ? '1' : '0';
|
| 203 |
-
$matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
|
| 204 |
-
$var_checkbox++;
|
| 205 |
-
}
|
| 206 |
-
}
|
| 207 |
-
else {
|
| 208 |
-
if ($matrix_value[$mat_rows+$mat_columns + 2] == "text") {
|
| 209 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
| 210 |
-
$text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
|
| 211 |
-
$matrix .='['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$text_value."; ";
|
| 212 |
-
$var_checkbox++;
|
| 213 |
-
}
|
| 214 |
-
}
|
| 215 |
-
else {
|
| 216 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
| 217 |
-
$selected_text = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox];
|
| 218 |
-
$matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows + 1 + $l].']='.$selected_text."; ";
|
| 219 |
-
$var_checkbox++;
|
| 220 |
-
}
|
| 221 |
-
}
|
| 222 |
-
}
|
| 223 |
-
}
|
| 224 |
-
}
|
| 225 |
-
$data_temp[stripslashes($label_titles[$h])] = $matrix;
|
| 226 |
-
}
|
| 227 |
-
else {
|
| 228 |
-
$val = strip_tags(htmlspecialchars_decode($element_value));
|
| 229 |
-
$val = stripslashes(str_replace(''', "'", $val));
|
| 230 |
-
$data_temp[stripslashes($label_titles[$h])] = ($element_value ? $val : '');
|
| 231 |
-
}
|
| 232 |
-
}
|
| 233 |
-
else {
|
| 234 |
-
$data_temp[stripslashes($label_titles[$h])] = '';
|
| 235 |
-
}
|
| 236 |
-
|
| 237 |
-
if(isset($verified_emails[$sorted_labels_id[$h]]) && $sorted_types[$h] == "type_submitter_mail") {
|
| 238 |
-
if($data_temp[stripslashes($label_titles[$h])] == '') {
|
| 239 |
-
$data_temp[stripslashes($label_titles[$h]).'(verified)'] = '';
|
| 240 |
-
} else {
|
| 241 |
-
if(in_array($i, $verified_emails[$sorted_labels_id[$h]])){
|
| 242 |
-
$data_temp[stripslashes($label_titles[$h]).'(verified)']= 'yes';
|
| 243 |
-
} else{
|
| 244 |
-
$data_temp[stripslashes($label_titles[$h]).'(verified)']= 'no';
|
| 245 |
-
}
|
| 246 |
-
}
|
| 247 |
-
}
|
| 248 |
-
}
|
| 249 |
-
|
| 250 |
-
$query = $wpdb->prepare("SELECT id FROM " . $wpdb->prefix . "formmaker_submits where element_label=%s AND form_id = %d AND group_id=%d",'item_total', $form_id, $i);
|
| 251 |
-
$is_paypal = $wpdb->get_results($query);
|
| 252 |
-
|
| 253 |
-
if($is_paypal) {
|
| 254 |
-
$item_total = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s", $i, 'item_total'));
|
| 255 |
-
$total = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s", $i, 'total'));
|
| 256 |
-
$payment_status = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s", $i, '0'));
|
| 257 |
-
$data_temp['Item Total'] = $item_total;
|
| 258 |
-
$data_temp['Total'] = $total;
|
| 259 |
-
$data_temp['Payment Status'] = $payment_status;
|
| 260 |
-
}
|
| 261 |
-
$query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_sessions where group_id=%d",$i);
|
| 262 |
-
$paypal_info = $wpdb->get_results($query);
|
| 263 |
-
if ($paypal_info) {
|
| 264 |
-
$is_paypal_info = TRUE;
|
| 265 |
-
}
|
| 266 |
-
if ($is_paypal) {
|
| 267 |
-
foreach ($paypal_info_fields as $key=>$paypal_info_field) {
|
| 268 |
-
if ($paypal_info) {
|
| 269 |
-
$data_temp['PAYPAL_'.$paypal_info_labels[$key]]=$paypal_info[0]->$paypal_info_field;
|
| 270 |
-
}
|
| 271 |
-
else {
|
| 272 |
-
$data_temp['PAYPAL_'.$paypal_info_labels[$key]]='';
|
| 273 |
-
}
|
| 274 |
-
}
|
| 275 |
-
}
|
| 276 |
-
|
| 277 |
-
$data[$i] = $data_temp;
|
| 278 |
-
}
|
| 279 |
-
|
| 280 |
-
}
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
array_push($params, $data);
|
| 284 |
-
array_push($params, $title);
|
| 285 |
-
array_push($params, $is_paypal_info);
|
| 286 |
-
return $params;
|
| 287 |
-
|
| 288 |
-
}
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 292 |
-
// Getters & Setters //
|
| 293 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 294 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 295 |
-
// Private Methods //
|
| 296 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 297 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 298 |
-
// Listeners //
|
| 299 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 300 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMModelGenerete_csv {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
public function get_data() {
|
| 22 |
+
global $wpdb;
|
| 23 |
+
$is_paypal_info = FALSE;
|
| 24 |
+
$params = array();
|
| 25 |
+
$group_id_s = array();
|
| 26 |
+
$form_id = (int)$_REQUEST['form_id'];
|
| 27 |
+
$limitstart = (int)$_REQUEST['limitstart'];
|
| 28 |
+
$search_labels = isset($_REQUEST['search_labels']) ? $_REQUEST['search_labels'] : '';
|
| 29 |
+
$verified_emails = isset($_REQUEST['verified_emails']) ? json_decode(stripslashes($_REQUEST['verified_emails']), true) : array();
|
| 30 |
+
|
| 31 |
+
$paypal_info_fields = array('currency', 'ord_last_modified', 'status', 'full_name', 'fax', 'mobile_phone', 'email', 'phone', 'address', 'paypal_info', 'ipn', 'tax', 'shipping');
|
| 32 |
+
$paypal_info_labels = array( 'Currency', 'Last modified', 'Status', 'Full Name', 'Fax', 'Mobile phone', 'Email', 'Phone', 'Address', 'Paypal info', 'IPN', 'Tax', 'Shipping');
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
if($search_labels){
|
| 36 |
+
$query = $wpdb->prepare("SELECT distinct group_id FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d and group_id IN(".$search_labels.")", $form_id);
|
| 37 |
+
$group_id_s = $wpdb->get_col($query);
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
$query = $wpdb->prepare("SELECT distinct element_label FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d",$form_id);
|
| 42 |
+
$labels = $wpdb->get_col($query);
|
| 43 |
+
|
| 44 |
+
$query_lable = $wpdb->prepare("SELECT label_order,title FROM " . $wpdb->prefix . "formmaker where id=%d", $form_id);
|
| 45 |
+
$rows_lable = $wpdb->get_results($query_lable);
|
| 46 |
+
$ptn = "/[^a-zA-Z0-9_]/";
|
| 47 |
+
$rpltxt = "";
|
| 48 |
+
$title = isset($rows_lable[0]) ? preg_replace($ptn, $rpltxt, $rows_lable[0]->title) : '';
|
| 49 |
+
|
| 50 |
+
$sorted_labels_id = array();
|
| 51 |
+
$sorted_labels = array();
|
| 52 |
+
$sorted_types = array();
|
| 53 |
+
$label_titles = array();
|
| 54 |
+
$label_id = array();
|
| 55 |
+
$label_order = array();
|
| 56 |
+
$label_order_original = array();
|
| 57 |
+
$label_type = array();
|
| 58 |
+
if ($labels) {
|
| 59 |
+
$label_all = explode('#****#', $rows_lable[0]->label_order);
|
| 60 |
+
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
| 61 |
+
foreach ($label_all as $key => $label_each) {
|
| 62 |
+
$label_id_each = explode('#**id**#', $label_each);
|
| 63 |
+
array_push($label_id, $label_id_each[0]);
|
| 64 |
+
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
| 65 |
+
array_push($label_order_original, $label_oder_each[0]);
|
| 66 |
+
$label_temp = preg_replace($ptn, $rpltxt, $label_oder_each[0]);
|
| 67 |
+
array_push($label_order, $label_temp);
|
| 68 |
+
array_push($label_type, $label_oder_each[1]);
|
| 69 |
+
}
|
| 70 |
+
foreach ($label_id as $key => $label) {
|
| 71 |
+
if (in_array($label, $labels) && $label_type[$key] !='type_arithmetic_captcha') {
|
| 72 |
+
array_push($sorted_labels, $label_order[$key]);
|
| 73 |
+
array_push($sorted_labels_id, $label);
|
| 74 |
+
array_push($label_titles, stripslashes($label_order_original[$key]));
|
| 75 |
+
array_push($sorted_types, $label_type[$key]);
|
| 76 |
+
}
|
| 77 |
+
}
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
$m = count($sorted_labels);
|
| 81 |
+
$wpdb->query("SET SESSION group_concat_max_len = 1000000");
|
| 82 |
+
|
| 83 |
+
$rows = array();
|
| 84 |
+
|
| 85 |
+
if($search_labels){
|
| 86 |
+
$query = $wpdb->prepare("SELECT group_id, ip, date, user_id_wd, GROUP_CONCAT( element_label SEPARATOR ',') as element_label, GROUP_CONCAT( element_value SEPARATOR '*:*el_value*:*') as element_value FROM " . $wpdb->prefix . "formmaker_submits where form_id= %d and group_id IN (".$search_labels.") GROUP BY group_id ORDER BY date ASC limit %d, %d", $form_id, $limitstart, 1000);
|
| 87 |
+
$rows = $wpdb->get_results($query, OBJECT_K);
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
$data = array();
|
| 92 |
+
$group_id_s_count = $limitstart + 1000 < count($group_id_s) ? $limitstart + 1000 : count($group_id_s);
|
| 93 |
+
|
| 94 |
+
sort($group_id_s,SORT_NUMERIC);
|
| 95 |
+
for ($www = $limitstart; $www < $group_id_s_count; $www++) {
|
| 96 |
+
$i = $group_id_s[$www];
|
| 97 |
+
$field_key = array_search($i, $label_id);
|
| 98 |
+
if($label_type[$field_key] != 'type_arithmetic_captcha') {
|
| 99 |
+
$data_temp = array();
|
| 100 |
+
$tt = $rows[$i];
|
| 101 |
+
|
| 102 |
+
$date = $tt->date;
|
| 103 |
+
$ip = $tt->ip;
|
| 104 |
+
$user_id = get_userdata($tt->user_id_wd);
|
| 105 |
+
$username = $user_id ? $user_id->display_name : "";
|
| 106 |
+
$useremail = $user_id ? $user_id->user_email : "";
|
| 107 |
+
$data_temp['Submission ID'] = $i;
|
| 108 |
+
$data_temp['Submit date'] = $date;
|
| 109 |
+
$data_temp['Ip']=$ip;
|
| 110 |
+
$data_temp['Submitter\'s Username']=$username;
|
| 111 |
+
$data_temp['Submitter\'s Email Address']=$useremail;
|
| 112 |
+
|
| 113 |
+
$element_labels = explode(',', $tt->element_label);
|
| 114 |
+
$element_values = explode('*:*el_value*:*', $tt->element_value);
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
for ($h = 0; $h < $m; $h++) {
|
| 118 |
+
if(isset($data_temp[$label_titles[$h]]))
|
| 119 |
+
$label_titles[$h] .= '(1)';
|
| 120 |
+
|
| 121 |
+
if(in_array($sorted_labels_id[$h], $element_labels)) {
|
| 122 |
+
$element_value = $element_values[array_search($sorted_labels_id[$h], $element_labels)];
|
| 123 |
+
|
| 124 |
+
if (strpos($element_value, "*@@url@@*")) {
|
| 125 |
+
$file_names = '';
|
| 126 |
+
$new_files = explode("*@@url@@*", $element_value);
|
| 127 |
+
foreach ($new_files as $new_file) {
|
| 128 |
+
if ($new_file) {
|
| 129 |
+
$file_names .= $new_file . ", ";
|
| 130 |
+
}
|
| 131 |
+
}
|
| 132 |
+
$data_temp[stripslashes($label_titles[$h])] = $file_names;
|
| 133 |
+
}
|
| 134 |
+
elseif (strpos($element_value, "***br***")) {
|
| 135 |
+
$element_value = str_replace("***br***", ', ', $element_value);
|
| 136 |
+
if (strpos($element_value, "***quantity***")) {
|
| 137 |
+
$element_value = str_replace("***quantity***", '', $element_value);
|
| 138 |
+
}
|
| 139 |
+
if (strpos($element_value, "***property***")) {
|
| 140 |
+
$element_value = str_replace("***property***", '', $element_value);
|
| 141 |
+
}
|
| 142 |
+
if(substr($element_value, -2) == ', ') {
|
| 143 |
+
$data_temp[stripslashes($label_titles[$h])]= substr($element_value, 0, -2);
|
| 144 |
+
}
|
| 145 |
+
else {
|
| 146 |
+
$data_temp[stripslashes($label_titles[$h])]= $element_value;
|
| 147 |
+
}
|
| 148 |
+
}
|
| 149 |
+
elseif (strpos($element_value, "***map***")) {
|
| 150 |
+
$data_temp[stripslashes($label_titles[$h])] = 'Longitude:' . str_replace("***map***", ', Latitude:', $element_value);
|
| 151 |
+
}
|
| 152 |
+
elseif (strpos($element_value, "***star_rating***")) {
|
| 153 |
+
$element = str_replace("***star_rating***", '', $element_value);
|
| 154 |
+
$element = explode("***", $element);
|
| 155 |
+
$data_temp[stripslashes($label_titles[$h])] = ' ' . $element[1] . '/' . $element[0];
|
| 156 |
+
}
|
| 157 |
+
elseif (strpos($element_value, "@@@") || $element_value == "@@@" || $element_value == "@@@@@@@@@") {
|
| 158 |
+
$data_temp[stripslashes($label_titles[$h])] = str_replace("@@@", ' ', $element_value);
|
| 159 |
+
}
|
| 160 |
+
elseif (strpos($element_value, "***grading***")) {
|
| 161 |
+
$element = str_replace("***grading***", '', $element_value);
|
| 162 |
+
$grading = explode(":", $element);
|
| 163 |
+
$items_count = sizeof($grading) - 1;
|
| 164 |
+
$items = "";
|
| 165 |
+
$total = "";
|
| 166 |
+
for ($k = 0; $k < $items_count / 2; $k++) {
|
| 167 |
+
$items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . ", ";
|
| 168 |
+
$total += $grading[$k];
|
| 169 |
+
}
|
| 170 |
+
$items .= "Total: " . $total;
|
| 171 |
+
$data_temp[stripslashes($label_titles[$h])] = $items;
|
| 172 |
+
}
|
| 173 |
+
elseif (strpos($element_value, "***matrix***")) {
|
| 174 |
+
$element = str_replace("***matrix***", '', $element_value);
|
| 175 |
+
$matrix_value = explode('***', $element);
|
| 176 |
+
$matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
|
| 177 |
+
$mat_rows = $matrix_value[0];
|
| 178 |
+
$mat_columns = $matrix_value[$mat_rows + 1];
|
| 179 |
+
$matrix = "";
|
| 180 |
+
$aaa = array();
|
| 181 |
+
$var_checkbox = 1;
|
| 182 |
+
$selected_value = "";
|
| 183 |
+
$selected_value_yes = "";
|
| 184 |
+
$selected_value_no = "";
|
| 185 |
+
for ($k = 1; $k <= $mat_rows; $k++) {
|
| 186 |
+
if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
|
| 187 |
+
if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
|
| 188 |
+
$checked = "0";
|
| 189 |
+
$aaa[1] = "";
|
| 190 |
+
}
|
| 191 |
+
else {
|
| 192 |
+
$aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
|
| 193 |
+
}
|
| 194 |
+
for ($l = 1; $l <= $mat_columns; $l++) {
|
| 195 |
+
$checked = $aaa[1] == $l ? '1' : '0';
|
| 196 |
+
$matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
|
| 197 |
+
}
|
| 198 |
+
}
|
| 199 |
+
else {
|
| 200 |
+
if ($matrix_value[$mat_rows+$mat_columns + 2] == "checkbox") {
|
| 201 |
+
for ($l = 1; $l <= $mat_columns; $l++) {
|
| 202 |
+
$checked = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox] == 1 ? '1' : '0';
|
| 203 |
+
$matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
|
| 204 |
+
$var_checkbox++;
|
| 205 |
+
}
|
| 206 |
+
}
|
| 207 |
+
else {
|
| 208 |
+
if ($matrix_value[$mat_rows+$mat_columns + 2] == "text") {
|
| 209 |
+
for ($l = 1; $l <= $mat_columns; $l++) {
|
| 210 |
+
$text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
|
| 211 |
+
$matrix .='['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$text_value."; ";
|
| 212 |
+
$var_checkbox++;
|
| 213 |
+
}
|
| 214 |
+
}
|
| 215 |
+
else {
|
| 216 |
+
for ($l = 1; $l <= $mat_columns; $l++) {
|
| 217 |
+
$selected_text = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox];
|
| 218 |
+
$matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows + 1 + $l].']='.$selected_text."; ";
|
| 219 |
+
$var_checkbox++;
|
| 220 |
+
}
|
| 221 |
+
}
|
| 222 |
+
}
|
| 223 |
+
}
|
| 224 |
+
}
|
| 225 |
+
$data_temp[stripslashes($label_titles[$h])] = $matrix;
|
| 226 |
+
}
|
| 227 |
+
else {
|
| 228 |
+
$val = strip_tags(htmlspecialchars_decode($element_value));
|
| 229 |
+
$val = stripslashes(str_replace(''', "'", $val));
|
| 230 |
+
$data_temp[stripslashes($label_titles[$h])] = ($element_value ? $val : '');
|
| 231 |
+
}
|
| 232 |
+
}
|
| 233 |
+
else {
|
| 234 |
+
$data_temp[stripslashes($label_titles[$h])] = '';
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
if(isset($verified_emails[$sorted_labels_id[$h]]) && $sorted_types[$h] == "type_submitter_mail") {
|
| 238 |
+
if($data_temp[stripslashes($label_titles[$h])] == '') {
|
| 239 |
+
$data_temp[stripslashes($label_titles[$h]).'(verified)'] = '';
|
| 240 |
+
} else {
|
| 241 |
+
if(in_array($i, $verified_emails[$sorted_labels_id[$h]])){
|
| 242 |
+
$data_temp[stripslashes($label_titles[$h]).'(verified)']= 'yes';
|
| 243 |
+
} else{
|
| 244 |
+
$data_temp[stripslashes($label_titles[$h]).'(verified)']= 'no';
|
| 245 |
+
}
|
| 246 |
+
}
|
| 247 |
+
}
|
| 248 |
+
}
|
| 249 |
+
|
| 250 |
+
$query = $wpdb->prepare("SELECT id FROM " . $wpdb->prefix . "formmaker_submits where element_label=%s AND form_id = %d AND group_id=%d",'item_total', $form_id, $i);
|
| 251 |
+
$is_paypal = $wpdb->get_results($query);
|
| 252 |
+
|
| 253 |
+
if($is_paypal) {
|
| 254 |
+
$item_total = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s", $i, 'item_total'));
|
| 255 |
+
$total = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s", $i, 'total'));
|
| 256 |
+
$payment_status = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s", $i, '0'));
|
| 257 |
+
$data_temp['Item Total'] = $item_total;
|
| 258 |
+
$data_temp['Total'] = $total;
|
| 259 |
+
$data_temp['Payment Status'] = $payment_status;
|
| 260 |
+
}
|
| 261 |
+
$query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_sessions where group_id=%d",$i);
|
| 262 |
+
$paypal_info = $wpdb->get_results($query);
|
| 263 |
+
if ($paypal_info) {
|
| 264 |
+
$is_paypal_info = TRUE;
|
| 265 |
+
}
|
| 266 |
+
if ($is_paypal) {
|
| 267 |
+
foreach ($paypal_info_fields as $key=>$paypal_info_field) {
|
| 268 |
+
if ($paypal_info) {
|
| 269 |
+
$data_temp['PAYPAL_'.$paypal_info_labels[$key]]=$paypal_info[0]->$paypal_info_field;
|
| 270 |
+
}
|
| 271 |
+
else {
|
| 272 |
+
$data_temp['PAYPAL_'.$paypal_info_labels[$key]]='';
|
| 273 |
+
}
|
| 274 |
+
}
|
| 275 |
+
}
|
| 276 |
+
|
| 277 |
+
$data[$i] = $data_temp;
|
| 278 |
+
}
|
| 279 |
+
|
| 280 |
+
}
|
| 281 |
+
|
| 282 |
+
|
| 283 |
+
array_push($params, $data);
|
| 284 |
+
array_push($params, $title);
|
| 285 |
+
array_push($params, $is_paypal_info);
|
| 286 |
+
return $params;
|
| 287 |
+
|
| 288 |
+
}
|
| 289 |
+
|
| 290 |
+
|
| 291 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 292 |
+
// Getters & Setters //
|
| 293 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 294 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 295 |
+
// Private Methods //
|
| 296 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 297 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 298 |
+
// Listeners //
|
| 299 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 300 |
}
|
admin/models/FMModelGenerete_xml.php
CHANGED
|
@@ -1,301 +1,301 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMModelGenerete_xml {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
|
| 22 |
-
public function get_data() {
|
| 23 |
-
global $wpdb;
|
| 24 |
-
$is_paypal_info = FALSE;
|
| 25 |
-
$params = array();
|
| 26 |
-
$group_id_s = array();
|
| 27 |
-
$form_id = (int)$_REQUEST['form_id'];
|
| 28 |
-
$limitstart = (int)$_REQUEST['limitstart'];
|
| 29 |
-
$search_labels = isset($_REQUEST['search_labels']) ? $_REQUEST['search_labels'] : '';
|
| 30 |
-
$verified_emails = isset($_REQUEST['verified_emails']) ? json_decode(stripslashes($_REQUEST['verified_emails']), true) : array();
|
| 31 |
-
|
| 32 |
-
$paypal_info_fields = array('currency', 'ord_last_modified', 'status', 'full_name', 'fax', 'mobile_phone', 'email', 'phone', 'address', 'paypal_info', 'ipn', 'tax', 'shipping');
|
| 33 |
-
$paypal_info_labels = array( 'Currency', 'Last modified', 'Status', 'Full Name', 'Fax', 'Mobile phone', 'Email', 'Phone', 'Address', 'Paypal info', 'IPN', 'Tax', 'Shipping');
|
| 34 |
-
|
| 35 |
-
if($search_labels){
|
| 36 |
-
$query = $wpdb->prepare("SELECT distinct group_id FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d and group_id IN(".$search_labels.")", $form_id);
|
| 37 |
-
$group_id_s = $wpdb->get_col($query);
|
| 38 |
-
}
|
| 39 |
-
|
| 40 |
-
$query = $wpdb->prepare("SELECT distinct element_label FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d",$form_id);
|
| 41 |
-
$labels = $wpdb->get_col($query);
|
| 42 |
-
|
| 43 |
-
$query_lable = $wpdb->prepare("SELECT label_order,title FROM " . $wpdb->prefix . "formmaker where id=%d", $form_id);
|
| 44 |
-
$rows_lable = $wpdb->get_results($query_lable);
|
| 45 |
-
$ptn = "/[^a-zA-Z0-9_]/";
|
| 46 |
-
$rpltxt = "";
|
| 47 |
-
$title = isset($rows_lable[0]) ? preg_replace($ptn, $rpltxt, $rows_lable[0]->title) : '';
|
| 48 |
-
|
| 49 |
-
$sorted_labels_id = array();
|
| 50 |
-
$sorted_labels = array();
|
| 51 |
-
$label_titles = array();
|
| 52 |
-
$sorted_types = array();
|
| 53 |
-
$label_id = array();
|
| 54 |
-
$label_order = array();
|
| 55 |
-
$label_order_original = array();
|
| 56 |
-
$label_type = array();
|
| 57 |
-
if ($labels) {
|
| 58 |
-
$label_all = explode('#****#', $rows_lable[0]->label_order);
|
| 59 |
-
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
| 60 |
-
foreach ($label_all as $key => $label_each) {
|
| 61 |
-
$label_id_each = explode('#**id**#', $label_each);
|
| 62 |
-
array_push($label_id, $label_id_each[0]);
|
| 63 |
-
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
| 64 |
-
array_push($label_order_original, $label_oder_each[0]);
|
| 65 |
-
$label_temp = preg_replace($ptn, $rpltxt, $label_oder_each[0]);
|
| 66 |
-
array_push($label_order, $label_temp);
|
| 67 |
-
array_push($label_type, $label_oder_each[1]);
|
| 68 |
-
}
|
| 69 |
-
foreach ($label_id as $key => $label) {
|
| 70 |
-
if (in_array($label, $labels) && $label_type[$key] !='type_arithmetic_captcha') {
|
| 71 |
-
array_push($sorted_labels, $label_order[$key]);
|
| 72 |
-
array_push($sorted_labels_id, $label);
|
| 73 |
-
array_push($label_titles, stripslashes($label_order_original[$key]));
|
| 74 |
-
array_push($sorted_types, $label_type[$key]);
|
| 75 |
-
}
|
| 76 |
-
}
|
| 77 |
-
}
|
| 78 |
-
|
| 79 |
-
$m = count($sorted_labels);
|
| 80 |
-
|
| 81 |
-
$rows = array();
|
| 82 |
-
|
| 83 |
-
if($search_labels){
|
| 84 |
-
$query = $wpdb->prepare("SELECT group_id, ip, date, user_id_wd, GROUP_CONCAT( element_label SEPARATOR ',') as element_label, GROUP_CONCAT( element_value SEPARATOR '*:*el_value*:*') as element_value FROM " . $wpdb->prefix . "formmaker_submits where form_id= %d and group_id IN(".$search_labels.") GROUP BY group_id ORDER BY date ASC limit %d, %d", $form_id, $limitstart, 1000);
|
| 85 |
-
$rows = $wpdb->get_results($query, OBJECT_K);
|
| 86 |
-
}
|
| 87 |
-
|
| 88 |
-
$data = array();
|
| 89 |
-
$group_id_s_count = $limitstart + 1000 < count($group_id_s) ? $limitstart + 1000 : count($group_id_s);
|
| 90 |
-
|
| 91 |
-
sort($group_id_s,SORT_NUMERIC);
|
| 92 |
-
for ($www = $limitstart; $www < $group_id_s_count; $www++) {
|
| 93 |
-
|
| 94 |
-
$i = $group_id_s[$www];
|
| 95 |
-
|
| 96 |
-
$field_key = array_search($i, $label_id);
|
| 97 |
-
if($label_type[$field_key] != 'type_arithmetic_captcha') {
|
| 98 |
-
$data_temp = array();
|
| 99 |
-
$tt = $rows[$i];
|
| 100 |
-
|
| 101 |
-
$date = $tt->date;
|
| 102 |
-
$ip = $tt->ip;
|
| 103 |
-
$user_id = get_userdata($tt->user_id_wd);
|
| 104 |
-
$username = $user_id ? $user_id->display_name : "";
|
| 105 |
-
$useremail = $user_id ? $user_id->user_email : "";
|
| 106 |
-
$data_temp['Submit date'] = $date;
|
| 107 |
-
$data_temp['Ip']=$ip;
|
| 108 |
-
$data_temp['Submitter\'s Username']=$username;
|
| 109 |
-
$data_temp['Submitter\'s Email Address']=$useremail;
|
| 110 |
-
|
| 111 |
-
$element_labels = explode(',', $tt->element_label);
|
| 112 |
-
$element_values = explode('*:*el_value*:*', $tt->element_value);
|
| 113 |
-
for ($h = 0; $h < $m; $h++) {
|
| 114 |
-
if(isset($data_temp[$label_titles[$h]]))
|
| 115 |
-
$label_titles[$h] .= '(1)';
|
| 116 |
-
|
| 117 |
-
if(in_array($sorted_labels_id[$h], $element_labels)) {
|
| 118 |
-
$element_value = $element_values[array_search($sorted_labels_id[$h], $element_labels)];
|
| 119 |
-
|
| 120 |
-
if (strpos($element_value, "*@@url@@*")) {
|
| 121 |
-
$file_names = '';
|
| 122 |
-
$new_files = explode("*@@url@@*", $element_value);
|
| 123 |
-
foreach ($new_files as $new_file) {
|
| 124 |
-
if ($new_file) {
|
| 125 |
-
$file_names .= $new_file . ", ";
|
| 126 |
-
}
|
| 127 |
-
}
|
| 128 |
-
$data_temp[stripslashes($label_titles[$h])] = $file_names;
|
| 129 |
-
}
|
| 130 |
-
elseif (strpos($element_value, "***br***")) {
|
| 131 |
-
$element_value = str_replace("***br***", ', ', $element_value);
|
| 132 |
-
if (strpos($element_value, "***quantity***")) {
|
| 133 |
-
$element_value = str_replace("***quantity***", '', $element_value);
|
| 134 |
-
}
|
| 135 |
-
if (strpos($element_value, "***property***")) {
|
| 136 |
-
$element_value = str_replace("***property***", '', $element_value);
|
| 137 |
-
}
|
| 138 |
-
if(substr($element_value, -2) == ', ') {
|
| 139 |
-
$data_temp[stripslashes($label_titles[$h])]= substr($element_value, 0, -2);
|
| 140 |
-
}
|
| 141 |
-
else {
|
| 142 |
-
$data_temp[stripslashes($label_titles[$h])]= $element_value;
|
| 143 |
-
}
|
| 144 |
-
}
|
| 145 |
-
elseif (strpos($element_value, "***map***")) {
|
| 146 |
-
$data_temp[stripslashes($label_titles[$h])] = 'Longitude:' . str_replace("***map***", ', Latitude:', $element_value);
|
| 147 |
-
}
|
| 148 |
-
elseif (strpos($element_value, "***star_rating***")) {
|
| 149 |
-
$element = str_replace("***star_rating***", '', $element_value);
|
| 150 |
-
$element = explode("***", $element);
|
| 151 |
-
$data_temp[stripslashes($label_titles[$h])] = ' ' . $element[1] . '/' . $element[0];
|
| 152 |
-
}
|
| 153 |
-
elseif (strpos($element_value, "@@@") || $element_value == "@@@" || $element_value == "@@@@@@@@@") {
|
| 154 |
-
$data_temp[stripslashes($label_titles[$h])] = str_replace("@@@", ' ', $element_value);
|
| 155 |
-
}
|
| 156 |
-
elseif (strpos($element_value, "***grading***")) {
|
| 157 |
-
$element = str_replace("***grading***", '', $element_value);
|
| 158 |
-
$grading = explode(":", $element);
|
| 159 |
-
$items_count = sizeof($grading) - 1;
|
| 160 |
-
$items = "";
|
| 161 |
-
$total = "";
|
| 162 |
-
for ($k = 0; $k < $items_count / 2; $k++) {
|
| 163 |
-
$items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . ", ";
|
| 164 |
-
$total += $grading[$k];
|
| 165 |
-
}
|
| 166 |
-
$items .= "Total: " . $total;
|
| 167 |
-
$data_temp[stripslashes($label_titles[$h])] = $items;
|
| 168 |
-
}
|
| 169 |
-
elseif (strpos($element_value, "***matrix***")) {
|
| 170 |
-
$element = str_replace("***matrix***", '', $element_value);
|
| 171 |
-
$matrix_value = explode('***', $element);
|
| 172 |
-
$matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
|
| 173 |
-
$mat_rows = $matrix_value[0];
|
| 174 |
-
$mat_columns = $matrix_value[$mat_rows + 1];
|
| 175 |
-
$matrix = "";
|
| 176 |
-
$aaa = array();
|
| 177 |
-
$var_checkbox = 1;
|
| 178 |
-
$selected_value = "";
|
| 179 |
-
$selected_value_yes = "";
|
| 180 |
-
$selected_value_no = "";
|
| 181 |
-
for ($k = 1; $k <= $mat_rows; $k++) {
|
| 182 |
-
if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
|
| 183 |
-
if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
|
| 184 |
-
$checked = "0";
|
| 185 |
-
$aaa[1] = "";
|
| 186 |
-
}
|
| 187 |
-
else {
|
| 188 |
-
$aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
|
| 189 |
-
}
|
| 190 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
| 191 |
-
$checked = $aaa[1] == $l ? '1' : '0';
|
| 192 |
-
$matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
|
| 193 |
-
}
|
| 194 |
-
}
|
| 195 |
-
else {
|
| 196 |
-
if ($matrix_value[$mat_rows+$mat_columns + 2] == "checkbox") {
|
| 197 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
| 198 |
-
$checked = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox] == 1 ? '1' : '0';
|
| 199 |
-
$matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
|
| 200 |
-
$var_checkbox++;
|
| 201 |
-
}
|
| 202 |
-
}
|
| 203 |
-
else {
|
| 204 |
-
if ($matrix_value[$mat_rows+$mat_columns + 2] == "text") {
|
| 205 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
| 206 |
-
$text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
|
| 207 |
-
$matrix .='['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$text_value."; ";
|
| 208 |
-
$var_checkbox++;
|
| 209 |
-
}
|
| 210 |
-
}
|
| 211 |
-
else {
|
| 212 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
| 213 |
-
$selected_text = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox];
|
| 214 |
-
$matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows + 1 + $l].']='.$selected_text."; ";
|
| 215 |
-
$var_checkbox++;
|
| 216 |
-
}
|
| 217 |
-
}
|
| 218 |
-
}
|
| 219 |
-
}
|
| 220 |
-
}
|
| 221 |
-
$data_temp[stripslashes($label_titles[$h])] = $matrix;
|
| 222 |
-
}
|
| 223 |
-
else {
|
| 224 |
-
$val = strip_tags(htmlspecialchars_decode($element_value));
|
| 225 |
-
$val = stripslashes(str_replace(''', "'", $val));
|
| 226 |
-
$data_temp[stripslashes($label_titles[$h])] = ($element_value ? $val : '');
|
| 227 |
-
}
|
| 228 |
-
}
|
| 229 |
-
else
|
| 230 |
-
$data_temp[stripslashes($label_titles[$h])] = '';
|
| 231 |
-
|
| 232 |
-
if(isset($verified_emails[$sorted_labels_id[$h]]) && $sorted_types[$h] == "type_submitter_mail") {
|
| 233 |
-
if($data_temp[stripslashes($label_titles[$h])] == '') {
|
| 234 |
-
$data_temp[stripslashes($label_titles[$h]).'(verified)'] = '';
|
| 235 |
-
} else {
|
| 236 |
-
if(in_array($i, $verified_emails[$sorted_labels_id[$h]])){
|
| 237 |
-
$data_temp[stripslashes($label_titles[$h]).'(verified)']= 'yes';
|
| 238 |
-
} else{
|
| 239 |
-
$data_temp[stripslashes($label_titles[$h]).'(verified)']= 'no';
|
| 240 |
-
}
|
| 241 |
-
}
|
| 242 |
-
}
|
| 243 |
-
}
|
| 244 |
-
|
| 245 |
-
$item_total = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s",$i,'item_total'));
|
| 246 |
-
|
| 247 |
-
$total = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s",$i,'total'));
|
| 248 |
-
|
| 249 |
-
$payment_status = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s",$i,'0'));
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
if($item_total)
|
| 253 |
-
$data_temp['Item Total'] = $item_total;
|
| 254 |
-
|
| 255 |
-
if($total)
|
| 256 |
-
$data_temp['Total'] = $total;
|
| 257 |
-
|
| 258 |
-
if($payment_status)
|
| 259 |
-
$data_temp['Payment Status'] = $payment_status;
|
| 260 |
-
|
| 261 |
-
$query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_sessions where group_id= %d", $i);
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
$paypal_info = $wpdb->get_results($query);
|
| 266 |
-
if ($paypal_info) {
|
| 267 |
-
$is_paypal_info = TRUE;
|
| 268 |
-
}
|
| 269 |
-
if ($is_paypal_info) {
|
| 270 |
-
foreach ($paypal_info_fields as $key=>$paypal_info_field) {
|
| 271 |
-
if ($paypal_info) {
|
| 272 |
-
$data_temp['PAYPAL_' . $paypal_info_labels[$key]] = $paypal_info[0]->$paypal_info_field;
|
| 273 |
-
}
|
| 274 |
-
else {
|
| 275 |
-
$data_temp['PAYPAL_' . $paypal_info_labels[$key]] = '';
|
| 276 |
-
}
|
| 277 |
-
}
|
| 278 |
-
}
|
| 279 |
-
|
| 280 |
-
$data[$i] = $data_temp;
|
| 281 |
-
}
|
| 282 |
-
}
|
| 283 |
-
|
| 284 |
-
array_push($params, $data);
|
| 285 |
-
array_push($params, $title);
|
| 286 |
-
array_push($params, $is_paypal_info);
|
| 287 |
-
|
| 288 |
-
return $params;
|
| 289 |
-
|
| 290 |
-
}
|
| 291 |
-
|
| 292 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 293 |
-
// Getters & Setters //
|
| 294 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 295 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 296 |
-
// Private Methods //
|
| 297 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 298 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 299 |
-
// Listeners //
|
| 300 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 301 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMModelGenerete_xml {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
|
| 22 |
+
public function get_data() {
|
| 23 |
+
global $wpdb;
|
| 24 |
+
$is_paypal_info = FALSE;
|
| 25 |
+
$params = array();
|
| 26 |
+
$group_id_s = array();
|
| 27 |
+
$form_id = (int)$_REQUEST['form_id'];
|
| 28 |
+
$limitstart = (int)$_REQUEST['limitstart'];
|
| 29 |
+
$search_labels = isset($_REQUEST['search_labels']) ? $_REQUEST['search_labels'] : '';
|
| 30 |
+
$verified_emails = isset($_REQUEST['verified_emails']) ? json_decode(stripslashes($_REQUEST['verified_emails']), true) : array();
|
| 31 |
+
|
| 32 |
+
$paypal_info_fields = array('currency', 'ord_last_modified', 'status', 'full_name', 'fax', 'mobile_phone', 'email', 'phone', 'address', 'paypal_info', 'ipn', 'tax', 'shipping');
|
| 33 |
+
$paypal_info_labels = array( 'Currency', 'Last modified', 'Status', 'Full Name', 'Fax', 'Mobile phone', 'Email', 'Phone', 'Address', 'Paypal info', 'IPN', 'Tax', 'Shipping');
|
| 34 |
+
|
| 35 |
+
if($search_labels){
|
| 36 |
+
$query = $wpdb->prepare("SELECT distinct group_id FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d and group_id IN(".$search_labels.")", $form_id);
|
| 37 |
+
$group_id_s = $wpdb->get_col($query);
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
$query = $wpdb->prepare("SELECT distinct element_label FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d",$form_id);
|
| 41 |
+
$labels = $wpdb->get_col($query);
|
| 42 |
+
|
| 43 |
+
$query_lable = $wpdb->prepare("SELECT label_order,title FROM " . $wpdb->prefix . "formmaker where id=%d", $form_id);
|
| 44 |
+
$rows_lable = $wpdb->get_results($query_lable);
|
| 45 |
+
$ptn = "/[^a-zA-Z0-9_]/";
|
| 46 |
+
$rpltxt = "";
|
| 47 |
+
$title = isset($rows_lable[0]) ? preg_replace($ptn, $rpltxt, $rows_lable[0]->title) : '';
|
| 48 |
+
|
| 49 |
+
$sorted_labels_id = array();
|
| 50 |
+
$sorted_labels = array();
|
| 51 |
+
$label_titles = array();
|
| 52 |
+
$sorted_types = array();
|
| 53 |
+
$label_id = array();
|
| 54 |
+
$label_order = array();
|
| 55 |
+
$label_order_original = array();
|
| 56 |
+
$label_type = array();
|
| 57 |
+
if ($labels) {
|
| 58 |
+
$label_all = explode('#****#', $rows_lable[0]->label_order);
|
| 59 |
+
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
| 60 |
+
foreach ($label_all as $key => $label_each) {
|
| 61 |
+
$label_id_each = explode('#**id**#', $label_each);
|
| 62 |
+
array_push($label_id, $label_id_each[0]);
|
| 63 |
+
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
| 64 |
+
array_push($label_order_original, $label_oder_each[0]);
|
| 65 |
+
$label_temp = preg_replace($ptn, $rpltxt, $label_oder_each[0]);
|
| 66 |
+
array_push($label_order, $label_temp);
|
| 67 |
+
array_push($label_type, $label_oder_each[1]);
|
| 68 |
+
}
|
| 69 |
+
foreach ($label_id as $key => $label) {
|
| 70 |
+
if (in_array($label, $labels) && $label_type[$key] !='type_arithmetic_captcha') {
|
| 71 |
+
array_push($sorted_labels, $label_order[$key]);
|
| 72 |
+
array_push($sorted_labels_id, $label);
|
| 73 |
+
array_push($label_titles, stripslashes($label_order_original[$key]));
|
| 74 |
+
array_push($sorted_types, $label_type[$key]);
|
| 75 |
+
}
|
| 76 |
+
}
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
$m = count($sorted_labels);
|
| 80 |
+
|
| 81 |
+
$rows = array();
|
| 82 |
+
|
| 83 |
+
if($search_labels){
|
| 84 |
+
$query = $wpdb->prepare("SELECT group_id, ip, date, user_id_wd, GROUP_CONCAT( element_label SEPARATOR ',') as element_label, GROUP_CONCAT( element_value SEPARATOR '*:*el_value*:*') as element_value FROM " . $wpdb->prefix . "formmaker_submits where form_id= %d and group_id IN(".$search_labels.") GROUP BY group_id ORDER BY date ASC limit %d, %d", $form_id, $limitstart, 1000);
|
| 85 |
+
$rows = $wpdb->get_results($query, OBJECT_K);
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
$data = array();
|
| 89 |
+
$group_id_s_count = $limitstart + 1000 < count($group_id_s) ? $limitstart + 1000 : count($group_id_s);
|
| 90 |
+
|
| 91 |
+
sort($group_id_s,SORT_NUMERIC);
|
| 92 |
+
for ($www = $limitstart; $www < $group_id_s_count; $www++) {
|
| 93 |
+
|
| 94 |
+
$i = $group_id_s[$www];
|
| 95 |
+
|
| 96 |
+
$field_key = array_search($i, $label_id);
|
| 97 |
+
if($label_type[$field_key] != 'type_arithmetic_captcha') {
|
| 98 |
+
$data_temp = array();
|
| 99 |
+
$tt = $rows[$i];
|
| 100 |
+
|
| 101 |
+
$date = $tt->date;
|
| 102 |
+
$ip = $tt->ip;
|
| 103 |
+
$user_id = get_userdata($tt->user_id_wd);
|
| 104 |
+
$username = $user_id ? $user_id->display_name : "";
|
| 105 |
+
$useremail = $user_id ? $user_id->user_email : "";
|
| 106 |
+
$data_temp['Submit date'] = $date;
|
| 107 |
+
$data_temp['Ip']=$ip;
|
| 108 |
+
$data_temp['Submitter\'s Username']=$username;
|
| 109 |
+
$data_temp['Submitter\'s Email Address']=$useremail;
|
| 110 |
+
|
| 111 |
+
$element_labels = explode(',', $tt->element_label);
|
| 112 |
+
$element_values = explode('*:*el_value*:*', $tt->element_value);
|
| 113 |
+
for ($h = 0; $h < $m; $h++) {
|
| 114 |
+
if(isset($data_temp[$label_titles[$h]]))
|
| 115 |
+
$label_titles[$h] .= '(1)';
|
| 116 |
+
|
| 117 |
+
if(in_array($sorted_labels_id[$h], $element_labels)) {
|
| 118 |
+
$element_value = $element_values[array_search($sorted_labels_id[$h], $element_labels)];
|
| 119 |
+
|
| 120 |
+
if (strpos($element_value, "*@@url@@*")) {
|
| 121 |
+
$file_names = '';
|
| 122 |
+
$new_files = explode("*@@url@@*", $element_value);
|
| 123 |
+
foreach ($new_files as $new_file) {
|
| 124 |
+
if ($new_file) {
|
| 125 |
+
$file_names .= $new_file . ", ";
|
| 126 |
+
}
|
| 127 |
+
}
|
| 128 |
+
$data_temp[stripslashes($label_titles[$h])] = $file_names;
|
| 129 |
+
}
|
| 130 |
+
elseif (strpos($element_value, "***br***")) {
|
| 131 |
+
$element_value = str_replace("***br***", ', ', $element_value);
|
| 132 |
+
if (strpos($element_value, "***quantity***")) {
|
| 133 |
+
$element_value = str_replace("***quantity***", '', $element_value);
|
| 134 |
+
}
|
| 135 |
+
if (strpos($element_value, "***property***")) {
|
| 136 |
+
$element_value = str_replace("***property***", '', $element_value);
|
| 137 |
+
}
|
| 138 |
+
if(substr($element_value, -2) == ', ') {
|
| 139 |
+
$data_temp[stripslashes($label_titles[$h])]= substr($element_value, 0, -2);
|
| 140 |
+
}
|
| 141 |
+
else {
|
| 142 |
+
$data_temp[stripslashes($label_titles[$h])]= $element_value;
|
| 143 |
+
}
|
| 144 |
+
}
|
| 145 |
+
elseif (strpos($element_value, "***map***")) {
|
| 146 |
+
$data_temp[stripslashes($label_titles[$h])] = 'Longitude:' . str_replace("***map***", ', Latitude:', $element_value);
|
| 147 |
+
}
|
| 148 |
+
elseif (strpos($element_value, "***star_rating***")) {
|
| 149 |
+
$element = str_replace("***star_rating***", '', $element_value);
|
| 150 |
+
$element = explode("***", $element);
|
| 151 |
+
$data_temp[stripslashes($label_titles[$h])] = ' ' . $element[1] . '/' . $element[0];
|
| 152 |
+
}
|
| 153 |
+
elseif (strpos($element_value, "@@@") || $element_value == "@@@" || $element_value == "@@@@@@@@@") {
|
| 154 |
+
$data_temp[stripslashes($label_titles[$h])] = str_replace("@@@", ' ', $element_value);
|
| 155 |
+
}
|
| 156 |
+
elseif (strpos($element_value, "***grading***")) {
|
| 157 |
+
$element = str_replace("***grading***", '', $element_value);
|
| 158 |
+
$grading = explode(":", $element);
|
| 159 |
+
$items_count = sizeof($grading) - 1;
|
| 160 |
+
$items = "";
|
| 161 |
+
$total = "";
|
| 162 |
+
for ($k = 0; $k < $items_count / 2; $k++) {
|
| 163 |
+
$items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . ", ";
|
| 164 |
+
$total += $grading[$k];
|
| 165 |
+
}
|
| 166 |
+
$items .= "Total: " . $total;
|
| 167 |
+
$data_temp[stripslashes($label_titles[$h])] = $items;
|
| 168 |
+
}
|
| 169 |
+
elseif (strpos($element_value, "***matrix***")) {
|
| 170 |
+
$element = str_replace("***matrix***", '', $element_value);
|
| 171 |
+
$matrix_value = explode('***', $element);
|
| 172 |
+
$matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
|
| 173 |
+
$mat_rows = $matrix_value[0];
|
| 174 |
+
$mat_columns = $matrix_value[$mat_rows + 1];
|
| 175 |
+
$matrix = "";
|
| 176 |
+
$aaa = array();
|
| 177 |
+
$var_checkbox = 1;
|
| 178 |
+
$selected_value = "";
|
| 179 |
+
$selected_value_yes = "";
|
| 180 |
+
$selected_value_no = "";
|
| 181 |
+
for ($k = 1; $k <= $mat_rows; $k++) {
|
| 182 |
+
if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
|
| 183 |
+
if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
|
| 184 |
+
$checked = "0";
|
| 185 |
+
$aaa[1] = "";
|
| 186 |
+
}
|
| 187 |
+
else {
|
| 188 |
+
$aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
|
| 189 |
+
}
|
| 190 |
+
for ($l = 1; $l <= $mat_columns; $l++) {
|
| 191 |
+
$checked = $aaa[1] == $l ? '1' : '0';
|
| 192 |
+
$matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
|
| 193 |
+
}
|
| 194 |
+
}
|
| 195 |
+
else {
|
| 196 |
+
if ($matrix_value[$mat_rows+$mat_columns + 2] == "checkbox") {
|
| 197 |
+
for ($l = 1; $l <= $mat_columns; $l++) {
|
| 198 |
+
$checked = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox] == 1 ? '1' : '0';
|
| 199 |
+
$matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
|
| 200 |
+
$var_checkbox++;
|
| 201 |
+
}
|
| 202 |
+
}
|
| 203 |
+
else {
|
| 204 |
+
if ($matrix_value[$mat_rows+$mat_columns + 2] == "text") {
|
| 205 |
+
for ($l = 1; $l <= $mat_columns; $l++) {
|
| 206 |
+
$text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
|
| 207 |
+
$matrix .='['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$text_value."; ";
|
| 208 |
+
$var_checkbox++;
|
| 209 |
+
}
|
| 210 |
+
}
|
| 211 |
+
else {
|
| 212 |
+
for ($l = 1; $l <= $mat_columns; $l++) {
|
| 213 |
+
$selected_text = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox];
|
| 214 |
+
$matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows + 1 + $l].']='.$selected_text."; ";
|
| 215 |
+
$var_checkbox++;
|
| 216 |
+
}
|
| 217 |
+
}
|
| 218 |
+
}
|
| 219 |
+
}
|
| 220 |
+
}
|
| 221 |
+
$data_temp[stripslashes($label_titles[$h])] = $matrix;
|
| 222 |
+
}
|
| 223 |
+
else {
|
| 224 |
+
$val = strip_tags(htmlspecialchars_decode($element_value));
|
| 225 |
+
$val = stripslashes(str_replace(''', "'", $val));
|
| 226 |
+
$data_temp[stripslashes($label_titles[$h])] = ($element_value ? $val : '');
|
| 227 |
+
}
|
| 228 |
+
}
|
| 229 |
+
else
|
| 230 |
+
$data_temp[stripslashes($label_titles[$h])] = '';
|
| 231 |
+
|
| 232 |
+
if(isset($verified_emails[$sorted_labels_id[$h]]) && $sorted_types[$h] == "type_submitter_mail") {
|
| 233 |
+
if($data_temp[stripslashes($label_titles[$h])] == '') {
|
| 234 |
+
$data_temp[stripslashes($label_titles[$h]).'(verified)'] = '';
|
| 235 |
+
} else {
|
| 236 |
+
if(in_array($i, $verified_emails[$sorted_labels_id[$h]])){
|
| 237 |
+
$data_temp[stripslashes($label_titles[$h]).'(verified)']= 'yes';
|
| 238 |
+
} else{
|
| 239 |
+
$data_temp[stripslashes($label_titles[$h]).'(verified)']= 'no';
|
| 240 |
+
}
|
| 241 |
+
}
|
| 242 |
+
}
|
| 243 |
+
}
|
| 244 |
+
|
| 245 |
+
$item_total = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s",$i,'item_total'));
|
| 246 |
+
|
| 247 |
+
$total = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s",$i,'total'));
|
| 248 |
+
|
| 249 |
+
$payment_status = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s",$i,'0'));
|
| 250 |
+
|
| 251 |
+
|
| 252 |
+
if($item_total)
|
| 253 |
+
$data_temp['Item Total'] = $item_total;
|
| 254 |
+
|
| 255 |
+
if($total)
|
| 256 |
+
$data_temp['Total'] = $total;
|
| 257 |
+
|
| 258 |
+
if($payment_status)
|
| 259 |
+
$data_temp['Payment Status'] = $payment_status;
|
| 260 |
+
|
| 261 |
+
$query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_sessions where group_id= %d", $i);
|
| 262 |
+
|
| 263 |
+
|
| 264 |
+
|
| 265 |
+
$paypal_info = $wpdb->get_results($query);
|
| 266 |
+
if ($paypal_info) {
|
| 267 |
+
$is_paypal_info = TRUE;
|
| 268 |
+
}
|
| 269 |
+
if ($is_paypal_info) {
|
| 270 |
+
foreach ($paypal_info_fields as $key=>$paypal_info_field) {
|
| 271 |
+
if ($paypal_info) {
|
| 272 |
+
$data_temp['PAYPAL_' . $paypal_info_labels[$key]] = $paypal_info[0]->$paypal_info_field;
|
| 273 |
+
}
|
| 274 |
+
else {
|
| 275 |
+
$data_temp['PAYPAL_' . $paypal_info_labels[$key]] = '';
|
| 276 |
+
}
|
| 277 |
+
}
|
| 278 |
+
}
|
| 279 |
+
|
| 280 |
+
$data[$i] = $data_temp;
|
| 281 |
+
}
|
| 282 |
+
}
|
| 283 |
+
|
| 284 |
+
array_push($params, $data);
|
| 285 |
+
array_push($params, $title);
|
| 286 |
+
array_push($params, $is_paypal_info);
|
| 287 |
+
|
| 288 |
+
return $params;
|
| 289 |
+
|
| 290 |
+
}
|
| 291 |
+
|
| 292 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 293 |
+
// Getters & Setters //
|
| 294 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 295 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 296 |
+
// Private Methods //
|
| 297 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 298 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 299 |
+
// Listeners //
|
| 300 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 301 |
}
|
admin/models/FMModelGoptions_fm.php
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMModelGoptions_fm {
|
| 4 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMModelGoptions_fm {
|
| 4 |
}
|
admin/models/FMModelLicensing_fm.php
CHANGED
|
@@ -1,30 +1,30 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMModelLicensing_fm {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 22 |
-
// Getters & Setters //
|
| 23 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 25 |
-
// Private Methods //
|
| 26 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 28 |
-
// Listeners //
|
| 29 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 30 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMModelLicensing_fm {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 22 |
+
// Getters & Setters //
|
| 23 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 24 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 25 |
+
// Private Methods //
|
| 26 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 27 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 28 |
+
// Listeners //
|
| 29 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 30 |
}
|
admin/models/FMModelManage_fm.php
CHANGED
|
@@ -1,2887 +1,2887 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMModelManage_fm {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
public function get_rows_data() {
|
| 22 |
-
global $wpdb;
|
| 23 |
-
$where = 'WHERE `id` NOT IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')';
|
| 24 |
-
$where .= ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? ' AND title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
|
| 25 |
-
$asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
|
| 26 |
-
$order_by_array = array('id', 'title', 'mail');
|
| 27 |
-
$order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
|
| 28 |
-
$order_by = ' ORDER BY `' . $order_by . '` ' . $asc_or_desc;
|
| 29 |
-
if (isset($_POST['page_number']) && $_POST['page_number']) {
|
| 30 |
-
$limit = ((int)$_POST['page_number'] - 1) * 20;
|
| 31 |
-
}
|
| 32 |
-
else {
|
| 33 |
-
$limit = 0;
|
| 34 |
-
}
|
| 35 |
-
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker " . $where . $order_by . " LIMIT " . $limit . ",20";
|
| 36 |
-
$rows = $wpdb->get_results($query);
|
| 37 |
-
return $rows;
|
| 38 |
-
}
|
| 39 |
-
|
| 40 |
-
public function get_row_data($id) {
|
| 41 |
-
global $wpdb;
|
| 42 |
-
if ($id != 0) {
|
| 43 |
-
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
|
| 44 |
-
}
|
| 45 |
-
else {
|
| 46 |
-
$row = new stdClass();
|
| 47 |
-
$row->id = 0;
|
| 48 |
-
$row->title = '';
|
| 49 |
-
$row->mail = '';
|
| 50 |
-
$row->form = '';
|
| 51 |
-
$row->form_front = '';
|
| 52 |
-
$row->theme = 0;
|
| 53 |
-
$row->javascript = '';
|
| 54 |
-
$row->submit_text = '';
|
| 55 |
-
$row->url = '';
|
| 56 |
-
$row->submit_text_type = 0;
|
| 57 |
-
$row->script1 = '';
|
| 58 |
-
$row->script2 = '';
|
| 59 |
-
$row->script_user1 = '';
|
| 60 |
-
$row->script_user2 = '';
|
| 61 |
-
$row->counter = 0;
|
| 62 |
-
$row->label_order = '';
|
| 63 |
-
$row->article_id = '';
|
| 64 |
-
$row->pagination = '';
|
| 65 |
-
$row->show_title = '';
|
| 66 |
-
$row->show_numbers = '';
|
| 67 |
-
$row->public_key = '';
|
| 68 |
-
$row->private_key = '';
|
| 69 |
-
$row->recaptcha_theme = '';
|
| 70 |
-
$row->from_name = '';
|
| 71 |
-
$row->from_mail = '';
|
| 72 |
-
$row->label_order_current = '';
|
| 73 |
-
$row->script_mail_user = '';
|
| 74 |
-
$row->script_mail = '';
|
| 75 |
-
$row->tax = 0;
|
| 76 |
-
$row->payment_currency = '$';
|
| 77 |
-
$row->paypal_email = '';
|
| 78 |
-
$row->checkout_mode = 'testmode';
|
| 79 |
-
$row->paypal_mode = 0;
|
| 80 |
-
|
| 81 |
-
$row->published = 1;
|
| 82 |
-
$row->form_fields = '';
|
| 83 |
-
$row->savedb = 1;
|
| 84 |
-
$row->sendemail = 1;
|
| 85 |
-
$row->requiredmark = '*';
|
| 86 |
-
$row->reply_to = 0;
|
| 87 |
-
$row->send_to = 0;
|
| 88 |
-
$row->autogen_layout = 1;
|
| 89 |
-
$row->custom_front = '';
|
| 90 |
-
$row->mail_from_user = '';
|
| 91 |
-
$row->mail_from_name_user = '';
|
| 92 |
-
$row->reply_to_user = '';
|
| 93 |
-
$row->save_uploads = 1;
|
| 94 |
-
$row->header_title = '';
|
| 95 |
-
$row->header_description = '';
|
| 96 |
-
$row->header_image_url = '';
|
| 97 |
-
$row->header_image_animation = '';
|
| 98 |
-
$row->header_hide_image = '';
|
| 99 |
-
}
|
| 100 |
-
return $row;
|
| 101 |
-
}
|
| 102 |
-
|
| 103 |
-
public function get_row_data_new($id) {
|
| 104 |
-
global $wpdb;
|
| 105 |
-
if ($id != 0) {
|
| 106 |
-
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_backup WHERE backup_id="%d"', $id));
|
| 107 |
-
$labels2 = array();
|
| 108 |
-
$label_id = array();
|
| 109 |
-
$label_order_original = array();
|
| 110 |
-
$label_type = array();
|
| 111 |
-
$label_all = explode('#****#', $row->label_order);
|
| 112 |
-
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
| 113 |
-
foreach($label_all as $key => $label_each) {
|
| 114 |
-
$label_id_each=explode('#**id**#',$label_each);
|
| 115 |
-
array_push($label_id, $label_id_each[0]);
|
| 116 |
-
$label_oder_each=explode('#**label**#', $label_id_each[1]);
|
| 117 |
-
array_push($label_order_original, addslashes($label_oder_each[0]));
|
| 118 |
-
array_push($label_type, $label_oder_each[1]);
|
| 119 |
-
}
|
| 120 |
-
$labels2['id'] = '"' . implode('","', $label_id) . '"';
|
| 121 |
-
$labels2['label'] = '"' . implode('","', $label_order_original) . '"';
|
| 122 |
-
$labels2['type'] = '"' . implode('","', $label_type) . '"';
|
| 123 |
-
$ids = array();
|
| 124 |
-
$types = array();
|
| 125 |
-
$labels = array();
|
| 126 |
-
$paramss = array();
|
| 127 |
-
$fields = explode('*:*new_field*:*', $row->form_fields);
|
| 128 |
-
$fields = array_slice($fields, 0, count($fields) - 1);
|
| 129 |
-
foreach ($fields as $field) {
|
| 130 |
-
$temp=explode('*:*id*:*',$field);
|
| 131 |
-
array_push($ids, $temp[0]);
|
| 132 |
-
$temp=explode('*:*type*:*',$temp[1]);
|
| 133 |
-
array_push($types, $temp[0]);
|
| 134 |
-
$temp=explode('*:*w_field_label*:*',$temp[1]);
|
| 135 |
-
array_push($labels, $temp[0]);
|
| 136 |
-
array_push($paramss, $temp[1]);
|
| 137 |
-
}
|
| 138 |
-
$form = $row->form_front;
|
| 139 |
-
foreach ($ids as $ids_key => $id) {
|
| 140 |
-
$label = $labels[$ids_key];
|
| 141 |
-
$type = $types[$ids_key];
|
| 142 |
-
$params = $paramss[$ids_key];
|
| 143 |
-
if (strpos($form, '%'.$id.' - '.$label.'%') || strpos($form, '%'.$id.' -'.$label.'%')) {
|
| 144 |
-
$rep = '';
|
| 145 |
-
$arrows='';
|
| 146 |
-
$param = array();
|
| 147 |
-
$param['attributes'] = '';
|
| 148 |
-
switch($type)
|
| 149 |
-
{
|
| 150 |
-
case 'type_section_break':
|
| 151 |
-
{
|
| 152 |
-
$arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" ><div id="X_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png?ver='. WD_FM_VERSION.'" title="Remove the field" onclick="remove_section_break("'.$id.'")" onmouseover="chnage_icons_src(this,"delete_el")" onmouseout="chnage_icons_src(this,"delete_el")"></div><div id="edit_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png?ver='. WD_FM_VERSION.'" title="Edit the field" onclick="edit("'.$id.'")" onmouseover="chnage_icons_src(this,"edit")" onmouseout="chnage_icons_src(this,"edit")"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">custom_'.$id.'</span></div><div id="duplicate_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/duplicate.png?ver='. WD_FM_VERSION.'" title="Duplicate the field" onclick="duplicate("'.$id.'")" onmouseover="chnage_icons_src(this,"duplicate")" onmouseout="chnage_icons_src(this,"duplicate")"></div></div>';
|
| 153 |
-
break;
|
| 154 |
-
}
|
| 155 |
-
case 'type_editor':
|
| 156 |
-
{
|
| 157 |
-
$arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" type="type_editor" style="margin-top:0px;"><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png?ver='. WD_FM_VERSION.'" title="Remove the field" onclick="remove_row("'.$id.'")" onmouseover="chnage_icons_src(this,"delete_el")" onmouseout="chnage_icons_src(this,"delete_el")"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/left.png?ver='. WD_FM_VERSION.'" title="Move the field to the left" onclick="left_row("'.$id.'")" onmouseover="chnage_icons_src(this,"left")" onmouseout="chnage_icons_src(this,"left")"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/up.png?ver='. WD_FM_VERSION.'" title="Move the field up" onclick="up_row("'.$id.'")" onmouseover="chnage_icons_src(this,"up")" onmouseout="chnage_icons_src(this,"up")"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/down.png?ver='. WD_FM_VERSION.'" title="Move the field down" onclick="down_row("'.$id.'")" onmouseover="chnage_icons_src(this,"down")" onmouseout="chnage_icons_src(this,"down")"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/right.png?ver='. WD_FM_VERSION.'" title="Move the field to the right" onclick="right_row("'.$id.'")" onmouseover="chnage_icons_src(this,"right")" onmouseout="chnage_icons_src(this,"right")"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png?ver='. WD_FM_VERSION.'" title="Edit the field" onclick="edit("'.$id.'")" onmouseover="chnage_icons_src(this,"edit")" onmouseout="chnage_icons_src(this,"edit")"></div><div id="duplicate_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/duplicate.png?ver='. WD_FM_VERSION.'" title="Duplicate the field" onclick="duplicate("'.$id.'")" onmouseover="chnage_icons_src(this,"duplicate")" onmouseout="chnage_icons_src(this,"duplicate")"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_up.png?ver='. WD_FM_VERSION.'" title="Move the field to the upper page" onclick="page_up("'.$id.'")" onmouseover="chnage_icons_src(this,"page_up")" onmouseout="chnage_icons_src(this,"page_up")"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_down.png?ver='. WD_FM_VERSION.'" title="Move the field to the lower page" onclick="page_down("'.$id.'")" onmouseover="chnage_icons_src(this,"page_down")" onmouseout="chnage_icons_src(this,"page_down")"></div></div>';
|
| 158 |
-
break;
|
| 159 |
-
}
|
| 160 |
-
|
| 161 |
-
case 'type_send_copy':
|
| 162 |
-
case 'type_stripe':
|
| 163 |
-
case 'type_captcha':
|
| 164 |
-
case 'type_arithmetic_captcha':
|
| 165 |
-
case 'type_recaptcha':
|
| 166 |
-
{
|
| 167 |
-
$arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows"><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png?ver='. WD_FM_VERSION.'" title="Remove the field" onclick="remove_row("'.$id.'")" onmouseover="chnage_icons_src(this,"delete_el")" onmouseout="chnage_icons_src(this,"delete_el")"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/left.png?ver='. WD_FM_VERSION.'" title="Move the field to the left" onclick="left_row("'.$id.'")" onmouseover="chnage_icons_src(this,"left")" onmouseout="chnage_icons_src(this,"left")"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/up.png?ver='. WD_FM_VERSION.'" title="Move the field up" onclick="up_row("'.$id.'")" onmouseover="chnage_icons_src(this,"up")" onmouseout="chnage_icons_src(this,"up")"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/down.png?ver='. WD_FM_VERSION.'" title="Move the field down" onclick="down_row("'.$id.'")" onmouseover="chnage_icons_src(this,"down")" onmouseout="chnage_icons_src(this,"down")"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/right.png?ver='. WD_FM_VERSION.'" title="Move the field to the right" onclick="right_row("'.$id.'")" onmouseover="chnage_icons_src(this,"right")" onmouseout="chnage_icons_src(this,"right")"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png?ver='. WD_FM_VERSION.'" title="Edit the field" onclick="edit("'.$id.'")" onmouseover="chnage_icons_src(this,"edit")" onmouseout="chnage_icons_src(this,"edit")"></div><div id="duplicate_'.$id.'" valign="middle" class="element_toolbar"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_up.png?ver='. WD_FM_VERSION.'" title="Move the field to the upper page" onclick="page_up("'.$id.'")" onmouseover="chnage_icons_src(this,"page_up")" onmouseout="chnage_icons_src(this,"page_up")"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_down.png?ver='. WD_FM_VERSION.'" title="Move the field to the lower page" onclick="page_down("'.$id.'")" onmouseover="chnage_icons_src(this,"page_down")" onmouseout="chnage_icons_src(this,"page_down")"></div></div>';
|
| 168 |
-
break;
|
| 169 |
-
}
|
| 170 |
-
|
| 171 |
-
default :
|
| 172 |
-
{
|
| 173 |
-
$arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" ><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png?ver='. WD_FM_VERSION.'" title="Remove the field" onclick="remove_row("'.$id.'")" onmouseover="chnage_icons_src(this,"delete_el")" onmouseout="chnage_icons_src(this,"delete_el")"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/left.png?ver='. WD_FM_VERSION.'" title="Move the field to the left" onclick="left_row("'.$id.'")" onmouseover="chnage_icons_src(this,"left")" onmouseout="chnage_icons_src(this,"left")"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/up.png?ver='. WD_FM_VERSION.'" title="Move the field up" onclick="up_row("'.$id.'")" onmouseover="chnage_icons_src(this,"up")" onmouseout="chnage_icons_src(this,"up")"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/down.png?ver='. WD_FM_VERSION.'" title="Move the field down" onclick="down_row("'.$id.'")" onmouseover="chnage_icons_src(this,"down")" onmouseout="chnage_icons_src(this,"down")"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/right.png?ver='. WD_FM_VERSION.'" title="Move the field to the right" onclick="right_row("'.$id.'")" onmouseover="chnage_icons_src(this,"right")" onmouseout="chnage_icons_src(this,"right")"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png?ver='. WD_FM_VERSION.'" title="Edit the field" onclick="edit("'.$id.'")" onmouseover="chnage_icons_src(this,"edit")" onmouseout="chnage_icons_src(this,"edit")"></div><div id="duplicate_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/duplicate.png?ver='. WD_FM_VERSION.'" title="Duplicate the field" onclick="duplicate("'.$id.'")" onmouseover="chnage_icons_src(this,"duplicate")" onmouseout="chnage_icons_src(this,"duplicate")"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_up.png?ver='. WD_FM_VERSION.'" title="Move the field to the upper page" onclick="page_up("'.$id.'")" onmouseover="chnage_icons_src(this,"page_up")" onmouseout="chnage_icons_src(this,"page_up")"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_down.png?ver='. WD_FM_VERSION.'" title="Move the field to the lower page" onclick="page_down("'.$id.'")" onmouseover="chnage_icons_src(this,"page_down")" onmouseout="chnage_icons_src(this,"page_down")"></div></div>';
|
| 174 |
-
break;
|
| 175 |
-
}
|
| 176 |
-
|
| 177 |
-
}
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
switch ($type) {
|
| 183 |
-
case 'type_section_break': {
|
| 184 |
-
$params_names = array('w_editor');
|
| 185 |
-
$temp = $params;
|
| 186 |
-
foreach ($params_names as $params_name) {
|
| 187 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 188 |
-
$param[$params_name] = $temp[0];
|
| 189 |
-
$temp = $temp[1];
|
| 190 |
-
}
|
| 191 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_section_break" class="wdform_field_section_break">'.$arrows.'<span id="'.$id.'_element_labelform_id_temp" style="display: none;">custom_'.$id.'</span><div id="'.$id.'_element_sectionform_id_temp" align="left" class="wdform_section_break">'.$param['w_editor'].'</div></div><div id="'.$id.'_element_labelform_id_temp" style="color:red;">custom_'.$id.'</div>';
|
| 192 |
-
break;
|
| 193 |
-
}
|
| 194 |
-
case 'type_editor': {
|
| 195 |
-
$params_names = array('w_editor');
|
| 196 |
-
$temp = $params;
|
| 197 |
-
foreach ($params_names as $params_name ) {
|
| 198 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 199 |
-
$param[$params_name] = $temp[0];
|
| 200 |
-
$temp = $temp[1];
|
| 201 |
-
}
|
| 202 |
-
$rep =$arrows.'<div id="wdform_field'.$id.'" type="type_editor" class="wdform_field" >'.$param['w_editor'].'</div><div id="'.$id.'_element_labelform_id_temp" style="color: red;">custom_'.$id.'</div>';
|
| 203 |
-
break;
|
| 204 |
-
}
|
| 205 |
-
case 'type_send_copy': {
|
| 206 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_required');
|
| 207 |
-
$temp = $params;
|
| 208 |
-
|
| 209 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 210 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_first_val', 'w_required');
|
| 211 |
-
|
| 212 |
-
foreach ($params_names as $params_name ) {
|
| 213 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 214 |
-
$param[$params_name] = $temp[0];
|
| 215 |
-
$temp = $temp[1];
|
| 216 |
-
}
|
| 217 |
-
if ($temp) {
|
| 218 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 219 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 220 |
-
foreach ($attrs as $attr) {
|
| 221 |
-
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
| 222 |
-
}
|
| 223 |
-
}
|
| 224 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
| 225 |
-
|
| 226 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 227 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 228 |
-
|
| 229 |
-
$input_active = ($param['w_first_val'] == 'true' ? "checked='checked'" : "");
|
| 230 |
-
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
| 231 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_send_copy" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" style="display: '.$param['w_field_label_pos'].'"><input type="hidden" value="type_send_copy" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp" /><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp" /><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="checkbox" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" onclick="set_checked("'.$id.'","","form_id_temp")" '.$input_active.' '.$param['attributes'].' disabled /></div></div>';
|
| 232 |
-
break;
|
| 233 |
-
}
|
| 234 |
-
case 'type_text': {
|
| 235 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique');
|
| 236 |
-
$temp = $params;
|
| 237 |
-
if(strpos($temp, 'w_regExp_status') > -1)
|
| 238 |
-
$params_names = array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required', 'w_regExp_status', 'w_regExp_value', 'w_regExp_common', 'w_regExp_arg', 'w_regExp_alert', 'w_unique');
|
| 239 |
-
|
| 240 |
-
if(strpos($temp, 'w_readonly') > -1)
|
| 241 |
-
$params_names = array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required', 'w_regExp_status', 'w_regExp_value', 'w_regExp_common', 'w_regExp_arg', 'w_regExp_alert', 'w_unique', 'w_readonly');
|
| 242 |
-
|
| 243 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 244 |
-
$params_names = array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size','w_first_val','w_title','w_required', 'w_regExp_status', 'w_regExp_value', 'w_regExp_common', 'w_regExp_arg', 'w_regExp_alert', 'w_unique', 'w_readonly');
|
| 245 |
-
|
| 246 |
-
foreach ($params_names as $params_name) {
|
| 247 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 248 |
-
$param[$params_name] = $temp[0];
|
| 249 |
-
$temp = $temp[1];
|
| 250 |
-
}
|
| 251 |
-
if ($temp) {
|
| 252 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 253 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 254 |
-
foreach ($attrs as $attr) {
|
| 255 |
-
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
| 256 |
-
}
|
| 257 |
-
}
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
| 263 |
-
$input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
|
| 264 |
-
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
| 265 |
-
|
| 266 |
-
$param['w_regExp_status'] = (isset($param['w_regExp_status']) ? $param['w_regExp_status'] : "no");
|
| 267 |
-
$param['w_regExp_value'] = (isset($param['w_regExp_value']) ? $param['w_regExp_value'] : "");
|
| 268 |
-
$param['w_regExp_common'] = (isset($param['w_regExp_common']) ? $param['w_regExp_common'] : "");
|
| 269 |
-
$param['w_regExp_arg'] = (isset($param['w_regExp_arg']) ? $param['w_regExp_arg'] : "");
|
| 270 |
-
$param['w_regExp_alert'] = (isset($param['w_regExp_alert']) ? $param['w_regExp_alert'] : "Incorrect Value");
|
| 271 |
-
|
| 272 |
-
$param['w_readonly'] = (isset($param['w_readonly']) ? $param['w_readonly'] : "no");
|
| 273 |
-
|
| 274 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 275 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_text" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" style="display: '.$param['w_field_label_pos'].'"><input type="hidden" value="type_text" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp" /><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp" /><input type="hidden" value="'.$param['w_readonly'].'" name="'.$id.'_readonlyform_id_temp" id="'.$id.'_readonlyform_id_temp"/><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_regExp_status'].'" name="'.$id.'_regExpStatusform_id_temp" id="'.$id.'_regExpStatusform_id_temp"><input type="hidden" value="'.$param['w_regExp_value'].'" name="'.$id.'_regExp_valueform_id_temp" id="'.$id.'_regExp_valueform_id_temp"><input type="hidden" value="'.$param['w_regExp_common'].'" name="'.$id.'_regExp_commonform_id_temp" id="'.$id.'_regExp_commonform_id_temp"><input type="hidden" value="'.$param['w_regExp_alert'].'" name="'.$id.'_regExp_alertform_id_temp" id="'.$id.'_regExp_alertform_id_temp"><input type="hidden" value="'.$param['w_regExp_arg'].'" name="'.$id.'_regArgumentform_id_temp" id="'.$id.'_regArgumentform_id_temp"><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp" /><input type="text" class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" onfocus="delete_value("'.$id.'_elementform_id_temp")" onblur="return_value("'.$id.'_elementform_id_temp")" onchange="change_value("'.$id.'_elementform_id_temp")" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div></div>';
|
| 279 |
-
|
| 280 |
-
break;
|
| 281 |
-
}
|
| 282 |
-
case 'type_number': {
|
| 283 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique', 'w_class');
|
| 284 |
-
$temp = $params;
|
| 285 |
-
foreach ($params_names as $params_name) {
|
| 286 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 287 |
-
$param[$params_name] = $temp[0];
|
| 288 |
-
$temp = $temp[1];
|
| 289 |
-
}
|
| 290 |
-
if ($temp) {
|
| 291 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 292 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 293 |
-
foreach ($attrs as $attr) {
|
| 294 |
-
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
| 295 |
-
}
|
| 296 |
-
}
|
| 297 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
| 298 |
-
$input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
|
| 299 |
-
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
| 300 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_number" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'"><input type="hidden" value="type_number" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><input type="text" class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" onkeypress="return check_isnum(event)" onfocus="delete_value("'.$id.'_elementform_id_temp")" onblur="return_value("'.$id.'_elementform_id_temp")" onchange="change_value("'.$id.'_elementform_id_temp")" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div></div>';
|
| 301 |
-
break;
|
| 302 |
-
}
|
| 303 |
-
case 'type_password': {
|
| 304 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_required', 'w_unique', 'w_class');
|
| 305 |
-
$temp = $params;
|
| 306 |
-
|
| 307 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 308 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_size', 'w_required', 'w_unique', 'w_class');
|
| 309 |
-
|
| 310 |
-
if(strpos($temp, 'w_verification') > -1)
|
| 311 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_size', 'w_required', 'w_unique', 'w_class', 'w_verification', 'w_verification_label');
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
foreach ($params_names as $params_name) {
|
| 316 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 317 |
-
$param[$params_name] = $temp[0];
|
| 318 |
-
$temp = $temp[1];
|
| 319 |
-
}
|
| 320 |
-
if ($temp) {
|
| 321 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 322 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 323 |
-
foreach ($attrs as $attr) {
|
| 324 |
-
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
| 325 |
-
}
|
| 326 |
-
}
|
| 327 |
-
|
| 328 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
| 329 |
-
|
| 330 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 331 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
if(isset($param['w_verification']) && $param['w_verification'] == "yes"){
|
| 335 |
-
$display_label_confirm = $display_label;
|
| 336 |
-
$display_element_confirm = $param['w_field_label_pos'];
|
| 337 |
-
}
|
| 338 |
-
else{
|
| 339 |
-
$display_label_confirm = "none";
|
| 340 |
-
$display_element_confirm = "none";
|
| 341 |
-
}
|
| 342 |
-
|
| 343 |
-
$param['w_verification'] = isset($param['w_verification']) ? $param['w_verification'] : "no";
|
| 344 |
-
$param['w_verification_label'] = isset($param['w_verification_label']) ? $param['w_verification_label'] : "Password confirmation:";
|
| 345 |
-
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
$confirm_password ='<br><div align="left" id="'.$id.'_1_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label_confirm.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_1_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$param['w_verification_label'].'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_1_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_element_confirm.';"><input type="hidden" value="'.$param['w_verification'].'" name="'.$id.'_verification_id_temp" id="'.$id.'_verification_id_temp"><input type="text" class="input_deactive" id="'.$id.'_1_elementform_id_temp" name="'.$id.'_1_elementform_id_temp" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div>';
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_password" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'"><input type="hidden" value="type_password" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><input type="password" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div>'.$confirm_password.'</div>';
|
| 353 |
-
break;
|
| 354 |
-
|
| 355 |
-
}
|
| 356 |
-
case 'type_textarea': {
|
| 357 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size_w', 'w_size_h', 'w_first_val', 'w_title', 'w_required', 'w_unique', 'w_class');
|
| 358 |
-
$temp = $params;
|
| 359 |
-
|
| 360 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 361 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_size_w', 'w_size_h', 'w_first_val', 'w_title', 'w_required', 'w_unique', 'w_class');
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
foreach ($params_names as $params_name) {
|
| 366 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 367 |
-
$param[$params_name] = $temp[0];
|
| 368 |
-
$temp = $temp[1];
|
| 369 |
-
}
|
| 370 |
-
if ($temp) {
|
| 371 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 372 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 373 |
-
foreach ($attrs as $attr) {
|
| 374 |
-
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
| 375 |
-
}
|
| 376 |
-
}
|
| 377 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
| 378 |
-
$input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
|
| 379 |
-
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
| 380 |
-
|
| 381 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 382 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_textarea" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display:'.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><input type="hidden" value="type_textarea" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><textarea class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" title="'.$param['w_title'].'" onfocus="delete_value("'.$id.'_elementform_id_temp")" onblur="return_value("'.$id.'_elementform_id_temp")" onchange="change_value("'.$id.'_elementform_id_temp")" style="width: '.$param['w_size_w'].'px; height: '.$param['w_size_h'].'px;" '.$param['attributes'].' disabled>'.$param['w_first_val'].'</textarea></div></div>';
|
| 386 |
-
break;
|
| 387 |
-
}
|
| 388 |
-
case 'type_phone': {
|
| 389 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_mini_labels', 'w_required', 'w_unique', 'w_class');
|
| 390 |
-
$temp = $params;
|
| 391 |
-
|
| 392 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 393 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_size', 'w_first_val', 'w_title', 'w_mini_labels', 'w_required', 'w_unique', 'w_class');
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
foreach ($params_names as $params_name) {
|
| 397 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 398 |
-
$param[$params_name] = $temp[0];
|
| 399 |
-
$temp = $temp[1];
|
| 400 |
-
}
|
| 401 |
-
if ($temp) {
|
| 402 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 403 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 404 |
-
foreach ($attrs as $attr) {
|
| 405 |
-
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
| 406 |
-
}
|
| 407 |
-
}
|
| 408 |
-
$w_first_val = explode('***', $param['w_first_val']);
|
| 409 |
-
$w_title = explode('***', $param['w_title']);
|
| 410 |
-
$w_mini_labels = explode('***', $param['w_mini_labels']);
|
| 411 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
| 412 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 413 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 414 |
-
|
| 415 |
-
$input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
|
| 416 |
-
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
| 417 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_phone" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_phone" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><div id="'.$id.'_table_name" style="display: table;"><div id="'.$id.'_tr_name1" style="display: table-row;"><div id="'.$id.'_td_name_input_first" style="display: table-cell;"><input type="text" class="'.$input_active.'" id="'.$id.'_element_firstform_id_temp" name="'.$id.'_element_firstform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'" onfocus="delete_value("'.$id.'_element_firstform_id_temp")"onblur="return_value("'.$id.'_element_firstform_id_temp")"onchange="change_value("'.$id.'_element_firstform_id_temp")" onkeypress="return check_isnum(event)"style="width: 50px;" '.$param['attributes'].' disabled /><span class="wdform_line" style="margin: 0px 4px; padding: 0px;">-</span></div><div id="'.$id.'_td_name_input_last" style="display: table-cell;"><input type="text" class="'.$input_active.'" id="'.$id.'_element_lastform_id_temp" name="'.$id.'_element_lastform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'" onfocus="delete_value("'.$id.'_element_lastform_id_temp")"onblur="return_value("'.$id.'_element_lastform_id_temp")" onchange="change_value("'.$id.'_element_lastform_id_temp")" onkeypress="return check_isnum(event)"style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div></div><div id="'.$id.'_tr_name2" style="display: table-row;"><div id="'.$id.'_td_name_label_first" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_area_code">'.$w_mini_labels[0].'</label></div><div id="'.$id.'_td_name_label_last" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_phone_number">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
|
| 418 |
-
break;
|
| 419 |
-
}
|
| 420 |
-
|
| 421 |
-
case 'type_phone_new': {
|
| 422 |
-
$temp = $params;
|
| 423 |
-
$params_names = array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size','w_first_val', 'w_top_country','w_required','w_unique', 'w_class');
|
| 424 |
-
|
| 425 |
-
foreach ($params_names as $params_name) {
|
| 426 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 427 |
-
$param[$params_name] = $temp[0];
|
| 428 |
-
$temp = $temp[1];
|
| 429 |
-
}
|
| 430 |
-
if ($temp) {
|
| 431 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 432 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 433 |
-
foreach ($attrs as $attr) {
|
| 434 |
-
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
| 435 |
-
}
|
| 436 |
-
}
|
| 437 |
-
|
| 438 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
| 439 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 440 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 441 |
-
|
| 442 |
-
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
| 443 |
-
|
| 444 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_phone_new" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_phone_new" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><div id="'.$id.'_table_name" style="display: table;"><div id="'.$id.'_tr_name1" style="display: table-row;"><div id="'.$id.'_td_name_input_first" style="display: table-cell;"><input type="text" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" top-country = "'.$param['w_top_country'].'" onfocus="delete_value("'.$id.'_elementform_id_temp")" onblur="return_value("'.$id.'_elementform_id_temp")" onchange="change_value("'.$id.'_elementform_id_temp")" onkeypress="return check_isnum("'.$id.'_elementform_id_temp")" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled></div></div></div></div></div>';
|
| 445 |
-
break;
|
| 446 |
-
}
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
case 'type_name': {
|
| 450 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class');
|
| 451 |
-
$temp = $params;
|
| 452 |
-
if(strpos($temp, 'w_name_fields') > -1)
|
| 453 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class', 'w_name_fields');
|
| 454 |
-
|
| 455 |
-
if(strpos($temp, 'w_autofill') > -1)
|
| 456 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class', 'w_name_fields', 'w_autofill');
|
| 457 |
-
|
| 458 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 459 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class', 'w_name_fields');
|
| 460 |
-
|
| 461 |
-
foreach ($params_names as $params_name) {
|
| 462 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 463 |
-
$param[$params_name] = $temp[0];
|
| 464 |
-
$temp = $temp[1];
|
| 465 |
-
}
|
| 466 |
-
if ($temp) {
|
| 467 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 468 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 469 |
-
foreach ($attrs as $attr) {
|
| 470 |
-
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
| 471 |
-
}
|
| 472 |
-
}
|
| 473 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
| 474 |
-
|
| 475 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 476 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
| 480 |
-
$w_first_val = explode('***', $param['w_first_val']);
|
| 481 |
-
$w_title = explode('***', $param['w_title']);
|
| 482 |
-
$w_mini_labels = explode('***', $param['w_mini_labels']);
|
| 483 |
-
|
| 484 |
-
$param['w_name_fields'] = isset($param['w_name_fields']) ? $param['w_name_fields'] : ($param['w_name_format'] == 'normal' ? 'no***no' : 'yes***yes');
|
| 485 |
-
$w_name_fields = explode('***', $param['w_name_fields']);
|
| 486 |
-
$param['w_autofill'] = isset($param['w_autofill']) ? $param['w_autofill'] : 'no';
|
| 487 |
-
|
| 488 |
-
$w_name_format = '<div id="'.$id.'_td_name_input_first" style="display: table-cell;"><input type="text" class="'.($w_first_val[0]==$w_title[0] ? "input_deactive" : "input_active").'" id="'.$id.'_element_firstform_id_temp" name="'.$id.'_element_firstform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'" onfocus="delete_value("'.$id.'_element_firstform_id_temp")"onblur="return_value("'.$id.'_element_firstform_id_temp")" onchange="change_value("'.$id.'_element_firstform_id_temp")" style="margin-right: 10px; width: '.$param['w_size'].'px;"'.$param['attributes'].' disabled /></div><div id="'.$id.'_td_name_input_last" style="display: table-cell;"><input type="text" class="'.($w_first_val[1]==$w_title[1] ? "input_deactive" : "input_active").'" id="'.$id.'_element_lastform_id_temp" name="'.$id.'_element_lastform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'" onfocus="delete_value("'.$id.'_element_lastform_id_temp")"onblur="return_value("'.$id.'_element_lastform_id_temp")" onchange="change_value("'.$id.'_element_lastform_id_temp")" style="margin-right: 10px; width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div>';
|
| 489 |
-
$w_name_format_mini_labels = '<div id="'.$id.'_td_name_label_first" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_first">'.$w_mini_labels[1].'</label></div><div id="'.$id.'_td_name_label_last" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_last">'.$w_mini_labels[2].'</label></div>';
|
| 490 |
-
|
| 491 |
-
if($w_name_fields[0] == 'yes') {
|
| 492 |
-
$w_name_format = '<div id="'.$id.'_td_name_input_title" style="display: table-cell;"><input type="text" class="'.($w_first_val[2]==$w_title[2] ? "input_deactive" : "input_active").'" id="'.$id.'_element_titleform_id_temp" name="'.$id.'_element_titleform_id_temp" value="'.$w_first_val[2].'" title="'.$w_title[2].'" onfocus="delete_value("'.$id.'_element_titleform_id_temp")" onblur="return_value("'.$id.'_element_titleform_id_temp")" onchange="change_value("'.$id.'_element_titleform_id_temp")" style="margin: 0px 10px 0px 0px; width: 40px;" disabled /></div>'.$w_name_format;
|
| 493 |
-
$w_name_format_mini_labels ='<div id="'.$id.'_td_name_label_title" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_title">'.$w_mini_labels[0].'</label></div>'.$w_name_format_mini_labels;
|
| 494 |
-
}
|
| 495 |
-
|
| 496 |
-
if($w_name_fields[1] == 'yes') {
|
| 497 |
-
$w_name_format = $w_name_format.'<div id="'.$id.'_td_name_input_middle" style="display: table-cell;"><input type="text" class="'.($w_first_val[3]==$w_title[3] ? "input_deactive" : "input_active").'" id="'.$id.'_element_middleform_id_temp" name="'.$id.'_element_middleform_id_temp" value="'.$w_first_val[3].'" title="'.$w_title[3].'" onfocus="delete_value("'.$id.'_element_middleform_id_temp")" onblur="return_value("'.$id.'_element_middleform_id_temp")" onchange="change_value("'.$id.'_element_middleform_id_temp")" style="width: '.$param['w_size'].'px;" disabled /></div>';
|
| 498 |
-
$w_name_format_mini_labels = $w_name_format_mini_labels.'<div id="'.$id.'_td_name_label_middle" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_middle">'.$w_mini_labels[3].'</label></div>';
|
| 499 |
-
}
|
| 500 |
-
|
| 501 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_name" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_name" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><input type="hidden" value="'.$param['w_autofill'].'" name="'.$id.'_autofillform_id_temp" id="'.$id.'_autofillform_id_temp"><input type="hidden" name="'.$id.'_enable_fieldsform_id_temp" id="'.$id.'_enable_fieldsform_id_temp" title="'.$w_name_fields[0].'" first="yes" last="yes" middle="'.$w_name_fields[1].'"><div id="'.$id.'_table_name" cellpadding="0" cellspacing="0" style="display: table;"><div id="'.$id.'_tr_name1" style="display: table-row;">'.$w_name_format.'</div><div id="'.$id.'_tr_name2" style="display: table-row;">'.$w_name_format_mini_labels.'</div></div></div></div>';
|
| 502 |
-
break;
|
| 503 |
-
}
|
| 504 |
-
case 'type_address': {
|
| 505 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_mini_labels', 'w_disabled_fields', 'w_required', 'w_class');
|
| 506 |
-
$temp = $params;
|
| 507 |
-
|
| 508 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 509 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_size', 'w_mini_labels', 'w_disabled_fields', 'w_required', 'w_class');
|
| 510 |
-
|
| 511 |
-
|
| 512 |
-
|
| 513 |
-
foreach ($params_names as $params_name) {
|
| 514 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 515 |
-
$param[$params_name] = $temp[0];
|
| 516 |
-
$temp = $temp[1];
|
| 517 |
-
}
|
| 518 |
-
if ($temp) {
|
| 519 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 520 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 521 |
-
foreach ($attrs as $attr) {
|
| 522 |
-
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
| 523 |
-
}
|
| 524 |
-
}
|
| 525 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
| 526 |
-
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
| 527 |
-
|
| 528 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 529 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 530 |
-
|
| 531 |
-
|
| 532 |
-
$w_mini_labels = explode('***', $param['w_mini_labels']);
|
| 533 |
-
$w_disabled_fields = explode('***', $param['w_disabled_fields']);
|
| 534 |
-
$hidden_inputs = '';
|
| 535 |
-
$labels_for_id = array('street1', 'street2', 'city', 'state', 'postal', 'country');
|
| 536 |
-
foreach ($w_disabled_fields as $key => $w_disabled_field) {
|
| 537 |
-
if ($key != 6) {
|
| 538 |
-
if ($w_disabled_field == 'yes') {
|
| 539 |
-
$hidden_inputs .= '<input type="hidden" id="'.$id.'_'.$labels_for_id[$key].'form_id_temp" value="'.$w_mini_labels[$key].'" id_for_label="'.($id+$key).'">';
|
| 540 |
-
}
|
| 541 |
-
}
|
| 542 |
-
}
|
| 543 |
-
$address_fields ='';
|
| 544 |
-
$g=0;
|
| 545 |
-
if($w_disabled_fields[0]=='no')
|
| 546 |
-
{
|
| 547 |
-
$g+=2;
|
| 548 |
-
$address_fields .= '<span style="float: left; width: 100%; padding-bottom: 8px; display: block;"><input type="text" id="'.$id.'_street1form_id_temp" name="'.$id.'_street1form_id_temp" onchange="change_value("'.$id.'_street1form_id_temp")" style="width: 100%;" '.$param['attributes'].' disabled /><label class="mini_label" id="'.$id.'_mini_label_street1" style="display: block;">'.$w_mini_labels[0].'</label></span>';
|
| 549 |
-
}
|
| 550 |
-
|
| 551 |
-
if($w_disabled_fields[1]=='no')
|
| 552 |
-
{
|
| 553 |
-
$g+=2;
|
| 554 |
-
$address_fields .= '<span style="float: left; width: 100%; padding-bottom: 8px; display: block;"><input type="text" id="'.$id.'_street2form_id_temp" name="'.($id+1).'_street2form_id_temp" onchange="change_value("'.$id.'_street2form_id_temp")" style="width: 100%;" '.$param['attributes'].' disabled /><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_street2">'.$w_mini_labels[1].'</label></span>';
|
| 555 |
-
}
|
| 556 |
-
|
| 557 |
-
if($w_disabled_fields[2]=='no')
|
| 558 |
-
{
|
| 559 |
-
$g++;
|
| 560 |
-
$address_fields .= '<span style="float: left; width: 48%; padding-bottom: 8px;"><input type="text" id="'.$id.'_cityform_id_temp" name="'.($id+2).'_cityform_id_temp" onchange="change_value("'.$id.'_cityform_id_temp")" style="width: 100%;" '.$param['attributes'].' disabled /><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_city">'.$w_mini_labels[2].'</label></span>';
|
| 561 |
-
}
|
| 562 |
-
|
| 563 |
-
if($w_disabled_fields[3]=='no')
|
| 564 |
-
{
|
| 565 |
-
$g++;
|
| 566 |
-
if($w_disabled_fields[5]=='yes' && $w_disabled_fields[6]=='yes')
|
| 567 |
-
$address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><select type="text" id="'.$id.'_stateform_id_temp" name="'.($id+3).'_stateform_id_temp" onchange="change_value("'.$id.'_stateform_id_temp")" style="width: 100%;" '.$param['attributes'].' disabled ><option value=""></option><option value="Alabama">Alabama</option><option value="Alaska">Alaska</option><option value="Arizona">Arizona</option><option value="Arkansas">Arkansas</option><option value="California">California</option><option value="Colorado">Colorado</option><option value="Connecticut">Connecticut</option><option value="Delaware">Delaware</option><option value="Florida">Florida</option><option value="Georgia">Georgia</option><option value="Hawaii">Hawaii</option><option value="Idaho">Idaho</option><option value="Illinois">Illinois</option><option value="Indiana">Indiana</option><option value="Iowa">Iowa</option><option value="Kansas">Kansas</option><option value="Kentucky">Kentucky</option><option value="Louisiana">Louisiana</option><option value="Maine">Maine</option><option value="Maryland">Maryland</option><option value="Massachusetts">Massachusetts</option><option value="Michigan">Michigan</option><option value="Minnesota">Minnesota</option><option value="Mississippi">Mississippi</option><option value="Missouri">Missouri</option><option value="Montana">Montana</option><option value="Nebraska">Nebraska</option><option value="Nevada">Nevada</option><option value="New Hampshire">New Hampshire</option><option value="New Jersey">New Jersey</option><option value="New Mexico">New Mexico</option><option value="New York">New York</option><option value="North Carolina">North Carolina</option><option value="North Dakota">North Dakota</option><option value="Ohio">Ohio</option><option value="Oklahoma">Oklahoma</option><option value="Oregon">Oregon</option><option value="Pennsylvania">Pennsylvania</option><option value="Rhode Island">Rhode Island</option><option value="South Carolina">South Carolina</option><option value="South Dakota">South Dakota</option><option value="Tennessee">Tennessee</option><option value="Texas">Texas</option><option value="Utah">Utah</option><option value="Vermont">Vermont</option><option value="Virginia">Virginia</option><option value="Washington">Washington</option><option value="West Virginia">West Virginia</option><option value="Wisconsin">Wisconsin</option><option value="Wyoming">Wyoming</option></select><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_state">'.$w_mini_labels[3].'</label></span>';
|
| 568 |
-
else
|
| 569 |
-
$address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><input type="text" id="'.$id.'_stateform_id_temp" name="'.($id+3).'_stateform_id_temp" onchange="change_value("'.$id.'_stateform_id_temp")" style="width: 100%;" '.$param['attributes'].' disabled><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_state">'.$w_mini_labels[3].'</label></span>';
|
| 570 |
-
}
|
| 571 |
-
|
| 572 |
-
if($w_disabled_fields[4]=='no')
|
| 573 |
-
{
|
| 574 |
-
$g++;
|
| 575 |
-
$address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><input type="text" id="'.$id.'_postalform_id_temp" name="'.($id+4).'_postalform_id_temp" onchange="change_value("'.$id.'_postalform_id_temp")" style="width: 100%;" '.$param['attributes'].' disabled><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_postal">'.$w_mini_labels[4].'</label></span>';
|
| 576 |
-
}
|
| 577 |
-
|
| 578 |
-
if($w_disabled_fields[5]=='no')
|
| 579 |
-
{
|
| 580 |
-
$g++;
|
| 581 |
-
$address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><select type="text" id="'.$id.'_countryform_id_temp" name="'.($id+5).'_countryform_id_temp" onchange="change_value("'.$id.'_countryform_id_temp")" style="width: 100%;" '.$param['attributes'].' disabled><option value=""></option><option value="Afghanistan">Afghanistan</option><option value="Albania">Albania</option><option value="Algeria">Algeria</option><option value="Andorra">Andorra</option><option value="Angola">Angola</option><option value="Antigua and Barbuda">Antigua and Barbuda</option><option value="Argentina">Argentina</option><option value="Armenia">Armenia</option><option value="Australia">Australia</option><option value="Austria">Austria</option><option value="Azerbaijan">Azerbaijan</option><option value="Bahamas">Bahamas</option><option value="Bahrain">Bahrain</option><option value="Bangladesh">Bangladesh</option><option value="Barbados">Barbados</option><option value="Belarus">Belarus</option><option value="Belgium">Belgium</option><option value="Belize">Belize</option><option value="Benin">Benin</option><option value="Bhutan">Bhutan</option><option value="Bolivia">Bolivia</option><option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option><option value="Botswana">Botswana</option><option value="Brazil">Brazil</option><option value="Brunei">Brunei</option><option value="Bulgaria">Bulgaria</option><option value="Burkina Faso">Burkina Faso</option><option value="Burundi">Burundi</option><option value="Cambodia">Cambodia</option><option value="Cameroon">Cameroon</option><option value="Canada">Canada</option><option value="Cape Verde">Cape Verde</option><option value="Central African Republic">Central African Republic</option><option value="Chad">Chad</option><option value="Chile">Chile</option><option value="China">China</option><option value="Colombia">Colombia</option><option value="Comoros">Comoros</option><option value="Congo (Brazzaville)">Congo (Brazzaville)</option><option value="Congo">Congo</option><option value="Costa Rica">Costa Rica</option><option value="Cote d\'Ivoire">Cote d\'Ivoire</option><option value="Croatia">Croatia</option><option value="Cuba">Cuba</option><option value="Cyprus">Cyprus</option><option value="Czech Republic">Czech Republic</option><option value="Denmark">Denmark</option><option value="Djibouti">Djibouti</option><option value="Dominica">Dominica</option><option value="Dominican Republic">Dominican Republic</option><option value="East Timor (Timor Timur)">East Timor (Timor Timur)</option><option value="Ecuador">Ecuador</option><option value="Egypt">Egypt</option><option value="El Salvador">El Salvador</option><option value="Equatorial Guinea">Equatorial Guinea</option><option value="Eritrea">Eritrea</option><option value="Estonia">Estonia</option><option value="Ethiopia">Ethiopia</option><option value="Fiji">Fiji</option><option value="Finland">Finland</option><option value="France">France</option><option value="Gabon">Gabon</option><option value="Gambia, The">Gambia, The</option><option value="Georgia">Georgia</option><option value="Germany">Germany</option><option value="Ghana">Ghana</option><option value="Greece">Greece</option><option value="Grenada">Grenada</option><option value="Guatemala">Guatemala</option><option value="Guinea">Guinea</option><option value="Guinea-Bissau">Guinea-Bissau</option><option value="Guyana">Guyana</option><option value="Haiti">Haiti</option><option value="Honduras">Honduras</option><option value="Hungary">Hungary</option><option value="Iceland">Iceland</option><option value="India">India</option><option value="Indonesia">Indonesia</option><option value="Iran">Iran</option><option value="Iraq">Iraq</option><option value="Ireland">Ireland</option><option value="Israel">Israel</option><option value="Italy">Italy</option><option value="Jamaica">Jamaica</option><option value="Japan">Japan</option><option value="Jordan">Jordan</option><option value="Kazakhstan">Kazakhstan</option><option value="Kenya">Kenya</option><option value="Kiribati">Kiribati</option><option value="Korea, North">Korea, North</option><option value="Korea, South">Korea, South</option><option value="Kuwait">Kuwait</option><option value="Kyrgyzstan">Kyrgyzstan</option><option value="Laos">Laos</option><option value="Latvia">Latvia</option><option value="Lebanon">Lebanon</option><option value="Lesotho">Lesotho</option><option value="Liberia">Liberia</option><option value="Libya">Libya</option><option value="Liechtenstein">Liechtenstein</option><option value="Lithuania">Lithuania</option><option value="Luxembourg">Luxembourg</option><option value="Macedonia">Macedonia</option><option value="Madagascar">Madagascar</option><option value="Malawi">Malawi</option><option value="Malaysia">Malaysia</option><option value="Maldives">Maldives</option><option value="Mali">Mali</option><option value="Malta">Malta</option><option value="Marshall Islands">Marshall Islands</option><option value="Mauritania">Mauritania</option><option value="Mauritius">Mauritius</option><option value="Mexico">Mexico</option><option value="Micronesia">Micronesia</option><option value="Moldova">Moldova</option><option value="Monaco">Monaco</option><option value="Mongolia">Mongolia</option><option value="Morocco">Morocco</option><option value="Mozambique">Mozambique</option><option value="Myanmar">Myanmar</option><option value="Namibia">Namibia</option><option value="Nauru">Nauru</option><option value="Nepal">Nepal</option><option value="Netherlands">Netherlands</option><option value="New Zealand">New Zealand</option><option value="Nicaragua">Nicaragua</option><option value="Niger">Niger</option><option value="Nigeria">Nigeria</option><option value="Norway">Norway</option><option value="Oman">Oman</option><option value="Pakistan">Pakistan</option><option value="Palau">Palau</option><option value="Panama">Panama</option><option value="Papua New Guinea">Papua New Guinea</option><option value="Paraguay">Paraguay</option><option value="Peru">Peru</option><option value="Philippines">Philippines</option><option value="Poland">Poland</option><option value="Portugal">Portugal</option><option value="Qatar">Qatar</option><option value="Romania">Romania</option><option value="Russia">Russia</option><option value="Rwanda">Rwanda</option><option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option><option value="Saint Lucia">Saint Lucia</option><option value="Saint Vincent">Saint Vincent</option><option value="Samoa">Samoa</option><option value="San Marino">San Marino</option><option value="Sao Tome and Principe">Sao Tome and Principe</option><option value="Saudi Arabia">Saudi Arabia</option><option value="Senegal">Senegal</option><option value="Serbia and Montenegro">Serbia and Montenegro</option><option value="Seychelles">Seychelles</option><option value="Sierra Leone">Sierra Leone</option><option value="Singapore">Singapore</option><option value="Slovakia">Slovakia</option><option value="Slovenia">Slovenia</option><option value="Solomon Islands">Solomon Islands</option><option value="Somalia">Somalia</option><option value="South Africa">South Africa</option><option value="Spain">Spain</option><option value="Sri Lanka">Sri Lanka</option><option value="Sudan">Sudan</option><option value="Suriname">Suriname</option><option value="Swaziland">Swaziland</option><option value="Sweden">Sweden</option><option value="Switzerland">Switzerland</option><option value="Syria">Syria</option><option value="Taiwan">Taiwan</option><option value="Tajikistan">Tajikistan</option><option value="Tanzania">Tanzania</option><option value="Thailand">Thailand</option><option value="Togo">Togo</option><option value="Tonga">Tonga</option><option value="Trinidad and Tobago">Trinidad and Tobago</option><option value="Tunisia">Tunisia</option><option value="Turkey">Turkey</option><option value="Turkmenistan">Turkmenistan</option><option value="Tuvalu">Tuvalu</option><option value="Uganda">Uganda</option><option value="Ukraine">Ukraine</option><option value="United Arab Emirates">United Arab Emirates</option><option value="United Kingdom">United Kingdom</option><option value="United States">United States</option><option value="Uruguay">Uruguay</option><option value="Uzbekistan">Uzbekistan</option><option value="Vanuatu">Vanuatu</option><option value="Vatican City">Vatican City</option><option value="Venezuela">Venezuela</option><option value="Vietnam">Vietnam</option><option value="Yemen">Yemen</option><option value="Zambia">Zambia</option><option value="Zimbabwe">Zimbabwe</option></select><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_country">'.$w_mini_labels[5].'</span>';
|
| 582 |
-
}
|
| 583 |
-
|
| 584 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_address" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px; vertical-align:top;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_address" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" name="'.$id.'_disable_fieldsform_id_temp" id="'.$id.'_disable_fieldsform_id_temp" street1="'.$w_disabled_fields[0].'" street2="'.$w_disabled_fields[1].'" city="'.$w_disabled_fields[2].'" state="'.$w_disabled_fields[3].'" postal="'.$w_disabled_fields[4].'" country="'.$w_disabled_fields[5].'" us_states="'.$w_disabled_fields[6].'"><div id="'.$id.'_div_address" style="width: '.$param['w_size'].'px;">'.$address_fields.$hidden_inputs.'</div></div></div>';
|
| 585 |
-
break;
|
| 586 |
-
}
|
| 587 |
-
case 'type_submitter_mail': {
|
| 588 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique', 'w_class');
|
| 589 |
-
$temp=$params;
|
| 590 |
-
if(strpos($temp, 'w_autofill') > -1)
|
| 591 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique', 'w_class', 'w_autofill');
|
| 592 |
-
|
| 593 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 594 |
-
$params_names = array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size','w_first_val','w_title','w_required','w_unique', 'w_class', 'w_autofill');
|
| 595 |
-
|
| 596 |
-
if(strpos($temp, 'w_verification') > -1)
|
| 597 |
-
$params_names = array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size','w_first_val','w_title','w_required','w_unique', 'w_class', 'w_verification', 'w_verification_label', 'w_verification_placeholder', 'w_autofill');
|
| 598 |
-
|
| 599 |
-
|
| 600 |
-
foreach($params_names as $params_name )
|
| 601 |
-
{
|
| 602 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 603 |
-
$param[$params_name] = $temp[0];
|
| 604 |
-
$temp=$temp[1];
|
| 605 |
-
}
|
| 606 |
-
|
| 607 |
-
if($temp)
|
| 608 |
-
{
|
| 609 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 610 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 611 |
-
foreach($attrs as $attr)
|
| 612 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 613 |
-
}
|
| 614 |
-
|
| 615 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 616 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 617 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 618 |
-
|
| 619 |
-
$input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
|
| 620 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 621 |
-
$param['w_autofill'] = isset($param['w_autofill']) ? $param['w_autofill'] : 'no';
|
| 622 |
-
|
| 623 |
-
if(isset($param['w_verification']) && $param['w_verification'] == "yes"){
|
| 624 |
-
$display_label_confirm = $display_label;
|
| 625 |
-
$display_element_confirm = $param['w_field_label_pos'];
|
| 626 |
-
}
|
| 627 |
-
else{
|
| 628 |
-
$display_label_confirm = "none";
|
| 629 |
-
$display_element_confirm = "none";
|
| 630 |
-
}
|
| 631 |
-
|
| 632 |
-
|
| 633 |
-
$param['w_verification'] = isset($param['w_verification']) ? $param['w_verification'] : "no";
|
| 634 |
-
$param['w_verification_label'] = isset($param['w_verification_label']) ? $param['w_verification_label'] : "E-mail confirmation:";
|
| 635 |
-
$param['w_verification_placeholder'] = isset($param['w_verification_placeholder']) ? $param['w_verification_placeholder'] : "";
|
| 636 |
-
|
| 637 |
-
$confirm_emeil = '<br><div align="left" id="'.$id.'_1_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label_confirm.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_1_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$param['w_verification_label'].'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_1_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_element_confirm.';"><input type="hidden" value="'.$param['w_verification'].'" name="'.$id.'_verification_id_temp" id="'.$id.'_verification_id_temp"><input type="text" class="input_deactive" id="'.$id.'_1_elementform_id_temp" name="'.$id.'_1_elementform_id_temp" value="'.$param['w_verification_placeholder'].'" title="'.$param['w_verification_placeholder'].'" onfocus="delete_value("'.$id.'_elementform_id_temp")" onblur="return_value("'.$id.'_elementform_id_temp")" onchange="change_value("'.$id.'_elementform_id_temp")" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div>';
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_submitter_mail" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_submitter_mail" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><input type="hidden" value="'.$param['w_autofill'].'" name="'.$id.'_autofillform_id_temp" id="'.$id.'_autofillform_id_temp"><input type="hidden" value="'.$param['w_verification'].'" name="'.$id.'_verification_id_temp" id="'.$id.'_verification_id_temp"><input type="text" class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" onfocus="delete_value("'.$id.'_elementform_id_temp")" onblur="return_value("'.$id.'_elementform_id_temp")" onchange="change_value("'.$id.'_elementform_id_temp")" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div>'.$confirm_emeil.'</div>';
|
| 641 |
-
break;
|
| 642 |
-
}
|
| 643 |
-
case 'type_checkbox':
|
| 644 |
-
{
|
| 645 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num','w_class');
|
| 646 |
-
$temp=$params;
|
| 647 |
-
if(strpos($temp, 'w_field_option_pos') > -1)
|
| 648 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_field_option_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_value_disabled','w_choices_value', 'w_choices_params', 'w_class');
|
| 649 |
-
|
| 650 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 651 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_field_option_pos', 'w_hide_label', 'w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_value_disabled','w_choices_value', 'w_choices_params', 'w_class');
|
| 652 |
-
|
| 653 |
-
foreach($params_names as $params_name )
|
| 654 |
-
{
|
| 655 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 656 |
-
$param[$params_name] = $temp[0];
|
| 657 |
-
$temp=$temp[1];
|
| 658 |
-
}
|
| 659 |
-
|
| 660 |
-
if($temp)
|
| 661 |
-
{
|
| 662 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 663 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 664 |
-
foreach($attrs as $attr)
|
| 665 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 666 |
-
}
|
| 667 |
-
if(!isset($param['w_value_disabled']))
|
| 668 |
-
$param['w_value_disabled'] = 'no';
|
| 669 |
-
|
| 670 |
-
if(!isset($param['w_field_option_pos']))
|
| 671 |
-
$param['w_field_option_pos'] = 'left';
|
| 672 |
-
|
| 673 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 674 |
-
|
| 675 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 676 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 677 |
-
|
| 678 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 679 |
-
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 680 |
-
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 681 |
-
|
| 682 |
-
if(isset($param['w_choices_value']))
|
| 683 |
-
{
|
| 684 |
-
$param['w_choices_value'] = explode('***',$param['w_choices_value']);
|
| 685 |
-
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 686 |
-
}
|
| 687 |
-
|
| 688 |
-
foreach($param['w_choices_checked'] as $key => $choices_checked )
|
| 689 |
-
{
|
| 690 |
-
if($choices_checked=='true')
|
| 691 |
-
$param['w_choices_checked'][$key]='checked="checked"';
|
| 692 |
-
else
|
| 693 |
-
$param['w_choices_checked'][$key]='';
|
| 694 |
-
}
|
| 695 |
-
|
| 696 |
-
$rep='<div id="wdform_field'.$id.'" type="type_checkbox" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_checkbox" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_rowcol'].'" name="'.$id.'_rowcol_numform_id_temp" id="'.$id.'_rowcol_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><input type="hidden" value="'.$param['w_value_disabled'].'" name="'.$id.'_value_disabledform_id_temp" id="'.$id.'_value_disabledform_id_temp"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;" '.($param['w_flow']=='hor' ? 'for_hor="'.$id.'_hor"' : '').'>';
|
| 697 |
-
|
| 698 |
-
if($param['w_flow']=='hor')
|
| 699 |
-
{
|
| 700 |
-
$j = 0;
|
| 701 |
-
for($i=0; $i<(int)$param['w_rowcol']; $i++)
|
| 702 |
-
{
|
| 703 |
-
$rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
|
| 704 |
-
|
| 705 |
-
for($l=0; $l<=(int)(count($param['w_choices'])/$param['w_rowcol']); $l++)
|
| 706 |
-
{
|
| 707 |
-
if($j >= count($param['w_choices'])%$param['w_rowcol'] && $l==(int)(count($param['w_choices'])/$param['w_rowcol']))
|
| 708 |
-
continue;
|
| 709 |
-
|
| 710 |
-
if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
|
| 711 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="checkbox" value="" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" other="1" onclick="if(set_checked("'.$id.'","'.((int)$param['w_rowcol']*$l+$i).'","form_id_temp")) show_other_input("'.$id.'","form_id_temp");" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled /><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'">'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
|
| 712 |
-
else
|
| 713 |
-
{
|
| 714 |
-
$where = '';
|
| 715 |
-
$order_by = '';
|
| 716 |
-
$db_info = '';
|
| 717 |
-
if(isset($param['w_choices_value']))
|
| 718 |
-
$choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$l+$i];
|
| 719 |
-
else
|
| 720 |
-
$choise_value = $param['w_choices'][(int)$param['w_rowcol']*$l+$i];
|
| 721 |
-
|
| 722 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$l+$i])
|
| 723 |
-
{
|
| 724 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$l+$i]);
|
| 725 |
-
$where = "where='".$w_choices_params[0]."'";
|
| 726 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 727 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 728 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 729 |
-
}
|
| 730 |
-
|
| 731 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="checkbox" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" onclick="set_checked("'.$id.'","'.((int)$param['w_rowcol']*$l+$i).'","form_id_temp")" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
|
| 732 |
-
}
|
| 733 |
-
}
|
| 734 |
-
|
| 735 |
-
$j++;
|
| 736 |
-
$rep.='</div>';
|
| 737 |
-
|
| 738 |
-
}
|
| 739 |
-
|
| 740 |
-
}
|
| 741 |
-
else
|
| 742 |
-
{
|
| 743 |
-
for($i=0; $i<(int)(count($param['w_choices'])/$param['w_rowcol']); $i++)
|
| 744 |
-
{
|
| 745 |
-
$rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
|
| 746 |
-
|
| 747 |
-
if(count($param['w_choices']) > (int)$param['w_rowcol'])
|
| 748 |
-
for($l=0; $l<$param['w_rowcol']; $l++)
|
| 749 |
-
{
|
| 750 |
-
if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
|
| 751 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" other="1" onclick="if(set_checked("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")) show_other_input("'.$id.'","form_id_temp");" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled /><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
|
| 752 |
-
else
|
| 753 |
-
{
|
| 754 |
-
$where = '' ;
|
| 755 |
-
$order_by = '' ;
|
| 756 |
-
$db_info = '' ;
|
| 757 |
-
if(isset($param['w_choices_value']))
|
| 758 |
-
$choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$i+$l];
|
| 759 |
-
else
|
| 760 |
-
$choise_value = $param['w_choices'][(int)$param['w_rowcol']*$i+$l];
|
| 761 |
-
|
| 762 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$i+$l])
|
| 763 |
-
{
|
| 764 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$i+$l]);
|
| 765 |
-
$where = "where='".$w_choices_params[0]."'";
|
| 766 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 767 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 768 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 769 |
-
}
|
| 770 |
-
|
| 771 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" onclick="set_checked("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'"
|
| 772 |
-
'.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
|
| 773 |
-
}
|
| 774 |
-
}
|
| 775 |
-
else
|
| 776 |
-
for($l=0; $l<count($param['w_choices']); $l++)
|
| 777 |
-
{
|
| 778 |
-
if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
|
| 779 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" other="1" onclick="if(set_checked("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")) show_other_input("'.$id.'","form_id_temp");" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
|
| 780 |
-
else
|
| 781 |
-
{
|
| 782 |
-
$where = '' ;
|
| 783 |
-
$order_by = '' ;
|
| 784 |
-
$db_info = '' ;
|
| 785 |
-
if(isset($param['w_choices_value']))
|
| 786 |
-
$choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$i+$l];
|
| 787 |
-
else
|
| 788 |
-
$choise_value = $param['w_choices'][(int)$param['w_rowcol']*$i+$l];
|
| 789 |
-
|
| 790 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$i+$l])
|
| 791 |
-
{
|
| 792 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$i+$l]);
|
| 793 |
-
$where = "where='".$w_choices_params[0]."'";
|
| 794 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 795 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 796 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 797 |
-
}
|
| 798 |
-
|
| 799 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" onclick="set_checked("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
|
| 800 |
-
}
|
| 801 |
-
}
|
| 802 |
-
|
| 803 |
-
$rep.='</div>';
|
| 804 |
-
}
|
| 805 |
-
|
| 806 |
-
if(count($param['w_choices'])%$param['w_rowcol']!=0)
|
| 807 |
-
{
|
| 808 |
-
$rep.='<div id="'.$id.'_element_tr'.((int)(count($param['w_choices'])/(int)$param['w_rowcol'])).'" style="display: table-row;">';
|
| 809 |
-
|
| 810 |
-
for($k=0; $k<count($param['w_choices'])%$param['w_rowcol']; $k++)
|
| 811 |
-
{
|
| 812 |
-
$l = count($param['w_choices']) - count($param['w_choices'])%$param['w_rowcol'] + $k;
|
| 813 |
-
if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$l)
|
| 814 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="checkbox" value="" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp'.$l.'" other="1" onclick="if(set_checked("'.$id.'","'.$l.'","form_id_temp")) show_other_input("'.$id.'","form_id_temp");" '.$param['w_choices_checked'][$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$l.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
|
| 815 |
-
else
|
| 816 |
-
{
|
| 817 |
-
$where = '' ;
|
| 818 |
-
$order_by = '' ;
|
| 819 |
-
$db_info = '' ;
|
| 820 |
-
if(isset($param['w_choices_value']))
|
| 821 |
-
$choise_value = $param['w_choices_value'][$l];
|
| 822 |
-
else
|
| 823 |
-
$choise_value = $param['w_choices'][$l];
|
| 824 |
-
|
| 825 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$l])
|
| 826 |
-
{
|
| 827 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$l]);
|
| 828 |
-
$where = "where='".$w_choices_params[0]."'";
|
| 829 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 830 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 831 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 832 |
-
}
|
| 833 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="checkbox" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp'.$l.'" onclick="set_checked("'.$id.'","'.$l.'","form_id_temp")" '.$param['w_choices_checked'][$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$l.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$l.'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][$l].'</label></div>';
|
| 834 |
-
}
|
| 835 |
-
}
|
| 836 |
-
|
| 837 |
-
$rep.='</div>';
|
| 838 |
-
}
|
| 839 |
-
|
| 840 |
-
|
| 841 |
-
|
| 842 |
-
}
|
| 843 |
-
$rep.='</div></div></div></div>';
|
| 844 |
-
break;
|
| 845 |
-
}
|
| 846 |
-
case 'type_radio':
|
| 847 |
-
{
|
| 848 |
-
|
| 849 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num','w_class');
|
| 850 |
-
$temp=$params;
|
| 851 |
-
if(strpos($temp, 'w_field_option_pos') > -1)
|
| 852 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_field_option_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_value_disabled', 'w_choices_value', 'w_choices_params','w_class');
|
| 853 |
-
|
| 854 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 855 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_field_option_pos', 'w_hide_label', 'w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_value_disabled', 'w_choices_value', 'w_choices_params','w_class');
|
| 856 |
-
foreach($params_names as $params_name )
|
| 857 |
-
{
|
| 858 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 859 |
-
$param[$params_name] = $temp[0];
|
| 860 |
-
$temp=$temp[1];
|
| 861 |
-
}
|
| 862 |
-
|
| 863 |
-
if($temp)
|
| 864 |
-
{
|
| 865 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 866 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 867 |
-
foreach($attrs as $attr)
|
| 868 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 869 |
-
}
|
| 870 |
-
if(!isset($param['w_value_disabled']))
|
| 871 |
-
$param['w_value_disabled'] = 'no';
|
| 872 |
-
|
| 873 |
-
if(!isset($param['w_field_option_pos']))
|
| 874 |
-
$param['w_field_option_pos'] = 'left';
|
| 875 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 876 |
-
|
| 877 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 878 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 879 |
-
|
| 880 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 881 |
-
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 882 |
-
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 883 |
-
|
| 884 |
-
if(isset($param['w_choices_value']))
|
| 885 |
-
{
|
| 886 |
-
$param['w_choices_value'] = explode('***',$param['w_choices_value']);
|
| 887 |
-
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 888 |
-
}
|
| 889 |
-
|
| 890 |
-
foreach($param['w_choices_checked'] as $key => $choices_checked )
|
| 891 |
-
{
|
| 892 |
-
if($choices_checked=='true')
|
| 893 |
-
$param['w_choices_checked'][$key]='checked="checked"';
|
| 894 |
-
else
|
| 895 |
-
$param['w_choices_checked'][$key]='';
|
| 896 |
-
}
|
| 897 |
-
|
| 898 |
-
$rep='<div id="wdform_field'.$id.'" type="type_radio" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_radio" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_rowcol'].'" name="'.$id.'_rowcol_numform_id_temp" id="'.$id.'_rowcol_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><input type="hidden" value="'.$param['w_value_disabled'].'" name="'.$id.'_value_disabledform_id_temp" id="'.$id.'_value_disabledform_id_temp"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;" '.($param['w_flow']=='hor' ? 'for_hor="'.$id.'_hor"' : '').'>';
|
| 899 |
-
|
| 900 |
-
|
| 901 |
-
if($param['w_flow']=='hor')
|
| 902 |
-
{
|
| 903 |
-
$j = 0;
|
| 904 |
-
for($i=0; $i<(int)$param['w_rowcol']; $i++)
|
| 905 |
-
{
|
| 906 |
-
$rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
|
| 907 |
-
|
| 908 |
-
for($l=0; $l<=(int)(count($param['w_choices'])/$param['w_rowcol']); $l++)
|
| 909 |
-
{
|
| 910 |
-
if($j >= count($param['w_choices'])%$param['w_rowcol'] && $l==(int)(count($param['w_choices'])/$param['w_rowcol']))
|
| 911 |
-
continue;
|
| 912 |
-
|
| 913 |
-
if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$l+$i)
|
| 914 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp" other="1" onclick="set_default("'.$id.'","'.((int)$param['w_rowcol']*$l+$i).'","form_id_temp"); show_other_input("'.$id.'","form_id_temp");" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'">'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
|
| 915 |
-
else
|
| 916 |
-
{
|
| 917 |
-
$where = '' ;
|
| 918 |
-
$order_by = '' ;
|
| 919 |
-
$db_info = '' ;
|
| 920 |
-
if(isset($param['w_choices_value']))
|
| 921 |
-
$choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$l+$i];
|
| 922 |
-
else
|
| 923 |
-
$choise_value = $param['w_choices'][(int)$param['w_rowcol']*$l+$i];
|
| 924 |
-
|
| 925 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$l+$i])
|
| 926 |
-
{
|
| 927 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$l+$i]);
|
| 928 |
-
$where = "where='".$w_choices_params[0]."'";
|
| 929 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 930 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 931 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 932 |
-
}
|
| 933 |
-
|
| 934 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="radio" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp" onclick="set_default("'.$id.'","'.((int)$param['w_rowcol']*$l+$i).'","form_id_temp")" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
|
| 935 |
-
}
|
| 936 |
-
}
|
| 937 |
-
|
| 938 |
-
$j++;
|
| 939 |
-
$rep.='</div>';
|
| 940 |
-
|
| 941 |
-
}
|
| 942 |
-
|
| 943 |
-
}
|
| 944 |
-
else
|
| 945 |
-
{
|
| 946 |
-
for($i=0; $i<(int)(count($param['w_choices'])/$param['w_rowcol']); $i++)
|
| 947 |
-
{
|
| 948 |
-
$rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
|
| 949 |
-
|
| 950 |
-
if(count($param['w_choices']) > (int)$param['w_rowcol'])
|
| 951 |
-
for($l=0; $l<$param['w_rowcol']; $l++)
|
| 952 |
-
{
|
| 953 |
-
if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
|
| 954 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" other="1" onclick="set_default("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp"); show_other_input("'.$id.'","form_id_temp");" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
|
| 955 |
-
else
|
| 956 |
-
{
|
| 957 |
-
$where = '' ;
|
| 958 |
-
$order_by = '' ;
|
| 959 |
-
$db_info = '' ;
|
| 960 |
-
if(isset($param['w_choices_value']))
|
| 961 |
-
$choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$i+$l];
|
| 962 |
-
else
|
| 963 |
-
$choise_value = $param['w_choices'][(int)$param['w_rowcol']*$i+$l];
|
| 964 |
-
|
| 965 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$i+$l])
|
| 966 |
-
{
|
| 967 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$i+$l]);
|
| 968 |
-
$where = "where='".$w_choices_params[0]."'";
|
| 969 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 970 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 971 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 972 |
-
}
|
| 973 |
-
|
| 974 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" onclick="set_default("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
|
| 975 |
-
}
|
| 976 |
-
}
|
| 977 |
-
else
|
| 978 |
-
for($l=0; $l<count($param['w_choices']); $l++)
|
| 979 |
-
{
|
| 980 |
-
if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
|
| 981 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" other="1" onclick="set_default("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp"); show_other_input("'.$id.'","form_id_temp");" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
|
| 982 |
-
else
|
| 983 |
-
{
|
| 984 |
-
$where = '' ;
|
| 985 |
-
$order_by = '' ;
|
| 986 |
-
$db_info = '' ;
|
| 987 |
-
if(isset($param['w_choices_value']))
|
| 988 |
-
$choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$i+$l];
|
| 989 |
-
else
|
| 990 |
-
$choise_value = $param['w_choices'][(int)$param['w_rowcol']*$i+$l];
|
| 991 |
-
|
| 992 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$i+$l])
|
| 993 |
-
{
|
| 994 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$i+$l]);
|
| 995 |
-
$where = "where='".$w_choices_params[0]."'";
|
| 996 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 997 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 998 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 999 |
-
}
|
| 1000 |
-
|
| 1001 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" onclick="set_default("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
|
| 1002 |
-
}
|
| 1003 |
-
}
|
| 1004 |
-
|
| 1005 |
-
$rep.='</div>';
|
| 1006 |
-
}
|
| 1007 |
-
|
| 1008 |
-
if(count($param['w_choices'])%$param['w_rowcol']!=0)
|
| 1009 |
-
{
|
| 1010 |
-
$rep.='<div id="'.$id.'_element_tr'.((int)(count($param['w_choices'])/(int)$param['w_rowcol'])).'" style="display: table-row;">';
|
| 1011 |
-
|
| 1012 |
-
for($k=0; $k<count($param['w_choices'])%$param['w_rowcol']; $k++)
|
| 1013 |
-
{
|
| 1014 |
-
$l = count($param['w_choices']) - count($param['w_choices'])%$param['w_rowcol'] + $k;
|
| 1015 |
-
if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$l)
|
| 1016 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][$l].'" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp" other="1" onclick="set_default("'.$id.'","'.$l.'","form_id_temp"); show_other_input("'.$id.'","form_id_temp");" '.$param['w_choices_checked'][$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$l.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
|
| 1017 |
-
else
|
| 1018 |
-
{
|
| 1019 |
-
$where = '' ;
|
| 1020 |
-
$order_by = '' ;
|
| 1021 |
-
$db_info = '' ;
|
| 1022 |
-
if(isset($param['w_choices_value']))
|
| 1023 |
-
$choise_value = $param['w_choices_value'][$l];
|
| 1024 |
-
else
|
| 1025 |
-
$choise_value = $param['w_choices'][$l];
|
| 1026 |
-
|
| 1027 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$l])
|
| 1028 |
-
{
|
| 1029 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$l]);
|
| 1030 |
-
$where = "where='".$w_choices_params[0]."'";
|
| 1031 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 1032 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 1033 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 1034 |
-
}
|
| 1035 |
-
|
| 1036 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="radio" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp" onclick="set_default("'.$id.'","'.$l.'","form_id_temp")" '.$param['w_choices_checked'][$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$l.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$l.'"
|
| 1037 |
-
'.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][$l].'</label></div>';
|
| 1038 |
-
}
|
| 1039 |
-
}
|
| 1040 |
-
|
| 1041 |
-
$rep.='</div>';
|
| 1042 |
-
}
|
| 1043 |
-
|
| 1044 |
-
}
|
| 1045 |
-
|
| 1046 |
-
|
| 1047 |
-
|
| 1048 |
-
$rep.='</div></div></div></div>';
|
| 1049 |
-
|
| 1050 |
-
break;
|
| 1051 |
-
}
|
| 1052 |
-
case 'type_own_select':
|
| 1053 |
-
{
|
| 1054 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_checked', 'w_choices_disabled','w_required','w_class');
|
| 1055 |
-
$temp=$params;
|
| 1056 |
-
if(strpos($temp, 'w_choices_value') > -1)
|
| 1057 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_checked', 'w_choices_disabled', 'w_required', 'w_value_disabled', 'w_choices_value', 'w_choices_params', 'w_class');
|
| 1058 |
-
|
| 1059 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 1060 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size','w_choices','w_choices_checked', 'w_choices_disabled', 'w_required', 'w_value_disabled', 'w_choices_value', 'w_choices_params', 'w_class');
|
| 1061 |
-
|
| 1062 |
-
foreach($params_names as $params_name )
|
| 1063 |
-
{
|
| 1064 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1065 |
-
$param[$params_name] = $temp[0];
|
| 1066 |
-
$temp=$temp[1];
|
| 1067 |
-
}
|
| 1068 |
-
|
| 1069 |
-
if($temp)
|
| 1070 |
-
{
|
| 1071 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1072 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1073 |
-
foreach($attrs as $attr)
|
| 1074 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1075 |
-
}
|
| 1076 |
-
|
| 1077 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1078 |
-
|
| 1079 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1080 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1081 |
-
|
| 1082 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 1083 |
-
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 1084 |
-
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 1085 |
-
$param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
|
| 1086 |
-
|
| 1087 |
-
if(isset($param['w_choices_value']))
|
| 1088 |
-
{
|
| 1089 |
-
$param['w_choices_value'] = explode('***',$param['w_choices_value']);
|
| 1090 |
-
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 1091 |
-
}
|
| 1092 |
-
|
| 1093 |
-
if(!isset($param['w_value_disabled']))
|
| 1094 |
-
$param['w_value_disabled'] = 'no';
|
| 1095 |
-
|
| 1096 |
-
foreach($param['w_choices_checked'] as $key => $choices_checked )
|
| 1097 |
-
{
|
| 1098 |
-
if($choices_checked=='true')
|
| 1099 |
-
$param['w_choices_checked'][$key]='selected="selected"';
|
| 1100 |
-
else
|
| 1101 |
-
$param['w_choices_checked'][$key]='';
|
| 1102 |
-
}
|
| 1103 |
-
|
| 1104 |
-
$rep='<div id="wdform_field'.$id.'" type="type_own_select" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; "><input type="hidden" value="type_own_select" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_value_disabled'].'" name="'.$id.'_value_disabledform_id_temp" id="'.$id.'_value_disabledform_id_temp"><select id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" onchange="set_select(this)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled>';
|
| 1105 |
-
foreach($param['w_choices'] as $key => $choice)
|
| 1106 |
-
{
|
| 1107 |
-
$where = '';
|
| 1108 |
-
$order_by = '';
|
| 1109 |
-
$db_info = '';
|
| 1110 |
-
$choice_value = $param['w_choices_disabled'][$key]=='true' ? '' : (isset($param['w_choices_value']) ? $param['w_choices_value'][$key] : $choice);
|
| 1111 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 1112 |
-
{
|
| 1113 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 1114 |
-
$where = "where='".$w_choices_params[0]."'";
|
| 1115 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 1116 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 1117 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 1118 |
-
}
|
| 1119 |
-
|
| 1120 |
-
$rep.='<option id="'.$id.'_option'.$key.'" value="'.$choice_value.'" onselect="set_select("'.$id.'_option'.$key.'")" '.$param['w_choices_checked'][$key].' '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</option>';
|
| 1121 |
-
}
|
| 1122 |
-
$rep.='</select></div></div>';
|
| 1123 |
-
break;
|
| 1124 |
-
}
|
| 1125 |
-
|
| 1126 |
-
case 'type_country':
|
| 1127 |
-
{
|
| 1128 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_countries','w_required','w_class');
|
| 1129 |
-
$temp=$params;
|
| 1130 |
-
|
| 1131 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 1132 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size','w_countries','w_required','w_class');
|
| 1133 |
-
|
| 1134 |
-
foreach($params_names as $params_name )
|
| 1135 |
-
{
|
| 1136 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1137 |
-
$param[$params_name] = $temp[0];
|
| 1138 |
-
$temp=$temp[1];
|
| 1139 |
-
}
|
| 1140 |
-
|
| 1141 |
-
if($temp)
|
| 1142 |
-
{
|
| 1143 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1144 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1145 |
-
foreach($attrs as $attr)
|
| 1146 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1147 |
-
}
|
| 1148 |
-
|
| 1149 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1150 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1151 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1152 |
-
|
| 1153 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 1154 |
-
$param['w_countries'] = explode('***',$param['w_countries']);
|
| 1155 |
-
|
| 1156 |
-
$rep='<div id="wdform_field'.$id.'" type="type_country" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; "><input type="hidden" value="type_country" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><select id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled>';
|
| 1157 |
-
foreach($param['w_countries'] as $key => $choice)
|
| 1158 |
-
{
|
| 1159 |
-
$choice_value=$choice;
|
| 1160 |
-
$rep.='<option value="'.$choice_value.'">'.$choice.'</option>';
|
| 1161 |
-
}
|
| 1162 |
-
$rep.='</select></div></div>';
|
| 1163 |
-
break;
|
| 1164 |
-
}
|
| 1165 |
-
|
| 1166 |
-
case 'type_time':
|
| 1167 |
-
{
|
| 1168 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_time_type','w_am_pm','w_sec','w_hh','w_mm','w_ss','w_mini_labels','w_required','w_class');
|
| 1169 |
-
$temp=$params;
|
| 1170 |
-
|
| 1171 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 1172 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_time_type', 'w_am_pm','w_sec','w_hh','w_mm','w_ss','w_mini_labels','w_required','w_class');
|
| 1173 |
-
|
| 1174 |
-
foreach($params_names as $params_name )
|
| 1175 |
-
{
|
| 1176 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1177 |
-
$param[$params_name] = $temp[0];
|
| 1178 |
-
$temp=$temp[1];
|
| 1179 |
-
}
|
| 1180 |
-
|
| 1181 |
-
if($temp)
|
| 1182 |
-
{
|
| 1183 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1184 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1185 |
-
foreach($attrs as $attr)
|
| 1186 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1187 |
-
}
|
| 1188 |
-
|
| 1189 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1190 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1191 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1192 |
-
|
| 1193 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 1194 |
-
|
| 1195 |
-
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
| 1196 |
-
|
| 1197 |
-
|
| 1198 |
-
if($param['w_sec']=='1')
|
| 1199 |
-
{
|
| 1200 |
-
$w_sec = '<div align="center" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;"> : </span></div><div id="'.$id.'_td_time_input3" style="width: 32px; display: table-cell;"><input type="text" value="'.$param['w_ss'].'" class="time_box" id="'.$id.'_ssform_id_temp" name="'.$id.'_ssform_id_temp" onkeypress="return check_second(event, "'.$id.'_ssform_id_temp")" onkeyup="change_second("'.$id.'_ssform_id_temp")" onblur="add_0("'.$id.'_ssform_id_temp")" '.$param['attributes'].' disabled /></div>';
|
| 1201 |
-
$w_sec_label='<div style="display: table-cell;"></div><div id="'.$id.'_td_time_label3" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_ss">'.$w_mini_labels[2].'</label></div>';
|
| 1202 |
-
}
|
| 1203 |
-
else
|
| 1204 |
-
{
|
| 1205 |
-
$w_sec = '';
|
| 1206 |
-
$w_sec_label='';
|
| 1207 |
-
}
|
| 1208 |
-
|
| 1209 |
-
if($param['w_time_type']=='12')
|
| 1210 |
-
{
|
| 1211 |
-
if($param['w_am_pm']=='am')
|
| 1212 |
-
{
|
| 1213 |
-
$am_ = "selected=\"selected\"";
|
| 1214 |
-
$pm_ = "";
|
| 1215 |
-
}
|
| 1216 |
-
else
|
| 1217 |
-
{
|
| 1218 |
-
$am_ = "";
|
| 1219 |
-
$pm_ = "selected=\"selected\"";
|
| 1220 |
-
|
| 1221 |
-
}
|
| 1222 |
-
|
| 1223 |
-
$w_time_type = '<div id="'.$id.'_am_pm_select" class="td_am_pm_select" style="display: table-cell;"><select class="am_pm_select" name="'.$id.'_am_pmform_id_temp" id="'.$id.'_am_pmform_id_temp" onchange="set_sel_am_pm(this)" '.$param['attributes'].'><option value="am" '.$am_.'>AM</option><option value="pm" '.$pm_.'>PM</option></select></div>';
|
| 1224 |
-
|
| 1225 |
-
$w_time_type_label = '<div id="'.$id.'_am_pm_label" class="td_am_pm_select" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_am_pm">'.$w_mini_labels[3].'</label></div>';
|
| 1226 |
-
|
| 1227 |
-
}
|
| 1228 |
-
else
|
| 1229 |
-
{
|
| 1230 |
-
$w_time_type='';
|
| 1231 |
-
$w_time_type_label = '';
|
| 1232 |
-
}
|
| 1233 |
-
|
| 1234 |
-
|
| 1235 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_time" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_time" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><div id="'.$id.'_table_time" style="display: table;"><div id="'.$id.'_tr_time1" style="display: table-row;"><div id="'.$id.'_td_time_input1" style="width: 32px; display: table-cell;"><input type="text" value="'.$param['w_hh'].'" class="time_box" id="'.$id.'_hhform_id_temp" name="'.$id.'_hhform_id_temp" onkeypress="return check_hour(event, "'.$id.'_hhform_id_temp", "23")" onkeyup="change_hour(event, "'.$id.'_hhform_id_temp","23")" onblur="add_0("'.$id.'_hhform_id_temp")" '.$param['attributes'].' disabled/></div><div align="center" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;"> : </span></div><div id="'.$id.'_td_time_input2" style="width: 32px; display: table-cell;"><input type="text" value="'.$param['w_mm'].'" class="time_box" id="'.$id.'_mmform_id_temp" name="'.$id.'_mmform_id_temp" onkeypress="return check_minute(event, "'.$id.'_mmform_id_temp")" onkeyup="change_minute(event, "'.$id.'_mmform_id_temp")" onblur="add_0("'.$id.'_mmform_id_temp")" '.$param['attributes'].' disabled/></div>'.$w_sec.$w_time_type.'</div><div id="'.$id.'_tr_time2" style="display: table-row;"><div id="'.$id.'_td_time_label1" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_hh">'.$w_mini_labels[0].'</label></div><div style="display: table-cell;"></div><div id="'.$id.'_td_time_label2" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_mm">'.$w_mini_labels[1].'</label></div>'.$w_sec_label.$w_time_type_label.'</div></div></div></div>';
|
| 1236 |
-
|
| 1237 |
-
break;
|
| 1238 |
-
}
|
| 1239 |
-
case 'type_date':
|
| 1240 |
-
{
|
| 1241 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val');
|
| 1242 |
-
$temp = $params;
|
| 1243 |
-
if(strpos($temp, 'w_disable_past_days') > -1)
|
| 1244 |
-
$params_names = array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val', 'w_disable_past_days');
|
| 1245 |
-
foreach($params_names as $params_name )
|
| 1246 |
-
{
|
| 1247 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1248 |
-
$param[$params_name] = $temp[0];
|
| 1249 |
-
$temp=$temp[1];
|
| 1250 |
-
}
|
| 1251 |
-
|
| 1252 |
-
if($temp)
|
| 1253 |
-
{
|
| 1254 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1255 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1256 |
-
foreach($attrs as $attr)
|
| 1257 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1258 |
-
}
|
| 1259 |
-
|
| 1260 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1261 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 1262 |
-
$param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
|
| 1263 |
-
$disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
|
| 1264 |
-
|
| 1265 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_date" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_date" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_disable_past_days'].'" name="'.$id.'_dis_past_daysform_id_temp" id="'.$id.'_dis_past_daysform_id_temp"><input type="text" value="'.$param['w_date'].'" class="wdform-date" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" maxlength="10" size="10" onchange="change_value("'.$id.'_elementform_id_temp")" '.$param['attributes'].' disabled/><input id="'.$id.'_buttonform_id_temp" class="button" type="reset" value="'.$param['w_but_val'].'" format="'.$param['w_format'].'" src="templates/bluestork/images/system/calendar.png?ver='. WD_FM_VERSION.'" alt="calendario" '.$param['attributes'].' onclick="return showCalendar("'.$id.'_elementform_id_temp" , "'.$param['w_format'].'", '.$disable_past_days.')"></div></div>';
|
| 1266 |
-
|
| 1267 |
-
break;
|
| 1268 |
-
}
|
| 1269 |
-
|
| 1270 |
-
///////////////////////// type_date_new ////////////////////////////
|
| 1271 |
-
|
| 1272 |
-
case 'type_date_new':
|
| 1273 |
-
{
|
| 1274 |
-
|
| 1275 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_size', 'w_date','w_required', 'w_show_image', 'w_class','w_format', 'w_start_day', 'w_default_date', 'w_min_date', 'w_max_date', 'w_invalid_dates', 'w_show_days', 'w_hide_time', 'w_but_val', 'w_disable_past_days');
|
| 1276 |
-
$temp = $params;
|
| 1277 |
-
|
| 1278 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 1279 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size', 'w_date','w_required', 'w_show_image', 'w_class','w_format', 'w_start_day', 'w_default_date', 'w_min_date', 'w_max_date', 'w_invalid_dates', 'w_show_days', 'w_hide_time', 'w_but_val', 'w_disable_past_days');
|
| 1280 |
-
|
| 1281 |
-
|
| 1282 |
-
foreach($params_names as $params_name )
|
| 1283 |
-
{
|
| 1284 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1285 |
-
$param[$params_name] = $temp[0];
|
| 1286 |
-
$temp=$temp[1];
|
| 1287 |
-
}
|
| 1288 |
-
|
| 1289 |
-
if($temp)
|
| 1290 |
-
{
|
| 1291 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1292 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1293 |
-
foreach($attrs as $attr)
|
| 1294 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1295 |
-
}
|
| 1296 |
-
|
| 1297 |
-
|
| 1298 |
-
$w_show_week_days = explode('***', $param['w_show_days']);
|
| 1299 |
-
|
| 1300 |
-
|
| 1301 |
-
|
| 1302 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1303 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1304 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1305 |
-
|
| 1306 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 1307 |
-
$param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
|
| 1308 |
-
$disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
|
| 1309 |
-
$display_image_date = $param['w_show_image'] == 'yes' ? 'inline' : 'none';
|
| 1310 |
-
|
| 1311 |
-
|
| 1312 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_date_new" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_date_new" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp">
|
| 1313 |
-
<input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp">
|
| 1314 |
-
|
| 1315 |
-
<input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/>
|
| 1316 |
-
|
| 1317 |
-
<input type="hidden" value="'.$param['w_show_image'].'" name="'.$id.'_show_imageform_id_temp" id="'.$id.'_show_imageform_id_temp">
|
| 1318 |
-
|
| 1319 |
-
<input type="hidden" value="'.$param['w_disable_past_days'].'" name="'.$id.'_dis_past_daysform_id_temp" id="'.$id.'_dis_past_daysform_id_temp">
|
| 1320 |
-
|
| 1321 |
-
<input type="hidden" value="'.$param['w_default_date'].'" name="'.$id.'_default_date_id_temp" id="'.$id.'_default_date_id_temp">
|
| 1322 |
-
<input type="hidden" value="'.$param['w_min_date'].'" name="'.$id.'_min_date_id_temp" id="'.$id.'_min_date_id_temp">
|
| 1323 |
-
<input type="hidden" value="'.$param['w_max_date'].'" name="'.$id.'_max_date_id_temp" id="'.$id.'_max_date_id_temp">
|
| 1324 |
-
<input type="hidden" value="'.$param['w_invalid_dates'].'" name="'.$id.'_invalid_dates_id_temp" id="'.$id.'_invalid_dates_id_temp">
|
| 1325 |
-
|
| 1326 |
-
<input type="hidden" value="'.$param['w_start_day'].'" name="'.$id.'_start_dayform_id_temp" id="'.$id.'_start_dayform_id_temp">
|
| 1327 |
-
|
| 1328 |
-
<input type="hidden" value="'.$param['w_hide_time'].'" name="'.$id.'_hide_timeform_id_temp" id="'.$id.'_hide_timeform_id_temp">
|
| 1329 |
-
|
| 1330 |
-
<input type="hidden" name="'.$id.'_show_week_days" id="'.$id.'_show_week_days" sunday="'.$w_show_week_days[0].'" monday="'.$w_show_week_days[1].'" tuesday="'.$w_show_week_days[2].'" wednesday="'.$w_show_week_days[3].'" thursday="'.$w_show_week_days[4].'" friday="'.$w_show_week_days[5].'" saturday="'.$w_show_week_days[6].'">
|
| 1331 |
-
|
| 1332 |
-
|
| 1333 |
-
|
| 1334 |
-
<input type="text" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled/>
|
| 1335 |
-
<img src="' . WD_FM_URL . '/images/date.png" id="'.$id.'_show_imagedateform_id_temp" name="'.$id.'_show_imagedateform_id_temp" style="vertical-align : text-top; margin-left : 1px; display:'.$display_image_date.'">
|
| 1336 |
-
|
| 1337 |
-
<input id="'.$id.'_buttonform_id_temp" type="hidden" value="'.$param['w_but_val'].'" format="'.$param['w_format'].'" ></div></div>';
|
| 1338 |
-
|
| 1339 |
-
break;
|
| 1340 |
-
}
|
| 1341 |
-
|
| 1342 |
-
|
| 1343 |
-
|
| 1344 |
-
case 'type_date_range':
|
| 1345 |
-
{
|
| 1346 |
-
|
| 1347 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_size', 'w_date','w_required', 'w_show_image', 'w_class','w_format', 'w_start_day', 'w_default_date_start', 'w_default_date_end', 'w_min_date', 'w_max_date', 'w_invalid_dates', 'w_show_days', 'w_hide_time', 'w_but_val', 'w_disable_past_days');
|
| 1348 |
-
$temp = $params;
|
| 1349 |
-
|
| 1350 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 1351 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size', 'w_date','w_required', 'w_show_image', 'w_class','w_format', 'w_start_day', 'w_default_date_start', 'w_default_date_end', 'w_min_date', 'w_max_date', 'w_invalid_dates', 'w_show_days', 'w_hide_time', 'w_but_val', 'w_disable_past_days');
|
| 1352 |
-
|
| 1353 |
-
|
| 1354 |
-
foreach($params_names as $params_name )
|
| 1355 |
-
{
|
| 1356 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1357 |
-
$param[$params_name] = $temp[0];
|
| 1358 |
-
$temp=$temp[1];
|
| 1359 |
-
}
|
| 1360 |
-
|
| 1361 |
-
if($temp)
|
| 1362 |
-
{
|
| 1363 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1364 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1365 |
-
foreach($attrs as $attr)
|
| 1366 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1367 |
-
}
|
| 1368 |
-
|
| 1369 |
-
|
| 1370 |
-
$w_show_week_days = explode('***', $param['w_show_days']);
|
| 1371 |
-
$defaul_day_array = explode(',', $param['w_date']);
|
| 1372 |
-
$defaul_day_start = $defaul_day_array[0];
|
| 1373 |
-
$defaul_day_end = $defaul_day_array[1];
|
| 1374 |
-
|
| 1375 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1376 |
-
|
| 1377 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1378 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1379 |
-
|
| 1380 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 1381 |
-
$param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
|
| 1382 |
-
$disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
|
| 1383 |
-
$display_image_date = $param['w_show_image'] == 'yes' ? 'inline' : 'none';
|
| 1384 |
-
|
| 1385 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_date_range" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';">
|
| 1386 |
-
|
| 1387 |
-
<input type="hidden" value="type_date_range" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp">
|
| 1388 |
-
|
| 1389 |
-
<input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp">
|
| 1390 |
-
|
| 1391 |
-
<input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/>
|
| 1392 |
-
|
| 1393 |
-
<input type="hidden" value="'.$param['w_show_image'].'" name="'.$id.'_show_imageform_id_temp" id="'.$id.'_show_imageform_id_temp">
|
| 1394 |
-
|
| 1395 |
-
<input type="hidden" value="'.$param['w_disable_past_days'].'" name="'.$id.'_dis_past_daysform_id_temp" id="'.$id.'_dis_past_daysform_id_temp">
|
| 1396 |
-
|
| 1397 |
-
<input type="hidden" value="'.$param['w_default_date_start'].'" name="'.$id.'_default_date_id_temp_start" id="'.$id.'_default_date_id_temp_start">
|
| 1398 |
-
|
| 1399 |
-
<input type="hidden" value="'.$param['w_default_date_end'].'" name="'.$id.'_default_date_id_temp_end" id="'.$id.'_default_date_id_temp_end">
|
| 1400 |
-
|
| 1401 |
-
<input type="hidden" value="'.$param['w_min_date'].'" name="'.$id.'_min_date_id_temp" id="'.$id.'_min_date_id_temp">
|
| 1402 |
-
|
| 1403 |
-
<input type="hidden" value="'.$param['w_max_date'].'" name="'.$id.'_max_date_id_temp" id="'.$id.'_max_date_id_temp">
|
| 1404 |
-
|
| 1405 |
-
<input type="hidden" value="'.$param['w_invalid_dates'].'" name="'.$id.'_invalid_dates_id_temp" id="'.$id.'_invalid_dates_id_temp">
|
| 1406 |
-
|
| 1407 |
-
<input type="hidden" value="'.$param['w_start_day'].'" name="'.$id.'_start_dayform_id_temp" id="'.$id.'_start_dayform_id_temp">
|
| 1408 |
-
|
| 1409 |
-
<input type="hidden" value="'.$param['w_hide_time'].'" name="'.$id.'_hide_timeform_id_temp" id="'.$id.'_hide_timeform_id_temp">
|
| 1410 |
-
|
| 1411 |
-
<input type="hidden" name="'.$id.'_show_week_days" id="'.$id.'_show_week_days" sunday="'.$w_show_week_days[0].'" monday="'.$w_show_week_days[1].'" tuesday="'.$w_show_week_days[2].'" wednesday="'.$w_show_week_days[3].'" thursday="'.$w_show_week_days[4].'" friday="'.$w_show_week_days[5].'" saturday="'.$w_show_week_days[6].'">
|
| 1412 |
-
|
| 1413 |
-
|
| 1414 |
-
|
| 1415 |
-
|
| 1416 |
-
|
| 1417 |
-
<input type="text" id="'.$id.'_elementform_id_temp0" name="'.$id.'_elementform_id_temp0" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled/>
|
| 1418 |
-
<img src="' . WD_FM_URL . '/images/date.png" id="'.$id.'_show_imagedateform_id_temp0" name="'.$id.'_show_imagedateform_id_temp0" style="vertical-align : text-top; margin-left : 1px; display:'.$display_image_date.'">
|
| 1419 |
-
|
| 1420 |
-
<span>-</span>
|
| 1421 |
-
|
| 1422 |
-
<input type="text" id="'.$id.'_elementform_id_temp1" name="'.$id.'_elementform_id_temp1" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled/>
|
| 1423 |
-
<img src="' . WD_FM_URL . '/images/date.png" id="'.$id.'_show_imagedateform_id_temp1" name="'.$id.'_show_imagedateform_id_temp1" style="vertical-align : text-top; margin-left : 1px; display:'.$display_image_date.'">
|
| 1424 |
-
|
| 1425 |
-
<input id="'.$id.'_buttonform_id_temp" type="hidden" value="'.$param['w_but_val'].'" format="'.$param['w_format'].'" >
|
| 1426 |
-
|
| 1427 |
-
</div></div>';
|
| 1428 |
-
|
| 1429 |
-
|
| 1430 |
-
|
| 1431 |
-
break;
|
| 1432 |
-
}
|
| 1433 |
-
|
| 1434 |
-
|
| 1435 |
-
|
| 1436 |
-
|
| 1437 |
-
|
| 1438 |
-
case 'type_date_fields':
|
| 1439 |
-
{
|
| 1440 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_day','w_month','w_year','w_day_type','w_month_type','w_year_type','w_day_label','w_month_label','w_year_label','w_day_size','w_month_size','w_year_size','w_required','w_class','w_from','w_to','w_divider');
|
| 1441 |
-
|
| 1442 |
-
$temp=$params;
|
| 1443 |
-
|
| 1444 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 1445 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_day','w_month','w_year','w_day_type','w_month_type','w_year_type','w_day_label','w_month_label','w_year_label','w_day_size','w_month_size','w_year_size','w_required','w_class','w_from','w_to','w_divider');
|
| 1446 |
-
|
| 1447 |
-
|
| 1448 |
-
foreach($params_names as $params_name )
|
| 1449 |
-
{
|
| 1450 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1451 |
-
$param[$params_name] = $temp[0];
|
| 1452 |
-
$temp=$temp[1];
|
| 1453 |
-
}
|
| 1454 |
-
|
| 1455 |
-
if($temp)
|
| 1456 |
-
{
|
| 1457 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1458 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1459 |
-
foreach($attrs as $attr)
|
| 1460 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1461 |
-
}
|
| 1462 |
-
|
| 1463 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1464 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1465 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1466 |
-
|
| 1467 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 1468 |
-
|
| 1469 |
-
|
| 1470 |
-
if($param['w_day_type']=="SELECT")
|
| 1471 |
-
{
|
| 1472 |
-
|
| 1473 |
-
|
| 1474 |
-
$w_day_type = '<select id="'.$id.'_dayform_id_temp" name="'.$id.'_dayform_id_temp" onchange="set_select(this)" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].' disabled><option value=""></option>';
|
| 1475 |
-
for($k=0; $k<=31; $k++)
|
| 1476 |
-
{
|
| 1477 |
-
if($k<10)
|
| 1478 |
-
{
|
| 1479 |
-
if($param['w_day']=='0'.$k)
|
| 1480 |
-
$selected = "selected=\"selected\"";
|
| 1481 |
-
else
|
| 1482 |
-
$selected = "";
|
| 1483 |
-
|
| 1484 |
-
$w_day_type .= '<option value="0'.$k.'" '.$selected.'>0'.$k.'</option>';
|
| 1485 |
-
}
|
| 1486 |
-
else
|
| 1487 |
-
{
|
| 1488 |
-
if($param['w_day']==''.$k)
|
| 1489 |
-
$selected = "selected=\"selected\"";
|
| 1490 |
-
else
|
| 1491 |
-
$selected = "";
|
| 1492 |
-
|
| 1493 |
-
$w_day_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
|
| 1494 |
-
}
|
| 1495 |
-
|
| 1496 |
-
|
| 1497 |
-
|
| 1498 |
-
}
|
| 1499 |
-
$w_day_type .= '</select>';
|
| 1500 |
-
}
|
| 1501 |
-
else
|
| 1502 |
-
{
|
| 1503 |
-
$w_day_type = '<input type="text" value="'.$param['w_day'].'" id="'.$id.'_dayform_id_temp" name="'.$id.'_dayform_id_temp" onchange="change_value("'.$id.'_dayform_id_temp")" onkeypress="return check_day(event, "'.$id.'_dayform_id_temp")" onblur="if (this.value=="0") this.value=""; else add_0("'.$id.'_dayform_id_temp")" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].' disabled/>';
|
| 1504 |
-
}
|
| 1505 |
-
|
| 1506 |
-
if($param['w_month_type']=="SELECT")
|
| 1507 |
-
{
|
| 1508 |
-
|
| 1509 |
-
$w_month_type = '<select id="'.$id.'_monthform_id_temp" name="'.$id.'_monthform_id_temp" onchange="set_select(this)" style="width: '.$param['w_month_size'].'px;" '.$param['attributes'].' disabled><option value=""></option><option value="01" '.($param['w_month']=="01" ? "selected=\"selected\"": "").' ><!--repstart-->January<!--repend--></option><option value="02" '.($param['w_month']=="02" ? "selected=\"selected\"": "").'><!--repstart-->February<!--repend--></option><option value="03" '.($param['w_month']=="03"? "selected=\"selected\"": "").'><!--repstart-->March<!--repend--></option><option value="04" '.($param['w_month']=="04" ? "selected=\"selected\"": "").' ><!--repstart-->April<!--repend--></option><option value="05" '.($param['w_month']=="05" ? "selected=\"selected\"": "").' ><!--repstart-->May<!--repend--></option><option value="06" '.($param['w_month']=="06" ? "selected=\"selected\"": "").' ><!--repstart-->June<!--repend--></option><option value="07" '.($param['w_month']=="07" ? "selected=\"selected\"": "").' ><!--repstart-->July<!--repend--></option><option value="08" '.($param['w_month']=="08" ? "selected=\"selected\"": "").' ><!--repstart-->August<!--repend--></option><option value="09" '.($param['w_month']=="09" ? "selected=\"selected\"": "").' ><!--repstart-->September<!--repend--></option><option value="10" '.($param['w_month']=="10" ? "selected=\"selected\"": "").' ><!--repstart-->October<!--repend--></option><option value="11" '.($param['w_month']=="11" ? "selected=\"selected\"": "").'><!--repstart-->November<!--repend--></option><option value="12" '.($param['w_month']=="12" ? "selected=\"selected\"": "").' ><!--repstart-->December<!--repend--></option></select>';
|
| 1510 |
-
|
| 1511 |
-
}
|
| 1512 |
-
else
|
| 1513 |
-
{
|
| 1514 |
-
$w_month_type = '<input type="text" value="'.$param['w_month'].'" id="'.$id.'_monthform_id_temp" name="'.$id.'_monthform_id_temp" onkeypress="return check_month(event, "'.$id.'_monthform_id_temp")" onchange="change_value("'.$id.'_monthform_id_temp")" onblur="if (this.value=="0") this.value=""; else add_0("'.$id.'_monthform_id_temp")" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].' disabled/>';
|
| 1515 |
-
|
| 1516 |
-
}
|
| 1517 |
-
$param['w_to'] = isset($param['w_to']) && $param['w_to']!="NaN" ? $param['w_to'] : date("Y");
|
| 1518 |
-
if($param['w_year_type']=="SELECT")
|
| 1519 |
-
{
|
| 1520 |
-
$w_year_type = '<select id="'.$id.'_yearform_id_temp" name="'.$id.'_yearform_id_temp" onchange="set_select(this)" from="'.$param['w_from'].'" to="'.$param['w_to'].'" style="width: '.$param['w_year_size'].'px;" '.$param['attributes'].' disabled><option value=""></option>';
|
| 1521 |
-
for($k=$param['w_to']; $k>=$param['w_from']; $k--)
|
| 1522 |
-
{
|
| 1523 |
-
if($param['w_year']==$k)
|
| 1524 |
-
$selected = "selected=\"selected\"";
|
| 1525 |
-
else
|
| 1526 |
-
$selected = "";
|
| 1527 |
-
|
| 1528 |
-
$w_year_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
|
| 1529 |
-
}
|
| 1530 |
-
$w_year_type .= '</select>';
|
| 1531 |
-
|
| 1532 |
-
}
|
| 1533 |
-
else
|
| 1534 |
-
{
|
| 1535 |
-
$w_year_type = '<input type="text" value="'.$param['w_year'].'" id="'.$id.'_yearform_id_temp" name="'.$id.'_yearform_id_temp" onchange="change_year("'.$id.'_yearform_id_temp")" onkeypress="return check_year1(event, "'.$id.'_yearform_id_temp")" onblur="check_year2("'.$id.'_yearform_id_temp")" from="'.$param['w_from'].'" to="'.$param['w_to'].'" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].' disabled/>';
|
| 1536 |
-
}
|
| 1537 |
-
|
| 1538 |
-
|
| 1539 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_date_fields" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_date_fields" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><div id="'.$id.'_table_date" style="display: table;"><div id="'.$id.'_tr_date1" style="display: table-row;"><div id="'.$id.'_td_date_input1" style="display: table-cell;">
|
| 1540 |
-
'.$w_day_type.'
|
| 1541 |
-
|
| 1542 |
-
</div><div id="'.$id.'_td_date_separator1" style="display: table-cell;"><span id="'.$id.'_separator1" class="wdform_separator">'.$param['w_divider'].'</span></div><div id="'.$id.'_td_date_input2" style="display: table-cell;">'.$w_month_type.'</div><div id="'.$id.'_td_date_separator2" style="display: table-cell;"><span id="'.$id.'_separator2" class="wdform_separator">'.$param['w_divider'].'</span></div><div id="'.$id.'_td_date_input3" style="display: table-cell;">'.$w_year_type.'</div></div><div id="'.$id.'_tr_date2" style="display: table-row;"><div id="'.$id.'_td_date_label1" style="display: table-cell;"><label class="mini_label" id="'.$id.'_day_label">'.$param['w_day_label'].'</label></div><div style="display: table-cell;"></div><div id="'.$id.'_td_date_label2" style="display: table-cell;"><label class="mini_label" id="'.$id.'_month_label">'.$param['w_month_label'].'</label></div><div style="display: table-cell;"></div><div id="'.$id.'_td_date_label3" style="display: table-cell;"><label class="mini_label" id="'.$id.'_year_label">'.$param['w_year_label'].'</label></div></div></div></div></div>';
|
| 1543 |
-
|
| 1544 |
-
break;
|
| 1545 |
-
}
|
| 1546 |
-
case 'type_file_upload':
|
| 1547 |
-
{
|
| 1548 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_destination','w_extension','w_max_size','w_required','w_multiple','w_class');
|
| 1549 |
-
$temp=$params;
|
| 1550 |
-
|
| 1551 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 1552 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_destination','w_extension','w_max_size','w_required','w_multiple','w_class');
|
| 1553 |
-
|
| 1554 |
-
|
| 1555 |
-
foreach($params_names as $params_name )
|
| 1556 |
-
{
|
| 1557 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1558 |
-
$param[$params_name] = $temp[0];
|
| 1559 |
-
if (isset($temp[1])) {
|
| 1560 |
-
$temp = $temp[1];
|
| 1561 |
-
}
|
| 1562 |
-
else {
|
| 1563 |
-
$temp = '';
|
| 1564 |
-
}
|
| 1565 |
-
}
|
| 1566 |
-
|
| 1567 |
-
if($temp)
|
| 1568 |
-
{
|
| 1569 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1570 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1571 |
-
foreach($attrs as $attr)
|
| 1572 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1573 |
-
}
|
| 1574 |
-
|
| 1575 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1576 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1577 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1578 |
-
|
| 1579 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 1580 |
-
$multiple = ($param['w_multiple']=="yes" ? "multiple='multiple'" : "");
|
| 1581 |
-
|
| 1582 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_file_upload" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_file_upload" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="***max_sizeskizb'.$id.'***'.$param['w_max_size'].'***max_sizeverj'.$id.'***" id="'.$id.'_max_size" name="'.$id.'_max_size"><input type="hidden" value="***destinationskizb'.$id.'***'.$param['w_destination'].'***destinationverj'.$id.'***" id="'.$id.'_destination" name="'.$id.'_destination"><input type="hidden" value="***extensionskizb'.$id.'***'.$param['w_extension'].'***extensionverj'.$id.'***" id="'.$id.'_extension" name="'.$id.'_extension"><input type="file" class="file_upload" id="'.$id.'_elementform_id_temp" name="'.$id.'_fileform_id_temp" '.$multiple.' '.$param['attributes'].' disabled/></div></div>';
|
| 1583 |
-
|
| 1584 |
-
break;
|
| 1585 |
-
}
|
| 1586 |
-
case 'type_captcha':
|
| 1587 |
-
{
|
| 1588 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_digit','w_class');
|
| 1589 |
-
$temp=$params;
|
| 1590 |
-
|
| 1591 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 1592 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_digit','w_class');
|
| 1593 |
-
|
| 1594 |
-
foreach($params_names as $params_name )
|
| 1595 |
-
{
|
| 1596 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1597 |
-
$param[$params_name] = $temp[0];
|
| 1598 |
-
$temp=$temp[1];
|
| 1599 |
-
}
|
| 1600 |
-
|
| 1601 |
-
if($temp)
|
| 1602 |
-
{
|
| 1603 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1604 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1605 |
-
foreach($attrs as $attr)
|
| 1606 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1607 |
-
}
|
| 1608 |
-
|
| 1609 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1610 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1611 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1612 |
-
|
| 1613 |
-
|
| 1614 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_captcha" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display:'.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_captcha" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div style="display: table;"><div style="display: table-row;"><div valign="middle" style="display: table-cell;"><img type="captcha" digit="'.$param['w_digit'].'" src="' . add_query_arg(array('action' => 'formmakerwdcaptcha', 'digit' => $param['w_digit'], 'i' => 'form_id_temp'), admin_url('admin-ajax.php')) . '" id="_wd_captchaform_id_temp" class="captcha_img" onclick="captcha_refresh("_wd_captcha","form_id_temp")" '.$param['attributes'].'></div><div valign="middle" style="display: table-cell;"><div class="captcha_refresh" id="_element_refreshform_id_temp" onclick="captcha_refresh("_wd_captcha","form_id_temp")" '.$param['attributes'].'></div></div></div><div style="display: table-row;"><div style="display: table-cell;"><input type="text" class="captcha_input" id="_wd_captcha_inputform_id_temp" name="captcha_input" style="width: '.($param['w_digit']*10+15).'px;" '.$param['attributes'].' disabled/><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/></div></div></div></div></div>';
|
| 1615 |
-
|
| 1616 |
-
break;
|
| 1617 |
-
}
|
| 1618 |
-
case 'type_arithmetic_captcha':
|
| 1619 |
-
{
|
| 1620 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_count', 'w_operations','w_class', 'w_input_size');
|
| 1621 |
-
$temp=$params;
|
| 1622 |
-
|
| 1623 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 1624 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_count', 'w_operations','w_class', 'w_input_size');
|
| 1625 |
-
|
| 1626 |
-
|
| 1627 |
-
foreach($params_names as $params_name )
|
| 1628 |
-
{
|
| 1629 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1630 |
-
$param[$params_name] = $temp[0];
|
| 1631 |
-
$temp=$temp[1];
|
| 1632 |
-
}
|
| 1633 |
-
|
| 1634 |
-
if($temp)
|
| 1635 |
-
{
|
| 1636 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1637 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1638 |
-
foreach($attrs as $attr)
|
| 1639 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1640 |
-
}
|
| 1641 |
-
|
| 1642 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1643 |
-
|
| 1644 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1645 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1646 |
-
$param['w_count'] = $param['w_count'] ? $param['w_count'] : 1;
|
| 1647 |
-
$param['w_operations'] = $param['w_operations'] ? $param['w_operations'] : '+, -, *, /';
|
| 1648 |
-
$param['w_input_size'] = $param['w_input_size'] ? $param['w_input_size'] : 60;
|
| 1649 |
-
|
| 1650 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_arithmetic_captcha" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display:'.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_captcha" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div style="display: table;"><div style="display: table-row;"><div style="display: table-cell;"><img type="captcha" operations_count="'.$param['w_count'].'" operations="'.$param['w_operations'].'" input_size="'.$param['w_input_size'].'" src="' . add_query_arg(array('action' => 'formmakerwdmathcaptcha', 'operations_count' => $param['w_count'], 'operations' => urlencode($param['w_operations']), 'i' => 'form_id_temp'), admin_url('admin-ajax.php')) . '" id="_wd_arithmetic_captchaform_id_temp" class="arithmetic_captcha_img" onclick="captcha_refresh("_wd_arithmetic_captcha","form_id_temp")" '.$param['attributes'].'></div><div style="display: table-cell;"><input type="text" class="arithmetic_captcha_input" id="_wd_arithmetic_captcha_inputform_id_temp" name="arithmetic_captcha_input" onkeypress="return check_isnum(event)" style="width: '.$param['w_input_size'].'px;" '.$param['attributes'].' disabled/><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/></div><div style="display: table-cell; vertical-align: middle;"><div class="captcha_refresh" id="_element_refreshform_id_temp" onclick="captcha_refresh("_wd_arithmetic_captcha","form_id_temp")" '.$param['attributes'].'></div></div></div></div></div></div>';
|
| 1651 |
-
|
| 1652 |
-
break;
|
| 1653 |
-
}
|
| 1654 |
-
|
| 1655 |
-
|
| 1656 |
-
case 'type_recaptcha':
|
| 1657 |
-
{
|
| 1658 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_public','w_private','w_theme','w_class');
|
| 1659 |
-
$temp=$params;
|
| 1660 |
-
|
| 1661 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 1662 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_public','w_private','w_theme','w_class');
|
| 1663 |
-
|
| 1664 |
-
foreach($params_names as $params_name )
|
| 1665 |
-
{
|
| 1666 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1667 |
-
$param[$params_name] = $temp[0];
|
| 1668 |
-
$temp=$temp[1];
|
| 1669 |
-
}
|
| 1670 |
-
|
| 1671 |
-
if($temp)
|
| 1672 |
-
{
|
| 1673 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1674 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1675 |
-
foreach($attrs as $attr)
|
| 1676 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1677 |
-
}
|
| 1678 |
-
|
| 1679 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1680 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1681 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1682 |
-
|
| 1683 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_recaptcha" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_recaptcha" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><div id="wd_recaptchaform_id_temp" public_key="'.$param['w_public'].'" private_key="'.$param['w_private'].'" theme="'.$param['w_theme'].'" '.$param['attributes'].'><span style="color: red; font-style: italic;">Recaptcha doesn\'t display in back end</span></div></div></div>';
|
| 1684 |
-
|
| 1685 |
-
break;
|
| 1686 |
-
}
|
| 1687 |
-
|
| 1688 |
-
case 'type_hidden':
|
| 1689 |
-
{
|
| 1690 |
-
$params_names=array('w_name','w_value');
|
| 1691 |
-
$temp=$params;
|
| 1692 |
-
foreach($params_names as $params_name )
|
| 1693 |
-
{
|
| 1694 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1695 |
-
$param[$params_name] = $temp[0];
|
| 1696 |
-
$temp=$temp[1];
|
| 1697 |
-
}
|
| 1698 |
-
|
| 1699 |
-
if($temp)
|
| 1700 |
-
{
|
| 1701 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1702 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1703 |
-
foreach($attrs as $attr)
|
| 1704 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1705 |
-
}
|
| 1706 |
-
$param['w_name'] = str_replace(' ','',$param['w_name']);
|
| 1707 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_hidden" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" style="display: table-cell;"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">'.$param['w_name'].'</span><span style="color: red; font-size: 13px;">Hidden field</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" style="display: table-cell; padding-left:7px;"><input type="hidden" value="'.$param['w_value'].'" id="'.$id.'_elementform_id_temp" name="'.$param['w_name'].'" '.$param['attributes'].'><input type="hidden" value="type_hidden" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div><span align="left">Name: </span><span align="left" id="'.$id.'_hidden_nameform_id_temp">'.$param['w_name'].'</span></div><div><span align="left">Value: </span><span align="left" id="'.$id.'_hidden_valueform_id_temp">'.$param['w_value'].'</span></div></div></div>';
|
| 1708 |
-
|
| 1709 |
-
break;
|
| 1710 |
-
}
|
| 1711 |
-
case 'type_mark_map':
|
| 1712 |
-
{
|
| 1713 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class');
|
| 1714 |
-
$temp=$params;
|
| 1715 |
-
|
| 1716 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 1717 |
-
$params_names = array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class');
|
| 1718 |
-
|
| 1719 |
-
|
| 1720 |
-
foreach($params_names as $params_name )
|
| 1721 |
-
{
|
| 1722 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1723 |
-
$param[$params_name] = $temp[0];
|
| 1724 |
-
$temp=$temp[1];
|
| 1725 |
-
}
|
| 1726 |
-
|
| 1727 |
-
if($temp)
|
| 1728 |
-
{
|
| 1729 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1730 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1731 |
-
foreach($attrs as $attr)
|
| 1732 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1733 |
-
}
|
| 1734 |
-
|
| 1735 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1736 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1737 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1738 |
-
|
| 1739 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_mark_map" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="type_mark_map" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div id="'.$id.'_elementform_id_temp" long0="'.$param['w_long'].'" lat0="'.$param['w_lat'].'" zoom="'.$param['w_zoom'].'" info0="'.$param['w_info'].'" center_x="'.$param['w_center_x'].'" center_y="'.$param['w_center_y'].'" style="width: '.$param['w_width'].'px; height: '.$param['w_height'].'px;" '.$param['attributes'].'></div></div></div> ';
|
| 1740 |
-
|
| 1741 |
-
break;
|
| 1742 |
-
}
|
| 1743 |
-
|
| 1744 |
-
case 'type_map':
|
| 1745 |
-
{
|
| 1746 |
-
$params_names=array('w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class');
|
| 1747 |
-
$temp=$params;
|
| 1748 |
-
foreach($params_names as $params_name )
|
| 1749 |
-
{
|
| 1750 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1751 |
-
$param[$params_name] = $temp[0];
|
| 1752 |
-
$temp=$temp[1];
|
| 1753 |
-
}
|
| 1754 |
-
|
| 1755 |
-
if($temp)
|
| 1756 |
-
{
|
| 1757 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1758 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1759 |
-
foreach($attrs as $attr)
|
| 1760 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1761 |
-
}
|
| 1762 |
-
|
| 1763 |
-
$marker='';
|
| 1764 |
-
|
| 1765 |
-
$param['w_long'] = explode('***',$param['w_long']);
|
| 1766 |
-
$param['w_lat'] = explode('***',$param['w_lat']);
|
| 1767 |
-
$param['w_info'] = explode('***',$param['w_info']);
|
| 1768 |
-
foreach($param['w_long'] as $key => $w_long )
|
| 1769 |
-
{
|
| 1770 |
-
$marker.='long'.$key.'="'.$w_long.'" lat'.$key.'="'.$param['w_lat'][$key].'" info'.$key.'="'.$param['w_info'][$key].'"';
|
| 1771 |
-
}
|
| 1772 |
-
|
| 1773 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_map" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><input type="hidden" value="type_map" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div id="'.$id.'_elementform_id_temp" zoom="'.$param['w_zoom'].'" center_x="'.$param['w_center_x'].'" center_y="'.$param['w_center_y'].'" style="width: '.$param['w_width'].'px; height: '.$param['w_height'].'px;" '.$marker.' '.$param['attributes'].'></div></div></div>';
|
| 1774 |
-
|
| 1775 |
-
break;
|
| 1776 |
-
}
|
| 1777 |
-
case 'type_paypal_price':
|
| 1778 |
-
{
|
| 1779 |
-
|
| 1780 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_first_val','w_title', 'w_mini_labels','w_size','w_required','w_hide_cents','w_class','w_range_min','w_range_max');
|
| 1781 |
-
$temp=$params;
|
| 1782 |
-
foreach($params_names as $params_name )
|
| 1783 |
-
{
|
| 1784 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1785 |
-
$param[$params_name] = $temp[0];
|
| 1786 |
-
$temp=$temp[1];
|
| 1787 |
-
}
|
| 1788 |
-
|
| 1789 |
-
if($temp)
|
| 1790 |
-
{
|
| 1791 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1792 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1793 |
-
foreach($attrs as $attr)
|
| 1794 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1795 |
-
}
|
| 1796 |
-
|
| 1797 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1798 |
-
$input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
|
| 1799 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 1800 |
-
$hide_cents = ($param['w_hide_cents']=="yes" ? "none;" : "table-cell;");
|
| 1801 |
-
|
| 1802 |
-
|
| 1803 |
-
$w_first_val = explode('***',$param['w_first_val']);
|
| 1804 |
-
$w_title = explode('***',$param['w_title']);
|
| 1805 |
-
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
| 1806 |
-
|
| 1807 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_paypal_price" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required"style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_paypal_price" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_range_min'].'" name="'.$id.'_range_minform_id_temp" id="'.$id.'_range_minform_id_temp"><input type="hidden" value="'.$param['w_range_max'].'" name="'.$id.'_range_maxform_id_temp" id="'.$id.'_range_maxform_id_temp"><div id="'.$id.'_table_price" style="display: table;"><div id="'.$id.'_tr_price1" style="display: table-row;"><div id="'.$id.'_td_name_currency" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;"><!--repstart--> $ <!--repend--></span></div><div id="'.$id.'_td_name_dollars" style="display: table-cell;"><input type="text" class="'.$input_active.'" id="'.$id.'_element_dollarsform_id_temp" name="'.$id.'_element_dollarsform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'"onfocus="delete_value("'.$id.'_element_dollarsform_id_temp")" onblur="return_value("'.$id.'_element_dollarsform_id_temp")"onchange="change_value("'.$id.'_element_dollarsform_id_temp")" onkeypress="return check_isnum(event)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled/></div><div id="'.$id.'_td_name_divider" style="display: '.$hide_cents.';"><span class="wdform_colon" style="vertical-align: middle;"> . </span></div><div id="'.$id.'_td_name_cents" style="display: '.$hide_cents.'"><input type="text" class="'.$input_active.'" id="'.$id.'_element_centsform_id_temp" name="'.$id.'_element_centsform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'"onfocus="delete_value("'.$id.'_element_centsform_id_temp")" onblur="return_value("'.$id.'_element_centsform_id_temp"); add_0("'.$id.'_element_centsform_id_temp")"onchange="change_value("'.$id.'_element_centsform_id_temp")" onkeypress="return check_isnum_interval(event,"'.$id.'_element_centsform_id_temp",0,99)"style="width: 30px;" '.$param['attributes'].' disabled/></div></div><div id="'.$id.'_tr_price2" style="display: table-row;"><div style="display: table-cell;"><label class="mini_label"></label></div><div align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_dollars">'.$w_mini_labels[0].'</label></div><div id="'.$id.'_td_name_label_divider" style="display: '.$hide_cents.'"><label class="mini_label"></label></div><div align="left" id="'.$id.'_td_name_label_cents" style="display: '.$hide_cents.'"><label class="mini_label" id="'.$id.'_mini_label_cents">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
|
| 1808 |
-
break;
|
| 1809 |
-
}
|
| 1810 |
-
|
| 1811 |
-
case 'type_paypal_price_new':
|
| 1812 |
-
{
|
| 1813 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_first_val','w_title', 'w_size','w_required', 'w_class','w_range_min','w_range_max', 'w_readonly', 'w_currency');
|
| 1814 |
-
|
| 1815 |
-
$temp=$params;
|
| 1816 |
-
|
| 1817 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 1818 |
-
$params_names = array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_first_val','w_title', 'w_size','w_required', 'w_class','w_range_min','w_range_max', 'w_readonly', 'w_currency');
|
| 1819 |
-
|
| 1820 |
-
|
| 1821 |
-
foreach($params_names as $params_name )
|
| 1822 |
-
{
|
| 1823 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1824 |
-
$param[$params_name] = $temp[0];
|
| 1825 |
-
$temp=$temp[1];
|
| 1826 |
-
}
|
| 1827 |
-
|
| 1828 |
-
if($temp)
|
| 1829 |
-
{
|
| 1830 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1831 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1832 |
-
foreach($attrs as $attr)
|
| 1833 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1834 |
-
}
|
| 1835 |
-
|
| 1836 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1837 |
-
|
| 1838 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1839 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1840 |
-
|
| 1841 |
-
$input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
|
| 1842 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 1843 |
-
$currency_sumbol = ($param['w_currency']=="yes" ? "display:none;" : "display: table-cell;");
|
| 1844 |
-
$param['w_readonly'] = (isset($param['w_readonly']) ? $param['w_readonly'] : "no");
|
| 1845 |
-
|
| 1846 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_paypal_price_new" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required"style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_paypal_price_new" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_readonly'].'" name="'.$id.'_readonlyform_id_temp" id="'.$id.'_readonlyform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_range_min'].'" name="'.$id.'_range_minform_id_temp" id="'.$id.'_range_minform_id_temp"><input type="hidden" value="'.$param['w_range_max'].'" name="'.$id.'_range_maxform_id_temp" id="'.$id.'_range_maxform_id_temp"><div id="'.$id.'_table_price" style="display: table;"><div id="'.$id.'_tr_price1" style="display: table-row;"><div id="'.$id.'_td_name_currency" style="'.$currency_sumbol.'"><span class="wdform_colon" style="vertical-align: middle;"><!--repstart--> $ <!--repend--></span></div><div id="'.$id.'_td_name_dollars" style="display: table-cell;"><input type="text" class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'"onfocus="delete_value("'.$id.'_elementform_id_temp")" onblur="return_value("'.$id.'_elementform_id_temp")"onchange="change_value("'.$id.'_elementform_id_temp")" onkeypress="return check_isnum(event)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled/></div></div></div></div></div>';
|
| 1847 |
-
break;
|
| 1848 |
-
}
|
| 1849 |
-
|
| 1850 |
-
|
| 1851 |
-
|
| 1852 |
-
|
| 1853 |
-
|
| 1854 |
-
case 'type_paypal_select':
|
| 1855 |
-
{
|
| 1856 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_price','w_choices_checked', 'w_choices_disabled','w_required','w_quantity', 'w_quantity_value','w_class','w_property','w_property_values');
|
| 1857 |
-
$temp=$params;
|
| 1858 |
-
if(strpos($temp, 'w_choices_params') > -1)
|
| 1859 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_price','w_choices_checked', 'w_choices_disabled','w_required','w_quantity', 'w_quantity_value', 'w_choices_params', 'w_class', 'w_property', 'w_property_values');
|
| 1860 |
-
|
| 1861 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 1862 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size','w_choices','w_choices_price','w_choices_checked', 'w_choices_disabled','w_required','w_quantity', 'w_quantity_value', 'w_choices_params', 'w_class', 'w_property', 'w_property_values');
|
| 1863 |
-
|
| 1864 |
-
foreach($params_names as $params_name )
|
| 1865 |
-
{
|
| 1866 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1867 |
-
$param[$params_name] = $temp[0];
|
| 1868 |
-
$temp=$temp[1];
|
| 1869 |
-
}
|
| 1870 |
-
|
| 1871 |
-
if($temp)
|
| 1872 |
-
{
|
| 1873 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1874 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1875 |
-
foreach($attrs as $attr)
|
| 1876 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1877 |
-
}
|
| 1878 |
-
|
| 1879 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1880 |
-
|
| 1881 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1882 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1883 |
-
|
| 1884 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 1885 |
-
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 1886 |
-
|
| 1887 |
-
$param['w_choices_price'] = explode('***',$param['w_choices_price']);
|
| 1888 |
-
|
| 1889 |
-
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 1890 |
-
|
| 1891 |
-
$param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
|
| 1892 |
-
$param['w_property'] = explode('***',$param['w_property']);
|
| 1893 |
-
$param['w_property_values'] = explode('***',$param['w_property_values']);
|
| 1894 |
-
if(isset($param['w_choices_params']))
|
| 1895 |
-
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 1896 |
-
foreach($param['w_choices_checked'] as $key => $choices_checked )
|
| 1897 |
-
{
|
| 1898 |
-
if($choices_checked=='true')
|
| 1899 |
-
$param['w_choices_checked'][$key]='selected="selected"';
|
| 1900 |
-
else
|
| 1901 |
-
$param['w_choices_checked'][$key]='';
|
| 1902 |
-
}
|
| 1903 |
-
|
| 1904 |
-
|
| 1905 |
-
$rep='<div id="wdform_field'.$id.'" type="type_paypal_select" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; "><input type="hidden" value="type_paypal_select" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><select id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" onchange="set_select(this)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled>';
|
| 1906 |
-
foreach($param['w_choices'] as $key => $choice)
|
| 1907 |
-
{
|
| 1908 |
-
$where = '';
|
| 1909 |
-
$order_by = '';
|
| 1910 |
-
$db_info = '';
|
| 1911 |
-
$choice_value = $param['w_choices_disabled'][$key]=="true" ? '' : $param['w_choices_price'][$key];
|
| 1912 |
-
|
| 1913 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 1914 |
-
{
|
| 1915 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 1916 |
-
$where = "where='".$w_choices_params[0]."'";
|
| 1917 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 1918 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 1919 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 1920 |
-
}
|
| 1921 |
-
$rep.='<option id="'.$id.'_option'.$key.'" value="'.$choice_value.'" onselect="set_select("'.$id.'_option'.$key.'")" '.$param['w_choices_checked'][$key].' '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</option>';
|
| 1922 |
-
}
|
| 1923 |
-
$rep.='</select><div id="'.$id.'_divform_id_temp">';
|
| 1924 |
-
if($param['w_quantity']=="yes")
|
| 1925 |
-
$rep.='<span id="'.$id.'_element_quantity_spanform_id_temp" style="margin-right: 15px;"><label class="mini_label" id="'.$id.'_element_quantity_label_form_id_temp" style="margin-right: 5px;"><!--repstart-->Quantity<!--repend--></label><input type="text" value="'.$param['w_quantity_value'].'" id="'.$id.'_element_quantityform_id_temp" name="'.$id.'_element_quantityform_id_temp" onkeypress="return check_isnum(event)" onchange="change_value("'.$id.'_element_quantityform_id_temp", this.value)" style="width: 30px; margin: 2px 0px;" disabled /></span>';
|
| 1926 |
-
if($param['w_property'][0])
|
| 1927 |
-
foreach($param['w_property'] as $key => $property)
|
| 1928 |
-
{
|
| 1929 |
-
|
| 1930 |
-
$rep.='
|
| 1931 |
-
<span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
|
| 1932 |
-
|
| 1933 |
-
<label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
|
| 1934 |
-
<select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;" disabled>';
|
| 1935 |
-
$param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
|
| 1936 |
-
$param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
|
| 1937 |
-
foreach($param['w_property_values'][$key] as $subkey => $property_value)
|
| 1938 |
-
{
|
| 1939 |
-
$rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
|
| 1940 |
-
}
|
| 1941 |
-
$rep.='</select></span>';
|
| 1942 |
-
}
|
| 1943 |
-
|
| 1944 |
-
$rep.='</div></div></div>';
|
| 1945 |
-
break;
|
| 1946 |
-
}
|
| 1947 |
-
|
| 1948 |
-
case 'type_paypal_checkbox':
|
| 1949 |
-
{
|
| 1950 |
-
|
| 1951 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_class','w_property','w_property_values','w_quantity','w_quantity_value');
|
| 1952 |
-
$temp=$params;
|
| 1953 |
-
if(strpos($temp, 'w_field_option_pos') > -1)
|
| 1954 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_choices_params', 'w_class','w_property','w_property_values','w_quantity','w_quantity_value');
|
| 1955 |
-
|
| 1956 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 1957 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_hide_label', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_choices_params', 'w_class','w_property','w_property_values','w_quantity','w_quantity_value');
|
| 1958 |
-
foreach($params_names as $params_name )
|
| 1959 |
-
{
|
| 1960 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1961 |
-
$param[$params_name] = $temp[0];
|
| 1962 |
-
$temp=$temp[1];
|
| 1963 |
-
}
|
| 1964 |
-
|
| 1965 |
-
if($temp)
|
| 1966 |
-
{
|
| 1967 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1968 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1969 |
-
foreach($attrs as $attr)
|
| 1970 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1971 |
-
}
|
| 1972 |
-
if(!isset($param['w_field_option_pos']))
|
| 1973 |
-
$param['w_field_option_pos'] = 'left';
|
| 1974 |
-
|
| 1975 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1976 |
-
|
| 1977 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1978 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1979 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 1980 |
-
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 1981 |
-
$param['w_choices_price'] = explode('***',$param['w_choices_price']);
|
| 1982 |
-
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 1983 |
-
$param['w_property'] = explode('***',$param['w_property']);
|
| 1984 |
-
$param['w_property_values'] = explode('***',$param['w_property_values']);
|
| 1985 |
-
|
| 1986 |
-
if(isset($param['w_choices_params']))
|
| 1987 |
-
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 1988 |
-
|
| 1989 |
-
foreach($param['w_choices_checked'] as $key => $choices_checked )
|
| 1990 |
-
{
|
| 1991 |
-
if($choices_checked=='true')
|
| 1992 |
-
$param['w_choices_checked'][$key]='checked="checked"';
|
| 1993 |
-
else
|
| 1994 |
-
$param['w_choices_checked'][$key]='';
|
| 1995 |
-
}
|
| 1996 |
-
|
| 1997 |
-
$rep='<div id="wdform_field'.$id.'" type="type_paypal_checkbox" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="wd_form_label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_paypal_checkbox" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
|
| 1998 |
-
|
| 1999 |
-
if($param['w_flow']=='hor')
|
| 2000 |
-
{
|
| 2001 |
-
$rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
|
| 2002 |
-
foreach($param['w_choices'] as $key => $choice)
|
| 2003 |
-
{
|
| 2004 |
-
$where ='';
|
| 2005 |
-
$order_by ='';
|
| 2006 |
-
$db_info = '';
|
| 2007 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 2008 |
-
{
|
| 2009 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 2010 |
-
$where = "where='".$w_choices_params[0]."'";
|
| 2011 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 2012 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 2013 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 2014 |
-
}
|
| 2015 |
-
|
| 2016 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="checkbox" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp'.$key.'" value="'.$param['w_choices_price'][$key].'" onclick="set_checked("'.$id.'","'.$key.'","form_id_temp")" '.$param['w_choices_checked'][$key].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div>';
|
| 2017 |
-
}
|
| 2018 |
-
$rep.= '</div>';
|
| 2019 |
-
}
|
| 2020 |
-
else
|
| 2021 |
-
{
|
| 2022 |
-
|
| 2023 |
-
foreach($param['w_choices'] as $key => $choice)
|
| 2024 |
-
{
|
| 2025 |
-
$where ='';
|
| 2026 |
-
$order_by ='';
|
| 2027 |
-
$db_info ='';
|
| 2028 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 2029 |
-
{
|
| 2030 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 2031 |
-
$where = "where='".$w_choices_params[0]."'";
|
| 2032 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 2033 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 2034 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 2035 |
-
}
|
| 2036 |
-
|
| 2037 |
-
$rep.='<div id="'.$id.'_element_tr'.$key.'" style="display: table-row;"><div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="checkbox" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp'.$key.'" value="'.$param['w_choices_price'][$key].'" onclick="set_checked("'.$id.'","'.$key.'","form_id_temp")" '.$param['w_choices_checked'][$key].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div></div>';
|
| 2038 |
-
}
|
| 2039 |
-
|
| 2040 |
-
}
|
| 2041 |
-
$rep.='</div></div>';
|
| 2042 |
-
|
| 2043 |
-
$rep.='<div id="'.$id.'_divform_id_temp">';
|
| 2044 |
-
if($param['w_quantity']=="yes")
|
| 2045 |
-
$rep.='<span id="'.$id.'_element_quantity_spanform_id_temp" style="margin-right: 15px;"><label class="mini_label" id="'.$id.'_element_quantity_label_form_id_temp" style="margin-right: 5px;"><!--repstart-->Quantity<!--repend--></label><input type="text" value="'.$param['w_quantity_value'].'" id="'.$id.'_element_quantityform_id_temp" name="'.$id.'_element_quantityform_id_temp" onkeypress="return check_isnum(event)" onchange="change_value("'.$id.'_element_quantityform_id_temp", this.value)" style="width: 30px; margin: 2px 0px;" disabled/></span>';
|
| 2046 |
-
if($param['w_property'][0])
|
| 2047 |
-
foreach($param['w_property'] as $key => $property)
|
| 2048 |
-
{
|
| 2049 |
-
$rep.='
|
| 2050 |
-
<span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
|
| 2051 |
-
|
| 2052 |
-
<label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
|
| 2053 |
-
<select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;" disabled>';
|
| 2054 |
-
$param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
|
| 2055 |
-
$param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
|
| 2056 |
-
foreach($param['w_property_values'][$key] as $subkey => $property_value)
|
| 2057 |
-
{
|
| 2058 |
-
$rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
|
| 2059 |
-
}
|
| 2060 |
-
$rep.='</select></span>';
|
| 2061 |
-
}
|
| 2062 |
-
|
| 2063 |
-
$rep.='</div></div></div>';
|
| 2064 |
-
break;
|
| 2065 |
-
}
|
| 2066 |
-
case 'type_paypal_radio':
|
| 2067 |
-
{
|
| 2068 |
-
|
| 2069 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_class','w_property','w_property_values','w_quantity','w_quantity_value');
|
| 2070 |
-
$temp=$params;
|
| 2071 |
-
if(strpos($temp, 'w_field_option_pos') > -1)
|
| 2072 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_choices_params', 'w_class','w_property','w_property_values','w_quantity','w_quantity_value');
|
| 2073 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 2074 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_hide_label', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_choices_params', 'w_class','w_property','w_property_values','w_quantity','w_quantity_value');
|
| 2075 |
-
foreach($params_names as $params_name )
|
| 2076 |
-
{
|
| 2077 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2078 |
-
$param[$params_name] = $temp[0];
|
| 2079 |
-
$temp=$temp[1];
|
| 2080 |
-
}
|
| 2081 |
-
|
| 2082 |
-
if($temp)
|
| 2083 |
-
{
|
| 2084 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2085 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2086 |
-
foreach($attrs as $attr)
|
| 2087 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2088 |
-
}
|
| 2089 |
-
if(!isset($param['w_field_option_pos']))
|
| 2090 |
-
$param['w_field_option_pos'] = 'left';
|
| 2091 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 2092 |
-
|
| 2093 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 2094 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 2095 |
-
|
| 2096 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 2097 |
-
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 2098 |
-
|
| 2099 |
-
$param['w_choices_price'] = explode('***',$param['w_choices_price']);
|
| 2100 |
-
|
| 2101 |
-
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 2102 |
-
|
| 2103 |
-
$param['w_property'] = explode('***',$param['w_property']);
|
| 2104 |
-
$param['w_property_values'] = explode('***',$param['w_property_values']);
|
| 2105 |
-
|
| 2106 |
-
if(isset($param['w_choices_params']))
|
| 2107 |
-
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 2108 |
-
|
| 2109 |
-
foreach($param['w_choices_checked'] as $key => $choices_checked )
|
| 2110 |
-
{
|
| 2111 |
-
if($choices_checked=='true')
|
| 2112 |
-
$param['w_choices_checked'][$key]='checked="checked"';
|
| 2113 |
-
else
|
| 2114 |
-
$param['w_choices_checked'][$key]='';
|
| 2115 |
-
}
|
| 2116 |
-
|
| 2117 |
-
$rep='<div id="wdform_field'.$id.'" type="type_paypal_radio" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="wd_form_label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_paypal_radio" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
|
| 2118 |
-
|
| 2119 |
-
if($param['w_flow']=='hor')
|
| 2120 |
-
{
|
| 2121 |
-
$rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
|
| 2122 |
-
foreach($param['w_choices'] as $key => $choice)
|
| 2123 |
-
{
|
| 2124 |
-
$where ='';
|
| 2125 |
-
$order_by ='';
|
| 2126 |
-
$db_info ='';
|
| 2127 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 2128 |
-
{
|
| 2129 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 2130 |
-
$where = "where='".$w_choices_params[0]."'";
|
| 2131 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 2132 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 2133 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 2134 |
-
}
|
| 2135 |
-
|
| 2136 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default("'.$id.'","'.$key.'","form_id_temp")" '.$param['w_choices_checked'][$key].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div>';
|
| 2137 |
-
}
|
| 2138 |
-
$rep.= '</div>';
|
| 2139 |
-
}
|
| 2140 |
-
else
|
| 2141 |
-
{
|
| 2142 |
-
|
| 2143 |
-
foreach($param['w_choices'] as $key => $choice)
|
| 2144 |
-
{
|
| 2145 |
-
|
| 2146 |
-
$where ='';
|
| 2147 |
-
$order_by ='';
|
| 2148 |
-
$db_info ='';
|
| 2149 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 2150 |
-
{
|
| 2151 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 2152 |
-
$where = "where='".$w_choices_params[0]."'";
|
| 2153 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 2154 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 2155 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 2156 |
-
}
|
| 2157 |
-
|
| 2158 |
-
$rep.='<div id="'.$id.'_element_tr'.$key.'" style="display: table-row;"><div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default("'.$id.'","'.$key.'","form_id_temp")" '.$param['w_choices_checked'][$key].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div></div>';
|
| 2159 |
-
}
|
| 2160 |
-
|
| 2161 |
-
}
|
| 2162 |
-
$rep.='</div></div>';
|
| 2163 |
-
|
| 2164 |
-
$rep.='<div id="'.$id.'_divform_id_temp">';
|
| 2165 |
-
if($param['w_quantity']=="yes")
|
| 2166 |
-
$rep.='<span id="'.$id.'_element_quantity_spanform_id_temp" style="margin-right: 15px;"><label class="mini_label" id="'.$id.'_element_quantity_label_form_id_temp" style="margin-right: 5px;"><!--repstart-->Quantity<!--repend--></label><input type="text" value="'.$param['w_quantity_value'].'" id="'.$id.'_element_quantityform_id_temp" name="'.$id.'_element_quantityform_id_temp" onkeypress="return check_isnum(event)" onchange="change_value("'.$id.'_element_quantityform_id_temp", this.value)" style="width: 30px; margin: 2px 0px;" disabled/></span>';
|
| 2167 |
-
if($param['w_property'][0])
|
| 2168 |
-
foreach($param['w_property'] as $key => $property)
|
| 2169 |
-
{
|
| 2170 |
-
$rep.='
|
| 2171 |
-
<span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
|
| 2172 |
-
|
| 2173 |
-
<label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
|
| 2174 |
-
<select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;" disabled>';
|
| 2175 |
-
$param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
|
| 2176 |
-
$param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
|
| 2177 |
-
foreach($param['w_property_values'][$key] as $subkey => $property_value)
|
| 2178 |
-
{
|
| 2179 |
-
$rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
|
| 2180 |
-
}
|
| 2181 |
-
$rep.='</select></span>';
|
| 2182 |
-
}
|
| 2183 |
-
|
| 2184 |
-
$rep.='</div></div></div>';
|
| 2185 |
-
|
| 2186 |
-
break;
|
| 2187 |
-
}
|
| 2188 |
-
case 'type_paypal_shipping':
|
| 2189 |
-
{
|
| 2190 |
-
|
| 2191 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_class');
|
| 2192 |
-
$temp=$params;
|
| 2193 |
-
|
| 2194 |
-
if(strpos($temp, 'w_field_option_pos') > -1)
|
| 2195 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_choices_params','w_class');
|
| 2196 |
-
|
| 2197 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 2198 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_hide_label', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_choices_params','w_class');
|
| 2199 |
-
|
| 2200 |
-
foreach($params_names as $params_name )
|
| 2201 |
-
{
|
| 2202 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2203 |
-
$param[$params_name] = $temp[0];
|
| 2204 |
-
$temp=$temp[1];
|
| 2205 |
-
}
|
| 2206 |
-
|
| 2207 |
-
if($temp)
|
| 2208 |
-
{
|
| 2209 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2210 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2211 |
-
foreach($attrs as $attr)
|
| 2212 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2213 |
-
}
|
| 2214 |
-
if(!isset($param['w_field_option_pos']))
|
| 2215 |
-
$param['w_field_option_pos'] = 'left';
|
| 2216 |
-
|
| 2217 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 2218 |
-
|
| 2219 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 2220 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 2221 |
-
|
| 2222 |
-
|
| 2223 |
-
|
| 2224 |
-
|
| 2225 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 2226 |
-
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 2227 |
-
|
| 2228 |
-
$param['w_choices_price'] = explode('***',$param['w_choices_price']);
|
| 2229 |
-
|
| 2230 |
-
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 2231 |
-
|
| 2232 |
-
if(isset($param['w_choices_params']))
|
| 2233 |
-
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 2234 |
-
|
| 2235 |
-
foreach($param['w_choices_checked'] as $key => $choices_checked )
|
| 2236 |
-
{
|
| 2237 |
-
if($choices_checked=='true')
|
| 2238 |
-
$param['w_choices_checked'][$key]='checked="checked"';
|
| 2239 |
-
else
|
| 2240 |
-
$param['w_choices_checked'][$key]='';
|
| 2241 |
-
}
|
| 2242 |
-
|
| 2243 |
-
$rep='<div id="wdform_field'.$id.'" type="type_paypal_shipping" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="wd_form_label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; vertical-align:top;"><input type="hidden" value="type_paypal_shipping" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
|
| 2244 |
-
|
| 2245 |
-
if($param['w_flow']=='hor')
|
| 2246 |
-
{
|
| 2247 |
-
$rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
|
| 2248 |
-
foreach($param['w_choices'] as $key => $choice)
|
| 2249 |
-
{
|
| 2250 |
-
$where ='';
|
| 2251 |
-
$order_by ='';
|
| 2252 |
-
$db_info ='';
|
| 2253 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 2254 |
-
{
|
| 2255 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 2256 |
-
$where = "where='".$w_choices_params[0]."'";
|
| 2257 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 2258 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 2259 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 2260 |
-
}
|
| 2261 |
-
|
| 2262 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default("'.$id.'","'.$key.'","form_id_temp")" '.$param['w_choices_checked'][$key].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div>';
|
| 2263 |
-
}
|
| 2264 |
-
$rep.= '</div>';
|
| 2265 |
-
}
|
| 2266 |
-
else
|
| 2267 |
-
{
|
| 2268 |
-
|
| 2269 |
-
foreach($param['w_choices'] as $key => $choice)
|
| 2270 |
-
{
|
| 2271 |
-
$where ='';
|
| 2272 |
-
$order_by ='';
|
| 2273 |
-
$db_info ='';
|
| 2274 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 2275 |
-
{
|
| 2276 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 2277 |
-
$where = "where='".$w_choices_params[0]."'";
|
| 2278 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 2279 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 2280 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 2281 |
-
}
|
| 2282 |
-
|
| 2283 |
-
$rep.='<div id="'.$id.'_element_tr'.$key.'" style="display: table-row;"><div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default("'.$id.'","'.$key.'","form_id_temp")" '.$param['w_choices_checked'][$key].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div></div>';
|
| 2284 |
-
}
|
| 2285 |
-
|
| 2286 |
-
}
|
| 2287 |
-
$rep.='</div></div>';
|
| 2288 |
-
|
| 2289 |
-
$rep.='</div></div>';
|
| 2290 |
-
|
| 2291 |
-
break;
|
| 2292 |
-
}
|
| 2293 |
-
case 'type_paypal_total':
|
| 2294 |
-
{
|
| 2295 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_class');
|
| 2296 |
-
$temp=$params;
|
| 2297 |
-
if(strpos($temp, 'w_size') > -1)
|
| 2298 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_class', 'w_size');
|
| 2299 |
-
|
| 2300 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 2301 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_class', 'w_size');
|
| 2302 |
-
|
| 2303 |
-
foreach($params_names as $params_name )
|
| 2304 |
-
{
|
| 2305 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2306 |
-
$param[$params_name] = $temp[0];
|
| 2307 |
-
$temp=$temp[1];
|
| 2308 |
-
}
|
| 2309 |
-
|
| 2310 |
-
if($temp)
|
| 2311 |
-
{
|
| 2312 |
-
$temp = explode('*:*w_attr_name*:*',$temp);
|
| 2313 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2314 |
-
foreach($attrs as $attr)
|
| 2315 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2316 |
-
}
|
| 2317 |
-
|
| 2318 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 2319 |
-
|
| 2320 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 2321 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 2322 |
-
$param['w_size'] = isset($param['w_size']) ? $param['w_size'] : '300';
|
| 2323 |
-
|
| 2324 |
-
$rep='<div id="wdform_field'.$id.'" type="type_paypal_total" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_paypal_total" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><div id="'.$id.'paypal_totalform_id_temp" class="wdform_paypal_total paypal_totalform_id_temp" style="width:'.$param['w_size'].'px;"><input type="hidden" value="" name="'.$id.'_paypal_totalform_id_temp" class="input_paypal_totalform_id_temp"><div id="'.$id.'div_totalform_id_temp" class="div_totalform_id_temp" style="margin-bottom: 10px;"><!--repstart-->$300<!--repend--></div><div id="'.$id.'paypal_productsform_id_temp" class="paypal_productsform_id_temp" style="border-spacing: 2px;"><div style="border-spacing: 2px;"><!--repstart-->product 1 $100<!--repend--></div><div style="border-spacing: 2px;"><!--repstart-->product 2 $200<!--repend--></div></div><div id="'.$id.'paypal_taxform_id_temp" class="paypal_taxform_id_temp" style="border-spacing: 2px; margin-top: 7px;"></div></div></div></div>';
|
| 2325 |
-
|
| 2326 |
-
break;
|
| 2327 |
-
}
|
| 2328 |
-
|
| 2329 |
-
|
| 2330 |
-
|
| 2331 |
-
case 'type_stripe': {
|
| 2332 |
-
$params_names=array('w_field_size', 'w_field_label_size','w_field_label_pos','w_class');
|
| 2333 |
-
$temp=$params;
|
| 2334 |
-
foreach($params_names as $params_name )
|
| 2335 |
-
{
|
| 2336 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2337 |
-
$param[$params_name] = $temp[0];
|
| 2338 |
-
$temp=$temp[1];
|
| 2339 |
-
}
|
| 2340 |
-
|
| 2341 |
-
if($temp)
|
| 2342 |
-
{
|
| 2343 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2344 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2345 |
-
foreach($attrs as $attr)
|
| 2346 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2347 |
-
}
|
| 2348 |
-
|
| 2349 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 2350 |
-
$rep='<div id="wdform_field'.$id.'" type="type_stripe" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="display: none;">stripe</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><div id="'.$id.'_elementform_id_temp" style="width:'.$param['w_field_size'].'px; margin:10px; border: 1px solid #000; min-width:80px;text-align:center;"> Stripe Section</div><input type="hidden" id="is_stripe" /><input type="hidden" value="type_stripe" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"></div></div>';
|
| 2351 |
-
|
| 2352 |
-
break;
|
| 2353 |
-
}
|
| 2354 |
-
|
| 2355 |
-
case 'type_star_rating':
|
| 2356 |
-
{
|
| 2357 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_field_label_col','w_star_amount','w_required','w_class');
|
| 2358 |
-
$temp=$params;
|
| 2359 |
-
|
| 2360 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 2361 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_field_label_col','w_star_amount','w_required','w_class');
|
| 2362 |
-
|
| 2363 |
-
foreach($params_names as $params_name )
|
| 2364 |
-
{
|
| 2365 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2366 |
-
$param[$params_name] = $temp[0];
|
| 2367 |
-
$temp=$temp[1];
|
| 2368 |
-
}
|
| 2369 |
-
|
| 2370 |
-
if($temp)
|
| 2371 |
-
{
|
| 2372 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2373 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2374 |
-
foreach($attrs as $attr)
|
| 2375 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2376 |
-
}
|
| 2377 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 2378 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 2379 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 2380 |
-
|
| 2381 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 2382 |
-
|
| 2383 |
-
|
| 2384 |
-
$images = '';
|
| 2385 |
-
for($i=0; $i<$param['w_star_amount']; $i++)
|
| 2386 |
-
{
|
| 2387 |
-
$images .= '<img id="'.$id.'_star_'.$i.'" src="' . WD_FM_URL . '/images/star.png?ver='. WD_FM_VERSION.'" onmouseover="change_src('.$i.','.$id.',"form_id_temp")" onmouseout="reset_src('.$i.','.$id.')" onclick="select_star_rating('.$i.','.$id.', "form_id_temp")">';
|
| 2388 |
-
}
|
| 2389 |
-
|
| 2390 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_star_rating" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_star_rating" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_star_amount'].'" id="'.$id.'_star_amountform_id_temp" name="'.$id.'_star_amountform_id_temp"><input type="hidden" value="'.$param['w_field_label_col'].'" name="'.$id.'_star_colorform_id_temp" id="'.$id.'_star_colorform_id_temp"><div id="'.$id.'_elementform_id_temp" class="wdform_stars" '.$param['attributes'].'>'.$images.'</div></div></div>';
|
| 2391 |
-
|
| 2392 |
-
|
| 2393 |
-
break;
|
| 2394 |
-
}
|
| 2395 |
-
case 'type_scale_rating':
|
| 2396 |
-
{
|
| 2397 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_mini_labels','w_scale_amount','w_required','w_class');
|
| 2398 |
-
$temp=$params;
|
| 2399 |
-
|
| 2400 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 2401 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_mini_labels','w_scale_amount','w_required','w_class');
|
| 2402 |
-
|
| 2403 |
-
foreach($params_names as $params_name )
|
| 2404 |
-
{
|
| 2405 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2406 |
-
$param[$params_name] = $temp[0];
|
| 2407 |
-
$temp=$temp[1];
|
| 2408 |
-
}
|
| 2409 |
-
|
| 2410 |
-
if($temp)
|
| 2411 |
-
{
|
| 2412 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2413 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2414 |
-
foreach($attrs as $attr)
|
| 2415 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2416 |
-
}
|
| 2417 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 2418 |
-
|
| 2419 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 2420 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 2421 |
-
|
| 2422 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 2423 |
-
|
| 2424 |
-
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
| 2425 |
-
|
| 2426 |
-
$numbers = '';
|
| 2427 |
-
for($i=1; $i<=$param['w_scale_amount']; $i++)
|
| 2428 |
-
{
|
| 2429 |
-
$numbers .= '<div id="'.$id.'_scale_td1_'.$i.'form_id_temp" style="text-align: center; display: table-cell;"><span>'.$i.'</span></div>';
|
| 2430 |
-
}
|
| 2431 |
-
|
| 2432 |
-
|
| 2433 |
-
$radio_buttons = '';
|
| 2434 |
-
for($k=1; $k<=$param['w_scale_amount']; $k++)
|
| 2435 |
-
{
|
| 2436 |
-
$radio_buttons .= '<div id="'.$id.'_scale_td2_'.$k.'form_id_temp" style="display: table-cell;"><input id="'.$id.'_scale_radioform_id_temp_'.$k.'" name="'.$id.'_scale_radioform_id_temp" value="'.$k.'" type="radio"></div>';
|
| 2437 |
-
}
|
| 2438 |
-
|
| 2439 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_scale_rating" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; vertical-align: top; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_scale_rating" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_scale_amount'].'" id="'.$id.'_scale_amountform_id_temp" name="'.$id.'_scale_amountform_id_temp"><div id="'.$id.'_elementform_id_temp" style="float: left;" '.$param['attributes'].'><label class="mini_label" id="'.$id.'_mini_label_worst" style="position: relative; top: 6px; font-size: 11px; display: inline-table;">'.$w_mini_labels[0].'</label><div id="'.$id.'_scale_tableform_id_temp" style="display: inline-table;"><div id="'.$id.'_scale_tr1form_id_temp" style="display: table-row;">'.$numbers.'</div><div id="'.$id.'_scale_tr2form_id_temp" style="display: table-row;">'.$radio_buttons.'</div></div><label class="mini_label" id="'.$id.'_mini_label_best" style="position: relative; top: 6px; font-size: 11px; display: inline-table;">'.$w_mini_labels[1].'</label></div></div></div>';
|
| 2440 |
-
|
| 2441 |
-
break;
|
| 2442 |
-
}
|
| 2443 |
-
case 'type_spinner':
|
| 2444 |
-
{
|
| 2445 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_field_width','w_field_min_value','w_field_max_value', 'w_field_step', 'w_field_value', 'w_required','w_class');
|
| 2446 |
-
$temp=$params;
|
| 2447 |
-
|
| 2448 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 2449 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_field_width','w_field_min_value','w_field_max_value', 'w_field_step', 'w_field_value', 'w_required','w_class');
|
| 2450 |
-
|
| 2451 |
-
|
| 2452 |
-
foreach($params_names as $params_name ) {
|
| 2453 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2454 |
-
$param[$params_name] = $temp[0];
|
| 2455 |
-
$temp=$temp[1];
|
| 2456 |
-
}
|
| 2457 |
-
if($temp) {
|
| 2458 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2459 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2460 |
-
foreach($attrs as $attr)
|
| 2461 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2462 |
-
}
|
| 2463 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 2464 |
-
|
| 2465 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 2466 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 2467 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 2468 |
-
|
| 2469 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_spinner" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_spinner" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_field_width'].'" name="'.$id.'_spinner_widthform_id_temp" id="'.$id.'_spinner_widthform_id_temp"><input type="hidden" value="'.$param['w_field_min_value'].'" id="'.$id.'_min_valueform_id_temp" name="'.$id.'_min_valueform_id_temp"><input type="hidden" value="'.$param['w_field_max_value'].'" name="'.$id.'_max_valueform_id_temp" id="'.$id.'_max_valueform_id_temp"><input type="hidden" value="'.$param['w_field_step'].'" name="'.$id.'_stepform_id_temp" id="'.$id.'_stepform_id_temp"><input type="" value="'.($param['w_field_value']!= 'null' ? $param['w_field_value'] : '').'" name="'.$id.'_elementform_id_temp" id="'.$id.'_elementform_id_temp" onkeypress="return check_isnum_or_minus(event)" style="width: '.$param['w_field_width'].'px;" '.$param['attributes'].' disabled/></div></div>';
|
| 2470 |
-
break;
|
| 2471 |
-
}
|
| 2472 |
-
case 'type_slider': {
|
| 2473 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_field_width','w_field_min_value','w_field_max_value', 'w_field_value', 'w_required','w_class');
|
| 2474 |
-
$temp=$params;
|
| 2475 |
-
|
| 2476 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 2477 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_field_width','w_field_min_value','w_field_max_value', 'w_field_value', 'w_required','w_class');
|
| 2478 |
-
|
| 2479 |
-
foreach($params_names as $params_name ) {
|
| 2480 |
-
$temp = explode('*:*'.$params_name.'*:*',$temp);
|
| 2481 |
-
$param[$params_name] = $temp[0];
|
| 2482 |
-
$temp=$temp[1];
|
| 2483 |
-
}
|
| 2484 |
-
if ($temp) {
|
| 2485 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 2486 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2487 |
-
foreach($attrs as $attr) {
|
| 2488 |
-
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
| 2489 |
-
}
|
| 2490 |
-
}
|
| 2491 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 2492 |
-
|
| 2493 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 2494 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 2495 |
-
|
| 2496 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 2497 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_slider" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; vertical-align: top; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_slider" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_field_width'].'" name="'.$id.'_slider_widthform_id_temp" id="'.$id.'_slider_widthform_id_temp"><input type="hidden" value="'.$param['w_field_min_value'].'" id="'.$id.'_slider_min_valueform_id_temp" name="'.$id.'_slider_min_valueform_id_temp"><input type="hidden" value="'.$param['w_field_max_value'].'" id="'.$id.'_slider_max_valueform_id_temp" name="'.$id.'_slider_max_valueform_id_temp"><input type="hidden" value="'.$param['w_field_value'].'" id="'.$id.'_slider_valueform_id_temp" name="'.$id.'_slider_valueform_id_temp"><div id="'.$id.'_slider_tableform_id_temp"><div><div id="'.$id.'_slider_td1form_id_temp"><div name="'.$id.'_elementform_id_temp" id="'.$id.'_elementform_id_temp" style="width: '.$param['w_field_width'].'px;" '.$param['attributes'].'"></div></div></div><div><div align="left" id="'.$id.'_slider_td2form_id_temp" style="display: inline-table; width: 33.3%; text-align: left;"><span id="'.$id.'_element_minform_id_temp" class="label">'.$param['w_field_min_value'].'</span></div><div align="right" id="'.$id.'_slider_td3form_id_temp" style="display: inline-table; width: 33.3%; text-align: center;"><span id="'.$id.'_element_valueform_id_temp" class="label">'.$param['w_field_value'].'</span></div><div align="right" id="'.$id.'_slider_td4form_id_temp" style="display: inline-table; width: 33.3%; text-align: right;"><span id="'.$id.'_element_maxform_id_temp" class="label">'.$param['w_field_max_value'].'</span></div></div></div></div></div>';
|
| 2498 |
-
break;
|
| 2499 |
-
}
|
| 2500 |
-
case 'type_range': {
|
| 2501 |
-
$params_names = array('w_field_label_size','w_field_label_pos','w_field_range_width','w_field_range_step','w_field_value1', 'w_field_value2', 'w_mini_labels', 'w_required','w_class');
|
| 2502 |
-
$temp = $params;
|
| 2503 |
-
|
| 2504 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 2505 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_field_range_width','w_field_range_step','w_field_value1', 'w_field_value2', 'w_mini_labels', 'w_required','w_class');
|
| 2506 |
-
|
| 2507 |
-
foreach ($params_names as $params_name ) {
|
| 2508 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 2509 |
-
$param[$params_name] = $temp[0];
|
| 2510 |
-
$temp = $temp[1];
|
| 2511 |
-
}
|
| 2512 |
-
if ($temp) {
|
| 2513 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 2514 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 2515 |
-
foreach($attrs as $attr) {
|
| 2516 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2517 |
-
}
|
| 2518 |
-
}
|
| 2519 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 2520 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 2521 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 2522 |
-
|
| 2523 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 2524 |
-
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
| 2525 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_range" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_range" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_field_range_width'].'" name="'.$id.'_range_widthform_id_temp" id="'.$id.'_range_widthform_id_temp"><input type="hidden" value="'.$param['w_field_range_step'].'" name="'.$id.'_range_stepform_id_temp" id="'.$id.'_range_stepform_id_temp"><div id="'.$id.'_elemet_table_littleform_id_temp" style="display: table;"><div style="display: table-row;"><div valign="middle" align="left" style="display: table-cell;"><input type="" value="'.($param['w_field_value1']!= 'null' ? $param['w_field_value1'] : '').'" name="'.$id.'_elementform_id_temp0" id="'.$id.'_elementform_id_temp0" onkeypress="return check_isnum_or_minus(event)" style="width: '.$param['w_field_range_width'].'px;" '.$param['attributes'].' disabled/></div><div valign="middle" align="left" style="display: table-cell; padding-left: 4px;"><input type="" value="'.($param['w_field_value2']!= 'null' ? $param['w_field_value2'] : '').'" name="'.$id.'_elementform_id_temp1" id="'.$id.'_elementform_id_temp1" onkeypress="return check_isnum_or_minus(event)" style="width: '.$param['w_field_range_width'].'px;" '.$param['attributes'].' disabled/></div></div><div style="display: table-row;"><div valign="top" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_from">'.$w_mini_labels[0].'</label></div><div valign="top" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_to">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
|
| 2526 |
-
break;
|
| 2527 |
-
}
|
| 2528 |
-
case 'type_grading': {
|
| 2529 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_items', 'w_total', 'w_required', 'w_class');
|
| 2530 |
-
$temp = $params;
|
| 2531 |
-
|
| 2532 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 2533 |
-
$params_names=array('w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_items', 'w_total', 'w_required', 'w_class');
|
| 2534 |
-
|
| 2535 |
-
|
| 2536 |
-
foreach($params_names as $params_name) {
|
| 2537 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 2538 |
-
$param[$params_name] = $temp[0];
|
| 2539 |
-
$temp = $temp[1];
|
| 2540 |
-
}
|
| 2541 |
-
if ($temp) {
|
| 2542 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 2543 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 2544 |
-
foreach ($attrs as $attr) {
|
| 2545 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2546 |
-
}
|
| 2547 |
-
}
|
| 2548 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
| 2549 |
-
|
| 2550 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 2551 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 2552 |
-
|
| 2553 |
-
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
| 2554 |
-
$w_items = explode('***', $param['w_items']);
|
| 2555 |
-
$grading_items = '';
|
| 2556 |
-
for($i=0; $i<count($w_items); $i++)
|
| 2557 |
-
{
|
| 2558 |
-
$grading_items .= '<div id="'.$id.'_element_div'.$i.'" class="grading"><input id="'.$id.'_elementform_id_temp_'.$i.'" name="'.$id.'_elementform_id_temp_'.$i.'" onkeypress="return check_isnum_or_minus(event)" value="" size="5" onkeyup="sum_grading_values('.$id.',"form_id_temp")" onchange="sum_grading_values('.$id.',"form_id_temp")" '.$param['attributes'].' disabled/><label id="'.$id.'_label_elementform_id_temp'.$i.'" class="ch-rad-label">'.$w_items[$i].'</label></div>';
|
| 2559 |
-
}
|
| 2560 |
-
|
| 2561 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_grading" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; vertical-align: top; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_grading" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_total'].'" name="'.$id.'_grading_totalform_id_temp" id="'.$id.'_grading_totalform_id_temp"><div id="'.$id.'_elementform_id_temp">'.$grading_items.'<div id="'.$id.'_element_total_divform_id_temp" class="grading_div">Total:<span id="'.$id.'_sum_elementform_id_temp" name="'.$id.'_sum_elementform_id_temp">0</span>/<span id="'.$id.'_total_elementform_id_temp" name="'.$id.'_total_elementform_id_temp">'.$param['w_total'].'</span><span id="'.$id.'_text_elementform_id_temp" name="'.$id.'_text_elementform_id_temp"></span></div></div></div></div>';
|
| 2562 |
-
|
| 2563 |
-
break;
|
| 2564 |
-
}
|
| 2565 |
-
case 'type_matrix': {
|
| 2566 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_input_type', 'w_rows', 'w_columns', 'w_required','w_class','w_textbox_size');
|
| 2567 |
-
$temp = $params;
|
| 2568 |
-
|
| 2569 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
| 2570 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_field_input_type', 'w_rows', 'w_columns', 'w_required','w_class','w_textbox_size');
|
| 2571 |
-
|
| 2572 |
-
|
| 2573 |
-
foreach ($params_names as $params_name) {
|
| 2574 |
-
$temp = explode('*:*'.$params_name.'*:*',$temp);
|
| 2575 |
-
$param[$params_name] = $temp[0];
|
| 2576 |
-
$temp = $temp[1];
|
| 2577 |
-
}
|
| 2578 |
-
if ($temp) {
|
| 2579 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 2580 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 2581 |
-
foreach ($attrs as $attr) {
|
| 2582 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2583 |
-
}
|
| 2584 |
-
}
|
| 2585 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 2586 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 2587 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 2588 |
-
|
| 2589 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 2590 |
-
$param['w_textbox_size'] = isset($param['w_textbox_size']) ? $param['w_textbox_size'] : '100';
|
| 2591 |
-
$w_rows = explode('***',$param['w_rows']);
|
| 2592 |
-
$w_columns = explode('***',$param['w_columns']);
|
| 2593 |
-
$column_labels = '';
|
| 2594 |
-
for ($i = 1; $i < count($w_columns); $i++) {
|
| 2595 |
-
$column_labels .= '<div id="'.$id.'_element_td0_'.$i.'" class="matrix_" style="display: table-cell;"><label id="'.$id.'_label_elementform_id_temp0_'.$i.'" name="'.$id.'_label_elementform_id_temp0_'.$i.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$i.'" value="'.$w_columns[$i].'">'.$w_columns[$i].'</label></div>';
|
| 2596 |
-
}
|
| 2597 |
-
$rows_columns = '';
|
| 2598 |
-
for($i=1; $i<count($w_rows); $i++)
|
| 2599 |
-
{
|
| 2600 |
-
|
| 2601 |
-
$rows_columns .= '<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;"><div id="'.$id.'_element_td'.$i.'_0" class="matrix_" style="display: table-cell;"><label id="'.$id.'_label_elementform_id_temp'.$i.'_0" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$i.'" value="'.$w_rows[$i].'">'.$w_rows[$i].'</label></div>';
|
| 2602 |
-
|
| 2603 |
-
|
| 2604 |
-
for($k=1; $k<count($w_columns); $k++)
|
| 2605 |
-
{
|
| 2606 |
-
if($param['w_field_input_type']=='radio')
|
| 2607 |
-
$rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" align="center" size="14" type="radio" name="'.$id.'_input_elementform_id_temp'.$i.'" value="'.$i.'_'.$k.'" disabled/></div>';
|
| 2608 |
-
else
|
| 2609 |
-
if($param['w_field_input_type']=='checkbox')
|
| 2610 |
-
$rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" align="center" size="14" type="checkbox" name="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" value="1" disabled/></div>';
|
| 2611 |
-
else
|
| 2612 |
-
if($param['w_field_input_type']=='text')
|
| 2613 |
-
$rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" align="center" type="text" name="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" value="" style="width:'.$param['w_textbox_size'].'px" disabled/></div>';
|
| 2614 |
-
else
|
| 2615 |
-
if($param['w_field_input_type']=='select')
|
| 2616 |
-
$rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><select id="'.$id.'_select_yes_noform_id_temp'.$i.'_'.$k.'" name="'.$id.'_select_yes_noform_id_temp'.$i.'_'.$k.'" disabled><option value=""> </option><option value="yes">Yes</option><option value="no">No</option></select></div>';
|
| 2617 |
-
|
| 2618 |
-
}
|
| 2619 |
-
|
| 2620 |
-
$rows_columns .= '</div>';
|
| 2621 |
-
}
|
| 2622 |
-
|
| 2623 |
-
|
| 2624 |
-
|
| 2625 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_matrix" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_matrix" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_field_input_type'].'" name="'.$id.'_input_typeform_id_temp" id="'.$id.'_input_typeform_id_temp"><input type="hidden" value="'.$param['w_textbox_size'].'" name="'.$id.'_textbox_sizeform_id_temp" id="'.$id.'_textbox_sizeform_id_temp"><div id="'.$id.'_elementform_id_temp" style="display: table;" '.$param['attributes'].'><div id="'.$id.'_table_little" style="display: table-row-group;"><div id="'.$id.'_element_tr0" style="display: table-row;"><div id="'.$id.'_element_td0_0" style="display: table-cell;"></div>'.$column_labels.'</div>'.$rows_columns.'</div></div></div></div>';
|
| 2626 |
-
|
| 2627 |
-
break;
|
| 2628 |
-
}
|
| 2629 |
-
case 'type_submit_reset': {
|
| 2630 |
-
$params_names=array('w_submit_title','w_reset_title','w_class','w_act');
|
| 2631 |
-
$temp=$params;
|
| 2632 |
-
foreach ($params_names as $params_name) {
|
| 2633 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2634 |
-
$param[$params_name] = $temp[0];
|
| 2635 |
-
$temp=$temp[1];
|
| 2636 |
-
}
|
| 2637 |
-
if ($temp) {
|
| 2638 |
-
$temp = explode('*:*w_attr_name*:*',$temp);
|
| 2639 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2640 |
-
foreach ($attrs as $attr) {
|
| 2641 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2642 |
-
}
|
| 2643 |
-
}
|
| 2644 |
-
$param['w_act'] = ($param['w_act']=="false" ? 'style="display: none;"' : "");
|
| 2645 |
-
$rep='<div id="wdform_field'.$id.'" type="type_submit_reset" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">type_submit_reset_'.$id.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><input type="hidden" value="type_submit_reset" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><button type="button" class="button-submit" id="'.$id.'_element_submitform_id_temp" value="'.$param['w_submit_title'].'" disabled '.$param['attributes'].'>'.$param['w_submit_title'].'</button><button type="button" class="button-reset" id="'.$id.'_element_resetform_id_temp" value="'.$param['w_reset_title'].'" disabled '.$param['w_act'].' '.$param['attributes'].'>'.$param['w_reset_title'].'</button></div></div>';
|
| 2646 |
-
break;
|
| 2647 |
-
}
|
| 2648 |
-
case 'type_button': {
|
| 2649 |
-
$params_names=array('w_title','w_func','w_class');
|
| 2650 |
-
$temp=$params;
|
| 2651 |
-
foreach($params_names as $params_name) {
|
| 2652 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2653 |
-
$param[$params_name] = $temp[0];
|
| 2654 |
-
$temp=$temp[1];
|
| 2655 |
-
}
|
| 2656 |
-
if ($temp) {
|
| 2657 |
-
$temp = explode('*:*w_attr_name*:*',$temp);
|
| 2658 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2659 |
-
foreach($attrs as $attr) {
|
| 2660 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2661 |
-
}
|
| 2662 |
-
}
|
| 2663 |
-
$param['w_title'] = explode('***',$param['w_title']);
|
| 2664 |
-
$param['w_func'] = explode('***',$param['w_func']);
|
| 2665 |
-
$rep.='<div id="wdform_field'.$id.'" type="type_button" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">button_'.$id.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><input type="hidden" value="type_button" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp">';
|
| 2666 |
-
foreach ($param['w_title'] as $key => $title) {
|
| 2667 |
-
$rep.='<button type="button" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp'.$key.'" value="'.$title.'" onclick="'.$param['w_func'][$key].'" '.$param['attributes'].'>'.$title.'</button>';
|
| 2668 |
-
}
|
| 2669 |
-
$rep .= '</div></div>';
|
| 2670 |
-
break;
|
| 2671 |
-
}
|
| 2672 |
-
}
|
| 2673 |
-
|
| 2674 |
-
$form = str_replace('%' . $id . ' - ' . $labels[$ids_key] . '%', $rep, $form);
|
| 2675 |
-
$form = str_replace('%' . $id . ' -' . $labels[$ids_key] . '%', $rep, $form);
|
| 2676 |
-
$row->form_front = $form;
|
| 2677 |
-
}
|
| 2678 |
-
}
|
| 2679 |
-
}
|
| 2680 |
-
else {
|
| 2681 |
-
$row = new stdClass();
|
| 2682 |
-
$row->id = 0;
|
| 2683 |
-
$row->backup_id ='';
|
| 2684 |
-
$row->title = '';
|
| 2685 |
-
$row->mail = '';
|
| 2686 |
-
$row->form = '';
|
| 2687 |
-
$row->form_front = '';
|
| 2688 |
-
$row->theme = $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'");
|
| 2689 |
-
$row->javascript = '';
|
| 2690 |
-
$row->submit_text = '';
|
| 2691 |
-
$row->url = '';
|
| 2692 |
-
$row->submit_text_type = 0;
|
| 2693 |
-
$row->script1 = '';
|
| 2694 |
-
$row->script2 = '';
|
| 2695 |
-
$row->script_user1 = '';
|
| 2696 |
-
$row->script_user2 = '';
|
| 2697 |
-
$row->counter = 0;
|
| 2698 |
-
$row->label_order = '';
|
| 2699 |
-
$row->article_id = '';
|
| 2700 |
-
$row->pagination = '';
|
| 2701 |
-
$row->show_title = '';
|
| 2702 |
-
$row->show_numbers = '';
|
| 2703 |
-
$row->public_key = '';
|
| 2704 |
-
$row->private_key = '';
|
| 2705 |
-
$row->recaptcha_theme = '';
|
| 2706 |
-
$row->from_name = '';
|
| 2707 |
-
$row->from_mail = '';
|
| 2708 |
-
$row->label_order_current = '';
|
| 2709 |
-
$row->script_mail_user = '';
|
| 2710 |
-
$row->script_mail = '';
|
| 2711 |
-
$row->tax = 0;
|
| 2712 |
-
$row->payment_currency = '$';
|
| 2713 |
-
$row->paypal_email = '';
|
| 2714 |
-
$row->checkout_mode = 'testmode';
|
| 2715 |
-
$row->paypal_mode = 0;
|
| 2716 |
-
|
| 2717 |
-
$row->published = 1;
|
| 2718 |
-
$row->form_fields = '';
|
| 2719 |
-
$row->savedb = 1;
|
| 2720 |
-
$row->sendemail = 1;
|
| 2721 |
-
$row->requiredmark = '*';
|
| 2722 |
-
$row->reply_to = 0;
|
| 2723 |
-
$row->send_to = 0;
|
| 2724 |
-
$row->autogen_layout = 1;
|
| 2725 |
-
$row->custom_front = '';
|
| 2726 |
-
$row->mail_from_user = '';
|
| 2727 |
-
$row->mail_from_name_user = '';
|
| 2728 |
-
$row->reply_to_user = '';
|
| 2729 |
-
$row->save_uploads = 1;
|
| 2730 |
-
|
| 2731 |
-
$row->header_title = '';
|
| 2732 |
-
$row->header_description = '';
|
| 2733 |
-
$row->header_image_url = '';
|
| 2734 |
-
$row->header_image_animation = '';
|
| 2735 |
-
$row->header_hide_image = '';
|
| 2736 |
-
|
| 2737 |
-
$row->condition = '';
|
| 2738 |
-
$row->mail_cc = '';
|
| 2739 |
-
$row->mail_cc_user = '';
|
| 2740 |
-
$row->mail_bcc = '';
|
| 2741 |
-
$row->mail_bcc_user = '';
|
| 2742 |
-
$row->mail_subject = '';
|
| 2743 |
-
$row->mail_subject_user = '';
|
| 2744 |
-
$row->mail_mode = 1;
|
| 2745 |
-
$row->mail_mode_user = 1;
|
| 2746 |
-
$row->mail_attachment = 1;
|
| 2747 |
-
$row->mail_attachment_user = 1;
|
| 2748 |
-
|
| 2749 |
-
$row->user_id_wd = '';
|
| 2750 |
-
$row->sortable = 1;
|
| 2751 |
-
$row->frontend_submit_fields = '';
|
| 2752 |
-
$row->frontend_submit_stat_fields = '';
|
| 2753 |
-
}
|
| 2754 |
-
return $row;
|
| 2755 |
-
}
|
| 2756 |
-
|
| 2757 |
-
public function get_theme_rows_data($old = '') {
|
| 2758 |
-
global $wpdb;
|
| 2759 |
-
$rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_themes ORDER BY `version` DESC, `id` ASC");
|
| 2760 |
-
return $rows;
|
| 2761 |
-
}
|
| 2762 |
-
|
| 2763 |
-
public function get_queries_rows_data($id) {
|
| 2764 |
-
global $wpdb;
|
| 2765 |
-
$rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_query WHERE form_id=" . $id . " ORDER BY id ASC");
|
| 2766 |
-
return $rows;
|
| 2767 |
-
}
|
| 2768 |
-
|
| 2769 |
-
public function get_labels($id) {
|
| 2770 |
-
global $wpdb;
|
| 2771 |
-
$rows = $wpdb->get_col("SELECT DISTINCT `element_label` FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id=" . $id);
|
| 2772 |
-
return $rows;
|
| 2773 |
-
}
|
| 2774 |
-
|
| 2775 |
-
public function is_paypal($id) {
|
| 2776 |
-
global $wpdb;
|
| 2777 |
-
$rows = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_sessions WHERE form_id=" . $id);
|
| 2778 |
-
return $rows;
|
| 2779 |
-
}
|
| 2780 |
-
|
| 2781 |
-
public function page_nav() {
|
| 2782 |
-
global $wpdb;
|
| 2783 |
-
$where = 'WHERE `id` NOT IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')';
|
| 2784 |
-
$where .= ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? ' AND title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
|
| 2785 |
-
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker " . $where;
|
| 2786 |
-
$total = $wpdb->get_var($query);
|
| 2787 |
-
$page_nav['total'] = $total;
|
| 2788 |
-
if (isset($_POST['page_number']) && $_POST['page_number']) {
|
| 2789 |
-
$limit = ((int) $_POST['page_number'] - 1) * 20;
|
| 2790 |
-
}
|
| 2791 |
-
else {
|
| 2792 |
-
$limit = 0;
|
| 2793 |
-
}
|
| 2794 |
-
$page_nav['limit'] = (int) ($limit / 20 + 1);
|
| 2795 |
-
return $page_nav;
|
| 2796 |
-
}
|
| 2797 |
-
|
| 2798 |
-
public function get_display_options($id) {
|
| 2799 |
-
global $wpdb;
|
| 2800 |
-
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_display_options WHERE form_id="%d"', $id));
|
| 2801 |
-
if (!$row) {
|
| 2802 |
-
$row = new stdClass();
|
| 2803 |
-
$row->form_id = $id;
|
| 2804 |
-
$row->type = 'embedded';
|
| 2805 |
-
$row->scrollbox_loading_delay = 0;
|
| 2806 |
-
$row->popover_animate_effect = '';
|
| 2807 |
-
$row->popover_loading_delay = 0;
|
| 2808 |
-
$row->popover_frequency = 0;
|
| 2809 |
-
$row->topbar_position = 1;
|
| 2810 |
-
$row->topbar_remain_top = 1;
|
| 2811 |
-
$row->topbar_closing = 1;
|
| 2812 |
-
$row->topbar_hide_duration = 0;
|
| 2813 |
-
$row->scrollbox_position = 1;
|
| 2814 |
-
$row->scrollbox_trigger_point = 20;
|
| 2815 |
-
$row->scrollbox_hide_duration = 0;
|
| 2816 |
-
$row->scrollbox_auto_hide = 1;
|
| 2817 |
-
$row->hide_mobile = 0;
|
| 2818 |
-
$row->scrollbox_closing = 1;
|
| 2819 |
-
$row->scrollbox_minimize = 1;
|
| 2820 |
-
$row->scrollbox_minimize_text = '';
|
| 2821 |
-
$row->display_on = 'everything';
|
| 2822 |
-
$row->posts_include = '';
|
| 2823 |
-
$row->pages_include = '';
|
| 2824 |
-
$row->display_on_categories = '';
|
| 2825 |
-
$row->current_categories = '';
|
| 2826 |
-
$row->show_for_admin = 0;
|
| 2827 |
-
}
|
| 2828 |
-
return $row;
|
| 2829 |
-
}
|
| 2830 |
-
|
| 2831 |
-
public function fm_posts_query() {
|
| 2832 |
-
$default_post_types = array( 'post', 'page' );
|
| 2833 |
-
$custom_post_types = get_post_types( array(
|
| 2834 |
-
'public' => true,
|
| 2835 |
-
'_builtin' => false,
|
| 2836 |
-
) );
|
| 2837 |
-
|
| 2838 |
-
$post_types = array_merge($default_post_types, $custom_post_types);
|
| 2839 |
-
$pt_names = array_values($post_types);
|
| 2840 |
-
|
| 2841 |
-
$query = array(
|
| 2842 |
-
'post_type' => $pt_names,
|
| 2843 |
-
'suppress_filters' => true,
|
| 2844 |
-
'update_post_term_cache' => false,
|
| 2845 |
-
'update_post_meta_cache' => false,
|
| 2846 |
-
'post_status' => 'publish',
|
| 2847 |
-
'posts_per_page' => -1,
|
| 2848 |
-
);
|
| 2849 |
-
|
| 2850 |
-
$get_posts = new WP_Query;
|
| 2851 |
-
$posts = $get_posts->query( $query );
|
| 2852 |
-
if ( ! $get_posts->post_count ) {
|
| 2853 |
-
return false;
|
| 2854 |
-
}
|
| 2855 |
-
|
| 2856 |
-
$results = array();
|
| 2857 |
-
foreach ($posts as $post) {
|
| 2858 |
-
$results[(int)$post->ID] = array(
|
| 2859 |
-
'title' => trim( esc_html( strip_tags( get_the_title( $post ) ) ) ),
|
| 2860 |
-
'post_type' => $post->post_type,
|
| 2861 |
-
);
|
| 2862 |
-
}
|
| 2863 |
-
|
| 2864 |
-
wp_reset_postdata();
|
| 2865 |
-
return $results;
|
| 2866 |
-
}
|
| 2867 |
-
|
| 2868 |
-
public function fm_categories_query() {
|
| 2869 |
-
$categories = get_categories( array(
|
| 2870 |
-
'hide_empty' => 0,
|
| 2871 |
-
) );
|
| 2872 |
-
$final_categories = array();
|
| 2873 |
-
foreach ( $categories as $key => $value ) {
|
| 2874 |
-
$final_categories[$value->term_id] = $value->name;
|
| 2875 |
-
}
|
| 2876 |
-
return $final_categories;
|
| 2877 |
-
}
|
| 2878 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 2879 |
-
// Getters & Setters //
|
| 2880 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 2881 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 2882 |
-
// Private Methods //
|
| 2883 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 2884 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 2885 |
-
// Listeners //
|
| 2886 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 2887 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMModelManage_fm {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
public function get_rows_data() {
|
| 22 |
+
global $wpdb;
|
| 23 |
+
$where = 'WHERE `id` NOT IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')';
|
| 24 |
+
$where .= ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? ' AND title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
|
| 25 |
+
$asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
|
| 26 |
+
$order_by_array = array('id', 'title', 'mail');
|
| 27 |
+
$order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
|
| 28 |
+
$order_by = ' ORDER BY `' . $order_by . '` ' . $asc_or_desc;
|
| 29 |
+
if (isset($_POST['page_number']) && $_POST['page_number']) {
|
| 30 |
+
$limit = ((int)$_POST['page_number'] - 1) * 20;
|
| 31 |
+
}
|
| 32 |
+
else {
|
| 33 |
+
$limit = 0;
|
| 34 |
+
}
|
| 35 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker " . $where . $order_by . " LIMIT " . $limit . ",20";
|
| 36 |
+
$rows = $wpdb->get_results($query);
|
| 37 |
+
return $rows;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
public function get_row_data($id) {
|
| 41 |
+
global $wpdb;
|
| 42 |
+
if ($id != 0) {
|
| 43 |
+
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
|
| 44 |
+
}
|
| 45 |
+
else {
|
| 46 |
+
$row = new stdClass();
|
| 47 |
+
$row->id = 0;
|
| 48 |
+
$row->title = '';
|
| 49 |
+
$row->mail = '';
|
| 50 |
+
$row->form = '';
|
| 51 |
+
$row->form_front = '';
|
| 52 |
+
$row->theme = 0;
|
| 53 |
+
$row->javascript = '';
|
| 54 |
+
$row->submit_text = '';
|
| 55 |
+
$row->url = '';
|
| 56 |
+
$row->submit_text_type = 0;
|
| 57 |
+
$row->script1 = '';
|
| 58 |
+
$row->script2 = '';
|
| 59 |
+
$row->script_user1 = '';
|
| 60 |
+
$row->script_user2 = '';
|
| 61 |
+
$row->counter = 0;
|
| 62 |
+
$row->label_order = '';
|
| 63 |
+
$row->article_id = '';
|
| 64 |
+
$row->pagination = '';
|
| 65 |
+
$row->show_title = '';
|
| 66 |
+
$row->show_numbers = '';
|
| 67 |
+
$row->public_key = '';
|
| 68 |
+
$row->private_key = '';
|
| 69 |
+
$row->recaptcha_theme = '';
|
| 70 |
+
$row->from_name = '';
|
| 71 |
+
$row->from_mail = '';
|
| 72 |
+
$row->label_order_current = '';
|
| 73 |
+
$row->script_mail_user = '';
|
| 74 |
+
$row->script_mail = '';
|
| 75 |
+
$row->tax = 0;
|
| 76 |
+
$row->payment_currency = '$';
|
| 77 |
+
$row->paypal_email = '';
|
| 78 |
+
$row->checkout_mode = 'testmode';
|
| 79 |
+
$row->paypal_mode = 0;
|
| 80 |
+
|
| 81 |
+
$row->published = 1;
|
| 82 |
+
$row->form_fields = '';
|
| 83 |
+
$row->savedb = 1;
|
| 84 |
+
$row->sendemail = 1;
|
| 85 |
+
$row->requiredmark = '*';
|
| 86 |
+
$row->reply_to = 0;
|
| 87 |
+
$row->send_to = 0;
|
| 88 |
+
$row->autogen_layout = 1;
|
| 89 |
+
$row->custom_front = '';
|
| 90 |
+
$row->mail_from_user = '';
|
| 91 |
+
$row->mail_from_name_user = '';
|
| 92 |
+
$row->reply_to_user = '';
|
| 93 |
+
$row->save_uploads = 1;
|
| 94 |
+
$row->header_title = '';
|
| 95 |
+
$row->header_description = '';
|
| 96 |
+
$row->header_image_url = '';
|
| 97 |
+
$row->header_image_animation = '';
|
| 98 |
+
$row->header_hide_image = '';
|
| 99 |
+
}
|
| 100 |
+
return $row;
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
public function get_row_data_new($id) {
|
| 104 |
+
global $wpdb;
|
| 105 |
+
if ($id != 0) {
|
| 106 |
+
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_backup WHERE backup_id="%d"', $id));
|
| 107 |
+
$labels2 = array();
|
| 108 |
+
$label_id = array();
|
| 109 |
+
$label_order_original = array();
|
| 110 |
+
$label_type = array();
|
| 111 |
+
$label_all = explode('#****#', $row->label_order);
|
| 112 |
+
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
| 113 |
+
foreach($label_all as $key => $label_each) {
|
| 114 |
+
$label_id_each=explode('#**id**#',$label_each);
|
| 115 |
+
array_push($label_id, $label_id_each[0]);
|
| 116 |
+
$label_oder_each=explode('#**label**#', $label_id_each[1]);
|
| 117 |
+
array_push($label_order_original, addslashes($label_oder_each[0]));
|
| 118 |
+
array_push($label_type, $label_oder_each[1]);
|
| 119 |
+
}
|
| 120 |
+
$labels2['id'] = '"' . implode('","', $label_id) . '"';
|
| 121 |
+
$labels2['label'] = '"' . implode('","', $label_order_original) . '"';
|
| 122 |
+
$labels2['type'] = '"' . implode('","', $label_type) . '"';
|
| 123 |
+
$ids = array();
|
| 124 |
+
$types = array();
|
| 125 |
+
$labels = array();
|
| 126 |
+
$paramss = array();
|
| 127 |
+
$fields = explode('*:*new_field*:*', $row->form_fields);
|
| 128 |
+
$fields = array_slice($fields, 0, count($fields) - 1);
|
| 129 |
+
foreach ($fields as $field) {
|
| 130 |
+
$temp=explode('*:*id*:*',$field);
|
| 131 |
+
array_push($ids, $temp[0]);
|
| 132 |
+
$temp=explode('*:*type*:*',$temp[1]);
|
| 133 |
+
array_push($types, $temp[0]);
|
| 134 |
+
$temp=explode('*:*w_field_label*:*',$temp[1]);
|
| 135 |
+
array_push($labels, $temp[0]);
|
| 136 |
+
array_push($paramss, $temp[1]);
|
| 137 |
+
}
|
| 138 |
+
$form = $row->form_front;
|
| 139 |
+
foreach ($ids as $ids_key => $id) {
|
| 140 |
+
$label = $labels[$ids_key];
|
| 141 |
+
$type = $types[$ids_key];
|
| 142 |
+
$params = $paramss[$ids_key];
|
| 143 |
+
if (strpos($form, '%'.$id.' - '.$label.'%') || strpos($form, '%'.$id.' -'.$label.'%')) {
|
| 144 |
+
$rep = '';
|
| 145 |
+
$arrows='';
|
| 146 |
+
$param = array();
|
| 147 |
+
$param['attributes'] = '';
|
| 148 |
+
switch($type)
|
| 149 |
+
{
|
| 150 |
+
case 'type_section_break':
|
| 151 |
+
{
|
| 152 |
+
$arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" ><div id="X_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png?ver='. WD_FM_VERSION.'" title="Remove the field" onclick="remove_section_break("'.$id.'")" onmouseover="chnage_icons_src(this,"delete_el")" onmouseout="chnage_icons_src(this,"delete_el")"></div><div id="edit_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png?ver='. WD_FM_VERSION.'" title="Edit the field" onclick="edit("'.$id.'")" onmouseover="chnage_icons_src(this,"edit")" onmouseout="chnage_icons_src(this,"edit")"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">custom_'.$id.'</span></div><div id="duplicate_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/duplicate.png?ver='. WD_FM_VERSION.'" title="Duplicate the field" onclick="duplicate("'.$id.'")" onmouseover="chnage_icons_src(this,"duplicate")" onmouseout="chnage_icons_src(this,"duplicate")"></div></div>';
|
| 153 |
+
break;
|
| 154 |
+
}
|
| 155 |
+
case 'type_editor':
|
| 156 |
+
{
|
| 157 |
+
$arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" type="type_editor" style="margin-top:0px;"><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png?ver='. WD_FM_VERSION.'" title="Remove the field" onclick="remove_row("'.$id.'")" onmouseover="chnage_icons_src(this,"delete_el")" onmouseout="chnage_icons_src(this,"delete_el")"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/left.png?ver='. WD_FM_VERSION.'" title="Move the field to the left" onclick="left_row("'.$id.'")" onmouseover="chnage_icons_src(this,"left")" onmouseout="chnage_icons_src(this,"left")"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/up.png?ver='. WD_FM_VERSION.'" title="Move the field up" onclick="up_row("'.$id.'")" onmouseover="chnage_icons_src(this,"up")" onmouseout="chnage_icons_src(this,"up")"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/down.png?ver='. WD_FM_VERSION.'" title="Move the field down" onclick="down_row("'.$id.'")" onmouseover="chnage_icons_src(this,"down")" onmouseout="chnage_icons_src(this,"down")"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/right.png?ver='. WD_FM_VERSION.'" title="Move the field to the right" onclick="right_row("'.$id.'")" onmouseover="chnage_icons_src(this,"right")" onmouseout="chnage_icons_src(this,"right")"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png?ver='. WD_FM_VERSION.'" title="Edit the field" onclick="edit("'.$id.'")" onmouseover="chnage_icons_src(this,"edit")" onmouseout="chnage_icons_src(this,"edit")"></div><div id="duplicate_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/duplicate.png?ver='. WD_FM_VERSION.'" title="Duplicate the field" onclick="duplicate("'.$id.'")" onmouseover="chnage_icons_src(this,"duplicate")" onmouseout="chnage_icons_src(this,"duplicate")"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_up.png?ver='. WD_FM_VERSION.'" title="Move the field to the upper page" onclick="page_up("'.$id.'")" onmouseover="chnage_icons_src(this,"page_up")" onmouseout="chnage_icons_src(this,"page_up")"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_down.png?ver='. WD_FM_VERSION.'" title="Move the field to the lower page" onclick="page_down("'.$id.'")" onmouseover="chnage_icons_src(this,"page_down")" onmouseout="chnage_icons_src(this,"page_down")"></div></div>';
|
| 158 |
+
break;
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
case 'type_send_copy':
|
| 162 |
+
case 'type_stripe':
|
| 163 |
+
case 'type_captcha':
|
| 164 |
+
case 'type_arithmetic_captcha':
|
| 165 |
+
case 'type_recaptcha':
|
| 166 |
+
{
|
| 167 |
+
$arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows"><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png?ver='. WD_FM_VERSION.'" title="Remove the field" onclick="remove_row("'.$id.'")" onmouseover="chnage_icons_src(this,"delete_el")" onmouseout="chnage_icons_src(this,"delete_el")"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/left.png?ver='. WD_FM_VERSION.'" title="Move the field to the left" onclick="left_row("'.$id.'")" onmouseover="chnage_icons_src(this,"left")" onmouseout="chnage_icons_src(this,"left")"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/up.png?ver='. WD_FM_VERSION.'" title="Move the field up" onclick="up_row("'.$id.'")" onmouseover="chnage_icons_src(this,"up")" onmouseout="chnage_icons_src(this,"up")"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/down.png?ver='. WD_FM_VERSION.'" title="Move the field down" onclick="down_row("'.$id.'")" onmouseover="chnage_icons_src(this,"down")" onmouseout="chnage_icons_src(this,"down")"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/right.png?ver='. WD_FM_VERSION.'" title="Move the field to the right" onclick="right_row("'.$id.'")" onmouseover="chnage_icons_src(this,"right")" onmouseout="chnage_icons_src(this,"right")"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png?ver='. WD_FM_VERSION.'" title="Edit the field" onclick="edit("'.$id.'")" onmouseover="chnage_icons_src(this,"edit")" onmouseout="chnage_icons_src(this,"edit")"></div><div id="duplicate_'.$id.'" valign="middle" class="element_toolbar"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_up.png?ver='. WD_FM_VERSION.'" title="Move the field to the upper page" onclick="page_up("'.$id.'")" onmouseover="chnage_icons_src(this,"page_up")" onmouseout="chnage_icons_src(this,"page_up")"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_down.png?ver='. WD_FM_VERSION.'" title="Move the field to the lower page" onclick="page_down("'.$id.'")" onmouseover="chnage_icons_src(this,"page_down")" onmouseout="chnage_icons_src(this,"page_down")"></div></div>';
|
| 168 |
+
break;
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
default :
|
| 172 |
+
{
|
| 173 |
+
$arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" ><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png?ver='. WD_FM_VERSION.'" title="Remove the field" onclick="remove_row("'.$id.'")" onmouseover="chnage_icons_src(this,"delete_el")" onmouseout="chnage_icons_src(this,"delete_el")"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/left.png?ver='. WD_FM_VERSION.'" title="Move the field to the left" onclick="left_row("'.$id.'")" onmouseover="chnage_icons_src(this,"left")" onmouseout="chnage_icons_src(this,"left")"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/up.png?ver='. WD_FM_VERSION.'" title="Move the field up" onclick="up_row("'.$id.'")" onmouseover="chnage_icons_src(this,"up")" onmouseout="chnage_icons_src(this,"up")"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/down.png?ver='. WD_FM_VERSION.'" title="Move the field down" onclick="down_row("'.$id.'")" onmouseover="chnage_icons_src(this,"down")" onmouseout="chnage_icons_src(this,"down")"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/right.png?ver='. WD_FM_VERSION.'" title="Move the field to the right" onclick="right_row("'.$id.'")" onmouseover="chnage_icons_src(this,"right")" onmouseout="chnage_icons_src(this,"right")"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png?ver='. WD_FM_VERSION.'" title="Edit the field" onclick="edit("'.$id.'")" onmouseover="chnage_icons_src(this,"edit")" onmouseout="chnage_icons_src(this,"edit")"></div><div id="duplicate_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/duplicate.png?ver='. WD_FM_VERSION.'" title="Duplicate the field" onclick="duplicate("'.$id.'")" onmouseover="chnage_icons_src(this,"duplicate")" onmouseout="chnage_icons_src(this,"duplicate")"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_up.png?ver='. WD_FM_VERSION.'" title="Move the field to the upper page" onclick="page_up("'.$id.'")" onmouseover="chnage_icons_src(this,"page_up")" onmouseout="chnage_icons_src(this,"page_up")"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_down.png?ver='. WD_FM_VERSION.'" title="Move the field to the lower page" onclick="page_down("'.$id.'")" onmouseover="chnage_icons_src(this,"page_down")" onmouseout="chnage_icons_src(this,"page_down")"></div></div>';
|
| 174 |
+
break;
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
|
| 180 |
+
|
| 181 |
+
|
| 182 |
+
switch ($type) {
|
| 183 |
+
case 'type_section_break': {
|
| 184 |
+
$params_names = array('w_editor');
|
| 185 |
+
$temp = $params;
|
| 186 |
+
foreach ($params_names as $params_name) {
|
| 187 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 188 |
+
$param[$params_name] = $temp[0];
|
| 189 |
+
$temp = $temp[1];
|
| 190 |
+
}
|
| 191 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_section_break" class="wdform_field_section_break">'.$arrows.'<span id="'.$id.'_element_labelform_id_temp" style="display: none;">custom_'.$id.'</span><div id="'.$id.'_element_sectionform_id_temp" align="left" class="wdform_section_break">'.$param['w_editor'].'</div></div><div id="'.$id.'_element_labelform_id_temp" style="color:red;">custom_'.$id.'</div>';
|
| 192 |
+
break;
|
| 193 |
+
}
|
| 194 |
+
case 'type_editor': {
|
| 195 |
+
$params_names = array('w_editor');
|
| 196 |
+
$temp = $params;
|
| 197 |
+
foreach ($params_names as $params_name ) {
|
| 198 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 199 |
+
$param[$params_name] = $temp[0];
|
| 200 |
+
$temp = $temp[1];
|
| 201 |
+
}
|
| 202 |
+
$rep =$arrows.'<div id="wdform_field'.$id.'" type="type_editor" class="wdform_field" >'.$param['w_editor'].'</div><div id="'.$id.'_element_labelform_id_temp" style="color: red;">custom_'.$id.'</div>';
|
| 203 |
+
break;
|
| 204 |
+
}
|
| 205 |
+
case 'type_send_copy': {
|
| 206 |
+
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_required');
|
| 207 |
+
$temp = $params;
|
| 208 |
+
|
| 209 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 210 |
+
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_first_val', 'w_required');
|
| 211 |
+
|
| 212 |
+
foreach ($params_names as $params_name ) {
|
| 213 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 214 |
+
$param[$params_name] = $temp[0];
|
| 215 |
+
$temp = $temp[1];
|
| 216 |
+
}
|
| 217 |
+
if ($temp) {
|
| 218 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 219 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 220 |
+
foreach ($attrs as $attr) {
|
| 221 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
| 222 |
+
}
|
| 223 |
+
}
|
| 224 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
| 225 |
+
|
| 226 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 227 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 228 |
+
|
| 229 |
+
$input_active = ($param['w_first_val'] == 'true' ? "checked='checked'" : "");
|
| 230 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
| 231 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_send_copy" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" style="display: '.$param['w_field_label_pos'].'"><input type="hidden" value="type_send_copy" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp" /><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp" /><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="checkbox" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" onclick="set_checked("'.$id.'","","form_id_temp")" '.$input_active.' '.$param['attributes'].' disabled /></div></div>';
|
| 232 |
+
break;
|
| 233 |
+
}
|
| 234 |
+
case 'type_text': {
|
| 235 |
+
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique');
|
| 236 |
+
$temp = $params;
|
| 237 |
+
if(strpos($temp, 'w_regExp_status') > -1)
|
| 238 |
+
$params_names = array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required', 'w_regExp_status', 'w_regExp_value', 'w_regExp_common', 'w_regExp_arg', 'w_regExp_alert', 'w_unique');
|
| 239 |
+
|
| 240 |
+
if(strpos($temp, 'w_readonly') > -1)
|
| 241 |
+
$params_names = array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required', 'w_regExp_status', 'w_regExp_value', 'w_regExp_common', 'w_regExp_arg', 'w_regExp_alert', 'w_unique', 'w_readonly');
|
| 242 |
+
|
| 243 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 244 |
+
$params_names = array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size','w_first_val','w_title','w_required', 'w_regExp_status', 'w_regExp_value', 'w_regExp_common', 'w_regExp_arg', 'w_regExp_alert', 'w_unique', 'w_readonly');
|
| 245 |
+
|
| 246 |
+
foreach ($params_names as $params_name) {
|
| 247 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 248 |
+
$param[$params_name] = $temp[0];
|
| 249 |
+
$temp = $temp[1];
|
| 250 |
+
}
|
| 251 |
+
if ($temp) {
|
| 252 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 253 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 254 |
+
foreach ($attrs as $attr) {
|
| 255 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
| 256 |
+
}
|
| 257 |
+
}
|
| 258 |
+
|
| 259 |
+
|
| 260 |
+
|
| 261 |
+
|
| 262 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
| 263 |
+
$input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
|
| 264 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
| 265 |
+
|
| 266 |
+
$param['w_regExp_status'] = (isset($param['w_regExp_status']) ? $param['w_regExp_status'] : "no");
|
| 267 |
+
$param['w_regExp_value'] = (isset($param['w_regExp_value']) ? $param['w_regExp_value'] : "");
|
| 268 |
+
$param['w_regExp_common'] = (isset($param['w_regExp_common']) ? $param['w_regExp_common'] : "");
|
| 269 |
+
$param['w_regExp_arg'] = (isset($param['w_regExp_arg']) ? $param['w_regExp_arg'] : "");
|
| 270 |
+
$param['w_regExp_alert'] = (isset($param['w_regExp_alert']) ? $param['w_regExp_alert'] : "Incorrect Value");
|
| 271 |
+
|
| 272 |
+
$param['w_readonly'] = (isset($param['w_readonly']) ? $param['w_readonly'] : "no");
|
| 273 |
+
|
| 274 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 275 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 276 |
+
|
| 277 |
+
|
| 278 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_text" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" style="display: '.$param['w_field_label_pos'].'"><input type="hidden" value="type_text" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp" /><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp" /><input type="hidden" value="'.$param['w_readonly'].'" name="'.$id.'_readonlyform_id_temp" id="'.$id.'_readonlyform_id_temp"/><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_regExp_status'].'" name="'.$id.'_regExpStatusform_id_temp" id="'.$id.'_regExpStatusform_id_temp"><input type="hidden" value="'.$param['w_regExp_value'].'" name="'.$id.'_regExp_valueform_id_temp" id="'.$id.'_regExp_valueform_id_temp"><input type="hidden" value="'.$param['w_regExp_common'].'" name="'.$id.'_regExp_commonform_id_temp" id="'.$id.'_regExp_commonform_id_temp"><input type="hidden" value="'.$param['w_regExp_alert'].'" name="'.$id.'_regExp_alertform_id_temp" id="'.$id.'_regExp_alertform_id_temp"><input type="hidden" value="'.$param['w_regExp_arg'].'" name="'.$id.'_regArgumentform_id_temp" id="'.$id.'_regArgumentform_id_temp"><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp" /><input type="text" class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" onfocus="delete_value("'.$id.'_elementform_id_temp")" onblur="return_value("'.$id.'_elementform_id_temp")" onchange="change_value("'.$id.'_elementform_id_temp")" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div></div>';
|
| 279 |
+
|
| 280 |
+
break;
|
| 281 |
+
}
|
| 282 |
+
case 'type_number': {
|
| 283 |
+
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique', 'w_class');
|
| 284 |
+
$temp = $params;
|
| 285 |
+
foreach ($params_names as $params_name) {
|
| 286 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 287 |
+
$param[$params_name] = $temp[0];
|
| 288 |
+
$temp = $temp[1];
|
| 289 |
+
}
|
| 290 |
+
if ($temp) {
|
| 291 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 292 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 293 |
+
foreach ($attrs as $attr) {
|
| 294 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
| 295 |
+
}
|
| 296 |
+
}
|
| 297 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
| 298 |
+
$input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
|
| 299 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
| 300 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_number" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'"><input type="hidden" value="type_number" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><input type="text" class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" onkeypress="return check_isnum(event)" onfocus="delete_value("'.$id.'_elementform_id_temp")" onblur="return_value("'.$id.'_elementform_id_temp")" onchange="change_value("'.$id.'_elementform_id_temp")" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div></div>';
|
| 301 |
+
break;
|
| 302 |
+
}
|
| 303 |
+
case 'type_password': {
|
| 304 |
+
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_required', 'w_unique', 'w_class');
|
| 305 |
+
$temp = $params;
|
| 306 |
+
|
| 307 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 308 |
+
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_size', 'w_required', 'w_unique', 'w_class');
|
| 309 |
+
|
| 310 |
+
if(strpos($temp, 'w_verification') > -1)
|
| 311 |
+
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_size', 'w_required', 'w_unique', 'w_class', 'w_verification', 'w_verification_label');
|
| 312 |
+
|
| 313 |
+
|
| 314 |
+
|
| 315 |
+
foreach ($params_names as $params_name) {
|
| 316 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 317 |
+
$param[$params_name] = $temp[0];
|
| 318 |
+
$temp = $temp[1];
|
| 319 |
+
}
|
| 320 |
+
if ($temp) {
|
| 321 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 322 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 323 |
+
foreach ($attrs as $attr) {
|
| 324 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
| 325 |
+
}
|
| 326 |
+
}
|
| 327 |
+
|
| 328 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
| 329 |
+
|
| 330 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 331 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 332 |
+
|
| 333 |
+
|
| 334 |
+
if(isset($param['w_verification']) && $param['w_verification'] == "yes"){
|
| 335 |
+
$display_label_confirm = $display_label;
|
| 336 |
+
$display_element_confirm = $param['w_field_label_pos'];
|
| 337 |
+
}
|
| 338 |
+
else{
|
| 339 |
+
$display_label_confirm = "none";
|
| 340 |
+
$display_element_confirm = "none";
|
| 341 |
+
}
|
| 342 |
+
|
| 343 |
+
$param['w_verification'] = isset($param['w_verification']) ? $param['w_verification'] : "no";
|
| 344 |
+
$param['w_verification_label'] = isset($param['w_verification_label']) ? $param['w_verification_label'] : "Password confirmation:";
|
| 345 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
| 346 |
+
|
| 347 |
+
|
| 348 |
+
$confirm_password ='<br><div align="left" id="'.$id.'_1_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label_confirm.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_1_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$param['w_verification_label'].'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_1_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_element_confirm.';"><input type="hidden" value="'.$param['w_verification'].'" name="'.$id.'_verification_id_temp" id="'.$id.'_verification_id_temp"><input type="text" class="input_deactive" id="'.$id.'_1_elementform_id_temp" name="'.$id.'_1_elementform_id_temp" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div>';
|
| 349 |
+
|
| 350 |
+
|
| 351 |
+
|
| 352 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_password" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'"><input type="hidden" value="type_password" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><input type="password" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div>'.$confirm_password.'</div>';
|
| 353 |
+
break;
|
| 354 |
+
|
| 355 |
+
}
|
| 356 |
+
case 'type_textarea': {
|
| 357 |
+
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size_w', 'w_size_h', 'w_first_val', 'w_title', 'w_required', 'w_unique', 'w_class');
|
| 358 |
+
$temp = $params;
|
| 359 |
+
|
| 360 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 361 |
+
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_size_w', 'w_size_h', 'w_first_val', 'w_title', 'w_required', 'w_unique', 'w_class');
|
| 362 |
+
|
| 363 |
+
|
| 364 |
+
|
| 365 |
+
foreach ($params_names as $params_name) {
|
| 366 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 367 |
+
$param[$params_name] = $temp[0];
|
| 368 |
+
$temp = $temp[1];
|
| 369 |
+
}
|
| 370 |
+
if ($temp) {
|
| 371 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 372 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 373 |
+
foreach ($attrs as $attr) {
|
| 374 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
| 375 |
+
}
|
| 376 |
+
}
|
| 377 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
| 378 |
+
$input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
|
| 379 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
| 380 |
+
|
| 381 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 382 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 383 |
+
|
| 384 |
+
|
| 385 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_textarea" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display:'.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><input type="hidden" value="type_textarea" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><textarea class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" title="'.$param['w_title'].'" onfocus="delete_value("'.$id.'_elementform_id_temp")" onblur="return_value("'.$id.'_elementform_id_temp")" onchange="change_value("'.$id.'_elementform_id_temp")" style="width: '.$param['w_size_w'].'px; height: '.$param['w_size_h'].'px;" '.$param['attributes'].' disabled>'.$param['w_first_val'].'</textarea></div></div>';
|
| 386 |
+
break;
|
| 387 |
+
}
|
| 388 |
+
case 'type_phone': {
|
| 389 |
+
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_mini_labels', 'w_required', 'w_unique', 'w_class');
|
| 390 |
+
$temp = $params;
|
| 391 |
+
|
| 392 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 393 |
+
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_size', 'w_first_val', 'w_title', 'w_mini_labels', 'w_required', 'w_unique', 'w_class');
|
| 394 |
+
|
| 395 |
+
|
| 396 |
+
foreach ($params_names as $params_name) {
|
| 397 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 398 |
+
$param[$params_name] = $temp[0];
|
| 399 |
+
$temp = $temp[1];
|
| 400 |
+
}
|
| 401 |
+
if ($temp) {
|
| 402 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 403 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 404 |
+
foreach ($attrs as $attr) {
|
| 405 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
| 406 |
+
}
|
| 407 |
+
}
|
| 408 |
+
$w_first_val = explode('***', $param['w_first_val']);
|
| 409 |
+
$w_title = explode('***', $param['w_title']);
|
| 410 |
+
$w_mini_labels = explode('***', $param['w_mini_labels']);
|
| 411 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
| 412 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 413 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 414 |
+
|
| 415 |
+
$input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
|
| 416 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
| 417 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_phone" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_phone" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><div id="'.$id.'_table_name" style="display: table;"><div id="'.$id.'_tr_name1" style="display: table-row;"><div id="'.$id.'_td_name_input_first" style="display: table-cell;"><input type="text" class="'.$input_active.'" id="'.$id.'_element_firstform_id_temp" name="'.$id.'_element_firstform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'" onfocus="delete_value("'.$id.'_element_firstform_id_temp")"onblur="return_value("'.$id.'_element_firstform_id_temp")"onchange="change_value("'.$id.'_element_firstform_id_temp")" onkeypress="return check_isnum(event)"style="width: 50px;" '.$param['attributes'].' disabled /><span class="wdform_line" style="margin: 0px 4px; padding: 0px;">-</span></div><div id="'.$id.'_td_name_input_last" style="display: table-cell;"><input type="text" class="'.$input_active.'" id="'.$id.'_element_lastform_id_temp" name="'.$id.'_element_lastform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'" onfocus="delete_value("'.$id.'_element_lastform_id_temp")"onblur="return_value("'.$id.'_element_lastform_id_temp")" onchange="change_value("'.$id.'_element_lastform_id_temp")" onkeypress="return check_isnum(event)"style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div></div><div id="'.$id.'_tr_name2" style="display: table-row;"><div id="'.$id.'_td_name_label_first" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_area_code">'.$w_mini_labels[0].'</label></div><div id="'.$id.'_td_name_label_last" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_phone_number">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
|
| 418 |
+
break;
|
| 419 |
+
}
|
| 420 |
+
|
| 421 |
+
case 'type_phone_new': {
|
| 422 |
+
$temp = $params;
|
| 423 |
+
$params_names = array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size','w_first_val', 'w_top_country','w_required','w_unique', 'w_class');
|
| 424 |
+
|
| 425 |
+
foreach ($params_names as $params_name) {
|
| 426 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 427 |
+
$param[$params_name] = $temp[0];
|
| 428 |
+
$temp = $temp[1];
|
| 429 |
+
}
|
| 430 |
+
if ($temp) {
|
| 431 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 432 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 433 |
+
foreach ($attrs as $attr) {
|
| 434 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
| 435 |
+
}
|
| 436 |
+
}
|
| 437 |
+
|
| 438 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
| 439 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 440 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 441 |
+
|
| 442 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
| 443 |
+
|
| 444 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_phone_new" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_phone_new" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><div id="'.$id.'_table_name" style="display: table;"><div id="'.$id.'_tr_name1" style="display: table-row;"><div id="'.$id.'_td_name_input_first" style="display: table-cell;"><input type="text" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" top-country = "'.$param['w_top_country'].'" onfocus="delete_value("'.$id.'_elementform_id_temp")" onblur="return_value("'.$id.'_elementform_id_temp")" onchange="change_value("'.$id.'_elementform_id_temp")" onkeypress="return check_isnum("'.$id.'_elementform_id_temp")" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled></div></div></div></div></div>';
|
| 445 |
+
break;
|
| 446 |
+
}
|
| 447 |
+
|
| 448 |
+
|
| 449 |
+
case 'type_name': {
|
| 450 |
+
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class');
|
| 451 |
+
$temp = $params;
|
| 452 |
+
if(strpos($temp, 'w_name_fields') > -1)
|
| 453 |
+
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class', 'w_name_fields');
|
| 454 |
+
|
| 455 |
+
if(strpos($temp, 'w_autofill') > -1)
|
| 456 |
+
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class', 'w_name_fields', 'w_autofill');
|
| 457 |
+
|
| 458 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 459 |
+
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class', 'w_name_fields');
|
| 460 |
+
|
| 461 |
+
foreach ($params_names as $params_name) {
|
| 462 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 463 |
+
$param[$params_name] = $temp[0];
|
| 464 |
+
$temp = $temp[1];
|
| 465 |
+
}
|
| 466 |
+
if ($temp) {
|
| 467 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 468 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 469 |
+
foreach ($attrs as $attr) {
|
| 470 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
| 471 |
+
}
|
| 472 |
+
}
|
| 473 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
| 474 |
+
|
| 475 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 476 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 477 |
+
|
| 478 |
+
|
| 479 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
| 480 |
+
$w_first_val = explode('***', $param['w_first_val']);
|
| 481 |
+
$w_title = explode('***', $param['w_title']);
|
| 482 |
+
$w_mini_labels = explode('***', $param['w_mini_labels']);
|
| 483 |
+
|
| 484 |
+
$param['w_name_fields'] = isset($param['w_name_fields']) ? $param['w_name_fields'] : ($param['w_name_format'] == 'normal' ? 'no***no' : 'yes***yes');
|
| 485 |
+
$w_name_fields = explode('***', $param['w_name_fields']);
|
| 486 |
+
$param['w_autofill'] = isset($param['w_autofill']) ? $param['w_autofill'] : 'no';
|
| 487 |
+
|
| 488 |
+
$w_name_format = '<div id="'.$id.'_td_name_input_first" style="display: table-cell;"><input type="text" class="'.($w_first_val[0]==$w_title[0] ? "input_deactive" : "input_active").'" id="'.$id.'_element_firstform_id_temp" name="'.$id.'_element_firstform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'" onfocus="delete_value("'.$id.'_element_firstform_id_temp")"onblur="return_value("'.$id.'_element_firstform_id_temp")" onchange="change_value("'.$id.'_element_firstform_id_temp")" style="margin-right: 10px; width: '.$param['w_size'].'px;"'.$param['attributes'].' disabled /></div><div id="'.$id.'_td_name_input_last" style="display: table-cell;"><input type="text" class="'.($w_first_val[1]==$w_title[1] ? "input_deactive" : "input_active").'" id="'.$id.'_element_lastform_id_temp" name="'.$id.'_element_lastform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'" onfocus="delete_value("'.$id.'_element_lastform_id_temp")"onblur="return_value("'.$id.'_element_lastform_id_temp")" onchange="change_value("'.$id.'_element_lastform_id_temp")" style="margin-right: 10px; width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div>';
|
| 489 |
+
$w_name_format_mini_labels = '<div id="'.$id.'_td_name_label_first" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_first">'.$w_mini_labels[1].'</label></div><div id="'.$id.'_td_name_label_last" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_last">'.$w_mini_labels[2].'</label></div>';
|
| 490 |
+
|
| 491 |
+
if($w_name_fields[0] == 'yes') {
|
| 492 |
+
$w_name_format = '<div id="'.$id.'_td_name_input_title" style="display: table-cell;"><input type="text" class="'.($w_first_val[2]==$w_title[2] ? "input_deactive" : "input_active").'" id="'.$id.'_element_titleform_id_temp" name="'.$id.'_element_titleform_id_temp" value="'.$w_first_val[2].'" title="'.$w_title[2].'" onfocus="delete_value("'.$id.'_element_titleform_id_temp")" onblur="return_value("'.$id.'_element_titleform_id_temp")" onchange="change_value("'.$id.'_element_titleform_id_temp")" style="margin: 0px 10px 0px 0px; width: 40px;" disabled /></div>'.$w_name_format;
|
| 493 |
+
$w_name_format_mini_labels ='<div id="'.$id.'_td_name_label_title" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_title">'.$w_mini_labels[0].'</label></div>'.$w_name_format_mini_labels;
|
| 494 |
+
}
|
| 495 |
+
|
| 496 |
+
if($w_name_fields[1] == 'yes') {
|
| 497 |
+
$w_name_format = $w_name_format.'<div id="'.$id.'_td_name_input_middle" style="display: table-cell;"><input type="text" class="'.($w_first_val[3]==$w_title[3] ? "input_deactive" : "input_active").'" id="'.$id.'_element_middleform_id_temp" name="'.$id.'_element_middleform_id_temp" value="'.$w_first_val[3].'" title="'.$w_title[3].'" onfocus="delete_value("'.$id.'_element_middleform_id_temp")" onblur="return_value("'.$id.'_element_middleform_id_temp")" onchange="change_value("'.$id.'_element_middleform_id_temp")" style="width: '.$param['w_size'].'px;" disabled /></div>';
|
| 498 |
+
$w_name_format_mini_labels = $w_name_format_mini_labels.'<div id="'.$id.'_td_name_label_middle" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_middle">'.$w_mini_labels[3].'</label></div>';
|
| 499 |
+
}
|
| 500 |
+
|
| 501 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_name" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_name" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><input type="hidden" value="'.$param['w_autofill'].'" name="'.$id.'_autofillform_id_temp" id="'.$id.'_autofillform_id_temp"><input type="hidden" name="'.$id.'_enable_fieldsform_id_temp" id="'.$id.'_enable_fieldsform_id_temp" title="'.$w_name_fields[0].'" first="yes" last="yes" middle="'.$w_name_fields[1].'"><div id="'.$id.'_table_name" cellpadding="0" cellspacing="0" style="display: table;"><div id="'.$id.'_tr_name1" style="display: table-row;">'.$w_name_format.'</div><div id="'.$id.'_tr_name2" style="display: table-row;">'.$w_name_format_mini_labels.'</div></div></div></div>';
|
| 502 |
+
break;
|
| 503 |
+
}
|
| 504 |
+
case 'type_address': {
|
| 505 |
+
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_mini_labels', 'w_disabled_fields', 'w_required', 'w_class');
|
| 506 |
+
$temp = $params;
|
| 507 |
+
|
| 508 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 509 |
+
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_size', 'w_mini_labels', 'w_disabled_fields', 'w_required', 'w_class');
|
| 510 |
+
|
| 511 |
+
|
| 512 |
+
|
| 513 |
+
foreach ($params_names as $params_name) {
|
| 514 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 515 |
+
$param[$params_name] = $temp[0];
|
| 516 |
+
$temp = $temp[1];
|
| 517 |
+
}
|
| 518 |
+
if ($temp) {
|
| 519 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 520 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 521 |
+
foreach ($attrs as $attr) {
|
| 522 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
| 523 |
+
}
|
| 524 |
+
}
|
| 525 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
| 526 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
| 527 |
+
|
| 528 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 529 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 530 |
+
|
| 531 |
+
|
| 532 |
+
$w_mini_labels = explode('***', $param['w_mini_labels']);
|
| 533 |
+
$w_disabled_fields = explode('***', $param['w_disabled_fields']);
|
| 534 |
+
$hidden_inputs = '';
|
| 535 |
+
$labels_for_id = array('street1', 'street2', 'city', 'state', 'postal', 'country');
|
| 536 |
+
foreach ($w_disabled_fields as $key => $w_disabled_field) {
|
| 537 |
+
if ($key != 6) {
|
| 538 |
+
if ($w_disabled_field == 'yes') {
|
| 539 |
+
$hidden_inputs .= '<input type="hidden" id="'.$id.'_'.$labels_for_id[$key].'form_id_temp" value="'.$w_mini_labels[$key].'" id_for_label="'.($id+$key).'">';
|
| 540 |
+
}
|
| 541 |
+
}
|
| 542 |
+
}
|
| 543 |
+
$address_fields ='';
|
| 544 |
+
$g=0;
|
| 545 |
+
if($w_disabled_fields[0]=='no')
|
| 546 |
+
{
|
| 547 |
+
$g+=2;
|
| 548 |
+
$address_fields .= '<span style="float: left; width: 100%; padding-bottom: 8px; display: block;"><input type="text" id="'.$id.'_street1form_id_temp" name="'.$id.'_street1form_id_temp" onchange="change_value("'.$id.'_street1form_id_temp")" style="width: 100%;" '.$param['attributes'].' disabled /><label class="mini_label" id="'.$id.'_mini_label_street1" style="display: block;">'.$w_mini_labels[0].'</label></span>';
|
| 549 |
+
}
|
| 550 |
+
|
| 551 |
+
if($w_disabled_fields[1]=='no')
|
| 552 |
+
{
|
| 553 |
+
$g+=2;
|
| 554 |
+
$address_fields .= '<span style="float: left; width: 100%; padding-bottom: 8px; display: block;"><input type="text" id="'.$id.'_street2form_id_temp" name="'.($id+1).'_street2form_id_temp" onchange="change_value("'.$id.'_street2form_id_temp")" style="width: 100%;" '.$param['attributes'].' disabled /><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_street2">'.$w_mini_labels[1].'</label></span>';
|
| 555 |
+
}
|
| 556 |
+
|
| 557 |
+
if($w_disabled_fields[2]=='no')
|
| 558 |
+
{
|
| 559 |
+
$g++;
|
| 560 |
+
$address_fields .= '<span style="float: left; width: 48%; padding-bottom: 8px;"><input type="text" id="'.$id.'_cityform_id_temp" name="'.($id+2).'_cityform_id_temp" onchange="change_value("'.$id.'_cityform_id_temp")" style="width: 100%;" '.$param['attributes'].' disabled /><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_city">'.$w_mini_labels[2].'</label></span>';
|
| 561 |
+
}
|
| 562 |
+
|
| 563 |
+
if($w_disabled_fields[3]=='no')
|
| 564 |
+
{
|
| 565 |
+
$g++;
|
| 566 |
+
if($w_disabled_fields[5]=='yes' && $w_disabled_fields[6]=='yes')
|
| 567 |
+
$address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><select type="text" id="'.$id.'_stateform_id_temp" name="'.($id+3).'_stateform_id_temp" onchange="change_value("'.$id.'_stateform_id_temp")" style="width: 100%;" '.$param['attributes'].' disabled ><option value=""></option><option value="Alabama">Alabama</option><option value="Alaska">Alaska</option><option value="Arizona">Arizona</option><option value="Arkansas">Arkansas</option><option value="California">California</option><option value="Colorado">Colorado</option><option value="Connecticut">Connecticut</option><option value="Delaware">Delaware</option><option value="Florida">Florida</option><option value="Georgia">Georgia</option><option value="Hawaii">Hawaii</option><option value="Idaho">Idaho</option><option value="Illinois">Illinois</option><option value="Indiana">Indiana</option><option value="Iowa">Iowa</option><option value="Kansas">Kansas</option><option value="Kentucky">Kentucky</option><option value="Louisiana">Louisiana</option><option value="Maine">Maine</option><option value="Maryland">Maryland</option><option value="Massachusetts">Massachusetts</option><option value="Michigan">Michigan</option><option value="Minnesota">Minnesota</option><option value="Mississippi">Mississippi</option><option value="Missouri">Missouri</option><option value="Montana">Montana</option><option value="Nebraska">Nebraska</option><option value="Nevada">Nevada</option><option value="New Hampshire">New Hampshire</option><option value="New Jersey">New Jersey</option><option value="New Mexico">New Mexico</option><option value="New York">New York</option><option value="North Carolina">North Carolina</option><option value="North Dakota">North Dakota</option><option value="Ohio">Ohio</option><option value="Oklahoma">Oklahoma</option><option value="Oregon">Oregon</option><option value="Pennsylvania">Pennsylvania</option><option value="Rhode Island">Rhode Island</option><option value="South Carolina">South Carolina</option><option value="South Dakota">South Dakota</option><option value="Tennessee">Tennessee</option><option value="Texas">Texas</option><option value="Utah">Utah</option><option value="Vermont">Vermont</option><option value="Virginia">Virginia</option><option value="Washington">Washington</option><option value="West Virginia">West Virginia</option><option value="Wisconsin">Wisconsin</option><option value="Wyoming">Wyoming</option></select><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_state">'.$w_mini_labels[3].'</label></span>';
|
| 568 |
+
else
|
| 569 |
+
$address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><input type="text" id="'.$id.'_stateform_id_temp" name="'.($id+3).'_stateform_id_temp" onchange="change_value("'.$id.'_stateform_id_temp")" style="width: 100%;" '.$param['attributes'].' disabled><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_state">'.$w_mini_labels[3].'</label></span>';
|
| 570 |
+
}
|
| 571 |
+
|
| 572 |
+
if($w_disabled_fields[4]=='no')
|
| 573 |
+
{
|
| 574 |
+
$g++;
|
| 575 |
+
$address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><input type="text" id="'.$id.'_postalform_id_temp" name="'.($id+4).'_postalform_id_temp" onchange="change_value("'.$id.'_postalform_id_temp")" style="width: 100%;" '.$param['attributes'].' disabled><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_postal">'.$w_mini_labels[4].'</label></span>';
|
| 576 |
+
}
|
| 577 |
+
|
| 578 |
+
if($w_disabled_fields[5]=='no')
|
| 579 |
+
{
|
| 580 |
+
$g++;
|
| 581 |
+
$address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><select type="text" id="'.$id.'_countryform_id_temp" name="'.($id+5).'_countryform_id_temp" onchange="change_value("'.$id.'_countryform_id_temp")" style="width: 100%;" '.$param['attributes'].' disabled><option value=""></option><option value="Afghanistan">Afghanistan</option><option value="Albania">Albania</option><option value="Algeria">Algeria</option><option value="Andorra">Andorra</option><option value="Angola">Angola</option><option value="Antigua and Barbuda">Antigua and Barbuda</option><option value="Argentina">Argentina</option><option value="Armenia">Armenia</option><option value="Australia">Australia</option><option value="Austria">Austria</option><option value="Azerbaijan">Azerbaijan</option><option value="Bahamas">Bahamas</option><option value="Bahrain">Bahrain</option><option value="Bangladesh">Bangladesh</option><option value="Barbados">Barbados</option><option value="Belarus">Belarus</option><option value="Belgium">Belgium</option><option value="Belize">Belize</option><option value="Benin">Benin</option><option value="Bhutan">Bhutan</option><option value="Bolivia">Bolivia</option><option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option><option value="Botswana">Botswana</option><option value="Brazil">Brazil</option><option value="Brunei">Brunei</option><option value="Bulgaria">Bulgaria</option><option value="Burkina Faso">Burkina Faso</option><option value="Burundi">Burundi</option><option value="Cambodia">Cambodia</option><option value="Cameroon">Cameroon</option><option value="Canada">Canada</option><option value="Cape Verde">Cape Verde</option><option value="Central African Republic">Central African Republic</option><option value="Chad">Chad</option><option value="Chile">Chile</option><option value="China">China</option><option value="Colombia">Colombia</option><option value="Comoros">Comoros</option><option value="Congo (Brazzaville)">Congo (Brazzaville)</option><option value="Congo">Congo</option><option value="Costa Rica">Costa Rica</option><option value="Cote d\'Ivoire">Cote d\'Ivoire</option><option value="Croatia">Croatia</option><option value="Cuba">Cuba</option><option value="Cyprus">Cyprus</option><option value="Czech Republic">Czech Republic</option><option value="Denmark">Denmark</option><option value="Djibouti">Djibouti</option><option value="Dominica">Dominica</option><option value="Dominican Republic">Dominican Republic</option><option value="East Timor (Timor Timur)">East Timor (Timor Timur)</option><option value="Ecuador">Ecuador</option><option value="Egypt">Egypt</option><option value="El Salvador">El Salvador</option><option value="Equatorial Guinea">Equatorial Guinea</option><option value="Eritrea">Eritrea</option><option value="Estonia">Estonia</option><option value="Ethiopia">Ethiopia</option><option value="Fiji">Fiji</option><option value="Finland">Finland</option><option value="France">France</option><option value="Gabon">Gabon</option><option value="Gambia, The">Gambia, The</option><option value="Georgia">Georgia</option><option value="Germany">Germany</option><option value="Ghana">Ghana</option><option value="Greece">Greece</option><option value="Grenada">Grenada</option><option value="Guatemala">Guatemala</option><option value="Guinea">Guinea</option><option value="Guinea-Bissau">Guinea-Bissau</option><option value="Guyana">Guyana</option><option value="Haiti">Haiti</option><option value="Honduras">Honduras</option><option value="Hungary">Hungary</option><option value="Iceland">Iceland</option><option value="India">India</option><option value="Indonesia">Indonesia</option><option value="Iran">Iran</option><option value="Iraq">Iraq</option><option value="Ireland">Ireland</option><option value="Israel">Israel</option><option value="Italy">Italy</option><option value="Jamaica">Jamaica</option><option value="Japan">Japan</option><option value="Jordan">Jordan</option><option value="Kazakhstan">Kazakhstan</option><option value="Kenya">Kenya</option><option value="Kiribati">Kiribati</option><option value="Korea, North">Korea, North</option><option value="Korea, South">Korea, South</option><option value="Kuwait">Kuwait</option><option value="Kyrgyzstan">Kyrgyzstan</option><option value="Laos">Laos</option><option value="Latvia">Latvia</option><option value="Lebanon">Lebanon</option><option value="Lesotho">Lesotho</option><option value="Liberia">Liberia</option><option value="Libya">Libya</option><option value="Liechtenstein">Liechtenstein</option><option value="Lithuania">Lithuania</option><option value="Luxembourg">Luxembourg</option><option value="Macedonia">Macedonia</option><option value="Madagascar">Madagascar</option><option value="Malawi">Malawi</option><option value="Malaysia">Malaysia</option><option value="Maldives">Maldives</option><option value="Mali">Mali</option><option value="Malta">Malta</option><option value="Marshall Islands">Marshall Islands</option><option value="Mauritania">Mauritania</option><option value="Mauritius">Mauritius</option><option value="Mexico">Mexico</option><option value="Micronesia">Micronesia</option><option value="Moldova">Moldova</option><option value="Monaco">Monaco</option><option value="Mongolia">Mongolia</option><option value="Morocco">Morocco</option><option value="Mozambique">Mozambique</option><option value="Myanmar">Myanmar</option><option value="Namibia">Namibia</option><option value="Nauru">Nauru</option><option value="Nepal">Nepal</option><option value="Netherlands">Netherlands</option><option value="New Zealand">New Zealand</option><option value="Nicaragua">Nicaragua</option><option value="Niger">Niger</option><option value="Nigeria">Nigeria</option><option value="Norway">Norway</option><option value="Oman">Oman</option><option value="Pakistan">Pakistan</option><option value="Palau">Palau</option><option value="Panama">Panama</option><option value="Papua New Guinea">Papua New Guinea</option><option value="Paraguay">Paraguay</option><option value="Peru">Peru</option><option value="Philippines">Philippines</option><option value="Poland">Poland</option><option value="Portugal">Portugal</option><option value="Qatar">Qatar</option><option value="Romania">Romania</option><option value="Russia">Russia</option><option value="Rwanda">Rwanda</option><option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option><option value="Saint Lucia">Saint Lucia</option><option value="Saint Vincent">Saint Vincent</option><option value="Samoa">Samoa</option><option value="San Marino">San Marino</option><option value="Sao Tome and Principe">Sao Tome and Principe</option><option value="Saudi Arabia">Saudi Arabia</option><option value="Senegal">Senegal</option><option value="Serbia and Montenegro">Serbia and Montenegro</option><option value="Seychelles">Seychelles</option><option value="Sierra Leone">Sierra Leone</option><option value="Singapore">Singapore</option><option value="Slovakia">Slovakia</option><option value="Slovenia">Slovenia</option><option value="Solomon Islands">Solomon Islands</option><option value="Somalia">Somalia</option><option value="South Africa">South Africa</option><option value="Spain">Spain</option><option value="Sri Lanka">Sri Lanka</option><option value="Sudan">Sudan</option><option value="Suriname">Suriname</option><option value="Swaziland">Swaziland</option><option value="Sweden">Sweden</option><option value="Switzerland">Switzerland</option><option value="Syria">Syria</option><option value="Taiwan">Taiwan</option><option value="Tajikistan">Tajikistan</option><option value="Tanzania">Tanzania</option><option value="Thailand">Thailand</option><option value="Togo">Togo</option><option value="Tonga">Tonga</option><option value="Trinidad and Tobago">Trinidad and Tobago</option><option value="Tunisia">Tunisia</option><option value="Turkey">Turkey</option><option value="Turkmenistan">Turkmenistan</option><option value="Tuvalu">Tuvalu</option><option value="Uganda">Uganda</option><option value="Ukraine">Ukraine</option><option value="United Arab Emirates">United Arab Emirates</option><option value="United Kingdom">United Kingdom</option><option value="United States">United States</option><option value="Uruguay">Uruguay</option><option value="Uzbekistan">Uzbekistan</option><option value="Vanuatu">Vanuatu</option><option value="Vatican City">Vatican City</option><option value="Venezuela">Venezuela</option><option value="Vietnam">Vietnam</option><option value="Yemen">Yemen</option><option value="Zambia">Zambia</option><option value="Zimbabwe">Zimbabwe</option></select><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_country">'.$w_mini_labels[5].'</span>';
|
| 582 |
+
}
|
| 583 |
+
|
| 584 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_address" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px; vertical-align:top;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_address" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" name="'.$id.'_disable_fieldsform_id_temp" id="'.$id.'_disable_fieldsform_id_temp" street1="'.$w_disabled_fields[0].'" street2="'.$w_disabled_fields[1].'" city="'.$w_disabled_fields[2].'" state="'.$w_disabled_fields[3].'" postal="'.$w_disabled_fields[4].'" country="'.$w_disabled_fields[5].'" us_states="'.$w_disabled_fields[6].'"><div id="'.$id.'_div_address" style="width: '.$param['w_size'].'px;">'.$address_fields.$hidden_inputs.'</div></div></div>';
|
| 585 |
+
break;
|
| 586 |
+
}
|
| 587 |
+
case 'type_submitter_mail': {
|
| 588 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique', 'w_class');
|
| 589 |
+
$temp=$params;
|
| 590 |
+
if(strpos($temp, 'w_autofill') > -1)
|
| 591 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique', 'w_class', 'w_autofill');
|
| 592 |
+
|
| 593 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 594 |
+
$params_names = array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size','w_first_val','w_title','w_required','w_unique', 'w_class', 'w_autofill');
|
| 595 |
+
|
| 596 |
+
if(strpos($temp, 'w_verification') > -1)
|
| 597 |
+
$params_names = array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size','w_first_val','w_title','w_required','w_unique', 'w_class', 'w_verification', 'w_verification_label', 'w_verification_placeholder', 'w_autofill');
|
| 598 |
+
|
| 599 |
+
|
| 600 |
+
foreach($params_names as $params_name )
|
| 601 |
+
{
|
| 602 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 603 |
+
$param[$params_name] = $temp[0];
|
| 604 |
+
$temp=$temp[1];
|
| 605 |
+
}
|
| 606 |
+
|
| 607 |
+
if($temp)
|
| 608 |
+
{
|
| 609 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 610 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 611 |
+
foreach($attrs as $attr)
|
| 612 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 613 |
+
}
|
| 614 |
+
|
| 615 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 616 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 617 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 618 |
+
|
| 619 |
+
$input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
|
| 620 |
+
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 621 |
+
$param['w_autofill'] = isset($param['w_autofill']) ? $param['w_autofill'] : 'no';
|
| 622 |
+
|
| 623 |
+
if(isset($param['w_verification']) && $param['w_verification'] == "yes"){
|
| 624 |
+
$display_label_confirm = $display_label;
|
| 625 |
+
$display_element_confirm = $param['w_field_label_pos'];
|
| 626 |
+
}
|
| 627 |
+
else{
|
| 628 |
+
$display_label_confirm = "none";
|
| 629 |
+
$display_element_confirm = "none";
|
| 630 |
+
}
|
| 631 |
+
|
| 632 |
+
|
| 633 |
+
$param['w_verification'] = isset($param['w_verification']) ? $param['w_verification'] : "no";
|
| 634 |
+
$param['w_verification_label'] = isset($param['w_verification_label']) ? $param['w_verification_label'] : "E-mail confirmation:";
|
| 635 |
+
$param['w_verification_placeholder'] = isset($param['w_verification_placeholder']) ? $param['w_verification_placeholder'] : "";
|
| 636 |
+
|
| 637 |
+
$confirm_emeil = '<br><div align="left" id="'.$id.'_1_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label_confirm.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_1_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$param['w_verification_label'].'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_1_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_element_confirm.';"><input type="hidden" value="'.$param['w_verification'].'" name="'.$id.'_verification_id_temp" id="'.$id.'_verification_id_temp"><input type="text" class="input_deactive" id="'.$id.'_1_elementform_id_temp" name="'.$id.'_1_elementform_id_temp" value="'.$param['w_verification_placeholder'].'" title="'.$param['w_verification_placeholder'].'" onfocus="delete_value("'.$id.'_elementform_id_temp")" onblur="return_value("'.$id.'_elementform_id_temp")" onchange="change_value("'.$id.'_elementform_id_temp")" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div>';
|
| 638 |
+
|
| 639 |
+
|
| 640 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_submitter_mail" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_submitter_mail" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><input type="hidden" value="'.$param['w_autofill'].'" name="'.$id.'_autofillform_id_temp" id="'.$id.'_autofillform_id_temp"><input type="hidden" value="'.$param['w_verification'].'" name="'.$id.'_verification_id_temp" id="'.$id.'_verification_id_temp"><input type="text" class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" onfocus="delete_value("'.$id.'_elementform_id_temp")" onblur="return_value("'.$id.'_elementform_id_temp")" onchange="change_value("'.$id.'_elementform_id_temp")" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div>'.$confirm_emeil.'</div>';
|
| 641 |
+
break;
|
| 642 |
+
}
|
| 643 |
+
case 'type_checkbox':
|
| 644 |
+
{
|
| 645 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num','w_class');
|
| 646 |
+
$temp=$params;
|
| 647 |
+
if(strpos($temp, 'w_field_option_pos') > -1)
|
| 648 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_field_option_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_value_disabled','w_choices_value', 'w_choices_params', 'w_class');
|
| 649 |
+
|
| 650 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 651 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_field_option_pos', 'w_hide_label', 'w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_value_disabled','w_choices_value', 'w_choices_params', 'w_class');
|
| 652 |
+
|
| 653 |
+
foreach($params_names as $params_name )
|
| 654 |
+
{
|
| 655 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 656 |
+
$param[$params_name] = $temp[0];
|
| 657 |
+
$temp=$temp[1];
|
| 658 |
+
}
|
| 659 |
+
|
| 660 |
+
if($temp)
|
| 661 |
+
{
|
| 662 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 663 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 664 |
+
foreach($attrs as $attr)
|
| 665 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 666 |
+
}
|
| 667 |
+
if(!isset($param['w_value_disabled']))
|
| 668 |
+
$param['w_value_disabled'] = 'no';
|
| 669 |
+
|
| 670 |
+
if(!isset($param['w_field_option_pos']))
|
| 671 |
+
$param['w_field_option_pos'] = 'left';
|
| 672 |
+
|
| 673 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 674 |
+
|
| 675 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 676 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 677 |
+
|
| 678 |
+
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 679 |
+
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 680 |
+
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 681 |
+
|
| 682 |
+
if(isset($param['w_choices_value']))
|
| 683 |
+
{
|
| 684 |
+
$param['w_choices_value'] = explode('***',$param['w_choices_value']);
|
| 685 |
+
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 686 |
+
}
|
| 687 |
+
|
| 688 |
+
foreach($param['w_choices_checked'] as $key => $choices_checked )
|
| 689 |
+
{
|
| 690 |
+
if($choices_checked=='true')
|
| 691 |
+
$param['w_choices_checked'][$key]='checked="checked"';
|
| 692 |
+
else
|
| 693 |
+
$param['w_choices_checked'][$key]='';
|
| 694 |
+
}
|
| 695 |
+
|
| 696 |
+
$rep='<div id="wdform_field'.$id.'" type="type_checkbox" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_checkbox" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_rowcol'].'" name="'.$id.'_rowcol_numform_id_temp" id="'.$id.'_rowcol_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><input type="hidden" value="'.$param['w_value_disabled'].'" name="'.$id.'_value_disabledform_id_temp" id="'.$id.'_value_disabledform_id_temp"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;" '.($param['w_flow']=='hor' ? 'for_hor="'.$id.'_hor"' : '').'>';
|
| 697 |
+
|
| 698 |
+
if($param['w_flow']=='hor')
|
| 699 |
+
{
|
| 700 |
+
$j = 0;
|
| 701 |
+
for($i=0; $i<(int)$param['w_rowcol']; $i++)
|
| 702 |
+
{
|
| 703 |
+
$rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
|
| 704 |
+
|
| 705 |
+
for($l=0; $l<=(int)(count($param['w_choices'])/$param['w_rowcol']); $l++)
|
| 706 |
+
{
|
| 707 |
+
if($j >= count($param['w_choices'])%$param['w_rowcol'] && $l==(int)(count($param['w_choices'])/$param['w_rowcol']))
|
| 708 |
+
continue;
|
| 709 |
+
|
| 710 |
+
if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
|
| 711 |
+
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="checkbox" value="" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" other="1" onclick="if(set_checked("'.$id.'","'.((int)$param['w_rowcol']*$l+$i).'","form_id_temp")) show_other_input("'.$id.'","form_id_temp");" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled /><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'">'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
|
| 712 |
+
else
|
| 713 |
+
{
|
| 714 |
+
$where = '';
|
| 715 |
+
$order_by = '';
|
| 716 |
+
$db_info = '';
|
| 717 |
+
if(isset($param['w_choices_value']))
|
| 718 |
+
$choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$l+$i];
|
| 719 |
+
else
|
| 720 |
+
$choise_value = $param['w_choices'][(int)$param['w_rowcol']*$l+$i];
|
| 721 |
+
|
| 722 |
+
if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$l+$i])
|
| 723 |
+
{
|
| 724 |
+
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$l+$i]);
|
| 725 |
+
$where = "where='".$w_choices_params[0]."'";
|
| 726 |
+
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 727 |
+
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 728 |
+
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 729 |
+
}
|
| 730 |
+
|
| 731 |
+
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="checkbox" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" onclick="set_checked("'.$id.'","'.((int)$param['w_rowcol']*$l+$i).'","form_id_temp")" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
|
| 732 |
+
}
|
| 733 |
+
}
|
| 734 |
+
|
| 735 |
+
$j++;
|
| 736 |
+
$rep.='</div>';
|
| 737 |
+
|
| 738 |
+
}
|
| 739 |
+
|
| 740 |
+
}
|
| 741 |
+
else
|
| 742 |
+
{
|
| 743 |
+
for($i=0; $i<(int)(count($param['w_choices'])/$param['w_rowcol']); $i++)
|
| 744 |
+
{
|
| 745 |
+
$rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
|
| 746 |
+
|
| 747 |
+
if(count($param['w_choices']) > (int)$param['w_rowcol'])
|
| 748 |
+
for($l=0; $l<$param['w_rowcol']; $l++)
|
| 749 |
+
{
|
| 750 |
+
if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
|
| 751 |
+
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" other="1" onclick="if(set_checked("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")) show_other_input("'.$id.'","form_id_temp");" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled /><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
|
| 752 |
+
else
|
| 753 |
+
{
|
| 754 |
+
$where = '' ;
|
| 755 |
+
$order_by = '' ;
|
| 756 |
+
$db_info = '' ;
|
| 757 |
+
if(isset($param['w_choices_value']))
|
| 758 |
+
$choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$i+$l];
|
| 759 |
+
else
|
| 760 |
+
$choise_value = $param['w_choices'][(int)$param['w_rowcol']*$i+$l];
|
| 761 |
+
|
| 762 |
+
if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$i+$l])
|
| 763 |
+
{
|
| 764 |
+
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$i+$l]);
|
| 765 |
+
$where = "where='".$w_choices_params[0]."'";
|
| 766 |
+
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 767 |
+
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 768 |
+
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 769 |
+
}
|
| 770 |
+
|
| 771 |
+
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" onclick="set_checked("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'"
|
| 772 |
+
'.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
|
| 773 |
+
}
|
| 774 |
+
}
|
| 775 |
+
else
|
| 776 |
+
for($l=0; $l<count($param['w_choices']); $l++)
|
| 777 |
+
{
|
| 778 |
+
if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
|
| 779 |
+
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" other="1" onclick="if(set_checked("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")) show_other_input("'.$id.'","form_id_temp");" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
|
| 780 |
+
else
|
| 781 |
+
{
|
| 782 |
+
$where = '' ;
|
| 783 |
+
$order_by = '' ;
|
| 784 |
+
$db_info = '' ;
|
| 785 |
+
if(isset($param['w_choices_value']))
|
| 786 |
+
$choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$i+$l];
|
| 787 |
+
else
|
| 788 |
+
$choise_value = $param['w_choices'][(int)$param['w_rowcol']*$i+$l];
|
| 789 |
+
|
| 790 |
+
if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$i+$l])
|
| 791 |
+
{
|
| 792 |
+
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$i+$l]);
|
| 793 |
+
$where = "where='".$w_choices_params[0]."'";
|
| 794 |
+
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 795 |
+
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 796 |
+
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 797 |
+
}
|
| 798 |
+
|
| 799 |
+
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" onclick="set_checked("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
|
| 800 |
+
}
|
| 801 |
+
}
|
| 802 |
+
|
| 803 |
+
$rep.='</div>';
|
| 804 |
+
}
|
| 805 |
+
|
| 806 |
+
if(count($param['w_choices'])%$param['w_rowcol']!=0)
|
| 807 |
+
{
|
| 808 |
+
$rep.='<div id="'.$id.'_element_tr'.((int)(count($param['w_choices'])/(int)$param['w_rowcol'])).'" style="display: table-row;">';
|
| 809 |
+
|
| 810 |
+
for($k=0; $k<count($param['w_choices'])%$param['w_rowcol']; $k++)
|
| 811 |
+
{
|
| 812 |
+
$l = count($param['w_choices']) - count($param['w_choices'])%$param['w_rowcol'] + $k;
|
| 813 |
+
if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$l)
|
| 814 |
+
$rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="checkbox" value="" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp'.$l.'" other="1" onclick="if(set_checked("'.$id.'","'.$l.'","form_id_temp")) show_other_input("'.$id.'","form_id_temp");" '.$param['w_choices_checked'][$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$l.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
|
| 815 |
+
else
|
| 816 |
+
{
|
| 817 |
+
$where = '' ;
|
| 818 |
+
$order_by = '' ;
|
| 819 |
+
$db_info = '' ;
|
| 820 |
+
if(isset($param['w_choices_value']))
|
| 821 |
+
$choise_value = $param['w_choices_value'][$l];
|
| 822 |
+
else
|
| 823 |
+
$choise_value = $param['w_choices'][$l];
|
| 824 |
+
|
| 825 |
+
if(isset($param['w_choices_params']) && $param['w_choices_params'][$l])
|
| 826 |
+
{
|
| 827 |
+
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$l]);
|
| 828 |
+
$where = "where='".$w_choices_params[0]."'";
|
| 829 |
+
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 830 |
+
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 831 |
+
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 832 |
+
}
|
| 833 |
+
$rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="checkbox" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp'.$l.'" onclick="set_checked("'.$id.'","'.$l.'","form_id_temp")" '.$param['w_choices_checked'][$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$l.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$l.'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][$l].'</label></div>';
|
| 834 |
+
}
|
| 835 |
+
}
|
| 836 |
+
|
| 837 |
+
$rep.='</div>';
|
| 838 |
+
}
|
| 839 |
+
|
| 840 |
+
|
| 841 |
+
|
| 842 |
+
}
|
| 843 |
+
$rep.='</div></div></div></div>';
|
| 844 |
+
break;
|
| 845 |
+
}
|
| 846 |
+
case 'type_radio':
|
| 847 |
+
{
|
| 848 |
+
|
| 849 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num','w_class');
|
| 850 |
+
$temp=$params;
|
| 851 |
+
if(strpos($temp, 'w_field_option_pos') > -1)
|
| 852 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_field_option_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_value_disabled', 'w_choices_value', 'w_choices_params','w_class');
|
| 853 |
+
|
| 854 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 855 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_field_option_pos', 'w_hide_label', 'w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_value_disabled', 'w_choices_value', 'w_choices_params','w_class');
|
| 856 |
+
foreach($params_names as $params_name )
|
| 857 |
+
{
|
| 858 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 859 |
+
$param[$params_name] = $temp[0];
|
| 860 |
+
$temp=$temp[1];
|
| 861 |
+
}
|
| 862 |
+
|
| 863 |
+
if($temp)
|
| 864 |
+
{
|
| 865 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 866 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 867 |
+
foreach($attrs as $attr)
|
| 868 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 869 |
+
}
|
| 870 |
+
if(!isset($param['w_value_disabled']))
|
| 871 |
+
$param['w_value_disabled'] = 'no';
|
| 872 |
+
|
| 873 |
+
if(!isset($param['w_field_option_pos']))
|
| 874 |
+
$param['w_field_option_pos'] = 'left';
|
| 875 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 876 |
+
|
| 877 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 878 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 879 |
+
|
| 880 |
+
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 881 |
+
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 882 |
+
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 883 |
+
|
| 884 |
+
if(isset($param['w_choices_value']))
|
| 885 |
+
{
|
| 886 |
+
$param['w_choices_value'] = explode('***',$param['w_choices_value']);
|
| 887 |
+
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 888 |
+
}
|
| 889 |
+
|
| 890 |
+
foreach($param['w_choices_checked'] as $key => $choices_checked )
|
| 891 |
+
{
|
| 892 |
+
if($choices_checked=='true')
|
| 893 |
+
$param['w_choices_checked'][$key]='checked="checked"';
|
| 894 |
+
else
|
| 895 |
+
$param['w_choices_checked'][$key]='';
|
| 896 |
+
}
|
| 897 |
+
|
| 898 |
+
$rep='<div id="wdform_field'.$id.'" type="type_radio" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_radio" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_rowcol'].'" name="'.$id.'_rowcol_numform_id_temp" id="'.$id.'_rowcol_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><input type="hidden" value="'.$param['w_value_disabled'].'" name="'.$id.'_value_disabledform_id_temp" id="'.$id.'_value_disabledform_id_temp"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;" '.($param['w_flow']=='hor' ? 'for_hor="'.$id.'_hor"' : '').'>';
|
| 899 |
+
|
| 900 |
+
|
| 901 |
+
if($param['w_flow']=='hor')
|
| 902 |
+
{
|
| 903 |
+
$j = 0;
|
| 904 |
+
for($i=0; $i<(int)$param['w_rowcol']; $i++)
|
| 905 |
+
{
|
| 906 |
+
$rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
|
| 907 |
+
|
| 908 |
+
for($l=0; $l<=(int)(count($param['w_choices'])/$param['w_rowcol']); $l++)
|
| 909 |
+
{
|
| 910 |
+
if($j >= count($param['w_choices'])%$param['w_rowcol'] && $l==(int)(count($param['w_choices'])/$param['w_rowcol']))
|
| 911 |
+
continue;
|
| 912 |
+
|
| 913 |
+
if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$l+$i)
|
| 914 |
+
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp" other="1" onclick="set_default("'.$id.'","'.((int)$param['w_rowcol']*$l+$i).'","form_id_temp"); show_other_input("'.$id.'","form_id_temp");" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'">'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
|
| 915 |
+
else
|
| 916 |
+
{
|
| 917 |
+
$where = '' ;
|
| 918 |
+
$order_by = '' ;
|
| 919 |
+
$db_info = '' ;
|
| 920 |
+
if(isset($param['w_choices_value']))
|
| 921 |
+
$choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$l+$i];
|
| 922 |
+
else
|
| 923 |
+
$choise_value = $param['w_choices'][(int)$param['w_rowcol']*$l+$i];
|
| 924 |
+
|
| 925 |
+
if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$l+$i])
|
| 926 |
+
{
|
| 927 |
+
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$l+$i]);
|
| 928 |
+
$where = "where='".$w_choices_params[0]."'";
|
| 929 |
+
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 930 |
+
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 931 |
+
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 932 |
+
}
|
| 933 |
+
|
| 934 |
+
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="radio" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp" onclick="set_default("'.$id.'","'.((int)$param['w_rowcol']*$l+$i).'","form_id_temp")" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
|
| 935 |
+
}
|
| 936 |
+
}
|
| 937 |
+
|
| 938 |
+
$j++;
|
| 939 |
+
$rep.='</div>';
|
| 940 |
+
|
| 941 |
+
}
|
| 942 |
+
|
| 943 |
+
}
|
| 944 |
+
else
|
| 945 |
+
{
|
| 946 |
+
for($i=0; $i<(int)(count($param['w_choices'])/$param['w_rowcol']); $i++)
|
| 947 |
+
{
|
| 948 |
+
$rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
|
| 949 |
+
|
| 950 |
+
if(count($param['w_choices']) > (int)$param['w_rowcol'])
|
| 951 |
+
for($l=0; $l<$param['w_rowcol']; $l++)
|
| 952 |
+
{
|
| 953 |
+
if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
|
| 954 |
+
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" other="1" onclick="set_default("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp"); show_other_input("'.$id.'","form_id_temp");" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
|
| 955 |
+
else
|
| 956 |
+
{
|
| 957 |
+
$where = '' ;
|
| 958 |
+
$order_by = '' ;
|
| 959 |
+
$db_info = '' ;
|
| 960 |
+
if(isset($param['w_choices_value']))
|
| 961 |
+
$choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$i+$l];
|
| 962 |
+
else
|
| 963 |
+
$choise_value = $param['w_choices'][(int)$param['w_rowcol']*$i+$l];
|
| 964 |
+
|
| 965 |
+
if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$i+$l])
|
| 966 |
+
{
|
| 967 |
+
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$i+$l]);
|
| 968 |
+
$where = "where='".$w_choices_params[0]."'";
|
| 969 |
+
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 970 |
+
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 971 |
+
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 972 |
+
}
|
| 973 |
+
|
| 974 |
+
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" onclick="set_default("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
|
| 975 |
+
}
|
| 976 |
+
}
|
| 977 |
+
else
|
| 978 |
+
for($l=0; $l<count($param['w_choices']); $l++)
|
| 979 |
+
{
|
| 980 |
+
if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
|
| 981 |
+
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" other="1" onclick="set_default("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp"); show_other_input("'.$id.'","form_id_temp");" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
|
| 982 |
+
else
|
| 983 |
+
{
|
| 984 |
+
$where = '' ;
|
| 985 |
+
$order_by = '' ;
|
| 986 |
+
$db_info = '' ;
|
| 987 |
+
if(isset($param['w_choices_value']))
|
| 988 |
+
$choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$i+$l];
|
| 989 |
+
else
|
| 990 |
+
$choise_value = $param['w_choices'][(int)$param['w_rowcol']*$i+$l];
|
| 991 |
+
|
| 992 |
+
if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$i+$l])
|
| 993 |
+
{
|
| 994 |
+
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$i+$l]);
|
| 995 |
+
$where = "where='".$w_choices_params[0]."'";
|
| 996 |
+
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 997 |
+
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 998 |
+
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 999 |
+
}
|
| 1000 |
+
|
| 1001 |
+
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" onclick="set_default("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
|
| 1002 |
+
}
|
| 1003 |
+
}
|
| 1004 |
+
|
| 1005 |
+
$rep.='</div>';
|
| 1006 |
+
}
|
| 1007 |
+
|
| 1008 |
+
if(count($param['w_choices'])%$param['w_rowcol']!=0)
|
| 1009 |
+
{
|
| 1010 |
+
$rep.='<div id="'.$id.'_element_tr'.((int)(count($param['w_choices'])/(int)$param['w_rowcol'])).'" style="display: table-row;">';
|
| 1011 |
+
|
| 1012 |
+
for($k=0; $k<count($param['w_choices'])%$param['w_rowcol']; $k++)
|
| 1013 |
+
{
|
| 1014 |
+
$l = count($param['w_choices']) - count($param['w_choices'])%$param['w_rowcol'] + $k;
|
| 1015 |
+
if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$l)
|
| 1016 |
+
$rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][$l].'" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp" other="1" onclick="set_default("'.$id.'","'.$l.'","form_id_temp"); show_other_input("'.$id.'","form_id_temp");" '.$param['w_choices_checked'][$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$l.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
|
| 1017 |
+
else
|
| 1018 |
+
{
|
| 1019 |
+
$where = '' ;
|
| 1020 |
+
$order_by = '' ;
|
| 1021 |
+
$db_info = '' ;
|
| 1022 |
+
if(isset($param['w_choices_value']))
|
| 1023 |
+
$choise_value = $param['w_choices_value'][$l];
|
| 1024 |
+
else
|
| 1025 |
+
$choise_value = $param['w_choices'][$l];
|
| 1026 |
+
|
| 1027 |
+
if(isset($param['w_choices_params']) && $param['w_choices_params'][$l])
|
| 1028 |
+
{
|
| 1029 |
+
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$l]);
|
| 1030 |
+
$where = "where='".$w_choices_params[0]."'";
|
| 1031 |
+
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 1032 |
+
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 1033 |
+
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 1034 |
+
}
|
| 1035 |
+
|
| 1036 |
+
$rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="radio" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp" onclick="set_default("'.$id.'","'.$l.'","form_id_temp")" '.$param['w_choices_checked'][$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$l.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$l.'"
|
| 1037 |
+
'.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][$l].'</label></div>';
|
| 1038 |
+
}
|
| 1039 |
+
}
|
| 1040 |
+
|
| 1041 |
+
$rep.='</div>';
|
| 1042 |
+
}
|
| 1043 |
+
|
| 1044 |
+
}
|
| 1045 |
+
|
| 1046 |
+
|
| 1047 |
+
|
| 1048 |
+
$rep.='</div></div></div></div>';
|
| 1049 |
+
|
| 1050 |
+
break;
|
| 1051 |
+
}
|
| 1052 |
+
case 'type_own_select':
|
| 1053 |
+
{
|
| 1054 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_checked', 'w_choices_disabled','w_required','w_class');
|
| 1055 |
+
$temp=$params;
|
| 1056 |
+
if(strpos($temp, 'w_choices_value') > -1)
|
| 1057 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_checked', 'w_choices_disabled', 'w_required', 'w_value_disabled', 'w_choices_value', 'w_choices_params', 'w_class');
|
| 1058 |
+
|
| 1059 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 1060 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size','w_choices','w_choices_checked', 'w_choices_disabled', 'w_required', 'w_value_disabled', 'w_choices_value', 'w_choices_params', 'w_class');
|
| 1061 |
+
|
| 1062 |
+
foreach($params_names as $params_name )
|
| 1063 |
+
{
|
| 1064 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1065 |
+
$param[$params_name] = $temp[0];
|
| 1066 |
+
$temp=$temp[1];
|
| 1067 |
+
}
|
| 1068 |
+
|
| 1069 |
+
if($temp)
|
| 1070 |
+
{
|
| 1071 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1072 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1073 |
+
foreach($attrs as $attr)
|
| 1074 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1075 |
+
}
|
| 1076 |
+
|
| 1077 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1078 |
+
|
| 1079 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1080 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1081 |
+
|
| 1082 |
+
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 1083 |
+
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 1084 |
+
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 1085 |
+
$param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
|
| 1086 |
+
|
| 1087 |
+
if(isset($param['w_choices_value']))
|
| 1088 |
+
{
|
| 1089 |
+
$param['w_choices_value'] = explode('***',$param['w_choices_value']);
|
| 1090 |
+
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 1091 |
+
}
|
| 1092 |
+
|
| 1093 |
+
if(!isset($param['w_value_disabled']))
|
| 1094 |
+
$param['w_value_disabled'] = 'no';
|
| 1095 |
+
|
| 1096 |
+
foreach($param['w_choices_checked'] as $key => $choices_checked )
|
| 1097 |
+
{
|
| 1098 |
+
if($choices_checked=='true')
|
| 1099 |
+
$param['w_choices_checked'][$key]='selected="selected"';
|
| 1100 |
+
else
|
| 1101 |
+
$param['w_choices_checked'][$key]='';
|
| 1102 |
+
}
|
| 1103 |
+
|
| 1104 |
+
$rep='<div id="wdform_field'.$id.'" type="type_own_select" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; "><input type="hidden" value="type_own_select" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_value_disabled'].'" name="'.$id.'_value_disabledform_id_temp" id="'.$id.'_value_disabledform_id_temp"><select id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" onchange="set_select(this)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled>';
|
| 1105 |
+
foreach($param['w_choices'] as $key => $choice)
|
| 1106 |
+
{
|
| 1107 |
+
$where = '';
|
| 1108 |
+
$order_by = '';
|
| 1109 |
+
$db_info = '';
|
| 1110 |
+
$choice_value = $param['w_choices_disabled'][$key]=='true' ? '' : (isset($param['w_choices_value']) ? $param['w_choices_value'][$key] : $choice);
|
| 1111 |
+
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 1112 |
+
{
|
| 1113 |
+
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 1114 |
+
$where = "where='".$w_choices_params[0]."'";
|
| 1115 |
+
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 1116 |
+
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 1117 |
+
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 1118 |
+
}
|
| 1119 |
+
|
| 1120 |
+
$rep.='<option id="'.$id.'_option'.$key.'" value="'.$choice_value.'" onselect="set_select("'.$id.'_option'.$key.'")" '.$param['w_choices_checked'][$key].' '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</option>';
|
| 1121 |
+
}
|
| 1122 |
+
$rep.='</select></div></div>';
|
| 1123 |
+
break;
|
| 1124 |
+
}
|
| 1125 |
+
|
| 1126 |
+
case 'type_country':
|
| 1127 |
+
{
|
| 1128 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_countries','w_required','w_class');
|
| 1129 |
+
$temp=$params;
|
| 1130 |
+
|
| 1131 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 1132 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size','w_countries','w_required','w_class');
|
| 1133 |
+
|
| 1134 |
+
foreach($params_names as $params_name )
|
| 1135 |
+
{
|
| 1136 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1137 |
+
$param[$params_name] = $temp[0];
|
| 1138 |
+
$temp=$temp[1];
|
| 1139 |
+
}
|
| 1140 |
+
|
| 1141 |
+
if($temp)
|
| 1142 |
+
{
|
| 1143 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1144 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1145 |
+
foreach($attrs as $attr)
|
| 1146 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1147 |
+
}
|
| 1148 |
+
|
| 1149 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1150 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1151 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1152 |
+
|
| 1153 |
+
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 1154 |
+
$param['w_countries'] = explode('***',$param['w_countries']);
|
| 1155 |
+
|
| 1156 |
+
$rep='<div id="wdform_field'.$id.'" type="type_country" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; "><input type="hidden" value="type_country" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><select id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled>';
|
| 1157 |
+
foreach($param['w_countries'] as $key => $choice)
|
| 1158 |
+
{
|
| 1159 |
+
$choice_value=$choice;
|
| 1160 |
+
$rep.='<option value="'.$choice_value.'">'.$choice.'</option>';
|
| 1161 |
+
}
|
| 1162 |
+
$rep.='</select></div></div>';
|
| 1163 |
+
break;
|
| 1164 |
+
}
|
| 1165 |
+
|
| 1166 |
+
case 'type_time':
|
| 1167 |
+
{
|
| 1168 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_time_type','w_am_pm','w_sec','w_hh','w_mm','w_ss','w_mini_labels','w_required','w_class');
|
| 1169 |
+
$temp=$params;
|
| 1170 |
+
|
| 1171 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 1172 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_time_type', 'w_am_pm','w_sec','w_hh','w_mm','w_ss','w_mini_labels','w_required','w_class');
|
| 1173 |
+
|
| 1174 |
+
foreach($params_names as $params_name )
|
| 1175 |
+
{
|
| 1176 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1177 |
+
$param[$params_name] = $temp[0];
|
| 1178 |
+
$temp=$temp[1];
|
| 1179 |
+
}
|
| 1180 |
+
|
| 1181 |
+
if($temp)
|
| 1182 |
+
{
|
| 1183 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1184 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1185 |
+
foreach($attrs as $attr)
|
| 1186 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1187 |
+
}
|
| 1188 |
+
|
| 1189 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1190 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1191 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1192 |
+
|
| 1193 |
+
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 1194 |
+
|
| 1195 |
+
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
| 1196 |
+
|
| 1197 |
+
|
| 1198 |
+
if($param['w_sec']=='1')
|
| 1199 |
+
{
|
| 1200 |
+
$w_sec = '<div align="center" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;"> : </span></div><div id="'.$id.'_td_time_input3" style="width: 32px; display: table-cell;"><input type="text" value="'.$param['w_ss'].'" class="time_box" id="'.$id.'_ssform_id_temp" name="'.$id.'_ssform_id_temp" onkeypress="return check_second(event, "'.$id.'_ssform_id_temp")" onkeyup="change_second("'.$id.'_ssform_id_temp")" onblur="add_0("'.$id.'_ssform_id_temp")" '.$param['attributes'].' disabled /></div>';
|
| 1201 |
+
$w_sec_label='<div style="display: table-cell;"></div><div id="'.$id.'_td_time_label3" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_ss">'.$w_mini_labels[2].'</label></div>';
|
| 1202 |
+
}
|
| 1203 |
+
else
|
| 1204 |
+
{
|
| 1205 |
+
$w_sec = '';
|
| 1206 |
+
$w_sec_label='';
|
| 1207 |
+
}
|
| 1208 |
+
|
| 1209 |
+
if($param['w_time_type']=='12')
|
| 1210 |
+
{
|
| 1211 |
+
if($param['w_am_pm']=='am')
|
| 1212 |
+
{
|
| 1213 |
+
$am_ = "selected=\"selected\"";
|
| 1214 |
+
$pm_ = "";
|
| 1215 |
+
}
|
| 1216 |
+
else
|
| 1217 |
+
{
|
| 1218 |
+
$am_ = "";
|
| 1219 |
+
$pm_ = "selected=\"selected\"";
|
| 1220 |
+
|
| 1221 |
+
}
|
| 1222 |
+
|
| 1223 |
+
$w_time_type = '<div id="'.$id.'_am_pm_select" class="td_am_pm_select" style="display: table-cell;"><select class="am_pm_select" name="'.$id.'_am_pmform_id_temp" id="'.$id.'_am_pmform_id_temp" onchange="set_sel_am_pm(this)" '.$param['attributes'].'><option value="am" '.$am_.'>AM</option><option value="pm" '.$pm_.'>PM</option></select></div>';
|
| 1224 |
+
|
| 1225 |
+
$w_time_type_label = '<div id="'.$id.'_am_pm_label" class="td_am_pm_select" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_am_pm">'.$w_mini_labels[3].'</label></div>';
|
| 1226 |
+
|
| 1227 |
+
}
|
| 1228 |
+
else
|
| 1229 |
+
{
|
| 1230 |
+
$w_time_type='';
|
| 1231 |
+
$w_time_type_label = '';
|
| 1232 |
+
}
|
| 1233 |
+
|
| 1234 |
+
|
| 1235 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_time" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_time" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><div id="'.$id.'_table_time" style="display: table;"><div id="'.$id.'_tr_time1" style="display: table-row;"><div id="'.$id.'_td_time_input1" style="width: 32px; display: table-cell;"><input type="text" value="'.$param['w_hh'].'" class="time_box" id="'.$id.'_hhform_id_temp" name="'.$id.'_hhform_id_temp" onkeypress="return check_hour(event, "'.$id.'_hhform_id_temp", "23")" onkeyup="change_hour(event, "'.$id.'_hhform_id_temp","23")" onblur="add_0("'.$id.'_hhform_id_temp")" '.$param['attributes'].' disabled/></div><div align="center" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;"> : </span></div><div id="'.$id.'_td_time_input2" style="width: 32px; display: table-cell;"><input type="text" value="'.$param['w_mm'].'" class="time_box" id="'.$id.'_mmform_id_temp" name="'.$id.'_mmform_id_temp" onkeypress="return check_minute(event, "'.$id.'_mmform_id_temp")" onkeyup="change_minute(event, "'.$id.'_mmform_id_temp")" onblur="add_0("'.$id.'_mmform_id_temp")" '.$param['attributes'].' disabled/></div>'.$w_sec.$w_time_type.'</div><div id="'.$id.'_tr_time2" style="display: table-row;"><div id="'.$id.'_td_time_label1" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_hh">'.$w_mini_labels[0].'</label></div><div style="display: table-cell;"></div><div id="'.$id.'_td_time_label2" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_mm">'.$w_mini_labels[1].'</label></div>'.$w_sec_label.$w_time_type_label.'</div></div></div></div>';
|
| 1236 |
+
|
| 1237 |
+
break;
|
| 1238 |
+
}
|
| 1239 |
+
case 'type_date':
|
| 1240 |
+
{
|
| 1241 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val');
|
| 1242 |
+
$temp = $params;
|
| 1243 |
+
if(strpos($temp, 'w_disable_past_days') > -1)
|
| 1244 |
+
$params_names = array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val', 'w_disable_past_days');
|
| 1245 |
+
foreach($params_names as $params_name )
|
| 1246 |
+
{
|
| 1247 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1248 |
+
$param[$params_name] = $temp[0];
|
| 1249 |
+
$temp=$temp[1];
|
| 1250 |
+
}
|
| 1251 |
+
|
| 1252 |
+
if($temp)
|
| 1253 |
+
{
|
| 1254 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1255 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1256 |
+
foreach($attrs as $attr)
|
| 1257 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1258 |
+
}
|
| 1259 |
+
|
| 1260 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1261 |
+
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 1262 |
+
$param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
|
| 1263 |
+
$disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
|
| 1264 |
+
|
| 1265 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_date" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_date" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_disable_past_days'].'" name="'.$id.'_dis_past_daysform_id_temp" id="'.$id.'_dis_past_daysform_id_temp"><input type="text" value="'.$param['w_date'].'" class="wdform-date" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" maxlength="10" size="10" onchange="change_value("'.$id.'_elementform_id_temp")" '.$param['attributes'].' disabled/><input id="'.$id.'_buttonform_id_temp" class="button" type="reset" value="'.$param['w_but_val'].'" format="'.$param['w_format'].'" src="templates/bluestork/images/system/calendar.png?ver='. WD_FM_VERSION.'" alt="calendario" '.$param['attributes'].' onclick="return showCalendar("'.$id.'_elementform_id_temp" , "'.$param['w_format'].'", '.$disable_past_days.')"></div></div>';
|
| 1266 |
+
|
| 1267 |
+
break;
|
| 1268 |
+
}
|
| 1269 |
+
|
| 1270 |
+
///////////////////////// type_date_new ////////////////////////////
|
| 1271 |
+
|
| 1272 |
+
case 'type_date_new':
|
| 1273 |
+
{
|
| 1274 |
+
|
| 1275 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_size', 'w_date','w_required', 'w_show_image', 'w_class','w_format', 'w_start_day', 'w_default_date', 'w_min_date', 'w_max_date', 'w_invalid_dates', 'w_show_days', 'w_hide_time', 'w_but_val', 'w_disable_past_days');
|
| 1276 |
+
$temp = $params;
|
| 1277 |
+
|
| 1278 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 1279 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size', 'w_date','w_required', 'w_show_image', 'w_class','w_format', 'w_start_day', 'w_default_date', 'w_min_date', 'w_max_date', 'w_invalid_dates', 'w_show_days', 'w_hide_time', 'w_but_val', 'w_disable_past_days');
|
| 1280 |
+
|
| 1281 |
+
|
| 1282 |
+
foreach($params_names as $params_name )
|
| 1283 |
+
{
|
| 1284 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1285 |
+
$param[$params_name] = $temp[0];
|
| 1286 |
+
$temp=$temp[1];
|
| 1287 |
+
}
|
| 1288 |
+
|
| 1289 |
+
if($temp)
|
| 1290 |
+
{
|
| 1291 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1292 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1293 |
+
foreach($attrs as $attr)
|
| 1294 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1295 |
+
}
|
| 1296 |
+
|
| 1297 |
+
|
| 1298 |
+
$w_show_week_days = explode('***', $param['w_show_days']);
|
| 1299 |
+
|
| 1300 |
+
|
| 1301 |
+
|
| 1302 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1303 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1304 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1305 |
+
|
| 1306 |
+
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 1307 |
+
$param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
|
| 1308 |
+
$disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
|
| 1309 |
+
$display_image_date = $param['w_show_image'] == 'yes' ? 'inline' : 'none';
|
| 1310 |
+
|
| 1311 |
+
|
| 1312 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_date_new" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_date_new" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp">
|
| 1313 |
+
<input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp">
|
| 1314 |
+
|
| 1315 |
+
<input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/>
|
| 1316 |
+
|
| 1317 |
+
<input type="hidden" value="'.$param['w_show_image'].'" name="'.$id.'_show_imageform_id_temp" id="'.$id.'_show_imageform_id_temp">
|
| 1318 |
+
|
| 1319 |
+
<input type="hidden" value="'.$param['w_disable_past_days'].'" name="'.$id.'_dis_past_daysform_id_temp" id="'.$id.'_dis_past_daysform_id_temp">
|
| 1320 |
+
|
| 1321 |
+
<input type="hidden" value="'.$param['w_default_date'].'" name="'.$id.'_default_date_id_temp" id="'.$id.'_default_date_id_temp">
|
| 1322 |
+
<input type="hidden" value="'.$param['w_min_date'].'" name="'.$id.'_min_date_id_temp" id="'.$id.'_min_date_id_temp">
|
| 1323 |
+
<input type="hidden" value="'.$param['w_max_date'].'" name="'.$id.'_max_date_id_temp" id="'.$id.'_max_date_id_temp">
|
| 1324 |
+
<input type="hidden" value="'.$param['w_invalid_dates'].'" name="'.$id.'_invalid_dates_id_temp" id="'.$id.'_invalid_dates_id_temp">
|
| 1325 |
+
|
| 1326 |
+
<input type="hidden" value="'.$param['w_start_day'].'" name="'.$id.'_start_dayform_id_temp" id="'.$id.'_start_dayform_id_temp">
|
| 1327 |
+
|
| 1328 |
+
<input type="hidden" value="'.$param['w_hide_time'].'" name="'.$id.'_hide_timeform_id_temp" id="'.$id.'_hide_timeform_id_temp">
|
| 1329 |
+
|
| 1330 |
+
<input type="hidden" name="'.$id.'_show_week_days" id="'.$id.'_show_week_days" sunday="'.$w_show_week_days[0].'" monday="'.$w_show_week_days[1].'" tuesday="'.$w_show_week_days[2].'" wednesday="'.$w_show_week_days[3].'" thursday="'.$w_show_week_days[4].'" friday="'.$w_show_week_days[5].'" saturday="'.$w_show_week_days[6].'">
|
| 1331 |
+
|
| 1332 |
+
|
| 1333 |
+
|
| 1334 |
+
<input type="text" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled/>
|
| 1335 |
+
<img src="' . WD_FM_URL . '/images/date.png" id="'.$id.'_show_imagedateform_id_temp" name="'.$id.'_show_imagedateform_id_temp" style="vertical-align : text-top; margin-left : 1px; display:'.$display_image_date.'">
|
| 1336 |
+
|
| 1337 |
+
<input id="'.$id.'_buttonform_id_temp" type="hidden" value="'.$param['w_but_val'].'" format="'.$param['w_format'].'" ></div></div>';
|
| 1338 |
+
|
| 1339 |
+
break;
|
| 1340 |
+
}
|
| 1341 |
+
|
| 1342 |
+
|
| 1343 |
+
|
| 1344 |
+
case 'type_date_range':
|
| 1345 |
+
{
|
| 1346 |
+
|
| 1347 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_size', 'w_date','w_required', 'w_show_image', 'w_class','w_format', 'w_start_day', 'w_default_date_start', 'w_default_date_end', 'w_min_date', 'w_max_date', 'w_invalid_dates', 'w_show_days', 'w_hide_time', 'w_but_val', 'w_disable_past_days');
|
| 1348 |
+
$temp = $params;
|
| 1349 |
+
|
| 1350 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 1351 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size', 'w_date','w_required', 'w_show_image', 'w_class','w_format', 'w_start_day', 'w_default_date_start', 'w_default_date_end', 'w_min_date', 'w_max_date', 'w_invalid_dates', 'w_show_days', 'w_hide_time', 'w_but_val', 'w_disable_past_days');
|
| 1352 |
+
|
| 1353 |
+
|
| 1354 |
+
foreach($params_names as $params_name )
|
| 1355 |
+
{
|
| 1356 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1357 |
+
$param[$params_name] = $temp[0];
|
| 1358 |
+
$temp=$temp[1];
|
| 1359 |
+
}
|
| 1360 |
+
|
| 1361 |
+
if($temp)
|
| 1362 |
+
{
|
| 1363 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1364 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1365 |
+
foreach($attrs as $attr)
|
| 1366 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1367 |
+
}
|
| 1368 |
+
|
| 1369 |
+
|
| 1370 |
+
$w_show_week_days = explode('***', $param['w_show_days']);
|
| 1371 |
+
$defaul_day_array = explode(',', $param['w_date']);
|
| 1372 |
+
$defaul_day_start = $defaul_day_array[0];
|
| 1373 |
+
$defaul_day_end = $defaul_day_array[1];
|
| 1374 |
+
|
| 1375 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1376 |
+
|
| 1377 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1378 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1379 |
+
|
| 1380 |
+
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 1381 |
+
$param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
|
| 1382 |
+
$disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
|
| 1383 |
+
$display_image_date = $param['w_show_image'] == 'yes' ? 'inline' : 'none';
|
| 1384 |
+
|
| 1385 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_date_range" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';">
|
| 1386 |
+
|
| 1387 |
+
<input type="hidden" value="type_date_range" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp">
|
| 1388 |
+
|
| 1389 |
+
<input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp">
|
| 1390 |
+
|
| 1391 |
+
<input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/>
|
| 1392 |
+
|
| 1393 |
+
<input type="hidden" value="'.$param['w_show_image'].'" name="'.$id.'_show_imageform_id_temp" id="'.$id.'_show_imageform_id_temp">
|
| 1394 |
+
|
| 1395 |
+
<input type="hidden" value="'.$param['w_disable_past_days'].'" name="'.$id.'_dis_past_daysform_id_temp" id="'.$id.'_dis_past_daysform_id_temp">
|
| 1396 |
+
|
| 1397 |
+
<input type="hidden" value="'.$param['w_default_date_start'].'" name="'.$id.'_default_date_id_temp_start" id="'.$id.'_default_date_id_temp_start">
|
| 1398 |
+
|
| 1399 |
+
<input type="hidden" value="'.$param['w_default_date_end'].'" name="'.$id.'_default_date_id_temp_end" id="'.$id.'_default_date_id_temp_end">
|
| 1400 |
+
|
| 1401 |
+
<input type="hidden" value="'.$param['w_min_date'].'" name="'.$id.'_min_date_id_temp" id="'.$id.'_min_date_id_temp">
|
| 1402 |
+
|
| 1403 |
+
<input type="hidden" value="'.$param['w_max_date'].'" name="'.$id.'_max_date_id_temp" id="'.$id.'_max_date_id_temp">
|
| 1404 |
+
|
| 1405 |
+
<input type="hidden" value="'.$param['w_invalid_dates'].'" name="'.$id.'_invalid_dates_id_temp" id="'.$id.'_invalid_dates_id_temp">
|
| 1406 |
+
|
| 1407 |
+
<input type="hidden" value="'.$param['w_start_day'].'" name="'.$id.'_start_dayform_id_temp" id="'.$id.'_start_dayform_id_temp">
|
| 1408 |
+
|
| 1409 |
+
<input type="hidden" value="'.$param['w_hide_time'].'" name="'.$id.'_hide_timeform_id_temp" id="'.$id.'_hide_timeform_id_temp">
|
| 1410 |
+
|
| 1411 |
+
<input type="hidden" name="'.$id.'_show_week_days" id="'.$id.'_show_week_days" sunday="'.$w_show_week_days[0].'" monday="'.$w_show_week_days[1].'" tuesday="'.$w_show_week_days[2].'" wednesday="'.$w_show_week_days[3].'" thursday="'.$w_show_week_days[4].'" friday="'.$w_show_week_days[5].'" saturday="'.$w_show_week_days[6].'">
|
| 1412 |
+
|
| 1413 |
+
|
| 1414 |
+
|
| 1415 |
+
|
| 1416 |
+
|
| 1417 |
+
<input type="text" id="'.$id.'_elementform_id_temp0" name="'.$id.'_elementform_id_temp0" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled/>
|
| 1418 |
+
<img src="' . WD_FM_URL . '/images/date.png" id="'.$id.'_show_imagedateform_id_temp0" name="'.$id.'_show_imagedateform_id_temp0" style="vertical-align : text-top; margin-left : 1px; display:'.$display_image_date.'">
|
| 1419 |
+
|
| 1420 |
+
<span>-</span>
|
| 1421 |
+
|
| 1422 |
+
<input type="text" id="'.$id.'_elementform_id_temp1" name="'.$id.'_elementform_id_temp1" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled/>
|
| 1423 |
+
<img src="' . WD_FM_URL . '/images/date.png" id="'.$id.'_show_imagedateform_id_temp1" name="'.$id.'_show_imagedateform_id_temp1" style="vertical-align : text-top; margin-left : 1px; display:'.$display_image_date.'">
|
| 1424 |
+
|
| 1425 |
+
<input id="'.$id.'_buttonform_id_temp" type="hidden" value="'.$param['w_but_val'].'" format="'.$param['w_format'].'" >
|
| 1426 |
+
|
| 1427 |
+
</div></div>';
|
| 1428 |
+
|
| 1429 |
+
|
| 1430 |
+
|
| 1431 |
+
break;
|
| 1432 |
+
}
|
| 1433 |
+
|
| 1434 |
+
|
| 1435 |
+
|
| 1436 |
+
|
| 1437 |
+
|
| 1438 |
+
case 'type_date_fields':
|
| 1439 |
+
{
|
| 1440 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_day','w_month','w_year','w_day_type','w_month_type','w_year_type','w_day_label','w_month_label','w_year_label','w_day_size','w_month_size','w_year_size','w_required','w_class','w_from','w_to','w_divider');
|
| 1441 |
+
|
| 1442 |
+
$temp=$params;
|
| 1443 |
+
|
| 1444 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 1445 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_day','w_month','w_year','w_day_type','w_month_type','w_year_type','w_day_label','w_month_label','w_year_label','w_day_size','w_month_size','w_year_size','w_required','w_class','w_from','w_to','w_divider');
|
| 1446 |
+
|
| 1447 |
+
|
| 1448 |
+
foreach($params_names as $params_name )
|
| 1449 |
+
{
|
| 1450 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1451 |
+
$param[$params_name] = $temp[0];
|
| 1452 |
+
$temp=$temp[1];
|
| 1453 |
+
}
|
| 1454 |
+
|
| 1455 |
+
if($temp)
|
| 1456 |
+
{
|
| 1457 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1458 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1459 |
+
foreach($attrs as $attr)
|
| 1460 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1461 |
+
}
|
| 1462 |
+
|
| 1463 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1464 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1465 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1466 |
+
|
| 1467 |
+
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 1468 |
+
|
| 1469 |
+
|
| 1470 |
+
if($param['w_day_type']=="SELECT")
|
| 1471 |
+
{
|
| 1472 |
+
|
| 1473 |
+
|
| 1474 |
+
$w_day_type = '<select id="'.$id.'_dayform_id_temp" name="'.$id.'_dayform_id_temp" onchange="set_select(this)" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].' disabled><option value=""></option>';
|
| 1475 |
+
for($k=0; $k<=31; $k++)
|
| 1476 |
+
{
|
| 1477 |
+
if($k<10)
|
| 1478 |
+
{
|
| 1479 |
+
if($param['w_day']=='0'.$k)
|
| 1480 |
+
$selected = "selected=\"selected\"";
|
| 1481 |
+
else
|
| 1482 |
+
$selected = "";
|
| 1483 |
+
|
| 1484 |
+
$w_day_type .= '<option value="0'.$k.'" '.$selected.'>0'.$k.'</option>';
|
| 1485 |
+
}
|
| 1486 |
+
else
|
| 1487 |
+
{
|
| 1488 |
+
if($param['w_day']==''.$k)
|
| 1489 |
+
$selected = "selected=\"selected\"";
|
| 1490 |
+
else
|
| 1491 |
+
$selected = "";
|
| 1492 |
+
|
| 1493 |
+
$w_day_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
|
| 1494 |
+
}
|
| 1495 |
+
|
| 1496 |
+
|
| 1497 |
+
|
| 1498 |
+
}
|
| 1499 |
+
$w_day_type .= '</select>';
|
| 1500 |
+
}
|
| 1501 |
+
else
|
| 1502 |
+
{
|
| 1503 |
+
$w_day_type = '<input type="text" value="'.$param['w_day'].'" id="'.$id.'_dayform_id_temp" name="'.$id.'_dayform_id_temp" onchange="change_value("'.$id.'_dayform_id_temp")" onkeypress="return check_day(event, "'.$id.'_dayform_id_temp")" onblur="if (this.value=="0") this.value=""; else add_0("'.$id.'_dayform_id_temp")" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].' disabled/>';
|
| 1504 |
+
}
|
| 1505 |
+
|
| 1506 |
+
if($param['w_month_type']=="SELECT")
|
| 1507 |
+
{
|
| 1508 |
+
|
| 1509 |
+
$w_month_type = '<select id="'.$id.'_monthform_id_temp" name="'.$id.'_monthform_id_temp" onchange="set_select(this)" style="width: '.$param['w_month_size'].'px;" '.$param['attributes'].' disabled><option value=""></option><option value="01" '.($param['w_month']=="01" ? "selected=\"selected\"": "").' ><!--repstart-->January<!--repend--></option><option value="02" '.($param['w_month']=="02" ? "selected=\"selected\"": "").'><!--repstart-->February<!--repend--></option><option value="03" '.($param['w_month']=="03"? "selected=\"selected\"": "").'><!--repstart-->March<!--repend--></option><option value="04" '.($param['w_month']=="04" ? "selected=\"selected\"": "").' ><!--repstart-->April<!--repend--></option><option value="05" '.($param['w_month']=="05" ? "selected=\"selected\"": "").' ><!--repstart-->May<!--repend--></option><option value="06" '.($param['w_month']=="06" ? "selected=\"selected\"": "").' ><!--repstart-->June<!--repend--></option><option value="07" '.($param['w_month']=="07" ? "selected=\"selected\"": "").' ><!--repstart-->July<!--repend--></option><option value="08" '.($param['w_month']=="08" ? "selected=\"selected\"": "").' ><!--repstart-->August<!--repend--></option><option value="09" '.($param['w_month']=="09" ? "selected=\"selected\"": "").' ><!--repstart-->September<!--repend--></option><option value="10" '.($param['w_month']=="10" ? "selected=\"selected\"": "").' ><!--repstart-->October<!--repend--></option><option value="11" '.($param['w_month']=="11" ? "selected=\"selected\"": "").'><!--repstart-->November<!--repend--></option><option value="12" '.($param['w_month']=="12" ? "selected=\"selected\"": "").' ><!--repstart-->December<!--repend--></option></select>';
|
| 1510 |
+
|
| 1511 |
+
}
|
| 1512 |
+
else
|
| 1513 |
+
{
|
| 1514 |
+
$w_month_type = '<input type="text" value="'.$param['w_month'].'" id="'.$id.'_monthform_id_temp" name="'.$id.'_monthform_id_temp" onkeypress="return check_month(event, "'.$id.'_monthform_id_temp")" onchange="change_value("'.$id.'_monthform_id_temp")" onblur="if (this.value=="0") this.value=""; else add_0("'.$id.'_monthform_id_temp")" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].' disabled/>';
|
| 1515 |
+
|
| 1516 |
+
}
|
| 1517 |
+
$param['w_to'] = isset($param['w_to']) && $param['w_to']!="NaN" ? $param['w_to'] : date("Y");
|
| 1518 |
+
if($param['w_year_type']=="SELECT")
|
| 1519 |
+
{
|
| 1520 |
+
$w_year_type = '<select id="'.$id.'_yearform_id_temp" name="'.$id.'_yearform_id_temp" onchange="set_select(this)" from="'.$param['w_from'].'" to="'.$param['w_to'].'" style="width: '.$param['w_year_size'].'px;" '.$param['attributes'].' disabled><option value=""></option>';
|
| 1521 |
+
for($k=$param['w_to']; $k>=$param['w_from']; $k--)
|
| 1522 |
+
{
|
| 1523 |
+
if($param['w_year']==$k)
|
| 1524 |
+
$selected = "selected=\"selected\"";
|
| 1525 |
+
else
|
| 1526 |
+
$selected = "";
|
| 1527 |
+
|
| 1528 |
+
$w_year_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
|
| 1529 |
+
}
|
| 1530 |
+
$w_year_type .= '</select>';
|
| 1531 |
+
|
| 1532 |
+
}
|
| 1533 |
+
else
|
| 1534 |
+
{
|
| 1535 |
+
$w_year_type = '<input type="text" value="'.$param['w_year'].'" id="'.$id.'_yearform_id_temp" name="'.$id.'_yearform_id_temp" onchange="change_year("'.$id.'_yearform_id_temp")" onkeypress="return check_year1(event, "'.$id.'_yearform_id_temp")" onblur="check_year2("'.$id.'_yearform_id_temp")" from="'.$param['w_from'].'" to="'.$param['w_to'].'" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].' disabled/>';
|
| 1536 |
+
}
|
| 1537 |
+
|
| 1538 |
+
|
| 1539 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_date_fields" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_date_fields" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><div id="'.$id.'_table_date" style="display: table;"><div id="'.$id.'_tr_date1" style="display: table-row;"><div id="'.$id.'_td_date_input1" style="display: table-cell;">
|
| 1540 |
+
'.$w_day_type.'
|
| 1541 |
+
|
| 1542 |
+
</div><div id="'.$id.'_td_date_separator1" style="display: table-cell;"><span id="'.$id.'_separator1" class="wdform_separator">'.$param['w_divider'].'</span></div><div id="'.$id.'_td_date_input2" style="display: table-cell;">'.$w_month_type.'</div><div id="'.$id.'_td_date_separator2" style="display: table-cell;"><span id="'.$id.'_separator2" class="wdform_separator">'.$param['w_divider'].'</span></div><div id="'.$id.'_td_date_input3" style="display: table-cell;">'.$w_year_type.'</div></div><div id="'.$id.'_tr_date2" style="display: table-row;"><div id="'.$id.'_td_date_label1" style="display: table-cell;"><label class="mini_label" id="'.$id.'_day_label">'.$param['w_day_label'].'</label></div><div style="display: table-cell;"></div><div id="'.$id.'_td_date_label2" style="display: table-cell;"><label class="mini_label" id="'.$id.'_month_label">'.$param['w_month_label'].'</label></div><div style="display: table-cell;"></div><div id="'.$id.'_td_date_label3" style="display: table-cell;"><label class="mini_label" id="'.$id.'_year_label">'.$param['w_year_label'].'</label></div></div></div></div></div>';
|
| 1543 |
+
|
| 1544 |
+
break;
|
| 1545 |
+
}
|
| 1546 |
+
case 'type_file_upload':
|
| 1547 |
+
{
|
| 1548 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_destination','w_extension','w_max_size','w_required','w_multiple','w_class');
|
| 1549 |
+
$temp=$params;
|
| 1550 |
+
|
| 1551 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 1552 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_destination','w_extension','w_max_size','w_required','w_multiple','w_class');
|
| 1553 |
+
|
| 1554 |
+
|
| 1555 |
+
foreach($params_names as $params_name )
|
| 1556 |
+
{
|
| 1557 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1558 |
+
$param[$params_name] = $temp[0];
|
| 1559 |
+
if (isset($temp[1])) {
|
| 1560 |
+
$temp = $temp[1];
|
| 1561 |
+
}
|
| 1562 |
+
else {
|
| 1563 |
+
$temp = '';
|
| 1564 |
+
}
|
| 1565 |
+
}
|
| 1566 |
+
|
| 1567 |
+
if($temp)
|
| 1568 |
+
{
|
| 1569 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1570 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1571 |
+
foreach($attrs as $attr)
|
| 1572 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1573 |
+
}
|
| 1574 |
+
|
| 1575 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1576 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1577 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1578 |
+
|
| 1579 |
+
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 1580 |
+
$multiple = ($param['w_multiple']=="yes" ? "multiple='multiple'" : "");
|
| 1581 |
+
|
| 1582 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_file_upload" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_file_upload" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="***max_sizeskizb'.$id.'***'.$param['w_max_size'].'***max_sizeverj'.$id.'***" id="'.$id.'_max_size" name="'.$id.'_max_size"><input type="hidden" value="***destinationskizb'.$id.'***'.$param['w_destination'].'***destinationverj'.$id.'***" id="'.$id.'_destination" name="'.$id.'_destination"><input type="hidden" value="***extensionskizb'.$id.'***'.$param['w_extension'].'***extensionverj'.$id.'***" id="'.$id.'_extension" name="'.$id.'_extension"><input type="file" class="file_upload" id="'.$id.'_elementform_id_temp" name="'.$id.'_fileform_id_temp" '.$multiple.' '.$param['attributes'].' disabled/></div></div>';
|
| 1583 |
+
|
| 1584 |
+
break;
|
| 1585 |
+
}
|
| 1586 |
+
case 'type_captcha':
|
| 1587 |
+
{
|
| 1588 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_digit','w_class');
|
| 1589 |
+
$temp=$params;
|
| 1590 |
+
|
| 1591 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 1592 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_digit','w_class');
|
| 1593 |
+
|
| 1594 |
+
foreach($params_names as $params_name )
|
| 1595 |
+
{
|
| 1596 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1597 |
+
$param[$params_name] = $temp[0];
|
| 1598 |
+
$temp=$temp[1];
|
| 1599 |
+
}
|
| 1600 |
+
|
| 1601 |
+
if($temp)
|
| 1602 |
+
{
|
| 1603 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1604 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1605 |
+
foreach($attrs as $attr)
|
| 1606 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1607 |
+
}
|
| 1608 |
+
|
| 1609 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1610 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1611 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1612 |
+
|
| 1613 |
+
|
| 1614 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_captcha" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display:'.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_captcha" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div style="display: table;"><div style="display: table-row;"><div valign="middle" style="display: table-cell;"><img type="captcha" digit="'.$param['w_digit'].'" src="' . add_query_arg(array('action' => 'formmakerwdcaptcha', 'digit' => $param['w_digit'], 'i' => 'form_id_temp'), admin_url('admin-ajax.php')) . '" id="_wd_captchaform_id_temp" class="captcha_img" onclick="captcha_refresh("_wd_captcha","form_id_temp")" '.$param['attributes'].'></div><div valign="middle" style="display: table-cell;"><div class="captcha_refresh" id="_element_refreshform_id_temp" onclick="captcha_refresh("_wd_captcha","form_id_temp")" '.$param['attributes'].'></div></div></div><div style="display: table-row;"><div style="display: table-cell;"><input type="text" class="captcha_input" id="_wd_captcha_inputform_id_temp" name="captcha_input" style="width: '.($param['w_digit']*10+15).'px;" '.$param['attributes'].' disabled/><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/></div></div></div></div></div>';
|
| 1615 |
+
|
| 1616 |
+
break;
|
| 1617 |
+
}
|
| 1618 |
+
case 'type_arithmetic_captcha':
|
| 1619 |
+
{
|
| 1620 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_count', 'w_operations','w_class', 'w_input_size');
|
| 1621 |
+
$temp=$params;
|
| 1622 |
+
|
| 1623 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 1624 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_count', 'w_operations','w_class', 'w_input_size');
|
| 1625 |
+
|
| 1626 |
+
|
| 1627 |
+
foreach($params_names as $params_name )
|
| 1628 |
+
{
|
| 1629 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1630 |
+
$param[$params_name] = $temp[0];
|
| 1631 |
+
$temp=$temp[1];
|
| 1632 |
+
}
|
| 1633 |
+
|
| 1634 |
+
if($temp)
|
| 1635 |
+
{
|
| 1636 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1637 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1638 |
+
foreach($attrs as $attr)
|
| 1639 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1640 |
+
}
|
| 1641 |
+
|
| 1642 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1643 |
+
|
| 1644 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1645 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1646 |
+
$param['w_count'] = $param['w_count'] ? $param['w_count'] : 1;
|
| 1647 |
+
$param['w_operations'] = $param['w_operations'] ? $param['w_operations'] : '+, -, *, /';
|
| 1648 |
+
$param['w_input_size'] = $param['w_input_size'] ? $param['w_input_size'] : 60;
|
| 1649 |
+
|
| 1650 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_arithmetic_captcha" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display:'.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_captcha" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div style="display: table;"><div style="display: table-row;"><div style="display: table-cell;"><img type="captcha" operations_count="'.$param['w_count'].'" operations="'.$param['w_operations'].'" input_size="'.$param['w_input_size'].'" src="' . add_query_arg(array('action' => 'formmakerwdmathcaptcha', 'operations_count' => $param['w_count'], 'operations' => urlencode($param['w_operations']), 'i' => 'form_id_temp'), admin_url('admin-ajax.php')) . '" id="_wd_arithmetic_captchaform_id_temp" class="arithmetic_captcha_img" onclick="captcha_refresh("_wd_arithmetic_captcha","form_id_temp")" '.$param['attributes'].'></div><div style="display: table-cell;"><input type="text" class="arithmetic_captcha_input" id="_wd_arithmetic_captcha_inputform_id_temp" name="arithmetic_captcha_input" onkeypress="return check_isnum(event)" style="width: '.$param['w_input_size'].'px;" '.$param['attributes'].' disabled/><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/></div><div style="display: table-cell; vertical-align: middle;"><div class="captcha_refresh" id="_element_refreshform_id_temp" onclick="captcha_refresh("_wd_arithmetic_captcha","form_id_temp")" '.$param['attributes'].'></div></div></div></div></div></div>';
|
| 1651 |
+
|
| 1652 |
+
break;
|
| 1653 |
+
}
|
| 1654 |
+
|
| 1655 |
+
|
| 1656 |
+
case 'type_recaptcha':
|
| 1657 |
+
{
|
| 1658 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_public','w_private','w_theme','w_class');
|
| 1659 |
+
$temp=$params;
|
| 1660 |
+
|
| 1661 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 1662 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_public','w_private','w_theme','w_class');
|
| 1663 |
+
|
| 1664 |
+
foreach($params_names as $params_name )
|
| 1665 |
+
{
|
| 1666 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1667 |
+
$param[$params_name] = $temp[0];
|
| 1668 |
+
$temp=$temp[1];
|
| 1669 |
+
}
|
| 1670 |
+
|
| 1671 |
+
if($temp)
|
| 1672 |
+
{
|
| 1673 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1674 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1675 |
+
foreach($attrs as $attr)
|
| 1676 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1677 |
+
}
|
| 1678 |
+
|
| 1679 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1680 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1681 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1682 |
+
|
| 1683 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_recaptcha" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_recaptcha" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><div id="wd_recaptchaform_id_temp" public_key="'.$param['w_public'].'" private_key="'.$param['w_private'].'" theme="'.$param['w_theme'].'" '.$param['attributes'].'><span style="color: red; font-style: italic;">Recaptcha doesn\'t display in back end</span></div></div></div>';
|
| 1684 |
+
|
| 1685 |
+
break;
|
| 1686 |
+
}
|
| 1687 |
+
|
| 1688 |
+
case 'type_hidden':
|
| 1689 |
+
{
|
| 1690 |
+
$params_names=array('w_name','w_value');
|
| 1691 |
+
$temp=$params;
|
| 1692 |
+
foreach($params_names as $params_name )
|
| 1693 |
+
{
|
| 1694 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1695 |
+
$param[$params_name] = $temp[0];
|
| 1696 |
+
$temp=$temp[1];
|
| 1697 |
+
}
|
| 1698 |
+
|
| 1699 |
+
if($temp)
|
| 1700 |
+
{
|
| 1701 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1702 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1703 |
+
foreach($attrs as $attr)
|
| 1704 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1705 |
+
}
|
| 1706 |
+
$param['w_name'] = str_replace(' ','',$param['w_name']);
|
| 1707 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_hidden" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" style="display: table-cell;"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">'.$param['w_name'].'</span><span style="color: red; font-size: 13px;">Hidden field</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" style="display: table-cell; padding-left:7px;"><input type="hidden" value="'.$param['w_value'].'" id="'.$id.'_elementform_id_temp" name="'.$param['w_name'].'" '.$param['attributes'].'><input type="hidden" value="type_hidden" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div><span align="left">Name: </span><span align="left" id="'.$id.'_hidden_nameform_id_temp">'.$param['w_name'].'</span></div><div><span align="left">Value: </span><span align="left" id="'.$id.'_hidden_valueform_id_temp">'.$param['w_value'].'</span></div></div></div>';
|
| 1708 |
+
|
| 1709 |
+
break;
|
| 1710 |
+
}
|
| 1711 |
+
case 'type_mark_map':
|
| 1712 |
+
{
|
| 1713 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class');
|
| 1714 |
+
$temp=$params;
|
| 1715 |
+
|
| 1716 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 1717 |
+
$params_names = array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class');
|
| 1718 |
+
|
| 1719 |
+
|
| 1720 |
+
foreach($params_names as $params_name )
|
| 1721 |
+
{
|
| 1722 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1723 |
+
$param[$params_name] = $temp[0];
|
| 1724 |
+
$temp=$temp[1];
|
| 1725 |
+
}
|
| 1726 |
+
|
| 1727 |
+
if($temp)
|
| 1728 |
+
{
|
| 1729 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1730 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1731 |
+
foreach($attrs as $attr)
|
| 1732 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1733 |
+
}
|
| 1734 |
+
|
| 1735 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1736 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1737 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1738 |
+
|
| 1739 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_mark_map" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="type_mark_map" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div id="'.$id.'_elementform_id_temp" long0="'.$param['w_long'].'" lat0="'.$param['w_lat'].'" zoom="'.$param['w_zoom'].'" info0="'.$param['w_info'].'" center_x="'.$param['w_center_x'].'" center_y="'.$param['w_center_y'].'" style="width: '.$param['w_width'].'px; height: '.$param['w_height'].'px;" '.$param['attributes'].'></div></div></div> ';
|
| 1740 |
+
|
| 1741 |
+
break;
|
| 1742 |
+
}
|
| 1743 |
+
|
| 1744 |
+
case 'type_map':
|
| 1745 |
+
{
|
| 1746 |
+
$params_names=array('w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class');
|
| 1747 |
+
$temp=$params;
|
| 1748 |
+
foreach($params_names as $params_name )
|
| 1749 |
+
{
|
| 1750 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1751 |
+
$param[$params_name] = $temp[0];
|
| 1752 |
+
$temp=$temp[1];
|
| 1753 |
+
}
|
| 1754 |
+
|
| 1755 |
+
if($temp)
|
| 1756 |
+
{
|
| 1757 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1758 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1759 |
+
foreach($attrs as $attr)
|
| 1760 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1761 |
+
}
|
| 1762 |
+
|
| 1763 |
+
$marker='';
|
| 1764 |
+
|
| 1765 |
+
$param['w_long'] = explode('***',$param['w_long']);
|
| 1766 |
+
$param['w_lat'] = explode('***',$param['w_lat']);
|
| 1767 |
+
$param['w_info'] = explode('***',$param['w_info']);
|
| 1768 |
+
foreach($param['w_long'] as $key => $w_long )
|
| 1769 |
+
{
|
| 1770 |
+
$marker.='long'.$key.'="'.$w_long.'" lat'.$key.'="'.$param['w_lat'][$key].'" info'.$key.'="'.$param['w_info'][$key].'"';
|
| 1771 |
+
}
|
| 1772 |
+
|
| 1773 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_map" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><input type="hidden" value="type_map" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div id="'.$id.'_elementform_id_temp" zoom="'.$param['w_zoom'].'" center_x="'.$param['w_center_x'].'" center_y="'.$param['w_center_y'].'" style="width: '.$param['w_width'].'px; height: '.$param['w_height'].'px;" '.$marker.' '.$param['attributes'].'></div></div></div>';
|
| 1774 |
+
|
| 1775 |
+
break;
|
| 1776 |
+
}
|
| 1777 |
+
case 'type_paypal_price':
|
| 1778 |
+
{
|
| 1779 |
+
|
| 1780 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_first_val','w_title', 'w_mini_labels','w_size','w_required','w_hide_cents','w_class','w_range_min','w_range_max');
|
| 1781 |
+
$temp=$params;
|
| 1782 |
+
foreach($params_names as $params_name )
|
| 1783 |
+
{
|
| 1784 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1785 |
+
$param[$params_name] = $temp[0];
|
| 1786 |
+
$temp=$temp[1];
|
| 1787 |
+
}
|
| 1788 |
+
|
| 1789 |
+
if($temp)
|
| 1790 |
+
{
|
| 1791 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1792 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1793 |
+
foreach($attrs as $attr)
|
| 1794 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1795 |
+
}
|
| 1796 |
+
|
| 1797 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1798 |
+
$input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
|
| 1799 |
+
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 1800 |
+
$hide_cents = ($param['w_hide_cents']=="yes" ? "none;" : "table-cell;");
|
| 1801 |
+
|
| 1802 |
+
|
| 1803 |
+
$w_first_val = explode('***',$param['w_first_val']);
|
| 1804 |
+
$w_title = explode('***',$param['w_title']);
|
| 1805 |
+
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
| 1806 |
+
|
| 1807 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_paypal_price" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required"style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_paypal_price" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_range_min'].'" name="'.$id.'_range_minform_id_temp" id="'.$id.'_range_minform_id_temp"><input type="hidden" value="'.$param['w_range_max'].'" name="'.$id.'_range_maxform_id_temp" id="'.$id.'_range_maxform_id_temp"><div id="'.$id.'_table_price" style="display: table;"><div id="'.$id.'_tr_price1" style="display: table-row;"><div id="'.$id.'_td_name_currency" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;"><!--repstart--> $ <!--repend--></span></div><div id="'.$id.'_td_name_dollars" style="display: table-cell;"><input type="text" class="'.$input_active.'" id="'.$id.'_element_dollarsform_id_temp" name="'.$id.'_element_dollarsform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'"onfocus="delete_value("'.$id.'_element_dollarsform_id_temp")" onblur="return_value("'.$id.'_element_dollarsform_id_temp")"onchange="change_value("'.$id.'_element_dollarsform_id_temp")" onkeypress="return check_isnum(event)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled/></div><div id="'.$id.'_td_name_divider" style="display: '.$hide_cents.';"><span class="wdform_colon" style="vertical-align: middle;"> . </span></div><div id="'.$id.'_td_name_cents" style="display: '.$hide_cents.'"><input type="text" class="'.$input_active.'" id="'.$id.'_element_centsform_id_temp" name="'.$id.'_element_centsform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'"onfocus="delete_value("'.$id.'_element_centsform_id_temp")" onblur="return_value("'.$id.'_element_centsform_id_temp"); add_0("'.$id.'_element_centsform_id_temp")"onchange="change_value("'.$id.'_element_centsform_id_temp")" onkeypress="return check_isnum_interval(event,"'.$id.'_element_centsform_id_temp",0,99)"style="width: 30px;" '.$param['attributes'].' disabled/></div></div><div id="'.$id.'_tr_price2" style="display: table-row;"><div style="display: table-cell;"><label class="mini_label"></label></div><div align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_dollars">'.$w_mini_labels[0].'</label></div><div id="'.$id.'_td_name_label_divider" style="display: '.$hide_cents.'"><label class="mini_label"></label></div><div align="left" id="'.$id.'_td_name_label_cents" style="display: '.$hide_cents.'"><label class="mini_label" id="'.$id.'_mini_label_cents">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
|
| 1808 |
+
break;
|
| 1809 |
+
}
|
| 1810 |
+
|
| 1811 |
+
case 'type_paypal_price_new':
|
| 1812 |
+
{
|
| 1813 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_first_val','w_title', 'w_size','w_required', 'w_class','w_range_min','w_range_max', 'w_readonly', 'w_currency');
|
| 1814 |
+
|
| 1815 |
+
$temp=$params;
|
| 1816 |
+
|
| 1817 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 1818 |
+
$params_names = array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_first_val','w_title', 'w_size','w_required', 'w_class','w_range_min','w_range_max', 'w_readonly', 'w_currency');
|
| 1819 |
+
|
| 1820 |
+
|
| 1821 |
+
foreach($params_names as $params_name )
|
| 1822 |
+
{
|
| 1823 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1824 |
+
$param[$params_name] = $temp[0];
|
| 1825 |
+
$temp=$temp[1];
|
| 1826 |
+
}
|
| 1827 |
+
|
| 1828 |
+
if($temp)
|
| 1829 |
+
{
|
| 1830 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1831 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1832 |
+
foreach($attrs as $attr)
|
| 1833 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1834 |
+
}
|
| 1835 |
+
|
| 1836 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1837 |
+
|
| 1838 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1839 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1840 |
+
|
| 1841 |
+
$input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
|
| 1842 |
+
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 1843 |
+
$currency_sumbol = ($param['w_currency']=="yes" ? "display:none;" : "display: table-cell;");
|
| 1844 |
+
$param['w_readonly'] = (isset($param['w_readonly']) ? $param['w_readonly'] : "no");
|
| 1845 |
+
|
| 1846 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_paypal_price_new" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required"style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_paypal_price_new" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_readonly'].'" name="'.$id.'_readonlyform_id_temp" id="'.$id.'_readonlyform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_range_min'].'" name="'.$id.'_range_minform_id_temp" id="'.$id.'_range_minform_id_temp"><input type="hidden" value="'.$param['w_range_max'].'" name="'.$id.'_range_maxform_id_temp" id="'.$id.'_range_maxform_id_temp"><div id="'.$id.'_table_price" style="display: table;"><div id="'.$id.'_tr_price1" style="display: table-row;"><div id="'.$id.'_td_name_currency" style="'.$currency_sumbol.'"><span class="wdform_colon" style="vertical-align: middle;"><!--repstart--> $ <!--repend--></span></div><div id="'.$id.'_td_name_dollars" style="display: table-cell;"><input type="text" class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'"onfocus="delete_value("'.$id.'_elementform_id_temp")" onblur="return_value("'.$id.'_elementform_id_temp")"onchange="change_value("'.$id.'_elementform_id_temp")" onkeypress="return check_isnum(event)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled/></div></div></div></div></div>';
|
| 1847 |
+
break;
|
| 1848 |
+
}
|
| 1849 |
+
|
| 1850 |
+
|
| 1851 |
+
|
| 1852 |
+
|
| 1853 |
+
|
| 1854 |
+
case 'type_paypal_select':
|
| 1855 |
+
{
|
| 1856 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_price','w_choices_checked', 'w_choices_disabled','w_required','w_quantity', 'w_quantity_value','w_class','w_property','w_property_values');
|
| 1857 |
+
$temp=$params;
|
| 1858 |
+
if(strpos($temp, 'w_choices_params') > -1)
|
| 1859 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_price','w_choices_checked', 'w_choices_disabled','w_required','w_quantity', 'w_quantity_value', 'w_choices_params', 'w_class', 'w_property', 'w_property_values');
|
| 1860 |
+
|
| 1861 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 1862 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size','w_choices','w_choices_price','w_choices_checked', 'w_choices_disabled','w_required','w_quantity', 'w_quantity_value', 'w_choices_params', 'w_class', 'w_property', 'w_property_values');
|
| 1863 |
+
|
| 1864 |
+
foreach($params_names as $params_name )
|
| 1865 |
+
{
|
| 1866 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1867 |
+
$param[$params_name] = $temp[0];
|
| 1868 |
+
$temp=$temp[1];
|
| 1869 |
+
}
|
| 1870 |
+
|
| 1871 |
+
if($temp)
|
| 1872 |
+
{
|
| 1873 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1874 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1875 |
+
foreach($attrs as $attr)
|
| 1876 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1877 |
+
}
|
| 1878 |
+
|
| 1879 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1880 |
+
|
| 1881 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1882 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1883 |
+
|
| 1884 |
+
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 1885 |
+
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 1886 |
+
|
| 1887 |
+
$param['w_choices_price'] = explode('***',$param['w_choices_price']);
|
| 1888 |
+
|
| 1889 |
+
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 1890 |
+
|
| 1891 |
+
$param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
|
| 1892 |
+
$param['w_property'] = explode('***',$param['w_property']);
|
| 1893 |
+
$param['w_property_values'] = explode('***',$param['w_property_values']);
|
| 1894 |
+
if(isset($param['w_choices_params']))
|
| 1895 |
+
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 1896 |
+
foreach($param['w_choices_checked'] as $key => $choices_checked )
|
| 1897 |
+
{
|
| 1898 |
+
if($choices_checked=='true')
|
| 1899 |
+
$param['w_choices_checked'][$key]='selected="selected"';
|
| 1900 |
+
else
|
| 1901 |
+
$param['w_choices_checked'][$key]='';
|
| 1902 |
+
}
|
| 1903 |
+
|
| 1904 |
+
|
| 1905 |
+
$rep='<div id="wdform_field'.$id.'" type="type_paypal_select" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; "><input type="hidden" value="type_paypal_select" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><select id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" onchange="set_select(this)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled>';
|
| 1906 |
+
foreach($param['w_choices'] as $key => $choice)
|
| 1907 |
+
{
|
| 1908 |
+
$where = '';
|
| 1909 |
+
$order_by = '';
|
| 1910 |
+
$db_info = '';
|
| 1911 |
+
$choice_value = $param['w_choices_disabled'][$key]=="true" ? '' : $param['w_choices_price'][$key];
|
| 1912 |
+
|
| 1913 |
+
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 1914 |
+
{
|
| 1915 |
+
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 1916 |
+
$where = "where='".$w_choices_params[0]."'";
|
| 1917 |
+
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 1918 |
+
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 1919 |
+
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 1920 |
+
}
|
| 1921 |
+
$rep.='<option id="'.$id.'_option'.$key.'" value="'.$choice_value.'" onselect="set_select("'.$id.'_option'.$key.'")" '.$param['w_choices_checked'][$key].' '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</option>';
|
| 1922 |
+
}
|
| 1923 |
+
$rep.='</select><div id="'.$id.'_divform_id_temp">';
|
| 1924 |
+
if($param['w_quantity']=="yes")
|
| 1925 |
+
$rep.='<span id="'.$id.'_element_quantity_spanform_id_temp" style="margin-right: 15px;"><label class="mini_label" id="'.$id.'_element_quantity_label_form_id_temp" style="margin-right: 5px;"><!--repstart-->Quantity<!--repend--></label><input type="text" value="'.$param['w_quantity_value'].'" id="'.$id.'_element_quantityform_id_temp" name="'.$id.'_element_quantityform_id_temp" onkeypress="return check_isnum(event)" onchange="change_value("'.$id.'_element_quantityform_id_temp", this.value)" style="width: 30px; margin: 2px 0px;" disabled /></span>';
|
| 1926 |
+
if($param['w_property'][0])
|
| 1927 |
+
foreach($param['w_property'] as $key => $property)
|
| 1928 |
+
{
|
| 1929 |
+
|
| 1930 |
+
$rep.='
|
| 1931 |
+
<span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
|
| 1932 |
+
|
| 1933 |
+
<label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
|
| 1934 |
+
<select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;" disabled>';
|
| 1935 |
+
$param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
|
| 1936 |
+
$param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
|
| 1937 |
+
foreach($param['w_property_values'][$key] as $subkey => $property_value)
|
| 1938 |
+
{
|
| 1939 |
+
$rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
|
| 1940 |
+
}
|
| 1941 |
+
$rep.='</select></span>';
|
| 1942 |
+
}
|
| 1943 |
+
|
| 1944 |
+
$rep.='</div></div></div>';
|
| 1945 |
+
break;
|
| 1946 |
+
}
|
| 1947 |
+
|
| 1948 |
+
case 'type_paypal_checkbox':
|
| 1949 |
+
{
|
| 1950 |
+
|
| 1951 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_class','w_property','w_property_values','w_quantity','w_quantity_value');
|
| 1952 |
+
$temp=$params;
|
| 1953 |
+
if(strpos($temp, 'w_field_option_pos') > -1)
|
| 1954 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_choices_params', 'w_class','w_property','w_property_values','w_quantity','w_quantity_value');
|
| 1955 |
+
|
| 1956 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 1957 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_hide_label', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_choices_params', 'w_class','w_property','w_property_values','w_quantity','w_quantity_value');
|
| 1958 |
+
foreach($params_names as $params_name )
|
| 1959 |
+
{
|
| 1960 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1961 |
+
$param[$params_name] = $temp[0];
|
| 1962 |
+
$temp=$temp[1];
|
| 1963 |
+
}
|
| 1964 |
+
|
| 1965 |
+
if($temp)
|
| 1966 |
+
{
|
| 1967 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1968 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1969 |
+
foreach($attrs as $attr)
|
| 1970 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 1971 |
+
}
|
| 1972 |
+
if(!isset($param['w_field_option_pos']))
|
| 1973 |
+
$param['w_field_option_pos'] = 'left';
|
| 1974 |
+
|
| 1975 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 1976 |
+
|
| 1977 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 1978 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 1979 |
+
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 1980 |
+
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 1981 |
+
$param['w_choices_price'] = explode('***',$param['w_choices_price']);
|
| 1982 |
+
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 1983 |
+
$param['w_property'] = explode('***',$param['w_property']);
|
| 1984 |
+
$param['w_property_values'] = explode('***',$param['w_property_values']);
|
| 1985 |
+
|
| 1986 |
+
if(isset($param['w_choices_params']))
|
| 1987 |
+
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 1988 |
+
|
| 1989 |
+
foreach($param['w_choices_checked'] as $key => $choices_checked )
|
| 1990 |
+
{
|
| 1991 |
+
if($choices_checked=='true')
|
| 1992 |
+
$param['w_choices_checked'][$key]='checked="checked"';
|
| 1993 |
+
else
|
| 1994 |
+
$param['w_choices_checked'][$key]='';
|
| 1995 |
+
}
|
| 1996 |
+
|
| 1997 |
+
$rep='<div id="wdform_field'.$id.'" type="type_paypal_checkbox" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="wd_form_label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_paypal_checkbox" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
|
| 1998 |
+
|
| 1999 |
+
if($param['w_flow']=='hor')
|
| 2000 |
+
{
|
| 2001 |
+
$rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
|
| 2002 |
+
foreach($param['w_choices'] as $key => $choice)
|
| 2003 |
+
{
|
| 2004 |
+
$where ='';
|
| 2005 |
+
$order_by ='';
|
| 2006 |
+
$db_info = '';
|
| 2007 |
+
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 2008 |
+
{
|
| 2009 |
+
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 2010 |
+
$where = "where='".$w_choices_params[0]."'";
|
| 2011 |
+
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 2012 |
+
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 2013 |
+
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 2014 |
+
}
|
| 2015 |
+
|
| 2016 |
+
$rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="checkbox" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp'.$key.'" value="'.$param['w_choices_price'][$key].'" onclick="set_checked("'.$id.'","'.$key.'","form_id_temp")" '.$param['w_choices_checked'][$key].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div>';
|
| 2017 |
+
}
|
| 2018 |
+
$rep.= '</div>';
|
| 2019 |
+
}
|
| 2020 |
+
else
|
| 2021 |
+
{
|
| 2022 |
+
|
| 2023 |
+
foreach($param['w_choices'] as $key => $choice)
|
| 2024 |
+
{
|
| 2025 |
+
$where ='';
|
| 2026 |
+
$order_by ='';
|
| 2027 |
+
$db_info ='';
|
| 2028 |
+
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 2029 |
+
{
|
| 2030 |
+
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 2031 |
+
$where = "where='".$w_choices_params[0]."'";
|
| 2032 |
+
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 2033 |
+
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 2034 |
+
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 2035 |
+
}
|
| 2036 |
+
|
| 2037 |
+
$rep.='<div id="'.$id.'_element_tr'.$key.'" style="display: table-row;"><div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="checkbox" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp'.$key.'" value="'.$param['w_choices_price'][$key].'" onclick="set_checked("'.$id.'","'.$key.'","form_id_temp")" '.$param['w_choices_checked'][$key].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div></div>';
|
| 2038 |
+
}
|
| 2039 |
+
|
| 2040 |
+
}
|
| 2041 |
+
$rep.='</div></div>';
|
| 2042 |
+
|
| 2043 |
+
$rep.='<div id="'.$id.'_divform_id_temp">';
|
| 2044 |
+
if($param['w_quantity']=="yes")
|
| 2045 |
+
$rep.='<span id="'.$id.'_element_quantity_spanform_id_temp" style="margin-right: 15px;"><label class="mini_label" id="'.$id.'_element_quantity_label_form_id_temp" style="margin-right: 5px;"><!--repstart-->Quantity<!--repend--></label><input type="text" value="'.$param['w_quantity_value'].'" id="'.$id.'_element_quantityform_id_temp" name="'.$id.'_element_quantityform_id_temp" onkeypress="return check_isnum(event)" onchange="change_value("'.$id.'_element_quantityform_id_temp", this.value)" style="width: 30px; margin: 2px 0px;" disabled/></span>';
|
| 2046 |
+
if($param['w_property'][0])
|
| 2047 |
+
foreach($param['w_property'] as $key => $property)
|
| 2048 |
+
{
|
| 2049 |
+
$rep.='
|
| 2050 |
+
<span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
|
| 2051 |
+
|
| 2052 |
+
<label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
|
| 2053 |
+
<select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;" disabled>';
|
| 2054 |
+
$param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
|
| 2055 |
+
$param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
|
| 2056 |
+
foreach($param['w_property_values'][$key] as $subkey => $property_value)
|
| 2057 |
+
{
|
| 2058 |
+
$rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
|
| 2059 |
+
}
|
| 2060 |
+
$rep.='</select></span>';
|
| 2061 |
+
}
|
| 2062 |
+
|
| 2063 |
+
$rep.='</div></div></div>';
|
| 2064 |
+
break;
|
| 2065 |
+
}
|
| 2066 |
+
case 'type_paypal_radio':
|
| 2067 |
+
{
|
| 2068 |
+
|
| 2069 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_class','w_property','w_property_values','w_quantity','w_quantity_value');
|
| 2070 |
+
$temp=$params;
|
| 2071 |
+
if(strpos($temp, 'w_field_option_pos') > -1)
|
| 2072 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_choices_params', 'w_class','w_property','w_property_values','w_quantity','w_quantity_value');
|
| 2073 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 2074 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_hide_label', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_choices_params', 'w_class','w_property','w_property_values','w_quantity','w_quantity_value');
|
| 2075 |
+
foreach($params_names as $params_name )
|
| 2076 |
+
{
|
| 2077 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2078 |
+
$param[$params_name] = $temp[0];
|
| 2079 |
+
$temp=$temp[1];
|
| 2080 |
+
}
|
| 2081 |
+
|
| 2082 |
+
if($temp)
|
| 2083 |
+
{
|
| 2084 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2085 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2086 |
+
foreach($attrs as $attr)
|
| 2087 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2088 |
+
}
|
| 2089 |
+
if(!isset($param['w_field_option_pos']))
|
| 2090 |
+
$param['w_field_option_pos'] = 'left';
|
| 2091 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 2092 |
+
|
| 2093 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 2094 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 2095 |
+
|
| 2096 |
+
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 2097 |
+
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 2098 |
+
|
| 2099 |
+
$param['w_choices_price'] = explode('***',$param['w_choices_price']);
|
| 2100 |
+
|
| 2101 |
+
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 2102 |
+
|
| 2103 |
+
$param['w_property'] = explode('***',$param['w_property']);
|
| 2104 |
+
$param['w_property_values'] = explode('***',$param['w_property_values']);
|
| 2105 |
+
|
| 2106 |
+
if(isset($param['w_choices_params']))
|
| 2107 |
+
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 2108 |
+
|
| 2109 |
+
foreach($param['w_choices_checked'] as $key => $choices_checked )
|
| 2110 |
+
{
|
| 2111 |
+
if($choices_checked=='true')
|
| 2112 |
+
$param['w_choices_checked'][$key]='checked="checked"';
|
| 2113 |
+
else
|
| 2114 |
+
$param['w_choices_checked'][$key]='';
|
| 2115 |
+
}
|
| 2116 |
+
|
| 2117 |
+
$rep='<div id="wdform_field'.$id.'" type="type_paypal_radio" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="wd_form_label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_paypal_radio" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
|
| 2118 |
+
|
| 2119 |
+
if($param['w_flow']=='hor')
|
| 2120 |
+
{
|
| 2121 |
+
$rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
|
| 2122 |
+
foreach($param['w_choices'] as $key => $choice)
|
| 2123 |
+
{
|
| 2124 |
+
$where ='';
|
| 2125 |
+
$order_by ='';
|
| 2126 |
+
$db_info ='';
|
| 2127 |
+
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 2128 |
+
{
|
| 2129 |
+
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 2130 |
+
$where = "where='".$w_choices_params[0]."'";
|
| 2131 |
+
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 2132 |
+
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 2133 |
+
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 2134 |
+
}
|
| 2135 |
+
|
| 2136 |
+
$rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default("'.$id.'","'.$key.'","form_id_temp")" '.$param['w_choices_checked'][$key].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div>';
|
| 2137 |
+
}
|
| 2138 |
+
$rep.= '</div>';
|
| 2139 |
+
}
|
| 2140 |
+
else
|
| 2141 |
+
{
|
| 2142 |
+
|
| 2143 |
+
foreach($param['w_choices'] as $key => $choice)
|
| 2144 |
+
{
|
| 2145 |
+
|
| 2146 |
+
$where ='';
|
| 2147 |
+
$order_by ='';
|
| 2148 |
+
$db_info ='';
|
| 2149 |
+
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 2150 |
+
{
|
| 2151 |
+
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 2152 |
+
$where = "where='".$w_choices_params[0]."'";
|
| 2153 |
+
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 2154 |
+
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 2155 |
+
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 2156 |
+
}
|
| 2157 |
+
|
| 2158 |
+
$rep.='<div id="'.$id.'_element_tr'.$key.'" style="display: table-row;"><div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default("'.$id.'","'.$key.'","form_id_temp")" '.$param['w_choices_checked'][$key].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div></div>';
|
| 2159 |
+
}
|
| 2160 |
+
|
| 2161 |
+
}
|
| 2162 |
+
$rep.='</div></div>';
|
| 2163 |
+
|
| 2164 |
+
$rep.='<div id="'.$id.'_divform_id_temp">';
|
| 2165 |
+
if($param['w_quantity']=="yes")
|
| 2166 |
+
$rep.='<span id="'.$id.'_element_quantity_spanform_id_temp" style="margin-right: 15px;"><label class="mini_label" id="'.$id.'_element_quantity_label_form_id_temp" style="margin-right: 5px;"><!--repstart-->Quantity<!--repend--></label><input type="text" value="'.$param['w_quantity_value'].'" id="'.$id.'_element_quantityform_id_temp" name="'.$id.'_element_quantityform_id_temp" onkeypress="return check_isnum(event)" onchange="change_value("'.$id.'_element_quantityform_id_temp", this.value)" style="width: 30px; margin: 2px 0px;" disabled/></span>';
|
| 2167 |
+
if($param['w_property'][0])
|
| 2168 |
+
foreach($param['w_property'] as $key => $property)
|
| 2169 |
+
{
|
| 2170 |
+
$rep.='
|
| 2171 |
+
<span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
|
| 2172 |
+
|
| 2173 |
+
<label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
|
| 2174 |
+
<select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;" disabled>';
|
| 2175 |
+
$param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
|
| 2176 |
+
$param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
|
| 2177 |
+
foreach($param['w_property_values'][$key] as $subkey => $property_value)
|
| 2178 |
+
{
|
| 2179 |
+
$rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
|
| 2180 |
+
}
|
| 2181 |
+
$rep.='</select></span>';
|
| 2182 |
+
}
|
| 2183 |
+
|
| 2184 |
+
$rep.='</div></div></div>';
|
| 2185 |
+
|
| 2186 |
+
break;
|
| 2187 |
+
}
|
| 2188 |
+
case 'type_paypal_shipping':
|
| 2189 |
+
{
|
| 2190 |
+
|
| 2191 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_class');
|
| 2192 |
+
$temp=$params;
|
| 2193 |
+
|
| 2194 |
+
if(strpos($temp, 'w_field_option_pos') > -1)
|
| 2195 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_choices_params','w_class');
|
| 2196 |
+
|
| 2197 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 2198 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_hide_label', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_choices_params','w_class');
|
| 2199 |
+
|
| 2200 |
+
foreach($params_names as $params_name )
|
| 2201 |
+
{
|
| 2202 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2203 |
+
$param[$params_name] = $temp[0];
|
| 2204 |
+
$temp=$temp[1];
|
| 2205 |
+
}
|
| 2206 |
+
|
| 2207 |
+
if($temp)
|
| 2208 |
+
{
|
| 2209 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2210 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2211 |
+
foreach($attrs as $attr)
|
| 2212 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2213 |
+
}
|
| 2214 |
+
if(!isset($param['w_field_option_pos']))
|
| 2215 |
+
$param['w_field_option_pos'] = 'left';
|
| 2216 |
+
|
| 2217 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 2218 |
+
|
| 2219 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 2220 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 2221 |
+
|
| 2222 |
+
|
| 2223 |
+
|
| 2224 |
+
|
| 2225 |
+
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 2226 |
+
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 2227 |
+
|
| 2228 |
+
$param['w_choices_price'] = explode('***',$param['w_choices_price']);
|
| 2229 |
+
|
| 2230 |
+
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 2231 |
+
|
| 2232 |
+
if(isset($param['w_choices_params']))
|
| 2233 |
+
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 2234 |
+
|
| 2235 |
+
foreach($param['w_choices_checked'] as $key => $choices_checked )
|
| 2236 |
+
{
|
| 2237 |
+
if($choices_checked=='true')
|
| 2238 |
+
$param['w_choices_checked'][$key]='checked="checked"';
|
| 2239 |
+
else
|
| 2240 |
+
$param['w_choices_checked'][$key]='';
|
| 2241 |
+
}
|
| 2242 |
+
|
| 2243 |
+
$rep='<div id="wdform_field'.$id.'" type="type_paypal_shipping" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="wd_form_label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; vertical-align:top;"><input type="hidden" value="type_paypal_shipping" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
|
| 2244 |
+
|
| 2245 |
+
if($param['w_flow']=='hor')
|
| 2246 |
+
{
|
| 2247 |
+
$rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
|
| 2248 |
+
foreach($param['w_choices'] as $key => $choice)
|
| 2249 |
+
{
|
| 2250 |
+
$where ='';
|
| 2251 |
+
$order_by ='';
|
| 2252 |
+
$db_info ='';
|
| 2253 |
+
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 2254 |
+
{
|
| 2255 |
+
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 2256 |
+
$where = "where='".$w_choices_params[0]."'";
|
| 2257 |
+
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 2258 |
+
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 2259 |
+
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 2260 |
+
}
|
| 2261 |
+
|
| 2262 |
+
$rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default("'.$id.'","'.$key.'","form_id_temp")" '.$param['w_choices_checked'][$key].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div>';
|
| 2263 |
+
}
|
| 2264 |
+
$rep.= '</div>';
|
| 2265 |
+
}
|
| 2266 |
+
else
|
| 2267 |
+
{
|
| 2268 |
+
|
| 2269 |
+
foreach($param['w_choices'] as $key => $choice)
|
| 2270 |
+
{
|
| 2271 |
+
$where ='';
|
| 2272 |
+
$order_by ='';
|
| 2273 |
+
$db_info ='';
|
| 2274 |
+
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 2275 |
+
{
|
| 2276 |
+
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 2277 |
+
$where = "where='".$w_choices_params[0]."'";
|
| 2278 |
+
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 2279 |
+
$order_by = "order_by='".$w_choices_params[0]."'";
|
| 2280 |
+
$db_info = "db_info='".$w_choices_params[1]."'";
|
| 2281 |
+
}
|
| 2282 |
+
|
| 2283 |
+
$rep.='<div id="'.$id.'_element_tr'.$key.'" style="display: table-row;"><div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default("'.$id.'","'.$key.'","form_id_temp")" '.$param['w_choices_checked'][$key].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div></div>';
|
| 2284 |
+
}
|
| 2285 |
+
|
| 2286 |
+
}
|
| 2287 |
+
$rep.='</div></div>';
|
| 2288 |
+
|
| 2289 |
+
$rep.='</div></div>';
|
| 2290 |
+
|
| 2291 |
+
break;
|
| 2292 |
+
}
|
| 2293 |
+
case 'type_paypal_total':
|
| 2294 |
+
{
|
| 2295 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_class');
|
| 2296 |
+
$temp=$params;
|
| 2297 |
+
if(strpos($temp, 'w_size') > -1)
|
| 2298 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_class', 'w_size');
|
| 2299 |
+
|
| 2300 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 2301 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_class', 'w_size');
|
| 2302 |
+
|
| 2303 |
+
foreach($params_names as $params_name )
|
| 2304 |
+
{
|
| 2305 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2306 |
+
$param[$params_name] = $temp[0];
|
| 2307 |
+
$temp=$temp[1];
|
| 2308 |
+
}
|
| 2309 |
+
|
| 2310 |
+
if($temp)
|
| 2311 |
+
{
|
| 2312 |
+
$temp = explode('*:*w_attr_name*:*',$temp);
|
| 2313 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2314 |
+
foreach($attrs as $attr)
|
| 2315 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2316 |
+
}
|
| 2317 |
+
|
| 2318 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 2319 |
+
|
| 2320 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 2321 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 2322 |
+
$param['w_size'] = isset($param['w_size']) ? $param['w_size'] : '300';
|
| 2323 |
+
|
| 2324 |
+
$rep='<div id="wdform_field'.$id.'" type="type_paypal_total" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_paypal_total" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><div id="'.$id.'paypal_totalform_id_temp" class="wdform_paypal_total paypal_totalform_id_temp" style="width:'.$param['w_size'].'px;"><input type="hidden" value="" name="'.$id.'_paypal_totalform_id_temp" class="input_paypal_totalform_id_temp"><div id="'.$id.'div_totalform_id_temp" class="div_totalform_id_temp" style="margin-bottom: 10px;"><!--repstart-->$300<!--repend--></div><div id="'.$id.'paypal_productsform_id_temp" class="paypal_productsform_id_temp" style="border-spacing: 2px;"><div style="border-spacing: 2px;"><!--repstart-->product 1 $100<!--repend--></div><div style="border-spacing: 2px;"><!--repstart-->product 2 $200<!--repend--></div></div><div id="'.$id.'paypal_taxform_id_temp" class="paypal_taxform_id_temp" style="border-spacing: 2px; margin-top: 7px;"></div></div></div></div>';
|
| 2325 |
+
|
| 2326 |
+
break;
|
| 2327 |
+
}
|
| 2328 |
+
|
| 2329 |
+
|
| 2330 |
+
|
| 2331 |
+
case 'type_stripe': {
|
| 2332 |
+
$params_names=array('w_field_size', 'w_field_label_size','w_field_label_pos','w_class');
|
| 2333 |
+
$temp=$params;
|
| 2334 |
+
foreach($params_names as $params_name )
|
| 2335 |
+
{
|
| 2336 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2337 |
+
$param[$params_name] = $temp[0];
|
| 2338 |
+
$temp=$temp[1];
|
| 2339 |
+
}
|
| 2340 |
+
|
| 2341 |
+
if($temp)
|
| 2342 |
+
{
|
| 2343 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2344 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2345 |
+
foreach($attrs as $attr)
|
| 2346 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2347 |
+
}
|
| 2348 |
+
|
| 2349 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 2350 |
+
$rep='<div id="wdform_field'.$id.'" type="type_stripe" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="display: none;">stripe</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><div id="'.$id.'_elementform_id_temp" style="width:'.$param['w_field_size'].'px; margin:10px; border: 1px solid #000; min-width:80px;text-align:center;"> Stripe Section</div><input type="hidden" id="is_stripe" /><input type="hidden" value="type_stripe" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"></div></div>';
|
| 2351 |
+
|
| 2352 |
+
break;
|
| 2353 |
+
}
|
| 2354 |
+
|
| 2355 |
+
case 'type_star_rating':
|
| 2356 |
+
{
|
| 2357 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_field_label_col','w_star_amount','w_required','w_class');
|
| 2358 |
+
$temp=$params;
|
| 2359 |
+
|
| 2360 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 2361 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_field_label_col','w_star_amount','w_required','w_class');
|
| 2362 |
+
|
| 2363 |
+
foreach($params_names as $params_name )
|
| 2364 |
+
{
|
| 2365 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2366 |
+
$param[$params_name] = $temp[0];
|
| 2367 |
+
$temp=$temp[1];
|
| 2368 |
+
}
|
| 2369 |
+
|
| 2370 |
+
if($temp)
|
| 2371 |
+
{
|
| 2372 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2373 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2374 |
+
foreach($attrs as $attr)
|
| 2375 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2376 |
+
}
|
| 2377 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 2378 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 2379 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 2380 |
+
|
| 2381 |
+
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 2382 |
+
|
| 2383 |
+
|
| 2384 |
+
$images = '';
|
| 2385 |
+
for($i=0; $i<$param['w_star_amount']; $i++)
|
| 2386 |
+
{
|
| 2387 |
+
$images .= '<img id="'.$id.'_star_'.$i.'" src="' . WD_FM_URL . '/images/star.png?ver='. WD_FM_VERSION.'" onmouseover="change_src('.$i.','.$id.',"form_id_temp")" onmouseout="reset_src('.$i.','.$id.')" onclick="select_star_rating('.$i.','.$id.', "form_id_temp")">';
|
| 2388 |
+
}
|
| 2389 |
+
|
| 2390 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_star_rating" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_star_rating" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_star_amount'].'" id="'.$id.'_star_amountform_id_temp" name="'.$id.'_star_amountform_id_temp"><input type="hidden" value="'.$param['w_field_label_col'].'" name="'.$id.'_star_colorform_id_temp" id="'.$id.'_star_colorform_id_temp"><div id="'.$id.'_elementform_id_temp" class="wdform_stars" '.$param['attributes'].'>'.$images.'</div></div></div>';
|
| 2391 |
+
|
| 2392 |
+
|
| 2393 |
+
break;
|
| 2394 |
+
}
|
| 2395 |
+
case 'type_scale_rating':
|
| 2396 |
+
{
|
| 2397 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_mini_labels','w_scale_amount','w_required','w_class');
|
| 2398 |
+
$temp=$params;
|
| 2399 |
+
|
| 2400 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 2401 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_mini_labels','w_scale_amount','w_required','w_class');
|
| 2402 |
+
|
| 2403 |
+
foreach($params_names as $params_name )
|
| 2404 |
+
{
|
| 2405 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2406 |
+
$param[$params_name] = $temp[0];
|
| 2407 |
+
$temp=$temp[1];
|
| 2408 |
+
}
|
| 2409 |
+
|
| 2410 |
+
if($temp)
|
| 2411 |
+
{
|
| 2412 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2413 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2414 |
+
foreach($attrs as $attr)
|
| 2415 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2416 |
+
}
|
| 2417 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 2418 |
+
|
| 2419 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 2420 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 2421 |
+
|
| 2422 |
+
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 2423 |
+
|
| 2424 |
+
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
| 2425 |
+
|
| 2426 |
+
$numbers = '';
|
| 2427 |
+
for($i=1; $i<=$param['w_scale_amount']; $i++)
|
| 2428 |
+
{
|
| 2429 |
+
$numbers .= '<div id="'.$id.'_scale_td1_'.$i.'form_id_temp" style="text-align: center; display: table-cell;"><span>'.$i.'</span></div>';
|
| 2430 |
+
}
|
| 2431 |
+
|
| 2432 |
+
|
| 2433 |
+
$radio_buttons = '';
|
| 2434 |
+
for($k=1; $k<=$param['w_scale_amount']; $k++)
|
| 2435 |
+
{
|
| 2436 |
+
$radio_buttons .= '<div id="'.$id.'_scale_td2_'.$k.'form_id_temp" style="display: table-cell;"><input id="'.$id.'_scale_radioform_id_temp_'.$k.'" name="'.$id.'_scale_radioform_id_temp" value="'.$k.'" type="radio"></div>';
|
| 2437 |
+
}
|
| 2438 |
+
|
| 2439 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_scale_rating" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; vertical-align: top; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_scale_rating" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_scale_amount'].'" id="'.$id.'_scale_amountform_id_temp" name="'.$id.'_scale_amountform_id_temp"><div id="'.$id.'_elementform_id_temp" style="float: left;" '.$param['attributes'].'><label class="mini_label" id="'.$id.'_mini_label_worst" style="position: relative; top: 6px; font-size: 11px; display: inline-table;">'.$w_mini_labels[0].'</label><div id="'.$id.'_scale_tableform_id_temp" style="display: inline-table;"><div id="'.$id.'_scale_tr1form_id_temp" style="display: table-row;">'.$numbers.'</div><div id="'.$id.'_scale_tr2form_id_temp" style="display: table-row;">'.$radio_buttons.'</div></div><label class="mini_label" id="'.$id.'_mini_label_best" style="position: relative; top: 6px; font-size: 11px; display: inline-table;">'.$w_mini_labels[1].'</label></div></div></div>';
|
| 2440 |
+
|
| 2441 |
+
break;
|
| 2442 |
+
}
|
| 2443 |
+
case 'type_spinner':
|
| 2444 |
+
{
|
| 2445 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_field_width','w_field_min_value','w_field_max_value', 'w_field_step', 'w_field_value', 'w_required','w_class');
|
| 2446 |
+
$temp=$params;
|
| 2447 |
+
|
| 2448 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 2449 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_field_width','w_field_min_value','w_field_max_value', 'w_field_step', 'w_field_value', 'w_required','w_class');
|
| 2450 |
+
|
| 2451 |
+
|
| 2452 |
+
foreach($params_names as $params_name ) {
|
| 2453 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2454 |
+
$param[$params_name] = $temp[0];
|
| 2455 |
+
$temp=$temp[1];
|
| 2456 |
+
}
|
| 2457 |
+
if($temp) {
|
| 2458 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2459 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2460 |
+
foreach($attrs as $attr)
|
| 2461 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2462 |
+
}
|
| 2463 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 2464 |
+
|
| 2465 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 2466 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 2467 |
+
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 2468 |
+
|
| 2469 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_spinner" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_spinner" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_field_width'].'" name="'.$id.'_spinner_widthform_id_temp" id="'.$id.'_spinner_widthform_id_temp"><input type="hidden" value="'.$param['w_field_min_value'].'" id="'.$id.'_min_valueform_id_temp" name="'.$id.'_min_valueform_id_temp"><input type="hidden" value="'.$param['w_field_max_value'].'" name="'.$id.'_max_valueform_id_temp" id="'.$id.'_max_valueform_id_temp"><input type="hidden" value="'.$param['w_field_step'].'" name="'.$id.'_stepform_id_temp" id="'.$id.'_stepform_id_temp"><input type="" value="'.($param['w_field_value']!= 'null' ? $param['w_field_value'] : '').'" name="'.$id.'_elementform_id_temp" id="'.$id.'_elementform_id_temp" onkeypress="return check_isnum_or_minus(event)" style="width: '.$param['w_field_width'].'px;" '.$param['attributes'].' disabled/></div></div>';
|
| 2470 |
+
break;
|
| 2471 |
+
}
|
| 2472 |
+
case 'type_slider': {
|
| 2473 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_field_width','w_field_min_value','w_field_max_value', 'w_field_value', 'w_required','w_class');
|
| 2474 |
+
$temp=$params;
|
| 2475 |
+
|
| 2476 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 2477 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_field_width','w_field_min_value','w_field_max_value', 'w_field_value', 'w_required','w_class');
|
| 2478 |
+
|
| 2479 |
+
foreach($params_names as $params_name ) {
|
| 2480 |
+
$temp = explode('*:*'.$params_name.'*:*',$temp);
|
| 2481 |
+
$param[$params_name] = $temp[0];
|
| 2482 |
+
$temp=$temp[1];
|
| 2483 |
+
}
|
| 2484 |
+
if ($temp) {
|
| 2485 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 2486 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2487 |
+
foreach($attrs as $attr) {
|
| 2488 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
| 2489 |
+
}
|
| 2490 |
+
}
|
| 2491 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 2492 |
+
|
| 2493 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 2494 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 2495 |
+
|
| 2496 |
+
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 2497 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_slider" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; vertical-align: top; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_slider" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_field_width'].'" name="'.$id.'_slider_widthform_id_temp" id="'.$id.'_slider_widthform_id_temp"><input type="hidden" value="'.$param['w_field_min_value'].'" id="'.$id.'_slider_min_valueform_id_temp" name="'.$id.'_slider_min_valueform_id_temp"><input type="hidden" value="'.$param['w_field_max_value'].'" id="'.$id.'_slider_max_valueform_id_temp" name="'.$id.'_slider_max_valueform_id_temp"><input type="hidden" value="'.$param['w_field_value'].'" id="'.$id.'_slider_valueform_id_temp" name="'.$id.'_slider_valueform_id_temp"><div id="'.$id.'_slider_tableform_id_temp"><div><div id="'.$id.'_slider_td1form_id_temp"><div name="'.$id.'_elementform_id_temp" id="'.$id.'_elementform_id_temp" style="width: '.$param['w_field_width'].'px;" '.$param['attributes'].'"></div></div></div><div><div align="left" id="'.$id.'_slider_td2form_id_temp" style="display: inline-table; width: 33.3%; text-align: left;"><span id="'.$id.'_element_minform_id_temp" class="label">'.$param['w_field_min_value'].'</span></div><div align="right" id="'.$id.'_slider_td3form_id_temp" style="display: inline-table; width: 33.3%; text-align: center;"><span id="'.$id.'_element_valueform_id_temp" class="label">'.$param['w_field_value'].'</span></div><div align="right" id="'.$id.'_slider_td4form_id_temp" style="display: inline-table; width: 33.3%; text-align: right;"><span id="'.$id.'_element_maxform_id_temp" class="label">'.$param['w_field_max_value'].'</span></div></div></div></div></div>';
|
| 2498 |
+
break;
|
| 2499 |
+
}
|
| 2500 |
+
case 'type_range': {
|
| 2501 |
+
$params_names = array('w_field_label_size','w_field_label_pos','w_field_range_width','w_field_range_step','w_field_value1', 'w_field_value2', 'w_mini_labels', 'w_required','w_class');
|
| 2502 |
+
$temp = $params;
|
| 2503 |
+
|
| 2504 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 2505 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_field_range_width','w_field_range_step','w_field_value1', 'w_field_value2', 'w_mini_labels', 'w_required','w_class');
|
| 2506 |
+
|
| 2507 |
+
foreach ($params_names as $params_name ) {
|
| 2508 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 2509 |
+
$param[$params_name] = $temp[0];
|
| 2510 |
+
$temp = $temp[1];
|
| 2511 |
+
}
|
| 2512 |
+
if ($temp) {
|
| 2513 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 2514 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 2515 |
+
foreach($attrs as $attr) {
|
| 2516 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2517 |
+
}
|
| 2518 |
+
}
|
| 2519 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 2520 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 2521 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 2522 |
+
|
| 2523 |
+
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 2524 |
+
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
| 2525 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_range" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_range" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_field_range_width'].'" name="'.$id.'_range_widthform_id_temp" id="'.$id.'_range_widthform_id_temp"><input type="hidden" value="'.$param['w_field_range_step'].'" name="'.$id.'_range_stepform_id_temp" id="'.$id.'_range_stepform_id_temp"><div id="'.$id.'_elemet_table_littleform_id_temp" style="display: table;"><div style="display: table-row;"><div valign="middle" align="left" style="display: table-cell;"><input type="" value="'.($param['w_field_value1']!= 'null' ? $param['w_field_value1'] : '').'" name="'.$id.'_elementform_id_temp0" id="'.$id.'_elementform_id_temp0" onkeypress="return check_isnum_or_minus(event)" style="width: '.$param['w_field_range_width'].'px;" '.$param['attributes'].' disabled/></div><div valign="middle" align="left" style="display: table-cell; padding-left: 4px;"><input type="" value="'.($param['w_field_value2']!= 'null' ? $param['w_field_value2'] : '').'" name="'.$id.'_elementform_id_temp1" id="'.$id.'_elementform_id_temp1" onkeypress="return check_isnum_or_minus(event)" style="width: '.$param['w_field_range_width'].'px;" '.$param['attributes'].' disabled/></div></div><div style="display: table-row;"><div valign="top" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_from">'.$w_mini_labels[0].'</label></div><div valign="top" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_to">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
|
| 2526 |
+
break;
|
| 2527 |
+
}
|
| 2528 |
+
case 'type_grading': {
|
| 2529 |
+
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_items', 'w_total', 'w_required', 'w_class');
|
| 2530 |
+
$temp = $params;
|
| 2531 |
+
|
| 2532 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 2533 |
+
$params_names=array('w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_items', 'w_total', 'w_required', 'w_class');
|
| 2534 |
+
|
| 2535 |
+
|
| 2536 |
+
foreach($params_names as $params_name) {
|
| 2537 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 2538 |
+
$param[$params_name] = $temp[0];
|
| 2539 |
+
$temp = $temp[1];
|
| 2540 |
+
}
|
| 2541 |
+
if ($temp) {
|
| 2542 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 2543 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 2544 |
+
foreach ($attrs as $attr) {
|
| 2545 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2546 |
+
}
|
| 2547 |
+
}
|
| 2548 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
| 2549 |
+
|
| 2550 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 2551 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 2552 |
+
|
| 2553 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
| 2554 |
+
$w_items = explode('***', $param['w_items']);
|
| 2555 |
+
$grading_items = '';
|
| 2556 |
+
for($i=0; $i<count($w_items); $i++)
|
| 2557 |
+
{
|
| 2558 |
+
$grading_items .= '<div id="'.$id.'_element_div'.$i.'" class="grading"><input id="'.$id.'_elementform_id_temp_'.$i.'" name="'.$id.'_elementform_id_temp_'.$i.'" onkeypress="return check_isnum_or_minus(event)" value="" size="5" onkeyup="sum_grading_values('.$id.',"form_id_temp")" onchange="sum_grading_values('.$id.',"form_id_temp")" '.$param['attributes'].' disabled/><label id="'.$id.'_label_elementform_id_temp'.$i.'" class="ch-rad-label">'.$w_items[$i].'</label></div>';
|
| 2559 |
+
}
|
| 2560 |
+
|
| 2561 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_grading" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; vertical-align: top; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_grading" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_total'].'" name="'.$id.'_grading_totalform_id_temp" id="'.$id.'_grading_totalform_id_temp"><div id="'.$id.'_elementform_id_temp">'.$grading_items.'<div id="'.$id.'_element_total_divform_id_temp" class="grading_div">Total:<span id="'.$id.'_sum_elementform_id_temp" name="'.$id.'_sum_elementform_id_temp">0</span>/<span id="'.$id.'_total_elementform_id_temp" name="'.$id.'_total_elementform_id_temp">'.$param['w_total'].'</span><span id="'.$id.'_text_elementform_id_temp" name="'.$id.'_text_elementform_id_temp"></span></div></div></div></div>';
|
| 2562 |
+
|
| 2563 |
+
break;
|
| 2564 |
+
}
|
| 2565 |
+
case 'type_matrix': {
|
| 2566 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_input_type', 'w_rows', 'w_columns', 'w_required','w_class','w_textbox_size');
|
| 2567 |
+
$temp = $params;
|
| 2568 |
+
|
| 2569 |
+
if(strpos($temp, 'w_hide_label') > -1)
|
| 2570 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_field_input_type', 'w_rows', 'w_columns', 'w_required','w_class','w_textbox_size');
|
| 2571 |
+
|
| 2572 |
+
|
| 2573 |
+
foreach ($params_names as $params_name) {
|
| 2574 |
+
$temp = explode('*:*'.$params_name.'*:*',$temp);
|
| 2575 |
+
$param[$params_name] = $temp[0];
|
| 2576 |
+
$temp = $temp[1];
|
| 2577 |
+
}
|
| 2578 |
+
if ($temp) {
|
| 2579 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
| 2580 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 2581 |
+
foreach ($attrs as $attr) {
|
| 2582 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2583 |
+
}
|
| 2584 |
+
}
|
| 2585 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
| 2586 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
| 2587 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
| 2588 |
+
|
| 2589 |
+
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
| 2590 |
+
$param['w_textbox_size'] = isset($param['w_textbox_size']) ? $param['w_textbox_size'] : '100';
|
| 2591 |
+
$w_rows = explode('***',$param['w_rows']);
|
| 2592 |
+
$w_columns = explode('***',$param['w_columns']);
|
| 2593 |
+
$column_labels = '';
|
| 2594 |
+
for ($i = 1; $i < count($w_columns); $i++) {
|
| 2595 |
+
$column_labels .= '<div id="'.$id.'_element_td0_'.$i.'" class="matrix_" style="display: table-cell;"><label id="'.$id.'_label_elementform_id_temp0_'.$i.'" name="'.$id.'_label_elementform_id_temp0_'.$i.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$i.'" value="'.$w_columns[$i].'">'.$w_columns[$i].'</label></div>';
|
| 2596 |
+
}
|
| 2597 |
+
$rows_columns = '';
|
| 2598 |
+
for($i=1; $i<count($w_rows); $i++)
|
| 2599 |
+
{
|
| 2600 |
+
|
| 2601 |
+
$rows_columns .= '<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;"><div id="'.$id.'_element_td'.$i.'_0" class="matrix_" style="display: table-cell;"><label id="'.$id.'_label_elementform_id_temp'.$i.'_0" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$i.'" value="'.$w_rows[$i].'">'.$w_rows[$i].'</label></div>';
|
| 2602 |
+
|
| 2603 |
+
|
| 2604 |
+
for($k=1; $k<count($w_columns); $k++)
|
| 2605 |
+
{
|
| 2606 |
+
if($param['w_field_input_type']=='radio')
|
| 2607 |
+
$rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" align="center" size="14" type="radio" name="'.$id.'_input_elementform_id_temp'.$i.'" value="'.$i.'_'.$k.'" disabled/></div>';
|
| 2608 |
+
else
|
| 2609 |
+
if($param['w_field_input_type']=='checkbox')
|
| 2610 |
+
$rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" align="center" size="14" type="checkbox" name="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" value="1" disabled/></div>';
|
| 2611 |
+
else
|
| 2612 |
+
if($param['w_field_input_type']=='text')
|
| 2613 |
+
$rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" align="center" type="text" name="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" value="" style="width:'.$param['w_textbox_size'].'px" disabled/></div>';
|
| 2614 |
+
else
|
| 2615 |
+
if($param['w_field_input_type']=='select')
|
| 2616 |
+
$rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><select id="'.$id.'_select_yes_noform_id_temp'.$i.'_'.$k.'" name="'.$id.'_select_yes_noform_id_temp'.$i.'_'.$k.'" disabled><option value=""> </option><option value="yes">Yes</option><option value="no">No</option></select></div>';
|
| 2617 |
+
|
| 2618 |
+
}
|
| 2619 |
+
|
| 2620 |
+
$rows_columns .= '</div>';
|
| 2621 |
+
}
|
| 2622 |
+
|
| 2623 |
+
|
| 2624 |
+
|
| 2625 |
+
$rep ='<div id="wdform_field'.$id.'" type="type_matrix" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_matrix" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_field_input_type'].'" name="'.$id.'_input_typeform_id_temp" id="'.$id.'_input_typeform_id_temp"><input type="hidden" value="'.$param['w_textbox_size'].'" name="'.$id.'_textbox_sizeform_id_temp" id="'.$id.'_textbox_sizeform_id_temp"><div id="'.$id.'_elementform_id_temp" style="display: table;" '.$param['attributes'].'><div id="'.$id.'_table_little" style="display: table-row-group;"><div id="'.$id.'_element_tr0" style="display: table-row;"><div id="'.$id.'_element_td0_0" style="display: table-cell;"></div>'.$column_labels.'</div>'.$rows_columns.'</div></div></div></div>';
|
| 2626 |
+
|
| 2627 |
+
break;
|
| 2628 |
+
}
|
| 2629 |
+
case 'type_submit_reset': {
|
| 2630 |
+
$params_names=array('w_submit_title','w_reset_title','w_class','w_act');
|
| 2631 |
+
$temp=$params;
|
| 2632 |
+
foreach ($params_names as $params_name) {
|
| 2633 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2634 |
+
$param[$params_name] = $temp[0];
|
| 2635 |
+
$temp=$temp[1];
|
| 2636 |
+
}
|
| 2637 |
+
if ($temp) {
|
| 2638 |
+
$temp = explode('*:*w_attr_name*:*',$temp);
|
| 2639 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2640 |
+
foreach ($attrs as $attr) {
|
| 2641 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2642 |
+
}
|
| 2643 |
+
}
|
| 2644 |
+
$param['w_act'] = ($param['w_act']=="false" ? 'style="display: none;"' : "");
|
| 2645 |
+
$rep='<div id="wdform_field'.$id.'" type="type_submit_reset" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">type_submit_reset_'.$id.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><input type="hidden" value="type_submit_reset" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><button type="button" class="button-submit" id="'.$id.'_element_submitform_id_temp" value="'.$param['w_submit_title'].'" disabled '.$param['attributes'].'>'.$param['w_submit_title'].'</button><button type="button" class="button-reset" id="'.$id.'_element_resetform_id_temp" value="'.$param['w_reset_title'].'" disabled '.$param['w_act'].' '.$param['attributes'].'>'.$param['w_reset_title'].'</button></div></div>';
|
| 2646 |
+
break;
|
| 2647 |
+
}
|
| 2648 |
+
case 'type_button': {
|
| 2649 |
+
$params_names=array('w_title','w_func','w_class');
|
| 2650 |
+
$temp=$params;
|
| 2651 |
+
foreach($params_names as $params_name) {
|
| 2652 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2653 |
+
$param[$params_name] = $temp[0];
|
| 2654 |
+
$temp=$temp[1];
|
| 2655 |
+
}
|
| 2656 |
+
if ($temp) {
|
| 2657 |
+
$temp = explode('*:*w_attr_name*:*',$temp);
|
| 2658 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2659 |
+
foreach($attrs as $attr) {
|
| 2660 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2661 |
+
}
|
| 2662 |
+
}
|
| 2663 |
+
$param['w_title'] = explode('***',$param['w_title']);
|
| 2664 |
+
$param['w_func'] = explode('***',$param['w_func']);
|
| 2665 |
+
$rep.='<div id="wdform_field'.$id.'" type="type_button" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">button_'.$id.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><input type="hidden" value="type_button" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp">';
|
| 2666 |
+
foreach ($param['w_title'] as $key => $title) {
|
| 2667 |
+
$rep.='<button type="button" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp'.$key.'" value="'.$title.'" onclick="'.$param['w_func'][$key].'" '.$param['attributes'].'>'.$title.'</button>';
|
| 2668 |
+
}
|
| 2669 |
+
$rep .= '</div></div>';
|
| 2670 |
+
break;
|
| 2671 |
+
}
|
| 2672 |
+
}
|
| 2673 |
+
|
| 2674 |
+
$form = str_replace('%' . $id . ' - ' . $labels[$ids_key] . '%', $rep, $form);
|
| 2675 |
+
$form = str_replace('%' . $id . ' -' . $labels[$ids_key] . '%', $rep, $form);
|
| 2676 |
+
$row->form_front = $form;
|
| 2677 |
+
}
|
| 2678 |
+
}
|
| 2679 |
+
}
|
| 2680 |
+
else {
|
| 2681 |
+
$row = new stdClass();
|
| 2682 |
+
$row->id = 0;
|
| 2683 |
+
$row->backup_id ='';
|
| 2684 |
+
$row->title = '';
|
| 2685 |
+
$row->mail = '';
|
| 2686 |
+
$row->form = '';
|
| 2687 |
+
$row->form_front = '';
|
| 2688 |
+
$row->theme = $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'");
|
| 2689 |
+
$row->javascript = '';
|
| 2690 |
+
$row->submit_text = '';
|
| 2691 |
+
$row->url = '';
|
| 2692 |
+
$row->submit_text_type = 0;
|
| 2693 |
+
$row->script1 = '';
|
| 2694 |
+
$row->script2 = '';
|
| 2695 |
+
$row->script_user1 = '';
|
| 2696 |
+
$row->script_user2 = '';
|
| 2697 |
+
$row->counter = 0;
|
| 2698 |
+
$row->label_order = '';
|
| 2699 |
+
$row->article_id = '';
|
| 2700 |
+
$row->pagination = '';
|
| 2701 |
+
$row->show_title = '';
|
| 2702 |
+
$row->show_numbers = '';
|
| 2703 |
+
$row->public_key = '';
|
| 2704 |
+
$row->private_key = '';
|
| 2705 |
+
$row->recaptcha_theme = '';
|
| 2706 |
+
$row->from_name = '';
|
| 2707 |
+
$row->from_mail = '';
|
| 2708 |
+
$row->label_order_current = '';
|
| 2709 |
+
$row->script_mail_user = '';
|
| 2710 |
+
$row->script_mail = '';
|
| 2711 |
+
$row->tax = 0;
|
| 2712 |
+
$row->payment_currency = '$';
|
| 2713 |
+
$row->paypal_email = '';
|
| 2714 |
+
$row->checkout_mode = 'testmode';
|
| 2715 |
+
$row->paypal_mode = 0;
|
| 2716 |
+
|
| 2717 |
+
$row->published = 1;
|
| 2718 |
+
$row->form_fields = '';
|
| 2719 |
+
$row->savedb = 1;
|
| 2720 |
+
$row->sendemail = 1;
|
| 2721 |
+
$row->requiredmark = '*';
|
| 2722 |
+
$row->reply_to = 0;
|
| 2723 |
+
$row->send_to = 0;
|
| 2724 |
+
$row->autogen_layout = 1;
|
| 2725 |
+
$row->custom_front = '';
|
| 2726 |
+
$row->mail_from_user = '';
|
| 2727 |
+
$row->mail_from_name_user = '';
|
| 2728 |
+
$row->reply_to_user = '';
|
| 2729 |
+
$row->save_uploads = 1;
|
| 2730 |
+
|
| 2731 |
+
$row->header_title = '';
|
| 2732 |
+
$row->header_description = '';
|
| 2733 |
+
$row->header_image_url = '';
|
| 2734 |
+
$row->header_image_animation = '';
|
| 2735 |
+
$row->header_hide_image = '';
|
| 2736 |
+
|
| 2737 |
+
$row->condition = '';
|
| 2738 |
+
$row->mail_cc = '';
|
| 2739 |
+
$row->mail_cc_user = '';
|
| 2740 |
+
$row->mail_bcc = '';
|
| 2741 |
+
$row->mail_bcc_user = '';
|
| 2742 |
+
$row->mail_subject = '';
|
| 2743 |
+
$row->mail_subject_user = '';
|
| 2744 |
+
$row->mail_mode = 1;
|
| 2745 |
+
$row->mail_mode_user = 1;
|
| 2746 |
+
$row->mail_attachment = 1;
|
| 2747 |
+
$row->mail_attachment_user = 1;
|
| 2748 |
+
|
| 2749 |
+
$row->user_id_wd = '';
|
| 2750 |
+
$row->sortable = 1;
|
| 2751 |
+
$row->frontend_submit_fields = '';
|
| 2752 |
+
$row->frontend_submit_stat_fields = '';
|
| 2753 |
+
}
|
| 2754 |
+
return $row;
|
| 2755 |
+
}
|
| 2756 |
+
|
| 2757 |
+
public function get_theme_rows_data($old = '') {
|
| 2758 |
+
global $wpdb;
|
| 2759 |
+
$rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_themes ORDER BY `version` DESC, `id` ASC");
|
| 2760 |
+
return $rows;
|
| 2761 |
+
}
|
| 2762 |
+
|
| 2763 |
+
public function get_queries_rows_data($id) {
|
| 2764 |
+
global $wpdb;
|
| 2765 |
+
$rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_query WHERE form_id=" . $id . " ORDER BY id ASC");
|
| 2766 |
+
return $rows;
|
| 2767 |
+
}
|
| 2768 |
+
|
| 2769 |
+
public function get_labels($id) {
|
| 2770 |
+
global $wpdb;
|
| 2771 |
+
$rows = $wpdb->get_col("SELECT DISTINCT `element_label` FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id=" . $id);
|
| 2772 |
+
return $rows;
|
| 2773 |
+
}
|
| 2774 |
+
|
| 2775 |
+
public function is_paypal($id) {
|
| 2776 |
+
global $wpdb;
|
| 2777 |
+
$rows = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_sessions WHERE form_id=" . $id);
|
| 2778 |
+
return $rows;
|
| 2779 |
+
}
|
| 2780 |
+
|
| 2781 |
+
public function page_nav() {
|
| 2782 |
+
global $wpdb;
|
| 2783 |
+
$where = 'WHERE `id` NOT IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')';
|
| 2784 |
+
$where .= ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? ' AND title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
|
| 2785 |
+
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker " . $where;
|
| 2786 |
+
$total = $wpdb->get_var($query);
|
| 2787 |
+
$page_nav['total'] = $total;
|
| 2788 |
+
if (isset($_POST['page_number']) && $_POST['page_number']) {
|
| 2789 |
+
$limit = ((int) $_POST['page_number'] - 1) * 20;
|
| 2790 |
+
}
|
| 2791 |
+
else {
|
| 2792 |
+
$limit = 0;
|
| 2793 |
+
}
|
| 2794 |
+
$page_nav['limit'] = (int) ($limit / 20 + 1);
|
| 2795 |
+
return $page_nav;
|
| 2796 |
+
}
|
| 2797 |
+
|
| 2798 |
+
public function get_display_options($id) {
|
| 2799 |
+
global $wpdb;
|
| 2800 |
+
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_display_options WHERE form_id="%d"', $id));
|
| 2801 |
+
if (!$row) {
|
| 2802 |
+
$row = new stdClass();
|
| 2803 |
+
$row->form_id = $id;
|
| 2804 |
+
$row->type = 'embedded';
|
| 2805 |
+
$row->scrollbox_loading_delay = 0;
|
| 2806 |
+
$row->popover_animate_effect = '';
|
| 2807 |
+
$row->popover_loading_delay = 0;
|
| 2808 |
+
$row->popover_frequency = 0;
|
| 2809 |
+
$row->topbar_position = 1;
|
| 2810 |
+
$row->topbar_remain_top = 1;
|
| 2811 |
+
$row->topbar_closing = 1;
|
| 2812 |
+
$row->topbar_hide_duration = 0;
|
| 2813 |
+
$row->scrollbox_position = 1;
|
| 2814 |
+
$row->scrollbox_trigger_point = 20;
|
| 2815 |
+
$row->scrollbox_hide_duration = 0;
|
| 2816 |
+
$row->scrollbox_auto_hide = 1;
|
| 2817 |
+
$row->hide_mobile = 0;
|
| 2818 |
+
$row->scrollbox_closing = 1;
|
| 2819 |
+
$row->scrollbox_minimize = 1;
|
| 2820 |
+
$row->scrollbox_minimize_text = '';
|
| 2821 |
+
$row->display_on = 'everything';
|
| 2822 |
+
$row->posts_include = '';
|
| 2823 |
+
$row->pages_include = '';
|
| 2824 |
+
$row->display_on_categories = '';
|
| 2825 |
+
$row->current_categories = '';
|
| 2826 |
+
$row->show_for_admin = 0;
|
| 2827 |
+
}
|
| 2828 |
+
return $row;
|
| 2829 |
+
}
|
| 2830 |
+
|
| 2831 |
+
public function fm_posts_query() {
|
| 2832 |
+
$default_post_types = array( 'post', 'page' );
|
| 2833 |
+
$custom_post_types = get_post_types( array(
|
| 2834 |
+
'public' => true,
|
| 2835 |
+
'_builtin' => false,
|
| 2836 |
+
) );
|
| 2837 |
+
|
| 2838 |
+
$post_types = array_merge($default_post_types, $custom_post_types);
|
| 2839 |
+
$pt_names = array_values($post_types);
|
| 2840 |
+
|
| 2841 |
+
$query = array(
|
| 2842 |
+
'post_type' => $pt_names,
|
| 2843 |
+
'suppress_filters' => true,
|
| 2844 |
+
'update_post_term_cache' => false,
|
| 2845 |
+
'update_post_meta_cache' => false,
|
| 2846 |
+
'post_status' => 'publish',
|
| 2847 |
+
'posts_per_page' => -1,
|
| 2848 |
+
);
|
| 2849 |
+
|
| 2850 |
+
$get_posts = new WP_Query;
|
| 2851 |
+
$posts = $get_posts->query( $query );
|
| 2852 |
+
if ( ! $get_posts->post_count ) {
|
| 2853 |
+
return false;
|
| 2854 |
+
}
|
| 2855 |
+
|
| 2856 |
+
$results = array();
|
| 2857 |
+
foreach ($posts as $post) {
|
| 2858 |
+
$results[(int)$post->ID] = array(
|
| 2859 |
+
'title' => trim( esc_html( strip_tags( get_the_title( $post ) ) ) ),
|
| 2860 |
+
'post_type' => $post->post_type,
|
| 2861 |
+
);
|
| 2862 |
+
}
|
| 2863 |
+
|
| 2864 |
+
wp_reset_postdata();
|
| 2865 |
+
return $results;
|
| 2866 |
+
}
|
| 2867 |
+
|
| 2868 |
+
public function fm_categories_query() {
|
| 2869 |
+
$categories = get_categories( array(
|
| 2870 |
+
'hide_empty' => 0,
|
| 2871 |
+
) );
|
| 2872 |
+
$final_categories = array();
|
| 2873 |
+
foreach ( $categories as $key => $value ) {
|
| 2874 |
+
$final_categories[$value->term_id] = $value->name;
|
| 2875 |
+
}
|
| 2876 |
+
return $final_categories;
|
| 2877 |
+
}
|
| 2878 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 2879 |
+
// Getters & Setters //
|
| 2880 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 2881 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 2882 |
+
// Private Methods //
|
| 2883 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 2884 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 2885 |
+
// Listeners //
|
| 2886 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 2887 |
}
|
admin/models/FMModelSelect_data_from_db.php
CHANGED
|
@@ -1,111 +1,111 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMModelSelect_data_from_db {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
|
| 22 |
-
function get_labels($form_id) {
|
| 23 |
-
global $wpdb;
|
| 24 |
-
$rows = $wpdb->get_var("SELECT label_order_current FROM " . $wpdb->prefix . "formmaker where id=" . $form_id);
|
| 25 |
-
return $rows;
|
| 26 |
-
}
|
| 27 |
-
function get_tables() {
|
| 28 |
-
global $wpdb;
|
| 29 |
-
$con_type = $_POST['con_type'];
|
| 30 |
-
|
| 31 |
-
if($con_type == 'local') {
|
| 32 |
-
$query = "SHOW TABLES";
|
| 33 |
-
$tables = $wpdb->get_col($query);
|
| 34 |
-
}
|
| 35 |
-
else if($con_type == 'remote') {
|
| 36 |
-
$username = isset($_POST['username']) ? $_POST['username'] : '';
|
| 37 |
-
$password = isset($_POST['password']) ? $_POST['password'] : '';
|
| 38 |
-
$database = isset($_POST['database']) ? $_POST['database'] : '';
|
| 39 |
-
$host = isset($_POST['host']) ? $_POST['host'] : '';
|
| 40 |
-
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
| 41 |
-
$query = "SHOW TABLES";
|
| 42 |
-
$tables = $wpdb_temp->get_col($query);
|
| 43 |
-
}
|
| 44 |
-
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
| 45 |
-
return $tables;
|
| 46 |
-
}
|
| 47 |
-
|
| 48 |
-
function get_tables_saved($con_type, $username, $password, $database, $host) {
|
| 49 |
-
global $wpdb;
|
| 50 |
-
|
| 51 |
-
if($con_type == 'local') {
|
| 52 |
-
$query = "SHOW TABLES";
|
| 53 |
-
$tables = $wpdb->get_col($query);
|
| 54 |
-
}
|
| 55 |
-
else if($con_type == 'remote') {
|
| 56 |
-
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
| 57 |
-
$query = "SHOW TABLES";
|
| 58 |
-
$tables = $wpdb_temp->get_col($query);
|
| 59 |
-
}
|
| 60 |
-
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
| 61 |
-
return $tables;
|
| 62 |
-
}
|
| 63 |
-
|
| 64 |
-
function get_table_struct() {
|
| 65 |
-
global $wpdb;
|
| 66 |
-
$name = isset($_POST['name']) ? $_POST['name'] : NULL;
|
| 67 |
-
if(!$name)
|
| 68 |
-
return array();
|
| 69 |
-
$con_method = $_POST['con_method'];
|
| 70 |
-
$con_type = $_POST['con_type'];
|
| 71 |
-
$query = "SHOW COLUMNS FROM " . $name;
|
| 72 |
-
if($con_type == 'remote') {
|
| 73 |
-
$username = isset($_POST['username']) ? $_POST['username'] : '';
|
| 74 |
-
$password = isset($_POST['password']) ? $_POST['password'] : '';
|
| 75 |
-
$database = isset($_POST['database']) ? $_POST['database'] : '';
|
| 76 |
-
$host = isset($_POST['host']) ? $_POST['host'] : '';
|
| 77 |
-
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
| 78 |
-
$table_struct = $wpdb_temp->get_results($query);
|
| 79 |
-
}
|
| 80 |
-
else {
|
| 81 |
-
$table_struct = $wpdb->get_results($query);
|
| 82 |
-
}
|
| 83 |
-
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
| 84 |
-
return $table_struct;
|
| 85 |
-
}
|
| 86 |
-
|
| 87 |
-
function get_table_struct_saved($con_type, $username, $password, $database, $host, $name, $con_method) {
|
| 88 |
-
global $wpdb;
|
| 89 |
-
if(!$name)
|
| 90 |
-
return array();
|
| 91 |
-
$query = "SHOW COLUMNS FROM " . $name;
|
| 92 |
-
if($con_type == 'remote') {
|
| 93 |
-
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
| 94 |
-
$table_struct = $wpdb_temp->get_results($query);
|
| 95 |
-
}
|
| 96 |
-
else {
|
| 97 |
-
$table_struct = $wpdb->get_results($query);
|
| 98 |
-
}
|
| 99 |
-
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
| 100 |
-
return $table_struct;
|
| 101 |
-
}
|
| 102 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 103 |
-
// Getters & Setters //
|
| 104 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 105 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 106 |
-
// Private Methods //
|
| 107 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 108 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 109 |
-
// Listeners //
|
| 110 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 111 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMModelSelect_data_from_db {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
|
| 22 |
+
function get_labels($form_id) {
|
| 23 |
+
global $wpdb;
|
| 24 |
+
$rows = $wpdb->get_var("SELECT label_order_current FROM " . $wpdb->prefix . "formmaker where id=" . $form_id);
|
| 25 |
+
return $rows;
|
| 26 |
+
}
|
| 27 |
+
function get_tables() {
|
| 28 |
+
global $wpdb;
|
| 29 |
+
$con_type = $_POST['con_type'];
|
| 30 |
+
|
| 31 |
+
if($con_type == 'local') {
|
| 32 |
+
$query = "SHOW TABLES";
|
| 33 |
+
$tables = $wpdb->get_col($query);
|
| 34 |
+
}
|
| 35 |
+
else if($con_type == 'remote') {
|
| 36 |
+
$username = isset($_POST['username']) ? $_POST['username'] : '';
|
| 37 |
+
$password = isset($_POST['password']) ? $_POST['password'] : '';
|
| 38 |
+
$database = isset($_POST['database']) ? $_POST['database'] : '';
|
| 39 |
+
$host = isset($_POST['host']) ? $_POST['host'] : '';
|
| 40 |
+
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
| 41 |
+
$query = "SHOW TABLES";
|
| 42 |
+
$tables = $wpdb_temp->get_col($query);
|
| 43 |
+
}
|
| 44 |
+
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
| 45 |
+
return $tables;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
function get_tables_saved($con_type, $username, $password, $database, $host) {
|
| 49 |
+
global $wpdb;
|
| 50 |
+
|
| 51 |
+
if($con_type == 'local') {
|
| 52 |
+
$query = "SHOW TABLES";
|
| 53 |
+
$tables = $wpdb->get_col($query);
|
| 54 |
+
}
|
| 55 |
+
else if($con_type == 'remote') {
|
| 56 |
+
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
| 57 |
+
$query = "SHOW TABLES";
|
| 58 |
+
$tables = $wpdb_temp->get_col($query);
|
| 59 |
+
}
|
| 60 |
+
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
| 61 |
+
return $tables;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
function get_table_struct() {
|
| 65 |
+
global $wpdb;
|
| 66 |
+
$name = isset($_POST['name']) ? $_POST['name'] : NULL;
|
| 67 |
+
if(!$name)
|
| 68 |
+
return array();
|
| 69 |
+
$con_method = $_POST['con_method'];
|
| 70 |
+
$con_type = $_POST['con_type'];
|
| 71 |
+
$query = "SHOW COLUMNS FROM " . $name;
|
| 72 |
+
if($con_type == 'remote') {
|
| 73 |
+
$username = isset($_POST['username']) ? $_POST['username'] : '';
|
| 74 |
+
$password = isset($_POST['password']) ? $_POST['password'] : '';
|
| 75 |
+
$database = isset($_POST['database']) ? $_POST['database'] : '';
|
| 76 |
+
$host = isset($_POST['host']) ? $_POST['host'] : '';
|
| 77 |
+
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
| 78 |
+
$table_struct = $wpdb_temp->get_results($query);
|
| 79 |
+
}
|
| 80 |
+
else {
|
| 81 |
+
$table_struct = $wpdb->get_results($query);
|
| 82 |
+
}
|
| 83 |
+
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
| 84 |
+
return $table_struct;
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
function get_table_struct_saved($con_type, $username, $password, $database, $host, $name, $con_method) {
|
| 88 |
+
global $wpdb;
|
| 89 |
+
if(!$name)
|
| 90 |
+
return array();
|
| 91 |
+
$query = "SHOW COLUMNS FROM " . $name;
|
| 92 |
+
if($con_type == 'remote') {
|
| 93 |
+
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
| 94 |
+
$table_struct = $wpdb_temp->get_results($query);
|
| 95 |
+
}
|
| 96 |
+
else {
|
| 97 |
+
$table_struct = $wpdb->get_results($query);
|
| 98 |
+
}
|
| 99 |
+
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
| 100 |
+
return $table_struct;
|
| 101 |
+
}
|
| 102 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 103 |
+
// Getters & Setters //
|
| 104 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 105 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 106 |
+
// Private Methods //
|
| 107 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 108 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 109 |
+
// Listeners //
|
| 110 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 111 |
}
|
admin/models/FMModelShow_matrix.php
CHANGED
|
@@ -1,31 +1,31 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMModelShow_matrix {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
|
| 22 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 23 |
-
// Getters & Setters //
|
| 24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 25 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 26 |
-
// Private Methods //
|
| 27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 28 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 29 |
-
// Listeners //
|
| 30 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 31 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMModelShow_matrix {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
|
| 22 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 23 |
+
// Getters & Setters //
|
| 24 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 25 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 26 |
+
// Private Methods //
|
| 27 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 28 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 29 |
+
// Listeners //
|
| 30 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 31 |
}
|
admin/models/FMModelSubmissions_fm.php
CHANGED
|
@@ -1,744 +1,744 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
class FMModelSubmissions_fm {
|
| 3 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 4 |
-
// Events //
|
| 5 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
// Constants //
|
| 8 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
// Variables //
|
| 11 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
// Constructor & Destructor //
|
| 14 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 15 |
-
public function __construct() {
|
| 16 |
-
}
|
| 17 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 18 |
-
// Public Methods //
|
| 19 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 20 |
-
public function blocked_ips() {
|
| 21 |
-
global $wpdb;
|
| 22 |
-
$ips = $wpdb->get_col('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked');
|
| 23 |
-
return $ips;
|
| 24 |
-
}
|
| 25 |
-
|
| 26 |
-
public function get_form_titles() {
|
| 27 |
-
global $wpdb;
|
| 28 |
-
$query = "SELECT id, title FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN(" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ") order by title";
|
| 29 |
-
$forms = $wpdb->get_results($query);
|
| 30 |
-
return $forms;
|
| 31 |
-
}
|
| 32 |
-
|
| 33 |
-
public function get_statistics($form_id) {
|
| 34 |
-
global $wpdb;
|
| 35 |
-
$statistics = array();
|
| 36 |
-
$query = $wpdb->prepare('SELECT count(distinct group_id) FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id ="%d"', $form_id);
|
| 37 |
-
$statistics["total_entries"] = $wpdb->get_var($query);
|
| 38 |
-
$query = $wpdb->prepare('SELECT `views` FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $form_id);
|
| 39 |
-
$statistics["total_views"] = $wpdb->get_var($query);
|
| 40 |
-
if ($statistics["total_views"]) {
|
| 41 |
-
$statistics["conversion_rate"] = round((($statistics["total_entries"] / $statistics["total_views"]) * 100), 2) . '%';
|
| 42 |
-
}
|
| 43 |
-
else {
|
| 44 |
-
$statistics["conversion_rate"] = '0%';
|
| 45 |
-
}
|
| 46 |
-
return $statistics;
|
| 47 |
-
}
|
| 48 |
-
|
| 49 |
-
public function get_labels_parameters($form_id) {
|
| 50 |
-
global $wpdb;
|
| 51 |
-
$labels = array();
|
| 52 |
-
$labels_id = array();
|
| 53 |
-
$sorted_labels_id = array();
|
| 54 |
-
$label_names = array();
|
| 55 |
-
$label_types = array();
|
| 56 |
-
$sorted_label_types = array();
|
| 57 |
-
$label_names_original = array();
|
| 58 |
-
$labels_parameters = array();
|
| 59 |
-
$join_query = array();
|
| 60 |
-
$join_where = array();
|
| 61 |
-
$join_verified = array();
|
| 62 |
-
$rows_ord = array();
|
| 63 |
-
$join = '';
|
| 64 |
-
|
| 65 |
-
$query = $wpdb->prepare("SELECT `group_id`,`element_value` FROM " . $wpdb->prefix . "formmaker_submits WHERE `form_id`='%d' and `element_label` = 'verifyinfo' ", $form_id);
|
| 66 |
-
$ver_emails_data = $wpdb->get_results($query);
|
| 67 |
-
|
| 68 |
-
$ver_emails_array = array();
|
| 69 |
-
if($ver_emails_data) {
|
| 70 |
-
foreach($ver_emails_data as $ver_email) {
|
| 71 |
-
$elem_label = str_replace('verified**', '', $ver_email->element_value);
|
| 72 |
-
$query = $wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits WHERE `form_id`='%d' AND `group_id` = '%d' AND `element_label` = '%s' ", $form_id, (int)$ver_email->group_id, $elem_label);
|
| 73 |
-
if(!isset($ver_emails_array[$elem_label]))
|
| 74 |
-
$ver_emails_array[$elem_label] = array();
|
| 75 |
-
|
| 76 |
-
if(!in_array( $wpdb->get_var($query), $ver_emails_array[$elem_label]))
|
| 77 |
-
$ver_emails_array[$elem_label][] = $wpdb->get_var($query);
|
| 78 |
-
}
|
| 79 |
-
}
|
| 80 |
-
for ($i = 0; $i < 9; $i++) {
|
| 81 |
-
array_push($labels_parameters, NULL);
|
| 82 |
-
}
|
| 83 |
-
$sorted_label_names = array();
|
| 84 |
-
$sorted_label_names_original = array();
|
| 85 |
-
$where_labels = array();
|
| 86 |
-
$where2 = array();
|
| 87 |
-
$pagination_clicked = (isset($_POST['pagination_clicked']) && $_POST['pagination_clicked'] == '1' ? '1' : '0');
|
| 88 |
-
$order_by = ((isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) != '') ? esc_html(stripslashes($_POST['order_by'])) : 'group_id');
|
| 89 |
-
$asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'asc') ? 'asc' : 'desc');
|
| 90 |
-
$limit = ((isset($_POST['page_number'])) ? ((int) $_POST['page_number'] - 1) * 20 : 0);
|
| 91 |
-
$lists['hide_label_list'] = ((isset($_POST['hide_label_list'])) ? esc_html(stripslashes($_POST['hide_label_list'])) : '');
|
| 92 |
-
$lists['startdate'] = ((isset($_POST['startdate'])) ? esc_html(stripslashes($_POST['startdate'])) : '');
|
| 93 |
-
$lists['enddate'] = ((isset($_POST['enddate'])) ? esc_html(stripslashes($_POST['enddate'])) : '');
|
| 94 |
-
$lists['ip_search'] = ((isset($_POST['ip_search'])) ? esc_html(stripslashes($_POST['ip_search'])) : '');
|
| 95 |
-
|
| 96 |
-
$lists['username_search'] = ((isset($_POST['username_search'])) ? esc_html(stripslashes($_POST['username_search'])) : '');
|
| 97 |
-
$lists['useremail_search'] = ((isset($_POST['useremail_search'])) ? esc_html(stripslashes($_POST['useremail_search'])) : '');
|
| 98 |
-
$lists['id_search'] = ((isset($_POST['id_search'])) ? esc_html(stripslashes($_POST['id_search'])) : '');
|
| 99 |
-
|
| 100 |
-
if ($lists['ip_search']) {
|
| 101 |
-
$where[] = 'ip LIKE "%' . $lists['ip_search'] . '%"';
|
| 102 |
-
}
|
| 103 |
-
if ($lists['startdate'] != '') {
|
| 104 |
-
$where[] = " `date`>='" . $lists['startdate'] . " 00:00:00' ";
|
| 105 |
-
}
|
| 106 |
-
if ($lists['enddate'] != '') {
|
| 107 |
-
$where[] = " `date`<='" . $lists['enddate'] . " 23:59:59' ";
|
| 108 |
-
}
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
if ($lists['username_search']) {
|
| 112 |
-
$where[] = 'user_id_wd IN (SELECT ID FROM ' . $wpdb->prefix . 'users WHERE display_name LIKE "%'.$lists['username_search'].'%")';
|
| 113 |
-
}
|
| 114 |
-
if ($lists['useremail_search']) {
|
| 115 |
-
$where[] = 'user_id_wd IN (SELECT ID FROM ' . $wpdb->prefix . 'users WHERE user_email LIKE "%'.$lists['useremail_search'].'%")';
|
| 116 |
-
}
|
| 117 |
-
|
| 118 |
-
if ($lists['id_search']) {
|
| 119 |
-
$where[] = 'group_id ='.(int)$lists['id_search'];
|
| 120 |
-
}
|
| 121 |
-
|
| 122 |
-
$where[] = 'form_id=' . $form_id . '';
|
| 123 |
-
$where = (count($where) ? ' ' . implode(' AND ', $where) : '');
|
| 124 |
-
if ($order_by == 'group_id' or $order_by == 'date' or $order_by == 'ip') {
|
| 125 |
-
$orderby = ' ORDER BY ' . $order_by . ' ' . $asc_or_desc . '';
|
| 126 |
-
}elseif($order_by == 'display_name' or $order_by == 'user_email'){
|
| 127 |
-
$orderby = ' ORDER BY (SELECT '.$order_by.' FROM ' . $wpdb->prefix . 'users WHERE ID=user_id_wd) '. $asc_or_desc .'';
|
| 128 |
-
}
|
| 129 |
-
else {
|
| 130 |
-
$orderby = "";
|
| 131 |
-
}
|
| 132 |
-
if ($form_id) {
|
| 133 |
-
for($i = 0; $i < 9; $i++) {
|
| 134 |
-
array_pop($labels_parameters);
|
| 135 |
-
}
|
| 136 |
-
$query = "SELECT distinct element_label FROM " . $wpdb->prefix . "formmaker_submits WHERE ". $where;
|
| 137 |
-
$results = $wpdb->get_results($query);
|
| 138 |
-
for ($i = 0; $i < count($results); $i++) {
|
| 139 |
-
array_push($labels, $results[$i]->element_label);
|
| 140 |
-
}
|
| 141 |
-
$form = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='%d'", $form_id));
|
| 142 |
-
if (strpos($form->label_order, 'type_paypal_')) {
|
| 143 |
-
$form->label_order = $form->label_order . "item_total#**id**#Item Total#**label**#type_paypal_payment_total#****#total#**id**#Total#**label**#type_paypal_payment_total#****#0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
|
| 144 |
-
}
|
| 145 |
-
|
| 146 |
-
$form_labels = explode('#****#', $form->label_order);
|
| 147 |
-
$form_labels = array_slice($form_labels, 0, count($form_labels) - 1);
|
| 148 |
-
|
| 149 |
-
foreach ($form_labels as $key => $form_label) {
|
| 150 |
-
$label_id = explode('#**id**#', $form_label);
|
| 151 |
-
array_push($labels_id, $label_id[0]);
|
| 152 |
-
$label_name_type = explode('#**label**#', $label_id[1]);
|
| 153 |
-
array_push($label_names_original, $label_name_type[0]);
|
| 154 |
-
$ptn = "/[^a-zA-Z0-9_]/";
|
| 155 |
-
$rpltxt = "";
|
| 156 |
-
$label_name = preg_replace($ptn, $rpltxt, $label_name_type[0]);
|
| 157 |
-
array_push($label_names, $label_name);
|
| 158 |
-
array_push($label_types, $label_name_type[1]);
|
| 159 |
-
}
|
| 160 |
-
|
| 161 |
-
foreach ($labels_id as $key => $label_id) {
|
| 162 |
-
if (in_array($label_id, $labels)) {
|
| 163 |
-
if (!in_array($label_id, $sorted_labels_id)) {
|
| 164 |
-
array_push($sorted_labels_id, $label_id);
|
| 165 |
-
}
|
| 166 |
-
array_push($sorted_label_names, $label_names[$key]);
|
| 167 |
-
array_push($sorted_label_types, $label_types[$key]);
|
| 168 |
-
array_push($sorted_label_names_original, $label_names_original[$key]);
|
| 169 |
-
if (isset($_POST[$form_id . '_' . $label_id . '_search'])) {
|
| 170 |
-
$search_temp = esc_html($_POST[$form_id . '_' . $label_id . '_search']);
|
| 171 |
-
}
|
| 172 |
-
else {
|
| 173 |
-
$search_temp = '';
|
| 174 |
-
}
|
| 175 |
-
$search_temp = strtolower($search_temp);
|
| 176 |
-
|
| 177 |
-
$lists[$form_id . '_' . $label_id . '_search'] = $search_temp;
|
| 178 |
-
if ($search_temp) {
|
| 179 |
-
$join_query[] = 'search';
|
| 180 |
-
$join_where[] = array('label' => $label_id, 'search' => $search_temp);
|
| 181 |
-
}
|
| 182 |
-
|
| 183 |
-
if (isset($_POST[$form_id . '_' . $label_id . '_search_verified'])) {
|
| 184 |
-
$search_verified = $_POST[$form_id . '_' . $label_id . '_search_verified'];
|
| 185 |
-
$lists[$form_id . '_' . $label_id . '_search_verified'] = $search_verified;
|
| 186 |
-
} else {
|
| 187 |
-
$search_verified = '';
|
| 188 |
-
}
|
| 189 |
-
|
| 190 |
-
if ($search_verified && isset($ver_emails_array[$label_id])) {
|
| 191 |
-
$join_query[] = 'search';
|
| 192 |
-
$join_where[] = null;
|
| 193 |
-
$join_verified[] = array('label' => $label_id, 'ver_search' => implode('|', $ver_emails_array[$label_id]));
|
| 194 |
-
}
|
| 195 |
-
}
|
| 196 |
-
}
|
| 197 |
-
|
| 198 |
-
if (strpos($order_by, "_field")) {
|
| 199 |
-
if (in_array(str_replace("_field", "", $order_by), $labels)) {
|
| 200 |
-
$join_query[] = 'sort';
|
| 201 |
-
$join_where[] = array('label'=>str_replace("_field", "", $order_by));
|
| 202 |
-
}
|
| 203 |
-
}
|
| 204 |
-
$cols = 'group_id';
|
| 205 |
-
if ($order_by == 'date' or $order_by == 'ip') {
|
| 206 |
-
$cols = 'group_id, date, ip';
|
| 207 |
-
}
|
| 208 |
-
|
| 209 |
-
$ver_where = '';
|
| 210 |
-
if( !empty($join_verified) ) {
|
| 211 |
-
foreach( $join_verified as $key_ver => $join_ver) {
|
| 212 |
-
$ver_where .= '(element_label="' . $join_ver['label'] . '" AND element_value REGEXP "'.$join_ver['ver_search'].'" ) AND' ;
|
| 213 |
-
}
|
| 214 |
-
}
|
| 215 |
-
|
| 216 |
-
switch (count($join_query)) {
|
| 217 |
-
case 0:
|
| 218 |
-
$join = 'SELECT distinct group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE '. $where;
|
| 219 |
-
|
| 220 |
-
break;
|
| 221 |
-
case 1:
|
| 222 |
-
if ($join_query[0] == 'sort') {
|
| 223 |
-
$join = 'SELECT group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE ' . $where . ' AND element_label="' . $join_where[0]['label'] . '" ';
|
| 224 |
-
$join_count = 'SELECT count(group_id) FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="' . $form_id . '" AND element_label="' . $join_where[0]['label'] . '" ';
|
| 225 |
-
|
| 226 |
-
$orderby = ' ORDER BY `element_value` ' . $asc_or_desc;
|
| 227 |
-
}
|
| 228 |
-
else {
|
| 229 |
-
if(isset($join_where[0]['search'])) {
|
| 230 |
-
$join = 'SELECT group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE element_label="' . $join_where[0]['label'] . '" AND (element_value LIKE "%' . $join_where[0]['search'] . '%" OR element_value LIKE "%' . str_replace(' ', '@@@', $join_where[0]['search']) . '%") AND ' . $where;
|
| 231 |
-
} else {
|
| 232 |
-
$join = 'SELECT group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE '.$ver_where . $where;
|
| 233 |
-
}
|
| 234 |
-
}
|
| 235 |
-
break;
|
| 236 |
-
default:
|
| 237 |
-
if( !empty($join_verified) ) {
|
| 238 |
-
if( isset( $join_where[0]['search'] ) ) {
|
| 239 |
-
$join = 'SELECT t.group_id from (SELECT t1.group_id from (SELECT ' . $cols . ' FROM ' . $wpdb->prefix . 'formmaker_submits WHERE (element_label="' . $join_where[0]['label'] . '" AND (element_value LIKE "%' . $join_where[0]['search'] . '%" OR element_value LIKE "%' . str_replace(' ', '@@@', $join_where[0]['search']) . '%")) AND '. $where.' ) as t1 JOIN (SELECT group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE '.$ver_where.$where.') as t2 ON t1.group_id = t2.group_id) as t ';
|
| 240 |
-
|
| 241 |
-
} else{
|
| 242 |
-
$join = 'SELECT t.group_id FROM (SELECT ' . $cols . ' FROM ' . $wpdb->prefix . 'formmaker_submits WHERE ' . $ver_where.$where . ') as t ';
|
| 243 |
-
}
|
| 244 |
-
} else{
|
| 245 |
-
$join = 'SELECT t.group_id FROM (SELECT ' . $cols . ' FROM ' . $wpdb->prefix . 'formmaker_submits WHERE ' . $where . ' AND element_label="' . $join_where[0]['label'] . '" AND (element_value LIKE "%' . $join_where[0]['search'] . '%" OR element_value LIKE "%' . str_replace(' ', '@@@', $join_where[0]['search']) . '%" )) as t ';
|
| 246 |
-
}
|
| 247 |
-
|
| 248 |
-
for ($key = 1; $key < count($join_query); $key++) {
|
| 249 |
-
if ($join_query[$key] == 'sort') {
|
| 250 |
-
if(isset($join_where[$key])){
|
| 251 |
-
$join .= 'LEFT JOIN (SELECT group_id as group_id' . $key . ', element_value FROM ' . $wpdb->prefix . 'formmaker_submits WHERE ' . $where . ' AND element_label="' . $join_where[$key]['label'] . '") as t' . $key . ' ON t' . $key . '.group_id' . $key . '=t.group_id ';
|
| 252 |
-
$orderby = ' ORDER BY t' . $key . '.`element_value` ' . $asc_or_desc . '';
|
| 253 |
-
}
|
| 254 |
-
}
|
| 255 |
-
else {
|
| 256 |
-
if(isset( $join_where[$key])) {
|
| 257 |
-
$join .= 'INNER JOIN (SELECT group_id as group_id' . $key . ' FROM ' . $wpdb->prefix . 'formmaker_submits WHERE '.$where.' AND element_label="' . $join_where[$key]['label'] . '" AND (element_value LIKE "%' . $join_where[$key]['search'] . '%" OR element_value LIKE "%' . str_replace(' ', '@@@', $join_where[$key]['search']) . '%")) as t' . $key . ' ON t' . $key . '.group_id' . $key . '=t.group_id ';
|
| 258 |
-
}
|
| 259 |
-
}
|
| 260 |
-
}
|
| 261 |
-
break;
|
| 262 |
-
}
|
| 263 |
-
$pos = strpos($join, 'SELECT t.group_id');
|
| 264 |
-
if ($pos === FALSE) {
|
| 265 |
-
$query = str_replace(array('SELECT group_id','SELECT distinct group_id'), array('SELECT count(distinct group_id)','SELECT count(distinct group_id)'), $join);
|
| 266 |
-
}
|
| 267 |
-
else {
|
| 268 |
-
$query = str_replace('SELECT t.group_id', 'SELECT count(t.group_id)', $join);
|
| 269 |
-
}
|
| 270 |
-
$total = $wpdb->get_var($query);
|
| 271 |
-
|
| 272 |
-
$query_sub_count = "SELECT count(distinct group_id) from ".$wpdb->prefix."formmaker_submits";
|
| 273 |
-
$sub_count = (int)$wpdb->get_var($query_sub_count);
|
| 274 |
-
|
| 275 |
-
$limit1 = (int)$total < $sub_count && !$pagination_clicked ? 0 : $limit;
|
| 276 |
-
$query = $join . ' ' . $orderby . ' limit ' . $limit1 . ', 20 ';
|
| 277 |
-
$results = $wpdb->get_results($query);
|
| 278 |
-
for ($i = 0; $i < count($results); $i++) {
|
| 279 |
-
array_push($rows_ord, $results[$i]->group_id);
|
| 280 |
-
}
|
| 281 |
-
|
| 282 |
-
$query1 = $join . ' ' . $orderby ;
|
| 283 |
-
$searched_group_ids = $wpdb->get_results($query1);
|
| 284 |
-
$searched_ids = array();
|
| 285 |
-
for ($i = 0; $i < count($searched_group_ids); $i++) {
|
| 286 |
-
array_push($searched_ids, $searched_group_ids[$i]->group_id);
|
| 287 |
-
}
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
$where2 = array();
|
| 291 |
-
$where2[] = "group_id='0'";
|
| 292 |
-
foreach ($rows_ord as $rows_ordd) {
|
| 293 |
-
$where2[] = "group_id='" . $rows_ordd . "'";
|
| 294 |
-
}
|
| 295 |
-
$where2 = (count($where2) ? ' WHERE ' . implode( ' OR ', $where2 ) . '' : '' );
|
| 296 |
-
$query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits ' . $where2;
|
| 297 |
-
$rows = $wpdb->get_results($query);
|
| 298 |
-
$group_ids = $rows_ord;
|
| 299 |
-
$lists['total'] = $total;
|
| 300 |
-
$lists['limit'] = (int) ($limit1 / 20 + 1);
|
| 301 |
-
|
| 302 |
-
$where_choices = $where;
|
| 303 |
-
array_push($labels_parameters, $sorted_labels_id);
|
| 304 |
-
array_push($labels_parameters, $sorted_label_types);
|
| 305 |
-
array_push($labels_parameters, $lists);
|
| 306 |
-
array_push($labels_parameters, $sorted_label_names);
|
| 307 |
-
array_push($labels_parameters, $sorted_label_names_original);
|
| 308 |
-
array_push($labels_parameters, $rows);
|
| 309 |
-
array_push($labels_parameters, $group_ids);
|
| 310 |
-
array_push($labels_parameters, $where_choices);
|
| 311 |
-
array_push($labels_parameters, $searched_ids);
|
| 312 |
-
}
|
| 313 |
-
return $labels_parameters;
|
| 314 |
-
}
|
| 315 |
-
|
| 316 |
-
public function get_type_address($sorted_label_type, $sorted_label_name_original) {
|
| 317 |
-
if ($sorted_label_type == 'type_address') {
|
| 318 |
-
switch ($sorted_label_name_original) {
|
| 319 |
-
case 'Street Line':
|
| 320 |
-
$field_title = __('Street Address', 'form_maker');
|
| 321 |
-
break;
|
| 322 |
-
case 'Street Line2':
|
| 323 |
-
$field_title = __('Street Address Line 2', 'form_maker');
|
| 324 |
-
break;
|
| 325 |
-
case 'City':
|
| 326 |
-
$field_title = __('City', 'form_maker');
|
| 327 |
-
break;
|
| 328 |
-
case 'State':
|
| 329 |
-
$field_title = __('State / Province / Region', 'form_maker');
|
| 330 |
-
break;
|
| 331 |
-
case 'Postal':
|
| 332 |
-
$field_title = __('Postal / Zip Code', 'form_maker');
|
| 333 |
-
break;
|
| 334 |
-
case 'Country':
|
| 335 |
-
$field_title = __('Country', 'form_maker');
|
| 336 |
-
break;
|
| 337 |
-
default :
|
| 338 |
-
$field_title = stripslashes($sorted_label_name_original);
|
| 339 |
-
break;
|
| 340 |
-
}
|
| 341 |
-
}
|
| 342 |
-
else {
|
| 343 |
-
$field_title = stripslashes($sorted_label_name_original);
|
| 344 |
-
}
|
| 345 |
-
return $field_title;
|
| 346 |
-
}
|
| 347 |
-
|
| 348 |
-
public function hide_or_not($hide_strings,$hide_string) {
|
| 349 |
-
if (strpos($hide_string,'@') === FALSE) {
|
| 350 |
-
if (strpos($hide_strings, '@' . $hide_string . '@') === FALSE) {
|
| 351 |
-
$style = '';
|
| 352 |
-
}
|
| 353 |
-
else {
|
| 354 |
-
$style = 'style="display:none"';
|
| 355 |
-
}
|
| 356 |
-
}
|
| 357 |
-
else {
|
| 358 |
-
if (strpos($hide_strings, $hide_string) === FALSE) {
|
| 359 |
-
$style = '';
|
| 360 |
-
}
|
| 361 |
-
else {
|
| 362 |
-
$style = 'style="display:none"';
|
| 363 |
-
}
|
| 364 |
-
}
|
| 365 |
-
return $style;
|
| 366 |
-
}
|
| 367 |
-
|
| 368 |
-
public function sort_group_ids($sorted_label_names_count, $group_ids) {
|
| 369 |
-
$count_labe = $sorted_label_names_count;
|
| 370 |
-
$group_id_s = array();
|
| 371 |
-
$l = 0;
|
| 372 |
-
if (count($group_ids) > 0 and $count_labe) {
|
| 373 |
-
for ($i = 0; $i < count($group_ids); $i++) {
|
| 374 |
-
if (!in_array($group_ids[$i], $group_id_s)) {
|
| 375 |
-
array_push($group_id_s, $group_ids[$i]);
|
| 376 |
-
}
|
| 377 |
-
}
|
| 378 |
-
}
|
| 379 |
-
return $group_id_s;
|
| 380 |
-
}
|
| 381 |
-
|
| 382 |
-
public function array_for_group_id($group, $rows) {
|
| 383 |
-
$i = $group;
|
| 384 |
-
$count_rows = count($rows);
|
| 385 |
-
$temp = array();
|
| 386 |
-
for ($j = 0; $j < $count_rows; $j++) {
|
| 387 |
-
$row = $rows[$j];
|
| 388 |
-
if ($row->group_id == $i) {
|
| 389 |
-
array_push($temp, $row);
|
| 390 |
-
}
|
| 391 |
-
}
|
| 392 |
-
return $temp;
|
| 393 |
-
}
|
| 394 |
-
|
| 395 |
-
public function check_radio_type($sorted_label_type) {
|
| 396 |
-
if ($sorted_label_type == "type_checkbox" || $sorted_label_type == "type_radio" || $sorted_label_type == "type_own_select" || $sorted_label_type == "type_country" || $sorted_label_type == "type_paypal_select" || $sorted_label_type == "type_paypal_radio" || $sorted_label_type == "type_paypal_checkbox" || $sorted_label_type == "type_paypal_shipping") {
|
| 397 |
-
return TRUE;
|
| 398 |
-
}
|
| 399 |
-
else {
|
| 400 |
-
return FALSE;
|
| 401 |
-
}
|
| 402 |
-
}
|
| 403 |
-
|
| 404 |
-
public function statistic_for_radio($where_choices, $sorted_label_id) {
|
| 405 |
-
global $wpdb;
|
| 406 |
-
$choices_params = array();
|
| 407 |
-
$query = "SELECT element_value FROM " . $wpdb->prefix . "formmaker_submits WHERE " . $where_choices . " AND element_label='" . $sorted_label_id . "'";
|
| 408 |
-
$choices = $wpdb->get_results($query);
|
| 409 |
-
$colors=array('#5FE2FF','#F9E89C');
|
| 410 |
-
$choices_colors=array('#4EC0D9','#DDCC7F');
|
| 411 |
-
$choices_labels = array();
|
| 412 |
-
$choices_count = array();
|
| 413 |
-
$all = count($choices);
|
| 414 |
-
$unanswered = 0;
|
| 415 |
-
foreach ($choices as $key => $choice) {
|
| 416 |
-
if ($choice->element_value == '') {
|
| 417 |
-
$unanswered++;
|
| 418 |
-
}
|
| 419 |
-
else {
|
| 420 |
-
if (!in_array($choice->element_value, $choices_labels)) {
|
| 421 |
-
array_push($choices_labels, $choice->element_value);
|
| 422 |
-
array_push($choices_count, 0);
|
| 423 |
-
}
|
| 424 |
-
$choices_count[array_search($choice->element_value, $choices_labels)]++;
|
| 425 |
-
}
|
| 426 |
-
}
|
| 427 |
-
array_multisort($choices_count, SORT_DESC, $choices_labels);
|
| 428 |
-
array_push($choices_params, $choices_count);
|
| 429 |
-
array_push($choices_params, $choices_labels);
|
| 430 |
-
array_push($choices_params, $unanswered);
|
| 431 |
-
array_push($choices_params, $all);
|
| 432 |
-
array_push($choices_params, $colors);
|
| 433 |
-
array_push($choices_params, $choices_colors);
|
| 434 |
-
return $choices_params;
|
| 435 |
-
}
|
| 436 |
-
|
| 437 |
-
public function get_data_of_group_id($id) {
|
| 438 |
-
global $wpdb;
|
| 439 |
-
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id=" . $id;
|
| 440 |
-
$rows = $wpdb->get_results($query);
|
| 441 |
-
$form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id=" . $rows[0]->form_id);
|
| 442 |
-
$params = array();
|
| 443 |
-
$label_id = array();
|
| 444 |
-
$label_order_original = array();
|
| 445 |
-
$label_type = array();
|
| 446 |
-
$ispaypal = strpos($form->label_order, 'type_paypal_');
|
| 447 |
-
if ($form->paypal_mode == 1) {
|
| 448 |
-
if ($ispaypal) {
|
| 449 |
-
$form->label_order = $form->label_order."0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
|
| 450 |
-
}
|
| 451 |
-
}
|
| 452 |
-
$label_all = explode('#****#', $form->label_order);
|
| 453 |
-
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
| 454 |
-
foreach ($label_all as $key => $label_each) {
|
| 455 |
-
$label_id_each = explode('#**id**#', $label_each);
|
| 456 |
-
array_push($label_id, $label_id_each[0]);
|
| 457 |
-
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
| 458 |
-
array_push($label_order_original, $label_oder_each[0]);
|
| 459 |
-
array_push($label_type, $label_oder_each[1]);
|
| 460 |
-
}
|
| 461 |
-
/*$theme_id = $wpdb->get_var("SELECT theme FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form->id . "'");*/
|
| 462 |
-
$css = $wpdb->get_var("SELECT css FROM " . $wpdb->prefix . "formmaker_themes");
|
| 463 |
-
array_push($params, $rows);
|
| 464 |
-
array_push($params, $label_id);
|
| 465 |
-
array_push($params, $label_order_original);
|
| 466 |
-
array_push($params, $label_type);
|
| 467 |
-
array_push($params, $ispaypal);
|
| 468 |
-
array_push($params, $form);
|
| 469 |
-
array_push($params, $css);
|
| 470 |
-
return $params;
|
| 471 |
-
}
|
| 472 |
-
|
| 473 |
-
public function check_type_for_edit_function($label_type) {
|
| 474 |
-
if ($label_type != 'type_editor' and $label_type != 'type_submit_reset' and $label_type != 'type_map' and $label_type != 'type_mark_map' and $label_type != 'type_captcha' and $label_type != 'type_recaptcha' and $label_type != 'type_button') {
|
| 475 |
-
return TRUE;
|
| 476 |
-
}
|
| 477 |
-
else {
|
| 478 |
-
return FALSE;
|
| 479 |
-
}
|
| 480 |
-
}
|
| 481 |
-
|
| 482 |
-
public function check_for_submited_label($rows, $label_id) {
|
| 483 |
-
foreach ($rows as $row) {
|
| 484 |
-
if ($row->element_label == $label_id) {
|
| 485 |
-
$element_value = $row->element_value;
|
| 486 |
-
break;
|
| 487 |
-
}
|
| 488 |
-
else {
|
| 489 |
-
$element_value = 'continue';
|
| 490 |
-
}
|
| 491 |
-
}
|
| 492 |
-
return $element_value;
|
| 493 |
-
}
|
| 494 |
-
|
| 495 |
-
public function view_for_star_rating($element_value, $element_label) {
|
| 496 |
-
$view_star_rating_array = array();
|
| 497 |
-
$new_filename = str_replace("***star_rating***", '', $element_value);
|
| 498 |
-
$stars = "";
|
| 499 |
-
$new_filename=explode('***', $new_filename);
|
| 500 |
-
for ($j = 0; $j < $new_filename[1]; $j++) {
|
| 501 |
-
$stars .= '<img id="' . $element_label . '_star_' . $j . '" src="' . WD_FM_URL . '/images/star_' . $new_filename[2] . '.png?ver='. WD_FM_VERSION.'" /> ';
|
| 502 |
-
}
|
| 503 |
-
for ($k = $new_filename[1]; $k < $new_filename[0]; $k++) {
|
| 504 |
-
$stars .= '<img id="' . $element_label . '_star_' . $k . '" src="' . WD_FM_URL . '/images/star.png?ver='. WD_FM_VERSION.'" /> ';
|
| 505 |
-
}
|
| 506 |
-
array_push($view_star_rating_array, $stars);
|
| 507 |
-
return $view_star_rating_array;
|
| 508 |
-
}
|
| 509 |
-
|
| 510 |
-
public function view_for_grading($element_value) {
|
| 511 |
-
$view_grading_array = array();
|
| 512 |
-
$new_filename = str_replace("***grading***", '', $element_value);
|
| 513 |
-
$grading = explode(":", $new_filename);
|
| 514 |
-
$items_count = sizeof($grading) - 1;
|
| 515 |
-
$items = "";
|
| 516 |
-
$total = "";
|
| 517 |
-
for ($k = 0; $k < $items_count / 2; $k++) {
|
| 518 |
-
$items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . "</br>";
|
| 519 |
-
$total += $grading[$k];
|
| 520 |
-
}
|
| 521 |
-
$items .= "Total: " . $total;
|
| 522 |
-
array_push($view_grading_array, $items);
|
| 523 |
-
return $view_grading_array;
|
| 524 |
-
}
|
| 525 |
-
|
| 526 |
-
public function images_for_star_rating($element_value, $label_id) {
|
| 527 |
-
$edit_stars = "";
|
| 528 |
-
$star_rating_array = array();
|
| 529 |
-
$element_value1 = str_replace("***star_rating***", '', $element_value);
|
| 530 |
-
$stars_value = explode('
|
| 531 |
-
for ($j = 0; $j < $stars_value[
|
| 532 |
-
$edit_stars .= '<img id="'
|
| 533 |
-
}
|
| 534 |
-
for( $
|
| 535 |
-
$edit_stars .= '<img id="'
|
| 536 |
-
}
|
| 537 |
-
array_push($star_rating_array, $edit_stars);
|
| 538 |
-
array_push($star_rating_array, $stars_value);
|
| 539 |
-
return $star_rating_array;
|
| 540 |
-
}
|
| 541 |
-
|
| 542 |
-
public function params_for_scale_rating($element_value, $label_id) {
|
| 543 |
-
$scale_rating_array = array();
|
| 544 |
-
$scale_radio = explode('/', $element_value);
|
| 545 |
-
$scale_value = $scale_radio[0];
|
| 546 |
-
$scale = '<table><tr>';
|
| 547 |
-
for ($k = 1; $k <= $scale_radio[1]; $k++) {
|
| 548 |
-
$scale .= '<td style="text-align:center"><span>' . $k . '</span></td>';
|
| 549 |
-
}
|
| 550 |
-
$scale .= '<tr></tr>';
|
| 551 |
-
for ($l = 1; $l <= $scale_radio[1]; $l++) {
|
| 552 |
-
if ($l == $scale_radio[0]) {
|
| 553 |
-
$checked = "checked";
|
| 554 |
-
}
|
| 555 |
-
else {
|
| 556 |
-
$checked = "";
|
| 557 |
-
}
|
| 558 |
-
$scale .= '<td><input type="radio" name = "'.$label_id.'_scale_rating_radio" id = "'.$label_id.'_scale_rating_radio_'.$l.'" value="'.$l.'" '.$checked.' onClick="edit_scale_rating(this.value,'.$label_id.')" /></td>';
|
| 559 |
-
}
|
| 560 |
-
$scale .= '</tr></table>';
|
| 561 |
-
array_push($scale_rating_array, $scale);
|
| 562 |
-
array_push($scale_rating_array, $scale_radio);
|
| 563 |
-
array_push($scale_rating_array, $checked);
|
| 564 |
-
return $scale_rating_array;
|
| 565 |
-
}
|
| 566 |
-
|
| 567 |
-
public function params_for_type_range($element_value, $label_id) {
|
| 568 |
-
$range_value = explode('-', $element_value);
|
| 569 |
-
$range = '<input name="'.$label_id.'_element0" id="'.$label_id.'_element0" type="text" value="'.$range_value[0].'" onChange="edit_range(this.value,'.$label_id.',0)" size="8"/> - <input name="'.$label_id.'_element1" id="'.$label_id.'_element1" type="text" value="'.$range_value[1].'" onChange="edit_range(this.value,'.$label_id.',1)" size="8"/>';
|
| 570 |
-
return $range;
|
| 571 |
-
}
|
| 572 |
-
|
| 573 |
-
public function params_for_type_grading($element_value, $label_id) {
|
| 574 |
-
$type_grading_array = array();
|
| 575 |
-
$element_value1 = str_replace("***grading***", '', $element_value);
|
| 576 |
-
$garding_value = explode(':', $element_value1);
|
| 577 |
-
$items_count = sizeof($garding_value) - 1;
|
| 578 |
-
$garding = "";
|
| 579 |
-
$sum = "";
|
| 580 |
-
for ($k = 0; $k < $items_count/2; $k++) {
|
| 581 |
-
$garding .= '<input name="'.$label_id.'_element'.$k.'" id="'.$label_id.'_element'.$k.'" type="text" value="'.$garding_value[$k].'" onKeyUp="edit_grading('.$label_id.','.$items_count.')" size="5"/> '.$garding_value[$items_count/2+$k].'</br>';
|
| 582 |
-
$sum += $garding_value[$k];
|
| 583 |
-
}
|
| 584 |
-
array_push($type_grading_array, $garding);
|
| 585 |
-
array_push($type_grading_array, $garding_value);
|
| 586 |
-
array_push($type_grading_array, $sum);
|
| 587 |
-
array_push($type_grading_array, $items_count);
|
| 588 |
-
array_push($type_grading_array, $element_value1);
|
| 589 |
-
return $type_grading_array;
|
| 590 |
-
}
|
| 591 |
-
|
| 592 |
-
public function params_for_type_matrix($element_value, $label_id) {
|
| 593 |
-
$type_matrix_array = array();
|
| 594 |
-
$new_filename = str_replace("***matrix***", '', $element_value);
|
| 595 |
-
$matrix_value = explode('***', $new_filename);
|
| 596 |
-
$matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
|
| 597 |
-
$mat_rows = $matrix_value[0];
|
| 598 |
-
$mat_columns = $matrix_value[$mat_rows + 1];
|
| 599 |
-
$matrix = "<table>";
|
| 600 |
-
$matrix .= '<tr><td></td>';
|
| 601 |
-
for ($k = 1; $k <= $mat_columns; $k++) {
|
| 602 |
-
$matrix .= '<td style="background-color:#BBBBBB; padding:5px; border:1px; ">'.$matrix_value[$mat_rows+1+$k].'</td>';
|
| 603 |
-
}
|
| 604 |
-
$matrix .= '</tr>';
|
| 605 |
-
$aaa = Array();
|
| 606 |
-
$var_checkbox = 1;
|
| 607 |
-
$selected_value = "";
|
| 608 |
-
$selected_value_yes = "";
|
| 609 |
-
$selected_value_no = "";
|
| 610 |
-
for ($k = 1; $k <= $mat_rows; $k++) {
|
| 611 |
-
$matrix .= '<tr><td style="background-color:#BBBBBB; padding:5px; border:1px;">'.$matrix_value[$k].'</td>';
|
| 612 |
-
if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
|
| 613 |
-
if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
|
| 614 |
-
$checked = "";
|
| 615 |
-
$aaa[1] = "";
|
| 616 |
-
}
|
| 617 |
-
else {
|
| 618 |
-
$aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
|
| 619 |
-
}
|
| 620 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
| 621 |
-
if ($aaa[1] == $l) {
|
| 622 |
-
$checked = 'checked';
|
| 623 |
-
}
|
| 624 |
-
else {
|
| 625 |
-
$checked = "";
|
| 626 |
-
}
|
| 627 |
-
$index = "'" . $k . '_' . $l . "'";
|
| 628 |
-
$matrix .= '<td style="text-align:center;"><input name="'.$label_id.'_input_elementform_id_temp'.$k.'" id="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" type="'.$matrix_value[$mat_rows+$mat_columns+2].'" '.$checked.' onClick="change_radio_values('.$index.','.$label_id.','.$mat_rows.','.$mat_columns.')"/></td>';
|
| 629 |
-
}
|
| 630 |
-
}
|
| 631 |
-
else {
|
| 632 |
-
if ($matrix_value[$mat_rows+$mat_columns+2] == "checkbox") {
|
| 633 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
| 634 |
-
if ($matrix_value[$mat_rows + $mat_columns + 2 + $var_checkbox] == 1) {
|
| 635 |
-
$checked = 'checked';
|
| 636 |
-
}
|
| 637 |
-
else {
|
| 638 |
-
$checked = '';
|
| 639 |
-
}
|
| 640 |
-
$index = "'".$k.'_'.$l."'";
|
| 641 |
-
$matrix .='<td style="text-align:center;"><input name="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" id="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" type="'.$matrix_value[$mat_rows+$mat_columns+2].'" '.$checked.' onClick="change_checkbox_values('.$index.','.$label_id.','.$mat_rows.','.$mat_columns.')"/></td>';
|
| 642 |
-
$var_checkbox++;
|
| 643 |
-
}
|
| 644 |
-
}
|
| 645 |
-
else {
|
| 646 |
-
if ($matrix_value[$mat_rows + $mat_columns + 2] == "text") {
|
| 647 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
| 648 |
-
$text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
|
| 649 |
-
$index = "'".$k.'_'.$l."'";
|
| 650 |
-
$matrix .= '<td style="text-align:center;"><input name="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" id="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" type="'.$matrix_value[$mat_rows+$mat_columns+2].'" value="'.$text_value.'" onKeyUp="change_text_values('.$index.','.$label_id.','.$mat_rows.','.$mat_columns.')"/></td>';
|
| 651 |
-
$var_checkbox++;
|
| 652 |
-
}
|
| 653 |
-
}
|
| 654 |
-
else {
|
| 655 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
| 656 |
-
$selected_text = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox];
|
| 657 |
-
if ($selected_text == 'yes') {
|
| 658 |
-
$selected_value_yes = 'selected';
|
| 659 |
-
$selected_value_no = '';
|
| 660 |
-
$selected_value = '';
|
| 661 |
-
}
|
| 662 |
-
else {
|
| 663 |
-
if ($selected_text=='no') {
|
| 664 |
-
$selected_value_yes ='';
|
| 665 |
-
$selected_value_no ='selected';
|
| 666 |
-
$selected_value ='';
|
| 667 |
-
}
|
| 668 |
-
else {
|
| 669 |
-
$selected_value_yes = '';
|
| 670 |
-
$selected_value_no ='';
|
| 671 |
-
$selected_value ='selected';
|
| 672 |
-
}
|
| 673 |
-
}
|
| 674 |
-
$index = "'".$k.'_'.$l."'";
|
| 675 |
-
$matrix .= '<td style="text-align:center;"><select name="'.$label_id.'_select_yes_noform_id_temp'.$k.'_'.$l.'" id="'.$label_id.'_select_yes_noform_id_temp'.$k.'_'.$l.'" onChange="change_option_values('.$index.','.$label_id.','.$mat_rows.','.$mat_columns.')"><option value="" '.$selected_value.'></option><option value="yes" '.$selected_value_yes.' >Yes</option><option value="no" '.$selected_value_no.'>No</option></select></td>';
|
| 676 |
-
$var_checkbox++;
|
| 677 |
-
}
|
| 678 |
-
}
|
| 679 |
-
}
|
| 680 |
-
}
|
| 681 |
-
$matrix .= '</tr>';
|
| 682 |
-
}
|
| 683 |
-
$matrix .= '</table>';
|
| 684 |
-
array_push($type_matrix_array, $matrix);
|
| 685 |
-
array_push($type_matrix_array, $new_filename);
|
| 686 |
-
return $type_matrix_array;
|
| 687 |
-
}
|
| 688 |
-
|
| 689 |
-
public function select_data_from_db_for_labels($db_info,$label_column, $table, $where, $order_by) {
|
| 690 |
-
global $wpdb;
|
| 691 |
-
|
| 692 |
-
$query = "SELECT `" . $label_column . "` FROM " . $table . $where . " ORDER BY " . $order_by;
|
| 693 |
-
if($db_info) {
|
| 694 |
-
$temp = explode('@@@wdfhostwdf@@@',$db_info);
|
| 695 |
-
$host = $temp[0];
|
| 696 |
-
$temp = explode('@@@wdfportwdf@@@',$temp[1]);
|
| 697 |
-
$port = $temp[0];
|
| 698 |
-
$temp = explode('@@@wdfusernamewdf@@@',$temp[1]);
|
| 699 |
-
$username = $temp[0];
|
| 700 |
-
$temp = explode('@@@wdfpasswordwdf@@@',$temp[1]);
|
| 701 |
-
$password = $temp[0];
|
| 702 |
-
$temp = explode('@@@wdfdatabasewdf@@@',$temp[1]);
|
| 703 |
-
$database = $temp[0];
|
| 704 |
-
|
| 705 |
-
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
| 706 |
-
$choices_labels = $wpdb_temp->get_col($query);
|
| 707 |
-
}
|
| 708 |
-
else {
|
| 709 |
-
$choices_labels = $wpdb->get_col($query);
|
| 710 |
-
}
|
| 711 |
-
return $choices_labels;
|
| 712 |
-
}
|
| 713 |
-
public function select_data_from_db_for_values($db_info,$value_column, $table, $where, $order_by) {
|
| 714 |
-
global $wpdb;
|
| 715 |
-
$query = "SELECT `" . $value_column . "` FROM " . $table . $where . " ORDER BY " . $order_by;
|
| 716 |
-
if($db_info) {
|
| 717 |
-
$temp = explode('@@@wdfhostwdf@@@',$db_info);
|
| 718 |
-
$host = $temp[0];
|
| 719 |
-
$temp = explode('@@@wdfportwdf@@@',$temp[1]);
|
| 720 |
-
$port = $temp[0];
|
| 721 |
-
$temp = explode('@@@wdfusernamewdf@@@',$temp[1]);
|
| 722 |
-
$username = $temp[0];
|
| 723 |
-
$temp = explode('@@@wdfpasswordwdf@@@',$temp[1]);
|
| 724 |
-
$password = $temp[0];
|
| 725 |
-
$temp = explode('@@@wdfdatabasewdf@@@',$temp[1]);
|
| 726 |
-
$database = $temp[0];
|
| 727 |
-
|
| 728 |
-
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
| 729 |
-
$choices_values = $wpdb_temp->get_col($query);
|
| 730 |
-
}
|
| 731 |
-
else {
|
| 732 |
-
$choices_values = $wpdb->get_col($query);
|
| 733 |
-
}
|
| 734 |
-
return $choices_values;
|
| 735 |
-
}
|
| 736 |
-
public function get_subs_count($form_id) {
|
| 737 |
-
global $wpdb;
|
| 738 |
-
$query = $wpdb->prepare("SELECT distinct group_id FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d", $form_id);
|
| 739 |
-
$group_id_s = $wpdb->get_col($query);
|
| 740 |
-
return count($group_id_s);
|
| 741 |
-
}
|
| 742 |
-
}
|
| 743 |
-
|
| 744 |
-
?>
|
| 1 |
+
<?php
|
| 2 |
+
class FMModelSubmissions_fm {
|
| 3 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 4 |
+
// Events //
|
| 5 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
// Constants //
|
| 8 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
// Variables //
|
| 11 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
// Constructor & Destructor //
|
| 14 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 15 |
+
public function __construct() {
|
| 16 |
+
}
|
| 17 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 18 |
+
// Public Methods //
|
| 19 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 20 |
+
public function blocked_ips() {
|
| 21 |
+
global $wpdb;
|
| 22 |
+
$ips = $wpdb->get_col('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked');
|
| 23 |
+
return $ips;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
public function get_form_titles() {
|
| 27 |
+
global $wpdb;
|
| 28 |
+
$query = "SELECT id, title FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN(" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ") order by title";
|
| 29 |
+
$forms = $wpdb->get_results($query);
|
| 30 |
+
return $forms;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
public function get_statistics($form_id) {
|
| 34 |
+
global $wpdb;
|
| 35 |
+
$statistics = array();
|
| 36 |
+
$query = $wpdb->prepare('SELECT count(distinct group_id) FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id ="%d"', $form_id);
|
| 37 |
+
$statistics["total_entries"] = $wpdb->get_var($query);
|
| 38 |
+
$query = $wpdb->prepare('SELECT `views` FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $form_id);
|
| 39 |
+
$statistics["total_views"] = $wpdb->get_var($query);
|
| 40 |
+
if ($statistics["total_views"]) {
|
| 41 |
+
$statistics["conversion_rate"] = round((($statistics["total_entries"] / $statistics["total_views"]) * 100), 2) . '%';
|
| 42 |
+
}
|
| 43 |
+
else {
|
| 44 |
+
$statistics["conversion_rate"] = '0%';
|
| 45 |
+
}
|
| 46 |
+
return $statistics;
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
public function get_labels_parameters($form_id) {
|
| 50 |
+
global $wpdb;
|
| 51 |
+
$labels = array();
|
| 52 |
+
$labels_id = array();
|
| 53 |
+
$sorted_labels_id = array();
|
| 54 |
+
$label_names = array();
|
| 55 |
+
$label_types = array();
|
| 56 |
+
$sorted_label_types = array();
|
| 57 |
+
$label_names_original = array();
|
| 58 |
+
$labels_parameters = array();
|
| 59 |
+
$join_query = array();
|
| 60 |
+
$join_where = array();
|
| 61 |
+
$join_verified = array();
|
| 62 |
+
$rows_ord = array();
|
| 63 |
+
$join = '';
|
| 64 |
+
|
| 65 |
+
$query = $wpdb->prepare("SELECT `group_id`,`element_value` FROM " . $wpdb->prefix . "formmaker_submits WHERE `form_id`='%d' and `element_label` = 'verifyinfo' ", $form_id);
|
| 66 |
+
$ver_emails_data = $wpdb->get_results($query);
|
| 67 |
+
|
| 68 |
+
$ver_emails_array = array();
|
| 69 |
+
if($ver_emails_data) {
|
| 70 |
+
foreach($ver_emails_data as $ver_email) {
|
| 71 |
+
$elem_label = str_replace('verified**', '', $ver_email->element_value);
|
| 72 |
+
$query = $wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits WHERE `form_id`='%d' AND `group_id` = '%d' AND `element_label` = '%s' ", $form_id, (int)$ver_email->group_id, $elem_label);
|
| 73 |
+
if(!isset($ver_emails_array[$elem_label]))
|
| 74 |
+
$ver_emails_array[$elem_label] = array();
|
| 75 |
+
|
| 76 |
+
if(!in_array( $wpdb->get_var($query), $ver_emails_array[$elem_label]))
|
| 77 |
+
$ver_emails_array[$elem_label][] = $wpdb->get_var($query);
|
| 78 |
+
}
|
| 79 |
+
}
|
| 80 |
+
for ($i = 0; $i < 9; $i++) {
|
| 81 |
+
array_push($labels_parameters, NULL);
|
| 82 |
+
}
|
| 83 |
+
$sorted_label_names = array();
|
| 84 |
+
$sorted_label_names_original = array();
|
| 85 |
+
$where_labels = array();
|
| 86 |
+
$where2 = array();
|
| 87 |
+
$pagination_clicked = (isset($_POST['pagination_clicked']) && $_POST['pagination_clicked'] == '1' ? '1' : '0');
|
| 88 |
+
$order_by = ((isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) != '') ? esc_html(stripslashes($_POST['order_by'])) : 'group_id');
|
| 89 |
+
$asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'asc') ? 'asc' : 'desc');
|
| 90 |
+
$limit = ((isset($_POST['page_number'])) ? ((int) $_POST['page_number'] - 1) * 20 : 0);
|
| 91 |
+
$lists['hide_label_list'] = ((isset($_POST['hide_label_list'])) ? esc_html(stripslashes($_POST['hide_label_list'])) : '');
|
| 92 |
+
$lists['startdate'] = ((isset($_POST['startdate'])) ? esc_html(stripslashes($_POST['startdate'])) : '');
|
| 93 |
+
$lists['enddate'] = ((isset($_POST['enddate'])) ? esc_html(stripslashes($_POST['enddate'])) : '');
|
| 94 |
+
$lists['ip_search'] = ((isset($_POST['ip_search'])) ? esc_html(stripslashes($_POST['ip_search'])) : '');
|
| 95 |
+
|
| 96 |
+
$lists['username_search'] = ((isset($_POST['username_search'])) ? esc_html(stripslashes($_POST['username_search'])) : '');
|
| 97 |
+
$lists['useremail_search'] = ((isset($_POST['useremail_search'])) ? esc_html(stripslashes($_POST['useremail_search'])) : '');
|
| 98 |
+
$lists['id_search'] = ((isset($_POST['id_search'])) ? esc_html(stripslashes($_POST['id_search'])) : '');
|
| 99 |
+
|
| 100 |
+
if ($lists['ip_search']) {
|
| 101 |
+
$where[] = 'ip LIKE "%' . $lists['ip_search'] . '%"';
|
| 102 |
+
}
|
| 103 |
+
if ($lists['startdate'] != '') {
|
| 104 |
+
$where[] = " `date`>='" . $lists['startdate'] . " 00:00:00' ";
|
| 105 |
+
}
|
| 106 |
+
if ($lists['enddate'] != '') {
|
| 107 |
+
$where[] = " `date`<='" . $lists['enddate'] . " 23:59:59' ";
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
if ($lists['username_search']) {
|
| 112 |
+
$where[] = 'user_id_wd IN (SELECT ID FROM ' . $wpdb->prefix . 'users WHERE display_name LIKE "%'.$lists['username_search'].'%")';
|
| 113 |
+
}
|
| 114 |
+
if ($lists['useremail_search']) {
|
| 115 |
+
$where[] = 'user_id_wd IN (SELECT ID FROM ' . $wpdb->prefix . 'users WHERE user_email LIKE "%'.$lists['useremail_search'].'%")';
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
if ($lists['id_search']) {
|
| 119 |
+
$where[] = 'group_id ='.(int)$lists['id_search'];
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
$where[] = 'form_id=' . $form_id . '';
|
| 123 |
+
$where = (count($where) ? ' ' . implode(' AND ', $where) : '');
|
| 124 |
+
if ($order_by == 'group_id' or $order_by == 'date' or $order_by == 'ip') {
|
| 125 |
+
$orderby = ' ORDER BY ' . $order_by . ' ' . $asc_or_desc . '';
|
| 126 |
+
}elseif($order_by == 'display_name' or $order_by == 'user_email'){
|
| 127 |
+
$orderby = ' ORDER BY (SELECT '.$order_by.' FROM ' . $wpdb->prefix . 'users WHERE ID=user_id_wd) '. $asc_or_desc .'';
|
| 128 |
+
}
|
| 129 |
+
else {
|
| 130 |
+
$orderby = "";
|
| 131 |
+
}
|
| 132 |
+
if ($form_id) {
|
| 133 |
+
for($i = 0; $i < 9; $i++) {
|
| 134 |
+
array_pop($labels_parameters);
|
| 135 |
+
}
|
| 136 |
+
$query = "SELECT distinct element_label FROM " . $wpdb->prefix . "formmaker_submits WHERE ". $where;
|
| 137 |
+
$results = $wpdb->get_results($query);
|
| 138 |
+
for ($i = 0; $i < count($results); $i++) {
|
| 139 |
+
array_push($labels, $results[$i]->element_label);
|
| 140 |
+
}
|
| 141 |
+
$form = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='%d'", $form_id));
|
| 142 |
+
if (strpos($form->label_order, 'type_paypal_')) {
|
| 143 |
+
$form->label_order = $form->label_order . "item_total#**id**#Item Total#**label**#type_paypal_payment_total#****#total#**id**#Total#**label**#type_paypal_payment_total#****#0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
$form_labels = explode('#****#', $form->label_order);
|
| 147 |
+
$form_labels = array_slice($form_labels, 0, count($form_labels) - 1);
|
| 148 |
+
|
| 149 |
+
foreach ($form_labels as $key => $form_label) {
|
| 150 |
+
$label_id = explode('#**id**#', $form_label);
|
| 151 |
+
array_push($labels_id, $label_id[0]);
|
| 152 |
+
$label_name_type = explode('#**label**#', $label_id[1]);
|
| 153 |
+
array_push($label_names_original, $label_name_type[0]);
|
| 154 |
+
$ptn = "/[^a-zA-Z0-9_]/";
|
| 155 |
+
$rpltxt = "";
|
| 156 |
+
$label_name = preg_replace($ptn, $rpltxt, $label_name_type[0]);
|
| 157 |
+
array_push($label_names, $label_name);
|
| 158 |
+
array_push($label_types, $label_name_type[1]);
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
foreach ($labels_id as $key => $label_id) {
|
| 162 |
+
if (in_array($label_id, $labels)) {
|
| 163 |
+
if (!in_array($label_id, $sorted_labels_id)) {
|
| 164 |
+
array_push($sorted_labels_id, $label_id);
|
| 165 |
+
}
|
| 166 |
+
array_push($sorted_label_names, $label_names[$key]);
|
| 167 |
+
array_push($sorted_label_types, $label_types[$key]);
|
| 168 |
+
array_push($sorted_label_names_original, $label_names_original[$key]);
|
| 169 |
+
if (isset($_POST[$form_id . '_' . $label_id . '_search'])) {
|
| 170 |
+
$search_temp = esc_html($_POST[$form_id . '_' . $label_id . '_search']);
|
| 171 |
+
}
|
| 172 |
+
else {
|
| 173 |
+
$search_temp = '';
|
| 174 |
+
}
|
| 175 |
+
$search_temp = strtolower($search_temp);
|
| 176 |
+
|
| 177 |
+
$lists[$form_id . '_' . $label_id . '_search'] = $search_temp;
|
| 178 |
+
if ($search_temp) {
|
| 179 |
+
$join_query[] = 'search';
|
| 180 |
+
$join_where[] = array('label' => $label_id, 'search' => $search_temp);
|
| 181 |
+
}
|
| 182 |
+
|
| 183 |
+
if (isset($_POST[$form_id . '_' . $label_id . '_search_verified'])) {
|
| 184 |
+
$search_verified = $_POST[$form_id . '_' . $label_id . '_search_verified'];
|
| 185 |
+
$lists[$form_id . '_' . $label_id . '_search_verified'] = $search_verified;
|
| 186 |
+
} else {
|
| 187 |
+
$search_verified = '';
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
if ($search_verified && isset($ver_emails_array[$label_id])) {
|
| 191 |
+
$join_query[] = 'search';
|
| 192 |
+
$join_where[] = null;
|
| 193 |
+
$join_verified[] = array('label' => $label_id, 'ver_search' => implode('|', $ver_emails_array[$label_id]));
|
| 194 |
+
}
|
| 195 |
+
}
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
if (strpos($order_by, "_field")) {
|
| 199 |
+
if (in_array(str_replace("_field", "", $order_by), $labels)) {
|
| 200 |
+
$join_query[] = 'sort';
|
| 201 |
+
$join_where[] = array('label'=>str_replace("_field", "", $order_by));
|
| 202 |
+
}
|
| 203 |
+
}
|
| 204 |
+
$cols = 'group_id';
|
| 205 |
+
if ($order_by == 'date' or $order_by == 'ip') {
|
| 206 |
+
$cols = 'group_id, date, ip';
|
| 207 |
+
}
|
| 208 |
+
|
| 209 |
+
$ver_where = '';
|
| 210 |
+
if( !empty($join_verified) ) {
|
| 211 |
+
foreach( $join_verified as $key_ver => $join_ver) {
|
| 212 |
+
$ver_where .= '(element_label="' . $join_ver['label'] . '" AND element_value REGEXP "'.$join_ver['ver_search'].'" ) AND' ;
|
| 213 |
+
}
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
switch (count($join_query)) {
|
| 217 |
+
case 0:
|
| 218 |
+
$join = 'SELECT distinct group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE '. $where;
|
| 219 |
+
|
| 220 |
+
break;
|
| 221 |
+
case 1:
|
| 222 |
+
if ($join_query[0] == 'sort') {
|
| 223 |
+
$join = 'SELECT group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE ' . $where . ' AND element_label="' . $join_where[0]['label'] . '" ';
|
| 224 |
+
$join_count = 'SELECT count(group_id) FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="' . $form_id . '" AND element_label="' . $join_where[0]['label'] . '" ';
|
| 225 |
+
|
| 226 |
+
$orderby = ' ORDER BY `element_value` ' . $asc_or_desc;
|
| 227 |
+
}
|
| 228 |
+
else {
|
| 229 |
+
if(isset($join_where[0]['search'])) {
|
| 230 |
+
$join = 'SELECT group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE element_label="' . $join_where[0]['label'] . '" AND (element_value LIKE "%' . $join_where[0]['search'] . '%" OR element_value LIKE "%' . str_replace(' ', '@@@', $join_where[0]['search']) . '%") AND ' . $where;
|
| 231 |
+
} else {
|
| 232 |
+
$join = 'SELECT group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE '.$ver_where . $where;
|
| 233 |
+
}
|
| 234 |
+
}
|
| 235 |
+
break;
|
| 236 |
+
default:
|
| 237 |
+
if( !empty($join_verified) ) {
|
| 238 |
+
if( isset( $join_where[0]['search'] ) ) {
|
| 239 |
+
$join = 'SELECT t.group_id from (SELECT t1.group_id from (SELECT ' . $cols . ' FROM ' . $wpdb->prefix . 'formmaker_submits WHERE (element_label="' . $join_where[0]['label'] . '" AND (element_value LIKE "%' . $join_where[0]['search'] . '%" OR element_value LIKE "%' . str_replace(' ', '@@@', $join_where[0]['search']) . '%")) AND '. $where.' ) as t1 JOIN (SELECT group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE '.$ver_where.$where.') as t2 ON t1.group_id = t2.group_id) as t ';
|
| 240 |
+
|
| 241 |
+
} else{
|
| 242 |
+
$join = 'SELECT t.group_id FROM (SELECT ' . $cols . ' FROM ' . $wpdb->prefix . 'formmaker_submits WHERE ' . $ver_where.$where . ') as t ';
|
| 243 |
+
}
|
| 244 |
+
} else{
|
| 245 |
+
$join = 'SELECT t.group_id FROM (SELECT ' . $cols . ' FROM ' . $wpdb->prefix . 'formmaker_submits WHERE ' . $where . ' AND element_label="' . $join_where[0]['label'] . '" AND (element_value LIKE "%' . $join_where[0]['search'] . '%" OR element_value LIKE "%' . str_replace(' ', '@@@', $join_where[0]['search']) . '%" )) as t ';
|
| 246 |
+
}
|
| 247 |
+
|
| 248 |
+
for ($key = 1; $key < count($join_query); $key++) {
|
| 249 |
+
if ($join_query[$key] == 'sort') {
|
| 250 |
+
if(isset($join_where[$key])){
|
| 251 |
+
$join .= 'LEFT JOIN (SELECT group_id as group_id' . $key . ', element_value FROM ' . $wpdb->prefix . 'formmaker_submits WHERE ' . $where . ' AND element_label="' . $join_where[$key]['label'] . '") as t' . $key . ' ON t' . $key . '.group_id' . $key . '=t.group_id ';
|
| 252 |
+
$orderby = ' ORDER BY t' . $key . '.`element_value` ' . $asc_or_desc . '';
|
| 253 |
+
}
|
| 254 |
+
}
|
| 255 |
+
else {
|
| 256 |
+
if(isset( $join_where[$key])) {
|
| 257 |
+
$join .= 'INNER JOIN (SELECT group_id as group_id' . $key . ' FROM ' . $wpdb->prefix . 'formmaker_submits WHERE '.$where.' AND element_label="' . $join_where[$key]['label'] . '" AND (element_value LIKE "%' . $join_where[$key]['search'] . '%" OR element_value LIKE "%' . str_replace(' ', '@@@', $join_where[$key]['search']) . '%")) as t' . $key . ' ON t' . $key . '.group_id' . $key . '=t.group_id ';
|
| 258 |
+
}
|
| 259 |
+
}
|
| 260 |
+
}
|
| 261 |
+
break;
|
| 262 |
+
}
|
| 263 |
+
$pos = strpos($join, 'SELECT t.group_id');
|
| 264 |
+
if ($pos === FALSE) {
|
| 265 |
+
$query = str_replace(array('SELECT group_id','SELECT distinct group_id'), array('SELECT count(distinct group_id)','SELECT count(distinct group_id)'), $join);
|
| 266 |
+
}
|
| 267 |
+
else {
|
| 268 |
+
$query = str_replace('SELECT t.group_id', 'SELECT count(t.group_id)', $join);
|
| 269 |
+
}
|
| 270 |
+
$total = $wpdb->get_var($query);
|
| 271 |
+
|
| 272 |
+
$query_sub_count = "SELECT count(distinct group_id) from ".$wpdb->prefix."formmaker_submits";
|
| 273 |
+
$sub_count = (int)$wpdb->get_var($query_sub_count);
|
| 274 |
+
|
| 275 |
+
$limit1 = (int)$total < $sub_count && !$pagination_clicked ? 0 : $limit;
|
| 276 |
+
$query = $join . ' ' . $orderby . ' limit ' . $limit1 . ', 20 ';
|
| 277 |
+
$results = $wpdb->get_results($query);
|
| 278 |
+
for ($i = 0; $i < count($results); $i++) {
|
| 279 |
+
array_push($rows_ord, $results[$i]->group_id);
|
| 280 |
+
}
|
| 281 |
+
|
| 282 |
+
$query1 = $join . ' ' . $orderby ;
|
| 283 |
+
$searched_group_ids = $wpdb->get_results($query1);
|
| 284 |
+
$searched_ids = array();
|
| 285 |
+
for ($i = 0; $i < count($searched_group_ids); $i++) {
|
| 286 |
+
array_push($searched_ids, $searched_group_ids[$i]->group_id);
|
| 287 |
+
}
|
| 288 |
+
|
| 289 |
+
|
| 290 |
+
$where2 = array();
|
| 291 |
+
$where2[] = "group_id='0'";
|
| 292 |
+
foreach ($rows_ord as $rows_ordd) {
|
| 293 |
+
$where2[] = "group_id='" . $rows_ordd . "'";
|
| 294 |
+
}
|
| 295 |
+
$where2 = (count($where2) ? ' WHERE ' . implode( ' OR ', $where2 ) . '' : '' );
|
| 296 |
+
$query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits ' . $where2;
|
| 297 |
+
$rows = $wpdb->get_results($query);
|
| 298 |
+
$group_ids = $rows_ord;
|
| 299 |
+
$lists['total'] = $total;
|
| 300 |
+
$lists['limit'] = (int) ($limit1 / 20 + 1);
|
| 301 |
+
|
| 302 |
+
$where_choices = $where;
|
| 303 |
+
array_push($labels_parameters, $sorted_labels_id);
|
| 304 |
+
array_push($labels_parameters, $sorted_label_types);
|
| 305 |
+
array_push($labels_parameters, $lists);
|
| 306 |
+
array_push($labels_parameters, $sorted_label_names);
|
| 307 |
+
array_push($labels_parameters, $sorted_label_names_original);
|
| 308 |
+
array_push($labels_parameters, $rows);
|
| 309 |
+
array_push($labels_parameters, $group_ids);
|
| 310 |
+
array_push($labels_parameters, $where_choices);
|
| 311 |
+
array_push($labels_parameters, $searched_ids);
|
| 312 |
+
}
|
| 313 |
+
return $labels_parameters;
|
| 314 |
+
}
|
| 315 |
+
|
| 316 |
+
public function get_type_address($sorted_label_type, $sorted_label_name_original) {
|
| 317 |
+
if ($sorted_label_type == 'type_address') {
|
| 318 |
+
switch ($sorted_label_name_original) {
|
| 319 |
+
case 'Street Line':
|
| 320 |
+
$field_title = __('Street Address', 'form_maker');
|
| 321 |
+
break;
|
| 322 |
+
case 'Street Line2':
|
| 323 |
+
$field_title = __('Street Address Line 2', 'form_maker');
|
| 324 |
+
break;
|
| 325 |
+
case 'City':
|
| 326 |
+
$field_title = __('City', 'form_maker');
|
| 327 |
+
break;
|
| 328 |
+
case 'State':
|
| 329 |
+
$field_title = __('State / Province / Region', 'form_maker');
|
| 330 |
+
break;
|
| 331 |
+
case 'Postal':
|
| 332 |
+
$field_title = __('Postal / Zip Code', 'form_maker');
|
| 333 |
+
break;
|
| 334 |
+
case 'Country':
|
| 335 |
+
$field_title = __('Country', 'form_maker');
|
| 336 |
+
break;
|
| 337 |
+
default :
|
| 338 |
+
$field_title = stripslashes($sorted_label_name_original);
|
| 339 |
+
break;
|
| 340 |
+
}
|
| 341 |
+
}
|
| 342 |
+
else {
|
| 343 |
+
$field_title = stripslashes($sorted_label_name_original);
|
| 344 |
+
}
|
| 345 |
+
return $field_title;
|
| 346 |
+
}
|
| 347 |
+
|
| 348 |
+
public function hide_or_not($hide_strings,$hide_string) {
|
| 349 |
+
if (strpos($hide_string,'@') === FALSE) {
|
| 350 |
+
if (strpos($hide_strings, '@' . $hide_string . '@') === FALSE) {
|
| 351 |
+
$style = '';
|
| 352 |
+
}
|
| 353 |
+
else {
|
| 354 |
+
$style = 'style="display:none"';
|
| 355 |
+
}
|
| 356 |
+
}
|
| 357 |
+
else {
|
| 358 |
+
if (strpos($hide_strings, $hide_string) === FALSE) {
|
| 359 |
+
$style = '';
|
| 360 |
+
}
|
| 361 |
+
else {
|
| 362 |
+
$style = 'style="display:none"';
|
| 363 |
+
}
|
| 364 |
+
}
|
| 365 |
+
return $style;
|
| 366 |
+
}
|
| 367 |
+
|
| 368 |
+
public function sort_group_ids($sorted_label_names_count, $group_ids) {
|
| 369 |
+
$count_labe = $sorted_label_names_count;
|
| 370 |
+
$group_id_s = array();
|
| 371 |
+
$l = 0;
|
| 372 |
+
if (count($group_ids) > 0 and $count_labe) {
|
| 373 |
+
for ($i = 0; $i < count($group_ids); $i++) {
|
| 374 |
+
if (!in_array($group_ids[$i], $group_id_s)) {
|
| 375 |
+
array_push($group_id_s, $group_ids[$i]);
|
| 376 |
+
}
|
| 377 |
+
}
|
| 378 |
+
}
|
| 379 |
+
return $group_id_s;
|
| 380 |
+
}
|
| 381 |
+
|
| 382 |
+
public function array_for_group_id($group, $rows) {
|
| 383 |
+
$i = $group;
|
| 384 |
+
$count_rows = count($rows);
|
| 385 |
+
$temp = array();
|
| 386 |
+
for ($j = 0; $j < $count_rows; $j++) {
|
| 387 |
+
$row = $rows[$j];
|
| 388 |
+
if ($row->group_id == $i) {
|
| 389 |
+
array_push($temp, $row);
|
| 390 |
+
}
|
| 391 |
+
}
|
| 392 |
+
return $temp;
|
| 393 |
+
}
|
| 394 |
+
|
| 395 |
+
public function check_radio_type($sorted_label_type) {
|
| 396 |
+
if ($sorted_label_type == "type_checkbox" || $sorted_label_type == "type_radio" || $sorted_label_type == "type_own_select" || $sorted_label_type == "type_country" || $sorted_label_type == "type_paypal_select" || $sorted_label_type == "type_paypal_radio" || $sorted_label_type == "type_paypal_checkbox" || $sorted_label_type == "type_paypal_shipping") {
|
| 397 |
+
return TRUE;
|
| 398 |
+
}
|
| 399 |
+
else {
|
| 400 |
+
return FALSE;
|
| 401 |
+
}
|
| 402 |
+
}
|
| 403 |
+
|
| 404 |
+
public function statistic_for_radio($where_choices, $sorted_label_id) {
|
| 405 |
+
global $wpdb;
|
| 406 |
+
$choices_params = array();
|
| 407 |
+
$query = "SELECT element_value FROM " . $wpdb->prefix . "formmaker_submits WHERE " . $where_choices . " AND element_label='" . $sorted_label_id . "'";
|
| 408 |
+
$choices = $wpdb->get_results($query);
|
| 409 |
+
$colors=array('#5FE2FF','#F9E89C');
|
| 410 |
+
$choices_colors=array('#4EC0D9','#DDCC7F');
|
| 411 |
+
$choices_labels = array();
|
| 412 |
+
$choices_count = array();
|
| 413 |
+
$all = count($choices);
|
| 414 |
+
$unanswered = 0;
|
| 415 |
+
foreach ($choices as $key => $choice) {
|
| 416 |
+
if ($choice->element_value == '') {
|
| 417 |
+
$unanswered++;
|
| 418 |
+
}
|
| 419 |
+
else {
|
| 420 |
+
if (!in_array($choice->element_value, $choices_labels)) {
|
| 421 |
+
array_push($choices_labels, $choice->element_value);
|
| 422 |
+
array_push($choices_count, 0);
|
| 423 |
+
}
|
| 424 |
+
$choices_count[array_search($choice->element_value, $choices_labels)]++;
|
| 425 |
+
}
|
| 426 |
+
}
|
| 427 |
+
array_multisort($choices_count, SORT_DESC, $choices_labels);
|
| 428 |
+
array_push($choices_params, $choices_count);
|
| 429 |
+
array_push($choices_params, $choices_labels);
|
| 430 |
+
array_push($choices_params, $unanswered);
|
| 431 |
+
array_push($choices_params, $all);
|
| 432 |
+
array_push($choices_params, $colors);
|
| 433 |
+
array_push($choices_params, $choices_colors);
|
| 434 |
+
return $choices_params;
|
| 435 |
+
}
|
| 436 |
+
|
| 437 |
+
public function get_data_of_group_id($id) {
|
| 438 |
+
global $wpdb;
|
| 439 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id=" . $id;
|
| 440 |
+
$rows = $wpdb->get_results($query);
|
| 441 |
+
$form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id=" . $rows[0]->form_id);
|
| 442 |
+
$params = array();
|
| 443 |
+
$label_id = array();
|
| 444 |
+
$label_order_original = array();
|
| 445 |
+
$label_type = array();
|
| 446 |
+
$ispaypal = strpos($form->label_order, 'type_paypal_');
|
| 447 |
+
if ($form->paypal_mode == 1) {
|
| 448 |
+
if ($ispaypal) {
|
| 449 |
+
$form->label_order = $form->label_order."0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
|
| 450 |
+
}
|
| 451 |
+
}
|
| 452 |
+
$label_all = explode('#****#', $form->label_order);
|
| 453 |
+
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
| 454 |
+
foreach ($label_all as $key => $label_each) {
|
| 455 |
+
$label_id_each = explode('#**id**#', $label_each);
|
| 456 |
+
array_push($label_id, $label_id_each[0]);
|
| 457 |
+
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
| 458 |
+
array_push($label_order_original, $label_oder_each[0]);
|
| 459 |
+
array_push($label_type, $label_oder_each[1]);
|
| 460 |
+
}
|
| 461 |
+
/*$theme_id = $wpdb->get_var("SELECT theme FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form->id . "'");*/
|
| 462 |
+
$css = $wpdb->get_var("SELECT css FROM " . $wpdb->prefix . "formmaker_themes");
|
| 463 |
+
array_push($params, $rows);
|
| 464 |
+
array_push($params, $label_id);
|
| 465 |
+
array_push($params, $label_order_original);
|
| 466 |
+
array_push($params, $label_type);
|
| 467 |
+
array_push($params, $ispaypal);
|
| 468 |
+
array_push($params, $form);
|
| 469 |
+
array_push($params, $css);
|
| 470 |
+
return $params;
|
| 471 |
+
}
|
| 472 |
+
|
| 473 |
+
public function check_type_for_edit_function($label_type) {
|
| 474 |
+
if ($label_type != 'type_editor' and $label_type != 'type_submit_reset' and $label_type != 'type_map' and $label_type != 'type_mark_map' and $label_type != 'type_captcha' and $label_type != 'type_recaptcha' and $label_type != 'type_button') {
|
| 475 |
+
return TRUE;
|
| 476 |
+
}
|
| 477 |
+
else {
|
| 478 |
+
return FALSE;
|
| 479 |
+
}
|
| 480 |
+
}
|
| 481 |
+
|
| 482 |
+
public function check_for_submited_label($rows, $label_id) {
|
| 483 |
+
foreach ($rows as $row) {
|
| 484 |
+
if ($row->element_label == $label_id) {
|
| 485 |
+
$element_value = $row->element_value;
|
| 486 |
+
break;
|
| 487 |
+
}
|
| 488 |
+
else {
|
| 489 |
+
$element_value = 'continue';
|
| 490 |
+
}
|
| 491 |
+
}
|
| 492 |
+
return $element_value;
|
| 493 |
+
}
|
| 494 |
+
|
| 495 |
+
public function view_for_star_rating($element_value, $element_label) {
|
| 496 |
+
$view_star_rating_array = array();
|
| 497 |
+
$new_filename = str_replace("***star_rating***", '', $element_value);
|
| 498 |
+
$stars = "";
|
| 499 |
+
$new_filename=explode('***', $new_filename);
|
| 500 |
+
for ($j = 0; $j < $new_filename[1]; $j++) {
|
| 501 |
+
$stars .= '<img id="' . $element_label . '_star_' . $j . '" src="' . WD_FM_URL . '/images/star_' . $new_filename[2] . '.png?ver='. WD_FM_VERSION.'" /> ';
|
| 502 |
+
}
|
| 503 |
+
for ($k = $new_filename[1]; $k < $new_filename[0]; $k++) {
|
| 504 |
+
$stars .= '<img id="' . $element_label . '_star_' . $k . '" src="' . WD_FM_URL . '/images/star.png?ver='. WD_FM_VERSION.'" /> ';
|
| 505 |
+
}
|
| 506 |
+
array_push($view_star_rating_array, $stars);
|
| 507 |
+
return $view_star_rating_array;
|
| 508 |
+
}
|
| 509 |
+
|
| 510 |
+
public function view_for_grading($element_value) {
|
| 511 |
+
$view_grading_array = array();
|
| 512 |
+
$new_filename = str_replace("***grading***", '', $element_value);
|
| 513 |
+
$grading = explode(":", $new_filename);
|
| 514 |
+
$items_count = sizeof($grading) - 1;
|
| 515 |
+
$items = "";
|
| 516 |
+
$total = "";
|
| 517 |
+
for ($k = 0; $k < $items_count / 2; $k++) {
|
| 518 |
+
$items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . "</br>";
|
| 519 |
+
$total += $grading[$k];
|
| 520 |
+
}
|
| 521 |
+
$items .= "Total: " . $total;
|
| 522 |
+
array_push($view_grading_array, $items);
|
| 523 |
+
return $view_grading_array;
|
| 524 |
+
}
|
| 525 |
+
|
| 526 |
+
public function images_for_star_rating($element_value, $label_id) {
|
| 527 |
+
$edit_stars = "";
|
| 528 |
+
$star_rating_array = array();
|
| 529 |
+
$element_value1 = str_replace("***star_rating***", '', $element_value);
|
| 530 |
+
$stars_value = explode('/', $element_value1);
|
| 531 |
+
for ($j = 0; $j < $stars_value[0]; $j++) {
|
| 532 |
+
$edit_stars .= '<img id="' . $label_id . '_star_' . $j . '" onclick="edit_star_rating(' . $j . ',' . $label_id . ')" src="' . WD_FM_URL . '/images/star_yellow.png?ver=' . WD_FM_VERSION . '" /> ';
|
| 533 |
+
}
|
| 534 |
+
for ($k = $stars_value[0]; $k < $stars_value[1]; $k++) {
|
| 535 |
+
$edit_stars .= '<img id="' . $label_id . '_star_' . $k . '" onclick="edit_star_rating(' . $k . ',' . $label_id . ')" src="' . WD_FM_URL . '/images/star.png?ver=' . WD_FM_VERSION . '" /> ';
|
| 536 |
+
}
|
| 537 |
+
array_push($star_rating_array, $edit_stars);
|
| 538 |
+
array_push($star_rating_array, $stars_value);
|
| 539 |
+
return $star_rating_array;
|
| 540 |
+
}
|
| 541 |
+
|
| 542 |
+
public function params_for_scale_rating($element_value, $label_id) {
|
| 543 |
+
$scale_rating_array = array();
|
| 544 |
+
$scale_radio = explode('/', $element_value);
|
| 545 |
+
$scale_value = $scale_radio[0];
|
| 546 |
+
$scale = '<table><tr>';
|
| 547 |
+
for ($k = 1; $k <= $scale_radio[1]; $k++) {
|
| 548 |
+
$scale .= '<td style="text-align:center"><span>' . $k . '</span></td>';
|
| 549 |
+
}
|
| 550 |
+
$scale .= '<tr></tr>';
|
| 551 |
+
for ($l = 1; $l <= $scale_radio[1]; $l++) {
|
| 552 |
+
if ($l == $scale_radio[0]) {
|
| 553 |
+
$checked = "checked";
|
| 554 |
+
}
|
| 555 |
+
else {
|
| 556 |
+
$checked = "";
|
| 557 |
+
}
|
| 558 |
+
$scale .= '<td><input type="radio" name = "'.$label_id.'_scale_rating_radio" id = "'.$label_id.'_scale_rating_radio_'.$l.'" value="'.$l.'" '.$checked.' onClick="edit_scale_rating(this.value,'.$label_id.')" /></td>';
|
| 559 |
+
}
|
| 560 |
+
$scale .= '</tr></table>';
|
| 561 |
+
array_push($scale_rating_array, $scale);
|
| 562 |
+
array_push($scale_rating_array, $scale_radio);
|
| 563 |
+
array_push($scale_rating_array, $checked);
|
| 564 |
+
return $scale_rating_array;
|
| 565 |
+
}
|
| 566 |
+
|
| 567 |
+
public function params_for_type_range($element_value, $label_id) {
|
| 568 |
+
$range_value = explode('-', $element_value);
|
| 569 |
+
$range = '<input name="'.$label_id.'_element0" id="'.$label_id.'_element0" type="text" value="'.$range_value[0].'" onChange="edit_range(this.value,'.$label_id.',0)" size="8"/> - <input name="'.$label_id.'_element1" id="'.$label_id.'_element1" type="text" value="'.$range_value[1].'" onChange="edit_range(this.value,'.$label_id.',1)" size="8"/>';
|
| 570 |
+
return $range;
|
| 571 |
+
}
|
| 572 |
+
|
| 573 |
+
public function params_for_type_grading($element_value, $label_id) {
|
| 574 |
+
$type_grading_array = array();
|
| 575 |
+
$element_value1 = str_replace("***grading***", '', $element_value);
|
| 576 |
+
$garding_value = explode(':', $element_value1);
|
| 577 |
+
$items_count = sizeof($garding_value) - 1;
|
| 578 |
+
$garding = "";
|
| 579 |
+
$sum = "";
|
| 580 |
+
for ($k = 0; $k < $items_count/2; $k++) {
|
| 581 |
+
$garding .= '<input name="'.$label_id.'_element'.$k.'" id="'.$label_id.'_element'.$k.'" type="text" value="'.$garding_value[$k].'" onKeyUp="edit_grading('.$label_id.','.$items_count.')" size="5"/> '.$garding_value[$items_count/2+$k].'</br>';
|
| 582 |
+
$sum += $garding_value[$k];
|
| 583 |
+
}
|
| 584 |
+
array_push($type_grading_array, $garding);
|
| 585 |
+
array_push($type_grading_array, $garding_value);
|
| 586 |
+
array_push($type_grading_array, $sum);
|
| 587 |
+
array_push($type_grading_array, $items_count);
|
| 588 |
+
array_push($type_grading_array, $element_value1);
|
| 589 |
+
return $type_grading_array;
|
| 590 |
+
}
|
| 591 |
+
|
| 592 |
+
public function params_for_type_matrix($element_value, $label_id) {
|
| 593 |
+
$type_matrix_array = array();
|
| 594 |
+
$new_filename = str_replace("***matrix***", '', $element_value);
|
| 595 |
+
$matrix_value = explode('***', $new_filename);
|
| 596 |
+
$matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
|
| 597 |
+
$mat_rows = $matrix_value[0];
|
| 598 |
+
$mat_columns = $matrix_value[$mat_rows + 1];
|
| 599 |
+
$matrix = "<table>";
|
| 600 |
+
$matrix .= '<tr><td></td>';
|
| 601 |
+
for ($k = 1; $k <= $mat_columns; $k++) {
|
| 602 |
+
$matrix .= '<td style="background-color:#BBBBBB; padding:5px; border:1px; ">'.$matrix_value[$mat_rows+1+$k].'</td>';
|
| 603 |
+
}
|
| 604 |
+
$matrix .= '</tr>';
|
| 605 |
+
$aaa = Array();
|
| 606 |
+
$var_checkbox = 1;
|
| 607 |
+
$selected_value = "";
|
| 608 |
+
$selected_value_yes = "";
|
| 609 |
+
$selected_value_no = "";
|
| 610 |
+
for ($k = 1; $k <= $mat_rows; $k++) {
|
| 611 |
+
$matrix .= '<tr><td style="background-color:#BBBBBB; padding:5px; border:1px;">'.$matrix_value[$k].'</td>';
|
| 612 |
+
if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
|
| 613 |
+
if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
|
| 614 |
+
$checked = "";
|
| 615 |
+
$aaa[1] = "";
|
| 616 |
+
}
|
| 617 |
+
else {
|
| 618 |
+
$aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
|
| 619 |
+
}
|
| 620 |
+
for ($l = 1; $l <= $mat_columns; $l++) {
|
| 621 |
+
if ($aaa[1] == $l) {
|
| 622 |
+
$checked = 'checked';
|
| 623 |
+
}
|
| 624 |
+
else {
|
| 625 |
+
$checked = "";
|
| 626 |
+
}
|
| 627 |
+
$index = "'" . $k . '_' . $l . "'";
|
| 628 |
+
$matrix .= '<td style="text-align:center;"><input name="'.$label_id.'_input_elementform_id_temp'.$k.'" id="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" type="'.$matrix_value[$mat_rows+$mat_columns+2].'" '.$checked.' onClick="change_radio_values('.$index.','.$label_id.','.$mat_rows.','.$mat_columns.')"/></td>';
|
| 629 |
+
}
|
| 630 |
+
}
|
| 631 |
+
else {
|
| 632 |
+
if ($matrix_value[$mat_rows+$mat_columns+2] == "checkbox") {
|
| 633 |
+
for ($l = 1; $l <= $mat_columns; $l++) {
|
| 634 |
+
if ($matrix_value[$mat_rows + $mat_columns + 2 + $var_checkbox] == 1) {
|
| 635 |
+
$checked = 'checked';
|
| 636 |
+
}
|
| 637 |
+
else {
|
| 638 |
+
$checked = '';
|
| 639 |
+
}
|
| 640 |
+
$index = "'".$k.'_'.$l."'";
|
| 641 |
+
$matrix .='<td style="text-align:center;"><input name="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" id="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" type="'.$matrix_value[$mat_rows+$mat_columns+2].'" '.$checked.' onClick="change_checkbox_values('.$index.','.$label_id.','.$mat_rows.','.$mat_columns.')"/></td>';
|
| 642 |
+
$var_checkbox++;
|
| 643 |
+
}
|
| 644 |
+
}
|
| 645 |
+
else {
|
| 646 |
+
if ($matrix_value[$mat_rows + $mat_columns + 2] == "text") {
|
| 647 |
+
for ($l = 1; $l <= $mat_columns; $l++) {
|
| 648 |
+
$text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
|
| 649 |
+
$index = "'".$k.'_'.$l."'";
|
| 650 |
+
$matrix .= '<td style="text-align:center;"><input name="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" id="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" type="'.$matrix_value[$mat_rows+$mat_columns+2].'" value="'.$text_value.'" onKeyUp="change_text_values('.$index.','.$label_id.','.$mat_rows.','.$mat_columns.')"/></td>';
|
| 651 |
+
$var_checkbox++;
|
| 652 |
+
}
|
| 653 |
+
}
|
| 654 |
+
else {
|
| 655 |
+
for ($l = 1; $l <= $mat_columns; $l++) {
|
| 656 |
+
$selected_text = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox];
|
| 657 |
+
if ($selected_text == 'yes') {
|
| 658 |
+
$selected_value_yes = 'selected';
|
| 659 |
+
$selected_value_no = '';
|
| 660 |
+
$selected_value = '';
|
| 661 |
+
}
|
| 662 |
+
else {
|
| 663 |
+
if ($selected_text=='no') {
|
| 664 |
+
$selected_value_yes ='';
|
| 665 |
+
$selected_value_no ='selected';
|
| 666 |
+
$selected_value ='';
|
| 667 |
+
}
|
| 668 |
+
else {
|
| 669 |
+
$selected_value_yes = '';
|
| 670 |
+
$selected_value_no ='';
|
| 671 |
+
$selected_value ='selected';
|
| 672 |
+
}
|
| 673 |
+
}
|
| 674 |
+
$index = "'".$k.'_'.$l."'";
|
| 675 |
+
$matrix .= '<td style="text-align:center;"><select name="'.$label_id.'_select_yes_noform_id_temp'.$k.'_'.$l.'" id="'.$label_id.'_select_yes_noform_id_temp'.$k.'_'.$l.'" onChange="change_option_values('.$index.','.$label_id.','.$mat_rows.','.$mat_columns.')"><option value="" '.$selected_value.'></option><option value="yes" '.$selected_value_yes.' >Yes</option><option value="no" '.$selected_value_no.'>No</option></select></td>';
|
| 676 |
+
$var_checkbox++;
|
| 677 |
+
}
|
| 678 |
+
}
|
| 679 |
+
}
|
| 680 |
+
}
|
| 681 |
+
$matrix .= '</tr>';
|
| 682 |
+
}
|
| 683 |
+
$matrix .= '</table>';
|
| 684 |
+
array_push($type_matrix_array, $matrix);
|
| 685 |
+
array_push($type_matrix_array, $new_filename);
|
| 686 |
+
return $type_matrix_array;
|
| 687 |
+
}
|
| 688 |
+
|
| 689 |
+
public function select_data_from_db_for_labels($db_info,$label_column, $table, $where, $order_by) {
|
| 690 |
+
global $wpdb;
|
| 691 |
+
|
| 692 |
+
$query = "SELECT `" . $label_column . "` FROM " . $table . $where . " ORDER BY " . $order_by;
|
| 693 |
+
if($db_info) {
|
| 694 |
+
$temp = explode('@@@wdfhostwdf@@@',$db_info);
|
| 695 |
+
$host = $temp[0];
|
| 696 |
+
$temp = explode('@@@wdfportwdf@@@',$temp[1]);
|
| 697 |
+
$port = $temp[0];
|
| 698 |
+
$temp = explode('@@@wdfusernamewdf@@@',$temp[1]);
|
| 699 |
+
$username = $temp[0];
|
| 700 |
+
$temp = explode('@@@wdfpasswordwdf@@@',$temp[1]);
|
| 701 |
+
$password = $temp[0];
|
| 702 |
+
$temp = explode('@@@wdfdatabasewdf@@@',$temp[1]);
|
| 703 |
+
$database = $temp[0];
|
| 704 |
+
|
| 705 |
+
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
| 706 |
+
$choices_labels = $wpdb_temp->get_col($query);
|
| 707 |
+
}
|
| 708 |
+
else {
|
| 709 |
+
$choices_labels = $wpdb->get_col($query);
|
| 710 |
+
}
|
| 711 |
+
return $choices_labels;
|
| 712 |
+
}
|
| 713 |
+
public function select_data_from_db_for_values($db_info,$value_column, $table, $where, $order_by) {
|
| 714 |
+
global $wpdb;
|
| 715 |
+
$query = "SELECT `" . $value_column . "` FROM " . $table . $where . " ORDER BY " . $order_by;
|
| 716 |
+
if($db_info) {
|
| 717 |
+
$temp = explode('@@@wdfhostwdf@@@',$db_info);
|
| 718 |
+
$host = $temp[0];
|
| 719 |
+
$temp = explode('@@@wdfportwdf@@@',$temp[1]);
|
| 720 |
+
$port = $temp[0];
|
| 721 |
+
$temp = explode('@@@wdfusernamewdf@@@',$temp[1]);
|
| 722 |
+
$username = $temp[0];
|
| 723 |
+
$temp = explode('@@@wdfpasswordwdf@@@',$temp[1]);
|
| 724 |
+
$password = $temp[0];
|
| 725 |
+
$temp = explode('@@@wdfdatabasewdf@@@',$temp[1]);
|
| 726 |
+
$database = $temp[0];
|
| 727 |
+
|
| 728 |
+
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
| 729 |
+
$choices_values = $wpdb_temp->get_col($query);
|
| 730 |
+
}
|
| 731 |
+
else {
|
| 732 |
+
$choices_values = $wpdb->get_col($query);
|
| 733 |
+
}
|
| 734 |
+
return $choices_values;
|
| 735 |
+
}
|
| 736 |
+
public function get_subs_count($form_id) {
|
| 737 |
+
global $wpdb;
|
| 738 |
+
$query = $wpdb->prepare("SELECT distinct group_id FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d", $form_id);
|
| 739 |
+
$group_id_s = $wpdb->get_col($query);
|
| 740 |
+
return count($group_id_s);
|
| 741 |
+
}
|
| 742 |
+
}
|
| 743 |
+
|
| 744 |
+
?>
|
admin/models/FMModelThemes_fm.php
CHANGED
|
@@ -1,100 +1,100 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMModelThemes_fm {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
public function get_rows_data() {
|
| 22 |
-
global $wpdb;
|
| 23 |
-
$where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
|
| 24 |
-
$asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
|
| 25 |
-
$order_by_array = array('id', 'title', 'default');
|
| 26 |
-
$order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
|
| 27 |
-
$order_by = ' ORDER BY `' . $order_by . '` ' . $asc_or_desc;
|
| 28 |
-
if (isset($_POST['page_number']) && $_POST['page_number']) {
|
| 29 |
-
$limit = ((int) $_POST['page_number'] - 1) * 20;
|
| 30 |
-
}
|
| 31 |
-
else {
|
| 32 |
-
$limit = 0;
|
| 33 |
-
}
|
| 34 |
-
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker_themes " . $where . $order_by . " LIMIT " . $limit . ",20";
|
| 35 |
-
$rows = $wpdb->get_results($query);
|
| 36 |
-
return $rows;
|
| 37 |
-
}
|
| 38 |
-
|
| 39 |
-
public function get_row_data($id, $reset) {
|
| 40 |
-
global $wpdb;
|
| 41 |
-
if ($id != 0) {
|
| 42 |
-
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
|
| 43 |
-
if ($reset) {
|
| 44 |
-
if (!$row->default) {
|
| 45 |
-
$row_id = $row->id;
|
| 46 |
-
$row_title = $row->title;
|
| 47 |
-
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes WHERE default="%d"', 1));
|
| 48 |
-
$row->id = $row_id;
|
| 49 |
-
$row->title = $row_title;
|
| 50 |
-
$row->default = FALSE;
|
| 51 |
-
$row->version = 2;
|
| 52 |
-
}
|
| 53 |
-
else {
|
| 54 |
-
$row->css = '';
|
| 55 |
-
}
|
| 56 |
-
}
|
| 57 |
-
}
|
| 58 |
-
else {
|
| 59 |
-
$row = new stdClass();
|
| 60 |
-
$row->id = 0;
|
| 61 |
-
$row->title = '';
|
| 62 |
-
$row->css = '{"GPFontFamily":"tahoma","AGPWidth":"100","AGPSPWidth":"30","AGPPadding":"","AGPMargin":"0 auto","AGPBorderColor":"#ffffff","AGPBorderType":"solid","AGPBorderWidth":"1","AGPBorderRadius":"0","AGPBoxShadow":"","HPAlign":"top","HPBGColor":"#96afab","HPWidth":"100","HTPWidth":"40","HPPadding":"10px 0","HPMargin":"","HPTextAlign":"center","HPBorderColor":"#b7b7b7","HPBorderType":"solid","HPBorderWidth":"1","HPBorderRadius":"0","HTPFontSize":"24","HTPWeight":"normal","HTPColor":"#ffffff","HDPFontSize":"15","HDPColor":"#607370","HIPAlign":"top","HIPWidth":"80","HIPHeight":"","GPBGColor":"#ededed","GPFontSize":"16","GPFontWeight":"normal","GPWidth":"100","GTPWidth":"60","GPAlign":"center","GPBackground":"","GPBackgroundRepeat":"no-repeat","GPBGPosition1":"","GPBGPosition2":"","GPBGSize1":"","GPBGSize2":"","GPColor":"#607370","GPPadding":"10px","GPMargin":"","GPBorderColor":"#ffffff","GPBorderType":"solid","GPBorderWidth":"1","GPBorderRadius":"0","GPMLFontSize":"14","GPMLFontWeight":"normal","GPMLColor":"#868686","GPMLPadding":"0px 5px 0px 0px","GPMLMargin":"0px","SEPBGColor":"#ededed","SEPPadding":"","SEPMargin":"","COPPadding":"15px 20px","COPMargin":"0px","FPWidth":"70","FPPadding":"15px 0 0 0","FPMargin":"0 auto","IPHeight":"26","IPFontSize":"14","IPFontWeight":"normal","IPBGColor":"#ffffff","IPColor":"#868686","IPPadding":"0px 5px","IPMargin":"0px","IPBorderTop":"top","IPBorderRight":"right","IPBorderBottom":"bottom","IPBorderLeft":"left","IPBorderColor":"#dfdfdf","IPBorderType":"solid","IPBorderWidth":"1","IPBorderRadius":"0","IPBoxShadow":"","SBPAppearance":"none","SBPBackground":"images/themes/drop-downs/2.png","SBPBGRepeat":"no-repeat","SBPBGPos1":"95%","SBPBGPos2":"50%","SBPBGSize1":"8%","SBPBGSize2":"32%","SCPBGColor":"#ffffff","SCPWidth":"16","SCPHeight":"16","SCPBorderTop":"top","SCPBorderRight":"right","SCPBorderBottom":"bottom","SCPBorderLeft":"left","SCPBorderColor":"#868686","SCPBorderType":"solid","SCPBorderWidth":"1","SCPMargin":"0px 3px","SCPBorderRadius":"15","SCPBoxShadow":"","SCCPBGColor":"#868686","SCCPWidth":"6","SCCPHeight":"6","SCCPMargin":"5","SCCPBorderRadius":"10","MCPBGColor":"#ffffff","MCPWidth":"16","MCPHeight":"16","MCPBorderTop":"top","MCPBorderRight":"right","MCPBorderBottom":"bottom","MCPBorderLeft":"left","MCPBorderColor":"#868686","MCPBorderType":"solid","MCPBorderWidth":"1","MCPMargin":"0px 3px","MCPBorderRadius":"0","MCPBoxShadow":"","MCCPBGColor":"","MCCPBackground":"images/themes/checkboxes/1.png","MCCPBGRepeat":"no-repeat","MCCPBGPos1":"","MCCPBGPos2":"","MCCPWidth":"16","MCCPHeight":"16","MCCPMargin":"0","MCCPBorderRadius":"0","SPAlign":"left","SPBGColor":"#e74c3c","SPWidth":"","SPHeight":"","SPFontSize":"16","SPFontWeight":"normal","SPColor":"#ffffff","SPPadding":"5px 8px","SPMargin":"0 15px 0 0","SPBorderTop":"top","SPBorderRight":"right","SPBorderBottom":"bottom","SPBorderLeft":"left","SPBorderColor":"#e74c3c","SPBorderType":"solid","SPBorderWidth":"1","SPBorderRadius":"0","SPBoxShadow":"","SHPBGColor":"#701e16","SHPColor":"#ffffff","SHPBorderTop":"top","SHPBorderRight":"right","SHPBorderBottom":"bottom","SHPBorderLeft":"left","SHPBorderColor":"#701e16","SHPBorderType":"solid","SHPBorderWidth":"1","BPBGColor":"#96afab","BPWidth":"","BPHeight":"","BPFontSize":"16","BPFontWeight":"normal","BPColor":"#ffffff","BPPadding":"5px 8px","BPMargin":"0 15px 0 0","BPBorderTop":"top","BPBorderRight":"right","BPBorderBottom":"bottom","BPBorderLeft":"left","BPBorderColor":"#8a8a8a","BPBorderType":"solid","BPBorderWidth":"1","BPBorderRadius":"0","BPBoxShadow":"","BHPBGColor":"#5a7784","BHPColor":"#ffffff","BHPBorderTop":"top","BHPBorderRight":"right","BHPBorderBottom":"bottom","BHPBorderLeft":"left","BHPBorderColor":"#5a7784","BHPBorderType":"solid","BHPBorderWidth":"1","PSAPBGColor":"#e74c3c","PSAPFontSize":"16","PSAPFontWeight":"normal","PSAPColor":"#ffffff","PSAPHeight":"","PSAPLineHeight":"","PSAPPadding":"6px","PSAPMargin":"0 1px 0 0 ","PSAPBorderTop":"top","PSAPBorderRight":"right","PSAPBorderBottom":"bottom","PSAPBorderLeft":"left","PSAPBorderColor":"#e74c3c","PSAPBorderType":"solid","PSAPBorderWidth":"2","PSAPBorderRadius":"0","PSDPBGColor":"#ededed","PSDPFontSize":"14","PSDPFontWeight":"normal","PSDPColor":"#737373","PSDPHeight":"","PSDPLineHeight":"","PSDPPadding":"3px 5px","PSDPMargin":"0 1px 0 0 ","PSDPBorderTop":"top","PSDPBorderRight":"right","PSDPBorderBottom":"bottom","PSDPBorderLeft":"left","PSDPBorderColor":"#ededed","PSDPBorderType":"solid","PSDPBorderWidth":"2","PSDPBorderRadius":"0","PSAPAlign":"right","PSAPWidth":"","PPAPWidth":"100%","NBPBGColor":"","NBPWidth":"","NBPHeight":"","NBPLineHeight":"","NBPColor":"#607370","NBPPadding":"4px 10px","NBPMargin":"0px","NBPBorderColor":"#777777","NBPBorderType":"solid","NBPBorderWidth":"1","NBPBorderRadius":"0","NBPBoxShadow":"","NBHPBGColor":"","NBHPColor":"#96afab","NBHPBorderColor":"#787878","NBHPBorderType":"solid","NBHPBorderWidth":"1","PBPBGColor":"","PBPWidth":"100","PBPHeight":"","PBPLineHeight":"","PBPColor":"#607370","PBPPadding":"","PBPMargin":"0px","PBPBorderColor":"#777777","PBPBorderType":"solid","PBPBorderWidth":"1","PBPBorderRadius":"0","PBPBoxShadow":"","PBHPBGColor":"","PBHPColor":"#96afab","PBHPBorderColor":"#787878","PBHPBorderType":"solid","PBHPBorderWidth":"1","CBPPosition":"absolute","CBPTop":"10px","CBPRight":"10px","CBPBottom":"","CBPLeft":"","CBPBGColor":"","CBPFontSize":"20","CBPFontWeight":"normal","CBPColor":"#777777","CBPPadding":"0px","CBPMargin":"0px","CBPBorderColor":"#ffffff","CBPBorderType":"solid","CBPBorderWidth":"1","CBPBorderRadius":"0","CBHPBGColor":"","CBHPColor":"#e74c3c","CBHPBorderColor":"#737373","CBHPBorderType":"solid","CBHPBorderWidth":"1","MBPBGColor":"#96afab","MBPFontSize":"17","MBPFontWeight":"normal","MBPColor":"#ffffff","MBPTextAlign":"center","MBPPadding":"10px","MBPMargin":"","MBPBorderTop":"top","MBPBorderRight":"right","MBPBorderBottom":"bottom","MBPBorderLeft":"left","MBPBorderColor":"#96afab","MBPBorderType":"solid","MBPBorderWidth":"2","MBPBorderRadius":"0","MBHPBGColor":"#96afab","MBHPColor":"#607370","MBHPBorderTop":"top","MBHPBorderRight":"right","MBHPBorderBottom":"bottom","MBHPBorderLeft":"left","MBHPBorderColor":"#96afab","MBHPBorderType":"solid","MBHPBorderWidth":"2","OPDeInputColor":"#afafaf","OPFontStyle":"normal","OPRColor":"#ff1313","OPDPIcon":"images/themes/date-pickers/2.png","OPDPRepeat":"no-repeat","OPDPPos1":"0%","OPDPPos2":"10%","OPDPMargin":"3px 0 0 -23px","OPFBgUrl":"images/themes/file-uploads/2.png","OPFBGRepeat":"no-repeat","OPFPos1":"0%","OPFPos2":"10%","OPGWidth":"100","CUPCSS":""}';
|
| 63 |
-
$row->default = 0;
|
| 64 |
-
$row->version = 2;
|
| 65 |
-
}
|
| 66 |
-
$params_decoded = json_decode(html_entity_decode($row->css), true);
|
| 67 |
-
if ($params_decoded != null) {
|
| 68 |
-
$row->css = $params_decoded;
|
| 69 |
-
}
|
| 70 |
-
else {
|
| 71 |
-
$row->css = array("CUPCSS" => $row->css);
|
| 72 |
-
}
|
| 73 |
-
return $row;
|
| 74 |
-
}
|
| 75 |
-
|
| 76 |
-
public function page_nav() {
|
| 77 |
-
global $wpdb;
|
| 78 |
-
$where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
|
| 79 |
-
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_themes " . $where;
|
| 80 |
-
$total = $wpdb->get_var($query);
|
| 81 |
-
$page_nav['total'] = $total;
|
| 82 |
-
if (isset($_POST['page_number']) && $_POST['page_number']) {
|
| 83 |
-
$limit = ((int) $_POST['page_number'] - 1) * 20;
|
| 84 |
-
}
|
| 85 |
-
else {
|
| 86 |
-
$limit = 0;
|
| 87 |
-
}
|
| 88 |
-
$page_nav['limit'] = (int) ($limit / 20 + 1);
|
| 89 |
-
return $page_nav;
|
| 90 |
-
}
|
| 91 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 92 |
-
// Getters & Setters //
|
| 93 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 94 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 95 |
-
// Private Methods //
|
| 96 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 97 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 98 |
-
// Listeners //
|
| 99 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 100 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMModelThemes_fm {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
public function get_rows_data() {
|
| 22 |
+
global $wpdb;
|
| 23 |
+
$where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
|
| 24 |
+
$asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
|
| 25 |
+
$order_by_array = array('id', 'title', 'default');
|
| 26 |
+
$order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
|
| 27 |
+
$order_by = ' ORDER BY `' . $order_by . '` ' . $asc_or_desc;
|
| 28 |
+
if (isset($_POST['page_number']) && $_POST['page_number']) {
|
| 29 |
+
$limit = ((int) $_POST['page_number'] - 1) * 20;
|
| 30 |
+
}
|
| 31 |
+
else {
|
| 32 |
+
$limit = 0;
|
| 33 |
+
}
|
| 34 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker_themes " . $where . $order_by . " LIMIT " . $limit . ",20";
|
| 35 |
+
$rows = $wpdb->get_results($query);
|
| 36 |
+
return $rows;
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
public function get_row_data($id, $reset) {
|
| 40 |
+
global $wpdb;
|
| 41 |
+
if ($id != 0) {
|
| 42 |
+
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
|
| 43 |
+
if ($reset) {
|
| 44 |
+
if (!$row->default) {
|
| 45 |
+
$row_id = $row->id;
|
| 46 |
+
$row_title = $row->title;
|
| 47 |
+
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes WHERE default="%d"', 1));
|
| 48 |
+
$row->id = $row_id;
|
| 49 |
+
$row->title = $row_title;
|
| 50 |
+
$row->default = FALSE;
|
| 51 |
+
$row->version = 2;
|
| 52 |
+
}
|
| 53 |
+
else {
|
| 54 |
+
$row->css = '';
|
| 55 |
+
}
|
| 56 |
+
}
|
| 57 |
+
}
|
| 58 |
+
else {
|
| 59 |
+
$row = new stdClass();
|
| 60 |
+
$row->id = 0;
|
| 61 |
+
$row->title = '';
|
| 62 |
+
$row->css = '{"GPFontFamily":"tahoma","AGPWidth":"100","AGPSPWidth":"30","AGPPadding":"","AGPMargin":"0 auto","AGPBorderColor":"#ffffff","AGPBorderType":"solid","AGPBorderWidth":"1","AGPBorderRadius":"0","AGPBoxShadow":"","HPAlign":"top","HPBGColor":"#96afab","HPWidth":"100","HTPWidth":"40","HPPadding":"10px 0","HPMargin":"","HPTextAlign":"center","HPBorderColor":"#b7b7b7","HPBorderType":"solid","HPBorderWidth":"1","HPBorderRadius":"0","HTPFontSize":"24","HTPWeight":"normal","HTPColor":"#ffffff","HDPFontSize":"15","HDPColor":"#607370","HIPAlign":"top","HIPWidth":"80","HIPHeight":"","GPBGColor":"#ededed","GPFontSize":"16","GPFontWeight":"normal","GPWidth":"100","GTPWidth":"60","GPAlign":"center","GPBackground":"","GPBackgroundRepeat":"no-repeat","GPBGPosition1":"","GPBGPosition2":"","GPBGSize1":"","GPBGSize2":"","GPColor":"#607370","GPPadding":"10px","GPMargin":"","GPBorderColor":"#ffffff","GPBorderType":"solid","GPBorderWidth":"1","GPBorderRadius":"0","GPMLFontSize":"14","GPMLFontWeight":"normal","GPMLColor":"#868686","GPMLPadding":"0px 5px 0px 0px","GPMLMargin":"0px","SEPBGColor":"#ededed","SEPPadding":"","SEPMargin":"","COPPadding":"15px 20px","COPMargin":"0px","FPWidth":"70","FPPadding":"15px 0 0 0","FPMargin":"0 auto","IPHeight":"26","IPFontSize":"14","IPFontWeight":"normal","IPBGColor":"#ffffff","IPColor":"#868686","IPPadding":"0px 5px","IPMargin":"0px","IPBorderTop":"top","IPBorderRight":"right","IPBorderBottom":"bottom","IPBorderLeft":"left","IPBorderColor":"#dfdfdf","IPBorderType":"solid","IPBorderWidth":"1","IPBorderRadius":"0","IPBoxShadow":"","SBPAppearance":"none","SBPBackground":"images/themes/drop-downs/2.png","SBPBGRepeat":"no-repeat","SBPBGPos1":"95%","SBPBGPos2":"50%","SBPBGSize1":"8%","SBPBGSize2":"32%","SCPBGColor":"#ffffff","SCPWidth":"16","SCPHeight":"16","SCPBorderTop":"top","SCPBorderRight":"right","SCPBorderBottom":"bottom","SCPBorderLeft":"left","SCPBorderColor":"#868686","SCPBorderType":"solid","SCPBorderWidth":"1","SCPMargin":"0px 3px","SCPBorderRadius":"15","SCPBoxShadow":"","SCCPBGColor":"#868686","SCCPWidth":"6","SCCPHeight":"6","SCCPMargin":"5","SCCPBorderRadius":"10","MCPBGColor":"#ffffff","MCPWidth":"16","MCPHeight":"16","MCPBorderTop":"top","MCPBorderRight":"right","MCPBorderBottom":"bottom","MCPBorderLeft":"left","MCPBorderColor":"#868686","MCPBorderType":"solid","MCPBorderWidth":"1","MCPMargin":"0px 3px","MCPBorderRadius":"0","MCPBoxShadow":"","MCCPBGColor":"","MCCPBackground":"images/themes/checkboxes/1.png","MCCPBGRepeat":"no-repeat","MCCPBGPos1":"","MCCPBGPos2":"","MCCPWidth":"16","MCCPHeight":"16","MCCPMargin":"0","MCCPBorderRadius":"0","SPAlign":"left","SPBGColor":"#e74c3c","SPWidth":"","SPHeight":"","SPFontSize":"16","SPFontWeight":"normal","SPColor":"#ffffff","SPPadding":"5px 8px","SPMargin":"0 15px 0 0","SPBorderTop":"top","SPBorderRight":"right","SPBorderBottom":"bottom","SPBorderLeft":"left","SPBorderColor":"#e74c3c","SPBorderType":"solid","SPBorderWidth":"1","SPBorderRadius":"0","SPBoxShadow":"","SHPBGColor":"#701e16","SHPColor":"#ffffff","SHPBorderTop":"top","SHPBorderRight":"right","SHPBorderBottom":"bottom","SHPBorderLeft":"left","SHPBorderColor":"#701e16","SHPBorderType":"solid","SHPBorderWidth":"1","BPBGColor":"#96afab","BPWidth":"","BPHeight":"","BPFontSize":"16","BPFontWeight":"normal","BPColor":"#ffffff","BPPadding":"5px 8px","BPMargin":"0 15px 0 0","BPBorderTop":"top","BPBorderRight":"right","BPBorderBottom":"bottom","BPBorderLeft":"left","BPBorderColor":"#8a8a8a","BPBorderType":"solid","BPBorderWidth":"1","BPBorderRadius":"0","BPBoxShadow":"","BHPBGColor":"#5a7784","BHPColor":"#ffffff","BHPBorderTop":"top","BHPBorderRight":"right","BHPBorderBottom":"bottom","BHPBorderLeft":"left","BHPBorderColor":"#5a7784","BHPBorderType":"solid","BHPBorderWidth":"1","PSAPBGColor":"#e74c3c","PSAPFontSize":"16","PSAPFontWeight":"normal","PSAPColor":"#ffffff","PSAPHeight":"","PSAPLineHeight":"","PSAPPadding":"6px","PSAPMargin":"0 1px 0 0 ","PSAPBorderTop":"top","PSAPBorderRight":"right","PSAPBorderBottom":"bottom","PSAPBorderLeft":"left","PSAPBorderColor":"#e74c3c","PSAPBorderType":"solid","PSAPBorderWidth":"2","PSAPBorderRadius":"0","PSDPBGColor":"#ededed","PSDPFontSize":"14","PSDPFontWeight":"normal","PSDPColor":"#737373","PSDPHeight":"","PSDPLineHeight":"","PSDPPadding":"3px 5px","PSDPMargin":"0 1px 0 0 ","PSDPBorderTop":"top","PSDPBorderRight":"right","PSDPBorderBottom":"bottom","PSDPBorderLeft":"left","PSDPBorderColor":"#ededed","PSDPBorderType":"solid","PSDPBorderWidth":"2","PSDPBorderRadius":"0","PSAPAlign":"right","PSAPWidth":"","PPAPWidth":"100%","NBPBGColor":"","NBPWidth":"","NBPHeight":"","NBPLineHeight":"","NBPColor":"#607370","NBPPadding":"4px 10px","NBPMargin":"0px","NBPBorderColor":"#777777","NBPBorderType":"solid","NBPBorderWidth":"1","NBPBorderRadius":"0","NBPBoxShadow":"","NBHPBGColor":"","NBHPColor":"#96afab","NBHPBorderColor":"#787878","NBHPBorderType":"solid","NBHPBorderWidth":"1","PBPBGColor":"","PBPWidth":"100","PBPHeight":"","PBPLineHeight":"","PBPColor":"#607370","PBPPadding":"","PBPMargin":"0px","PBPBorderColor":"#777777","PBPBorderType":"solid","PBPBorderWidth":"1","PBPBorderRadius":"0","PBPBoxShadow":"","PBHPBGColor":"","PBHPColor":"#96afab","PBHPBorderColor":"#787878","PBHPBorderType":"solid","PBHPBorderWidth":"1","CBPPosition":"absolute","CBPTop":"10px","CBPRight":"10px","CBPBottom":"","CBPLeft":"","CBPBGColor":"","CBPFontSize":"20","CBPFontWeight":"normal","CBPColor":"#777777","CBPPadding":"0px","CBPMargin":"0px","CBPBorderColor":"#ffffff","CBPBorderType":"solid","CBPBorderWidth":"1","CBPBorderRadius":"0","CBHPBGColor":"","CBHPColor":"#e74c3c","CBHPBorderColor":"#737373","CBHPBorderType":"solid","CBHPBorderWidth":"1","MBPBGColor":"#96afab","MBPFontSize":"17","MBPFontWeight":"normal","MBPColor":"#ffffff","MBPTextAlign":"center","MBPPadding":"10px","MBPMargin":"","MBPBorderTop":"top","MBPBorderRight":"right","MBPBorderBottom":"bottom","MBPBorderLeft":"left","MBPBorderColor":"#96afab","MBPBorderType":"solid","MBPBorderWidth":"2","MBPBorderRadius":"0","MBHPBGColor":"#96afab","MBHPColor":"#607370","MBHPBorderTop":"top","MBHPBorderRight":"right","MBHPBorderBottom":"bottom","MBHPBorderLeft":"left","MBHPBorderColor":"#96afab","MBHPBorderType":"solid","MBHPBorderWidth":"2","OPDeInputColor":"#afafaf","OPFontStyle":"normal","OPRColor":"#ff1313","OPDPIcon":"images/themes/date-pickers/2.png","OPDPRepeat":"no-repeat","OPDPPos1":"0%","OPDPPos2":"10%","OPDPMargin":"3px 0 0 -23px","OPFBgUrl":"images/themes/file-uploads/2.png","OPFBGRepeat":"no-repeat","OPFPos1":"0%","OPFPos2":"10%","OPGWidth":"100","CUPCSS":""}';
|
| 63 |
+
$row->default = 0;
|
| 64 |
+
$row->version = 2;
|
| 65 |
+
}
|
| 66 |
+
$params_decoded = json_decode(html_entity_decode($row->css), true);
|
| 67 |
+
if ($params_decoded != null) {
|
| 68 |
+
$row->css = $params_decoded;
|
| 69 |
+
}
|
| 70 |
+
else {
|
| 71 |
+
$row->css = array("CUPCSS" => $row->css);
|
| 72 |
+
}
|
| 73 |
+
return $row;
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
public function page_nav() {
|
| 77 |
+
global $wpdb;
|
| 78 |
+
$where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
|
| 79 |
+
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_themes " . $where;
|
| 80 |
+
$total = $wpdb->get_var($query);
|
| 81 |
+
$page_nav['total'] = $total;
|
| 82 |
+
if (isset($_POST['page_number']) && $_POST['page_number']) {
|
| 83 |
+
$limit = ((int) $_POST['page_number'] - 1) * 20;
|
| 84 |
+
}
|
| 85 |
+
else {
|
| 86 |
+
$limit = 0;
|
| 87 |
+
}
|
| 88 |
+
$page_nav['limit'] = (int) ($limit / 20 + 1);
|
| 89 |
+
return $page_nav;
|
| 90 |
+
}
|
| 91 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 92 |
+
// Getters & Setters //
|
| 93 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 94 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 95 |
+
// Private Methods //
|
| 96 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 97 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 98 |
+
// Listeners //
|
| 99 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 100 |
}
|
admin/models/FMModelUninstall_fm.php
CHANGED
|
@@ -1,51 +1,51 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMModelUninstall_fm {
|
| 4 |
-
|
| 5 |
-
public function delete_db_tables() {
|
| 6 |
-
global $wpdb;
|
| 7 |
-
$true_or_false_forms = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker WHERE `id` IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
|
| 8 |
-
if ($true_or_false_forms) {
|
| 9 |
-
$wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
|
| 10 |
-
$wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_submits WHERE `form_id` NOT IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
|
| 11 |
-
$wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_views WHERE `form_id` NOT IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
|
| 12 |
-
}
|
| 13 |
-
else {
|
| 14 |
-
$email_verification_post_id = $wpdb->get_var("SELECT mail_verification_post_id FROM " . $wpdb->prefix . "formmaker WHERE mail_verification_post_id != 0");
|
| 15 |
-
delete_option("wd_form_maker_version");
|
| 16 |
-
delete_option('formmaker_cureent_version');
|
| 17 |
-
delete_option('contact_form_themes');
|
| 18 |
-
delete_option('contact_form_forms');
|
| 19 |
-
delete_option('form_maker_pro_active');
|
| 20 |
-
delete_option('fm_emailverification');
|
| 21 |
-
delete_option('fm_admin_notice');
|
| 22 |
-
delete_option('fm_settings');
|
| 23 |
-
delete_option('fm_subscribe_done');
|
| 24 |
-
wp_delete_post($email_verification_post_id);
|
| 25 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker");
|
| 26 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_submits");
|
| 27 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_views");
|
| 28 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_themes");
|
| 29 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_sessions");
|
| 30 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_blocked");
|
| 31 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_query");
|
| 32 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_backup");
|
| 33 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_mailchimp");
|
| 34 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_reg");
|
| 35 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_post_gen_options");
|
| 36 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_email_conditions");
|
| 37 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_dbox_int");
|
| 38 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_pdf_options");
|
| 39 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_pdf");
|
| 40 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_pushover");
|
| 41 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_stripe");
|
| 42 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_save_options");
|
| 43 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_saved_entries");
|
| 44 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_saved_attributes");
|
| 45 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_calculator");
|
| 46 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_gdrive_int");
|
| 47 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_display_options");
|
| 48 |
-
}
|
| 49 |
-
}
|
| 50 |
-
|
| 51 |
-
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMModelUninstall_fm {
|
| 4 |
+
|
| 5 |
+
public function delete_db_tables() {
|
| 6 |
+
global $wpdb;
|
| 7 |
+
$true_or_false_forms = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker WHERE `id` IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
|
| 8 |
+
if ($true_or_false_forms) {
|
| 9 |
+
$wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
|
| 10 |
+
$wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_submits WHERE `form_id` NOT IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
|
| 11 |
+
$wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_views WHERE `form_id` NOT IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
|
| 12 |
+
}
|
| 13 |
+
else {
|
| 14 |
+
$email_verification_post_id = $wpdb->get_var("SELECT mail_verification_post_id FROM " . $wpdb->prefix . "formmaker WHERE mail_verification_post_id != 0");
|
| 15 |
+
delete_option("wd_form_maker_version");
|
| 16 |
+
delete_option('formmaker_cureent_version');
|
| 17 |
+
delete_option('contact_form_themes');
|
| 18 |
+
delete_option('contact_form_forms');
|
| 19 |
+
delete_option('form_maker_pro_active');
|
| 20 |
+
delete_option('fm_emailverification');
|
| 21 |
+
delete_option('fm_admin_notice');
|
| 22 |
+
delete_option('fm_settings');
|
| 23 |
+
delete_option('fm_subscribe_done');
|
| 24 |
+
wp_delete_post($email_verification_post_id);
|
| 25 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker");
|
| 26 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_submits");
|
| 27 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_views");
|
| 28 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_themes");
|
| 29 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_sessions");
|
| 30 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_blocked");
|
| 31 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_query");
|
| 32 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_backup");
|
| 33 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_mailchimp");
|
| 34 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_reg");
|
| 35 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_post_gen_options");
|
| 36 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_email_conditions");
|
| 37 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_dbox_int");
|
| 38 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_pdf_options");
|
| 39 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_pdf");
|
| 40 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_pushover");
|
| 41 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_stripe");
|
| 42 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_save_options");
|
| 43 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_saved_entries");
|
| 44 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_saved_attributes");
|
| 45 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_calculator");
|
| 46 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_gdrive_int");
|
| 47 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_display_options");
|
| 48 |
+
}
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
}
|
admin/models/FMModelWidget.php
CHANGED
|
@@ -1,38 +1,38 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMModelWidget {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
|
| 22 |
-
public function get_gallery_rows_data() {
|
| 23 |
-
global $wpdb;
|
| 24 |
-
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker order by `title`";
|
| 25 |
-
$rows = $wpdb->get_results($query);
|
| 26 |
-
return $rows;
|
| 27 |
-
}
|
| 28 |
-
|
| 29 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 30 |
-
// Getters & Setters //
|
| 31 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 32 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 33 |
-
// Private Methods //
|
| 34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 36 |
-
// Listeners //
|
| 37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMModelWidget {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
|
| 22 |
+
public function get_gallery_rows_data() {
|
| 23 |
+
global $wpdb;
|
| 24 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker order by `title`";
|
| 25 |
+
$rows = $wpdb->get_results($query);
|
| 26 |
+
return $rows;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 30 |
+
// Getters & Setters //
|
| 31 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 32 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 33 |
+
// Private Methods //
|
| 34 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 35 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 36 |
+
// Listeners //
|
| 37 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 38 |
}
|
admin/views/FMViewBlocked_ips_fm.php
CHANGED
|
@@ -1,150 +1,150 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMViewBlocked_ips_fm {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
private $model;
|
| 14 |
-
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
// Constructor & Destructor //
|
| 17 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 18 |
-
public function __construct($model) {
|
| 19 |
-
$this->model = $model;
|
| 20 |
-
}
|
| 21 |
-
|
| 22 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 23 |
-
// Public Methods //
|
| 24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 25 |
-
public function display() {
|
| 26 |
-
$rows_data = $this->model->get_rows_data();
|
| 27 |
-
$page_nav = $this->model->page_nav();
|
| 28 |
-
$search_value = ((isset($_POST['search_value'])) ? esc_html(stripslashes($_POST['search_value'])) : '');
|
| 29 |
-
$asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
|
| 30 |
-
$order_by_array = array('id', 'ip');
|
| 31 |
-
$order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
|
| 32 |
-
$order_class = 'manage-column column-title sorted ' . $asc_or_desc;
|
| 33 |
-
$ids_string = '';
|
| 34 |
-
?>
|
| 35 |
-
<div id="fm_blocked_ips_message" style="width: 99%; display: none;"></div>
|
| 36 |
-
<form onkeypress="fm_doNothing(event)" class="wrap" id="blocked_ips" method="post" action="admin.php?page=blocked_ips_fm">
|
| 37 |
-
<?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
|
| 38 |
-
<div class="fm-page-banner blocked-ips-banner">
|
| 39 |
-
<div class="block_icon">
|
| 40 |
-
</div>
|
| 41 |
-
<div class="fm-logo-title">Blocked IPs</div>
|
| 42 |
-
<div class="fm-page-actions">
|
| 43 |
-
<button class="fm-button save-button medium" onclick="fm_set_input_value('task', 'save_all');">
|
| 44 |
-
<span></span>
|
| 45 |
-
Save
|
| 46 |
-
</button>
|
| 47 |
-
<button class="fm-button delete-button medium" onclick="if (confirm('Do you want to unblock selected IPs?')) { fm_set_input_value('task', 'delete_all'); } else { return false; }">
|
| 48 |
-
<span></span>
|
| 49 |
-
Delete
|
| 50 |
-
</button>
|
| 51 |
-
</div>
|
| 52 |
-
</div>
|
| 53 |
-
<div class="fm-clear"></div>
|
| 54 |
-
<div class="tablenav top">
|
| 55 |
-
<?php
|
| 56 |
-
WDW_FM_Library::search('IP', $search_value, 'blocked_ips');
|
| 57 |
-
WDW_FM_Library::html_page_nav($page_nav['total'], $page_nav['limit'], 'blocked_ips');
|
| 58 |
-
?>
|
| 59 |
-
</div>
|
| 60 |
-
<table class="wp-list-table widefat fixed pages fm-block-ip">
|
| 61 |
-
<thead>
|
| 62 |
-
<tr>
|
| 63 |
-
<th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin: 0;" /></th>
|
| 64 |
-
<th class="table_small_col <?php if ($order_by == 'id') {echo $order_class;} ?>">
|
| 65 |
-
<a onclick="fm_set_input_value('task', '');
|
| 66 |
-
fm_set_input_value('order_by', 'id');
|
| 67 |
-
fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'id' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
|
| 68 |
-
fm_form_submit(event, 'blocked_ips')" href="">
|
| 69 |
-
<span>ID</span><span class="sorting-indicator"></span></th>
|
| 70 |
-
</a>
|
| 71 |
-
<th class="<?php if ($order_by == 'ip') {echo $order_class;} ?>">
|
| 72 |
-
<a onclick="fm_set_input_value('task', '');
|
| 73 |
-
fm_set_input_value('order_by', 'ip');
|
| 74 |
-
fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'ip' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
|
| 75 |
-
fm_form_submit(event, 'blocked_ips')" href="">
|
| 76 |
-
<span>IP</span><span class="sorting-indicator"></span>
|
| 77 |
-
</a>
|
| 78 |
-
</th>
|
| 79 |
-
<th class="table_small_col">Edit</th>
|
| 80 |
-
<th class="table_small_col">Delete</th>
|
| 81 |
-
</tr>
|
| 82 |
-
<tr id="tr" style="background-color: #f9f9f9;">
|
| 83 |
-
<th></th>
|
| 84 |
-
<th></th>
|
| 85 |
-
<th>
|
| 86 |
-
<input type="text" class="input_th" id="ip" name="ip" onkeypress="return fm_check_isnum(event)">
|
| 87 |
-
<button class="fm-button add-button medium" onclick="if (fm_check_required('ip', 'IP')) {return false;} fm_set_input_value('task', 'save'); fm_set_input_value('current_id', ''); fm_save_ip('blocked_ips');">
|
| 88 |
-
Add IP
|
| 89 |
-
<span></span>
|
| 90 |
-
</button>
|
| 91 |
-
</th>
|
| 92 |
-
<th>
|
| 93 |
-
|
| 94 |
-
</th>
|
| 95 |
-
<th></th>
|
| 96 |
-
</tr>
|
| 97 |
-
</thead>
|
| 98 |
-
<tbody id="tbody_arr">
|
| 99 |
-
<?php
|
| 100 |
-
if ($rows_data) {
|
| 101 |
-
foreach ($rows_data as $row_data
|
| 102 |
-
$alternate = (!isset($alternate) || $alternate == 'class="alternate"') ? '' : 'class="alternate"';
|
| 103 |
-
?>
|
| 104 |
-
<tr id="tr_<?php echo $row_data->id; ?>" <?php echo $alternate; ?>>
|
| 105 |
-
<td class="table_small_col check-column" id="td_check_<?php echo $row_data->id; ?>" >
|
| 106 |
-
<input id="check_<?php echo $row_data->id; ?>" name="check_<?php echo $row_data->id; ?>" type="checkbox" />
|
| 107 |
-
</td>
|
| 108 |
-
<td class="table_small_col" id="td_id_<?php echo $row_data->id; ?>" ><?php echo $row_data->id; ?></td>
|
| 109 |
-
<td id="td_ip_<?php echo $row_data->id; ?>" >
|
| 110 |
-
<a class="pointer" id="ip<?php echo $row_data->id; ?>"
|
| 111 |
-
onclick="fm_edit_ip(<?php echo $row_data->id; ?>)"
|
| 112 |
-
title="Edit"><?php echo $row_data->ip; ?></a>
|
| 113 |
-
</td>
|
| 114 |
-
<td class="table_small_col" id="td_edit_<?php echo $row_data->id; ?>">
|
| 115 |
-
<button class="fm-icon edit-icon" onclick="fm_edit_ip(<?php echo $row_data->id; ?>);">
|
| 116 |
-
<span></span>
|
| 117 |
-
</button>
|
| 118 |
-
</td>
|
| 119 |
-
<td class="table_small_col" id="td_delete_<?php echo $row_data->id; ?>">
|
| 120 |
-
<button class="fm-icon delete-icon" onclick="if (confirm('Do you want to unblock selected IP?')) { fm_set_input_value('task', 'delete'); fm_set_input_value('current_id', <?php echo $row_data->id; ?>); fm_form_submit(event, 'blocked_ips'); } else {return false;}">
|
| 121 |
-
<span></span>
|
| 122 |
-
</button>
|
| 123 |
-
</td>
|
| 124 |
-
</tr>
|
| 125 |
-
<?php
|
| 126 |
-
$ids_string .= $row_data->id . ',';
|
| 127 |
-
}
|
| 128 |
-
}
|
| 129 |
-
?>
|
| 130 |
-
</tbody>
|
| 131 |
-
</table>
|
| 132 |
-
<input id="task" name="task" type="hidden" value="" />
|
| 133 |
-
<input id="current_id" name="current_id" type="hidden" value="" />
|
| 134 |
-
<input id="ids_string" name="ids_string" type="hidden" value="<?php echo $ids_string; ?>" />
|
| 135 |
-
<input id="asc_or_desc" name="asc_or_desc" type="hidden" value="<?php echo $asc_or_desc; ?>" />
|
| 136 |
-
<input id="order_by" name="order_by" type="hidden" value="<?php echo $order_by; ?>" />
|
| 137 |
-
</form>
|
| 138 |
-
<?php
|
| 139 |
-
}
|
| 140 |
-
|
| 141 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 142 |
-
// Getters & Setters //
|
| 143 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 144 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 145 |
-
// Private Methods //
|
| 146 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 147 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 148 |
-
// Listeners //
|
| 149 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMViewBlocked_ips_fm {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
private $model;
|
| 14 |
+
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
// Constructor & Destructor //
|
| 17 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 18 |
+
public function __construct($model) {
|
| 19 |
+
$this->model = $model;
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 23 |
+
// Public Methods //
|
| 24 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 25 |
+
public function display() {
|
| 26 |
+
$rows_data = $this->model->get_rows_data();
|
| 27 |
+
$page_nav = $this->model->page_nav();
|
| 28 |
+
$search_value = ((isset($_POST['search_value'])) ? esc_html(stripslashes($_POST['search_value'])) : '');
|
| 29 |
+
$asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
|
| 30 |
+
$order_by_array = array('id', 'ip');
|
| 31 |
+
$order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
|
| 32 |
+
$order_class = 'manage-column column-title sorted ' . $asc_or_desc;
|
| 33 |
+
$ids_string = '';
|
| 34 |
+
?>
|
| 35 |
+
<div id="fm_blocked_ips_message" style="width: 99%; display: none;"></div>
|
| 36 |
+
<form onkeypress="fm_doNothing(event)" class="wrap" id="blocked_ips" method="post" action="admin.php?page=blocked_ips_fm">
|
| 37 |
+
<?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
|
| 38 |
+
<div class="fm-page-banner blocked-ips-banner">
|
| 39 |
+
<div class="block_icon">
|
| 40 |
+
</div>
|
| 41 |
+
<div class="fm-logo-title">Blocked IPs</div>
|
| 42 |
+
<div class="fm-page-actions">
|
| 43 |
+
<button class="fm-button save-button medium" onclick="fm_set_input_value('task', 'save_all');">
|
| 44 |
+
<span></span>
|
| 45 |
+
Save
|
| 46 |
+
</button>
|
| 47 |
+
<button class="fm-button delete-button medium" onclick="if (confirm('Do you want to unblock selected IPs?')) { fm_set_input_value('task', 'delete_all'); } else { return false; }">
|
| 48 |
+
<span></span>
|
| 49 |
+
Delete
|
| 50 |
+
</button>
|
| 51 |
+
</div>
|
| 52 |
+
</div>
|
| 53 |
+
<div class="fm-clear"></div>
|
| 54 |
+
<div class="tablenav top">
|
| 55 |
+
<?php
|
| 56 |
+
WDW_FM_Library::search('IP', $search_value, 'blocked_ips');
|
| 57 |
+
WDW_FM_Library::html_page_nav($page_nav['total'], $page_nav['limit'], 'blocked_ips');
|
| 58 |
+
?>
|
| 59 |
+
</div>
|
| 60 |
+
<table class="wp-list-table widefat fixed pages fm-block-ip">
|
| 61 |
+
<thead>
|
| 62 |
+
<tr>
|
| 63 |
+
<th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin: 0;" /></th>
|
| 64 |
+
<th class="table_small_col <?php if ($order_by == 'id') {echo $order_class;} ?>">
|
| 65 |
+
<a onclick="fm_set_input_value('task', '');
|
| 66 |
+
fm_set_input_value('order_by', 'id');
|
| 67 |
+
fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'id' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
|
| 68 |
+
fm_form_submit(event, 'blocked_ips')" href="">
|
| 69 |
+
<span>ID</span><span class="sorting-indicator"></span></th>
|
| 70 |
+
</a>
|
| 71 |
+
<th class="<?php if ($order_by == 'ip') {echo $order_class;} ?>">
|
| 72 |
+
<a onclick="fm_set_input_value('task', '');
|
| 73 |
+
fm_set_input_value('order_by', 'ip');
|
| 74 |
+
fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'ip' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
|
| 75 |
+
fm_form_submit(event, 'blocked_ips')" href="">
|
| 76 |
+
<span>IP</span><span class="sorting-indicator"></span>
|
| 77 |
+
</a>
|
| 78 |
+
</th>
|
| 79 |
+
<th class="table_small_col">Edit</th>
|
| 80 |
+
<th class="table_small_col">Delete</th>
|
| 81 |
+
</tr>
|
| 82 |
+
<tr id="tr" style="background-color: #f9f9f9;">
|
| 83 |
+
<th></th>
|
| 84 |
+
<th></th>
|
| 85 |
+
<th>
|
| 86 |
+
<input type="text" class="input_th" id="ip" name="ip" onkeypress="return fm_check_isnum(event)">
|
| 87 |
+
<button class="fm-button add-button medium" onclick="if (fm_check_required('ip', 'IP')) {return false;} fm_set_input_value('task', 'save'); fm_set_input_value('current_id', ''); fm_save_ip('blocked_ips');">
|
| 88 |
+
Add IP
|
| 89 |
+
<span></span>
|
| 90 |
+
</button>
|
| 91 |
+
</th>
|
| 92 |
+
<th>
|
| 93 |
+
|
| 94 |
+
</th>
|
| 95 |
+
<th></th>
|
| 96 |
+
</tr>
|
| 97 |
+
</thead>
|
| 98 |
+
<tbody id="tbody_arr">
|
| 99 |
+
<?php
|
| 100 |
+
if ($rows_data) {
|
| 101 |
+
foreach ($rows_data as $row_data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
