Version Description
Changed: CSV/XML export
Download this release
Release Info
Developer | webdorado |
Plugin | Form Maker by WD – user-friendly drag & drop Form Builder plugin |
Version | 1.7.86 |
Comparing to | |
See all releases |
Code changes from version 1.7.85 to 1.7.86
- admin/models/FMModelGenerete_csv.php +214 -224
- admin/models/FMModelGenerete_xml.php +217 -241
- admin/models/FMModelSubmissions_fm.php +6 -0
- admin/views/FMViewGenerete_csv.php +53 -44
- admin/views/FMViewGenerete_xml.php +40 -28
- admin/views/FMViewSubmissions_fm.php +42 -18
- css/style.css +22 -0
- form-maker.php +2 -2
- readme.txt +4 -1
admin/models/FMModelGenerete_csv.php
CHANGED
@@ -18,252 +18,242 @@ class FMModelGenerete_csv {
|
|
18 |
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
// Public Methods //
|
20 |
////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
global $wpdb;
|
25 |
-
$params = array();
|
26 |
-
$form_id = (int)$_REQUEST['form_id'];
|
27 |
-
$paypal_info_fields = array('currency', 'ord_last_modified', 'status', 'full_name', 'fax', 'mobile_phone', 'email', 'phone', 'address', 'paypal_info', 'ipn', 'tax', 'shipping');
|
28 |
-
|
29 |
-
$paypal_info_labels = array( 'Currency', 'Last modified', 'Status', 'Full Name', 'Fax', 'Mobile phone', 'Email', 'Phone', 'Address', 'Paypal info', 'IPN', 'Tax', 'Shipping');
|
30 |
-
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
|
44 |
-
|
45 |
-
|
46 |
-
$rows_lable = $wpdb->get_results($query_lable);
|
47 |
-
$ptn = "/[^a-zA-Z0-9_]/";
|
48 |
-
$rpltxt = "";
|
49 |
-
$title = preg_replace($ptn, $rpltxt, $rows_lable[0]->title);
|
50 |
-
$sorted_labels_id = array();
|
51 |
-
$sorted_labels = array();
|
52 |
-
$label_titles = array();
|
53 |
-
if ($labels) {
|
54 |
-
$label_id = array();
|
55 |
-
$label_order = array();
|
56 |
-
$label_order_original = array();
|
57 |
-
$label_type = array();
|
58 |
-
///stexic
|
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 |
-
$ptn = "/[^a-zA-Z0-9_]/";
|
67 |
-
$rpltxt = "";
|
68 |
-
$label_temp = preg_replace($ptn, $rpltxt, $label_oder_each[0]);
|
69 |
-
array_push($label_order, $label_temp);
|
70 |
-
array_push($label_type, $label_oder_each[1]);
|
71 |
-
}
|
72 |
-
foreach ($label_id as $key => $label) {
|
73 |
-
if (in_array($label, $labels) && $label_type[$key] !='type_arithmetic_captcha') {
|
74 |
-
array_push($sorted_labels, $label_order[$key]);
|
75 |
-
array_push($sorted_labels_id, $label);
|
76 |
-
array_push($label_titles, stripslashes($label_order_original[$key]));
|
77 |
-
}
|
78 |
-
}
|
79 |
-
}
|
80 |
-
|
81 |
-
$m = count($sorted_labels);
|
82 |
-
$group_id_s = array();
|
83 |
-
|
84 |
-
if (count($rows) > 0 and $m){
|
85 |
|
86 |
-
$
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
$data_temp = array();
|
97 |
-
$tt = $wpdb->get_results($wpdb->prepare("SELECT `element_label`, `id`, `form_id`, `element_value`, `group_id`, `date`, `ip`, `user_id_wd` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d",$i), OBJECT_K);
|
98 |
-
for ($h = 0; $h < $m; $h++) {
|
99 |
-
if(isset($data_temp[$label_titles[$h]]))
|
100 |
-
$label_titles[$h] .= '(1)';
|
101 |
-
if(isset($tt[$sorted_labels_id[$h]])) {
|
102 |
-
$t = $tt[$sorted_labels_id[$h]];
|
103 |
-
if ($t) {
|
104 |
-
$f=$t;
|
105 |
-
$date=$t->date;
|
106 |
-
$ip = $t->ip;
|
107 |
-
$user_id = get_userdata($t->user_id_wd);
|
108 |
$username = $user_id ? $user_id->display_name : "";
|
109 |
-
$useremail= $user_id ? $user_id->user_email : "";
|
110 |
-
$data_temp['Submit date']
|
111 |
$data_temp['Ip']=$ip;
|
112 |
$data_temp['Submitter\'s Username']=$username;
|
113 |
$data_temp['Submitter\'s Email Address']=$useremail;
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
if
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
}
|
132 |
-
if(substr($element_value, -2) == ', ') {
|
133 |
-
$data_temp[stripslashes($label_titles[$h])]= substr($element_value, 0, -2);
|
134 |
-
}
|
135 |
-
else {
|
136 |
-
$data_temp[stripslashes($label_titles[$h])]= $element_value;
|
137 |
-
}
|
138 |
-
}
|
139 |
-
elseif (strpos($t->element_value, "***map***")) {
|
140 |
-
$data_temp[stripslashes($label_titles[$h])] = 'Longitude:' . str_replace("***map***", ', Latitude:', $t->element_value);
|
141 |
-
}
|
142 |
-
elseif (strpos($t->element_value, "***star_rating***")) {
|
143 |
-
$element = str_replace("***star_rating***", '', $t->element_value);
|
144 |
-
$element = explode("***", $element);
|
145 |
-
$data_temp[stripslashes($label_titles[$h])] = ' ' . $element[1] . '/' . $element[0];
|
146 |
}
|
147 |
-
|
148 |
-
|
|
|
|
|
|
|
|
|
149 |
}
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
$
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
$total += $grading[$k];
|
159 |
-
}
|
160 |
-
$items .= "Total: " . $total;
|
161 |
-
$data_temp[stripslashes($label_titles[$h])] = $items;
|
162 |
}
|
163 |
-
elseif (strpos($t->element_value, "***matrix***")) {
|
164 |
-
$element = str_replace("***matrix***", '', $t->element_value);
|
165 |
-
$matrix_value = explode('***', $element);
|
166 |
-
$matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
|
167 |
-
$mat_rows = $matrix_value[0];
|
168 |
-
$mat_columns = $matrix_value[$mat_rows + 1];
|
169 |
-
$matrix = "";
|
170 |
-
$aaa = Array();
|
171 |
-
$var_checkbox = 1;
|
172 |
-
$selected_value = "";
|
173 |
-
$selected_value_yes = "";
|
174 |
-
$selected_value_no = "";
|
175 |
-
for ($k = 1; $k <= $mat_rows; $k++) {
|
176 |
-
if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
|
177 |
-
if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
|
178 |
-
$checked = "0";
|
179 |
-
$aaa[1] = "";
|
180 |
-
}
|
181 |
-
else {
|
182 |
-
$aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
|
183 |
-
}
|
184 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
185 |
-
if ($aaa[1] == $l) {
|
186 |
-
$checked = '1';
|
187 |
}
|
188 |
-
|
189 |
-
|
190 |
}
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
if ($matrix_value[$mat_rows+$mat_columns + 2] == "checkbox") {
|
196 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
197 |
-
if ($matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox] == 1) {
|
198 |
-
$checked = '1';
|
199 |
-
}
|
200 |
-
else {
|
201 |
-
$checked = '0';
|
202 |
-
}
|
203 |
-
$matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
|
204 |
-
$var_checkbox++;
|
205 |
}
|
206 |
-
|
207 |
-
|
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 |
-
|
216 |
-
|
217 |
-
$
|
218 |
-
$
|
219 |
-
$
|
220 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
}
|
222 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
}
|
224 |
}
|
225 |
-
$data_temp[stripslashes($label_titles[$h])] = $matrix;
|
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 |
// Getters & Setters //
|
269 |
////////////////////////////////////////////////////////////////////////////////////////
|
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 |
+
|
29 |
+
$paypal_info_fields = array('currency', 'ord_last_modified', 'status', 'full_name', 'fax', 'mobile_phone', 'email', 'phone', 'address', 'paypal_info', 'ipn', 'tax', 'shipping');
|
30 |
+
$paypal_info_labels = array( 'Currency', 'Last modified', 'Status', 'Full Name', 'Fax', 'Mobile phone', 'Email', 'Phone', 'Address', 'Paypal info', 'IPN', 'Tax', 'Shipping');
|
31 |
+
|
32 |
+
$query = $wpdb->prepare("SELECT distinct group_id FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d", $form_id);
|
33 |
+
$group_id_s = $wpdb->get_col($query);
|
34 |
|
35 |
+
$query = $wpdb->prepare("SELECT distinct element_label FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d",$form_id);
|
36 |
+
$labels = $wpdb->get_col($query);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
+
$query_lable = $wpdb->prepare("SELECT label_order,title FROM " . $wpdb->prefix . "formmaker where id=%d", $form_id);
|
39 |
+
$rows_lable = $wpdb->get_results($query_lable);
|
40 |
+
$ptn = "/[^a-zA-Z0-9_]/";
|
41 |
+
$rpltxt = "";
|
42 |
+
$title = preg_replace($ptn, $rpltxt, $rows_lable[0]->title);
|
43 |
|
44 |
+
$sorted_labels_id = array();
|
45 |
+
$sorted_labels = array();
|
46 |
+
$label_titles = array();
|
47 |
+
$label_id = array();
|
48 |
+
$label_order = array();
|
49 |
+
$label_order_original = array();
|
50 |
+
$label_type = array();
|
51 |
+
if ($labels) {
|
52 |
+
$label_all = explode('#****#', $rows_lable[0]->label_order);
|
53 |
+
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
54 |
+
foreach ($label_all as $key => $label_each) {
|
55 |
+
$label_id_each = explode('#**id**#', $label_each);
|
56 |
+
array_push($label_id, $label_id_each[0]);
|
57 |
+
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
58 |
+
array_push($label_order_original, $label_oder_each[0]);
|
59 |
+
$label_temp = preg_replace($ptn, $rpltxt, $label_oder_each[0]);
|
60 |
+
array_push($label_order, $label_temp);
|
61 |
+
array_push($label_type, $label_oder_each[1]);
|
62 |
+
}
|
63 |
+
foreach ($label_id as $key => $label) {
|
64 |
+
if (in_array($label, $labels) && $label_type[$key] !='type_arithmetic_captcha') {
|
65 |
+
array_push($sorted_labels, $label_order[$key]);
|
66 |
+
array_push($sorted_labels_id, $label);
|
67 |
+
array_push($label_titles, stripslashes($label_order_original[$key]));
|
68 |
+
}
|
69 |
+
}
|
70 |
+
}
|
71 |
+
|
72 |
+
$m = count($sorted_labels);
|
73 |
|
74 |
+
$query = $wpdb->prepare("SELECT group_id, ip, date, user_id_wd, GROUP_CONCAT( element_label SEPARATOR ',') as element_label, GROUP_CONCAT( element_value SEPARATOR '*:*el_value*:*') as element_value FROM " . $wpdb->prefix . "formmaker_submits where form_id= %d GROUP BY group_id ORDER BY date ASC limit %d, %d", $form_id, $limitstart, 3000);
|
75 |
+
$rows = $wpdb->get_results($query, OBJECT_K);
|
|
|
76 |
|
77 |
+
$data = array();
|
78 |
+
$group_id_s_count = $limitstart + 3000 < count($group_id_s) ? $limitstart + 3000 : count($group_id_s);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
|
80 |
+
for ($www = $limitstart; $www < $group_id_s_count; $www++) {
|
81 |
+
$i = $group_id_s[$www];
|
82 |
+
$field_key = array_search($i, $label_id);
|
83 |
+
if($label_type[$field_key] != 'type_arithmetic_captcha') {
|
84 |
+
$data_temp = array();
|
85 |
+
$tt = $rows[$i];
|
86 |
+
|
87 |
+
$date = $tt->date;
|
88 |
+
$ip = $tt->ip;
|
89 |
+
$user_id = get_userdata($tt->user_id_wd);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
$username = $user_id ? $user_id->display_name : "";
|
91 |
+
$useremail = $user_id ? $user_id->user_email : "";
|
92 |
+
$data_temp['Submit date'] = $date;
|
93 |
$data_temp['Ip']=$ip;
|
94 |
$data_temp['Submitter\'s Username']=$username;
|
95 |
$data_temp['Submitter\'s Email Address']=$useremail;
|
96 |
+
|
97 |
+
$element_labels = explode(',', $tt->element_label);
|
98 |
+
$element_values = explode('*:*el_value*:*', $tt->element_value);
|
99 |
+
for ($h = 0; $h < $m; $h++) {
|
100 |
+
if(isset($data_temp[$label_titles[$h]]))
|
101 |
+
$label_titles[$h] .= '(1)';
|
102 |
+
|
103 |
+
if(in_array($sorted_labels_id[$h], $element_labels)) {
|
104 |
+
$element_value = $element_values[array_search($sorted_labels_id[$h], $element_labels)];
|
105 |
+
|
106 |
+
if (strpos($element_value, "*@@url@@*")) {
|
107 |
+
$file_names = '';
|
108 |
+
$new_files = explode("*@@url@@*", $element_value);
|
109 |
+
foreach ($new_files as $new_file) {
|
110 |
+
if ($new_file) {
|
111 |
+
$file_names .= $new_file . ", ";
|
112 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
}
|
114 |
+
$data_temp[stripslashes($label_titles[$h])] = $file_names;
|
115 |
+
}
|
116 |
+
elseif (strpos($element_value, "***br***")) {
|
117 |
+
$element_value = str_replace("***br***", ', ', $element_value);
|
118 |
+
if (strpos($element_value, "***quantity***")) {
|
119 |
+
$element_value = str_replace("***quantity***", '', $element_value);
|
120 |
}
|
121 |
+
if (strpos($element_value, "***property***")) {
|
122 |
+
$element_value = str_replace("***property***", '', $element_value);
|
123 |
+
}
|
124 |
+
if(substr($element_value, -2) == ', ') {
|
125 |
+
$data_temp[stripslashes($label_titles[$h])]= substr($element_value, 0, -2);
|
126 |
+
}
|
127 |
+
else {
|
128 |
+
$data_temp[stripslashes($label_titles[$h])]= $element_value;
|
|
|
|
|
|
|
|
|
129 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
}
|
131 |
+
elseif (strpos($element_value, "***map***")) {
|
132 |
+
$data_temp[stripslashes($label_titles[$h])] = 'Longitude:' . str_replace("***map***", ', Latitude:', $element_value);
|
133 |
}
|
134 |
+
elseif (strpos($element_value, "***star_rating***")) {
|
135 |
+
$element = str_replace("***star_rating***", '', $element_value);
|
136 |
+
$element = explode("***", $element);
|
137 |
+
$data_temp[stripslashes($label_titles[$h])] = ' ' . $element[1] . '/' . $element[0];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
}
|
139 |
+
elseif (strpos($element_value, "@@@") || $element_value == "@@@" || $element_value == "@@@@@@@@@") {
|
140 |
+
$data_temp[stripslashes($label_titles[$h])] = str_replace("@@@", ' ', $element_value);
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
}
|
142 |
+
elseif (strpos($element_value, "***grading***")) {
|
143 |
+
$element = str_replace("***grading***", '', $element_value);
|
144 |
+
$grading = explode(":", $element);
|
145 |
+
$items_count = sizeof($grading) - 1;
|
146 |
+
$items = "";
|
147 |
+
$total = "";
|
148 |
+
for ($k = 0; $k < $items_count / 2; $k++) {
|
149 |
+
$items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . ", ";
|
150 |
+
$total += $grading[$k];
|
151 |
+
}
|
152 |
+
$items .= "Total: " . $total;
|
153 |
+
$data_temp[stripslashes($label_titles[$h])] = $items;
|
154 |
}
|
155 |
+
elseif (strpos($element_value, "***matrix***")) {
|
156 |
+
$element = str_replace("***matrix***", '', $element_value);
|
157 |
+
$matrix_value = explode('***', $element);
|
158 |
+
$matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
|
159 |
+
$mat_rows = $matrix_value[0];
|
160 |
+
$mat_columns = $matrix_value[$mat_rows + 1];
|
161 |
+
$matrix = "";
|
162 |
+
$aaa = array();
|
163 |
+
$var_checkbox = 1;
|
164 |
+
$selected_value = "";
|
165 |
+
$selected_value_yes = "";
|
166 |
+
$selected_value_no = "";
|
167 |
+
for ($k = 1; $k <= $mat_rows; $k++) {
|
168 |
+
if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
|
169 |
+
if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
|
170 |
+
$checked = "0";
|
171 |
+
$aaa[1] = "";
|
172 |
+
}
|
173 |
+
else {
|
174 |
+
$aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
|
175 |
+
}
|
176 |
+
for ($l = 1; $l <= $mat_columns; $l++) {
|
177 |
+
$checked = $aaa[1] == $l ? '1' : '0';
|
178 |
+
$matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
|
179 |
+
}
|
180 |
+
}
|
181 |
+
else {
|
182 |
+
if ($matrix_value[$mat_rows+$mat_columns + 2] == "checkbox") {
|
183 |
+
for ($l = 1; $l <= $mat_columns; $l++) {
|
184 |
+
$checked = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox] == 1 ? '1' : '0';
|
185 |
+
$matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
|
186 |
+
$var_checkbox++;
|
187 |
+
}
|
188 |
+
}
|
189 |
+
else {
|
190 |
+
if ($matrix_value[$mat_rows+$mat_columns + 2] == "text") {
|
191 |
+
for ($l = 1; $l <= $mat_columns; $l++) {
|
192 |
+
$text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
|
193 |
+
$matrix .='['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$text_value."; ";
|
194 |
+
$var_checkbox++;
|
195 |
+
}
|
196 |
+
}
|
197 |
+
else {
|
198 |
+
for ($l = 1; $l <= $mat_columns; $l++) {
|
199 |
+
$selected_text = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox];
|
200 |
+
$matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows + 1 + $l].']='.$selected_text."; ";
|
201 |
+
$var_checkbox++;
|
202 |
+
}
|
203 |
+
}
|
204 |
}
|
205 |
}
|
|
|
206 |
}
|
207 |
+
$data_temp[stripslashes($label_titles[$h])] = $matrix;
|
208 |
+
}
|
209 |
+
else {
|
210 |
+
$val = htmlspecialchars_decode($element_value);
|
211 |
+
$val = stripslashes(str_replace(''', "'", $val));
|
212 |
+
$data_temp[stripslashes($label_titles[$h])] = ($element_value ? $val : '');
|
213 |
+
}
|
214 |
+
}
|
215 |
}
|
216 |
+
|
217 |
+
$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);
|
218 |
+
$is_paypal = $wpdb->get_results($query);
|
219 |
+
|
220 |
+
if($is_paypal) {
|
221 |
+
$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'));
|
222 |
+
$total = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s", $i, 'total'));
|
223 |
+
$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'));
|
224 |
+
$data_temp['Item Total'] = $item_total;
|
225 |
+
$data_temp['Total'] = $total;
|
226 |
+
$data_temp['Payment Status'] = $payment_status;
|
227 |
+
}
|
228 |
+
$query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_sessions where group_id=%d",$i);
|
229 |
+
$paypal_info = $wpdb->get_results($query);
|
230 |
+
if ($paypal_info) {
|
231 |
+
$is_paypal_info = TRUE;
|
232 |
+
}
|
233 |
+
if ($is_paypal) {
|
234 |
+
foreach ($paypal_info_fields as $key=>$paypal_info_field) {
|
235 |
+
if ($paypal_info) {
|
236 |
+
$data_temp['PAYPAL_'.$paypal_info_labels[$key]]=$paypal_info[0]->$paypal_info_field;
|
237 |
+
}
|
238 |
+
else {
|
239 |
+
$data_temp['PAYPAL_'.$paypal_info_labels[$key]]='';
|
240 |
+
}
|
241 |
+
}
|
242 |
+
}
|
243 |
+
|
244 |
+
$data[$i] = $data_temp;
|
245 |
+
}
|
246 |
+
}
|
247 |
+
|
248 |
+
array_push($params, $data);
|
249 |
+
array_push($params, $title);
|
250 |
+
array_push($params, $is_paypal_info);
|
251 |
+
|
252 |
+
return $params;
|
253 |
+
|
254 |
+
}
|
255 |
+
|
256 |
+
|
257 |
////////////////////////////////////////////////////////////////////////////////////////
|
258 |
// Getters & Setters //
|
259 |
////////////////////////////////////////////////////////////////////////////////////////
|
admin/models/FMModelGenerete_xml.php
CHANGED
@@ -20,272 +20,248 @@ class FMModelGenerete_xml {
|
|
20 |
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
|
22 |
public function get_data() {
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
if (!in_array($row->element_label, $labels)) {
|
36 |
-
array_push($labels, $row->element_label);
|
37 |
-
}
|
38 |
-
}
|
39 |
-
$label_titles = array();
|
40 |
-
$sorted_labels = array();
|
41 |
-
$query_lable = "SELECT label_order,title FROM " . $wpdb->prefix . "formmaker where id=$form_id ";
|
42 |
-
$rows_lable = $wpdb->get_results($query_lable);
|
43 |
-
$ptn = "/[^a-zA-Z0-9_]/";
|
44 |
-
$rpltxt = "";
|
45 |
-
$title = preg_replace($ptn, $rpltxt, $rows_lable[0]->title);
|
46 |
-
$sorted_labels_id = array();
|
47 |
-
$sorted_labels = array();
|
48 |
-
$label_titles = array();
|
49 |
-
if ($labels) {
|
50 |
-
$label_id = array();
|
51 |
-
$label_order = array();
|
52 |
-
$label_order_original = array();
|
53 |
-
$label_type = array();
|
54 |
-
$label_all = explode('#****#', $rows_lable[0]->label_order);
|
55 |
-
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
56 |
-
foreach ($label_all as $key => $label_each) {
|
57 |
-
$label_id_each = explode('#**id**#', $label_each);
|
58 |
-
array_push($label_id, $label_id_each[0]);
|
59 |
-
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
60 |
-
array_push($label_order_original, $label_oder_each[0]);
|
61 |
-
$ptn = "/[^a-zA-Z0-9_]/";
|
62 |
-
$rpltxt = "";
|
63 |
-
$label_temp = preg_replace($ptn, $rpltxt, $label_oder_each[0]);
|
64 |
-
array_push($label_order, $label_temp);
|
65 |
-
array_push($label_type, $label_oder_each[1]);
|
66 |
-
}
|
67 |
-
foreach ($label_id as $key => $label) {
|
68 |
-
if (in_array($label, $labels) && $label_type[$key] !='type_arithmetic_captcha') {
|
69 |
-
array_push($sorted_labels, $label_order[$key]);
|
70 |
-
array_push($sorted_labels_id, $label);
|
71 |
-
array_push($label_titles, stripslashes($label_order_original[$key]));
|
72 |
-
}
|
73 |
-
}
|
74 |
-
}
|
75 |
-
$m = count($sorted_labels);
|
76 |
-
$group_id_s = array();
|
77 |
-
$l = 0;
|
78 |
-
if (count($rows) > 0 and $m) {
|
79 |
-
for ($i = 0; $i < count($rows); $i++) {
|
80 |
-
$row = &$rows[$i];
|
81 |
-
if (!in_array($row->group_id, $group_id_s)) {
|
82 |
-
array_push($group_id_s, $row->group_id);
|
83 |
-
}
|
84 |
-
}
|
85 |
-
}
|
86 |
-
$data = array();
|
87 |
-
$temp_all = array();
|
88 |
-
for ($j = 0; $j < $n; $j++) {
|
89 |
-
$row = &$rows[$j];
|
90 |
-
$key = $row->group_id;
|
91 |
-
if (!isset($temp_all[$key])) {
|
92 |
-
$temp_all[$key] = array();
|
93 |
-
}
|
94 |
-
array_push($temp_all[$key], $row);
|
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 |
-
$element_value = str_replace("***br***", ', ', $t->element_value);
|
131 |
-
if (strpos($element_value, "***quantity***")) {
|
132 |
-
$element_value = str_replace("***quantity***", '', $element_value);
|
133 |
-
}
|
134 |
-
if (strpos($element_value, "***property***")) {
|
135 |
-
$element_value = str_replace("***property***", '', $element_value);
|
136 |
-
}
|
137 |
-
if(substr($element_value, -2) == ', ') {
|
138 |
-
$data_temp[stripslashes($label_titles[$h])]= substr($element_value, 0, -2);
|
139 |
-
}
|
140 |
-
else {
|
141 |
-
$data_temp[stripslashes($label_titles[$h])]= $element_value;
|
142 |
-
}
|
143 |
-
}
|
144 |
-
elseif (strpos($t->element_value, "***map***")) {
|
145 |
-
$data_temp[stripslashes($label_titles[$h])] = 'Longitude:' . str_replace("***map***", ', Latitude:', $t->element_value);
|
146 |
}
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
}
|
152 |
-
|
153 |
-
|
|
|
|
|
|
|
|
|
154 |
}
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
$
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
$total += $grading[$k];
|
164 |
-
}
|
165 |
-
$items .= "Total: " . $total;
|
166 |
-
$data_temp[stripslashes($label_titles[$h])] = $items;
|
167 |
}
|
168 |
-
elseif (strpos($t->element_value, "***matrix***")) {
|
169 |
-
$element = str_replace("***matrix***", '', $t->element_value);
|
170 |
-
$matrix_value = explode('***', $element);
|
171 |
-
$matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
|
172 |
-
$mat_rows = $matrix_value[0];
|
173 |
-
$mat_columns = $matrix_value[$mat_rows + 1];
|
174 |
-
$matrix = "";
|
175 |
-
$aaa = Array();
|
176 |
-
$var_checkbox = 1;
|
177 |
-
$selected_value = "";
|
178 |
-
$selected_value_yes = "";
|
179 |
-
$selected_value_no = "";
|
180 |
-
for ($k = 1; $k <= $mat_rows; $k++) {
|
181 |
-
if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
|
182 |
-
if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
|
183 |
-
$checked = "0";
|
184 |
-
$aaa[1] = "";
|
185 |
-
}
|
186 |
-
else {
|
187 |
-
$aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
|
188 |
-
}
|
189 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
190 |
-
if ($aaa[1] == $l) {
|
191 |
-
$checked = '1';
|
192 |
}
|
193 |
-
|
194 |
-
|
195 |
}
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
if ($matrix_value[$mat_rows+$mat_columns + 2] == "checkbox") {
|
201 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
202 |
-
if ($matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox] == 1) {
|
203 |
-
$checked = '1';
|
204 |
-
}
|
205 |
-
else {
|
206 |
-
$checked = '0';
|
207 |
-
}
|
208 |
-
$matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
|
209 |
-
$var_checkbox++;
|
210 |
}
|
211 |
-
|
212 |
-
|
213 |
-
if ($matrix_value[$mat_rows+$mat_columns + 2] == "text") {
|
214 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
215 |
-
$text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
|
216 |
-
$matrix .='['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$text_value."; ";
|
217 |
-
$var_checkbox++;
|
218 |
-
}
|
219 |
}
|
220 |
-
|
221 |
-
|
222 |
-
$
|
223 |
-
$
|
224 |
-
$
|
225 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
}
|
227 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
}
|
229 |
}
|
230 |
-
$data_temp[stripslashes($label_titles[$h])] = $matrix;
|
231 |
}
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
|
|
|
|
|
|
|
|
236 |
}
|
237 |
-
}
|
238 |
-
}
|
239 |
-
}
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
$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'));
|
244 |
-
|
245 |
-
|
246 |
-
$total = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s",$i,'total'));
|
247 |
|
|
|
|
|
|
|
248 |
|
249 |
-
|
250 |
|
251 |
|
252 |
-
|
253 |
-
|
254 |
|
255 |
-
|
256 |
-
|
257 |
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
|
|
|
262 |
|
263 |
-
$query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_sessions where group_id= %d", $i);
|
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 |
// Getters & Setters //
|
291 |
////////////////////////////////////////////////////////////////////////////////////////
|
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 |
+
|
30 |
+
$paypal_info_fields = array('currency', 'ord_last_modified', 'status', 'full_name', 'fax', 'mobile_phone', 'email', 'phone', 'address', 'paypal_info', 'ipn', 'tax', 'shipping');
|
31 |
+
$paypal_info_labels = array( 'Currency', 'Last modified', 'Status', 'Full Name', 'Fax', 'Mobile phone', 'Email', 'Phone', 'Address', 'Paypal info', 'IPN', 'Tax', 'Shipping');
|
32 |
+
|
33 |
+
$query = $wpdb->prepare("SELECT distinct group_id FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d", $form_id);
|
34 |
+
$group_id_s = $wpdb->get_col($query);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
+
$query = $wpdb->prepare("SELECT distinct element_label FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d",$form_id);
|
37 |
+
$labels = $wpdb->get_col($query);
|
38 |
+
|
39 |
+
$query_lable = $wpdb->prepare("SELECT label_order,title FROM " . $wpdb->prefix . "formmaker where id=%d", $form_id);
|
40 |
+
$rows_lable = $wpdb->get_results($query_lable);
|
41 |
+
$ptn = "/[^a-zA-Z0-9_]/";
|
42 |
+
$rpltxt = "";
|
43 |
+
$title = preg_replace($ptn, $rpltxt, $rows_lable[0]->title);
|
44 |
+
|
45 |
+
$sorted_labels_id = array();
|
46 |
+
$sorted_labels = array();
|
47 |
+
$label_titles = array();
|
48 |
+
$label_id = array();
|
49 |
+
$label_order = array();
|
50 |
+
$label_order_original = array();
|
51 |
+
$label_type = array();
|
52 |
+
if ($labels) {
|
53 |
+
$label_all = explode('#****#', $rows_lable[0]->label_order);
|
54 |
+
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
55 |
+
foreach ($label_all as $key => $label_each) {
|
56 |
+
$label_id_each = explode('#**id**#', $label_each);
|
57 |
+
array_push($label_id, $label_id_each[0]);
|
58 |
+
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
59 |
+
array_push($label_order_original, $label_oder_each[0]);
|
60 |
+
$label_temp = preg_replace($ptn, $rpltxt, $label_oder_each[0]);
|
61 |
+
array_push($label_order, $label_temp);
|
62 |
+
array_push($label_type, $label_oder_each[1]);
|
63 |
+
}
|
64 |
+
foreach ($label_id as $key => $label) {
|
65 |
+
if (in_array($label, $labels) && $label_type[$key] !='type_arithmetic_captcha') {
|
66 |
+
array_push($sorted_labels, $label_order[$key]);
|
67 |
+
array_push($sorted_labels_id, $label);
|
68 |
+
array_push($label_titles, stripslashes($label_order_original[$key]));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
}
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
$m = count($sorted_labels);
|
74 |
+
|
75 |
+
$query = $wpdb->prepare("SELECT group_id, ip, date, user_id_wd, GROUP_CONCAT( element_label SEPARATOR ',') as element_label, GROUP_CONCAT( element_value SEPARATOR '*:*el_value*:*') as element_value FROM " . $wpdb->prefix . "formmaker_submits where form_id= %d GROUP BY group_id ORDER BY date ASC limit %d, %d", $form_id, $limitstart, 3000);
|
76 |
+
$rows = $wpdb->get_results($query, OBJECT_K);
|
77 |
+
|
78 |
+
$data = array();
|
79 |
+
$group_id_s_count = $limitstart + 3000 < count($group_id_s) ? $limitstart + 3000 : count($group_id_s);
|
80 |
+
|
81 |
+
for ($www = $limitstart; $www < $group_id_s_count; $www++) {
|
82 |
+
$i = $group_id_s[$www];
|
83 |
+
$field_key = array_search($i, $label_id);
|
84 |
+
if($label_type[$field_key] != 'type_arithmetic_captcha') {
|
85 |
+
$data_temp = array();
|
86 |
+
$tt = $rows[$i];
|
87 |
+
|
88 |
+
$date = $tt->date;
|
89 |
+
$ip = $tt->ip;
|
90 |
+
$user_id = get_userdata($tt->user_id_wd);
|
91 |
+
$username = $user_id ? $user_id->display_name : "";
|
92 |
+
$useremail = $user_id ? $user_id->user_email : "";
|
93 |
+
$data_temp['Submit date'] = $date;
|
94 |
+
$data_temp['Ip']=$ip;
|
95 |
+
$data_temp['Submitter\'s Username']=$username;
|
96 |
+
$data_temp['Submitter\'s Email Address']=$useremail;
|
97 |
+
|
98 |
+
$element_labels = explode(',', $tt->element_label);
|
99 |
+
$element_values = explode('*:*el_value*:*', $tt->element_value);
|
100 |
+
for ($h = 0; $h < $m; $h++) {
|
101 |
+
if(isset($data_temp[$label_titles[$h]]))
|
102 |
+
$label_titles[$h] .= '(1)';
|
103 |
+
|
104 |
+
if(in_array($sorted_labels_id[$h], $element_labels)) {
|
105 |
+
$element_value = $element_values[array_search($sorted_labels_id[$h], $element_labels)];
|
106 |
+
|
107 |
+
if (strpos($element_value, "*@@url@@*")) {
|
108 |
+
$file_names = '';
|
109 |
+
$new_files = explode("*@@url@@*", $element_value);
|
110 |
+
foreach ($new_files as $new_file) {
|
111 |
+
if ($new_file) {
|
112 |
+
$file_names .= $new_file . ", ";
|
113 |
+
}
|
114 |
}
|
115 |
+
$data_temp[stripslashes($label_titles[$h])] = $file_names;
|
116 |
+
}
|
117 |
+
elseif (strpos($element_value, "***br***")) {
|
118 |
+
$element_value = str_replace("***br***", ', ', $element_value);
|
119 |
+
if (strpos($element_value, "***quantity***")) {
|
120 |
+
$element_value = str_replace("***quantity***", '', $element_value);
|
121 |
}
|
122 |
+
if (strpos($element_value, "***property***")) {
|
123 |
+
$element_value = str_replace("***property***", '', $element_value);
|
124 |
+
}
|
125 |
+
if(substr($element_value, -2) == ', ') {
|
126 |
+
$data_temp[stripslashes($label_titles[$h])]= substr($element_value, 0, -2);
|
127 |
+
}
|
128 |
+
else {
|
129 |
+
$data_temp[stripslashes($label_titles[$h])]= $element_value;
|
|
|
|
|
|
|
|
|
130 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
}
|
132 |
+
elseif (strpos($element_value, "***map***")) {
|
133 |
+
$data_temp[stripslashes($label_titles[$h])] = 'Longitude:' . str_replace("***map***", ', Latitude:', $element_value);
|
134 |
}
|
135 |
+
elseif (strpos($element_value, "***star_rating***")) {
|
136 |
+
$element = str_replace("***star_rating***", '', $element_value);
|
137 |
+
$element = explode("***", $element);
|
138 |
+
$data_temp[stripslashes($label_titles[$h])] = ' ' . $element[1] . '/' . $element[0];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
}
|
140 |
+
elseif (strpos($element_value, "@@@") || $element_value == "@@@" || $element_value == "@@@@@@@@@") {
|
141 |
+
$data_temp[stripslashes($label_titles[$h])] = str_replace("@@@", ' ', $element_value);
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
}
|
143 |
+
elseif (strpos($element_value, "***grading***")) {
|
144 |
+
$element = str_replace("***grading***", '', $element_value);
|
145 |
+
$grading = explode(":", $element);
|
146 |
+
$items_count = sizeof($grading) - 1;
|
147 |
+
$items = "";
|
148 |
+
$total = "";
|
149 |
+
for ($k = 0; $k < $items_count / 2; $k++) {
|
150 |
+
$items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . ", ";
|
151 |
+
$total += $grading[$k];
|
152 |
+
}
|
153 |
+
$items .= "Total: " . $total;
|
154 |
+
$data_temp[stripslashes($label_titles[$h])] = $items;
|
155 |
}
|
156 |
+
elseif (strpos($element_value, "***matrix***")) {
|
157 |
+
$element = str_replace("***matrix***", '', $element_value);
|
158 |
+
$matrix_value = explode('***', $element);
|
159 |
+
$matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
|
160 |
+
$mat_rows = $matrix_value[0];
|
161 |
+
$mat_columns = $matrix_value[$mat_rows + 1];
|
162 |
+
$matrix = "";
|
163 |
+
$aaa = array();
|
164 |
+
$var_checkbox = 1;
|
165 |
+
$selected_value = "";
|
166 |
+
$selected_value_yes = "";
|
167 |
+
$selected_value_no = "";
|
168 |
+
for ($k = 1; $k <= $mat_rows; $k++) {
|
169 |
+
if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
|
170 |
+
if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
|
171 |
+
$checked = "0";
|
172 |
+
$aaa[1] = "";
|
173 |
+
}
|
174 |
+
else {
|
175 |
+
$aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
|
176 |
+
}
|
177 |
+
for ($l = 1; $l <= $mat_columns; $l++) {
|
178 |
+
$checked = $aaa[1] == $l ? '1' : '0';
|
179 |
+
$matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
|
180 |
+
}
|
181 |
+
}
|
182 |
+
else {
|
183 |
+
if ($matrix_value[$mat_rows+$mat_columns + 2] == "checkbox") {
|
184 |
+
for ($l = 1; $l <= $mat_columns; $l++) {
|
185 |
+
$checked = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox] == 1 ? '1' : '0';
|
186 |
+
$matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
|
187 |
+
$var_checkbox++;
|
188 |
+
}
|
189 |
+
}
|
190 |
+
else {
|
191 |
+
if ($matrix_value[$mat_rows+$mat_columns + 2] == "text") {
|
192 |
+
for ($l = 1; $l <= $mat_columns; $l++) {
|
193 |
+
$text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
|
194 |
+
$matrix .='['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$text_value."; ";
|
195 |
+
$var_checkbox++;
|
196 |
+
}
|
197 |
+
}
|
198 |
+
else {
|
199 |
+
for ($l = 1; $l <= $mat_columns; $l++) {
|
200 |
+
$selected_text = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox];
|
201 |
+
$matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows + 1 + $l].']='.$selected_text."; ";
|
202 |
+
$var_checkbox++;
|
203 |
+
}
|
204 |
+
}
|
205 |
}
|
206 |
}
|
|
|
207 |
}
|
208 |
+
$data_temp[stripslashes($label_titles[$h])] = $matrix;
|
209 |
+
}
|
210 |
+
else {
|
211 |
+
$val = htmlspecialchars_decode($element_value);
|
212 |
+
$val = stripslashes(str_replace(''', "'", $val));
|
213 |
+
$data_temp[stripslashes($label_titles[$h])] = ($element_value ? $val : '');
|
214 |
+
}
|
215 |
+
}
|
216 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
|
218 |
+
$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'));
|
219 |
+
|
220 |
+
$total = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s",$i,'total'));
|
221 |
|
222 |
+
$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'));
|
223 |
|
224 |
|
225 |
+
if($item_total)
|
226 |
+
$data_temp['Item Total'] = $item_total;
|
227 |
|
228 |
+
if($total)
|
229 |
+
$data_temp['Total'] = $total;
|
230 |
|
231 |
+
if($payment_status)
|
232 |
+
$data_temp['Payment Status'] = $payment_status;
|
|
|
233 |
|
234 |
+
$query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_sessions where group_id= %d", $i);
|
235 |
|
|
|
236 |
|
237 |
|
238 |
+
$paypal_info = $wpdb->get_results($query);
|
239 |
+
if ($paypal_info) {
|
240 |
+
$is_paypal_info = TRUE;
|
241 |
+
}
|
242 |
+
if ($is_paypal_info) {
|
243 |
+
foreach ($paypal_info_fields as $key=>$paypal_info_field) {
|
244 |
+
if ($paypal_info) {
|
245 |
+
$data_temp['PAYPAL_' . $paypal_info_labels[$key]] = $paypal_info[0]->$paypal_info_field;
|
246 |
+
}
|
247 |
+
else {
|
248 |
+
$data_temp['PAYPAL_' . $paypal_info_labels[$key]] = '';
|
249 |
+
}
|
250 |
+
}
|
251 |
+
}
|
252 |
+
|
253 |
+
$data[$i] = $data_temp;
|
254 |
+
}
|
255 |
+
}
|
256 |
|
257 |
+
array_push($params, $data);
|
258 |
+
array_push($params, $title);
|
259 |
+
array_push($params, $is_paypal_info);
|
260 |
+
|
261 |
+
return $params;
|
262 |
+
|
263 |
+
}
|
264 |
+
|
265 |
////////////////////////////////////////////////////////////////////////////////////////
|
266 |
// Getters & Setters //
|
267 |
////////////////////////////////////////////////////////////////////////////////////////
|
admin/models/FMModelSubmissions_fm.php
CHANGED
@@ -654,6 +654,12 @@ class FMModelSubmissions_fm {
|
|
654 |
}
|
655 |
return $choices_values;
|
656 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
657 |
}
|
658 |
|
659 |
?>
|
654 |
}
|
655 |
return $choices_values;
|
656 |
}
|
657 |
+
public function get_subs_count($form_id) {
|
658 |
+
global $wpdb;
|
659 |
+
$query = $wpdb->prepare("SELECT distinct group_id FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d", $form_id);
|
660 |
+
$group_id_s = $wpdb->get_col($query);
|
661 |
+
return count($group_id_s);
|
662 |
+
}
|
663 |
}
|
664 |
|
665 |
?>
|
admin/views/FMViewGenerete_csv.php
CHANGED
@@ -22,54 +22,63 @@ class FMViewGenerete_csv {
|
|
22 |
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
// Public Methods //
|
24 |
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
$all_keys = array();
|
39 |
-
foreach ($data as $key =>$row) {
|
40 |
-
$all_keys = array_merge($all_keys, $row);
|
41 |
-
}
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
|
|
48 |
}
|
49 |
-
$data[$key] = $row;
|
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 |
// Getters & Setters //
|
75 |
////////////////////////////////////////////////////////////////////////////////////////
|
22 |
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
// Public Methods //
|
24 |
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
+
public function display() {
|
26 |
+
$params = $this->model->get_data();
|
27 |
+
$limitstart = (int)$_REQUEST['limitstart'];
|
28 |
+
$send_header = (int)$_REQUEST['send_header'];
|
29 |
+
$data = $params[0];
|
30 |
+
$title = $params[1];
|
31 |
+
$is_paypal_info = $params[2];
|
32 |
+
|
33 |
+
$all_keys = array();
|
34 |
+
foreach ($data as $row) {
|
35 |
+
$all_keys = array_merge($all_keys, $row);
|
36 |
+
}
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
+
$keys_array = array_keys($all_keys);
|
39 |
+
foreach ($data as $key => $row) {
|
40 |
+
foreach ($keys_array as $key1 => $value) {
|
41 |
+
if(!array_key_exists ( $value , $row ))
|
42 |
+
array_splice($row, $key1, 0, '');
|
43 |
+
}
|
44 |
+
$data[$key] = $row;
|
45 |
}
|
|
|
|
|
46 |
|
47 |
+
if(!file_exists(WD_FM_DIR . '/export'))
|
48 |
+
mkdir(WD_FM_DIR . '/export' , 0777);
|
49 |
+
|
50 |
+
if(file_exists(WD_FM_DIR . '/export/export.txt') && $limitstart == 0){
|
51 |
+
unlink(WD_FM_DIR . '/export/export.txt');
|
52 |
+
}
|
53 |
+
|
54 |
+
$output = fopen(WD_FM_DIR . '/export/export.txt', "a");
|
55 |
+
if($limitstart == 0) {
|
56 |
+
fputcsv($output, str_replace('PAYPAL_', '', $keys_array));
|
57 |
+
}
|
58 |
+
|
59 |
+
foreach ($data as $record) {
|
60 |
+
fputcsv($output, $record);
|
61 |
+
}
|
62 |
+
fclose($output);
|
63 |
+
|
64 |
+
if($send_header == 1){
|
65 |
+
$filename = $title . "_" . date('Ymd') . ".csv";
|
66 |
+
header('Content-Encoding: Windows-1252');
|
67 |
+
header('Content-type: text/csv; charset=Windows-1252');
|
68 |
+
header("Content-Disposition: attachment; filename=\"$filename\"");
|
69 |
+
|
70 |
+
$exported = copy(WD_FM_DIR . '/export/export.txt', "php://output");
|
71 |
+
die();
|
72 |
+
}
|
73 |
+
|
74 |
+
}
|
75 |
|
76 |
+
public function cleanData(&$str) {
|
77 |
+
$str = preg_replace("/\t/", "\\t", $str);
|
78 |
+
$str = preg_replace("/\r?\n/", "\\n", $str);
|
79 |
+
if (strstr($str, '"'))
|
80 |
+
$str = '"' . str_replace('"', '""', $str) . '"';
|
81 |
+
}
|
82 |
////////////////////////////////////////////////////////////////////////////////////////
|
83 |
// Getters & Setters //
|
84 |
////////////////////////////////////////////////////////////////////////////////////////
|
admin/views/FMViewGenerete_xml.php
CHANGED
@@ -23,36 +23,48 @@ class FMViewGenerete_xml {
|
|
23 |
// Public Methods //
|
24 |
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
public function display() {
|
26 |
-
|
|
|
|
|
27 |
$data = $params[0];
|
28 |
$title = $params[1];
|
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 |
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
// Public Methods //
|
24 |
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
public function display() {
|
26 |
+
$params = $this->model->get_data();
|
27 |
+
$limitstart = (int)$_REQUEST['limitstart'];
|
28 |
+
$send_header = (int)$_REQUEST['send_header'];
|
29 |
$data = $params[0];
|
30 |
$title = $params[1];
|
31 |
+
|
32 |
+
if(!file_exists(WD_FM_DIR . '/export'))
|
33 |
+
mkdir(WD_FM_DIR . '/export' , 0777);
|
34 |
+
|
35 |
+
if(file_exists(WD_FM_DIR . '/export/export.txt') && $limitstart == 0){
|
36 |
+
unlink(WD_FM_DIR . '/export/export.txt');
|
37 |
+
}
|
38 |
+
|
39 |
+
define('PHP_TAB', "\t");
|
40 |
+
$output = fopen(WD_FM_DIR . '/export/export.txt', "a");
|
41 |
+
if($limitstart == 0) {
|
42 |
+
fwrite($output, '<?xml version="1.0" encoding="utf-8" ?>'.PHP_EOL);
|
43 |
+
fwrite($output, '<form title="'.$title.'">'.PHP_EOL);
|
44 |
+
}
|
45 |
+
|
46 |
+
foreach ($data as $key1 => $value1) {
|
47 |
+
fwrite($output, PHP_TAB.'<submission id="'.$key1.'">'.PHP_EOL);
|
48 |
+
foreach ($value1 as $key => $value) {
|
49 |
+
fwrite($output, PHP_TAB.PHP_TAB.'<field title="'.$key.'">'.PHP_EOL);
|
50 |
+
fwrite($output, PHP_TAB.PHP_TAB.PHP_TAB.'<![CDATA['.$value.']]>'.PHP_EOL);
|
51 |
+
fwrite($output, PHP_TAB.PHP_TAB.'</field>'.PHP_EOL);
|
52 |
+
}
|
53 |
+
fwrite($output, PHP_TAB.'</submission>'.PHP_EOL);
|
54 |
+
}
|
55 |
+
|
56 |
+
if($send_header == 1){
|
57 |
+
fwrite($output, '</form>');
|
58 |
+
fclose($output);
|
59 |
+
$filename = $title . "_" . date('Ymd') . ".xml";
|
60 |
+
header('Content-Encoding: Windows-1252');
|
61 |
+
header('Content-type: text/xml; charset=utf-8');
|
62 |
+
header("Content-Disposition: attachment; filename=\"$filename\"");
|
63 |
+
|
64 |
+
$exported = copy(WD_FM_DIR . '/export/export.txt', "php://output");
|
65 |
+
die();
|
66 |
+
}
|
67 |
+
|
68 |
}
|
69 |
|
70 |
////////////////////////////////////////////////////////////////////////////////////////
|
admin/views/FMViewSubmissions_fm.php
CHANGED
@@ -55,8 +55,29 @@ class FMViewSubmissions_fm {
|
|
55 |
$ka_fielderov_search = (($lists['ip_search'] || $lists['startdate'] || $lists['enddate'] || $lists['username_search'] || $lists['useremail_search'] || $lists['id_search']) ? TRUE : FALSE);
|
56 |
$is_stats = false;
|
57 |
$blocked_ips = $this->model->blocked_ips();
|
|
|
58 |
?>
|
59 |
<script type="text/javascript">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
function clickLabChBAll(ChBAll) {
|
61 |
<?php
|
62 |
if (isset($sorted_label_names)) {
|
@@ -155,6 +176,7 @@ class FMViewSubmissions_fm {
|
|
155 |
});
|
156 |
});
|
157 |
</script>
|
|
|
158 |
<div id="sbox-overlay" onclick="toggleChBDiv(false)"
|
159 |
style="z-index: 65555; position: fixed; top: 0px; left: 0px; visibility: visible; zoom: 1; background-color: #000000; opacity: 0.7; filter: alpha(opacity=70); display: none;">
|
160 |
</div>
|
@@ -242,8 +264,8 @@ class FMViewSubmissions_fm {
|
|
242 |
</td>
|
243 |
<td style="text-align: right;" width="300">
|
244 |
<span class="exp_but_span">Export to</span>
|
245 |
-
<input type="button" class="button-secondary" value="CSV" onclick="
|
246 |
-
<input type="button" class="button-secondary" value="XML" onclick="
|
247 |
</td>
|
248 |
</tr>
|
249 |
<tr>
|
@@ -700,7 +722,24 @@ class FMViewSubmissions_fm {
|
|
700 |
</td>
|
701 |
</tr>
|
702 |
</table>
|
703 |
-
<div id="div_stats"></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
704 |
<?php
|
705 |
}
|
706 |
}
|
@@ -710,21 +749,6 @@ class FMViewSubmissions_fm {
|
|
710 |
jQuery(window).load(function() {
|
711 |
spider_popup();
|
712 |
});
|
713 |
-
function show_stats() {
|
714 |
-
jQuery('#div_stats').html('<div id="saving"><div id="saving_text">Loading</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
|
715 |
-
if(jQuery('#sorted_label_key').val()!="") {
|
716 |
-
jQuery('#div_stats').load('<?php echo add_query_arg(array('action' => 'get_stats', 'page' => 'submissions_fm'), admin_url('admin-ajax.php')); ?>', {
|
717 |
-
'task': 'show_stats',
|
718 |
-
'form_id' : '<?php echo $form_id; ?>',
|
719 |
-
'sorted_label_key' : jQuery('#sorted_label_key').val(),
|
720 |
-
'startdate' : jQuery('#startstats').val(),
|
721 |
-
'enddate' : jQuery('#endstats').val(),
|
722 |
-
'nonce_fm_ajax': '<?php echo $ajax_nonce; ?>'
|
723 |
-
});
|
724 |
-
}
|
725 |
-
else
|
726 |
-
jQuery('#div_stats').html("Please select the field!")
|
727 |
-
}
|
728 |
<?php
|
729 |
if ($ka_fielderov_search) {
|
730 |
?>
|
55 |
$ka_fielderov_search = (($lists['ip_search'] || $lists['startdate'] || $lists['enddate'] || $lists['username_search'] || $lists['useremail_search'] || $lists['id_search']) ? TRUE : FALSE);
|
56 |
$is_stats = false;
|
57 |
$blocked_ips = $this->model->blocked_ips();
|
58 |
+
$subs_count = $this->model->get_subs_count($form_id);
|
59 |
?>
|
60 |
<script type="text/javascript">
|
61 |
+
function export_submissions(type, limit) {
|
62 |
+
body = jQuery('body');
|
63 |
+
jQuery.ajax({
|
64 |
+
type: "POST",
|
65 |
+
url:"<?php echo add_query_arg(array('form_id' => $form_id, 'send_header' => 0), admin_url('admin-ajax.php')); ?>&action=generete_"+type+"&limitstart="+limit,
|
66 |
+
beforeSend: function() {
|
67 |
+
body.addClass("fm_loading");
|
68 |
+
},
|
69 |
+
success: function(data) {
|
70 |
+
if(limit < <?php echo $subs_count; ?>) {
|
71 |
+
limit += 3000;
|
72 |
+
export_submissions(type, limit);
|
73 |
+
}
|
74 |
+
else{
|
75 |
+
body.removeClass("fm_loading");
|
76 |
+
window.location = "<?php echo add_query_arg(array('form_id' => $form_id, 'send_header' => 1), admin_url('admin-ajax.php')); ?>&action=generete_"+type+"&limitstart="+limit;
|
77 |
+
}
|
78 |
+
}
|
79 |
+
});
|
80 |
+
}
|
81 |
function clickLabChBAll(ChBAll) {
|
82 |
<?php
|
83 |
if (isset($sorted_label_names)) {
|
176 |
});
|
177 |
});
|
178 |
</script>
|
179 |
+
<div class="fm_modal"></div>
|
180 |
<div id="sbox-overlay" onclick="toggleChBDiv(false)"
|
181 |
style="z-index: 65555; position: fixed; top: 0px; left: 0px; visibility: visible; zoom: 1; background-color: #000000; opacity: 0.7; filter: alpha(opacity=70); display: none;">
|
182 |
</div>
|
264 |
</td>
|
265 |
<td style="text-align: right;" width="300">
|
266 |
<span class="exp_but_span">Export to</span>
|
267 |
+
<input type="button" class="button-secondary" value="CSV" onclick="export_submissions('csv', 0)" />
|
268 |
+
<input type="button" class="button-secondary" value="XML" onclick="export_submissions('xml', 0)" />
|
269 |
</td>
|
270 |
</tr>
|
271 |
<tr>
|
722 |
</td>
|
723 |
</tr>
|
724 |
</table>
|
725 |
+
<div id="div_stats"></div>
|
726 |
+
<script>
|
727 |
+
function show_stats() {
|
728 |
+
jQuery('#div_stats').html('<div id="saving"><div id="saving_text">Loading</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
|
729 |
+
if(jQuery('#sorted_label_key').val()!="") {
|
730 |
+
jQuery('#div_stats').load('<?php echo add_query_arg(array('action' => 'get_stats', 'page' => 'submissions_fm'), admin_url('admin-ajax.php')); ?>', {
|
731 |
+
'task': 'show_stats',
|
732 |
+
'form_id' : '<?php echo $form_id; ?>',
|
733 |
+
'sorted_label_key' : jQuery('#sorted_label_key').val(),
|
734 |
+
'startdate' : jQuery('#startstats').val(),
|
735 |
+
'enddate' : jQuery('#endstats').val(),
|
736 |
+
'nonce_fm_ajax': '<?php echo $ajax_nonce; ?>'
|
737 |
+
});
|
738 |
+
}
|
739 |
+
else
|
740 |
+
jQuery('#div_stats').html("Please select the field!")
|
741 |
+
}
|
742 |
+
</script>
|
743 |
<?php
|
744 |
}
|
745 |
}
|
749 |
jQuery(window).load(function() {
|
750 |
spider_popup();
|
751 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
752 |
<?php
|
753 |
if ($ka_fielderov_search) {
|
754 |
?>
|
css/style.css
CHANGED
@@ -374,4 +374,26 @@ visibility: visible !important;
|
|
374 |
height: 80px !important;
|
375 |
width: 100% !important;
|
376 |
display:inline-block
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
377 |
}
|
374 |
height: 80px !important;
|
375 |
width: 100% !important;
|
376 |
display:inline-block
|
377 |
+
}
|
378 |
+
|
379 |
+
.fm_modal {
|
380 |
+
display: none;
|
381 |
+
position: fixed;
|
382 |
+
z-index: 1000;
|
383 |
+
top: 0;
|
384 |
+
left: 0;
|
385 |
+
height: 100%;
|
386 |
+
width: 100%;
|
387 |
+
background: rgba( 255, 255, 255, .8 )
|
388 |
+
url('http://i.stack.imgur.com/FhHRx.gif')
|
389 |
+
50% 50%
|
390 |
+
no-repeat;
|
391 |
+
}
|
392 |
+
|
393 |
+
.fm_loading {
|
394 |
+
overflow: hidden;
|
395 |
+
}
|
396 |
+
|
397 |
+
.fm_loading .fm_modal {
|
398 |
+
display: block;
|
399 |
}
|
form-maker.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Form Maker
|
4 |
* Plugin URI: https://web-dorado.com/products/form-maker-wordpress.html
|
5 |
* Description: This plugin is a modern and advanced tool for easy and fast creating of a WordPress Form. The backend interface is intuitive and user friendly which allows users far from scripting and programming to create WordPress Forms.
|
6 |
-
* Version: 1.7.
|
7 |
* Author: WebDorado
|
8 |
* Author URI: https://web-dorado.com/
|
9 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
@@ -269,7 +269,7 @@ function register_fmemailverification_cpt(){
|
|
269 |
// Activate plugin.
|
270 |
function form_maker_activate() {
|
271 |
$version = get_option("wd_form_maker_version");
|
272 |
-
$new_version = '1.7.
|
273 |
global $wpdb;
|
274 |
if (!$version) {
|
275 |
add_option("wd_form_maker_version", $new_version, '', 'no');
|
3 |
* Plugin Name: Form Maker
|
4 |
* Plugin URI: https://web-dorado.com/products/form-maker-wordpress.html
|
5 |
* Description: This plugin is a modern and advanced tool for easy and fast creating of a WordPress Form. The backend interface is intuitive and user friendly which allows users far from scripting and programming to create WordPress Forms.
|
6 |
+
* Version: 1.7.86
|
7 |
* Author: WebDorado
|
8 |
* Author URI: https://web-dorado.com/
|
9 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
269 |
// Activate plugin.
|
270 |
function form_maker_activate() {
|
271 |
$version = get_option("wd_form_maker_version");
|
272 |
+
$new_version = '1.7.86';
|
273 |
global $wpdb;
|
274 |
if (!$version) {
|
275 |
add_option("wd_form_maker_version", $new_version, '', 'no');
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://web-dorado.com/products/wordpress-form.html
|
|
4 |
Tags: form, forms, form builder, form maker, form manager, form plugin, form with recaptcha, forms plugin, multiple forms, paypal form, survey form, feedback form, feedback forms, contact form,contact form plugin, contact form builder, form creator, email form, secure form, web form, form to email, contact forms, custom forms, form widget, captcha form, wordpress contact form ,recaptcha contact form, form creation, contact form with auto reply, widget contact form, builder, feedback, contacts form plugin , custom contact form, contact us form, formular, formulario, admin, captcha, contact, database, email, javascript, jquery, page, plugin, survey, widget, custom form, forms creator, input, validation, send copy, form with captcha , pdf
|
5 |
Requires at least: 3.4
|
6 |
Tested up to: 4.3
|
7 |
-
Stable tag: 1.7.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -297,6 +297,9 @@ The Form Maker (Pro version) has simple PayPal integration. This allows the user
|
|
297 |
|
298 |
== Changelog ==
|
299 |
|
|
|
|
|
|
|
300 |
= 1.7.85 =
|
301 |
Fixed: Bug in conditional fields
|
302 |
|
4 |
Tags: form, forms, form builder, form maker, form manager, form plugin, form with recaptcha, forms plugin, multiple forms, paypal form, survey form, feedback form, feedback forms, contact form,contact form plugin, contact form builder, form creator, email form, secure form, web form, form to email, contact forms, custom forms, form widget, captcha form, wordpress contact form ,recaptcha contact form, form creation, contact form with auto reply, widget contact form, builder, feedback, contacts form plugin , custom contact form, contact us form, formular, formulario, admin, captcha, contact, database, email, javascript, jquery, page, plugin, survey, widget, custom form, forms creator, input, validation, send copy, form with captcha , pdf
|
5 |
Requires at least: 3.4
|
6 |
Tested up to: 4.3
|
7 |
+
Stable tag: 1.7.86
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
297 |
|
298 |
== Changelog ==
|
299 |
|
300 |
+
= 1.7.86 =
|
301 |
+
Changed: CSV/XML export
|
302 |
+
|
303 |
= 1.7.85 =
|
304 |
Fixed: Bug in conditional fields
|
305 |
|