Version Description
Download this release
Release Info
Developer | webdorado |
Plugin | Form Maker by WD – user-friendly drag & drop Form Builder plugin |
Version | 1.5.4 |
Comparing to | |
See all releases |
Code changes from version 1.5.1 to 1.5.4
- Form_Maker.php +1031 -1376
- Submissions.html.php +775 -789
- Submissions.php +387 -591
- Theme_functions.php +134 -165
- Themes_function.html.php +298 -252
- css/style.css +1 -1
- form_ajax_functions.php +456 -560
- form_maker_functions.html.php +3513 -3559
- form_maker_functions.php +556 -963
- form_maker_widget.php +16 -8
- front_end_form_maker.php +1713 -1670
- generate_csv.php +0 -234
- generate_xml.php +0 -458
- images/{formmaker.png → formMaker.png} +0 -0
- images/formoptions.png +0 -0
- images/info.png +0 -0
- images/logo.png +0 -0
- images/paypal.png +0 -0
- js/formmaker_free.js +938 -6573
Form_Maker.php
CHANGED
@@ -2,16 +2,12 @@
|
|
2 |
/*
|
3 |
Plugin Name: Form Maker
|
4 |
Plugin URI: http://web-dorado.com/products/form-maker-wordpress.html
|
5 |
-
Version: 1.5.
|
6 |
Author: http://web-dorado.com/
|
7 |
License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
8 |
*/
|
9 |
-
|
10 |
//// load languages
|
11 |
///////////////////////////////////////////////////////////////////////////////////////////////////////////////// css
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
$first_css = ".wdform_table1
|
16 |
{
|
17 |
font-size:14px;
|
@@ -124,7 +120,7 @@ margin: 0px;
|
|
124 |
padding: 0px;
|
125 |
vertical-align:middle;
|
126 |
cursor:pointer;
|
127 |
-
background-image: url(".plugins_url('images/refresh_black.png',__FILE__).");
|
128 |
}
|
129 |
|
130 |
.captcha_input
|
@@ -202,126 +198,86 @@ width:50px;
|
|
202 |
{
|
203 |
width:100px;
|
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 |
require_once("front_end_form_maker.php");
|
234 |
require_once("form_maker_widget.php");
|
235 |
require_once('recaptchalib.php');
|
236 |
-
|
237 |
-
add_action( 'init', 'form_maker_language_load' );
|
238 |
-
|
239 |
function form_maker_language_load() {
|
240 |
-
|
241 |
}
|
242 |
-
add_action('init', 'do_output_buffer');
|
243 |
-
function do_output_buffer() {
|
244 |
-
ob_start();
|
245 |
-
}
|
246 |
-
////////////////
|
247 |
-
for($ii=0;$ii<100;$ii++){
|
248 |
-
remove_filter('the_content','do_shortcode',$ii);
|
249 |
-
remove_filter('the_content','wpautop',$ii);
|
250 |
-
}
|
251 |
-
add_filter('the_content','wpautop',10);
|
252 |
-
add_filter('the_content','do_shortcode',11);
|
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 |
function form_maker_scripts_method() {
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
}
|
287 |
-
|
288 |
-
add_action('wp_enqueue_scripts', 'form_maker_scripts_method');
|
289 |
-
|
290 |
-
|
291 |
|
|
|
292 |
///////////////////////////// FORNT END Print message
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
$returned_content=" <style>
|
325 |
.updated,.error{
|
326 |
border-width:1px !important;
|
327 |
border-style:solid !important;
|
@@ -370,217 +326,161 @@ error a
|
|
370 |
margin-right:20px !important;
|
371 |
}
|
372 |
</style>";
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
{
|
377 |
-
|
378 |
-
}
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
{
|
394 |
-
return $content;
|
395 |
-
}
|
396 |
-
}
|
397 |
-
else
|
398 |
-
{
|
399 |
-
return $content;
|
400 |
-
}
|
401 |
}
|
402 |
|
403 |
-
|
404 |
-
add_filter('the_content', 'print_massage');
|
405 |
-
|
406 |
-
|
407 |
///////////////////////////// FORNT END FUNCTION
|
408 |
//// add front end
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
//// add editor new mce button
|
413 |
add_filter('mce_external_plugins', "Form_Maker_register");
|
414 |
add_filter('mce_buttons', 'Form_Maker_add_button', 0);
|
415 |
-
|
416 |
/// function for add new button
|
417 |
-
function Form_Maker_add_button($buttons)
|
418 |
-
|
419 |
-
|
420 |
-
return $buttons;
|
421 |
-
}
|
422 |
-
/// function for registr new button
|
423 |
-
function Form_Maker_register($plugin_array)
|
424 |
-
{
|
425 |
-
$url = plugins_url( 'js/editor_plugin.js' , __FILE__ );
|
426 |
-
$plugin_array["Form_Maker_mce"] = $url;
|
427 |
-
return $plugin_array;
|
428 |
}
|
429 |
|
|
|
|
|
|
|
|
|
|
|
|
|
430 |
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
function add_button_style1()
|
441 |
-
{
|
442 |
-
echo '<style type="text/css">
|
443 |
-
.wp_themeSkin span.mce_Form_Maker_mce {background:url('.plugins_url( 'images/formmakerLogo.png' , __FILE__ ).') no-repeat !important;}
|
444 |
.wp_themeSkin .mceButtonEnabled:hover span.mce_Form_Maker_mce,.wp_themeSkin .mceButtonActive span.mce_Form_Maker_mce
|
445 |
-
{background:url('.plugins_url(
|
446 |
</style>';
|
447 |
}
|
448 |
|
449 |
add_action('admin_head', 'add_button_style1');
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
add_action('admin_menu', 'Form_maker_options_panel');
|
458 |
-
function Form_maker_options_panel(){
|
459 |
-
|
460 |
add_menu_page('Theme page title', 'Form Maker', 'manage_options', 'Form_maker', 'Manage_Form_maker', $icon_url);
|
461 |
-
$page_form= add_submenu_page(
|
462 |
-
$page_submits=add_submenu_page(
|
463 |
-
add_submenu_page(
|
464 |
-
add_submenu_page(
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
wp_enqueue_script("f_calendar",plugins_url("js/calendar.js",__FILE__));
|
489 |
-
wp_enqueue_script("f_calendar_functions",plugins_url("js/calendar_function.js",__FILE__));
|
490 |
-
wp_enqueue_script("f_calendar_setup",plugins_url("js/calendar-setup.js",__FILE__));
|
491 |
-
wp_enqueue_style("calendar-jos",plugins_url("js/calendar-jos.css",__FILE__));
|
492 |
}
|
493 |
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
|
|
548 |
}
|
549 |
|
550 |
-
|
551 |
-
|
552 |
///////////////////////////////////////// add ajax for form maker functionaliti
|
553 |
-
|
554 |
-
|
555 |
-
require_once("form_ajax_functions.php"); //////////// include form ajax functions for next 4 ajax hooks
|
556 |
-
|
557 |
add_action('wp_ajax_formmakergeneretexml', 'form_maker_generete_xml'); ///export xml
|
558 |
add_action('wp_ajax_formmakergeneretecsv', 'form_maker_generete_csv'); ///export csv
|
559 |
add_action('wp_ajax_formmakerwdcaptcha', 'form_maker_wd_captcha'); /// generete captcha image and save it code in session
|
560 |
add_action('wp_ajax_formmakerwindow', 'form_maker_window_php'); /// openid window in post or page for editor
|
561 |
-
|
562 |
add_action('wp_ajax_nopriv_formmakergeneretexml', 'form_maker_generete_xml'); ///export xml
|
563 |
add_action('wp_ajax_nopriv_formmakergeneretecsv', 'form_maker_generete_csv'); ///export csv
|
564 |
add_action('wp_ajax_nopriv_formmakerwdcaptcha', 'form_maker_wd_captcha'); /// generete captcha image and save it code in session
|
565 |
add_action('wp_ajax_nopriv_formmakerwindow', 'form_maker_window_php'); /// openid window in post or page for editor
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
////////////////////////////////////////////
|
573 |
//////////////////////////////////////////// manager
|
574 |
////////////////////////////////////////////
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
add_action('wp_ajax_fromeditcountryinpopup', 'spider_form_country_edit');
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
function spider_form_country_edit() {
|
585 |
if (function_exists('current_user_can')) {
|
586 |
if (!current_user_can('manage_options')) {
|
@@ -590,32 +490,32 @@ function spider_form_country_edit() {
|
|
590 |
else {
|
591 |
die('Access Denied');
|
592 |
}
|
593 |
-
|
594 |
-
$id = (int)
|
595 |
}
|
596 |
-
|
597 |
echo "<h2>error cannot get fild id</h2>";
|
598 |
return;
|
599 |
-
|
600 |
-
|
601 |
}
|
602 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
603 |
|
604 |
-
function html_spider_form_country_edit($id){
|
605 |
|
606 |
-
|
607 |
-
wp_print_scripts( 'jquery-ui-core');
|
608 |
-
wp_print_scripts( 'jquery-ui-widget');
|
609 |
-
wp_print_scripts( 'jquery-ui-mouse');
|
610 |
-
wp_print_scripts( 'jquery-ui-slider');
|
611 |
-
wp_print_scripts( 'jquery-ui-sortable');
|
612 |
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
<
|
617 |
-
|
618 |
-
<img alt="CANCEL" title="cancel" style=" cursor:pointer; vertical-align:middle; margin:5px; " src="<?php echo plugins_url('images/cancel_but.png',__FILE__); ?>" onclick="window.parent.tb_remove();">
|
619 |
</span>
|
620 |
<button onclick="select_all()">Select all</button>
|
621 |
<button onclick="remove_all()">Remove all</button>
|
@@ -625,346 +525,213 @@ wp_print_scripts( 'jquery-ui-sortable');
|
|
625 |
<script>
|
626 |
|
627 |
|
628 |
-
selec_coutries=[];
|
629 |
|
630 |
-
coutries=["","Afghanistan","Albania",
|
631 |
|
632 |
-
select_=window.parent.document.getElementById('<?php echo $id ?>_elementform_id_temp');
|
633 |
-
n=select_.childNodes.length;
|
634 |
-
for(i=0; i<n; i++)
|
635 |
-
{
|
636 |
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
var p = document.createElement('span');
|
647 |
-
p.style.cssText ="color:#000000; font-size: 13px; cursor:move";
|
648 |
-
p.innerHTML=select_.childNodes[i].value;
|
649 |
-
|
650 |
-
var li = document.createElement('li');
|
651 |
-
li.style.cssText ="margin:3px; vertical-align:middle";
|
652 |
-
li.id=i;
|
653 |
-
|
654 |
-
li.appendChild(ch);
|
655 |
-
li.appendChild(p);
|
656 |
-
|
657 |
-
document.getElementById('countries_list').appendChild(li);
|
658 |
-
}
|
659 |
-
cur=i;
|
660 |
-
m=coutries.length;
|
661 |
-
for(i=0; i<m; i++)
|
662 |
-
{
|
663 |
-
isin=isValueInArray(selec_coutries, coutries[i]);
|
664 |
-
|
665 |
-
if(!isin)
|
666 |
-
{
|
667 |
-
var ch = document.createElement('input');
|
668 |
-
ch.setAttribute("type","checkbox");
|
669 |
-
ch.value=coutries[i];
|
670 |
-
ch.id=cur+"ch";
|
671 |
-
|
672 |
-
|
673 |
-
var p = document.createElement('span');
|
674 |
-
p.style.cssText ="color:#000000; font-size: 13px; cursor:move";
|
675 |
-
p.innerHTML=coutries[i];
|
676 |
-
|
677 |
-
var li = document.createElement('li');
|
678 |
-
li.style.cssText ="margin:3px; vertical-align:middle";
|
679 |
-
li.id=cur;
|
680 |
-
|
681 |
-
li.appendChild(ch);
|
682 |
-
li.appendChild(p);
|
683 |
-
|
684 |
-
document.getElementById('countries_list').appendChild(li);
|
685 |
-
cur++;
|
686 |
-
}
|
687 |
-
}
|
688 |
-
jQuery(function() {
|
689 |
-
jQuery( "#countries_list" ).sortable();
|
690 |
-
jQuery( "#countries_list" ).disableSelection();
|
691 |
-
});
|
692 |
-
|
693 |
-
function isValueInArray(arr, val) {
|
694 |
-
inArray = false;
|
695 |
-
for (x = 0; x < arr.length; x++)
|
696 |
-
if (val == arr[x])
|
697 |
-
inArray = true;
|
698 |
-
return inArray;
|
699 |
-
}
|
700 |
-
function save_list()
|
701 |
-
{
|
702 |
-
select_.innerHTML=""
|
703 |
-
ul=document.getElementById('countries_list');
|
704 |
-
n=ul.childNodes.length;
|
705 |
-
for(i=0; i<n; i++)
|
706 |
-
{
|
707 |
-
if(ul.childNodes[i].tagName=="LI")
|
708 |
-
{
|
709 |
-
id=ul.childNodes[i].id;
|
710 |
-
if(document.getElementById(id+'ch').checked)
|
711 |
-
{
|
712 |
-
var option_ = document.createElement('option');
|
713 |
-
option_.setAttribute("value", document.getElementById(id+'ch').value);
|
714 |
-
option_.innerHTML=document.getElementById(id+'ch').value;
|
715 |
-
|
716 |
-
select_.appendChild(option_);
|
717 |
-
}
|
718 |
-
|
719 |
-
}
|
720 |
-
|
721 |
-
|
722 |
-
}
|
723 |
-
window.parent.tb_remove();
|
724 |
|
725 |
|
726 |
-
|
|
|
|
|
727 |
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
{
|
732 |
-
document.getElementById(i+'ch').checked=true;;
|
733 |
-
}
|
734 |
-
}
|
735 |
|
736 |
-
|
737 |
-
|
738 |
-
for(i=0; i<194; i++)
|
739 |
-
{
|
740 |
-
document.getElementById(i+'ch').checked=false;;
|
741 |
-
}
|
742 |
-
}
|
743 |
-
</script>
|
744 |
|
|
|
|
|
|
|
|
|
|
|
|
|
745 |
|
|
|
|
|
|
|
|
|
|
|
746 |
|
747 |
|
748 |
-
|
|
|
|
|
749 |
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
755 |
|
|
|
|
|
756 |
|
|
|
757 |
|
758 |
|
759 |
-
|
760 |
-
|
761 |
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
break;
|
873 |
-
|
874 |
-
case "Save_Edit_JavaScript" :
|
875 |
-
Apply_Edit_JavaScript($id);
|
876 |
-
edit_form_maker($id);
|
877 |
-
break;
|
878 |
-
|
879 |
-
case "Apply_Edit_JavaScript" :
|
880 |
-
Apply_Edit_JavaScript($id);
|
881 |
-
Edit_JavaScript($id);
|
882 |
-
break;
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
// Custom_text_in_email_for_administrator
|
891 |
-
case "Custom_text_in_email_for_administrator" :
|
892 |
-
if($id){
|
893 |
-
apply_form($id);
|
894 |
-
}
|
895 |
-
else
|
896 |
-
{
|
897 |
-
save_form();
|
898 |
-
$id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
|
899 |
-
}
|
900 |
-
Custom_text_in_email_for_administrator($id);
|
901 |
-
break;
|
902 |
-
|
903 |
-
case "Save_Custom_text_in_email_for_administrator" :
|
904 |
-
Apply_Custom_text_in_email_for_administrator($id);
|
905 |
-
edit_form_maker($id);
|
906 |
-
break;
|
907 |
-
|
908 |
-
case "Apply_Custom_text_in_email_for_administrator" :
|
909 |
-
Apply_Custom_text_in_email_for_administrator($id);
|
910 |
-
Custom_text_in_email_for_administrator($id);
|
911 |
-
break;
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
// Custom text in email for user
|
924 |
-
case "Custom_text_in_email_for_user" :
|
925 |
-
if($id){
|
926 |
-
apply_form($id);
|
927 |
-
}
|
928 |
-
else
|
929 |
-
{
|
930 |
-
save_form();
|
931 |
-
$id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
|
932 |
-
}
|
933 |
-
Custom_text_in_email_for_user($id);
|
934 |
-
break;
|
935 |
-
|
936 |
-
case "Save_Custom_text_in_email_for_user" :
|
937 |
-
Apply_Custom_text_in_email_for_user($id);
|
938 |
-
edit_form_maker($id);
|
939 |
-
break;
|
940 |
-
|
941 |
-
case "Apply_Custom_text_in_email_for_user" :
|
942 |
-
Apply_Custom_text_in_email_for_user($id);
|
943 |
-
Custom_text_in_email_for_user($id);
|
944 |
-
break;
|
945 |
-
case "save_as_copy":
|
946 |
-
save_as_copy();
|
947 |
-
display_form_lists();
|
948 |
-
break;
|
949 |
-
default:
|
950 |
-
display_form_lists();
|
951 |
-
}
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
}
|
958 |
|
959 |
////////////////////////////////////////////
|
960 |
//////////////////////////////////////////// Submi
|
961 |
////////////////////////////////////////////
|
962 |
-
|
963 |
////map in spubmits
|
964 |
-
|
965 |
-
|
966 |
add_action('wp_ajax_frommapeditinpopup', 'spider_form_map_edit');
|
967 |
-
|
968 |
function spider_form_map_edit() {
|
969 |
if (function_exists('current_user_can')) {
|
970 |
if (!current_user_can('manage_options')) {
|
@@ -974,446 +741,412 @@ function spider_form_map_edit() {
|
|
974 |
else {
|
975 |
die('Access Denied');
|
976 |
}
|
977 |
-
|
978 |
$long = esc_html($_GET['long']);
|
979 |
$lat = esc_html($_GET['lat']);
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
<table style="margin:0px; padding:0px">
|
985 |
-
<tr><td><b>Address:</b></td><td><input type="text" id="addrval0" style="border:0px; background:none" size="80" readonly /> </td></tr>
|
986 |
-
<tr><td><b>Longitude:</b></td> <td><input type="text" id="longval0" style="border:0px; background:none" size="80" readonly /> </td></tr>
|
987 |
-
<tr><td><b>Latitude:</b></td><td><input type="text" id="latval0" style="border:0px; background:none" size="80" readonly /> </td></tr>
|
988 |
-
</table>
|
989 |
-
|
990 |
-
<div id="0_elementform_id_temp" long="<?php echo $long ?>" center_x="<?php echo $long ?>" center_y="<?php echo $lat ?>" lat="<?php echo $lat ?>" zoom="8" info="" style="width:600px; height:500px; "></div>
|
991 |
|
992 |
-
<
|
993 |
-
|
994 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
995 |
|
|
|
|
|
|
|
996 |
|
997 |
-
|
|
|
|
|
998 |
|
999 |
-
<?php
|
1000 |
|
|
|
1001 |
|
1002 |
-
|
1003 |
-
|
1004 |
-
}
|
1005 |
-
else{
|
1006 |
-
return 0;
|
1007 |
-
}
|
1008 |
-
|
1009 |
-
}
|
1010 |
|
1011 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1012 |
/////////////////////////////////////////////////////////////////////////////////////
|
1013 |
/////////////////////////////////////////////////////////////////////////////////// priview form
|
1014 |
///////////////////////////////////////////////////////////////////////////////////
|
1015 |
///////////////////////////////////////////////////////////////////////////////////
|
1016 |
-
|
1017 |
add_action('wp_ajax_frommakerpreview', 'preview_formmaker');
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
$cmpnt_js_path =plugins_url('js',__FILE__);
|
1031 |
-
$id='form_id_temp';
|
1032 |
-
?>
|
1033 |
-
<script src="<?php echo $cmpnt_js_path."/if_gmap.js"; ?>"></script>
|
1034 |
-
<script src="<?php echo $cmpnt_js_path."/main.js"; ?>"></script>
|
1035 |
<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
|
1036 |
<style>
|
1037 |
-
<?php
|
1038 |
-
$cmpnt_js_path =plugins_url('',__FILE__);
|
1039 |
-
|
1040 |
|
1041 |
-
?>
|
1042 |
</style>
|
1043 |
<div id="form_id_temppages" class="wdform_page_navigation" show_title="" show_numbers="" type=""></div>
|
1044 |
|
1045 |
-
|
1046 |
-
<input type="hidden" id="counter<?php echo $id ?>" value="" name="counter<?php echo $id ?>"
|
1047 |
|
1048 |
<script>
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
}
|
1066 |
-
}
|
1067 |
-
|
1068 |
-
refresh_first();
|
1069 |
-
|
1070 |
-
|
1071 |
-
if(form_view_count<?php echo $id ?>>1)
|
1072 |
-
{
|
1073 |
-
for(i=1; i<=form_view_max<?php echo $id ?>; i++)
|
1074 |
-
{
|
1075 |
-
if(document.getElementById('<?php echo $id ?>form_view'+i))
|
1076 |
-
{
|
1077 |
-
first_form_view<?php echo $id ?>=i;
|
1078 |
-
break;
|
1079 |
-
}
|
1080 |
-
}
|
1081 |
-
|
1082 |
-
generate_page_nav(first_form_view<?php echo $id ?>, '<?php echo $id ?>', form_view_count<?php echo $id ?>, form_view_max<?php echo $id ?>);
|
1083 |
-
}
|
1084 |
-
|
1085 |
-
|
1086 |
-
function remove_add_(id)
|
1087 |
-
{
|
1088 |
-
attr_name= new Array();
|
1089 |
-
attr_value= new Array();
|
1090 |
-
var input = document.getElementById(id);
|
1091 |
-
atr=input.attributes;
|
1092 |
-
for(v=0;v<30;v++)
|
1093 |
-
if(atr[v] )
|
1094 |
-
{
|
1095 |
-
if(atr[v].name.indexOf("add_")==0)
|
1096 |
-
{
|
1097 |
-
attr_name.push(atr[v].name.replace('add_',''));
|
1098 |
-
attr_value.push(atr[v].value);
|
1099 |
-
input.removeAttribute(atr[v].name);
|
1100 |
-
v--;
|
1101 |
-
}
|
1102 |
-
}
|
1103 |
-
for(v=0;v<attr_name.length; v++)
|
1104 |
-
{
|
1105 |
-
input.setAttribute(attr_name[v],attr_value[v])
|
1106 |
-
}
|
1107 |
}
|
1108 |
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
1210 |
-
|
1211 |
-
|
1212 |
-
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
1236 |
-
|
1237 |
-
|
1238 |
-
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
-
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
-
|
1247 |
-
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
|
1278 |
-
|
1279 |
-
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
|
1320 |
-
|
1321 |
-
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
|
1345 |
-
|
1346 |
-
|
1347 |
-
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
|
1375 |
-
|
1376 |
-
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
|
1398 |
-
|
1399 |
-
|
1400 |
-
|
1401 |
-
|
1402 |
-
|
1403 |
-
|
1404 |
-
|
1405 |
-
|
1406 |
-
|
1407 |
-
|
1408 |
-
|
1409 |
-
|
|
|
|
|
|
|
|
|
|
|
1410 |
}
|
1411 |
|
1412 |
|
1413 |
</script>
|
1414 |
-
<?php
|
1415 |
-
die();
|
1416 |
}
|
|
|
1417 |
function preview_formmaker() {
|
1418 |
if (function_exists('current_user_can')) {
|
1419 |
if (!current_user_can('manage_options')) {
|
@@ -1423,364 +1156,286 @@ function preview_formmaker() {
|
|
1423 |
else {
|
1424 |
die('Access Denied');
|
1425 |
}
|
1426 |
-
|
1427 |
-
|
1428 |
-
|
1429 |
}
|
1430 |
else {
|
1431 |
$getparams = 0;
|
1432 |
}
|
1433 |
-
|
1434 |
-
|
1435 |
-
|
1436 |
}
|
1437 |
|
1438 |
-
|
1439 |
-
|
1440 |
-
|
1441 |
-
|
1442 |
-
|
1443 |
-
|
1444 |
-
|
1445 |
-
|
1446 |
-
|
1447 |
-
|
1448 |
-
|
1449 |
-
|
1450 |
//////////////////////////////////////////////////////////////////////////////////////
|
1451 |
//////////////////////////////////////////////////////////////////////////////////
|
1452 |
///////////////////////////////////////////////////////////////////////////////
|
1453 |
///////////////////////////////////////////////////////////////////////////////
|
1454 |
/////////////////////////////////////////////////////////////////////////////////
|
1455 |
-
|
1456 |
-
|
1457 |
-
|
1458 |
-
|
1459 |
-
|
1460 |
-
|
1461 |
-
|
1462 |
-
|
1463 |
-
|
1464 |
-
|
1465 |
-
|
1466 |
-
|
1467 |
-
|
1468 |
-
|
1469 |
-
|
1470 |
-
|
1471 |
-
|
1472 |
-
|
1473 |
-
|
1474 |
-
|
1475 |
-
|
1476 |
-
|
1477 |
-
|
1478 |
-
|
1479 |
-
|
1480 |
-
|
1481 |
-
|
1482 |
-
|
1483 |
-
|
1484 |
-
|
1485 |
-
|
1486 |
-
|
1487 |
-
|
1488 |
-
|
1489 |
-
|
1490 |
-
|
1491 |
-
|
1492 |
-
|
1493 |
-
|
1494 |
-
|
1495 |
-
|
1496 |
-
|
1497 |
-
|
1498 |
-
|
1499 |
-
|
1500 |
-
|
1501 |
-
|
1502 |
-
case "cancel" :
|
1503 |
-
show_submits();
|
1504 |
-
break;
|
1505 |
-
|
1506 |
-
|
1507 |
-
default:
|
1508 |
-
show_submits();
|
1509 |
-
}
|
1510 |
-
|
1511 |
-
|
1512 |
-
|
1513 |
-
|
1514 |
-
|
1515 |
-
|
1516 |
-
|
1517 |
-
}
|
1518 |
-
function Form_maker_Themes(){
|
1519 |
-
|
1520 |
-
require_once("Theme_functions.php");
|
1521 |
-
require_once("Themes_function.html.php");
|
1522 |
-
if(!function_exists('print_html_nav'))
|
1523 |
-
require_once("nav_function/nav_html_func.php");
|
1524 |
-
global $wpdb;
|
1525 |
-
if (isset($_GET["task"])) {
|
1526 |
-
$task = esc_html($_GET["task"]);
|
1527 |
-
}
|
1528 |
-
else {
|
1529 |
-
$task = "";
|
1530 |
-
}
|
1531 |
-
if (isset($_GET["id"])) {
|
1532 |
-
$id = (int) $_GET["id"];
|
1533 |
-
}
|
1534 |
-
else {
|
1535 |
-
$id = 0;
|
1536 |
-
}
|
1537 |
-
switch($task){
|
1538 |
-
case 'theme':
|
1539 |
-
show_theme();
|
1540 |
-
break;
|
1541 |
-
case 'default':
|
1542 |
-
default_theme($id);
|
1543 |
-
show_theme();
|
1544 |
-
break;
|
1545 |
-
|
1546 |
-
case 'add_theme':
|
1547 |
-
add_theme();
|
1548 |
-
break;
|
1549 |
-
|
1550 |
-
case 'Save':
|
1551 |
-
if($id)
|
1552 |
-
{
|
1553 |
-
apply_theme($id);
|
1554 |
-
}
|
1555 |
-
else
|
1556 |
-
{
|
1557 |
-
save_theme();
|
1558 |
-
}
|
1559 |
-
|
1560 |
-
show_theme();
|
1561 |
-
break;
|
1562 |
-
|
1563 |
-
case 'Apply':
|
1564 |
-
if($id)
|
1565 |
-
{
|
1566 |
-
apply_theme($id);
|
1567 |
-
}
|
1568 |
-
else
|
1569 |
-
{
|
1570 |
-
save_theme();
|
1571 |
-
$id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker_themes");
|
1572 |
-
}
|
1573 |
-
|
1574 |
-
edit_theme($id);
|
1575 |
-
break;
|
1576 |
-
|
1577 |
-
case 'edit_theme':
|
1578 |
-
edit_theme($id);
|
1579 |
-
break;
|
1580 |
-
|
1581 |
-
case 'remove_theme':
|
1582 |
-
remove_theme($id);
|
1583 |
-
show_theme();
|
1584 |
-
break;
|
1585 |
-
default:
|
1586 |
-
show_theme();
|
1587 |
-
}
|
1588 |
-
|
1589 |
-
|
1590 |
-
|
1591 |
-
|
1592 |
-
}
|
1593 |
-
|
1594 |
-
|
1595 |
-
|
1596 |
-
|
1597 |
-
function Uninstall_Form_Maker()
|
1598 |
-
{
|
1599 |
-
|
1600 |
-
global $wpdb;
|
1601 |
-
$base_name = plugin_basename('Form_maker');
|
1602 |
-
$base_page = 'admin.php?page='.$base_name;
|
1603 |
-
if (isset($_GET['mode'])) {
|
1604 |
-
$mode = trim(esc_html($_GET['mode']));
|
1605 |
-
}
|
1606 |
-
|
1607 |
-
if(!empty($_POST['do'])) {
|
1608 |
-
|
1609 |
-
if (esc_html($_POST['do']) == "UNINSTALL Form Maker") {
|
1610 |
-
check_admin_referer('Form Maker_uninstall');
|
1611 |
-
if(trim(esc_html($_POST['uninstall_Form_yes'])) == 'yes') {
|
1612 |
-
|
1613 |
-
if((get_option('contact_form_forms',false) || get_option('contact_form_forms',false)!='') && get_option('contact_form_themes',false) || get_option('contact_form_themes',false)!=''){
|
1614 |
-
|
1615 |
-
echo '<div id="message" class="updated fade">';
|
1616 |
-
echo '<p>';
|
1617 |
-
echo "Table 'formmaker' has been deleted.";
|
1618 |
-
$wpdb->query("DELETE FROM ".$wpdb->prefix."formmaker WHERE `id` NOT IN (".get_option('contact_form_forms').")");
|
1619 |
-
echo '<font style="color:#000;">';
|
1620 |
-
echo '</font><br />';
|
1621 |
-
echo '</p>';
|
1622 |
-
echo '<p>';
|
1623 |
-
echo "Table 'formmaker_submits' has been deleted.";
|
1624 |
-
$wpdb->query("DELETE FROM ".$wpdb->prefix."formmaker_submits WHERE `form_id` NOT IN (".get_option('contact_form_forms').")");
|
1625 |
-
echo '<font style="color:#000;">';
|
1626 |
-
echo '</font><br />';
|
1627 |
-
echo '</p>';
|
1628 |
-
echo '<p>';
|
1629 |
-
echo "Table 'formmaker_views' has been deleted.";
|
1630 |
-
$wpdb->query("DELETE FROM ".$wpdb->prefix."formmaker_views WHERE `form_id` NOT IN (".get_option('contact_form_forms').")");
|
1631 |
-
echo '<font style="color:#000;">';
|
1632 |
-
echo '</font><br />';
|
1633 |
-
echo '</p>';
|
1634 |
-
echo '<p>';
|
1635 |
-
echo "Table 'formmaker_themes' has been deleted.";
|
1636 |
-
$wpdb->query("DELETE FROM ".$wpdb->prefix."formmaker_themes WHERE `id` NOT IN (".get_option('contact_form_themes').")");
|
1637 |
-
echo '<font style="color:#000;">';
|
1638 |
-
echo '</font><br />';
|
1639 |
-
echo '</p>';
|
1640 |
-
echo '</div>';
|
1641 |
-
|
1642 |
-
|
1643 |
-
}
|
1644 |
-
else{
|
1645 |
-
|
1646 |
-
|
1647 |
-
echo '<div id="message" class="updated fade">';
|
1648 |
-
echo '<p>';
|
1649 |
-
echo "Table 'formmaker' has been deleted.";
|
1650 |
-
$wpdb->query("DROP TABLE ".$wpdb->prefix."formmaker");
|
1651 |
-
echo '<font style="color:#000;">';
|
1652 |
-
echo '</font><br />';
|
1653 |
-
echo '</p>';
|
1654 |
-
echo '<p>';
|
1655 |
-
echo "Table 'formmaker_submits' has been deleted.";
|
1656 |
-
$wpdb->query("DROP TABLE ".$wpdb->prefix."formmaker_submits");
|
1657 |
-
echo '<font style="color:#000;">';
|
1658 |
-
echo '</font><br />';
|
1659 |
-
echo '</p>';
|
1660 |
-
echo '<p>';
|
1661 |
-
echo "Table 'formmaker_views' has been deleted.";
|
1662 |
-
$wpdb->query("DROP TABLE ".$wpdb->prefix."formmaker_views");
|
1663 |
-
echo '<font style="color:#000;">';
|
1664 |
-
echo '</font><br />';
|
1665 |
-
echo '</p>';
|
1666 |
-
echo '<p>';
|
1667 |
-
echo "Table 'formmaker_themes' has been deleted.";
|
1668 |
-
$wpdb->query("DROP TABLE ".$wpdb->prefix."formmaker_themes");
|
1669 |
-
echo '<font style="color:#000;">';
|
1670 |
-
echo '</font><br />';
|
1671 |
-
echo '</p>';
|
1672 |
-
echo '</div>';
|
1673 |
-
}
|
1674 |
-
$mode = 'end-UNINSTALL';
|
1675 |
-
|
1676 |
-
}
|
1677 |
-
}
|
1678 |
-
}
|
1679 |
-
|
1680 |
-
|
1681 |
-
if(!isset($mode))
|
1682 |
-
$mode='';
|
1683 |
-
switch($mode) {
|
1684 |
-
|
1685 |
-
case 'end-UNINSTALL':
|
1686 |
-
$deactivate_url = wp_nonce_url('plugins.php?action=deactivate&plugin='.plugin_basename(__FILE__), 'deactivate-plugin_'.plugin_basename(__FILE__)).'&form_maker_uninstall=1';
|
1687 |
-
echo '<div class="wrap">';
|
1688 |
-
echo '<div id="icon-Form_maker" class="icon32"><br /></div>';
|
1689 |
-
echo '<h2>Uninstall Form Maker</h2>';
|
1690 |
-
echo '<p><strong>'.sprintf('<a href="%s">Click Here</a> To Finish The Uninstallation And Form Maker Will Be Deactivated Automatically.', $deactivate_url).'</strong></p>';
|
1691 |
-
echo '</div>';
|
1692 |
-
break;
|
1693 |
-
// Main Page
|
1694 |
-
default:
|
1695 |
-
?>
|
1696 |
-
<form method="post" action="<?php echo admin_url('admin.php?page=Uninstall_Form_Maker'); ?>">
|
1697 |
-
<?php wp_nonce_field('Form Maker_uninstall'); ?>
|
1698 |
-
<div class="wrap">
|
1699 |
-
<div id="icon-Form_maker" class="icon32"><br /></div>
|
1700 |
-
<h2><?php echo 'Uninstall Form Maker'; ?></h2>
|
1701 |
-
<p>
|
1702 |
-
<?php echo 'Deactivating Form Maker plugin does not remove any data that may have been created, such as the Forms and the Submissions. To completely remove this plugin, you can uninstall it here.'; ?>
|
1703 |
-
</p>
|
1704 |
-
<p style="color: red">
|
1705 |
-
<strong><?php echo'WARNING:'; ?></strong><br />
|
1706 |
-
<?php echo 'Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first.'; ?>
|
1707 |
-
</p>
|
1708 |
-
<p style="color: red">
|
1709 |
-
<strong><?php echo 'The following WordPress Options/Tables will be DELETED:'; ?></strong><br />
|
1710 |
-
</p>
|
1711 |
-
<table class="widefat">
|
1712 |
-
<thead>
|
1713 |
-
<tr>
|
1714 |
-
<th><?php echo 'WordPress Tables'; ?></th>
|
1715 |
-
</tr>
|
1716 |
-
</thead>
|
1717 |
-
<tr>
|
1718 |
-
<td valign="top">
|
1719 |
-
<ol>
|
1720 |
-
<?php
|
1721 |
-
echo '<li>formmaker</li>'."\n";
|
1722 |
-
echo '<li>formmaker_submits</li>'."\n";
|
1723 |
-
echo '<li>formmaker_views</li>'."\n";
|
1724 |
-
echo '<li>formmaker_themes</li>'."\n";
|
1725 |
-
|
1726 |
-
?>
|
1727 |
-
</ol>
|
1728 |
-
</td>
|
1729 |
-
</tr>
|
1730 |
-
</table>
|
1731 |
-
<p style="text-align: center;">
|
1732 |
-
<?php echo 'Do you really want to uninstall Form Maker?'; ?><br /><br />
|
1733 |
-
<input type="checkbox" name="uninstall_Form_yes" value="yes" /> <?php echo 'Yes'; ?><br /><br />
|
1734 |
-
<input type="submit" name="do" value="<?php echo 'UNINSTALL Form Maker'; ?>" class="button-primary" onclick="return confirm('<?php echo 'You Are About To Uninstall Form Maker From WordPress.\nThis Action Is Not Reversible.\n\n Choose [Cancel] To Stop, [OK] To Uninstall.'; ?>')" />
|
1735 |
-
</p>
|
1736 |
-
</div>
|
1737 |
-
</form>
|
1738 |
-
<?php
|
1739 |
-
} // End switch($mode)
|
1740 |
-
|
1741 |
-
}
|
1742 |
-
|
1743 |
-
|
1744 |
-
|
1745 |
-
require_once("update_sql.php");
|
1746 |
-
|
1747 |
-
|
1748 |
-
|
1749 |
-
|
1750 |
-
|
1751 |
-
function formmaker_activate()
|
1752 |
-
{
|
1753 |
-
include 'setup_sql.php';
|
1754 |
-
set_form_maker_sql();
|
1755 |
-
|
1756 |
}
|
1757 |
|
1758 |
-
|
1759 |
-
|
1760 |
-
|
1761 |
-
|
1762 |
-
|
1763 |
-
|
1764 |
-
|
1765 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1766 |
}
|
1767 |
|
1768 |
-
|
1769 |
-
|
1770 |
-
|
1771 |
-
|
1772 |
-
|
1773 |
-
|
1774 |
-
|
1775 |
-
|
1776 |
-
|
1777 |
-
|
1778 |
-
|
1779 |
-
|
1780 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1781 |
delete_option('formmaker_cureent_version');
|
1782 |
-
|
1783 |
-
|
1784 |
}
|
1785 |
|
1786 |
-
register_deactivation_hook(
|
2 |
/*
|
3 |
Plugin Name: Form Maker
|
4 |
Plugin URI: http://web-dorado.com/products/form-maker-wordpress.html
|
5 |
+
Version: 1.5.4
|
6 |
Author: http://web-dorado.com/
|
7 |
License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
8 |
*/
|
|
|
9 |
//// load languages
|
10 |
///////////////////////////////////////////////////////////////////////////////////////////////////////////////// css
|
|
|
|
|
|
|
11 |
$first_css = ".wdform_table1
|
12 |
{
|
13 |
font-size:14px;
|
120 |
padding: 0px;
|
121 |
vertical-align:middle;
|
122 |
cursor:pointer;
|
123 |
+
background-image: url(" . plugins_url('images/refresh_black.png', __FILE__) . ");
|
124 |
}
|
125 |
|
126 |
.captcha_input
|
198 |
{
|
199 |
width:100px;
|
200 |
}";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
//////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
require_once("front_end_form_maker.php");
|
203 |
require_once("form_maker_widget.php");
|
204 |
require_once('recaptchalib.php');
|
205 |
+
add_action('init', 'form_maker_language_load');
|
|
|
|
|
206 |
function form_maker_language_load() {
|
207 |
+
load_plugin_textdomain('form_maker', FALSE, basename(dirname(__FILE__)) . '/languages');
|
208 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
|
210 |
+
function form_maker_sesseion_path() {
|
211 |
+
@session_start();
|
212 |
+
session_save_path(ABSPATH . 'wp-content/plugins/form-maker');
|
213 |
+
}
|
214 |
+
add_action('init', 'form_maker_sesseion_path');
|
215 |
|
216 |
+
function do_output_buffer() {
|
217 |
+
ob_start();
|
218 |
+
}
|
219 |
+
add_action('init', 'do_output_buffer');
|
220 |
|
221 |
+
////////////////
|
222 |
+
for ($ii = 0; $ii < 100; $ii++) {
|
223 |
+
remove_filter('the_content', 'do_shortcode', $ii);
|
224 |
+
remove_filter('the_content', 'wpautop', $ii);
|
225 |
+
}
|
226 |
+
add_filter('the_content', 'wpautop', 10);
|
227 |
+
add_filter('the_content', 'do_shortcode', 11);
|
228 |
+
add_filter('the_content', 'Form_maker_fornt_end_main', 5000);
|
229 |
+
function Form_maker_fornt_end_main($content) {
|
230 |
+
$pattern = '[\[Form id="([0-9]*)"\]]';
|
231 |
+
$count_forms_in_post = preg_match_all($pattern, $content, $matches_form);
|
232 |
+
for ($jj = 0; $jj < $count_forms_in_post; $jj++) {
|
233 |
+
$padron = $matches_form[0][$jj];
|
234 |
+
$replacment = form_maker_front_end($matches_form[1][$jj]);
|
235 |
+
$content = str_replace($padron, $replacment, $content);
|
236 |
+
}
|
237 |
+
return $content;
|
238 |
+
}
|
239 |
|
240 |
function form_maker_scripts_method() {
|
241 |
+
wp_enqueue_style("gmap_styles_", plugins_url("css/style_for_map.css", __FILE__), FALSE);
|
242 |
+
wp_enqueue_script("main_g_js", plugins_url("js/main_front_end.js", __FILE__), FALSE);
|
243 |
+
wp_enqueue_script("Calendar", plugins_url("js/calendar.js", __FILE__), FALSE);
|
244 |
+
wp_enqueue_script("calendar-setup", plugins_url("js/calendar-setup.js", __FILE__), FALSE);
|
245 |
+
wp_enqueue_script("calendar_function", plugins_url("js/calendar_function.js", __FILE__), FALSE);
|
246 |
+
wp_enqueue_style("Css", plugins_url("js/calendar-jos.css", __FILE__), FALSE);
|
247 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
248 |
|
249 |
+
add_action('wp_enqueue_scripts', 'form_maker_scripts_method');
|
250 |
///////////////////////////// FORNT END Print message
|
251 |
+
$check_seo = 0;
|
252 |
+
function print_massage($content) {
|
253 |
+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
254 |
+
if (is_plugin_active('wordpress-seo/wp-seo.php') && $_SESSION['form_submit_type']) {
|
255 |
+
global $check_seo;
|
256 |
+
if ($check_seo++ != 1) {
|
257 |
+
return;
|
258 |
+
}
|
259 |
+
}
|
260 |
+
$mh_after_head = did_action('wp_enqueue_scripts');
|
261 |
+
if ($mh_after_head == 1) {
|
262 |
+
global $wpdb;
|
263 |
+
@session_start();
|
264 |
+
if (isset($_SESSION['form_submit_type']) && $_SESSION['form_submit_type']) {
|
265 |
+
$type_and_id = $_SESSION['form_submit_type'];
|
266 |
+
$type_and_id = explode(',', $type_and_id);
|
267 |
+
$form_get_type = $type_and_id[0];
|
268 |
+
$form_get_id = $type_and_id[1];
|
269 |
+
$_SESSION['form_submit_type'] = 0;
|
270 |
+
if ($form_get_type == 3) {
|
271 |
+
$_SESSION['massage_after_submit'] = "";
|
272 |
+
$row = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_get_id . "'");
|
273 |
+
return wpautop($row->submit_text);
|
274 |
+
}
|
275 |
+
}
|
276 |
+
if (isset($_SESSION['massage_after_submit'])) {
|
277 |
+
if ($_SESSION['massage_after_submit'] != "") {
|
278 |
+
$message = $_SESSION['massage_after_submit'];
|
279 |
+
$_SESSION['massage_after_submit'] = "";
|
280 |
+
$returned_content = " <style>
|
|
|
|
|
281 |
.updated,.error{
|
282 |
border-width:1px !important;
|
283 |
border-style:solid !important;
|
326 |
margin-right:20px !important;
|
327 |
}
|
328 |
</style>";
|
329 |
+
if ($_SESSION['error_or_no']) {
|
330 |
+
$error = 'error';
|
331 |
+
}
|
332 |
+
else {
|
333 |
+
$error = 'updated';
|
334 |
+
}
|
335 |
+
$returned_content .= "<div class=\"" . $error . "\" ><p><strong>" . $message . "</strong></p></div>" . $content; // modified content
|
336 |
+
return $returned_content;
|
337 |
+
}
|
338 |
+
else {
|
339 |
+
return $content;
|
340 |
+
}
|
341 |
+
}
|
342 |
+
else {
|
343 |
+
return $content;
|
344 |
+
}
|
345 |
+
}
|
346 |
+
else {
|
347 |
+
return $content;
|
348 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
349 |
}
|
350 |
|
351 |
+
add_filter('the_content', 'print_massage');
|
|
|
|
|
|
|
352 |
///////////////////////////// FORNT END FUNCTION
|
353 |
//// add front end
|
|
|
|
|
|
|
354 |
//// add editor new mce button
|
355 |
add_filter('mce_external_plugins', "Form_Maker_register");
|
356 |
add_filter('mce_buttons', 'Form_Maker_add_button', 0);
|
|
|
357 |
/// function for add new button
|
358 |
+
function Form_Maker_add_button($buttons) {
|
359 |
+
array_push($buttons, "Form_Maker_mce");
|
360 |
+
return $buttons;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
361 |
}
|
362 |
|
363 |
+
/// function for registr new button
|
364 |
+
function Form_Maker_register($plugin_array) {
|
365 |
+
$url = plugins_url('js/editor_plugin.js', __FILE__);
|
366 |
+
$plugin_array["Form_Maker_mce"] = $url;
|
367 |
+
return $plugin_array;
|
368 |
+
}
|
369 |
|
370 |
+
function add_button_style1() {
|
371 |
+
echo '<style type="text/css">
|
372 |
+
.wp_themeSkin span.mce_Form_Maker_mce {background:url(' . plugins_url('images/formmakerLogo.png', __FILE__) . ') no-repeat !important;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
373 |
.wp_themeSkin .mceButtonEnabled:hover span.mce_Form_Maker_mce,.wp_themeSkin .mceButtonActive span.mce_Form_Maker_mce
|
374 |
+
{background:url(' . plugins_url('images/formmakerLogoHover.png', __FILE__) . ') no-repeat !important;}
|
375 |
</style>';
|
376 |
}
|
377 |
|
378 |
add_action('admin_head', 'add_button_style1');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
379 |
add_action('admin_menu', 'Form_maker_options_panel');
|
380 |
+
function Form_maker_options_panel() {
|
381 |
+
$icon_url = plugins_url('images/FormMakerLogo-16.png', __FILE__);
|
382 |
add_menu_page('Theme page title', 'Form Maker', 'manage_options', 'Form_maker', 'Manage_Form_maker', $icon_url);
|
383 |
+
$page_form = add_submenu_page('Form_maker', 'Form Maker Manager', 'Manager', 'manage_options', 'Form_maker', 'Manage_Form_maker');
|
384 |
+
$page_submits = add_submenu_page('Form_maker', 'Form Maker submissions', 'Submissions', 'manage_options', 'Form_maker_Submits', 'Form_maker_Submits');
|
385 |
+
add_submenu_page('Form_maker', 'Licensing', 'Licensing', 'manage_options', 'form_maker_Licensing', 'form_maker_Licensing');
|
386 |
+
add_submenu_page('Form_maker', 'Form Maker Themes', 'Themes', 'manage_options', 'Form_maker_Themes', 'Form_maker_Themes');
|
387 |
+
add_submenu_page('Form_maker', 'Uninstall Form Maker ', 'Uninstall Form Maker', 'manage_options', 'Uninstall_Form_Maker', 'Uninstall_Form_Maker');
|
388 |
+
add_action('admin_print_styles-' . $page_form, 'form_maker_admin_styles_scripts');
|
389 |
+
add_action('admin_print_styles-' . $page_submits, 'form_maker_submits_styles_scripts');
|
390 |
+
}
|
391 |
+
|
392 |
+
function form_maker_Licensing() {
|
393 |
+
?>
|
394 |
+
<div style="width:95%">
|
395 |
+
<p>
|
396 |
+
This plugin is the non-commercial version of the Form Maker. Use of this plugin is free. You can add not more than 7 fields. The limitation is on the some types of the fields (File Upload, Map and Paypal). If you want to use those fields, you are required to purchase a license. </p>
|
397 |
+
<br/><br/>
|
398 |
+
<a href="http://web-dorado.com/files/fromFormMaker.php" class="button-primary" target="_blank">Purchase a
|
399 |
+
License</a>
|
400 |
+
<br/><br/><br/>
|
401 |
+
|
402 |
+
<p>After the purchasing the commercial version follow this steps:</p>
|
403 |
+
<ol>
|
404 |
+
<li>Deactivate Form Maker Plugin</li>
|
405 |
+
<li>Delete Form Maker Plugin</li>
|
406 |
+
<li>Install the downloaded commercial version of the plugin</li>
|
407 |
+
</ol>
|
408 |
+
</div>
|
409 |
+
<?php
|
|
|
|
|
|
|
|
|
410 |
}
|
411 |
|
412 |
+
function form_maker_submits_styles_scripts() {
|
413 |
+
wp_enqueue_script('word-count');
|
414 |
+
wp_enqueue_script('post');
|
415 |
+
wp_enqueue_script('editor');
|
416 |
+
wp_enqueue_script('media-upload');
|
417 |
+
wp_admin_css('thickbox');
|
418 |
+
wp_print_scripts('media-upload');
|
419 |
+
do_action('admin_print_styles');
|
420 |
+
wp_enqueue_script('common');
|
421 |
+
wp_enqueue_script('jquery-color');
|
422 |
+
wp_enqueue_script('utils');
|
423 |
+
wp_enqueue_script("mootools", plugins_url("js/mootools.js", __FILE__));
|
424 |
+
wp_enqueue_script("f_calendar", plugins_url("js/calendar.js", __FILE__));
|
425 |
+
wp_enqueue_script("f_calendar_functions", plugins_url("js/calendar_function.js", __FILE__));
|
426 |
+
wp_enqueue_script("f_calendar_setup", plugins_url("js/calendar-setup.js", __FILE__));
|
427 |
+
wp_enqueue_style("calendar-jos", plugins_url("js/calendar-jos.css", __FILE__));
|
428 |
+
}
|
429 |
+
|
430 |
+
function form_maker_admin_styles_scripts() {
|
431 |
+
if (isset($_GET['task'])) {
|
432 |
+
if (esc_html($_GET['task']) == "update" || esc_html($_GET['task']) == "save_update" || esc_html($_GET['task']) == "gotoedit" || esc_html($_GET['task']) == "add_form" || esc_html($_GET['task']) == "edit_form" || esc_html($_GET['task']) == "Save_Edit_JavaScript" || esc_html($_GET['task']) == "Save_Actions_after_submission" || esc_html($_GET['task']) == "Save_Custom_text_in_email_for_administrator" || esc_html($_GET['task']) == "Save_Custom_text_in_email_for_user") {
|
433 |
+
wp_enqueue_script('word-count');
|
434 |
+
wp_enqueue_script('post');
|
435 |
+
wp_enqueue_script('editor');
|
436 |
+
wp_enqueue_script('media-upload');
|
437 |
+
wp_admin_css('thickbox');
|
438 |
+
wp_print_scripts('media-upload');
|
439 |
+
do_action('admin_print_styles');
|
440 |
+
wp_enqueue_script('common');
|
441 |
+
wp_enqueue_script('jquery-color');
|
442 |
+
if (get_bloginfo('version') < '3.3') {
|
443 |
+
if (function_exists('add_thickbox'))
|
444 |
+
add_thickbox();
|
445 |
+
if (function_exists('wp_tiny_mce'))
|
446 |
+
wp_tiny_mce();
|
447 |
+
}
|
448 |
+
wp_enqueue_script('utils');
|
449 |
+
if (get_bloginfo('version') > 3.3) {
|
450 |
+
wp_enqueue_script("jquery");
|
451 |
+
}
|
452 |
+
else {
|
453 |
+
wp_deregister_script('jquery');
|
454 |
+
wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js');
|
455 |
+
wp_enqueue_script('jquery');
|
456 |
+
}
|
457 |
+
wp_enqueue_script("form_main_js", plugins_url("js/formmaker_free.js", __FILE__));
|
458 |
+
wp_enqueue_style("styles_form", plugins_url("css/style.css", __FILE__));
|
459 |
+
wp_enqueue_script("mootools", plugins_url("js/mootools.js", __FILE__));
|
460 |
+
wp_enqueue_script("f_calendar", plugins_url("js/calendar.js", __FILE__));
|
461 |
+
wp_enqueue_script("f_calendar_functions", plugins_url("js/calendar_function.js", __FILE__));
|
462 |
+
wp_enqueue_script("f_calendar_setup", plugins_url("js/calendar-setup.js", __FILE__));
|
463 |
+
// wp_enqueue_script("main",plugins_url("js/main.js",__FILE__));
|
464 |
+
wp_enqueue_style("calendar-jos", plugins_url("js/calendar-jos.css", __FILE__));
|
465 |
+
}
|
466 |
+
}
|
467 |
}
|
468 |
|
|
|
|
|
469 |
///////////////////////////////////////// add ajax for form maker functionaliti
|
470 |
+
require_once("form_ajax_functions.php"); //////////// include form ajax functions for next 4 ajax hooks
|
|
|
|
|
|
|
471 |
add_action('wp_ajax_formmakergeneretexml', 'form_maker_generete_xml'); ///export xml
|
472 |
add_action('wp_ajax_formmakergeneretecsv', 'form_maker_generete_csv'); ///export csv
|
473 |
add_action('wp_ajax_formmakerwdcaptcha', 'form_maker_wd_captcha'); /// generete captcha image and save it code in session
|
474 |
add_action('wp_ajax_formmakerwindow', 'form_maker_window_php'); /// openid window in post or page for editor
|
|
|
475 |
add_action('wp_ajax_nopriv_formmakergeneretexml', 'form_maker_generete_xml'); ///export xml
|
476 |
add_action('wp_ajax_nopriv_formmakergeneretecsv', 'form_maker_generete_csv'); ///export csv
|
477 |
add_action('wp_ajax_nopriv_formmakerwdcaptcha', 'form_maker_wd_captcha'); /// generete captcha image and save it code in session
|
478 |
add_action('wp_ajax_nopriv_formmakerwindow', 'form_maker_window_php'); /// openid window in post or page for editor
|
479 |
+
add_action('wp_ajax_form_preview_product_option', 'form_maker_form_preview_product_option');
|
|
|
|
|
|
|
|
|
|
|
480 |
////////////////////////////////////////////
|
481 |
//////////////////////////////////////////// manager
|
482 |
////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
483 |
add_action('wp_ajax_fromeditcountryinpopup', 'spider_form_country_edit');
|
|
|
|
|
|
|
484 |
function spider_form_country_edit() {
|
485 |
if (function_exists('current_user_can')) {
|
486 |
if (!current_user_can('manage_options')) {
|
490 |
else {
|
491 |
die('Access Denied');
|
492 |
}
|
493 |
+
if (isset($_GET['field_id'])) {
|
494 |
+
$id = (int)$_GET['field_id'];
|
495 |
}
|
496 |
+
else {
|
497 |
echo "<h2>error cannot get fild id</h2>";
|
498 |
return;
|
499 |
+
}
|
500 |
+
html_spider_form_country_edit($id);
|
501 |
}
|
502 |
|
503 |
+
function html_spider_form_country_edit($id) {
|
504 |
+
wp_print_scripts('jquery');
|
505 |
+
wp_print_scripts('jquery-ui-core');
|
506 |
+
wp_print_scripts('jquery-ui-widget');
|
507 |
+
wp_print_scripts('jquery-ui-mouse');
|
508 |
+
wp_print_scripts('jquery-ui-slider');
|
509 |
+
wp_print_scripts('jquery-ui-sortable');
|
510 |
|
|
|
511 |
|
512 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
513 |
|
514 |
+
<span style=" position: absolute;right: 29px;">
|
515 |
+
<img alt="ADD" title="add" style="cursor:pointer; vertical-align:middle; margin:5px; "
|
516 |
+
src="<?php echo plugins_url('images/save.png', __FILE__); ?>" onclick="save_list()">
|
517 |
+
<img alt="CANCEL" title="cancel" style=" cursor:pointer; vertical-align:middle; margin:5px; "
|
518 |
+
src="<?php echo plugins_url('images/cancel_but.png', __FILE__); ?>" onclick="window.parent.tb_remove();">
|
|
|
519 |
</span>
|
520 |
<button onclick="select_all()">Select all</button>
|
521 |
<button onclick="remove_all()">Remove all</button>
|
525 |
<script>
|
526 |
|
527 |
|
528 |
+
selec_coutries = [];
|
529 |
|
530 |
+
coutries = ["", "Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombi", "Comoros", "Congo (Brazzaville)", "Congo", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor Timur)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia, The", "Georgia", "Germany", "Ghana", "Greece", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepa", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe"];
|
531 |
|
532 |
+
select_ = window.parent.document.getElementById('<?php echo $id ?>_elementform_id_temp');
|
533 |
+
n = select_.childNodes.length;
|
534 |
+
for (i = 0; i < n; i++) {
|
|
|
535 |
|
536 |
+
selec_coutries.push(select_.childNodes[i].value);
|
537 |
+
var ch = document.createElement('input');
|
538 |
+
ch.setAttribute("type", "checkbox");
|
539 |
+
ch.setAttribute("checked", "checked");
|
540 |
+
ch.value = select_.childNodes[i].value;
|
541 |
+
ch.id = i + "ch";
|
542 |
+
//ch.setAttribute("id",i);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
543 |
|
544 |
|
545 |
+
var p = document.createElement('span');
|
546 |
+
p.style.cssText = "color:#000000; font-size: 13px; cursor:move";
|
547 |
+
p.innerHTML = select_.childNodes[i].value;
|
548 |
|
549 |
+
var li = document.createElement('li');
|
550 |
+
li.style.cssText = "margin:3px; vertical-align:middle";
|
551 |
+
li.id = i;
|
|
|
|
|
|
|
|
|
552 |
|
553 |
+
li.appendChild(ch);
|
554 |
+
li.appendChild(p);
|
|
|
|
|
|
|
|
|
|
|
|
|
555 |
|
556 |
+
document.getElementById('countries_list').appendChild(li);
|
557 |
+
}
|
558 |
+
cur = i;
|
559 |
+
m = coutries.length;
|
560 |
+
for (i = 0; i < m; i++) {
|
561 |
+
isin = isValueInArray(selec_coutries, coutries[i]);
|
562 |
|
563 |
+
if (!isin) {
|
564 |
+
var ch = document.createElement('input');
|
565 |
+
ch.setAttribute("type", "checkbox");
|
566 |
+
ch.value = coutries[i];
|
567 |
+
ch.id = cur + "ch";
|
568 |
|
569 |
|
570 |
+
var p = document.createElement('span');
|
571 |
+
p.style.cssText = "color:#000000; font-size: 13px; cursor:move";
|
572 |
+
p.innerHTML = coutries[i];
|
573 |
|
574 |
+
var li = document.createElement('li');
|
575 |
+
li.style.cssText = "margin:3px; vertical-align:middle";
|
576 |
+
li.id = cur;
|
577 |
+
|
578 |
+
li.appendChild(ch);
|
579 |
+
li.appendChild(p);
|
580 |
+
|
581 |
+
document.getElementById('countries_list').appendChild(li);
|
582 |
+
cur++;
|
583 |
+
}
|
584 |
+
}
|
585 |
+
jQuery(function () {
|
586 |
+
jQuery("#countries_list").sortable();
|
587 |
+
jQuery("#countries_list").disableSelection();
|
588 |
+
});
|
589 |
+
|
590 |
+
function isValueInArray(arr, val) {
|
591 |
+
inArray = false;
|
592 |
+
for (x = 0; x < arr.length; x++)
|
593 |
+
if (val == arr[x])
|
594 |
+
inArray = true;
|
595 |
+
return inArray;
|
596 |
+
}
|
597 |
+
function save_list() {
|
598 |
+
select_.innerHTML = ""
|
599 |
+
ul = document.getElementById('countries_list');
|
600 |
+
n = ul.childNodes.length;
|
601 |
+
for (i = 0; i < n; i++) {
|
602 |
+
if (ul.childNodes[i].tagName == "LI") {
|
603 |
+
id = ul.childNodes[i].id;
|
604 |
+
if (document.getElementById(id + 'ch').checked) {
|
605 |
+
var option_ = document.createElement('option');
|
606 |
+
option_.setAttribute("value", document.getElementById(id + 'ch').value);
|
607 |
+
option_.innerHTML = document.getElementById(id + 'ch').value;
|
608 |
|
609 |
+
select_.appendChild(option_);
|
610 |
+
}
|
611 |
|
612 |
+
}
|
613 |
|
614 |
|
615 |
+
}
|
616 |
+
window.parent.tb_remove();
|
617 |
|
618 |
+
|
619 |
+
}
|
620 |
+
|
621 |
+
function select_all() {
|
622 |
+
for (i = 0; i < 194; i++) {
|
623 |
+
document.getElementById(i + 'ch').checked = true;
|
624 |
+
;
|
625 |
+
}
|
626 |
+
}
|
627 |
+
|
628 |
+
function remove_all() {
|
629 |
+
for (i = 0; i < 194; i++) {
|
630 |
+
document.getElementById(i + 'ch').checked = false;
|
631 |
+
;
|
632 |
+
}
|
633 |
+
}
|
634 |
+
</script>
|
635 |
+
|
636 |
+
|
637 |
+
|
638 |
+
|
639 |
+
<?php
|
640 |
+
}
|
641 |
+
|
642 |
+
function Manage_Form_maker() {
|
643 |
+
require_once("form_maker_functions.php");
|
644 |
+
require_once("form_maker_functions.html.php");
|
645 |
+
if (!function_exists('print_html_nav'))
|
646 |
+
require_once("nav_function/nav_html_func.php");
|
647 |
+
global $wpdb;
|
648 |
+
if (isset($_GET["task"])) {
|
649 |
+
$task = esc_html($_GET["task"]);
|
650 |
+
}
|
651 |
+
else {
|
652 |
+
$task = "show";
|
653 |
+
}
|
654 |
+
if (isset($_GET["id"])) {
|
655 |
+
$id = (int)$_GET["id"];
|
656 |
+
}
|
657 |
+
else {
|
658 |
+
$id = 0;
|
659 |
+
}
|
660 |
+
switch ($task) {
|
661 |
+
case 'update':
|
662 |
+
update_form_maker();
|
663 |
+
break;
|
664 |
+
case 'save_update':
|
665 |
+
save_update_form_maker();
|
666 |
+
break;
|
667 |
+
case 'update_complite':
|
668 |
+
update_complete();
|
669 |
+
display_form_lists();
|
670 |
+
break;
|
671 |
+
case "add_form" :
|
672 |
+
add_form();
|
673 |
+
break;
|
674 |
+
case "edit_form" :
|
675 |
+
edit_form_maker($id);
|
676 |
+
break;
|
677 |
+
case "Save" :
|
678 |
+
if ($id)
|
679 |
+
apply_form($id);
|
680 |
+
else
|
681 |
+
save_form();
|
682 |
+
display_form_lists();
|
683 |
+
break;
|
684 |
+
case "Apply" :
|
685 |
+
if ($id) {
|
686 |
+
apply_form($id);
|
687 |
+
}
|
688 |
+
else {
|
689 |
+
save_form();
|
690 |
+
$id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
691 |
+
}
|
692 |
+
forchrome($id);
|
693 |
+
break;
|
694 |
+
case "gotoedit" :
|
695 |
+
gotoedit();
|
696 |
+
edit_form_maker($id);
|
697 |
+
break;
|
698 |
+
case "remove_form" :
|
699 |
+
remove_form($id);
|
700 |
+
display_form_lists();
|
701 |
+
break;
|
702 |
+
// Form options.
|
703 |
+
case "form_options" :
|
704 |
+
if ($id) {
|
705 |
+
apply_form($id);
|
706 |
+
}
|
707 |
+
else {
|
708 |
+
save_form();
|
709 |
+
$id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
710 |
+
}
|
711 |
+
form_options($id);
|
712 |
+
break;
|
713 |
+
case "Save_form_options" :
|
714 |
+
Apply_form_options($id);
|
715 |
+
forchrome($id);
|
716 |
+
break;
|
717 |
+
case "Apply_form_options" :
|
718 |
+
Apply_form_options($id);
|
719 |
+
form_options($id);
|
720 |
+
break;
|
721 |
+
case "save_as_copy":
|
722 |
+
save_as_copy();
|
723 |
+
display_form_lists();
|
724 |
+
break;
|
725 |
+
default:
|
726 |
+
display_form_lists();
|
727 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
728 |
}
|
729 |
|
730 |
////////////////////////////////////////////
|
731 |
//////////////////////////////////////////// Submi
|
732 |
////////////////////////////////////////////
|
|
|
733 |
////map in spubmits
|
|
|
|
|
734 |
add_action('wp_ajax_frommapeditinpopup', 'spider_form_map_edit');
|
|
|
735 |
function spider_form_map_edit() {
|
736 |
if (function_exists('current_user_can')) {
|
737 |
if (!current_user_can('manage_options')) {
|
741 |
else {
|
742 |
die('Access Denied');
|
743 |
}
|
744 |
+
if (isset($_GET['long']) && isset($_GET['lat'])) {
|
745 |
$long = esc_html($_GET['long']);
|
746 |
$lat = esc_html($_GET['lat']);
|
747 |
+
?>
|
748 |
+
<script src="<?php echo plugins_url("js/if_gmap.js", __FILE__); ?>"></script>
|
749 |
+
<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
750 |
|
751 |
+
<table style="margin:0px; padding:0px">
|
752 |
+
<tr>
|
753 |
+
<td><b>Address:</b></td>
|
754 |
+
<td><input type="text" id="addrval0" style="border:0px; background:none" size="80" readonly/></td>
|
755 |
+
</tr>
|
756 |
+
<tr>
|
757 |
+
<td><b>Longitude:</b></td>
|
758 |
+
<td><input type="text" id="longval0" style="border:0px; background:none" size="80" readonly/></td>
|
759 |
+
</tr>
|
760 |
+
<tr>
|
761 |
+
<td><b>Latitude:</b></td>
|
762 |
+
<td><input type="text" id="latval0" style="border:0px; background:none" size="80" readonly/></td>
|
763 |
+
</tr>
|
764 |
+
</table>
|
765 |
|
766 |
+
<div id="0_elementform_id_temp" long="<?php echo $long ?>" center_x="<?php echo $long ?>"
|
767 |
+
center_y="<?php echo $lat ?>" lat="<?php echo $lat ?>" zoom="8" info=""
|
768 |
+
style="width:600px; height:500px; "></div>
|
769 |
|
770 |
+
<script>
|
771 |
+
if_gmap_init("0");
|
772 |
+
add_marker_on_map(0, 0, "<?php echo $long ?>", "<?php echo $lat ?>", '');
|
773 |
|
|
|
774 |
|
775 |
+
</script>
|
776 |
|
777 |
+
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
778 |
|
779 |
|
780 |
+
die();
|
781 |
+
}
|
782 |
+
else {
|
783 |
+
return 0;
|
784 |
+
}
|
785 |
+
}
|
786 |
+
|
787 |
/////////////////////////////////////////////////////////////////////////////////////
|
788 |
/////////////////////////////////////////////////////////////////////////////////// priview form
|
789 |
///////////////////////////////////////////////////////////////////////////////////
|
790 |
///////////////////////////////////////////////////////////////////////////////////
|
|
|
791 |
add_action('wp_ajax_frommakerpreview', 'preview_formmaker');
|
792 |
+
function html_preview_formmaker($css) {
|
793 |
+
/**
|
794 |
+
* @package SpiderFC
|
795 |
+
* @author Web-Dorado
|
796 |
+
* @copyright (C) 2011 Web-Dorado. All rights reserved.
|
797 |
+
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
798 |
+
**/
|
799 |
+
$cmpnt_js_path = plugins_url('js', __FILE__);
|
800 |
+
$id = 'form_id_temp';
|
801 |
+
?>
|
802 |
+
<script src="<?php echo $cmpnt_js_path . "/if_gmap.js"; ?>"></script>
|
803 |
+
<script src="<?php echo $cmpnt_js_path . "/main.js"; ?>"></script>
|
|
|
|
|
|
|
|
|
|
|
804 |
<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
|
805 |
<style>
|
806 |
+
<?php
|
807 |
+
$cmpnt_js_path = plugins_url('', __FILE__);
|
808 |
+
echo str_replace('[SITE_ROOT]', $cmpnt_js_path, $css);
|
809 |
|
810 |
+
?>
|
811 |
</style>
|
812 |
<div id="form_id_temppages" class="wdform_page_navigation" show_title="" show_numbers="" type=""></div>
|
813 |
|
814 |
+
<form id="form_preview"></form>
|
815 |
+
<input type="hidden" id="counter<?php echo $id ?>" value="" name="counter<?php echo $id ?>"/>
|
816 |
|
817 |
<script>
|
818 |
+
JURI_ROOT = '<?php echo $cmpnt_js_path ?>';
|
819 |
+
|
820 |
+
document.getElementById('form_preview').innerHTML = window.parent.document.getElementById('take').innerHTML;
|
821 |
+
document.getElementById('form_id_temppages').setAttribute('show_title', window.parent.document.getElementById('pages').getAttribute('show_title'));
|
822 |
+
document.getElementById('form_id_temppages').setAttribute('show_numbers', window.parent.document.getElementById('pages').getAttribute('show_numbers'));
|
823 |
+
document.getElementById('form_id_temppages').setAttribute('type', window.parent.document.getElementById('pages').getAttribute('type'));
|
824 |
+
document.getElementById('counterform_id_temp').value = window.parent.gen;
|
825 |
+
;
|
826 |
+
|
827 |
+
form_view_count<?php echo $id ?>= 0;
|
828 |
+
for (i = 1; i <= 30; i++) {
|
829 |
+
if (document.getElementById('<?php echo $id ?>form_view' + i)) {
|
830 |
+
form_view_count<?php echo $id ?>++;
|
831 |
+
form_view_max<?php echo $id ?>= i;
|
832 |
+
document.getElementById('<?php echo $id ?>form_view' + i).parentNode.removeAttribute('style');
|
833 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
834 |
}
|
835 |
|
836 |
+
refresh_first();
|
837 |
+
|
838 |
+
|
839 |
+
if (form_view_count<?php echo $id ?>> 1) {
|
840 |
+
for (i = 1; i <= form_view_max<?php echo $id ?>; i++) {
|
841 |
+
if (document.getElementById('<?php echo $id ?>form_view' + i)) {
|
842 |
+
first_form_view<?php echo $id ?>= i;
|
843 |
+
break;
|
844 |
+
}
|
845 |
+
}
|
846 |
+
|
847 |
+
generate_page_nav(first_form_view<?php echo $id ?>, '<?php echo $id ?>', form_view_count<?php echo $id ?>, form_view_max<?php echo $id ?>);
|
848 |
+
}
|
849 |
+
|
850 |
+
|
851 |
+
function remove_add_(id) {
|
852 |
+
attr_name = new Array();
|
853 |
+
attr_value = new Array();
|
854 |
+
var input = document.getElementById(id);
|
855 |
+
atr = input.attributes;
|
856 |
+
for (v = 0; v < 30; v++)
|
857 |
+
if (atr[v]) {
|
858 |
+
if (atr[v].name.indexOf("add_") == 0) {
|
859 |
+
attr_name.push(atr[v].name.replace('add_', ''));
|
860 |
+
attr_value.push(atr[v].value);
|
861 |
+
input.removeAttribute(atr[v].name);
|
862 |
+
v--;
|
863 |
+
}
|
864 |
+
}
|
865 |
+
for (v = 0; v < attr_name.length; v++) {
|
866 |
+
input.setAttribute(attr_name[v], attr_value[v])
|
867 |
+
}
|
868 |
+
}
|
869 |
+
|
870 |
+
function refresh_first() {
|
871 |
+
|
872 |
+
n = window.parent.gen;
|
873 |
+
for (i = 0; i < n; i++) {
|
874 |
+
if (document.getElementById(i)) {
|
875 |
+
for (z = 0; z < document.getElementById(i).childNodes.length; z++)
|
876 |
+
if (document.getElementById(i).childNodes[z].nodeType == 3)
|
877 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
|
878 |
+
|
879 |
+
if (document.getElementById(i).getAttribute('type') == "type_map") {
|
880 |
+
if_gmap_init(i);
|
881 |
+
for (q = 0; q < 20; q++)
|
882 |
+
if (document.getElementById(i + "_elementform_id_temp").getAttribute("long" + q)) {
|
883 |
+
|
884 |
+
w_long = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("long" + q));
|
885 |
+
w_lat = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("lat" + q));
|
886 |
+
w_info = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("info" + q));
|
887 |
+
add_marker_on_map(i, q, w_long, w_lat, w_info, false);
|
888 |
+
}
|
889 |
+
}
|
890 |
+
|
891 |
+
if (document.getElementById(i).getAttribute('type') == "type_mark_map") {
|
892 |
+
if_gmap_init(i);
|
893 |
+
w_long = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("long" + 0));
|
894 |
+
w_lat = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("lat" + 0));
|
895 |
+
w_info = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("info" + 0));
|
896 |
+
add_marker_on_map(i, 0, w_long, w_lat, w_info, true);
|
897 |
+
}
|
898 |
+
|
899 |
+
|
900 |
+
if (document.getElementById(i).getAttribute('type') == "type_captcha" || document.getElementById(i).getAttribute('type') == "type_recaptcha") {
|
901 |
+
if (document.getElementById(i).childNodes[10]) {
|
902 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
903 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
904 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
905 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
906 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
907 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
908 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
909 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
910 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
911 |
+
}
|
912 |
+
else {
|
913 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
914 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
915 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
916 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
917 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
918 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
919 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
920 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
921 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
922 |
+
}
|
923 |
+
continue;
|
924 |
+
}
|
925 |
+
|
926 |
+
if (document.getElementById(i).getAttribute('type') == "type_section_break") {
|
927 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
928 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
929 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
930 |
+
continue;
|
931 |
+
}
|
932 |
+
|
933 |
+
|
934 |
+
if (document.getElementById(i).childNodes[10]) {
|
935 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
936 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
937 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
938 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
939 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
940 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
941 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
942 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
943 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
944 |
+
}
|
945 |
+
else {
|
946 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
947 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
948 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
949 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
950 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
951 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
952 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
953 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
954 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
955 |
+
}
|
956 |
+
}
|
957 |
+
}
|
958 |
+
|
959 |
+
for (i = 0; i <= n; i++) {
|
960 |
+
if (document.getElementById(i)) {
|
961 |
+
type = document.getElementById(i).getAttribute("type");
|
962 |
+
switch (type) {
|
963 |
+
case "type_text":
|
964 |
+
case "type_number":
|
965 |
+
case "type_password":
|
966 |
+
case "type_submitter_mail":
|
967 |
+
case "type_own_select":
|
968 |
+
case "type_country":
|
969 |
+
case "type_hidden":
|
970 |
+
case "type_map":
|
971 |
+
{
|
972 |
+
remove_add_(i + "_elementform_id_temp");
|
973 |
+
break;
|
974 |
+
}
|
975 |
+
|
976 |
+
case "type_submit_reset":
|
977 |
+
{
|
978 |
+
remove_add_(i + "_element_submitform_id_temp");
|
979 |
+
if (document.getElementById(i + "_element_resetform_id_temp"))
|
980 |
+
remove_add_(i + "_element_resetform_id_temp");
|
981 |
+
break;
|
982 |
+
}
|
983 |
+
|
984 |
+
case "type_captcha":
|
985 |
+
{
|
986 |
+
remove_add_("_wd_captchaform_id_temp");
|
987 |
+
remove_add_("_element_refreshform_id_temp");
|
988 |
+
remove_add_("_wd_captcha_inputform_id_temp");
|
989 |
+
break;
|
990 |
+
}
|
991 |
+
|
992 |
+
case "type_recaptcha":
|
993 |
+
{
|
994 |
+
remove_add_("wd_recaptchaform_id_temp");
|
995 |
+
break;
|
996 |
+
}
|
997 |
+
|
998 |
+
case "type_file_upload":
|
999 |
+
{
|
1000 |
+
remove_add_(i + "_elementform_id_temp");
|
1001 |
+
break;
|
1002 |
+
}
|
1003 |
+
|
1004 |
+
case "type_textarea":
|
1005 |
+
{
|
1006 |
+
remove_add_(i + "_elementform_id_temp");
|
1007 |
+
|
1008 |
+
break;
|
1009 |
+
}
|
1010 |
+
|
1011 |
+
case "type_name":
|
1012 |
+
{
|
1013 |
+
|
1014 |
+
if (document.getElementById(i + "_element_titleform_id_temp")) {
|
1015 |
+
remove_add_(i + "_element_titleform_id_temp");
|
1016 |
+
remove_add_(i + "_element_firstform_id_temp");
|
1017 |
+
remove_add_(i + "_element_lastform_id_temp");
|
1018 |
+
remove_add_(i + "_element_middleform_id_temp");
|
1019 |
+
}
|
1020 |
+
else {
|
1021 |
+
remove_add_(i + "_element_firstform_id_temp");
|
1022 |
+
remove_add_(i + "_element_lastform_id_temp");
|
1023 |
+
|
1024 |
+
}
|
1025 |
+
break;
|
1026 |
+
|
1027 |
+
}
|
1028 |
+
|
1029 |
+
case "type_phone":
|
1030 |
+
{
|
1031 |
+
|
1032 |
+
remove_add_(i + "_element_firstform_id_temp");
|
1033 |
+
remove_add_(i + "_element_lastform_id_temp");
|
1034 |
+
|
1035 |
+
break;
|
1036 |
+
|
1037 |
+
}
|
1038 |
+
case "type_address":
|
1039 |
+
{
|
1040 |
+
remove_add_(i + "_street1form_id_temp");
|
1041 |
+
remove_add_(i + "_street2form_id_temp");
|
1042 |
+
remove_add_(i + "_cityform_id_temp");
|
1043 |
+
remove_add_(i + "_stateform_id_temp");
|
1044 |
+
remove_add_(i + "_postalform_id_temp");
|
1045 |
+
remove_add_(i + "_countryform_id_temp");
|
1046 |
+
|
1047 |
+
break;
|
1048 |
+
|
1049 |
+
}
|
1050 |
+
|
1051 |
+
|
1052 |
+
case "type_checkbox":
|
1053 |
+
case "type_radio":
|
1054 |
+
{
|
1055 |
+
is = true;
|
1056 |
+
for (j = 0; j < 100; j++)
|
1057 |
+
if (document.getElementById(i + "_elementform_id_temp" + j)) {
|
1058 |
+
remove_add_(i + "_elementform_id_temp" + j);
|
1059 |
+
}
|
1060 |
+
/* if(document.getElementById(i+"_randomize").value=="yes")
|
1061 |
+
choises_randomize(i);*/
|
1062 |
+
|
1063 |
+
break;
|
1064 |
+
}
|
1065 |
+
|
1066 |
+
case "type_button":
|
1067 |
+
{
|
1068 |
+
for (j = 0; j < 100; j++)
|
1069 |
+
if (document.getElementById(i + "_elementform_id_temp" + j)) {
|
1070 |
+
remove_add_(i + "_elementform_id_temp" + j);
|
1071 |
+
}
|
1072 |
+
break;
|
1073 |
+
}
|
1074 |
+
|
1075 |
+
case "type_time":
|
1076 |
+
{
|
1077 |
+
if (document.getElementById(i + "_ssform_id_temp")) {
|
1078 |
+
remove_add_(i + "_ssform_id_temp");
|
1079 |
+
remove_add_(i + "_mmform_id_temp");
|
1080 |
+
remove_add_(i + "_hhform_id_temp");
|
1081 |
+
}
|
1082 |
+
else {
|
1083 |
+
remove_add_(i + "_mmform_id_temp");
|
1084 |
+
remove_add_(i + "_hhform_id_temp");
|
1085 |
+
}
|
1086 |
+
break;
|
1087 |
+
|
1088 |
+
}
|
1089 |
+
|
1090 |
+
case "type_date":
|
1091 |
+
{
|
1092 |
+
remove_add_(i + "_elementform_id_temp");
|
1093 |
+
remove_add_(i + "_buttonform_id_temp");
|
1094 |
+
break;
|
1095 |
+
}
|
1096 |
+
case "type_date_fields":
|
1097 |
+
{
|
1098 |
+
remove_add_(i + "_dayform_id_temp");
|
1099 |
+
remove_add_(i + "_monthform_id_temp");
|
1100 |
+
remove_add_(i + "_yearform_id_temp");
|
1101 |
+
break;
|
1102 |
+
}
|
1103 |
+
}
|
1104 |
+
}
|
1105 |
+
}
|
1106 |
+
|
1107 |
+
|
1108 |
+
for (t = 1; t <= form_view_max<?php echo $id ?>; t++) {
|
1109 |
+
if (document.getElementById('form_id_tempform_view' + t)) {
|
1110 |
+
form_view_element = document.getElementById('form_id_tempform_view' + t);
|
1111 |
+
xy = form_view_element.childNodes.length - 2;
|
1112 |
+
for (z = 0; z <= xy; z++) {
|
1113 |
+
if (form_view_element.childNodes[z])
|
1114 |
+
if (form_view_element.childNodes[z].nodeType != 3)
|
1115 |
+
if (!form_view_element.childNodes[z].id) {
|
1116 |
+
del = true;
|
1117 |
+
GLOBAL_tr = form_view_element.childNodes[z];
|
1118 |
+
//////////////////////////////////////////////////////////////////////////////////////////
|
1119 |
+
for (x = 0; x < GLOBAL_tr.firstChild.childNodes.length; x++) {
|
1120 |
+
table = GLOBAL_tr.firstChild.childNodes[x];
|
1121 |
+
tbody = table.firstChild;
|
1122 |
+
if (tbody.childNodes.length)
|
1123 |
+
del = false;
|
1124 |
+
}
|
1125 |
+
|
1126 |
+
if (del) {
|
1127 |
+
form_view_element.removeChild(form_view_element.childNodes[z]);
|
1128 |
+
}
|
1129 |
+
|
1130 |
+
}
|
1131 |
+
}
|
1132 |
+
}
|
1133 |
+
}
|
1134 |
+
|
1135 |
+
|
1136 |
+
for (i = 1; i <= window.parent.form_view_max; i++)
|
1137 |
+
if (document.getElementById('form_id_tempform_view' + i)) {
|
1138 |
+
document.getElementById('form_id_tempform_view' + i).parentNode.removeChild(document.getElementById('form_id_tempform_view_img' + i));
|
1139 |
+
document.getElementById('form_id_tempform_view' + i).removeAttribute('style');
|
1140 |
+
}
|
1141 |
+
|
1142 |
}
|
1143 |
|
1144 |
|
1145 |
</script>
|
1146 |
+
<?php
|
1147 |
+
die();
|
1148 |
}
|
1149 |
+
|
1150 |
function preview_formmaker() {
|
1151 |
if (function_exists('current_user_can')) {
|
1152 |
if (!current_user_can('manage_options')) {
|
1156 |
else {
|
1157 |
die('Access Denied');
|
1158 |
}
|
1159 |
+
global $wpdb;
|
1160 |
+
if (isset($_GET['id'])) {
|
1161 |
+
$getparams = (int)$_GET['id'];
|
1162 |
}
|
1163 |
else {
|
1164 |
$getparams = 0;
|
1165 |
}
|
1166 |
+
$query = "SELECT css FROM " . $wpdb->prefix . "formmaker_themes WHERE id=" . $getparams;
|
1167 |
+
$css = $wpdb->get_var($query);
|
1168 |
+
html_preview_formmaker($css);
|
1169 |
}
|
1170 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1171 |
//////////////////////////////////////////////////////////////////////////////////////
|
1172 |
//////////////////////////////////////////////////////////////////////////////////
|
1173 |
///////////////////////////////////////////////////////////////////////////////
|
1174 |
///////////////////////////////////////////////////////////////////////////////
|
1175 |
/////////////////////////////////////////////////////////////////////////////////
|
1176 |
+
function Form_maker_Submits() {
|
1177 |
+
require_once("Submissions.html.php");
|
1178 |
+
require_once("Submissions.php");
|
1179 |
+
if (!function_exists('print_html_nav'))
|
1180 |
+
require_once("nav_function/nav_html_func.php");
|
1181 |
+
global $wpdb;
|
1182 |
+
if (isset($_GET["task"])) {
|
1183 |
+
$task = esc_html($_GET["task"]);
|
1184 |
+
}
|
1185 |
+
else {
|
1186 |
+
$task = "show";
|
1187 |
+
}
|
1188 |
+
if (isset($_GET["id"])) {
|
1189 |
+
$id = (int)$_GET["id"];
|
1190 |
+
}
|
1191 |
+
else {
|
1192 |
+
$id = 0;
|
1193 |
+
}
|
1194 |
+
switch ($task) {
|
1195 |
+
case "submits" :
|
1196 |
+
show_submits();
|
1197 |
+
break;
|
1198 |
+
case "edit_submit" :
|
1199 |
+
editSubmit($id);
|
1200 |
+
break;
|
1201 |
+
case "remove_submit" :
|
1202 |
+
remov_submit($id);
|
1203 |
+
show_submits();
|
1204 |
+
break;
|
1205 |
+
case "remov_cheched" :
|
1206 |
+
remov_cheched_submission();
|
1207 |
+
show_submits();
|
1208 |
+
break;
|
1209 |
+
case "appply_submit" :
|
1210 |
+
save_submit($id);
|
1211 |
+
editSubmit($id);
|
1212 |
+
break;
|
1213 |
+
case "save_submit" :
|
1214 |
+
save_submit($id);
|
1215 |
+
show_submits();
|
1216 |
+
break;
|
1217 |
+
case "cancel" :
|
1218 |
+
show_submits();
|
1219 |
+
break;
|
1220 |
+
default:
|
1221 |
+
show_submits();
|
1222 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1223 |
}
|
1224 |
|
1225 |
+
function Form_maker_Themes() {
|
1226 |
+
require_once("Theme_functions.php");
|
1227 |
+
require_once("Themes_function.html.php");
|
1228 |
+
if (!function_exists('print_html_nav'))
|
1229 |
+
require_once("nav_function/nav_html_func.php");
|
1230 |
+
global $wpdb;
|
1231 |
+
if (isset($_GET["task"])) {
|
1232 |
+
$task = esc_html($_GET["task"]);
|
1233 |
+
}
|
1234 |
+
else {
|
1235 |
+
$task = "";
|
1236 |
+
}
|
1237 |
+
if (isset($_GET["id"])) {
|
1238 |
+
$id = (int)$_GET["id"];
|
1239 |
+
}
|
1240 |
+
else {
|
1241 |
+
$id = 0;
|
1242 |
+
}
|
1243 |
+
switch ($task) {
|
1244 |
+
case 'theme':
|
1245 |
+
show_theme();
|
1246 |
+
break;
|
1247 |
+
case 'default':
|
1248 |
+
default_theme($id);
|
1249 |
+
show_theme();
|
1250 |
+
break;
|
1251 |
+
case 'add_theme':
|
1252 |
+
add_theme();
|
1253 |
+
break;
|
1254 |
+
case 'Save':
|
1255 |
+
if ($id) {
|
1256 |
+
apply_theme($id);
|
1257 |
+
}
|
1258 |
+
else {
|
1259 |
+
save_theme();
|
1260 |
+
}
|
1261 |
+
show_theme();
|
1262 |
+
break;
|
1263 |
+
case 'Apply':
|
1264 |
+
if ($id) {
|
1265 |
+
apply_theme($id);
|
1266 |
+
}
|
1267 |
+
else {
|
1268 |
+
save_theme();
|
1269 |
+
$id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker_themes");
|
1270 |
+
}
|
1271 |
+
edit_theme($id);
|
1272 |
+
break;
|
1273 |
+
case 'edit_theme':
|
1274 |
+
edit_theme($id);
|
1275 |
+
break;
|
1276 |
+
case 'remove_theme':
|
1277 |
+
remove_theme($id);
|
1278 |
+
show_theme();
|
1279 |
+
break;
|
1280 |
+
default:
|
1281 |
+
show_theme();
|
1282 |
+
}
|
1283 |
}
|
1284 |
|
1285 |
+
function Uninstall_Form_Maker() {
|
1286 |
+
global $wpdb;
|
1287 |
+
$base_name = plugin_basename('Form_maker');
|
1288 |
+
$base_page = 'admin.php?page=' . $base_name;
|
1289 |
+
if (isset($_GET['mode'])) {
|
1290 |
+
$mode = trim(esc_html($_GET['mode']));
|
1291 |
+
}
|
1292 |
+
if (!empty($_POST['do'])) {
|
1293 |
+
if (esc_html($_POST['do']) == "UNINSTALL Form Maker") {
|
1294 |
+
check_admin_referer('Form Maker_uninstall');
|
1295 |
+
if (trim(esc_html($_POST['uninstall_Form_yes'])) == 'yes') {
|
1296 |
+
if ((get_option('contact_form_forms', FALSE) || get_option('contact_form_forms', FALSE) != '') && get_option('contact_form_themes', FALSE) || get_option('contact_form_themes', FALSE) != '') {
|
1297 |
+
echo '<div id="message" class="updated fade">';
|
1298 |
+
echo '<p>';
|
1299 |
+
echo "Table 'formmaker' has been deleted.";
|
1300 |
+
$wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN (" . get_option('contact_form_forms') . ")");
|
1301 |
+
echo '<font style="color:#000;">';
|
1302 |
+
echo '</font><br />';
|
1303 |
+
echo '</p>';
|
1304 |
+
echo '<p>';
|
1305 |
+
echo "Table 'formmaker_submits' has been deleted.";
|
1306 |
+
$wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_submits WHERE `form_id` NOT IN (" . get_option('contact_form_forms') . ")");
|
1307 |
+
echo '<font style="color:#000;">';
|
1308 |
+
echo '</font><br />';
|
1309 |
+
echo '</p>';
|
1310 |
+
echo '<p>';
|
1311 |
+
echo "Table 'formmaker_views' has been deleted.";
|
1312 |
+
$wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_views WHERE `form_id` NOT IN (" . get_option('contact_form_forms') . ")");
|
1313 |
+
echo '<font style="color:#000;">';
|
1314 |
+
echo '</font><br />';
|
1315 |
+
echo '</p>';
|
1316 |
+
echo '<p>';
|
1317 |
+
echo "Table 'formmaker_themes' has been deleted.";
|
1318 |
+
$wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_themes WHERE `id` NOT IN (" . get_option('contact_form_themes') . ")");
|
1319 |
+
echo '<font style="color:#000;">';
|
1320 |
+
echo '</font><br />';
|
1321 |
+
echo '</p>';
|
1322 |
+
echo '</div>';
|
1323 |
+
}
|
1324 |
+
else {
|
1325 |
+
echo '<div id="message" class="updated fade">';
|
1326 |
+
echo '<p>';
|
1327 |
+
echo "Table 'formmaker' has been deleted.";
|
1328 |
+
$wpdb->query("DROP TABLE " . $wpdb->prefix . "formmaker");
|
1329 |
+
echo '<font style="color:#000;">';
|
1330 |
+
echo '</font><br />';
|
1331 |
+
echo '</p>';
|
1332 |
+
echo '<p>';
|
1333 |
+
echo "Table 'formmaker_submits' has been deleted.";
|
1334 |
+
$wpdb->query("DROP TABLE " . $wpdb->prefix . "formmaker_submits");
|
1335 |
+
echo '<font style="color:#000;">';
|
1336 |
+
echo '</font><br />';
|
1337 |
+
echo '</p>';
|
1338 |
+
echo '<p>';
|
1339 |
+
echo "Table 'formmaker_views' has been deleted.";
|
1340 |
+
$wpdb->query("DROP TABLE " . $wpdb->prefix . "formmaker_views");
|
1341 |
+
echo '<font style="color:#000;">';
|
1342 |
+
echo '</font><br />';
|
1343 |
+
echo '</p>';
|
1344 |
+
echo '<p>';
|
1345 |
+
echo "Table 'formmaker_themes' has been deleted.";
|
1346 |
+
$wpdb->query("DROP TABLE " . $wpdb->prefix . "formmaker_themes");
|
1347 |
+
echo '<font style="color:#000;">';
|
1348 |
+
echo '</font><br />';
|
1349 |
+
echo '</p>';
|
1350 |
+
echo '<p>';
|
1351 |
+
echo "Table 'formmaker_sessions' has been deleted.";
|
1352 |
+
$wpdb->query("DROP TABLE " . $wpdb->prefix . "formmaker_sessions");
|
1353 |
+
echo '<font style="color:#000;">';
|
1354 |
+
echo '</font><br />';
|
1355 |
+
echo '</p>';
|
1356 |
+
echo '</div>';
|
1357 |
+
}
|
1358 |
+
$mode = 'end-UNINSTALL';
|
1359 |
+
}
|
1360 |
+
}
|
1361 |
+
}
|
1362 |
+
if (!isset($mode))
|
1363 |
+
$mode = '';
|
1364 |
+
switch ($mode) {
|
1365 |
+
case 'end-UNINSTALL':
|
1366 |
+
$deactivate_url = wp_nonce_url('plugins.php?action=deactivate&plugin=' . plugin_basename(__FILE__), 'deactivate-plugin_' . plugin_basename(__FILE__)) . '&form_maker_uninstall=1';
|
1367 |
+
echo '<div class="wrap">';
|
1368 |
+
echo '<div id="icon-Form_maker" class="icon32"><br /></div>';
|
1369 |
+
echo '<h2>Uninstall Form Maker</h2>';
|
1370 |
+
echo '<p><strong>' . sprintf('<a href="%s">Click Here</a> To Finish The Uninstallation And Form Maker Will Be Deactivated Automatically.', $deactivate_url) . '</strong></p>';
|
1371 |
+
echo '</div>';
|
1372 |
+
break;
|
1373 |
+
// Main Page
|
1374 |
+
default:
|
1375 |
+
?>
|
1376 |
+
<form method="post" action="<?php echo admin_url('admin.php?page=Uninstall_Form_Maker'); ?>">
|
1377 |
+
<?php wp_nonce_field('Form Maker_uninstall'); ?>
|
1378 |
+
<div class="wrap">
|
1379 |
+
<div id="icon-Form_maker" class="icon32"><br/></div>
|
1380 |
+
<h2><?php echo 'Uninstall Form Maker'; ?></h2>
|
1381 |
+
<p>
|
1382 |
+
<?php echo 'Deactivating Form Maker plugin does not remove any data that may have been created, such as the Forms and the Submissions. To completely remove this plugin, you can uninstall it here.'; ?>
|
1383 |
+
</p>
|
1384 |
+
<p style="color: red">
|
1385 |
+
<strong><?php echo'WARNING:'; ?></strong><br/>
|
1386 |
+
<?php echo 'Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first.'; ?>
|
1387 |
+
</p>
|
1388 |
+
<p style="color: red">
|
1389 |
+
<strong><?php echo 'The following WordPress Options/Tables will be DELETED:'; ?></strong><br/>
|
1390 |
+
</p>
|
1391 |
+
<table class="widefat">
|
1392 |
+
<thead>
|
1393 |
+
<tr>
|
1394 |
+
<th><?php echo 'WordPress Tables'; ?></th>
|
1395 |
+
</tr>
|
1396 |
+
</thead>
|
1397 |
+
<tr>
|
1398 |
+
<td valign="top">
|
1399 |
+
<ol>
|
1400 |
+
<?php
|
1401 |
+
echo '<li>formmaker</li>' . "\n";
|
1402 |
+
echo '<li>formmaker_submits</li>' . "\n";
|
1403 |
+
echo '<li>formmaker_views</li>' . "\n";
|
1404 |
+
echo '<li>formmaker_themes</li>' . "\n";
|
1405 |
+
echo '<li>formmaker_sessions</li>' . "\n";
|
1406 |
+
?>
|
1407 |
+
</ol>
|
1408 |
+
</td>
|
1409 |
+
</tr>
|
1410 |
+
</table>
|
1411 |
+
<p style="text-align: center;">
|
1412 |
+
<?php echo 'Do you really want to uninstall Form Maker?'; ?><br/><br/>
|
1413 |
+
<input type="checkbox" name="uninstall_Form_yes" value="yes"/> <?php echo 'Yes'; ?><br/><br/>
|
1414 |
+
<input type="submit" name="do" value="<?php echo 'UNINSTALL Form Maker'; ?>" class="button-primary"
|
1415 |
+
onclick="return confirm('<?php echo 'You Are About To Uninstall Form Maker From WordPress.\nThis Action Is Not Reversible.\n\n Choose [Cancel] To Stop, [OK] To Uninstall.'; ?>')"/>
|
1416 |
+
</p>
|
1417 |
+
</div>
|
1418 |
+
</form>
|
1419 |
+
<?php
|
1420 |
+
} // End switch($mode)
|
1421 |
+
}
|
1422 |
+
|
1423 |
+
|
1424 |
+
function formmaker_activate() {
|
1425 |
+
include 'setup_sql.php';
|
1426 |
+
set_form_maker_sql();
|
1427 |
+
require_once("update_sql.php");
|
1428 |
+
formmaker_chech_update();
|
1429 |
+
}
|
1430 |
+
|
1431 |
+
register_activation_hook(__FILE__, 'formmaker_activate');
|
1432 |
+
function sp_form_deactiv() {
|
1433 |
+
echo esc_html($_GET['form_maker_uninstall']);
|
1434 |
+
if (isset($_GET['form_maker_uninstall'])) {
|
1435 |
+
if (esc_html($_GET['form_maker_uninstall']) == 1) {
|
1436 |
delete_option('formmaker_cureent_version');
|
1437 |
+
}
|
1438 |
+
}
|
1439 |
}
|
1440 |
|
1441 |
+
register_deactivation_hook(__FILE__, 'sp_form_deactiv');
|
Submissions.html.php
CHANGED
@@ -1,882 +1,868 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
4 |
}
|
5 |
-
function html_show_submits($rows, $forms, $lists, $pageNav, $labels, $label_titles, $rows_ord, $filter_order_Dir
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
if(!in_array($row->group_id, $group_id_s))
|
23 |
-
{
|
24 |
-
|
25 |
-
array_push($group_id_s, $row->group_id);
|
26 |
-
|
27 |
-
}
|
28 |
-
}
|
29 |
-
|
30 |
-
?>
|
31 |
<style>
|
32 |
-
.calendar .button
|
33 |
-
|
34 |
-
|
35 |
-
}
|
36 |
</style>
|
37 |
<script type="text/javascript">
|
38 |
-
function tableOrdering(
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
|
|
|
|
|
|
|
|
44 |
}
|
45 |
-
function
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
if(typeof(allTags[curTag].id)!="undefined")
|
67 |
-
if(allTags[curTag].id.indexOf('_fc')>0)
|
68 |
-
{
|
69 |
-
curLabel=allTags[curTag].id.replace('_fc','');
|
70 |
-
if(document.forms.admin_form.hide_label_list.value.indexOf('@'+curLabel+'@')>=0)
|
71 |
-
allTags[curTag].style.display = 'none';
|
72 |
-
else
|
73 |
-
allTags[curTag].style.display = '';
|
74 |
-
}
|
75 |
-
}
|
76 |
}
|
77 |
|
78 |
-
function clickLabChB(label, ChB)
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
}
|
88 |
-
renderColumns();
|
89 |
}
|
90 |
|
91 |
-
function toggleChBDiv(b)
|
92 |
-
{
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
document.getElementById("ChBDiv").style.display="none";
|
106 |
-
document.getElementById("sbox-overlay").style.display="none";
|
107 |
-
}
|
108 |
}
|
109 |
|
110 |
-
function clickLabChBAll(ChBAll)
|
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 |
-
function remove_all()
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
{
|
152 |
-
echo "document.getElementById('".$form_id.'_'.$labels_id[$i]."_search').value='';
|
153 |
";
|
154 |
-
|
155 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
|
158 |
-
function
|
159 |
-
|
160 |
-
|
161 |
-
{
|
162 |
-
document.getElementById('fields_filter').style.display='';
|
163 |
-
document.getElementById('filter_img').src='<?php echo plugins_url('images/filter_hide.png',__FILE__) ?>';
|
164 |
-
}
|
165 |
-
else{
|
166 |
-
document.getElementById('fields_filter').style.display="none";
|
167 |
-
document.getElementById('filter_img').src='<?php echo plugins_url('images/filter_show.png',__FILE__) ?>';
|
168 |
-
}
|
169 |
}
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
|
|
|
|
|
|
174 |
}
|
175 |
-
|
176 |
-
|
177 |
-
var form = document.adminForm;
|
178 |
-
if (pressbutton == 'cancel_theme') {
|
179 |
-
submitform( pressbutton );
|
180 |
-
return;
|
181 |
-
}
|
182 |
-
|
183 |
-
if(document.getElementById('title').value==''){
|
184 |
-
alert('The theme must have a title')
|
185 |
-
return;
|
186 |
-
}
|
187 |
-
submitform( pressbutton );
|
188 |
-
}
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
function submitform( pressbutton ){
|
194 |
-
document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
|
195 |
-
document.getElementById('adminForm').submit();
|
196 |
-
}
|
197 |
-
//-->
|
198 |
-
|
199 |
-
function change_width(){
|
200 |
-
width=parseInt(document.getElementById('width').value)+45+parseInt(document.getElementById('border_width').value);
|
201 |
-
height=550;
|
202 |
-
|
203 |
-
document.getElementById('spider_calendar_preview').href="http://localhost/wordpress/wp-content/plugins/spider-calendar/preview.php?TB_iframe=1&tbWidth="+width+"&tbHeight="+height;
|
204 |
-
}
|
205 |
-
|
206 |
-
|
207 |
var thickDims, tbWidth, tbHeight;
|
208 |
-
jQuery(document).ready(function($) {
|
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 |
</script>
|
272 |
|
273 |
<style>
|
274 |
|
275 |
-
.reports
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
background-color:transparent; !important
|
292 |
-
}
|
293 |
</style>
|
294 |
-
<?php
|
295 |
-
if(isset($labels))
|
296 |
-
{
|
297 |
-
?>
|
298 |
-
<div id="sbox-overlay" 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;" onclick="toggleChBDiv(false)"></div>
|
299 |
-
<div style="background-color:#FFFFFF; width: 350px; height: 350px; overflow-y: scroll; padding: 20px; position: fixed; top: 100px;display:none; border:2px solid #AAAAAA; z-index:65556" id="ChBDiv">
|
300 |
-
|
301 |
-
<form action="#">
|
302 |
-
<p style="font-weight:bold; font-size:18px;margin-top: 0px;">
|
303 |
-
Select Columns
|
304 |
-
</p>
|
305 |
-
|
306 |
-
<input type="checkbox" <?php if($lists['hide_label_list']==='') echo 'checked="checked"' ?> onclick="clickLabChBAll(this)" id="ChBAll" />All</br>
|
307 |
-
|
308 |
-
<?php
|
309 |
-
|
310 |
-
foreach($templabels as $key => $curlabel)
|
311 |
-
{
|
312 |
-
if(strpos($lists['hide_label_list'],'@'.$curlabel.'@')===false)
|
313 |
-
echo '<input type="checkbox" checked="checked" onclick="clickLabChB(\''.$curlabel.'\', this)" />'.$label_titles[$key].'<br />';
|
314 |
-
else
|
315 |
-
echo '<input type="checkbox" onclick="clickLabChB(\''.$curlabel.'\', this)" />'.$label_titles[$key].'<br />';
|
316 |
-
}
|
317 |
-
|
318 |
-
|
319 |
?>
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
325 |
</div>
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
<
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
|
|
|
|
336 |
|
337 |
<tr>
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
|
|
384 |
|
385 |
</tr>
|
386 |
|
387 |
<tr>
|
388 |
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
</table>
|
404 |
-
<?php print_html_nav($pageNav['total'],$pageNav['limit']);
|
405 |
-
?>
|
406 |
-
<table class="wp-list-table widefat fixed posts" style="width:95%; table-layout: inherit !important;" >
|
407 |
-
<thead>
|
408 |
-
<tr>
|
409 |
-
<th width="3%"><?php echo '#'; ?></th>
|
410 |
-
|
411 |
-
<th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input type="checkbox"></th>
|
412 |
-
<?php
|
413 |
-
|
414 |
-
|
415 |
-
?> <th width="4%" scope="col" id="submitid_fc" class="submitid_fc <?php if($sort["sortid_by"]=="group_id") echo $sort["custom_style"]; else echo $sort["default_style"]; ?>" <?php if(!(strpos($lists['hide_label_list'],'@submitid@')===false)) echo 'style="display:none;"';?>><a href="javascript:ordering('group_id',<?php if($sort["sortid_by"]=="group_id") echo $sort["1_or_2"]; else echo "1"; ?>)"><span>ID</span><span class="sorting-indicator"></span></a></th><?php
|
416 |
-
?> <th width="210px" scope="col" id="submitdate_fc" class="submitdate_fc <?php if($sort["sortid_by"]=="date") echo $sort["custom_style"]; else echo $sort["default_style"]; ?>" <?php if(!(strpos($lists['hide_label_list'],'@submitdate@')===false)) echo 'style="display:none;"';?>><a href="javascript:ordering('date',<?php if($sort["sortid_by"]=="date") echo $sort["1_or_2"]; else echo "1"; ?>)"><span>Submit date</span><span class="sorting-indicator"></span></a></th><?php
|
417 |
-
?> <th scope="col" id="submitterip_fc" class="submitterip_fc <?php if($sort["sortid_by"]=="ip") echo $sort["custom_style"]; else echo $sort["default_style"]; ?>" <?php if(!(strpos($lists['hide_label_list'],'@submitterip@')===false)) echo 'style="display:none;"';?>><a href="javascript:ordering('ip',<?php if($sort["sortid_by"]=="ip") echo $sort["1_or_2"]; else echo "1"; ?>)"><span>Submitter's IP Address</span><span class="sorting-indicator"></span></a></th><?php
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
$n=count($rows);
|
422 |
-
|
423 |
-
|
424 |
-
for($i=0; $i < count($labels) ; $i++)
|
425 |
-
{
|
426 |
-
if(strpos($lists['hide_label_list'],'@'.$labels_id[$i].'@')===false) $styleStr='';
|
427 |
-
else $styleStr='display:none;';
|
428 |
-
if($sorted_labels_type[$i]=='type_address')
|
429 |
-
switch($label_titles_copy[$i])
|
430 |
-
{
|
431 |
-
case 'Street Line': $field_title=__('Street Address', 'form_maker'); break;
|
432 |
-
case 'Street Line2': $field_title=__('Street Address Line 2', 'form_maker'); break;
|
433 |
-
case 'City': $field_title=__('City', 'form_maker'); break;
|
434 |
-
case 'State': $field_title=__('State / Province / Region', 'form_maker'); break;
|
435 |
-
case 'Postal': $field_title=__('Postal / Zip Code', 'form_maker'); break;
|
436 |
-
case 'Country': $field_title=__('Country', 'form_maker'); break;
|
437 |
-
default : $field_title=$label_titles_copy[$i]; break;
|
438 |
-
}
|
439 |
-
else
|
440 |
-
$field_title=$label_titles_copy[$i];
|
441 |
-
?>
|
442 |
-
|
443 |
-
<th style="<?php echo $styleStr; ?>" id="<?php echo $labels_id[$i].'_fc';?>" class="<?php echo $labels_id[$i].'_fc'; if($sort["sortid_by"]==$labels_id[$i]."_field") echo $sort["custom_style"].'"'; else echo $sort["default_style"].'"'; ?> "><a href="javascript:ordering('<?php echo $labels_id[$i]."_field"; ?>',<?php if($sort["sortid_by"]==$labels_id[$i]."_field") echo $sort["1_or_2"]; else echo "1"; ?>)"><span><?php echo $field_title ?></span><span class="sorting-indicator"></span></a></th>
|
444 |
-
|
445 |
-
<?php }
|
446 |
-
?>
|
447 |
-
<th style="width:80px">Edit</th>
|
448 |
-
<th style="width:80px"><a href="javascript:submit_del('admin.php?page=Form_maker_Submits&task=remov_cheched')">Delete</a></th>
|
449 |
-
</tr>
|
450 |
-
<tr id="fields_filter" style="display:none">
|
451 |
-
<th width="3%"></th>
|
452 |
-
<th width="3%"></th>
|
453 |
-
<th width="4%" class="submitid_fc" <?php if(!(strpos($lists['hide_label_list'],'@submitid@')===false)) echo 'style="display:none;"';?> ></th>
|
454 |
-
<th width="150" class="submitdate_fc" style="margin:inherit; <?php if(!(strpos($lists['hide_label_list'],'@submitdate@')===false)) echo 'display:none;';?>">
|
455 |
-
<table align="center" style="margin:auto" class="simple_table">
|
456 |
-
<tr class="simple_table">
|
457 |
-
<td class="simple_table" style="text-align:left">From:</td>
|
458 |
-
<td style="text-align:center" class="simple_table"><input class="inputbox" type="text" name="startdate" id="startdate" size="15" maxlength="15" value="<?php echo $lists['startdate'];?>" /></td>
|
459 |
-
<td style="text-align:center" class="simple_table"><input type="reset" style="width:22px" class="button" value="..." onclick="return showCalendar('startdate','%Y-%m-%d');" /></td>
|
460 |
-
</tr>
|
461 |
-
<tr class="simple_table">
|
462 |
-
<td style="text-align:left" class="simple_table">To:</td>
|
463 |
-
<td style="text-align:center" class="simple_table"><input class="inputbox" type="text" name="enddate" id="enddate" size="15" maxlength="15" value="<?php echo $lists['enddate'];?>" /></td>
|
464 |
-
<td style="text-align:center" class="simple_table"><input type="reset" style="width:22px" class="button" value="..." onclick="return showCalendar('enddate','%Y-%m-%d');" /></td>
|
465 |
-
</tr>
|
466 |
-
</table>
|
467 |
-
</th>
|
468 |
-
<th width="100"class="submitterip_fc" <?php if(!(strpos($lists['hide_label_list'],'@submitterip@')===false)) echo 'style="display:none;"';?>>
|
469 |
-
<input type="text" name="ip_search" id="ip_search" value="<?php echo $lists['ip_search'] ?>" onChange="this.form.submit();"/>
|
470 |
-
</th>
|
471 |
-
<?php
|
472 |
-
$n=count($rows);
|
473 |
-
$ka_fielderov_search=false;
|
474 |
-
|
475 |
-
if($lists['ip_search'] || $lists['startdate'] || $lists['enddate']){
|
476 |
-
$ka_fielderov_search=true;
|
477 |
-
}
|
478 |
-
|
479 |
-
for($i=0; $i < count($labels) ; $i++)
|
480 |
-
{
|
481 |
-
if(strpos($lists['hide_label_list'],'@'.$labels_id[$i].'@')===false)
|
482 |
-
$styleStr='';
|
483 |
-
else
|
484 |
-
$styleStr='style="display:none;"';
|
485 |
-
|
486 |
-
if(!$ka_fielderov_search)
|
487 |
-
if($lists[$form_id.'_'.$labels_id[$i].'_search'])
|
488 |
-
{
|
489 |
-
$ka_fielderov_search=true;
|
490 |
-
}
|
491 |
-
|
492 |
-
if($sorted_labels_type[$i]!='type_mark_map')
|
493 |
-
echo '<th class="'.$labels_id[$i].'_fc" '.$styleStr.'>'.'<input name="'.$form_id.'_'.$labels_id[$i].'_search" id="'.$form_id.'_'.$labels_id[$i].'_search" type="text" value="'.$lists[$form_id.'_'.$labels_id[$i].'_search'].'" onChange="this.form.submit();" >'.'</th>';
|
494 |
-
else
|
495 |
-
echo '<th class="'.$labels_id[$i].'_fc" '.$styleStr.'>'.'</th>';
|
496 |
-
}
|
497 |
-
?>
|
498 |
-
<th></th><th></th>
|
499 |
-
</tr>
|
500 |
-
</thead>
|
501 |
-
<?php
|
502 |
-
$k = 0;
|
503 |
-
$m=count($labels);
|
504 |
-
$group_id_s= array();
|
505 |
-
$l=0;
|
506 |
-
if(count($rows_ord)>0 and $m)
|
507 |
-
for($i=0; $i <count($rows_ord); $i++)
|
508 |
-
{
|
509 |
-
|
510 |
-
$row =$rows_ord[$i];
|
511 |
-
|
512 |
-
if(!in_array($row->group_id, $group_id_s))
|
513 |
-
{
|
514 |
-
|
515 |
-
array_push($group_id_s, $row->group_id);
|
516 |
-
|
517 |
-
}
|
518 |
-
|
519 |
-
}
|
520 |
-
for($www=0, $qqq=count($group_id_s); $www < $qqq ; $www++)
|
521 |
-
{
|
522 |
-
$i=$group_id_s[$www];
|
523 |
-
|
524 |
-
$temp= array();
|
525 |
-
for($j=0; $j < $n ; $j++)
|
526 |
-
{
|
527 |
-
$row = $rows[$j];
|
528 |
-
if($row->group_id==$i)
|
529 |
-
{
|
530 |
-
array_push($temp, $row);
|
531 |
-
}
|
532 |
-
}
|
533 |
-
$f=$temp[0];
|
534 |
-
$date=$f->date;
|
535 |
-
$ip=$f->ip;
|
536 |
-
// $checked = JHTML::_('grid.id', $www, $group_id_s[$www]);
|
537 |
-
$link="admin.php?page=Form_maker_Submits&task=edit_submit&id=".$f->group_id;
|
538 |
-
?>
|
539 |
-
|
540 |
-
<tr class="<?php echo "row$k"; ?>">
|
541 |
-
|
542 |
-
<td ><?php echo $www+1;?></td>
|
543 |
-
|
544 |
-
<th style="text-align:center" class="check-column"><input type="checkbox" name="post[]" value="<?php echo $f->group_id; ?>"></th>
|
545 |
-
|
546 |
-
<?php
|
547 |
-
|
548 |
-
if(strpos($lists['hide_label_list'],'@submitid@')===false)
|
549 |
-
echo '<td class="submitid_fc"><a href="'.$link.'" >'.$f->group_id.'</a></td>';
|
550 |
-
else
|
551 |
-
echo '<td class="submitid_fc" style="display:none;"><a href="'.$link.'" >'.$f->group_id.'</a></td>';
|
552 |
-
|
553 |
-
if(strpos($lists['hide_label_list'],'@submitdate@')===false)
|
554 |
-
echo '<td class="submitdate_fc"><a href="'.$link.'" >'.$date.'</a></td>';
|
555 |
-
else
|
556 |
-
echo '<td class="submitdate_fc" style="display:none;"><a href="'.$link.'" >'.$date.'</a></td>';
|
557 |
-
|
558 |
-
if(strpos($lists['hide_label_list'],'@submitterip@')===false)
|
559 |
-
echo '<td class="submitterip_fc"><a href="'.$link.'" >'.$ip.'</a></td>';
|
560 |
-
else
|
561 |
-
echo '<td class="submitterip_fc" style="display:none;"><a href="'.$link.'" >'.$ip.'</a></td>';
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
//print_r($temp);
|
566 |
-
$ttt=count($temp);
|
567 |
-
for($h=0; $h < $m ; $h++)
|
568 |
-
{
|
569 |
-
$not_label=true;
|
570 |
-
for($g=0; $g < $ttt ; $g++)
|
571 |
-
{
|
572 |
-
$t = $temp[$g];
|
573 |
-
if(strpos($lists['hide_label_list'],'@'.$labels_id[$h].'@')===false) $styleStr='';
|
574 |
-
else $styleStr='style="display:none;"';
|
575 |
-
if($t->element_label==$labels_id[$h])
|
576 |
-
{
|
577 |
-
|
578 |
-
if(strpos($t->element_value,"***map***"))
|
579 |
-
{
|
580 |
-
$map_params=explode('***map***',$t->element_value);
|
581 |
-
|
582 |
-
$longit =$map_params[0];
|
583 |
-
$latit =$map_params[1];
|
584 |
-
|
585 |
-
echo '<td align="center" class="'.$labels_id[$h].'_fc" '.$styleStr.'><a class="thickbox-preview" href="'.admin_url('admin-ajax.php?action=frommapeditinpopup&long='.$longit.'&lat='.$latit).'&TB_iframe=1&tbWidth=630&tbHeight=650" >'.'Show on Map'."</a></td>";
|
586 |
-
}
|
587 |
-
else
|
588 |
-
|
589 |
-
if(strpos($t->element_value,"*@@url@@*"))
|
590 |
-
{
|
591 |
-
$new_file=str_replace("*@@url@@*",'', str_replace("***br***",'<br>', $t->element_value));
|
592 |
-
$new_filename=explode('/', $new_file);
|
593 |
-
echo '<td class="'.$labels_id[$h].'_fc" '.$styleStr.'><a target="_blank" href="'.$new_file.'">'.$new_filename[count($new_filename)-1]."</td>";
|
594 |
-
}
|
595 |
-
else
|
596 |
-
echo '<td class="'.$labels_id[$h].'_fc" '.$styleStr.'><pre style="font-family:inherit">'.str_replace("***br***",'<br>', $t->element_value).'</pre></td>';
|
597 |
-
$not_label=false;
|
598 |
-
}
|
599 |
-
}
|
600 |
-
if($not_label)
|
601 |
-
echo '<td class="'.$labels_id[$h].'_fc" '.$styleStr.'></td>';
|
602 |
-
}
|
603 |
-
?>
|
604 |
-
<td><a href="javascript:submit_del('admin.php?page=Form_maker_Submits&task=edit_submit&id=<?php echo $f->group_id; ?>')">Edit</a></td>
|
605 |
-
<td><a href="javascript:submit_del('admin.php?page=Form_maker_Submits&task=remove_submit&id=<?php echo $f->group_id; ?>')">Delete</a></td>
|
606 |
</tr>
|
607 |
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
614 |
|
615 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
616 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
617 |
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
618 |
|
619 |
-
|
620 |
-
|
621 |
-
<?php
|
622 |
-
foreach($sorted_labels_type as $key => $label_type)
|
623 |
-
{
|
624 |
-
if($label_type=="type_checkbox" || $label_type=="type_radio" || $label_type=="type_own_select" || $label_type=="type_country")
|
625 |
-
{
|
626 |
-
?>
|
627 |
-
<br />
|
628 |
-
<br />
|
629 |
-
|
630 |
-
<strong><?php echo $label_titles_copy[$key]?></strong>
|
631 |
-
<br />
|
632 |
-
<br />
|
633 |
|
634 |
-
|
635 |
-
$query = "SELECT element_value FROM ".$wpdb->prefix."formmaker_submits ".$where_choices." AND element_label='".$labels_id[$key]."'";
|
636 |
-
$choices = $wpdb->get_results($query);
|
637 |
-
$colors=array('#2CBADE','#FE6400');
|
638 |
-
$choices_labels=array();
|
639 |
-
$choices_count=array();
|
640 |
-
$all=count($choices);
|
641 |
-
$unanswered=0;
|
642 |
-
foreach($choices as $key => $choice)
|
643 |
-
{
|
644 |
-
if($choice->element_value=='')
|
645 |
-
{
|
646 |
-
$unanswered++;
|
647 |
-
}
|
648 |
-
else
|
649 |
-
{
|
650 |
-
if(!in_array( $choice->element_value,$choices_labels))
|
651 |
-
{
|
652 |
-
array_push($choices_labels, $choice->element_value);
|
653 |
-
array_push($choices_count, 0);
|
654 |
-
}
|
655 |
-
|
656 |
-
$choices_count[array_search($choice->element_value, $choices_labels)]++;
|
657 |
-
}
|
658 |
-
}
|
659 |
-
array_multisort($choices_count,SORT_DESC,$choices_labels);
|
660 |
-
?>
|
661 |
-
<table width="95%" style="width:95%" class="wp-list-table widefat fixed posts">
|
662 |
-
<thead>
|
663 |
-
<tr>
|
664 |
-
<th width="20%">Choices</th>
|
665 |
-
<th>Percentage</th>
|
666 |
-
<th width="10%">Count</th>
|
667 |
-
</tr>
|
668 |
-
</thead>
|
669 |
-
<?php
|
670 |
-
foreach($choices_labels as $key => $choices_label)
|
671 |
-
{
|
672 |
-
?>
|
673 |
-
<tr>
|
674 |
-
<td><?php echo str_replace("***br***",'<br>', $choices_label)?></td>
|
675 |
-
<td><div class="bordered" style="width:<?php echo ($choices_count[$key]/($all-$unanswered))*100; ?>%; height:18px; background-color:<?php echo $colors[$key % 2]; ?>"> </div></td>
|
676 |
-
<td><?php echo $choices_count[$key]?></td>
|
677 |
-
</tr>
|
678 |
-
<?php
|
679 |
-
}
|
680 |
-
|
681 |
-
if($unanswered){
|
682 |
-
?>
|
683 |
-
<tr>
|
684 |
-
<td colspan="2" align="right">Unanswered</th>
|
685 |
-
<td><strong><?php echo $unanswered;?></strong></th>
|
686 |
-
</tr>
|
687 |
|
688 |
-
|
689 |
-
|
690 |
-
?>
|
691 |
-
<tr>
|
692 |
-
<td colspan="2" align="right"><strong>Total</strong></th>
|
693 |
-
<td><strong><?php echo $all;?></strong></th>
|
694 |
-
</tr>
|
695 |
|
696 |
-
|
697 |
-
<?php
|
698 |
-
}
|
699 |
-
}
|
700 |
-
?>
|
701 |
|
702 |
-
|
703 |
-
|
704 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
705 |
|
706 |
-
|
707 |
|
708 |
-
<input type="hidden" name="filter_order_Dir2" value="<?php echo $lists['order_Dir']; ?>" />
|
709 |
|
710 |
-
|
|
|
711 |
|
712 |
-
|
713 |
-
<?php if($ka_fielderov_search){?>
|
714 |
-
document.getElementById('fields_filter').style.display='';
|
715 |
-
<?php
|
716 |
-
}?>
|
717 |
-
</script>
|
718 |
|
719 |
-
|
|
|
720 |
|
721 |
|
722 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
723 |
|
|
|
|
|
|
|
|
|
|
|
|
|
724 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
725 |
|
|
|
|
|
|
|
|
|
|
|
726 |
|
727 |
|
728 |
|
|
|
729 |
|
|
|
730 |
|
|
|
731 |
|
|
|
732 |
|
|
|
|
|
|
|
|
|
|
|
|
|
733 |
|
|
|
|
|
734 |
|
|
|
|
|
735 |
|
736 |
-
function html_editSubmit($rows, $labels_id ,$labels_name,$labels_type){
|
737 |
-
?>
|
738 |
-
|
739 |
<script language="javascript" type="text/javascript">
|
740 |
|
741 |
-
function submitbutton(pressbutton) {
|
742 |
-
|
743 |
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
}
|
749 |
|
750 |
-
|
751 |
-
}
|
752 |
-
function submitform(pressbutton)
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
</script>
|
759 |
<table width="90%">
|
760 |
-
|
761 |
-
<
|
762 |
-
|
763 |
-
|
764 |
-
|
|
|
|
|
|
|
|
|
765 |
</tr>
|
766 |
-
</tbody
|
767 |
-
|
768 |
-
<
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
if($labels_type[$key]!='type_checkbox')
|
811 |
-
echo ' <tr>
|
812 |
<td class="key">
|
813 |
<label for="title">
|
814 |
-
'
|
815 |
</label>
|
816 |
</td>
|
817 |
<td >
|
818 |
-
<input type="text" name="submission_'
|
819 |
</td>
|
820 |
</tr>
|
821 |
';
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
<td class="key" rowspan="'.count($choices).'">
|
828 |
<label for="title">
|
829 |
-
'
|
830 |
</label>
|
831 |
</td>';
|
832 |
-
|
833 |
-
|
834 |
<td >
|
835 |
-
<input type="text" name="submission_'
|
836 |
</td>
|
837 |
</tr>
|
838 |
';
|
839 |
-
|
840 |
-
|
841 |
-
}
|
842 |
|
843 |
-
?>
|
844 |
-
|
845 |
-
<input type="hidden" name="option" value="com_formmaker"
|
846 |
-
<input type="hidden" name="id" value="<?php echo $rows[0]->group_id?>"
|
847 |
-
<input type="hidden" name="form_id" value="<?php echo $rows[0]->form_id?>"
|
848 |
-
<input type="hidden" name="date" value="<?php echo $rows[0]->date?>"
|
849 |
-
<input type="hidden" name="ip" value="<?php echo $rows[0]->ip?>"
|
850 |
-
<input type="hidden" name="task" value="save_submit"
|
851 |
</form>
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
}
|
858 |
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
?>
|
1 |
<?php
|
2 |
+
if (!current_user_can('manage_options')) {
|
3 |
+
die('Access Denied');
|
4 |
}
|
5 |
+
function html_show_submits($rows, $forms, $lists, $pageNav, $labels, $label_titles, $rows_ord, $filter_order_Dir, $form_id, $labels_id, $sorted_labels_type, $total_entries, $total_views, $where, $where_choices, $sort) {
|
6 |
+
$label_titles_copy = $label_titles;
|
7 |
+
global $wpdb;
|
8 |
+
$n = count($rows);
|
9 |
+
$m = count($labels);
|
10 |
+
$group_id_s = array();
|
11 |
+
$rows_ord_none = array();
|
12 |
+
if (count($rows_ord) > 0 and $m)
|
13 |
+
for ($i = 0; $i < count($rows_ord); $i++) {
|
14 |
+
$row = $rows_ord[$i];
|
15 |
+
if (!in_array($row->group_id, $group_id_s)) {
|
16 |
+
array_push($group_id_s, $row->group_id);
|
17 |
+
}
|
18 |
+
}
|
19 |
+
|
20 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
<style>
|
22 |
+
.calendar .button {
|
23 |
+
display: table-cell !important;
|
24 |
+
}
|
|
|
25 |
</style>
|
26 |
<script type="text/javascript">
|
27 |
+
function tableOrdering(order, dir, task) {
|
28 |
+
var form = document.admin_form;
|
29 |
+
form.filter_order2.value = order;
|
30 |
+
form.filter_order_Dir2.value = dir;
|
31 |
+
submitform(task);
|
32 |
+
}
|
33 |
+
function ordering(name, as_or_desc) {
|
34 |
+
document.getElementById('asc_or_desc').value = as_or_desc;
|
35 |
+
document.getElementById('order_by').value = name;
|
36 |
+
document.getElementById('admin_form').submit();
|
37 |
}
|
38 |
+
function renderColumns() {
|
39 |
+
allTags = document.getElementsByTagName('*');
|
40 |
+
|
41 |
+
for (curTag in allTags) {
|
42 |
+
if (typeof(allTags[curTag].className) != "undefined")
|
43 |
+
if (allTags[curTag].className.indexOf('_fc') > 0) {
|
44 |
+
curLabel = allTags[curTag].className.replace('_fc', '');
|
45 |
+
if (document.forms.admin_form.hide_label_list.value.indexOf('@' + curLabel + '@') >= 0)
|
46 |
+
allTags[curTag].style.display = 'none';
|
47 |
+
else
|
48 |
+
allTags[curTag].style.display = '';
|
49 |
+
}
|
50 |
+
if (typeof(allTags[curTag].id) != "undefined")
|
51 |
+
if (allTags[curTag].id.indexOf('_fc') > 0) {
|
52 |
+
curLabel = allTags[curTag].id.replace('_fc', '');
|
53 |
+
if (document.forms.admin_form.hide_label_list.value.indexOf('@' + curLabel + '@') >= 0)
|
54 |
+
allTags[curTag].style.display = 'none';
|
55 |
+
else
|
56 |
+
allTags[curTag].style.display = '';
|
57 |
+
}
|
58 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
}
|
60 |
|
61 |
+
function clickLabChB(label, ChB) {
|
62 |
+
document.forms.admin_form.hide_label_list.value = document.forms.admin_form.hide_label_list.value.replace('@' + label + '@', '');
|
63 |
+
if (document.forms.admin_form.hide_label_list.value == '') document.getElementById('ChBAll').checked = true;
|
64 |
+
|
65 |
+
if (!(ChB.checked)) {
|
66 |
+
document.forms.admin_form.hide_label_list.value += '@' + label + '@';
|
67 |
+
document.getElementById('ChBAll').checked = false;
|
68 |
+
}
|
69 |
+
renderColumns();
|
|
|
|
|
70 |
}
|
71 |
|
72 |
+
function toggleChBDiv(b) {
|
73 |
+
if (b) {
|
74 |
+
sizes = window.getSize().size;
|
75 |
+
document.getElementById("sbox-overlay").style.width = sizes.x + "px";
|
76 |
+
document.getElementById("sbox-overlay").style.height = sizes.y + "px";
|
77 |
+
document.getElementById("ChBDiv").style.left = Math.floor((sizes.x - 350) / 2) + "px";
|
78 |
+
|
79 |
+
document.getElementById("ChBDiv").style.display = "block";
|
80 |
+
document.getElementById("sbox-overlay").style.display = "block";
|
81 |
+
}
|
82 |
+
else {
|
83 |
+
document.getElementById("ChBDiv").style.display = "none";
|
84 |
+
document.getElementById("sbox-overlay").style.display = "none";
|
85 |
+
}
|
|
|
|
|
|
|
86 |
}
|
87 |
|
88 |
+
function clickLabChBAll(ChBAll) {
|
89 |
+
<?php
|
90 |
+
if (isset($labels)) {
|
91 |
+
$templabels = array_merge(array(
|
92 |
+
'submitid',
|
93 |
+
'submitdate',
|
94 |
+
'submitterip'
|
95 |
+
), $labels_id);
|
96 |
+
$label_titles = array_merge(array(
|
97 |
+
'ID',
|
98 |
+
'Submit date',
|
99 |
+
"Submitter's IP Address"
|
100 |
+
), $label_titles);
|
101 |
+
}
|
102 |
+
?>
|
103 |
+
|
104 |
+
if (ChBAll.checked) {
|
105 |
+
document.forms.admin_form.hide_label_list.value = '';
|
106 |
+
|
107 |
+
for (i = 0; i <= ChBAll.form.length; i++)
|
108 |
+
if (typeof(ChBAll.form[i]) != "undefined")
|
109 |
+
if (ChBAll.form[i].type == "checkbox")
|
110 |
+
ChBAll.form[i].checked = true;
|
111 |
+
}
|
112 |
+
else {
|
113 |
+
document.forms.admin_form.hide_label_list.value = '@<?php echo implode($templabels, '@@') ?>@';
|
114 |
+
|
115 |
+
for (i = 0; i <= ChBAll.form.length; i++)
|
116 |
+
if (typeof(ChBAll.form[i]) != "undefined")
|
117 |
+
if (ChBAll.form[i].type == "checkbox")
|
118 |
+
ChBAll.form[i].checked = false;
|
119 |
+
}
|
120 |
+
|
121 |
+
renderColumns();
|
122 |
}
|
123 |
|
124 |
+
function remove_all() {
|
125 |
+
document.getElementById('startdate').value = '';
|
126 |
+
document.getElementById('enddate').value = '';
|
127 |
+
document.getElementById('ip_search').value = '';
|
128 |
+
<?php
|
129 |
+
$n = count($rows);
|
130 |
+
|
131 |
+
for ($i = 0; $i < count($labels); $i++) {
|
132 |
+
echo "document.getElementById('" . $form_id . '_' . $labels_id[$i] . "_search').value='';
|
|
|
|
|
133 |
";
|
134 |
+
}
|
135 |
+
?>
|
136 |
+
}
|
137 |
+
|
138 |
+
function show_hide_filter() {
|
139 |
+
if (document.getElementById('fields_filter').style.display == "none") {
|
140 |
+
document.getElementById('fields_filter').style.display = '';
|
141 |
+
document.getElementById('filter_img').src = '<?php echo plugins_url('images/filter_hide.png', __FILE__) ?>';
|
142 |
+
}
|
143 |
+
else {
|
144 |
+
document.getElementById('fields_filter').style.display = "none";
|
145 |
+
document.getElementById('filter_img').src = '<?php echo plugins_url('images/filter_show.png', __FILE__) ?>';
|
146 |
+
}
|
147 |
}
|
148 |
+
function submit_del(href_in) {
|
149 |
+
document.getElementById('admin_form').action = href_in;
|
150 |
+
document.getElementById('admin_form').submit();
|
151 |
+
}
|
152 |
+
<!--
|
153 |
+
function submitbutton(pressbutton) {
|
154 |
+
var form = document.adminForm;
|
155 |
+
if (pressbutton == 'cancel_theme') {
|
156 |
+
submitform(pressbutton);
|
157 |
+
return;
|
158 |
+
}
|
159 |
+
|
160 |
+
if (document.getElementById('title').value == '') {
|
161 |
+
alert('The theme must have a title')
|
162 |
+
return;
|
163 |
+
}
|
164 |
+
submitform(pressbutton);
|
165 |
+
}
|
166 |
+
|
167 |
|
168 |
+
function submitform(pressbutton) {
|
169 |
+
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
170 |
+
document.getElementById('adminForm').submit();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
}
|
172 |
+
//-->
|
173 |
+
|
174 |
+
function change_width() {
|
175 |
+
width = parseInt(document.getElementById('width').value) + 45 + parseInt(document.getElementById('border_width').value);
|
176 |
+
height = 550;
|
177 |
+
|
178 |
+
document.getElementById('spider_calendar_preview').href = "http://localhost/wordpress/wp-content/plugins/spider-calendar/preview.php?TB_iframe=1&tbWidth=" + width + "&tbHeight=" + height;
|
179 |
}
|
180 |
+
|
181 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
var thickDims, tbWidth, tbHeight;
|
183 |
+
jQuery(document).ready(function ($) {
|
184 |
+
|
185 |
+
thickDims = function () {
|
186 |
+
var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
|
187 |
+
|
188 |
+
w = (tbWidth && tbWidth < W - 90) ? tbWidth : W - 200;
|
189 |
+
h = (tbHeight && tbHeight < H - 60) ? tbHeight : H - 200;
|
190 |
+
|
191 |
+
if (tbWindow.size()) {
|
192 |
+
tbWindow.width(w).height(h);
|
193 |
+
$('#TB_iframeContent').width(w).height(h - 27);
|
194 |
+
tbWindow.css({'margin-left':'-' + parseInt((w / 2), 10) + 'px'});
|
195 |
+
if (typeof document.body.style.maxWidth != 'undefined')
|
196 |
+
tbWindow.css({'top':(H - h) / 2, 'margin-top':'0'});
|
197 |
+
}
|
198 |
+
};
|
199 |
+
|
200 |
+
thickDims();
|
201 |
+
$(window).resize(function () {
|
202 |
+
thickDims()
|
203 |
+
});
|
204 |
+
|
205 |
+
$('a.thickbox-preview').click(function () {
|
206 |
+
tb_click.call(this);
|
207 |
+
|
208 |
+
var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text;
|
209 |
+
|
210 |
+
if (tbWidth = href.match(/&tbWidth=[0-9]+/))
|
211 |
+
tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
|
212 |
+
else
|
213 |
+
tbWidth = $(window).width() - 90;
|
214 |
+
|
215 |
+
if (tbHeight = href.match(/&tbHeight=[0-9]+/))
|
216 |
+
tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
|
217 |
+
else
|
218 |
+
tbHeight = $(window).height() - 60;
|
219 |
+
|
220 |
+
if (alink.length) {
|
221 |
+
url = alink.attr('href') || '';
|
222 |
+
text = alink.attr('title') || '';
|
223 |
+
link = ' <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
|
224 |
+
} else {
|
225 |
+
text = $(this).attr('title') || '';
|
226 |
+
link = ' <span class="tb-theme-preview-link">' + text + '</span>';
|
227 |
+
}
|
228 |
+
|
229 |
+
$('#TB_title').css({'background-color':'#222', 'color':'#dfdfdf'});
|
230 |
+
$('#TB_closeAjaxWindow').css({'float':'left'});
|
231 |
+
$('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
|
232 |
+
|
233 |
+
$('#TB_iframeContent').width('100%');
|
234 |
+
thickDims();
|
235 |
+
|
236 |
+
return false;
|
237 |
+
});
|
238 |
+
|
239 |
+
// Theme details
|
240 |
+
$('.theme-detail').click(function () {
|
241 |
+
$(this).siblings('.themedetaildiv').toggle();
|
242 |
+
return false;
|
243 |
+
});
|
244 |
|
245 |
});
|
246 |
|
247 |
+
|
248 |
</script>
|
249 |
|
250 |
<style>
|
251 |
|
252 |
+
.reports {
|
253 |
+
border: 1px solid #DEDEDE;
|
254 |
+
border-radius: 11px;
|
255 |
+
background-color: #F0F0F0;
|
256 |
+
text-align: center;
|
257 |
+
width: 100px;
|
258 |
+
}
|
259 |
+
|
260 |
+
.bordered {
|
261 |
+
border-radius: 8px
|
262 |
+
}
|
263 |
+
|
264 |
+
.simple_table {
|
265 |
+
background-color: transparent;
|
266 |
+
!important
|
267 |
+
}
|
|
|
|
|
268 |
</style>
|
269 |
+
<?php
|
270 |
+
if (isset($labels)) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
?>
|
272 |
+
<div id="sbox-overlay"
|
273 |
+
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;"
|
274 |
+
onclick="toggleChBDiv(false)"></div>
|
275 |
+
<div
|
276 |
+
style="background-color:#FFFFFF; width: 350px; height: 350px; overflow-y: scroll; padding: 20px; position: fixed; top: 100px;display:none; border:2px solid #AAAAAA; z-index:65556"
|
277 |
+
id="ChBDiv">
|
278 |
+
|
279 |
+
<form action="#">
|
280 |
+
<p style="font-weight:bold; font-size:18px;margin-top: 0px;">
|
281 |
+
Select Columns
|
282 |
+
</p>
|
283 |
+
|
284 |
+
<input type="checkbox" <?php if ($lists['hide_label_list'] === '')
|
285 |
+
echo 'checked="checked"' ?> onclick="clickLabChBAll(this)" id="ChBAll"/>All</br>
|
286 |
+
|
287 |
+
<?php
|
288 |
+
|
289 |
+
foreach ($templabels as $key => $curlabel) {
|
290 |
+
if (strpos($lists['hide_label_list'], '@' . $curlabel . '@') === FALSE)
|
291 |
+
echo '<input type="checkbox" checked="checked" onclick="clickLabChB(\'' . $curlabel . '\', this)" />' . stripslashes($label_titles[$key]) . '<br />';
|
292 |
+
else
|
293 |
+
echo '<input type="checkbox" onclick="clickLabChB(\'' . $curlabel . '\', this)" />' . stripslashes($label_titles[$key]) . '<br />';
|
294 |
+
}
|
295 |
+
|
296 |
+
|
297 |
+
?>
|
298 |
+
<br/>
|
299 |
+
|
300 |
+
<div style="text-align:center;">
|
301 |
+
<input type="button" onclick="toggleChBDiv(false);" value="Done"/>
|
302 |
+
</div>
|
303 |
+
</form>
|
304 |
+
</div>
|
305 |
+
|
306 |
+
<?php } ?>
|
307 |
+
<div style="font-size:14px; font-weight:bold">
|
308 |
+
<a href="http://web-dorado.com/wordpress-form-maker-guide-2.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
|
309 |
+
<br />
|
310 |
+
This section allows you to view and manage form submissions.
|
311 |
+
<a href="http://web-dorado.com/wordpress-form-maker-guide-6.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
312 |
</div>
|
313 |
+
<form action="admin.php?page=Form_maker_Submits" method="post" id="admin_form"
|
314 |
+
name="admin_form">
|
315 |
+
<input type="hidden" name="option" value="com_formmaker">
|
316 |
+
<input type="hidden" name="task" value="submits">
|
317 |
+
<input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if (isset($_POST['asc_or_desc'])) {
|
318 |
+
echo esc_html($_POST['asc_or_desc']);
|
319 |
+
} ?>">
|
320 |
+
<input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by'])) {
|
321 |
+
echo esc_html($_POST['order_by']);
|
322 |
+
} ?>">
|
323 |
+
<br/>
|
324 |
+
<table width="95%">
|
325 |
|
326 |
<tr>
|
327 |
+
<td colspan="11">
|
328 |
+
<div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
|
329 |
+
<a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank"
|
330 |
+
style="color:red; text-decoration:none;">
|
331 |
+
<img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="www.web-dorado.com"
|
332 |
+
width="215"><br>
|
333 |
+
Get the full version
|
334 |
+
</a>
|
335 |
+
</div>
|
336 |
+
</td>
|
337 |
+
</tr>
|
338 |
+
<tr style="line-height:inherit !important;">
|
339 |
+
<td align="left" width="300"> Select a form:
|
340 |
+
<select name="form_id" id="form_id"
|
341 |
+
onchange="if(document.getElementById('startdate'))remove_all();document.admin_form.submit();">
|
342 |
+
<option value="0" selected="selected"> Select a Form</option>
|
343 |
+
<?php
|
344 |
+
$option = 'com_formmaker';
|
345 |
+
if ($forms)
|
346 |
+
for ($i = 0, $n = count($forms); $i < $n; $i++) {
|
347 |
+
$form = $forms[$i];
|
348 |
+
if ($form_id == $form->id) {
|
349 |
+
echo "<option value='" . $form->id . "' selected='selected'>" . $form->title . "</option>";
|
350 |
+
$form_title = $form->title;
|
351 |
+
}
|
352 |
+
else
|
353 |
+
echo "<option value='" . $form->id . "' >" . $form->title . "</option>";
|
354 |
+
}
|
355 |
+
?>
|
356 |
+
</select>
|
357 |
+
</td>
|
358 |
+
<?php if (isset($form_id) and $form_id > 0): ?>
|
359 |
+
<td class="reports"><strong>Entries</strong><br/><?php echo $total_entries; ?></td>
|
360 |
+
<td class="reports"><strong>Views</strong><br/><?php echo $total_views ?></td>
|
361 |
+
<td class="reports"><strong>Conversion Rate</strong><br/><?php if ($total_views)
|
362 |
+
echo round((($total_entries / $total_views) * 100), 2) . '%';
|
363 |
+
else echo '0%' ?></td>
|
364 |
+
<td style="font-size:36px;text-align:center;line-height: initial;">
|
365 |
+
<?php echo $form_title ?>
|
366 |
+
</td>
|
367 |
+
<td style="text-align:right;" width="300">
|
368 |
+
Export to
|
369 |
+
<input type="button" value="CSV"
|
370 |
+
onclick="window.location='<?php echo admin_url('admin-ajax.php?action=formmakergeneretecsv'); ?>&form_id=<?php echo $form_id; ?>'"/>
|
371 |
+
<input type="button" value="XML"
|
372 |
+
onclick="window.location='<?php echo admin_url('admin-ajax.php?action=formmakergeneretexml'); ?>&form_id=<?php echo $form_id; ?>'"/>
|
373 |
+
</td>
|
374 |
|
375 |
</tr>
|
376 |
|
377 |
<tr>
|
378 |
|
379 |
+
<td colspan=5>
|
380 |
+
<br/>
|
381 |
+
<input type="hidden" name="hide_label_list" value="<?php echo $lists['hide_label_list']; ?>"/>
|
382 |
+
<img src="<?php echo plugins_url("images/filter_show.png", __FILE__) ?>" width="40"
|
383 |
+
style="vertical-align:bottom; cursor:pointer" onclick="show_hide_filter()" title="Search by fields"
|
384 |
+
id="filter_img"/>
|
385 |
+
<input type="button" onclick="this.form.submit();" value="Go"/>
|
386 |
+
<input type="button" onclick="remove_all();this.form.submit();" value="Reset"/>
|
387 |
+
</td>
|
388 |
+
<td align="right">
|
389 |
+
<br/><br/>
|
390 |
+
<?php if (isset($labels))
|
391 |
+
echo '<input type="button" onclick="toggleChBDiv(true)" value="Add/Remove Columns" />'; ?>
|
392 |
+
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
393 |
</tr>
|
394 |
|
395 |
+
<?php else: echo '<td><br /><br /><br /></td></tr>'; endif; ?>
|
396 |
+
</table>
|
397 |
+
<?php print_html_nav($pageNav['total'], $pageNav['limit']);
|
398 |
+
?>
|
399 |
+
<div style="border-radius: 3px 3px 3px 3px;border: 1px solid #F0F0F0; overflow-x:auto; width:95%; ">
|
400 |
+
<table class="wp-list-table widefat fixed posts" style="width:95%; table-layout: inherit !important;">
|
401 |
+
<thead>
|
402 |
+
<tr>
|
403 |
+
<th width="3%"><?php echo '#'; ?></th>
|
404 |
+
|
405 |
+
<th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input type="checkbox"></th>
|
406 |
+
<?php
|
407 |
+
|
408 |
+
|
409 |
+
?>
|
410 |
+
<th width="4%" scope="col" id="submitid_fc" class="submitid_fc <?php if ($sort["sortid_by"] == "group_id")
|
411 |
+
echo $sort["custom_style"];
|
412 |
+
else echo $sort["default_style"]; ?>" <?php if (!(strpos($lists['hide_label_list'], '@submitid@') === FALSE))
|
413 |
+
echo 'style="display:none;"';?>><a href="javascript:ordering('group_id',<?php if ($sort["sortid_by"] == "group_id")
|
414 |
+
echo $sort["1_or_2"];
|
415 |
+
else echo "1"; ?>)"><span>ID</span><span class="sorting-indicator"></span></a></th><?php
|
416 |
+
?>
|
417 |
+
<th width="210px" scope="col" id="submitdate_fc" class="submitdate_fc <?php if ($sort["sortid_by"] == "date")
|
418 |
+
echo $sort["custom_style"];
|
419 |
+
else echo $sort["default_style"]; ?>" <?php if (!(strpos($lists['hide_label_list'], '@submitdate@') === FALSE))
|
420 |
+
echo 'style="display:none;"';?>><a href="javascript:ordering('date',<?php if ($sort["sortid_by"] == "date")
|
421 |
+
echo $sort["1_or_2"];
|
422 |
+
else echo "1"; ?>)"><span>Submit date</span><span class="sorting-indicator"></span></a></th><?php
|
423 |
+
?>
|
424 |
+
<th scope="col" id="submitterip_fc" class="submitterip_fc <?php if ($sort["sortid_by"] == "ip")
|
425 |
+
echo $sort["custom_style"];
|
426 |
+
else echo $sort["default_style"]; ?>" <?php if (!(strpos($lists['hide_label_list'], '@submitterip@') === FALSE))
|
427 |
+
echo 'style="display:none;"';?>><a href="javascript:ordering('ip',<?php if ($sort["sortid_by"] == "ip")
|
428 |
+
echo $sort["1_or_2"];
|
429 |
+
else echo "1"; ?>)"><span>Submitter's IP Address</span><span class="sorting-indicator"></span></a></th><?php
|
430 |
+
|
431 |
+
|
432 |
+
|
433 |
+
$n = count($rows);
|
434 |
+
|
435 |
+
|
436 |
+
for ($i = 0; $i < count($labels); $i++) {
|
437 |
+
if (strpos($lists['hide_label_list'], '@' . $labels_id[$i] . '@') === FALSE)
|
438 |
+
$styleStr = '';
|
439 |
+
else $styleStr = 'display:none;';
|
440 |
+
if ($sorted_labels_type[$i] == 'type_address'
|
441 |
+
)
|
442 |
+
switch ($label_titles_copy[$i]) {
|
443 |
+
case 'Street Line':
|
444 |
+
$field_title = __('Street Address', 'form_maker');
|
445 |
+
break;
|
446 |
+
case 'Street Line2':
|
447 |
+
$field_title = __('Street Address Line 2', 'form_maker');
|
448 |
+
break;
|
449 |
+
case 'City':
|
450 |
+
$field_title = __('City', 'form_maker');
|
451 |
+
break;
|
452 |
+
case 'State':
|
453 |
+
$field_title = __('State / Province / Region', 'form_maker');
|
454 |
+
break;
|
455 |
+
case 'Postal':
|
456 |
+
$field_title = __('Postal / Zip Code', 'form_maker');
|
457 |
+
break;
|
458 |
+
case 'Country':
|
459 |
+
$field_title = __('Country', 'form_maker');
|
460 |
+
break;
|
461 |
+
default :
|
462 |
+
$field_title = stripslashes($label_titles_copy[$i]);
|
463 |
+
break;
|
464 |
+
}
|
465 |
+
else
|
466 |
+
$field_title = stripslashes($label_titles_copy[$i]);
|
467 |
+
?>
|
468 |
|
469 |
+
<th style="<?php echo $styleStr; ?>" id="<?php echo $labels_id[$i] . '_fc';?>"
|
470 |
+
class="<?php echo $labels_id[$i] . '_fc'; if ($sort["sortid_by"] == $labels_id[$i] . "_field")
|
471 |
+
echo $sort["custom_style"] . '"';
|
472 |
+
else echo $sort["default_style"] . '"'; ?> "><a
|
473 |
+
href="javascript:ordering('<?php echo $labels_id[$i] . "_field"; ?>',<?php if ($sort["sortid_by"] == $labels_id[$i] . "_field")
|
474 |
+
echo $sort["1_or_2"];
|
475 |
+
else echo "1"; ?>)"><span><?php echo $field_title ?></span><span class="sorting-indicator"></span></a></th>
|
476 |
|
477 |
+
<?php
|
478 |
+
}
|
479 |
+
?>
|
480 |
+
<th style="width:80px">Edit</th>
|
481 |
+
<th style="width:80px"><a
|
482 |
+
href="javascript:submit_del('admin.php?page=Form_maker_Submits&task=remov_cheched')">Delete</a></th>
|
483 |
+
</tr>
|
484 |
+
<tr id="fields_filter" style="display:none">
|
485 |
+
<th width="3%"></th>
|
486 |
+
<th width="3%"></th>
|
487 |
+
<th width="4%" class="submitid_fc" <?php if (!(strpos($lists['hide_label_list'], '@submitid@') === FALSE))
|
488 |
+
echo 'style="display:none;"';?> ></th>
|
489 |
+
<th width="150" class="submitdate_fc"
|
490 |
+
style="margin:inherit; <?php if (!(strpos($lists['hide_label_list'], '@submitdate@') === FALSE))
|
491 |
+
echo 'display:none;';?>">
|
492 |
+
<table align="center" style="margin:auto" class="simple_table">
|
493 |
+
<tr class="simple_table">
|
494 |
+
<td class="simple_table" style="text-align:left">From:</td>
|
495 |
+
<td style="text-align:center" class="simple_table"><input class="inputbox" type="text" name="startdate"
|
496 |
+
id="startdate" size="15" maxlength="15"
|
497 |
+
value="<?php echo $lists['startdate'];?>"/></td>
|
498 |
+
<td style="text-align:center" class="simple_table"><input type="reset" style="width:22px" class="button"
|
499 |
+
value="..."
|
500 |
+
onclick="return showCalendar('startdate','%Y-%m-%d');"/>
|
501 |
+
</td>
|
502 |
+
</tr>
|
503 |
+
<tr class="simple_table">
|
504 |
+
<td style="text-align:left" class="simple_table">To:</td>
|
505 |
+
<td style="text-align:center" class="simple_table"><input class="inputbox" type="text" name="enddate"
|
506 |
+
id="enddate" size="15" maxlength="15"
|
507 |
+
value="<?php echo $lists['enddate'];?>"/></td>
|
508 |
+
<td style="text-align:center" class="simple_table"><input type="reset" style="width:22px" class="button"
|
509 |
+
value="..."
|
510 |
+
onclick="return showCalendar('enddate','%Y-%m-%d');"/>
|
511 |
+
</td>
|
512 |
+
</tr>
|
513 |
</table>
|
514 |
+
</th>
|
515 |
+
<th width="100" class="submitterip_fc" <?php if (!(strpos($lists['hide_label_list'], '@submitterip@') === FALSE))
|
516 |
+
echo 'style="display:none;"';?>>
|
517 |
+
<input type="text" name="ip_search" id="ip_search" value="<?php echo $lists['ip_search'] ?>"
|
518 |
+
onChange="this.form.submit();"/>
|
519 |
+
</th>
|
520 |
+
<?php
|
521 |
+
$n = count($rows);
|
522 |
+
$ka_fielderov_search = FALSE;
|
523 |
+
|
524 |
+
if ($lists['ip_search'] || $lists['startdate'] || $lists['enddate']) {
|
525 |
+
$ka_fielderov_search = TRUE;
|
526 |
+
}
|
527 |
+
|
528 |
+
for ($i = 0; $i < count($labels); $i++) {
|
529 |
+
if (strpos($lists['hide_label_list'], '@' . $labels_id[$i] . '@') === FALSE)
|
530 |
+
$styleStr = '';
|
531 |
+
else
|
532 |
+
$styleStr = 'style="display:none;"';
|
533 |
+
if (!$ka_fielderov_search)
|
534 |
+
if ($lists[$form_id . '_' . $labels_id[$i] . '_search']) {
|
535 |
+
$ka_fielderov_search = TRUE;
|
536 |
+
}
|
537 |
+
if ($sorted_labels_type[$i] != 'type_mark_map')
|
538 |
+
echo '<th class="' . $labels_id[$i] . '_fc" ' . $styleStr . '>' . '<input name="' . $form_id . '_' . $labels_id[$i] . '_search" id="' . $form_id . '_' . $labels_id[$i] . '_search" type="text" value="' . $lists[$form_id . '_' . $labels_id[$i] . '_search'] . '" onChange="this.form.submit();" >' . '</th>';
|
539 |
+
else
|
540 |
+
echo '<th class="' . $labels_id[$i] . '_fc" ' . $styleStr . '>' . '</th>';
|
541 |
+
}
|
542 |
+
?>
|
543 |
+
<th></th>
|
544 |
+
<th></th>
|
545 |
+
</tr>
|
546 |
+
</thead>
|
547 |
+
<?php
|
548 |
+
$k = 0;
|
549 |
+
$m = count($labels);
|
550 |
+
$group_id_s = array();
|
551 |
+
$l = 0;
|
552 |
+
if (count($rows_ord) > 0 and $m)
|
553 |
+
for ($i = 0; $i < count($rows_ord); $i++) {
|
554 |
+
$row = $rows_ord[$i];
|
555 |
+
if (!in_array($row->group_id, $group_id_s)) {
|
556 |
+
array_push($group_id_s, $row->group_id);
|
557 |
+
}
|
558 |
+
}
|
559 |
+
for ($www = 0, $qqq = count($group_id_s); $www < $qqq; $www++) {
|
560 |
+
$i = $group_id_s[$www];
|
561 |
+
$temp = array();
|
562 |
+
for ($j = 0; $j < $n; $j++) {
|
563 |
+
$row = $rows[$j];
|
564 |
+
if ($row->group_id == $i) {
|
565 |
+
array_push($temp, $row);
|
566 |
+
}
|
567 |
+
}
|
568 |
+
$f = $temp[0];
|
569 |
+
$date = $f->date;
|
570 |
+
$ip = $f->ip;
|
571 |
+
// $checked = JHTML::_('grid.id', $www, $group_id_s[$www]);
|
572 |
+
$link = "admin.php?page=Form_maker_Submits&task=edit_submit&id=" . $f->group_id;
|
573 |
+
?>
|
574 |
|
575 |
+
<tr class="<?php echo "row$k"; ?>">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
576 |
|
577 |
+
<td><?php echo $www + 1;?></td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
578 |
|
579 |
+
<th style="text-align:center" class="check-column"><input type="checkbox" name="post[]"
|
580 |
+
value="<?php echo $f->group_id; ?>"></th>
|
|
|
|
|
|
|
|
|
|
|
581 |
|
582 |
+
<?php
|
|
|
|
|
|
|
|
|
583 |
|
584 |
+
if (strpos($lists['hide_label_list'], '@submitid@') === FALSE)
|
585 |
+
echo '<td class="submitid_fc"><a href="' . $link . '" >' . $f->group_id . '</a></td>';
|
586 |
+
else
|
587 |
+
echo '<td class="submitid_fc" style="display:none;"><a href="' . $link . '" >' . $f->group_id . '</a></td>';
|
588 |
+
|
589 |
+
if (strpos($lists['hide_label_list'], '@submitdate@') === FALSE)
|
590 |
+
echo '<td class="submitdate_fc"><a href="' . $link . '" >' . $date . '</a></td>';
|
591 |
+
else
|
592 |
+
echo '<td class="submitdate_fc" style="display:none;"><a href="' . $link . '" >' . $date . '</a></td>';
|
593 |
+
|
594 |
+
if (strpos($lists['hide_label_list'], '@submitterip@') === FALSE)
|
595 |
+
echo '<td class="submitterip_fc"><a href="' . $link . '" >' . $ip . '</a></td>';
|
596 |
+
else
|
597 |
+
echo '<td class="submitterip_fc" style="display:none;"><a href="' . $link . '" >' . $ip . '</a></td>';
|
598 |
+
|
599 |
+
|
600 |
+
|
601 |
+
//print_r($temp);
|
602 |
+
$ttt = count($temp);
|
603 |
+
for ($h = 0; $h < $m; $h++) {
|
604 |
+
$not_label = TRUE;
|
605 |
+
for ($g = 0; $g < $ttt; $g++) {
|
606 |
+
$t = $temp[$g];
|
607 |
+
if (strpos($lists['hide_label_list'], '@' . $labels_id[$h] . '@') === FALSE)
|
608 |
+
$styleStr = '';
|
609 |
+
else $styleStr = 'style="display:none;"';
|
610 |
+
if ($t->element_label == $labels_id[$h]) {
|
611 |
+
if (strpos($t->element_value, "***map***")) {
|
612 |
+
$map_params = explode('***map***', $t->element_value);
|
613 |
+
$longit = $map_params[0];
|
614 |
+
$latit = $map_params[1];
|
615 |
+
echo '<td align="center" class="' . $labels_id[$h] . '_fc" ' . $styleStr . '><a class="thickbox-preview" href="' . admin_url('admin-ajax.php?action=frommapeditinpopup&long=' . $longit . '&lat=' . $latit) . '&TB_iframe=1&tbWidth=630&tbHeight=650" >' . 'Show on Map' . "</a></td>";
|
616 |
+
}
|
617 |
+
else if (strpos($t->element_value, "*@@url@@*")) {
|
618 |
+
$new_file = str_replace("*@@url@@*", '', str_replace("***br***", '<br>', $t->element_value));
|
619 |
+
$new_filename = explode('/', $new_file);
|
620 |
+
echo '<td class="' . $labels_id[$h] . '_fc" ' . $styleStr . '><a target="_blank" href="' . $new_file . '">' . $new_filename[count($new_filename) - 1] . "</td>";
|
621 |
+
}
|
622 |
+
else
|
623 |
+
echo '<td class="' . $labels_id[$h] . '_fc" ' . $styleStr . '><pre style="font-family:inherit">' . str_replace("***br***", '<br>', $t->element_value) . '</pre></td>';
|
624 |
+
$not_label = FALSE;
|
625 |
+
}
|
626 |
+
}
|
627 |
+
if ($not_label)
|
628 |
+
echo '<td class="' . $labels_id[$h] . '_fc" ' . $styleStr . '></td>';
|
629 |
+
}
|
630 |
+
?>
|
631 |
+
<td><a
|
632 |
+
href="javascript:submit_del('admin.php?page=Form_maker_Submits&task=edit_submit&id=<?php echo $f->group_id; ?>')">Edit</a>
|
633 |
+
</td>
|
634 |
+
<td><a
|
635 |
+
href="javascript:submit_del('admin.php?page=Form_maker_Submits&task=remove_submit&id=<?php echo $f->group_id; ?>')">Delete</a>
|
636 |
+
</td>
|
637 |
+
</tr>
|
638 |
|
639 |
+
<?php
|
640 |
|
|
|
641 |
|
642 |
+
$k = 1 - $k;
|
643 |
+
}
|
644 |
|
645 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
646 |
|
647 |
+
</table>
|
648 |
+
</div>
|
649 |
|
650 |
|
651 |
+
<?php
|
652 |
+
foreach ($sorted_labels_type as $key => $label_type) {
|
653 |
+
if ($label_type == "type_checkbox" || $label_type == "type_radio" || $label_type == "type_own_select" || $label_type == "type_country") {
|
654 |
+
?>
|
655 |
+
<br/>
|
656 |
+
<br/>
|
657 |
+
|
658 |
+
<strong><?php echo stripslashes($label_titles_copy[$key]); ?></strong>
|
659 |
+
<br/>
|
660 |
+
<br/>
|
661 |
+
|
662 |
+
<?php
|
663 |
+
$query = "SELECT element_value FROM " . $wpdb->prefix . "formmaker_submits " . $where_choices . " AND element_label='" . $labels_id[$key] . "'";
|
664 |
+
$choices = $wpdb->get_results($query);
|
665 |
+
$colors = array(
|
666 |
+
'#2CBADE',
|
667 |
+
'#FE6400'
|
668 |
+
);
|
669 |
+
$choices_labels = array();
|
670 |
+
$choices_count = array();
|
671 |
+
$all = count($choices);
|
672 |
+
$unanswered = 0;
|
673 |
+
foreach ($choices as $key => $choice) {
|
674 |
+
if ($choice->element_value == '') {
|
675 |
+
$unanswered++;
|
676 |
+
}
|
677 |
+
else {
|
678 |
+
if (!in_array($choice->element_value, $choices_labels)) {
|
679 |
+
array_push($choices_labels, $choice->element_value);
|
680 |
+
array_push($choices_count, 0);
|
681 |
+
}
|
682 |
+
$choices_count[array_search($choice->element_value, $choices_labels)]++;
|
683 |
+
}
|
684 |
+
}
|
685 |
+
array_multisort($choices_count, SORT_DESC, $choices_labels);
|
686 |
+
?>
|
687 |
+
<table width="95%" style="width:95%" class="wp-list-table widefat fixed posts">
|
688 |
+
<thead>
|
689 |
+
<tr>
|
690 |
+
<th width="20%">Choices</th>
|
691 |
+
<th>Percentage</th>
|
692 |
+
<th width="10%">Count</th>
|
693 |
+
</tr>
|
694 |
+
</thead>
|
695 |
+
<?php
|
696 |
+
foreach ($choices_labels as $key => $choices_label) {
|
697 |
+
?>
|
698 |
+
<tr>
|
699 |
+
<td><?php echo str_replace("***br***", '<br>', $choices_label)?></td>
|
700 |
+
<td>
|
701 |
+
<div class="bordered"
|
702 |
+
style="width:<?php echo ($choices_count[$key] / ($all - $unanswered)) * 100; ?>%; height:18px; background-color:<?php echo $colors[$key % 2]; ?>"></div>
|
703 |
+
</td>
|
704 |
+
<td><?php echo $choices_count[$key]?></td>
|
705 |
+
</tr>
|
706 |
+
<?php
|
707 |
+
}
|
708 |
|
709 |
+
if ($unanswered) {
|
710 |
+
?>
|
711 |
+
<tr>
|
712 |
+
<td colspan="2" align="right">Unanswered</th>
|
713 |
+
<td><strong><?php echo $unanswered;?></strong></th>
|
714 |
+
</tr>
|
715 |
|
716 |
+
<?php
|
717 |
+
}
|
718 |
+
?>
|
719 |
+
<tr>
|
720 |
+
<td colspan="2" align="right"><strong>Total</strong></th>
|
721 |
+
<td><strong><?php echo $all;?></strong></th>
|
722 |
+
</tr>
|
723 |
|
724 |
+
</table>
|
725 |
+
<?php
|
726 |
+
}
|
727 |
+
}
|
728 |
+
?>
|
729 |
|
730 |
|
731 |
|
732 |
+
<input type="hidden" name="boxchecked" value="0">
|
733 |
|
734 |
+
<input type="hidden" name="filter_order2" value="<?php echo $lists['order']; ?>"/>
|
735 |
|
736 |
+
<input type="hidden" name="filter_order_Dir2" value="<?php echo $lists['order_Dir']; ?>"/>
|
737 |
|
738 |
+
</form>
|
739 |
|
740 |
+
<script>
|
741 |
+
<?php if ($ka_fielderov_search) { ?>
|
742 |
+
document.getElementById('fields_filter').style.display = '';
|
743 |
+
<?php
|
744 |
+
}?>
|
745 |
+
</script>
|
746 |
|
747 |
+
<?php
|
748 |
+
}
|
749 |
|
750 |
+
function html_editSubmit($rows, $labels_id, $labels_name, $labels_type) {
|
751 |
+
?>
|
752 |
|
|
|
|
|
|
|
753 |
<script language="javascript" type="text/javascript">
|
754 |
|
755 |
+
function submitbutton(pressbutton) {
|
756 |
+
var form = document.adminForm;
|
757 |
|
758 |
+
if (pressbutton == 'cancel_submit') {
|
759 |
+
submitform(pressbutton);
|
760 |
+
return;
|
761 |
+
}
|
|
|
762 |
|
763 |
+
submitform(pressbutton);
|
764 |
+
}
|
765 |
+
function submitform(pressbutton) {
|
766 |
+
|
767 |
+
document.getElementById('adminForm').action = document.getElementById('adminForm').action + '&task=' + pressbutton;
|
768 |
+
document.getElementById('adminForm').submit();
|
769 |
+
}
|
770 |
+
</script>
|
|
|
771 |
<table width="90%">
|
772 |
+
<tbody>
|
773 |
+
<tr>
|
774 |
+
<td width="100%"><h2>Edit Submission</h2></td>
|
775 |
+
<td align="right"><input type="button" onclick="submitbutton('save_submit')" value="Save"
|
776 |
+
class="button-secondary action"></td>
|
777 |
+
<td align="right"><input type="button" onclick="submitbutton('appply_submit')" value="Apply"
|
778 |
+
class="button-secondary action"></td>
|
779 |
+
<td align="right"><input type="button" onclick="submitbutton('cancel')" value="Cancel"
|
780 |
+
class="button-secondary action"></td>
|
781 |
</tr>
|
782 |
+
</tbody>
|
783 |
+
</table>
|
784 |
+
<form action="admin.php?page=Form_maker_Submits&id=<?php echo (int)$_GET['id']; ?>" method="post" id="adminForm"
|
785 |
+
name="adminForm">
|
786 |
+
<table class="admintable">
|
787 |
+
<tr>
|
788 |
+
<td class="key">
|
789 |
+
<label for="ID">ID: </label>
|
790 |
+
</td>
|
791 |
+
<td>
|
792 |
+
<?php echo $rows[0]->group_id;?>
|
793 |
+
</td>
|
794 |
+
</tr>
|
795 |
+
|
796 |
+
<tr>
|
797 |
+
<td class="key">
|
798 |
+
<label for="Date">Date:
|
799 |
+
</label>
|
800 |
+
</td>
|
801 |
+
<td>
|
802 |
+
<?php echo $rows[0]->date;?>
|
803 |
+
</td>
|
804 |
+
</tr>
|
805 |
+
<tr>
|
806 |
+
<td class="key">
|
807 |
+
<label for="IP">IP:</label>
|
808 |
+
</td>
|
809 |
+
<td>
|
810 |
+
<?php echo $rows[0]->ip;?>
|
811 |
+
</td>
|
812 |
+
</tr>
|
813 |
+
|
814 |
+
<?php
|
815 |
+
foreach ($labels_id as $key => $label_id) {
|
816 |
+
if ($labels_type[$key] != 'type_editor' and $labels_type[$key] != 'type_submit_reset' and $labels_type[$key] != 'type_map' and $labels_type[$key] != 'type_mark_map' and $labels_type[$key] != 'type_captcha' and $labels_type[$key] != 'type_recaptcha' and $labels_type[$key] != 'type_button') {
|
817 |
+
$element_value = '';
|
818 |
+
foreach ($rows as $row) {
|
819 |
+
if ($row->element_label == $label_id) {
|
820 |
+
$element_value = $row->element_value;
|
821 |
+
break;
|
822 |
+
}
|
823 |
+
}
|
824 |
+
if ($labels_type[$key] != 'type_checkbox')
|
825 |
+
echo ' <tr>
|
|
|
|
|
826 |
<td class="key">
|
827 |
<label for="title">
|
828 |
+
' . $labels_name[$key] . '
|
829 |
</label>
|
830 |
</td>
|
831 |
<td >
|
832 |
+
<input type="text" name="submission_' . $label_id . '" id="submission_' . $label_id . '" value="' . str_replace("*@@url@@*", '', $element_value) . '" size="80" />
|
833 |
</td>
|
834 |
</tr>
|
835 |
';
|
836 |
+
else {
|
837 |
+
$choices = explode('***br***', $element_value);
|
838 |
+
$choices = array_slice($choices, 0, count($choices) - 1);
|
839 |
+
echo ' <tr>
|
840 |
+
<td class="key" rowspan="' . count($choices) . '">
|
|
|
841 |
<label for="title">
|
842 |
+
' . $labels_name[$key] . '
|
843 |
</label>
|
844 |
</td>';
|
845 |
+
foreach ($choices as $choice_key => $choice)
|
846 |
+
echo '
|
847 |
<td >
|
848 |
+
<input type="text" name="submission_' . $label_id . '_' . $choice_key . '" id="submission_' . $label_id . '_' . $choice_key . '" value="' . $choice . '" size="80" />
|
849 |
</td>
|
850 |
</tr>
|
851 |
';
|
852 |
+
}
|
853 |
+
}
|
854 |
+
}
|
855 |
|
856 |
+
?>
|
857 |
+
</table>
|
858 |
+
<input type="hidden" name="option" value="com_formmaker"/>
|
859 |
+
<input type="hidden" name="id" value="<?php echo $rows[0]->group_id?>"/>
|
860 |
+
<input type="hidden" name="form_id" value="<?php echo $rows[0]->form_id?>"/>
|
861 |
+
<input type="hidden" name="date" value="<?php echo $rows[0]->date?>"/>
|
862 |
+
<input type="hidden" name="ip" value="<?php echo $rows[0]->ip?>"/>
|
863 |
+
<input type="hidden" name="task" value="save_submit"/>
|
864 |
</form>
|
865 |
+
<?php
|
|
|
|
|
|
|
|
|
866 |
}
|
867 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
868 |
?>
|
Submissions.php
CHANGED
@@ -1,605 +1,401 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
-
|
5 |
}
|
6 |
-
function show_submits(){
|
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 |
-
|
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 |
-
array_push($label_order_original, $label_order_each[0]);
|
232 |
-
|
233 |
-
$ptn = "/[^a-zA-Z0-9_]/";
|
234 |
-
$rpltxt = "";
|
235 |
-
$label_temp=preg_replace($ptn, $rpltxt, $label_order_each[0]);
|
236 |
-
array_push($label_order, $label_temp);
|
237 |
-
|
238 |
-
array_push($label_type, $label_order_each[1]);
|
239 |
-
}
|
240 |
-
|
241 |
-
foreach($label_id as $key => $label)
|
242 |
-
if(in_array($label, $labels))
|
243 |
-
{
|
244 |
-
array_push($sorted_labels_type, $label_type[$key]);
|
245 |
-
array_push($sorted_labels, $label_order[$key]);
|
246 |
-
array_push($sorted_labels_id, $label);
|
247 |
-
array_push($label_titles, $label_order_original[$key]);
|
248 |
-
if(isset($_POST[$form_id.'_'.$label.'_search']))
|
249 |
-
$search_temp = esc_html($_POST[$form_id.'_'.$label.'_search']);
|
250 |
-
else
|
251 |
-
$search_temp ='';
|
252 |
-
$search_temp = strtolower( $search_temp );
|
253 |
-
$lists[$form_id.'_'.$label.'_search'] = $search_temp;
|
254 |
-
|
255 |
-
if ( $search_temp ) {
|
256 |
-
$where_labels[] = '(group_id in (SELECT group_id FROM '.$wpdb->prefix.'formmaker_submits WHERE element_label='.$label.' AND element_value LIKE "%'.$search_temp.'%"))';
|
257 |
-
}
|
258 |
-
|
259 |
-
}
|
260 |
-
}
|
261 |
-
|
262 |
-
$where_labels = ( count( $where_labels ) ? ' ' . implode( ' AND ', $where_labels ) : '' );
|
263 |
-
if($where_labels)
|
264 |
-
$where= $where.' AND '.$where_labels;
|
265 |
-
|
266 |
-
$rows_ord = array();
|
267 |
-
if(strpos($filter_order,"_field"))
|
268 |
-
{
|
269 |
-
|
270 |
-
$query = "insert into ".$wpdb->prefix."formmaker_submits (form_id, element_label, element_value, group_id,`date`,ip) select $form_id,'".str_replace("_field","",$filter_order)."', '', group_id,`date`,ip from ".$wpdb->prefix."formmaker_submits where `form_id`=$form_id and group_id not in (select group_id from ".$wpdb->prefix."formmaker_submits where `form_id`=$form_id and element_label='".str_replace("_field","",$filter_order)."' group by group_id) group by group_id";
|
271 |
-
|
272 |
-
|
273 |
-
if($wpdb->query($query)){ echo "database error";}
|
274 |
-
|
275 |
-
$query = "SELECT group_id, date, ip FROM ".$wpdb->prefix."formmaker_submits ". $where." and element_label='".str_replace("_field","",$filter_order)."' order by element_value ".$filter_order_Dir;
|
276 |
-
|
277 |
-
$rows_ord = $wpdb->get_results($query);
|
278 |
-
|
279 |
-
}
|
280 |
-
|
281 |
-
$query = 'SELECT group_id, date, ip FROM '.$wpdb->prefix.'formmaker_submits'. $where.' group by group_id '. $orderby;
|
282 |
-
$group_ids=$wpdb->get_results($query);
|
283 |
-
$total = count($group_ids);
|
284 |
-
|
285 |
-
|
286 |
-
$query = 'SELECT count(distinct group_id) FROM '.$wpdb->prefix.'formmaker_submits where form_id ="'.$form_id.'"';
|
287 |
-
$total_entries=$wpdb->get_var($query);
|
288 |
-
|
289 |
-
if(count($rows_ord)!=0){
|
290 |
-
$group_ids=$rows_ord;
|
291 |
-
$total = count($rows_ord);
|
292 |
-
|
293 |
-
$query = "SELECT group_id, date, ip FROM ".$wpdb->prefix."formmaker_submits ". $where." and element_label='".str_replace("_field","",$filter_order)."' order by element_value ".$filter_order_Dir." limit ".$limit.", 20 ";
|
294 |
-
$rows_ord = $wpdb->get_results($query);
|
295 |
-
|
296 |
-
|
297 |
-
}
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
$where2 = array();
|
304 |
-
$where_choices=$where;
|
305 |
-
for($i=$limit; $i<$limit+20; $i++)
|
306 |
-
{
|
307 |
-
if($i<$total)
|
308 |
-
$where2 [] ="group_id='".$group_ids[$i]->group_id."'";
|
309 |
-
|
310 |
-
}
|
311 |
-
$where2 = ( count( $where2 ) ? ' AND ( ' . implode( ' OR ', $where2 ).' )' : '' );
|
312 |
-
$where=$where.$where2;
|
313 |
-
$query = "SELECT * FROM ".$wpdb->prefix."formmaker_submits ". $where." ".$orderby.'';
|
314 |
-
$rows =$wpdb->get_results($query);
|
315 |
-
|
316 |
-
$pageNav['total'] =$total;
|
317 |
-
$pageNav['limit'] = $limit/20+1;
|
318 |
-
|
319 |
-
$query = 'SELECT `views` FROM '.$wpdb->prefix.'formmaker_views WHERE form_id="'.$form_id.'"';
|
320 |
-
$total_views = $wpdb->get_var($query);
|
321 |
-
|
322 |
-
|
323 |
-
$lists['order_Dir'] = $filter_order_Dir;
|
324 |
-
|
325 |
-
$lists['order'] = $filter_order;
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
// search filter
|
330 |
-
|
331 |
-
$lists['search_submits']= $search_submits;
|
332 |
-
$lists['ip_search']=$ip_search;
|
333 |
-
|
334 |
-
if(count($rows_ord)==0)
|
335 |
-
$rows_ord=$rows;
|
336 |
-
// display function
|
337 |
-
html_show_submits($rows, $forms, $lists, $pageNav, $sorted_labels, $label_titles, $rows_ord, $filter_order_Dir,$form_id, $sorted_labels_id, $sorted_labels_type, $total_entries, $total_views,$where,$where_choices,$sort);
|
338 |
-
|
339 |
-
|
340 |
}
|
341 |
-
function remov_submit($id){
|
342 |
-
global $wpdb;
|
343 |
-
$query="DELETE FROM ".$wpdb->prefix."formmaker_submits WHERE group_id='".$id."'";
|
344 |
-
if($wpdb->query($query)){
|
345 |
-
?>
|
346 |
-
<div class="updated"><p><strong>Item Deleted.</strong></p></div>
|
347 |
-
<?php
|
348 |
-
}
|
349 |
-
else
|
350 |
-
{
|
351 |
-
?>
|
352 |
-
<div id="message" class="error"><p>Form Maker Submission Not Deleted</p></div>
|
353 |
-
<?php
|
354 |
-
}
|
355 |
-
}
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
function remov_cheched_submission()
|
362 |
-
{
|
363 |
-
global $wpdb;
|
364 |
-
$cid = $_POST['post'];
|
365 |
-
|
366 |
-
if (count( $cid )) {
|
367 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
368 |
|
369 |
-
|
|
|
|
|
|
|
|
|
370 |
// Create sql statement
|
371 |
-
|
372 |
-
$
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
?>
|
389 |
-
<div id="message" class="error"><p>Submissions Not Selected</p></div>
|
390 |
-
<?php
|
391 |
-
}
|
392 |
}
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
|
402 |
-
function editSubmit($id)
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
$label_id_each=explode('#**id**#',$label_each);
|
422 |
-
array_push($label_id, $label_id_each[0]);
|
423 |
-
|
424 |
-
$label_oder_each=explode('#**label**#', $label_id_each[1]);
|
425 |
-
array_push($label_order_original, $label_oder_each[0]);
|
426 |
-
array_push($label_type, $label_oder_each[1]);
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
}
|
431 |
-
|
432 |
-
// display function
|
433 |
-
|
434 |
-
html_editSubmit($rows, $label_id ,$label_order_original,$label_type);
|
435 |
-
|
436 |
-
|
437 |
}
|
438 |
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
$result=$wpdb->get_var($query);
|
547 |
-
if($result)
|
548 |
-
{
|
549 |
-
$query = "UPDATE ".$wpdb->prefix."formmaker_submits SET `element_value`='".$element_value."' WHERE group_id='".$id."' AND element_label='".$label_id_1."'";
|
550 |
-
$wpdb->update(
|
551 |
-
$wpdb->prefix."formmaker_submits",
|
552 |
-
array(
|
553 |
-
'element_value' => $element_value,
|
554 |
-
),
|
555 |
-
array( 'group_id' => $id,
|
556 |
-
'element_label' => $label_id_1),
|
557 |
-
array(
|
558 |
-
'%s',
|
559 |
-
),
|
560 |
-
array( '%d',
|
561 |
-
'%s' )
|
562 |
-
);
|
563 |
-
}
|
564 |
-
else
|
565 |
-
{
|
566 |
-
$query = "INSERT INTO ".$wpdb->prefix."formmaker_submits (form_id, element_label, element_value, group_id, date, ip) VALUES('".$form_id."', '".$label_id_1."', '".$element_value."','".$id."', '".$date."', '".$ip."')" ;
|
567 |
-
$wpdb->insert(
|
568 |
-
$wpdb->prefix."formmaker_submits",
|
569 |
-
array(
|
570 |
-
'form_id' => $form_id,
|
571 |
-
'element_label' => $label_id_1,
|
572 |
-
'element_value' => $element_value,
|
573 |
-
'group_id' => $id,
|
574 |
-
'date' => $date,
|
575 |
-
'ip' => $ip
|
576 |
-
),
|
577 |
-
array(
|
578 |
-
'%d',
|
579 |
-
'%s',
|
580 |
-
'%s',
|
581 |
-
'%d',
|
582 |
-
'%s',
|
583 |
-
'%s'
|
584 |
-
)
|
585 |
-
);
|
586 |
-
}
|
587 |
-
|
588 |
-
}
|
589 |
-
|
590 |
-
}
|
591 |
-
|
592 |
-
|
593 |
-
}
|
594 |
-
|
595 |
}
|
596 |
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
?>
|
1 |
<?php
|
2 |
|
3 |
+
if (!current_user_can('manage_options')) {
|
4 |
+
die('Access Denied');
|
5 |
}
|
6 |
+
function show_submits() {
|
7 |
+
global $wpdb;
|
8 |
+
///////////////////////////////////////////////////////////////////////////// PAGE NAVI ///////////////////////////////////////////////////
|
9 |
+
$sort["default_style"] = "manage-column column-autor sortable desc";
|
10 |
+
if (isset($_POST['page_number'])) {
|
11 |
+
if ($_POST['asc_or_desc']) {
|
12 |
+
if (isset($_POST['order_by'])) {
|
13 |
+
$sort["sortid_by"] = $wpdb->escape($_POST['order_by']);
|
14 |
+
}
|
15 |
+
if ($_POST['asc_or_desc'] == 1) {
|
16 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
17 |
+
$sort["1_or_2"] = "2";
|
18 |
+
$order = "ORDER BY " . $sort["sortid_by"] . " ASC";
|
19 |
+
}
|
20 |
+
else {
|
21 |
+
$sort["custom_style"] = "manage-column column-title sorted desc";
|
22 |
+
$sort["1_or_2"] = "1";
|
23 |
+
$order = "ORDER BY " . $sort["sortid_by"] . " DESC";
|
24 |
+
}
|
25 |
+
}
|
26 |
+
else {
|
27 |
+
$sort["sortid_by"] = "";
|
28 |
+
}
|
29 |
+
if ($_POST['page_number']) {
|
30 |
+
$limit = ((int)$_POST['page_number'] - 1) * 20;
|
31 |
+
}
|
32 |
+
else {
|
33 |
+
$limit = 0;
|
34 |
+
}
|
35 |
+
}
|
36 |
+
else {
|
37 |
+
$sort["sortid_by"] = "";
|
38 |
+
$limit = 0;
|
39 |
+
}
|
40 |
+
///////////////////////////////////////////////////////////////// END PAGE NAVI ///////////////////////////////////////////////
|
41 |
+
$query = "SELECT id, title FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN(" . get_option('contact_form_forms', 0) . ") order by title";
|
42 |
+
$forms = $wpdb->get_results($query);
|
43 |
+
//$task = JRequest::getCmd('task');
|
44 |
+
if (isset($_POST['form_id'])) {
|
45 |
+
$form_id = (int)$_POST['form_id'];
|
46 |
+
if ($form_id) {
|
47 |
+
$query = "SELECT id FROM " . $wpdb->prefix . "formmaker WHERE id=" . $form_id;
|
48 |
+
$exists = $wpdb->get_var($query);
|
49 |
+
}
|
50 |
+
else {
|
51 |
+
$exists = "";
|
52 |
+
}
|
53 |
+
}
|
54 |
+
else {
|
55 |
+
$exists = "";
|
56 |
+
}
|
57 |
+
if (!$exists)
|
58 |
+
$form_id = 0;
|
59 |
+
if (isset($_POST['order_by']) && $_POST['order_by'] != "")
|
60 |
+
$filter_order = $wpdb->escape($_POST['order_by']);
|
61 |
+
else
|
62 |
+
$filter_order = 'id';
|
63 |
+
if (isset($_POST['asc_or_desc'])) {
|
64 |
+
if ($_POST['asc_or_desc'] == 1) {
|
65 |
+
$filter_order_Dir = " ASC";
|
66 |
+
}
|
67 |
+
else {
|
68 |
+
$filter_order_Dir = " DESC";
|
69 |
+
}
|
70 |
+
}
|
71 |
+
else {
|
72 |
+
$filter_order_Dir = "";
|
73 |
+
}
|
74 |
+
if (isset($_POST['search_submits'])) {
|
75 |
+
$search_submits = esc_html($_POST['search_submits']);
|
76 |
+
$search_submits = strtolower($search_submits);
|
77 |
+
}
|
78 |
+
else {
|
79 |
+
$search_submits = "";
|
80 |
+
}
|
81 |
+
if (isset($_POST['ip_search'])) {
|
82 |
+
$ip_search = esc_html($_POST['ip_search']);
|
83 |
+
$ip_search = strtolower($ip_search);
|
84 |
+
}
|
85 |
+
else {
|
86 |
+
$ip_search = "";
|
87 |
+
}
|
88 |
+
$where = array();
|
89 |
+
$where_choices = array();
|
90 |
+
if (isset($_POST['startdate'])) {
|
91 |
+
$lists['startdate'] = esc_html($_POST['startdate']);
|
92 |
+
}
|
93 |
+
else {
|
94 |
+
$lists['startdate'] = "";
|
95 |
+
}
|
96 |
+
if (isset($_POST['enddate'])) {
|
97 |
+
$lists['enddate'] = esc_html($_POST['enddate']);
|
98 |
+
}
|
99 |
+
else {
|
100 |
+
$lists['enddate'] = "";
|
101 |
+
}
|
102 |
+
if (isset($_POST['hide_label_list'])) {
|
103 |
+
$lists['hide_label_list'] = esc_html($_POST['hide_label_list']);
|
104 |
+
}
|
105 |
+
else {
|
106 |
+
$lists['hide_label_list'] = "";
|
107 |
+
}
|
108 |
+
if ($search_submits) {
|
109 |
+
$where[] = 'element_label LIKE "%' . $search_submits . '%"';
|
110 |
+
}
|
111 |
+
if ($ip_search) {
|
112 |
+
$where[] = 'ip LIKE "%' . $ip_search . '%"';
|
113 |
+
}
|
114 |
+
if ($lists['startdate'] != '')
|
115 |
+
$where[] = " `date`>='" . $lists['startdate'] . " 00:00:00' ";
|
116 |
+
if ($lists['enddate'] != '')
|
117 |
+
$where[] = " `date`<='" . $lists['enddate'] . " 23:59:59' ";
|
118 |
+
/*if ($form_id=="")
|
119 |
+
if($forms)
|
120 |
+
$form_id=$forms[0]->id;*/
|
121 |
+
$where[] = 'form_id="' . $form_id . '"';
|
122 |
+
$where = (count($where) ? ' WHERE ' . implode(' AND ', $where) : '');
|
123 |
+
$orderby = ' ';
|
124 |
+
if ($filter_order == 'id' or $filter_order == 'title' or $filter_order == 'mail') {
|
125 |
+
$orderby = ' ORDER BY `date` desc';
|
126 |
+
}
|
127 |
+
else if (!strpos($filter_order, "_field")) {
|
128 |
+
$orderby = ' ORDER BY ' . $filter_order . ' ' . $filter_order_Dir . '';
|
129 |
+
}
|
130 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker_submits" . $where;
|
131 |
+
$rows = $wpdb->get_results($query);
|
132 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id='" . $form_id . "'";
|
133 |
+
$rowsc = $wpdb->get_results($query);
|
134 |
+
//$orderby=$order;
|
135 |
+
$where_labels = array();
|
136 |
+
$n = count($rowsc);
|
137 |
+
$labels = array();
|
138 |
+
for ($i = 0; $i < $n; $i++) {
|
139 |
+
$row = $rowsc[$i];
|
140 |
+
if (!in_array($row->element_label, $labels)) {
|
141 |
+
array_push($labels, $row->element_label);
|
142 |
+
}
|
143 |
+
}
|
144 |
+
$sorted_labels_type = array();
|
145 |
+
$sorted_labels_id = array();
|
146 |
+
$sorted_labels = array();
|
147 |
+
$label_titles = array();
|
148 |
+
if ($labels) {
|
149 |
+
$label_id = array();
|
150 |
+
$label_order = array();
|
151 |
+
$label_order_original = array();
|
152 |
+
$label_type = array();
|
153 |
+
$this_form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'");
|
154 |
+
$label_all = explode('#****#', $this_form->label_order);
|
155 |
+
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
156 |
+
foreach ($label_all as $key => $label_each) {
|
157 |
+
$label_id_each = explode('#**id**#', $label_each);
|
158 |
+
array_push($label_id, $label_id_each[0]);
|
159 |
+
$label_order_each = explode('#**label**#', $label_id_each[1]);
|
160 |
+
array_push($label_order_original, $label_order_each[0]);
|
161 |
+
$ptn = "/[^a-zA-Z0-9_]/";
|
162 |
+
$rpltxt = "";
|
163 |
+
$label_temp = preg_replace($ptn, $rpltxt, $label_order_each[0]);
|
164 |
+
array_push($label_order, $label_temp);
|
165 |
+
array_push($label_type, $label_order_each[1]);
|
166 |
+
}
|
167 |
+
foreach ($label_id as $key => $label)
|
168 |
+
if (in_array($label, $labels)) {
|
169 |
+
array_push($sorted_labels_type, $label_type[$key]);
|
170 |
+
array_push($sorted_labels, $label_order[$key]);
|
171 |
+
array_push($sorted_labels_id, $label);
|
172 |
+
array_push($label_titles, $label_order_original[$key]);
|
173 |
+
if (isset($_POST[$form_id . '_' . $label . '_search']))
|
174 |
+
$search_temp = esc_html($_POST[$form_id . '_' . $label . '_search']);
|
175 |
+
else
|
176 |
+
$search_temp = '';
|
177 |
+
$search_temp = strtolower($search_temp);
|
178 |
+
$lists[$form_id . '_' . $label . '_search'] = $search_temp;
|
179 |
+
if ($search_temp) {
|
180 |
+
$where_labels[] = '(group_id in (SELECT group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE element_label=' . $label . ' AND element_value LIKE "%' . $search_temp . '%"))';
|
181 |
+
}
|
182 |
+
}
|
183 |
+
}
|
184 |
+
$where_labels = (count($where_labels) ? ' ' . implode(' AND ', $where_labels) : '');
|
185 |
+
if ($where_labels)
|
186 |
+
$where = $where . ' AND ' . $where_labels;
|
187 |
+
$rows_ord = array();
|
188 |
+
if (strpos($filter_order, "_field")) {
|
189 |
+
$query = "insert into " . $wpdb->prefix . "formmaker_submits (form_id, element_label, element_value, group_id,`date`,ip) select $form_id,'" . str_replace("_field", "", $filter_order) . "', '', group_id,`date`,ip from " . $wpdb->prefix . "formmaker_submits where `form_id`=$form_id and group_id not in (select group_id from " . $wpdb->prefix . "formmaker_submits where `form_id`=$form_id and element_label='" . str_replace("_field", "", $filter_order) . "' group by group_id) group by group_id";
|
190 |
+
if ($wpdb->query($query)) {
|
191 |
+
echo "database error";
|
192 |
+
}
|
193 |
+
$query = "SELECT group_id, date, ip FROM " . $wpdb->prefix . "formmaker_submits " . $where . " and element_label='" . str_replace("_field", "", $filter_order) . "' order by element_value " . $filter_order_Dir;
|
194 |
+
$rows_ord = $wpdb->get_results($query);
|
195 |
+
}
|
196 |
+
$query = 'SELECT group_id, date, ip FROM ' . $wpdb->prefix . 'formmaker_submits' . $where . ' group by group_id ' . $orderby;
|
197 |
+
$group_ids = $wpdb->get_results($query);
|
198 |
+
$total = count($group_ids);
|
199 |
+
$query = 'SELECT count(distinct group_id) FROM ' . $wpdb->prefix . 'formmaker_submits where form_id ="' . $form_id . '"';
|
200 |
+
$total_entries = $wpdb->get_var($query);
|
201 |
+
if (count($rows_ord) != 0) {
|
202 |
+
$group_ids = $rows_ord;
|
203 |
+
$total = count($rows_ord);
|
204 |
+
$query = "SELECT group_id, date, ip FROM " . $wpdb->prefix . "formmaker_submits " . $where . " and element_label='" . str_replace("_field", "", $filter_order) . "' order by element_value " . $filter_order_Dir . " limit " . $limit . ", 20 ";
|
205 |
+
$rows_ord = $wpdb->get_results($query);
|
206 |
+
}
|
207 |
+
$where2 = array();
|
208 |
+
$where_choices = $where;
|
209 |
+
for ($i = $limit; $i < $limit + 20; $i++) {
|
210 |
+
if ($i < $total)
|
211 |
+
$where2 [] = "group_id='" . $group_ids[$i]->group_id . "'";
|
212 |
+
}
|
213 |
+
$where2 = (count($where2) ? ' AND ( ' . implode(' OR ', $where2) . ' )' : '');
|
214 |
+
$where = $where . $where2;
|
215 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker_submits " . $where . " " . $orderby . '';
|
216 |
+
$rows = $wpdb->get_results($query);
|
217 |
+
$pageNav['total'] = $total;
|
218 |
+
$pageNav['limit'] = $limit / 20 + 1;
|
219 |
+
$query = 'SELECT `views` FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="' . $form_id . '"';
|
220 |
+
$total_views = $wpdb->get_var($query);
|
221 |
+
$lists['order_Dir'] = $filter_order_Dir;
|
222 |
+
$lists['order'] = $filter_order;
|
223 |
+
// search filter
|
224 |
+
$lists['search_submits'] = $search_submits;
|
225 |
+
$lists['ip_search'] = $ip_search;
|
226 |
+
if (count($rows_ord) == 0)
|
227 |
+
$rows_ord = $rows;
|
228 |
+
// display function
|
229 |
+
html_show_submits($rows, $forms, $lists, $pageNav, $sorted_labels, $label_titles, $rows_ord, $filter_order_Dir, $form_id, $sorted_labels_id, $sorted_labels_type, $total_entries, $total_views, $where, $where_choices, $sort);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
|
232 |
+
function remov_submit($id) {
|
233 |
+
global $wpdb;
|
234 |
+
$query = "DELETE FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "'";
|
235 |
+
if ($wpdb->query($query)) {
|
236 |
+
?>
|
237 |
+
<div class="updated"><p><strong>Item Deleted.</strong></p></div>
|
238 |
+
<?php
|
239 |
+
}
|
240 |
+
else {
|
241 |
+
?>
|
242 |
+
<div id="message" class="error"><p>Form Maker Submission Not Deleted</p></div>
|
243 |
+
<?php
|
244 |
+
}
|
245 |
+
}
|
246 |
|
247 |
+
function remov_cheched_submission() {
|
248 |
+
global $wpdb;
|
249 |
+
$cid = $_POST['post'];
|
250 |
+
if (count($cid)) {
|
251 |
+
$cids = esc_html(implode(',', $cid));
|
252 |
// Create sql statement
|
253 |
+
$query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_submits' . ' WHERE group_id IN ( ' . $cids . ' )';
|
254 |
+
if ($wpdb->query($query)) {
|
255 |
+
?>
|
256 |
+
<div class="updated"><p><strong>Items Deleted.</strong></p></div>
|
257 |
+
<?php
|
258 |
+
}
|
259 |
+
else {
|
260 |
+
?>
|
261 |
+
<div id="message" class="error"><p>Form Maker Submissions Not Deleted</p></div>
|
262 |
+
<?php
|
263 |
+
}
|
264 |
+
}
|
265 |
+
else {
|
266 |
+
?>
|
267 |
+
<div id="message" class="error"><p>Submissions Not Selected</p></div>
|
268 |
+
<?php
|
269 |
+
}
|
|
|
|
|
|
|
|
|
270 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
|
272 |
+
function editSubmit($id) {
|
273 |
+
global $wpdb;
|
274 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id=" . $id;
|
275 |
+
$rows = $wpdb->get_results($query);
|
276 |
+
$form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id=" . $rows[0]->form_id);
|
277 |
+
$label_id = array();
|
278 |
+
$label_order_original = array();
|
279 |
+
$label_type = array();
|
280 |
+
$label_all = explode('#****#', $form->label_order);
|
281 |
+
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
282 |
+
foreach ($label_all as $key => $label_each) {
|
283 |
+
$label_id_each = explode('#**id**#', $label_each);
|
284 |
+
array_push($label_id, $label_id_each[0]);
|
285 |
+
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
286 |
+
array_push($label_order_original, $label_oder_each[0]);
|
287 |
+
array_push($label_type, $label_oder_each[1]);
|
288 |
+
}
|
289 |
+
// display function
|
290 |
+
html_editSubmit($rows, $label_id, $label_order_original, $label_type);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
291 |
}
|
292 |
|
293 |
+
function save_submit($id) {
|
294 |
+
global $wpdb;
|
295 |
+
$id = (int)$_POST['id'];
|
296 |
+
$date = esc_html($_POST['date']);
|
297 |
+
$ip = esc_html($_POST['ip']);
|
298 |
+
$form_id = $wpdb->get_var("SELECT form_id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "'");
|
299 |
+
$form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'");
|
300 |
+
$label_id = array();
|
301 |
+
$label_order_original = array();
|
302 |
+
$label_type = array();
|
303 |
+
$label_all = explode('#****#', $form->label_order);
|
304 |
+
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
305 |
+
foreach ($label_all as $key => $label_each) {
|
306 |
+
$label_id_each = explode('#**id**#', $label_each);
|
307 |
+
array_push($label_id, $label_id_each[0]);
|
308 |
+
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
309 |
+
array_push($label_order_original, $label_oder_each[0]);
|
310 |
+
array_push($label_type, $label_oder_each[1]);
|
311 |
+
}
|
312 |
+
foreach ($label_id as $key => $label_id_1) {
|
313 |
+
$element_value = esc_html($_POST["submission_" . $label_id_1]);
|
314 |
+
if (isset($_POST["submission_" . $label_id_1])) {
|
315 |
+
$query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
|
316 |
+
$result = $wpdb->get_var($query);
|
317 |
+
if ($label_type[$key] == 'type_file_upload')
|
318 |
+
if ($element_value)
|
319 |
+
$element_value = $element_value . "*@@url@@*";
|
320 |
+
if ($result) {
|
321 |
+
//$query = "UPDATE ".$wpdb->prefix."formmaker_submits SET `element_value`='".$element_value."' WHERE group_id='".$id."' AND element_label='".$label_id_1."'";
|
322 |
+
$wpdb->update($wpdb->prefix . "formmaker_submits", array(
|
323 |
+
'element_value' => $element_value,
|
324 |
+
), array(
|
325 |
+
'group_id' => $id,
|
326 |
+
'element_label' => $label_id_1
|
327 |
+
), array(
|
328 |
+
'%s',
|
329 |
+
), array(
|
330 |
+
'%d',
|
331 |
+
'%s'
|
332 |
+
));
|
333 |
+
}
|
334 |
+
else {
|
335 |
+
$wpdb->insert($wpdb->prefix . "formmaker_submits", array(
|
336 |
+
'form_id' => $form_id,
|
337 |
+
'element_label' => $label_id_1,
|
338 |
+
'element_value' => $element_value,
|
339 |
+
'group_id' => $id,
|
340 |
+
'date' => $date,
|
341 |
+
'ip' => $ip
|
342 |
+
), array(
|
343 |
+
'%d',
|
344 |
+
'%s',
|
345 |
+
'%s',
|
346 |
+
'%d',
|
347 |
+
'%s',
|
348 |
+
'%s'
|
349 |
+
));
|
350 |
+
}
|
351 |
+
}
|
352 |
+
else {
|
353 |
+
$element_value_ch = esc_html($_POST["submission_" . $label_id_1 . '_0']);
|
354 |
+
if (isset($_POST["submission_" . $label_id_1 . '_0'])) {
|
355 |
+
for ($z = 0; $z < 21; $z++) {
|
356 |
+
$element_value_ch = esc_html($_POST["submission_" . $label_id_1 . '_' . $z]);
|
357 |
+
if (isset($element_value_ch))
|
358 |
+
$element_value = $element_value . $element_value_ch . '***br***';
|
359 |
+
else
|
360 |
+
break;
|
361 |
+
}
|
362 |
+
$query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
|
363 |
+
$result = $wpdb->get_var($query);
|
364 |
+
if ($result) {
|
365 |
+
$query = "UPDATE " . $wpdb->prefix . "formmaker_submits SET `element_value`='" . $element_value . "' WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
|
366 |
+
$wpdb->update($wpdb->prefix . "formmaker_submits", array(
|
367 |
+
'element_value' => $element_value,
|
368 |
+
), array(
|
369 |
+
'group_id' => $id,
|
370 |
+
'element_label' => $label_id_1
|
371 |
+
), array(
|
372 |
+
'%s',
|
373 |
+
), array(
|
374 |
+
'%d',
|
375 |
+
'%s'
|
376 |
+
));
|
377 |
+
}
|
378 |
+
else {
|
379 |
+
$query = "INSERT INTO " . $wpdb->prefix . "formmaker_submits (form_id, element_label, element_value, group_id, date, ip) VALUES('" . $form_id . "', '" . $label_id_1 . "', '" . $element_value . "','" . $id . "', '" . $date . "', '" . $ip . "')";
|
380 |
+
$wpdb->insert($wpdb->prefix . "formmaker_submits", array(
|
381 |
+
'form_id' => $form_id,
|
382 |
+
'element_label' => $label_id_1,
|
383 |
+
'element_value' => $element_value,
|
384 |
+
'group_id' => $id,
|
385 |
+
'date' => $date,
|
386 |
+
'ip' => $ip
|
387 |
+
), array(
|
388 |
+
'%d',
|
389 |
+
'%s',
|
390 |
+
'%s',
|
391 |
+
'%d',
|
392 |
+
'%s',
|
393 |
+
'%s'
|
394 |
+
));
|
395 |
+
}
|
396 |
+
}
|
397 |
+
}
|
398 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
399 |
}
|
400 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
401 |
?>
|
Theme_functions.php
CHANGED
@@ -1,180 +1,149 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
4 |
}
|
5 |
-
function add_theme(){
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
html_add_theme($def_theme);
|
11 |
}
|
12 |
|
13 |
-
function show_theme(){
|
14 |
-
global $wpdb;
|
15 |
-
$order="";
|
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 |
-
$where=" WHERE `id` NOT IN (".get_option('contact_form_themes',0).")";
|
69 |
-
else
|
70 |
-
$where.=" AND `id` NOT IN (".get_option('contact_form_themes',0).")";
|
71 |
-
// get the total number of records
|
72 |
-
$query = "SELECT COUNT(*) FROM ".$wpdb->prefix."formmaker_themes". $where;
|
73 |
-
$total = $wpdb->get_var($query);
|
74 |
-
$pageNav['total'] =$total;
|
75 |
-
$pageNav['limit'] = $limit/20+1;
|
76 |
-
$query = "SELECT * FROM ".$wpdb->prefix."formmaker_themes".$where." ". $order." "." LIMIT ".$limit.",20";
|
77 |
-
$rows = $wpdb->get_results($query);
|
78 |
-
html_show_theme($rows, $pageNav, $sort);
|
79 |
}
|
80 |
|
81 |
-
function save_theme(){
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
<?php
|
104 |
-
|
105 |
-
return true;
|
106 |
-
|
107 |
-
}
|
108 |
-
function apply_theme($id){
|
109 |
-
global $wpdb;
|
110 |
-
$save_or_no= $wpdb->update($wpdb->prefix.'formmaker_themes', array(
|
111 |
-
'title' => $_POST["title"],
|
112 |
-
'css' =>stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST["css"])),
|
113 |
-
|
114 |
-
),
|
115 |
-
array('id'=>$id),
|
116 |
-
array(
|
117 |
-
'%s',
|
118 |
-
'%s'
|
119 |
-
)
|
120 |
-
);
|
121 |
-
?>
|
122 |
-
<div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
|
123 |
-
<?php
|
124 |
-
|
125 |
-
return true;
|
126 |
-
|
127 |
}
|
128 |
|
129 |
-
function
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
}
|
135 |
|
136 |
-
function
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
?>
|
141 |
-
<div class="updated"><p><strong><?php _e("You can't delete default theme"); ?></strong></p></div>
|
142 |
-
<?php
|
143 |
-
return;
|
144 |
-
}
|
145 |
-
$sql_remov_tag="DELETE FROM ".$wpdb->prefix."formmaker_themes WHERE id='".$id."'";
|
146 |
-
if(!$wpdb->query($sql_remov_tag))
|
147 |
-
{
|
148 |
-
?>
|
149 |
-
<div id="message" class="error"><p>Spider Video Player Theme Not Deleted</p></div>
|
150 |
-
<?php
|
151 |
-
|
152 |
-
}
|
153 |
-
else{
|
154 |
-
?>
|
155 |
-
<div class="updated"><p><strong><?php _e('Item Deleted.' ); ?></strong></p></div>
|
156 |
-
<?php
|
157 |
-
}
|
158 |
}
|
159 |
|
160 |
-
function
|
161 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
'default' =>1,
|
175 |
-
),
|
176 |
-
array('id'=>$id),
|
177 |
-
array( '%d' )
|
178 |
-
);
|
179 |
}
|
|
|
180 |
?>
|
1 |
<?php
|
2 |
+
if (!current_user_can('manage_options')) {
|
3 |
+
die('Access Denied');
|
4 |
}
|
5 |
+
function add_theme() {
|
6 |
+
global $wpdb;
|
7 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker_themes where `default`=1 AND `id` NOT IN(" . get_option('contact_form_themes', 0) . ") ";
|
8 |
+
$def_theme = $wpdb->get_row($query);
|
9 |
+
html_add_theme($def_theme);
|
|
|
10 |
}
|
11 |
|
12 |
+
function show_theme() {
|
13 |
+
global $wpdb;
|
14 |
+
$order = "";
|
15 |
+
$sort["default_style"] = "manage-column column-autor sortable desc";
|
16 |
+
if (isset($_POST['page_number'])) {
|
17 |
+
if ($_POST['asc_or_desc']) {
|
18 |
+
$sort["sortid_by"] = $wpdb->escape($_POST['order_by']);
|
19 |
+
if ($_POST['asc_or_desc'] == 1) {
|
20 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
21 |
+
$sort["1_or_2"] = "2";
|
22 |
+
$order = "ORDER BY " . $sort["sortid_by"] . " ASC";
|
23 |
+
}
|
24 |
+
else {
|
25 |
+
$sort["custom_style"] = "manage-column column-title sorted desc";
|
26 |
+
$sort["1_or_2"] = "1";
|
27 |
+
$order = "ORDER BY " . $sort["sortid_by"] . " DESC";
|
28 |
+
}
|
29 |
+
}
|
30 |
+
if ($_POST['page_number']) {
|
31 |
+
$limit = ((int)$_POST['page_number'] - 1) * 20;
|
32 |
+
}
|
33 |
+
else {
|
34 |
+
$limit = 0;
|
35 |
+
}
|
36 |
+
}
|
37 |
+
else {
|
38 |
+
$sort["sortid_by"] = "";
|
39 |
+
$limit = 0;
|
40 |
+
}
|
41 |
+
if (isset($_POST['search_events_by_title'])) {
|
42 |
+
$search_tag = esc_html($_POST['search_events_by_title']);
|
43 |
+
}
|
44 |
+
else {
|
45 |
+
$search_tag = "";
|
46 |
+
}
|
47 |
+
if ($search_tag) {
|
48 |
+
$where = ' WHERE title LIKE "%' . $search_tag . '%"';
|
49 |
+
}
|
50 |
+
else {
|
51 |
+
$where = "";
|
52 |
+
}
|
53 |
+
if ($order == "")
|
54 |
+
$order = "ORDER BY `title` ASC";
|
55 |
+
if (!$where)
|
56 |
+
$where = " WHERE `id` NOT IN (" . get_option('contact_form_themes', 0) . ")";
|
57 |
+
else
|
58 |
+
$where .= " AND `id` NOT IN (" . get_option('contact_form_themes', 0) . ")";
|
59 |
+
// get the total number of records
|
60 |
+
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_themes" . $where;
|
61 |
+
$total = $wpdb->get_var($query);
|
62 |
+
$pageNav['total'] = $total;
|
63 |
+
$pageNav['limit'] = $limit / 20 + 1;
|
64 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker_themes" . $where . " " . $order . " " . " LIMIT " . $limit . ",20";
|
65 |
+
$rows = $wpdb->get_results($query);
|
66 |
+
html_show_theme($rows, $pageNav, $sort);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
}
|
68 |
|
69 |
+
function save_theme() {
|
70 |
+
global $wpdb;
|
71 |
+
$save_or_no = $wpdb->insert($wpdb->prefix . 'formmaker_themes', array(
|
72 |
+
'id' => NULL,
|
73 |
+
'title' => $_POST["title"],
|
74 |
+
'css' => stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST["css"])),
|
75 |
+
), array(
|
76 |
+
'%d',
|
77 |
+
'%s',
|
78 |
+
'%s'
|
79 |
+
));
|
80 |
+
if (!$save_or_no) {
|
81 |
+
?>
|
82 |
+
<div class="updated"><p><strong><?php _e('Error. Please install plugin again'); ?></strong></p></div>
|
83 |
+
<?php
|
84 |
+
return FALSE;
|
85 |
+
}
|
86 |
+
?>
|
87 |
+
<div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
|
88 |
+
<?php
|
89 |
+
|
90 |
+
return TRUE;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
}
|
92 |
|
93 |
+
function apply_theme($id) {
|
94 |
+
global $wpdb;
|
95 |
+
$save_or_no = $wpdb->update($wpdb->prefix . 'formmaker_themes', array(
|
96 |
+
'title' => $_POST["title"],
|
97 |
+
'css' => stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST["css"])),
|
98 |
+
), array('id' => $id), array(
|
99 |
+
'%s',
|
100 |
+
'%s'
|
101 |
+
));
|
102 |
+
?>
|
103 |
+
<div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
|
104 |
+
<?php
|
105 |
+
|
106 |
+
return TRUE;
|
107 |
}
|
108 |
|
109 |
+
function edit_theme($id) {
|
110 |
+
global $wpdb;
|
111 |
+
$row = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker_themes WHERE id='" . $id . "'");
|
112 |
+
html_edit_theme($row, $id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
}
|
114 |
|
115 |
+
function remove_theme($id) {
|
116 |
+
global $wpdb;
|
117 |
+
if ($wpdb->get_var("SELECT `default` FROM " . $wpdb->prefix . "formmaker_themes WHERE id='" . $id . "'")) {
|
118 |
+
?>
|
119 |
+
<div class="updated"><p><strong><?php _e("You can't delete default theme"); ?></strong></p></div>
|
120 |
+
<?php
|
121 |
+
return;
|
122 |
+
}
|
123 |
+
$sql_remov_tag = "DELETE FROM " . $wpdb->prefix . "formmaker_themes WHERE id='" . $id . "'";
|
124 |
+
if (!$wpdb->query($sql_remov_tag)) {
|
125 |
+
?>
|
126 |
+
<div id="message" class="error"><p>Spider Video Player Theme Not Deleted</p></div>
|
127 |
+
<?php
|
128 |
+
}
|
129 |
+
else {
|
130 |
+
?>
|
131 |
+
<div class="updated"><p><strong><?php _e('Item Deleted.'); ?></strong></p></div>
|
132 |
+
<?php
|
133 |
+
}
|
134 |
+
}
|
135 |
|
136 |
+
function default_theme($id) {
|
137 |
+
global $wpdb;
|
138 |
+
$ids_for = $wpdb->get_col("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`=1 AND `id` NOT IN(" . get_option('contact_form_themes', 0) . ")");
|
139 |
+
for ($i = 0; $i < count($ids_for); $i++) {
|
140 |
+
$savedd = $wpdb->update($wpdb->prefix . 'formmaker_themes', array(
|
141 |
+
'default' => 0,
|
142 |
+
), array('id' => $ids_for[$i]), array('%d'));
|
143 |
+
}
|
144 |
+
$savedd = $wpdb->update($wpdb->prefix . 'formmaker_themes', array(
|
145 |
+
'default' => 1,
|
146 |
+
), array('id' => $id), array('%d'));
|
|
|
|
|
|
|
|
|
|
|
147 |
}
|
148 |
+
|
149 |
?>
|
Themes_function.html.php
CHANGED
@@ -1,293 +1,339 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
4 |
}
|
5 |
-
function html_add_theme($def_theme){
|
6 |
-
?>
|
7 |
<script>
|
8 |
|
9 |
-
function submitbutton(pressbutton) {
|
10 |
-
|
11 |
-
var form = document.adminForm;
|
12 |
-
if(form.title.value=="")
|
13 |
-
{
|
14 |
-
alert('Set Theme title');
|
15 |
-
return;
|
16 |
-
}
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
document.getElementById("adminForm").submit();
|
24 |
-
}
|
25 |
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
<tr>
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
<td align="right"><input type="button" onclick="submitbutton('Save')" value="Save" class="button-secondary action"> </td>
|
42 |
-
<td align="right"><input type="button" onclick="submitbutton('Apply')" value="Apply" class="button-secondary action"> </td>
|
43 |
-
<td align="right"><input type="button" onclick="window.location.href='admin.php?page=Form_maker_Themes'" value="Cancel" class="button-secondary action"> </td>
|
44 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
</table>
|
46 |
-
<
|
47 |
-
<
|
48 |
-
|
49 |
-
|
50 |
-
<tr>
|
51 |
-
<td class="key">
|
52 |
-
<label for="title">
|
53 |
-
Title of theme:
|
54 |
-
</label>
|
55 |
-
</td>
|
56 |
-
<td >
|
57 |
-
<input type="text" name="title" id="title" size="80"/>
|
58 |
-
</td>
|
59 |
-
</tr>
|
60 |
-
<tr>
|
61 |
-
<td class="key">
|
62 |
-
<label for="title">
|
63 |
-
Css:
|
64 |
-
</label>
|
65 |
-
</td>
|
66 |
-
<td >
|
67 |
-
<textarea name="css" id="css" rows=30 cols=100><?php echo $def_theme->css ?></textarea>
|
68 |
-
</td>
|
69 |
-
</tr>
|
70 |
-
</table>
|
71 |
-
<input type="hidden" name="option" value="com_formmaker" />
|
72 |
-
<input type="hidden" name="task" value="" />
|
73 |
</form>
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
<?php
|
80 |
}
|
81 |
|
82 |
-
function html_show_theme($rows, $pageNav, $sort){
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
95 |
-
if( keyCode == 13 ) {
|
96 |
-
|
97 |
-
|
98 |
-
if(!e) var e = window.event;
|
99 |
-
|
100 |
-
e.cancelBubble = true;
|
101 |
-
e.returnValue = false;
|
102 |
-
|
103 |
-
if (e.stopPropagation) {
|
104 |
-
e.stopPropagation();
|
105 |
-
e.preventDefault();
|
106 |
-
}
|
107 |
-
}
|
108 |
-
}
|
109 |
-
</script>
|
110 |
-
<script language="JavaScript">
|
111 |
|
112 |
-
</script>
|
113 |
-
<form method="post" onkeypress="doNothing()" action="admin.php?page=Form_maker_Themes" id="admin_form" name="admin_form">
|
114 |
-
<table cellspacing="10" width="100%">
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
|
117 |
|
118 |
<tr>
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
</tr>
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
<label for="search_events_by_title" style="font-size:14px">Title: </label>
|
138 |
-
<input type="text" name="search_events_by_title" value="'
|
139 |
</div>
|
140 |
<div class="alignleft actions">
|
141 |
<input type="button" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\'; document.getElementById(\'serch_or_not\').value=\'search\';
|
142 |
document.getElementById(\'admin_form\').submit();" class="button-secondary action">
|
143 |
<input type="button" value="Reset" onclick="window.location.href=\'admin.php?page=Form_maker_Themes\'" class="button-secondary action">
|
144 |
</div>';
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
<table class="wp-list-table widefat fixed pages" style="width:95%">
|
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 |
-
submitform( pressbutton );
|
197 |
-
return;
|
198 |
-
}
|
199 |
-
if(form.title.value=="")
|
200 |
-
{
|
201 |
-
alert('Set Theme title');
|
202 |
-
return;
|
203 |
-
}
|
204 |
-
|
205 |
-
submitform( pressbutton );
|
206 |
-
}
|
207 |
-
function submitform(pressbutton)
|
208 |
-
{
|
209 |
-
document.getElementById("adminForm").action=document.getElementById("adminForm").action+"&task="+pressbutton;
|
210 |
-
document.getElementById("adminForm").submit();
|
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 |
<tr>
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
250 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
</table>
|
252 |
-
<
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
<tr>
|
257 |
-
<td class="key">
|
258 |
-
<label for="title">
|
259 |
-
Title of theme:
|
260 |
-
</label>
|
261 |
-
</td>
|
262 |
-
<td >
|
263 |
-
<input type="text" name="title" id="title" value="<?php echo htmlspecialchars($row->title) ?>" size="80"/>
|
264 |
-
</td>
|
265 |
-
</tr>
|
266 |
-
<tr>
|
267 |
-
<td class="key">
|
268 |
-
<label for="title">
|
269 |
-
Css:
|
270 |
-
</label>
|
271 |
-
</td>
|
272 |
-
<td >
|
273 |
-
<textarea name="css" id="css" rows=30 cols=100><?php echo htmlspecialchars($row->css) ?></textarea>
|
274 |
-
</td>
|
275 |
-
</tr>
|
276 |
-
</table>
|
277 |
-
<input type="hidden" name="option" value="com_formmaker" />
|
278 |
-
<input type="hidden" name="id" value="<?php echo $row->id?>" />
|
279 |
-
<input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
|
280 |
-
<input type="hidden" name="task" value="" />
|
281 |
</form>
|
282 |
|
283 |
|
284 |
<?php
|
285 |
}
|
286 |
-
|
287 |
-
{
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
}
|
292 |
}
|
|
|
293 |
?>
|
1 |
<?php
|
2 |
+
if (!current_user_can('manage_options')) {
|
3 |
+
die('Access Denied');
|
4 |
}
|
5 |
+
function html_add_theme($def_theme) {
|
6 |
+
?>
|
7 |
<script>
|
8 |
|
9 |
+
function submitbutton(pressbutton) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
+
var form = document.adminForm;
|
12 |
+
if (form.title.value == "") {
|
13 |
+
alert('Set Theme title');
|
14 |
+
return;
|
15 |
+
}
|
|
|
|
|
16 |
|
17 |
+
submitform(pressbutton);
|
18 |
+
}
|
19 |
+
function submitform(pressbutton) {
|
20 |
+
document.getElementById("adminForm").action = document.getElementById("adminForm").action + "&task=" + pressbutton;
|
21 |
+
document.getElementById("adminForm").submit();
|
22 |
+
}
|
23 |
|
24 |
+
</script>
|
25 |
+
<div style="font-size:14px; font-weight:bold">
|
26 |
+
<a href="http://web-dorado.com/wordpress-form-maker-guide-2.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
|
27 |
+
<br />
|
28 |
+
This section allows you to edit form themes.
|
29 |
+
<a href="http://web-dorado.com/wordpress-form-maker-guide-2.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
30 |
+
</div>
|
31 |
+
<table width="90%">
|
32 |
+
<thead>
|
33 |
<tr>
|
34 |
+
<td colspan="11">
|
35 |
+
<div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
|
36 |
+
<a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank"
|
37 |
+
style="color:red; text-decoration:none;">
|
38 |
+
<img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="www.web-dorado.com"
|
39 |
+
width="215"><br>
|
40 |
+
Get the full version
|
41 |
+
</a>
|
42 |
+
</div>
|
43 |
+
</td>
|
|
|
|
|
|
|
44 |
</tr>
|
45 |
+
</thead>
|
46 |
+
<tr>
|
47 |
+
<td width="100%"><h2>Adding New Theme</h2></td>
|
48 |
+
<td align="right"><input type="button" onclick="submitbutton('Save')" value="Save" class="button-secondary action">
|
49 |
+
</td>
|
50 |
+
<td align="right"><input type="button" onclick="submitbutton('Apply')" value="Apply"
|
51 |
+
class="button-secondary action"></td>
|
52 |
+
<td align="right"><input type="button" onclick="window.location.href='admin.php?page=Form_maker_Themes'"
|
53 |
+
value="Cancel" class="button-secondary action"></td>
|
54 |
+
</tr>
|
55 |
+
</table>
|
56 |
+
<form action="admin.php?page=Form_maker_Themes" method="post" id="adminForm" name="adminForm">
|
57 |
+
<table class="admintable">
|
58 |
+
|
59 |
+
|
60 |
+
<tr>
|
61 |
+
<td class="key">
|
62 |
+
<label for="title">
|
63 |
+
Title of theme:
|
64 |
+
</label>
|
65 |
+
</td>
|
66 |
+
<td>
|
67 |
+
<input type="text" name="title" id="title" size="80"/>
|
68 |
+
</td>
|
69 |
+
</tr>
|
70 |
+
<tr>
|
71 |
+
<td class="key">
|
72 |
+
<label for="title">
|
73 |
+
Css:
|
74 |
+
</label>
|
75 |
+
</td>
|
76 |
+
<td>
|
77 |
+
<textarea name="css" id="css" rows=30 cols=100><?php echo $def_theme->css ?></textarea>
|
78 |
+
</td>
|
79 |
+
</tr>
|
80 |
</table>
|
81 |
+
<input type="hidden" name="option" value="com_formmaker"/>
|
82 |
+
<input type="hidden" name="task" value=""/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
</form>
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
+
|
88 |
+
|
89 |
<?php
|
90 |
}
|
91 |
|
92 |
+
function html_show_theme($rows, $pageNav, $sort) {
|
93 |
+
global $wpdb;
|
94 |
+
?>
|
95 |
+
<script language="javascript">
|
96 |
+
function ordering(name, as_or_desc) {
|
97 |
+
document.getElementById('asc_or_desc').value = as_or_desc;
|
98 |
+
document.getElementById('order_by').value = name;
|
99 |
+
document.getElementById('admin_form').submit();
|
100 |
+
}
|
101 |
+
function doNothing() {
|
102 |
+
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
103 |
+
if (keyCode == 13) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
|
|
|
|
|
|
|
105 |
|
106 |
+
if (!e) var e = window.event;
|
107 |
+
|
108 |
+
e.cancelBubble = true;
|
109 |
+
e.returnValue = false;
|
110 |
+
|
111 |
+
if (e.stopPropagation) {
|
112 |
+
e.stopPropagation();
|
113 |
+
e.preventDefault();
|
114 |
+
}
|
115 |
+
}
|
116 |
+
}
|
117 |
+
</script>
|
118 |
+
<div style="font-size:14px; font-weight:bold">
|
119 |
+
<a href="http://web-dorado.com/wordpress-form-maker-guide-2.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
|
120 |
+
<br />
|
121 |
+
This section allows you to edit form themes.
|
122 |
+
<a href="http://web-dorado.com/wordpress-form-maker-guide-2.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
123 |
+
</div>
|
124 |
+
<form method="post" onkeypress="doNothing()" action="admin.php?page=Form_maker_Themes" id="admin_form"
|
125 |
+
name="admin_form">
|
126 |
+
<table cellspacing="10" width="100%">
|
127 |
|
128 |
|
129 |
<tr>
|
130 |
+
<td style="width:80px">
|
131 |
+
<?php echo "<h2>" . 'Themes' . "</h2>"; ?>
|
132 |
+
</td>
|
133 |
+
<td style="width:90px; text-align:right;"><p class="submit" style="padding:0px; text-align:left"><input
|
134 |
+
type="button" value="Add a Theme" name="custom_parametrs"
|
135 |
+
onclick="window.location.href='admin.php?page=Form_maker_Themes&task=add_theme'"/></p></td>
|
136 |
+
<td style="text-align:right;font-size:16px;padding:20px; padding-right:50px">
|
137 |
+
|
138 |
+
</td>
|
139 |
+
<td colspan="11">
|
140 |
+
<div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:90%">
|
141 |
+
<a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank"
|
142 |
+
style="color:red; text-decoration:none;">
|
143 |
+
<img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="www.web-dorado.com"
|
144 |
+
width="215"><br>
|
145 |
+
Get the full version
|
146 |
+
</a>
|
147 |
+
</div>
|
148 |
+
</td>
|
149 |
</tr>
|
150 |
+
</table>
|
151 |
+
<?php
|
152 |
+
if (isset($_POST['serch_or_not'])) {
|
153 |
+
if (esc_html($_POST['serch_or_not']) == "search") {
|
154 |
+
$serch_value = esc_html($_POST['search_events_by_title']);
|
155 |
+
}
|
156 |
+
else {
|
157 |
+
$serch_value = "";
|
158 |
+
}
|
159 |
+
}
|
160 |
+
else {
|
161 |
+
$serch_value = "";
|
162 |
+
}
|
163 |
+
$serch_fields = '<div class="alignleft actions" style="width:180px;">
|
164 |
<label for="search_events_by_title" style="font-size:14px">Title: </label>
|
165 |
+
<input type="text" name="search_events_by_title" value="' . $serch_value . '" id="search_events_by_title" onchange="clear_serch_texts()">
|
166 |
</div>
|
167 |
<div class="alignleft actions">
|
168 |
<input type="button" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\'; document.getElementById(\'serch_or_not\').value=\'search\';
|
169 |
document.getElementById(\'admin_form\').submit();" class="button-secondary action">
|
170 |
<input type="button" value="Reset" onclick="window.location.href=\'admin.php?page=Form_maker_Themes\'" class="button-secondary action">
|
171 |
</div>';
|
172 |
+
print_html_nav($pageNav['total'], $pageNav['limit'], $serch_fields);
|
173 |
+
|
174 |
+
?>
|
175 |
<table class="wp-list-table widefat fixed pages" style="width:95%">
|
176 |
+
<thead>
|
177 |
+
<TR>
|
178 |
+
<th scope="col" id="id" class="<?php if ($sort["sortid_by"] == "id")
|
179 |
+
echo $sort["custom_style"];
|
180 |
+
else echo $sort["default_style"]; ?>" style=" width:120px"><a
|
181 |
+
href="javascript:ordering('id',<?php if ($sort["sortid_by"] == "id")
|
182 |
+
echo $sort["1_or_2"];
|
183 |
+
else echo "1"; ?>)"><span>ID</span><span class="sorting-indicator"></span></a></th>
|
184 |
+
<th scope="col" id="title" class="<?php if ($sort["sortid_by"] == "title")
|
185 |
+
echo $sort["custom_style"];
|
186 |
+
else echo $sort["default_style"]; ?>" style=""><a
|
187 |
+
href="javascript:ordering('title',<?php if ($sort["sortid_by"] == "title")
|
188 |
+
echo $sort["1_or_2"];
|
189 |
+
else echo "1"; ?>)"><span>Title</span><span class="sorting-indicator"></span></a></th>
|
190 |
+
<th>Default</th>
|
191 |
+
<th style="width:80px">Edit</th>
|
192 |
+
<th style="width:80px">Delete</th>
|
193 |
+
</TR>
|
194 |
+
</thead>
|
195 |
+
<tbody>
|
196 |
+
<?php for ($i = 0; $i < count($rows); $i++) { ?>
|
197 |
+
<tr>
|
198 |
+
<td><?php echo $rows[$i]->id; ?></td>
|
199 |
+
<td><a
|
200 |
+
href="admin.php?page=Form_maker_Themes&task=edit_theme&id=<?php echo $rows[$i]->id?>"><?php echo $rows[$i]->title; ?></a>
|
201 |
+
</td>
|
202 |
+
<td><a <?php if (!$rows[$i]->default)
|
203 |
+
echo 'style="color:#C00"'; ?>
|
204 |
+
href="admin.php?page=Form_maker_Themes&task=default&id=<?php echo $rows[$i]->id?>"><?php if ($rows[$i]->default)
|
205 |
+
echo "Default";
|
206 |
+
else echo "Not Default"; ?></a></td>
|
207 |
+
<td><a href="admin.php?page=Form_maker_Themes&task=edit_theme&id=<?php echo $rows[$i]->id?>">Edit</a></td>
|
208 |
+
<td><a href="admin.php?page=Form_maker_Themes&task=remove_theme&id=<?php echo $rows[$i]->id?>">Delete</a></td>
|
209 |
+
</tr>
|
210 |
+
<?php } ?>
|
211 |
+
</tbody>
|
212 |
+
</table>
|
213 |
+
<input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if (isset($_POST['asc_or_desc']))
|
214 |
+
echo esc_html($_POST['asc_or_desc']);?>"/>
|
215 |
+
<input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by']))
|
216 |
+
echo esc_html($_POST['order_by']);?>"/>
|
217 |
|
218 |
+
<?php
|
219 |
+
?>
|
220 |
+
|
221 |
+
|
222 |
+
</form>
|
223 |
+
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
224 |
}
|
225 |
|
226 |
+
function html_edit_theme($row, $id) {
|
227 |
+
?>
|
228 |
+
|
229 |
+
|
230 |
+
<script>
|
231 |
+
|
232 |
+
function submitbutton(pressbutton) {
|
233 |
+
|
234 |
+
var form = document.adminForm;
|
235 |
+
|
236 |
+
if (pressbutton == 'cancel_themes') {
|
237 |
+
submitform(pressbutton);
|
238 |
+
return;
|
239 |
+
}
|
240 |
+
if (form.title.value == "") {
|
241 |
+
alert('Set Theme title');
|
242 |
+
return;
|
243 |
+
}
|
244 |
+
|
245 |
+
submitform(pressbutton);
|
246 |
+
}
|
247 |
+
function submitform(pressbutton) {
|
248 |
+
document.getElementById("adminForm").action = document.getElementById("adminForm").action + "&task=" + pressbutton;
|
249 |
+
document.getElementById("adminForm").submit();
|
250 |
+
}
|
251 |
+
|
252 |
+
</script>
|
253 |
+
|
254 |
+
|
255 |
+
|
256 |
+
|
257 |
+
|
258 |
+
|
259 |
+
|
260 |
+
|
261 |
+
|
262 |
+
|
263 |
+
|
264 |
+
|
265 |
+
|
266 |
+
|
267 |
+
|
268 |
+
|
269 |
+
|
270 |
+
|
271 |
+
|
272 |
+
|
273 |
+
<table width="90%">
|
274 |
+
<thead>
|
275 |
<tr>
|
276 |
+
<td colspan="11">
|
277 |
+
<div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
|
278 |
+
<a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank"
|
279 |
+
style="color:red; text-decoration:none;">
|
280 |
+
<img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="www.web-dorado.com"
|
281 |
+
width="215"><br>
|
282 |
+
Get the full version
|
283 |
+
</a>
|
284 |
+
</div>
|
285 |
+
</td>
|
286 |
+
</tr>
|
287 |
+
</thead>
|
288 |
+
<tr>
|
289 |
+
<td width="100%"><h2>Theme <?php echo htmlspecialchars($row->title)?></h2></td>
|
290 |
+
<td align="right"><input type="button" onclick="submitbutton('Save')" value="Save" class="button-secondary action">
|
291 |
+
</td>
|
292 |
+
<td align="right"><input type="button" onclick="submitbutton('Apply')" value="Apply"
|
293 |
+
class="button-secondary action"></td>
|
294 |
+
<td align="right"><input type="button" onclick="window.location.href='admin.php?page=Form_maker_Themes'"
|
295 |
+
value="Cancel" class="button-secondary action"></td>
|
296 |
</tr>
|
297 |
+
</table>
|
298 |
+
<form action="admin.php?page=Form_maker_Themes&id=<?php echo $id; ?>" method="post" id="adminForm" name="adminForm">
|
299 |
+
<table class="admintable">
|
300 |
+
|
301 |
+
|
302 |
+
<tr>
|
303 |
+
<td class="key">
|
304 |
+
<label for="title">
|
305 |
+
Title of theme:
|
306 |
+
</label>
|
307 |
+
</td>
|
308 |
+
<td>
|
309 |
+
<input type="text" name="title" id="title" value="<?php echo htmlspecialchars($row->title) ?>" size="80"/>
|
310 |
+
</td>
|
311 |
+
</tr>
|
312 |
+
<tr>
|
313 |
+
<td class="key">
|
314 |
+
<label for="title">
|
315 |
+
Css:
|
316 |
+
</label>
|
317 |
+
</td>
|
318 |
+
<td>
|
319 |
+
<textarea name="css" id="css" rows=30 cols=100><?php echo htmlspecialchars($row->css) ?></textarea>
|
320 |
+
</td>
|
321 |
+
</tr>
|
322 |
</table>
|
323 |
+
<input type="hidden" name="option" value="com_formmaker"/>
|
324 |
+
<input type="hidden" name="id" value="<?php echo $row->id?>"/>
|
325 |
+
<input type="hidden" name="cid[]" value="<?php echo $row->id; ?>"/>
|
326 |
+
<input type="hidden" name="task" value=""/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
327 |
</form>
|
328 |
|
329 |
|
330 |
<?php
|
331 |
}
|
332 |
+
|
333 |
+
function cheched($row, $y) {
|
334 |
+
if ($row == $y) {
|
335 |
+
echo'checked="checked"';
|
336 |
+
}
|
|
|
337 |
}
|
338 |
+
|
339 |
?>
|
css/style.css
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
background-color:#00AAF1;
|
4 |
margin:1px;
|
5 |
border-radius:0px;
|
6 |
-
padding:
|
7 |
height:75px;
|
8 |
width:87px;
|
9 |
cursor:pointer;
|
3 |
background-color:#00AAF1;
|
4 |
margin:1px;
|
5 |
border-radius:0px;
|
6 |
+
padding:2px;
|
7 |
height:75px;
|
8 |
width:87px;
|
9 |
cursor:pointer;
|
form_ajax_functions.php
CHANGED
@@ -1,20 +1,14 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
* @package Form Maker
|
5 |
* @author Web-Dorado
|
6 |
* @copyright (C) 2011 Web-Dorado. All rights reserved.
|
7 |
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
8 |
**/
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
//////////////////////////////////////////////////// generete CSV
|
17 |
-
function form_maker_generete_csv() {
|
18 |
if (function_exists('current_user_can')) {
|
19 |
if (!current_user_can('manage_options')) {
|
20 |
die('Access Denied');
|
@@ -23,223 +17,143 @@
|
|
23 |
else {
|
24 |
die('Access Denied');
|
25 |
}
|
26 |
-
|
27 |
-
global $wpdb;
|
28 |
-
$form_id
|
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 |
-
|
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 |
-
$i=$group_id_s[$www];
|
137 |
-
|
138 |
-
$temp= array();
|
139 |
-
for($j=0; $j < $n ; $j++)
|
140 |
-
{
|
141 |
-
|
142 |
-
$row = &$rows[$j];
|
143 |
-
|
144 |
-
if($row->group_id==$i)
|
145 |
-
{
|
146 |
-
|
147 |
-
array_push($temp, $row);
|
148 |
-
}
|
149 |
-
}
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
$f=$temp[0];
|
154 |
-
$date=$f->date;
|
155 |
-
$ip=$f->ip;
|
156 |
-
$data_temp['Submit date']=$date;
|
157 |
-
$data_temp['Ip']=$ip;
|
158 |
-
|
159 |
-
|
160 |
-
$ttt=count($temp);
|
161 |
-
|
162 |
-
// var_dump($temp);
|
163 |
-
for($h=0; $h < $m ; $h++)
|
164 |
-
{
|
165 |
-
|
166 |
-
for($g=0; $g < $ttt ; $g++)
|
167 |
-
{
|
168 |
-
$t = $temp[$g];
|
169 |
-
if($t->element_label==$sorted_labels_id[$h])
|
170 |
-
{
|
171 |
-
if(strpos($t->element_value,"*@@url@@*"))
|
172 |
-
{
|
173 |
-
$new_file=str_replace("*@@url@@*",'', $t->element_value);
|
174 |
-
$new_filename=explode('/', $new_file);
|
175 |
-
$data_temp[$label_titles[$h]]=$new_file;
|
176 |
-
}
|
177 |
-
else
|
178 |
-
if(strpos($t->element_value,"***br***"))
|
179 |
-
{
|
180 |
-
$data_temp[$label_titles[$h]]= substr(str_replace("***br***",', ', $t->element_value), 0, -2);
|
181 |
-
}
|
182 |
-
else
|
183 |
-
if(strpos($t->element_value,"***map***"))
|
184 |
-
{
|
185 |
-
$data_temp[$label_titles[$h]]= 'Longitude:'.substr(str_replace("***map***",', Latitude:', $t->element_value), 0, -2);
|
186 |
-
}
|
187 |
-
else
|
188 |
-
$data_temp[$label_titles[$h]]=$t->element_value;
|
189 |
-
}
|
190 |
-
}
|
191 |
-
|
192 |
-
|
193 |
-
}
|
194 |
-
$data[]=$data_temp;
|
195 |
-
}
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
function cleanData(&$str)
|
201 |
-
{
|
202 |
-
$str = preg_replace("/\t/", "\\t", $str);
|
203 |
-
$str = preg_replace("/\r?\n/", "\\n", $str);
|
204 |
-
if(strstr($str, '"')) $str = '"' . str_replace('"', '""', $str) . '"';
|
205 |
-
}
|
206 |
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
}
|
222 |
-
|
223 |
-
echo '"'.implode('","',array_values($row))."\"\r\n";
|
224 |
}
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
/////////////////////////////////////////////////////////////////////////////
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
///////////////////////////////////////////////////////////////////////////// generete XML
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
function form_maker_generete_xml() {
|
244 |
if (function_exists('current_user_can')) {
|
245 |
if (!current_user_can('manage_options')) {
|
@@ -250,197 +164,158 @@ function form_maker_generete_xml() {
|
|
250 |
die('Access Denied');
|
251 |
}
|
252 |
if (isset($_GET['action']) && esc_html($_GET['action']) == 'formmakergeneretexml') {
|
253 |
-
global $wpdb;
|
254 |
-
$form_id
|
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 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
$
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
if(strpos($t->element_value,"***map***"))
|
359 |
-
{
|
360 |
-
$data_temp[$label_titles[$h]]= 'Longitude:'.substr(str_replace("***map***",', Latitude:', $t->element_value), 0, -2);
|
361 |
-
}
|
362 |
-
else
|
363 |
-
$data_temp[$label_titles[$h]]=$t->element_value;
|
364 |
-
}
|
365 |
-
}
|
366 |
-
}
|
367 |
-
$data[]=$data_temp;
|
368 |
-
}
|
369 |
-
function cleanData(&$str)
|
370 |
-
{
|
371 |
-
$str = preg_replace("/\t/", "\\t", $str);
|
372 |
-
$str = preg_replace("/\r?\n/", "\\n", $str);
|
373 |
-
if(strstr($str, '"')) $str = '"' . str_replace('"', '""', $str) . '"';
|
374 |
-
}
|
375 |
-
$filename = $title."_" . date('Ymd') . ".xml";
|
376 |
-
header("Content-Disposition: attachment; filename=\"$filename\"");
|
377 |
-
header("Content-Type:text/xml, charset=utf-8");
|
378 |
-
$flag = false;
|
379 |
-
echo '
|
380 |
-
|
381 |
-
<?xml version="1.0" encoding="utf-8" ?>
|
382 |
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
392 |
}
|
393 |
-
echo ' </form>
|
394 |
-
';
|
395 |
-
die('');
|
396 |
-
}
|
397 |
}
|
398 |
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
//////////////////////////////////////////////////////////////////////
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
///////////////////////////////////////////////////////////////////// wd_captcha
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
function form_maker_wd_captcha(){
|
422 |
if (isset($_GET['action']) && esc_html($_GET['action']) == 'formmakerwdcaptcha') {
|
423 |
-
|
424 |
-
$i = (int)
|
425 |
}
|
426 |
else {
|
427 |
$i = '';
|
428 |
}
|
429 |
if (isset($_GET['r2'])) {
|
430 |
-
$r2 = (int)
|
431 |
}
|
432 |
else {
|
433 |
$r2 = 0;
|
434 |
}
|
435 |
if (isset($_GET['r'])) {
|
436 |
-
$rrr = (int)
|
437 |
}
|
438 |
else {
|
439 |
$rrr = 0;
|
440 |
}
|
441 |
$randNum = 0 + $r2 + $rrr;
|
442 |
if (isset($_GET["digit"])) {
|
443 |
-
$digit = (int)
|
444 |
}
|
445 |
else {
|
446 |
$digit = 6;
|
@@ -452,182 +327,203 @@ function form_maker_wd_captcha(){
|
|
452 |
$cap_length_max = $digit;
|
453 |
$cap_digital = 1;
|
454 |
$cap_latin_char = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
455 |
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
$
|
461 |
-
$
|
462 |
-
$
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
$
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
$
|
472 |
-
$
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
$letter=$code[$it];
|
484 |
-
imagestring($canvas,6,(10*$it+10),$cap_height/4,$letter,$color_text);
|
485 |
-
}
|
486 |
-
|
487 |
-
for ($c = 0; $c < 150; $c++){
|
488 |
-
$x = rand(0,$cap_width-1);
|
489 |
-
$y = rand(0,29);
|
490 |
-
$col='0x'.rand(0,9).'0'.rand(0,9).'0'.rand(0,9).'0';
|
491 |
-
imagesetpixel($canvas, $x, $y, $col);
|
492 |
-
}
|
493 |
-
|
494 |
-
|
495 |
-
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
496 |
-
header('Cache-Control: no-store, no-cache, must-revalidate');
|
497 |
-
header('Cache-Control: post-check=0, pre-check=0',false);
|
498 |
-
header('Pragma: no-cache');
|
499 |
-
header('Content-Type: image/jpeg');
|
500 |
-
imagejpeg($canvas,null,$cap_quality);
|
501 |
-
die('');
|
502 |
-
}
|
503 |
}
|
504 |
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
/////////////////////////////////////////////////////////////////////
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
////////////////////////////////////////////////////////////////////// function post or page window php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
526 |
|
|
|
527 |
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
<html xmlns="http://www.w3.org/1999/xhtml">
|
535 |
-
<head>
|
536 |
-
<title>Form Maker</title>
|
537 |
-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
538 |
-
<script language="javascript" type="text/javascript" src="<?php echo get_option("siteurl"); ?>/wp-includes/js/jquery/jquery.js"></script>
|
539 |
-
<script language="javascript" type="text/javascript" src="<?php echo get_option("siteurl"); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
|
540 |
-
<link rel="stylesheet" href="<?php echo get_option("siteurl"); ?>/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css?ver=342-20110630100">
|
541 |
-
<script language="javascript" type="text/javascript" src="<?php echo get_option("siteurl"); ?>/wp-includes/js/tinymce/utils/mctabs.js"></script>
|
542 |
-
<script language="javascript" type="text/javascript" src="<?php echo get_option("siteurl"); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
|
543 |
-
<base target="_self">
|
544 |
-
</head>
|
545 |
-
<body id="link" style="" dir="ltr" class="forceColors">
|
546 |
-
<div class="tabs" role="tablist" tabindex="-1">
|
547 |
-
<ul>
|
548 |
-
<li id="form_maker_tab" class="current" role="tab" tabindex="0"><span><a href="javascript:mcTabs.displayTab('Single_product_tab','Single_product_panel');" onMouseDown="return false;" tabindex="-1">Form Maker</a></span></li>
|
549 |
-
</ul>
|
550 |
-
</div>
|
551 |
-
<style>
|
552 |
-
.panel_wrapper{
|
553 |
-
height:170px !important;
|
554 |
-
}
|
555 |
-
</style>
|
556 |
-
<div class="panel_wrapper">
|
557 |
-
<div id="Single_product_panel" class="panel current">
|
558 |
-
<table>
|
559 |
-
<tr>
|
560 |
-
<td style="height:100px; width:100px; vertical-align:top;">
|
561 |
-
Select a Form
|
562 |
-
</td>
|
563 |
-
<td style="vertical-align:top">
|
564 |
-
<select name="Form_Makername" id="Form_Makername" style="width:250px; text-align:center">
|
565 |
-
<option style="text-align:center" value="- Select Form -" selected="selected">- Select a Form -</option>
|
566 |
-
<?php $ids_Form_Maker=$wpdb->get_results("SELECT * FROM ".$wpdb->prefix."formmaker WHERE `id` NOT IN(".get_option('contact_form_forms',0).") order by `id` DESC",0);
|
567 |
-
foreach($ids_Form_Maker as $arr_Form_Maker)
|
568 |
-
{
|
569 |
-
?>
|
570 |
-
<option value="<?php echo $arr_Form_Maker->id; ?>"><?php echo $arr_Form_Maker->title; ?></option>
|
571 |
-
<?php }?>
|
572 |
-
</select>
|
573 |
-
</td>
|
574 |
-
</tr>
|
575 |
-
</table>
|
576 |
-
</div>
|
577 |
-
</div>
|
578 |
-
<div class="mceActionPanel">
|
579 |
-
<div style="float: left">
|
580 |
-
<input type="button" id="cancel" name="cancel" value="Cancel" onClick="tinyMCEPopup.close();" />
|
581 |
-
</div>
|
582 |
-
|
583 |
-
<div style="float: right">
|
584 |
-
<input type="submit" id="insert" name="insert" value="Insert" onClick="insert_Form_Maker();" />
|
585 |
-
</div>
|
586 |
-
</div>
|
587 |
-
<script type="text/javascript">
|
588 |
-
function insert_Form_Maker() {
|
589 |
-
if(document.getElementById('Form_Makername').value=='- Select Form -')
|
590 |
-
{
|
591 |
-
tinyMCEPopup.close();
|
592 |
-
}
|
593 |
-
else
|
594 |
-
{
|
595 |
-
var tagtext;
|
596 |
-
tagtext='[Form id="'+document.getElementById('Form_Makername').value+'"]';
|
597 |
-
window.tinyMCE.execInstanceCommand('content', 'mceInsertContent', false, tagtext);
|
598 |
-
tinyMCEPopup.editor.execCommand('mceRepaint');
|
599 |
-
tinyMCEPopup.close();
|
600 |
-
}
|
601 |
-
|
602 |
}
|
603 |
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
610 |
}
|
611 |
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
* @package Form Maker
|
5 |
* @author Web-Dorado
|
6 |
* @copyright (C) 2011 Web-Dorado. All rights reserved.
|
7 |
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
8 |
**/
|
9 |
+
// Direct access must be allowed
|
10 |
+
//////////////////////////////////////////////////// generete CSV
|
11 |
+
function form_maker_generete_csv() {
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
if (function_exists('current_user_can')) {
|
13 |
if (!current_user_can('manage_options')) {
|
14 |
die('Access Denied');
|
17 |
else {
|
18 |
die('Access Denied');
|
19 |
}
|
20 |
+
if (isset($_GET['action']) && esc_html($_GET['action']) == 'formmakergeneretecsv') {
|
21 |
+
global $wpdb;
|
22 |
+
$form_id = $_REQUEST['form_id'];
|
23 |
+
$query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_submits where form_id= %d", $form_id);
|
24 |
+
$rows = $wpdb->get_results($query);
|
25 |
+
$n = count($rows);
|
26 |
+
$labels = array();
|
27 |
+
for ($i = 0; $i < $n; $i++) {
|
28 |
+
$row = &$rows[$i];
|
29 |
+
if (!in_array($row->element_label, $labels)) {
|
30 |
+
array_push($labels, $row->element_label);
|
31 |
+
}
|
32 |
+
}
|
33 |
+
$label_titles = array();
|
34 |
+
$sorted_labels = array();
|
35 |
+
$query_lable = $wpdb->prepare("SELECT label_order,title FROM " . $wpdb->prefix . "formmaker where id= %d", $form_id);
|
36 |
+
$rows_lable = $wpdb->get_results($query_lable);
|
37 |
+
$ptn = "/[^a-zA-Z0-9_]/";
|
38 |
+
$rpltxt = "";
|
39 |
+
$title = preg_replace($ptn, $rpltxt, $rows_lable[0]->title);
|
40 |
+
$sorted_labels_id = array();
|
41 |
+
$sorted_labels = array();
|
42 |
+
$label_titles = array();
|
43 |
+
if ($labels) {
|
44 |
+
$label_id = array();
|
45 |
+
$label_order = array();
|
46 |
+
$label_order_original = array();
|
47 |
+
$label_type = array();
|
48 |
+
///stexic
|
49 |
+
$label_all = explode('#****#', $rows_lable[0]->label_order);
|
50 |
+
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
51 |
+
foreach ($label_all as $key => $label_each) {
|
52 |
+
$label_id_each = explode('#**id**#', $label_each);
|
53 |
+
array_push($label_id, $label_id_each[0]);
|
54 |
+
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
55 |
+
array_push($label_order_original, $label_oder_each[0]);
|
56 |
+
$ptn = "/[^a-zA-Z0-9_]/";
|
57 |
+
$rpltxt = "";
|
58 |
+
$label_temp = preg_replace($ptn, $rpltxt, $label_oder_each[0]);
|
59 |
+
array_push($label_order, $label_temp);
|
60 |
+
array_push($label_type, $label_oder_each[1]);
|
61 |
+
//echo $label."<br>";
|
62 |
+
}
|
63 |
+
foreach ($label_id as $key => $label)
|
64 |
+
if (in_array($label, $labels)) {
|
65 |
+
array_push($sorted_labels, $label_order[$key]);
|
66 |
+
array_push($sorted_labels_id, $label);
|
67 |
+
array_push($label_titles, $label_order_original[$key]);
|
68 |
+
}
|
69 |
+
}
|
70 |
+
$m = count($sorted_labels);
|
71 |
+
$group_id_s = array();
|
72 |
+
$l = 0;
|
73 |
+
if (count($rows) > 0 and $m)
|
74 |
+
for ($i = 0; $i < count($rows); $i++) {
|
75 |
+
$row = &$rows[$i];
|
76 |
+
if (!in_array($row->group_id, $group_id_s)) {
|
77 |
+
array_push($group_id_s, $row->group_id);
|
78 |
+
}
|
79 |
+
}
|
80 |
+
$data = array();
|
81 |
+
for ($www = 0; $www < count($group_id_s); $www++) {
|
82 |
+
$i = $group_id_s[$www];
|
83 |
+
$temp = array();
|
84 |
+
for ($j = 0; $j < $n; $j++) {
|
85 |
+
$row = &$rows[$j];
|
86 |
+
if ($row->group_id == $i) {
|
87 |
+
array_push($temp, $row);
|
88 |
+
}
|
89 |
+
}
|
90 |
+
$f = $temp[0];
|
91 |
+
$date = $f->date;
|
92 |
+
$ip = $f->ip;
|
93 |
+
$data_temp['Submit date'] = $date;
|
94 |
+
$data_temp['Ip'] = $ip;
|
95 |
+
$ttt = count($temp);
|
96 |
+
// var_dump($temp);
|
97 |
+
for ($h = 0; $h < $m; $h++) {
|
98 |
+
$data_temp[$label_titles[$h]] = '';
|
99 |
+
for ($g = 0; $g < $ttt; $g++) {
|
100 |
+
$t = $temp[$g];
|
101 |
+
if ($t->element_label == $sorted_labels_id[$h]) {
|
102 |
+
if (strpos($t->element_value, "*@@url@@*")) {
|
103 |
+
$new_file = str_replace("*@@url@@*", '', $t->element_value);
|
104 |
+
$new_filename = explode('/', $new_file);
|
105 |
+
$data_temp[$label_titles[$h]] = $new_file;
|
106 |
+
}
|
107 |
+
elseif (strpos($t->element_value, "***br***")) {
|
108 |
+
$data_temp[$label_titles[$h]] = substr(str_replace("***br***", ', ', $t->element_value), 0, -2);
|
109 |
+
}
|
110 |
+
elseif (strpos($t->element_value, "***map***")) {
|
111 |
+
$data_temp[$label_titles[$h]] = 'Longitude:' . substr(str_replace("***map***", ', Latitude:', $t->element_value), 0, -2);
|
112 |
+
}
|
113 |
+
else {
|
114 |
+
$val = htmlspecialchars_decode($t->element_value);
|
115 |
+
$val = stripslashes(str_replace(''', "'", $val));
|
116 |
+
$data_temp[stripslashes($label_titles[$h])] = ($t->element_value ? $val : '');
|
117 |
+
}
|
118 |
+
}
|
119 |
+
}
|
120 |
+
}
|
121 |
+
$data[] = $data_temp;
|
122 |
+
}
|
123 |
+
function cleanData(&$str) {
|
124 |
+
$str = preg_replace("/\t/", "\\t", $str);
|
125 |
+
$str = preg_replace("/\r?\n/", "\\n", $str);
|
126 |
+
if (strstr($str, '"'))
|
127 |
+
$str = '"' . str_replace('"', '""', $str) . '"';
|
128 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
|
130 |
+
// file name for download
|
131 |
+
$filename = $title . "_" . date('Ymd') . ".csv";
|
132 |
+
header('Content-Encoding: Windows-1252');
|
133 |
+
header('Content-type: text/csv; charset=Windows-1252');
|
134 |
+
header("Content-Disposition: attachment; filename=\"$filename\"");
|
135 |
+
echo chr(239) . chr(187) . chr(191);
|
136 |
+
$flag = FALSE;
|
137 |
+
foreach ($data as $row) {
|
138 |
+
if (!$flag) {
|
139 |
+
# display field/column names as first row
|
140 |
+
echo "sep=,\r\n";
|
141 |
+
echo '"' . implode('","', array_keys($row));
|
142 |
+
if ($is_paypal_info) {
|
143 |
+
echo '","Currency","Last modified","Status","Full Name","Fax","Mobile phone","Email","Phone","Address","Paypal info","IPN","Tax","Shipping';
|
144 |
+
}
|
145 |
+
echo "\"\r\n";
|
146 |
+
$flag = TRUE;
|
147 |
+
}
|
148 |
+
array_walk($row, 'cleanData');
|
149 |
+
echo '"' . implode('","', array_values($row)) . "\"\r\n";
|
150 |
}
|
151 |
+
die('');
|
|
|
152 |
}
|
153 |
+
}
|
154 |
+
|
155 |
+
/////////////////////////////////////////////////////////////////////////////
|
156 |
+
///////////////////////////////////////////////////////////////////////////// generete XML
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
function form_maker_generete_xml() {
|
158 |
if (function_exists('current_user_can')) {
|
159 |
if (!current_user_can('manage_options')) {
|
164 |
die('Access Denied');
|
165 |
}
|
166 |
if (isset($_GET['action']) && esc_html($_GET['action']) == 'formmakergeneretexml') {
|
167 |
+
global $wpdb;
|
168 |
+
$form_id = $_REQUEST['form_id'];
|
169 |
+
$query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_submits where form_id= %d", $form_id);
|
170 |
+
$rows = $wpdb->get_results($query);
|
171 |
+
$n = count($rows);
|
172 |
+
$labels = array();
|
173 |
+
for ($i = 0; $i < $n; $i++) {
|
174 |
+
$row = &$rows[$i];
|
175 |
+
if (!in_array($row->element_label, $labels)) {
|
176 |
+
array_push($labels, $row->element_label);
|
177 |
+
}
|
178 |
+
}
|
179 |
+
$label_titles = array();
|
180 |
+
$sorted_labels = array();
|
181 |
+
$query_lable = "SELECT label_order,title FROM " . $wpdb->prefix . "formmaker where id=$form_id ";
|
182 |
+
$rows_lable = $wpdb->get_results($query_lable);
|
183 |
+
$ptn = "/[^a-zA-Z0-9_]/";
|
184 |
+
$rpltxt = "";
|
185 |
+
$title = preg_replace($ptn, $rpltxt, $rows_lable[0]->title);
|
186 |
+
$sorted_labels_id = array();
|
187 |
+
$sorted_labels = array();
|
188 |
+
$label_titles = array();
|
189 |
+
if ($labels) {
|
190 |
+
$label_id = array();
|
191 |
+
$label_order = array();
|
192 |
+
$label_order_original = array();
|
193 |
+
$label_type = array();
|
194 |
+
///stexic
|
195 |
+
$label_all = explode('#****#', $rows_lable[0]->label_order);
|
196 |
+
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
197 |
+
foreach ($label_all as $key => $label_each) {
|
198 |
+
$label_id_each = explode('#**id**#', $label_each);
|
199 |
+
array_push($label_id, $label_id_each[0]);
|
200 |
+
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
201 |
+
array_push($label_order_original, $label_oder_each[0]);
|
202 |
+
$ptn = "/[^a-zA-Z0-9_]/";
|
203 |
+
$rpltxt = "";
|
204 |
+
$label_temp = preg_replace($ptn, $rpltxt, $label_oder_each[0]);
|
205 |
+
array_push($label_order, $label_temp);
|
206 |
+
array_push($label_type, $label_oder_each[1]);
|
207 |
+
}
|
208 |
+
foreach ($label_id as $key => $label)
|
209 |
+
if (in_array($label, $labels)) {
|
210 |
+
array_push($sorted_labels, $label_order[$key]);
|
211 |
+
array_push($sorted_labels_id, $label);
|
212 |
+
array_push($label_titles, $label_order_original[$key]);
|
213 |
+
}
|
214 |
+
}
|
215 |
+
$m = count($sorted_labels);
|
216 |
+
$group_id_s = array();
|
217 |
+
$l = 0;
|
218 |
+
if (count($rows) > 0 and $m)
|
219 |
+
for ($i = 0; $i < count($rows); $i++) {
|
220 |
+
$row = &$rows[$i];
|
221 |
+
if (!in_array($row->group_id, $group_id_s)) {
|
222 |
+
array_push($group_id_s, $row->group_id);
|
223 |
+
}
|
224 |
+
}
|
225 |
+
$data = array();
|
226 |
+
for ($www = 0; $www < count($group_id_s); $www++) {
|
227 |
+
$i = $group_id_s[$www];
|
228 |
+
$temp = array();
|
229 |
+
for ($j = 0; $j < $n; $j++) {
|
230 |
+
$row = &$rows[$j];
|
231 |
+
if ($row->group_id == $i) {
|
232 |
+
array_push($temp, $row);
|
233 |
+
}
|
234 |
+
}
|
235 |
+
$f = $temp[0];
|
236 |
+
$date = $f->date;
|
237 |
+
$ip = $f->ip;
|
238 |
+
$data_temp['Submit date'] = $date;
|
239 |
+
$data_temp['Ip'] = $ip;
|
240 |
+
$ttt = count($temp);
|
241 |
+
for ($h = 0; $h < $m; $h++) {
|
242 |
+
for ($g = 0; $g < $ttt; $g++) {
|
243 |
+
$t = $temp[$g];
|
244 |
+
if ($t->element_label == $sorted_labels_id[$h]) {
|
245 |
+
if (strpos($t->element_value, "*@@url@@*")) {
|
246 |
+
$new_file = str_replace("*@@url@@*", '', $t->element_value);
|
247 |
+
$new_filename = explode('/', $new_file);
|
248 |
+
$data_temp[$label_titles[$h]] = $new_file;
|
249 |
+
}
|
250 |
+
elseif (strpos($t->element_value, "***br***")) {
|
251 |
+
$data_temp[$label_titles[$h]] = substr(str_replace("***br***", ', ', $t->element_value), 0, -2);
|
252 |
+
}
|
253 |
+
elseif (strpos($t->element_value, "***map***")) {
|
254 |
+
$data_temp[$label_titles[$h]] = 'Longitude:' . substr(str_replace("***map***", ', Latitude:', $t->element_value), 0, -2);
|
255 |
+
}
|
256 |
+
else {
|
257 |
+
$val = str_replace('&', "&", $t->element_value);
|
258 |
+
$val = stripslashes(str_replace(''', "'", $t->element_value));
|
259 |
+
$data_temp[stripslashes($label_titles[$h])] = ($t->element_value ? $val : '');
|
260 |
+
}
|
261 |
+
}
|
262 |
+
}
|
263 |
+
}
|
264 |
+
$data[] = $data_temp;
|
265 |
+
}
|
266 |
+
function cleanData(&$str) {
|
267 |
+
$str = preg_replace("/\t/", "\\t", $str);
|
268 |
+
$str = preg_replace("/\r?\n/", "\\n", $str);
|
269 |
+
if (strstr($str, '"'))
|
270 |
+
$str = '"' . str_replace('"', '""', $str) . '"';
|
271 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
|
273 |
+
$filename = $title . "_" . date('Ymd') . ".xml";
|
274 |
+
header("Content-Disposition: attachment; filename=\"$filename\"");
|
275 |
+
header("Content-Type:text/xml, charset=utf-8");
|
276 |
+
$flag = FALSE;
|
277 |
+
echo '<?xml version="1.0" encoding="utf-8" ?>
|
278 |
+
|
279 |
+
<form title="' . $title . '">';
|
280 |
+
foreach ($data as $key1 => $value1) {
|
281 |
+
echo '<submission>';
|
282 |
+
foreach ($value1 as $key => $value) {
|
283 |
+
echo '<field title="' . $key . '">';
|
284 |
+
echo '<![CDATA[' . $value . "]]>";
|
285 |
+
echo '</field>';
|
286 |
+
}
|
287 |
+
echo '</submission>';
|
288 |
+
}
|
289 |
+
echo ' </form>';
|
290 |
+
die('');
|
291 |
}
|
|
|
|
|
|
|
|
|
292 |
}
|
293 |
|
|
|
|
|
|
|
|
|
294 |
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
|
295 |
///////////////////////////////////////////////////////////////////// wd_captcha
|
296 |
+
function form_maker_wd_captcha() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
if (isset($_GET['action']) && esc_html($_GET['action']) == 'formmakerwdcaptcha') {
|
298 |
+
if (isset($_GET["i"])) {
|
299 |
+
$i = (int)$_GET["i"];
|
300 |
}
|
301 |
else {
|
302 |
$i = '';
|
303 |
}
|
304 |
if (isset($_GET['r2'])) {
|
305 |
+
$r2 = (int)$_GET['r2'];
|
306 |
}
|
307 |
else {
|
308 |
$r2 = 0;
|
309 |
}
|
310 |
if (isset($_GET['r'])) {
|
311 |
+
$rrr = (int)$_GET['r'];
|
312 |
}
|
313 |
else {
|
314 |
$rrr = 0;
|
315 |
}
|
316 |
$randNum = 0 + $r2 + $rrr;
|
317 |
if (isset($_GET["digit"])) {
|
318 |
+
$digit = (int)$_GET["digit"];
|
319 |
}
|
320 |
else {
|
321 |
$digit = 6;
|
327 |
$cap_length_max = $digit;
|
328 |
$cap_digital = 1;
|
329 |
$cap_latin_char = 1;
|
330 |
+
function code_generic($_length, $_digital = 1, $_latin_char = 1) {
|
331 |
+
$dig = array(
|
332 |
+
0,
|
333 |
+
1,
|
334 |
+
2,
|
335 |
+
3,
|
336 |
+
4,
|
337 |
+
5,
|
338 |
+
6,
|
339 |
+
7,
|
340 |
+
8,
|
341 |
+
9
|
342 |
+
);
|
343 |
+
$lat = array(
|
344 |
+
'a',
|
345 |
+
'b',
|
346 |
+
'c',
|
347 |
+
'd',
|
348 |
+
'e',
|
349 |
+
'f',
|
350 |
+
'g',
|
351 |
+
'h',
|
352 |
+
'j',
|
353 |
+
'k',
|
354 |
+
'l',
|
355 |
+
'm',
|
356 |
+
'n',
|
357 |
+
'o',
|
358 |
+
'p',
|
359 |
+
'q',
|
360 |
+
'r',
|
361 |
+
's',
|
362 |
+
't',
|
363 |
+
'u',
|
364 |
+
'v',
|
365 |
+
'w',
|
366 |
+
'x',
|
367 |
+
'y',
|
368 |
+
'z'
|
369 |
+
);
|
370 |
+
$main = array();
|
371 |
+
if ($_digital)
|
372 |
+
$main = array_merge($main, $dig);
|
373 |
+
if ($_latin_char)
|
374 |
+
$main = array_merge($main, $lat);
|
375 |
+
shuffle($main);
|
376 |
+
$pass = substr(implode('', $main), 0, $_length);
|
377 |
+
return $pass;
|
378 |
+
}
|
379 |
|
380 |
+
$l = rand($cap_length_min, $cap_length_max);
|
381 |
+
$code = code_generic($l, $cap_digital, $cap_latin_char);
|
382 |
+
@session_start();
|
383 |
+
$_SESSION[$i . '_wd_captcha_code'] = $code;
|
384 |
+
$canvas = imagecreatetruecolor($cap_width, $cap_height);
|
385 |
+
$c = imagecolorallocate($canvas, rand(150, 255), rand(150, 255), rand(150, 255));
|
386 |
+
imagefilledrectangle($canvas, 0, 0, $cap_width, $cap_height, $c);
|
387 |
+
$count = strlen($code);
|
388 |
+
$color_text = imagecolorallocate($canvas, 0, 0, 0);
|
389 |
+
for ($it = 0; $it < $count; $it++) {
|
390 |
+
$letter = $code[$it];
|
391 |
+
imagestring($canvas, 6, (10 * $it + 10), $cap_height / 4, $letter, $color_text);
|
392 |
+
}
|
393 |
+
for ($c = 0; $c < 150; $c++) {
|
394 |
+
$x = rand(0, $cap_width - 1);
|
395 |
+
$y = rand(0, 29);
|
396 |
+
$col = '0x' . rand(0, 9) . '0' . rand(0, 9) . '0' . rand(0, 9) . '0';
|
397 |
+
imagesetpixel($canvas, $x, $y, $col);
|
398 |
+
}
|
399 |
+
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
400 |
+
header('Cache-Control: no-store, no-cache, must-revalidate');
|
401 |
+
header('Cache-Control: post-check=0, pre-check=0', FALSE);
|
402 |
+
header('Pragma: no-cache');
|
403 |
+
header('Content-Type: image/jpeg');
|
404 |
+
imagejpeg($canvas, NULL, $cap_quality);
|
405 |
+
die('');
|
406 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
407 |
}
|
408 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
409 |
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
410 |
////////////////////////////////////////////////////////////////////// function post or page window php
|
411 |
+
function form_maker_window_php() {
|
412 |
+
if (isset($_GET['action']) && esc_html($_GET['action']) == 'formmakerwindow') {
|
413 |
+
global $wpdb;
|
414 |
+
?>
|
415 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
416 |
+
<head>
|
417 |
+
<title>Form Maker</title>
|
418 |
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
419 |
+
<script language="javascript" type="text/javascript"
|
420 |
+
src="<?php echo get_option("siteurl"); ?>/wp-includes/js/jquery/jquery.js"></script>
|
421 |
+
<script language="javascript" type="text/javascript"
|
422 |
+
src="<?php echo get_option("siteurl"); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
|
423 |
+
<link rel="stylesheet"
|
424 |
+
href="<?php echo get_option("siteurl"); ?>/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css?ver=342-20110630100">
|
425 |
+
<script language="javascript" type="text/javascript"
|
426 |
+
src="<?php echo get_option("siteurl"); ?>/wp-includes/js/tinymce/utils/mctabs.js"></script>
|
427 |
+
<script language="javascript" type="text/javascript"
|
428 |
+
src="<?php echo get_option("siteurl"); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
|
429 |
+
<base target="_self">
|
430 |
+
</head>
|
431 |
+
<body id="link" style="" dir="ltr" class="forceColors">
|
432 |
+
<div class="tabs" role="tablist" tabindex="-1">
|
433 |
+
<ul>
|
434 |
+
<li id="form_maker_tab" class="current" role="tab" tabindex="0"><span><a
|
435 |
+
href="javascript:mcTabs.displayTab('Single_product_tab','Single_product_panel');" onMouseDown="return false;"
|
436 |
+
tabindex="-1">Form Maker</a></span></li>
|
437 |
+
</ul>
|
438 |
+
</div>
|
439 |
+
<style>
|
440 |
+
.panel_wrapper {
|
441 |
+
height: 170px !important;
|
442 |
+
}
|
443 |
+
</style>
|
444 |
+
<div class="panel_wrapper">
|
445 |
+
<div id="Single_product_panel" class="panel current">
|
446 |
+
<table>
|
447 |
+
<tr>
|
448 |
+
<td style="height:100px; width:100px; vertical-align:top;">
|
449 |
+
Select a Form
|
450 |
+
</td>
|
451 |
+
<td style="vertical-align:top">
|
452 |
+
<select name="Form_Makername" id="Form_Makername" style="width:250px; text-align:center">
|
453 |
+
<option style="text-align:center" value="- Select Form -" selected="selected">- Select a Form -</option>
|
454 |
+
<?php $ids_Form_Maker = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN(" . get_option('contact_form_forms', 0) . ") order by `id` DESC", 0);
|
455 |
+
foreach ($ids_Form_Maker as $arr_Form_Maker) {
|
456 |
+
?>
|
457 |
+
<option value="<?php echo $arr_Form_Maker->id; ?>"><?php echo $arr_Form_Maker->title; ?></option>
|
458 |
+
<?php }?>
|
459 |
+
</select>
|
460 |
+
</td>
|
461 |
+
</tr>
|
462 |
+
</table>
|
463 |
+
</div>
|
464 |
+
</div>
|
465 |
+
<div class="mceActionPanel">
|
466 |
+
<div style="float: left">
|
467 |
+
<input type="button" id="cancel" name="cancel" value="Cancel" onClick="tinyMCEPopup.close();"/>
|
468 |
+
</div>
|
469 |
+
|
470 |
+
<div style="float: right">
|
471 |
+
<input type="submit" id="insert" name="insert" value="Insert" onClick="insert_Form_Maker();"/>
|
472 |
+
</div>
|
473 |
+
</div>
|
474 |
+
<script type="text/javascript">
|
475 |
+
function insert_Form_Maker() {
|
476 |
+
if (document.getElementById('Form_Makername').value == '- Select Form -') {
|
477 |
+
tinyMCEPopup.close();
|
478 |
+
}
|
479 |
+
else {
|
480 |
+
var tagtext;
|
481 |
+
tagtext = '[Form id="' + document.getElementById('Form_Makername').value + '"]';
|
482 |
+
window.tinyMCE.execInstanceCommand('content', 'mceInsertContent', false, tagtext);
|
483 |
+
tinyMCEPopup.editor.execCommand('mceRepaint');
|
484 |
+
tinyMCEPopup.close();
|
485 |
+
}
|
486 |
|
487 |
+
}
|
488 |
|
489 |
+
</script>
|
490 |
+
</body>
|
491 |
+
</html>
|
492 |
+
<?php
|
493 |
+
die('');
|
494 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
495 |
}
|
496 |
|
497 |
+
// Form preview from product options page.
|
498 |
+
function form_maker_form_preview_product_option() {
|
499 |
+
global $wpdb;
|
500 |
+
if (isset($_GET['id'])) {
|
501 |
+
$getparams = (int) $_GET['id'];
|
502 |
+
}
|
503 |
+
if (isset($_GET['form_id'])) {
|
504 |
+
$form_id = (int) $_GET['form_id'];
|
505 |
+
}
|
506 |
+
$query = "SELECT css FROM " . $wpdb->prefix . "formmaker_themes WHERE id=" . $getparams;
|
507 |
+
$css = $wpdb->get_var($query);
|
508 |
+
$query = "SELECT form_front FROM " . $wpdb->prefix . "formmaker WHERE id=" . $form_id;
|
509 |
+
$form = $wpdb->get_var($query);
|
510 |
+
html_form_maker_form_preview_product_option($css, $form);
|
511 |
}
|
512 |
|
513 |
+
function html_form_maker_form_preview_product_option($css, $form) {
|
514 |
+
$cmpnt_js_path = plugins_url('js', __FILE__);
|
515 |
+
$id = 'form_id_temp';
|
516 |
+
?>
|
517 |
+
<script src="<?php echo $cmpnt_js_path . "/if_gmap_back_end.js"; ?>"></script>
|
518 |
+
<script src="<?php echo $cmpnt_js_path . "/main.js"; ?>"></script>
|
519 |
+
<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
|
520 |
+
<style>
|
521 |
+
<?php
|
522 |
+
$cmpnt_js_path = plugins_url('', __FILE__);
|
523 |
+
echo str_replace('[SITE_ROOT]', $cmpnt_js_path, $css);
|
524 |
+
?>
|
525 |
+
</style>
|
526 |
+
<form id="form_preview"><?php echo $form; ?></form>
|
527 |
+
<?php
|
528 |
+
die();
|
529 |
+
}
|
|
|
|
|
|
|
|
|
|
form_maker_functions.html.php
CHANGED
@@ -1,3908 +1,3862 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
if(!current_user_can('manage_options')) {
|
6 |
-
die('Access Denied');
|
7 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
$current_updates = $_SESSION['current_updates']-1;
|
18 |
-
$perc=(int)(($current_updates/$all_updates)*100);
|
19 |
-
?>
|
20 |
-
<br />
|
21 |
-
<br />
|
22 |
-
<style>
|
23 |
-
.calendar .button
|
24 |
-
{
|
25 |
-
display:table-cell !important;
|
26 |
-
}
|
27 |
-
.big_div
|
28 |
-
{
|
29 |
-
width:100%;
|
30 |
-
background-color:transparent;
|
31 |
-
height:40px;
|
32 |
-
border-radius:20px;
|
33 |
-
border:6px #00AEEF solid;
|
34 |
-
text-align: center !important;
|
35 |
-
}
|
36 |
-
|
37 |
-
.small_div
|
38 |
-
{
|
39 |
-
background-color:#00AEEF;
|
40 |
-
height:40px;
|
41 |
-
border-radius:12px;
|
42 |
-
text-align:right;
|
43 |
-
float: left;
|
44 |
-
}
|
45 |
-
.progress_span
|
46 |
-
{
|
47 |
-
padding-right:10px;
|
48 |
-
line-height:40px;
|
49 |
-
color:#000 !important;
|
50 |
-
font-size:20px;
|
51 |
-
}
|
52 |
-
.forms_span
|
53 |
-
{
|
54 |
-
padding-right:10px;
|
55 |
-
line-height:20px;
|
56 |
-
font-size:12px;
|
57 |
-
font-style:italic;
|
58 |
-
color:#999 !important;
|
59 |
-
}
|
60 |
-
</style>
|
61 |
-
|
62 |
-
<div style="" class="big_div">
|
63 |
-
<div style="width:<?php echo $perc ?>%;" class="small_div">
|
64 |
-
<span class="progress_span"><?php echo $perc ?>%</span>
|
65 |
-
</div>
|
66 |
-
<span class="forms_span"> Updated forms <?php echo $current_updates ?></br> Forms remaining <b style="color:red"><?php echo $all_updates-$current_updates?></b> </span>
|
67 |
-
</div>
|
68 |
-
<br />
|
69 |
<script type="text/javascript">
|
70 |
-
count_of_filds_form=10000;
|
71 |
-
function submitbutton
|
72 |
-
|
73 |
-
|
74 |
-
|
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 |
-
document.getElementById('label_order').value=tox;
|
124 |
-
|
125 |
-
|
126 |
-
refresh_()
|
127 |
-
document.getElementById('pagination').value=document.getElementById('pages').getAttribute("type");
|
128 |
-
document.getElementById('show_title').value=document.getElementById('pages').getAttribute("show_title");
|
129 |
-
document.getElementById('show_numbers').value=document.getElementById('pages').getAttribute("show_numbers");
|
130 |
-
submitform( pressbutton );
|
131 |
}
|
132 |
-
function submitform(
|
133 |
-
|
134 |
-
document.getElementById('adminForm').
|
135 |
-
document.getElementById('adminForm').submit();
|
136 |
-
|
137 |
}
|
138 |
-
function remove_whitespace(node)
|
139 |
-
{
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
remove_whitespace(node.childNodes[ttt]);
|
151 |
-
}
|
152 |
-
}
|
153 |
-
return
|
154 |
}
|
155 |
|
156 |
-
function refresh_()
|
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 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
}
|
313 |
-
|
314 |
-
|
315 |
-
case "type_checkbox":
|
316 |
-
case "type_radio":
|
317 |
-
{
|
318 |
-
is=true;
|
319 |
-
for(j=0; j<100; j++)
|
320 |
-
if(document.getElementById(i+"_elementform_id_temp"+j))
|
321 |
-
{
|
322 |
-
remove_add_(i+"_elementform_id_temp"+j);
|
323 |
-
}
|
324 |
-
|
325 |
-
/*if(document.getElementById(i+"_randomize").value=="yes")
|
326 |
choises_randomize(i);*/
|
327 |
-
|
328 |
-
break;
|
329 |
-
}
|
330 |
-
|
331 |
-
case "type_button":
|
332 |
-
{
|
333 |
-
for(j=0; j<100; j++)
|
334 |
-
if(document.getElementById(i+"_elementform_id_temp"+j))
|
335 |
-
{
|
336 |
-
remove_add_(i+"_elementform_id_temp"+j);
|
337 |
-
}
|
338 |
-
break;
|
339 |
-
}
|
340 |
-
|
341 |
-
case "type_time":
|
342 |
-
{
|
343 |
-
if(document.getElementById(i+"_ssform_id_temp"))
|
344 |
-
{
|
345 |
-
remove_add_(i+"_ssform_id_temp");
|
346 |
-
remove_add_(i+"_mmform_id_temp");
|
347 |
-
remove_add_(i+"_hhform_id_temp");
|
348 |
-
}
|
349 |
-
else
|
350 |
-
{
|
351 |
-
remove_add_(i+"_mmform_id_temp");
|
352 |
-
remove_add_(i+"_hhform_id_temp");
|
353 |
-
|
354 |
-
}
|
355 |
-
break;
|
356 |
-
|
357 |
-
}
|
358 |
-
|
359 |
-
case "type_date":
|
360 |
-
{
|
361 |
-
remove_add_(i+"_elementform_id_temp");
|
362 |
-
remove_add_(i+"_buttonform_id_temp");
|
363 |
-
|
364 |
-
break;
|
365 |
-
}
|
366 |
-
case "type_date_fields":
|
367 |
-
{
|
368 |
-
remove_add_(i+"_dayform_id_temp");
|
369 |
-
remove_add_(i+"_monthform_id_temp");
|
370 |
-
remove_add_(i+"_yearform_id_temp");
|
371 |
-
break;
|
372 |
-
}
|
373 |
-
}
|
374 |
-
}
|
375 |
-
}
|
376 |
-
|
377 |
-
for(i=1; i<=form_view_max; i++)
|
378 |
-
{
|
379 |
-
if(document.getElementById('form_id_tempform_view'+i))
|
380 |
-
{
|
381 |
-
if(document.getElementById('page_next_'+i))
|
382 |
-
document.getElementById('page_next_'+i).removeAttribute('src');
|
383 |
-
if(document.getElementById('page_previous_'+i))
|
384 |
-
document.getElementById('page_previous_'+i).removeAttribute('src');
|
385 |
-
document.getElementById('form_id_tempform_view'+i).parentNode.removeChild(document.getElementById('form_id_tempform_view_img'+i));
|
386 |
-
document.getElementById('form_id_tempform_view'+i).removeAttribute('style');
|
387 |
-
}
|
388 |
-
}
|
389 |
-
|
390 |
-
for(t=1;t<=form_view_max;t++)
|
391 |
-
{
|
392 |
-
if(document.getElementById('form_id_tempform_view'+t))
|
393 |
-
{
|
394 |
-
form_view_element=document.getElementById('form_id_tempform_view'+t);
|
395 |
-
n=form_view_element.childNodes.length-2;
|
396 |
-
|
397 |
-
for(q=0;q<=n;q++)
|
398 |
-
{
|
399 |
-
if(form_view_element.childNodes[q])
|
400 |
-
if(form_view_element.childNodes[q].nodeType!=3)
|
401 |
-
if(!form_view_element.childNodes[q].id)
|
402 |
-
{
|
403 |
-
del=true;
|
404 |
-
GLOBAL_tr=form_view_element.childNodes[q];
|
405 |
-
|
406 |
-
for (x=0; x < GLOBAL_tr.firstChild.childNodes.length; x++)
|
407 |
-
{
|
408 |
-
|
409 |
-
table=GLOBAL_tr.firstChild.childNodes[x];
|
410 |
-
tbody=table.firstChild;
|
411 |
-
|
412 |
-
if(tbody.childNodes.length)
|
413 |
-
del=false;
|
414 |
-
}
|
415 |
-
|
416 |
-
if(del)
|
417 |
-
{
|
418 |
-
form_view_element.removeChild(form_view_element.childNodes[q]);
|
419 |
-
}
|
420 |
-
|
421 |
-
}
|
422 |
-
}
|
423 |
-
}
|
424 |
-
}
|
425 |
-
|
426 |
|
427 |
-
|
|
|
428 |
|
429 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
430 |
|
|
|
|
|
|
|
|
|
431 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
432 |
|
|
|
|
|
|
|
433 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
434 |
|
435 |
-
gen=<?php echo $row->counter; ?>;//add main form id
|
436 |
-
function enable()
|
437 |
-
{
|
438 |
-
for(iiiii=0; iiiii<1000;iiiii++)
|
439 |
-
{
|
440 |
-
if(document.getElementsByTagName("iframe")[iiiii]){
|
441 |
-
if(document.getElementsByTagName("iframe")[iiiii].id=='form_maker_editor_ifr'){
|
442 |
-
id_ifr_editor=iiiii;
|
443 |
-
break;
|
444 |
-
}
|
445 |
-
}
|
446 |
-
}
|
447 |
-
alltypes=Array('customHTML','text','checkbox','radio','time_and_date','select','file_upload','captcha','map','button','page_break','section_break');
|
448 |
-
for(x=0; x<12;x++)
|
449 |
-
{
|
450 |
-
document.getElementById('img_'+alltypes[x]).src="<?php echo $form_file_url; ?>/images/"+alltypes[x]+".png";
|
451 |
-
}
|
452 |
-
|
453 |
-
|
454 |
-
document.getElementById('formMakerDiv').style.display =(document.getElementById('formMakerDiv').style.display=='block'?'none':'block');
|
455 |
-
document.getElementById('formMakerDiv1').style.display =(document.getElementById('formMakerDiv1').style.display=='block'?'none':'block');
|
456 |
-
if(document.getElementById('formMakerDiv').offsetWidth)
|
457 |
-
document.getElementById('formMakerDiv1').style.width =(document.getElementById('formMakerDiv').offsetWidth - 60)+'px';
|
458 |
-
document.getElementById('when_edit').style.display ='none';
|
459 |
-
}
|
460 |
-
|
461 |
-
function enable2()
|
462 |
-
{
|
463 |
-
for(iiiii=0; iiiii<1000;iiiii++)
|
464 |
-
{
|
465 |
-
if(document.getElementsByTagName("iframe")[iiiii]){
|
466 |
-
if(document.getElementsByTagName("iframe")[iiiii].id=='form_maker_editor_ifr'){
|
467 |
-
id_ifr_editor=iiiii;
|
468 |
-
break;
|
469 |
-
}
|
470 |
-
}
|
471 |
-
}
|
472 |
-
alltypes=Array('customHTML','text','checkbox','radio','time_and_date','select','file_upload','captcha','map','button','page_break','section_break');
|
473 |
-
for(x=0; x<12;x++)
|
474 |
-
{
|
475 |
-
document.getElementById('img_'+alltypes[x]).src="<?php echo $form_file_url; ?>/images/"+alltypes[x]+".png";
|
476 |
-
}
|
477 |
-
|
478 |
-
|
479 |
-
document.getElementById('formMakerDiv').style.display =(document.getElementById('formMakerDiv').style.display=='block'?'none':'block');
|
480 |
-
document.getElementById('formMakerDiv1').style.display =(document.getElementById('formMakerDiv1').style.display=='block'?'none':'block');
|
481 |
-
if(document.getElementById('formMakerDiv').offsetWidth)
|
482 |
-
document.getElementById('formMakerDiv1').style.width =(document.getElementById('formMakerDiv').offsetWidth - 60)+'px';
|
483 |
-
document.getElementById('when_edit').style.display ='block';
|
484 |
-
if(document.getElementById('field_types').offsetWidth)
|
485 |
-
document.getElementById('when_edit').style.width =document.getElementById('field_types').offsetWidth+'px';
|
486 |
-
|
487 |
-
if(document.getElementById('field_types').offsetHeight)
|
488 |
-
document.getElementById('when_edit').style.height =document.getElementById('field_types').offsetHeight+'px';
|
489 |
-
|
490 |
-
//document.getElementById('when_edit').style.position='none';
|
491 |
-
|
492 |
-
}
|
493 |
-
|
494 |
-
function set_preview()
|
495 |
-
{
|
496 |
-
appWidth =parseInt(document.body.offsetWidth);
|
497 |
-
appHeight =parseInt(document.body.offsetHeight);
|
498 |
-
//document.getElementById('toolbar-popup-preview').childNodes[1].href='index.php?option=com_formmaker&task=preview&tmpl=component&theme='+document.getElementById('theme').value;
|
499 |
-
//document.getElementById('toolbar-popup-preview').childNodes[1].setAttribute('rel',"{handler: 'iframe', size: {x:"+(appWidth-100)+", y: "+531+"}}");
|
500 |
}
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
{
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
513 |
}
|
514 |
|
515 |
-
|
516 |
-
{
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
527 |
}
|
528 |
-
|
529 |
-
{
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
left:0;
|
535 |
-
display:none;
|
536 |
-
margin-left:30px;
|
537 |
-
margin-top:15px;
|
538 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
539 |
|
540 |
|
541 |
</style>
|
542 |
|
543 |
-
<form action="admin.php?page=Form_maker&id=<?php echo $row->id; ?>" method="post" name="adminForm" id="adminForm"
|
544 |
-
|
545 |
-
<
|
|
|
546 |
|
547 |
|
548 |
<td align="left" valign="middle" rowspan="3" style="padding:10px;">
|
549 |
-
|
550 |
-
|
551 |
|
552 |
<td width="70" align="right" valign="middle">
|
553 |
|
554 |
-
|
555 |
|
556 |
</td>
|
557 |
|
558 |
<td width="153" align="center" valign="middle">
|
559 |
|
560 |
-
|
561 |
|
562 |
-
|
|
|
563 |
|
564 |
-
|
565 |
|
566 |
</td>
|
567 |
-
|
568 |
-
</tr
|
|
|
569 |
|
570 |
<td width="300" align="right" valign="middle">
|
571 |
|
572 |
-
|
573 |
|
574 |
</td>
|
575 |
|
576 |
<td width="153" align="center" valign="middle">
|
577 |
|
578 |
-
|
579 |
|
580 |
-
|
|
|
581 |
|
582 |
-
|
583 |
|
584 |
</td>
|
585 |
|
586 |
-
|
587 |
|
588 |
-
<tr>
|
589 |
|
590 |
<td width="300" align="right" valign="middle">
|
591 |
|
592 |
-
|
593 |
|
594 |
</td>
|
595 |
|
596 |
<td width="153" align="center" valign="middle">
|
597 |
|
598 |
-
|
599 |
-
|
600 |
-
<select id="theme" name="theme" style="background:transparent; width:151px; height:19px; border:none; font-size:11px" onChange="set_preview()" >
|
601 |
-
|
602 |
-
<?php
|
603 |
-
$form_theme='';
|
604 |
-
foreach($themes as $theme)
|
605 |
-
{
|
606 |
-
if($theme->id==$row->theme)
|
607 |
-
{
|
608 |
-
echo '<option value="'.$theme->id.'" selected>'.$theme->title.'</option>';
|
609 |
-
$form_theme=$theme->css;
|
610 |
-
}
|
611 |
-
else
|
612 |
-
echo '<option value="'.$theme->id.'">'.$theme->title.'</option>';
|
613 |
-
}
|
614 |
-
?>
|
615 |
-
</select>
|
616 |
|
617 |
-
|
|
|
|
|
618 |
|
619 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
620 |
|
621 |
-
|
622 |
|
623 |
-
|
624 |
-
<td align="left" colspan="3">
|
625 |
-
|
626 |
-
<img src="<?php echo $form_file_url; ?>/images/addanewfield.png" onclick="enable(); Enable()" style="cursor:pointer;margin:10px;" />
|
627 |
|
628 |
-
</td>
|
629 |
</tr>
|
630 |
-
</table>
|
631 |
|
632 |
-
<div id="formMakerDiv" onclick="close_window()"></div>
|
633 |
-
<div id="formMakerDiv1" align="center">
|
634 |
-
|
635 |
-
|
636 |
-
<table border="0" width="100%" cellpadding="0" cellspacing="0" height="100%" style="border:6px #00aeef solid; background-color:#FFF">
|
637 |
<tr>
|
638 |
-
<td
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
<table border="0" cellpadding="0" cellspacing="3" width="100%">
|
644 |
-
<tr>
|
645 |
-
<td align="center" onClick="addRow('customHTML')" class="field_buttons" id="table_editor"><img src="<?php echo $form_file_url; ?>/images/customHTML.png" style="margin:5px" id="img_customHTML"/></td>
|
646 |
-
|
647 |
-
<td align="center" onClick="addRow('text')" class="field_buttons" id="table_text"><img src="<?php echo $form_file_url; ?>/images/text.png" style="margin:5px" id="img_text"/></td>
|
648 |
-
</tr>
|
649 |
-
<tr>
|
650 |
-
<td align="center" onClick="addRow('time_and_date')" class="field_buttons" id="table_time_and_date"><img src="<?php echo $form_file_url; ?>/images/time_and_date.png" style="margin:5px" id="img_time_and_date"/></td>
|
651 |
-
|
652 |
-
<td align="center" onClick="addRow('select')" class="field_buttons" id="table_select"><img src="<?php echo $form_file_url; ?>/images/select.png" style="margin:5px" id="img_select"/></td>
|
653 |
-
</tr>
|
654 |
-
<tr>
|
655 |
-
<td align="center" onClick="addRow('checkbox')" class="field_buttons" id="table_checkbox"><img src="<?php echo $form_file_url; ?>/images/checkbox.png" style="margin:5px" id="img_checkbox"/></td>
|
656 |
-
|
657 |
-
<td align="center" onClick="addRow('radio')" class="field_buttons" id="table_radio"><img src="<?php echo $form_file_url; ?>/images/radio.png" style="margin:5px" id="img_radio"/></td>
|
658 |
-
</tr>
|
659 |
-
<tr>
|
660 |
-
<td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="background-color: rgb(114, 113, 113) !important;" class="field_buttons" id="table_file_upload"><img src="<?php echo $form_file_url; ?>/images/file_upload.png" style="margin:5px" id="img_file_upload"/></td>
|
661 |
-
|
662 |
-
<td align="center" onClick="addRow('captcha')" class="field_buttons" id="table_captcha"><img src="<?php echo $form_file_url; ?>/images/captcha.png" style="margin:5px" id="img_captcha"/></td>
|
663 |
-
</tr>
|
664 |
-
<tr>
|
665 |
-
<td align="center" onClick="addRow('page_break')" class="field_buttons" id="table_page_break"><img src="<?php echo $form_file_url; ?>/images/page_break.png" style="margin:5px" id="img_page_break"/></td>
|
666 |
-
|
667 |
-
<td align="center" onClick="addRow('section_break')" class="field_buttons" id="table_section_break"><img src="<?php echo $form_file_url; ?>/images/section_break.png" style="margin:5px" id="img_section_break"/></td>
|
668 |
-
</tr>
|
669 |
-
<tr>
|
670 |
-
<td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="background-color: rgb(114, 113, 113) !important;" class="field_buttons" id="table_map"><img src="<?php echo $form_file_url; ?>/images/map.png" style="margin:5px" id="img_map"/></td>
|
671 |
-
|
672 |
-
<td align="center" onClick="addRow('button')" class="field_buttons" id="table_button"><img src="<?php echo $form_file_url; ?>/images/button.png" style="margin:5px" id="img_button"/></td>
|
673 |
-
</tr>
|
674 |
-
</table>
|
675 |
-
|
676 |
-
</td>
|
677 |
-
<td width="35%" height="100%" align="left"><div id="edit_table" style="padding:0px; overflow-y:scroll; height:531px" ></div></td>
|
678 |
-
|
679 |
-
<td align="center" valign="top" style="background:url(<?php echo $form_file_url; ?>/images/border2.png) repeat-y;"> </td>
|
680 |
-
<td style="padding:15px">
|
681 |
-
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
|
682 |
-
|
683 |
-
<tr>
|
684 |
-
<td align="right"><input type="radio" value="end" name="el_pos" checked="checked" id="pos_end" onclick="Disable()"/>
|
685 |
-
At The End
|
686 |
-
<input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
|
687 |
-
At The Beginning
|
688 |
-
<input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
|
689 |
-
Before
|
690 |
-
<select style="width:100px; margin-left:5px" id="sel_el_pos" disabled="disabled">
|
691 |
-
</select>
|
692 |
-
<img alt="ADD" title="add" style="cursor:pointer; vertical-align:middle; margin:5px" src="<?php echo $form_file_url; ?>/images/save.png" onClick="add(0)"/>
|
693 |
-
<img alt="CANCEL" title="cancel" style=" cursor:pointer; vertical-align:middle; margin:5px" src="<?php echo $form_file_url; ?>/images/cancel_but.png" onClick="close_window()"/>
|
694 |
-
|
695 |
-
<hr style=" margin-bottom:10px" />
|
696 |
-
</td>
|
697 |
-
</tr>
|
698 |
-
|
699 |
-
<tr height="100%" valign="top">
|
700 |
-
<td id="show_table"></td>
|
701 |
-
</tr>
|
702 |
-
|
703 |
-
</table>
|
704 |
-
</td>
|
705 |
-
</tr>
|
706 |
-
</table>
|
707 |
</td>
|
708 |
</tr>
|
709 |
</table>
|
710 |
-
</div>
|
711 |
-
<input type="hidden" id="old" />
|
712 |
-
<input type="hidden" id="old_selected" />
|
713 |
-
<input type="hidden" id="element_type" />
|
714 |
-
<input type="hidden" id="editing_id" />
|
715 |
-
<div id="main_editor" style="position:absolute; display:none; z-index:140;"><?php if(function_exists ('the_editor') || function_exists ('wp_editor')){ if(get_bloginfo('version')<'3.3'){ ?>
|
716 |
-
<div style=" max-width:500px; height:300px;text-align:left" id="poststuff">
|
717 |
-
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea"><?php the_editor("","form_maker_editor","title",$media_buttons = true, $tab_index = 1, $extended = true ); ?>
|
718 |
-
</div>
|
719 |
-
</div>
|
720 |
-
<?php
|
721 |
-
}
|
722 |
-
else{
|
723 |
-
echo "<style>#wp-form_maker_editor-media-buttons{ text-align:left }</style>"; wp_editor("","form_maker_editor");
|
724 |
-
}
|
725 |
|
726 |
-
|
727 |
-
|
728 |
-
{
|
729 |
-
?>
|
730 |
-
<textarea name="form_maker_editor" id="form_maker_editor" cols="40" rows="6" style="width: 450px; height: 350px; " class="mce_editable" aria-hidden="true"></textarea>
|
731 |
-
<?php
|
732 |
|
733 |
-
}
|
734 |
-
?></div>
|
735 |
-
|
736 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
737 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
738 |
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
743 |
|
744 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
745 |
|
746 |
-
|
747 |
|
748 |
<h2 style="color:#00aeef">Form</h2>
|
749 |
|
750 |
-
|
751 |
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
|
756 |
-
?>
|
757 |
-
<table width="100%" style="margin:8px"
|
758 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
759 |
|
760 |
-
|
761 |
<?php
|
762 |
-
|
763 |
-
|
764 |
-
?> </div>
|
765 |
|
766 |
-
</
|
767 |
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
<input type="hidden" name="private_key" id="private_key" />
|
777 |
-
<input type="hidden" name="recaptcha_theme" id="recaptcha_theme" />
|
778 |
|
779 |
-
|
780 |
-
|
|
|
|
|
|
|
|
|
781 |
|
782 |
<script type="text/javascript">
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
|
787 |
-
function formOnload()
|
788 |
-
{
|
789 |
//enable maps
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
}
|
811 |
-
}
|
812 |
-
submitbutton('save_update');
|
813 |
|
814 |
}
|
815 |
|
816 |
-
function formAddToOnload()
|
817 |
-
{
|
818 |
-
|
819 |
-
|
|
|
820 |
}
|
821 |
|
822 |
-
function formLoadBody()
|
823 |
-
{
|
824 |
|
825 |
-
|
826 |
-
|
827 |
}
|
828 |
|
829 |
var formOldFunctionOnLoad = null;
|
830 |
formLoadBody();
|
831 |
|
832 |
-
function add_new_field(id)
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
atrs=return_attributes(id+'_element');
|
931 |
-
w_attr_name=atrs[0];
|
932 |
-
w_attr_value=atrs[1];
|
933 |
-
type_submitter_mail(gen, w_field_label, w_field_label_pos, w_size, w_first_val, w_title, w_send, w_required, 'no', w_class, w_attr_name, w_attr_value); add(0); break;
|
934 |
-
}
|
935 |
-
case 'type_checkbox':
|
936 |
-
{
|
937 |
-
|
938 |
-
if(document.getElementById(id+'_hor'))
|
939 |
-
w_flow="hor"
|
940 |
-
else
|
941 |
-
w_flow="ver";
|
942 |
-
|
943 |
-
v=0;
|
944 |
-
for(k=0;k<100;k++)
|
945 |
-
if(document.getElementById(id+"_element"+k))
|
946 |
-
{
|
947 |
-
if(document.getElementById(id+"_element"+k).getAttribute('other'))
|
948 |
-
if(document.getElementById(id+"_element"+k).getAttribute('other')=='1')
|
949 |
-
w_allow_other_num=t;
|
950 |
-
w_choices[t]=document.getElementById(id+"_element"+k).value;
|
951 |
-
w_choices_checked[t]=document.getElementById(id+"_element"+k).checked;
|
952 |
-
t++;
|
953 |
-
v=k;
|
954 |
-
}
|
955 |
-
atrs=return_attributes(id+'_element'+v);
|
956 |
-
w_attr_name=atrs[0];
|
957 |
-
w_attr_value=atrs[1];
|
958 |
-
type_checkbox(gen, w_field_label, w_field_label_pos, w_flow, w_choices, w_choices_checked, w_required, 'no','no', '0', w_class, w_attr_name, w_attr_value); add(0); break;
|
959 |
-
}
|
960 |
-
case 'type_radio':
|
961 |
-
{
|
962 |
-
if(document.getElementById(id+'_hor'))
|
963 |
-
w_flow="hor"
|
964 |
-
else
|
965 |
-
w_flow="ver";
|
966 |
-
|
967 |
-
|
968 |
-
v=0;
|
969 |
-
for(k=0;k<100;k++)
|
970 |
-
if(document.getElementById(id+"_element"+k))
|
971 |
-
{
|
972 |
-
w_choices[t]=document.getElementById(id+"_element"+k).value;
|
973 |
-
w_choices_checked[t]=document.getElementById(id+"_element"+k).checked;
|
974 |
-
t++;
|
975 |
-
v=k;
|
976 |
-
}
|
977 |
-
atrs=return_attributes(id+'_element'+v);
|
978 |
-
w_attr_name=atrs[0];
|
979 |
-
w_attr_value=atrs[1];
|
980 |
-
type_radio(gen, w_field_label, w_field_label_pos, w_flow, w_choices, w_choices_checked, w_required, 'no', 'no', 0, w_class, w_attr_name, w_attr_value); add(0); break;
|
981 |
-
}
|
982 |
-
case 'type_time':
|
983 |
-
{
|
984 |
-
atrs=return_attributes(id+'_hh');
|
985 |
-
w_attr_name=atrs[0];
|
986 |
-
w_attr_value=atrs[1];
|
987 |
-
w_hh=document.getElementById(id+'_hh').value;
|
988 |
-
w_mm=document.getElementById(id+'_mm').value;
|
989 |
-
if(document.getElementById(id+'_ss'))
|
990 |
-
{
|
991 |
-
w_ss=document.getElementById(id+'_ss').value;
|
992 |
-
w_sec="1";
|
993 |
-
}
|
994 |
-
else
|
995 |
-
{
|
996 |
-
w_ss="";
|
997 |
-
w_sec="0";
|
998 |
-
}
|
999 |
-
if(document.getElementById(id+'_am_pm_select'))
|
1000 |
-
{
|
1001 |
-
w_am_pm=document.getElementById(id+'_am_pm').value;
|
1002 |
-
w_time_type="12";
|
1003 |
-
}
|
1004 |
-
else
|
1005 |
-
{
|
1006 |
-
w_am_pm=0;
|
1007 |
-
w_time_type="24";
|
1008 |
-
}
|
1009 |
-
type_time(gen, w_field_label, w_field_label_pos, w_time_type, w_am_pm, w_sec, w_hh, w_mm, w_ss, w_required, w_class, w_attr_name, w_attr_value); add(0); break;
|
1010 |
-
}
|
1011 |
-
case 'type_date':
|
1012 |
-
{
|
1013 |
-
atrs=return_attributes(id+'_element');
|
1014 |
-
w_attr_name=atrs[0];
|
1015 |
-
w_attr_value=atrs[1];
|
1016 |
-
w_date=document.getElementById(id+'_element').value;
|
1017 |
-
w_format=document.getElementById(id+'_button').getAttribute("format");
|
1018 |
-
w_but_val=document.getElementById(id+'_button').value;
|
1019 |
-
type_date(gen, w_field_label, w_field_label_pos, w_date, w_required, w_class, w_format, w_but_val, w_attr_name, w_attr_value); add(0); break;
|
1020 |
-
}
|
1021 |
-
case 'type_date_fields':
|
1022 |
-
{
|
1023 |
-
atrs =return_attributes(id+'_day');
|
1024 |
-
w_attr_name =atrs[0];
|
1025 |
-
w_attr_value =atrs[1];
|
1026 |
-
w_day =document.getElementById(id+'_day').value;
|
1027 |
-
w_month =document.getElementById(id+'_month').value;
|
1028 |
-
w_year =document.getElementById(id+'_year').value;
|
1029 |
-
w_day_type =document.getElementById(id+'_day').tagName;
|
1030 |
-
w_month_type =document.getElementById(id+'_month').tagName;
|
1031 |
-
w_year_type =document.getElementById(id+'_year').tagName;
|
1032 |
-
w_day_label =document.getElementById(id+'_day_label').innerHTML;
|
1033 |
-
w_month_label =document.getElementById(id+'_month_label').innerHTML;
|
1034 |
-
w_year_label =document.getElementById(id+'_year_label').innerHTML;
|
1035 |
-
|
1036 |
-
s =document.getElementById(id+'_day').style.width;
|
1037 |
-
w_day_size =s.substring(0,s.length-2);
|
1038 |
-
|
1039 |
-
s =document.getElementById(id+'_month').style.width;
|
1040 |
-
w_month_size =s.substring(0,s.length-2);
|
1041 |
-
|
1042 |
-
s =document.getElementById(id+'_year').style.width;
|
1043 |
-
w_year_size =s.substring(0,s.length-2);
|
1044 |
-
|
1045 |
-
if(w_year_type=='SELECT')
|
1046 |
-
{
|
1047 |
-
w_from =document.getElementById(id+'_year').getAttribute('from');
|
1048 |
-
w_to =document.getElementById(id+'_year').getAttribute('to');
|
1049 |
-
}
|
1050 |
-
else
|
1051 |
-
{
|
1052 |
-
w_from ='1901';
|
1053 |
-
w_to ='2012';
|
1054 |
-
}
|
1055 |
-
w_divider =document.getElementById(id+'_separator1').innerHTML;
|
1056 |
-
type_date_fields(gen, w_field_label, 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, w_attr_name, w_attr_value); add(0); break;
|
1057 |
-
}
|
1058 |
-
case 'type_own_select':
|
1059 |
-
{
|
1060 |
-
for(k=0;k<100;k++)
|
1061 |
-
if(document.getElementById(id+"_option"+k))
|
1062 |
-
{
|
1063 |
-
w_choices[t]=document.getElementById(id+"_option"+k).innerHTML;
|
1064 |
-
w_choices_checked[t]=document.getElementById(id+"_option"+k).selected;
|
1065 |
-
if(document.getElementById(id+"_option"+k).value=="")
|
1066 |
-
w_choices_disabled[t]=true;
|
1067 |
-
else
|
1068 |
-
w_choices_disabled[t]=false;
|
1069 |
-
t++;
|
1070 |
-
}
|
1071 |
-
|
1072 |
-
atrs=return_attributes(id+'_element');
|
1073 |
-
w_attr_name=atrs[0];
|
1074 |
-
w_attr_value=atrs[1];
|
1075 |
-
type_own_select(gen, w_field_label, w_field_label_pos, w_size, w_choices, w_choices_checked, w_required, w_class, w_attr_name, w_attr_value, w_choices_disabled); add(0); break;
|
1076 |
-
}
|
1077 |
-
case 'type_country':
|
1078 |
-
{
|
1079 |
-
w_countries=[];
|
1080 |
-
|
1081 |
-
select_=document.getElementById(id+'_element');
|
1082 |
-
n=select_.childNodes.length;
|
1083 |
-
for(i=0; i<n; i++)
|
1084 |
-
{
|
1085 |
-
w_countries.push(select_.childNodes[i].value);
|
1086 |
-
}
|
1087 |
-
|
1088 |
-
atrs=return_attributes(id+'_element');
|
1089 |
-
w_attr_name=atrs[0];
|
1090 |
-
w_attr_value=atrs[1];
|
1091 |
-
type_country(gen, w_field_label, w_countries, w_field_label_pos, w_size, w_required, w_class, w_attr_name, w_attr_value); add(0); break;
|
1092 |
-
}
|
1093 |
-
case 'type_file_upload':
|
1094 |
-
{
|
1095 |
-
w_destination=document.getElementById(id+"_destination").value.replace("***destinationverj"+id+"***", "").replace("***destinationskizb"+id+"***", "");
|
1096 |
-
w_extension =document.getElementById(id+"_extension").value.replace("***extensionverj"+id+"***", "").replace("***extensionskizb"+id+"***", "");
|
1097 |
-
w_max_size =document.getElementById(id+"_max_size").value.replace("***max_sizeverj"+id+"***", "").replace("***max_sizeskizb"+id+"***", "");
|
1098 |
-
|
1099 |
-
atrs=return_attributes(id+'_element');
|
1100 |
-
w_attr_name=atrs[0];
|
1101 |
-
w_attr_value=atrs[1];
|
1102 |
-
type_file_upload(gen, w_field_label, w_field_label_pos, w_destination,w_extension, w_max_size, w_required, w_class, w_attr_name, w_attr_value); add(0); break;
|
1103 |
-
}
|
1104 |
-
case 'type_map':
|
1105 |
-
{
|
1106 |
-
|
1107 |
-
w_lat=[];
|
1108 |
-
w_long=[];
|
1109 |
-
w_info=[];
|
1110 |
-
|
1111 |
-
w_zoom = document.getElementById(id+"_element").getAttribute("zoom");
|
1112 |
-
w_width = parseInt(document.getElementById(id+"_element").style.width);
|
1113 |
-
w_height= parseInt(document.getElementById(id+"_element").style.height);
|
1114 |
-
|
1115 |
-
|
1116 |
-
w_lat.push(document.getElementById(id+"_element").getAttribute("lat"));
|
1117 |
-
w_long.push(document.getElementById(id+"_element").getAttribute("long"));
|
1118 |
-
w_info.push(document.getElementById(id+"_element").getAttribute("info"));
|
1119 |
-
|
1120 |
-
atrs=return_attributes(id+'_element');
|
1121 |
-
w_attr_name=atrs[0];
|
1122 |
-
w_attr_value=atrs[1];
|
1123 |
-
type_map(gen, w_long, w_lat, w_long, w_lat, w_zoom, w_width, w_height, w_class, w_info, w_attr_name, w_attr_value); add(0);break;
|
1124 |
-
}
|
1125 |
-
case 'type_submit_reset':
|
1126 |
-
{
|
1127 |
-
atrs=return_attributes(id+'_element_submit');
|
1128 |
-
w_act=!(document.getElementById(id+"_element_reset").style.display=="none");
|
1129 |
-
w_attr_name=atrs[0];
|
1130 |
-
w_attr_value=atrs[1];
|
1131 |
-
w_submit_title = document.getElementById(id+"_element_submit").value;
|
1132 |
-
w_reset_title = document.getElementById(id+"_element_reset").value;
|
1133 |
-
type_submit_reset(gen, w_submit_title , w_reset_title , w_class, w_act, w_attr_name, w_attr_value); add(0); break;
|
1134 |
-
}
|
1135 |
-
|
1136 |
-
case 'type_button':
|
1137 |
-
{
|
1138 |
-
w_title =new Array();
|
1139 |
-
|
1140 |
-
w_func =new Array();
|
1141 |
-
t=0;
|
1142 |
-
v=0;
|
1143 |
-
for(k=0;k<100;k++)
|
1144 |
-
if(document.getElementById(id+"_element"+k))
|
1145 |
-
{
|
1146 |
-
w_title[t]=document.getElementById(id+"_element"+k).value;
|
1147 |
-
w_func[t]=document.getElementById(id+"_element"+k).getAttribute("onclick");
|
1148 |
-
t++;
|
1149 |
-
v=k;
|
1150 |
-
}
|
1151 |
-
atrs=return_attributes(id+'_element'+v);
|
1152 |
-
w_attr_name=atrs[0];
|
1153 |
-
w_attr_value=atrs[1];
|
1154 |
-
type_button (gen, w_title , w_func , w_class,w_attr_name, w_attr_value); add(0); break;
|
1155 |
-
}
|
1156 |
-
case 'type_hidden':
|
1157 |
-
{
|
1158 |
-
w_value = document.getElementById(id+"_element").value;
|
1159 |
-
w_name = document.getElementById(id+"_element").name;
|
1160 |
-
|
1161 |
-
atrs=return_attributes(id+'_element');
|
1162 |
-
w_attr_name=atrs[0];
|
1163 |
-
w_attr_value=atrs[1];
|
1164 |
-
type_hidden (gen, w_name, w_value , w_attr_name, w_attr_value); add(0); break;
|
1165 |
-
}
|
1166 |
-
|
1167 |
-
case 'type_captcha':
|
1168 |
-
{
|
1169 |
-
w_digit=document.getElementById("wd_captcha").getAttribute("digit");
|
1170 |
-
atrs=return_attributes('wd_captcha');
|
1171 |
-
w_attr_name=atrs[0];
|
1172 |
-
w_attr_value=atrs[1];
|
1173 |
-
type_captcha(gen, w_field_label, w_field_label_pos, w_digit, w_class, w_attr_name, w_attr_value); add(0);break;
|
1174 |
-
}
|
1175 |
-
|
1176 |
-
|
1177 |
-
}
|
1178 |
-
|
1179 |
-
|
1180 |
-
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
1181 |
-
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
1182 |
-
}
|
1183 |
-
|
1184 |
-
plugin_url=document.getElementById('form_plugins_url').value;
|
1185 |
-
|
1186 |
-
</script>
|
1187 |
-
|
1188 |
-
<input type="hidden" name="option" value="com_formmaker" />
|
1189 |
|
1190 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1191 |
|
1192 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1193 |
|
1194 |
-
|
1195 |
-
|
|
|
1196 |
|
1197 |
-
|
|
|
|
|
1198 |
|
1199 |
-
<?php
|
1200 |
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
}
|
1206 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1207 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1208 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1209 |
|
1210 |
-
function html_forchrome_update(){
|
1211 |
-
?>
|
1212 |
-
<script type="text/javascript">
|
1213 |
|
|
|
1214 |
|
1215 |
-
window.onload=val;
|
1216 |
|
1217 |
-
|
1218 |
-
|
1219 |
-
var form = document.adminForm;
|
1220 |
-
submitform();
|
1221 |
}
|
1222 |
-
function submitform( pressbutton ){
|
1223 |
|
1224 |
-
|
1225 |
-
document.getElementById('adminForm').submit();
|
1226 |
|
1227 |
-
}
|
1228 |
</script>
|
1229 |
-
<form action="admin.php?page=Form_maker&id=<?php echo $id; ?>" method="post" id="adminForm" name="adminForm">
|
1230 |
|
1231 |
-
|
1232 |
-
</form>
|
1233 |
-
<?php
|
1234 |
-
|
1235 |
-
}
|
1236 |
|
1237 |
-
|
1238 |
-
|
1239 |
-
?>
|
1240 |
|
1241 |
-
<
|
1242 |
-
<?php
|
1243 |
-
|
1244 |
-
}
|
1245 |
|
|
|
|
|
1246 |
|
|
|
1247 |
|
|
|
|
|
1248 |
|
|
|
|
|
|
|
1249 |
|
1250 |
|
|
|
1251 |
|
1252 |
-
function
|
|
|
|
|
|
|
|
|
1253 |
|
|
|
|
|
1254 |
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
<script language="javascript">
|
1259 |
-
function confirmation(href,title) {
|
1260 |
-
var answer = confirm("Are you sure you want to delete '"+title+"'?")
|
1261 |
-
if (answer){
|
1262 |
-
document.getElementById('admin_form').action=href;
|
1263 |
-
document.getElementById('admin_form').submit();
|
1264 |
-
}
|
1265 |
-
}
|
1266 |
-
function ordering(name,as_or_desc)
|
1267 |
-
{
|
1268 |
-
document.getElementById('asc_or_desc').value=as_or_desc;
|
1269 |
-
document.getElementById('order_by').value=name;
|
1270 |
-
document.getElementById('admin_form').submit();
|
1271 |
-
}
|
1272 |
-
function doNothing() {
|
1273 |
-
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
1274 |
-
if( keyCode == 13 ) {
|
1275 |
|
1276 |
|
1277 |
-
|
|
|
|
|
1278 |
|
1279 |
-
|
1280 |
-
|
1281 |
|
1282 |
-
|
1283 |
-
|
1284 |
-
e.preventDefault();
|
1285 |
-
}
|
1286 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1287 |
}
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
<
|
1295 |
-
|
|
|
|
|
|
|
1296 |
<tr>
|
1297 |
-
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1310 |
</tr>
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
if (esc_html($_POST['serch_or_not']) == "search") {
|
1316 |
$serch_value = esc_html($_POST['search_events_by_title']);
|
1317 |
}
|
1318 |
else {
|
1319 |
$serch_value = "";
|
1320 |
}
|
1321 |
-
}
|
1322 |
-
|
1323 |
<label for="search_events_by_title" style="font-size:14px">Title: </label>
|
1324 |
-
<input type="text" name="search_events_by_title" value="'
|
1325 |
</div>
|
1326 |
<div class="alignleft actions">
|
1327 |
<input type="button" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\'; document.getElementById(\'serch_or_not\').value=\'search\';
|
1328 |
document.getElementById(\'admin_form\').submit();" class="button-secondary action">
|
1329 |
<input type="button" value="Reset" onclick="window.location.href=\'admin.php?page=Form_maker\'" class="button-secondary action">
|
1330 |
</div>';
|
1331 |
-
|
1332 |
-
|
1333 |
-
?>
|
1334 |
-
<table class="wp-list-table widefat fixed pages" style="width:95%">
|
1335 |
-
<thead>
|
1336 |
-
<TR>
|
1337 |
-
<th scope="col" id="id" class="<?php if($sort["sortid_by"]=="id") echo $sort["custom_style"]; else echo $sort["default_style"]; ?>" style="width:110px" ><a href="javascript:ordering('id',<?php if($sort["sortid_by"]=="id") echo $sort["1_or_2"]; else echo "1"; ?>)"><span>ID</span><span class="sorting-indicator"></span></a></th>
|
1338 |
-
<th scope="col" id="title" class="<?php if($sort["sortid_by"]=="title") echo $sort["custom_style"]; else echo $sort["default_style"]; ?>" style="" ><a href="javascript:ordering('title',<?php if($sort["sortid_by"]=="title") echo $sort["1_or_2"]; else echo "1"; ?>)"><span>Title</span><span class="sorting-indicator"></span></a></th>
|
1339 |
-
<th scope="col" id="mail" class="<?php if($sort["sortid_by"]=="mail") echo $sort["custom_style"]; else echo $sort["default_style"]; ?>" ><a href="javascript:ordering('mail',<?php if($sort["sortid_by"]=="mail") echo $sort["1_or_2"]; else echo "1"; ?>)"><span>Email to send submissions to</span><span class="sorting-indicator"></span></a></th>
|
1340 |
-
<th style="width:80px">Edit</th>
|
1341 |
-
<th style="width:80px">Delete</th>
|
1342 |
-
</TR>
|
1343 |
-
</thead>
|
1344 |
-
<tbody>
|
1345 |
-
<?php for($i=0; $i<count($rows);$i++){ ?>
|
1346 |
-
<tr>
|
1347 |
-
<?php
|
1348 |
-
$old_version = false;
|
1349 |
-
if(strpos($rows[$i]->form, "wdform_table1")===false)
|
1350 |
-
{
|
1351 |
-
$old_version = true;
|
1352 |
-
}
|
1353 |
-
?>
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
1357 |
-
<td><?php if(!$old_version) { ?><a href="admin.php?page=Form_maker&task=edit_form&id=<?php echo $rows[$i]->id?>"><?php echo $rows[$i]->id; ?></a><?php }else{?> <p style="color:red; cursor:pointer; margin:0px" onclick="alert('Update forms to new version!')"><?php echo $rows[$i]->id; ?></p><?php }?></td>
|
1358 |
-
<td><?php if(!$old_version) { ?><a href="admin.php?page=Form_maker&task=edit_form&id=<?php echo $rows[$i]->id?>"><?php echo $rows[$i]->title; ?></a><?php }else{?> <p style="color:red; cursor:pointer; margin:0px" onclick="alert('Update forms to new version!')"><?php echo $rows[$i]->title; ?></p><?php }?></td>
|
1359 |
-
<td><?php echo $rows[$i]->mail; ?></td>
|
1360 |
-
<td><?php if(!$old_version) { ?><a href="admin.php?page=Form_maker&task=edit_form&id=<?php echo $rows[$i]->id?>">Edit</a><?php }else{?> <p style="color:red; cursor:pointer; margin:0px" onclick="alert('Update forms to new version!')">Edit</p><?php }?></td>
|
1361 |
-
<td><a href="javascript:confirmation('admin.php?page=Form_maker&task=remove_form&id=<?php echo $rows[$i]->id?>','<?php echo $rows[$i]->title; ?>')">Delete</a></td>
|
1362 |
-
</tr>
|
1363 |
-
<?php } ?>
|
1364 |
-
</tbody>
|
1365 |
-
</table>
|
1366 |
-
<input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if(isset($_POST['asc_or_desc'])) echo esc_html($_POST['asc_or_desc']);?>" />
|
1367 |
-
<input type="hidden" name="order_by" id="order_by" value="<?php if(isset($_POST['order_by'])) echo esc_html($_POST['order_by']);?>" />
|
1368 |
-
|
1369 |
-
<?php
|
1370 |
-
?>
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
</form>
|
1375 |
-
<?php
|
1376 |
|
1377 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1378 |
|
|
|
|
|
1379 |
|
1380 |
|
|
|
|
|
1381 |
}
|
1382 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1383 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1384 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1385 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1386 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1387 |
|
|
|
|
|
|
|
|
|
|
|
1388 |
|
|
|
|
|
|
|
1389 |
|
|
|
|
|
1390 |
|
|
|
|
|
1391 |
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
|
|
|
|
|
|
|
|
1397 |
|
1398 |
-
|
1399 |
-
|
1400 |
|
1401 |
-
|
1402 |
-
var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
|
1403 |
|
1404 |
-
|
1405 |
-
|
1406 |
|
1407 |
-
|
1408 |
-
|
1409 |
-
$('#TB_iframeContent').width(w).height(h - 27);
|
1410 |
-
tbWindow.css({'margin-left': '-' + parseInt((w / 2),10) + 'px'});
|
1411 |
-
if ( typeof document.body.style.maxWidth != 'undefined' )
|
1412 |
-
tbWindow.css({'top':(H-h)/2,'margin-top':'0'});
|
1413 |
-
}
|
1414 |
-
};
|
1415 |
|
1416 |
-
|
1417 |
-
$(window).resize( function() { thickDims() } );
|
1418 |
|
1419 |
-
|
1420 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1421 |
|
1422 |
-
|
1423 |
|
1424 |
-
|
1425 |
-
tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
|
1426 |
-
else
|
1427 |
-
tbWidth = $(window).width() - 120;
|
1428 |
|
1429 |
-
|
1430 |
-
|
1431 |
-
|
1432 |
-
|
1433 |
-
|
1434 |
-
|
1435 |
-
|
1436 |
-
|
1437 |
-
|
1438 |
-
|
1439 |
-
text = $(this).attr('title') || '';
|
1440 |
-
link = ' <span class="tb-theme-preview-link">' + text + '</span>';
|
1441 |
-
}
|
1442 |
|
1443 |
-
|
1444 |
-
|
1445 |
-
|
|
|
|
|
|
|
|
|
|
|
1446 |
|
1447 |
-
|
1448 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1449 |
|
1450 |
-
|
1451 |
-
} );
|
1452 |
|
1453 |
-
|
1454 |
-
|
1455 |
-
|
1456 |
-
|
1457 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1458 |
|
1459 |
-
|
1460 |
-
function refresh_()
|
1461 |
-
{
|
1462 |
-
|
1463 |
-
document.getElementById('form').value=document.getElementById('take').innerHTML;
|
1464 |
-
document.getElementById('counter').value=gen;
|
1465 |
-
|
1466 |
-
|
1467 |
-
|
1468 |
-
|
1469 |
-
|
1470 |
-
n=gen;
|
1471 |
-
for(i=0; i<n; i++)
|
1472 |
-
{
|
1473 |
-
if(document.getElementById(i))
|
1474 |
-
{
|
1475 |
-
for(z=0; z<document.getElementById(i).childNodes.length; z++)
|
1476 |
-
if(document.getElementById(i).childNodes[z].nodeType==3)
|
1477 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
|
1478 |
-
|
1479 |
-
if(document.getElementById(i).getAttribute('type')=="type_captcha" || document.getElementById(i).getAttribute('type')=="type_recaptcha")
|
1480 |
-
{
|
1481 |
-
if(document.getElementById(i).childNodes[10])
|
1482 |
-
{
|
1483 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1484 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1485 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1486 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1487 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1488 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1489 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1490 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1491 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1492 |
-
}
|
1493 |
-
else
|
1494 |
-
{
|
1495 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1496 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1497 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1498 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1499 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1500 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1501 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1502 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1503 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1504 |
-
}
|
1505 |
-
continue;
|
1506 |
-
}
|
1507 |
-
|
1508 |
-
if(document.getElementById(i).getAttribute('type')=="type_section_break")
|
1509 |
-
{
|
1510 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1511 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1512 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1513 |
-
continue;
|
1514 |
-
}
|
1515 |
-
|
1516 |
-
|
1517 |
-
if(document.getElementById(i).childNodes[10])
|
1518 |
-
{
|
1519 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1520 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1521 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1522 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1523 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1524 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1525 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1526 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1527 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1528 |
-
}
|
1529 |
-
else
|
1530 |
-
{
|
1531 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1532 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1533 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1534 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1535 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1536 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1537 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1538 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1539 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1540 |
-
}
|
1541 |
-
}
|
1542 |
-
}
|
1543 |
-
|
1544 |
-
for(i=0; i<=n; i++)
|
1545 |
-
{
|
1546 |
-
if(document.getElementById(i))
|
1547 |
-
{
|
1548 |
-
type=document.getElementById(i).getAttribute("type");
|
1549 |
-
switch(type)
|
1550 |
-
{
|
1551 |
-
case "type_text":
|
1552 |
-
case "type_number":
|
1553 |
-
case "type_password":
|
1554 |
-
case "type_submitter_mail":
|
1555 |
-
case "type_own_select":
|
1556 |
-
case "type_country":
|
1557 |
-
case "type_hidden":
|
1558 |
-
case "type_map":
|
1559 |
-
{
|
1560 |
-
remove_add_(i+"_elementform_id_temp");
|
1561 |
-
break;
|
1562 |
-
}
|
1563 |
-
|
1564 |
-
case "type_submit_reset":
|
1565 |
-
{
|
1566 |
-
remove_add_(i+"_element_submitform_id_temp");
|
1567 |
-
if(document.getElementById(i+"_element_resetform_id_temp"))
|
1568 |
-
remove_add_(i+"_element_resetform_id_temp");
|
1569 |
-
break;
|
1570 |
-
}
|
1571 |
-
|
1572 |
-
case "type_captcha":
|
1573 |
-
{
|
1574 |
-
remove_add_("_wd_captchaform_id_temp");
|
1575 |
-
remove_add_("_element_refreshform_id_temp");
|
1576 |
-
remove_add_("_wd_captcha_inputform_id_temp");
|
1577 |
-
break;
|
1578 |
-
}
|
1579 |
-
|
1580 |
-
case "type_recaptcha":
|
1581 |
-
{
|
1582 |
-
document.getElementById("public_key").value = document.getElementById("wd_recaptchaform_id_temp").getAttribute("public_key");
|
1583 |
-
document.getElementById("private_key").value= document.getElementById("wd_recaptchaform_id_temp").getAttribute("private_key");
|
1584 |
-
document.getElementById("recaptcha_theme").value= document.getElementById("wd_recaptchaform_id_temp").getAttribute("theme");
|
1585 |
-
document.getElementById('wd_recaptchaform_id_temp').innerHTML='';
|
1586 |
-
remove_add_("wd_recaptchaform_id_temp");
|
1587 |
-
break;
|
1588 |
-
}
|
1589 |
-
|
1590 |
-
case "type_file_upload":
|
1591 |
-
{
|
1592 |
-
remove_add_(i+"_elementform_id_temp");
|
1593 |
-
break;
|
1594 |
-
}
|
1595 |
-
|
1596 |
-
case "type_textarea":
|
1597 |
-
{
|
1598 |
-
remove_add_(i+"_elementform_id_temp");
|
1599 |
-
|
1600 |
-
break;
|
1601 |
-
}
|
1602 |
-
|
1603 |
-
case "type_name":
|
1604 |
-
{
|
1605 |
-
|
1606 |
-
if(document.getElementById(i+"_element_titleform_id_temp"))
|
1607 |
-
{
|
1608 |
-
remove_add_(i+"_element_titleform_id_temp");
|
1609 |
-
remove_add_(i+"_element_firstform_id_temp");
|
1610 |
-
remove_add_(i+"_element_lastform_id_temp");
|
1611 |
-
remove_add_(i+"_element_middleform_id_temp");
|
1612 |
-
}
|
1613 |
-
else
|
1614 |
-
{
|
1615 |
-
remove_add_(i+"_element_firstform_id_temp");
|
1616 |
-
remove_add_(i+"_element_lastform_id_temp");
|
1617 |
-
|
1618 |
-
}
|
1619 |
-
break;
|
1620 |
-
|
1621 |
-
}
|
1622 |
-
|
1623 |
-
case "type_phone":
|
1624 |
-
{
|
1625 |
-
|
1626 |
-
remove_add_(i+"_element_firstform_id_temp");
|
1627 |
-
remove_add_(i+"_element_lastform_id_temp");
|
1628 |
-
|
1629 |
-
break;
|
1630 |
-
|
1631 |
-
}
|
1632 |
-
case "type_address":
|
1633 |
-
{
|
1634 |
-
remove_add_(i+"_street1form_id_temp");
|
1635 |
-
remove_add_(i+"_street2form_id_temp");
|
1636 |
-
remove_add_(i+"_cityform_id_temp");
|
1637 |
-
remove_add_(i+"_stateform_id_temp");
|
1638 |
-
remove_add_(i+"_postalform_id_temp");
|
1639 |
-
remove_add_(i+"_countryform_id_temp");
|
1640 |
-
|
1641 |
-
break;
|
1642 |
-
|
1643 |
-
}
|
1644 |
-
|
1645 |
-
|
1646 |
-
case "type_checkbox":
|
1647 |
-
case "type_radio":
|
1648 |
-
{
|
1649 |
-
is=true;
|
1650 |
-
for(j=0; j<100; j++)
|
1651 |
-
if(document.getElementById(i+"_elementform_id_temp"+j))
|
1652 |
-
{
|
1653 |
-
remove_add_(i+"_elementform_id_temp"+j);
|
1654 |
-
}
|
1655 |
-
/* if(document.getElementById(i+"_randomize").value=="yes")
|
1656 |
-
choises_randomize(i);*/
|
1657 |
-
|
1658 |
-
break;
|
1659 |
-
}
|
1660 |
-
|
1661 |
-
case "type_button":
|
1662 |
-
{
|
1663 |
-
for(j=0; j<100; j++)
|
1664 |
-
if(document.getElementById(i+"_elementform_id_temp"+j))
|
1665 |
-
{
|
1666 |
-
remove_add_(i+"_elementform_id_temp"+j);
|
1667 |
-
}
|
1668 |
-
break;
|
1669 |
-
}
|
1670 |
-
|
1671 |
-
case "type_time":
|
1672 |
-
{
|
1673 |
-
if(document.getElementById(i+"_ssform_id_temp"))
|
1674 |
-
{
|
1675 |
-
remove_add_(i+"_ssform_id_temp");
|
1676 |
-
remove_add_(i+"_mmform_id_temp");
|
1677 |
-
remove_add_(i+"_hhform_id_temp");
|
1678 |
-
}
|
1679 |
-
else
|
1680 |
-
{
|
1681 |
-
remove_add_(i+"_mmform_id_temp");
|
1682 |
-
remove_add_(i+"_hhform_id_temp");
|
1683 |
-
}
|
1684 |
-
break;
|
1685 |
-
|
1686 |
-
}
|
1687 |
-
|
1688 |
-
case "type_date":
|
1689 |
-
{
|
1690 |
-
remove_add_(i+"_elementform_id_temp");
|
1691 |
-
remove_add_(i+"_buttonform_id_temp");
|
1692 |
-
break;
|
1693 |
-
}
|
1694 |
-
case "type_date_fields":
|
1695 |
-
{
|
1696 |
-
remove_add_(i+"_dayform_id_temp");
|
1697 |
-
remove_add_(i+"_monthform_id_temp");
|
1698 |
-
remove_add_(i+"_yearform_id_temp");
|
1699 |
-
break;
|
1700 |
-
}
|
1701 |
-
}
|
1702 |
-
}
|
1703 |
-
}
|
1704 |
-
|
1705 |
-
for(i=1; i<=form_view_max; i++)
|
1706 |
-
if(document.getElementById('form_id_tempform_view'+i))
|
1707 |
-
{
|
1708 |
-
if(document.getElementById('page_next_'+i))
|
1709 |
-
document.getElementById('page_next_'+i).removeAttribute('src');
|
1710 |
-
if(document.getElementById('page_previous_'+i))
|
1711 |
-
document.getElementById('page_previous_'+i).removeAttribute('src');
|
1712 |
-
document.getElementById('form_id_tempform_view'+i).parentNode.removeChild(document.getElementById('form_id_tempform_view_img'+i));
|
1713 |
-
document.getElementById('form_id_tempform_view'+i).removeAttribute('style');
|
1714 |
-
}
|
1715 |
-
|
1716 |
-
document.getElementById('form_front').value=document.getElementById('take').innerHTML;
|
1717 |
|
1718 |
}
|
1719 |
|
1720 |
-
function submitform(
|
1721 |
-
|
1722 |
-
document.getElementById('adminForm').
|
1723 |
-
document.getElementById('adminForm').submit();
|
1724 |
-
|
1725 |
}
|
1726 |
|
1727 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1728 |
|
1729 |
-
|
1730 |
-
|
1731 |
-
|
1732 |
-
|
1733 |
-
|
1734 |
-
|
1735 |
-
|
1736 |
-
|
1737 |
-
return;
|
1738 |
-
}
|
1739 |
-
|
1740 |
-
if (form.title.value == "")
|
1741 |
-
{
|
1742 |
-
alert( "The form must have a title." );
|
1743 |
-
return ;
|
1744 |
-
}
|
1745 |
-
|
1746 |
-
if(form.mail.value!='')
|
1747 |
-
{
|
1748 |
-
subMailArr=form.mail.value.split(',');
|
1749 |
-
emailListValid=true;
|
1750 |
-
for(subMailIt=0; subMailIt<subMailArr.length; subMailIt++)
|
1751 |
-
{
|
1752 |
-
trimmedMail = subMailArr[subMailIt].replace(/^\s+|\s+$/g, '') ;
|
1753 |
-
if (trimmedMail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1)
|
1754 |
-
{
|
1755 |
-
alert( "This is not a list of valid email addresses." );
|
1756 |
-
emailListValid=false;
|
1757 |
-
break;
|
1758 |
-
}
|
1759 |
-
}
|
1760 |
-
if(!emailListValid)
|
1761 |
-
return;
|
1762 |
-
}
|
1763 |
-
|
1764 |
-
tox='';
|
1765 |
-
|
1766 |
-
for(t=1;t<=form_view_max;t++)
|
1767 |
-
{
|
1768 |
-
if(document.getElementById('form_id_tempform_view'+t))
|
1769 |
-
{
|
1770 |
-
form_view_element=document.getElementById('form_id_tempform_view'+t);
|
1771 |
-
n=form_view_element.childNodes.length-2;
|
1772 |
-
|
1773 |
-
for(z=0;z<=n;z++)
|
1774 |
-
{
|
1775 |
-
if(form_view_element.childNodes[z].nodeType!=3)
|
1776 |
-
if(!form_view_element.childNodes[z].id)
|
1777 |
-
{
|
1778 |
-
GLOBAL_tr=form_view_element.childNodes[z];
|
1779 |
-
//////////////////////////////////////////////////////////////////////////////////////////
|
1780 |
-
for (x=0; x < GLOBAL_tr.firstChild.childNodes.length; x++)
|
1781 |
-
{
|
1782 |
-
table=GLOBAL_tr.firstChild.childNodes[x];
|
1783 |
-
tbody=table.firstChild;
|
1784 |
-
for (y=0; y < tbody.childNodes.length; y++)
|
1785 |
-
{
|
1786 |
-
tr=tbody.childNodes[y];
|
1787 |
-
l_label = document.getElementById( tr.id+'_element_labelform_id_temp').innerHTML;
|
1788 |
-
l_label = l_label.replace(/(\r\n|\n|\r)/gm," ");
|
1789 |
-
|
1790 |
-
if(tr.getAttribute('type')=="type_address")
|
1791 |
-
{
|
1792 |
-
addr_id=parseInt(tr.id);
|
1793 |
-
tox=tox+addr_id+'#**id**#'+'Street Line'+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
|
1794 |
-
tox=tox+addr_id+'#**id**#'+'Street Line2'+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
|
1795 |
-
tox=tox+addr_id+'#**id**#'+'City'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
|
1796 |
-
tox=tox+addr_id+'#**id**#'+'State'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
|
1797 |
-
tox=tox+addr_id+'#**id**#'+'Postal'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
|
1798 |
-
tox=tox+addr_id+'#**id**#'+'Country'+'#**label**#'+tr.getAttribute('type')+'#****#';
|
1799 |
-
}
|
1800 |
-
else
|
1801 |
-
tox=tox+tr.id+'#**id**#'+l_label+'#**label**#'+tr.getAttribute('type')+'#****#';
|
1802 |
-
}
|
1803 |
-
}
|
1804 |
-
}
|
1805 |
-
}
|
1806 |
-
}
|
1807 |
-
}
|
1808 |
-
|
1809 |
-
document.getElementById('label_order').value=tox;
|
1810 |
-
refresh_();
|
1811 |
-
document.getElementById('pagination').value=document.getElementById('pages').getAttribute("type");
|
1812 |
-
document.getElementById('show_title').value=document.getElementById('pages').getAttribute("show_title");
|
1813 |
-
document.getElementById('show_numbers').value=document.getElementById('pages').getAttribute("show_numbers");
|
1814 |
-
|
1815 |
-
submitform( pressbutton );
|
1816 |
|
1817 |
}
|
1818 |
-
gen=1;
|
1819 |
-
form_view=1;
|
1820 |
-
form_view_max=1;
|
1821 |
-
form_view_count=1;
|
1822 |
-
|
1823 |
-
function set_preview()
|
1824 |
-
|
1825 |
-
|
1826 |
-
|
1827 |
-
document.getElementById('preview_form').href='<?php echo admin_url('admin-ajax.php'); ?>?action=frommakerpreview&id='+document.getElementById('theme').value+'&TB_iframe=1';
|
1828 |
}
|
1829 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1830 |
|
1831 |
-
|
1832 |
-
|
1833 |
-
|
1834 |
-
|
1835 |
-
|
1836 |
-
|
1837 |
-
|
1838 |
-
|
1839 |
-
|
1840 |
-
|
1841 |
-
|
1842 |
-
|
1843 |
-
|
1844 |
-
|
1845 |
-
|
1846 |
-
|
1847 |
-
|
1848 |
-
|
1849 |
-
|
1850 |
-
|
1851 |
-
|
1852 |
-
|
1853 |
-
|
1854 |
-
|
1855 |
-
|
1856 |
-
|
1857 |
-
{
|
1858 |
-
alltypes=Array('customHTML','text','checkbox','radio','time_and_date','select','file_upload','captcha','map','button','page_break','section_break');
|
1859 |
-
for(x=0; x<12;x++)
|
1860 |
-
{
|
1861 |
-
document.getElementById('img_'+alltypes[x]).src="<?php echo plugins_url("images",__FILE__) ?>/"+alltypes[x]+".png";
|
1862 |
-
}
|
1863 |
-
|
1864 |
-
document.getElementById('formMakerDiv').style.display =(document.getElementById('formMakerDiv').style.display=='block'?'none':'block');
|
1865 |
-
document.getElementById('formMakerDiv1').style.display =(document.getElementById('formMakerDiv1').style.display=='block'?'none':'block');
|
1866 |
-
if(document.getElementById('formMakerDiv').offsetWidth)
|
1867 |
-
document.getElementById('formMakerDiv1').style.width =(document.getElementById('formMakerDiv').offsetWidth - 60)+'px';
|
1868 |
-
document.getElementById('when_edit').style.display ='block';
|
1869 |
-
if(document.getElementById('field_types').offsetWidth)
|
1870 |
-
document.getElementById('when_edit').style.width =document.getElementById('field_types').offsetWidth+'px';
|
1871 |
-
|
1872 |
-
if(document.getElementById('field_types').offsetHeight)
|
1873 |
-
document.getElementById('when_edit').style.height =document.getElementById('field_types').offsetHeight+'px';
|
1874 |
-
|
1875 |
-
}
|
1876 |
-
|
1877 |
-
|
1878 |
-
|
1879 |
-
var thickDims, tbWidth, tbHeight;
|
1880 |
-
jQuery(document).ready(function($) {
|
1881 |
-
|
1882 |
-
thickDims = function() {
|
1883 |
-
var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
|
1884 |
-
|
1885 |
-
w = (tbWidth && tbWidth < W - 90) ? tbWidth : W - 40;
|
1886 |
-
h = (tbHeight && tbHeight < H - 60) ? tbHeight : H - 40;
|
1887 |
-
|
1888 |
-
if ( tbWindow.size() ) {
|
1889 |
-
tbWindow.width(w).height(h);
|
1890 |
-
$('#TB_iframeContent').width(w).height(h - 27);
|
1891 |
-
tbWindow.css({'margin-left': '-' + parseInt((w / 2),10) + 'px'});
|
1892 |
-
if ( typeof document.body.style.maxWidth != 'undefined' )
|
1893 |
-
tbWindow.css({'top':(H-h)/2,'margin-top':'0'});
|
1894 |
-
}
|
1895 |
-
};
|
1896 |
|
1897 |
-
thickDims();
|
1898 |
-
$(window).resize( function() { thickDims() } );
|
1899 |
|
1900 |
-
|
1901 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1902 |
|
1903 |
-
|
1904 |
|
1905 |
-
|
1906 |
-
tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
|
1907 |
-
else
|
1908 |
-
tbWidth = $(window).width() - 120;
|
1909 |
-
|
1910 |
-
if ( tbHeight = href.match(/&tbHeight=[0-9]+/) )
|
1911 |
-
tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
|
1912 |
-
else
|
1913 |
-
tbHeight = $(window).height() - 120;
|
1914 |
-
|
1915 |
-
if ( alink.length ) {
|
1916 |
-
url = alink.attr('href') || '';
|
1917 |
-
text = alink.attr('title') || '';
|
1918 |
-
link = ' <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
|
1919 |
-
} else {
|
1920 |
-
text = $(this).attr('title') || '';
|
1921 |
-
link = ' <span class="tb-theme-preview-link">' + text + '</span>';
|
1922 |
-
}
|
1923 |
-
|
1924 |
-
$('#TB_title').css({'background-color':'#222','color':'#dfdfdf'});
|
1925 |
-
$('#TB_closeAjaxWindow').css({'float':'left'});
|
1926 |
-
$('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
|
1927 |
-
|
1928 |
-
$('#TB_iframeContent').width('100%');
|
1929 |
-
thickDims();
|
1930 |
-
|
1931 |
-
return false;
|
1932 |
-
} );
|
1933 |
-
|
1934 |
-
// Theme details
|
1935 |
-
$('.theme-detail').click(function () {
|
1936 |
-
$(this).siblings('.themedetaildiv').toggle();
|
1937 |
-
return false;
|
1938 |
-
});
|
1939 |
-
|
1940 |
-
});
|
1941 |
-
|
1942 |
-
</script>
|
1943 |
<style>
|
1944 |
-
.calendar .button
|
1945 |
-
|
1946 |
-
|
1947 |
-
|
1948 |
-
|
1949 |
-
|
1950 |
-
|
1951 |
-
|
1952 |
-
|
1953 |
-
|
1954 |
-
|
1955 |
-
|
1956 |
-
|
1957 |
-
|
1958 |
-
|
1959 |
-
#
|
1960 |
-
|
1961 |
-
|
1962 |
-
|
1963 |
-
|
1964 |
-
|
1965 |
-
|
1966 |
-
|
1967 |
-
|
1968 |
-
|
1969 |
-
|
1970 |
-
|
1971 |
-
|
1972 |
-
|
1973 |
-
|
1974 |
-
|
1975 |
-
|
1976 |
-
|
1977 |
-
|
1978 |
-
top:
|
1979 |
-
|
1980 |
-
|
1981 |
-
|
1982 |
-
|
1983 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1984 |
</style>
|
1985 |
<?php
|
1986 |
-
foreach($themes as $theme)
|
1987 |
-
|
1988 |
-
|
1989 |
-
|
1990 |
-
|
1991 |
-
|
1992 |
-
|
1993 |
-
|
1994 |
-
|
1995 |
-
|
1996 |
-
|
1997 |
-
|
1998 |
-
|
1999 |
-
|
|
|
|
|
|
|
2000 |
<thead>
|
2001 |
<tr>
|
2002 |
-
|
2003 |
-
|
2004 |
-
|
2005 |
-
|
2006 |
-
|
2007 |
-
|
2008 |
-
|
2009 |
-
|
2010 |
-
|
2011 |
-
<td width="100%" ><?php echo "<h2>Form Maker</h2>"; ?></td>
|
2012 |
-
<td><a id="preview_form" href="<?php echo admin_url('admin-ajax.php').'?action=frommakerpreview&id='.$my_selected_theme.'&TB_iframe=1'; ?>" class="thickbox-preview" title="Form Preview" onclick="return false;"><input type="button" value="preview" class="button-primary" /></a> </td>
|
2013 |
-
<td><input type="button" onclick="submitbutton('Actions_after_submission')" value="Actions after submission" class="button-primary" /> </td>
|
2014 |
-
<td> <input type="button" onclick="submitbutton('Edit_JavaScript')" value="Edit JavaScript" class="button-primary" /> </td>
|
2015 |
-
<td style="width:300px"><input type="button" onclick="submitbutton('Custom_text_in_email_for_administrator')" value="Custom text in email for administrator" class="button-primary" /> </td>
|
2016 |
-
<td style="width:300px"><input type="button" onclick="submitbutton('Custom_text_in_email_for_user')" value="Custom text in email for user" class="button-primary" /> </td>
|
2017 |
-
<td align="right"><input type="button" onclick="submitbutton('Save')" value="Save" class="button-secondary action" /> </td>
|
2018 |
-
<td align="right"><input type="button" onclick="submitbutton('Apply')" value="Apply" class="button-secondary action"/> </td>
|
2019 |
-
<td align="right"><input type="button" onclick="window.location.href='admin.php?page=Form_maker'" value="Cancel" class="button-secondary action" /> </td>
|
2020 |
-
</tr>
|
2021 |
-
</table>
|
2022 |
-
<br />
|
2023 |
-
|
2024 |
-
<form action="admin.php?page=Form_maker" method="post" id="adminForm" name="adminForm" enctype="multipart/form-data">
|
2025 |
-
<table style="border:6px #00aeef solid; background-color:#00aeef " width="95%" cellpadding="0" cellspacing="0">
|
2026 |
-
<tr>
|
2027 |
-
|
2028 |
-
|
2029 |
-
<td align="left" valign="middle" rowspan="3" style="padding:10px;">
|
2030 |
-
<img src="<?php echo plugins_url("images/formmaker.png",__FILE__) ?>" />
|
2031 |
-
</td>
|
2032 |
-
|
2033 |
-
<td width="300" align="right" valign="middle">
|
2034 |
-
|
2035 |
-
<span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Form title: </span>
|
2036 |
-
|
2037 |
-
</td>
|
2038 |
-
|
2039 |
-
<td width="153" height="30px" align="center" valign="middle">
|
2040 |
-
|
2041 |
-
<div style="background-image:url(<?php echo plugins_url("images/input.png",__FILE__) ?>); height:19px">
|
2042 |
-
<input type="hidden" value="<?php echo plugins_url("",__FILE__) ?>" id="form_plugins_url" />
|
2043 |
-
<input id="title" name="title" style="background:none; padding:inherit; width:151px; height:19px; border:none; font-size:11px; " />
|
2044 |
-
|
2045 |
-
</div>
|
2046 |
-
|
2047 |
-
</td>
|
2048 |
-
|
2049 |
-
</tr>
|
2050 |
-
|
2051 |
-
|
2052 |
-
<tr>
|
2053 |
-
|
2054 |
-
<td width="300" align="right" valign="middle">
|
2055 |
-
|
2056 |
-
<span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Email to send submissions to: </span>
|
2057 |
-
|
2058 |
-
</td>
|
2059 |
-
|
2060 |
-
<td width="153" height="30px" align="center" valign="middle">
|
2061 |
-
|
2062 |
-
<div style="background-image:url(<?php echo plugins_url("images/input.png",__FILE__) ?>); height:19px">
|
2063 |
-
|
2064 |
-
<input id="mail" name="mail" style="background:none; padding:inherit; width:151px; height:19px; border:none; font-size:11px" />
|
2065 |
-
|
2066 |
-
</div>
|
2067 |
-
|
2068 |
-
</td>
|
2069 |
-
|
2070 |
-
</tr>
|
2071 |
-
|
2072 |
-
<tr>
|
2073 |
-
|
2074 |
-
<td width="300" align="right" valign="middle">
|
2075 |
-
|
2076 |
-
<span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Theme: </span>
|
2077 |
-
|
2078 |
-
</td>
|
2079 |
-
|
2080 |
-
<td width="153" height="30px" align="center" valign="middle">
|
2081 |
-
|
2082 |
-
<div style="height:19px">
|
2083 |
-
|
2084 |
-
<select id="theme" name="theme" style="background:transparent; width:151px; height:19px; border:none; font-size:11px" onChange="set_preview()" >
|
2085 |
-
|
2086 |
-
<?php
|
2087 |
-
$form_theme='';
|
2088 |
-
foreach($themes as $theme)
|
2089 |
-
{
|
2090 |
-
if($theme->default == 1 )
|
2091 |
-
{
|
2092 |
-
echo '<option value="'.$theme->id.'" selected>'.$theme->title.'</option>';
|
2093 |
-
$form_theme=$theme->css;
|
2094 |
-
}
|
2095 |
-
else
|
2096 |
-
echo '<option value="'.$theme->id.'">'.$theme->title.'</option>';
|
2097 |
-
|
2098 |
-
}
|
2099 |
-
?>
|
2100 |
-
</select>
|
2101 |
-
|
2102 |
-
</div>
|
2103 |
-
|
2104 |
</td>
|
2105 |
-
|
2106 |
-
</tr>
|
2107 |
-
|
2108 |
-
|
2109 |
-
|
2110 |
-
<tr>
|
2111 |
-
<td align="left" colspan="3">
|
2112 |
-
|
2113 |
-
<img src="<?php echo plugins_url("images/addanewfield.png",__FILE__) ?>" onclick="enable(); Enable()" style="cursor:pointer;margin:10px;" />
|
2114 |
-
|
2115 |
-
</td>
|
2116 |
</tr>
|
2117 |
-
</
|
2118 |
-
|
2119 |
-
|
2120 |
-
|
2121 |
-
<div id="formMakerDiv" onclick="close_window()"></div>
|
2122 |
-
|
2123 |
-
<div id="formMakerDiv1" align="center">
|
2124 |
-
|
2125 |
-
<table border="0" width="100%" cellpadding="0" cellspacing="0" height="100%" style="border:6px #00aeef solid; background-color:#FFF">
|
2126 |
<tr>
|
2127 |
-
<td
|
2128 |
-
<
|
2129 |
-
|
2130 |
-
|
2131 |
-
|
2132 |
-
|
2133 |
-
|
2134 |
-
|
2135 |
-
|
2136 |
-
<td align="center" onClick="addRow('text')" id="table_text" class="field_buttons"><img src="<?php echo plugins_url("images/text.png",__FILE__); ?>" style="margin:5px" id="img_text"/></td>
|
2137 |
-
</tr>
|
2138 |
-
<tr>
|
2139 |
-
<td align="center" onClick="addRow('time_and_date')" id="table_time_and_date" class="field_buttons"><img src="<?php echo plugins_url("images/time_and_date.png",__FILE__); ?>" style="margin:5px" id="img_time_and_date"/></td>
|
2140 |
-
|
2141 |
-
<td align="center" onClick="addRow('select')" id="table_select" class="field_buttons" ><img src="<?php echo plugins_url("images/select.png",__FILE__); ?>" style="margin:5px" id="img_select"/></td>
|
2142 |
-
</tr>
|
2143 |
-
<tr>
|
2144 |
-
<td align="center" onClick="addRow('checkbox')" id="table_checkbox" class="field_buttons"><img src="<?php echo plugins_url("images/checkbox.png",__FILE__); ?>" style="margin:5px" id="img_checkbox"/></td>
|
2145 |
-
|
2146 |
-
<td align="center" onClick="addRow('radio')" id="table_radio" class="field_buttons"><img src="<?php echo plugins_url("images/radio.png",__FILE__); ?>" style="margin:5px" id="img_radio"/></td>
|
2147 |
-
</tr>
|
2148 |
-
<tr>
|
2149 |
-
<td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="background-color: rgb(114, 113, 113) !important;" id="table_file_upload" class="field_buttons"><img src="<?php echo plugins_url("images/file_upload.png",__FILE__); ?>" style="margin:5px" id="img_file_upload"/></td>
|
2150 |
-
|
2151 |
-
<td align="center" onClick="addRow('captcha')" id="table_captcha" class="field_buttons"><img src="<?php echo plugins_url("images/captcha.png",__FILE__); ?>" style="margin:5px" id="img_captcha"/></td>
|
2152 |
-
</tr>
|
2153 |
-
<tr>
|
2154 |
-
<td align="center" onClick="addRow('page_break')" id="table_page_break" class="field_buttons"><img src="<?php echo plugins_url("images/page_break.png",__FILE__); ?>" style="margin:5px" id="img_page_break"/></td>
|
2155 |
-
|
2156 |
-
<td align="center" onClick="addRow('section_break')" id="table_section_break" class="field_buttons"><img src="<?php echo plugins_url("images/section_break.png",__FILE__); ?>" style="margin:5px" id="img_section_break"/></td>
|
2157 |
-
</tr>
|
2158 |
-
<tr>
|
2159 |
-
<td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="background-color: rgb(114, 113, 113) !important;" id="table_map" class="field_buttons"><img src="<?php echo plugins_url("images/map.png",__FILE__); ?>" style="margin:5px" id="img_map"/></td>
|
2160 |
-
|
2161 |
-
<td align="center" onClick="addRow('button')" id="table_button" class="field_buttons"><img src="<?php echo plugins_url("images/button.png",__FILE__); ?>" style="margin:5px" id="img_button"/></td>
|
2162 |
-
</tr>
|
2163 |
-
</table>
|
2164 |
-
</td>
|
2165 |
-
<td width="40%" height="100%" align="left"><div id="edit_table" style="padding:0px; overflow-y:scroll; height:531px" ></div></td>
|
2166 |
-
<td align="center" valign="top" style="background:url(<?php echo plugins_url("images/border2.png",__FILE__); ?>) repeat-y;"> </td>
|
2167 |
-
<td style="padding:15px">
|
2168 |
-
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
|
2169 |
-
|
2170 |
-
<tr>
|
2171 |
-
<td align="right"><input type="radio" value="end" name="el_pos" checked="checked" id="pos_end" onclick="Disable()"/>
|
2172 |
-
At The End
|
2173 |
-
<input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
|
2174 |
-
At The Beginning
|
2175 |
-
<input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
|
2176 |
-
Before
|
2177 |
-
<select style="width:100px; margin-left:5px" id="sel_el_pos" disabled="disabled">
|
2178 |
-
</select>
|
2179 |
-
<img alt="ADD" title="add" style="cursor:pointer; vertical-align:middle; margin:5px" src="<?php echo plugins_url("images/save.png",__FILE__); ?>" onClick="add(0)"/>
|
2180 |
-
<img alt="CANCEL" title="cancel" style=" cursor:pointer; vertical-align:middle; margin:5px" src="<?php echo plugins_url("images/cancel_but.png",__FILE__); ?>" onClick="close_window()"/>
|
2181 |
-
|
2182 |
-
<hr style=" margin-bottom:10px" />
|
2183 |
-
</td>
|
2184 |
-
</tr>
|
2185 |
-
|
2186 |
-
<tr height="100%" valign="top">
|
2187 |
-
<td id="show_table"></td>
|
2188 |
-
</tr>
|
2189 |
-
|
2190 |
-
</table>
|
2191 |
-
</td>
|
2192 |
-
</tr>
|
2193 |
-
</table>
|
2194 |
</td>
|
|
|
|
|
|
|
|
|
2195 |
</tr>
|
2196 |
</table>
|
2197 |
-
<
|
2198 |
-
<input type="hidden" id="old_selected" />
|
2199 |
-
<input type="hidden" id="element_type" />
|
2200 |
-
<input type="hidden" id="editing_id" />
|
2201 |
-
<input type="hidden" id="editing_page_break" />
|
2202 |
|
2203 |
-
|
2204 |
-
<div
|
2205 |
-
<div
|
2206 |
-
|
2207 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2208 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2209 |
|
2210 |
-
|
2211 |
-
|
2212 |
-
|
2213 |
-
else{
|
2214 |
-
echo "<style>#wp-form_maker_editor-media-buttons{ text-align:left }</style>"; wp_editor("","form_maker_editor");
|
2215 |
-
}
|
2216 |
-
}
|
2217 |
-
else
|
2218 |
-
{
|
2219 |
-
?>
|
2220 |
-
<textarea name="form_maker_editor" id="form_maker_editor" cols="40" rows="6" style="width: 450px; height: 350px; " class="mce_editable" aria-hidden="true"></textarea>
|
2221 |
-
<?php
|
2222 |
|
2223 |
-
|
2224 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2225 |
|
2226 |
|
2227 |
</div>
|
2228 |
|
2229 |
-
<?php if(!function_exists
|
2230 |
-
?>
|
2231 |
<iframe id="tinymce" style="display:none"></iframe>
|
2232 |
|
2233 |
-
<?php
|
2234 |
-
?>
|
2235 |
|
2236 |
|
2237 |
|
2238 |
-
<br
|
2239 |
-
<br
|
2240 |
|
2241 |
<fieldset>
|
2242 |
|
2243 |
-
|
2244 |
|
2245 |
<h2 style="color:#00aeef">Form</h2>
|
2246 |
-
|
2247 |
-
</legend>
|
2248 |
-
|
2249 |
-
<style><?php global $first_css;
|
2250 |
-
echo $first_css; ?></style>
|
2251 |
-
|
2252 |
-
<table width="100%" style="margin:8px"><tr id="page_navigation"><td align="center" width="90%" id="pages" show_title="false" show_numbers="true" type="none"></td><td align="left" id="edit_page_navigation"></td></tr></table>
|
2253 |
-
<div id="take" class="main"><table cellpadding="4" cellspacing="0" class="wdform_table1" style="border-top:0px solid black;"><tbody id="form_id_tempform_view1" class="wdform_tbody1" page_title="Untitled page" next_title="Next" next_type="button" next_class="wdform_page_button" next_checkable="false" previous_title="Previous" previous_type="button" previous_class="wdform_page_button" previous_checkable="false"><tr class="wdform_tr1" ><td class="wdform_td1" ><table class="wdform_table2"><tbody class="wdform_tbody2"></tbody></table></td></tr><tr class="wdform_footer"><td colspan="100" valign="top"><table width="100%" style="padding-right:170px"><tbody><tr id="form_id_temppage_nav1"></tr></tbody></table></td></tr><tbody id="form_id_tempform_view_img1" style="float:right !important ;" ><tr><td width="0%"></td><td align="right"><img src="<?php echo plugins_url("images/minus.png",__FILE__); ?>" title="Show or hide the page" class="page_toolbar" onclick="show_or_hide('1')" id="show_page_img_1" /></td><td><img src="<?php echo plugins_url("images/page_delete.png",__FILE__); ?>" title="Delete the page" class="page_toolbar" onclick="remove_page('1')" /></td><td><img src="<?php echo plugins_url("images/page_delete_all.png",__FILE__); ?>" title="Delete the page with fields" class="page_toolbar" onclick="remove_page_all('1')" /></td><td><img src="<?php echo plugins_url("images/page_edit.png",__FILE__); ?>" title="Edit the page" class="page_toolbar" onclick="edit_page_break('1')" /></td></tr></tbody></table></div>
|
2254 |
-
</fieldset>
|
2255 |
-
|
2256 |
-
<input type="hidden" name="form_front" id="form_front" />
|
2257 |
-
<input type="hidden" name="form" id="form" />
|
2258 |
|
2259 |
-
|
2260 |
-
|
2261 |
-
<input type="hidden" name="pagination" id="pagination" />
|
2262 |
-
<input type="hidden" name="show_title" id="show_title" />
|
2263 |
-
<input type="hidden" name="show_numbers" id="show_numbers" />
|
2264 |
-
|
2265 |
-
<input type="hidden" name="public_key" id="public_key" />
|
2266 |
-
<input type="hidden" name="private_key" id="private_key" />
|
2267 |
-
<input type="hidden" name="recaptcha_theme" id="recaptcha_theme" />
|
2268 |
|
2269 |
-
|
2270 |
-
|
2271 |
-
|
2272 |
-
<input type="hidden" name="task" value="" />
|
2273 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2274 |
</form>
|
2275 |
-
|
2276 |
-
|
2277 |
<script>
|
2278 |
-
plugin_url=document.getElementById('form_plugins_url').value;
|
2279 |
-
//appWidth =parseInt(document.body.offsetWidth);
|
2280 |
-
//appHeight =parseInt(document.body.offsetHeight);
|
2281 |
-
//document.getElementById('toolbar-popup-popup').childNodes[1].href='index.php?option=com_formmaker&task=preview&tmpl=component&theme='+document.getElementById('theme').value;
|
2282 |
-
//document.getElementById('toolbar-popup-popup').childNodes[1].setAttribute('rel',"{handler: 'iframe', size: {x:"+(appWidth-100)+", y: "+(appHeight-30)+"}}");
|
2283 |
</script>
|
2284 |
<?php
|
|
|
|
|
|
|
|
|
2285 |
|
|
|
2286 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2287 |
}
|
2288 |
|
2289 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2290 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2291 |
|
2292 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2293 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2294 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2295 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2296 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2297 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2298 |
|
|
|
|
|
|
|
2299 |
|
|
|
|
|
2300 |
|
|
|
|
|
|
|
2301 |
|
2302 |
-
|
|
|
2303 |
|
2304 |
-
|
2305 |
-
|
2306 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2307 |
|
2308 |
-
|
2309 |
-
alert('ffff');
|
2310 |
-
tb_click.call(vvvv);
|
2311 |
|
2312 |
-
|
|
|
2313 |
|
2314 |
-
|
2315 |
-
|
2316 |
-
|
2317 |
-
tbWidth = $(window).width() - 120;
|
2318 |
|
2319 |
-
|
2320 |
-
|
2321 |
-
|
2322 |
-
|
2323 |
-
|
2324 |
-
|
2325 |
-
|
2326 |
-
|
2327 |
-
|
2328 |
-
|
2329 |
-
|
2330 |
-
|
2331 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2332 |
|
2333 |
-
|
2334 |
-
|
2335 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2336 |
|
2337 |
-
|
2338 |
-
|
2339 |
|
2340 |
-
return false;
|
2341 |
}
|
2342 |
|
|
|
|
|
|
|
|
|
2343 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2344 |
|
|
|
|
|
|
|
|
|
|
|
|
|
2345 |
|
2346 |
-
|
|
|
|
|
|
|
2347 |
|
2348 |
-
document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
|
2349 |
-
document.getElementById('adminForm').submit();
|
2350 |
|
2351 |
-
|
2352 |
-
function submitbutton(pressbutton)
|
2353 |
-
|
2354 |
-
{
|
2355 |
-
|
2356 |
-
if(!document.getElementById('araqel'))
|
2357 |
-
{
|
2358 |
-
alert('Please wait while page loading');
|
2359 |
-
return;
|
2360 |
-
}
|
2361 |
-
else
|
2362 |
-
if(document.getElementById('araqel').value=='0')
|
2363 |
-
{
|
2364 |
-
alert('Please wait while page loading');
|
2365 |
-
return;
|
2366 |
-
}
|
2367 |
-
|
2368 |
-
var form = document.adminForm;
|
2369 |
-
|
2370 |
-
if (pressbutton == 'cancel')
|
2371 |
-
|
2372 |
-
{
|
2373 |
-
|
2374 |
-
submitform( pressbutton );
|
2375 |
-
|
2376 |
-
return;
|
2377 |
-
|
2378 |
-
}
|
2379 |
-
|
2380 |
-
if (form.title.value == "")
|
2381 |
-
|
2382 |
-
{
|
2383 |
-
|
2384 |
-
alert( "The form must have a title." );
|
2385 |
-
return;
|
2386 |
-
|
2387 |
-
}
|
2388 |
-
|
2389 |
-
if(form.mail.value!='')
|
2390 |
-
{
|
2391 |
-
subMailArr=form.mail.value.split(',');
|
2392 |
-
emailListValid=true;
|
2393 |
-
for(subMailIt=0; subMailIt<subMailArr.length; subMailIt++)
|
2394 |
-
{
|
2395 |
-
trimmedMail = subMailArr[subMailIt].replace(/^\s+|\s+$/g, '') ;
|
2396 |
-
if (trimmedMail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1)
|
2397 |
-
{
|
2398 |
-
alert( "This is not a list of valid email addresses." );
|
2399 |
-
emailListValid=false;
|
2400 |
-
break;
|
2401 |
-
}
|
2402 |
-
}
|
2403 |
-
if(!emailListValid)
|
2404 |
-
return
|
2405 |
-
|
2406 |
-
}
|
2407 |
-
|
2408 |
-
tox='';
|
2409 |
-
l_id_array=[<?php echo $labels['id']?>];
|
2410 |
-
l_label_array=[<?php echo $labels['label']?>];
|
2411 |
-
l_type_array=[<?php echo $labels['type']?>];
|
2412 |
-
l_id_removed=[];
|
2413 |
-
|
2414 |
-
for(x=0; x< l_id_array.length; x++)
|
2415 |
-
{
|
2416 |
-
l_id_removed[x]=true;
|
2417 |
-
}
|
2418 |
-
|
2419 |
-
for(t=1;t<=form_view_max;t++)
|
2420 |
-
{
|
2421 |
-
if(document.getElementById('form_id_tempform_view'+t))
|
2422 |
-
{
|
2423 |
-
form_view_element=document.getElementById('form_id_tempform_view'+t);
|
2424 |
-
n=form_view_element.childNodes.length-2;
|
2425 |
-
|
2426 |
-
for(q=0;q<=n;q++)
|
2427 |
-
{
|
2428 |
-
if(form_view_element.childNodes[q].nodeType!=3)
|
2429 |
-
if(!form_view_element.childNodes[q].id)
|
2430 |
-
{
|
2431 |
-
GLOBAL_tr=form_view_element.childNodes[q];
|
2432 |
-
|
2433 |
-
for (x=0; x < GLOBAL_tr.firstChild.childNodes.length; x++)
|
2434 |
-
{
|
2435 |
-
|
2436 |
-
table=GLOBAL_tr.firstChild.childNodes[x];
|
2437 |
-
tbody=table.firstChild;
|
2438 |
-
for (y=0; y < tbody.childNodes.length; y++)
|
2439 |
-
{
|
2440 |
-
is_in_old=false;
|
2441 |
-
tr=tbody.childNodes[y];
|
2442 |
-
l_id=tr.id;
|
2443 |
-
|
2444 |
-
l_label=document.getElementById( tr.id+'_element_labelform_id_temp').innerHTML;
|
2445 |
-
l_label = l_label.replace(/(\r\n|\n|\r)/gm," ");
|
2446 |
-
l_type=tr.getAttribute('type');
|
2447 |
-
for(z=0; z< l_id_array.length; z++)
|
2448 |
-
{
|
2449 |
-
if(l_id_array[z]==l_id)
|
2450 |
-
{
|
2451 |
-
l_id_removed[z]=false;
|
2452 |
-
if(l_type_array[z]=="type_address")
|
2453 |
-
{
|
2454 |
-
z++;
|
2455 |
-
l_id_removed[z]=false;
|
2456 |
-
z++;
|
2457 |
-
l_id_removed[z]=false;
|
2458 |
-
z++;
|
2459 |
-
l_id_removed[z]=false;
|
2460 |
-
z++;
|
2461 |
-
l_id_removed[z]=false;
|
2462 |
-
z++;
|
2463 |
-
l_id_removed[z]=false;
|
2464 |
-
}
|
2465 |
-
}
|
2466 |
-
}
|
2467 |
-
|
2468 |
-
if(tr.getAttribute('type')=="type_address")
|
2469 |
-
{
|
2470 |
-
addr_id=parseInt(tr.id);
|
2471 |
-
tox=tox+addr_id+'#**id**#'+'Street Line'+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
|
2472 |
-
tox=tox+addr_id+'#**id**#'+'Street Line2'+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
|
2473 |
-
tox=tox+addr_id+'#**id**#'+'City'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
|
2474 |
-
tox=tox+addr_id+'#**id**#'+'State'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
|
2475 |
-
tox=tox+addr_id+'#**id**#'+'Postal'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
|
2476 |
-
tox=tox+addr_id+'#**id**#'+'Country'+'#**label**#'+tr.getAttribute('type')+'#****#';
|
2477 |
-
}
|
2478 |
-
else
|
2479 |
-
tox=tox+l_id+'#**id**#'+l_label+'#**label**#'+l_type+'#****#';
|
2480 |
-
|
2481 |
-
|
2482 |
-
|
2483 |
-
}
|
2484 |
-
}
|
2485 |
-
}
|
2486 |
-
}
|
2487 |
-
}
|
2488 |
-
}
|
2489 |
-
for(x=0; x< l_id_array.length; x++)
|
2490 |
-
{
|
2491 |
-
if(l_id_removed[x])
|
2492 |
-
tox=tox+l_id_array[x]+'#**id**#'+l_label_array[x]+'#**label**#'+l_type_array[x]+'#****#';
|
2493 |
-
}
|
2494 |
-
|
2495 |
-
|
2496 |
-
document.getElementById('label_order').value=tox;
|
2497 |
-
|
2498 |
-
|
2499 |
-
refresh_()
|
2500 |
-
document.getElementById('pagination').value=document.getElementById('pages').getAttribute("type");
|
2501 |
-
document.getElementById('show_title').value=document.getElementById('pages').getAttribute("show_title");
|
2502 |
-
document.getElementById('show_numbers').value=document.getElementById('pages').getAttribute("show_numbers");
|
2503 |
-
|
2504 |
-
|
2505 |
-
submitform( pressbutton );
|
2506 |
-
}
|
2507 |
|
2508 |
-
function remove_whitespace(node)
|
2509 |
-
{
|
2510 |
-
for (ttt=0; ttt < node.childNodes.length; ttt++)
|
2511 |
-
{
|
2512 |
-
if( node.childNodes[ttt].nodeType == '3')
|
2513 |
-
{
|
2514 |
-
if(!node.childNodes[ttt])
|
2515 |
-
node.removeChild(node.childNodes[ttt]);
|
2516 |
-
}
|
2517 |
-
else
|
2518 |
-
{
|
2519 |
-
if(node.childNodes[ttt].childNodes.length)
|
2520 |
-
remove_whitespace(node.childNodes[ttt]);
|
2521 |
-
}
|
2522 |
-
}
|
2523 |
-
return
|
2524 |
}
|
2525 |
|
2526 |
-
function
|
2527 |
-
|
2528 |
-
|
2529 |
-
|
2530 |
-
document.getElementById('counter').value=gen;
|
2531 |
-
n=gen;
|
2532 |
-
for(i=0; i<n; i++)
|
2533 |
-
{
|
2534 |
-
if(document.getElementById(i))
|
2535 |
-
{
|
2536 |
-
for(z=0; z<document.getElementById(i).childNodes.length; z++)
|
2537 |
-
if(document.getElementById(i).childNodes[z].nodeType==3)
|
2538 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
|
2539 |
-
|
2540 |
-
if(document.getElementById(i).getAttribute('type')=="type_captcha" || document.getElementById(i).getAttribute('type')=="type_recaptcha")
|
2541 |
-
{
|
2542 |
-
if(document.getElementById(i).childNodes[10])
|
2543 |
-
{
|
2544 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2545 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2546 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2547 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2548 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2549 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2550 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2551 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2552 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2553 |
-
}
|
2554 |
-
else
|
2555 |
-
{
|
2556 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2557 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2558 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2559 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2560 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2561 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2562 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2563 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2564 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2565 |
-
}
|
2566 |
-
continue;
|
2567 |
-
}
|
2568 |
-
|
2569 |
-
if(document.getElementById(i).getAttribute('type')=="type_section_break")
|
2570 |
-
{
|
2571 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2572 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2573 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2574 |
-
continue;
|
2575 |
-
}
|
2576 |
-
|
2577 |
-
|
2578 |
-
|
2579 |
-
if(document.getElementById(i).childNodes[10])
|
2580 |
-
{
|
2581 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2582 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2583 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2584 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2585 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2586 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2587 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2588 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2589 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2590 |
-
}
|
2591 |
-
else
|
2592 |
-
{
|
2593 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2594 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2595 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2596 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2597 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2598 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2599 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2600 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2601 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2602 |
-
}
|
2603 |
-
}
|
2604 |
-
}
|
2605 |
-
|
2606 |
-
for(i=0; i<=n; i++)
|
2607 |
-
{
|
2608 |
-
if(document.getElementById(i))
|
2609 |
-
{
|
2610 |
-
type=document.getElementById(i).getAttribute("type");
|
2611 |
-
switch(type)
|
2612 |
-
{
|
2613 |
-
case "type_text":
|
2614 |
-
case "type_number":
|
2615 |
-
case "type_password":
|
2616 |
-
case "type_submitter_mail":
|
2617 |
-
case "type_own_select":
|
2618 |
-
case "type_country":
|
2619 |
-
case "type_hidden":
|
2620 |
-
case "type_map":
|
2621 |
-
{
|
2622 |
-
remove_add_(i+"_elementform_id_temp");
|
2623 |
-
break;
|
2624 |
-
}
|
2625 |
-
|
2626 |
-
case "type_submit_reset":
|
2627 |
-
{
|
2628 |
-
remove_add_(i+"_element_submitform_id_temp");
|
2629 |
-
if(document.getElementById(i+"_element_resetform_id_temp"))
|
2630 |
-
remove_add_(i+"_element_resetform_id_temp");
|
2631 |
-
break;
|
2632 |
-
}
|
2633 |
-
|
2634 |
-
case "type_captcha":
|
2635 |
-
{
|
2636 |
-
remove_add_("_wd_captchaform_id_temp");
|
2637 |
-
remove_add_("_element_refreshform_id_temp");
|
2638 |
-
remove_add_("_wd_captcha_inputform_id_temp");
|
2639 |
-
break;
|
2640 |
-
}
|
2641 |
-
|
2642 |
-
case "type_recaptcha":
|
2643 |
-
{
|
2644 |
-
document.getElementById("public_key").value = document.getElementById("wd_recaptchaform_id_temp").getAttribute("public_key");
|
2645 |
-
document.getElementById("private_key").value= document.getElementById("wd_recaptchaform_id_temp").getAttribute("private_key");
|
2646 |
-
document.getElementById("recaptcha_theme").value= document.getElementById("wd_recaptchaform_id_temp").getAttribute("theme");
|
2647 |
-
document.getElementById('wd_recaptchaform_id_temp').innerHTML='';
|
2648 |
-
remove_add_("wd_recaptchaform_id_temp");
|
2649 |
-
break;
|
2650 |
-
}
|
2651 |
-
|
2652 |
-
case "type_file_upload":
|
2653 |
-
{
|
2654 |
-
remove_add_(i+"_elementform_id_temp");
|
2655 |
-
|
2656 |
-
break;
|
2657 |
-
}
|
2658 |
-
|
2659 |
-
case "type_textarea":
|
2660 |
-
{
|
2661 |
-
remove_add_(i+"_elementform_id_temp");
|
2662 |
-
|
2663 |
-
break;
|
2664 |
-
}
|
2665 |
-
|
2666 |
-
case "type_name":
|
2667 |
-
{
|
2668 |
-
|
2669 |
-
if(document.getElementById(i+"_element_titleform_id_temp"))
|
2670 |
-
{
|
2671 |
-
remove_add_(i+"_element_titleform_id_temp");
|
2672 |
-
remove_add_(i+"_element_firstform_id_temp");
|
2673 |
-
remove_add_(i+"_element_lastform_id_temp");
|
2674 |
-
remove_add_(i+"_element_middleform_id_temp");
|
2675 |
-
}
|
2676 |
-
else
|
2677 |
-
{
|
2678 |
-
remove_add_(i+"_element_firstform_id_temp");
|
2679 |
-
remove_add_(i+"_element_lastform_id_temp");
|
2680 |
-
}
|
2681 |
-
break;
|
2682 |
-
|
2683 |
-
}
|
2684 |
-
|
2685 |
-
case "type_phone":
|
2686 |
-
{
|
2687 |
-
|
2688 |
-
remove_add_(i+"_element_firstform_id_temp");
|
2689 |
-
remove_add_(i+"_element_lastform_id_temp");
|
2690 |
-
break;
|
2691 |
-
|
2692 |
-
}
|
2693 |
-
case "type_address":
|
2694 |
-
{
|
2695 |
-
remove_add_(i+"_street1form_id_temp");
|
2696 |
-
remove_add_(i+"_street2form_id_temp");
|
2697 |
-
remove_add_(i+"_cityform_id_temp");
|
2698 |
-
remove_add_(i+"_stateform_id_temp");
|
2699 |
-
remove_add_(i+"_postalform_id_temp");
|
2700 |
-
remove_add_(i+"_countryform_id_temp");
|
2701 |
-
|
2702 |
-
break;
|
2703 |
-
|
2704 |
-
}
|
2705 |
-
|
2706 |
-
|
2707 |
-
case "type_checkbox":
|
2708 |
-
case "type_radio":
|
2709 |
-
{
|
2710 |
-
is=true;
|
2711 |
-
for(j=0; j<100; j++)
|
2712 |
-
if(document.getElementById(i+"_elementform_id_temp"+j))
|
2713 |
-
{
|
2714 |
-
remove_add_(i+"_elementform_id_temp"+j);
|
2715 |
-
}
|
2716 |
-
|
2717 |
-
/*if(document.getElementById(i+"_randomize").value=="yes")
|
2718 |
-
choises_randomize(i);*/
|
2719 |
-
|
2720 |
-
break;
|
2721 |
-
}
|
2722 |
-
|
2723 |
-
case "type_button":
|
2724 |
-
{
|
2725 |
-
for(j=0; j<100; j++)
|
2726 |
-
if(document.getElementById(i+"_elementform_id_temp"+j))
|
2727 |
-
{
|
2728 |
-
remove_add_(i+"_elementform_id_temp"+j);
|
2729 |
-
}
|
2730 |
-
break;
|
2731 |
-
}
|
2732 |
-
|
2733 |
-
case "type_time":
|
2734 |
-
{
|
2735 |
-
if(document.getElementById(i+"_ssform_id_temp"))
|
2736 |
-
{
|
2737 |
-
remove_add_(i+"_ssform_id_temp");
|
2738 |
-
remove_add_(i+"_mmform_id_temp");
|
2739 |
-
remove_add_(i+"_hhform_id_temp");
|
2740 |
-
}
|
2741 |
-
else
|
2742 |
-
{
|
2743 |
-
remove_add_(i+"_mmform_id_temp");
|
2744 |
-
remove_add_(i+"_hhform_id_temp");
|
2745 |
-
|
2746 |
-
}
|
2747 |
-
break;
|
2748 |
-
|
2749 |
-
}
|
2750 |
-
|
2751 |
-
case "type_date":
|
2752 |
-
{
|
2753 |
-
remove_add_(i+"_elementform_id_temp");
|
2754 |
-
remove_add_(i+"_buttonform_id_temp");
|
2755 |
-
|
2756 |
-
break;
|
2757 |
-
}
|
2758 |
-
case "type_date_fields":
|
2759 |
-
{
|
2760 |
-
remove_add_(i+"_dayform_id_temp");
|
2761 |
-
remove_add_(i+"_monthform_id_temp");
|
2762 |
-
remove_add_(i+"_yearform_id_temp");
|
2763 |
-
break;
|
2764 |
-
}
|
2765 |
-
}
|
2766 |
-
}
|
2767 |
-
}
|
2768 |
-
|
2769 |
-
for(i=1; i<=form_view_max; i++)
|
2770 |
-
{
|
2771 |
-
if(document.getElementById('form_id_tempform_view'+i))
|
2772 |
-
{
|
2773 |
-
if(document.getElementById('page_next_'+i))
|
2774 |
-
document.getElementById('page_next_'+i).removeAttribute('src');
|
2775 |
-
if(document.getElementById('page_previous_'+i))
|
2776 |
-
document.getElementById('page_previous_'+i).removeAttribute('src');
|
2777 |
-
|
2778 |
-
document.getElementById('form_id_tempform_view'+i).parentNode.removeChild(document.getElementById('form_id_tempform_view_img'+i));
|
2779 |
-
document.getElementById('form_id_tempform_view'+i).removeAttribute('style');
|
2780 |
-
}
|
2781 |
-
}
|
2782 |
-
|
2783 |
-
|
2784 |
-
document.getElementById('form_front').value=document.getElementById('take').innerHTML;
|
2785 |
-
|
2786 |
}
|
2787 |
|
2788 |
-
|
2789 |
-
{
|
2790 |
-
|
2791 |
-
|
2792 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2793 |
}
|
2794 |
|
2795 |
-
|
2796 |
-
|
2797 |
-
|
2798 |
-
|
2799 |
-
|
2800 |
-
|
2801 |
-
|
2802 |
-
|
2803 |
-
|
2804 |
-
|
2805 |
-
|
2806 |
-
|
2807 |
-
|
2808 |
-
|
2809 |
-
|
2810 |
-
|
2811 |
-
|
2812 |
-
|
2813 |
-
|
2814 |
-
|
2815 |
-
|
2816 |
-
|
2817 |
-
|
2818 |
-
|
2819 |
-
|
2820 |
-
|
2821 |
-
|
2822 |
-
function enable2()
|
2823 |
-
{
|
2824 |
-
alltypes=Array('customHTML','text','checkbox','radio','time_and_date','select','file_upload','captcha','map','button','page_break','section_break');
|
2825 |
-
for(x=0; x<12;x++)
|
2826 |
-
{
|
2827 |
-
document.getElementById('img_'+alltypes[x]).src="<?php echo plugins_url("images/",__FILE__) ?>"+alltypes[x]+".png";
|
2828 |
-
}
|
2829 |
-
|
2830 |
-
|
2831 |
-
document.getElementById('formMakerDiv').style.display =(document.getElementById('formMakerDiv').style.display=='block'?'none':'block');
|
2832 |
-
document.getElementById('formMakerDiv1').style.display =(document.getElementById('formMakerDiv1').style.display=='block'?'none':'block');
|
2833 |
-
if(document.getElementById('formMakerDiv').offsetWidth)
|
2834 |
-
document.getElementById('formMakerDiv1').style.width =(document.getElementById('formMakerDiv').offsetWidth - 60)+'px';
|
2835 |
-
document.getElementById('when_edit').style.display ='block';
|
2836 |
-
if(document.getElementById('field_types').offsetWidth)
|
2837 |
-
document.getElementById('when_edit').style.width =document.getElementById('field_types').offsetWidth+'px';
|
2838 |
-
|
2839 |
-
if(document.getElementById('field_types').offsetHeight)
|
2840 |
-
document.getElementById('when_edit').style.height =document.getElementById('field_types').offsetHeight+'px';
|
2841 |
-
|
2842 |
-
//document.getElementById('when_edit').style.position='none';
|
2843 |
-
|
2844 |
-
}
|
2845 |
-
|
2846 |
-
var thickDims, tbWidth, tbHeight;
|
2847 |
-
jQuery(document).ready(function($) {
|
2848 |
-
|
2849 |
-
thickDims = function() {
|
2850 |
-
var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
|
2851 |
-
|
2852 |
-
w = (tbWidth && tbWidth < W - 90) ? tbWidth : W - 40;
|
2853 |
-
h = (tbHeight && tbHeight < H - 60) ? tbHeight : H - 40;
|
2854 |
-
|
2855 |
-
if ( tbWindow.size() ) {
|
2856 |
-
tbWindow.width(w).height(h);
|
2857 |
-
$('#TB_iframeContent').width(w).height(h - 27);
|
2858 |
-
tbWindow.css({'margin-left': '-' + parseInt((w / 2),10) + 'px'});
|
2859 |
-
if ( typeof document.body.style.maxWidth != 'undefined' )
|
2860 |
-
tbWindow.css({'top':(H-h)/2,'margin-top':'0'});
|
2861 |
-
}
|
2862 |
-
};
|
2863 |
-
|
2864 |
-
thickDims();
|
2865 |
-
$(window).resize( function() { thickDims() } );
|
2866 |
|
2867 |
-
|
2868 |
-
|
2869 |
|
2870 |
-
|
|
|
2871 |
|
2872 |
-
|
2873 |
-
|
2874 |
-
else
|
2875 |
-
tbWidth = $(window).width() - 120;
|
2876 |
|
2877 |
-
|
2878 |
-
|
2879 |
-
|
2880 |
-
|
2881 |
-
|
2882 |
-
|
2883 |
-
|
2884 |
-
|
2885 |
-
|
2886 |
-
|
2887 |
-
|
2888 |
-
|
2889 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2890 |
|
2891 |
-
|
2892 |
-
|
2893 |
-
|
2894 |
|
2895 |
-
|
2896 |
-
|
2897 |
|
2898 |
-
|
2899 |
-
|
2900 |
|
2901 |
-
|
2902 |
-
|
2903 |
-
|
2904 |
-
|
2905 |
-
|
2906 |
|
2907 |
});
|
2908 |
|
2909 |
-
|
2910 |
<style>
|
2911 |
-
.calendar .button
|
2912 |
-
|
2913 |
-
|
2914 |
-
|
2915 |
-
|
2916 |
-
|
2917 |
-
|
2918 |
-
|
2919 |
-
|
2920 |
-
|
2921 |
-
|
2922 |
-
|
2923 |
-
|
2924 |
-
|
2925 |
-
|
2926 |
-
|
2927 |
-
|
2928 |
-
|
2929 |
-
|
2930 |
-
|
2931 |
-
|
2932 |
-
|
2933 |
-
|
2934 |
-
|
2935 |
-
|
2936 |
-
|
2937 |
-
|
2938 |
-
|
2939 |
-
|
2940 |
-
|
2941 |
-
|
2942 |
-
|
2943 |
-
|
2944 |
-
|
2945 |
-
|
2946 |
-
|
2947 |
-
|
2948 |
-
|
2949 |
-
|
2950 |
-
|
2951 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2952 |
</style>
|
2953 |
-
|
2954 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
2955 |
<tr>
|
2956 |
-
|
2957 |
-
|
2958 |
-
|
2959 |
-
|
2960 |
-
|
2961 |
-
|
2962 |
-
|
2963 |
-
|
|
|
|
|
|
|
|
|
2964 |
<tr>
|
2965 |
-
|
2966 |
-
|
2967 |
-
|
2968 |
-
|
2969 |
-
|
2970 |
-
|
2971 |
-
|
2972 |
-
|
2973 |
-
|
2974 |
-
|
|
|
|
|
|
|
|
|
2975 |
</tr>
|
2976 |
-
|
2977 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2978 |
|
2979 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2980 |
|
2981 |
-
|
2982 |
-
<
|
2983 |
-
<
|
|
|
2984 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2985 |
|
2986 |
-
|
2987 |
-
|
2988 |
-
|
2989 |
|
2990 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
2991 |
|
2992 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2993 |
|
2994 |
-
|
|
|
|
|
2995 |
|
2996 |
-
|
|
|
|
|
2997 |
|
2998 |
-
<div style="background-image:url(<?php echo plugins_url("images/input.png",__FILE__) ?>);">
|
2999 |
|
3000 |
-
<input id="title" name="title" <?php echo 'value="'.htmlspecialchars($row->title).'"' ?> style="background:none; padding:inherit; width:151px; height:17px; border:none; font-size:11px" />
|
3001 |
|
3002 |
-
|
|
|
3003 |
|
3004 |
-
|
3005 |
-
|
3006 |
-
</tr><tr>
|
3007 |
|
3008 |
-
|
3009 |
|
3010 |
-
<
|
3011 |
|
3012 |
-
|
3013 |
|
3014 |
-
|
|
|
|
|
3015 |
|
3016 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3017 |
|
3018 |
-
|
|
|
|
|
3019 |
|
3020 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3021 |
|
3022 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3023 |
|
3024 |
-
|
3025 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
3026 |
|
3027 |
-
|
3028 |
|
3029 |
-
|
|
|
|
|
|
|
3030 |
|
3031 |
-
|
|
|
3032 |
|
3033 |
-
|
3034 |
|
3035 |
-
<div style="height:19px">
|
3036 |
-
|
3037 |
-
<select id="theme" name="theme" style="background:transparent; width:151px; height:19px; border:none; font-size:11px" onChange="set_preview()" >
|
3038 |
-
|
3039 |
-
<?php
|
3040 |
-
$form_theme='';
|
3041 |
-
foreach($themes as $theme)
|
3042 |
-
{
|
3043 |
-
if($theme->id==$row->theme)
|
3044 |
-
{
|
3045 |
-
echo '<option value="'.$theme->id.'" selected>'.$theme->title.'</option>';
|
3046 |
-
$form_theme=$theme->css;
|
3047 |
-
}
|
3048 |
-
else
|
3049 |
-
echo '<option value="'.$theme->id.'">'.$theme->title.'</option>';
|
3050 |
-
}
|
3051 |
-
?>
|
3052 |
-
</select>
|
3053 |
|
3054 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3055 |
|
3056 |
-
|
|
|
|
|
|
|
3057 |
|
3058 |
-
|
3059 |
|
|
|
3060 |
|
3061 |
|
3062 |
-
|
3063 |
-
<td align="left" colspan="3">
|
3064 |
-
|
3065 |
-
<img src="<?php echo plugins_url("images/addanewfield.png",__FILE__) ?>" onclick="enable(); Enable()" style="cursor:pointer;margin:10px;" />
|
3066 |
|
3067 |
-
|
3068 |
-
</tr>
|
3069 |
-
</table>
|
3070 |
|
3071 |
-
<
|
3072 |
-
<div id="formMakerDiv1" style="padding-top:20px" align="center">
|
3073 |
-
|
3074 |
-
|
3075 |
-
<table border="0" width="100%" cellpadding="0" cellspacing="0" height="100%" style="border:6px #00aeef solid; background-color:#FFF">
|
3076 |
-
<tr>
|
3077 |
-
<td style="padding:0px">
|
3078 |
-
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
|
3079 |
-
<tr valign="top">
|
3080 |
-
<td width="15%" height="100%" style="border-right:dotted black 1px;" id="field_types">
|
3081 |
-
<div id="when_edit" style="display:none"></div>
|
3082 |
-
<table border="0" cellpadding="0" cellspacing="3" width="100%">
|
3083 |
-
<tr>
|
3084 |
-
<td align="center" onClick="addRow('customHTML')" style="cursor:pointer" id="table_editor" class="field_buttons"><img src="<?php echo plugins_url("images/customHTML.png",__FILE__) ?>" style="margin:5px" id="img_customHTML"/></td>
|
3085 |
-
|
3086 |
-
<td align="center" onClick="addRow('text')" style="cursor:pointer" id="table_text" class="field_buttons"><img src="<?php echo plugins_url("images/text.png",__FILE__) ?>" style="margin:5px" id="img_text"/></td>
|
3087 |
-
</tr>
|
3088 |
-
<tr>
|
3089 |
-
<td align="center" onClick="addRow('time_and_date')" style="cursor:pointer" id="table_time_and_date" class="field_buttons"><img src="<?php echo plugins_url("images/time_and_date.png",__FILE__) ?>" style="margin:5px" id="img_time_and_date"/></td>
|
3090 |
-
|
3091 |
-
<td align="center" onClick="addRow('select')" style="cursor:pointer" id="table_select" class="field_buttons"><img src="<?php echo plugins_url("images/select.png",__FILE__) ?>" style="margin:5px" id="img_select"/></td>
|
3092 |
-
</tr>
|
3093 |
-
<tr>
|
3094 |
-
<td align="center" onClick="addRow('checkbox')" style="cursor:pointer" id="table_checkbox" class="field_buttons"><img src="<?php echo plugins_url("images/checkbox.png",__FILE__) ?>" style="margin:5px" id="img_checkbox"/></td>
|
3095 |
-
|
3096 |
-
<td align="center" onClick="addRow('radio')" style="cursor:pointer" id="table_radio" class="field_buttons"><img src="<?php echo plugins_url("images/radio.png",__FILE__) ?>" style="margin:5px" id="img_radio"/></td>
|
3097 |
-
</tr>
|
3098 |
-
<tr>
|
3099 |
-
<td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="background-color: rgb(114, 113, 113) !important; cursor:pointer" id="table_file_upload" class="field_buttons"><img src="<?php echo plugins_url("images/file_upload.png",__FILE__) ?>" style="margin:5px" id="img_file_upload"/></td>
|
3100 |
-
|
3101 |
-
<td align="center" onClick="addRow('captcha')" style="cursor:pointer" id="table_captcha" class="field_buttons"><img src="<?php echo plugins_url("images/captcha.png",__FILE__) ?>" style="margin:5px" id="img_captcha"/></td>
|
3102 |
-
</tr>
|
3103 |
-
<tr>
|
3104 |
-
<td align="center" onClick="addRow('page_break')" style="cursor:pointer" id="table_page_break" class="field_buttons"><img src="<?php echo plugins_url("images/page_break.png",__FILE__) ?>" style="margin:5px" id="img_page_break"/></td>
|
3105 |
-
|
3106 |
-
<td align="center" onClick="addRow('section_break')" style="cursor:pointer" id="table_section_break" class="field_buttons"><img src="<?php echo plugins_url("images/section_break.png",__FILE__) ?>" style="margin:5px" id="img_section_break"/></td>
|
3107 |
-
</tr>
|
3108 |
-
<tr>
|
3109 |
-
<td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="background-color: rgb(114, 113, 113) !important; cursor:pointer" id="table_map" class="field_buttons"><img src="<?php echo plugins_url("images/map.png",__FILE__) ?>" style="margin:5px" id="img_map"/></td>
|
3110 |
-
|
3111 |
-
<td align="center" onClick="addRow('button')" style="cursor:pointer" id="table_button" class="field_buttons"><img src="<?php echo plugins_url("images/button.png",__FILE__) ?>" style="margin:5px" id="img_button"/></td>
|
3112 |
-
</tr>
|
3113 |
-
</table>
|
3114 |
-
|
3115 |
-
</td>
|
3116 |
-
<td width="35%" height="100%" align="left"><div id="edit_table" style="padding:0px; overflow-y:scroll; height:531px" ></div></td>
|
3117 |
-
|
3118 |
-
<td align="center" valign="top" style="background:url(<?php echo plugins_url("images/border2.png",__FILE__) ?>) repeat-y;"> </td>
|
3119 |
-
<td style="padding:15px">
|
3120 |
-
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
|
3121 |
-
|
3122 |
-
<tr>
|
3123 |
-
<td align="right"><input type="radio" value="end" name="el_pos" checked="checked" id="pos_end" onclick="Disable()"/>
|
3124 |
-
At The End
|
3125 |
-
<input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
|
3126 |
-
At The Beginning
|
3127 |
-
<input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
|
3128 |
-
Before
|
3129 |
-
<select style="width:100px; margin-left:5px" id="sel_el_pos" disabled="disabled">
|
3130 |
-
</select>
|
3131 |
-
<img alt="ADD" title="add" style="cursor:pointer; vertical-align:middle; margin:5px" src="<?php echo plugins_url("images/save.png",__FILE__) ?>" onClick="add(0)"/>
|
3132 |
-
<img alt="CANCEL" title="cancel" style=" cursor:pointer; vertical-align:middle; margin:5px" src="<?php echo plugins_url("images/cancel_but.png",__FILE__) ?>" onClick="close_window()"/>
|
3133 |
-
|
3134 |
-
<hr style=" margin-bottom:10px" />
|
3135 |
-
</td>
|
3136 |
-
</tr>
|
3137 |
-
|
3138 |
-
<tr height="100%" valign="top">
|
3139 |
-
<td id="show_table"></td>
|
3140 |
-
</tr>
|
3141 |
-
|
3142 |
-
</table>
|
3143 |
-
</td>
|
3144 |
-
</tr>
|
3145 |
-
</table>
|
3146 |
-
</td>
|
3147 |
-
</tr>
|
3148 |
-
</table>
|
3149 |
-
|
3150 |
-
<input type="hidden" id="old" />
|
3151 |
-
<input type="hidden" id="old_selected" />
|
3152 |
-
<input type="hidden" id="element_type" />
|
3153 |
-
<input type="hidden" id="editing_id" />
|
3154 |
-
<input type="hidden" value="<?php echo plugins_url("",__FILE__) ?>" id="form_plugins_url" />
|
3155 |
-
<div id="main_editor" style="position:absolute; display:none; z-index:140;"><?php if(function_exists ('the_editor') || function_exists ('wp_editor')){
|
3156 |
-
if(get_bloginfo('version')<'3.3'){
|
3157 |
-
?>
|
3158 |
-
<div style=" max-width:500px; height:300px;text-align:left" id="poststuff">
|
3159 |
-
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea"><?php the_editor("","form_maker_editor","title",$media_buttons = true, $tab_index = 1, $extended = true ); ?>
|
3160 |
-
</div>
|
3161 |
-
</div>
|
3162 |
-
<?php
|
3163 |
-
|
3164 |
-
}
|
3165 |
-
else
|
3166 |
-
{
|
3167 |
-
echo "<style>#wp-form_maker_editor-media-buttons{ text-align:left }</style>"; wp_editor("","form_maker_editor");
|
3168 |
-
}
|
3169 |
-
}
|
3170 |
-
else
|
3171 |
-
{
|
3172 |
-
?>
|
3173 |
-
<textarea name="form_maker_editor" id="form_maker_editor" cols="40" rows="6" style="width: 440px; height: 350px; " class="mce_editable" aria-hidden="true"></textarea>
|
3174 |
-
<?php
|
3175 |
-
|
3176 |
-
}
|
3177 |
-
?></div>
|
3178 |
-
</div>
|
3179 |
-
|
3180 |
-
<?php if(!function_exists ('the_editor'))
|
3181 |
-
{
|
3182 |
-
?>
|
3183 |
-
<iframe id="tinymce" style="display:none"></iframe>
|
3184 |
-
|
3185 |
-
<?php
|
3186 |
-
}
|
3187 |
-
?>
|
3188 |
-
|
3189 |
-
|
3190 |
-
|
3191 |
-
<br />
|
3192 |
-
<br />
|
3193 |
-
|
3194 |
-
<fieldset>
|
3195 |
-
|
3196 |
-
<legend>
|
3197 |
-
|
3198 |
-
<h2 style="color:#00aeef">Form</h2>
|
3199 |
-
|
3200 |
-
</legend>
|
3201 |
-
|
3202 |
-
<?php
|
3203 |
-
global $first_css;
|
3204 |
-
echo '<style>'.$first_css.'</style>';
|
3205 |
-
|
3206 |
-
?><table width="100%" style="margin:8px"><tr id="page_navigation"><td align="center" width="90%" id="pages" show_title="<?php echo $row->show_title; ?>" show_numbers="<?php echo $row->show_numbers; ?>" type="<?php echo $row->pagination; ?>"></td><td align="left" id="edit_page_navigation"></td></tr></table><div id="take"><?php
|
3207 |
-
|
3208 |
-
if($row->form)
|
3209 |
-
|
3210 |
-
echo $row->form;
|
3211 |
-
|
3212 |
-
else
|
3213 |
-
|
3214 |
-
echo '<table border="0" cellpadding="4" cellspacing="0" class="wdform_table1" width="100%" style="border-top:0px solid black;"><tbody id="form_view1" style="float:left;" page_title="Untitled page" next_title="Next" next_type="button" next_class="" next_checkable="true" previous_title="Previous" previous_type="button" previous_class="" previous_checkable="true"><tr><td valign="top"><table class="wdform_table2"><tbody></tbody></table></td></tr><tr><td colspan="100" valign="top"><table width="100%" style="padding-right:170px"><tbody><tr id="page_nav1"></tr></tbody></table></td></tr><tbody id="form_view_img1" style="float:right ;display:none" ><tr><td width="0%"></td><td align="right"><img src="'.plugins_url("images/minus.png",__FILE__).'" title="Show or hide the page" class="page_toolbar" onclick="show_or_hide("1")" id="show_page_img_1" /></td><td><img src="'.plugins_url("images/page_delete.png",__FILE__).'" title="Delete the page" class="page_toolbar" onclick="remove_page("1")" /></td><td><img src="'.plugins_url("images/page_delete_all.png",__FILE__).'" title="Delete the page with fields" class="page_toolbar" onclick="remove_page_all("1")" /></td><td><img src="'.plugins_url("images/page_edit.png",__FILE__).'" title="Edit the page" class="page_toolbar" onclick="edit_page_break("1")" /></td></tr></tbody></table>';
|
3215 |
-
?></div>
|
3216 |
-
|
3217 |
-
</fieldset>
|
3218 |
|
3219 |
-
|
3220 |
-
<input type="hidden" name="form_front" id="form_front">
|
3221 |
-
|
3222 |
-
<input type="hidden" name="pagination" id="pagination" />
|
3223 |
-
<input type="hidden" name="show_title" id="show_title" />
|
3224 |
-
<input type="hidden" name="show_numbers" id="show_numbers" />
|
3225 |
|
3226 |
-
|
3227 |
-
|
3228 |
-
<input type="hidden" name="recaptcha_theme" id="recaptcha_theme" />
|
3229 |
-
|
3230 |
-
<input type="hidden" id="label_order" name="label_order" value="<?php echo $row->label_order;?>" />
|
3231 |
-
<input type="hidden" name="counter" id="counter" value="<?php echo $row->counter;?>">
|
3232 |
-
|
3233 |
-
<script type="text/javascript">
|
3234 |
-
|
3235 |
-
function formOnload()
|
3236 |
-
{
|
3237 |
-
//enable maps
|
3238 |
-
for(t=0; t<<?php echo $row->counter;?>; t++)
|
3239 |
-
if(document.getElementById(t+"_typeform_id_temp"))
|
3240 |
-
{
|
3241 |
-
if(document.getElementById(t+"_typeform_id_temp").value=="type_map" || document.getElementById(t+"_typeform_id_temp").value=="type_mark_map")
|
3242 |
-
{
|
3243 |
-
if_gmap_init(t);
|
3244 |
-
for(q=0; q<20; q++)
|
3245 |
-
if(document.getElementById(t+"_elementform_id_temp").getAttribute("long"+q))
|
3246 |
-
{
|
3247 |
-
|
3248 |
-
w_long=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("long"+q));
|
3249 |
-
w_lat=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("lat"+q));
|
3250 |
-
w_info=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("info"+q));
|
3251 |
-
add_marker_on_map(t,q, w_long, w_lat, w_info, false);
|
3252 |
-
}
|
3253 |
-
}
|
3254 |
-
else
|
3255 |
-
if(document.getElementById(t+"_typeform_id_temp").value=="type_date")
|
3256 |
-
Calendar.setup({
|
3257 |
-
inputField: t+"_elementform_id_temp",
|
3258 |
-
ifFormat: document.getElementById(t+"_buttonform_id_temp").getAttribute('format'),
|
3259 |
-
button: t+"_buttonform_id_temp",
|
3260 |
-
align: "Tl",
|
3261 |
-
singleClick: true,
|
3262 |
-
firstDay: 0
|
3263 |
-
});
|
3264 |
-
|
3265 |
-
}
|
3266 |
-
|
3267 |
-
|
3268 |
-
form_view=1;
|
3269 |
-
form_view_count=0;
|
3270 |
-
for(i=1; i<=30; i++)
|
3271 |
-
{
|
3272 |
-
if(document.getElementById('form_id_tempform_view'+i))
|
3273 |
-
{
|
3274 |
-
form_view_count++;
|
3275 |
-
form_view_max=i;
|
3276 |
-
}
|
3277 |
-
}
|
3278 |
-
|
3279 |
-
if(form_view_count>1)
|
3280 |
-
{
|
3281 |
-
for(i=1; i<=form_view_max; i++)
|
3282 |
-
{
|
3283 |
-
if(document.getElementById('form_id_tempform_view'+i))
|
3284 |
-
{
|
3285 |
-
first_form_view=i;
|
3286 |
-
break;
|
3287 |
-
}
|
3288 |
-
}
|
3289 |
-
form_view=form_view_max;
|
3290 |
-
|
3291 |
-
generate_page_nav(first_form_view);
|
3292 |
-
|
3293 |
-
var img_EDIT = document.createElement("img");
|
3294 |
-
img_EDIT.setAttribute("src", "<?php echo plugins_url('',__FILE__) ?>/images/edit.png");
|
3295 |
-
img_EDIT.style.cssText = "margin-left:40px; cursor:pointer";
|
3296 |
-
img_EDIT.setAttribute("onclick", 'el_page_navigation()');
|
3297 |
-
|
3298 |
-
var td_EDIT = document.getElementById("edit_page_navigation");
|
3299 |
-
td_EDIT.appendChild(img_EDIT);
|
3300 |
-
|
3301 |
-
document.getElementById('page_navigation').appendChild(td_EDIT);
|
3302 |
-
|
3303 |
-
|
3304 |
-
}
|
3305 |
-
|
3306 |
-
|
3307 |
-
//if(document.getElementById('take').innerHTML.indexOf('up_row(')==-1) location.reload(true);
|
3308 |
-
//else
|
3309 |
-
document.getElementById('form').value=document.getElementById('take').innerHTML;
|
3310 |
-
document.getElementById('araqel').value=1;
|
3311 |
-
|
3312 |
-
}
|
3313 |
-
|
3314 |
-
function formAddToOnload()
|
3315 |
-
{
|
3316 |
-
if(formOldFunctionOnLoad){ formOldFunctionOnLoad(); }
|
3317 |
-
formOnload();
|
3318 |
-
}
|
3319 |
-
|
3320 |
-
function formLoadBody()
|
3321 |
-
{
|
3322 |
-
formOldFunctionOnLoad = window.onload;
|
3323 |
-
window.onload = formAddToOnload;
|
3324 |
-
}
|
3325 |
-
|
3326 |
-
var formOldFunctionOnLoad = null;
|
3327 |
-
|
3328 |
-
formLoadBody();
|
3329 |
-
|
3330 |
-
|
3331 |
-
</script>
|
3332 |
-
|
3333 |
-
<input type="hidden" name="option" value="com_formmaker" />
|
3334 |
-
|
3335 |
-
<input type="hidden" name="id" value="<?php echo $row->id?>" />
|
3336 |
-
|
3337 |
-
<input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
|
3338 |
-
|
3339 |
-
<input type="hidden" name="task" value="" />
|
3340 |
-
<input type="hidden" id="araqel" value="0" />
|
3341 |
|
3342 |
</form>
|
3343 |
|
3344 |
<script>
|
3345 |
-
|
3346 |
-
|
3347 |
-
|
3348 |
-
// document.getElementById('toolbar-popup-popup').childNodes[1].href='index.php?option=com_formmaker&task=preview&tmpl=component&theme='+document.getElementById('theme').value;
|
3349 |
-
// document.getElementById('toolbar-popup-popup').childNodes[1].setAttribute('rel',"{handler: 'iframe', size: {x:"+(appWidth-100)+", y: "+(appHeight-30)+"}}");
|
3350 |
</script>
|
3351 |
<?php
|
3352 |
-
|
3353 |
-
|
3354 |
-
|
3355 |
-
|
3356 |
-
|
3357 |
-
|
3358 |
-
|
3359 |
}
|
3360 |
|
3361 |
-
|
3362 |
-
|
3363 |
-
|
3364 |
-
|
3365 |
-
|
3366 |
-
|
3367 |
-
|
3368 |
-
|
3369 |
-
|
3370 |
-
|
3371 |
-
|
3372 |
-
|
3373 |
-
|
3374 |
-
|
3375 |
-
|
3376 |
-
|
3377 |
-
|
3378 |
-
|
3379 |
-
|
3380 |
-
|
3381 |
-
|
3382 |
-
|
3383 |
-
|
3384 |
-
|
3385 |
-
|
3386 |
-
|
3387 |
-
|
3388 |
-
|
3389 |
-
{
|
3390 |
-
|
3391 |
-
|
3392 |
-
|
3393 |
-
|
3394 |
-
{
|
3395 |
-
|
3396 |
-
|
3397 |
-
|
3398 |
-
|
3399 |
-
|
3400 |
-
|
3401 |
-
|
3402 |
-
|
3403 |
-
|
3404 |
-
|
3405 |
-
|
3406 |
-
|
3407 |
-
|
3408 |
-
|
3409 |
-
|
3410 |
-
|
3411 |
-
|
3412 |
-
|
3413 |
-
|
3414 |
-
|
3415 |
-
|
3416 |
-
|
3417 |
-
|
3418 |
-
|
3419 |
-
|
3420 |
-
|
3421 |
-
|
3422 |
-
|
3423 |
-
|
3424 |
-
|
3425 |
-
|
3426 |
-
|
3427 |
-
|
3428 |
-
|
3429 |
-
|
3430 |
-
|
3431 |
-
|
3432 |
-
|
3433 |
-
|
3434 |
-
|
3435 |
-
|
3436 |
-
|
3437 |
-
|
3438 |
-
|
3439 |
-
|
3440 |
-
|
3441 |
-
|
3442 |
-
|
3443 |
-
|
3444 |
-
|
3445 |
-
|
3446 |
-
|
3447 |
-
|
3448 |
-
|
3449 |
-
|
3450 |
-
|
3451 |
-
|
3452 |
-
|
3453 |
-
|
3454 |
-
|
3455 |
-
|
3456 |
-
|
3457 |
-
|
3458 |
-
|
3459 |
-
|
3460 |
-
|
3461 |
-
|
3462 |
-
|
3463 |
-
|
3464 |
-
|
3465 |
-
|
3466 |
-
|
3467 |
-
|
3468 |
-
|
3469 |
-
|
3470 |
-
|
3471 |
-
|
3472 |
-
|
3473 |
-
|
3474 |
-
|
3475 |
-
|
3476 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3477 |
<tr valign="top">
|
3478 |
-
|
3479 |
-
|
3480 |
-
|
3481 |
-
|
3482 |
-
|
3483 |
-
|
3484 |
-
<input type="radio" name="submit_text_type" onclick="set_type('page')"
|
3485 |
-
|
3486 |
-
|
3487 |
-
|
3488 |
</tr>
|
3489 |
-
<tr id="none" <?php if($row->submit_text_type==2 or $row->submit_text_type==3 or $row->submit_text_type==4 ) echo 'style="display:none"' ?> >
|
3490 |
-
|
3491 |
-
|
3492 |
-
|
3493 |
-
|
3494 |
-
|
3495 |
-
|
3496 |
-
</tr>
|
3497 |
-
<tr id="post" <?php if($row->submit_text_type!=2) echo 'style="display:none"' ?> >
|
3498 |
-
<td class="key">
|
3499 |
-
<label for="submissioni text"> Post </label>
|
3500 |
-
</td>
|
3501 |
-
<td >
|
3502 |
-
<select name="post_name" style="width:153px; font-size:11px;">
|
3503 |
-
<option value="0">- Select Post -</option>
|
3504 |
-
<?php
|
3505 |
-
|
3506 |
-
$args = array(
|
3507 |
-
'posts_per_page' => 10000);
|
3508 |
-
query_posts($args );
|
3509 |
-
|
3510 |
-
// The Loop
|
3511 |
-
while ( have_posts() ) : the_post(); ?>
|
3512 |
-
<option value="<?php $x=get_permalink(get_the_ID()); echo $x; ?>" <?php if($row->article_id==$x){echo ' selected="selected"';} ?>> <?php the_title(); ?> </option>
|
3513 |
-
<?php
|
3514 |
-
endwhile;
|
3515 |
-
|
3516 |
-
// Reset Query
|
3517 |
-
wp_reset_query();
|
3518 |
-
|
3519 |
-
?>
|
3520 |
-
</select>
|
3521 |
-
|
3522 |
-
</td>
|
3523 |
</tr>
|
3524 |
-
<tr id="
|
3525 |
-
|
3526 |
-
|
3527 |
-
|
3528 |
-
|
3529 |
-
|
3530 |
-
|
3531 |
-
|
3532 |
-
|
3533 |
-
|
3534 |
-
|
3535 |
-
|
3536 |
-
|
3537 |
-
|
3538 |
-
|
3539 |
-
|
3540 |
-
|
3541 |
-
|
3542 |
-
|
3543 |
-
|
3544 |
-
|
3545 |
-
?>
|
3546 |
-
</select>
|
3547 |
-
|
3548 |
-
</td>
|
3549 |
</tr>
|
3550 |
-
|
3551 |
-
|
3552 |
-
|
3553 |
-
|
3554 |
-
|
3555 |
-
|
3556 |
-
|
3557 |
-
|
3558 |
-
|
3559 |
-
|
3560 |
-
|
3561 |
-
|
3562 |
-
|
3563 |
-
|
3564 |
-
<?php
|
3565 |
-
|
|
|
|
|
|
|
|
|
|
|
3566 |
</tr>
|
3567 |
-
<tr
|
3568 |
-
|
3569 |
-
|
3570 |
-
|
3571 |
-
|
3572 |
-
|
3573 |
-
|
|
|
|
|
|
|
|
|
3574 |
</tr>
|
3575 |
-
|
3576 |
-
|
3577 |
-
|
3578 |
-
|
3579 |
-
|
3580 |
-
|
3581 |
-
|
3582 |
-
|
3583 |
-
|
3584 |
-
|
3585 |
-
|
3586 |
-
|
3587 |
-
|
3588 |
-
|
3589 |
-
|
3590 |
-
|
3591 |
-
|
3592 |
-
|
3593 |
-
|
3594 |
-
|
3595 |
-
|
3596 |
-
|
3597 |
-
|
3598 |
-
|
3599 |
-
|
3600 |
-
|
3601 |
-
|
3602 |
-
|
3603 |
-
|
3604 |
-
|
3605 |
-
|
3606 |
-
|
3607 |
-
function html_Edit_JavaScript($row){
|
3608 |
-
|
3609 |
-
?>
|
3610 |
-
<script type="text/javascript" language="javascript">
|
3611 |
-
function submit_in(pressbutton){
|
3612 |
-
|
3613 |
-
|
3614 |
-
document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
|
3615 |
-
document.getElementById('adminForm').submit();
|
3616 |
-
|
3617 |
-
}
|
3618 |
-
</script>
|
3619 |
-
|
3620 |
-
<table width="95%">
|
3621 |
-
<thead><tr>
|
3622 |
-
<td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
|
3623 |
-
<a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank" style="color:red; text-decoration:none;">
|
3624 |
-
<img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
|
3625 |
-
Get the full version
|
3626 |
-
</a>
|
3627 |
-
</div></td>
|
3628 |
-
</tr></thead>
|
3629 |
-
<tbody>
|
3630 |
-
<tr>
|
3631 |
-
<td width="100%"><h2>Edit JavaScript - <?php echo $row->title; ?></h2></td>
|
3632 |
-
<td align="right"><input type="button" onclick="submit_in('Save_Edit_JavaScript')" value="Save" class="button-secondary action"> </td>
|
3633 |
-
<td align="right"><input type="button" onclick="submit_in('Apply_Edit_JavaScript')" value="Apply" class="button-secondary action"> </td>
|
3634 |
-
<td align="right"><input type="button" onclick="window.location.href='admin.php?page=Form_maker&task=edit_form&id=<?php echo $row->id; ?>'" value="Cancel" class="button-secondary action"> </td>
|
3635 |
-
</tr>
|
3636 |
-
</tbody></table>
|
3637 |
-
<br />
|
3638 |
-
<form action="admin.php?page=Form_maker&id=<?php echo $row->id; ?>" id="adminForm" method="post" name="adminForm">
|
3639 |
-
<table class="adminform">
|
3640 |
-
|
3641 |
<tr>
|
3642 |
-
|
3643 |
-
<
|
3644 |
-
|
3645 |
-
|
3646 |
-
|
3647 |
-
|
3648 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3649 |
</tr>
|
3650 |
-
|
3651 |
<tr>
|
3652 |
-
|
3653 |
-
|
3654 |
-
|
3655 |
-
<textarea style="margin: 0px;" cols="110" rows="25" name="javascript" id="css" ><?php echo $row->javascript; ?></textarea>
|
3656 |
-
|
3657 |
-
</td>
|
3658 |
-
|
3659 |
</tr>
|
3660 |
-
|
3661 |
-
</table>
|
3662 |
-
</form>
|
3663 |
-
<?php
|
3664 |
-
|
3665 |
-
|
3666 |
-
}
|
3667 |
-
|
3668 |
-
|
3669 |
-
|
3670 |
-
|
3671 |
-
|
3672 |
-
|
3673 |
-
|
3674 |
-
|
3675 |
-
|
3676 |
-
|
3677 |
-
|
3678 |
-
|
3679 |
-
|
3680 |
-
|
3681 |
-
|
3682 |
-
|
3683 |
-
|
3684 |
-
function html_Custom_text_in_email_for_administrator($row){
|
3685 |
-
|
3686 |
-
|
3687 |
-
|
3688 |
-
|
3689 |
-
|
3690 |
-
?>
|
3691 |
-
<script type="text/javascript" language="javascript">
|
3692 |
-
function submit_in(pressbutton){
|
3693 |
-
|
3694 |
-
|
3695 |
-
document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
|
3696 |
-
document.getElementById('adminForm').submit();
|
3697 |
-
|
3698 |
-
}
|
3699 |
-
</script>
|
3700 |
-
|
3701 |
-
<table width="95%">
|
3702 |
-
<thead><tr>
|
3703 |
-
<td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
|
3704 |
-
<a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank" style="color:red; text-decoration:none;">
|
3705 |
-
<img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
|
3706 |
-
Get the full version
|
3707 |
-
</a>
|
3708 |
-
</div></td>
|
3709 |
-
</tr></thead>
|
3710 |
-
<tbody>
|
3711 |
-
|
3712 |
-
<tr>
|
3713 |
-
<td width="100%"><h2>Text for Administrator - <?php echo $row->title; ?></h2></td>
|
3714 |
-
<td align="right"><input type="button" onclick="submit_in('Save_Custom_text_in_email_for_administrator')" value="Save" class="button-secondary action"> </td>
|
3715 |
-
<td align="right"><input type="button" onclick="submit_in('Apply_Custom_text_in_email_for_administrator')" value="Apply" class="button-secondary action"> </td>
|
3716 |
-
<td align="right"><input type="button" onclick="window.location.href='admin.php?page=Form_maker&task=edit_form&id=<?php echo $row->id; ?>'" value="Cancel" class="button-secondary action"> </td>
|
3717 |
-
</tr>
|
3718 |
-
</tbody></table>
|
3719 |
-
<br />
|
3720 |
-
<form action="admin.php?page=Form_maker&id=<?php echo $row->id; ?>" id="adminForm" method="post" name="adminForm">
|
3721 |
-
<table width="95%" style="border-color:#000; border:medium;" >
|
3722 |
-
|
3723 |
-
<tbody>
|
3724 |
<tr>
|
3725 |
-
|
3726 |
-
<
|
3727 |
-
|
3728 |
-
|
3729 |
-
|
3730 |
-
|
3731 |
-
|
3732 |
-
|
3733 |
-
|
3734 |
-
|
3735 |
-
|
3736 |
-
|
3737 |
-
|
3738 |
-
|
3739 |
-
|
3740 |
-
|
3741 |
-
|
3742 |
-
|
3743 |
-
|
3744 |
-
|
3745 |
-
|
3746 |
-
|
3747 |
-
|
3748 |
-
|
3749 |
-
|
3750 |
-
|
3751 |
-
|
3752 |
-
|
3753 |
-
|
3754 |
-
|
3755 |
-
|
3756 |
-
|
3757 |
-
|
3758 |
-
|
3759 |
-
|
3760 |
-
|
3761 |
-
|
3762 |
-
|
3763 |
-
|
3764 |
-
|
3765 |
-
|
3766 |
-
|
3767 |
-
|
3768 |
-
|
3769 |
-
|
3770 |
-
|
3771 |
-
|
3772 |
-
|
3773 |
-
|
3774 |
-
|
3775 |
-
|
3776 |
-
|
3777 |
-
|
3778 |
-
|
3779 |
-
|
3780 |
-
|
3781 |
-
|
3782 |
-
|
3783 |
-
|
3784 |
-
|
3785 |
-
|
3786 |
-
|
3787 |
-
|
3788 |
-
|
3789 |
-
|
3790 |
-
|
3791 |
-
|
3792 |
-
|
3793 |
-
|
3794 |
-
|
3795 |
-
|
3796 |
-
|
3797 |
-
|
3798 |
-
|
3799 |
-
|
3800 |
-
|
3801 |
-
|
3802 |
-
|
3803 |
-
|
3804 |
-
|
3805 |
-
|
3806 |
-
|
3807 |
-
|
3808 |
-
|
3809 |
-
|
3810 |
-
|
3811 |
-
|
3812 |
-
|
3813 |
-
|
3814 |
-
|
3815 |
-
|
3816 |
-
|
3817 |
-
|
3818 |
-
|
3819 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3820 |
}
|
3821 |
-
</script>
|
3822 |
-
|
3823 |
-
<table width="95%">
|
3824 |
-
<thead><tr>
|
3825 |
-
<td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
|
3826 |
-
<a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank" style="color:red; text-decoration:none;">
|
3827 |
-
<img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
|
3828 |
-
Get the full version
|
3829 |
-
</a>
|
3830 |
-
</div></td>
|
3831 |
-
</tr></thead>
|
3832 |
-
<tbody>
|
3833 |
-
|
3834 |
-
<tr>
|
3835 |
-
<td width="100%"><h2>Text for User - <?php echo $row->title; ?></h2></td>
|
3836 |
-
<td align="right"><input type="button" onclick="submit_in('Save_Custom_text_in_email_for_user')" value="Save" class="button-secondary action"> </td>
|
3837 |
-
<td align="right"><input type="button" onclick="submit_in('Apply_Custom_text_in_email_for_user')" value="Apply" class="button-secondary action"> </td>
|
3838 |
-
<td align="right"><input type="button" onclick="window.location.href='admin.php?page=Form_maker&task=edit_form&id=<?php echo $row->id; ?>'" value="Cancel" class="button-secondary action"> </td>
|
3839 |
-
</tr>
|
3840 |
-
</tbody></table>
|
3841 |
-
<br />
|
3842 |
-
<form action="admin.php?page=Form_maker&id=<?php echo $row->id; ?>" id="adminForm" method="post" name="adminForm">
|
3843 |
-
<table width="95%" style="border-color:#000; border:medium;" >
|
3844 |
-
|
3845 |
-
<tbody>
|
3846 |
-
<tr>
|
3847 |
-
|
3848 |
-
<th style="text-align:left">
|
3849 |
-
|
3850 |
-
<label for="message" style="text-align:left"> Text before Message </label>
|
3851 |
-
<br />
|
3852 |
-
</th>
|
3853 |
-
</tr>
|
3854 |
-
<tr>
|
3855 |
-
|
3856 |
-
<td style="width:95%; min-width:500px"><?php if(function_exists('wp_editor') || function_exists('the_editor')){ if(get_bloginfo('version')<'3.3'){
|
3857 |
-
the_editor ( $row->script_user1, $idd = 'script_user1', $prev_id = 'Mail_script1', $media_buttons = true, $tab_index = 1, $extended = true );
|
3858 |
-
}
|
3859 |
-
else
|
3860 |
-
{
|
3861 |
-
wp_editor($row->script_user1, $idd = 'script_user1');
|
3862 |
-
}
|
3863 |
-
} else {?>
|
3864 |
-
|
3865 |
-
<textarea style="width:100%" name="script_user1" id><?php echo $row->script_user1 ?></textarea>
|
3866 |
-
<?php } ?>
|
3867 |
-
<br />
|
3868 |
-
</td>
|
3869 |
-
</tr>
|
3870 |
-
<tr>
|
3871 |
-
<td>
|
3872 |
-
<hr />
|
3873 |
-
<h2 align="center">MESSAGE</h2>
|
3874 |
-
<hr />
|
3875 |
-
<br />
|
3876 |
-
</td>
|
3877 |
-
</tr>
|
3878 |
-
<tr>
|
3879 |
-
|
3880 |
-
<th style="text-align:left">
|
3881 |
-
|
3882 |
-
<label for="message" style="text-align:left"> Text after Message </label>
|
3883 |
-
<br />
|
3884 |
-
</th>
|
3885 |
-
</tr>
|
3886 |
-
<tr>
|
3887 |
-
|
3888 |
-
<td style="width:70%; min-width:500px"><?php if(function_exists('wp_editor') || function_exists('the_editor')){if(get_bloginfo('version')<'3.3'){ the_editor ( $row->script_user2, $idd = 'script_user2', $prev_id = 'Mail_title2', $media_buttons = true, $tab_index = 2, $extended = true );} else{
|
3889 |
-
wp_editor( $row->script_user2, $idd = 'script_user2'); }}else { ?>
|
3890 |
-
|
3891 |
-
<textarea style="width:100%" name="script_user2"><?php echo $row->script_user2 ?></textarea>
|
3892 |
-
<?php } ?></td>
|
3893 |
-
</tr>
|
3894 |
-
</tbody>
|
3895 |
-
</table>
|
3896 |
-
|
3897 |
-
</form>
|
3898 |
-
<?php
|
3899 |
-
|
3900 |
-
|
3901 |
-
|
3902 |
-
|
3903 |
-
|
3904 |
-
|
3905 |
-
|
3906 |
-
|
3907 |
-
|
3908 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
if (!current_user_can('manage_options')) {
|
4 |
+
die('Access Denied');
|
|
|
|
|
5 |
}
|
6 |
+
function html_update_form_maker($row, $labels, $themes) {
|
7 |
+
$form_file_url = plugins_url('', __FILE__);
|
8 |
+
@session_start();
|
9 |
+
$all_updates = $_SESSION['all_updates'];
|
10 |
+
$current_updates = $_SESSION['current_updates'] - 1;
|
11 |
+
$perc = (int)(($current_updates / $all_updates) * 100);
|
12 |
+
?>
|
13 |
+
<br/>
|
14 |
+
<br/>
|
15 |
+
<style>
|
16 |
+
.calendar .button {
|
17 |
+
display: table-cell !important;
|
18 |
+
}
|
19 |
+
.big_div {
|
20 |
+
width: 100%;
|
21 |
+
background-color: transparent;
|
22 |
+
height: 40px;
|
23 |
+
border-radius: 20px;
|
24 |
+
border: 6px #00AEEF solid;
|
25 |
+
text-align: center !important;
|
26 |
+
}
|
27 |
+
.small_div {
|
28 |
+
background-color: #00AEEF;
|
29 |
+
height: 40px;
|
30 |
+
border-radius: 12px;
|
31 |
+
text-align: right;
|
32 |
+
float: left;
|
33 |
+
}
|
34 |
+
.progress_span {
|
35 |
+
padding-right: 10px;
|
36 |
+
line-height: 40px;
|
37 |
+
color: #000 !important;
|
38 |
+
font-size: 20px;
|
39 |
+
}
|
40 |
+
.forms_span {
|
41 |
+
padding-right: 10px;
|
42 |
+
line-height: 20px;
|
43 |
+
font-size: 12px;
|
44 |
+
font-style: italic;
|
45 |
+
color: #999 !important;
|
46 |
+
}
|
47 |
+
</style>
|
48 |
|
49 |
+
<div style="" class="big_div">
|
50 |
+
<div style="width:<?php echo $perc ?>%;" class="small_div">
|
51 |
+
<span class="progress_span"><?php echo $perc ?>%</span>
|
52 |
+
</div>
|
53 |
+
<span class="forms_span"> Updated forms <?php echo $current_updates ?></br> Forms remaining <b
|
54 |
+
style="color:red"><?php echo $all_updates - $current_updates?></b> </span>
|
55 |
+
</div>
|
56 |
+
<br/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
<script type="text/javascript">
|
58 |
+
count_of_filds_form = 10000;
|
59 |
+
function submitbutton(pressbutton) {
|
60 |
+
var form = document.adminForm;
|
61 |
+
tox = '';
|
62 |
+
for (t = 1; t <= form_view_max; t++) {
|
63 |
+
if (document.getElementById('form_id_tempform_view' + t)) {
|
64 |
+
form_view_element = document.getElementById('form_id_tempform_view' + t);
|
65 |
+
n = form_view_element.childNodes.length - 2;
|
66 |
+
for (z = 0; z <= n; z++) {
|
67 |
+
if (form_view_element.childNodes[z].nodeType != 3)
|
68 |
+
if (!form_view_element.childNodes[z].id) {
|
69 |
+
GLOBAL_tr = form_view_element.childNodes[z];
|
70 |
+
//////////////////////////////////////////////////////////////////////////////////////////
|
71 |
+
for (x = 0; x < GLOBAL_tr.firstChild.childNodes.length; x++) {
|
72 |
+
table = GLOBAL_tr.firstChild.childNodes[x];
|
73 |
+
tbody = table.firstChild;
|
74 |
+
for (y = 0; y < tbody.childNodes.length; y++) {
|
75 |
+
tr = tbody.childNodes[y];
|
76 |
+
l_label = document.getElementById(tr.id + '_element_labelform_id_temp').innerHTML;
|
77 |
+
l_label = l_label.replace(/(\r\n|\n|\r)/gm, " ");
|
78 |
+
|
79 |
+
if (tr.getAttribute('type') == "type_address") {
|
80 |
+
addr_id = parseInt(tr.id);
|
81 |
+
tox = tox + addr_id + '#**id**#' + 'Street Line' + '#**label**#' + tr.getAttribute('type') + '#****#';
|
82 |
+
addr_id++;
|
83 |
+
tox = tox + addr_id + '#**id**#' + 'Street Line2' + '#**label**#' + tr.getAttribute('type') + '#****#';
|
84 |
+
addr_id++;
|
85 |
+
tox = tox + addr_id + '#**id**#' + 'City' + '#**label**#' + tr.getAttribute('type') + '#****#';
|
86 |
+
addr_id++;
|
87 |
+
tox = tox + addr_id + '#**id**#' + 'State' + '#**label**#' + tr.getAttribute('type') + '#****#';
|
88 |
+
addr_id++;
|
89 |
+
tox = tox + addr_id + '#**id**#' + 'Postal' + '#**label**#' + tr.getAttribute('type') + '#****#';
|
90 |
+
addr_id++;
|
91 |
+
tox = tox + addr_id + '#**id**#' + 'Country' + '#**label**#' + tr.getAttribute('type') + '#****#';
|
92 |
+
}
|
93 |
+
else
|
94 |
+
tox = tox + tr.id + '#**id**#' + l_label + '#**label**#' + tr.getAttribute('type') + '#****#';
|
95 |
+
}
|
96 |
+
}
|
97 |
+
}
|
98 |
+
}
|
99 |
+
}
|
100 |
+
}
|
101 |
+
document.getElementById('label_order').value = tox;
|
102 |
+
refresh_();
|
103 |
+
document.getElementById('pagination').value = document.getElementById('pages').getAttribute("type");
|
104 |
+
document.getElementById('show_title').value = document.getElementById('pages').getAttribute("show_title");
|
105 |
+
document.getElementById('show_numbers').value = document.getElementById('pages').getAttribute("show_numbers");
|
106 |
+
submitform(pressbutton);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
}
|
108 |
+
function submitform(pressbutton) {
|
109 |
+
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
110 |
+
document.getElementById('adminForm').submit();
|
|
|
|
|
111 |
}
|
112 |
+
function remove_whitespace(node) {
|
113 |
+
for (ttt = 0; ttt < node.childNodes.length; ttt++) {
|
114 |
+
if (node.childNodes[ttt].nodeType == '3') {
|
115 |
+
if (!node.childNodes[ttt])
|
116 |
+
node.removeChild(node.childNodes[ttt]);
|
117 |
+
}
|
118 |
+
else {
|
119 |
+
if (node.childNodes[ttt].childNodes.length)
|
120 |
+
remove_whitespace(node.childNodes[ttt]);
|
121 |
+
}
|
122 |
+
}
|
123 |
+
return;
|
|
|
|
|
|
|
|
|
124 |
}
|
125 |
|
126 |
+
function refresh_() {
|
127 |
+
document.getElementById('form').value = document.getElementById('take').innerHTML;
|
128 |
+
gen = document.getElementById('counter').value;
|
129 |
+
n = gen;
|
130 |
+
for (i = 0; i < n; i++) {
|
131 |
+
if (document.getElementById(i)) {
|
132 |
+
for (z = 0; z < document.getElementById(i).childNodes.length; z++)
|
133 |
+
if (document.getElementById(i).childNodes[z].nodeType == 3)
|
134 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
|
135 |
+
|
136 |
+
if (document.getElementById(i).getAttribute('type') == "type_captcha" || document.getElementById(i).getAttribute('type') == "type_recaptcha") {
|
137 |
+
if (document.getElementById(i).childNodes[10]) {
|
138 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
139 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
140 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
141 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
142 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
143 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
144 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
145 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
146 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
147 |
+
}
|
148 |
+
else {
|
149 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
150 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
151 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
152 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
153 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
154 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
155 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
156 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
157 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
158 |
+
}
|
159 |
+
continue;
|
160 |
+
}
|
161 |
+
|
162 |
+
if (document.getElementById(i).childNodes[10]) {
|
163 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
164 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
165 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
166 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
167 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
168 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
169 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
170 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
171 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
172 |
+
}
|
173 |
+
else {
|
174 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
175 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
176 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
177 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
178 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
179 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
180 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
181 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
182 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
183 |
+
}
|
184 |
+
}
|
185 |
+
}
|
186 |
+
|
187 |
+
for (i = 0; i <= n; i++) {
|
188 |
+
if (document.getElementById(i)) {
|
189 |
+
type = document.getElementById(i).getAttribute("type");
|
190 |
+
switch (type) {
|
191 |
+
case "type_text":
|
192 |
+
case "type_number":
|
193 |
+
case "type_password":
|
194 |
+
case "type_submitter_mail":
|
195 |
+
case "type_own_select":
|
196 |
+
case "type_country":
|
197 |
+
case "type_hidden":
|
198 |
+
case "type_map":
|
199 |
+
{
|
200 |
+
remove_add_(i + "_elementform_id_temp");
|
201 |
+
break;
|
202 |
+
}
|
203 |
+
|
204 |
+
case "type_submit_reset":
|
205 |
+
{
|
206 |
+
remove_add_(i + "_element_submitform_id_temp");
|
207 |
+
if (document.getElementById(i + "_element_resetform_id_temp"))
|
208 |
+
remove_add_(i + "_element_resetform_id_temp");
|
209 |
+
break;
|
210 |
+
}
|
211 |
+
|
212 |
+
case "type_captcha":
|
213 |
+
{
|
214 |
+
remove_add_("_wd_captchaform_id_temp");
|
215 |
+
remove_add_("_element_refreshform_id_temp");
|
216 |
+
remove_add_("_wd_captcha_inputform_id_temp");
|
217 |
+
break;
|
218 |
+
}
|
219 |
+
case "type_file_upload":
|
220 |
+
{
|
221 |
+
remove_add_(i + "_elementform_id_temp");
|
222 |
+
|
223 |
+
break;
|
224 |
+
}
|
225 |
+
|
226 |
+
case "type_textarea":
|
227 |
+
{
|
228 |
+
remove_add_(i + "_elementform_id_temp");
|
229 |
+
|
230 |
+
break;
|
231 |
+
}
|
232 |
+
|
233 |
+
case "type_name":
|
234 |
+
{
|
235 |
+
|
236 |
+
if (document.getElementById(i + "_element_titleform_id_temp")) {
|
237 |
+
remove_add_(i + "_element_titleform_id_temp");
|
238 |
+
remove_add_(i + "_element_firstform_id_temp");
|
239 |
+
remove_add_(i + "_element_lastform_id_temp");
|
240 |
+
remove_add_(i + "_element_middleform_id_temp");
|
241 |
+
}
|
242 |
+
else {
|
243 |
+
remove_add_(i + "_element_firstform_id_temp");
|
244 |
+
remove_add_(i + "_element_lastform_id_temp");
|
245 |
+
}
|
246 |
+
break;
|
247 |
+
|
248 |
+
}
|
249 |
+
|
250 |
+
case "type_phone":
|
251 |
+
{
|
252 |
+
|
253 |
+
remove_add_(i + "_element_firstform_id_temp");
|
254 |
+
remove_add_(i + "_element_lastform_id_temp");
|
255 |
+
break;
|
256 |
+
|
257 |
+
}
|
258 |
+
case "type_address":
|
259 |
+
{
|
260 |
+
remove_add_(i + "_street1form_id_temp");
|
261 |
+
remove_add_(i + "_street2form_id_temp");
|
262 |
+
remove_add_(i + "_cityform_id_temp");
|
263 |
+
remove_add_(i + "_stateform_id_temp");
|
264 |
+
remove_add_(i + "_postalform_id_temp");
|
265 |
+
remove_add_(i + "_countryform_id_temp");
|
266 |
+
|
267 |
+
break;
|
268 |
+
|
269 |
+
}
|
270 |
+
|
271 |
+
|
272 |
+
case "type_checkbox":
|
273 |
+
case "type_radio":
|
274 |
+
{
|
275 |
+
is = true;
|
276 |
+
for (j = 0; j < 100; j++)
|
277 |
+
if (document.getElementById(i + "_elementform_id_temp" + j)) {
|
278 |
+
remove_add_(i + "_elementform_id_temp" + j);
|
279 |
+
}
|
280 |
+
|
281 |
+
/*if(document.getElementById(i+"_randomize").value=="yes")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
choises_randomize(i);*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
283 |
|
284 |
+
break;
|
285 |
+
}
|
286 |
|
287 |
+
case "type_button":
|
288 |
+
{
|
289 |
+
for (j = 0; j < 100; j++)
|
290 |
+
if (document.getElementById(i + "_elementform_id_temp" + j)) {
|
291 |
+
remove_add_(i + "_elementform_id_temp" + j);
|
292 |
+
}
|
293 |
+
break;
|
294 |
+
}
|
295 |
+
|
296 |
+
case "type_time":
|
297 |
+
{
|
298 |
+
if (document.getElementById(i + "_ssform_id_temp")) {
|
299 |
+
remove_add_(i + "_ssform_id_temp");
|
300 |
+
remove_add_(i + "_mmform_id_temp");
|
301 |
+
remove_add_(i + "_hhform_id_temp");
|
302 |
+
}
|
303 |
+
else {
|
304 |
+
remove_add_(i + "_mmform_id_temp");
|
305 |
+
remove_add_(i + "_hhform_id_temp");
|
306 |
+
|
307 |
+
}
|
308 |
+
break;
|
309 |
+
|
310 |
+
}
|
311 |
|
312 |
+
case "type_date":
|
313 |
+
{
|
314 |
+
remove_add_(i + "_elementform_id_temp");
|
315 |
+
remove_add_(i + "_buttonform_id_temp");
|
316 |
|
317 |
+
break;
|
318 |
+
}
|
319 |
+
case "type_date_fields":
|
320 |
+
{
|
321 |
+
remove_add_(i + "_dayform_id_temp");
|
322 |
+
remove_add_(i + "_monthform_id_temp");
|
323 |
+
remove_add_(i + "_yearform_id_temp");
|
324 |
+
break;
|
325 |
+
}
|
326 |
+
}
|
327 |
+
}
|
328 |
+
}
|
329 |
+
|
330 |
+
for (i = 1; i <= form_view_max; i++) {
|
331 |
+
if (document.getElementById('form_id_tempform_view' + i)) {
|
332 |
+
if (document.getElementById('page_next_' + i))
|
333 |
+
document.getElementById('page_next_' + i).removeAttribute('src');
|
334 |
+
if (document.getElementById('page_previous_' + i))
|
335 |
+
document.getElementById('page_previous_' + i).removeAttribute('src');
|
336 |
+
document.getElementById('form_id_tempform_view' + i).parentNode.removeChild(document.getElementById('form_id_tempform_view_img' + i));
|
337 |
+
document.getElementById('form_id_tempform_view' + i).removeAttribute('style');
|
338 |
+
}
|
339 |
+
}
|
340 |
+
|
341 |
+
for (t = 1; t <= form_view_max; t++) {
|
342 |
+
if (document.getElementById('form_id_tempform_view' + t)) {
|
343 |
+
form_view_element = document.getElementById('form_id_tempform_view' + t);
|
344 |
+
n = form_view_element.childNodes.length - 2;
|
345 |
+
|
346 |
+
for (q = 0; q <= n; q++) {
|
347 |
+
if (form_view_element.childNodes[q])
|
348 |
+
if (form_view_element.childNodes[q].nodeType != 3)
|
349 |
+
if (!form_view_element.childNodes[q].id) {
|
350 |
+
del = true;
|
351 |
+
GLOBAL_tr = form_view_element.childNodes[q];
|
352 |
+
|
353 |
+
for (x = 0; x < GLOBAL_tr.firstChild.childNodes.length; x++) {
|
354 |
+
|
355 |
+
table = GLOBAL_tr.firstChild.childNodes[x];
|
356 |
+
tbody = table.firstChild;
|
357 |
|
358 |
+
if (tbody.childNodes.length)
|
359 |
+
del = false;
|
360 |
+
}
|
361 |
|
362 |
+
if (del) {
|
363 |
+
form_view_element.removeChild(form_view_element.childNodes[q]);
|
364 |
+
}
|
365 |
+
|
366 |
+
}
|
367 |
+
}
|
368 |
+
}
|
369 |
+
}
|
370 |
+
|
371 |
+
|
372 |
+
document.getElementById('form_front').value = document.getElementById('take').innerHTML;
|
373 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
374 |
}
|
375 |
+
|
376 |
+
|
377 |
+
gen =<?php echo $row->counter; ?>;//add main form id
|
378 |
+
function enable() {
|
379 |
+
for (iiiii = 0; iiiii < 1000; iiiii++) {
|
380 |
+
if (document.getElementsByTagName("iframe")[iiiii]) {
|
381 |
+
if (document.getElementsByTagName("iframe")[iiiii].id == 'form_maker_editor_ifr') {
|
382 |
+
id_ifr_editor = iiiii;
|
383 |
+
break;
|
384 |
+
}
|
385 |
+
}
|
386 |
+
}
|
387 |
+
alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break');
|
388 |
+
for (x = 0; x < 12; x++) {
|
389 |
+
document.getElementById('img_' + alltypes[x]).src = "<?php echo $form_file_url; ?>/images/" + alltypes[x] + ".png";
|
390 |
+
}
|
391 |
+
|
392 |
+
|
393 |
+
document.getElementById('formMakerDiv').style.display = (document.getElementById('formMakerDiv').style.display == 'block' ? 'none' : 'block');
|
394 |
+
document.getElementById('formMakerDiv1').style.display = (document.getElementById('formMakerDiv1').style.display == 'block' ? 'none' : 'block');
|
395 |
+
if (document.getElementById('formMakerDiv').offsetWidth)
|
396 |
+
document.getElementById('formMakerDiv1').style.width = (document.getElementById('formMakerDiv').offsetWidth - 60) + 'px';
|
397 |
+
document.getElementById('when_edit').style.display = 'none';
|
398 |
}
|
399 |
|
400 |
+
function enable2() {
|
401 |
+
for (iiiii = 0; iiiii < 1000; iiiii++) {
|
402 |
+
if (document.getElementsByTagName("iframe")[iiiii]) {
|
403 |
+
if (document.getElementsByTagName("iframe")[iiiii].id == 'form_maker_editor_ifr') {
|
404 |
+
id_ifr_editor = iiiii;
|
405 |
+
break;
|
406 |
+
}
|
407 |
+
}
|
408 |
+
}
|
409 |
+
alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break');
|
410 |
+
for (x = 0; x < 12; x++) {
|
411 |
+
document.getElementById('img_' + alltypes[x]).src = "<?php echo $form_file_url; ?>/images/" + alltypes[x] + ".png";
|
412 |
+
}
|
413 |
+
|
414 |
+
|
415 |
+
document.getElementById('formMakerDiv').style.display = (document.getElementById('formMakerDiv').style.display == 'block' ? 'none' : 'block');
|
416 |
+
document.getElementById('formMakerDiv1').style.display = (document.getElementById('formMakerDiv1').style.display == 'block' ? 'none' : 'block');
|
417 |
+
if (document.getElementById('formMakerDiv').offsetWidth)
|
418 |
+
document.getElementById('formMakerDiv1').style.width = (document.getElementById('formMakerDiv').offsetWidth - 60) + 'px';
|
419 |
+
document.getElementById('when_edit').style.display = 'block';
|
420 |
+
if (document.getElementById('field_types').offsetWidth)
|
421 |
+
document.getElementById('when_edit').style.width = document.getElementById('field_types').offsetWidth + 'px';
|
422 |
+
|
423 |
+
if (document.getElementById('field_types').offsetHeight)
|
424 |
+
document.getElementById('when_edit').style.height = document.getElementById('field_types').offsetHeight + 'px';
|
425 |
+
|
426 |
+
//document.getElementById('when_edit').style.position='none';
|
427 |
+
|
428 |
}
|
429 |
+
|
430 |
+
function set_preview() {
|
431 |
+
appWidth = parseInt(document.body.offsetWidth);
|
432 |
+
appHeight = parseInt(document.body.offsetHeight);
|
433 |
+
//document.getElementById('toolbar-popup-preview').childNodes[1].href='index.php?option=com_formmaker&task=preview&tmpl=component&theme='+document.getElementById('theme').value;
|
434 |
+
//document.getElementById('toolbar-popup-preview').childNodes[1].setAttribute('rel',"{handler: 'iframe', size: {x:"+(appWidth-100)+", y: "+531+"}}");
|
|
|
|
|
|
|
|
|
435 |
}
|
436 |
+
</script>
|
437 |
+
<style>
|
438 |
+
#when_edit {
|
439 |
+
position: absolute;
|
440 |
+
background-color: #666;
|
441 |
+
z-index: 101;
|
442 |
+
display: none;
|
443 |
+
width: 100%;
|
444 |
+
height: 100%;
|
445 |
+
opacity: 0.7;
|
446 |
+
filter: alpha(opacity = 70);
|
447 |
+
}
|
448 |
+
|
449 |
+
#formMakerDiv {
|
450 |
+
position: fixed;
|
451 |
+
background-color: #666;
|
452 |
+
z-index: 100;
|
453 |
+
display: none;
|
454 |
+
left: 0;
|
455 |
+
top: 0;
|
456 |
+
width: 100%;
|
457 |
+
height: 100%;
|
458 |
+
opacity: 0.7;
|
459 |
+
filter: alpha(opacity = 70);
|
460 |
+
}
|
461 |
+
|
462 |
+
#formMakerDiv1 {
|
463 |
+
position: fixed;
|
464 |
+
z-index: 100;
|
465 |
+
background-color: transparent;
|
466 |
+
top: 0;
|
467 |
+
left: 0;
|
468 |
+
display: none;
|
469 |
+
margin-left: 30px;
|
470 |
+
margin-top: 15px;
|
471 |
+
}
|
472 |
|
473 |
|
474 |
</style>
|
475 |
|
476 |
+
<form action="admin.php?page=Form_maker&id=<?php echo $row->id; ?>" method="post" name="adminForm" id="adminForm"
|
477 |
+
enctype="multipart/form-data">
|
478 |
+
<table style="border:6px #00aeef solid; background-color:#00aeef" width="100%" cellpadding="0" cellspacing="0">
|
479 |
+
<tr>
|
480 |
|
481 |
|
482 |
<td align="left" valign="middle" rowspan="3" style="padding:10px;">
|
483 |
+
<img src="<?php echo $form_file_url; ?>/images/formmaker.png"/>
|
484 |
+
</td>
|
485 |
|
486 |
<td width="70" align="right" valign="middle">
|
487 |
|
488 |
+
<span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Form title: </span>
|
489 |
|
490 |
</td>
|
491 |
|
492 |
<td width="153" align="center" valign="middle">
|
493 |
|
494 |
+
<div style="background-image:url(<?php echo $form_file_url; ?>/images/input.png);">
|
495 |
|
496 |
+
<input id="title" name="title" <?php echo 'value="' . htmlspecialchars($row->title) . '"' ?>
|
497 |
+
style="background:none; width:151px; height:17px; border:none; font-size:11px"/>
|
498 |
|
499 |
+
</div>
|
500 |
|
501 |
</td>
|
502 |
+
|
503 |
+
</tr>
|
504 |
+
<tr>
|
505 |
|
506 |
<td width="300" align="right" valign="middle">
|
507 |
|
508 |
+
<span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Email to send submissions to: </span>
|
509 |
|
510 |
</td>
|
511 |
|
512 |
<td width="153" align="center" valign="middle">
|
513 |
|
514 |
+
<div style="background-image:url(<?php echo $form_file_url; ?>/images/input.png);">
|
515 |
|
516 |
+
<input id="mail" name="mail" <?php echo 'value="' . $row->mail . '"' ?>
|
517 |
+
style="background:none; width:151px; height:17px; border:none; font-size:11px"/>
|
518 |
|
519 |
+
</div>
|
520 |
|
521 |
</td>
|
522 |
|
523 |
+
</tr>
|
524 |
|
525 |
+
<tr>
|
526 |
|
527 |
<td width="300" align="right" valign="middle">
|
528 |
|
529 |
+
<span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Theme: </span>
|
530 |
|
531 |
</td>
|
532 |
|
533 |
<td width="153" align="center" valign="middle">
|
534 |
|
535 |
+
<div style="height:19px">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
536 |
|
537 |
+
<select id="theme" name="theme"
|
538 |
+
style="background:transparent; width:151px; height:19px; border:none; font-size:11px"
|
539 |
+
onChange="set_preview()">
|
540 |
|
541 |
+
<?php
|
542 |
+
$form_theme = '';
|
543 |
+
foreach ($themes as $theme) {
|
544 |
+
if ($theme->id == $row->theme) {
|
545 |
+
echo '<option value="' . $theme->id . '" selected>' . $theme->title . '</option>';
|
546 |
+
$form_theme = $theme->css;
|
547 |
+
}
|
548 |
+
else
|
549 |
+
echo '<option value="' . $theme->id . '">' . $theme->title . '</option>';
|
550 |
+
}
|
551 |
+
?>
|
552 |
+
</select>
|
553 |
|
554 |
+
</div>
|
555 |
|
556 |
+
</td>
|
|
|
|
|
|
|
557 |
|
|
|
558 |
</tr>
|
|
|
559 |
|
|
|
|
|
|
|
|
|
|
|
560 |
<tr>
|
561 |
+
<td align="left" colspan="3">
|
562 |
+
|
563 |
+
<img src="<?php echo $form_file_url; ?>/images/addanewfield.png" onclick="enable(); Enable()"
|
564 |
+
style="cursor:pointer;margin:10px;"/>
|
565 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
566 |
</td>
|
567 |
</tr>
|
568 |
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
569 |
|
570 |
+
<div id="formMakerDiv" onclick="close_window()"></div>
|
571 |
+
<div id="formMakerDiv1" align="center">
|
|
|
|
|
|
|
|
|
572 |
|
|
|
|
|
|
|
573 |
|
574 |
+
<table border="0" width="100%" cellpadding="0" cellspacing="0" height="100%"
|
575 |
+
style="border:6px #00aeef solid; background-color:#FFF">
|
576 |
+
<tr>
|
577 |
+
<td style="padding:0px">
|
578 |
+
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
|
579 |
+
<tr valign="top">
|
580 |
+
<td width="15%" height="100%" style="border-right:dotted black 1px;" id="field_types">
|
581 |
+
<div id="when_edit" style="display:none"></div>
|
582 |
+
<table border="0" cellpadding="0" cellspacing="3" width="100%">
|
583 |
+
<tr>
|
584 |
+
<td align="center" onClick="addRow('customHTML')" class="field_buttons" id="table_editor"><img
|
585 |
+
src="<?php echo $form_file_url; ?>/images/customHTML.png" style="margin:5px" id="img_customHTML"/>
|
586 |
+
</td>
|
587 |
|
588 |
+
<td align="center" onClick="addRow('text')" class="field_buttons" id="table_text"><img
|
589 |
+
src="<?php echo $form_file_url; ?>/images/text.png" style="margin:5px" id="img_text"/></td>
|
590 |
+
</tr>
|
591 |
+
<tr>
|
592 |
+
<td align="center" onClick="addRow('time_and_date')" class="field_buttons" id="table_time_and_date">
|
593 |
+
<img src="<?php echo $form_file_url; ?>/images/time_and_date.png" style="margin:5px"
|
594 |
+
id="img_time_and_date"/></td>
|
595 |
+
|
596 |
+
<td align="center" onClick="addRow('select')" class="field_buttons" id="table_select"><img
|
597 |
+
src="<?php echo $form_file_url; ?>/images/select.png" style="margin:5px" id="img_select"/></td>
|
598 |
+
</tr>
|
599 |
+
<tr>
|
600 |
+
<td align="center" onClick="addRow('checkbox')" class="field_buttons" id="table_checkbox"><img
|
601 |
+
src="<?php echo $form_file_url; ?>/images/checkbox.png" style="margin:5px" id="img_checkbox"/></td>
|
602 |
+
|
603 |
+
<td align="center" onClick="addRow('radio')" class="field_buttons" id="table_radio"><img
|
604 |
+
src="<?php echo $form_file_url; ?>/images/radio.png" style="margin:5px" id="img_radio"/></td>
|
605 |
+
</tr>
|
606 |
+
<tr>
|
607 |
+
<td align="center"
|
608 |
+
onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')"
|
609 |
+
style="background-color: rgb(114, 113, 113) !important;" class="field_buttons"
|
610 |
+
id="table_file_upload"><img src="<?php echo $form_file_url; ?>/images/file_upload.png"
|
611 |
+
style="margin:5px" id="img_file_upload"/></td>
|
612 |
+
|
613 |
+
<td align="center" onClick="addRow('captcha')" class="field_buttons" id="table_captcha"><img
|
614 |
+
src="<?php echo $form_file_url; ?>/images/captcha.png" style="margin:5px" id="img_captcha"/></td>
|
615 |
+
</tr>
|
616 |
+
<tr>
|
617 |
+
<td align="center" onClick="addRow('page_break')" class="field_buttons" id="table_page_break"><img
|
618 |
+
src="<?php echo $form_file_url; ?>/images/page_break.png" style="margin:5px" id="img_page_break"/>
|
619 |
+
</td>
|
620 |
|
621 |
+
<td align="center" onClick="addRow('section_break')" class="field_buttons" id="table_section_break">
|
622 |
+
<img src="<?php echo $form_file_url; ?>/images/section_break.png" style="margin:5px"
|
623 |
+
id="img_section_break"/></td>
|
624 |
+
</tr>
|
625 |
+
<tr>
|
626 |
+
<td align="center"
|
627 |
+
onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')"
|
628 |
+
style="background-color: rgb(114, 113, 113) !important;" class="field_buttons" id="table_map"><img
|
629 |
+
src="<?php echo $form_file_url; ?>/images/map.png" style="margin:5px" id="img_map"/></td>
|
630 |
+
|
631 |
+
<td align="center" onClick="addRow('button')" class="field_buttons" id="table_button"><img
|
632 |
+
src="<?php echo $form_file_url; ?>/images/button.png" style="margin:5px" id="img_button"/></td>
|
633 |
+
</tr>
|
634 |
+
</table>
|
635 |
+
|
636 |
+
</td>
|
637 |
+
<td width="35%" height="100%" align="left">
|
638 |
+
<div id="edit_table" style="padding:0px; overflow-y:scroll; height:531px"></div>
|
639 |
+
</td>
|
640 |
|
641 |
+
<td align="center" valign="top"
|
642 |
+
style="background:url(<?php echo $form_file_url; ?>/images/border2.png) repeat-y;"> </td>
|
643 |
+
<td style="padding:15px">
|
644 |
+
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
|
645 |
+
|
646 |
+
<tr>
|
647 |
+
<td align="right"><input type="radio" value="end" name="el_pos" checked="checked" id="pos_end"
|
648 |
+
onclick="Disable()"/>
|
649 |
+
At The End
|
650 |
+
<input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
|
651 |
+
At The Beginning
|
652 |
+
<input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
|
653 |
+
Before
|
654 |
+
<select style="width:100px; margin-left:5px" id="sel_el_pos" disabled="disabled">
|
655 |
+
</select>
|
656 |
+
<img alt="ADD" title="add" style="cursor:pointer; vertical-align:middle; margin:5px"
|
657 |
+
src="<?php echo $form_file_url; ?>/images/save.png" onClick="add(0)"/>
|
658 |
+
<img alt="CANCEL" title="cancel" style=" cursor:pointer; vertical-align:middle; margin:5px"
|
659 |
+
src="<?php echo $form_file_url; ?>/images/cancel_but.png" onClick="close_window()"/>
|
660 |
+
|
661 |
+
<hr style=" margin-bottom:10px"/>
|
662 |
+
</td>
|
663 |
+
</tr>
|
664 |
+
|
665 |
+
<tr height="100%" valign="top">
|
666 |
+
<td id="show_table"></td>
|
667 |
+
</tr>
|
668 |
+
|
669 |
+
</table>
|
670 |
+
</td>
|
671 |
+
</tr>
|
672 |
+
</table>
|
673 |
+
</td>
|
674 |
+
</tr>
|
675 |
+
</table>
|
676 |
+
</div>
|
677 |
+
<input type="hidden" id="old"/>
|
678 |
+
<input type="hidden" id="old_selected"/>
|
679 |
+
<input type="hidden" id="element_type"/>
|
680 |
+
<input type="hidden" id="editing_id"/>
|
681 |
+
|
682 |
+
<div id="main_editor"
|
683 |
+
style="position:absolute; display:none; z-index:140;"><?php if (function_exists('the_editor') || function_exists('wp_editor')) {
|
684 |
+
if (get_bloginfo('version') < '3.3') { ?>
|
685 |
+
<div style=" max-width:500px; height:300px;text-align:left" id="poststuff">
|
686 |
+
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>"
|
687 |
+
class="postarea"><?php the_editor("", "form_maker_editor", "title", $media_buttons = TRUE, $tab_index = 1, $extended = TRUE); ?>
|
688 |
+
</div>
|
689 |
+
</div>
|
690 |
+
<?php
|
691 |
+
}
|
692 |
+
else {
|
693 |
+
echo "<style>#wp-form_maker_editor-media-buttons{ text-align:left }</style>";
|
694 |
+
wp_editor("", "form_maker_editor");
|
695 |
+
}
|
696 |
+
}
|
697 |
+
else {
|
698 |
+
?>
|
699 |
+
<textarea name="form_maker_editor" id="form_maker_editor" cols="40" rows="6" style="width: 450px; height: 350px; "
|
700 |
+
class="mce_editable" aria-hidden="true"></textarea>
|
701 |
+
<?php
|
702 |
+
}
|
703 |
+
?></div>
|
704 |
+
|
705 |
+
|
706 |
+
<br/>
|
707 |
+
<br/>
|
708 |
+
|
709 |
+
<fieldset>
|
710 |
|
711 |
+
<legend>
|
712 |
|
713 |
<h2 style="color:#00aeef">Form</h2>
|
714 |
|
715 |
+
</legend>
|
716 |
|
717 |
+
<?php
|
718 |
+
global $first_css;
|
719 |
+
echo '<style>' . $first_css . '</style>';
|
720 |
|
721 |
+
?>
|
722 |
+
<table width="100%" style="margin:8px">
|
723 |
+
<tr id="page_navigation">
|
724 |
+
<td align="center" width="90%" id="pages" show_title="<?php echo $row->show_title; ?>"
|
725 |
+
show_numbers="<?php echo $row->show_numbers; ?>" type="<?php echo $row->pagination; ?>"></td>
|
726 |
+
<td align="left" id="edit_page_navigation"></td>
|
727 |
+
</tr>
|
728 |
+
</table>
|
729 |
+
<div id="take" class="main">
|
730 |
+
<table cellpadding="4" cellspacing="0" class="wdform_table1" style="border-top:0px solid black;">
|
731 |
+
<tbody id="form_id_tempform_view1" class="wdform_tbody1" page_title="Untitled page" next_title="Next"
|
732 |
+
next_type="button" next_class="wdform_page_button" next_checkable="false" previous_title="Previous"
|
733 |
+
previous_type="button" previous_class="wdform_page_button" previous_checkable="false">
|
734 |
+
<tr class="wdform_tr1">
|
735 |
+
<td class="wdform_td1">
|
736 |
+
<table class="wdform_table2">
|
737 |
+
<tbody class="wdform_tbody2"></tbody>
|
738 |
+
</table>
|
739 |
+
</td>
|
740 |
+
</tr>
|
741 |
+
<tr class="wdform_footer">
|
742 |
+
<td colspan="100" valign="top">
|
743 |
+
<table width="100%" style="padding-right:170px">
|
744 |
+
<tbody>
|
745 |
+
<tr id="form_id_temppage_nav1"></tr>
|
746 |
+
</tbody>
|
747 |
+
</table>
|
748 |
+
</td>
|
749 |
+
</tr>
|
750 |
+
<tbody id="form_id_tempform_view_img1" style="float:right ;">
|
751 |
+
<tr>
|
752 |
+
<td width="0%"></td>
|
753 |
+
<td align="right"><img src="<?php echo $form_file_url; ?>/images/minus.png" title="Show or hide the page"
|
754 |
+
class="page_toolbar" onclick="show_or_hide('1')" id="show_page_img_1"/></td>
|
755 |
+
<td><img src="<?php echo $form_file_url; ?>/images/page_delete.png" title="Delete the page" class="page_toolbar"
|
756 |
+
onclick="remove_page('1')"/></td>
|
757 |
+
<td><img src="<?php echo $form_file_url; ?>/images/page_delete_all.png" title="Delete the page with fields"
|
758 |
+
class="page_toolbar" onclick="remove_page_all('1')"/></td>
|
759 |
+
<td><img src="<?php echo $form_file_url; ?>/images/page_edit.png" title="Edit the page" class="page_toolbar"
|
760 |
+
onclick="edit_page_break('1')"/></td>
|
761 |
+
</tr>
|
762 |
+
</tbody>
|
763 |
+
</table>
|
764 |
+
</div>
|
765 |
|
766 |
+
<div id="take_old" style="display:none">
|
767 |
<?php
|
768 |
+
echo $row->form;
|
|
|
|
|
769 |
|
770 |
+
?> </div>
|
771 |
|
772 |
+
</fieldset>
|
773 |
+
|
774 |
+
<input type="hidden" name="form" id="form">
|
775 |
+
<input type="hidden" name="form_front" id="form_front">
|
776 |
+
<input type="hidden" value="<?php echo plugins_url("", __FILE__) ?>" id="form_plugins_url"/>
|
777 |
+
<input type="hidden" name="pagination" id="pagination"/>
|
778 |
+
<input type="hidden" name="show_title" id="show_title"/>
|
779 |
+
<input type="hidden" name="show_numbers" id="show_numbers"/>
|
|
|
|
|
780 |
|
781 |
+
<input type="hidden" name="public_key" id="public_key"/>
|
782 |
+
<input type="hidden" name="private_key" id="private_key"/>
|
783 |
+
<input type="hidden" name="recaptcha_theme" id="recaptcha_theme"/>
|
784 |
+
|
785 |
+
<input type="hidden" id="label_order" name="label_order" value="<?php echo $row->label_order;?>"/>
|
786 |
+
<input type="hidden" name="counter" id="counter" value="<?php echo $row->counter;?>">
|
787 |
|
788 |
<script type="text/javascript">
|
789 |
+
form_view = 1;
|
790 |
+
form_view_count = 1;
|
791 |
+
form_view_max = 1;
|
792 |
|
793 |
+
function formOnload() {
|
|
|
794 |
//enable maps
|
795 |
+
form_view = document.getElementById('form_view');
|
796 |
+
GLOBAL_tr = form_view.firstChild;
|
797 |
+
|
798 |
+
for (qqq = 0; qqq < GLOBAL_tr.childNodes.length; qqq++) {
|
799 |
+
td = GLOBAL_tr.childNodes[qqq];
|
800 |
+
tbody = td.firstChild.firstChild;
|
801 |
+
for (yyy = 0; yyy < tbody.childNodes.length; yyy++) {
|
802 |
+
|
803 |
+
|
804 |
+
tr = tbody.childNodes[yyy];
|
805 |
+
l_id = tr.id;
|
806 |
+
add_new_field(l_id);
|
807 |
+
td = GLOBAL_tr.childNodes[qqq];
|
808 |
+
tbody = td.firstChild.firstChild;
|
809 |
+
for (zzz = 0; zzz < qqq; zzz++) {
|
810 |
+
right_row(l_id);
|
811 |
+
}
|
812 |
+
}
|
813 |
+
}
|
814 |
+
submitbutton('save_update');
|
|
|
|
|
|
|
815 |
|
816 |
}
|
817 |
|
818 |
+
function formAddToOnload() {
|
819 |
+
if (formOldFunctionOnLoad) {
|
820 |
+
formOldFunctionOnLoad();
|
821 |
+
}
|
822 |
+
formOnload();
|
823 |
}
|
824 |
|
825 |
+
function formLoadBody() {
|
|
|
826 |
|
827 |
+
formOldFunctionOnLoad = window.onload;
|
828 |
+
window.onload = formAddToOnload;
|
829 |
}
|
830 |
|
831 |
var formOldFunctionOnLoad = null;
|
832 |
formLoadBody();
|
833 |
|
834 |
+
function add_new_field(id) {
|
835 |
+
enable2();
|
836 |
+
type = document.getElementById(id).getAttribute('type');
|
837 |
+
//////////////////////////////parameter take
|
838 |
+
if (document.getElementById(id + '_element_label').innerHTML)
|
839 |
+
w_field_label = document.getElementById(id + '_element_label').innerHTML;
|
840 |
+
|
841 |
+
w_choices = new Array();
|
842 |
+
w_choices_checked = new Array();
|
843 |
+
w_choices_disabled = new Array();
|
844 |
+
w_allow_other_num = 0;
|
845 |
+
|
846 |
+
if (document.getElementById(id + '_label_and_element_section'))
|
847 |
+
w_field_label_pos = "top";
|
848 |
+
else
|
849 |
+
w_field_label_pos = "left";
|
850 |
+
|
851 |
+
if (document.getElementById(id + "_element")) {
|
852 |
+
s = document.getElementById(id + "_element").style.width;
|
853 |
+
w_size = s.substring(0, s.length - 2);
|
854 |
+
}
|
855 |
+
|
856 |
+
if (document.getElementById(id + "_required"))
|
857 |
+
w_required = document.getElementById(id + "_required").value;
|
858 |
+
|
859 |
+
if (document.getElementById(id + '_label_section')) {
|
860 |
+
w_class = document.getElementById(id + '_label_section').getAttribute("class");
|
861 |
+
if (!w_class)
|
862 |
+
w_class = "";
|
863 |
+
}
|
864 |
+
|
865 |
+
t = 0;
|
866 |
+
gen = id;
|
867 |
+
switch (type) {
|
868 |
+
case 'type_editor':
|
869 |
+
{
|
870 |
+
w_editor = document.getElementById(id + "_element_section").innerHTML;
|
871 |
+
type_editor(gen, w_editor);
|
872 |
+
add(0);
|
873 |
+
break;
|
874 |
+
}
|
875 |
+
case 'type_text':
|
876 |
+
{
|
877 |
+
w_first_val = document.getElementById(id + "_element").value;
|
878 |
+
w_title = document.getElementById(id + "_element").title;
|
879 |
+
atrs = return_attributes(id + '_element');
|
880 |
+
w_attr_name = atrs[0];
|
881 |
+
w_attr_value = atrs[1];
|
882 |
+
type_text(gen, w_field_label, w_field_label_pos, w_size, w_first_val, w_title, w_required, 'no', w_class, w_attr_name, w_attr_value);
|
883 |
+
add(0);
|
884 |
+
break;
|
885 |
+
}
|
886 |
+
case 'type_password':
|
887 |
+
{
|
888 |
+
atrs = return_attributes(id + '_element');
|
889 |
+
w_attr_name = atrs[0];
|
890 |
+
w_attr_value = atrs[1];
|
891 |
+
if (w_class == '')
|
892 |
+
w_class = 'wdform_input';
|
893 |
+
type_password(gen, w_field_label, w_field_label_pos, w_size, w_required, 'no', w_class, w_attr_name, w_attr_value);
|
894 |
+
add(0);
|
895 |
+
break;
|
896 |
+
}
|
897 |
+
case 'type_textarea':
|
898 |
+
{
|
899 |
+
w_first_val = document.getElementById(id + "_element").value;
|
900 |
+
w_title = document.getElementById(id + "_element").title;
|
901 |
+
s = document.getElementById(id + "_element").style.height;
|
902 |
+
w_size_h = s.substring(0, s.length - 2);
|
903 |
+
|
904 |
+
atrs = return_attributes(id + '_element');
|
905 |
+
w_attr_name = atrs[0];
|
906 |
+
w_attr_value = atrs[1];
|
907 |
+
type_textarea(gen, w_field_label, w_field_label_pos, w_size, w_size_h, w_first_val, w_title, w_required, 'no', w_class, w_attr_name, w_attr_value);
|
908 |
+
add(0);
|
909 |
+
break;
|
910 |
+
}
|
911 |
+
case 'type_name':
|
912 |
+
{
|
913 |
+
if (document.getElementById(id + '_element_middle'))
|
914 |
+
w_name_format = "extended";
|
915 |
+
else
|
916 |
+
w_name_format = "normal";
|
917 |
+
|
918 |
+
w_first_val = ['', ''];
|
919 |
+
w_title = ['', ''];
|
920 |
+
|
921 |
+
|
922 |
+
s = document.getElementById(id + "_element_first").style.width;
|
923 |
+
w_size = s.substring(0, s.length - 2);
|
924 |
+
atrs = return_attributes(id + '_element_first');
|
925 |
+
w_attr_name = atrs[0];
|
926 |
+
w_attr_value = atrs[1];
|
927 |
+
type_name(gen, w_field_label, w_field_label_pos, w_first_val, w_title, w_size, w_name_format, w_required, 'no', w_class, w_attr_name, w_attr_value);
|
928 |
+
add(0);
|
929 |
+
break;
|
930 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
931 |
|
932 |
+
case 'type_submitter_mail':
|
933 |
+
{
|
934 |
+
w_first_val = document.getElementById(id + "_element").value;
|
935 |
+
w_title = document.getElementById(id + "_element").title;
|
936 |
+
w_send = document.getElementById(id + "_send").value;
|
937 |
+
|
938 |
+
atrs = return_attributes(id + '_element');
|
939 |
+
w_attr_name = atrs[0];
|
940 |
+
w_attr_value = atrs[1];
|
941 |
+
type_submitter_mail(gen, w_field_label, w_field_label_pos, w_size, w_first_val, w_title, w_send, w_required, 'no', w_class, w_attr_name, w_attr_value);
|
942 |
+
add(0);
|
943 |
+
break;
|
944 |
+
}
|
945 |
+
case 'type_checkbox':
|
946 |
+
{
|
947 |
+
|
948 |
+
if (document.getElementById(id + '_hor'))
|
949 |
+
w_flow = "hor"
|
950 |
+
else
|
951 |
+
w_flow = "ver";
|
952 |
+
|
953 |
+
v = 0;
|
954 |
+
for (k = 0; k < 100; k++)
|
955 |
+
if (document.getElementById(id + "_element" + k)) {
|
956 |
+
if (document.getElementById(id + "_element" + k).getAttribute('other'))
|
957 |
+
if (document.getElementById(id + "_element" + k).getAttribute('other') == '1')
|
958 |
+
w_allow_other_num = t;
|
959 |
+
w_choices[t] = document.getElementById(id + "_element" + k).value;
|
960 |
+
w_choices_checked[t] = document.getElementById(id + "_element" + k).checked;
|
961 |
+
t++;
|
962 |
+
v = k;
|
963 |
+
}
|
964 |
+
atrs = return_attributes(id + '_element' + v);
|
965 |
+
w_attr_name = atrs[0];
|
966 |
+
w_attr_value = atrs[1];
|
967 |
+
type_checkbox(gen, w_field_label, w_field_label_pos, w_flow, w_choices, w_choices_checked, w_required, 'no', 'no', '0', w_class, w_attr_name, w_attr_value);
|
968 |
+
add(0);
|
969 |
+
break;
|
970 |
+
}
|
971 |
+
case 'type_radio':
|
972 |
+
{
|
973 |
+
if (document.getElementById(id + '_hor'))
|
974 |
+
w_flow = "hor"
|
975 |
+
else
|
976 |
+
w_flow = "ver";
|
977 |
+
|
978 |
+
|
979 |
+
v = 0;
|
980 |
+
for (k = 0; k < 100; k++)
|
981 |
+
if (document.getElementById(id + "_element" + k)) {
|
982 |
+
w_choices[t] = document.getElementById(id + "_element" + k).value;
|
983 |
+
w_choices_checked[t] = document.getElementById(id + "_element" + k).checked;
|
984 |
+
t++;
|
985 |
+
v = k;
|
986 |
+
}
|
987 |
+
atrs = return_attributes(id + '_element' + v);
|
988 |
+
w_attr_name = atrs[0];
|
989 |
+
w_attr_value = atrs[1];
|
990 |
+
type_radio(gen, w_field_label, w_field_label_pos, w_flow, w_choices, w_choices_checked, w_required, 'no', 'no', 0, w_class, w_attr_name, w_attr_value);
|
991 |
+
add(0);
|
992 |
+
break;
|
993 |
+
}
|
994 |
+
case 'type_time':
|
995 |
+
{
|
996 |
+
atrs = return_attributes(id + '_hh');
|
997 |
+
w_attr_name = atrs[0];
|
998 |
+
w_attr_value = atrs[1];
|
999 |
+
w_hh = document.getElementById(id + '_hh').value;
|
1000 |
+
w_mm = document.getElementById(id + '_mm').value;
|
1001 |
+
if (document.getElementById(id + '_ss')) {
|
1002 |
+
w_ss = document.getElementById(id + '_ss').value;
|
1003 |
+
w_sec = "1";
|
1004 |
+
}
|
1005 |
+
else {
|
1006 |
+
w_ss = "";
|
1007 |
+
w_sec = "0";
|
1008 |
+
}
|
1009 |
+
if (document.getElementById(id + '_am_pm_select')) {
|
1010 |
+
w_am_pm = document.getElementById(id + '_am_pm').value;
|
1011 |
+
w_time_type = "12";
|
1012 |
+
}
|
1013 |
+
else {
|
1014 |
+
w_am_pm = 0;
|
1015 |
+
w_time_type = "24";
|
1016 |
+
}
|
1017 |
+
type_time(gen, w_field_label, w_field_label_pos, w_time_type, w_am_pm, w_sec, w_hh, w_mm, w_ss, w_required, w_class, w_attr_name, w_attr_value);
|
1018 |
+
add(0);
|
1019 |
+
break;
|
1020 |
+
}
|
1021 |
+
case 'type_date':
|
1022 |
+
{
|
1023 |
+
atrs = return_attributes(id + '_element');
|
1024 |
+
w_attr_name = atrs[0];
|
1025 |
+
w_attr_value = atrs[1];
|
1026 |
+
w_date = document.getElementById(id + '_element').value;
|
1027 |
+
w_format = document.getElementById(id + '_button').getAttribute("format");
|
1028 |
+
w_but_val = document.getElementById(id + '_button').value;
|
1029 |
+
type_date(gen, w_field_label, w_field_label_pos, w_date, w_required, w_class, w_format, w_but_val, w_attr_name, w_attr_value);
|
1030 |
+
add(0);
|
1031 |
+
break;
|
1032 |
+
}
|
1033 |
+
case 'type_date_fields':
|
1034 |
+
{
|
1035 |
+
atrs = return_attributes(id + '_day');
|
1036 |
+
w_attr_name = atrs[0];
|
1037 |
+
w_attr_value = atrs[1];
|
1038 |
+
w_day = document.getElementById(id + '_day').value;
|
1039 |
+
w_month = document.getElementById(id + '_month').value;
|
1040 |
+
w_year = document.getElementById(id + '_year').value;
|
1041 |
+
w_day_type = document.getElementById(id + '_day').tagName;
|
1042 |
+
w_month_type = document.getElementById(id + '_month').tagName;
|
1043 |
+
w_year_type = document.getElementById(id + '_year').tagName;
|
1044 |
+
w_day_label = document.getElementById(id + '_day_label').innerHTML;
|
1045 |
+
w_month_label = document.getElementById(id + '_month_label').innerHTML;
|
1046 |
+
w_year_label = document.getElementById(id + '_year_label').innerHTML;
|
1047 |
+
|
1048 |
+
s = document.getElementById(id + '_day').style.width;
|
1049 |
+
w_day_size = s.substring(0, s.length - 2);
|
1050 |
+
|
1051 |
+
s = document.getElementById(id + '_month').style.width;
|
1052 |
+
w_month_size = s.substring(0, s.length - 2);
|
1053 |
+
|
1054 |
+
s = document.getElementById(id + '_year').style.width;
|
1055 |
+
w_year_size = s.substring(0, s.length - 2);
|
1056 |
+
|
1057 |
+
if (w_year_type == 'SELECT') {
|
1058 |
+
w_from = document.getElementById(id + '_year').getAttribute('from');
|
1059 |
+
w_to = document.getElementById(id + '_year').getAttribute('to');
|
1060 |
+
}
|
1061 |
+
else {
|
1062 |
+
w_from = '1901';
|
1063 |
+
w_to = '2012';
|
1064 |
+
}
|
1065 |
+
w_divider = document.getElementById(id + '_separator1').innerHTML;
|
1066 |
+
type_date_fields(gen, w_field_label, 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, w_attr_name, w_attr_value);
|
1067 |
+
add(0);
|
1068 |
+
break;
|
1069 |
+
}
|
1070 |
+
case 'type_own_select':
|
1071 |
+
{
|
1072 |
+
for (k = 0; k < 100; k++)
|
1073 |
+
if (document.getElementById(id + "_option" + k)) {
|
1074 |
+
w_choices[t] = document.getElementById(id + "_option" + k).innerHTML;
|
1075 |
+
w_choices_checked[t] = document.getElementById(id + "_option" + k).selected;
|
1076 |
+
if (document.getElementById(id + "_option" + k).value == "")
|
1077 |
+
w_choices_disabled[t] = true;
|
1078 |
+
else
|
1079 |
+
w_choices_disabled[t] = false;
|
1080 |
+
t++;
|
1081 |
+
}
|
1082 |
|
1083 |
+
atrs = return_attributes(id + '_element');
|
1084 |
+
w_attr_name = atrs[0];
|
1085 |
+
w_attr_value = atrs[1];
|
1086 |
+
type_own_select(gen, w_field_label, w_field_label_pos, w_size, w_choices, w_choices_checked, w_required, w_class, w_attr_name, w_attr_value, w_choices_disabled);
|
1087 |
+
add(0);
|
1088 |
+
break;
|
1089 |
+
}
|
1090 |
+
case 'type_country':
|
1091 |
+
{
|
1092 |
+
w_countries = [];
|
1093 |
+
|
1094 |
+
select_ = document.getElementById(id + '_element');
|
1095 |
+
n = select_.childNodes.length;
|
1096 |
+
for (i = 0; i < n; i++) {
|
1097 |
+
w_countries.push(select_.childNodes[i].value);
|
1098 |
+
}
|
1099 |
+
|
1100 |
+
atrs = return_attributes(id + '_element');
|
1101 |
+
w_attr_name = atrs[0];
|
1102 |
+
w_attr_value = atrs[1];
|
1103 |
+
type_country(gen, w_field_label, w_countries, w_field_label_pos, w_size, w_required, w_class, w_attr_name, w_attr_value);
|
1104 |
+
add(0);
|
1105 |
+
break;
|
1106 |
+
}
|
1107 |
+
case 'type_file_upload':
|
1108 |
+
{
|
1109 |
+
w_destination = document.getElementById(id + "_destination").value.replace("***destinationverj" + id + "***", "").replace("***destinationskizb" + id + "***", "");
|
1110 |
+
w_extension = document.getElementById(id + "_extension").value.replace("***extensionverj" + id + "***", "").replace("***extensionskizb" + id + "***", "");
|
1111 |
+
w_max_size = document.getElementById(id + "_max_size").value.replace("***max_sizeverj" + id + "***", "").replace("***max_sizeskizb" + id + "***", "");
|
1112 |
+
|
1113 |
+
atrs = return_attributes(id + '_element');
|
1114 |
+
w_attr_name = atrs[0];
|
1115 |
+
w_attr_value = atrs[1];
|
1116 |
+
type_file_upload(gen, w_field_label, w_field_label_pos, w_destination, w_extension, w_max_size, w_required, w_class, w_attr_name, w_attr_value);
|
1117 |
+
add(0);
|
1118 |
+
break;
|
1119 |
+
}
|
1120 |
+
case 'type_map':
|
1121 |
+
{
|
1122 |
|
1123 |
+
w_lat = [];
|
1124 |
+
w_long = [];
|
1125 |
+
w_info = [];
|
1126 |
|
1127 |
+
w_zoom = document.getElementById(id + "_element").getAttribute("zoom");
|
1128 |
+
w_width = parseInt(document.getElementById(id + "_element").style.width);
|
1129 |
+
w_height = parseInt(document.getElementById(id + "_element").style.height);
|
1130 |
|
|
|
1131 |
|
1132 |
+
w_lat.push(document.getElementById(id + "_element").getAttribute("lat"));
|
1133 |
+
w_long.push(document.getElementById(id + "_element").getAttribute("long"));
|
1134 |
+
w_info.push(document.getElementById(id + "_element").getAttribute("info"));
|
|
|
|
|
1135 |
|
1136 |
+
atrs = return_attributes(id + '_element');
|
1137 |
+
w_attr_name = atrs[0];
|
1138 |
+
w_attr_value = atrs[1];
|
1139 |
+
type_map(gen, w_long, w_lat, w_long, w_lat, w_zoom, w_width, w_height, w_class, w_info, w_attr_name, w_attr_value);
|
1140 |
+
add(0);
|
1141 |
+
break;
|
1142 |
+
}
|
1143 |
+
case 'type_submit_reset':
|
1144 |
+
{
|
1145 |
+
atrs = return_attributes(id + '_element_submit');
|
1146 |
+
w_act = !(document.getElementById(id + "_element_reset").style.display == "none");
|
1147 |
+
w_attr_name = atrs[0];
|
1148 |
+
w_attr_value = atrs[1];
|
1149 |
+
w_submit_title = document.getElementById(id + "_element_submit").value;
|
1150 |
+
w_reset_title = document.getElementById(id + "_element_reset").value;
|
1151 |
+
type_submit_reset(gen, w_submit_title, w_reset_title, w_class, w_act, w_attr_name, w_attr_value);
|
1152 |
+
add(0);
|
1153 |
+
break;
|
1154 |
+
}
|
1155 |
|
1156 |
+
case 'type_button':
|
1157 |
+
{
|
1158 |
+
w_title = new Array();
|
1159 |
+
|
1160 |
+
w_func = new Array();
|
1161 |
+
t = 0;
|
1162 |
+
v = 0;
|
1163 |
+
for (k = 0; k < 100; k++)
|
1164 |
+
if (document.getElementById(id + "_element" + k)) {
|
1165 |
+
w_title[t] = document.getElementById(id + "_element" + k).value;
|
1166 |
+
w_func[t] = document.getElementById(id + "_element" + k).getAttribute("onclick");
|
1167 |
+
t++;
|
1168 |
+
v = k;
|
1169 |
+
}
|
1170 |
+
atrs = return_attributes(id + '_element' + v);
|
1171 |
+
w_attr_name = atrs[0];
|
1172 |
+
w_attr_value = atrs[1];
|
1173 |
+
type_button(gen, w_title, w_func, w_class, w_attr_name, w_attr_value);
|
1174 |
+
add(0);
|
1175 |
+
break;
|
1176 |
+
}
|
1177 |
+
case 'type_hidden':
|
1178 |
+
{
|
1179 |
+
w_value = document.getElementById(id + "_element").value;
|
1180 |
+
w_name = document.getElementById(id + "_element").name;
|
1181 |
+
|
1182 |
+
atrs = return_attributes(id + '_element');
|
1183 |
+
w_attr_name = atrs[0];
|
1184 |
+
w_attr_value = atrs[1];
|
1185 |
+
type_hidden(gen, w_name, w_value, w_attr_name, w_attr_value);
|
1186 |
+
add(0);
|
1187 |
+
break;
|
1188 |
+
}
|
1189 |
|
1190 |
+
case 'type_captcha':
|
1191 |
+
{
|
1192 |
+
w_digit = document.getElementById("wd_captcha").getAttribute("digit");
|
1193 |
+
atrs = return_attributes('wd_captcha');
|
1194 |
+
w_attr_name = atrs[0];
|
1195 |
+
w_attr_value = atrs[1];
|
1196 |
+
type_captcha(gen, w_field_label, w_field_label_pos, w_digit, w_class, w_attr_name, w_attr_value);
|
1197 |
+
add(0);
|
1198 |
+
break;
|
1199 |
+
}
|
1200 |
|
|
|
|
|
|
|
1201 |
|
1202 |
+
}
|
1203 |
|
|
|
1204 |
|
1205 |
+
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
1206 |
+
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1207 |
}
|
|
|
1208 |
|
1209 |
+
plugin_url = document.getElementById('form_plugins_url').value;
|
|
|
1210 |
|
|
|
1211 |
</script>
|
|
|
1212 |
|
1213 |
+
<input type="hidden" name="option" value="com_formmaker"/>
|
|
|
|
|
|
|
|
|
1214 |
|
1215 |
+
<input type="hidden" name="id" value="<?php echo $row->id?>"/>
|
|
|
|
|
1216 |
|
1217 |
+
<input type="hidden" name="cid[]" value="<?php echo $row->id; ?>"/>
|
|
|
|
|
|
|
1218 |
|
1219 |
+
<input type="hidden" name="task" value=""/>
|
1220 |
+
<input type="hidden" id="araqel" value="0"/>
|
1221 |
|
1222 |
+
</form>
|
1223 |
|
1224 |
+
<?php
|
1225 |
+
}
|
1226 |
|
1227 |
+
function html_forchrome_update() {
|
1228 |
+
?>
|
1229 |
+
<script type="text/javascript">
|
1230 |
|
1231 |
|
1232 |
+
window.onload = val;
|
1233 |
|
1234 |
+
function val() {
|
1235 |
+
var form = document.adminForm;
|
1236 |
+
submitform();
|
1237 |
+
}
|
1238 |
+
function submitform(pressbutton) {
|
1239 |
|
1240 |
+
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=update";
|
1241 |
+
document.getElementById('adminForm').submit();
|
1242 |
|
1243 |
+
}
|
1244 |
+
</script>
|
1245 |
+
<form action="admin.php?page=Form_maker&id=<?php echo $id; ?>" method="post" id="adminForm" name="adminForm">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1246 |
|
1247 |
|
1248 |
+
</form>
|
1249 |
+
<?php
|
1250 |
+
}
|
1251 |
|
1252 |
+
function update_complete() {
|
1253 |
+
?>
|
1254 |
|
1255 |
+
<div class="updated"><p><strong><?php _e('All forms are updated!'); ?></strong></p></div>
|
1256 |
+
<?php
|
|
|
|
|
1257 |
}
|
1258 |
+
|
1259 |
+
function html_display_form_lists($rows, $pageNav, $sort, $old_version, $can_update_form) {
|
1260 |
+
global $wpdb;
|
1261 |
+
?>
|
1262 |
+
<script language="javascript">
|
1263 |
+
function confirmation(href, title) {
|
1264 |
+
var answer = confirm("Are you sure you want to delete '" + title + "'?")
|
1265 |
+
if (answer) {
|
1266 |
+
document.getElementById('admin_form').action = href;
|
1267 |
+
document.getElementById('admin_form').submit();
|
1268 |
+
}
|
1269 |
+
}
|
1270 |
+
function ordering(name, as_or_desc) {
|
1271 |
+
document.getElementById('asc_or_desc').value = as_or_desc;
|
1272 |
+
document.getElementById('order_by').value = name;
|
1273 |
+
document.getElementById('admin_form').submit();
|
1274 |
+
}
|
1275 |
+
function doNothing() {
|
1276 |
+
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
1277 |
+
if (keyCode == 13) {
|
1278 |
+
|
1279 |
+
|
1280 |
+
if (!e) var e = window.event;
|
1281 |
+
|
1282 |
+
e.cancelBubble = true;
|
1283 |
+
e.returnValue = false;
|
1284 |
+
|
1285 |
+
if (e.stopPropagation) {
|
1286 |
+
e.stopPropagation();
|
1287 |
+
e.preventDefault();
|
1288 |
+
}
|
1289 |
+
}
|
1290 |
+
}
|
1291 |
+
</script>
|
1292 |
+
<style>.calendar .button {
|
1293 |
+
display: table-cell !important;
|
1294 |
}
|
1295 |
+
</style>
|
1296 |
+
|
1297 |
+
<form method="post" onkeypress="doNothing()" action="admin.php?page=Form_maker" id="admin_form" name="admin_form">
|
1298 |
+
<br />
|
1299 |
+
<div style="font-size:14px; font-weight:bold">
|
1300 |
+
<a href="http://web-dorado.com/wordpress-form-maker-guide-2.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
|
1301 |
+
<br />
|
1302 |
+
This section allows you to create forms.
|
1303 |
+
<a href="http://web-dorado.com/wordpress-form-maker-guide-2.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
1304 |
+
</div>
|
1305 |
+
<table cellspacing="10" width="100%">
|
1306 |
<tr>
|
1307 |
+
<td style="width:50px">
|
1308 |
+
<img src="<?php echo plugins_url("images/formmakerLogo-48.png", __FILE__); ?>"/>
|
1309 |
+
</td>
|
1310 |
+
<td style="width:140px;">
|
1311 |
+
<h2 style="vertical-align:top;">Form Maker</h2></td>
|
1312 |
+
<td style="width:90px; text-align:right;"><input class="button-secondary action" type="button" value="Add a Form"
|
1313 |
+
name="custom_parametrs"
|
1314 |
+
onclick="window.location.href='admin.php?page=Form_maker&task=add_form'"/>
|
1315 |
+
</td>
|
1316 |
+
<?php if ($old_version && $can_update_form) { ?>
|
1317 |
+
<td style="width:90px; text-align:right;"><input class="button-primary action" type="button" value=" Update Forms"
|
1318 |
+
name="update_forms"
|
1319 |
+
onclick="window.location.href='admin.php?page=Form_maker&task=update'"/>
|
1320 |
+
</td><?php } if (!$can_update_form && $old_version) { ?>
|
1321 |
+
<td style="width:90px; text-align:right;"><input class="button-primary action" type="button" value=" Update Forms"
|
1322 |
+
name="update_forms"
|
1323 |
+
onclick="alert('You cant update the forms of pro version with the free version. Please get the pro version')"/>
|
1324 |
+
</td><?php }?>
|
1325 |
+
<td>
|
1326 |
+
<div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:90%">
|
1327 |
+
<a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank"
|
1328 |
+
style="color:red; text-decoration:none;">
|
1329 |
+
<img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="www.web-dorado.com"
|
1330 |
+
width="215"><br>
|
1331 |
+
Get the full version
|
1332 |
+
</a>
|
1333 |
+
</div>
|
1334 |
+
</td>
|
1335 |
</tr>
|
1336 |
+
</table>
|
1337 |
+
<?php
|
1338 |
+
$serch_value = "";
|
1339 |
+
if (isset($_POST['serch_or_not'])) {
|
1340 |
if (esc_html($_POST['serch_or_not']) == "search") {
|
1341 |
$serch_value = esc_html($_POST['search_events_by_title']);
|
1342 |
}
|
1343 |
else {
|
1344 |
$serch_value = "";
|
1345 |
}
|
1346 |
+
}
|
1347 |
+
$serch_fields = '<div class="alignleft actions" style="width:180px;">
|
1348 |
<label for="search_events_by_title" style="font-size:14px">Title: </label>
|
1349 |
+
<input type="text" name="search_events_by_title" value="' . $serch_value . '" id="search_events_by_title" onchange="clear_serch_texts()">
|
1350 |
</div>
|
1351 |
<div class="alignleft actions">
|
1352 |
<input type="button" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\'; document.getElementById(\'serch_or_not\').value=\'search\';
|
1353 |
document.getElementById(\'admin_form\').submit();" class="button-secondary action">
|
1354 |
<input type="button" value="Reset" onclick="window.location.href=\'admin.php?page=Form_maker\'" class="button-secondary action">
|
1355 |
</div>';
|
1356 |
+
print_html_nav($pageNav['total'], $pageNav['limit'], $serch_fields);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1357 |
|
1358 |
+
?>
|
1359 |
+
<table class="wp-list-table widefat fixed pages" style="width:95%">
|
1360 |
+
<thead>
|
1361 |
+
<TR>
|
1362 |
+
<th scope="col" id="id" class="<?php if ($sort["sortid_by"] == "id")
|
1363 |
+
echo $sort["custom_style"];
|
1364 |
+
else echo $sort["default_style"]; ?>" style="width:110px"><a
|
1365 |
+
href="javascript:ordering('id',<?php if ($sort["sortid_by"] == "id")
|
1366 |
+
echo $sort["1_or_2"];
|
1367 |
+
else echo "1"; ?>)"><span>ID</span><span class="sorting-indicator"></span></a></th>
|
1368 |
+
<th scope="col" id="title" class="<?php if ($sort["sortid_by"] == "title")
|
1369 |
+
echo $sort["custom_style"];
|
1370 |
+
else echo $sort["default_style"]; ?>" style=""><a
|
1371 |
+
href="javascript:ordering('title',<?php if ($sort["sortid_by"] == "title")
|
1372 |
+
echo $sort["1_or_2"];
|
1373 |
+
else echo "1"; ?>)"><span>Title</span><span class="sorting-indicator"></span></a></th>
|
1374 |
+
<th scope="col" id="mail" class="<?php if ($sort["sortid_by"] == "mail")
|
1375 |
+
echo $sort["custom_style"];
|
1376 |
+
else echo $sort["default_style"]; ?>"><a href="javascript:ordering('mail',<?php if ($sort["sortid_by"] == "mail")
|
1377 |
+
echo $sort["1_or_2"];
|
1378 |
+
else echo "1"; ?>)"><span>Email to send submissions to</span><span class="sorting-indicator"></span></a></th>
|
1379 |
+
<th style="width:80px">Edit</th>
|
1380 |
+
<th style="width:80px">Delete</th>
|
1381 |
+
</TR>
|
1382 |
+
</thead>
|
1383 |
+
<tbody>
|
1384 |
+
<?php for ($i = 0; $i < count($rows); $i++) { ?>
|
1385 |
+
<tr>
|
1386 |
+
<?php
|
1387 |
+
$old_version = FALSE;
|
1388 |
+
if (strpos($rows[$i]->form, "wdform_table1") === FALSE) {
|
1389 |
+
$old_version = TRUE;
|
1390 |
+
}
|
1391 |
+
?>
|
1392 |
+
|
1393 |
+
|
1394 |
+
|
1395 |
+
<td><?php if (!$old_version) { ?><a
|
1396 |
+
href="admin.php?page=Form_maker&task=edit_form&id=<?php echo $rows[$i]->id?>"><?php echo $rows[$i]->id; ?></a><?php }
|
1397 |
+
else { ?> <p style="color:red; cursor:pointer; margin:0px"
|
1398 |
+
onclick="alert('Update forms to new version!')"><?php echo $rows[$i]->id; ?></p><?php }?></td>
|
1399 |
+
<td><?php if (!$old_version) { ?><a
|
1400 |
+
href="admin.php?page=Form_maker&task=edit_form&id=<?php echo $rows[$i]->id?>"><?php echo $rows[$i]->title; ?></a><?php }
|
1401 |
+
else { ?> <p style="color:red; cursor:pointer; margin:0px"
|
1402 |
+
onclick="alert('Update forms to new version!')"><?php echo $rows[$i]->title; ?></p><?php }?></td>
|
1403 |
+
<td><?php echo $rows[$i]->mail; ?></td>
|
1404 |
+
<td><?php if (!$old_version) { ?><a href="admin.php?page=Form_maker&task=edit_form&id=<?php echo $rows[$i]->id?>">Edit</a><?php }
|
1405 |
+
else { ?> <p style="color:red; cursor:pointer; margin:0px" onclick="alert('Update forms to new version!')">
|
1406 |
+
Edit</p><?php }?></td>
|
1407 |
+
<td><a
|
1408 |
+
href="javascript:confirmation('admin.php?page=Form_maker&task=remove_form&id=<?php echo $rows[$i]->id?>','<?php echo $rows[$i]->title; ?>')">Delete</a>
|
1409 |
+
</td>
|
1410 |
+
</tr>
|
1411 |
+
<?php } ?>
|
1412 |
+
</tbody>
|
1413 |
+
</table>
|
1414 |
+
<input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if (isset($_POST['asc_or_desc']))
|
1415 |
+
echo esc_html($_POST['asc_or_desc']);?>"/>
|
1416 |
+
<input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by']))
|
1417 |
+
echo esc_html($_POST['order_by']);?>"/>
|
1418 |
|
1419 |
+
<?php
|
1420 |
+
?>
|
1421 |
|
1422 |
|
1423 |
+
</form>
|
1424 |
+
<?php
|
1425 |
}
|
1426 |
|
1427 |
+
function html_add_form($themes) {
|
1428 |
+
?>
|
1429 |
+
<script type="text/javascript">
|
1430 |
+
var thickDims, tbWidth, tbHeight;
|
1431 |
+
jQuery(document).ready(function ($) {
|
1432 |
+
thickDims = function () {
|
1433 |
+
var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
|
1434 |
+
w = (tbWidth && tbWidth < W - 90) ? tbWidth : W - 40;
|
1435 |
+
h = (tbHeight && tbHeight < H - 60) ? tbHeight : H - 40;
|
1436 |
+
if (tbWindow.size()) {
|
1437 |
+
tbWindow.width(w).height(h);
|
1438 |
+
$('#TB_iframeContent').width(w).height(h - 27);
|
1439 |
+
tbWindow.css({'margin-left':'-' + parseInt((w / 2), 10) + 'px'});
|
1440 |
+
if (typeof document.body.style.maxWidth != 'undefined')
|
1441 |
+
tbWindow.css({'top':(H - h) / 2, 'margin-top':'0'});
|
1442 |
+
}
|
1443 |
+
};
|
1444 |
+
thickDims();
|
1445 |
+
$(window).resize(function () {
|
1446 |
+
thickDims()
|
1447 |
+
});
|
1448 |
+
|
1449 |
+
$('a.thickbox-preview').click(function () {
|
1450 |
+
tb_click.call(this);
|
1451 |
+
|
1452 |
+
var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text;
|
1453 |
+
|
1454 |
+
if (tbWidth = href.match(/&tbWidth=[0-9]+/))
|
1455 |
+
tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
|
1456 |
+
else
|
1457 |
+
tbWidth = $(window).width() - 120;
|
1458 |
+
|
1459 |
+
if (tbHeight = href.match(/&tbHeight=[0-9]+/))
|
1460 |
+
tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
|
1461 |
+
else
|
1462 |
+
tbHeight = $(window).height() - 120;
|
1463 |
+
|
1464 |
+
if (alink.length) {
|
1465 |
+
url = alink.attr('href') || '';
|
1466 |
+
text = alink.attr('title') || '';
|
1467 |
+
link = ' <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
|
1468 |
+
} else {
|
1469 |
+
text = $(this).attr('title') || '';
|
1470 |
+
link = ' <span class="tb-theme-preview-link">' + text + '</span>';
|
1471 |
+
}
|
1472 |
+
$('#TB_title').css({'background-color':'#222', 'color':'#dfdfdf'});
|
1473 |
+
$('#TB_closeAjaxWindow').css({'float':'left'});
|
1474 |
+
$('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
|
1475 |
+
$('#TB_iframeContent').width('100%');
|
1476 |
+
thickDims();
|
1477 |
+
return false;
|
1478 |
+
});
|
1479 |
+
|
1480 |
+
// Theme details
|
1481 |
+
$('.theme-detail').click(function () {
|
1482 |
+
$(this).siblings('.themedetaildiv').toggle();
|
1483 |
+
return false;
|
1484 |
+
});
|
1485 |
|
1486 |
+
});
|
1487 |
+
var already_submitted = false;
|
1488 |
+
function refresh_() {
|
1489 |
+
document.getElementById('form').value = document.getElementById('take').innerHTML;
|
1490 |
+
document.getElementById('counter').value = gen;
|
1491 |
+
n = gen;
|
1492 |
+
for (i = 0; i < n; i++) {
|
1493 |
+
if (document.getElementById(i)) {
|
1494 |
+
for (z = 0; z < document.getElementById(i).childNodes.length; z++)
|
1495 |
+
if (document.getElementById(i).childNodes[z].nodeType == 3)
|
1496 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
|
1497 |
+
if (document.getElementById(i).getAttribute('type') == "type_captcha" || document.getElementById(i).getAttribute('type') == "type_recaptcha") {
|
1498 |
+
if (document.getElementById(i).childNodes[10]) {
|
1499 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1500 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1501 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1502 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1503 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1504 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1505 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1506 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1507 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1508 |
+
}
|
1509 |
+
else {
|
1510 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1511 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1512 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1513 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1514 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1515 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1516 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1517 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1518 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1519 |
+
}
|
1520 |
+
continue;
|
1521 |
+
}
|
1522 |
+
|
1523 |
+
if (document.getElementById(i).getAttribute('type') == "type_section_break") {
|
1524 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1525 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1526 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1527 |
+
continue;
|
1528 |
+
}
|
1529 |
+
|
1530 |
+
|
1531 |
+
if (document.getElementById(i).childNodes[10]) {
|
1532 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1533 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1534 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1535 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1536 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1537 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1538 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1539 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1540 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
1541 |
+
}
|
1542 |
+
else {
|
1543 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1544 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1545 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1546 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1547 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1548 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1549 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1550 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1551 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
1552 |
+
}
|
1553 |
+
}
|
1554 |
+
}
|
1555 |
+
|
1556 |
+
for (i = 0; i <= n; i++) {
|
1557 |
+
if (document.getElementById(i)) {
|
1558 |
+
type = document.getElementById(i).getAttribute("type");
|
1559 |
+
switch (type) {
|
1560 |
+
case "type_text":
|
1561 |
+
case "type_number":
|
1562 |
+
case "type_password":
|
1563 |
+
case "type_submitter_mail":
|
1564 |
+
case "type_own_select":
|
1565 |
+
case "type_country":
|
1566 |
+
case "type_hidden":
|
1567 |
+
case "type_map":
|
1568 |
+
{
|
1569 |
+
remove_add_(i + "_elementform_id_temp");
|
1570 |
+
break;
|
1571 |
+
}
|
1572 |
|
1573 |
+
case "type_submit_reset":
|
1574 |
+
{
|
1575 |
+
remove_add_(i + "_element_submitform_id_temp");
|
1576 |
+
if (document.getElementById(i + "_element_resetform_id_temp"))
|
1577 |
+
remove_add_(i + "_element_resetform_id_temp");
|
1578 |
+
break;
|
1579 |
+
}
|
1580 |
|
1581 |
+
case "type_captcha":
|
1582 |
+
{
|
1583 |
+
remove_add_("_wd_captchaform_id_temp");
|
1584 |
+
remove_add_("_element_refreshform_id_temp");
|
1585 |
+
remove_add_("_wd_captcha_inputform_id_temp");
|
1586 |
+
break;
|
1587 |
+
}
|
1588 |
|
1589 |
+
case "type_recaptcha":
|
1590 |
+
{
|
1591 |
+
document.getElementById("public_key").value = document.getElementById("wd_recaptchaform_id_temp").getAttribute("public_key");
|
1592 |
+
document.getElementById("private_key").value = document.getElementById("wd_recaptchaform_id_temp").getAttribute("private_key");
|
1593 |
+
document.getElementById("recaptcha_theme").value = document.getElementById("wd_recaptchaform_id_temp").getAttribute("theme");
|
1594 |
+
document.getElementById('wd_recaptchaform_id_temp').innerHTML = '';
|
1595 |
+
remove_add_("wd_recaptchaform_id_temp");
|
1596 |
+
break;
|
1597 |
+
}
|
1598 |
|
1599 |
+
case "type_file_upload":
|
1600 |
+
{
|
1601 |
+
remove_add_(i + "_elementform_id_temp");
|
1602 |
+
break;
|
1603 |
+
}
|
1604 |
|
1605 |
+
case "type_textarea":
|
1606 |
+
{
|
1607 |
+
remove_add_(i + "_elementform_id_temp");
|
1608 |
|
1609 |
+
break;
|
1610 |
+
}
|
1611 |
|
1612 |
+
case "type_name":
|
1613 |
+
{
|
1614 |
|
1615 |
+
if (document.getElementById(i + "_element_titleform_id_temp")) {
|
1616 |
+
remove_add_(i + "_element_titleform_id_temp");
|
1617 |
+
remove_add_(i + "_element_firstform_id_temp");
|
1618 |
+
remove_add_(i + "_element_lastform_id_temp");
|
1619 |
+
remove_add_(i + "_element_middleform_id_temp");
|
1620 |
+
}
|
1621 |
+
else {
|
1622 |
+
remove_add_(i + "_element_firstform_id_temp");
|
1623 |
+
remove_add_(i + "_element_lastform_id_temp");
|
1624 |
|
1625 |
+
}
|
1626 |
+
break;
|
1627 |
|
1628 |
+
}
|
|
|
1629 |
|
1630 |
+
case "type_phone":
|
1631 |
+
{
|
1632 |
|
1633 |
+
remove_add_(i + "_element_firstform_id_temp");
|
1634 |
+
remove_add_(i + "_element_lastform_id_temp");
|
|
|
|
|
|
|
|
|
|
|
|
|
1635 |
|
1636 |
+
break;
|
|
|
1637 |
|
1638 |
+
}
|
1639 |
+
case "type_address":
|
1640 |
+
{
|
1641 |
+
remove_add_(i + "_street1form_id_temp");
|
1642 |
+
remove_add_(i + "_street2form_id_temp");
|
1643 |
+
remove_add_(i + "_cityform_id_temp");
|
1644 |
+
remove_add_(i + "_stateform_id_temp");
|
1645 |
+
remove_add_(i + "_postalform_id_temp");
|
1646 |
+
remove_add_(i + "_countryform_id_temp");
|
1647 |
|
1648 |
+
break;
|
1649 |
|
1650 |
+
}
|
|
|
|
|
|
|
1651 |
|
1652 |
+
case "type_checkbox":
|
1653 |
+
case "type_radio":
|
1654 |
+
{
|
1655 |
+
is = true;
|
1656 |
+
for (j = 0; j < 100; j++)
|
1657 |
+
if (document.getElementById(i + "_elementform_id_temp" + j)) {
|
1658 |
+
remove_add_(i + "_elementform_id_temp" + j);
|
1659 |
+
}
|
1660 |
+
break;
|
1661 |
+
}
|
|
|
|
|
|
|
1662 |
|
1663 |
+
case "type_button":
|
1664 |
+
{
|
1665 |
+
for (j = 0; j < 100; j++)
|
1666 |
+
if (document.getElementById(i + "_elementform_id_temp" + j)) {
|
1667 |
+
remove_add_(i + "_elementform_id_temp" + j);
|
1668 |
+
}
|
1669 |
+
break;
|
1670 |
+
}
|
1671 |
|
1672 |
+
case "type_time":
|
1673 |
+
{
|
1674 |
+
if (document.getElementById(i + "_ssform_id_temp")) {
|
1675 |
+
remove_add_(i + "_ssform_id_temp");
|
1676 |
+
remove_add_(i + "_mmform_id_temp");
|
1677 |
+
remove_add_(i + "_hhform_id_temp");
|
1678 |
+
}
|
1679 |
+
else {
|
1680 |
+
remove_add_(i + "_mmform_id_temp");
|
1681 |
+
remove_add_(i + "_hhform_id_temp");
|
1682 |
+
}
|
1683 |
+
break;
|
1684 |
|
1685 |
+
}
|
|
|
1686 |
|
1687 |
+
case "type_date":
|
1688 |
+
{
|
1689 |
+
remove_add_(i + "_elementform_id_temp");
|
1690 |
+
remove_add_(i + "_buttonform_id_temp");
|
1691 |
+
break;
|
1692 |
+
}
|
1693 |
+
case "type_date_fields":
|
1694 |
+
{
|
1695 |
+
remove_add_(i + "_dayform_id_temp");
|
1696 |
+
remove_add_(i + "_monthform_id_temp");
|
1697 |
+
remove_add_(i + "_yearform_id_temp");
|
1698 |
+
break;
|
1699 |
+
}
|
1700 |
+
}
|
1701 |
+
}
|
1702 |
+
}
|
1703 |
+
|
1704 |
+
for (i = 1; i <= form_view_max; i++)
|
1705 |
+
if (document.getElementById('form_id_tempform_view' + i)) {
|
1706 |
+
if (document.getElementById('page_next_' + i))
|
1707 |
+
document.getElementById('page_next_' + i).removeAttribute('src');
|
1708 |
+
if (document.getElementById('page_previous_' + i))
|
1709 |
+
document.getElementById('page_previous_' + i).removeAttribute('src');
|
1710 |
+
document.getElementById('form_id_tempform_view' + i).parentNode.removeChild(document.getElementById('form_id_tempform_view_img' + i));
|
1711 |
+
document.getElementById('form_id_tempform_view' + i).removeAttribute('style');
|
1712 |
+
}
|
1713 |
|
1714 |
+
document.getElementById('form_front').value = document.getElementById('take').innerHTML;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1715 |
|
1716 |
}
|
1717 |
|
1718 |
+
function submitform(pressbutton) {
|
1719 |
+
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
1720 |
+
document.getElementById('adminForm').submit();
|
|
|
|
|
1721 |
}
|
1722 |
|
1723 |
|
1724 |
+
function submitbutton(pressbutton) {
|
1725 |
+
var form = document.adminForm;
|
1726 |
+
if (already_submitted) {
|
1727 |
+
submitform(pressbutton);
|
1728 |
+
return;
|
1729 |
+
}
|
1730 |
+
if (pressbutton == 'cancel') {
|
1731 |
+
submitform(pressbutton);
|
1732 |
+
return;
|
1733 |
+
}
|
1734 |
+
if (form.title.value == "") {
|
1735 |
+
alert("The form must have a title.");
|
1736 |
+
return;
|
1737 |
+
}
|
1738 |
+
tox = '';
|
1739 |
+
for (t = 1; t <= form_view_max; t++) {
|
1740 |
+
if (document.getElementById('form_id_tempform_view' + t)) {
|
1741 |
+
form_view_element = document.getElementById('form_id_tempform_view' + t);
|
1742 |
+
n = form_view_element.childNodes.length - 2;
|
1743 |
+
|
1744 |
+
for (z = 0; z <= n; z++) {
|
1745 |
+
if (form_view_element.childNodes[z].nodeType != 3)
|
1746 |
+
if (!form_view_element.childNodes[z].id) {
|
1747 |
+
GLOBAL_tr = form_view_element.childNodes[z];
|
1748 |
+
//////////////////////////////////////////////////////////////////////////////////////////
|
1749 |
+
for (x = 0; x < GLOBAL_tr.firstChild.childNodes.length; x++) {
|
1750 |
+
table = GLOBAL_tr.firstChild.childNodes[x];
|
1751 |
+
tbody = table.firstChild;
|
1752 |
+
for (y = 0; y < tbody.childNodes.length; y++) {
|
1753 |
+
tr = tbody.childNodes[y];
|
1754 |
+
l_label = document.getElementById(tr.id + '_element_labelform_id_temp').innerHTML;
|
1755 |
+
l_label = l_label.replace(/(\r\n|\n|\r)/gm, " ");
|
1756 |
+
|
1757 |
+
if (tr.getAttribute('type') == "type_address") {
|
1758 |
+
addr_id = parseInt(tr.id);
|
1759 |
+
tox = tox + addr_id + '#**id**#' + 'Street Line' + '#**label**#' + tr.getAttribute('type') + '#****#';
|
1760 |
+
addr_id++;
|
1761 |
+
tox = tox + addr_id + '#**id**#' + 'Street Line2' + '#**label**#' + tr.getAttribute('type') + '#****#';
|
1762 |
+
addr_id++;
|
1763 |
+
tox = tox + addr_id + '#**id**#' + 'City' + '#**label**#' + tr.getAttribute('type') + '#****#';
|
1764 |
+
addr_id++;
|
1765 |
+
tox = tox + addr_id + '#**id**#' + 'State' + '#**label**#' + tr.getAttribute('type') + '#****#';
|
1766 |
+
addr_id++;
|
1767 |
+
tox = tox + addr_id + '#**id**#' + 'Postal' + '#**label**#' + tr.getAttribute('type') + '#****#';
|
1768 |
+
addr_id++;
|
1769 |
+
tox = tox + addr_id + '#**id**#' + 'Country' + '#**label**#' + tr.getAttribute('type') + '#****#';
|
1770 |
+
}
|
1771 |
+
else
|
1772 |
+
tox = tox + tr.id + '#**id**#' + l_label + '#**label**#' + tr.getAttribute('type') + '#****#';
|
1773 |
+
}
|
1774 |
+
}
|
1775 |
+
}
|
1776 |
+
}
|
1777 |
+
}
|
1778 |
+
}
|
1779 |
|
1780 |
+
document.getElementById('label_order').value = tox;
|
1781 |
+
document.getElementById('label_order_current').value = tox;
|
1782 |
+
refresh_();
|
1783 |
+
document.getElementById('pagination').value = document.getElementById('pages').getAttribute("type");
|
1784 |
+
document.getElementById('show_title').value = document.getElementById('pages').getAttribute("show_title");
|
1785 |
+
document.getElementById('show_numbers').value = document.getElementById('pages').getAttribute("show_numbers");
|
1786 |
+
already_submitted = true;
|
1787 |
+
submitform(pressbutton);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1788 |
|
1789 |
}
|
1790 |
+
gen = 1;
|
1791 |
+
form_view = 1;
|
1792 |
+
form_view_max = 1;
|
1793 |
+
form_view_count = 1;
|
1794 |
+
|
1795 |
+
function set_preview() {
|
1796 |
+
appWidth = parseInt(document.body.offsetWidth);
|
1797 |
+
appHeight = parseInt(document.body.offsetHeight);
|
1798 |
+
document.getElementById('preview_form').href = '<?php echo admin_url('admin-ajax.php'); ?>?action=frommakerpreview&id=' + document.getElementById('theme').value + '&TB_iframe=1';
|
|
|
1799 |
}
|
1800 |
|
1801 |
+
//add main form id
|
1802 |
+
function enable() {
|
1803 |
+
for (iiiii = 0; iiiii < 1000; iiiii++) {
|
1804 |
+
if (document.getElementsByTagName("iframe")[iiiii]) {
|
1805 |
+
if (document.getElementsByTagName("iframe")[iiiii].id == 'form_maker_editor_ifr') {
|
1806 |
+
id_ifr_editor = iiiii;
|
1807 |
+
break;
|
1808 |
+
}
|
1809 |
+
}
|
1810 |
+
}
|
1811 |
+
alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal');
|
1812 |
+
for (x = 0; x < 13; x++) {
|
1813 |
+
document.getElementById('img_' + alltypes[x]).src = "<?php echo plugins_url("images",__FILE__) ?>/" + alltypes[x] + ".png";
|
1814 |
+
}
|
1815 |
+
if (document.getElementById('formMakerDiv').style.display == 'block') {
|
1816 |
+
jQuery('#formMakerDiv').slideToggle(200);
|
1817 |
+
}
|
1818 |
+
else {
|
1819 |
+
jQuery('#formMakerDiv').slideToggle(400);
|
1820 |
+
}
|
1821 |
+
if (document.getElementById('formMakerDiv').offsetWidth) {
|
1822 |
+
document.getElementById('formMakerDiv1').style.width = (document.getElementById('formMakerDiv').offsetWidth - 60) + 'px';
|
1823 |
+
}
|
1824 |
+
if (document.getElementById('formMakerDiv1').style.display == 'block') {
|
1825 |
+
jQuery('#formMakerDiv1').slideToggle(200);
|
1826 |
+
}
|
1827 |
+
else {
|
1828 |
+
jQuery('#formMakerDiv1').slideToggle(400);
|
1829 |
+
}
|
1830 |
+
document.getElementById('when_edit').style.display = 'none';
|
1831 |
+
}
|
1832 |
|
1833 |
+
function enable2() {
|
1834 |
+
alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal');
|
1835 |
+
for (x = 0; x < 13; x++) {
|
1836 |
+
document.getElementById('img_' + alltypes[x]).src = "<?php echo plugins_url("images",__FILE__) ?>/" + alltypes[x] + ".png";
|
1837 |
+
}
|
1838 |
+
if (document.getElementById('formMakerDiv').style.display == 'block') {
|
1839 |
+
jQuery('#formMakerDiv').slideToggle(200);
|
1840 |
+
}
|
1841 |
+
else {
|
1842 |
+
jQuery('#formMakerDiv').slideToggle(400);
|
1843 |
+
}
|
1844 |
+
if (document.getElementById('formMakerDiv').offsetWidth) {
|
1845 |
+
document.getElementById('formMakerDiv1').style.width = (document.getElementById('formMakerDiv').offsetWidth - 60) + 'px';
|
1846 |
+
}
|
1847 |
+
if (document.getElementById('formMakerDiv1').style.display == 'block') {
|
1848 |
+
jQuery('#formMakerDiv1').slideToggle(200);
|
1849 |
+
}
|
1850 |
+
else {
|
1851 |
+
jQuery('#formMakerDiv1').slideToggle(400);
|
1852 |
+
}
|
1853 |
+
document.getElementById('when_edit').style.display = 'block';
|
1854 |
+
if (document.getElementById('field_types').offsetWidth)
|
1855 |
+
document.getElementById('when_edit').style.width = document.getElementById('field_types').offsetWidth + 'px';
|
1856 |
+
if (document.getElementById('field_types').offsetHeight)
|
1857 |
+
document.getElementById('when_edit').style.height = document.getElementById('field_types').offsetHeight + 'px';
|
1858 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1859 |
|
|
|
|
|
1860 |
|
1861 |
+
var thickDims, tbWidth, tbHeight;
|
1862 |
+
jQuery(document).ready(function ($) {
|
1863 |
+
thickDims = function () {
|
1864 |
+
var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
|
1865 |
+
w = (tbWidth && tbWidth < W - 90) ? tbWidth : W - 40;
|
1866 |
+
h = (tbHeight && tbHeight < H - 60) ? tbHeight : H - 40;
|
1867 |
+
if (tbWindow.size()) {
|
1868 |
+
tbWindow.width(w).height(h);
|
1869 |
+
$('#TB_iframeContent').width(w).height(h - 27);
|
1870 |
+
tbWindow.css({'margin-left':'-' + parseInt((w / 2), 10) + 'px'});
|
1871 |
+
if (typeof document.body.style.maxWidth != 'undefined')
|
1872 |
+
tbWindow.css({'top':(H - h) / 2, 'margin-top':'0'});
|
1873 |
+
}
|
1874 |
+
};
|
1875 |
+
thickDims();
|
1876 |
+
$(window).resize(function () {
|
1877 |
+
thickDims()
|
1878 |
+
});
|
1879 |
+
$('a.thickbox-preview').click(function () {
|
1880 |
+
tb_click.call(this);
|
1881 |
+
var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text;
|
1882 |
+
if (tbWidth = href.match(/&tbWidth=[0-9]+/))
|
1883 |
+
tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
|
1884 |
+
else
|
1885 |
+
tbWidth = $(window).width() - 120;
|
1886 |
+
|
1887 |
+
if (tbHeight = href.match(/&tbHeight=[0-9]+/))
|
1888 |
+
tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
|
1889 |
+
else
|
1890 |
+
tbHeight = $(window).height() - 120;
|
1891 |
+
|
1892 |
+
if (alink.length) {
|
1893 |
+
url = alink.attr('href') || '';
|
1894 |
+
text = alink.attr('title') || '';
|
1895 |
+
link = ' <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
|
1896 |
+
} else {
|
1897 |
+
text = $(this).attr('title') || '';
|
1898 |
+
link = ' <span class="tb-theme-preview-link">' + text + '</span>';
|
1899 |
+
}
|
1900 |
+
$('#TB_title').css({'background-color':'#222', 'color':'#dfdfdf'});
|
1901 |
+
$('#TB_closeAjaxWindow').css({'float':'left'});
|
1902 |
+
$('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
|
1903 |
+
$('#TB_iframeContent').width('100%');
|
1904 |
+
thickDims();
|
1905 |
+
return false;
|
1906 |
+
});
|
1907 |
+
|
1908 |
+
// Theme details
|
1909 |
+
$('.theme-detail').click(function () {
|
1910 |
+
$(this).siblings('.themedetaildiv').toggle();
|
1911 |
+
return false;
|
1912 |
+
});
|
1913 |
|
1914 |
+
});
|
1915 |
|
1916 |
+
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1917 |
<style>
|
1918 |
+
.calendar .button {
|
1919 |
+
display: table-cell !important;
|
1920 |
+
}
|
1921 |
+
#when_edit {
|
1922 |
+
position: absolute;
|
1923 |
+
background-color: #666;
|
1924 |
+
z-index: 101;
|
1925 |
+
display: none;
|
1926 |
+
width: 100%;
|
1927 |
+
height: 100%;
|
1928 |
+
opacity: 0.7;
|
1929 |
+
filter: alpha(opacity = 70);
|
1930 |
+
}
|
1931 |
+
#formMakerDiv {
|
1932 |
+
position: fixed;
|
1933 |
+
background-color: #666;
|
1934 |
+
z-index: 100;
|
1935 |
+
display: none;
|
1936 |
+
left: 0;
|
1937 |
+
top: 0;
|
1938 |
+
width: 100%;
|
1939 |
+
height: 100%;
|
1940 |
+
opacity: 0.7;
|
1941 |
+
filter: alpha(opacity = 70);
|
1942 |
+
}
|
1943 |
+
#formMakerDiv1 {
|
1944 |
+
padding-top: 15px;
|
1945 |
+
position: fixed;
|
1946 |
+
z-index: 100;
|
1947 |
+
background-color: transparent;
|
1948 |
+
top: 0;
|
1949 |
+
left: 0;
|
1950 |
+
display: none;
|
1951 |
+
margin-left: 30px;
|
1952 |
+
margin-top: 15px;
|
1953 |
+
}
|
1954 |
+
.formmaker_table input {
|
1955 |
+
border-radius: 3px;
|
1956 |
+
padding: 2px;
|
1957 |
+
}
|
1958 |
+
|
1959 |
+
.formmaker_table {
|
1960 |
+
border-radius: 8px;
|
1961 |
+
border: 6px #00aeef solid;
|
1962 |
+
background-color: #00aeef;
|
1963 |
+
height: 120px;
|
1964 |
+
width: 98%;
|
1965 |
+
}
|
1966 |
</style>
|
1967 |
<?php
|
1968 |
+
foreach ($themes as $theme) {
|
1969 |
+
if ($theme->default == 1) {
|
1970 |
+
$my_selected_theme = $theme->id;
|
1971 |
+
}
|
1972 |
+
else {
|
1973 |
+
$my_selected_theme = 0;
|
1974 |
+
}
|
1975 |
+
}
|
1976 |
+
?>
|
1977 |
+
<br />
|
1978 |
+
<div style="font-size:14px; font-weight:bold">
|
1979 |
+
<a href="http://web-dorado.com/wordpress-form-maker-guide-2.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
|
1980 |
+
<br />
|
1981 |
+
This section allows you to add fields to your form.
|
1982 |
+
<a href="http://web-dorado.com/wordpress-form-maker-guide-4.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
1983 |
+
</div>
|
1984 |
+
<table width="95%">
|
1985 |
<thead>
|
1986 |
<tr>
|
1987 |
+
<td colspan="11">
|
1988 |
+
<div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
|
1989 |
+
<a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank"
|
1990 |
+
style="color:red; text-decoration:none;">
|
1991 |
+
<img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="www.web-dorado.com"
|
1992 |
+
width="215"><br>
|
1993 |
+
Get the full version
|
1994 |
+
</a>
|
1995 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1996 |
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1997 |
</tr>
|
1998 |
+
</thead>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1999 |
<tr>
|
2000 |
+
<td width="100%"><?php echo "<h2>Form Maker</h2>"; ?></td>
|
2001 |
+
<td><a id="preview_form"
|
2002 |
+
href="<?php echo admin_url('admin-ajax.php') . '?action=frommakerpreview&id=' . $my_selected_theme . '&TB_iframe=1'; ?>"
|
2003 |
+
class="thickbox-preview" title="Form Preview" onclick="return false;"><input type="button" value="preview"
|
2004 |
+
class="button-primary"/></a>
|
2005 |
+
</td>
|
2006 |
+
<td><input type="button" onclick="submitbutton('form_options')" value="Form options" class="button-primary" /></td>
|
2007 |
+
<td align="right"><input type="button" onclick="submitbutton('Save')" value="Save" class="button-secondary action"/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008 |
</td>
|
2009 |
+
<td align="right"><input type="button" onclick="submitbutton('Apply')" value="Apply"
|
2010 |
+
class="button-secondary action"/></td>
|
2011 |
+
<td align="right"><input type="button" onclick="window.location.href='admin.php?page=Form_maker'" value="Cancel"
|
2012 |
+
class="button-secondary action"/></td>
|
2013 |
</tr>
|
2014 |
</table>
|
2015 |
+
<br/>
|
|
|
|
|
|
|
|
|
2016 |
|
2017 |
+
<form action="admin.php?page=Form_maker" method="post" id="adminForm" name="adminForm" enctype="multipart/form-data">
|
2018 |
+
<div class="formmaker_table" width="100%">
|
2019 |
+
<div style="float:left; text-align:center">
|
2020 |
+
</br>
|
2021 |
+
<img src="<?php echo plugins_url("images/formMaker.png",__FILE__) ?>"/>
|
2022 |
+
</br>
|
2023 |
+
</br>
|
2024 |
+
<img src="<?php echo plugins_url("images/logo.png",__FILE__) ?>"/>
|
2025 |
+
</div>
|
2026 |
+
<div style="float:right">
|
2027 |
+
<span style="font-size:16.76pt; font-family:tahoma; color:#FFFFFF; vertical-align:middle;">Form title: </span>
|
2028 |
+
<input type="hidden" value="<?php echo plugins_url("",__FILE__) ?>" id="form_plugins_url" />
|
2029 |
+
<input id="title" name="title" style="width:160px; height:19px; border:none; font-size:11px;" value=""/>
|
2030 |
+
<br />
|
2031 |
+
<img src="<?php echo plugins_url("images/formoptions.png",__FILE__) ?>" onclick="submitbutton('form_options')" style="cursor:pointer;margin:10px 0 10px 10px; float:right"/>
|
2032 |
+
<br />
|
2033 |
+
<br />
|
2034 |
+
<br />
|
2035 |
+
<img src="<?php echo plugins_url("images/addanewfield.png",__FILE__) ?>" onclick="enable(); Enable()" style="cursor:pointer;margin:10px 0 10px 10px; float:right"/>
|
2036 |
+
</div>
|
2037 |
</div>
|
2038 |
+
<div id="formMakerDiv" onclick="close_window()"></div>
|
2039 |
+
<div id="formMakerDiv1" align="center">
|
2040 |
+
<table border="0" width="95%" cellpadding="0" cellspacing="0" height="100%"
|
2041 |
+
style="border:6px #00aeef solid; background-color:#FFF">
|
2042 |
+
<tr>
|
2043 |
+
<td style="padding:0px">
|
2044 |
+
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
|
2045 |
+
<tr valign="top">
|
2046 |
+
<td width="15%" height="100%" style="border-right:dotted black 1px;" id="field_types">
|
2047 |
+
<div id="when_edit" style="display:none"></div>
|
2048 |
+
<table border="0" cellpadding="0" cellspacing="3" width="100%">
|
2049 |
+
<tr>
|
2050 |
+
<td align="center" onClick="addRow('customHTML')" id="table_editor" class="field_buttons"><img
|
2051 |
+
src="<?php echo plugins_url("images/customHTML.png", __FILE__); ?>" style="margin:5px"
|
2052 |
+
id="img_customHTML"/></td>
|
2053 |
+
|
2054 |
+
<td align="center" onClick="addRow('text')" id="table_text" class="field_buttons"><img
|
2055 |
+
src="<?php echo plugins_url("images/text.png", __FILE__); ?>" style="margin:5px" id="img_text"/>
|
2056 |
+
</td>
|
2057 |
+
</tr>
|
2058 |
+
<tr>
|
2059 |
+
<td align="center" onClick="addRow('time_and_date')" id="table_time_and_date" class="field_buttons">
|
2060 |
+
<img src="<?php echo plugins_url("images/time_and_date.png", __FILE__); ?>" style="margin:5px"
|
2061 |
+
id="img_time_and_date"/></td>
|
2062 |
+
|
2063 |
+
<td align="center" onClick="addRow('select')" id="table_select" class="field_buttons"><img
|
2064 |
+
src="<?php echo plugins_url("images/select.png", __FILE__); ?>" style="margin:5px" id="img_select"/>
|
2065 |
+
</td>
|
2066 |
+
</tr>
|
2067 |
+
<tr>
|
2068 |
+
<td align="center" onClick="addRow('checkbox')" id="table_checkbox" class="field_buttons"><img
|
2069 |
+
src="<?php echo plugins_url("images/checkbox.png", __FILE__); ?>" style="margin:5px"
|
2070 |
+
id="img_checkbox"/></td>
|
2071 |
+
|
2072 |
+
<td align="center" onClick="addRow('radio')" id="table_radio" class="field_buttons"><img
|
2073 |
+
src="<?php echo plugins_url("images/radio.png", __FILE__); ?>" style="margin:5px" id="img_radio"/>
|
2074 |
+
</td>
|
2075 |
+
</tr>
|
2076 |
+
<tr>
|
2077 |
+
<td align="center"
|
2078 |
+
onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')"
|
2079 |
+
style="background-color: rgb(114, 113, 113) !important;" id="table_file_upload"
|
2080 |
+
class="field_buttons"><img src="<?php echo plugins_url("images/file_upload.png", __FILE__); ?>"
|
2081 |
+
style="margin:5px" id="img_file_upload"/></td>
|
2082 |
+
|
2083 |
+
<td align="center" onClick="addRow('captcha')" id="table_captcha" class="field_buttons"><img
|
2084 |
+
src="<?php echo plugins_url("images/captcha.png", __FILE__); ?>" style="margin:5px"
|
2085 |
+
id="img_captcha"/></td>
|
2086 |
+
</tr>
|
2087 |
+
<tr>
|
2088 |
+
<td align="center" onClick="addRow('page_break')" id="table_page_break" class="field_buttons"><img
|
2089 |
+
src="<?php echo plugins_url("images/page_break.png", __FILE__); ?>" style="margin:5px"
|
2090 |
+
id="img_page_break"/></td>
|
2091 |
+
|
2092 |
+
<td align="center" onClick="addRow('section_break')" id="table_section_break" class="field_buttons">
|
2093 |
+
<img src="<?php echo plugins_url("images/section_break.png", __FILE__); ?>" style="margin:5px"
|
2094 |
+
id="img_section_break"/></td>
|
2095 |
+
</tr>
|
2096 |
+
<tr>
|
2097 |
+
<td align="center"
|
2098 |
+
onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')"
|
2099 |
+
style="background-color: rgb(114, 113, 113) !important;" id="table_map" class="field_buttons"><img
|
2100 |
+
src="<?php echo plugins_url("images/map.png", __FILE__); ?>" style="margin:5px" id="img_map"/></td>
|
2101 |
+
<td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="background-color: rgb(114, 113, 113) !important;" id="table_paypal" class="field_buttons"><img src="<?php echo plugins_url("images/paypal.png",__FILE__); ?>" style="margin:5px" id="img_paypal"/></td>
|
2102 |
+
</tr>
|
2103 |
+
<tr>
|
2104 |
+
<td align="center" onClick="addRow('button')" colspan=2 id="table_button" class="field_buttons"><img
|
2105 |
+
src="<?php echo plugins_url("images/button.png", __FILE__); ?>" style="margin:5px" id="img_button"/>
|
2106 |
+
</td>
|
2107 |
+
</tr>
|
2108 |
+
</table>
|
2109 |
+
</td>
|
2110 |
+
<td width="40%" height="100%" align="left">
|
2111 |
+
<div id="edit_table" style="padding:0px; overflow-y:scroll; height:531px"></div>
|
2112 |
+
</td>
|
2113 |
+
<td align="center" valign="top"
|
2114 |
+
style="background:url(<?php echo plugins_url("images/border2.png", __FILE__); ?>) repeat-y;"> </td>
|
2115 |
+
<td style="padding:15px">
|
2116 |
+
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
|
2117 |
+
|
2118 |
+
<tr>
|
2119 |
+
<td align="right"><input type="radio" value="end" name="el_pos" checked="checked" id="pos_end"
|
2120 |
+
onclick="Disable()"/>
|
2121 |
+
At The End
|
2122 |
+
<input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
|
2123 |
+
At The Beginning
|
2124 |
+
<input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
|
2125 |
+
Before
|
2126 |
+
<select style="width:100px; margin-left:5px" id="sel_el_pos" disabled="disabled">
|
2127 |
+
</select>
|
2128 |
+
<img alt="ADD" title="add" style="cursor:pointer; vertical-align:middle; margin:5px"
|
2129 |
+
src="<?php echo plugins_url("images/save.png", __FILE__); ?>" onClick="add(0)"/>
|
2130 |
+
<img alt="CANCEL" title="cancel" style=" cursor:pointer; vertical-align:middle; margin:5px"
|
2131 |
+
src="<?php echo plugins_url("images/cancel_but.png", __FILE__); ?>" onClick="close_window()"/>
|
2132 |
+
|
2133 |
+
<hr style=" margin-bottom:10px"/>
|
2134 |
+
</td>
|
2135 |
+
</tr>
|
2136 |
|
2137 |
+
<tr height="100%" valign="top">
|
2138 |
+
<td id="show_table"></td>
|
2139 |
+
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2140 |
|
2141 |
+
</table>
|
2142 |
+
</td>
|
2143 |
+
</tr>
|
2144 |
+
</table>
|
2145 |
+
</td>
|
2146 |
+
</tr>
|
2147 |
+
</table>
|
2148 |
+
<input type="hidden" id="old"/>
|
2149 |
+
<input type="hidden" id="old_selected"/>
|
2150 |
+
<input type="hidden" id="element_type"/>
|
2151 |
+
<input type="hidden" id="editing_id"/>
|
2152 |
+
<input type="hidden" id="editing_page_break"/>
|
2153 |
+
|
2154 |
+
|
2155 |
+
<div id="main_editor"
|
2156 |
+
style="position:absolute; display:none; z-index:140;"><?php if (function_exists('the_editor') || function_exists('wp_editor')) {
|
2157 |
+
if (get_bloginfo('version') < '3.3') { ?>
|
2158 |
+
<div style=" max-width:500px; height:300px;text-align:left" id="poststuff">
|
2159 |
+
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>"
|
2160 |
+
class="postarea"><?php the_editor("", "form_maker_editor", "title", $media_buttons = TRUE, $tab_index = 1, $extended = TRUE); ?>
|
2161 |
+
</div>
|
2162 |
+
</div>
|
2163 |
+
|
2164 |
+
<?php
|
2165 |
+
}
|
2166 |
+
else {
|
2167 |
+
echo "<style>#wp-form_maker_editor-media-buttons{ text-align:left }</style>";
|
2168 |
+
wp_editor("", "form_maker_editor");
|
2169 |
+
}
|
2170 |
+
}
|
2171 |
+
else {
|
2172 |
+
?>
|
2173 |
+
<textarea name="form_maker_editor" id="form_maker_editor" cols="40" rows="6" style="width: 450px; height: 350px; "
|
2174 |
+
class="mce_editable" aria-hidden="true"></textarea>
|
2175 |
+
<?php
|
2176 |
+
}
|
2177 |
+
?></div>
|
2178 |
|
2179 |
|
2180 |
</div>
|
2181 |
|
2182 |
+
<?php if (!function_exists('the_editor'))
|
2183 |
+
?>
|
2184 |
<iframe id="tinymce" style="display:none"></iframe>
|
2185 |
|
2186 |
+
<?php
|
2187 |
+
?>
|
2188 |
|
2189 |
|
2190 |
|
2191 |
+
<br/>
|
2192 |
+
<br/>
|
2193 |
|
2194 |
<fieldset>
|
2195 |
|
2196 |
+
<legend>
|
2197 |
|
2198 |
<h2 style="color:#00aeef">Form</h2>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2199 |
|
2200 |
+
</legend>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2201 |
|
2202 |
+
<style><?php global $first_css;
|
2203 |
+
echo $first_css; ?></style>
|
|
|
|
|
2204 |
|
2205 |
+
<table width="100%" style="margin:8px">
|
2206 |
+
<tr id="page_navigation">
|
2207 |
+
<td align="center" width="90%" id="pages" show_title="false" show_numbers="true" type="none"></td>
|
2208 |
+
<td align="left" id="edit_page_navigation"></td>
|
2209 |
+
</tr>
|
2210 |
+
</table>
|
2211 |
+
<div id="take" class="main">
|
2212 |
+
<table cellpadding="4" cellspacing="0" class="wdform_table1" style="border-top:0px solid black;">
|
2213 |
+
<tbody id="form_id_tempform_view1" class="wdform_tbody1" page_title="Untitled page" next_title="Next"
|
2214 |
+
next_type="button" next_class="wdform_page_button" next_checkable="false" previous_title="Previous"
|
2215 |
+
previous_type="button" previous_class="wdform_page_button" previous_checkable="false">
|
2216 |
+
<tr class="wdform_tr1">
|
2217 |
+
<td class="wdform_td1">
|
2218 |
+
<table class="wdform_table2">
|
2219 |
+
<tbody class="wdform_tbody2"></tbody>
|
2220 |
+
</table>
|
2221 |
+
</td>
|
2222 |
+
</tr>
|
2223 |
+
<tr class="wdform_footer">
|
2224 |
+
<td colspan="100" valign="top">
|
2225 |
+
<table width="100%" style="padding-right:170px">
|
2226 |
+
<tbody>
|
2227 |
+
<tr id="form_id_temppage_nav1"></tr>
|
2228 |
+
</tbody>
|
2229 |
+
</table>
|
2230 |
+
</td>
|
2231 |
+
</tr>
|
2232 |
+
<tbody id="form_id_tempform_view_img1" style="float:right !important ;">
|
2233 |
+
<tr>
|
2234 |
+
<td width="0%"></td>
|
2235 |
+
<td align="right"><img src="<?php echo plugins_url("images/minus.png", __FILE__); ?>"
|
2236 |
+
title="Show or hide the page" class="page_toolbar" onclick="show_or_hide('1')"
|
2237 |
+
id="show_page_img_1"/></td>
|
2238 |
+
<td><img src="<?php echo plugins_url("images/page_delete.png", __FILE__); ?>" title="Delete the page"
|
2239 |
+
class="page_toolbar" onclick="remove_page('1')"/></td>
|
2240 |
+
<td><img src="<?php echo plugins_url("images/page_delete_all.png", __FILE__); ?>"
|
2241 |
+
title="Delete the page with fields" class="page_toolbar" onclick="remove_page_all('1')"/></td>
|
2242 |
+
<td><img src="<?php echo plugins_url("images/page_edit.png", __FILE__); ?>" title="Edit the page"
|
2243 |
+
class="page_toolbar" onclick="edit_page_break('1')"/></td>
|
2244 |
+
</tr>
|
2245 |
+
</tbody>
|
2246 |
+
</table>
|
2247 |
+
</div>
|
2248 |
+
</fieldset>
|
2249 |
+
<input type="hidden" name="form_front" id="form_front"/>
|
2250 |
+
<input type="hidden" name="form" id="form"/>
|
2251 |
+
<input type="hidden" name="counter" id="counter"/>
|
2252 |
+
<input type="hidden" name="pagination" id="pagination"/>
|
2253 |
+
<input type="hidden" name="show_title" id="show_title"/>
|
2254 |
+
<input type="hidden" name="show_numbers" id="show_numbers"/>
|
2255 |
+
<input type="hidden" name="public_key" id="public_key"/>
|
2256 |
+
<input type="hidden" name="private_key" id="private_key"/>
|
2257 |
+
<input type="hidden" name="recaptcha_theme" id="recaptcha_theme"/>
|
2258 |
+
<input type="hidden" name="script_mail" id="script_mail" value="%all%"/>
|
2259 |
+
<input type="hidden" name="script_mail_user" id="script_mail_user" value="%all%"/>
|
2260 |
+
<input type="hidden" name="label_order" id="label_order"/>
|
2261 |
+
<input type="hidden" name="label_order_current" id="label_order_current"/>
|
2262 |
+
<input type="hidden" name="option" value="com_formmaker"/>
|
2263 |
+
<input type="hidden" name="task" value=""/>
|
2264 |
</form>
|
|
|
|
|
2265 |
<script>
|
2266 |
+
plugin_url = document.getElementById('form_plugins_url').value;
|
|
|
|
|
|
|
|
|
2267 |
</script>
|
2268 |
<?php
|
2269 |
+
}
|
2270 |
+
|
2271 |
+
function html_edit_form_maker($row, $labels, $themes) {
|
2272 |
+
?>
|
2273 |
|
2274 |
+
<script type="text/javascript">
|
2275 |
|
2276 |
+
function gagoo(vvvv) {
|
2277 |
+
alert('ffff');
|
2278 |
+
tb_click.call(vvvv);
|
2279 |
+
var alink = $(vvvv).parents('.available-theme').find('.activatelink'), link = '', href = $(vvvv).attr('href'), url, text;
|
2280 |
+
if (tbWidth = href.match(/&tbWidth=[0-9]+/))
|
2281 |
+
tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
|
2282 |
+
else
|
2283 |
+
tbWidth = $(window).width() - 120;
|
2284 |
+
|
2285 |
+
if (tbHeight = href.match(/&tbHeight=[0-9]+/))
|
2286 |
+
tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
|
2287 |
+
else
|
2288 |
+
tbHeight = $(window).height() - 120;
|
2289 |
+
|
2290 |
+
if (alink.length) {
|
2291 |
+
url = alink.attr('href') || '';
|
2292 |
+
text = alink.attr('title') || '';
|
2293 |
+
link = ' <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
|
2294 |
+
} else {
|
2295 |
+
text = $(vvvv).attr('title') || '';
|
2296 |
+
link = ' <span class="tb-theme-preview-link">' + text + '</span>';
|
2297 |
+
}
|
2298 |
+
|
2299 |
+
$('#TB_title').css({'background-color':'#222', 'color':'#dfdfdf'});
|
2300 |
+
$('#TB_closeAjaxWindow').css({'float':'left'});
|
2301 |
+
$('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
|
2302 |
+
|
2303 |
+
$('#TB_iframeContent').width('100%');
|
2304 |
+
thickDims();
|
2305 |
+
|
2306 |
+
return false;
|
2307 |
}
|
2308 |
|
2309 |
|
2310 |
+
function submitform(pressbutton) {
|
2311 |
+
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
2312 |
+
document.getElementById('adminForm').submit();
|
2313 |
+
}
|
2314 |
+
function submitbutton(pressbutton) {
|
2315 |
+
if (!document.getElementById('araqel')) {
|
2316 |
+
alert('Please wait while page loading');
|
2317 |
+
return;
|
2318 |
+
}
|
2319 |
+
else if (document.getElementById('araqel').value == '0') {
|
2320 |
+
alert('Please wait while page loading');
|
2321 |
+
return;
|
2322 |
+
}
|
2323 |
+
var form = document.adminForm;
|
2324 |
+
|
2325 |
+
if (pressbutton == 'cancel') {
|
2326 |
+
|
2327 |
+
submitform(pressbutton);
|
2328 |
+
|
2329 |
+
return;
|
2330 |
+
|
2331 |
+
}
|
2332 |
+
if (form.title.value == "") {
|
2333 |
+
|
2334 |
+
alert("The form must have a title.");
|
2335 |
+
return;
|
2336 |
+
|
2337 |
+
}
|
2338 |
+
tox = '';
|
2339 |
+
l_id_array = [<?php echo $labels['id']?>];
|
2340 |
+
l_label_array = [<?php echo $labels['label']?>];
|
2341 |
+
l_type_array = [<?php echo $labels['type']?>];
|
2342 |
+
l_id_removed = [];
|
2343 |
+
|
2344 |
+
for (x = 0; x < l_id_array.length; x++) {
|
2345 |
+
l_id_removed[x] = true;
|
2346 |
+
}
|
2347 |
+
|
2348 |
+
for (t = 1; t <= form_view_max; t++) {
|
2349 |
+
if (document.getElementById('form_id_tempform_view' + t)) {
|
2350 |
+
form_view_element = document.getElementById('form_id_tempform_view' + t);
|
2351 |
+
n = form_view_element.childNodes.length - 2;
|
2352 |
+
|
2353 |
+
for (q = 0; q <= n; q++) {
|
2354 |
+
if (form_view_element.childNodes[q].nodeType != 3)
|
2355 |
+
if (!form_view_element.childNodes[q].id) {
|
2356 |
+
GLOBAL_tr = form_view_element.childNodes[q];
|
2357 |
+
|
2358 |
+
for (x = 0; x < GLOBAL_tr.firstChild.childNodes.length; x++) {
|
2359 |
+
|
2360 |
+
table = GLOBAL_tr.firstChild.childNodes[x];
|
2361 |
+
tbody = table.firstChild;
|
2362 |
+
for (y = 0; y < tbody.childNodes.length; y++) {
|
2363 |
+
is_in_old = false;
|
2364 |
+
tr = tbody.childNodes[y];
|
2365 |
+
l_id = tr.id;
|
2366 |
+
|
2367 |
+
l_label = document.getElementById(tr.id + '_element_labelform_id_temp').innerHTML;
|
2368 |
+
l_label = l_label.replace(/(\r\n|\n|\r)/gm, " ");
|
2369 |
+
l_type = tr.getAttribute('type');
|
2370 |
+
for (z = 0; z < l_id_array.length; z++) {
|
2371 |
+
if (l_id_array[z] == l_id) {
|
2372 |
+
l_id_removed[z] = false;
|
2373 |
+
if (l_type_array[z] == "type_address") {
|
2374 |
+
z++;
|
2375 |
+
l_id_removed[z] = false;
|
2376 |
+
z++;
|
2377 |
+
l_id_removed[z] = false;
|
2378 |
+
z++;
|
2379 |
+
l_id_removed[z] = false;
|
2380 |
+
z++;
|
2381 |
+
l_id_removed[z] = false;
|
2382 |
+
z++;
|
2383 |
+
l_id_removed[z] = false;
|
2384 |
+
}
|
2385 |
+
}
|
2386 |
+
}
|
2387 |
|
2388 |
+
if (tr.getAttribute('type') == "type_address") {
|
2389 |
+
addr_id = parseInt(tr.id);
|
2390 |
+
tox = tox + addr_id + '#**id**#' + 'Street Line' + '#**label**#' + tr.getAttribute('type') + '#****#';
|
2391 |
+
addr_id++;
|
2392 |
+
tox = tox + addr_id + '#**id**#' + 'Street Line2' + '#**label**#' + tr.getAttribute('type') + '#****#';
|
2393 |
+
addr_id++;
|
2394 |
+
tox = tox + addr_id + '#**id**#' + 'City' + '#**label**#' + tr.getAttribute('type') + '#****#';
|
2395 |
+
addr_id++;
|
2396 |
+
tox = tox + addr_id + '#**id**#' + 'State' + '#**label**#' + tr.getAttribute('type') + '#****#';
|
2397 |
+
addr_id++;
|
2398 |
+
tox = tox + addr_id + '#**id**#' + 'Postal' + '#**label**#' + tr.getAttribute('type') + '#****#';
|
2399 |
+
addr_id++;
|
2400 |
+
tox = tox + addr_id + '#**id**#' + 'Country' + '#**label**#' + tr.getAttribute('type') + '#****#';
|
2401 |
+
}
|
2402 |
+
else
|
2403 |
+
tox = tox + l_id + '#**id**#' + l_label + '#**label**#' + l_type + '#****#';
|
2404 |
|
2405 |
|
2406 |
+
}
|
2407 |
+
}
|
2408 |
+
}
|
2409 |
+
}
|
2410 |
+
}
|
2411 |
+
}
|
2412 |
+
document.getElementById('label_order_current').value = tox;
|
2413 |
+
for (x = 0; x < l_id_array.length; x++) {
|
2414 |
+
if (l_id_removed[x]) {
|
2415 |
+
tox = tox + l_id_array[x] + '#**id**#' + l_label_array[x] + '#**label**#' + l_type_array[x] + '#****#';
|
2416 |
+
}
|
2417 |
+
}
|
2418 |
+
document.getElementById('label_order').value = tox;
|
2419 |
+
refresh_();
|
2420 |
+
document.getElementById('pagination').value = document.getElementById('pages').getAttribute("type");
|
2421 |
+
document.getElementById('show_title').value = document.getElementById('pages').getAttribute("show_title");
|
2422 |
+
document.getElementById('show_numbers').value = document.getElementById('pages').getAttribute("show_numbers");
|
2423 |
+
submitform(pressbutton);
|
2424 |
+
}
|
2425 |
|
2426 |
+
function remove_whitespace(node) {
|
2427 |
+
for (var ttt = 0; ttt < node.childNodes.length; ttt++) {
|
2428 |
+
if (node.childNodes[ttt] && node.childNodes[ttt].nodeType == '3' && !/\S/.test(node.childNodes[ttt].nodeValue)) {
|
2429 |
+
node.removeChild(node.childNodes[ttt]);
|
2430 |
+
ttt--;
|
2431 |
+
}
|
2432 |
+
else {
|
2433 |
+
if (node.childNodes[ttt].childNodes.length)
|
2434 |
+
remove_whitespace(node.childNodes[ttt]);
|
2435 |
+
}
|
2436 |
+
}
|
2437 |
+
return;
|
2438 |
+
}
|
2439 |
|
2440 |
+
function refresh_() {
|
2441 |
+
document.getElementById('form').value = document.getElementById('take').innerHTML;
|
2442 |
+
document.getElementById('counter').value = gen;
|
2443 |
+
n = gen;
|
2444 |
+
for (i = 0; i < n; i++) {
|
2445 |
+
if (document.getElementById(i)) {
|
2446 |
+
for (z = 0; z < document.getElementById(i).childNodes.length; z++)
|
2447 |
+
if (document.getElementById(i).childNodes[z].nodeType == 3)
|
2448 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
|
2449 |
+
|
2450 |
+
if (document.getElementById(i).getAttribute('type') == "type_captcha" || document.getElementById(i).getAttribute('type') == "type_recaptcha") {
|
2451 |
+
if (document.getElementById(i).childNodes[10]) {
|
2452 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2453 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2454 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2455 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2456 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2457 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2458 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2459 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2460 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2461 |
+
}
|
2462 |
+
else {
|
2463 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2464 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2465 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2466 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2467 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2468 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2469 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2470 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2471 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2472 |
+
}
|
2473 |
+
continue;
|
2474 |
+
}
|
2475 |
+
|
2476 |
+
if (document.getElementById(i).getAttribute('type') == "type_section_break") {
|
2477 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2478 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2479 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2480 |
+
continue;
|
2481 |
+
}
|
2482 |
+
|
2483 |
+
|
2484 |
+
if (document.getElementById(i).childNodes[10]) {
|
2485 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2486 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2487 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2488 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2489 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2490 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2491 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2492 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2493 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
2494 |
+
}
|
2495 |
+
else {
|
2496 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2497 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2498 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2499 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2500 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2501 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2502 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2503 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2504 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
2505 |
+
}
|
2506 |
+
}
|
2507 |
+
}
|
2508 |
+
|
2509 |
+
for (i = 0; i <= n; i++) {
|
2510 |
+
if (document.getElementById(i)) {
|
2511 |
+
type = document.getElementById(i).getAttribute("type");
|
2512 |
+
switch (type) {
|
2513 |
+
case "type_text":
|
2514 |
+
case "type_number":
|
2515 |
+
case "type_password":
|
2516 |
+
case "type_submitter_mail":
|
2517 |
+
case "type_own_select":
|
2518 |
+
case "type_country":
|
2519 |
+
case "type_hidden":
|
2520 |
+
case "type_map":
|
2521 |
+
{
|
2522 |
+
remove_add_(i + "_elementform_id_temp");
|
2523 |
+
break;
|
2524 |
+
}
|
2525 |
|
2526 |
+
case "type_submit_reset":
|
2527 |
+
{
|
2528 |
+
remove_add_(i + "_element_submitform_id_temp");
|
2529 |
+
if (document.getElementById(i + "_element_resetform_id_temp"))
|
2530 |
+
remove_add_(i + "_element_resetform_id_temp");
|
2531 |
+
break;
|
2532 |
+
}
|
2533 |
|
2534 |
+
case "type_captcha":
|
2535 |
+
{
|
2536 |
+
remove_add_("_wd_captchaform_id_temp");
|
2537 |
+
remove_add_("_element_refreshform_id_temp");
|
2538 |
+
remove_add_("_wd_captcha_inputform_id_temp");
|
2539 |
+
break;
|
2540 |
+
}
|
2541 |
|
2542 |
+
case "type_recaptcha":
|
2543 |
+
{
|
2544 |
+
document.getElementById("public_key").value = document.getElementById("wd_recaptchaform_id_temp").getAttribute("public_key");
|
2545 |
+
document.getElementById("private_key").value = document.getElementById("wd_recaptchaform_id_temp").getAttribute("private_key");
|
2546 |
+
document.getElementById("recaptcha_theme").value = document.getElementById("wd_recaptchaform_id_temp").getAttribute("theme");
|
2547 |
+
document.getElementById('wd_recaptchaform_id_temp').innerHTML = '';
|
2548 |
+
remove_add_("wd_recaptchaform_id_temp");
|
2549 |
+
break;
|
2550 |
+
}
|
2551 |
|
2552 |
+
case "type_file_upload":
|
2553 |
+
{
|
2554 |
+
remove_add_(i + "_elementform_id_temp");
|
2555 |
|
2556 |
+
break;
|
2557 |
+
}
|
2558 |
|
2559 |
+
case "type_textarea":
|
2560 |
+
{
|
2561 |
+
remove_add_(i + "_elementform_id_temp");
|
2562 |
|
2563 |
+
break;
|
2564 |
+
}
|
2565 |
|
2566 |
+
case "type_name":
|
2567 |
+
{
|
2568 |
+
|
2569 |
+
if (document.getElementById(i + "_element_titleform_id_temp")) {
|
2570 |
+
remove_add_(i + "_element_titleform_id_temp");
|
2571 |
+
remove_add_(i + "_element_firstform_id_temp");
|
2572 |
+
remove_add_(i + "_element_lastform_id_temp");
|
2573 |
+
remove_add_(i + "_element_middleform_id_temp");
|
2574 |
+
}
|
2575 |
+
else {
|
2576 |
+
remove_add_(i + "_element_firstform_id_temp");
|
2577 |
+
remove_add_(i + "_element_lastform_id_temp");
|
2578 |
+
}
|
2579 |
+
break;
|
2580 |
|
2581 |
+
}
|
|
|
|
|
2582 |
|
2583 |
+
case "type_phone":
|
2584 |
+
{
|
2585 |
|
2586 |
+
remove_add_(i + "_element_firstform_id_temp");
|
2587 |
+
remove_add_(i + "_element_lastform_id_temp");
|
2588 |
+
break;
|
|
|
2589 |
|
2590 |
+
}
|
2591 |
+
case "type_address":
|
2592 |
+
{
|
2593 |
+
remove_add_(i + "_street1form_id_temp");
|
2594 |
+
remove_add_(i + "_street2form_id_temp");
|
2595 |
+
remove_add_(i + "_cityform_id_temp");
|
2596 |
+
remove_add_(i + "_stateform_id_temp");
|
2597 |
+
remove_add_(i + "_postalform_id_temp");
|
2598 |
+
remove_add_(i + "_countryform_id_temp");
|
2599 |
+
|
2600 |
+
break;
|
2601 |
+
}
|
2602 |
+
case "type_checkbox":
|
2603 |
+
case "type_radio":
|
2604 |
+
{
|
2605 |
+
is = true;
|
2606 |
+
for (j = 0; j < 100; j++)
|
2607 |
+
if (document.getElementById(i + "_elementform_id_temp" + j)) {
|
2608 |
+
remove_add_(i + "_elementform_id_temp" + j);
|
2609 |
+
}
|
2610 |
+
break;
|
2611 |
+
}
|
2612 |
+
|
2613 |
+
case "type_button":
|
2614 |
+
{
|
2615 |
+
for (j = 0; j < 100; j++)
|
2616 |
+
if (document.getElementById(i + "_elementform_id_temp" + j)) {
|
2617 |
+
remove_add_(i + "_elementform_id_temp" + j);
|
2618 |
+
}
|
2619 |
+
break;
|
2620 |
+
}
|
2621 |
|
2622 |
+
case "type_time":
|
2623 |
+
{
|
2624 |
+
if (document.getElementById(i + "_ssform_id_temp")) {
|
2625 |
+
remove_add_(i + "_ssform_id_temp");
|
2626 |
+
remove_add_(i + "_mmform_id_temp");
|
2627 |
+
remove_add_(i + "_hhform_id_temp");
|
2628 |
+
}
|
2629 |
+
else {
|
2630 |
+
remove_add_(i + "_mmform_id_temp");
|
2631 |
+
remove_add_(i + "_hhform_id_temp");
|
2632 |
|
2633 |
+
}
|
2634 |
+
break;
|
2635 |
|
|
|
2636 |
}
|
2637 |
|
2638 |
+
case "type_date":
|
2639 |
+
{
|
2640 |
+
remove_add_(i + "_elementform_id_temp");
|
2641 |
+
remove_add_(i + "_buttonform_id_temp");
|
2642 |
|
2643 |
+
break;
|
2644 |
+
}
|
2645 |
+
case "type_date_fields":
|
2646 |
+
{
|
2647 |
+
remove_add_(i + "_dayform_id_temp");
|
2648 |
+
remove_add_(i + "_monthform_id_temp");
|
2649 |
+
remove_add_(i + "_yearform_id_temp");
|
2650 |
+
break;
|
2651 |
+
}
|
2652 |
+
}
|
2653 |
+
}
|
2654 |
+
}
|
2655 |
|
2656 |
+
for (i = 1; i <= form_view_max; i++) {
|
2657 |
+
if (document.getElementById('form_id_tempform_view' + i)) {
|
2658 |
+
if (document.getElementById('page_next_' + i))
|
2659 |
+
document.getElementById('page_next_' + i).removeAttribute('src');
|
2660 |
+
if (document.getElementById('page_previous_' + i))
|
2661 |
+
document.getElementById('page_previous_' + i).removeAttribute('src');
|
2662 |
|
2663 |
+
document.getElementById('form_id_tempform_view' + i).parentNode.removeChild(document.getElementById('form_id_tempform_view_img' + i));
|
2664 |
+
document.getElementById('form_id_tempform_view' + i).removeAttribute('style');
|
2665 |
+
}
|
2666 |
+
}
|
2667 |
|
|
|
|
|
2668 |
|
2669 |
+
document.getElementById('form_front').value = document.getElementById('take').innerHTML;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2670 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2671 |
}
|
2672 |
|
2673 |
+
function set_preview() {
|
2674 |
+
appWidth = parseInt(document.body.offsetWidth);
|
2675 |
+
appHeight = parseInt(document.body.offsetHeight);
|
2676 |
+
document.getElementById('preview_form').href = '<?php echo admin_url('admin-ajax.php'); ?>?action=frommakerpreview&id=' + document.getElementById('theme').value + '&TB_iframe=1';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2677 |
}
|
2678 |
|
2679 |
+
gen =<?php echo $row->counter; ?>;//add main form id
|
2680 |
+
function enable() {
|
2681 |
+
for (iiiii = 0; iiiii < 1000; iiiii++) {
|
2682 |
+
if (document.getElementsByTagName("iframe")[iiiii]) {
|
2683 |
+
if (document.getElementsByTagName("iframe")[iiiii].id == 'form_maker_editor_ifr') {
|
2684 |
+
id_ifr_editor = iiiii;
|
2685 |
+
break;
|
2686 |
+
}
|
2687 |
+
}
|
2688 |
+
}
|
2689 |
+
alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal');
|
2690 |
+
for (x = 0; x < 13; x++) {
|
2691 |
+
document.getElementById('img_' + alltypes[x]).src = "<?php echo plugins_url("images/",__FILE__) ?>" + alltypes[x] + ".png";
|
2692 |
+
}
|
2693 |
+
if (document.getElementById('formMakerDiv').style.display == 'block') {
|
2694 |
+
jQuery('#formMakerDiv').slideToggle(200);
|
2695 |
+
}
|
2696 |
+
else {
|
2697 |
+
jQuery('#formMakerDiv').slideToggle(400);
|
2698 |
+
}
|
2699 |
+
if (document.getElementById('formMakerDiv').offsetWidth) {
|
2700 |
+
document.getElementById('formMakerDiv1').style.width = (document.getElementById('formMakerDiv').offsetWidth - 60) + 'px';
|
2701 |
+
}
|
2702 |
+
if (document.getElementById('formMakerDiv1').style.display == 'block') {
|
2703 |
+
jQuery('#formMakerDiv1').slideToggle(200);
|
2704 |
+
}
|
2705 |
+
else {
|
2706 |
+
jQuery('#formMakerDiv1').slideToggle(400);
|
2707 |
+
}
|
2708 |
+
document.getElementById('when_edit').style.display = 'none';
|
2709 |
}
|
2710 |
|
2711 |
+
function enable2() {
|
2712 |
+
alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal');
|
2713 |
+
for (x = 0; x < 13; x++) {
|
2714 |
+
document.getElementById('img_' + alltypes[x]).src = "<?php echo plugins_url("images/",__FILE__) ?>" + alltypes[x] + ".png";
|
2715 |
+
}
|
2716 |
+
if (document.getElementById('formMakerDiv').style.display == 'block') {
|
2717 |
+
jQuery('#formMakerDiv').slideToggle(200);
|
2718 |
+
}
|
2719 |
+
else {
|
2720 |
+
jQuery('#formMakerDiv').slideToggle(400);
|
2721 |
+
}
|
2722 |
+
if (document.getElementById('formMakerDiv').offsetWidth) {
|
2723 |
+
document.getElementById('formMakerDiv1').style.width = (document.getElementById('formMakerDiv').offsetWidth - 60) + 'px';
|
2724 |
+
}
|
2725 |
+
if (document.getElementById('formMakerDiv1').style.display == 'block') {
|
2726 |
+
jQuery('#formMakerDiv1').slideToggle(200);
|
2727 |
+
}
|
2728 |
+
else {
|
2729 |
+
jQuery('#formMakerDiv1').slideToggle(400);
|
2730 |
+
}
|
2731 |
+
document.getElementById('when_edit').style.display = 'block';
|
2732 |
+
if (document.getElementById('field_types').offsetWidth)
|
2733 |
+
document.getElementById('when_edit').style.width = document.getElementById('field_types').offsetWidth + 'px';
|
2734 |
+
if (document.getElementById('field_types').offsetHeight) {
|
2735 |
+
document.getElementById('when_edit').style.height = document.getElementById('field_types').offsetHeight + 'px';
|
2736 |
+
}
|
2737 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2738 |
|
2739 |
+
var thickDims, tbWidth, tbHeight;
|
2740 |
+
jQuery(document).ready(function ($) {
|
2741 |
|
2742 |
+
thickDims = function () {
|
2743 |
+
var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
|
2744 |
|
2745 |
+
w = (tbWidth && tbWidth < W - 90) ? tbWidth : W - 40;
|
2746 |
+
h = (tbHeight && tbHeight < H - 60) ? tbHeight : H - 40;
|
|
|
|
|
2747 |
|
2748 |
+
if (tbWindow.size()) {
|
2749 |
+
tbWindow.width(w).height(h);
|
2750 |
+
$('#TB_iframeContent').width(w).height(h - 27);
|
2751 |
+
tbWindow.css({'margin-left':'-' + parseInt((w / 2), 10) + 'px'});
|
2752 |
+
if (typeof document.body.style.maxWidth != 'undefined')
|
2753 |
+
tbWindow.css({'top':(H - h) / 2, 'margin-top':'0'});
|
2754 |
+
}
|
2755 |
+
};
|
2756 |
+
|
2757 |
+
thickDims();
|
2758 |
+
$(window).resize(function () {
|
2759 |
+
thickDims()
|
2760 |
+
});
|
2761 |
+
|
2762 |
+
$('a.thickbox-preview').click(function () {
|
2763 |
+
tb_click.call(this);
|
2764 |
+
|
2765 |
+
var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text;
|
2766 |
+
|
2767 |
+
if (tbWidth = href.match(/&tbWidth=[0-9]+/))
|
2768 |
+
tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
|
2769 |
+
else
|
2770 |
+
tbWidth = $(window).width() - 120;
|
2771 |
+
|
2772 |
+
if (tbHeight = href.match(/&tbHeight=[0-9]+/))
|
2773 |
+
tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
|
2774 |
+
else
|
2775 |
+
tbHeight = $(window).height() - 120;
|
2776 |
+
|
2777 |
+
if (alink.length) {
|
2778 |
+
url = alink.attr('href') || '';
|
2779 |
+
text = alink.attr('title') || '';
|
2780 |
+
link = ' <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
|
2781 |
+
} else {
|
2782 |
+
text = $(this).attr('title') || '';
|
2783 |
+
link = ' <span class="tb-theme-preview-link">' + text + '</span>';
|
2784 |
+
}
|
2785 |
|
2786 |
+
$('#TB_title').css({'background-color':'#222', 'color':'#dfdfdf'});
|
2787 |
+
$('#TB_closeAjaxWindow').css({'float':'left'});
|
2788 |
+
$('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
|
2789 |
|
2790 |
+
$('#TB_iframeContent').width('100%');
|
2791 |
+
thickDims();
|
2792 |
|
2793 |
+
return false;
|
2794 |
+
});
|
2795 |
|
2796 |
+
// Theme details
|
2797 |
+
$('.theme-detail').click(function () {
|
2798 |
+
$(this).siblings('.themedetaildiv').toggle();
|
2799 |
+
return false;
|
2800 |
+
});
|
2801 |
|
2802 |
});
|
2803 |
|
2804 |
+
</script>
|
2805 |
<style>
|
2806 |
+
.calendar .button {
|
2807 |
+
display: table-cell !important;
|
2808 |
+
}
|
2809 |
+
#when_edit {
|
2810 |
+
position: absolute;
|
2811 |
+
background-color: #666;
|
2812 |
+
z-index: 101;
|
2813 |
+
display: none;
|
2814 |
+
width: 100%;
|
2815 |
+
height: 100%;
|
2816 |
+
opacity: 0.7;
|
2817 |
+
filter: alpha(opacity = 70);
|
2818 |
+
}
|
2819 |
+
#formMakerDiv {
|
2820 |
+
position: fixed;
|
2821 |
+
background-color: #666;
|
2822 |
+
z-index: 100;
|
2823 |
+
display: none;
|
2824 |
+
left: 0;
|
2825 |
+
top: 0;
|
2826 |
+
width: 100%;
|
2827 |
+
height: 100%;
|
2828 |
+
opacity: 0.7;
|
2829 |
+
filter: alpha(opacity = 70);
|
2830 |
+
}
|
2831 |
+
#formMakerDiv1 {
|
2832 |
+
padding-top: 15px;
|
2833 |
+
position: fixed;
|
2834 |
+
z-index: 100;
|
2835 |
+
background-color: transparent;
|
2836 |
+
top: 0;
|
2837 |
+
left: 0;
|
2838 |
+
display: none;
|
2839 |
+
margin-left: 30px;
|
2840 |
+
margin-top: 15px;
|
2841 |
+
}
|
2842 |
+
.formmaker_table input {
|
2843 |
+
border-radius: 3px;
|
2844 |
+
padding: 2px;
|
2845 |
+
}
|
2846 |
+
.formmaker_table {
|
2847 |
+
border-radius: 8px;
|
2848 |
+
border: 6px #00aeef solid;
|
2849 |
+
background-color: #00aeef;
|
2850 |
+
height: 120px;
|
2851 |
+
width: 98%;
|
2852 |
+
}
|
2853 |
+
.formMakerDiv1_table {
|
2854 |
+
border: 6px #00aeef solid;
|
2855 |
+
background-color: #FFF;
|
2856 |
+
border-radius: 8px;
|
2857 |
+
}
|
2858 |
</style>
|
2859 |
+
<div style="font-size:14px; font-weight:bold">
|
2860 |
+
<a href="http://web-dorado.com/wordpress-form-maker-guide-2.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
|
2861 |
+
<br />
|
2862 |
+
This section allows you to add fields to your form.
|
2863 |
+
<a href="http://web-dorado.com/wordpress-form-maker-guide-4.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
2864 |
+
</div>
|
2865 |
+
<table width="95%">
|
2866 |
+
<thead>
|
2867 |
<tr>
|
2868 |
+
<td colspan="11">
|
2869 |
+
<div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
|
2870 |
+
<a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank"
|
2871 |
+
style="color:red; text-decoration:none;">
|
2872 |
+
<img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="www.web-dorado.com"
|
2873 |
+
width="215"><br>
|
2874 |
+
Get the full version
|
2875 |
+
</a>
|
2876 |
+
</div>
|
2877 |
+
</td>
|
2878 |
+
</tr>
|
2879 |
+
</thead>
|
2880 |
<tr>
|
2881 |
+
<td width="100%"><?php echo "<h2>Form Maker</h2>"; ?></td>
|
2882 |
+
<td><a id="preview_form"
|
2883 |
+
href="<?php echo admin_url('admin-ajax.php') . '?action=frommakerpreview&id=' . $row->theme . '&TB_iframe=1'; ?>"
|
2884 |
+
class="thickbox-preview" title="Form Preview" onclick="return false;"><input type="button" value="preview"
|
2885 |
+
class="button-primary"/></a>
|
2886 |
+
</td>
|
2887 |
+
<td><input type="button" onclick="submitbutton('form_options')" value="Form options" class="button-primary" /></td>
|
2888 |
+
<td style="width:300px"><input type="button" onclick="submitbutton('save_as_copy')" value="Save As Copy" class="button-secondary action" /> </td>
|
2889 |
+
<td align="right"><input type="button" onclick="submitbutton('Save')" value="Save" class="button-secondary action"/>
|
2890 |
+
</td>
|
2891 |
+
<td align="right"><input type="button" onclick="submitbutton('Apply')" value="Apply"
|
2892 |
+
class="button-secondary action"/></td>
|
2893 |
+
<td align="right"><input type="button" onclick="window.location.href='admin.php?page=Form_maker'" value="Cancel"
|
2894 |
+
class="button-secondary action"/></td>
|
2895 |
</tr>
|
2896 |
+
</table>
|
2897 |
+
<br/>
|
2898 |
+
|
2899 |
+
|
2900 |
+
|
2901 |
+
<form action="admin.php?page=Form_maker&id=<?php echo $row->id; ?>" method="post" name="adminForm" id="adminForm"
|
2902 |
+
enctype="multipart/form-data">
|
2903 |
+
<div class="formmaker_table" width="100%">
|
2904 |
+
<div style="float:left; text-align:center">
|
2905 |
+
</br>
|
2906 |
+
<img src="<?php echo plugins_url("images/formMaker.png",__FILE__) ?>"/>
|
2907 |
+
</br>
|
2908 |
+
</br>
|
2909 |
+
<img src="<?php echo plugins_url("images/logo.png",__FILE__) ?>"/>
|
2910 |
+
</div>
|
2911 |
+
<div style="float:right">
|
2912 |
+
<span style="font-size:16.76pt; font-family:tahoma; color:#FFFFFF; vertical-align:middle;">Form title: </span>
|
2913 |
+
<input id="title" name="title" style="width:160px; height:19px; border:none; font-size:11px;" value="<?php echo $row->title; ?>"/>
|
2914 |
+
<br />
|
2915 |
+
<img src="<?php echo plugins_url("images/formoptions.png",__FILE__) ?>" onclick="submitbutton('form_options')" style="cursor:pointer;margin:10px 0 10px 10px; float:right"/>
|
2916 |
+
<br />
|
2917 |
+
<br />
|
2918 |
+
<br />
|
2919 |
+
<img src="<?php echo plugins_url("images/addanewfield.png",__FILE__) ?>" onclick="enable(); Enable()" style="cursor:pointer;margin:10px 0 10px 10px; float:right"/>
|
2920 |
+
</div>
|
2921 |
+
</div>
|
2922 |
+
<div id="formMakerDiv" onclick="close_window()"></div>
|
2923 |
+
<div id="formMakerDiv1" style="padding-top:20px" align="center">
|
2924 |
|
2925 |
|
2926 |
+
<table border="0" width="100%" cellpadding="0" cellspacing="0" height="100%"
|
2927 |
+
style="border:6px #00aeef solid; background-color:#FFF">
|
2928 |
+
<tr>
|
2929 |
+
<td style="padding:0px">
|
2930 |
+
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
|
2931 |
+
<tr valign="top">
|
2932 |
+
<td width="15%" height="100%" style="border-right:dotted black 1px;" id="field_types">
|
2933 |
+
<div id="when_edit" style="display:none"></div>
|
2934 |
+
<table border="0" cellpadding="0" cellspacing="3" width="100%">
|
2935 |
+
<tr>
|
2936 |
+
<td align="center" onClick="addRow('customHTML')" style="cursor:pointer" id="table_editor"
|
2937 |
+
class="field_buttons"><img src="<?php echo plugins_url("images/customHTML.png", __FILE__) ?>"
|
2938 |
+
style="margin:5px" id="img_customHTML"/></td>
|
2939 |
+
|
2940 |
+
<td align="center" onClick="addRow('text')" style="cursor:pointer" id="table_text"
|
2941 |
+
class="field_buttons"><img src="<?php echo plugins_url("images/text.png", __FILE__) ?>"
|
2942 |
+
style="margin:5px" id="img_text"/></td>
|
2943 |
+
</tr>
|
2944 |
+
<tr>
|
2945 |
+
<td align="center" onClick="addRow('time_and_date')" style="cursor:pointer" id="table_time_and_date"
|
2946 |
+
class="field_buttons"><img src="<?php echo plugins_url("images/time_and_date.png", __FILE__) ?>"
|
2947 |
+
style="margin:5px" id="img_time_and_date"/></td>
|
2948 |
+
|
2949 |
+
<td align="center" onClick="addRow('select')" style="cursor:pointer" id="table_select"
|
2950 |
+
class="field_buttons"><img src="<?php echo plugins_url("images/select.png", __FILE__) ?>"
|
2951 |
+
style="margin:5px" id="img_select"/></td>
|
2952 |
+
</tr>
|
2953 |
+
<tr>
|
2954 |
+
<td align="center" onClick="addRow('checkbox')" style="cursor:pointer" id="table_checkbox"
|
2955 |
+
class="field_buttons"><img src="<?php echo plugins_url("images/checkbox.png", __FILE__) ?>"
|
2956 |
+
style="margin:5px" id="img_checkbox"/></td>
|
2957 |
+
|
2958 |
+
<td align="center" onClick="addRow('radio')" style="cursor:pointer" id="table_radio"
|
2959 |
+
class="field_buttons"><img src="<?php echo plugins_url("images/radio.png", __FILE__) ?>"
|
2960 |
+
style="margin:5px" id="img_radio"/></td>
|
2961 |
+
</tr>
|
2962 |
+
<tr>
|
2963 |
+
<td align="center"
|
2964 |
+
onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')"
|
2965 |
+
style="background-color: rgb(114, 113, 113) !important; cursor:pointer" id="table_file_upload"
|
2966 |
+
class="field_buttons"><img src="<?php echo plugins_url("images/file_upload.png", __FILE__) ?>"
|
2967 |
+
style="margin:5px" id="img_file_upload"/></td>
|
2968 |
+
|
2969 |
+
<td align="center" onClick="addRow('captcha')" style="cursor:pointer" id="table_captcha"
|
2970 |
+
class="field_buttons"><img src="<?php echo plugins_url("images/captcha.png", __FILE__) ?>"
|
2971 |
+
style="margin:5px" id="img_captcha"/></td>
|
2972 |
+
</tr>
|
2973 |
+
<tr>
|
2974 |
+
<td align="center" onClick="addRow('page_break')" style="cursor:pointer" id="table_page_break"
|
2975 |
+
class="field_buttons"><img src="<?php echo plugins_url("images/page_break.png", __FILE__) ?>"
|
2976 |
+
style="margin:5px" id="img_page_break"/></td>
|
2977 |
+
|
2978 |
+
<td align="center" onClick="addRow('section_break')" style="cursor:pointer" id="table_section_break"
|
2979 |
+
class="field_buttons"><img src="<?php echo plugins_url("images/section_break.png", __FILE__) ?>"
|
2980 |
+
style="margin:5px" id="img_section_break"/></td>
|
2981 |
+
</tr>
|
2982 |
+
<tr>
|
2983 |
+
<td align="center"
|
2984 |
+
onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')"
|
2985 |
+
style="background-color: rgb(114, 113, 113) !important; cursor:pointer" id="table_map"
|
2986 |
+
class="field_buttons"><img src="<?php echo plugins_url("images/map.png", __FILE__) ?>"
|
2987 |
+
style="margin:5px" id="img_map"/></td>
|
2988 |
+
<td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="background-color: rgb(114, 113, 113) !important; id="table_paypal" class="field_buttons">
|
2989 |
+
<img src="<?php echo plugins_url("images/paypal.png",__FILE__) ?>" style="margin:5px" id="img_paypal"/>
|
2990 |
+
</td>
|
2991 |
+
</tr>
|
2992 |
+
<tr>
|
2993 |
+
<td align="center" onClick="addRow('button')" colspan=2 style="cursor:pointer" id="table_button"
|
2994 |
+
class="field_buttons"><img src="<?php echo plugins_url("images/button.png", __FILE__) ?>"
|
2995 |
+
style="margin:5px" id="img_button"/></td>
|
2996 |
+
</tr>
|
2997 |
+
</table>
|
2998 |
|
2999 |
+
</td>
|
3000 |
+
<td width="35%" height="100%" align="left">
|
3001 |
+
<div id="edit_table" style="padding:0px; overflow-y:scroll; height:531px"></div>
|
3002 |
+
</td>
|
3003 |
|
3004 |
+
<td align="center" valign="top"
|
3005 |
+
style="background:url(<?php echo plugins_url("images/border2.png", __FILE__) ?>) repeat-y;"> </td>
|
3006 |
+
<td style="padding:15px">
|
3007 |
+
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
|
3008 |
+
|
3009 |
+
<tr>
|
3010 |
+
<td align="right"><input type="radio" value="end" name="el_pos" checked="checked" id="pos_end"
|
3011 |
+
onclick="Disable()"/>
|
3012 |
+
At The End
|
3013 |
+
<input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
|
3014 |
+
At The Beginning
|
3015 |
+
<input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
|
3016 |
+
Before
|
3017 |
+
<select style="width:100px; margin-left:5px" id="sel_el_pos" disabled="disabled">
|
3018 |
+
</select>
|
3019 |
+
<img alt="ADD" title="add" style="cursor:pointer; vertical-align:middle; margin:5px"
|
3020 |
+
src="<?php echo plugins_url("images/save.png", __FILE__) ?>" onClick="add(0)"/>
|
3021 |
+
<img alt="CANCEL" title="cancel" style=" cursor:pointer; vertical-align:middle; margin:5px"
|
3022 |
+
src="<?php echo plugins_url("images/cancel_but.png", __FILE__) ?>" onClick="close_window()"/>
|
3023 |
+
|
3024 |
+
<hr style=" margin-bottom:10px"/>
|
3025 |
+
</td>
|
3026 |
+
</tr>
|
3027 |
|
3028 |
+
<tr height="100%" valign="top">
|
3029 |
+
<td id="show_table"></td>
|
3030 |
+
</tr>
|
3031 |
|
3032 |
+
</table>
|
3033 |
+
</td>
|
3034 |
+
</tr>
|
3035 |
+
</table>
|
3036 |
+
</td>
|
3037 |
+
</tr>
|
3038 |
+
</table>
|
3039 |
|
3040 |
+
<input type="hidden" id="old"/>
|
3041 |
+
<input type="hidden" id="old_selected"/>
|
3042 |
+
<input type="hidden" id="element_type"/>
|
3043 |
+
<input type="hidden" id="editing_id"/>
|
3044 |
+
<input type="hidden" value="<?php echo plugins_url("", __FILE__) ?>" id="form_plugins_url"/>
|
3045 |
+
|
3046 |
+
<div id="main_editor"
|
3047 |
+
style="position:absolute; display:none; z-index:140;"><?php if (function_exists('the_editor') || function_exists('wp_editor')) {
|
3048 |
+
if (get_bloginfo('version') < '3.3') {
|
3049 |
+
?>
|
3050 |
+
<div style=" max-width:500px; height:300px;text-align:left" id="poststuff">
|
3051 |
+
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>"
|
3052 |
+
class="postarea"><?php the_editor("", "form_maker_editor", "title", $media_buttons = TRUE, $tab_index = 1, $extended = TRUE); ?>
|
3053 |
+
</div>
|
3054 |
+
</div>
|
3055 |
+
<?php
|
3056 |
+
}
|
3057 |
+
else {
|
3058 |
+
echo "<style>#wp-form_maker_editor-media-buttons{ text-align:left }</style>";
|
3059 |
+
wp_editor("", "form_maker_editor");
|
3060 |
+
}
|
3061 |
+
}
|
3062 |
+
else {
|
3063 |
+
?>
|
3064 |
+
<textarea name="form_maker_editor" id="form_maker_editor" cols="40" rows="6" style="width: 440px; height: 350px; "
|
3065 |
+
class="mce_editable" aria-hidden="true"></textarea>
|
3066 |
+
<?php
|
3067 |
+
}
|
3068 |
+
?></div>
|
3069 |
+
</div>
|
3070 |
|
3071 |
+
<?php if (!function_exists('the_editor')) {
|
3072 |
+
?>
|
3073 |
+
<iframe id="tinymce" style="display:none"></iframe>
|
3074 |
|
3075 |
+
<?php
|
3076 |
+
}
|
3077 |
+
?>
|
3078 |
|
|
|
3079 |
|
|
|
3080 |
|
3081 |
+
<br/>
|
3082 |
+
<br/>
|
3083 |
|
3084 |
+
<fieldset>
|
|
|
|
|
3085 |
|
3086 |
+
<legend>
|
3087 |
|
3088 |
+
<h2 style="color:#00aeef">Form</h2>
|
3089 |
|
3090 |
+
</legend>
|
3091 |
|
3092 |
+
<?php
|
3093 |
+
global $first_css;
|
3094 |
+
echo '<style>' . $first_css . '</style>';
|
3095 |
|
3096 |
+
?>
|
3097 |
+
<table width="100%" style="margin:8px">
|
3098 |
+
<tr id="page_navigation">
|
3099 |
+
<td align="center" width="90%" id="pages" show_title="<?php echo $row->show_title; ?>"
|
3100 |
+
show_numbers="<?php echo $row->show_numbers; ?>" type="<?php echo $row->pagination; ?>"></td>
|
3101 |
+
<td align="left" id="edit_page_navigation"></td>
|
3102 |
+
</tr>
|
3103 |
+
</table>
|
3104 |
+
<div id="take"><?php
|
3105 |
|
3106 |
+
if ($row->form)
|
3107 |
+
echo $row->form;
|
3108 |
+
else
|
3109 |
|
3110 |
+
echo '<table border="0" cellpadding="4" cellspacing="0" class="wdform_table1" width="100%" style="border-top:0px solid black;"><tbody id="form_view1" style="float:left;" page_title="Untitled page" next_title="Next" next_type="button" next_class="" next_checkable="true" previous_title="Previous" previous_type="button" previous_class="" previous_checkable="true"><tr><td valign="top"><table class="wdform_table2"><tbody></tbody></table></td></tr><tr><td colspan="100" valign="top"><table width="100%" style="padding-right:170px"><tbody><tr id="page_nav1"></tr></tbody></table></td></tr><tbody id="form_view_img1" style="float:right ;display:none" ><tr><td width="0%"></td><td align="right"><img src="' . plugins_url("images/minus.png", __FILE__) . '" title="Show or hide the page" class="page_toolbar" onclick="show_or_hide("1")" id="show_page_img_1" /></td><td><img src="' . plugins_url("images/page_delete.png", __FILE__) . '" title="Delete the page" class="page_toolbar" onclick="remove_page("1")" /></td><td><img src="' . plugins_url("images/page_delete_all.png", __FILE__) . '" title="Delete the page with fields" class="page_toolbar" onclick="remove_page_all("1")" /></td><td><img src="' . plugins_url("images/page_edit.png", __FILE__) . '" title="Edit the page" class="page_toolbar" onclick="edit_page_break("1")" /></td></tr></tbody></table>';
|
3111 |
+
?></div>
|
3112 |
+
</fieldset>
|
3113 |
+
<input type="hidden" name="form" id="form">
|
3114 |
+
<input type="hidden" name="form_front" id="form_front">
|
3115 |
+
<input type="hidden" name="pagination" id="pagination"/>
|
3116 |
+
<input type="hidden" name="show_title" id="show_title"/>
|
3117 |
+
<input type="hidden" name="show_numbers" id="show_numbers"/>
|
3118 |
+
<input type="hidden" name="public_key" id="public_key"/>
|
3119 |
+
<input type="hidden" name="private_key" id="private_key"/>
|
3120 |
+
<input type="hidden" name="recaptcha_theme" id="recaptcha_theme"/>
|
3121 |
+
<input type="hidden" id="label_order" name="label_order" value="<?php echo $row->label_order;?>"/>
|
3122 |
+
<input type="hidden" name="counter" id="counter" value="<?php echo $row->counter;?>">
|
3123 |
+
<input type="hidden" id="label_order_current" name="label_order_current" value="<?php echo $row->label_order_current;?>"/>
|
3124 |
+
<script type="text/javascript">
|
3125 |
|
3126 |
+
function formOnload() {
|
3127 |
+
//enable maps
|
3128 |
+
for (t = 0; t <<?php echo $row->counter;?>; t++)
|
3129 |
+
if (document.getElementById(t + "_typeform_id_temp")) {
|
3130 |
+
if (document.getElementById(t + "_typeform_id_temp").value == "type_map" || document.getElementById(t + "_typeform_id_temp").value == "type_mark_map") {
|
3131 |
+
if_gmap_init(t);
|
3132 |
+
for (q = 0; q < 20; q++)
|
3133 |
+
if (document.getElementById(t + "_elementform_id_temp").getAttribute("long" + q)) {
|
3134 |
+
|
3135 |
+
w_long = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("long" + q));
|
3136 |
+
w_lat = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("lat" + q));
|
3137 |
+
w_info = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("info" + q));
|
3138 |
+
add_marker_on_map(t, q, w_long, w_lat, w_info, false);
|
3139 |
+
}
|
3140 |
+
}
|
3141 |
+
else if (document.getElementById(t + "_typeform_id_temp").value == "type_date")
|
3142 |
+
Calendar.setup({
|
3143 |
+
inputField:t + "_elementform_id_temp",
|
3144 |
+
ifFormat:document.getElementById(t + "_buttonform_id_temp").getAttribute('format'),
|
3145 |
+
button:t + "_buttonform_id_temp",
|
3146 |
+
align:"Tl",
|
3147 |
+
singleClick:true,
|
3148 |
+
firstDay:0
|
3149 |
+
});
|
3150 |
+
|
3151 |
+
}
|
3152 |
+
|
3153 |
+
|
3154 |
+
form_view = 1;
|
3155 |
+
form_view_count = 0;
|
3156 |
+
for (i = 1; i <= 30; i++) {
|
3157 |
+
if (document.getElementById('form_id_tempform_view' + i)) {
|
3158 |
+
form_view_count++;
|
3159 |
+
form_view_max = i;
|
3160 |
+
}
|
3161 |
+
}
|
3162 |
|
3163 |
+
if (form_view_count > 1) {
|
3164 |
+
for (i = 1; i <= form_view_max; i++) {
|
3165 |
+
if (document.getElementById('form_id_tempform_view' + i)) {
|
3166 |
+
first_form_view = i;
|
3167 |
+
break;
|
3168 |
+
}
|
3169 |
+
}
|
3170 |
+
form_view = form_view_max;
|
3171 |
|
3172 |
+
generate_page_nav(first_form_view);
|
3173 |
|
3174 |
+
var img_EDIT = document.createElement("img");
|
3175 |
+
img_EDIT.setAttribute("src", "<?php echo plugins_url('', __FILE__) ?>/images/edit.png");
|
3176 |
+
img_EDIT.style.cssText = "margin-left:40px; cursor:pointer";
|
3177 |
+
img_EDIT.setAttribute("onclick", 'el_page_navigation()');
|
3178 |
|
3179 |
+
var td_EDIT = document.getElementById("edit_page_navigation");
|
3180 |
+
td_EDIT.appendChild(img_EDIT);
|
3181 |
|
3182 |
+
document.getElementById('page_navigation').appendChild(td_EDIT);
|
3183 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3184 |
|
3185 |
+
}
|
3186 |
+
document.getElementById('form').value = document.getElementById('take').innerHTML;
|
3187 |
+
document.getElementById('araqel').value = 1;
|
3188 |
+
}
|
3189 |
+
function formAddToOnload() {
|
3190 |
+
if (formOldFunctionOnLoad) {
|
3191 |
+
formOldFunctionOnLoad();
|
3192 |
+
}
|
3193 |
+
formOnload();
|
3194 |
+
}
|
3195 |
|
3196 |
+
function formLoadBody() {
|
3197 |
+
formOldFunctionOnLoad = window.onload;
|
3198 |
+
window.onload = formAddToOnload;
|
3199 |
+
}
|
3200 |
|
3201 |
+
var formOldFunctionOnLoad = null;
|
3202 |
|
3203 |
+
formLoadBody();
|
3204 |
|
3205 |
|
3206 |
+
</script>
|
|
|
|
|
|
|
3207 |
|
3208 |
+
<input type="hidden" name="option" value="com_formmaker"/>
|
|
|
|
|
3209 |
|
3210 |
+
<input type="hidden" name="id" value="<?php echo $row->id?>"/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3211 |
|
3212 |
+
<input type="hidden" name="cid[]" value="<?php echo $row->id; ?>"/>
|
|
|
|
|
|
|
|
|
|
|
3213 |
|
3214 |
+
<input type="hidden" name="task" value=""/>
|
3215 |
+
<input type="hidden" id="araqel" value="0"/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3216 |
|
3217 |
</form>
|
3218 |
|
3219 |
<script>
|
3220 |
+
plugin_url = document.getElementById('form_plugins_url').value;
|
3221 |
+
appWidth = parseInt(document.body.offsetWidth);
|
3222 |
+
appHeight = parseInt(document.body.offsetHeight);
|
3223 |
+
// document.getElementById('toolbar-popup-popup').childNodes[1].href='index.php?option=com_formmaker&task=preview&tmpl=component&theme='+document.getElementById('theme').value;
|
3224 |
+
// document.getElementById('toolbar-popup-popup').childNodes[1].setAttribute('rel',"{handler: 'iframe', size: {x:"+(appWidth-100)+", y: "+(appHeight-30)+"}}");
|
3225 |
</script>
|
3226 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3227 |
}
|
3228 |
|
3229 |
+
function html_form_options($row, $themes) {
|
3230 |
+
$label_id = array();
|
3231 |
+
$label_label = array();
|
3232 |
+
$label_type = array();
|
3233 |
+
$label_all = explode('#****#', $row->label_order_current);
|
3234 |
+
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
3235 |
+
foreach ($label_all as $key => $label_each) {
|
3236 |
+
$label_id_each = explode('#**id**#', $label_each);
|
3237 |
+
array_push($label_id, $label_id_each[0]);
|
3238 |
+
$label_order_each = explode('#**label**#', $label_id_each[1]);
|
3239 |
+
array_push($label_label, $label_order_each[0]);
|
3240 |
+
array_push($label_type, $label_order_each[1]);
|
3241 |
+
}
|
3242 |
+
?>
|
3243 |
+
<script language="javascript" type="text/javascript">
|
3244 |
+
function submitbutton(pressbutton) {
|
3245 |
+
var form = document.adminForm;
|
3246 |
+
if (pressbutton == 'cancel') {
|
3247 |
+
submit_in(pressbutton);
|
3248 |
+
return;
|
3249 |
+
}
|
3250 |
+
// Set selected ab id to hidden input.
|
3251 |
+
var fieldset = document.getElementsByTagName('fieldset');
|
3252 |
+
for (i = 0; i < fieldset.length; i++) {
|
3253 |
+
if (fieldset[i].style.display != "none") {
|
3254 |
+
document.getElementById("fieldset_id").value = fieldset[i].id;
|
3255 |
+
}
|
3256 |
+
}
|
3257 |
+
if (form.mail.value != '') {
|
3258 |
+
subMailArr = form.mail.value.split(',');
|
3259 |
+
emailListValid = true;
|
3260 |
+
for (subMailIt = 0; subMailIt < subMailArr.length; subMailIt++) {
|
3261 |
+
trimmedMail = subMailArr[subMailIt].replace(/^\s+|\s+$/g, '');
|
3262 |
+
if (trimmedMail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1) {
|
3263 |
+
alert("This is not a list of valid email addresses.");
|
3264 |
+
emailListValid = false;
|
3265 |
+
break;
|
3266 |
+
}
|
3267 |
+
}
|
3268 |
+
if (!emailListValid) {
|
3269 |
+
return;
|
3270 |
+
}
|
3271 |
+
}
|
3272 |
+
submit_in(pressbutton);
|
3273 |
+
}
|
3274 |
+
function check_isnum(e) {
|
3275 |
+
var chCode1 = e.which || e.keyCode;
|
3276 |
+
if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
|
3277 |
+
return false;
|
3278 |
+
}
|
3279 |
+
return true;
|
3280 |
+
}
|
3281 |
+
function insertAtCursor(myField, myValue) {
|
3282 |
+
if (myField.style.display == "none") {
|
3283 |
+
tinyMCE.execCommand('mceInsertContent', false, "%" + myValue + "%");
|
3284 |
+
return;
|
3285 |
+
}
|
3286 |
+
if (document.selection) {
|
3287 |
+
myField.focus();
|
3288 |
+
sel = document.selection.createRange();
|
3289 |
+
sel.text = myValue;
|
3290 |
+
}
|
3291 |
+
else if (myField.selectionStart || myField.selectionStart == '0') {
|
3292 |
+
var startPos = myField.selectionStart;
|
3293 |
+
var endPos = myField.selectionEnd;
|
3294 |
+
myField.value = myField.value.substring(0, startPos)
|
3295 |
+
+ "%" + myValue + "%"
|
3296 |
+
+ myField.value.substring(endPos, myField.value.length);
|
3297 |
+
}
|
3298 |
+
else {
|
3299 |
+
myField.value += "%" + myValue + "%";
|
3300 |
+
}
|
3301 |
+
}
|
3302 |
+
gen = "<?php echo $row->counter; ?>";
|
3303 |
+
form_view_max = 20;
|
3304 |
+
function remove_article() {
|
3305 |
+
document.getElementById('id_name').value = "Select an Article";
|
3306 |
+
document.getElementById('article_id').value = "";
|
3307 |
+
}
|
3308 |
+
function set_type(type) {
|
3309 |
+
switch(type) {
|
3310 |
+
case 'post':
|
3311 |
+
document.getElementById('post').removeAttribute('style');
|
3312 |
+
document.getElementById('page').setAttribute('style','display:none');
|
3313 |
+
document.getElementById('custom_text').setAttribute('style','display:none');
|
3314 |
+
document.getElementById('url').setAttribute('style','display:none');
|
3315 |
+
document.getElementById('none').setAttribute('style','display:none');
|
3316 |
+
break;
|
3317 |
+
case 'page':
|
3318 |
+
document.getElementById('page').removeAttribute('style');
|
3319 |
+
document.getElementById('post').setAttribute('style','display:none');
|
3320 |
+
document.getElementById('custom_text').setAttribute('style','display:none');
|
3321 |
+
document.getElementById('url').setAttribute('style','display:none');
|
3322 |
+
document.getElementById('none').setAttribute('style','display:none');
|
3323 |
+
break;
|
3324 |
+
case 'custom_text':
|
3325 |
+
document.getElementById('page').setAttribute('style','display:none');
|
3326 |
+
document.getElementById('post').setAttribute('style','display:none');
|
3327 |
+
document.getElementById('custom_text').removeAttribute('style');
|
3328 |
+
document.getElementById('url').setAttribute('style','display:none');
|
3329 |
+
document.getElementById('none').setAttribute('style','display:none');
|
3330 |
+
break;
|
3331 |
+
case 'url':
|
3332 |
+
document.getElementById('page').setAttribute('style','display:none');
|
3333 |
+
document.getElementById('post').setAttribute('style','display:none');
|
3334 |
+
document.getElementById('custom_text').setAttribute('style','display:none');
|
3335 |
+
document.getElementById('url').removeAttribute('style');
|
3336 |
+
document.getElementById('none').setAttribute('style','display:none');
|
3337 |
+
break;
|
3338 |
+
case 'none':
|
3339 |
+
document.getElementById('page').setAttribute('style','display:none');
|
3340 |
+
document.getElementById('post').setAttribute('style','display:none');
|
3341 |
+
document.getElementById('custom_text').setAttribute('style','display:none');
|
3342 |
+
document.getElementById('url').setAttribute('style','display:none');
|
3343 |
+
document.getElementById('none').removeAttribute('style');
|
3344 |
+
break;
|
3345 |
+
}
|
3346 |
+
}
|
3347 |
+
function set_preview() {
|
3348 |
+
appWidth = parseInt(document.body.offsetWidth);
|
3349 |
+
appHeight = parseInt(document.body.offsetHeight);
|
3350 |
+
document.getElementById('preview_form').href = '<?php echo admin_url('admin-ajax.php'); ?>?action=form_preview_product_option&form_id=<?php echo $row->id ?>&id='+document.getElementById('theme').value+'&TB_iframe=1';
|
3351 |
+
}
|
3352 |
+
function submit_in(pressbutton) {
|
3353 |
+
document.getElementById('adminForm').action = document.getElementById('adminForm').action+"&task="+pressbutton;
|
3354 |
+
document.getElementById('adminForm').submit();
|
3355 |
+
}
|
3356 |
+
var thickDims, tbWidth, tbHeight;
|
3357 |
+
jQuery(document).ready(function($) {
|
3358 |
+
thickDims = function() {
|
3359 |
+
var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
|
3360 |
+
w = (tbWidth && tbWidth < W - 90) ? tbWidth : W - 40;
|
3361 |
+
h = (tbHeight && tbHeight < H - 60) ? tbHeight : H - 40;
|
3362 |
+
if (tbWindow.size()) {
|
3363 |
+
tbWindow.width(w).height(h);
|
3364 |
+
$('#TB_iframeContent').width(w).height(h - 27);
|
3365 |
+
tbWindow.css({'margin-left': '-' + parseInt((w / 2),10) + 'px'});
|
3366 |
+
if (typeof document.body.style.maxWidth != 'undefined') {
|
3367 |
+
tbWindow.css({'top':(H-h)/2,'margin-top':'0'});
|
3368 |
+
}
|
3369 |
+
}
|
3370 |
+
};
|
3371 |
+
thickDims();
|
3372 |
+
$(window).resize(function() { thickDims() });
|
3373 |
+
$('a.thickbox-preview').click( function() {
|
3374 |
+
tb_click.call(this);
|
3375 |
+
var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text;
|
3376 |
+
if (tbWidth = href.match(/&tbWidth=[0-9]+/)) {
|
3377 |
+
tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
|
3378 |
+
}
|
3379 |
+
else {
|
3380 |
+
tbWidth = $(window).width() - 120;
|
3381 |
+
}
|
3382 |
+
if (tbHeight = href.match(/&tbHeight=[0-9]+/)) {
|
3383 |
+
tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
|
3384 |
+
}
|
3385 |
+
else {
|
3386 |
+
tbHeight = $(window).height() - 120;
|
3387 |
+
}
|
3388 |
+
if (alink.length) {
|
3389 |
+
url = alink.attr('href') || '';
|
3390 |
+
text = alink.attr('title') || '';
|
3391 |
+
link = ' <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
|
3392 |
+
}
|
3393 |
+
else {
|
3394 |
+
text = $(this).attr('title') || '';
|
3395 |
+
link = ' <span class="tb-theme-preview-link">' + text + '</span>';
|
3396 |
+
}
|
3397 |
+
$('#TB_title').css({'background-color':'#222','color':'#dfdfdf'});
|
3398 |
+
$('#TB_closeAjaxWindow').css({'float':'left'});
|
3399 |
+
$('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
|
3400 |
+
$('#TB_iframeContent').width('100%');
|
3401 |
+
thickDims();
|
3402 |
+
return false;
|
3403 |
+
});
|
3404 |
+
// Theme details.
|
3405 |
+
$('.theme-detail').click(function () {
|
3406 |
+
$(this).siblings('.themedetaildiv').toggle();
|
3407 |
+
return false;
|
3408 |
+
});
|
3409 |
+
});
|
3410 |
+
</script>
|
3411 |
+
<style>
|
3412 |
+
.borderer {
|
3413 |
+
border-radius:5px;
|
3414 |
+
padding-left:5px;
|
3415 |
+
background-color:#F0F0F0;
|
3416 |
+
height:19px;
|
3417 |
+
width:153px;
|
3418 |
+
}
|
3419 |
+
fieldset.adminform {
|
3420 |
+
border-radius: 7px;
|
3421 |
+
border: 1px solid;
|
3422 |
+
padding: 5px;
|
3423 |
+
width: 97%;
|
3424 |
+
}
|
3425 |
+
table.admintable td.key,
|
3426 |
+
table.admintable td.paramlist_key {
|
3427 |
+
background-color: #F6F6F6;
|
3428 |
+
border-bottom: 1px solid #E9E9E9;
|
3429 |
+
border-right: 1px solid #E9E9E9;
|
3430 |
+
color: #666666;
|
3431 |
+
font-weight: bold;
|
3432 |
+
text-align: right;
|
3433 |
+
width: 200px;
|
3434 |
+
}
|
3435 |
+
.submenu-box {
|
3436 |
+
background-color: #F4F4F4;
|
3437 |
+
border: 1px solid #CCCCCC;
|
3438 |
+
border-radius: 7px 7px 7px 7px;
|
3439 |
+
padding: 6px 5px;
|
3440 |
+
margin: 5px 0;
|
3441 |
+
}
|
3442 |
+
#submenu li {
|
3443 |
+
display: inline;
|
3444 |
+
margin: 0;
|
3445 |
+
padding: 0;
|
3446 |
+
}
|
3447 |
+
#submenu {
|
3448 |
+
margin: 0;
|
3449 |
+
padding: 0;
|
3450 |
+
}
|
3451 |
+
#general {
|
3452 |
+
padding: 0 15px;
|
3453 |
+
}
|
3454 |
+
#submenu a:hover, #submenu a.active, #submenu span.nolink.active {
|
3455 |
+
background: none repeat scroll 0 0 #FFFFFF;
|
3456 |
+
color: #146295;
|
3457 |
+
}
|
3458 |
+
#submenu li a, #submenu span.nolink {
|
3459 |
+
border-right: 1px solid #CCCCCC;
|
3460 |
+
color: #808080;
|
3461 |
+
cursor: pointer;
|
3462 |
+
font-size: 1.1em;
|
3463 |
+
font-weight: bold;
|
3464 |
+
height: 12px;
|
3465 |
+
line-height: 14px;
|
3466 |
+
padding: 0 15px;
|
3467 |
+
}
|
3468 |
+
</style>
|
3469 |
+
<div style="font-size:14px; font-weight:bold">
|
3470 |
+
<a href="http://web-dorado.com/wordpress-form-maker-guide-2.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
|
3471 |
+
<br />
|
3472 |
+
This section allows you to edit form options.
|
3473 |
+
<a href="http://web-dorado.com/wordpress-form-maker-guide-3.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
3474 |
+
</div>
|
3475 |
+
<form action="admin.php?page=Form_maker&id=<?php echo $row->id; ?>" id="adminForm" method="post" name="adminForm">
|
3476 |
+
<input type="hidden" name="take" id="take" value="<?php $row->form ?>">
|
3477 |
+
<table width="97%">
|
3478 |
+
<tbody>
|
3479 |
+
<tr>
|
3480 |
+
<td style="margin:5px;float:right" align="right"><input type="button" onclick="window.location.href='admin.php?page=Form_maker&task=edit_form&id=<?php echo $row->id; ?>'" value="Cancel" class="button-secondary action"> </td>
|
3481 |
+
<td style="margin:5px;float:right" align="right"><input type="button" onclick="submitbutton('Apply_form_options')" value="Apply" class="button-secondary action"></td>
|
3482 |
+
<td style="margin:5px;float:right" align="right"><input type="button" onclick="submitbutton('Save_form_options')" value="Save" class="button-secondary action"></td>
|
3483 |
+
</tr>
|
3484 |
+
</tbody>
|
3485 |
+
</table>
|
3486 |
+
<script>
|
3487 |
+
function form_maker_options_tabs(id) {
|
3488 |
+
document.getElementById("actions_fieldset").style.display = "none";
|
3489 |
+
document.getElementById("custom_fieldset").style.display = "none";
|
3490 |
+
document.getElementById("general_fieldset").style.display = "none";
|
3491 |
+
document.getElementById("payment_fieldset").style.display = "none";
|
3492 |
+
document.getElementById("javascript_fieldset").style.display = "none";
|
3493 |
+
document.getElementById("actions").setAttribute('class', '');
|
3494 |
+
document.getElementById("custom").setAttribute('class', '');
|
3495 |
+
document.getElementById("general").setAttribute('class', '');
|
3496 |
+
document.getElementById("payment").setAttribute('class', '');
|
3497 |
+
document.getElementById("javascript").setAttribute('class', '');
|
3498 |
+
if (document.getElementById(id)) {
|
3499 |
+
document.getElementById(id + "_fieldset").style.display = "";
|
3500 |
+
document.getElementById(id).setAttribute('class', 'active');
|
3501 |
+
}
|
3502 |
+
return false;
|
3503 |
+
}
|
3504 |
+
</script>
|
3505 |
+
<div class="submenu-box" style="width:97%">
|
3506 |
+
<div class="submenu-pad">
|
3507 |
+
<ul id="submenu" class="configuration">
|
3508 |
+
<li>
|
3509 |
+
<a id="general" onclick="form_maker_options_tabs('general')" href="#">General Options</a>
|
3510 |
+
</li>
|
3511 |
+
<li>
|
3512 |
+
<a id="actions" onclick="form_maker_options_tabs('actions')" href="#">Actions after Submission</a>
|
3513 |
+
</li>
|
3514 |
+
<li>
|
3515 |
+
<a id="payment" onclick="form_maker_options_tabs('payment')" href="#">Payment Options</a>
|
3516 |
+
</li>
|
3517 |
+
<li>
|
3518 |
+
<a id="javascript" onclick="form_maker_options_tabs('javascript')" href="#">JavaScript</a>
|
3519 |
+
</li>
|
3520 |
+
<li>
|
3521 |
+
<a id="custom" onclick="form_maker_options_tabs('custom')" href="#">Custom Text in Email</a>
|
3522 |
+
</li>
|
3523 |
+
</ul>
|
3524 |
+
<div class="clr"></div>
|
3525 |
+
</div>
|
3526 |
+
</div>
|
3527 |
+
<fieldset id="actions_fieldset" class="adminform">
|
3528 |
+
<legend style="color:#0B55C4;font-weight: bold;">Actions after submission</legend>
|
3529 |
+
<table class="admintable">
|
3530 |
<tr valign="top">
|
3531 |
+
<td class="key">
|
3532 |
+
<label for="submissioni text">Action type</label>
|
3533 |
+
</td>
|
3534 |
+
<td>
|
3535 |
+
<input type="radio" name="submit_text_type" onclick="set_type('none')" value="1" <?php if($row->submit_text_type!=2 and $row->submit_text_type!=3 and $row->submit_text_type!=4 and $row->submit_text_type!=5 ) echo "checked"; ?> /> Stay on Form<br/>
|
3536 |
+
<input type="radio" name="submit_text_type" onclick="set_type('post')" value="2" <?php if($row->submit_text_type==2 ) echo "checked"; ?> /> Post<br/>
|
3537 |
+
<input type="radio" name="submit_text_type" onclick="set_type('page')" value="5" <?php if($row->submit_text_type==5 ) echo "checked"; ?> /> Page<br/>
|
3538 |
+
<input type="radio" name="submit_text_type" onclick="set_type('custom_text')" value="3" <?php if($row->submit_text_type==3 ) echo "checked"; ?> /> Custom Text<br/>
|
3539 |
+
<input type="radio" name="submit_text_type" onclick="set_type('url')" value="4" <?php if($row->submit_text_type==4 ) echo "checked"; ?> /> URL
|
3540 |
+
</td>
|
3541 |
</tr>
|
3542 |
+
<tr id="none" <?php if ($row->submit_text_type == 2 or $row->submit_text_type == 3 or $row->submit_text_type==4 or $row->submit_text_type == 5) echo 'style="display:none"' ?> >
|
3543 |
+
<td class="key">
|
3544 |
+
<label> Stay on Form </label>
|
3545 |
+
</td>
|
3546 |
+
<td>
|
3547 |
+
<img src="<?php echo plugins_url("images/tick.png",__FILE__); ?>" border="0">
|
3548 |
+
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3549 |
</tr>
|
3550 |
+
<tr id="post" <?php if ($row->submit_text_type != 2) echo 'style="display:none"'; ?>>
|
3551 |
+
<td class="key">
|
3552 |
+
<label for="post_name"> Post </label>
|
3553 |
+
</td>
|
3554 |
+
<td>
|
3555 |
+
<select id="post_name" name="post_name" style="width:153px; font-size:11px;">
|
3556 |
+
<option value="0">- Select Post -</option>
|
3557 |
+
<?php
|
3558 |
+
// The Query.
|
3559 |
+
$args = array('posts_per_page' => 10000);
|
3560 |
+
query_posts($args);
|
3561 |
+
// The Loop.
|
3562 |
+
while (have_posts()) : the_post(); ?>
|
3563 |
+
<option value="<?php $x = get_permalink(get_the_ID()); echo $x; ?>" <?php if ($row->article_id == $x) {echo ' selected="selected"';} ?>><?php the_title(); ?></option>
|
3564 |
+
<?php
|
3565 |
+
endwhile;
|
3566 |
+
// Reset Query.
|
3567 |
+
wp_reset_query();
|
3568 |
+
?>
|
3569 |
+
</select>
|
3570 |
+
</td>
|
|
|
|
|
|
|
|
|
3571 |
</tr>
|
3572 |
+
<tr id="page" <?php if($row->submit_text_type!=5) echo 'style="display:none"' ?>>
|
3573 |
+
<td class="key">
|
3574 |
+
<label for="page_num"> Page </label>
|
3575 |
+
</td>
|
3576 |
+
<td>
|
3577 |
+
<select id="page_num" name="page_name" style="width:153px; font-size:11px;">
|
3578 |
+
<option value="0">- Select Page -</option>
|
3579 |
+
<?php
|
3580 |
+
// The Query.
|
3581 |
+
$pages = get_pages();
|
3582 |
+
// The Loop.
|
3583 |
+
foreach ($pages as $page) {
|
3584 |
+
?>
|
3585 |
+
<option value="<?php $x = get_page_link($page->ID); echo $x; ?>" <?php if ($row->article_id == $x) {echo ' selected="selected"';} ?>> <?php echo $page->post_title; ?></option>
|
3586 |
+
<?php
|
3587 |
+
}
|
3588 |
+
// Reset Query.
|
3589 |
+
wp_reset_query();
|
3590 |
+
?>
|
3591 |
+
</select>
|
3592 |
+
</td>
|
3593 |
</tr>
|
3594 |
+
<tr <?php if($row->submit_text_type!=3 ) echo 'style="display:none"' ?> id="custom_text">
|
3595 |
+
<td class="key">
|
3596 |
+
<label for="poststuff"> Text </label>
|
3597 |
+
</td>
|
3598 |
+
<td>
|
3599 |
+
<?php if (get_bloginfo('version') < '3.3'){ ?>
|
3600 |
+
<div style="height:200px;text-align:left" id="poststuff">
|
3601 |
+
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea"><?php the_editor($row->submit_text,"content","title",$media_buttons = true, $tab_index = 1, $extended = true ); ?></div>
|
3602 |
+
</div>
|
3603 |
+
<?php } else { wp_editor($row->submit_text,"content");}?>
|
3604 |
+
</td>
|
3605 |
</tr>
|
3606 |
+
<tr <?php if($row->submit_text_type != 4 ) echo 'style="display:none"' ?> id="url">
|
3607 |
+
<td class="key">
|
3608 |
+
<label for="url"> URL </label>
|
3609 |
+
</td>
|
3610 |
+
<td>
|
3611 |
+
<input type="text" id="url" name="url" style="width:300px" value="<?php echo $row->url ?>" />
|
3612 |
+
</td>
|
3613 |
+
</tr>
|
3614 |
+
</table>
|
3615 |
+
</fieldset>
|
3616 |
+
<fieldset id="custom_fieldset" class="adminform">
|
3617 |
+
<legend style="color:#0B55C4;font-weight: bold;">Custom text in email</legend>
|
3618 |
+
<table class="admintable">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3619 |
<tr>
|
3620 |
+
<td class="key" valign="top">
|
3621 |
+
<label>For Administrator</label>
|
3622 |
+
</td>
|
3623 |
+
<td>
|
3624 |
+
<div style="margin-bottom:5px">
|
3625 |
+
<?php
|
3626 |
+
for ($i = 0; $i < count($label_label); $i++) {
|
3627 |
+
if ($label_type[$i] == "type_submit_reset" || $label_type[$i] == "type_editor" || $label_type[$i] == "type_map" || $label_type[$i] == "type_mark_map" || $label_type[$i] == "type_captcha" || $label_type[$i] == "type_recaptcha" || $label_type[$i] == "type_button") {
|
3628 |
+
continue;
|
3629 |
+
}
|
3630 |
+
$param = "'" . htmlspecialchars(addslashes($label_label[$i])) . "'";
|
3631 |
+
$choise = 'document.getElementById(\'script_mail\')';
|
3632 |
+
echo '<input style="border:1px solid silver; font-size:10px;" type="button" value="' . htmlspecialchars(addslashes($label_label[$i])) . '" onClick="insertAtCursor(' . $choise . ',' . $param . ')" /> ';
|
3633 |
+
}
|
3634 |
+
$choise = 'document.getElementById(\'script_mail\')';
|
3635 |
+
echo '<input style="border:1px solid silver; font-size:10px; margin:3px;" type="button" value="All fields list" onClick="insertAtCursor(' . $choise . ',\'all\')" /> ';
|
3636 |
+
?>
|
3637 |
+
</div>
|
3638 |
+
<?php
|
3639 |
+
if (function_exists('wp_editor') || function_exists('the_editor')) {
|
3640 |
+
if (get_bloginfo('version') < '3.3') {
|
3641 |
+
the_editor($row->script_mail, $idd = 'script_mail', $prev_id = 'script_mail', $media_buttons = true, $tab_index = 1, $extended = TRUE);
|
3642 |
+
}
|
3643 |
+
else {
|
3644 |
+
wp_editor($row->script_mail, $idd = 'script_mail');
|
3645 |
+
}
|
3646 |
+
}
|
3647 |
+
else {
|
3648 |
+
?>
|
3649 |
+
<textarea name="script_mail" id="script_mail" cols="20" rows="10" style="width:300px; height:450px;"><?php echo $row->script_mail ?></textarea>
|
3650 |
+
<?php
|
3651 |
+
}
|
3652 |
+
?>
|
3653 |
+
</td>
|
3654 |
</tr>
|
|
|
3655 |
<tr>
|
3656 |
+
<td valign="top" height="30"></td>
|
3657 |
+
<td valign="top"></td>
|
|
|
|
|
|
|
|
|
|
|
3658 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3659 |
<tr>
|
3660 |
+
<td class="key" valign="top">
|
3661 |
+
<label>For User</label>
|
3662 |
+
</td>
|
3663 |
+
<td>
|
3664 |
+
<div style="margin-bottom:5px">
|
3665 |
+
<?php
|
3666 |
+
for ($i = 0; $i < count($label_label); $i++) {
|
3667 |
+
if ($label_type[$i] == "type_submit_reset" || $label_type[$i] == "type_editor" || $label_type[$i] == "type_map" || $label_type[$i] == "type_mark_map" || $label_type[$i] == "type_captcha" || $label_type[$i] == "type_recaptcha" || $label_type[$i] == "type_button") {
|
3668 |
+
continue;
|
3669 |
+
}
|
3670 |
+
$param = "'" . htmlspecialchars(addslashes($label_label[$i])) . "'";
|
3671 |
+
// if (!$is_editor) {
|
3672 |
+
$choise = 'document.getElementById(\'script_mail_user\')';
|
3673 |
+
echo '<input style="border:1px solid silver; font-size:10px;" type="button" value="' . htmlspecialchars(addslashes($label_label[$i])) . '" onClick="insertAtCursor(' . $choise . ',' . $param . ')" /> ';
|
3674 |
+
// }
|
3675 |
+
// else {
|
3676 |
+
// echo '<input type="button" value="' . htmlspecialchars(addslashes($label_label[$i])) . '" onClick="insertAtCursorEditor(' . $param . ')" /> ';
|
3677 |
+
// }
|
3678 |
+
}
|
3679 |
+
// if (!function_exists('wp_editor') && !function_exists('the_editor')) {
|
3680 |
+
$choise = 'document.getElementById(\'script_mail_user\')';
|
3681 |
+
echo '<input style="border:1px solid silver; font-size:10px; margin:3px;" type="button" value="All fields list" onClick="insertAtCursor(' . $choise . ',\'all\')" /> ';
|
3682 |
+
// }
|
3683 |
+
// else {
|
3684 |
+
// echo '<input style="margin:3px" type="button" value="All fields list" onClick="insertAtCursorEditor(\'all\')" /> ';
|
3685 |
+
// }
|
3686 |
+
?>
|
3687 |
+
</div>
|
3688 |
+
<?php
|
3689 |
+
if (function_exists('wp_editor') || function_exists('the_editor')) {
|
3690 |
+
if (get_bloginfo('version') < '3.3') {
|
3691 |
+
the_editor($row->script_mail_user, $idd = 'script_mail_user', $prev_id = 'script_mail_user', $media_buttons = true, $tab_index = 1, $extended = TRUE);
|
3692 |
+
}
|
3693 |
+
else {
|
3694 |
+
wp_editor($row->script_mail_user, $idd = 'script_mail_user');
|
3695 |
+
}
|
3696 |
+
}
|
3697 |
+
else {
|
3698 |
+
?>
|
3699 |
+
<textarea name="script_mail_user" id="script_mail_user" cols="20" rows="10" style="width:300px; height:350px;"><?php echo $row->script_mail_user ?></textarea>
|
3700 |
+
<?php
|
3701 |
+
}
|
3702 |
+
?>
|
3703 |
+
</td>
|
3704 |
+
</tr>
|
3705 |
+
</table>
|
3706 |
+
</fieldset>
|
3707 |
+
<fieldset id="general_fieldset" class="adminform">
|
3708 |
+
<legend style="color:#0B55C4;font-weight: bold;">Advanced Options</legend>
|
3709 |
+
<table class="admintable" style="float:left">
|
3710 |
+
<tr valign="top">
|
3711 |
+
<td class="key">
|
3712 |
+
<label>Email to send submissions to</label>
|
3713 |
+
</td>
|
3714 |
+
<td>
|
3715 |
+
<input id="mail" name="mail" value="<?php echo $row->mail ?>" style="width:250px;"/>
|
3716 |
+
</td>
|
3717 |
+
</tr>
|
3718 |
+
<tr valign="top">
|
3719 |
+
<td class="key">
|
3720 |
+
<label>Theme</label>
|
3721 |
+
</td>
|
3722 |
+
<td>
|
3723 |
+
<select id="theme" name="theme" style="width:260px; " onChange="set_preview()">
|
3724 |
+
<?php
|
3725 |
+
$form_theme = '';
|
3726 |
+
foreach ($themes as $theme) {
|
3727 |
+
if ($theme->id == $row->theme) {
|
3728 |
+
echo '<option value="' . $theme->id . '" selected>' . $theme->title . '</option>';
|
3729 |
+
$form_theme=$theme->css;
|
3730 |
+
}
|
3731 |
+
else
|
3732 |
+
echo '<option value="' . $theme->id . '">' . $theme->title . '</option>';
|
3733 |
+
}
|
3734 |
+
?>
|
3735 |
+
</select>
|
3736 |
+
<a id="preview_form" href="<?php echo admin_url('admin-ajax.php').'?action=form_preview_product_option&form_id=' . $row->id . '&id=' . $row->theme . '&TB_iframe=1'; ?>" class="thickbox-preview" title="Form Preview" onclick="return false;">
|
3737 |
+
<input type="button" value="preview" class="button-primary" />
|
3738 |
+
</a>
|
3739 |
+
</td>
|
3740 |
+
</tr>
|
3741 |
+
</table>
|
3742 |
+
<style>
|
3743 |
+
div.wd_preview span {
|
3744 |
+
float: none;
|
3745 |
+
width: 32px;
|
3746 |
+
height: 32px;
|
3747 |
+
margin: 0 auto;
|
3748 |
+
display: block;
|
3749 |
+
}
|
3750 |
+
div.wd_preview a {
|
3751 |
+
display: block;
|
3752 |
+
float: left;
|
3753 |
+
white-space: nowrap;
|
3754 |
+
border: 1px solid #fbfbfb;
|
3755 |
+
padding: 1px 5px;
|
3756 |
+
cursor: pointer;
|
3757 |
+
text-decoration: none
|
3758 |
+
}
|
3759 |
+
</style>
|
3760 |
+
</fieldset>
|
3761 |
+
<fieldset id="payment_fieldset" class="adminform">
|
3762 |
+
<legend style="color:#0B55C4;font-weight: bold;">Payment Options</legend>
|
3763 |
+
<div class="error">Paypal Options are disabled in free version.</div>
|
3764 |
+
<table class="admintable">
|
3765 |
+
<tr valign="top">
|
3766 |
+
<td class="key">
|
3767 |
+
<label>Turn Paypal On</label>
|
3768 |
+
</td>
|
3769 |
+
<td>
|
3770 |
+
<input disabled="disabled" type="radio" name="paypal_mode" id="paypal_mode1" value="1" <?php if ($row->paypal_mode == "1")
|
3771 |
+
echo "checked" ?> /> <label for="paypal_mode1">On </label><br/>
|
3772 |
+
<input disabled="disabled" type="radio" name="paypal_mode" id="paypal_mode2" value="0" <?php if ($row->paypal_mode != "1")
|
3773 |
+
echo "checked" ?> /> <label for="paypal_mode2">Off </label><br/>
|
3774 |
+
</td>
|
3775 |
+
</tr>
|
3776 |
+
<tr valign="top">
|
3777 |
+
<td class="key">
|
3778 |
+
<label>Checkout Mode</label>
|
3779 |
+
</td>
|
3780 |
+
<td>
|
3781 |
+
<input disabled="disabled" type="radio" name="checkout_mode" id="checkout_mode1"
|
3782 |
+
value="production" <?php if ($row->checkout_mode == "production")
|
3783 |
+
echo "checked" ?> /> <label for="checkout_mode1">Production </label><br/>
|
3784 |
+
<input disabled="disabled" type="radio" name="checkout_mode" id="checkout_mode2"
|
3785 |
+
value="testmode" <?php if ($row->checkout_mode != "production")
|
3786 |
+
echo "checked" ?> /> <label for="checkout_mode2">Testmode</label><br/>
|
3787 |
+
</td>
|
3788 |
+
</tr>
|
3789 |
+
<tr valign="top">
|
3790 |
+
<td class="key">
|
3791 |
+
<label>Paypal email</label>
|
3792 |
+
</td>
|
3793 |
+
<td>
|
3794 |
+
<input disabled="disabled" type="text" name="paypal_email" id="paypal_email" value="<?php echo $row->paypal_email; ?>" class="text_area" style="width:250px">
|
3795 |
+
</td>
|
3796 |
+
</tr>
|
3797 |
+
<tr valign="top">
|
3798 |
+
<td class="key">
|
3799 |
+
<label>Payment Currency</label>
|
3800 |
+
</td>
|
3801 |
+
<td>
|
3802 |
+
<select disabled="disabled" id="payment_currency" name="payment_currency" style="width:253px">
|
3803 |
+
<option value="USD" <?php echo (($row->payment_currency == 'USD') ? 'selected' : ''); ?>>$ • U.S. Dollar</option>
|
3804 |
+
<option value="EUR" <?php echo (($row->payment_currency == 'EUR') ? 'selected' : ''); ?>>€ • Euro</option>
|
3805 |
+
<option value="GBP" <?php echo (($row->payment_currency == 'GBP') ? 'selected' : ''); ?>>£ • Pound Sterling</option>
|
3806 |
+
<option value="JPY" <?php echo (($row->payment_currency == 'JPY') ? 'selected' : ''); ?>>¥ • Japanese Yen</option>
|
3807 |
+
<option value="CAD" <?php echo (($row->payment_currency == 'CAD') ? 'selected' : ''); ?>>C$ • Canadian Dollar</option>
|
3808 |
+
<option value="MXN" <?php echo (($row->payment_currency == 'MXN') ? 'selected' : ''); ?>>Mex$ • Mexican Peso</option>
|
3809 |
+
<option value="HKD" <?php echo (($row->payment_currency == 'HKD') ? 'selected' : ''); ?>>HK$ • Hong Kong Dollar</option>
|
3810 |
+
<option value="HUF" <?php echo (($row->payment_currency == 'HUF') ? 'selected' : ''); ?>>Ft • Hungarian Forint</option>
|
3811 |
+
<option value="NOK" <?php echo (($row->payment_currency == 'NOK') ? 'selected' : ''); ?>>kr • Norwegian Kroner</option>
|
3812 |
+
<option value="NZD" <?php echo (($row->payment_currency == 'NZD') ? 'selected' : ''); ?>>NZ$ • New Zealand Dollar</option>
|
3813 |
+
<option value="SGD" <?php echo (($row->payment_currency == 'SGD') ? 'selected' : ''); ?>>S$ • Singapore Dollar</option>
|
3814 |
+
<option value="SEK" <?php echo (($row->payment_currency == 'SEK') ? 'selected' : ''); ?>>kr • Swedish Kronor</option>
|
3815 |
+
<option value="PLN" <?php echo (($row->payment_currency == 'PLN') ? 'selected' : ''); ?>>zl • Polish Zloty</option>
|
3816 |
+
<option value="AUD" <?php echo (($row->payment_currency == 'AUD') ? 'selected' : ''); ?>>A$ • Australian Dollar</option>
|
3817 |
+
<option value="DKK" <?php echo (($row->payment_currency == 'DKK') ? 'selected' : ''); ?>>kr • Danish Kroner</option>
|
3818 |
+
<option value="CHF" <?php echo (($row->payment_currency == 'CHF') ? 'selected' : ''); ?>>CHF • Swiss Francs</option>
|
3819 |
+
<option value="CZK" <?php echo (($row->payment_currency == 'CZK') ? 'selected' : ''); ?>>Kc • Czech Koruny</option>
|
3820 |
+
<option value="ILS" <?php echo (($row->payment_currency == 'ILS') ? 'selected' : ''); ?>>₪ • Israeli Sheqel</option>
|
3821 |
+
<option value="BRL" <?php echo (($row->payment_currency == 'BRL') ? 'selected' : ''); ?>>R$ • Brazilian Real</option>
|
3822 |
+
<option value="TWD" <?php echo (($row->payment_currency == 'TWD') ? 'selected' : ''); ?>>NT$ • Taiwan New Dollars</option>
|
3823 |
+
<option value="MYR" <?php echo (($row->payment_currency == 'MYR') ? 'selected' : ''); ?>>RM • Malaysian Ringgit</option>
|
3824 |
+
<option value="PHP" <?php echo (($row->payment_currency == 'PHP') ? 'selected' : ''); ?>>₱ • Philippine Peso</option>
|
3825 |
+
<option value="THB" <?php echo (($row->payment_currency == 'THB') ? 'selected' : ''); ?>>฿ • Thai Bahtv</option>
|
3826 |
+
</select>
|
3827 |
+
</td>
|
3828 |
+
</tr>
|
3829 |
+
<tr valign="top">
|
3830 |
+
<td class="key">
|
3831 |
+
<label for="tax">Tax</label>
|
3832 |
+
</td>
|
3833 |
+
<td>
|
3834 |
+
<input disabled="disabled" type="text" name="tax" id="tax" value="<?php echo $row->tax; ?>" class="text_area" style="width:30px" onKeyPress="return check_isnum(event)"> %
|
3835 |
+
</td>
|
3836 |
+
</tr>
|
3837 |
+
</table>
|
3838 |
+
</fieldset>
|
3839 |
+
<fieldset id="javascript_fieldset" class="adminform">
|
3840 |
+
<legend style="color:#0B55C4;font-weight: bold;">JavaScript</legend>
|
3841 |
+
<table class="admintable">
|
3842 |
+
<tr valign="top">
|
3843 |
+
<td class="key">
|
3844 |
+
<label for="javascript">Javascript</label>
|
3845 |
+
</td>
|
3846 |
+
<td>
|
3847 |
+
<textarea style="margin: 0px;" cols="60" rows="30" name="javascript" id="javascript"><?php echo $row->javascript; ?></textarea>
|
3848 |
+
</td>
|
3849 |
+
</tr>
|
3850 |
+
</table>
|
3851 |
+
</fieldset>
|
3852 |
+
<input type="hidden" name="option" value="com_formmaker"/>
|
3853 |
+
<input type="hidden" name="id" value="<?php echo $row->id?>"/>
|
3854 |
+
<input type="hidden" name="cid[]" value="<?php echo $row->id; ?>"/>
|
3855 |
+
<input type="hidden" name="task" value="" />
|
3856 |
+
<input type="hidden" name="fieldset_id" id="fieldset_id" value="<?php echo ((isset($_POST['fieldset_id'])) ? esc_html($_POST['fieldset_id']) : 'general_fieldset'); ?>"/>
|
3857 |
+
</form>
|
3858 |
+
<script>
|
3859 |
+
window.onload = form_maker_options_tabs(document.getElementById("fieldset_id").value.replace("_fieldset", ""));
|
3860 |
+
</script>
|
3861 |
+
<?php
|
3862 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
form_maker_functions.php
CHANGED
@@ -1,417 +1,242 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
}
|
6 |
-
|
7 |
-
function update_form_maker(){
|
8 |
-
|
9 |
-
global $wpdb;
|
10 |
-
|
11 |
-
$query="SELECT id, form FROM ".$wpdb->prefix."formmaker WHERE `id` NOT IN(".get_option('contact_form_forms',0).")";
|
12 |
-
|
13 |
-
$forms=$wpdb->get_results($query);
|
14 |
-
|
15 |
-
$id=0;
|
16 |
-
$old_version = false;
|
17 |
-
foreach($forms as $form)
|
18 |
-
{
|
19 |
-
if(strpos($form->form, "wdform_table1")===false)
|
20 |
-
{
|
21 |
-
$id=$form->id;
|
22 |
-
$old_version = true;
|
23 |
-
break;
|
24 |
-
}
|
25 |
-
}
|
26 |
-
|
27 |
-
if(!$old_version)
|
28 |
-
{?>
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
<script type="text/javascript">
|
33 |
-
|
34 |
-
|
35 |
-
window.onload=val;
|
36 |
-
|
37 |
-
function val()
|
38 |
-
{
|
39 |
-
var form = document.adminForm;
|
40 |
-
submitform();
|
41 |
}
|
42 |
-
function
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
}
|
48 |
-
</script>
|
49 |
-
<form action="admin.php?page=Form_maker" method="post" id="adminForm" name="adminForm">
|
50 |
-
|
51 |
-
|
52 |
-
</form>
|
53 |
-
<?php
|
54 |
-
die();
|
55 |
-
/*
|
56 |
-
$msg="All forms are updated!";
|
57 |
-
$link = 'index.php?option=com_formmaker';
|
58 |
-
$mainframe->redirect($link, $msg);
|
59 |
-
*/
|
60 |
-
|
61 |
-
}
|
62 |
-
|
63 |
-
|
64 |
-
$row =$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id=".$id);
|
65 |
-
|
66 |
-
|
67 |
-
$labels= array();
|
68 |
-
|
69 |
-
$label_id= array();
|
70 |
-
$label_order_original= array();
|
71 |
-
$label_type= array();
|
72 |
-
|
73 |
-
$label_all = explode('#****#',$row->label_order);
|
74 |
-
$label_all = array_slice($label_all,0, count($label_all)-1);
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
foreach($label_all as $key => $label_each)
|
79 |
-
{
|
80 |
-
$label_id_each=explode('#**id**#',$label_each);
|
81 |
-
array_push($label_id, $label_id_each[0]);
|
82 |
-
|
83 |
-
$label_oder_each=explode('#**label**#', $label_id_each[1]);
|
84 |
-
array_push($label_order_original, addslashes($label_oder_each[0]));
|
85 |
-
array_push($label_type, $label_oder_each[1]);
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
}
|
90 |
-
|
91 |
-
$labels['id']='"'.implode('","',$label_id).'"';
|
92 |
-
$labels['label']='"'.implode('","',$label_order_original).'"';
|
93 |
-
$labels['type']='"'.implode('","',$label_type).'"';
|
94 |
-
|
95 |
-
$query = "SELECT * FROM ".$wpdb->prefix."formmaker_themes WHERE `id` NOT IN(".get_option('contact_form_forms',0).") ORDER BY title";
|
96 |
-
|
97 |
-
$themes = $wpdb->get_results($query);
|
98 |
-
|
99 |
-
|
100 |
-
@session_start();
|
101 |
-
$_SESSION['current_updates']=$_SESSION['current_updates']+1;
|
102 |
-
|
103 |
-
html_update_form_maker($row, $labels, $themes);
|
104 |
-
|
105 |
-
|
106 |
-
}
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
function save_update_form_maker(){
|
114 |
-
global $wpdb;
|
115 |
-
$id = (int) $_GET['id'];
|
116 |
-
$no_slash_form = stripslashes($_POST['form']);
|
117 |
-
|
118 |
-
$no_slash_form_front= stripslashes($_POST['form_front']);
|
119 |
-
$savedd=$wpdb->update($wpdb->prefix."formmaker", array(
|
120 |
-
'title' => $_POST["title"],
|
121 |
-
'mail' => $_POST["mail"],
|
122 |
-
'form' => $no_slash_form,
|
123 |
-
'form_front' => $no_slash_form_front,
|
124 |
-
'theme' => $_POST["theme"],
|
125 |
-
'counter' => $_POST["counter"],
|
126 |
-
'label_order' => $_POST["label_order"],
|
127 |
-
'pagination' => $_POST["pagination"],
|
128 |
-
'show_title' => $_POST["show_title"],
|
129 |
-
'show_numbers' => $_POST["show_numbers"],
|
130 |
-
'public_key' => $_POST["public_key"],
|
131 |
-
'private_key' => $_POST["private_key"],
|
132 |
-
'recaptcha_theme' => $_POST["recaptcha_theme"],
|
133 |
-
),
|
134 |
-
array('id'=>$id),
|
135 |
-
array(
|
136 |
-
'%s',
|
137 |
-
'%s',
|
138 |
-
'%s',
|
139 |
-
'%s',
|
140 |
-
'%d',
|
141 |
-
'%d',
|
142 |
-
'%s',
|
143 |
-
'%s',
|
144 |
-
'%s',
|
145 |
-
'%s',
|
146 |
-
'%s',
|
147 |
-
'%s',
|
148 |
-
'%s'
|
149 |
-
)
|
150 |
-
|
151 |
-
);
|
152 |
-
html_forchrome_update();
|
153 |
-
|
154 |
-
|
155 |
-
// $link = 'index.php?option=com_formmaker&task=update';
|
156 |
-
// $mainframe->redirect($link, $msg);
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
}
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
|
170 |
-
function display_form_lists(){
|
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 |
-
if($_POST['page_number'])
|
198 |
-
{
|
199 |
-
$limit=((int) $_POST['page_number']-1)*20;
|
200 |
-
}
|
201 |
-
else
|
202 |
-
{
|
203 |
-
$limit=0;
|
204 |
-
}
|
205 |
-
}
|
206 |
-
else
|
207 |
-
{
|
208 |
-
$limit=0;
|
209 |
-
}
|
210 |
-
if (isset($_POST['search_events_by_title'])) {
|
211 |
-
$search_tag = esc_html($_POST['search_events_by_title']);
|
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 |
-
$old_n++;
|
272 |
-
}
|
273 |
-
}
|
274 |
-
|
275 |
-
@session_start();
|
276 |
-
$_SESSION['all_updates']=$old_n;
|
277 |
-
$_SESSION['current_updates']=0;
|
278 |
-
}
|
279 |
-
|
280 |
-
html_display_form_lists($rows, $pageNav, $sort,$old_version,$can_update_form);
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
}
|
287 |
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
////////////////////////////////// ADD FORM
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
function add_form()
|
305 |
-
{
|
306 |
-
global $wpdb;
|
307 |
-
$query = "SELECT * FROM ".$wpdb->prefix."formmaker_themes WHERE `id` NOT IN(".get_option('contact_form_themes',0).") ORDER BY title";
|
308 |
-
$themes =$wpdb->get_results($query);
|
309 |
-
html_add_form($themes);
|
310 |
-
|
311 |
}
|
312 |
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
////////////////////////////////////// Edit Form
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
$label_id= array();
|
357 |
-
$label_order_original= array();
|
358 |
-
$label_type= array();
|
359 |
-
|
360 |
-
$label_all = explode('#****#',$row->label_order);
|
361 |
-
$label_all = array_slice($label_all,0, count($label_all)-1);
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
foreach($label_all as $key => $label_each)
|
366 |
-
{
|
367 |
-
$label_id_each=explode('#**id**#',$label_each);
|
368 |
-
array_push($label_id, $label_id_each[0]);
|
369 |
-
|
370 |
-
$label_oder_each=explode('#**label**#', $label_id_each[1]);
|
371 |
-
array_push($label_order_original, addslashes($label_oder_each[0]));
|
372 |
-
array_push($label_type, $label_oder_each[1]);
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
}
|
377 |
-
|
378 |
-
$labels['id']='"'.implode('","',$label_id).'"';
|
379 |
-
$labels['label']='"'.implode('","',$label_order_original).'"';
|
380 |
-
$labels['type']='"'.implode('","',$label_type).'"';
|
381 |
-
|
382 |
-
$query = "SELECT * FROM ".$wpdb->prefix."formmaker_themes WHERE `id` NOT IN(".get_option('contact_form_themes',0).") ORDER BY title";
|
383 |
-
$themes = $wpdb->get_results($query);
|
384 |
-
|
385 |
-
|
386 |
-
html_edit_form_maker($row, $labels, $themes);
|
387 |
-
|
388 |
}
|
389 |
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
<?php
|
406 |
-
return false;
|
407 |
-
}
|
408 |
-
|
409 |
-
global $wpdb;
|
410 |
-
if (esc_html($_POST["title"]) != '') {
|
411 |
-
if(isset($_POST["label_order"]) && isset($_POST["title"]) && isset($_POST["form"])){
|
412 |
-
$no_slash_form = stripslashes($_POST['form']);
|
413 |
-
$no_slash_form_front= stripslashes($_POST['form_front']);
|
414 |
-
$javascript="// before form is load
|
415 |
function before_load()
|
416 |
{
|
417 |
}
|
@@ -423,344 +248,302 @@ function before_submit()
|
|
423 |
function before_reset()
|
424 |
{
|
425 |
}";
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
|
|
505 |
<?php
|
506 |
-
exit;
|
507 |
-
}
|
508 |
-
|
509 |
-
}
|
510 |
-
else{
|
511 |
-
?>
|
512 |
-
<div class="updated"><p><strong><?php _e('could not save form '); ?></strong></p></div>
|
513 |
-
<?php
|
514 |
-
}
|
515 |
-
|
516 |
-
|
517 |
-
}
|
518 |
-
|
519 |
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
if(isset($_POST["label_order"]) && isset($_POST["title"]) && isset($_POST["form"]) && isset($_GET['id'])){
|
525 |
-
$no_slash_form = stripslashes($_POST['form']);
|
526 |
-
$no_slash_form_front= stripslashes($_POST['form_front']);
|
527 |
-
$row_for_sav_as_copy=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id=" . (int) $_GET['id']);
|
528 |
-
$javascript=$row_for_sav_as_copy->javascript;
|
529 |
-
|
530 |
-
$save_or_no= $wpdb->insert($wpdb->prefix.'formmaker', array(
|
531 |
-
'id' => NULL,
|
532 |
-
'title' => $_POST["title"],
|
533 |
-
'mail' => $_POST["mail"],
|
534 |
-
'form' => $no_slash_form,
|
535 |
-
'form_front' => $no_slash_form_front,
|
536 |
-
'theme' => $_POST["theme"],
|
537 |
-
'counter' => $_POST["counter"],
|
538 |
-
'label_order' => $_POST["label_order"],
|
539 |
-
'pagination' => $_POST["pagination"],
|
540 |
-
'show_title' => $_POST["show_title"],
|
541 |
-
'show_numbers' => $_POST["show_numbers"],
|
542 |
-
'public_key' => $_POST["public_key"],
|
543 |
-
'private_key' => $_POST["private_key"],
|
544 |
-
'recaptcha_theme' => $_POST["recaptcha_theme"],
|
545 |
-
'javascript' => $javascript,
|
546 |
-
'script1' => $row_for_sav_as_copy->script1,
|
547 |
-
'script2' => $row_for_sav_as_copy->script2,
|
548 |
-
'script_user1' => $row_for_sav_as_copy->script_user1,
|
549 |
-
'script_user2' => $row_for_sav_as_copy->script_user2,
|
550 |
-
'submit_text' => $row_for_sav_as_copy->submit_text,
|
551 |
-
'url' => $row_for_sav_as_copy->url,
|
552 |
-
'article_id' => $row_for_sav_as_copy->article_id,
|
553 |
-
'submit_text_type' => $row_for_sav_as_copy->submit_text_type
|
554 |
-
),
|
555 |
-
array(
|
556 |
-
'%d',
|
557 |
-
'%s',
|
558 |
-
'%s',
|
559 |
-
'%s',
|
560 |
-
'%s',
|
561 |
-
'%d',
|
562 |
-
'%d',
|
563 |
-
'%s',
|
564 |
-
'%s',
|
565 |
-
'%s',
|
566 |
-
'%s',
|
567 |
-
'%s',
|
568 |
-
'%s',
|
569 |
-
'%s',
|
570 |
-
'%s',
|
571 |
-
'%s',
|
572 |
-
'%s',
|
573 |
-
'%s',
|
574 |
-
'%s',
|
575 |
-
'%s',
|
576 |
-
'%s',
|
577 |
-
'%s',
|
578 |
-
'%s',
|
579 |
-
'%d'
|
580 |
-
)
|
581 |
-
);
|
582 |
-
|
583 |
-
if(!$save_or_no)
|
584 |
-
{
|
585 |
-
?>
|
586 |
-
<div class="updated"><p><strong><?php _e('Error. Please install plugin again'); ?></strong></p></div>
|
587 |
-
<?php
|
588 |
-
return false;
|
589 |
-
}
|
590 |
-
$id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
|
591 |
-
$save_or_no= $wpdb->insert($wpdb->prefix.'formmaker_views', array(
|
592 |
-
'form_id' => $id
|
593 |
-
),
|
594 |
-
array(
|
595 |
-
'%d'
|
596 |
-
)
|
597 |
-
);
|
598 |
-
?>
|
599 |
-
|
600 |
-
<div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
|
601 |
-
<?php
|
602 |
-
|
603 |
-
return true;
|
604 |
-
}
|
605 |
-
else
|
606 |
-
{
|
607 |
-
?>
|
608 |
<h1>Error</h1>
|
609 |
-
<
|
610 |
<?php
|
611 |
-
|
612 |
-
}
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
|
|
|
|
617 |
}
|
618 |
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
$
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
681 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
682 |
}
|
683 |
-
}
|
684 |
-
|
685 |
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
function remove_form($id){
|
695 |
global $wpdb;
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
726 |
}
|
727 |
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
733 |
}
|
734 |
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
function forchrome($id){
|
753 |
-
?>
|
754 |
<script type="text/javascript">
|
755 |
|
756 |
|
757 |
-
window.onload=val;
|
758 |
|
759 |
-
function val()
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
}
|
764 |
|
765 |
</script>
|
766 |
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
@@ -768,252 +551,62 @@ function val()
|
|
768 |
<?php
|
769 |
}
|
770 |
|
771 |
-
function gotoedit(){
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
<?php
|
776 |
-
|
777 |
-
}
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
//////////////////////////////////////////// Actions after submission
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
function Actions_after_submission($id){
|
803 |
-
global $wpdb;
|
804 |
-
$row=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$id."'");
|
805 |
-
html_Actions_after_submission($row);
|
806 |
-
}
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
function Apply_Actions_after_submission($id){
|
812 |
-
global $wpdb;
|
813 |
-
if($_POST["submit_text_type"]==5)
|
814 |
-
$sub_te_type= $_POST["page_name"];
|
815 |
-
else
|
816 |
-
{
|
817 |
-
$sub_te_type= $_POST["post_name"];
|
818 |
-
}
|
819 |
-
|
820 |
-
$savedd=$wpdb->update($wpdb->prefix."formmaker", array(
|
821 |
-
// 'javascript' => $_POST["counter"],
|
822 |
-
'submit_text' => $_POST["content"],
|
823 |
-
'url' => $_POST["url"],
|
824 |
-
'submit_text_type' => $_POST["submit_text_type"],
|
825 |
-
// 'script1' => $_POST["show_numbers"],
|
826 |
-
// 'script2' => $_POST["show_numbers"],
|
827 |
-
// 'script_user1' => $_POST["show_numbers"],
|
828 |
-
// 'script_user2' => $_POST["show_numbers"],
|
829 |
-
|
830 |
-
'article_id' =>$sub_te_type,
|
831 |
-
|
832 |
-
),
|
833 |
-
array('id'=>$id),
|
834 |
-
array(
|
835 |
-
'%s',
|
836 |
-
'%s',
|
837 |
-
'%d',
|
838 |
-
'%s'
|
839 |
-
)
|
840 |
-
|
841 |
-
);
|
842 |
-
|
843 |
-
?>
|
844 |
-
<div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
|
845 |
-
<?php
|
846 |
-
|
847 |
-
}
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
//////////////////////////////////////////// Edit JavaScript
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
function Edit_JavaScript($id){
|
873 |
-
global $wpdb;
|
874 |
-
$row=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$id."'");
|
875 |
-
html_Edit_JavaScript($row);
|
876 |
-
}
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
function Apply_Edit_JavaScript($id){
|
882 |
-
global $wpdb;
|
883 |
-
$savedd=$wpdb->update($wpdb->prefix."formmaker", array(
|
884 |
-
'javascript' => stripslashes($_POST["javascript"]),
|
885 |
-
|
886 |
-
// 'script1' => $_POST["show_numbers"],
|
887 |
-
// 'script2' => $_POST["show_numbers"],
|
888 |
-
// 'script_user1' => $_POST["show_numbers"],
|
889 |
-
// 'script_user2' => $_POST["show_numbers"],
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
),
|
894 |
-
array('id'=>$id),
|
895 |
-
array(
|
896 |
-
'%s'
|
897 |
-
)
|
898 |
-
|
899 |
-
);
|
900 |
-
?>
|
901 |
-
<div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
|
902 |
-
<?php
|
903 |
-
|
904 |
-
|
905 |
-
}
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
//////////////////////////////////////////// Edit Custom text in email for administrator
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
function Custom_text_in_email_for_administrator($id){
|
926 |
-
global $wpdb;
|
927 |
-
$row=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$id."'");
|
928 |
-
html_Custom_text_in_email_for_administrator($row);
|
929 |
-
}
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
function Apply_Custom_text_in_email_for_administrator($id){
|
935 |
-
global $wpdb;
|
936 |
-
$savedd=$wpdb->update($wpdb->prefix."formmaker", array(
|
937 |
-
'script1' => stripslashes($_POST["script1"]),
|
938 |
-
'script2' => stripslashes($_POST["script2"]),
|
939 |
-
|
940 |
-
),
|
941 |
-
array('id'=>$id),
|
942 |
-
array(
|
943 |
-
'%s',
|
944 |
-
'%s'
|
945 |
-
)
|
946 |
-
|
947 |
-
);
|
948 |
-
?>
|
949 |
-
<div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
|
950 |
-
<?php
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
}
|
955 |
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
//////////////////////////////////////////// Edit JavaScript
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
function Custom_text_in_email_for_user($id){
|
986 |
-
global $wpdb;
|
987 |
-
$row=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$id."'");
|
988 |
-
html_Custom_text_in_email_for_user($row);
|
989 |
}
|
990 |
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1013 |
}
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1 |
<?php
|
2 |
|
3 |
+
if (!current_user_can('manage_options')) {
|
4 |
+
die('Access Denied');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
}
|
6 |
+
function update_form_maker() {
|
7 |
+
global $wpdb;
|
8 |
+
$query = "SELECT id, form FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN(" . get_option('contact_form_forms', 0) . ")";
|
9 |
+
$forms = $wpdb->get_results($query);
|
10 |
+
$id = 0;
|
11 |
+
$old_version = FALSE;
|
12 |
+
foreach ($forms as $form) {
|
13 |
+
if (strpos($form->form, "wdform_table1") === FALSE) {
|
14 |
+
$id = $form->id;
|
15 |
+
$old_version = TRUE;
|
16 |
+
break;
|
17 |
+
}
|
18 |
+
}
|
19 |
+
if (!$old_version) {
|
20 |
+
?>
|
21 |
+
<script type="text/javascript">
|
22 |
+
window.onload = val;
|
23 |
+
function val() {
|
24 |
+
var form = document.adminForm;
|
25 |
+
submitform();
|
26 |
+
}
|
27 |
+
function submitform(pressbutton) {
|
28 |
+
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=update_complite";
|
29 |
+
document.getElementById('adminForm').submit();
|
30 |
+
}
|
31 |
+
</script>
|
32 |
+
<form action="admin.php?page=Form_maker" method="post" id="adminForm" name="adminForm"></form>
|
33 |
+
<?php
|
34 |
+
die();
|
35 |
+
}
|
36 |
+
$row = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id=" . $id);
|
37 |
+
$labels = array();
|
38 |
+
$label_id = array();
|
39 |
+
$label_order_original = array();
|
40 |
+
$label_type = array();
|
41 |
+
$label_all = explode('#****#', $row->label_order);
|
42 |
+
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
43 |
+
foreach ($label_all as $key => $label_each) {
|
44 |
+
$label_id_each = explode('#**id**#', $label_each);
|
45 |
+
array_push($label_id, $label_id_each[0]);
|
46 |
+
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
47 |
+
array_push($label_order_original, addslashes($label_oder_each[0]));
|
48 |
+
array_push($label_type, $label_oder_each[1]);
|
49 |
+
}
|
50 |
+
$labels['id'] = '"' . implode('","', $label_id) . '"';
|
51 |
+
$labels['label'] = '"' . implode('","', $label_order_original) . '"';
|
52 |
+
$labels['type'] = '"' . implode('","', $label_type) . '"';
|
53 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker_themes WHERE `id` NOT IN(" . get_option('contact_form_forms', 0) . ") ORDER BY title";
|
54 |
+
$themes = $wpdb->get_results($query);
|
55 |
+
@session_start();
|
56 |
+
$_SESSION['current_updates'] = $_SESSION['current_updates'] + 1;
|
57 |
+
html_update_form_maker($row, $labels, $themes);
|
58 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
|
60 |
+
function save_update_form_maker() {
|
61 |
+
global $wpdb;
|
62 |
+
$id = (int)$_GET['id'];
|
63 |
+
$no_slash_form = stripslashes($_POST['form']);
|
64 |
+
$no_slash_form_front = stripslashes($_POST['form_front']);
|
65 |
+
$savedd = $wpdb->update($wpdb->prefix . "formmaker", array(
|
66 |
+
'title' => $_POST["title"],
|
67 |
+
'mail' => $_POST["mail"],
|
68 |
+
'form' => $no_slash_form,
|
69 |
+
'form_front' => $no_slash_form_front,
|
70 |
+
'theme' => $_POST["theme"],
|
71 |
+
'counter' => $_POST["counter"],
|
72 |
+
'label_order' => $_POST["label_order"],
|
73 |
+
'label_order_current' => $_POST["label_order_current"],
|
74 |
+
'pagination' => $_POST["pagination"],
|
75 |
+
'show_title' => $_POST["show_title"],
|
76 |
+
'show_numbers' => $_POST["show_numbers"],
|
77 |
+
'public_key' => $_POST["public_key"],
|
78 |
+
'private_key' => $_POST["private_key"],
|
79 |
+
'recaptcha_theme' => $_POST["recaptcha_theme"],
|
80 |
+
), array('id' => $id), array(
|
81 |
+
'%s',
|
82 |
+
'%s',
|
83 |
+
'%s',
|
84 |
+
'%s',
|
85 |
+
'%d',
|
86 |
+
'%d',
|
87 |
+
'%s',
|
88 |
+
'%s',
|
89 |
+
'%s',
|
90 |
+
'%s',
|
91 |
+
'%s',
|
92 |
+
'%s',
|
93 |
+
'%s',
|
94 |
+
'%s'
|
95 |
+
));
|
96 |
+
html_forchrome_update();
|
97 |
+
}
|
98 |
|
99 |
+
function display_form_lists() {
|
100 |
+
global $wpdb;
|
101 |
+
$where = '';
|
102 |
+
$order = "";
|
103 |
+
$sort["default_style"] = "manage-column column-autor sortable desc";
|
104 |
+
$sort["sortid_by"] = "";
|
105 |
+
if (isset($_POST['page_number'])) {
|
106 |
+
if ($_POST['asc_or_desc']) {
|
107 |
+
$sort["sortid_by"] = $wpdb->escape($_POST['order_by']);
|
108 |
+
if ((int)$_POST['asc_or_desc'] == 1) {
|
109 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
110 |
+
$sort["1_or_2"] = "2";
|
111 |
+
$order = "ORDER BY " . $sort["sortid_by"] . " ASC";
|
112 |
+
}
|
113 |
+
else {
|
114 |
+
$sort["custom_style"] = "manage-column column-title sorted desc";
|
115 |
+
$sort["1_or_2"] = "1";
|
116 |
+
$order = "ORDER BY " . $sort["sortid_by"] . " DESC";
|
117 |
+
}
|
118 |
+
}
|
119 |
+
if ($_POST['page_number']) {
|
120 |
+
$limit = ((int)$_POST['page_number'] - 1) * 20;
|
121 |
+
}
|
122 |
+
else {
|
123 |
+
$limit = 0;
|
124 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
}
|
126 |
+
else {
|
127 |
+
$limit = 0;
|
128 |
+
}
|
129 |
+
if (isset($_POST['search_events_by_title'])) {
|
130 |
+
$search_tag = esc_html($_POST['search_events_by_title']);
|
131 |
+
}
|
132 |
+
else {
|
133 |
+
$search_tag = "";
|
134 |
+
}
|
135 |
+
if ($search_tag) {
|
136 |
+
$where = ' WHERE title LIKE "%' . $search_tag . '%"';
|
137 |
+
}
|
138 |
+
if ($where) {
|
139 |
+
$where .= " AND `id` NOT IN(" . get_option('contact_form_forms', 0) . ")";
|
140 |
+
}
|
141 |
+
else {
|
142 |
+
$where = " WHERE `id` NOT IN(" . get_option('contact_form_forms', 0) . ")";
|
143 |
+
}
|
144 |
+
// get the total number of records
|
145 |
+
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker" . $where;
|
146 |
+
$total = $wpdb->get_var($query);
|
147 |
+
$pageNav['total'] = $total;
|
148 |
+
$pageNav['limit'] = $limit / 20 + 1;
|
149 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker" . $where . " " . $order . " " . " LIMIT " . $limit . ",20";
|
150 |
+
$rows = $wpdb->get_results($query);
|
151 |
+
$old_version = FALSE;
|
152 |
+
foreach ($rows as $row) {
|
153 |
+
if (strpos($row->form, "wdform_table1") === FALSE) {
|
154 |
+
$old_version = TRUE;
|
155 |
+
break;
|
156 |
+
}
|
157 |
+
}
|
158 |
+
$can_update_form = TRUE;
|
159 |
+
if ($old_version) {
|
160 |
+
$old_n = 0;
|
161 |
+
foreach ($rows as $row) {
|
162 |
+
$count_words_in_form = count(explode("_element_section", $row->form)) - count(explode("and_element_section", $row->form));
|
163 |
+
if (!(strpos($row->form, "type_map") === FALSE)) {
|
164 |
+
$can_update_form = FALSE;
|
165 |
+
break;
|
166 |
+
}
|
167 |
+
if (!(strpos($row->form, "type_file") === FALSE)) {
|
168 |
+
$can_update_form = FALSE;
|
169 |
+
break;
|
170 |
+
}
|
171 |
+
if ($count_words_in_form > 5) {
|
172 |
+
$can_update_form = FALSE;
|
173 |
+
break;
|
174 |
+
}
|
175 |
+
if (strpos($row->form, "wdform_table1") === FALSE) {
|
176 |
+
$old_n++;
|
177 |
+
}
|
178 |
+
}
|
179 |
+
@session_start();
|
180 |
+
$_SESSION['all_updates'] = $old_n;
|
181 |
+
$_SESSION['current_updates'] = 0;
|
182 |
+
}
|
183 |
+
html_display_form_lists($rows, $pageNav, $sort, $old_version, $can_update_form);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
}
|
185 |
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
////////////////////////////////// ADD FORM
|
187 |
+
function add_form() {
|
188 |
+
global $wpdb;
|
189 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker_themes WHERE `id` NOT IN(" . get_option('contact_form_themes', 0) . ") ORDER BY title";
|
190 |
+
$themes = $wpdb->get_results($query);
|
191 |
+
html_add_form($themes);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
}
|
193 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
////////////////////////////////////// Edit Form
|
195 |
+
function edit_form_maker($id) {
|
196 |
+
global $wpdb;
|
197 |
+
// load the row from the db table
|
198 |
+
if (get_option('contact_form_forms', FALSE)) {
|
199 |
+
$row = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $id . "' AND `id` NOT IN(" . get_option('contact_form_forms') . ")");
|
200 |
+
}
|
201 |
+
else {
|
202 |
+
$row = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $id . "'");
|
203 |
+
}
|
204 |
+
$labels = array();
|
205 |
+
$label_id = array();
|
206 |
+
$label_order_original = array();
|
207 |
+
$label_type = array();
|
208 |
+
$label_all = explode('#****#', $row->label_order);
|
209 |
+
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
210 |
+
foreach ($label_all as $key => $label_each) {
|
211 |
+
$label_id_each = explode('#**id**#', $label_each);
|
212 |
+
array_push($label_id, $label_id_each[0]);
|
213 |
+
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
214 |
+
array_push($label_order_original, addslashes($label_oder_each[0]));
|
215 |
+
array_push($label_type, $label_oder_each[1]);
|
216 |
+
}
|
217 |
+
$labels['id'] = '"' . implode('","', $label_id) . '"';
|
218 |
+
$labels['label'] = '"' . implode('","', $label_order_original) . '"';
|
219 |
+
$labels['type'] = '"' . implode('","', $label_type) . '"';
|
220 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker_themes WHERE `id` NOT IN(" . get_option('contact_form_themes', 0) . ") ORDER BY title";
|
221 |
+
$themes = $wpdb->get_results($query);
|
222 |
+
html_edit_form_maker($row, $labels, $themes);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
}
|
224 |
|
225 |
+
function save_form() {
|
226 |
+
$count_words_in_form = count(explode("_element_section", $_POST["form"])) - count(explode("and_element_section", $_POST["form"])) + count(explode("wdform_table1", $_POST["form"]));
|
227 |
+
if ($count_words_in_form > 9) {
|
228 |
+
?>
|
229 |
+
<div class="updated"><p><strong>The free version is limited up to 5 fields to add. If you need this functionality, you
|
230 |
+
need to buy the commercial version.</strong></p></div>
|
231 |
+
<?php
|
232 |
+
return FALSE;
|
233 |
+
}
|
234 |
+
global $wpdb;
|
235 |
+
if (esc_html($_POST["title"]) != '') {
|
236 |
+
if (isset($_POST["label_order"]) && isset($_POST["title"]) && isset($_POST["form"])) {
|
237 |
+
$no_slash_form = stripslashes($_POST['form']);
|
238 |
+
$no_slash_form_front = stripslashes($_POST['form_front']);
|
239 |
+
$javascript = "// before form is load
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
function before_load()
|
241 |
{
|
242 |
}
|
248 |
function before_reset()
|
249 |
{
|
250 |
}";
|
251 |
+
$save_or_no = $wpdb->insert($wpdb->prefix . 'formmaker', array(
|
252 |
+
'id' => NULL,
|
253 |
+
'title' => $_POST["title"],
|
254 |
+
'mail' => '',
|
255 |
+
'form' => $no_slash_form,
|
256 |
+
'form_front' => $no_slash_form_front,
|
257 |
+
'theme' => 1,
|
258 |
+
'counter' => $_POST["counter"],
|
259 |
+
'label_order' => $_POST["label_order"],
|
260 |
+
'pagination' => $_POST["pagination"],
|
261 |
+
'show_title' => $_POST["show_title"],
|
262 |
+
'show_numbers' => $_POST["show_numbers"],
|
263 |
+
'public_key' => $_POST["public_key"],
|
264 |
+
'private_key' => $_POST["private_key"],
|
265 |
+
'recaptcha_theme' => $_POST["recaptcha_theme"],
|
266 |
+
'javascript' => $javascript,
|
267 |
+
'script1' => '',
|
268 |
+
'script2' => '',
|
269 |
+
'script_user1' => '',
|
270 |
+
'script_user2' => '',
|
271 |
+
'submit_text' => '',
|
272 |
+
'url' => '',
|
273 |
+
'article_id' => 0,
|
274 |
+
'submit_text_type' => 0,
|
275 |
+
'script_mail' => '%all%',
|
276 |
+
'script_mail_user' => '%all%',
|
277 |
+
'label_order_current' => $_POST["label_order"],
|
278 |
+
'tax' => 0,
|
279 |
+
'payment_currency' => '',
|
280 |
+
'paypal_email' => '',
|
281 |
+
'checkout_mode' => 'testmode',
|
282 |
+
'paypal_mode' => 0
|
283 |
+
), array(
|
284 |
+
'%d',
|
285 |
+
'%s',
|
286 |
+
'%s',
|
287 |
+
'%s',
|
288 |
+
'%s',
|
289 |
+
'%d',
|
290 |
+
'%d',
|
291 |
+
'%s',
|
292 |
+
'%s',
|
293 |
+
'%s',
|
294 |
+
'%s',
|
295 |
+
'%s',
|
296 |
+
'%s',
|
297 |
+
'%s',
|
298 |
+
'%s',
|
299 |
+
'%s',
|
300 |
+
'%s',
|
301 |
+
'%s',
|
302 |
+
'%s',
|
303 |
+
'%s',
|
304 |
+
'%s',
|
305 |
+
'%s',
|
306 |
+
'%d',
|
307 |
+
'%s',
|
308 |
+
'%s',
|
309 |
+
'%s',
|
310 |
+
'%d',
|
311 |
+
'%s',
|
312 |
+
'%s',
|
313 |
+
'%s',
|
314 |
+
'%d'
|
315 |
+
));
|
316 |
+
if (!$save_or_no) {
|
317 |
+
?>
|
318 |
+
<div class="updated"><p><strong><?php _e('Error. Please install plugin again'); ?></strong></p></div>
|
319 |
+
<?php
|
320 |
+
return FALSE;
|
321 |
+
}
|
322 |
+
$id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
323 |
+
$save_or_no = $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
|
324 |
+
'form_id' => $id
|
325 |
+
), array(
|
326 |
+
'%d'
|
327 |
+
));
|
328 |
+
?>
|
329 |
+
|
330 |
+
<div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
|
331 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
332 |
|
333 |
+
return TRUE;
|
334 |
+
}
|
335 |
+
else {
|
336 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
337 |
<h1>Error</h1>
|
|
|
338 |
<?php
|
339 |
+
exit;
|
340 |
+
}
|
341 |
+
}
|
342 |
+
else {
|
343 |
+
?>
|
344 |
+
<div class="updated"><p><strong><?php _e('could not save form '); ?></strong></p></div>
|
345 |
+
<?php
|
346 |
+
}
|
347 |
}
|
348 |
|
349 |
+
function save_as_copy() {
|
350 |
+
global $wpdb;
|
351 |
+
if (isset($_POST["label_order"]) && isset($_POST["title"]) && isset($_POST["form"]) && isset($_GET['id'])) {
|
352 |
+
$no_slash_form = stripslashes($_POST['form']);
|
353 |
+
$no_slash_form_front = stripslashes($_POST['form_front']);
|
354 |
+
$form_id = (int) $_GET['id'];
|
355 |
+
$row_for_sav_as_copy = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id=" . $form_id);
|
356 |
+
$javascript = $row_for_sav_as_copy->javascript;
|
357 |
+
$save_or_no = $wpdb->insert($wpdb->prefix . 'formmaker', array(
|
358 |
+
'id' => NULL,
|
359 |
+
'title' => $_POST["title"],
|
360 |
+
'mail' => $row_for_sav_as_copy->mail,
|
361 |
+
'form' => $no_slash_form,
|
362 |
+
'form_front' => $no_slash_form_front,
|
363 |
+
'theme' => $row_for_sav_as_copy->theme,
|
364 |
+
'counter' => $_POST["counter"],
|
365 |
+
'label_order' => $_POST["label_order"],
|
366 |
+
'pagination' => $_POST["pagination"],
|
367 |
+
'show_title' => $_POST["show_title"],
|
368 |
+
'show_numbers' => $_POST["show_numbers"],
|
369 |
+
'public_key' => $_POST["public_key"],
|
370 |
+
'private_key' => $_POST["private_key"],
|
371 |
+
'recaptcha_theme' => $_POST["recaptcha_theme"],
|
372 |
+
'javascript' => $javascript,
|
373 |
+
'script1' => $row_for_sav_as_copy->script1,
|
374 |
+
'script2' => $row_for_sav_as_copy->script2,
|
375 |
+
'script_user1' => $row_for_sav_as_copy->script_user1,
|
376 |
+
'script_user2' => $row_for_sav_as_copy->script_user2,
|
377 |
+
'submit_text' => $row_for_sav_as_copy->submit_text,
|
378 |
+
'url' => $row_for_sav_as_copy->url,
|
379 |
+
'article_id' => $row_for_sav_as_copy->article_id,
|
380 |
+
'submit_text_type' => $row_for_sav_as_copy->submit_text_type,
|
381 |
+
'script_mail' => $row_for_sav_as_copy->script_mail,
|
382 |
+
'script_mail_user' => $row_for_sav_as_copy->script_mail_user,
|
383 |
+
'paypal_mode' => $row_for_sav_as_copy->paypal_mode,
|
384 |
+
'checkout_mode' => $row_for_sav_as_copy->checkout_mode,
|
385 |
+
'paypal_email' => $row_for_sav_as_copy->paypal_email,
|
386 |
+
'payment_currency' => $row_for_sav_as_copy->payment_currency,
|
387 |
+
'tax' => $row_for_sav_as_copy->tax,
|
388 |
+
'label_order_current' => $row_for_sav_as_copy->label_order_current
|
389 |
+
), array(
|
390 |
+
'%d',
|
391 |
+
'%s',
|
392 |
+
'%s',
|
393 |
+
'%s',
|
394 |
+
'%s',
|
395 |
+
'%d',
|
396 |
+
'%d',
|
397 |
+
'%s',
|
398 |
+
'%s',
|
399 |
+
'%s',
|
400 |
+
'%s',
|
401 |
+
'%s',
|
402 |
+
'%s',
|
403 |
+
'%s',
|
404 |
+
'%s',
|
405 |
+
'%s',
|
406 |
+
'%s',
|
407 |
+
'%s',
|
408 |
+
'%s',
|
409 |
+
'%s',
|
410 |
+
'%s',
|
411 |
+
'%s',
|
412 |
+
'%d',
|
413 |
+
'%s',
|
414 |
+
'%s',
|
415 |
+
'%d',
|
416 |
+
'%s',
|
417 |
+
'%s',
|
418 |
+
'%s',
|
419 |
+
'%d',
|
420 |
+
'%s'
|
421 |
+
));
|
422 |
+
if (!$save_or_no) {
|
423 |
+
?>
|
424 |
+
<div class="updated"><p><strong><?php _e('Error. Please install plugin again'); ?></strong></p></div>
|
425 |
<?php
|
426 |
+
return FALSE;
|
427 |
+
}
|
428 |
+
$id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
429 |
+
$save_or_no = $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
|
430 |
+
'form_id' => $id
|
431 |
+
), array(
|
432 |
+
'%d'
|
433 |
+
));
|
434 |
+
?>
|
435 |
+
|
436 |
+
<div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
|
437 |
+
<?php
|
438 |
+
|
439 |
+
return TRUE;
|
440 |
+
}
|
441 |
+
else {
|
442 |
+
?>
|
443 |
+
<h1>Error</h1>
|
444 |
+
<
|
445 |
+
<?php
|
446 |
+
exit;
|
447 |
+
}
|
448 |
}
|
|
|
|
|
449 |
|
450 |
+
function apply_form($id) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
451 |
global $wpdb;
|
452 |
+
$count_words_in_form = count(explode("_element_section", $_POST["form"])) - count(explode("and_element_section", $_POST["form"])) + count(explode("wdform_table1", $_POST["form"]));
|
453 |
+
if ($count_words_in_form > 9) {
|
454 |
+
?>
|
455 |
+
<div class="updated"><p><strong>The free version is limited up to 5 fields to add. If you need this functionality, you
|
456 |
+
need to buy the commercial version.</strong></p></div>
|
457 |
+
<?php
|
458 |
+
return FALSE;
|
459 |
+
}
|
460 |
+
$no_slash_form = stripslashes($_POST['form']);
|
461 |
+
$no_slash_form_front = stripslashes($_POST['form_front']);
|
462 |
+
if ($_POST["title"] != '') {
|
463 |
+
$savedd = $wpdb->update($wpdb->prefix . "formmaker", array(
|
464 |
+
'title' => $_POST["title"],
|
465 |
+
'form' => $no_slash_form,
|
466 |
+
'form_front' => $no_slash_form_front,
|
467 |
+
'counter' => $_POST["counter"],
|
468 |
+
'label_order' => $_POST["label_order"],
|
469 |
+
'pagination' => $_POST["pagination"],
|
470 |
+
'show_title' => $_POST["show_title"],
|
471 |
+
'show_numbers' => $_POST["show_numbers"],
|
472 |
+
'public_key' => $_POST["public_key"],
|
473 |
+
'private_key' => $_POST["private_key"],
|
474 |
+
'recaptcha_theme' => $_POST["recaptcha_theme"],
|
475 |
+
), array('id' => $id), array(
|
476 |
+
'%s',
|
477 |
+
'%s',
|
478 |
+
'%s',
|
479 |
+
'%d',
|
480 |
+
'%s',
|
481 |
+
'%s',
|
482 |
+
'%s',
|
483 |
+
'%s',
|
484 |
+
'%s',
|
485 |
+
'%s',
|
486 |
+
'%s'
|
487 |
+
), array('%d'));
|
488 |
+
?>
|
489 |
+
<div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
|
490 |
+
<?php
|
491 |
+
}
|
492 |
+
else {
|
493 |
+
?>
|
494 |
+
<div class="updated"><p><strong><?php _e('could not save form'); ?></strong></p></div>
|
495 |
+
<?php
|
496 |
+
}
|
497 |
}
|
498 |
|
499 |
+
function remove_form($id) {
|
500 |
+
global $wpdb;
|
501 |
+
// If any item selected
|
502 |
+
// Prepare sql statement, if cid array more than one,
|
503 |
+
// will be "cid1, cid2, ..."
|
504 |
+
// Create sql statement
|
505 |
+
$sql_remov_form = "DELETE FROM " . $wpdb->prefix . "formmaker WHERE id='" . $id . "'";
|
506 |
+
if (!$wpdb->query($sql_remov_form)) {
|
507 |
+
?>
|
508 |
+
<div id="message" class="error"><p>Form Not Deleted</p></div>
|
509 |
+
<?php
|
510 |
+
return FALSE;
|
511 |
+
}
|
512 |
+
if ($wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker_views WHERE form_id='" . $id . "'")) {
|
513 |
+
$sql_remov_form = "DELETE FROM " . $wpdb->prefix . "formmaker_views WHERE form_id='" . $id . "'";
|
514 |
+
if (!$wpdb->query($sql_remov_form)) {
|
515 |
+
?>
|
516 |
+
<div id="message" class="error"><p>Form views Not Deleted</p></div>
|
517 |
+
<?php
|
518 |
+
return FALSE;
|
519 |
+
}
|
520 |
+
}
|
521 |
+
if ($wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id='" . $id . "'")) {
|
522 |
+
$sql_remov_form = "DELETE FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id='" . $id . "'";
|
523 |
+
if (!$wpdb->query($sql_remov_form)) {
|
524 |
+
?>
|
525 |
+
<div id="message" class="error"><p>Form submits Not Deleted</p></div>
|
526 |
+
<?php
|
527 |
+
return FALSE;
|
528 |
+
}
|
529 |
+
}
|
530 |
+
?>
|
531 |
+
<div class="updated"><p><strong><?php _e('Item Deleted.'); ?></strong></p></div>
|
532 |
+
<?php
|
533 |
+
// Execute query
|
534 |
}
|
535 |
|
536 |
+
function forchrome($id) {
|
537 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
538 |
<script type="text/javascript">
|
539 |
|
540 |
|
541 |
+
window.onload = val;
|
542 |
|
543 |
+
function val() {
|
544 |
+
document.getElementById('adminForm').action = "admin.php?page=Form_maker&task=gotoedit&id=<?php echo $id;?>";
|
545 |
+
document.getElementById('adminForm').submit();
|
546 |
+
}
|
|
|
547 |
|
548 |
</script>
|
549 |
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
551 |
<?php
|
552 |
}
|
553 |
|
554 |
+
function gotoedit() {
|
555 |
+
?>
|
556 |
+
<div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
|
557 |
+
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
558 |
}
|
559 |
|
560 |
+
// Form options.
|
561 |
+
function form_options($id) {
|
562 |
+
global $wpdb;
|
563 |
+
$row = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $id . "'");
|
564 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker_themes ORDER BY title";
|
565 |
+
$themes = $wpdb->get_results($query);
|
566 |
+
html_form_options($row, $themes);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
567 |
}
|
568 |
|
569 |
+
// Apply form options.
|
570 |
+
function Apply_form_options($id) {
|
571 |
+
global $wpdb;
|
572 |
+
if ($_POST["submit_text_type"] == 5) {
|
573 |
+
$sub_te_type = $_POST["page_name"];
|
574 |
+
}
|
575 |
+
else {
|
576 |
+
$sub_te_type = $_POST["post_name"];
|
577 |
+
}
|
578 |
+
$savedd = $wpdb->update($wpdb->prefix . "formmaker", array(
|
579 |
+
'mail' => $_POST["mail"],
|
580 |
+
'theme' => $_POST["theme"],
|
581 |
+
'javascript' => stripslashes($_POST["javascript"]),
|
582 |
+
'submit_text' => $_POST["content"],
|
583 |
+
'url' => $_POST["url"],
|
584 |
+
'submit_text_type' => $_POST["submit_text_type"],
|
585 |
+
'script_mail' => stripslashes($_POST["script_mail"]),
|
586 |
+
'script_mail_user' => stripslashes($_POST["script_mail_user"]),
|
587 |
+
'article_id' => $sub_te_type,
|
588 |
+
'paypal_mode' => 0,
|
589 |
+
'checkout_mode' => 'testmode',
|
590 |
+
'paypal_email' => '',
|
591 |
+
'payment_currency' => 'USD',
|
592 |
+
'tax' => 0
|
593 |
+
), array('id' => $id), array(
|
594 |
+
'%s',
|
595 |
+
'%d',
|
596 |
+
'%s',
|
597 |
+
'%s',
|
598 |
+
'%s',
|
599 |
+
'%d',
|
600 |
+
'%s',
|
601 |
+
'%s',
|
602 |
+
'%s',
|
603 |
+
'%d',
|
604 |
+
'%s',
|
605 |
+
'%s',
|
606 |
+
'%s',
|
607 |
+
'%d',
|
608 |
+
), array('%d'));
|
609 |
+
?>
|
610 |
+
<div class="updated"><p><strong><?php _e('Changes successfully saved'); ?></strong></p></div>
|
611 |
+
<?php
|
612 |
}
|
|
|
|
|
|
|
|
|
|
|
|
form_maker_widget.php
CHANGED
@@ -42,20 +42,28 @@ class form_maker_widget extends WP_Widget {
|
|
42 |
|
43 |
// Widget Control Panel //
|
44 |
function form($instance) {
|
45 |
-
$defaults = array(
|
|
|
|
|
|
|
46 |
$instance = wp_parse_args((array)$instance, $defaults);
|
47 |
global $wpdb; ?>
|
48 |
<p>
|
49 |
<label for="<?php echo $this->get_field_id('title'); ?>">Title:</label>
|
50 |
-
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
|
|
|
51 |
<label for="<?php echo $this->get_field_id('form_id'); ?>">Select a form:</label>
|
52 |
-
<select name="<?php echo $this->get_field_name('form_id'); ?>'" id="<?php echo $this->get_field_id('form_id'); ?>"
|
|
|
53 |
<option style="text-align:center" value="0">- Select a Form -</option>
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
|
|
|
|
|
|
59 |
</select>
|
60 |
<?php
|
61 |
}
|
42 |
|
43 |
// Widget Control Panel //
|
44 |
function form($instance) {
|
45 |
+
$defaults = array(
|
46 |
+
'title' => '',
|
47 |
+
'form_id' => 0
|
48 |
+
);
|
49 |
$instance = wp_parse_args((array)$instance, $defaults);
|
50 |
global $wpdb; ?>
|
51 |
<p>
|
52 |
<label for="<?php echo $this->get_field_id('title'); ?>">Title:</label>
|
53 |
+
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
|
54 |
+
name="<?php echo $this->get_field_name('title'); ?>'" type="text" value="<?php echo $instance['title']; ?>"/>
|
55 |
<label for="<?php echo $this->get_field_id('form_id'); ?>">Select a form:</label>
|
56 |
+
<select name="<?php echo $this->get_field_name('form_id'); ?>'" id="<?php echo $this->get_field_id('form_id'); ?>"
|
57 |
+
style="width:225px;text-align:center;">
|
58 |
<option style="text-align:center" value="0">- Select a Form -</option>
|
59 |
+
<?php
|
60 |
+
$ids_Form_Maker = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker order by `id` DESC", 0);
|
61 |
+
foreach ($ids_Form_Maker as $arr_Form_Maker) {
|
62 |
+
?>
|
63 |
+
<option value="<?php echo $arr_Form_Maker->id; ?>" <?php if ($arr_Form_Maker->id == $instance['form_id']) {
|
64 |
+
echo "SELECTED";
|
65 |
+
} ?>><?php echo $arr_Form_Maker->title; ?></option>
|
66 |
+
<?php }?>
|
67 |
</select>
|
68 |
<?php
|
69 |
}
|
front_end_form_maker.php
CHANGED
@@ -1,1625 +1,1698 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @package Form Maker
|
5 |
-
* @author Web-Dorado
|
6 |
-
* @copyright (C) 2011 Web-Dorado. All rights reserved.
|
7 |
-
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
8 |
-
**/
|
9 |
-
|
10 |
-
function showform($id)
|
11 |
-
{
|
12 |
-
|
13 |
-
global $wpdb;
|
14 |
-
$row=$wpdb->get_row($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id=%d",$id ));
|
15 |
-
|
16 |
-
if(!$row)
|
17 |
-
return false;
|
18 |
-
|
19 |
-
if(isset($_POST['Itemid'])){
|
20 |
-
$Itemid=esc_html($_POST["Itemid".$id]);
|
21 |
-
}
|
22 |
-
else{
|
23 |
-
$Itemid="";
|
24 |
-
}
|
25 |
-
|
26 |
-
$form_theme=$wpdb->get_var($wpdb->prepare("SELECT css FROM ".$wpdb->prefix."formmaker_themes WHERE id=%d",$row->theme ));
|
27 |
-
if(!$form_theme)
|
28 |
-
return false;
|
29 |
-
|
30 |
-
$label_id= array();
|
31 |
-
$label_type= array();
|
32 |
-
|
33 |
-
$label_all = explode('#****#',$row->label_order);
|
34 |
-
$label_all = array_slice($label_all,0, count($label_all)-1);
|
35 |
-
|
36 |
-
foreach($label_all as $key => $label_each)
|
37 |
-
{
|
38 |
-
$label_id_each=explode('#**id**#',$label_each);
|
39 |
-
array_push($label_id, $label_id_each[0]);
|
40 |
-
|
41 |
-
$label_order_each=explode('#**label**#', $label_id_each[1]);
|
42 |
-
|
43 |
-
array_push($label_type, $label_order_each[1]);
|
44 |
-
}
|
45 |
-
|
46 |
-
return array($row, $Itemid, $label_id, $label_type, $form_theme);
|
47 |
-
}
|
48 |
-
|
49 |
-
function savedata($form,$id)
|
50 |
-
{
|
51 |
-
|
52 |
-
|
53 |
-
$all_files=array();
|
54 |
-
@session_start();
|
55 |
-
if(isset($_POST["captcha_input"])){
|
56 |
-
$captcha_input=esc_html($_POST["captcha_input"]);
|
57 |
-
}
|
58 |
-
if(isset($_POST["recaptcha_response_field"])){
|
59 |
-
$recaptcha_response_field=esc_html($_POST["recaptcha_response_field"]);
|
60 |
-
}
|
61 |
-
$id_for_old=$id;
|
62 |
-
if(!$form->form_front)
|
63 |
-
$id='';
|
64 |
-
if(isset($_POST["counter".$id]))
|
65 |
-
{
|
66 |
-
$counter=(int) $_POST["counter".$id];
|
67 |
-
if (isset($_POST["captcha_input"]))
|
68 |
-
{
|
69 |
-
$session_wd_captcha_code=isset($_SESSION[$id.'_wd_captcha_code'])?$_SESSION[$id.'_wd_captcha_code']:'-';
|
70 |
-
if($captcha_input==$session_wd_captcha_code)
|
71 |
-
{
|
72 |
-
|
73 |
-
|
74 |
-
$all_files=save_db($counter,$id_for_old);
|
75 |
-
if(is_numeric($all_files))
|
76 |
-
remove($all_files,$id_for_old);
|
77 |
-
else
|
78 |
-
if(isset($counter))
|
79 |
-
gen_mail($counter, $all_files,$id_for_old);
|
80 |
-
|
81 |
-
}
|
82 |
-
else
|
83 |
-
{
|
84 |
-
echo "<script> alert('".addslashes(__('Error, incorrect Security code.', 'form_maker'))."');
|
85 |
-
</script>";
|
86 |
-
}
|
87 |
-
}
|
88 |
-
|
89 |
-
else
|
90 |
-
if(isset($_POST["recaptcha_response_field"]))
|
91 |
-
{
|
92 |
-
$privatekey = $form->private_key;
|
93 |
-
|
94 |
-
$resp = recaptcha_check_answer ($privatekey,$_SERVER["REMOTE_ADDR"],esc_html($_POST["recaptcha_challenge_field"]),$recaptcha_response_field);
|
95 |
-
if($resp->is_valid)
|
96 |
-
{
|
97 |
-
$all_files=save_db($counter,$id_for_old);
|
98 |
-
if(is_numeric($all_files))
|
99 |
-
remove($all_files,$id_for_old);
|
100 |
-
else
|
101 |
-
if(isset($counter))
|
102 |
-
gen_mail($counter, $all_files, $id_for_old);
|
103 |
-
|
104 |
-
}
|
105 |
-
else
|
106 |
-
{
|
107 |
-
echo "<script> alert('".addslashes(__('Error, incorrect Security code.', 'form_maker'))."');
|
108 |
-
</script>";
|
109 |
-
}
|
110 |
-
}
|
111 |
-
|
112 |
-
else
|
113 |
-
{
|
114 |
-
|
115 |
-
$all_files=save_db($counter, $id_for_old);
|
116 |
-
if(is_numeric($all_files))
|
117 |
-
remove($all_files, $id_for_old);
|
118 |
-
else
|
119 |
-
if(isset($counter))
|
120 |
-
gen_mail($counter, $all_files, $id_for_old);
|
121 |
-
|
122 |
-
}
|
123 |
-
|
124 |
-
|
125 |
-
return $all_files;
|
126 |
-
}
|
127 |
-
|
128 |
-
return $all_files;
|
129 |
-
|
130 |
-
|
131 |
-
}
|
132 |
-
|
133 |
-
function save_db($counter,$id)
|
134 |
-
{
|
135 |
-
|
136 |
-
global $wpdb;
|
137 |
-
$chgnac=true;
|
138 |
-
$all_files=array();
|
139 |
-
$form=$wpdb->get_row($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id= %d",$id));
|
140 |
-
|
141 |
-
$id_old=$id;
|
142 |
-
if(!$form->form_front){
|
143 |
-
$id='';
|
144 |
-
|
145 |
-
}
|
146 |
-
$label_id= array();
|
147 |
-
$label_label= array();
|
148 |
-
$label_type= array();
|
149 |
-
|
150 |
-
$label_all = explode('#****#',$form->label_order);
|
151 |
-
$label_all = array_slice($label_all,0, count($label_all)-1);
|
152 |
-
|
153 |
-
foreach($label_all as $key => $label_each)
|
154 |
-
{
|
155 |
-
$label_id_each=explode('#**id**#',$label_each);
|
156 |
-
array_push($label_id, $label_id_each[0]);
|
157 |
-
|
158 |
-
$label_order_each=explode('#**label**#', $label_id_each[1]);
|
159 |
-
|
160 |
-
array_push($label_label, $label_order_each[0]);
|
161 |
-
array_push($label_type, $label_order_each[1]);
|
162 |
-
}
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
$max = $wpdb->get_var("SELECT MAX( group_id ) FROM ".$wpdb->prefix."formmaker_submits" );
|
167 |
-
foreach($label_type as $key => $type)
|
168 |
-
{
|
169 |
-
$value='';
|
170 |
-
if($type=="type_submit_reset" or $type=="type_map" or $type=="type_editor" or $type=="type_captcha" or $type=="type_recaptcha" or $type=="type_button")
|
171 |
-
continue;
|
172 |
-
|
173 |
-
$i=$label_id[$key];
|
174 |
-
|
175 |
-
if($type!="type_address")
|
176 |
-
{
|
177 |
-
$deleted=$_POST[$i."_type".$id];
|
178 |
-
if(!isset($_POST[$i."_type".$id]))
|
179 |
-
break;
|
180 |
-
}
|
181 |
-
|
182 |
-
switch ($type)
|
183 |
-
{
|
184 |
-
case 'type_text':
|
185 |
-
case 'type_password':
|
186 |
-
case 'type_textarea':
|
187 |
-
case "type_submitter_mail":
|
188 |
-
case "type_date":
|
189 |
-
case "type_own_select":
|
190 |
-
case "type_country":
|
191 |
-
case "type_number":
|
192 |
-
{
|
193 |
-
$value=$_POST[$i."_element".$id];
|
194 |
-
break;
|
195 |
-
}
|
196 |
-
case "type_mark_map":
|
197 |
-
{
|
198 |
-
$value=$_POST[$i."_long".$id].'***map***'.$_POST[$i."_lat".$id];
|
199 |
-
break;
|
200 |
-
}
|
201 |
-
|
202 |
-
case "type_date_fields":
|
203 |
-
{
|
204 |
-
$value=$_POST[$i."_day".$id].'-'.$_POST[$i."_month".$id].'-'.$_POST[$i."_year".$id];
|
205 |
-
break;
|
206 |
-
}
|
207 |
-
|
208 |
-
case "type_time":
|
209 |
-
{
|
210 |
-
$ss=$_POST[$i."_ss".$id];
|
211 |
-
if(isset($_POST[$i."_ss".$id]))
|
212 |
-
$value=$_POST[$i."_hh".$id].':'.$_POST[$i."_mm".$id].':'.$_POST[$i."_ss".$id];
|
213 |
-
else
|
214 |
-
$value=$_POST[$i."_hh".$id].':'.$_POST[$i."_mm".$id];
|
215 |
-
|
216 |
-
$am_pm=$_POST[$i."_am_pm".$id];
|
217 |
-
if(isset($_POST[$i."_am_pm".$id]))
|
218 |
-
$value=$value.' '.$_POST[$i."_am_pm".$id];
|
219 |
-
|
220 |
-
break;
|
221 |
-
}
|
222 |
-
|
223 |
-
case "type_phone":
|
224 |
-
{
|
225 |
-
$value=$_POST[$i."_element_first".$id].' '.$_POST[$i."_element_last".$id];
|
226 |
-
|
227 |
-
break;
|
228 |
-
}
|
229 |
-
|
230 |
-
case "type_name":
|
231 |
-
{
|
232 |
-
$element_title=$_POST[$i."_element_title".$id];
|
233 |
-
if(isset($_POST[$i."_element_title".$id]))
|
234 |
-
$value=$_POST[$i."_element_title".$id].' '.$_POST[$i."_element_first".$id].' '.$_POST[$i."_element_last".$id].' '.$_POST[$i."_element_middle".$id];
|
235 |
-
else
|
236 |
-
$value=$_POST[$i."_element_first".$id].' '.$_POST[$i."_element_last".$id];
|
237 |
-
|
238 |
-
break;
|
239 |
-
}
|
240 |
-
|
241 |
-
case "type_file_upload":
|
242 |
-
{
|
243 |
-
$file = $_FILES[$i.'_file'.$id];
|
244 |
-
if($file['name'])
|
245 |
-
{
|
246 |
-
$untilupload = $form->form;
|
247 |
-
$pos1 = strpos($untilupload, "***destinationskizb".$i."***");
|
248 |
-
$pos2 = strpos($untilupload, "***destinationverj".$i."***");
|
249 |
-
$destination = substr($untilupload, $pos1+(23+(strlen($i)-1)), $pos2-$pos1-(23+(strlen($i)-1)));
|
250 |
-
$pos1 = strpos($untilupload, "***extensionskizb".$i."***");
|
251 |
-
$pos2 = strpos($untilupload, "***extensionverj".$i."***");
|
252 |
-
$extension = substr($untilupload, $pos1+(21+(strlen($i)-1)), $pos2-$pos1-(21+(strlen($i)-1)));
|
253 |
-
$pos1 = strpos($untilupload, "***max_sizeskizb".$i."***");
|
254 |
-
$pos2 = strpos($untilupload, "***max_sizeverj".$i."***");
|
255 |
-
$max_size = substr($untilupload, $pos1+(20+(strlen($i)-1)), $pos2-$pos1-(20+(strlen($i)-1)));
|
256 |
-
$fileName = $file['name'];
|
257 |
-
$destination=str_replace(site_url().'/','',$destination);
|
258 |
-
/*$destination = JPATH_SITE.DS.$_POST[$i.'_destination');
|
259 |
-
$extension = $_POST[$i.'_extension');
|
260 |
-
$max_size = $_POST[$i.'_max_size');*/
|
261 |
-
|
262 |
-
$fileSize = $file['size'];
|
263 |
-
|
264 |
-
if($fileSize > $max_size*1024)
|
265 |
-
{
|
266 |
-
echo "<script> alert('".addslashes(__('The file exceeds the allowed size of', 'form_maker')).$max_size." KB');</script>";
|
267 |
-
return ($max+1);
|
268 |
-
}
|
269 |
-
|
270 |
-
$uploadedFileNameParts = explode('.',$fileName);
|
271 |
-
$uploadedFileExtension = array_pop($uploadedFileNameParts);
|
272 |
-
$to=strlen($fileName)-strlen($uploadedFileExtension)-1;
|
273 |
-
|
274 |
-
$fileNameFree= substr($fileName,0, $to);
|
275 |
-
$invalidFileExts = explode(',', $extension);
|
276 |
-
$extOk = false;
|
277 |
-
|
278 |
-
foreach($invalidFileExts as $key => $value)
|
279 |
-
{
|
280 |
-
if( is_numeric(strpos(strtolower($value), strtolower($uploadedFileExtension) )) )
|
281 |
-
{
|
282 |
-
$extOk = true;
|
283 |
-
}
|
284 |
-
}
|
285 |
-
|
286 |
-
if ($extOk == false)
|
287 |
-
{
|
288 |
-
echo "<script> alert('".addslashes(__('Sorry, you are not allowed to upload this type of file.', 'form_maker'))."');</script>";
|
289 |
-
return ($max+1);
|
290 |
-
}
|
291 |
-
|
292 |
-
$fileTemp = $file['tmp_name'];
|
293 |
-
$p=1;
|
294 |
-
while(file_exists( $destination."/".$fileName))
|
295 |
-
{
|
296 |
-
$to=strlen($file['name'])-strlen($uploadedFileExtension)-1;
|
297 |
-
$fileName= substr($fileName,0, $to).'('.$p.').'.$uploadedFileExtension;
|
298 |
-
$p++;
|
299 |
-
}
|
300 |
-
|
301 |
-
if(is_dir(ABSPATH.$destination)){
|
302 |
-
if(!move_uploaded_file($fileTemp, ABSPATH.$destination.'/'.$fileName))
|
303 |
-
{
|
304 |
-
echo "<script> alert('".addslashes(__('Error, file cannot be moved.', 'form_maker'))."');</script>";
|
305 |
-
return ($max+1);
|
306 |
-
|
307 |
-
}
|
308 |
-
|
309 |
-
}
|
310 |
-
else
|
311 |
-
{
|
312 |
-
echo "<script> alert('".addslashes(__('Error, file cannot be moved.', 'form_maker'))."');</script>";
|
313 |
-
return ($max+1);
|
314 |
-
}
|
315 |
-
$value= site_url().'/'.$destination.'/'.$fileName.'*@@url@@*';
|
316 |
-
|
317 |
-
$file['tmp_name']=$destination."/".$fileName;
|
318 |
-
|
319 |
-
array_push($all_files,$file);
|
320 |
-
|
321 |
-
}
|
322 |
-
break;
|
323 |
-
}
|
324 |
-
|
325 |
-
case 'type_address':
|
326 |
-
{
|
327 |
-
$value='*#*#*#';
|
328 |
-
if(isset($_POST[$i."_street1".$id]))
|
329 |
-
{
|
330 |
-
$value=$_POST[$i."_street1".$id];
|
331 |
-
break;
|
332 |
-
}
|
333 |
-
|
334 |
-
if(isset($_POST[$i."_street2".$id]))
|
335 |
-
{
|
336 |
-
$value=$_POST[$i."_street2".$id];
|
337 |
-
break;
|
338 |
-
}
|
339 |
-
|
340 |
-
if(isset($_POST[$i."_city".$id]))
|
341 |
-
{
|
342 |
-
$value=$_POST[$i."_city".$id];
|
343 |
-
break;
|
344 |
-
}
|
345 |
-
|
346 |
-
|
347 |
-
if(isset($_POST[$i."_state".$id]))
|
348 |
-
{
|
349 |
-
$value=$_POST[$i."_state".$id];
|
350 |
-
break;
|
351 |
-
}
|
352 |
-
|
353 |
-
|
354 |
-
if(isset($_POST[$i."_postal".$id]))
|
355 |
-
{
|
356 |
-
$value=$_POST[$i."_postal".$id];
|
357 |
-
break;
|
358 |
-
}
|
359 |
-
|
360 |
-
|
361 |
-
if(isset($_POST[$i."_country".$id]))
|
362 |
-
{
|
363 |
-
$value=$_POST[$i."_country".$id];
|
364 |
-
break;
|
365 |
-
}
|
366 |
-
|
367 |
-
break;
|
368 |
-
}
|
369 |
-
|
370 |
-
case "type_hidden":
|
371 |
-
{
|
372 |
-
$value=$_POST[$label_label[$key]];
|
373 |
-
break;
|
374 |
-
}
|
375 |
-
|
376 |
-
case "type_radio":
|
377 |
-
{
|
378 |
-
$element=$_POST[$i."_other_input".$id];
|
379 |
-
if(isset($element))
|
380 |
-
{
|
381 |
-
$value=$element;
|
382 |
-
break;
|
383 |
-
}
|
384 |
-
|
385 |
-
$value=$_POST[$i."_element".$id];
|
386 |
-
break;
|
387 |
-
}
|
388 |
-
|
389 |
-
case "type_checkbox":
|
390 |
-
{
|
391 |
-
|
392 |
-
|
393 |
-
$start=-1;
|
394 |
-
$value='';
|
395 |
-
for($j=0; $j<100; $j++)
|
396 |
-
{
|
397 |
-
|
398 |
-
//$element=$_POST[$i."_element".$id.$j];
|
399 |
-
|
400 |
-
if(isset($_POST[$i."_element".$id.$j]))
|
401 |
-
{
|
402 |
-
$start=$j;
|
403 |
-
break;
|
404 |
-
}
|
405 |
-
}
|
406 |
-
$other_element_id=-1;
|
407 |
-
$is_other=$_POST[$i."_allow_other".$id];
|
408 |
-
if($is_other=="yes")
|
409 |
-
{
|
410 |
-
$other_element_id=$_POST[$i."_allow_other_num".$id];
|
411 |
-
}
|
412 |
-
|
413 |
-
if($start!=-1)
|
414 |
-
{
|
415 |
-
for($j=$start; $j<100; $j++)
|
416 |
-
{
|
417 |
-
//$element=$_POST[$i."_element".$id.$j];
|
418 |
-
if(isset($_POST[$i."_element".$id.$j])){
|
419 |
-
|
420 |
-
if($j==$other_element_id)
|
421 |
-
{
|
422 |
-
|
423 |
-
$value=$value.$_POST[$i."_other_input".$id].'***br***';
|
424 |
-
}
|
425 |
-
else
|
426 |
-
{
|
427 |
-
|
428 |
-
$value=$value.$_POST[$i."_element".$id.$j].'***br***';
|
429 |
-
}
|
430 |
-
}
|
431 |
-
}
|
432 |
-
}
|
433 |
-
break;
|
434 |
-
}
|
435 |
-
|
436 |
-
}
|
437 |
-
|
438 |
-
if($type=="type_address")
|
439 |
-
if( $value=='*#*#*#')
|
440 |
-
break;
|
441 |
-
|
442 |
-
$unique_element=$_POST[$i."_unique".$id];
|
443 |
-
if($unique_element=='yes')
|
444 |
-
{
|
445 |
-
$unique = $wpdb->get_col($wpdb->prepare("SELECT id FROM ".$wpdb->prefix."formmaker_submits WHERE form_id= %d and element_label= %s and element_value= %s",$id_old,$i,addslashes($value)));
|
446 |
-
if ($unique)
|
447 |
-
{
|
448 |
-
echo "<script> alert('".addslashes(__('This field %s requires a unique entry and this value was already submitted.', 'form_maker'))."'.replace('%s','".$label_label[$key]."'));</script>";
|
449 |
-
return ($max+1);
|
450 |
-
}
|
451 |
-
}
|
452 |
-
$ip=$_SERVER['REMOTE_ADDR'];
|
453 |
-
$r=$wpdb->prefix."formmaker_submits";
|
454 |
-
|
455 |
-
$save_or_no=$wpdb->insert($r, array(
|
456 |
-
'form_id' => $id_old,
|
457 |
-
'element_label' => $i,
|
458 |
-
'element_value' => addslashes($value),
|
459 |
-
'group_id' => ($max+1),
|
460 |
-
'date' => date('Y-m-d H:i:s'),
|
461 |
-
'ip' => $ip,
|
462 |
-
),
|
463 |
-
array(
|
464 |
-
'%d',
|
465 |
-
'%s',
|
466 |
-
'%s',
|
467 |
-
'%d',
|
468 |
-
'%s',
|
469 |
-
'%s'
|
470 |
-
|
471 |
-
)
|
472 |
-
);
|
473 |
-
|
474 |
-
if (!$save_or_no){return false;}
|
475 |
-
$chgnac=false;
|
476 |
-
}
|
477 |
-
if($chgnac)
|
478 |
-
{ global $wpdb;
|
479 |
-
|
480 |
-
if(count($all_files)==0)
|
481 |
-
@session_start();
|
482 |
-
if($form->submit_text_type!=4)
|
483 |
-
|
484 |
-
$_SESSION['massage_after_submit']=addslashes(addslashes(__('Nothing was submitted.', 'form_maker')));
|
485 |
-
$_SESSION['error_or_no']=1;
|
486 |
-
$_SESSION['form_submit_type']=$form->submit_text_type.",".$form->id;
|
487 |
-
wp_redirect($_SERVER["REQUEST_URI"]);
|
488 |
-
exit;
|
489 |
-
}
|
490 |
-
return $all_files;
|
491 |
-
}
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
function gen_mail($counter, $all_files, $id)
|
496 |
-
{
|
497 |
-
@session_start();
|
498 |
-
global $wpdb;
|
499 |
-
|
500 |
-
$row=$wpdb->get_row($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id=%d",$id));
|
501 |
-
if(!$row->form_front)
|
502 |
-
{
|
503 |
-
$id='';
|
504 |
-
}
|
505 |
-
$label_order_original= array();
|
506 |
-
$label_order_ids= array();
|
507 |
-
$label_label= array();
|
508 |
-
$label_type= array();
|
509 |
-
$cc=array();
|
510 |
-
$row_mail_one_time=1;
|
511 |
-
$label_all = explode('#****#',$row->label_order);
|
512 |
-
$label_all = array_slice($label_all,0, count($label_all)-1);
|
513 |
-
foreach($label_all as $key => $label_each)
|
514 |
-
{
|
515 |
-
$label_id_each=explode('#**id**#',$label_each);
|
516 |
-
$label_id=$label_id_each[0];
|
517 |
-
array_push($label_order_ids,$label_id);
|
518 |
-
|
519 |
-
$label_order_each=explode('#**label**#', $label_id_each[1]);
|
520 |
-
$label_order_original[$label_id]=$label_order_each[0];
|
521 |
-
array_push($label_label, $label_order_each[0]);
|
522 |
-
array_push($label_type, $label_order_each[1]);
|
523 |
-
}
|
524 |
-
|
525 |
-
|
526 |
-
$list='<table border="1" cellpadding="3" cellspacing="0" style="width:600px;">';
|
527 |
-
foreach($label_order_ids as $key => $label_order_id)
|
528 |
-
{
|
529 |
-
$i=$label_order_id;
|
530 |
-
$type=$_POST[$i."_type".$id];
|
531 |
-
if(isset($_POST[$i."_type".$id]))
|
532 |
-
if($type!="type_map" and $type!="type_submit_reset" and $type!="type_editor" and $type!="type_captcha" and $type!="type_recaptcha" and $type!="type_button")
|
533 |
-
{
|
534 |
-
$element_label=$label_order_original[$i];
|
535 |
-
|
536 |
-
switch ($type)
|
537 |
-
{
|
538 |
-
case 'type_text':
|
539 |
-
case 'type_password':
|
540 |
-
case 'type_textarea':
|
541 |
-
case "type_date":
|
542 |
-
case "type_own_select":
|
543 |
-
case "type_country":
|
544 |
-
case "type_number":
|
545 |
-
{
|
546 |
-
$element=$_POST[$i."_element".$id];
|
547 |
-
if(isset($_POST[$i."_element".$id]))
|
548 |
-
{
|
549 |
-
$list=$list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="font-family:inherit; margin:0px; padding:0px">'.$element.'</pre></td></tr>';
|
550 |
-
}
|
551 |
-
break;
|
552 |
-
|
553 |
-
|
554 |
-
}
|
555 |
-
|
556 |
-
case "type_submitter_mail":
|
557 |
-
{
|
558 |
-
$element=$_POST[$i."_element".$id];
|
559 |
-
if(isset($_POST[$i."_element".$id]))
|
560 |
-
{
|
561 |
-
$list=$list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="font-family:inherit; margin:0px; padding:0px">'.$element.'</pre></td></tr>';
|
562 |
-
if($_POST[$i."_send".$id]=="yes")
|
563 |
-
array_push($cc, $element);
|
564 |
-
}
|
565 |
-
break;
|
566 |
-
}
|
567 |
-
|
568 |
-
case "type_time":
|
569 |
-
{
|
570 |
-
|
571 |
-
$hh=$_POST[$i."_hh".$id];
|
572 |
-
if(isset($_POST[$i."_hh".$id]))
|
573 |
-
{
|
574 |
-
$ss=$_POST[$i."_ss".$id];
|
575 |
-
if(isset($_POST[$i."_ss".$id]))
|
576 |
-
$list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >'.$_POST[$i."_hh".$id].':'.$_POST[$i."_mm".$id].':'.$_POST[$i."_ss".$id];
|
577 |
-
else
|
578 |
-
$list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >'.$_POST[$i."_hh".$id].':'.$_POST[$i."_mm".$id];
|
579 |
-
$am_pm=$_POST[$i."_am_pm".$id];
|
580 |
-
if(isset($_POST[$i."_am_pm".$id]))
|
581 |
-
$list=$list.' '.$_POST[$i."_am_pm".$id].'</td></tr>';
|
582 |
-
else
|
583 |
-
$list=$list.'</td></tr>';
|
584 |
-
}
|
585 |
-
|
586 |
-
break;
|
587 |
-
}
|
588 |
-
|
589 |
-
case "type_phone":
|
590 |
-
{
|
591 |
-
$element_first=$_POST[$i."_element_first".$id];
|
592 |
-
if(isset($_POST[$i."_element_first".$id]))
|
593 |
-
{
|
594 |
-
$list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >'.$_POST[$i."_element_first".$id].' '.$_POST[$i."_element_last".$id].'</td></tr>';
|
595 |
-
}
|
596 |
-
break;
|
597 |
-
}
|
598 |
-
|
599 |
-
case "type_name":
|
600 |
-
{
|
601 |
-
$element_first=$_POST[$i."_element_first".$id];
|
602 |
-
if(isset($_POST[$i."_element_first".$id]))
|
603 |
-
{
|
604 |
-
$element_title=$_POST[$i."_element_title".$id];
|
605 |
-
if(isset($_POST[$i."_element_title".$id]))
|
606 |
-
$list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >'.$_POST[$i."_element_title".$id].' '.$_POST[$i."_element_first".$id].' '.$_POST[$i."_element_last".$id].' '.$_POST[$i."_element_middle".$id].'</td></tr>';
|
607 |
-
else
|
608 |
-
$list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >'.$_POST[$i."_element_first".$id].' '.$_POST[$i."_element_last".$id].'</td></tr>';
|
609 |
-
}
|
610 |
-
break;
|
611 |
-
}
|
612 |
-
case "type_mark_map":
|
613 |
-
{
|
614 |
-
|
615 |
-
if(isset($_POST[$i."_long".$id]))
|
616 |
-
{
|
617 |
-
$list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >Longitude:'.$_POST[$i."_long".$id].'<br/>Latitude:'.$_POST[$i."_lat".$id].'</td></tr>';
|
618 |
-
}
|
619 |
-
break;
|
620 |
-
}
|
621 |
-
|
622 |
-
case "type_address":
|
623 |
-
{
|
624 |
-
$street1=$_POST[$i."_street1".$id];
|
625 |
-
if(isset($_POST[$i."_street1".$id]))
|
626 |
-
{
|
627 |
-
$list=$list.'<tr valign="top"><td >'.$label_order_original[$i].'</td><td >'.$_POST[$i."_street1".$id].'</td></tr>';
|
628 |
-
$i++;
|
629 |
-
$list=$list.'<tr valign="top"><td >'.$label_order_original[$i].'</td><td >'.$_POST[$i."_street2".$id].'</td></tr>';
|
630 |
-
$i++;
|
631 |
-
$list=$list.'<tr valign="top"><td >'.$label_order_original[$i].'</td><td >'.$_POST[$i."_city".$id].'</td></tr>';
|
632 |
-
$i++;
|
633 |
-
$list=$list.'<tr valign="top"><td >'.$label_order_original[$i].'</td><td >'.$_POST[$i."_state".$id].'</td></tr>';
|
634 |
-
$i++;
|
635 |
-
$list=$list.'<tr valign="top"><td >'.$label_order_original[$i].'</td><td >'.$_POST[$i."_postal".$id].'</td></tr>';
|
636 |
-
$i++;
|
637 |
-
$list=$list.'<tr valign="top"><td >'.$label_order_original[$i].'</td><td >'.$_POST[$i."_country".$id].'</td></tr>';
|
638 |
-
$i++;
|
639 |
-
}
|
640 |
-
break;
|
641 |
-
}
|
642 |
-
|
643 |
-
case "type_date_fields":
|
644 |
-
{
|
645 |
-
$day=$_POST[$i."_day".$id];
|
646 |
-
if(isset($_POST[$i."_day".$id]))
|
647 |
-
{
|
648 |
-
$list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >'.$_POST[$i."_day".$id].'-'.$_POST[$i."_month".$id].'-'.$_POST[$i."_year".$id].'</td></tr>';
|
649 |
-
}
|
650 |
-
break;
|
651 |
-
}
|
652 |
-
|
653 |
-
case "type_radio":
|
654 |
-
{
|
655 |
-
$element=$_POST[$i."_other_input".$id];
|
656 |
-
if(isset($_POST[$i."_other_input".$id]))
|
657 |
-
{
|
658 |
-
$list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >'.$_POST[$i."_other_input".$id].'</td></tr>';
|
659 |
-
break;
|
660 |
-
}
|
661 |
-
|
662 |
-
$element=$_POST[$i."_element".$id];
|
663 |
-
if(isset($_POST[$i."_element".$id]))
|
664 |
-
{
|
665 |
-
$list=$list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="font-family:inherit; margin:0px; padding:0px">'.$element.'</pre></td></tr>';
|
666 |
-
}
|
667 |
-
break;
|
668 |
-
}
|
669 |
-
|
670 |
-
case "type_checkbox":
|
671 |
-
{
|
672 |
-
$list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >';
|
673 |
-
|
674 |
-
$start=-1;
|
675 |
-
for($j=0; $j<100; $j++)
|
676 |
-
{
|
677 |
-
if(isset($_POST[$i."_element".$id.$j]))
|
678 |
-
{
|
679 |
-
$start=$j;
|
680 |
-
break;
|
681 |
-
}
|
682 |
-
}
|
683 |
-
$other_element_id=-1;
|
684 |
-
$is_other=$_POST[$i."_allow_other".$id];
|
685 |
-
if($is_other=="yes")
|
686 |
-
{
|
687 |
-
$other_element_id=$_POST[$i."_allow_other_num".$id];
|
688 |
-
}
|
689 |
-
|
690 |
-
|
691 |
-
if($start!=-1)
|
692 |
-
{
|
693 |
-
for($j=$start; $j<100; $j++)
|
694 |
-
{
|
695 |
-
|
696 |
-
$element=$_POST[$i."_element".$id.$j];
|
697 |
-
if(isset($_POST[$i."_element".$id.$j]))
|
698 |
-
if($j==$other_element_id)
|
699 |
-
{
|
700 |
-
$list=$list.$_POST[$i."_other_input".$id].'<br>';
|
701 |
-
}
|
702 |
-
else
|
703 |
-
|
704 |
-
$list=$list.$_POST[$i."_element".$id.$j].'<br>';
|
705 |
-
}
|
706 |
-
$list=$list.'</td></tr>';
|
707 |
-
}
|
708 |
-
|
709 |
-
|
710 |
-
break;
|
711 |
-
}
|
712 |
-
default: break;
|
713 |
-
}
|
714 |
-
|
715 |
-
}
|
716 |
-
|
717 |
-
}
|
718 |
-
$list=$list.'</table>';
|
719 |
-
$list = wordwrap($list, 70, "\n", true);
|
720 |
-
add_filter('wp_mail_content_type',create_function('', 'return "text/html";'));
|
721 |
-
var_dump($all_files);
|
722 |
-
for($k=0;$k<count($all_files);$k++){
|
723 |
-
$attachment[$k]= dirname(__FILE__). '/uploads/'.$all_files[$k]['name'];
|
724 |
-
}
|
725 |
-
if(isset($cc[0]))
|
726 |
-
{
|
727 |
-
foreach ($cc as $c)
|
728 |
-
{
|
729 |
-
|
730 |
-
|
731 |
-
if($c)
|
732 |
-
{
|
733 |
-
|
734 |
-
$recipient = $c;
|
735 |
-
$subject = $row->title;
|
736 |
-
$body = $row->script_user1.'<br>'.$list.'<br>'.$row->script_user2;
|
737 |
-
$send=wp_mail($recipient, $subject, stripslashes($body), "",$attachment);
|
738 |
-
}
|
739 |
-
|
740 |
-
|
741 |
-
if($row->mail)
|
742 |
-
{
|
743 |
-
if($c)
|
744 |
-
{
|
745 |
-
$headers_form_mail = 'From: '.$c.' <'.$c.'>' . "\r\n";
|
746 |
-
|
747 |
-
}
|
748 |
-
else
|
749 |
-
{
|
750 |
-
$headers_form_mail ="";
|
751 |
-
}
|
752 |
-
if($row_mail_one_time){
|
753 |
-
$recipient = $row->mail;
|
754 |
-
$subject = $row->title;
|
755 |
-
$body = $row->script1.'<br>'.$list.'<br>'.$row->script2;
|
756 |
-
$mode = 1;
|
757 |
-
|
758 |
-
$send=wp_mail($recipient, $subject, stripslashes($body), $headers_form_mail,$attachment);
|
759 |
-
$row_mail_one_time=0;
|
760 |
-
}
|
761 |
-
}
|
762 |
-
}
|
763 |
-
}
|
764 |
-
else
|
765 |
-
{
|
766 |
-
if($row->mail)
|
767 |
-
{
|
768 |
-
$recipient = $row->mail;
|
769 |
-
$subject = $row->title;
|
770 |
-
$body = $row->script1.'<br>'.$list.'<br>'.$row->script2;
|
771 |
-
$mode = 1;
|
772 |
-
|
773 |
-
$send=wp_mail($recipient, $subject, stripslashes($body), "",$attachment);
|
774 |
-
}
|
775 |
-
}
|
776 |
-
if($row->mail)
|
777 |
-
{
|
778 |
-
if ( $send != true )
|
779 |
-
{
|
780 |
-
@session_start();
|
781 |
-
$_SESSION['error_or_no']=1;
|
782 |
-
$msg=addslashes(__('Error, email was not sent.', 'form_maker'));
|
783 |
-
}
|
784 |
-
else
|
785 |
-
{
|
786 |
-
@session_start();
|
787 |
-
$_SESSION['error_or_no']=0;
|
788 |
-
$msg=addslashes(__('Your form was successfully submitted.', 'form_maker'));
|
789 |
-
}
|
790 |
-
}
|
791 |
-
else
|
792 |
-
{
|
793 |
-
|
794 |
-
@session_start();
|
795 |
-
$_SESSION['error_or_no']=0;
|
796 |
-
$msg=addslashes(__('Your form was successfully submitted.', 'form_maker'));
|
797 |
-
}
|
798 |
-
|
799 |
-
switch($row->submit_text_type)
|
800 |
-
{
|
801 |
-
case "2":
|
802 |
-
case "5":
|
803 |
-
{
|
804 |
-
@session_start();
|
805 |
-
if($row->submit_text_type!=4)
|
806 |
-
$_SESSION['massage_after_submit']=$msg;
|
807 |
-
$_SESSION['form_submit_type']=$row->submit_text_type.",".$row->id;
|
808 |
-
if($row->article_id)
|
809 |
-
wp_redirect($row->article_id);
|
810 |
-
else
|
811 |
-
wp_redirect($_SERVER["REQUEST_URI"]);
|
812 |
-
|
813 |
-
exit;
|
814 |
-
break;
|
815 |
-
}
|
816 |
-
case "3":
|
817 |
-
{
|
818 |
-
@session_start();
|
819 |
-
if($row->submit_text_type!=4)
|
820 |
-
$_SESSION['massage_after_submit']=$msg;
|
821 |
-
$_SESSION['form_submit_type']=$row->submit_text_type.",".$row->id;
|
822 |
-
wp_redirect($_SERVER["REQUEST_URI"]);
|
823 |
-
|
824 |
-
exit;
|
825 |
-
break;
|
826 |
-
}
|
827 |
-
case "4":
|
828 |
-
{
|
829 |
-
@session_start();
|
830 |
-
if($row->submit_text_type!=4)
|
831 |
-
$_SESSION['massage_after_submit']=$msg;
|
832 |
-
$_SESSION['form_submit_type']=$row->submit_text_type.",".$row->id;
|
833 |
-
wp_redirect($row->url);
|
834 |
-
|
835 |
-
exit;
|
836 |
-
break;
|
837 |
-
}
|
838 |
-
default:
|
839 |
-
{
|
840 |
-
@session_start();
|
841 |
-
if($row->submit_text_type!=4)
|
842 |
-
$_SESSION['massage_after_submit']= $msg;
|
843 |
-
$_SESSION['form_submit_type']=$row->submit_text_type.",".$row->id;
|
844 |
-
wp_redirect($_SERVER["REQUEST_URI"]);
|
845 |
-
|
846 |
-
exit;
|
847 |
-
break;
|
848 |
-
}
|
849 |
-
}
|
850 |
-
}
|
851 |
-
|
852 |
-
/*function sendMail($from='', $fromname='', $recipient, $subject, $body, $mode=0, $cc=null, $bcc=null, $attachment=null, $replyto=null, $replytoname=null)
|
853 |
-
{
|
854 |
-
$recipient=explode (',', str_replace(' ', '', $recipient ));
|
855 |
-
// Get a JMail instance
|
856 |
-
$mail = &JFactory::getMailer();
|
857 |
-
|
858 |
-
$mail->setSender(array($from, $fromname));
|
859 |
-
$mail->setSubject($subject);
|
860 |
-
$mail->setBody($body);
|
861 |
-
|
862 |
-
// Are we sending the email as HTML?
|
863 |
-
if ($mode) {
|
864 |
-
$mail->IsHTML(true);
|
865 |
-
}
|
866 |
-
|
867 |
-
$mail->addRecipient($recipient);
|
868 |
-
$mail->addCC($cc);
|
869 |
-
$mail->addBCC($bcc);
|
870 |
-
|
871 |
-
if($attachment)
|
872 |
-
foreach($attachment as $attachment_temp)
|
873 |
-
{
|
874 |
-
$mail->addAttachment($attachment_temp[0], $attachment_temp[1], $attachment_temp[2]);
|
875 |
-
}
|
876 |
-
|
877 |
-
// Take care of reply email addresses
|
878 |
-
if (is_array($replyto)) {
|
879 |
-
$numReplyTo = count($replyto);
|
880 |
-
for ($i=0; $i < $numReplyTo; $i++){
|
881 |
-
$mail->addReplyTo(array($replyto[$i], $replytoname[$i]));
|
882 |
-
}
|
883 |
-
} elseif (isset($replyto)) {
|
884 |
-
$mail->addReplyTo(array($replyto, $replytoname));
|
885 |
-
}
|
886 |
-
|
887 |
-
return $mail->Send();
|
888 |
-
}
|
889 |
-
|
890 |
-
*/
|
891 |
-
|
892 |
-
function remove($group_id)
|
893 |
-
{
|
894 |
-
global $wpdb;
|
895 |
-
$wpdb->query($wpdb->prepare('DELETE FROM '.$wpdb->prefix.'formmaker_submits WHERE group_id= %d',$group_id));
|
896 |
-
|
897 |
-
}
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
////////////////////////////////////////////////////// DISPLAY
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
function form_maker_front_end($id){
|
919 |
-
|
920 |
-
global $wp_filter;
|
921 |
-
|
922 |
-
|
923 |
-
$form_maker_front_end="";
|
924 |
-
$result =showform($id);
|
925 |
-
if(!$result)
|
926 |
-
return;
|
927 |
-
$ok =savedata($result[0],$id);
|
928 |
-
if(is_numeric($ok))
|
929 |
-
remove($ok);
|
930 |
-
|
931 |
-
@session_start();
|
932 |
-
global $wpdb;
|
933 |
-
$row = $result[0];
|
934 |
-
$Itemid = $result[1];
|
935 |
-
$label_id = $result[2];
|
936 |
-
$label_type = $result[3];
|
937 |
-
$form_theme = $result[4];
|
938 |
-
|
939 |
-
|
940 |
-
$ok = $ok;
|
941 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
942 |
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
$body_or_classes[$i][1]="#form".$id.' '.str_replace(',',", #form".$id,$body_or_classes[$i][1]);
|
991 |
-
}
|
992 |
-
for($i=0;$i<$count_after_explod_theme;$i++){
|
993 |
-
$body_or_classes_implode[$i]=implode('}',$body_or_classes[$i]);
|
994 |
-
}
|
995 |
-
$form_theme=implode('{',$body_or_classes_implode);
|
996 |
-
$form_maker_front_end.= '<style>'.str_replace('[SITE_ROOT]', plugins_url("",__FILE__), $form_theme).'</style>';
|
997 |
-
|
998 |
-
// echo '<h3>'.$row->title.'</h3><br />';
|
999 |
-
|
1000 |
-
$form_maker_front_end.='<form name="form'.$id.'" action="'.$_SERVER['REQUEST_URI'].'" method="post" id="form'.$id.'" enctype="multipart/form-data" onsubmit="check_required(\'submit\', \''.$id.'\'); return false;">
|
1001 |
-
<div id="'.$id.'pages" class="wdform_page_navigation" show_title="'.$row->show_title.'" show_numbers="'.$row->show_numbers.'" type="'.$row->pagination.'"></div>
|
1002 |
-
<input type="hidden" id="counter'.$id.'" value="'.$row->counter.'" name="counter'.$id.'" />
|
1003 |
-
<input type="hidden" id="Itemid'.$id.'" value="'.$Itemid.'" name="Itemid'.$id.'" />';
|
1004 |
-
|
1005 |
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1081 |
|
1082 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1083 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1084 |
|
1085 |
-
$
|
|
|
|
|
|
|
1086 |
|
1087 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1088 |
';
|
1089 |
-
$form_maker_front_end.='
|
1090 |
';
|
1091 |
-
$form_maker_front_end.='
|
1092 |
';
|
1093 |
-
$form_maker_front_end.='
|
1094 |
-
';
|
1095 |
-
$form_maker_front_end.='function formOnload'.$id.'()
|
1096 |
{
|
1097 |
-
'
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
{
|
1104 |
-
case 'type_map':
|
1105 |
-
|
1106 |
-
|
1107 |
-
$form_maker_front_end.='if(document.getElementById("'.$label_id[$key].'_element'.$id.'"))
|
1108 |
{
|
1109 |
-
if_gmap_init('
|
1110 |
for(q=0; q<20; q++)
|
1111 |
-
if(document.getElementById('
|
1112 |
{
|
1113 |
|
1114 |
-
w_long=parseFloat(document.getElementById('
|
1115 |
-
w_lat=parseFloat(document.getElementById('
|
1116 |
-
w_info=parseFloat(document.getElementById('
|
1117 |
-
add_marker_on_map('
|
1118 |
}
|
1119 |
}';
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
if(!document.getElementById("'.$label_id[$key].'_long'.$id.'"))
|
1125 |
{
|
1126 |
|
1127 |
var longit = document.createElement(\'input\');
|
1128 |
longit.setAttribute("type", \'hidden\');
|
1129 |
-
longit.setAttribute("id", \''
|
1130 |
-
longit.setAttribute("name", \''
|
1131 |
|
1132 |
var latit = document.createElement(\'input\');
|
1133 |
latit.setAttribute("type", \'hidden\');
|
1134 |
-
latit.setAttribute("id", \''
|
1135 |
-
latit.setAttribute("name", \''
|
1136 |
|
1137 |
-
document.getElementById("'
|
1138 |
-
document.getElementById("'
|
1139 |
|
1140 |
-
if_gmap_init('
|
1141 |
|
1142 |
-
w_long=parseFloat(document.getElementById('
|
1143 |
-
w_lat=parseFloat(document.getElementById('
|
1144 |
-
w_info=parseFloat(document.getElementById('
|
1145 |
|
1146 |
|
1147 |
longit.value=w_long;
|
1148 |
latit.value=w_lat;
|
1149 |
-
add_marker_on_map('
|
1150 |
}';
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
case 'type_radio':
|
1165 |
-
case 'type_checkbox':
|
1166 |
-
$form_maker_front_end.='if(document.getElementById(\''.$label_id[$key].'_randomize'.$id.'\'))
|
1167 |
-
if(document.getElementById(\''.$label_id[$key].'_randomize'.$id.'\').value=="yes")
|
1168 |
{
|
1169 |
-
choises_randomize(\''
|
1170 |
}';
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
$form_maker_front_end.='if(window.before_load)
|
1181 |
{
|
1182 |
before_load();
|
1183 |
}
|
1184 |
}
|
1185 |
';
|
1186 |
-
|
1187 |
-
$form_maker_front_end.='function formAddToOnload'.$id.'()
|
1188 |
{
|
1189 |
-
if(formOldFunctionOnLoad'
|
1190 |
-
formOnload'
|
1191 |
}
|
1192 |
-
function formLoadBody'
|
1193 |
{
|
1194 |
-
formOldFunctionOnLoad'
|
1195 |
-
window.onload = formAddToOnload'
|
1196 |
-
}
|
1197 |
-
var formOldFunctionOnLoad'.$id.' = null;
|
1198 |
-
formLoadBody'.$id.'();';
|
1199 |
-
|
1200 |
-
|
1201 |
-
if(isset($_POST["captcha_input"])){
|
1202 |
-
$captcha_input=esc_html($_POST["captcha_input"]);
|
1203 |
-
}
|
1204 |
-
if(isset($_POST["recaptcha_response_field"])){
|
1205 |
-
$recaptcha_response_field=esc_html($_POST["recaptcha_response_field"]);
|
1206 |
}
|
1207 |
-
|
1208 |
-
$
|
1209 |
-
|
1210 |
-
$
|
1211 |
-
|
1212 |
-
{
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
|
|
|
|
|
|
|
|
|
|
1225 |
}
|
1226 |
";
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
1236 |
-
|
|
|
|
|
|
|
1237 |
}
|
1238 |
";
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
-
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
-
"if(document.getElementById('".$label_id[$key]."_element_first".$id."'))
|
1247 |
{
|
1248 |
-
if(document.getElementById('"
|
1249 |
-
{ document.getElementById('"
|
1250 |
-
document.getElementById('"
|
1251 |
}
|
1252 |
|
1253 |
-
if(document.getElementById('"
|
1254 |
-
{ document.getElementById('"
|
1255 |
-
document.getElementById('"
|
1256 |
}
|
1257 |
|
1258 |
-
if(document.getElementById('"
|
1259 |
-
{ document.getElementById('"
|
1260 |
-
document.getElementById('"
|
1261 |
}
|
1262 |
|
1263 |
-
if(document.getElementById('"
|
1264 |
-
{ document.getElementById('"
|
1265 |
-
document.getElementById('"
|
1266 |
}
|
1267 |
|
1268 |
}";
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
$form_maker_front_end.=
|
1273 |
-
"if(document.getElementById('".$label_id[$key]."_element_first".$id."'))
|
1274 |
{
|
1275 |
|
1276 |
-
if(document.getElementById('"
|
1277 |
-
{ document.getElementById('"
|
1278 |
-
document.getElementById('"
|
1279 |
}
|
1280 |
|
1281 |
-
if(document.getElementById('"
|
1282 |
-
{ document.getElementById('"
|
1283 |
-
document.getElementById('"
|
1284 |
}
|
1285 |
|
1286 |
}";
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
$form_maker_front_end.=
|
1294 |
-
"if(document.getElementById('".$label_id[$key]."_element_first".$id."'))
|
1295 |
{
|
1296 |
-
if(document.getElementById('"
|
1297 |
-
{ document.getElementById('"
|
1298 |
-
document.getElementById('"
|
1299 |
}
|
1300 |
|
1301 |
-
if(document.getElementById('"
|
1302 |
-
{ document.getElementById('"
|
1303 |
-
document.getElementById('"
|
1304 |
}
|
1305 |
}";
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
if($key>$old_key)
|
1313 |
-
{
|
1314 |
-
$form_maker_front_end.=
|
1315 |
-
"if(document.getElementById('".$label_id[$key]."_street1".$id."'))
|
1316 |
{
|
1317 |
-
document.getElementById('"
|
1318 |
-
document.getElementById('"
|
1319 |
-
document.getElementById('"
|
1320 |
-
document.getElementById('"
|
1321 |
-
document.getElementById('"
|
1322 |
-
document.getElementById('"
|
1323 |
|
1324 |
}";
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
{
|
1341 |
-
$other_element=$_POST[$label_id[$key]."_other_input".$id];
|
1342 |
-
$other_element_id=$_POST[$label_id[$key]."_allow_other_num".$id];
|
1343 |
-
if(isset($_POST[$label_id[$key]."_allow_other_num".$id]))
|
1344 |
-
$is_other=true;
|
1345 |
-
}
|
1346 |
-
|
1347 |
-
$form_maker_front_end.=
|
1348 |
-
"
|
1349 |
-
if(document.getElementById('".$label_id[$key]."_other_input".$id."'))
|
1350 |
{
|
1351 |
-
document.getElementById('"
|
1352 |
-
document.getElementById('"
|
1353 |
}
|
1354 |
for(k=0; k<30; k++)
|
1355 |
-
if(document.getElementById('"
|
1356 |
-
document.getElementById('"
|
1357 |
else break;
|
1358 |
";
|
1359 |
-
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
{
|
1364 |
-
$form_maker_front_end.=
|
1365 |
-
"document.getElementById('".$label_id[$key]."_element".$id.$j."').setAttribute('checked', 'checked');
|
1366 |
";
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
$
|
1372 |
-
|
1373 |
-
show_other_input('".$label_id[$key]."','".$id."');
|
1374 |
-
document.getElementById('".$label_id[$key]."_other_input".$id."').value='".$_POST[$label_id[$key]."_other_input".$id]."';
|
1375 |
";
|
1376 |
-
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
if(isset($_POST[$label_id[$key]."_other_input".$id]))
|
1389 |
-
$is_other=true;
|
1390 |
-
}
|
1391 |
-
|
1392 |
-
|
1393 |
-
$form_maker_front_end.=
|
1394 |
-
"
|
1395 |
-
if(document.getElementById('".$label_id[$key]."_other_input".$id."'))
|
1396 |
{
|
1397 |
-
document.getElementById('"
|
1398 |
-
document.getElementById('"
|
1399 |
}
|
1400 |
|
1401 |
for(k=0; k<50; k++)
|
1402 |
-
if(document.getElementById('"
|
1403 |
{
|
1404 |
-
document.getElementById('"
|
1405 |
-
if(document.getElementById('"
|
1406 |
{
|
1407 |
-
document.getElementById('"
|
1408 |
|
1409 |
}
|
1410 |
}
|
1411 |
else break;
|
1412 |
";
|
1413 |
-
|
1414 |
-
|
1415 |
-
|
1416 |
-
|
1417 |
-
document.getElementById('".$label_id[$key]."_other_input".$id."').value='".$_POST[$label_id[$key]."_other_input".$id]."';
|
1418 |
";
|
1419 |
-
|
1420 |
-
|
1421 |
-
|
1422 |
-
|
1423 |
-
|
1424 |
-
|
1425 |
-
|
1426 |
-
{
|
1427 |
-
$form_maker_front_end.=
|
1428 |
-
"if(document.getElementById('".$label_id[$key]."_hh".$id."'))
|
1429 |
{
|
1430 |
-
document.getElementById('"
|
1431 |
-
document.getElementById('"
|
1432 |
-
document.getElementById('"
|
1433 |
}";
|
1434 |
-
|
1435 |
-
|
1436 |
-
|
1437 |
-
$form_maker_front_end.=
|
1438 |
-
"if(document.getElementById('".$label_id[$key]."_hh".$id."'))
|
1439 |
{
|
1440 |
-
document.getElementById('"
|
1441 |
-
document.getElementById('"
|
1442 |
}";
|
1443 |
-
|
1444 |
-
|
1445 |
-
|
1446 |
-
|
1447 |
-
|
1448 |
-
document.getElementById('".$label_id[$key]."_am_pm".$id."').value='".$_POST[$label_id[$key]."_am_pm".$id]."';
|
1449 |
";
|
1450 |
-
|
1451 |
-
|
1452 |
-
|
1453 |
-
|
1454 |
-
|
1455 |
-
|
1456 |
-
$form_maker_front_end.=
|
1457 |
-
"if(document.getElementById('".$label_id[$key]."_day".$id."'))
|
1458 |
{
|
1459 |
-
document.getElementById('"
|
1460 |
-
document.getElementById('"
|
1461 |
-
document.getElementById('"
|
1462 |
}";
|
1463 |
-
|
1464 |
-
|
1465 |
-
|
1466 |
-
|
1467 |
-
|
1468 |
-
|
1469 |
-
|
1470 |
-
|
1471 |
-
document.getElementById('".$label_id[$key]."_element".$id."').value='".addslashes($_POST[$label_id[$key]."_element".$id])."';
|
1472 |
";
|
1473 |
-
|
1474 |
-
|
1475 |
-
|
1476 |
-
|
1477 |
-
|
1478 |
-
|
1479 |
-
|
1480 |
-
|
1481 |
-
|
1482 |
-
|
1483 |
-
}
|
1484 |
-
|
1485 |
-
|
1486 |
-
|
1487 |
-
|
1488 |
-
|
1489 |
-
$form_maker_front_end.=' form_view_count'.$id.'=0;
|
1490 |
for(i=1; i<=30; i++)
|
1491 |
{
|
1492 |
-
if(document.getElementById(\''
|
1493 |
{
|
1494 |
-
form_view_count'
|
1495 |
-
form_view_max'
|
1496 |
-
document.getElementById(\''
|
1497 |
}
|
1498 |
}
|
1499 |
-
if(form_view_count'
|
1500 |
{
|
1501 |
-
for(i=1; i<=form_view_max'
|
1502 |
{
|
1503 |
-
if(document.getElementById(\''
|
1504 |
{
|
1505 |
-
first_form_view'
|
1506 |
break;
|
1507 |
}
|
1508 |
}
|
1509 |
-
generate_page_nav(first_form_view'
|
1510 |
}
|
1511 |
var RecaptchaOptions = {
|
1512 |
-
theme: "'
|
1513 |
};
|
1514 |
</script>
|
1515 |
</form></div>';
|
1516 |
-
|
1517 |
-
|
1518 |
-
|
1519 |
-
|
1520 |
-
|
1521 |
-
|
1522 |
-
|
1523 |
-
$
|
1524 |
-
|
1525 |
-
|
1526 |
-
if($row->public_key)
|
1527 |
-
$publickey = $row->public_key;
|
1528 |
-
else
|
1529 |
-
$publickey = '0';
|
1530 |
-
$error = null;
|
1531 |
-
$form_maker_front_end.=recaptcha_get_html($publickey, $error);
|
1532 |
-
|
1533 |
-
|
1534 |
-
$form_maker_front_end.='</div>
|
1535 |
<script>
|
1536 |
recaptcha_html=document.getElementById(\'main_recaptcha\').innerHTML.replace(\'Recaptcha.widget = Recaptcha.$("recaptcha_widget_div"); Recaptcha.challenge_callback();\',"");
|
1537 |
document.getElementById(\'main_recaptcha\').innerHTML="";
|
1538 |
-
if(document.getElementById(\'wd_recaptcha'
|
1539 |
-
document.getElementById(\'wd_recaptcha'
|
|
|
|
|
1540 |
</script>';
|
1541 |
-
|
1542 |
-
|
1543 |
-
|
1544 |
-
|
1545 |
-
|
1546 |
-
|
1547 |
-
|
1548 |
-
|
1549 |
-
|
1550 |
-
|
1551 |
-
$
|
1552 |
-
|
1553 |
-
|
1554 |
-
",
|
1555 |
-
|
1556 |
-
|
1557 |
-
|
1558 |
-
|
1559 |
-
|
1560 |
-
|
1561 |
-
|
1562 |
-
|
1563 |
-
|
1564 |
-
|
1565 |
-
|
1566 |
-
|
1567 |
-
|
1568 |
-
|
1569 |
-
|
1570 |
-
|
1571 |
-
|
1572 |
-
|
1573 |
-
|
1574 |
-
|
1575 |
-
|
1576 |
-
|
1577 |
-
|
1578 |
-
|
1579 |
-
|
1580 |
-
|
1581 |
-
|
1582 |
-
|
1583 |
-
|
1584 |
-
|
1585 |
-
|
1586 |
-
|
1587 |
-
|
1588 |
-
|
1589 |
-
|
1590 |
-
|
1591 |
-
|
1592 |
-
|
1593 |
-
|
1594 |
-
|
1595 |
-
|
1596 |
-
|
1597 |
-
|
1598 |
-
|
1599 |
-
|
1600 |
-
|
1601 |
-
|
1602 |
-
|
1603 |
-
|
1604 |
-
|
1605 |
-
|
1606 |
-
|
1607 |
-
|
1608 |
-
|
1609 |
-
|
1610 |
-
|
1611 |
-
|
1612 |
-
|
1613 |
-
|
1614 |
-
$untilupload=str_replace(substr($untilupload, $pos1, $pos2-$pos1+22), "", $untilupload);
|
1615 |
-
}
|
1616 |
-
$form_maker_front_end.=$untilupload;
|
1617 |
-
$form_maker_front_end.="<script type=\"text/javascript\">
|
1618 |
function formOnload()
|
1619 |
{
|
1620 |
if(document.getElementById(\"wd_captcha_input\"))
|
1621 |
captcha_refresh('wd_captcha');
|
1622 |
-
for(t=0; t<". $row->counter."; t++)
|
1623 |
if(document.getElementById(t+\"_type\"))
|
1624 |
if(document.getElementById(t+\"_type\").value==\"type_map\")
|
1625 |
if_gmap_init(t+\"_element\", false);
|
@@ -1636,155 +1709,149 @@ $form_maker_front_end.='<style>'.str_replace('[SITE_ROOT]', plugins_url("",__FIL
|
|
1636 |
}
|
1637 |
var formOldFunctionOnLoad = null;
|
1638 |
formLoadBody();
|
1639 |
-
";
|
1640 |
-
|
1641 |
-
|
1642 |
-
|
1643 |
-
|
1644 |
-
|
1645 |
-
|
1646 |
-
|
1647 |
-
|
1648 |
-
|
1649 |
-
|
1650 |
-
|
1651 |
-
|
1652 |
-
|
1653 |
-
|
1654 |
-
|
1655 |
-
|
1656 |
-
|
1657 |
-
|
1658 |
-
|
1659 |
-
|
1660 |
-
|
1661 |
-
|
1662 |
-
|
1663 |
-
|
1664 |
-
case "type_text":
|
1665 |
-
|
1666 |
-
case "type_submitter_mail":{
|
1667 |
-
$form_maker_front_end.=
|
1668 |
-
"if(document.getElementById('".$i."_element"."').title!='".addslashes($_POST[$i."_element"])."')
|
1669 |
-
{ document.getElementById('".$i."_element"."').value='".addslashes($_POST[$i."_element"])."';
|
1670 |
-
document.getElementById('".$i."_element"."').style.color='#000000';
|
1671 |
-
document.getElementById('".$i."_element"."').style.fontStyle='normal !important';
|
1672 |
}
|
1673 |
";
|
1674 |
-
|
1675 |
-
|
1676 |
-
|
1677 |
-
|
1678 |
-
|
1679 |
-
|
1680 |
-
|
1681 |
-
document.getElementById('"
|
1682 |
-
document.getElementById('".$i."_element"."').style.fontStyle='normal';
|
1683 |
}
|
1684 |
";
|
1685 |
-
|
1686 |
-
|
1687 |
-
|
1688 |
-
|
1689 |
-
|
1690 |
-
"; break;
|
1691 |
-
}
|
1692 |
-
case "type_name":{
|
1693 |
-
if(isset($_POST[$i."_element_title"]))
|
1694 |
-
{
|
1695 |
-
$form_maker_front_end.=
|
1696 |
-
"document.getElementById('".$i."_element_title"."').value='".addslashes($_POST[$i."_element_title"])."';
|
1697 |
-
document.getElementById('".$i."_element_first"."').value='".addslashes($_POST[$i."_element_first"])."';
|
1698 |
-
document.getElementById('".$i."_element_last"."').value='".addslashes($_POST[$i."_element_last"])."';
|
1699 |
-
document.getElementById('".$i."_element_middle"."').value='".addslashes($_POST[$i."_element_middle"])."';
|
1700 |
";
|
1701 |
-
|
1702 |
-
|
1703 |
-
|
1704 |
-
|
1705 |
-
|
1706 |
-
|
1707 |
-
";
|
1708 |
-
|
1709 |
-
|
1710 |
-
|
1711 |
-
|
1712 |
-
|
1713 |
-
|
1714 |
-
|
1715 |
-
|
1716 |
-
|
1717 |
-
|
1718 |
-
|
1719 |
-
|
1720 |
-
|
1721 |
-
|
1722 |
-
|
1723 |
-
|
1724 |
-
|
1725 |
-
|
1726 |
-
|
1727 |
-
|
1728 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1729 |
{
|
1730 |
-
document.getElementById('"
|
1731 |
-
if(document.getElementById('"
|
1732 |
-
document.getElementById('"
|
1733 |
}
|
1734 |
else break;
|
1735 |
-
"; break;
|
1736 |
-
}
|
1737 |
-
case "type_time":{
|
1738 |
-
if(isset($_POST[$i."_ss"]))
|
1739 |
-
{
|
1740 |
-
$form_maker_front_end.=
|
1741 |
-
"document.getElementById('".$i."_hh"."').value='".$_POST[$i."_hh"]."';
|
1742 |
-
document.getElementById('".$i."_mm"."').value='".$_POST[$i."_mm"]."';
|
1743 |
-
document.getElementById('".$i."_ss"."').value='".$_POST[$i."_ss"]."';
|
1744 |
-
"; }
|
1745 |
-
else
|
1746 |
-
{
|
1747 |
-
$form_maker_front_end.=
|
1748 |
-
"document.getElementById('".$i."_hh"."').value='".$_POST[$i."_hh"]."';
|
1749 |
-
document.getElementById('".$i."_mm"."').value='".$_POST[$i."_mm"]."';
|
1750 |
";
|
1751 |
-
|
1752 |
-
|
1753 |
-
|
1754 |
-
|
1755 |
-
|
1756 |
-
|
1757 |
-
|
1758 |
-
";
|
1759 |
-
}
|
1760 |
-
case "type_date_fields":{
|
1761 |
-
$date_fields=explode('-',$_POST[$i."_element"]);
|
1762 |
-
$form_maker_front_end.=
|
1763 |
-
"document.getElementById('".$i."_day"."').value='".$date_fields[0]."';
|
1764 |
-
document.getElementById('".$i."_month"."').value='".$date_fields[1]."';
|
1765 |
-
document.getElementById('".$i."_year"."').value='".$date_fields[2]."';
|
1766 |
-
"; break;
|
1767 |
-
}
|
1768 |
-
case "type_country":{
|
1769 |
-
$form_maker_front_end.="document.getElementById('".$i."_element').value='".addslashes($_POST[$i."_element"])."';
|
1770 |
-
"; break;
|
1771 |
-
}
|
1772 |
-
case "type_own_select":{
|
1773 |
-
$form_maker_front_end.=
|
1774 |
-
"document.getElementById('".$i."_element').value='".addslashes($_POST[$i."_element"])."';
|
1775 |
";
|
1776 |
-
|
1777 |
-
|
1778 |
-
|
1779 |
-
|
1780 |
-
|
1781 |
-
|
1782 |
-
|
1783 |
-
|
1784 |
-
|
1785 |
-
|
1786 |
-
|
1787 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1788 |
for(i=0; i<n; i++)
|
1789 |
{
|
1790 |
if(document.getElementById(i))
|
@@ -1953,7 +2020,7 @@ function check_year2(id)
|
|
1953 |
if(year<from)
|
1954 |
{
|
1955 |
document.getElementById(id).value='';
|
1956 |
-
alert('".addslashes(__('The value of year is not valid','form_maker'))."');
|
1957 |
}
|
1958 |
}
|
1959 |
function remove_add_(id)
|
@@ -2004,7 +2071,7 @@ function check_required(but_type)
|
|
2004 |
window.location.reload( true );
|
2005 |
return;
|
2006 |
}
|
2007 |
-
n="
|
2008 |
ext_available=true;
|
2009 |
seted=true;
|
2010 |
for(i=0; i<=n; i++)
|
@@ -2115,14 +2182,14 @@ function check_required(but_type)
|
|
2115 |
else
|
2116 |
{
|
2117 |
if(!ext_available)
|
2118 |
-
{alert('".addslashes(__('Sorry, you are not allowed to upload this type of file','form_maker'))."');
|
2119 |
break;}
|
2120 |
x=document.getElementById(i-1+'_element_label');
|
2121 |
while(x.firstChild)
|
2122 |
{
|
2123 |
x=x.firstChild;
|
2124 |
}
|
2125 |
-
alert(x.nodeValue+' ".addslashes(__('field is required','form_maker'))."');
|
2126 |
break;
|
2127 |
}
|
2128 |
}
|
@@ -2132,7 +2199,7 @@ function check_required(but_type)
|
|
2132 |
if(document.getElementById(i))
|
2133 |
if(document.getElementById(i).getAttribute(\"type\")==\"type_submitter_mail\")
|
2134 |
if (document.getElementById(i+\"_element\").value!='') if(document.getElementById(i+\"_element\").value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1)
|
2135 |
-
{ alert( \"".addslashes(__('This is not a valid email address','form_maker'))."\" );
|
2136 |
return;
|
2137 |
}
|
2138 |
}
|
@@ -2141,7 +2208,7 @@ function check_required(but_type)
|
|
2141 |
}
|
2142 |
function create_headers()
|
2143 |
{ form_=document.getElementById('form');
|
2144 |
-
n="
|
2145 |
for(i=0; i<n; i++)
|
2146 |
{ if(document.getElementById(i))
|
2147 |
{if(document.getElementById(i).getAttribute(\"type\")!=\"type_map\")
|
@@ -2167,32 +2234,8 @@ form_.submit();
|
|
2167 |
}
|
2168 |
</script>
|
2169 |
</form></div>";
|
2170 |
-
|
2171 |
-
|
2172 |
-
|
2173 |
-
|
2174 |
-
|
2175 |
-
|
2176 |
-
|
2177 |
-
|
2178 |
-
|
2179 |
-
|
2180 |
-
|
2181 |
-
|
2182 |
-
|
2183 |
-
|
2184 |
-
|
2185 |
-
|
2186 |
-
|
2187 |
-
|
2188 |
-
|
2189 |
-
|
2190 |
-
|
2191 |
-
|
2192 |
-
|
2193 |
-
|
2194 |
-
}
|
2195 |
-
return $form_maker_front_end;
|
2196 |
}
|
2197 |
|
2198 |
|
1 |
+
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
+
/**
|
4 |
+
* @package Form Maker
|
5 |
+
* @author Web-Dorado
|
6 |
+
* @copyright (C) 2011 Web-Dorado. All rights reserved.
|
7 |
+
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
8 |
+
**/
|
9 |
+
function showform($id) {
|
10 |
+
global $wpdb;
|
11 |
+
$row = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id=%d", $id));
|
12 |
+
if (!$row)
|
13 |
+
return FALSE;
|
14 |
+
if (isset($_POST['Itemid'])) {
|
15 |
+
$Itemid = esc_html($_POST["Itemid" . $id]);
|
16 |
+
}
|
17 |
+
else {
|
18 |
+
$Itemid = "";
|
19 |
+
}
|
20 |
+
$form_theme = $wpdb->get_var($wpdb->prepare("SELECT css FROM " . $wpdb->prefix . "formmaker_themes WHERE id=%d", $row->theme));
|
21 |
+
if (!$form_theme)
|
22 |
+
return FALSE;
|
23 |
+
$label_id = array();
|
24 |
+
$label_type = array();
|
25 |
+
$label_all = explode('#****#', $row->label_order);
|
26 |
+
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
27 |
+
foreach ($label_all as $key => $label_each) {
|
28 |
+
$label_id_each = explode('#**id**#', $label_each);
|
29 |
+
array_push($label_id, $label_id_each[0]);
|
30 |
+
$label_order_each = explode('#**label**#', $label_id_each[1]);
|
31 |
+
array_push($label_type, $label_order_each[1]);
|
32 |
+
}
|
33 |
+
return array(
|
34 |
+
$row,
|
35 |
+
1,
|
36 |
+
$label_id,
|
37 |
+
$label_type,
|
38 |
+
$form_theme
|
39 |
+
);
|
40 |
+
}
|
41 |
|
42 |
+
function savedata($form, $id) {
|
43 |
+
$all_files = array();
|
44 |
+
$correct = FALSE;
|
45 |
+
@session_start();
|
46 |
+
$id_for_old = $id;
|
47 |
+
if (!$form->form_front)
|
48 |
+
$id = '';
|
49 |
+
if (isset($_POST["counter" . $id])) {
|
50 |
+
$counter = (int)$_POST["counter" . $id];
|
51 |
+
if (isset($_POST["captcha_input"])) {
|
52 |
+
$captcha_input = esc_html($_POST["captcha_input"]);
|
53 |
+
$session_wd_captcha_code = isset($_SESSION[$id . '_wd_captcha_code']) ? $_SESSION[$id . '_wd_captcha_code'] : '-';
|
54 |
+
if ($captcha_input == $session_wd_captcha_code) {
|
55 |
+
$correct = TRUE;
|
56 |
+
}
|
57 |
+
else {
|
58 |
+
echo "<script> alert('" . addslashes(__('Error, incorrect Security code.', 'form_maker')) . "');</script>";
|
59 |
+
}
|
60 |
+
}
|
61 |
+
elseif (isset($_POST["recaptcha_response_field"])) {
|
62 |
+
$recaptcha_response_field = $_POST["recaptcha_response_field"];
|
63 |
+
$privatekey = $form->private_key;
|
64 |
+
$resp = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], esc_html($_POST["recaptcha_challenge_field"]), $recaptcha_response_field);
|
65 |
+
if ($resp->is_valid) {
|
66 |
+
$correct = TRUE;
|
67 |
+
}
|
68 |
+
else {
|
69 |
+
echo "<script> alert('" . addslashes(__('Error, incorrect Security code.', 'form_maker')) . "');</script>";
|
70 |
+
}
|
71 |
+
}
|
72 |
+
else {
|
73 |
+
$correct = TRUE;
|
74 |
+
}
|
75 |
+
if ($correct) {
|
76 |
+
$result_temp = save_db($counter, $id_for_old);
|
77 |
+
$all_files = $result_temp[0];
|
78 |
+
if (is_numeric($all_files)) {
|
79 |
+
remove($all_files, $id_for_old);
|
80 |
+
}
|
81 |
+
elseif (isset($counter)) {
|
82 |
+
gen_mail($counter, $all_files, $id_for_old, $result_temp[1]);
|
83 |
+
}
|
84 |
+
}
|
85 |
+
return $all_files;
|
86 |
+
}
|
87 |
+
return $all_files;
|
88 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
|
90 |
+
function save_db($counter, $id) {
|
91 |
+
global $wpdb;
|
92 |
+
$chgnac = TRUE;
|
93 |
+
$all_files = array();
|
94 |
+
$form = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id= %d", $id));
|
95 |
+
$id_old = $id;
|
96 |
+
if (!$form->form_front) {
|
97 |
+
$id = '';
|
98 |
+
}
|
99 |
+
$label_id = array();
|
100 |
+
$label_label = array();
|
101 |
+
$label_type = array();
|
102 |
+
$label_all = explode('#****#', $form->label_order);
|
103 |
+
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
104 |
+
foreach ($label_all as $key => $label_each) {
|
105 |
+
$label_id_each = explode('#**id**#', $label_each);
|
106 |
+
array_push($label_id, $label_id_each[0]);
|
107 |
+
$label_order_each = explode('#**label**#', $label_id_each[1]);
|
108 |
+
array_push($label_label, $label_order_each[0]);
|
109 |
+
array_push($label_type, $label_order_each[1]);
|
110 |
+
}
|
111 |
+
$max = $wpdb->get_var("SELECT MAX( group_id ) FROM " . $wpdb->prefix . "formmaker_submits");
|
112 |
+
foreach ($label_type as $key => $type) {
|
113 |
+
$value = '';
|
114 |
+
if ($type == "type_submit_reset" or $type == "type_map" or $type == "type_editor" or $type == "type_captcha" or $type == "type_recaptcha" or $type == "type_button")
|
115 |
+
continue;
|
116 |
+
$i = $label_id[$key];
|
117 |
+
if ($type != "type_address") {
|
118 |
+
$deleted = $_POST[$i . "_type" . $id];
|
119 |
+
if (!isset($_POST[$i . "_type" . $id]))
|
120 |
+
break;
|
121 |
+
}
|
122 |
+
switch ($type) {
|
123 |
+
case 'type_text':
|
124 |
+
case 'type_password':
|
125 |
+
case 'type_textarea':
|
126 |
+
case "type_submitter_mail":
|
127 |
+
case "type_date":
|
128 |
+
case "type_own_select":
|
129 |
+
case "type_country":
|
130 |
+
case "type_number":
|
131 |
+
{
|
132 |
+
$value = $_POST[$i . "_element" . $id];
|
133 |
+
break;
|
134 |
+
}
|
135 |
+
case "type_mark_map":
|
136 |
+
{
|
137 |
+
$value = $_POST[$i . "_long" . $id] . '***map***' . $_POST[$i . "_lat" . $id];
|
138 |
+
break;
|
139 |
+
}
|
140 |
+
case "type_date_fields":
|
141 |
+
{
|
142 |
+
$value = $_POST[$i . "_day" . $id] . '-' . $_POST[$i . "_month" . $id] . '-' . $_POST[$i . "_year" . $id];
|
143 |
+
break;
|
144 |
+
}
|
145 |
+
case "type_time":
|
146 |
+
{
|
147 |
+
$ss = $_POST[$i . "_ss" . $id];
|
148 |
+
if (isset($_POST[$i . "_ss" . $id]))
|
149 |
+
$value = $_POST[$i . "_hh" . $id] . ':' . $_POST[$i . "_mm" . $id] . ':' . $_POST[$i . "_ss" . $id];
|
150 |
+
else
|
151 |
+
$value = $_POST[$i . "_hh" . $id] . ':' . $_POST[$i . "_mm" . $id];
|
152 |
+
$am_pm = $_POST[$i . "_am_pm" . $id];
|
153 |
+
if (isset($_POST[$i . "_am_pm" . $id]))
|
154 |
+
$value = $value . ' ' . $_POST[$i . "_am_pm" . $id];
|
155 |
+
break;
|
156 |
+
}
|
157 |
+
case "type_phone":
|
158 |
+
{
|
159 |
+
$value = $_POST[$i . "_element_first" . $id] . ' ' . $_POST[$i . "_element_last" . $id];
|
160 |
+
break;
|
161 |
+
}
|
162 |
+
case "type_name":
|
163 |
+
{
|
164 |
+
$element_title = $_POST[$i . "_element_title" . $id];
|
165 |
+
if (isset($_POST[$i . "_element_title" . $id]))
|
166 |
+
$value = $_POST[$i . "_element_title" . $id] . ' ' . $_POST[$i . "_element_first" . $id] . ' ' . $_POST[$i . "_element_last" . $id] . ' ' . $_POST[$i . "_element_middle" . $id];
|
167 |
+
else
|
168 |
+
$value = $_POST[$i . "_element_first" . $id] . ' ' . $_POST[$i . "_element_last" . $id];
|
169 |
+
break;
|
170 |
+
}
|
171 |
+
case "type_file_upload":
|
172 |
+
{
|
173 |
+
$file = $_FILES[$i . '_file' . $id];
|
174 |
+
if ($file['name']) {
|
175 |
+
$untilupload = $form->form;
|
176 |
+
$pos1 = strpos($untilupload, "***destinationskizb" . $i . "***");
|
177 |
+
$pos2 = strpos($untilupload, "***destinationverj" . $i . "***");
|
178 |
+
$destination = substr($untilupload, $pos1 + (23 + (strlen($i) - 1)), $pos2 - $pos1 - (23 + (strlen($i) - 1)));
|
179 |
+
$pos1 = strpos($untilupload, "***extensionskizb" . $i . "***");
|
180 |
+
$pos2 = strpos($untilupload, "***extensionverj" . $i . "***");
|
181 |
+
$extension = substr($untilupload, $pos1 + (21 + (strlen($i) - 1)), $pos2 - $pos1 - (21 + (strlen($i) - 1)));
|
182 |
+
$pos1 = strpos($untilupload, "***max_sizeskizb" . $i . "***");
|
183 |
+
$pos2 = strpos($untilupload, "***max_sizeverj" . $i . "***");
|
184 |
+
$max_size = substr($untilupload, $pos1 + (20 + (strlen($i) - 1)), $pos2 - $pos1 - (20 + (strlen($i) - 1)));
|
185 |
+
$fileName = $file['name'];
|
186 |
+
$destination = str_replace(site_url() . '/', '', $destination);
|
187 |
+
$fileSize = $file['size'];
|
188 |
+
if ($fileSize > $max_size * 1024) {
|
189 |
+
echo "<script> alert('" . addslashes(__('The file exceeds the allowed size of', 'form_maker')) . $max_size . " KB');</script>";
|
190 |
+
return array($max + 1);
|
191 |
+
}
|
192 |
+
$uploadedFileNameParts = explode('.', $fileName);
|
193 |
+
$uploadedFileExtension = array_pop($uploadedFileNameParts);
|
194 |
+
$to = strlen($fileName) - strlen($uploadedFileExtension) - 1;
|
195 |
+
$fileNameFree = substr($fileName, 0, $to);
|
196 |
+
$invalidFileExts = explode(',', $extension);
|
197 |
+
$extOk = FALSE;
|
198 |
+
foreach ($invalidFileExts as $key => $value) {
|
199 |
+
if (is_numeric(strpos(strtolower($value), strtolower($uploadedFileExtension)))) {
|
200 |
+
$extOk = TRUE;
|
201 |
+
}
|
202 |
+
}
|
203 |
+
if ($extOk == FALSE) {
|
204 |
+
echo "<script> alert('" . addslashes(__('Sorry, you are not allowed to upload this type of file.', 'form_maker')) . "');</script>";
|
205 |
+
return array($max + 1);
|
206 |
+
}
|
207 |
+
$fileTemp = $file['tmp_name'];
|
208 |
+
$p = 1;
|
209 |
+
while (file_exists($destination . "/" . $fileName)) {
|
210 |
+
$to = strlen($file['name']) - strlen($uploadedFileExtension) - 1;
|
211 |
+
$fileName = substr($fileName, 0, $to) . '(' . $p . ').' . $uploadedFileExtension;
|
212 |
+
$p++;
|
213 |
+
}
|
214 |
+
if (is_dir(ABSPATH . $destination)) {
|
215 |
+
if (!move_uploaded_file($fileTemp, ABSPATH . $destination . '/' . $fileName)) {
|
216 |
+
echo "<script> alert('" . addslashes(__('Error, file cannot be moved.', 'form_maker')) . "');</script>";
|
217 |
+
return array($max + 1);
|
218 |
+
}
|
219 |
+
}
|
220 |
+
else {
|
221 |
+
echo "<script> alert('" . addslashes(__('Error, file cannot be moved.', 'form_maker')) . "');</script>";
|
222 |
+
return array($max + 1);
|
223 |
+
}
|
224 |
+
$value = site_url() . '/' . $destination . '/' . $fileName . '*@@url@@*';
|
225 |
+
$file['tmp_name'] = $destination . "/" . $fileName;
|
226 |
+
$file['name'] = ABSPATH . $destination . "/" . $fileName;
|
227 |
+
array_push($all_files, $file);
|
228 |
+
}
|
229 |
+
break;
|
230 |
+
}
|
231 |
+
case 'type_address':
|
232 |
+
{
|
233 |
+
$value = '*#*#*#';
|
234 |
+
if (isset($_POST[$i . "_street1" . $id])) {
|
235 |
+
$value = $_POST[$i . "_street1" . $id];
|
236 |
+
break;
|
237 |
+
}
|
238 |
+
if (isset($_POST[$i . "_street2" . $id])) {
|
239 |
+
$value = $_POST[$i . "_street2" . $id];
|
240 |
+
break;
|
241 |
+
}
|
242 |
+
if (isset($_POST[$i . "_city" . $id])) {
|
243 |
+
$value = $_POST[$i . "_city" . $id];
|
244 |
+
break;
|
245 |
+
}
|
246 |
+
if (isset($_POST[$i . "_state" . $id])) {
|
247 |
+
$value = $_POST[$i . "_state" . $id];
|
248 |
+
break;
|
249 |
+
}
|
250 |
+
if (isset($_POST[$i . "_postal" . $id])) {
|
251 |
+
$value = $_POST[$i . "_postal" . $id];
|
252 |
+
break;
|
253 |
+
}
|
254 |
+
if (isset($_POST[$i . "_country" . $id])) {
|
255 |
+
$value = $_POST[$i . "_country" . $id];
|
256 |
+
break;
|
257 |
+
}
|
258 |
+
break;
|
259 |
+
}
|
260 |
+
case "type_hidden":
|
261 |
+
{
|
262 |
+
$value = $_POST[$label_label[$key]];
|
263 |
+
break;
|
264 |
+
}
|
265 |
+
case "type_radio":
|
266 |
+
{
|
267 |
+
$element = $_POST[$i . "_other_input" . $id];
|
268 |
+
if (isset($element)) {
|
269 |
+
$value = $element;
|
270 |
+
break;
|
271 |
+
}
|
272 |
+
$value = $_POST[$i . "_element" . $id];
|
273 |
+
break;
|
274 |
+
}
|
275 |
+
case "type_checkbox":
|
276 |
+
{
|
277 |
+
$start = -1;
|
278 |
+
$value = '';
|
279 |
+
for ($j = 0; $j < 100; $j++) {
|
280 |
+
if (isset($_POST[$i . "_element" . $id . $j])) {
|
281 |
+
$start = $j;
|
282 |
+
break;
|
283 |
+
}
|
284 |
+
}
|
285 |
+
$other_element_id = -1;
|
286 |
+
$is_other = $_POST[$i . "_allow_other" . $id];
|
287 |
+
if ($is_other == "yes") {
|
288 |
+
$other_element_id = $_POST[$i . "_allow_other_num" . $id];
|
289 |
+
}
|
290 |
+
if ($start != -1) {
|
291 |
+
for ($j = $start; $j < 100; $j++) {
|
292 |
+
if (isset($_POST[$i . "_element" . $id . $j])) {
|
293 |
+
if ($j == $other_element_id) {
|
294 |
+
$value = $value . $_POST[$i . "_other_input" . $id] . '***br***';
|
295 |
+
}
|
296 |
+
else {
|
297 |
+
$value = $value . $_POST[$i . "_element" . $id . $j] . '***br***';
|
298 |
+
}
|
299 |
+
}
|
300 |
+
}
|
301 |
+
}
|
302 |
+
break;
|
303 |
+
}
|
304 |
+
}
|
305 |
+
if ($type == "type_address")
|
306 |
+
if ($value == '*#*#*#')
|
307 |
+
break;
|
308 |
+
$unique_element = $_POST[$i . "_unique" . $id];
|
309 |
+
if ($unique_element == 'yes') {
|
310 |
+
$unique = $wpdb->get_col($wpdb->prepare("SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id= %d and element_label= %s and element_value= %s", $id_old, $i, addslashes($value)));
|
311 |
+
if ($unique) {
|
312 |
+
echo "<script> alert('" . addslashes(__('This field %s requires a unique entry and this value was already submitted.', 'form_maker')) . "'.replace('%s','" . $label_label[$key] . "'));</script>";
|
313 |
+
return ($max + 1);
|
314 |
+
}
|
315 |
+
}
|
316 |
+
$ip = $_SERVER['REMOTE_ADDR'];
|
317 |
+
$r = $wpdb->prefix . "formmaker_submits";
|
318 |
+
$save_or_no = $wpdb->insert($r, array(
|
319 |
+
'form_id' => $id_old,
|
320 |
+
'element_label' => $i,
|
321 |
+
'element_value' => addslashes($value),
|
322 |
+
'group_id' => ($max + 1),
|
323 |
+
'date' => date('Y-m-d H:i:s'),
|
324 |
+
'ip' => $ip,
|
325 |
+
), array(
|
326 |
+
'%d',
|
327 |
+
'%s',
|
328 |
+
'%s',
|
329 |
+
'%d',
|
330 |
+
'%s',
|
331 |
+
'%s'
|
332 |
+
));
|
333 |
+
if (!$save_or_no) {
|
334 |
+
return FALSE;
|
335 |
+
}
|
336 |
+
$chgnac = FALSE;
|
337 |
+
}
|
338 |
+
$str = '';
|
339 |
+
if ($chgnac) {
|
340 |
+
global $wpdb;
|
341 |
+
if (count($all_files) == 0)
|
342 |
+
@session_start();
|
343 |
+
if ($form->submit_text_type != 4)
|
344 |
+
$_SESSION['massage_after_submit'] = addslashes(addslashes(__('Nothing was submitted.', 'form_maker')));
|
345 |
+
$_SESSION['error_or_no'] = 1;
|
346 |
+
$_SESSION['form_submit_type'] = $form->submit_text_type . "," . $form->id;
|
347 |
+
wp_redirect($_SERVER["REQUEST_URI"]);
|
348 |
+
exit;
|
349 |
+
}
|
350 |
+
return array($all_files, $str);
|
351 |
+
}
|
352 |
|
353 |
+
function gen_mail($counter, $all_files, $id, $str) {
|
354 |
+
@session_start();
|
355 |
+
global $wpdb;
|
356 |
+
$row = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id=%d", $id));
|
357 |
+
if (!$row->form_front) {
|
358 |
+
$id = '';
|
359 |
+
}
|
360 |
+
$label_order_original = array();
|
361 |
+
$label_order_ids = array();
|
362 |
+
$label_label = array();
|
363 |
+
$label_type = array();
|
364 |
+
$cc = array();
|
365 |
+
$row_mail_one_time = 1;
|
366 |
+
$label_all = explode('#****#', $row->label_order);
|
367 |
+
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
368 |
+
foreach ($label_all as $key => $label_each) {
|
369 |
+
$label_id_each = explode('#**id**#', $label_each);
|
370 |
+
$label_id = $label_id_each[0];
|
371 |
+
array_push($label_order_ids, $label_id);
|
372 |
+
$label_order_each = explode('#**label**#', $label_id_each[1]);
|
373 |
+
$label_order_original[$label_id] = $label_order_each[0];
|
374 |
+
$label_type[$label_id] = $label_order_each[1];
|
375 |
+
array_push($label_label, $label_order_each[0]);
|
376 |
+
array_push($label_type, $label_order_each[1]);
|
377 |
+
}
|
378 |
+
$list = '<table border="1" cellpadding="3" cellspacing="0" style="width:600px;">';
|
379 |
+
foreach ($label_order_ids as $key => $label_order_id) {
|
380 |
+
$i = $label_order_id;
|
381 |
+
$type = $_POST[$i . "_type" . $id];
|
382 |
+
if (isset($_POST[$i . "_type" . $id]))
|
383 |
+
if ($type != "type_map" and $type != "type_submit_reset" and $type != "type_editor" and $type != "type_captcha" and $type != "type_recaptcha" and $type != "type_button") {
|
384 |
+
$element_label = $label_order_original[$i];
|
385 |
+
switch ($type) {
|
386 |
+
case 'type_text':
|
387 |
+
case 'type_password':
|
388 |
+
case 'type_textarea':
|
389 |
+
case "type_date":
|
390 |
+
case "type_own_select":
|
391 |
+
case "type_country":
|
392 |
+
case "type_number":
|
393 |
+
{
|
394 |
+
$element = $_POST[$i . "_element" . $id];
|
395 |
+
if (isset($_POST[$i . "_element" . $id])) {
|
396 |
+
$list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="font-family:inherit; margin:0px; padding:0px">' . $element . '</pre></td></tr>';
|
397 |
+
}
|
398 |
+
break;
|
399 |
+
}
|
400 |
+
case "type_submitter_mail":
|
401 |
+
{
|
402 |
+
$element = $_POST[$i . "_element" . $id];
|
403 |
+
if (isset($_POST[$i . "_element" . $id])) {
|
404 |
+
$list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="font-family:inherit; margin:0px; padding:0px">' . $element . '</pre></td></tr>';
|
405 |
+
if ($_POST[$i . "_send" . $id] == "yes")
|
406 |
+
array_push($cc, $element);
|
407 |
+
}
|
408 |
+
break;
|
409 |
+
}
|
410 |
+
case "type_time":
|
411 |
+
{
|
412 |
+
$hh = $_POST[$i . "_hh" . $id];
|
413 |
+
if (isset($_POST[$i . "_hh" . $id])) {
|
414 |
+
$ss = $_POST[$i . "_ss" . $id];
|
415 |
+
if (isset($_POST[$i . "_ss" . $id]))
|
416 |
+
$list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $_POST[$i . "_hh" . $id] . ':' . $_POST[$i . "_mm" . $id] . ':' . $_POST[$i . "_ss" . $id];
|
417 |
+
else
|
418 |
+
$list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $_POST[$i . "_hh" . $id] . ':' . $_POST[$i . "_mm" . $id];
|
419 |
+
$am_pm = $_POST[$i . "_am_pm" . $id];
|
420 |
+
if (isset($_POST[$i . "_am_pm" . $id]))
|
421 |
+
$list = $list . ' ' . $_POST[$i . "_am_pm" . $id] . '</td></tr>';
|
422 |
+
else
|
423 |
+
$list = $list . '</td></tr>';
|
424 |
+
}
|
425 |
+
break;
|
426 |
+
}
|
427 |
+
case "type_phone":
|
428 |
+
{
|
429 |
+
$element_first = $_POST[$i . "_element_first" . $id];
|
430 |
+
if (isset($_POST[$i . "_element_first" . $id])) {
|
431 |
+
$list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $_POST[$i . "_element_first" . $id] . ' ' . $_POST[$i . "_element_last" . $id] . '</td></tr>';
|
432 |
+
}
|
433 |
+
break;
|
434 |
+
}
|
435 |
+
case "type_name":
|
436 |
+
{
|
437 |
+
$element_first = $_POST[$i . "_element_first" . $id];
|
438 |
+
if (isset($_POST[$i . "_element_first" . $id])) {
|
439 |
+
$element_title = $_POST[$i . "_element_title" . $id];
|
440 |
+
if (isset($_POST[$i . "_element_title" . $id]))
|
441 |
+
$list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $_POST[$i . "_element_title" . $id] . ' ' . $_POST[$i . "_element_first" . $id] . ' ' . $_POST[$i . "_element_last" . $id] . ' ' . $_POST[$i . "_element_middle" . $id] . '</td></tr>';
|
442 |
+
else
|
443 |
+
$list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $_POST[$i . "_element_first" . $id] . ' ' . $_POST[$i . "_element_last" . $id] . '</td></tr>';
|
444 |
+
}
|
445 |
+
break;
|
446 |
+
}
|
447 |
+
case "type_mark_map":
|
448 |
+
{
|
449 |
+
if (isset($_POST[$i . "_long" . $id])) {
|
450 |
+
$list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >Longitude:' . $_POST[$i . "_long" . $id] . '<br/>Latitude:' . $_POST[$i . "_lat" . $id] . '</td></tr>';
|
451 |
+
}
|
452 |
+
break;
|
453 |
+
}
|
454 |
+
case "type_address":
|
455 |
+
{
|
456 |
+
$street1 = $_POST[$i . "_street1" . $id];
|
457 |
+
if (isset($_POST[$i . "_street1" . $id])) {
|
458 |
+
$list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $_POST[$i . "_street1" . $id] . '</td></tr>';
|
459 |
+
$i++;
|
460 |
+
$list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $_POST[$i . "_street2" . $id] . '</td></tr>';
|
461 |
+
$i++;
|
462 |
+
$list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $_POST[$i . "_city" . $id] . '</td></tr>';
|
463 |
+
$i++;
|
464 |
+
$list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $_POST[$i . "_state" . $id] . '</td></tr>';
|
465 |
+
$i++;
|
466 |
+
$list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $_POST[$i . "_postal" . $id] . '</td></tr>';
|
467 |
+
$i++;
|
468 |
+
$list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $_POST[$i . "_country" . $id] . '</td></tr>';
|
469 |
+
$i++;
|
470 |
+
}
|
471 |
+
break;
|
472 |
+
}
|
473 |
+
case "type_date_fields":
|
474 |
+
{
|
475 |
+
$day = $_POST[$i . "_day" . $id];
|
476 |
+
if (isset($_POST[$i . "_day" . $id])) {
|
477 |
+
$list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $_POST[$i . "_day" . $id] . '-' . $_POST[$i . "_month" . $id] . '-' . $_POST[$i . "_year" . $id] . '</td></tr>';
|
478 |
+
}
|
479 |
+
break;
|
480 |
+
}
|
481 |
+
case "type_radio":
|
482 |
+
{
|
483 |
+
$element = $_POST[$i . "_other_input" . $id];
|
484 |
+
if (isset($_POST[$i . "_other_input" . $id])) {
|
485 |
+
$list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $_POST[$i . "_other_input" . $id] . '</td></tr>';
|
486 |
+
break;
|
487 |
+
}
|
488 |
+
$element = $_POST[$i . "_element" . $id];
|
489 |
+
if (isset($_POST[$i . "_element" . $id])) {
|
490 |
+
$list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="font-family:inherit; margin:0px; padding:0px">' . $element . '</pre></td></tr>';
|
491 |
+
}
|
492 |
+
break;
|
493 |
+
}
|
494 |
+
case "type_checkbox":
|
495 |
+
{
|
496 |
+
$list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >';
|
497 |
+
$start = -1;
|
498 |
+
for ($j = 0; $j < 100; $j++) {
|
499 |
+
if (isset($_POST[$i . "_element" . $id . $j])) {
|
500 |
+
$start = $j;
|
501 |
+
break;
|
502 |
+
}
|
503 |
+
}
|
504 |
+
$other_element_id = -1;
|
505 |
+
$is_other = $_POST[$i . "_allow_other" . $id];
|
506 |
+
if ($is_other == "yes") {
|
507 |
+
$other_element_id = $_POST[$i . "_allow_other_num" . $id];
|
508 |
+
}
|
509 |
+
if ($start != -1) {
|
510 |
+
for ($j = $start; $j < 100; $j++) {
|
511 |
+
$element = $_POST[$i . "_element" . $id . $j];
|
512 |
+
if (isset($_POST[$i . "_element" . $id . $j]))
|
513 |
+
if ($j == $other_element_id) {
|
514 |
+
$list = $list . $_POST[$i . "_other_input" . $id] . '<br>';
|
515 |
+
}
|
516 |
+
else
|
517 |
|
518 |
+
$list = $list . $_POST[$i . "_element" . $id . $j] . '<br>';
|
519 |
+
}
|
520 |
+
$list = $list . '</td></tr>';
|
521 |
+
}
|
522 |
+
break;
|
523 |
+
}
|
524 |
+
default:
|
525 |
+
break;
|
526 |
+
}
|
527 |
+
}
|
528 |
+
}
|
529 |
+
$list = $list . '</table>';
|
530 |
+
$list = wordwrap($list, 70, "\n", TRUE);
|
531 |
+
// add_filter('wp_mail_content_type', create_function('', 'return "text/html";'));
|
532 |
+
$headers = "MIME-Version: 1.0\n" . "Content-Type: text/html; charset=\"" . get_option('blog_charset') . "\"\n";
|
533 |
+
for ($k = 0; $k < count($all_files); $k++) {
|
534 |
+
// $attachment[$k] = dirname(__FILE__) . '/uploads/' . $all_files[$k]['name'];
|
535 |
+
$attachment[$k]= $all_files[$k]['name'];
|
536 |
+
}
|
537 |
+
if (isset($cc[0])) {
|
538 |
+
foreach ($cc as $c) {
|
539 |
+
if ($c) {
|
540 |
+
$recipient = $c;
|
541 |
+
$subject = $row->title;
|
542 |
+
$new_script = wpautop($row->script_mail_user);
|
543 |
+
foreach ($label_order_original as $key => $label_each) {
|
544 |
+
if (strpos($row->script_mail_user, "%" . $label_each . "%") !== FALSE) {
|
545 |
+
$type = $label_type[$key];
|
546 |
+
if ($type != "type_submit_reset" or $type != "type_map" or $type != "type_editor" or $type != "type_captcha" or $type != "type_recaptcha" or $type != "type_button") {
|
547 |
+
$new_value = "";
|
548 |
+
switch ($type) {
|
549 |
+
case 'type_text':
|
550 |
+
case 'type_password':
|
551 |
+
case 'type_textarea':
|
552 |
+
case "type_date":
|
553 |
+
case "type_own_select":
|
554 |
+
case "type_country":
|
555 |
+
case "type_number": {
|
556 |
+
$element = $_POST[$key."_element".$id];
|
557 |
+
if (isset($element)) {
|
558 |
+
$new_value = $element;
|
559 |
+
}
|
560 |
+
break;
|
561 |
+
}
|
562 |
+
case "type_hidden": {
|
563 |
+
$element = $_POST[$element_label];
|
564 |
+
if (isset($element)) {
|
565 |
+
$new_value = $element;
|
566 |
+
}
|
567 |
+
break;
|
568 |
+
}
|
569 |
+
case "type_mark_map": {
|
570 |
+
$element = $_POST[$key."_long".$id];
|
571 |
+
if (isset($element)) {
|
572 |
+
$new_value = 'Longitude:'.$_POST[$key."_long".$id].'<br/>Latitude:' . $_POST[$key."_lat".$id];
|
573 |
+
}
|
574 |
+
break;
|
575 |
+
}
|
576 |
+
case "type_submitter_mail": {
|
577 |
+
$element = $_POST[$key."_element".$id];
|
578 |
+
if (isset($element)) {
|
579 |
+
$new_value = $element;
|
580 |
+
}
|
581 |
+
break;
|
582 |
+
}
|
583 |
+
case "type_time": {
|
584 |
+
$hh = $_POST[$key."_hh".$id];
|
585 |
+
if (isset($hh)) {
|
586 |
+
$ss = $_POST[$key."_ss".$id];
|
587 |
+
if (isset($ss)) {
|
588 |
+
$new_value = $_POST[$key."_hh".$id].':'.$_POST[$key."_mm".$id].':'.$_POST[$key."_ss".$id];
|
589 |
+
}
|
590 |
+
else {
|
591 |
+
$new_value = $_POST[$key."_hh".$id].':'.$_POST[$key."_mm".$id];
|
592 |
+
}
|
593 |
+
$am_pm = $_POST[$key."_am_pm".$id];
|
594 |
+
if (isset($am_pm)) {
|
595 |
+
$new_value = $new_value.' '.$_POST[$key."_am_pm".$id];
|
596 |
+
}
|
597 |
+
}
|
598 |
+
break;
|
599 |
+
}
|
600 |
+
case "type_phone": {
|
601 |
+
$element_first = $_POST[$key."_element_first".$id];
|
602 |
+
if (isset($element_first)) {
|
603 |
+
$new_value = $_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id];
|
604 |
+
}
|
605 |
+
break;
|
606 |
+
}
|
607 |
+
case "type_name": {
|
608 |
+
$element_first = $_POST[$key."_element_first".$id];
|
609 |
+
if (isset($element_first)) {
|
610 |
+
$element_title = $_POST[$key."_element_title".$id];
|
611 |
+
if (isset($element_title)) {
|
612 |
+
$new_value = $_POST[$key."_element_title".$id].' '.$_POST[$key."_element_first".$id].' '.$_POST[$i."_element_last".$id].' '.$_POST[$i."_element_middle".$id];
|
613 |
+
}
|
614 |
+
else {
|
615 |
+
$new_value = $_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id];
|
616 |
+
}
|
617 |
+
}
|
618 |
+
break;
|
619 |
+
}
|
620 |
+
case "type_address": {
|
621 |
+
$street1 = $_POST[$key."_street1".$id];
|
622 |
+
if (isset($street1)) {
|
623 |
+
$new_value = $new_value.$_POST[$key."_street1".$id];
|
624 |
+
$key++;
|
625 |
+
$new_value = $new_value.$_POST[$key."_street2".$id];
|
626 |
+
$key++;
|
627 |
+
$new_value = $new_value.$_POST[$key."_city".$id];
|
628 |
+
$key++;
|
629 |
+
$new_value = $new_value.$_POST[$key."_state".$id];
|
630 |
+
$key++;
|
631 |
+
$new_value = $new_value.$_POST[$key."_postal".$id];
|
632 |
+
$key++;
|
633 |
+
$new_value = $new_value.$_POST[$key."_country".$id];
|
634 |
+
$key++;
|
635 |
+
}
|
636 |
+
break;
|
637 |
+
}
|
638 |
+
case "type_date_fields": {
|
639 |
+
$day = $_POST[$key."_day".$id];
|
640 |
+
if (isset($day)) {
|
641 |
+
$new_value = $_POST[$key."_day".$id].'-'.$_POST[$key."_month".$id].'-'.$_POST[$key."_year".$id];
|
642 |
+
}
|
643 |
+
break;
|
644 |
+
}
|
645 |
+
case "type_radio": {
|
646 |
+
$element = $_POST[$key."_other_input".$id];
|
647 |
+
if (isset($element)) {
|
648 |
+
$new_value = $_POST[$key."_other_input".$id];
|
649 |
+
break;
|
650 |
+
}
|
651 |
+
$element = $_POST[$key."_element".$id];
|
652 |
+
if (isset($element)) {
|
653 |
+
$new_value = $element;
|
654 |
+
}
|
655 |
+
break;
|
656 |
+
}
|
657 |
+
case "type_checkbox": {
|
658 |
+
$start = -1;
|
659 |
+
for ($j = 0; $j < 100; $j++) {
|
660 |
+
$element = $_POST[$key."_element".$id.$j];
|
661 |
+
if (isset($element)) {
|
662 |
+
$start = $j;
|
663 |
+
break;
|
664 |
+
}
|
665 |
+
}
|
666 |
+
$other_element_id = -1;
|
667 |
+
$is_other = $_POST[$key."_allow_other".$id];
|
668 |
+
if ($is_other == "yes") {
|
669 |
+
$other_element_id = $_POST[$key."_allow_other_num".$id];
|
670 |
+
}
|
671 |
+
if ($start != -1) {
|
672 |
+
for ($j = $start; $j < 100; $j++) {
|
673 |
+
$element = $_POST[$key."_element".$id.$j];
|
674 |
+
if (isset($element)) {
|
675 |
+
if ($j == $other_element_id) {
|
676 |
+
$new_value = $new_value.$_POST[$key."_other_input".$id].'<br>';
|
677 |
+
}
|
678 |
+
else {
|
679 |
+
$new_value = $new_value.$_POST[$key."_element".$id.$j].'<br>';
|
680 |
+
}
|
681 |
+
}
|
682 |
+
}
|
683 |
+
}
|
684 |
+
break;
|
685 |
+
}
|
686 |
+
default: break;
|
687 |
+
}
|
688 |
+
$new_script = str_replace("%".$label_each."%", $new_value, $new_script);
|
689 |
+
}
|
690 |
+
}
|
691 |
+
}
|
692 |
+
if (strpos($new_script, "%all%") !== FALSE) {
|
693 |
+
$new_script = str_replace("%all%", $list, $new_script);
|
694 |
+
}
|
695 |
+
$body = $new_script;
|
696 |
+
$send = wp_mail($recipient, $subject, stripslashes($body), $headers, $attachment);
|
697 |
+
}
|
698 |
+
if ($row->mail) {
|
699 |
+
if ($c) {
|
700 |
+
// $headers_form_mail = 'From: ' . $c . ' <' . $c . '>' . "\r\n";
|
701 |
+
$headers = "MIME-Version: 1.0\n" . "From: " . $c . " <" . $c . ">" . "\r\n" . "Content-Type: text/html; charset=\"" . get_option('blog_charset') . "\"\n";
|
702 |
+
}
|
703 |
+
if ($row_mail_one_time) {
|
704 |
+
$recipient = $row->mail;
|
705 |
+
$subject = $row->title;
|
706 |
+
$new_script = wpautop($row->script_mail);
|
707 |
+
foreach($label_order_original as $key => $label_each) {
|
708 |
+
if (strpos($row->script_mail, "%" . $label_each . "%") !== FALSE) {
|
709 |
+
$type = $label_type[$key];
|
710 |
+
if ($type != "type_submit_reset" or $type!="type_map" or $type!="type_editor" or $type!="type_captcha" or $type!="type_recaptcha" or $type!="type_button") {
|
711 |
+
$new_value ="";
|
712 |
+
switch ($type) {
|
713 |
+
case 'type_text':
|
714 |
+
case 'type_password':
|
715 |
+
case 'type_textarea':
|
716 |
+
case "type_date":
|
717 |
+
case "type_own_select":
|
718 |
+
case "type_country":
|
719 |
+
case "type_number": {
|
720 |
+
$element = $_POST[$key."_element".$id];
|
721 |
+
if (isset($element)) {
|
722 |
+
$new_value = $element;
|
723 |
+
}
|
724 |
+
break;
|
725 |
+
}
|
726 |
+
case "type_hidden": {
|
727 |
+
$element = $_POST[$element_label];
|
728 |
+
if(isset($element))
|
729 |
+
{
|
730 |
+
$new_value = $element;
|
731 |
+
}
|
732 |
+
break;
|
733 |
+
}
|
734 |
+
case "type_mark_map": {
|
735 |
+
$element = $_POST[$key."_long".$id];
|
736 |
+
if (isset($element)) {
|
737 |
+
$new_value = 'Longitude:'.$_POST[$key."_long".$id].'<br/>Latitude:'.$_POST[$key."_lat".$id];
|
738 |
+
}
|
739 |
+
break;
|
740 |
+
}
|
741 |
+
case "type_submitter_mail": {
|
742 |
+
$element = $_POST[$key."_element".$id];
|
743 |
+
if (isset($element)) {
|
744 |
+
$new_value = $element;
|
745 |
+
}
|
746 |
+
break;
|
747 |
+
}
|
748 |
+
case "type_time": {
|
749 |
+
$hh = $_POST[$key."_hh".$id];
|
750 |
+
if (isset($hh)) {
|
751 |
+
$ss = $_POST[$key."_ss".$id];
|
752 |
+
if (isset($ss)) {
|
753 |
+
$new_value = $_POST[$key."_hh".$id].':'.$_POST[$key."_mm".$id].':'.$_POST[$key."_ss".$id];
|
754 |
+
}
|
755 |
+
else {
|
756 |
+
$new_value = $_POST[$key."_hh".$id].':'.$_POST[$key."_mm".$id];
|
757 |
+
}
|
758 |
+
$am_pm = $_POST[$key."_am_pm".$id];
|
759 |
+
if (isset($am_pm)) {
|
760 |
+
$new_value = $new_value.' '.$_POST[$key."_am_pm".$id];
|
761 |
+
}
|
762 |
+
}
|
763 |
+
break;
|
764 |
+
}
|
765 |
+
case "type_phone": {
|
766 |
+
$element_first = $_POST[$key."_element_first".$id];
|
767 |
+
if (isset($element_first)) {
|
768 |
+
$new_value = $_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id];
|
769 |
+
}
|
770 |
+
break;
|
771 |
+
}
|
772 |
+
case "type_name": {
|
773 |
+
$element_first = $_POST[$key."_element_first".$id];
|
774 |
+
if (isset($element_first)) {
|
775 |
+
$element_title = $_POST[$key."_element_title".$id];
|
776 |
+
if (isset($element_title)) {
|
777 |
+
$new_value = $_POST[$key."_element_title".$id].' '.$_POST[$key."_element_first".$id].' '.$_POST[$i."_element_last".$id].' '.$_POST[$i."_element_middle".$id];
|
778 |
+
}
|
779 |
+
else {
|
780 |
+
$new_value = $_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id];
|
781 |
+
}
|
782 |
+
}
|
783 |
+
break;
|
784 |
+
}
|
785 |
+
case "type_address": {
|
786 |
+
$street1 = $_POST[$key."_street1".$id];
|
787 |
+
if (isset($street1)) {
|
788 |
+
$new_value = $new_value.$_POST[$key."_street1".$id];
|
789 |
+
$key++;
|
790 |
+
$new_value=$new_value.$_POST[$key."_street2".$id];
|
791 |
+
$key++;
|
792 |
+
$new_value=$new_value.$_POST[$key."_city".$id];
|
793 |
+
$key++;
|
794 |
+
$new_value=$new_value.$_POST[$key."_state".$id];
|
795 |
+
$key++;
|
796 |
+
$new_value=$new_value.$_POST[$key."_postal".$id];
|
797 |
+
$key++;
|
798 |
+
$new_value=$new_value.$_POST[$key."_country".$id];
|
799 |
+
$key++;
|
800 |
+
}
|
801 |
+
break;
|
802 |
+
}
|
803 |
+
case "type_date_fields": {
|
804 |
+
$day = $_POST[$key."_day".$id];
|
805 |
+
if (isset($day)) {
|
806 |
+
$new_value = $_POST[$key."_day".$id].'-'.$_POST[$key."_month".$id].'-'.$_POST[$key."_year".$id];
|
807 |
+
}
|
808 |
+
break;
|
809 |
+
}
|
810 |
+
case "type_radio": {
|
811 |
+
$element = $_POST[$key."_other_input".$id];
|
812 |
+
if (isset($element)) {
|
813 |
+
$new_value = $_POST[$key."_other_input".$id];
|
814 |
+
break;
|
815 |
+
}
|
816 |
+
$element = $_POST[$key."_element".$id];
|
817 |
+
if (isset($element)) {
|
818 |
+
$new_value = $element;
|
819 |
+
}
|
820 |
+
break;
|
821 |
+
}
|
822 |
+
case "type_checkbox": {
|
823 |
+
$start = -1;
|
824 |
+
for ($j=0; $j<100; $j++) {
|
825 |
+
$element = $_POST[$key."_element".$id.$j];
|
826 |
+
if (isset($element)) {
|
827 |
+
$start = $j;
|
828 |
+
break;
|
829 |
+
}
|
830 |
+
}
|
831 |
+
$other_element_id=-1;
|
832 |
+
$is_other = $_POST[$key."_allow_other".$id];
|
833 |
+
if ($is_other == "yes") {
|
834 |
+
$other_element_id = $_POST[$key."_allow_other_num".$id];
|
835 |
+
}
|
836 |
+
if ($start != -1) {
|
837 |
+
for ($j = $start; $j < 100; $j++) {
|
838 |
+
$element = $_POST[$key."_element".$id.$j];
|
839 |
+
if (isset($element)) {
|
840 |
+
if ($j == $other_element_id) {
|
841 |
+
$new_value = $new_value.$_POST[$key."_other_input".$id].'<br>';
|
842 |
+
}
|
843 |
+
else {
|
844 |
+
$new_value = $new_value.$_POST[$key."_element".$id.$j].'<br>';
|
845 |
+
}
|
846 |
+
}
|
847 |
+
}
|
848 |
+
}
|
849 |
+
break;
|
850 |
+
}
|
851 |
+
default: break;
|
852 |
+
}
|
853 |
+
$new_script = str_replace("%".$label_each."%", $new_value, $new_script);
|
854 |
+
}
|
855 |
+
}
|
856 |
+
}
|
857 |
+
if (strpos($new_script, "%all%") !== FALSE) {
|
858 |
+
$new_script = str_replace("%all%", $list, $new_script);
|
859 |
+
}
|
860 |
+
$body = $new_script;
|
861 |
+
$mode = 1;
|
862 |
+
$send = wp_mail($recipient, $subject, stripslashes($body), $headers, $attachment);
|
863 |
+
$row_mail_one_time = 0;
|
864 |
+
}
|
865 |
+
}
|
866 |
+
}
|
867 |
+
}
|
868 |
+
else {
|
869 |
+
if ($row->mail) {
|
870 |
+
$recipient = $row->mail;
|
871 |
+
$subject = $row->title;
|
872 |
+
$new_script = wpautop($row->script_mail);
|
873 |
+
foreach($label_order_original as $key => $label_each) {
|
874 |
+
if (strpos($row->script_mail, "%" . $label_each . "%") !== FALSE) {
|
875 |
+
$type = $label_type[$key];
|
876 |
+
if ($type != "type_submit_reset" or $type != "type_map" or $type != "type_editor" or $type!="type_captcha" or $type!="type_recaptcha" or $type!="type_button") {
|
877 |
+
$new_value = "";
|
878 |
+
switch ($type) {
|
879 |
+
case 'type_text':
|
880 |
+
case 'type_password':
|
881 |
+
case 'type_textarea':
|
882 |
+
case "type_date":
|
883 |
+
case "type_own_select":
|
884 |
+
case "type_country":
|
885 |
+
case "type_number": {
|
886 |
+
$element = $_POST[$key."_element".$id];
|
887 |
+
if (isset($element)) {
|
888 |
+
$new_value = $element;
|
889 |
+
}
|
890 |
+
break;
|
891 |
+
}
|
892 |
+
case "type_hidden": {
|
893 |
+
$element = $_POST[$element_label];
|
894 |
+
if (isset($element)) {
|
895 |
+
$new_value = $element;
|
896 |
+
}
|
897 |
+
break;
|
898 |
+
}
|
899 |
+
case "type_mark_map": {
|
900 |
+
$element = $_POST[$key."_long".$id];
|
901 |
+
if (isset($element)) {
|
902 |
+
$new_value = 'Longitude:'.$_POST[$key."_long".$id].'<br/>Latitude:'.$_POST[$key."_lat".$id];
|
903 |
+
}
|
904 |
+
break;
|
905 |
+
}
|
906 |
+
case "type_submitter_mail": {
|
907 |
+
$element = $_POST[$key."_element".$id];
|
908 |
+
if (isset($element)) {
|
909 |
+
$new_value = $element;
|
910 |
+
}
|
911 |
+
break;
|
912 |
+
}
|
913 |
+
case "type_time": {
|
914 |
+
$hh = $_POST[$key."_hh".$id];
|
915 |
+
if (isset($hh)) {
|
916 |
+
$ss = $_POST[$key."_ss".$id];
|
917 |
+
if (isset($ss)) {
|
918 |
+
$new_value = $_POST[$key."_hh".$id].':'.$_POST[$key."_mm".$id].':'.$_POST[$key."_ss".$id];
|
919 |
+
}
|
920 |
+
else {
|
921 |
+
$new_value = $_POST[$key."_hh".$id].':'.$_POST[$key."_mm".$id];
|
922 |
+
}
|
923 |
+
$am_pm = $_POST[$key."_am_pm".$id];
|
924 |
+
if (isset($am_pm)) {
|
925 |
+
$new_value = $new_value.' '.$_POST[$key."_am_pm".$id];
|
926 |
+
}
|
927 |
+
}
|
928 |
+
break;
|
929 |
+
}
|
930 |
+
case "type_phone": {
|
931 |
+
$element_first = $_POST[$key."_element_first".$id];
|
932 |
+
if (isset($element_first)) {
|
933 |
+
$new_value = $_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id];
|
934 |
+
}
|
935 |
+
break;
|
936 |
+
}
|
937 |
+
case "type_name": {
|
938 |
+
$element_first = $_POST[$key."_element_first".$id];
|
939 |
+
if (isset($element_first)) {
|
940 |
+
$element_title = $_POST[$key."_element_title".$id];
|
941 |
+
if (isset($element_title)) {
|
942 |
+
$new_value = $_POST[$key."_element_title".$id].' '.$_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id].' '.$_POST[$key."_element_middle".$id];
|
943 |
+
}
|
944 |
+
else {
|
945 |
+
$new_value = $_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id];
|
946 |
+
}
|
947 |
+
}
|
948 |
+
break;
|
949 |
+
}
|
950 |
+
case "type_address": {
|
951 |
+
$street1 = $_POST[$key."_street1".$id];
|
952 |
+
if (isset($street1)) {
|
953 |
+
$new_value = $new_value.$_POST[$key."_street1".$id];
|
954 |
+
$key++;
|
955 |
+
$new_value = $new_value.$_POST[$key."_street2".$id];
|
956 |
+
$key++;
|
957 |
+
$new_value = $new_value.$_POST[$key."_city".$id];
|
958 |
+
$key++;
|
959 |
+
$new_value = $new_value.$_POST[$key."_state".$id];
|
960 |
+
$key++;
|
961 |
+
$new_value = $new_value.$_POST[$key."_postal".$id];
|
962 |
+
$key++;
|
963 |
+
$new_value = $new_value.$_POST[$key."_country".$id];
|
964 |
+
$key++;
|
965 |
+
}
|
966 |
+
break;
|
967 |
+
}
|
968 |
+
case "type_date_fields": {
|
969 |
+
$day = $_POST[$key."_day".$id];
|
970 |
+
if (isset($day)) {
|
971 |
+
$new_value = $_POST[$key."_day".$id].'-'.$_POST[$key."_month".$id].'-'.$_POST[$key."_year".$id];
|
972 |
+
}
|
973 |
+
break;
|
974 |
+
}
|
975 |
+
case "type_radio": {
|
976 |
+
$element = $_POST[$key."_other_input".$id];
|
977 |
+
if (isset($element)) {
|
978 |
+
$new_value = $_POST[$key."_other_input".$id];
|
979 |
+
break;
|
980 |
+
}
|
981 |
+
$element = $_POST[$key."_element".$id];
|
982 |
+
if (isset($element)) {
|
983 |
+
$new_value = $element;
|
984 |
+
}
|
985 |
+
break;
|
986 |
+
}
|
987 |
+
case "type_checkbox": {
|
988 |
+
$start = -1;
|
989 |
+
for ($j = 0; $j < 100; $j++) {
|
990 |
+
$element = $_POST[$key."_element".$id.$j];
|
991 |
+
if (isset($element)) {
|
992 |
+
$start = $j;
|
993 |
+
break;
|
994 |
+
}
|
995 |
+
}
|
996 |
+
$other_element_id = -1;
|
997 |
+
$is_other = $_POST[$key."_allow_other".$id];
|
998 |
+
if ($is_other == "yes") {
|
999 |
+
$other_element_id = $_POST[$key."_allow_other_num".$id];
|
1000 |
+
}
|
1001 |
+
if ($start != -1) {
|
1002 |
+
for ($j = $start; $j < 100; $j++) {
|
1003 |
+
$element = $_POST[$key."_element".$id.$j];
|
1004 |
+
if (isset($element)) {
|
1005 |
+
if ($j == $other_element_id) {
|
1006 |
+
$new_value = $new_value.$_POST[$key."_other_input".$id].'<br>';
|
1007 |
+
}
|
1008 |
+
else {
|
1009 |
+
$new_value = $new_value.$_POST[$key."_element".$id.$j].'<br>';
|
1010 |
+
}
|
1011 |
+
}
|
1012 |
+
}
|
1013 |
+
}
|
1014 |
+
break;
|
1015 |
+
}
|
1016 |
+
default: break;
|
1017 |
+
}
|
1018 |
+
$new_script = str_replace("%".$label_each."%", $new_value, $new_script);
|
1019 |
+
}
|
1020 |
+
}
|
1021 |
+
}
|
1022 |
+
if (strpos($new_script, "%all%") !== FALSE) {
|
1023 |
+
$new_script = str_replace("%all%", $list, $new_script);
|
1024 |
+
}
|
1025 |
+
$body = $new_script;
|
1026 |
+
$send = wp_mail($recipient, $subject, stripslashes($body), $headers, $attachment);
|
1027 |
+
}
|
1028 |
+
}
|
1029 |
+
if ($row->mail) {
|
1030 |
+
if ($send != TRUE) {
|
1031 |
+
@session_start();
|
1032 |
+
$_SESSION['error_or_no'] = 1;
|
1033 |
+
$msg = addslashes(__('Error, email was not sent.', 'form_maker'));
|
1034 |
+
}
|
1035 |
+
else {
|
1036 |
+
@session_start();
|
1037 |
+
$_SESSION['error_or_no'] = 0;
|
1038 |
+
$msg = addslashes(__('Your form was successfully submitted.', 'form_maker'));
|
1039 |
+
}
|
1040 |
+
}
|
1041 |
+
else {
|
1042 |
+
@session_start();
|
1043 |
+
$_SESSION['error_or_no'] = 0;
|
1044 |
+
$msg = addslashes(__('Your form was successfully submitted.', 'form_maker'));
|
1045 |
+
}
|
1046 |
+
switch ($row->submit_text_type) {
|
1047 |
+
case "2":
|
1048 |
+
case "5":
|
1049 |
+
{
|
1050 |
+
@session_start();
|
1051 |
+
if ($row->submit_text_type != 4)
|
1052 |
+
$_SESSION['massage_after_submit'] = $msg;
|
1053 |
+
$_SESSION['form_submit_type'] = $row->submit_text_type . "," . $row->id;
|
1054 |
+
if ($row->article_id) {
|
1055 |
+
$redirect_url = $row->article_id;
|
1056 |
+
}
|
1057 |
+
else {
|
1058 |
+
$redirect_url = 'http://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
|
1059 |
+
}
|
1060 |
+
break;
|
1061 |
+
}
|
1062 |
+
case "3":
|
1063 |
+
{
|
1064 |
+
@session_start();
|
1065 |
+
if ($row->submit_text_type != 4) {
|
1066 |
+
$_SESSION['massage_after_submit'] = $msg;
|
1067 |
+
}
|
1068 |
+
$_SESSION['form_submit_type'] = $row->submit_text_type . "," . $row->id;
|
1069 |
+
$redirect_url = 'http://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
|
1070 |
+
break;
|
1071 |
+
}
|
1072 |
+
case "4":
|
1073 |
+
{
|
1074 |
+
@session_start();
|
1075 |
+
if ($row->submit_text_type != 4)
|
1076 |
+
$_SESSION['massage_after_submit'] = $msg;
|
1077 |
+
$_SESSION['form_submit_type'] = $row->submit_text_type . "," . $row->id;
|
1078 |
+
$redirect_url = $row->url;
|
1079 |
+
break;
|
1080 |
+
}
|
1081 |
+
default:
|
1082 |
+
{
|
1083 |
+
@session_start();
|
1084 |
+
if ($row->submit_text_type != 4) {
|
1085 |
+
$_SESSION['massage_after_submit'] = $msg;
|
1086 |
+
}
|
1087 |
+
$_SESSION['form_submit_type'] = $row->submit_text_type . "," . $row->id;
|
1088 |
+
$redirect_url = 'http://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
|
1089 |
+
break;
|
1090 |
+
}
|
1091 |
+
}
|
1092 |
+
if (!$str) {
|
1093 |
+
wp_redirect($redirect_url);
|
1094 |
+
exit;
|
1095 |
+
}
|
1096 |
+
else {
|
1097 |
+
$str .= "&return=" . urlencode($redirect_url);
|
1098 |
+
wp_redirect($str);
|
1099 |
+
exit;
|
1100 |
+
}
|
1101 |
+
}
|
1102 |
|
1103 |
+
function remove($group_id) {
|
1104 |
+
global $wpdb;
|
1105 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id= %d', $group_id));
|
1106 |
+
}
|
1107 |
|
1108 |
+
////////////////////////////////////////////////////// DISPLAY
|
1109 |
+
function form_maker_front_end($id) {
|
1110 |
+
global $wp_filter;
|
1111 |
+
$form_maker_front_end = "";
|
1112 |
+
$result = showform($id);
|
1113 |
+
if (!$result) {
|
1114 |
+
return;
|
1115 |
+
}
|
1116 |
+
$ok = savedata($result[0], $id);
|
1117 |
+
if (is_numeric($ok)) {
|
1118 |
+
remove($ok);
|
1119 |
+
}
|
1120 |
+
@session_start();
|
1121 |
+
global $wpdb;
|
1122 |
+
$row = $result[0];
|
1123 |
+
$label_id = $result[2];
|
1124 |
+
$label_type = $result[3];
|
1125 |
+
$form_theme = $result[4];
|
1126 |
+
if (isset($_SESSION['show_submit_text' . $id]))
|
1127 |
+
if ($_SESSION['show_submit_text' . $id] == 1) {
|
1128 |
+
$_SESSION['show_submit_text' . $id] = 0;
|
1129 |
+
$form_maker_front_end .= $row->submit_text;
|
1130 |
+
return;
|
1131 |
+
}
|
1132 |
+
$vives_form = $wpdb->get_var($wpdb->prepare("SELECT views FROM " . $wpdb->prefix . "formmaker_views WHERE form_id=%d", $id));
|
1133 |
+
$vives_form = $vives_form + 1;
|
1134 |
+
$wpdb->update($wpdb->prefix . "formmaker_views", array(
|
1135 |
+
'views' => $vives_form,
|
1136 |
+
), array('form_id' => $id), array(
|
1137 |
+
'%d',
|
1138 |
+
), array('%d'));
|
1139 |
+
$article = $row->article_id;
|
1140 |
+
if ($row->form_front) {
|
1141 |
+
/////////if form is new version
|
1142 |
+
$form_maker_front_end .= '<div><script type="text/javascript">' . $row->javascript . '</script>';
|
1143 |
+
$new_form_theme = explode('{', $form_theme);
|
1144 |
+
$count_after_explod_theme = count($new_form_theme);
|
1145 |
+
for ($i = 0; $i < $count_after_explod_theme; $i++) {
|
1146 |
+
$body_or_classes[$i] = explode('}', $new_form_theme[$i]);
|
1147 |
+
}
|
1148 |
+
for ($i = 0; $i < $count_after_explod_theme; $i++) {
|
1149 |
+
if ($i == 0) {
|
1150 |
+
$body_or_classes[$i][0] = "#form" . $id . ' ' . str_replace(',', ", #form" . $id, $body_or_classes[$i][0]);
|
1151 |
+
}
|
1152 |
+
else {
|
1153 |
+
$body_or_classes[$i][1] = "#form" . $id . ' ' . str_replace(',', ", #form" . $id, $body_or_classes[$i][1]);
|
1154 |
+
}
|
1155 |
+
}
|
1156 |
+
for ($i = 0; $i < $count_after_explod_theme; $i++) {
|
1157 |
+
$body_or_classes_implode[$i] = implode('}', $body_or_classes[$i]);
|
1158 |
+
}
|
1159 |
+
$form_theme = implode('{', $body_or_classes_implode);
|
1160 |
+
$form_maker_front_end .= '<style>' . str_replace('[SITE_ROOT]', plugins_url("", __FILE__), $form_theme) . '</style>';
|
1161 |
+
$form_maker_front_end .= '<form name="form' . $id . '" action="' . $_SERVER['REQUEST_URI'] . '" method="post" id="form' . $id . '" enctype="multipart/form-data" onsubmit="check_required(\'submit\', \'' . $id . '\'); return false;">
|
1162 |
+
<div id="' . $id . 'pages" class="wdform_page_navigation" show_title="' . $row->show_title . '" show_numbers="' . $row->show_numbers . '" type="' . $row->pagination . '"></div>
|
1163 |
+
<input type="hidden" id="counter' . $id . '" value="' . $row->counter . '" name="counter' . $id . '" />';
|
1164 |
+
//inch@ petq chi raplace minchev form@ tpi
|
1165 |
+
$captcha_url = 'components/com_formmaker/wd_captcha.php?digit=';
|
1166 |
+
$captcha_rep_url = 'components/com_formmaker/wd_captcha.php?r2=' . mt_rand(0, 1000) . '&digit=';
|
1167 |
+
$rep1 = array(
|
1168 |
+
"<!--repstart-->Title<!--repend-->",
|
1169 |
+
"<!--repstart-->First<!--repend-->",
|
1170 |
+
"<!--repstart-->Last<!--repend-->",
|
1171 |
+
"<!--repstart-->Middle<!--repend-->",
|
1172 |
+
"<!--repstart-->January<!--repend-->",
|
1173 |
+
"<!--repstart-->February<!--repend-->",
|
1174 |
+
"<!--repstart-->March<!--repend-->",
|
1175 |
+
"<!--repstart-->April<!--repend-->",
|
1176 |
+
"<!--repstart-->May<!--repend-->",
|
1177 |
+
"<!--repstart-->June<!--repend-->",
|
1178 |
+
"<!--repstart-->July<!--repend-->",
|
1179 |
+
"<!--repstart-->August<!--repend-->",
|
1180 |
+
"<!--repstart-->September<!--repend-->",
|
1181 |
+
"<!--repstart-->October<!--repend-->",
|
1182 |
+
"<!--repstart-->November<!--repend-->",
|
1183 |
+
"<!--repstart-->December<!--repend-->",
|
1184 |
+
"<!--repstart-->Street Address<!--repend-->",
|
1185 |
+
"<!--repstart-->Street Address Line 2<!--repend-->",
|
1186 |
+
"<!--repstart-->City<!--repend-->",
|
1187 |
+
"<!--repstart-->State / Province / Region<!--repend-->",
|
1188 |
+
"<!--repstart-->Postal / Zip Code<!--repend-->",
|
1189 |
+
"<!--repstart-->Country<!--repend-->",
|
1190 |
+
"<!--repstart-->Area Code<!--repend-->",
|
1191 |
+
"<!--repstart-->Phone Number<!--repend-->",
|
1192 |
+
$captcha_url,
|
1193 |
+
'class="captcha_img"',
|
1194 |
+
plugins_url("images/refresh.png", __FILE__),
|
1195 |
+
'form_id_temp',
|
1196 |
+
'style="padding-right:170px"'
|
1197 |
+
);
|
1198 |
+
$rep2 = array(
|
1199 |
+
addslashes(__("Title", 'form_maker')),
|
1200 |
+
addslashes(__("First", 'form_maker')),
|
1201 |
+
addslashes(__("Last", 'form_maker')),
|
1202 |
+
addslashes(__("Middle", 'form_maker')),
|
1203 |
+
addslashes(__("January", 'form_maker')),
|
1204 |
+
addslashes(__("February", 'form_maker')),
|
1205 |
+
addslashes(__("March", 'form_maker')),
|
1206 |
+
addslashes(__("April", 'form_maker')),
|
1207 |
+
addslashes(__("May", 'form_maker')),
|
1208 |
+
addslashes(__("June", 'form_maker')),
|
1209 |
+
addslashes(__("July", 'form_maker')),
|
1210 |
+
addslashes(__("August", 'form_maker')),
|
1211 |
+
addslashes(__("September", 'form_maker')),
|
1212 |
+
addslashes(__("October", 'form_maker')),
|
1213 |
+
addslashes(__("November", 'form_maker')),
|
1214 |
+
addslashes(__("December", 'form_maker')),
|
1215 |
+
addslashes(__("Street Address", 'form_maker')),
|
1216 |
+
addslashes(__("Street Address Line 2", 'form_maker')),
|
1217 |
+
addslashes(__("City", 'form_maker')),
|
1218 |
+
addslashes(__("State / Province / Region", 'form_maker')),
|
1219 |
+
addslashes(__("Postal / Zip Code", 'form_maker')),
|
1220 |
+
addslashes(__("Country", 'form_maker')),
|
1221 |
+
addslashes(__("Area Code", 'form_maker')),
|
1222 |
+
addslashes(__("Phone Number", 'form_maker')),
|
1223 |
+
$captcha_rep_url,
|
1224 |
+
'class="captcha_img" style="display:none"',
|
1225 |
+
plugins_url("images/refresh.png", __FILE__),
|
1226 |
+
$id,
|
1227 |
+
''
|
1228 |
+
);
|
1229 |
+
$untilupload = str_replace($rep1, $rep2, $row->form_front);
|
1230 |
+
while (strpos($untilupload, "***destinationskizb") > 0) {
|
1231 |
+
$pos1 = strpos($untilupload, "***destinationskizb");
|
1232 |
+
$pos2 = strpos($untilupload, "***destinationverj");
|
1233 |
+
$untilupload = str_replace(substr($untilupload, $pos1, $pos2 - $pos1 + 22), "", $untilupload);
|
1234 |
+
}
|
1235 |
+
$form_maker_front_end .= $untilupload;
|
1236 |
+
$is_recaptcha = FALSE;
|
1237 |
+
$form_maker_front_end .= '<script type="text/javascript">';
|
1238 |
+
$form_maker_front_end .= 'WDF_FILE_TYPE_ERROR = \'' . addslashes(__("Sorry, you are not allowed to upload this type of file.", 'form_maker')) . '\';
|
1239 |
+
';
|
1240 |
+
$form_maker_front_end .= 'WDF_INVALID_EMAIL = \'' . addslashes(__("This is not a valid email address.", 'form_maker')) . '\';
|
1241 |
';
|
1242 |
+
$form_maker_front_end .= 'REQUEST_URI = "' . $_SERVER['REQUEST_URI'] . '";
|
1243 |
';
|
1244 |
+
$form_maker_front_end .= 'ReqFieldMsg =\'`FIELDNAME`' . addslashes(__('field is required.', 'form_maker')) . '\';
|
1245 |
';
|
1246 |
+
$form_maker_front_end .= 'function formOnload' . $id . '()
|
|
|
|
|
1247 |
{
|
1248 |
+
';
|
1249 |
+
//enable maps and refresh captcha
|
1250 |
+
foreach ($label_type as $key => $type) {
|
1251 |
+
switch ($type) {
|
1252 |
+
case 'type_map':
|
1253 |
+
$form_maker_front_end .= 'if(document.getElementById("' . $label_id[$key] . '_element' . $id . '"))
|
|
|
|
|
|
|
|
|
|
|
1254 |
{
|
1255 |
+
if_gmap_init(' . $label_id[$key] . ',' . $id . ');
|
1256 |
for(q=0; q<20; q++)
|
1257 |
+
if(document.getElementById(' . $label_id[$key] . '+"_element"+' . $id . ').getAttribute("long"+q))
|
1258 |
{
|
1259 |
|
1260 |
+
w_long=parseFloat(document.getElementById(' . $label_id[$key] . '+"_element"+' . $id . ').getAttribute("long"+q));
|
1261 |
+
w_lat=parseFloat(document.getElementById(' . $label_id[$key] . '+"_element"+' . $id . ').getAttribute("lat"+q));
|
1262 |
+
w_info=parseFloat(document.getElementById(' . $label_id[$key] . '+"_element"+' . $id . ').getAttribute("info"+q));
|
1263 |
+
add_marker_on_map(' . $label_id[$key] . ',q, w_long, w_lat, w_info,' . $id . ',false);
|
1264 |
}
|
1265 |
}';
|
1266 |
+
break;
|
1267 |
+
case 'type_mark_map':
|
1268 |
+
$form_maker_front_end .= 'if(document.getElementById("' . $label_id[$key] . '_element' . $id . '"))
|
1269 |
+
if(!document.getElementById("' . $label_id[$key] . '_long' . $id . '"))
|
|
|
1270 |
{
|
1271 |
|
1272 |
var longit = document.createElement(\'input\');
|
1273 |
longit.setAttribute("type", \'hidden\');
|
1274 |
+
longit.setAttribute("id", \'' . $label_id[$key] . '_long' . $id . '\');
|
1275 |
+
longit.setAttribute("name", \'' . $label_id[$key] . '_long' . $id . '\');
|
1276 |
|
1277 |
var latit = document.createElement(\'input\');
|
1278 |
latit.setAttribute("type", \'hidden\');
|
1279 |
+
latit.setAttribute("id", \'' . $label_id[$key] . '_lat' . $id . '\');
|
1280 |
+
latit.setAttribute("name", \'' . $label_id[$key] . '_lat' . $id . '\');
|
1281 |
|
1282 |
+
document.getElementById("' . $label_id[$key] . '_element_section' . $id . '").appendChild(longit);
|
1283 |
+
document.getElementById("' . $label_id[$key] . '_element_section' . $id . '").appendChild(latit);
|
1284 |
|
1285 |
+
if_gmap_init(' . $label_id[$key] . ', ' . $id . ');
|
1286 |
|
1287 |
+
w_long=parseFloat(document.getElementById(' . $label_id[$key] . '+"_element"+' . $id . ').getAttribute("long0"));
|
1288 |
+
w_lat=parseFloat(document.getElementById(' . $label_id[$key] . '+"_element"+' . $id . ').getAttribute("lat0"));
|
1289 |
+
w_info=parseFloat(document.getElementById(' . $label_id[$key] . '+"_element"+' . $id . ').getAttribute("info0"));
|
1290 |
|
1291 |
|
1292 |
longit.value=w_long;
|
1293 |
latit.value=w_lat;
|
1294 |
+
add_marker_on_map(' . $label_id[$key] . ',0, w_long, w_lat, w_info, ' . $id . ', true);
|
1295 |
}';
|
1296 |
+
break;
|
1297 |
+
case 'type_captcha':
|
1298 |
+
$form_maker_front_end .= 'if(document.getElementById(\'_wd_captcha' . $id . '\'))
|
1299 |
+
captcha_refresh(\'_wd_captcha\', \'' . $id . '\');';
|
1300 |
+
break;
|
1301 |
+
case 'type_recaptcha':
|
1302 |
+
$is_recaptcha = TRUE;
|
1303 |
+
break;
|
1304 |
+
case 'type_radio':
|
1305 |
+
case 'type_checkbox':
|
1306 |
+
$form_maker_front_end .= 'if(document.getElementById(\'' . $label_id[$key] . '_randomize' . $id . '\'))
|
1307 |
+
if(document.getElementById(\'' . $label_id[$key] . '_randomize' . $id . '\').value=="yes")
|
|
|
|
|
|
|
|
|
|
|
1308 |
{
|
1309 |
+
choises_randomize(\'' . $label_id[$key] . '\', \'' . $id . '\');
|
1310 |
}';
|
1311 |
+
break;
|
1312 |
+
default:
|
1313 |
+
break;
|
1314 |
+
}
|
1315 |
+
}
|
1316 |
+
$form_maker_front_end .= 'if(window.before_load)
|
|
|
|
|
|
|
|
|
1317 |
{
|
1318 |
before_load();
|
1319 |
}
|
1320 |
}
|
1321 |
';
|
1322 |
+
$form_maker_front_end .= 'function formAddToOnload' . $id . '()
|
|
|
1323 |
{
|
1324 |
+
if(formOldFunctionOnLoad' . $id . '){ formOldFunctionOnLoad' . $id . '(); }
|
1325 |
+
formOnload' . $id . '();
|
1326 |
}
|
1327 |
+
function formLoadBody' . $id . '()
|
1328 |
{
|
1329 |
+
formOldFunctionOnLoad' . $id . ' = window.onload;
|
1330 |
+
window.onload = formAddToOnload' . $id . ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1331 |
}
|
1332 |
+
var formOldFunctionOnLoad' . $id . ' = null;
|
1333 |
+
formLoadBody' . $id . '();';
|
1334 |
+
if (isset($_POST["captcha_input"])) {
|
1335 |
+
$captcha_input = esc_html($_POST["captcha_input"]);
|
1336 |
+
}
|
1337 |
+
if (isset($_POST["recaptcha_response_field"])) {
|
1338 |
+
$recaptcha_response_field = esc_html($_POST["recaptcha_response_field"]);
|
1339 |
+
}
|
1340 |
+
if (isset($_POST["counter" . $id])) {
|
1341 |
+
$counter = esc_html($_POST["counter" . $id]);
|
1342 |
+
}
|
1343 |
+
$old_key = -1;
|
1344 |
+
if (isset($counter)) {
|
1345 |
+
foreach ($label_type as $key => $type) {
|
1346 |
+
switch ($type) {
|
1347 |
+
case "type_text":
|
1348 |
+
case "type_number":
|
1349 |
+
case "type_submitter_mail":
|
1350 |
+
{
|
1351 |
+
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_element" . $id . "'))
|
1352 |
+
if(document.getElementById('" . $label_id[$key] . "_element" . $id . "').title!='" . addslashes($_POST[$label_id[$key] . "_element" . $id]) . "')
|
1353 |
+
{ document.getElementById('" . $label_id[$key] . "_element" . $id . "').value='" . addslashes($_POST[$label_id[$key] . "_element" . $id]) . "';
|
1354 |
+
document.getElementById('" . $label_id[$key] . "_element" . $id . "').className='input_active';
|
1355 |
}
|
1356 |
";
|
1357 |
+
break;
|
1358 |
+
}
|
1359 |
+
case "type_textarea":
|
1360 |
+
{
|
1361 |
+
$order = array(
|
1362 |
+
"\r\n",
|
1363 |
+
"\n",
|
1364 |
+
"\r"
|
1365 |
+
);
|
1366 |
+
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_element" . $id . "'))
|
1367 |
+
if(document.getElementById('" . $label_id[$key] . "_element" . $id . "').title!='" . str_replace($order, '\n', addslashes($_POST[$label_id[$key] . "_element" . $id])) . "')
|
1368 |
+
{ document.getElementById('" . $label_id[$key] . "_element" . $id . "').innerHTML='" . str_replace($order, '\n', addslashes($_POST[$label_id[$key] . "_element" . $id])) . "';
|
1369 |
+
document.getElementById('" . $label_id[$key] . "_element" . $id . "').className='input_active';
|
1370 |
}
|
1371 |
";
|
1372 |
+
break;
|
1373 |
+
}
|
1374 |
+
case "type_name":
|
1375 |
+
{
|
1376 |
+
$element_title = $_POST[$label_id[$key] . "_element_title" . $id];
|
1377 |
+
if (isset($_POST[$label_id[$key] . "_element_title" . $id])) {
|
1378 |
+
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_element_first" . $id . "'))
|
|
|
1379 |
{
|
1380 |
+
if(document.getElementById('" . $label_id[$key] . "_element_title" . $id . "').title!='" . addslashes($_POST[$label_id[$key] . "_element_title" . $id]) . "')
|
1381 |
+
{ document.getElementById('" . $label_id[$key] . "_element_title" . $id . "').value='" . addslashes($_POST[$label_id[$key] . "_element_title" . $id]) . "';
|
1382 |
+
document.getElementById('" . $label_id[$key] . "_element_title" . $id . "').className='input_active';
|
1383 |
}
|
1384 |
|
1385 |
+
if(document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').title!='" . addslashes($_POST[$label_id[$key] . "_element_first" . $id]) . "')
|
1386 |
+
{ document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').value='" . addslashes($_POST[$label_id[$key] . "_element_first" . $id]) . "';
|
1387 |
+
document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').className='input_active';
|
1388 |
}
|
1389 |
|
1390 |
+
if(document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').title!='" . addslashes($_POST[$label_id[$key] . "_element_last" . $id]) . "')
|
1391 |
+
{ document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').value='" . addslashes($_POST[$label_id[$key] . "_element_last" . $id]) . "';
|
1392 |
+
document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').className='input_active';
|
1393 |
}
|
1394 |
|
1395 |
+
if(document.getElementById('" . $label_id[$key] . "_element_middle" . $id . "').title!='" . addslashes($_POST[$label_id[$key] . "_element_middle" . $id]) . "')
|
1396 |
+
{ document.getElementById('" . $label_id[$key] . "_element_middle" . $id . "').value='" . addslashes($_POST[$label_id[$key] . "_element_middle" . $id]) . "';
|
1397 |
+
document.getElementById('" . $label_id[$key] . "_element_middle" . $id . "').className='input_active';
|
1398 |
}
|
1399 |
|
1400 |
}";
|
1401 |
+
}
|
1402 |
+
else {
|
1403 |
+
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_element_first" . $id . "'))
|
|
|
|
|
1404 |
{
|
1405 |
|
1406 |
+
if(document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').title!='" . addslashes($_POST[$label_id[$key] . "_element_first" . $id]) . "')
|
1407 |
+
{ document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').value='" . addslashes($_POST[$label_id[$key] . "_element_first" . $id]) . "';
|
1408 |
+
document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').className='input_active';
|
1409 |
}
|
1410 |
|
1411 |
+
if(document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').title!='" . addslashes($_POST[$label_id[$key] . "_element_last" . $id]) . "')
|
1412 |
+
{ document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').value='" . addslashes($_POST[$label_id[$key] . "_element_last" . $id]) . "';
|
1413 |
+
document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').className='input_active';
|
1414 |
}
|
1415 |
|
1416 |
}";
|
1417 |
+
}
|
1418 |
+
break;
|
1419 |
+
}
|
1420 |
+
case "type_phone":
|
1421 |
+
{
|
1422 |
+
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_element_first" . $id . "'))
|
|
|
|
|
1423 |
{
|
1424 |
+
if(document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').title!='" . addslashes($_POST[$label_id[$key] . "_element_first" . $id]) . "')
|
1425 |
+
{ document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').value='" . addslashes($_POST[$label_id[$key] . "_element_first" . $id]) . "';
|
1426 |
+
document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').className='input_active';
|
1427 |
}
|
1428 |
|
1429 |
+
if(document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').title!='" . addslashes($_POST[$label_id[$key] . "_element_last" . $id]) . "')
|
1430 |
+
{ document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').value='" . addslashes($_POST[$label_id[$key] . "_element_last" . $id]) . "';
|
1431 |
+
document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').className='input_active';
|
1432 |
}
|
1433 |
}";
|
1434 |
+
break;
|
1435 |
+
}
|
1436 |
+
case "type_address":
|
1437 |
+
{
|
1438 |
+
if ($key > $old_key) {
|
1439 |
+
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_street1" . $id . "'))
|
|
|
|
|
|
|
|
|
1440 |
{
|
1441 |
+
document.getElementById('" . $label_id[$key] . "_street1" . $id . "').value='" . addslashes($_POST[$label_id[$key] . "_street1" . $id]) . "';
|
1442 |
+
document.getElementById('" . $label_id[$key] . "_street2" . $id . "').value='" . addslashes($_POST[$label_id[$key + 1] . "_street2" . $id]) . "';
|
1443 |
+
document.getElementById('" . $label_id[$key] . "_city" . $id . "').value='" . addslashes($_POST[$label_id[$key + 2] . "_city" . $id]) . "';
|
1444 |
+
document.getElementById('" . $label_id[$key] . "_state" . $id . "').value='" . addslashes($_POST[$label_id[$key + 3] . "_state" . $id]) . "';
|
1445 |
+
document.getElementById('" . $label_id[$key] . "_postal" . $id . "').value='" . addslashes($_POST[$label_id[$key + 4] . "_postal" . $id]) . "';
|
1446 |
+
document.getElementById('" . $label_id[$key] . "_country" . $id . "').value='" . addslashes($_POST[$label_id[$key + 5] . "_country" . $id]) . "';
|
1447 |
|
1448 |
}";
|
1449 |
+
$old_key = $key + 5;
|
1450 |
+
}
|
1451 |
+
break;
|
1452 |
+
}
|
1453 |
+
case "type_checkbox":
|
1454 |
+
{
|
1455 |
+
$is_other = FALSE;
|
1456 |
+
if ($_POST[$label_id[$key] . "_allow_other" . $id] == "yes") {
|
1457 |
+
$other_element = $_POST[$label_id[$key] . "_other_input" . $id];
|
1458 |
+
$other_element_id = $_POST[$label_id[$key] . "_allow_other_num" . $id];
|
1459 |
+
if (isset($_POST[$label_id[$key] . "_allow_other_num" . $id]))
|
1460 |
+
$is_other = TRUE;
|
1461 |
+
}
|
1462 |
+
$form_maker_front_end .= "
|
1463 |
+
if(document.getElementById('" . $label_id[$key] . "_other_input" . $id . "'))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1464 |
{
|
1465 |
+
document.getElementById('" . $label_id[$key] . "_other_input" . $id . "').parentNode.removeChild(document.getElementById('" . $label_id[$key] . "_other_br" . $id . "'));
|
1466 |
+
document.getElementById('" . $label_id[$key] . "_other_input" . $id . "').parentNode.removeChild(document.getElementById('" . $label_id[$key] . "_other_input" . $id . "'));
|
1467 |
}
|
1468 |
for(k=0; k<30; k++)
|
1469 |
+
if(document.getElementById('" . $label_id[$key] . "_element" . $id . "'+k))
|
1470 |
+
document.getElementById('" . $label_id[$key] . "_element" . $id . "'+k).removeAttribute('checked');
|
1471 |
else break;
|
1472 |
";
|
1473 |
+
for ($j = 0; $j < 100; $j++) {
|
1474 |
+
$element = $_POST[$label_id[$key] . "_element" . $id . $j];
|
1475 |
+
if (isset($_POST[$label_id[$key] . "_element" . $id . $j])) {
|
1476 |
+
$form_maker_front_end .= "document.getElementById('" . $label_id[$key] . "_element" . $id . $j . "').setAttribute('checked', 'checked');
|
|
|
|
|
|
|
1477 |
";
|
1478 |
+
}
|
1479 |
+
}
|
1480 |
+
if ($is_other)
|
1481 |
+
$form_maker_front_end .= "
|
1482 |
+
show_other_input('" . $label_id[$key] . "','" . $id . "');
|
1483 |
+
document.getElementById('" . $label_id[$key] . "_other_input" . $id . "').value='" . $_POST[$label_id[$key] . "_other_input" . $id] . "';
|
|
|
|
|
1484 |
";
|
1485 |
+
break;
|
1486 |
+
}
|
1487 |
+
case "type_radio":
|
1488 |
+
{
|
1489 |
+
$is_other = FALSE;
|
1490 |
+
if ($_POST[$label_id[$key] . "_allow_other" . $id] == "yes") {
|
1491 |
+
$other_element = $_POST[$label_id[$key] . "_other_input" . $id];
|
1492 |
+
if (isset($_POST[$label_id[$key] . "_other_input" . $id]))
|
1493 |
+
$is_other = TRUE;
|
1494 |
+
}
|
1495 |
+
$form_maker_front_end .= "
|
1496 |
+
if(document.getElementById('" . $label_id[$key] . "_other_input" . $id . "'))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1497 |
{
|
1498 |
+
document.getElementById('" . $label_id[$key] . "_other_input" . $id . "').parentNode.removeChild(document.getElementById('" . $label_id[$key] . "_other_br" . $id . "'));
|
1499 |
+
document.getElementById('" . $label_id[$key] . "_other_input" . $id . "').parentNode.removeChild(document.getElementById('" . $label_id[$key] . "_other_input" . $id . "'));
|
1500 |
}
|
1501 |
|
1502 |
for(k=0; k<50; k++)
|
1503 |
+
if(document.getElementById('" . $label_id[$key] . "_element" . $id . "'+k))
|
1504 |
{
|
1505 |
+
document.getElementById('" . $label_id[$key] . "_element" . $id . "'+k).removeAttribute('checked');
|
1506 |
+
if(document.getElementById('" . $label_id[$key] . "_element" . $id . "'+k).value=='" . addslashes($_POST[$label_id[$key] . "_element" . $id]) . "')
|
1507 |
{
|
1508 |
+
document.getElementById('" . $label_id[$key] . "_element" . $id . "'+k).setAttribute('checked', 'checked');
|
1509 |
|
1510 |
}
|
1511 |
}
|
1512 |
else break;
|
1513 |
";
|
1514 |
+
if ($is_other)
|
1515 |
+
$form_maker_front_end .= "
|
1516 |
+
show_other_input('" . $label_id[$key] . "','" . $id . "');
|
1517 |
+
document.getElementById('" . $label_id[$key] . "_other_input" . $id . "').value='" . $_POST[$label_id[$key] . "_other_input" . $id] . "';
|
|
|
1518 |
";
|
1519 |
+
break;
|
1520 |
+
}
|
1521 |
+
case "type_time":
|
1522 |
+
{
|
1523 |
+
$ss = $_POST[$label_id[$key] . "_ss" . $id];
|
1524 |
+
if (isset($_POST[$label_id[$key] . "_ss" . $id])) {
|
1525 |
+
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_hh" . $id . "'))
|
|
|
|
|
|
|
1526 |
{
|
1527 |
+
document.getElementById('" . $label_id[$key] . "_hh" . $id . "').value='" . $_POST[$label_id[$key] . "_hh" . $id] . "';
|
1528 |
+
document.getElementById('" . $label_id[$key] . "_mm" . $id . "').value='" . $_POST[$label_id[$key] . "_mm" . $id] . "';
|
1529 |
+
document.getElementById('" . $label_id[$key] . "_ss" . $id . "').value='" . $_POST[$label_id[$key] . "_ss" . $id] . "';
|
1530 |
}";
|
1531 |
+
}
|
1532 |
+
else {
|
1533 |
+
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_hh" . $id . "'))
|
|
|
|
|
1534 |
{
|
1535 |
+
document.getElementById('" . $label_id[$key] . "_hh" . $id . "').value='" . $_POST[$label_id[$key] . "_hh" . $id] . "';
|
1536 |
+
document.getElementById('" . $label_id[$key] . "_mm" . $id . "').value='" . $_POST[$label_id[$key] . "_mm" . $id] . "';
|
1537 |
}";
|
1538 |
+
}
|
1539 |
+
$am_pm = $_POST[$label_id[$key] . "_am_pm" . $id];
|
1540 |
+
if (isset($am_pm))
|
1541 |
+
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_am_pm" . $id . "'))
|
1542 |
+
document.getElementById('" . $label_id[$key] . "_am_pm" . $id . "').value='" . $_POST[$label_id[$key] . "_am_pm" . $id] . "';
|
|
|
1543 |
";
|
1544 |
+
break;
|
1545 |
+
}
|
1546 |
+
case "type_date_fields":
|
1547 |
+
{
|
1548 |
+
$date_fields = explode('-', $_POST[$label_id[$key] . "_element" . $id]);
|
1549 |
+
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_day" . $id . "'))
|
|
|
|
|
1550 |
{
|
1551 |
+
document.getElementById('" . $label_id[$key] . "_day" . $id . "').value='" . $date_fields[0] . "';
|
1552 |
+
document.getElementById('" . $label_id[$key] . "_month" . $id . "').value='" . $date_fields[1] . "';
|
1553 |
+
document.getElementById('" . $label_id[$key] . "_year" . $id . "').value='" . $date_fields[2] . "';
|
1554 |
}";
|
1555 |
+
break;
|
1556 |
+
}
|
1557 |
+
case "type_date":
|
1558 |
+
case "type_own_select":
|
1559 |
+
case "type_country":
|
1560 |
+
{
|
1561 |
+
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_element" . $id . "'))
|
1562 |
+
document.getElementById('" . $label_id[$key] . "_element" . $id . "').value='" . addslashes($_POST[$label_id[$key] . "_element" . $id]) . "';
|
|
|
1563 |
";
|
1564 |
+
break;
|
1565 |
+
}
|
1566 |
+
default:
|
1567 |
+
{
|
1568 |
+
break;
|
1569 |
+
}
|
1570 |
+
}
|
1571 |
+
}
|
1572 |
+
}
|
1573 |
+
$form_maker_front_end .= ' form_view_count' . $id . '=0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1574 |
for(i=1; i<=30; i++)
|
1575 |
{
|
1576 |
+
if(document.getElementById(\'' . $id . 'form_view\'+i))
|
1577 |
{
|
1578 |
+
form_view_count' . $id . '++;
|
1579 |
+
form_view_max' . $id . '=i;
|
1580 |
+
document.getElementById(\'' . $id . 'form_view\'+i).parentNode.removeAttribute(\'style\');
|
1581 |
}
|
1582 |
}
|
1583 |
+
if(form_view_count' . $id . '>1)
|
1584 |
{
|
1585 |
+
for(i=1; i<=form_view_max' . $id . '; i++)
|
1586 |
{
|
1587 |
+
if(document.getElementById(\'' . $id . 'form_view\'+i))
|
1588 |
{
|
1589 |
+
first_form_view' . $id . '=i;
|
1590 |
break;
|
1591 |
}
|
1592 |
}
|
1593 |
+
generate_page_nav(first_form_view' . $id . ', \'' . $id . '\', form_view_count' . $id . ', form_view_max' . $id . ');
|
1594 |
}
|
1595 |
var RecaptchaOptions = {
|
1596 |
+
theme: "' . $row->recaptcha_theme . '"
|
1597 |
};
|
1598 |
</script>
|
1599 |
</form></div>';
|
1600 |
+
if ($is_recaptcha) {
|
1601 |
+
$form_maker_front_end .= '<div id="main_recaptcha" style="display:none;">';
|
1602 |
+
// Get a key from https://www.google.com/recaptcha/admin/create
|
1603 |
+
if ($row->public_key)
|
1604 |
+
$publickey = $row->public_key;
|
1605 |
+
else
|
1606 |
+
$publickey = '0';
|
1607 |
+
$error = NULL;
|
1608 |
+
$form_maker_front_end .= recaptcha_get_html($publickey, $error);
|
1609 |
+
$form_maker_front_end .= '</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1610 |
<script>
|
1611 |
recaptcha_html=document.getElementById(\'main_recaptcha\').innerHTML.replace(\'Recaptcha.widget = Recaptcha.$("recaptcha_widget_div"); Recaptcha.challenge_callback();\',"");
|
1612 |
document.getElementById(\'main_recaptcha\').innerHTML="";
|
1613 |
+
if(document.getElementById(\'wd_recaptcha' . $id . '\'))
|
1614 |
+
document.getElementById(\'wd_recaptcha' . $id . '\').innerHTML=recaptcha_html;
|
1615 |
+
Recaptcha.widget = Recaptcha.$("recaptcha_widget_div");
|
1616 |
+
Recaptcha.challenge_callback();
|
1617 |
</script>';
|
1618 |
+
}
|
1619 |
+
}
|
1620 |
+
else {
|
1621 |
+
$form_maker_front_end .= '<script type="text/javascript">' . str_replace("
|
1622 |
+
", " ", $row->javascript) . '</script>';
|
1623 |
+
$form_maker_front_end .= '<style>' . str_replace('[SITE_ROOT]', plugins_url("", __FILE__), str_replace('.wdform_table1', '.form_view', str_replace("
|
1624 |
+
", " ", $form_theme))) . '</style>';
|
1625 |
+
$form_maker_front_end .= "<form name=\"form\" action=\"" . $_SERVER['REQUEST_URI'] . "\" method=\"post\" id=\"form\" enctype=\"multipart/form-data\">
|
1626 |
+
<input type=\"hidden\" id=\"counter\" value=\"" . $row->counter . "\" name=\"counter\" />";
|
1627 |
+
$captcha_url = plugins_url("wd_captcha.php", __FILE__) . '?digit=';
|
1628 |
+
$captcha_rep_url = plugins_url("wd_captcha.php", __FILE__) . '?r2=' . mt_rand(0, 1000) . '&digit=';
|
1629 |
+
$rep1 = array(
|
1630 |
+
"<!--repstart-->Title<!--repend-->",
|
1631 |
+
"<!--repstart-->First<!--repend-->",
|
1632 |
+
"<!--repstart-->Last<!--repend-->",
|
1633 |
+
"<!--repstart-->Middle<!--repend-->",
|
1634 |
+
"<!--repstart-->January<!--repend-->",
|
1635 |
+
"<!--repstart-->February<!--repend-->",
|
1636 |
+
"<!--repstart-->March<!--repend-->",
|
1637 |
+
"<!--repstart-->April<!--repend-->",
|
1638 |
+
"<!--repstart-->May<!--repend-->",
|
1639 |
+
"<!--repstart-->June<!--repend-->",
|
1640 |
+
"<!--repstart-->July<!--repend-->",
|
1641 |
+
"<!--repstart-->August<!--repend-->",
|
1642 |
+
"<!--repstart-->September<!--repend-->",
|
1643 |
+
"<!--repstart-->October<!--repend-->",
|
1644 |
+
"<!--repstart-->November<!--repend-->",
|
1645 |
+
"<!--repstart-->December<!--repend-->",
|
1646 |
+
$captcha_url,
|
1647 |
+
'class="captcha_img"',
|
1648 |
+
plugins_url('images/refresh.png', __FILE__),
|
1649 |
+
plugins_url('images/delete_el.png', __FILE__),
|
1650 |
+
plugins_url('images/up.png', __FILE__),
|
1651 |
+
plugins_url('images/down.png', __FILE__),
|
1652 |
+
plugins_url('images/left.png', __FILE__),
|
1653 |
+
plugins_url('images/right.png', __FILE__),
|
1654 |
+
plugins_url('images/edit.png', __FILE__)
|
1655 |
+
);
|
1656 |
+
$rep2 = array(
|
1657 |
+
addslashes(__("Title", "form_maker")),
|
1658 |
+
addslashes(__("First", "form_maker")),
|
1659 |
+
addslashes(__("Last", "form_maker")),
|
1660 |
+
addslashes(__("Middle", "form_maker")),
|
1661 |
+
addslashes(__("January", "form_maker")),
|
1662 |
+
addslashes(__("February", "form_maker")),
|
1663 |
+
addslashes(__("March", "form_maker")),
|
1664 |
+
addslashes(__("April", "form_maker")),
|
1665 |
+
addslashes(__("May", "form_maker")),
|
1666 |
+
addslashes(__("June", "form_maker")),
|
1667 |
+
addslashes(__("July", "form_maker")),
|
1668 |
+
addslashes(__("August", "form_maker")),
|
1669 |
+
addslashes(__("September", "form_maker")),
|
1670 |
+
addslashes(__("October", "form_maker")),
|
1671 |
+
addslashes(__("November", "form_maker")),
|
1672 |
+
addslashes(__("December", "form_maker")),
|
1673 |
+
$captcha_rep_url,
|
1674 |
+
'class="captcha_img" style="display:none"',
|
1675 |
+
plugins_url('images/refresh.png', __FILE__),
|
1676 |
+
'',
|
1677 |
+
'',
|
1678 |
+
'',
|
1679 |
+
'',
|
1680 |
+
'',
|
1681 |
+
''
|
1682 |
+
);
|
1683 |
+
$untilupload = str_replace($rep1, $rep2, $row->form);
|
1684 |
+
while (strpos($untilupload, "***destinationskizb") > 0) {
|
1685 |
+
$pos1 = strpos($untilupload, "***destinationskizb");
|
1686 |
+
$pos2 = strpos($untilupload, "***destinationverj");
|
1687 |
+
$untilupload = str_replace(substr($untilupload, $pos1, $pos2 - $pos1 + 22), "", $untilupload);
|
1688 |
+
}
|
1689 |
+
$form_maker_front_end .= $untilupload;
|
1690 |
+
$form_maker_front_end .= "<script type=\"text/javascript\">
|
|
|
|
|
|
|
|
|
1691 |
function formOnload()
|
1692 |
{
|
1693 |
if(document.getElementById(\"wd_captcha_input\"))
|
1694 |
captcha_refresh('wd_captcha');
|
1695 |
+
for(t=0; t<" . $row->counter . "; t++)
|
1696 |
if(document.getElementById(t+\"_type\"))
|
1697 |
if(document.getElementById(t+\"_type\").value==\"type_map\")
|
1698 |
if_gmap_init(t+\"_element\", false);
|
1709 |
}
|
1710 |
var formOldFunctionOnLoad = null;
|
1711 |
formLoadBody();
|
1712 |
+
";
|
1713 |
+
if (isset($_POST["captcha_input"])) {
|
1714 |
+
$captcha_input = esc_html($_POST["captcha_input"]);
|
1715 |
+
}
|
1716 |
+
if (isset($_POST["counter"])) {
|
1717 |
+
$counter = (int)$_POST["counter"];
|
1718 |
+
}
|
1719 |
+
if (isset($counter))
|
1720 |
+
if (isset($_POST["captcha_input"]) or is_numeric($ok)) {
|
1721 |
+
$captcha_input = esc_html($_POST["captcha_input"]);
|
1722 |
+
$session_wd_captcha_code = isset($_SESSION['wd_captcha_code']) ? $_SESSION['wd_captcha_code'] : '-';
|
1723 |
+
if ($captcha_input != $session_wd_captcha_code or is_numeric($ok)) {
|
1724 |
+
for ($i = 0; $i < $counter; $i++) {
|
1725 |
+
if (isset($_POST[$i . "_type"])) {
|
1726 |
+
$type = $_POST[$i . "_type"];
|
1727 |
+
}
|
1728 |
+
if (isset($_POST[$i . "_type"])) {
|
1729 |
+
switch ($type) {
|
1730 |
+
case "type_text":
|
1731 |
+
case "type_submitter_mail":
|
1732 |
+
{
|
1733 |
+
$form_maker_front_end .= "if(document.getElementById('" . $i . "_element" . "').title!='" . addslashes($_POST[$i . "_element"]) . "')
|
1734 |
+
{ document.getElementById('" . $i . "_element" . "').value='" . addslashes($_POST[$i . "_element"]) . "';
|
1735 |
+
document.getElementById('" . $i . "_element" . "').style.color='#000000';
|
1736 |
+
document.getElementById('" . $i . "_element" . "').style.fontStyle='normal !important';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1737 |
}
|
1738 |
";
|
1739 |
+
break;
|
1740 |
+
}
|
1741 |
+
case "type_textarea":
|
1742 |
+
{
|
1743 |
+
$form_maker_front_end .= "if(document.getElementById('" . $i . "_element" . "').title!='" . addslashes($_POST[$i . "_element"]) . "')
|
1744 |
+
{ document.getElementById('" . $i . "_element" . "').innerHTML='" . addslashes($_POST[$i . "_element"]) . "';
|
1745 |
+
document.getElementById('" . $i . "_element" . "').style.color='#000000';
|
1746 |
+
document.getElementById('" . $i . "_element" . "').style.fontStyle='normal';
|
|
|
1747 |
}
|
1748 |
";
|
1749 |
+
break;
|
1750 |
+
}
|
1751 |
+
case "type_password":
|
1752 |
+
{
|
1753 |
+
$form_maker_front_end .= "document.getElementById('" . $i . "_element" . "').value='';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1754 |
";
|
1755 |
+
break;
|
1756 |
+
}
|
1757 |
+
case "type_name":
|
1758 |
+
{
|
1759 |
+
if (isset($_POST[$i . "_element_title"])) {
|
1760 |
+
$form_maker_front_end .= "document.getElementById('" . $i . "_element_title" . "').value='" . addslashes($_POST[$i . "_element_title"]) . "';
|
1761 |
+
document.getElementById('" . $i . "_element_first" . "').value='" . addslashes($_POST[$i . "_element_first"]) . "';
|
1762 |
+
document.getElementById('" . $i . "_element_last" . "').value='" . addslashes($_POST[$i . "_element_last"]) . "';
|
1763 |
+
document.getElementById('" . $i . "_element_middle" . "').value='" . addslashes($_POST[$i . "_element_middle"]) . "';
|
1764 |
+
";
|
1765 |
+
}
|
1766 |
+
else {
|
1767 |
+
$form_maker_front_end .= "document.getElementById('" . $i . "_element_first" . "').value='" . addslashes($_POST[$i . "_element_first"]) . "';
|
1768 |
+
document.getElementById('" . $i . "_element_last" . "').value='" . addslashes($_POST[$i . "_element_last"]) . "';
|
1769 |
+
";
|
1770 |
+
}
|
1771 |
+
break;
|
1772 |
+
}
|
1773 |
+
case "type_checkbox":
|
1774 |
+
{
|
1775 |
+
$form_maker_front_end .= "for(k=0; k<20; k++)
|
1776 |
+
if(document.getElementById('" . $i . "_element'+k))
|
1777 |
+
document.getElementById('" . $i . "_element'+k).removeAttribute('checked');
|
1778 |
+
else break; ";
|
1779 |
+
for ($j = 0; $j < 100; $j++) {
|
1780 |
+
if (isset($_POST[$i . "_element" . $j])) {
|
1781 |
+
$form_maker_front_end .= "document.getElementById('" . $i . "_element" . $j . "').setAttribute('checked', 'checked');
|
1782 |
+
";
|
1783 |
+
}
|
1784 |
+
}
|
1785 |
+
break;
|
1786 |
+
}
|
1787 |
+
case "type_radio":
|
1788 |
+
{
|
1789 |
+
$form_maker_front_end .= "for(k=0; k<100; k++)
|
1790 |
+
if(document.getElementById('" . $i . "_element'+k))
|
1791 |
{
|
1792 |
+
document.getElementById('" . $i . "_element'+k).removeAttribute('checked');
|
1793 |
+
if(document.getElementById('" . $i . "_element'+k).value=='" . addslashes($_POST[$i . "_element"]) . "')
|
1794 |
+
document.getElementById('" . $i . "_element'+k).setAttribute('checked', 'checked');
|
1795 |
}
|
1796 |
else break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1797 |
";
|
1798 |
+
break;
|
1799 |
+
}
|
1800 |
+
case "type_time":
|
1801 |
+
{
|
1802 |
+
if (isset($_POST[$i . "_ss"])) {
|
1803 |
+
$form_maker_front_end .= "document.getElementById('" . $i . "_hh" . "').value='" . $_POST[$i . "_hh"] . "';
|
1804 |
+
document.getElementById('" . $i . "_mm" . "').value='" . $_POST[$i . "_mm"] . "';
|
1805 |
+
document.getElementById('" . $i . "_ss" . "').value='" . $_POST[$i . "_ss"] . "';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1806 |
";
|
1807 |
+
}
|
1808 |
+
else {
|
1809 |
+
$form_maker_front_end .= "document.getElementById('" . $i . "_hh" . "').value='" . $_POST[$i . "_hh"] . "';
|
1810 |
+
document.getElementById('" . $i . "_mm" . "').value='" . $_POST[$i . "_mm"] . "';
|
1811 |
+
";
|
1812 |
+
}
|
1813 |
+
if (isset($_POST[$i . "_am_pm"]))
|
1814 |
+
$form_maker_front_end .= "document.getElementById('" . $i . "_am_pm').value='" . $_POST[$i . "_am_pm"] . "';
|
1815 |
+
";
|
1816 |
+
break;
|
1817 |
+
}
|
1818 |
+
case "type_date":
|
1819 |
+
{
|
1820 |
+
$form_maker_front_end .= "document.getElementById('" . $i . "_element" . "').value='" . $_POST[$i . "_element"] . "';
|
1821 |
+
";
|
1822 |
+
break;
|
1823 |
+
}
|
1824 |
+
case "type_date_fields":
|
1825 |
+
{
|
1826 |
+
$date_fields = explode('-', $_POST[$i . "_element"]);
|
1827 |
+
$form_maker_front_end .= "document.getElementById('" . $i . "_day" . "').value='" . $date_fields[0] . "';
|
1828 |
+
document.getElementById('" . $i . "_month" . "').value='" . $date_fields[1] . "';
|
1829 |
+
document.getElementById('" . $i . "_year" . "').value='" . $date_fields[2] . "';
|
1830 |
+
";
|
1831 |
+
break;
|
1832 |
+
}
|
1833 |
+
case "type_country":
|
1834 |
+
{
|
1835 |
+
$form_maker_front_end .= "document.getElementById('" . $i . "_element').value='" . addslashes($_POST[$i . "_element"]) . "';
|
1836 |
+
";
|
1837 |
+
break;
|
1838 |
+
}
|
1839 |
+
case "type_own_select":
|
1840 |
+
{
|
1841 |
+
$form_maker_front_end .= "document.getElementById('" . $i . "_element').value='" . addslashes($_POST[$i . "_element"]) . "';
|
1842 |
+
";
|
1843 |
+
break;
|
1844 |
+
}
|
1845 |
+
case "type_file":
|
1846 |
+
{
|
1847 |
+
break;
|
1848 |
+
}
|
1849 |
+
}
|
1850 |
+
}
|
1851 |
+
}
|
1852 |
+
}
|
1853 |
+
}
|
1854 |
+
$form_maker_front_end .= "n=" . $row->counter . ";
|
1855 |
for(i=0; i<n; i++)
|
1856 |
{
|
1857 |
if(document.getElementById(i))
|
2020 |
if(year<from)
|
2021 |
{
|
2022 |
document.getElementById(id).value='';
|
2023 |
+
alert('" . addslashes(__('The value of year is not valid', 'form_maker')) . "');
|
2024 |
}
|
2025 |
}
|
2026 |
function remove_add_(id)
|
2071 |
window.location.reload( true );
|
2072 |
return;
|
2073 |
}
|
2074 |
+
n=" . $row->counter . ";
|
2075 |
ext_available=true;
|
2076 |
seted=true;
|
2077 |
for(i=0; i<=n; i++)
|
2182 |
else
|
2183 |
{
|
2184 |
if(!ext_available)
|
2185 |
+
{alert('" . addslashes(__('Sorry, you are not allowed to upload this type of file', 'form_maker')) . "');
|
2186 |
break;}
|
2187 |
x=document.getElementById(i-1+'_element_label');
|
2188 |
while(x.firstChild)
|
2189 |
{
|
2190 |
x=x.firstChild;
|
2191 |
}
|
2192 |
+
alert(x.nodeValue+' " . addslashes(__('field is required', 'form_maker')) . "');
|
2193 |
break;
|
2194 |
}
|
2195 |
}
|
2199 |
if(document.getElementById(i))
|
2200 |
if(document.getElementById(i).getAttribute(\"type\")==\"type_submitter_mail\")
|
2201 |
if (document.getElementById(i+\"_element\").value!='') if(document.getElementById(i+\"_element\").value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1)
|
2202 |
+
{ alert( \"" . addslashes(__('This is not a valid email address', 'form_maker')) . "\" );
|
2203 |
return;
|
2204 |
}
|
2205 |
}
|
2208 |
}
|
2209 |
function create_headers()
|
2210 |
{ form_=document.getElementById('form');
|
2211 |
+
n=" . $row->counter . ";
|
2212 |
for(i=0; i<n; i++)
|
2213 |
{ if(document.getElementById(i))
|
2214 |
{if(document.getElementById(i).getAttribute(\"type\")!=\"type_map\")
|
2234 |
}
|
2235 |
</script>
|
2236 |
</form></div>";
|
2237 |
+
}
|
2238 |
+
return $form_maker_front_end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2239 |
}
|
2240 |
|
2241 |
|
generate_csv.php
DELETED
@@ -1,234 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
/**
|
5 |
-
* @package Form Maker
|
6 |
-
* @author Web-Dorado
|
7 |
-
* @copyright (C) 2011 Web-Dorado. All rights reserved.
|
8 |
-
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
-
**/
|
10 |
-
|
11 |
-
// Direct access must be allowed
|
12 |
-
|
13 |
-
$path = ''; // It should be end with a trailing slash
|
14 |
-
if ( !defined('WP_LOAD_PATH') ) {
|
15 |
-
|
16 |
-
/** classic root path if wp-content and plugins is below wp-config.php */
|
17 |
-
$classic_root = dirname(dirname(dirname(dirname(__FILE__)))) . '/' ;
|
18 |
-
|
19 |
-
if (file_exists( $classic_root . 'wp-load.php') )
|
20 |
-
define( 'WP_LOAD_PATH', $classic_root);
|
21 |
-
else
|
22 |
-
if (file_exists( $path . 'wp-load.php') )
|
23 |
-
define( 'WP_LOAD_PATH', $path);
|
24 |
-
else
|
25 |
-
exit("Could not find wp-load.php");
|
26 |
-
}
|
27 |
-
|
28 |
-
// let's load WordPress
|
29 |
-
require_once( WP_LOAD_PATH . 'wp-load.php');
|
30 |
-
|
31 |
-
global $wpdb;
|
32 |
-
|
33 |
-
$form_id=$_REQUEST['form_id'];
|
34 |
-
|
35 |
-
|
36 |
-
$query = $wpdb->prepare("SELECT * FROM ".$wpdb->prefix."formmaker_submits where form_id= %d",$form_id);
|
37 |
-
|
38 |
-
$rows = $wpdb->get_results($query);
|
39 |
-
|
40 |
-
$n=count($rows);
|
41 |
-
|
42 |
-
$labels= array();
|
43 |
-
for($i=0; $i < $n ; $i++)
|
44 |
-
|
45 |
-
{
|
46 |
-
$row = &$rows[$i];
|
47 |
-
if(!in_array($row->element_label, $labels))
|
48 |
-
{
|
49 |
-
array_push($labels, $row->element_label);
|
50 |
-
}
|
51 |
-
}
|
52 |
-
$label_titles=array();
|
53 |
-
$sorted_labels= array();
|
54 |
-
|
55 |
-
$query_lable = $wpdb->prepare("SELECT label_order,title FROM ".$wpdb->prefix."formmaker where id= %d",$form_id);
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
$rows_lable = $wpdb->get_results($query_lable);
|
60 |
-
$ptn = "/[^a-zA-Z0-9_]/";
|
61 |
-
$rpltxt = "";
|
62 |
-
|
63 |
-
|
64 |
-
$title=preg_replace($ptn, $rpltxt, $rows_lable[0]->title);
|
65 |
-
|
66 |
-
$sorted_labels_id= array();
|
67 |
-
$sorted_labels= array();
|
68 |
-
$label_titles=array();
|
69 |
-
if($labels)
|
70 |
-
{
|
71 |
-
|
72 |
-
$label_id= array();
|
73 |
-
$label_order= array();
|
74 |
-
$label_order_original= array();
|
75 |
-
$label_type= array();
|
76 |
-
|
77 |
-
///stexic
|
78 |
-
$label_all = explode('#****#',$rows_lable[0]->label_order);
|
79 |
-
$label_all = array_slice($label_all,0, count($label_all)-1);
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
foreach($label_all as $key => $label_each)
|
84 |
-
{
|
85 |
-
$label_id_each=explode('#**id**#',$label_each);
|
86 |
-
array_push($label_id, $label_id_each[0]);
|
87 |
-
|
88 |
-
$label_oder_each=explode('#**label**#', $label_id_each[1]);
|
89 |
-
|
90 |
-
array_push($label_order_original, $label_oder_each[0]);
|
91 |
-
|
92 |
-
$ptn = "/[^a-zA-Z0-9_]/";
|
93 |
-
$rpltxt = "";
|
94 |
-
$label_temp=preg_replace($ptn, $rpltxt, $label_oder_each[0]);
|
95 |
-
array_push($label_order, $label_temp);
|
96 |
-
|
97 |
-
array_push($label_type, $label_oder_each[1]);
|
98 |
-
|
99 |
-
|
100 |
-
//echo $label."<br>";
|
101 |
-
|
102 |
-
}
|
103 |
-
|
104 |
-
foreach($label_id as $key => $label)
|
105 |
-
if(in_array($label, $labels))
|
106 |
-
{
|
107 |
-
array_push($sorted_labels, $label_order[$key]);
|
108 |
-
array_push($sorted_labels_id, $label);
|
109 |
-
array_push($label_titles, $label_order_original[$key]);
|
110 |
-
}
|
111 |
-
|
112 |
-
|
113 |
-
}
|
114 |
-
|
115 |
-
$m=count($sorted_labels);
|
116 |
-
$group_id_s= array();
|
117 |
-
$l=0;
|
118 |
-
|
119 |
-
|
120 |
-
if(count($rows)>0 and $m)
|
121 |
-
for($i=0; $i <count($rows) ; $i++)
|
122 |
-
{
|
123 |
-
|
124 |
-
$row = &$rows[$i];
|
125 |
-
|
126 |
-
if(!in_array($row->group_id, $group_id_s))
|
127 |
-
{
|
128 |
-
|
129 |
-
array_push($group_id_s, $row->group_id);
|
130 |
-
|
131 |
-
}
|
132 |
-
}
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
$data=array();
|
137 |
-
|
138 |
-
|
139 |
-
for($www=0; $www < count($group_id_s); $www++)
|
140 |
-
{
|
141 |
-
$i=$group_id_s[$www];
|
142 |
-
|
143 |
-
$temp= array();
|
144 |
-
for($j=0; $j < $n ; $j++)
|
145 |
-
{
|
146 |
-
|
147 |
-
$row = &$rows[$j];
|
148 |
-
|
149 |
-
if($row->group_id==$i)
|
150 |
-
{
|
151 |
-
|
152 |
-
array_push($temp, $row);
|
153 |
-
}
|
154 |
-
}
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
$f=$temp[0];
|
159 |
-
$date=$f->date;
|
160 |
-
$ip=$f->ip;
|
161 |
-
$data_temp['Submit date']=$date;
|
162 |
-
$data_temp['Ip']=$ip;
|
163 |
-
|
164 |
-
|
165 |
-
$ttt=count($temp);
|
166 |
-
|
167 |
-
// var_dump($temp);
|
168 |
-
for($h=0; $h < $m ; $h++)
|
169 |
-
{
|
170 |
-
|
171 |
-
for($g=0; $g < $ttt ; $g++)
|
172 |
-
{
|
173 |
-
$t = $temp[$g];
|
174 |
-
if($t->element_label==$sorted_labels_id[$h])
|
175 |
-
{
|
176 |
-
if(strpos($t->element_value,"*@@url@@*"))
|
177 |
-
{
|
178 |
-
$new_file=str_replace("*@@url@@*",'', $t->element_value);
|
179 |
-
$new_filename=explode('/', $new_file);
|
180 |
-
$data_temp[$label_titles[$h]]=$new_file;
|
181 |
-
}
|
182 |
-
else
|
183 |
-
if(strpos($t->element_value,"***br***"))
|
184 |
-
{
|
185 |
-
$data_temp[$label_titles[$h]]= substr(str_replace("***br***",', ', $t->element_value), 0, -2);
|
186 |
-
}
|
187 |
-
else
|
188 |
-
if(strpos($t->element_value,"***map***"))
|
189 |
-
{
|
190 |
-
$data_temp[$label_titles[$h]]= 'Longitude:'.substr(str_replace("***map***",', Latitude:', $t->element_value), 0, -2);
|
191 |
-
}
|
192 |
-
else
|
193 |
-
$data_temp[$label_titles[$h]]=$t->element_value;
|
194 |
-
}
|
195 |
-
}
|
196 |
-
|
197 |
-
|
198 |
-
}
|
199 |
-
$data[]=$data_temp;
|
200 |
-
}
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
function cleanData(&$str)
|
206 |
-
{
|
207 |
-
$str = preg_replace("/\t/", "\\t", $str);
|
208 |
-
$str = preg_replace("/\r?\n/", "\\n", $str);
|
209 |
-
if(strstr($str, '"')) $str = '"' . str_replace('"', '""', $str) . '"';
|
210 |
-
}
|
211 |
-
|
212 |
-
// file name for download
|
213 |
-
$filename = $title."_" . date('Ymd') . ".csv";
|
214 |
-
|
215 |
-
header("Content-type:application/csv; charset='utf-8'");
|
216 |
-
header("Content-Disposition: attachment; filename=\"$filename\"");
|
217 |
-
echo chr(239).chr(187).chr(191);
|
218 |
-
|
219 |
-
|
220 |
-
$flag = false;
|
221 |
-
foreach($data as $row) {
|
222 |
-
if(!$flag) {
|
223 |
-
# display field/column names as first row
|
224 |
-
echo '"'.implode('","', array_keys($row))."\"\r\n";
|
225 |
-
$flag = true;
|
226 |
-
}
|
227 |
-
array_walk($row, 'cleanData');
|
228 |
-
echo '"'.implode('","',array_values($row))."\"\r\n";
|
229 |
-
}
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
generate_xml.php
DELETED
@@ -1,458 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
/**
|
8 |
-
|
9 |
-
* @package Form Maker
|
10 |
-
|
11 |
-
* @author Web-Dorado
|
12 |
-
|
13 |
-
* @copyright (C) 2011 Web-Dorado. All rights reserved.
|
14 |
-
|
15 |
-
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
16 |
-
|
17 |
-
**/
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
// Direct access must be allowed
|
22 |
-
|
23 |
-
$path = ''; // It should be end with a trailing slash
|
24 |
-
if ( !defined('WP_LOAD_PATH') ) {
|
25 |
-
|
26 |
-
/** classic root path if wp-content and plugins is below wp-config.php */
|
27 |
-
$classic_root = dirname(dirname(dirname(dirname(__FILE__)))) . '/' ;
|
28 |
-
|
29 |
-
if (file_exists( $classic_root . 'wp-load.php') )
|
30 |
-
define( 'WP_LOAD_PATH', $classic_root);
|
31 |
-
else
|
32 |
-
if (file_exists( $path . 'wp-load.php') )
|
33 |
-
define( 'WP_LOAD_PATH', $path);
|
34 |
-
else
|
35 |
-
exit("Could not find wp-load.php");
|
36 |
-
}
|
37 |
-
|
38 |
-
// let's load WordPress
|
39 |
-
require_once( WP_LOAD_PATH . 'wp-load.php');
|
40 |
-
|
41 |
-
global $wpdb;
|
42 |
-
|
43 |
-
$form_id=$_REQUEST['form_id'];
|
44 |
-
|
45 |
-
|
46 |
-
$query = $wpdb->prepare("SELECT * FROM ".$wpdb->prefix."formmaker_submits where form_id= %d",$form_id);
|
47 |
-
|
48 |
-
$rows = $wpdb->get_results($query);
|
49 |
-
|
50 |
-
$n=count($rows);
|
51 |
-
|
52 |
-
$labels= array();
|
53 |
-
|
54 |
-
for($i=0; $i < $n ; $i++)
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
{
|
59 |
-
|
60 |
-
$row = &$rows[$i];
|
61 |
-
|
62 |
-
if(!in_array($row->element_label, $labels))
|
63 |
-
|
64 |
-
{
|
65 |
-
|
66 |
-
array_push($labels, $row->element_label);
|
67 |
-
|
68 |
-
}
|
69 |
-
|
70 |
-
}
|
71 |
-
|
72 |
-
$label_titles=array();
|
73 |
-
|
74 |
-
$sorted_labels= array();
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
$query_lable = "SELECT label_order,title FROM ".$wpdb->prefix."formmaker where id=$form_id ";
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
$rows_lable = $wpdb->get_results($query_lable);
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
$ptn = "/[^a-zA-Z0-9_]/";
|
88 |
-
|
89 |
-
$rpltxt = "";
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
$title=preg_replace($ptn, $rpltxt, $rows_lable[0]->title);
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
$sorted_labels_id= array();
|
100 |
-
|
101 |
-
$sorted_labels= array();
|
102 |
-
|
103 |
-
$label_titles=array();
|
104 |
-
|
105 |
-
if($labels)
|
106 |
-
|
107 |
-
{
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
$label_id= array();
|
112 |
-
|
113 |
-
$label_order= array();
|
114 |
-
|
115 |
-
$label_order_original= array();
|
116 |
-
|
117 |
-
$label_type= array();
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
///stexic
|
122 |
-
|
123 |
-
$label_all = explode('#****#',$rows_lable[0]->label_order);
|
124 |
-
|
125 |
-
$label_all = array_slice($label_all,0, count($label_all)-1);
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
foreach($label_all as $key => $label_each)
|
134 |
-
|
135 |
-
{
|
136 |
-
|
137 |
-
$label_id_each=explode('#**id**#',$label_each);
|
138 |
-
|
139 |
-
array_push($label_id, $label_id_each[0]);
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
$label_oder_each=explode('#**label**#', $label_id_each[1]);
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
array_push($label_order_original, $label_oder_each[0]);
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
$ptn = "/[^a-zA-Z0-9_]/";
|
152 |
-
|
153 |
-
$rpltxt = "";
|
154 |
-
|
155 |
-
$label_temp=preg_replace($ptn, $rpltxt, $label_oder_each[0]);
|
156 |
-
|
157 |
-
array_push($label_order, $label_temp);
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
array_push($label_type, $label_oder_each[1]);
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
//echo $label."<br>";
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
}
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
foreach($label_id as $key => $label)
|
176 |
-
|
177 |
-
if(in_array($label, $labels))
|
178 |
-
|
179 |
-
{
|
180 |
-
|
181 |
-
array_push($sorted_labels, $label_order[$key]);
|
182 |
-
|
183 |
-
array_push($sorted_labels_id, $label);
|
184 |
-
|
185 |
-
array_push($label_titles, $label_order_original[$key]);
|
186 |
-
|
187 |
-
}
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
}
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
$m=count($sorted_labels);
|
198 |
-
|
199 |
-
$group_id_s= array();
|
200 |
-
|
201 |
-
$l=0;
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
//var_dump($label_titles);
|
206 |
-
|
207 |
-
if(count($rows)>0 and $m)
|
208 |
-
|
209 |
-
for($i=0; $i <count($rows) ; $i++)
|
210 |
-
|
211 |
-
{
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
$row = &$rows[$i];
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
if(!in_array($row->group_id, $group_id_s))
|
220 |
-
|
221 |
-
{
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
array_push($group_id_s, $row->group_id);
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
}
|
230 |
-
|
231 |
-
}
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
$data=array();
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
for($www=0; $www < count($group_id_s); $www++)
|
246 |
-
|
247 |
-
{
|
248 |
-
|
249 |
-
$i=$group_id_s[$www];
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
$temp= array();
|
254 |
-
|
255 |
-
for($j=0; $j < $n ; $j++)
|
256 |
-
|
257 |
-
{
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
$row = &$rows[$j];
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
if($row->group_id==$i)
|
266 |
-
|
267 |
-
{
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
array_push($temp, $row);
|
272 |
-
|
273 |
-
}
|
274 |
-
|
275 |
-
}
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
$f=$temp[0];
|
284 |
-
|
285 |
-
$date=$f->date;
|
286 |
-
|
287 |
-
$ip=$f->ip;
|
288 |
-
|
289 |
-
$data_temp['Submit date']=$date;
|
290 |
-
|
291 |
-
$data_temp['Ip']=$ip;
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
$ttt=count($temp);
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
// var_dump($temp);
|
302 |
-
|
303 |
-
for($h=0; $h < $m ; $h++)
|
304 |
-
|
305 |
-
{
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
for($g=0; $g < $ttt ; $g++)
|
310 |
-
|
311 |
-
{
|
312 |
-
|
313 |
-
$t = $temp[$g];
|
314 |
-
|
315 |
-
if($t->element_label==$sorted_labels_id[$h])
|
316 |
-
|
317 |
-
{
|
318 |
-
|
319 |
-
if(strpos($t->element_value,"*@@url@@*"))
|
320 |
-
|
321 |
-
{
|
322 |
-
|
323 |
-
$new_file=str_replace("*@@url@@*",'', $t->element_value);
|
324 |
-
|
325 |
-
$new_filename=explode('/', $new_file);
|
326 |
-
|
327 |
-
$data_temp[$label_titles[$h]]=$new_file;
|
328 |
-
|
329 |
-
}
|
330 |
-
|
331 |
-
else
|
332 |
-
if(strpos($t->element_value,"***br***"))
|
333 |
-
{
|
334 |
-
$data_temp[$label_titles[$h]]= substr(str_replace("***br***",', ', $t->element_value), 0, -2);
|
335 |
-
}
|
336 |
-
else
|
337 |
-
if(strpos($t->element_value,"***map***"))
|
338 |
-
{
|
339 |
-
$data_temp[$label_titles[$h]]= 'Longitude:'.substr(str_replace("***map***",', Latitude:', $t->element_value), 0, -2);
|
340 |
-
}
|
341 |
-
else
|
342 |
-
$data_temp[$label_titles[$h]]=$t->element_value;
|
343 |
-
|
344 |
-
}
|
345 |
-
|
346 |
-
}
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
}
|
353 |
-
|
354 |
-
$data[]=$data_temp;
|
355 |
-
|
356 |
-
}
|
357 |
-
|
358 |
-
// var_dump($data);
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
function cleanData(&$str)
|
365 |
-
|
366 |
-
{
|
367 |
-
|
368 |
-
$str = preg_replace("/\t/", "\\t", $str);
|
369 |
-
|
370 |
-
$str = preg_replace("/\r?\n/", "\\n", $str);
|
371 |
-
|
372 |
-
if(strstr($str, '"')) $str = '"' . str_replace('"', '""', $str) . '"';
|
373 |
-
|
374 |
-
}
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
// file name for download
|
379 |
-
|
380 |
-
$filename = $title."_" . date('Ymd') . ".xml";
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
header("Content-Disposition: attachment; filename=\"$filename\"");
|
385 |
-
|
386 |
-
header("Content-Type:text/xml, charset=utf-8");
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
$flag = false;
|
393 |
-
|
394 |
-
/*
|
395 |
-
|
396 |
-
foreach($data as $row) {
|
397 |
-
|
398 |
-
if(!$flag) {
|
399 |
-
|
400 |
-
# display field/column names as first row
|
401 |
-
|
402 |
-
echo implode("\t", array_keys($row)) . "\r\n";
|
403 |
-
|
404 |
-
$flag = true;
|
405 |
-
|
406 |
-
}
|
407 |
-
|
408 |
-
array_walk($row, 'cleanData');
|
409 |
-
|
410 |
-
echo implode("\t", array_values($row)) . "\r\n";
|
411 |
-
|
412 |
-
}
|
413 |
-
|
414 |
-
*/
|
415 |
-
|
416 |
-
echo '
|
417 |
-
|
418 |
-
<?xml version="1.0" encoding="utf-8" ?>
|
419 |
-
|
420 |
-
<form title="'.$title.'">';
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
foreach ($data as $key1 => $value1){
|
425 |
-
|
426 |
-
echo '<submition>';
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
foreach ($value1 as $key => $value){
|
431 |
-
|
432 |
-
echo '<field title="'.$key.'">';
|
433 |
-
|
434 |
-
echo '<![CDATA['.$value."]]>";
|
435 |
-
|
436 |
-
echo '</field>';
|
437 |
-
|
438 |
-
}
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
echo '</submition>';
|
443 |
-
|
444 |
-
}
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
echo '';
|
449 |
-
|
450 |
-
echo ' </form>
|
451 |
-
|
452 |
-
';
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
images/{formmaker.png → formMaker.png}
RENAMED
File without changes
|
images/formoptions.png
ADDED
Binary file
|
images/info.png
ADDED
Binary file
|
images/logo.png
ADDED
Binary file
|
images/paypal.png
ADDED
Binary file
|
js/formmaker_free.js
CHANGED
@@ -1,13 +1,14 @@
|
|
1 |
-
j=2;//choices id
|
2 |
var c;
|
3 |
-
var
|
4 |
-
var
|
5 |
-
var
|
6 |
-
var
|
7 |
-
|
8 |
-
|
|
|
9 |
else
|
10 |
-
var url_for_ajax=location.protocol+'//'+location.host+ajaxurl;
|
11 |
|
12 |
/**
|
13 |
* Remove witespaces from childNodes.
|
@@ -30,17154 +31,16649 @@ function form_maker_remove_spaces(parent) {
|
|
30 |
}
|
31 |
}
|
32 |
|
33 |
-
function active_reset(val, id)
|
34 |
-
{
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
{
|
41 |
-
document.getElementById(id+'_element_resetform_id_temp').style.display="none";
|
42 |
-
}
|
43 |
}
|
44 |
|
45 |
-
function check_required()
|
46 |
-
|
47 |
-
alert('"Submit" and "Reset" buttons are disabled in back end.');
|
48 |
}
|
49 |
|
50 |
function isNumber(n) {
|
51 |
return !isNaN(parseFloat(n)) && isFinite(n);
|
52 |
}
|
53 |
-
function change_field_name(id, x)
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
return;
|
64 |
-
}
|
65 |
-
|
66 |
-
if(value==id+"_elementform_id_temp")
|
67 |
-
{
|
68 |
-
alert('"Field Name" should differ from "Field Id".')
|
69 |
-
x.value="";
|
70 |
-
}
|
71 |
-
else
|
72 |
-
{
|
73 |
-
document.getElementById(id+'_elementform_id_temp').name=value;
|
74 |
-
document.getElementById(id+'_element_labelform_id_temp').innerHTML=value;
|
75 |
-
}
|
76 |
-
}
|
77 |
|
78 |
-
|
79 |
-
|
80 |
-
|
|
|
|
|
|
|
|
|
|
|
81 |
}
|
82 |
|
83 |
-
function
|
84 |
-
|
85 |
-
attr_names= new Array();
|
86 |
-
attr_value= new Array();
|
87 |
-
var input=document.getElementById(id);
|
88 |
-
if(input)
|
89 |
-
{
|
90 |
-
atr=input.attributes;
|
91 |
-
for(i=0;i<30;i++)
|
92 |
-
if(atr[i] )
|
93 |
-
{
|
94 |
-
if(atr[i].name.indexOf("add_")==0)
|
95 |
-
{
|
96 |
-
attr_names.push(atr[i].name.replace('add_',''));
|
97 |
-
attr_value.push(atr[i].value);
|
98 |
-
}
|
99 |
-
}
|
100 |
-
}
|
101 |
-
return Array(attr_names, attr_value);
|
102 |
}
|
103 |
|
104 |
-
function
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
id_array=Array();
|
120 |
-
id_array[0]=x+'_element_firstform_id_temp';
|
121 |
-
id_array[1]=x+'_element_lastform_id_temp';
|
122 |
-
id_array[2]=x+'_element_titleform_id_temp';
|
123 |
-
id_array[3]=x+'_element_middleform_id_temp';
|
124 |
-
break;
|
125 |
-
}
|
126 |
-
|
127 |
-
case "type_address":
|
128 |
-
|
129 |
-
{
|
130 |
-
id_array=Array();
|
131 |
-
id_array[0]=x+'_street1form_id_temp';
|
132 |
-
id_array[1]=x+'_street2form_id_temp';
|
133 |
-
id_array[2]=x+'_cityform_id_temp';
|
134 |
-
id_array[3]=x+'_stateform_id_temp';
|
135 |
-
id_array[4]=x+'_postalform_id_temp';
|
136 |
-
id_array[5]=x+'_countryform_id_temp';
|
137 |
-
break;
|
138 |
-
}
|
139 |
-
|
140 |
-
case "type_checkbox":
|
141 |
-
|
142 |
-
{
|
143 |
-
id_array=Array();
|
144 |
-
for(z=0;z<50;z++)
|
145 |
-
id_array[z]=x+'_elementform_id_temp'+z;
|
146 |
-
break;
|
147 |
-
}
|
148 |
-
|
149 |
-
case "type_time":
|
150 |
-
|
151 |
-
{
|
152 |
-
id_array=Array();
|
153 |
-
id_array[0]=x+'_hhform_id_temp';
|
154 |
-
id_array[1]=x+'_mmform_id_temp';
|
155 |
-
id_array[2]=x+'_ssform_id_temp';
|
156 |
-
id_array[3]=x+'_am_pmform_id_temp';
|
157 |
-
break;
|
158 |
-
}
|
159 |
-
case "type_date":
|
160 |
-
|
161 |
-
{
|
162 |
-
id_array=Array();
|
163 |
-
id_array[0]=x+'_elementform_id_temp';
|
164 |
-
id_array[1]=x+'_buttonform_id_temp';
|
165 |
-
break;
|
166 |
-
}
|
167 |
-
|
168 |
-
case "type_date_fields":
|
169 |
-
|
170 |
-
{
|
171 |
-
id_array=Array();
|
172 |
-
id_array[0]=x+'_dayform_id_temp';
|
173 |
-
id_array[1]=x+'_monthform_id_temp';
|
174 |
-
id_array[2]=x+'_yearform_id_temp';
|
175 |
-
break;
|
176 |
-
}
|
177 |
-
|
178 |
-
case "type_captcha":
|
179 |
-
|
180 |
-
{
|
181 |
-
id_array=Array();
|
182 |
-
id_array[0]='_wd_captchaform_id_temp';
|
183 |
-
id_array[1]='_wd_captcha_inputform_id_temp';
|
184 |
-
id_array[2]='_element_refreshform_id_temp';
|
185 |
-
break;
|
186 |
-
}
|
187 |
-
|
188 |
-
case "type_recaptcha":
|
189 |
-
|
190 |
-
{
|
191 |
-
id_array=Array();
|
192 |
-
id_array[0]='wd_recaptchaform_id_temp';
|
193 |
-
break;
|
194 |
-
}
|
195 |
-
|
196 |
-
case "type_submit_reset":
|
197 |
-
|
198 |
-
{
|
199 |
-
id_array=Array();
|
200 |
-
id_array[0]=x+'_element_submitform_id_temp';
|
201 |
-
id_array[1]=x+'_element_resetform_id_temp';
|
202 |
-
break;
|
203 |
-
}
|
204 |
-
|
205 |
-
case "type_page_break":
|
206 |
-
|
207 |
-
{
|
208 |
-
id_array=Array();
|
209 |
-
id_array[0]='_div_between';
|
210 |
-
break;
|
211 |
-
}
|
212 |
-
}
|
213 |
-
|
214 |
-
for(q=0; q<id_array.length;q++)
|
215 |
-
{
|
216 |
-
id=id_array[q];
|
217 |
-
var input=document.getElementById(id);
|
218 |
-
if(input)
|
219 |
-
{
|
220 |
-
atr=input.attributes;
|
221 |
-
for(i=0;i<30;i++)
|
222 |
-
if(atr[i])
|
223 |
-
{
|
224 |
-
if(atr[i].name.indexOf("add_")==0)
|
225 |
-
{
|
226 |
-
input.removeAttribute(atr[i].name);
|
227 |
-
i--;
|
228 |
-
}
|
229 |
-
}
|
230 |
-
|
231 |
-
for(i=0;i<10;i++)
|
232 |
-
if(document.getElementById("attr_name"+i))
|
233 |
-
{
|
234 |
-
try{input.setAttribute("add_"+document.getElementById("attr_name"+i).value, document.getElementById("attr_value"+i).value)}
|
235 |
-
catch(err)
|
236 |
-
{
|
237 |
-
alert('Only letters, numbers, hyphens and underscores are allowed.');
|
238 |
-
}
|
239 |
-
}
|
240 |
-
}
|
241 |
-
}
|
242 |
}
|
243 |
|
244 |
-
function
|
245 |
-
{
|
246 |
-
|
247 |
-
{
|
248 |
-
case 'type_text':
|
249 |
-
{
|
250 |
-
var edit_main_table=document.getElementById("edit_main_table");
|
251 |
-
|
252 |
-
var edit_main_tr0 = document.createElement('tr');
|
253 |
-
edit_main_tr0.setAttribute("valing", "top");
|
254 |
-
|
255 |
-
var edit_main_td0 = document.createElement('td');
|
256 |
-
edit_main_td0.style.cssText = "padding-top:10px";
|
257 |
-
|
258 |
-
var edit_main_td0_1 = document.createElement('td');
|
259 |
-
edit_main_td0_1.style.cssText = "padding-top:10px";
|
260 |
-
|
261 |
-
var br = document.createElement('br');
|
262 |
-
var br1 = document.createElement('br');
|
263 |
-
|
264 |
-
var field_id = document.createElement('label');
|
265 |
-
field_id.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:27px";
|
266 |
-
field_id.innerHTML = "Field id ";
|
267 |
-
|
268 |
-
|
269 |
-
var field_id_text = document.createElement('input');
|
270 |
-
field_id_text.setAttribute("size", "50");
|
271 |
-
field_id_text.setAttribute("type", "text");
|
272 |
-
field_id_text.setAttribute("disabled", "disabled");
|
273 |
-
field_id_text.setAttribute("value", i+"_elementform_id_temp");
|
274 |
-
|
275 |
-
var field_name = document.createElement('label');
|
276 |
-
field_name.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:3px";
|
277 |
-
field_name.innerHTML = "Field name ";
|
278 |
-
|
279 |
-
var field_name_text = document.createElement('input');
|
280 |
-
field_name_text.setAttribute("size", "50");
|
281 |
-
field_name_text.setAttribute("type", "text");
|
282 |
-
field_name_text.setAttribute("disabled", "disabled");
|
283 |
-
field_name_text.setAttribute("value", i+"_elementform_id_temp");
|
284 |
-
|
285 |
-
edit_main_td0.appendChild(field_id);
|
286 |
-
edit_main_td0.appendChild(br);
|
287 |
-
edit_main_td0.appendChild(field_name);
|
288 |
-
|
289 |
-
edit_main_td0_1.appendChild(field_id_text);
|
290 |
-
edit_main_td0_1.appendChild(br1);
|
291 |
-
edit_main_td0_1.appendChild(field_name_text);
|
292 |
-
edit_main_tr0.appendChild(edit_main_td0);
|
293 |
-
edit_main_tr0.appendChild(edit_main_td0_1);
|
294 |
-
edit_main_table.insertBefore(edit_main_tr0,edit_main_table.childNodes[0]);
|
295 |
-
break;
|
296 |
-
}
|
297 |
-
|
298 |
-
case 'type_address':
|
299 |
-
{
|
300 |
-
var edit_main_table=document.getElementById("edit_main_table");
|
301 |
-
|
302 |
-
var edit_main_tr0 = document.createElement('tr');
|
303 |
-
edit_main_tr0.setAttribute("valing", "top");
|
304 |
-
|
305 |
-
var edit_main_td0 = document.createElement('td');
|
306 |
-
edit_main_td0.style.cssText = "padding-top:10px";
|
307 |
-
edit_main_td0.setAttribute("colspan", "2");
|
308 |
-
|
309 |
-
var br = document.createElement('br');
|
310 |
-
|
311 |
-
var field_id = document.createElement('label');
|
312 |
-
field_id.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:27px";
|
313 |
-
field_id.innerHTML = "Fields id ";
|
314 |
-
|
315 |
-
|
316 |
-
var field_id_text = document.createElement('input');
|
317 |
-
field_id_text.setAttribute("type", "text");
|
318 |
-
field_id_text.setAttribute("id", "field_id");
|
319 |
-
field_id_text.setAttribute("disabled", "disabled");
|
320 |
-
field_id_text.setAttribute("style", "width:350px");
|
321 |
-
field_id_text.setAttribute("value", i+"_street1form_id_temp, "+i+"_street2form_id_temp, "+i+"_cityform_id_temp, "+i+"_stateform_id_temp, "+i+"_postalform_id_temp, "+i+"_countryform_id_temp");
|
322 |
-
|
323 |
-
var field_name = document.createElement('label');
|
324 |
-
field_name.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:3px";
|
325 |
-
field_name.innerHTML = "Fields name ";
|
326 |
-
|
327 |
-
var field_name_text = document.createElement('input');
|
328 |
-
field_name_text.setAttribute("type", "text");
|
329 |
-
field_name_text.setAttribute("id", "field_name");
|
330 |
-
field_name_text.setAttribute("disabled", "disabled");
|
331 |
-
field_name_text.setAttribute("style", "width:350px");
|
332 |
-
field_name_text.setAttribute("value", i+"_street1form_id_temp, "+i+"_street2form_id_temp, "+i+"_cityform_id_temp, "+i+"_stateform_id_temp, "+i+"_postalform_id_temp, "+i+"_countryform_id_temp");
|
333 |
-
|
334 |
-
edit_main_td0.appendChild(field_id);
|
335 |
-
edit_main_td0.appendChild(field_id_text);
|
336 |
-
edit_main_td0.appendChild(br);
|
337 |
-
edit_main_td0.appendChild(field_name);
|
338 |
-
edit_main_td0.appendChild(field_name_text);
|
339 |
-
edit_main_tr0.appendChild(edit_main_td0);
|
340 |
-
edit_main_table.insertBefore(edit_main_tr0,edit_main_table.childNodes[0]);
|
341 |
-
break;
|
342 |
-
}
|
343 |
-
|
344 |
-
case 'type_name':
|
345 |
-
{
|
346 |
-
var edit_main_table=document.getElementById("edit_main_table");
|
347 |
-
|
348 |
-
var edit_main_tr0 = document.createElement('tr');
|
349 |
-
edit_main_tr0.setAttribute("valing", "top");
|
350 |
-
|
351 |
-
var edit_main_td0 = document.createElement('td');
|
352 |
-
edit_main_td0.style.cssText = "padding-top:10px";
|
353 |
-
edit_main_td0.setAttribute("colspan", "2");
|
354 |
-
|
355 |
-
var br = document.createElement('br');
|
356 |
-
|
357 |
-
var field_id = document.createElement('label');
|
358 |
-
field_id.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:27px";
|
359 |
-
field_id.innerHTML = "Fields id ";
|
360 |
-
|
361 |
-
|
362 |
-
var field_id_text = document.createElement('input');
|
363 |
-
field_id_text.setAttribute("type", "text");
|
364 |
-
field_id_text.setAttribute("id", "field_id");
|
365 |
-
field_id_text.setAttribute("disabled", "disabled");
|
366 |
-
field_id_text.setAttribute("style", "width:350px");
|
367 |
-
field_id_text.setAttribute("value", i+"_element_firstform_id_temp, "+i+"_element_lastform_id_temp");
|
368 |
-
|
369 |
-
var field_name = document.createElement('label');
|
370 |
-
field_name.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:3px";
|
371 |
-
field_name.innerHTML = "Fields name ";
|
372 |
-
|
373 |
-
var field_name_text = document.createElement('input');
|
374 |
-
field_name_text.setAttribute("type", "text");
|
375 |
-
field_name_text.setAttribute("id", "field_name");
|
376 |
-
field_name_text.setAttribute("disabled", "disabled");
|
377 |
-
field_name_text.setAttribute("style", "width:350px");
|
378 |
-
field_name_text.setAttribute("value", i+"_element_firstform_id_temp, "+i+"_element_lastform_id_temp");
|
379 |
-
|
380 |
-
edit_main_td0.appendChild(field_id);
|
381 |
-
edit_main_td0.appendChild(field_id_text);
|
382 |
-
edit_main_td0.appendChild(br);
|
383 |
-
edit_main_td0.appendChild(field_name);
|
384 |
-
edit_main_td0.appendChild(field_name_text);
|
385 |
-
edit_main_tr0.appendChild(edit_main_td0);
|
386 |
-
edit_main_table.insertBefore(edit_main_tr0,edit_main_table.childNodes[0]);
|
387 |
-
break;
|
388 |
-
}
|
389 |
-
|
390 |
-
case 'type_radio':
|
391 |
-
{
|
392 |
-
var edit_main_table=document.getElementById("edit_main_table");
|
393 |
-
|
394 |
-
var edit_main_tr0 = document.createElement('tr');
|
395 |
-
edit_main_tr0.setAttribute("valing", "top");
|
396 |
-
|
397 |
-
var edit_main_td0 = document.createElement('td');
|
398 |
-
edit_main_td0.style.cssText = "padding-top:10px";
|
399 |
-
edit_main_td0.setAttribute("colspan", "2");
|
400 |
-
|
401 |
-
var br = document.createElement('br');
|
402 |
-
|
403 |
-
var field_id = document.createElement('label');
|
404 |
-
field_id.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:27px";
|
405 |
-
field_id.innerHTML = "Fields id ";
|
406 |
-
|
407 |
-
|
408 |
-
var field_id_text = document.createElement('input');
|
409 |
-
field_id_text.setAttribute("type", "text");
|
410 |
-
field_id_text.setAttribute("id", "field_id");
|
411 |
-
field_id_text.setAttribute("disabled", "disabled");
|
412 |
-
field_id_text.setAttribute("style", "width:350px");
|
413 |
-
field_id_text.setAttribute("value", '');
|
414 |
-
|
415 |
-
var field_name = document.createElement('label');
|
416 |
-
field_name.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:3px";
|
417 |
-
field_name.innerHTML = "Fields name ";
|
418 |
-
|
419 |
-
var field_name_text = document.createElement('input');
|
420 |
-
field_name_text.setAttribute("type", "text");
|
421 |
-
field_name_text.setAttribute("id", "field_name");
|
422 |
-
field_name_text.setAttribute("disabled", "disabled");
|
423 |
-
field_name_text.setAttribute("style", "width:350px");
|
424 |
-
field_name_text.setAttribute("value", '');
|
425 |
-
|
426 |
-
edit_main_td0.appendChild(field_id);
|
427 |
-
edit_main_td0.appendChild(field_id_text);
|
428 |
-
edit_main_td0.appendChild(br);
|
429 |
-
edit_main_td0.appendChild(field_name);
|
430 |
-
edit_main_td0.appendChild(field_name_text);
|
431 |
-
edit_main_tr0.appendChild(edit_main_td0);
|
432 |
-
edit_main_table.insertBefore(edit_main_tr0,edit_main_table.childNodes[0]);
|
433 |
-
refresh_id_name(i, type);
|
434 |
-
break;
|
435 |
-
}
|
436 |
-
|
437 |
-
case 'type_checkbox':
|
438 |
-
{
|
439 |
-
var edit_main_table=document.getElementById("edit_main_table");
|
440 |
-
|
441 |
-
var edit_main_tr0 = document.createElement('tr');
|
442 |
-
edit_main_tr0.setAttribute("valing", "top");
|
443 |
-
|
444 |
-
var edit_main_td0 = document.createElement('td');
|
445 |
-
edit_main_td0.style.cssText = "padding-top:10px";
|
446 |
-
edit_main_td0.setAttribute("colspan", "2");
|
447 |
-
|
448 |
-
var br = document.createElement('br');
|
449 |
-
|
450 |
-
var field_id = document.createElement('label');
|
451 |
-
field_id.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:27px";
|
452 |
-
field_id.innerHTML = "Fields id ";
|
453 |
-
|
454 |
-
|
455 |
-
var field_id_text = document.createElement('input');
|
456 |
-
field_id_text.setAttribute("type", "text");
|
457 |
-
field_id_text.setAttribute("id", "field_id");
|
458 |
-
field_id_text.setAttribute("disabled", "disabled");
|
459 |
-
field_id_text.setAttribute("style", "width:350px");
|
460 |
-
field_id_text.setAttribute("value", '');
|
461 |
-
|
462 |
-
var field_name = document.createElement('label');
|
463 |
-
field_name.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:3px";
|
464 |
-
field_name.innerHTML = "Fields name ";
|
465 |
-
|
466 |
-
var field_name_text = document.createElement('input');
|
467 |
-
field_name_text.setAttribute("type", "text");
|
468 |
-
field_name_text.setAttribute("id", "field_name");
|
469 |
-
field_name_text.setAttribute("disabled", "disabled");
|
470 |
-
field_name_text.setAttribute("style", "width:350px");
|
471 |
-
field_name_text.setAttribute("value", '');
|
472 |
-
|
473 |
-
edit_main_td0.appendChild(field_id);
|
474 |
-
edit_main_td0.appendChild(field_id_text);
|
475 |
-
edit_main_td0.appendChild(br);
|
476 |
-
edit_main_td0.appendChild(field_name);
|
477 |
-
edit_main_td0.appendChild(field_name_text);
|
478 |
-
edit_main_tr0.appendChild(edit_main_td0);
|
479 |
-
edit_main_table.insertBefore(edit_main_tr0,edit_main_table.childNodes[0]);
|
480 |
-
refresh_id_name(i, type);
|
481 |
-
break;
|
482 |
-
}
|
483 |
-
|
484 |
-
case 'type_time':
|
485 |
-
{
|
486 |
-
var edit_main_table=document.getElementById("edit_main_table");
|
487 |
-
|
488 |
-
var edit_main_tr0 = document.createElement('tr');
|
489 |
-
edit_main_tr0.setAttribute("valing", "top");
|
490 |
-
|
491 |
-
var edit_main_td0 = document.createElement('td');
|
492 |
-
edit_main_td0.style.cssText = "padding-top:10px";
|
493 |
-
var edit_main_td0_1 = document.createElement('td');
|
494 |
-
edit_main_td0_1.style.cssText = "padding-top:10px";
|
495 |
-
|
496 |
-
var br = document.createElement('br');
|
497 |
-
var br1 = document.createElement('br');
|
498 |
-
|
499 |
-
var field_id = document.createElement('label');
|
500 |
-
field_id.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:27px";
|
501 |
-
field_id.innerHTML = "Fields id ";
|
502 |
-
|
503 |
-
|
504 |
-
var field_id_text = document.createElement('input');
|
505 |
-
field_id_text.setAttribute("size", "50");
|
506 |
-
field_id_text.setAttribute("type", "text");
|
507 |
-
field_id_text.setAttribute("id", "field_id");
|
508 |
-
field_id_text.setAttribute("disabled", "disabled");
|
509 |
-
field_id_text.setAttribute("value", i+"_hhform_id_temp, "+i+"_mmform_id_temp, "+i+"_ssform_id_temp");
|
510 |
-
|
511 |
-
var field_name = document.createElement('label');
|
512 |
-
field_name.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:3px";
|
513 |
-
field_name.innerHTML = "Fields name ";
|
514 |
-
|
515 |
-
var field_name_text = document.createElement('input');
|
516 |
-
field_name_text.setAttribute("size", "50");
|
517 |
-
field_name_text.setAttribute("type", "text");
|
518 |
-
field_name_text.setAttribute("id", "field_name");
|
519 |
-
field_name_text.setAttribute("disabled", "disabled");
|
520 |
-
field_name_text.setAttribute("value", i+"_hhform_id_temp, "+i+"_mmform_id_temp, "+i+"_ssform_id_temp");
|
521 |
-
|
522 |
-
edit_main_td0.appendChild(field_id);
|
523 |
-
edit_main_td0.appendChild(br1);
|
524 |
-
edit_main_td0.appendChild(field_name);
|
525 |
-
edit_main_td0_1.appendChild(field_id_text);
|
526 |
-
edit_main_td0_1.appendChild(br);
|
527 |
-
edit_main_td0_1.appendChild(field_name_text);
|
528 |
-
|
529 |
-
edit_main_tr0.appendChild(edit_main_td0);
|
530 |
-
edit_main_tr0.appendChild(edit_main_td0_1);
|
531 |
-
edit_main_table.insertBefore(edit_main_tr0,edit_main_table.childNodes[0]);
|
532 |
-
break;
|
533 |
-
}
|
534 |
-
|
535 |
-
case 'type_date_fields':
|
536 |
-
{
|
537 |
-
var edit_main_table=document.getElementById("edit_main_table");
|
538 |
-
|
539 |
-
var edit_main_tr0 = document.createElement('tr');
|
540 |
-
edit_main_tr0.setAttribute("valing", "top");
|
541 |
-
|
542 |
-
var edit_main_td0 = document.createElement('td');
|
543 |
-
edit_main_td0.style.cssText = "padding-top:10px";
|
544 |
-
edit_main_td0.setAttribute("colspan", "2");
|
545 |
-
|
546 |
-
var br = document.createElement('br');
|
547 |
-
|
548 |
-
var field_id = document.createElement('label');
|
549 |
-
field_id.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:27px";
|
550 |
-
field_id.innerHTML = "Fields id ";
|
551 |
-
|
552 |
-
|
553 |
-
var field_id_text = document.createElement('input');
|
554 |
-
field_id_text.setAttribute("size", "50");
|
555 |
-
field_id_text.setAttribute("type", "text");
|
556 |
-
field_id_text.setAttribute("id", "field_id");
|
557 |
-
field_id_text.setAttribute("disabled", "disabled");
|
558 |
-
field_id_text.setAttribute("value", i+"_dayform_id_temp, "+i+"_monthform_id_temp, "+i+"_yearform_id_temp");
|
559 |
-
|
560 |
-
var field_name = document.createElement('label');
|
561 |
-
field_name.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:3px";
|
562 |
-
field_name.innerHTML = "Fields name ";
|
563 |
-
|
564 |
-
var field_name_text = document.createElement('input');
|
565 |
-
field_name_text.setAttribute("size", "50");
|
566 |
-
field_name_text.setAttribute("type", "text");
|
567 |
-
field_name_text.setAttribute("id", "field_name");
|
568 |
-
field_name_text.setAttribute("disabled", "disabled");
|
569 |
-
field_name_text.setAttribute("value", i+"_dayform_id_temp, "+i+"_monthform_id_temp, "+i+"_yearform_id_temp");
|
570 |
-
|
571 |
-
edit_main_td0.appendChild(field_id);
|
572 |
-
edit_main_td0.appendChild(field_id_text);
|
573 |
-
edit_main_td0.appendChild(br);
|
574 |
-
edit_main_td0.appendChild(field_name);
|
575 |
-
edit_main_td0.appendChild(field_name_text);
|
576 |
-
edit_main_tr0.appendChild(edit_main_td0);
|
577 |
-
edit_main_table.insertBefore(edit_main_tr0,edit_main_table.childNodes[0]);
|
578 |
-
break;
|
579 |
-
}
|
580 |
-
|
581 |
-
case 'type_captcha':
|
582 |
-
{
|
583 |
-
var edit_main_table=document.getElementById("edit_main_table");
|
584 |
-
|
585 |
-
var edit_main_tr0 = document.createElement('tr');
|
586 |
-
edit_main_tr0.setAttribute("valing", "top");
|
587 |
-
|
588 |
-
var edit_main_td0 = document.createElement('td');
|
589 |
-
edit_main_td0.style.cssText = "padding-top:10px";
|
590 |
-
|
591 |
-
var edit_main_td0_1 = document.createElement('td');
|
592 |
-
edit_main_td0_1.style.cssText = "padding-top:10px";
|
593 |
-
|
594 |
-
var br = document.createElement('br');
|
595 |
-
var br1 = document.createElement('br');
|
596 |
-
|
597 |
-
var field_id = document.createElement('label');
|
598 |
-
field_id.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:27px";
|
599 |
-
field_id.innerHTML = "Fields id ";
|
600 |
-
|
601 |
-
|
602 |
-
var field_id_text = document.createElement('input');
|
603 |
-
field_id_text.setAttribute("size", "50");
|
604 |
-
field_id_text.setAttribute("type", "text");
|
605 |
-
field_id_text.setAttribute("id", "field_id");
|
606 |
-
field_id_text.setAttribute("disabled", "disabled");
|
607 |
-
field_id_text.setAttribute("value", "wd_captcha_inputform_id_temp");
|
608 |
-
|
609 |
-
var field_name = document.createElement('label');
|
610 |
-
field_name.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:3px";
|
611 |
-
field_name.innerHTML = "Fields name ";
|
612 |
-
|
613 |
-
var field_name_text = document.createElement('input');
|
614 |
-
field_name_text.setAttribute("size", "50");
|
615 |
-
field_name_text.setAttribute("type", "text");
|
616 |
-
field_name_text.setAttribute("id", "field_name");
|
617 |
-
field_name_text.setAttribute("disabled", "disabled");
|
618 |
-
field_name_text.setAttribute("value", "captcha_inputform_id_temp");
|
619 |
-
|
620 |
-
edit_main_td0.appendChild(field_id);
|
621 |
-
edit_main_td0.appendChild(br1);
|
622 |
-
edit_main_td0.appendChild(field_name);
|
623 |
-
edit_main_td0_1.appendChild(field_id_text);
|
624 |
-
edit_main_td0_1.appendChild(br);
|
625 |
-
edit_main_td0_1.appendChild(field_name_text);
|
626 |
-
edit_main_tr0.appendChild(edit_main_td0);
|
627 |
-
edit_main_tr0.appendChild(edit_main_td0_1);
|
628 |
-
edit_main_table.insertBefore(edit_main_tr0,edit_main_table.childNodes[0]);
|
629 |
-
break;
|
630 |
-
}
|
631 |
-
|
632 |
-
}
|
633 |
-
}
|
634 |
|
|
|
|
|
|
|
|
|
|
|
635 |
|
636 |
-
|
637 |
-
{
|
638 |
-
switch(type)
|
639 |
-
{
|
640 |
-
case 'type_radio':
|
641 |
-
{
|
642 |
-
document.getElementById('field_id').value='';
|
643 |
-
for(k=0; k<50;k++)
|
644 |
-
{
|
645 |
-
if(document.getElementById(i+'_elementform_id_temp'+k))
|
646 |
-
document.getElementById('field_id').value +=i+'_elementform_id_temp'+k+', ';
|
647 |
-
}
|
648 |
-
a=document.getElementById('field_id').value.slice(0,-2);
|
649 |
-
document.getElementById('field_id').value=a;
|
650 |
-
document.getElementById('field_name').value =i+'_element';
|
651 |
-
|
652 |
-
break
|
653 |
-
}
|
654 |
-
case 'type_checkbox':
|
655 |
-
{
|
656 |
-
document.getElementById('field_id').value='';
|
657 |
-
for(k=0; k<50;k++)
|
658 |
-
{
|
659 |
-
if(document.getElementById(i+'_elementform_id_temp'+k))
|
660 |
-
{
|
661 |
-
document.getElementById('field_id').value +=i+'_elementform_id_temp'+k+', ';
|
662 |
-
}
|
663 |
-
}
|
664 |
-
a=document.getElementById('field_id').value.slice(0,-2);
|
665 |
-
document.getElementById('field_id').value =a;
|
666 |
-
document.getElementById('field_name').value =a;
|
667 |
-
|
668 |
-
break
|
669 |
-
}
|
670 |
-
}
|
671 |
|
672 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
673 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
674 |
|
|
|
675 |
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
w_attr_value[j]="value";
|
683 |
-
var el_attr_tr = document.createElement('tr');
|
684 |
-
el_attr_tr.setAttribute("id", "attr_row_"+j);
|
685 |
-
el_attr_tr.setAttribute("idi", j);
|
686 |
-
var el_attr_td_name = document.createElement('td');
|
687 |
-
el_attr_td_name.style.cssText = 'width:100px';
|
688 |
-
var el_attr_td_value = document.createElement('td');
|
689 |
-
el_attr_td_value.style.cssText = 'width:100px';
|
690 |
-
|
691 |
-
var el_attr_td_X = document.createElement('td');
|
692 |
-
var el_attr_name = document.createElement('input');
|
693 |
-
el_attr_name.setAttribute("type", "text");
|
694 |
-
el_attr_name.style.cssText = "width:100px";
|
695 |
-
el_attr_name.setAttribute("value", w_attr_name[j]);
|
696 |
-
el_attr_name.setAttribute("id", "attr_name"+j);
|
697 |
-
el_attr_name.setAttribute("onChange", "change_attribute_name('"+i+"', this, '"+type+"')");
|
698 |
-
|
699 |
-
var el_attr_value = document.createElement('input');
|
700 |
-
el_attr_value.setAttribute("type", "text");
|
701 |
-
el_attr_value.style.cssText = "width:100px";
|
702 |
-
el_attr_value.setAttribute("value", w_attr_value[j]);
|
703 |
-
el_attr_value.setAttribute("id", "attr_value"+j);
|
704 |
-
el_attr_value.setAttribute("onChange", "change_attribute_value('"+i+"', "+j+", '"+type+"')");
|
705 |
-
|
706 |
-
var el_attr_remove = document.createElement('img');
|
707 |
-
el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
|
708 |
-
el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
|
709 |
-
el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
|
710 |
-
el_attr_remove.setAttribute("align", 'top');
|
711 |
-
el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", '"+type+"')");
|
712 |
-
el_attr_table.appendChild(el_attr_tr);
|
713 |
-
el_attr_tr.appendChild(el_attr_td_name);
|
714 |
-
el_attr_tr.appendChild(el_attr_td_value);
|
715 |
-
el_attr_tr.appendChild(el_attr_td_X);
|
716 |
-
el_attr_td_name.appendChild(el_attr_name);
|
717 |
-
el_attr_td_value.appendChild(el_attr_value);
|
718 |
-
el_attr_td_X.appendChild(el_attr_remove);
|
719 |
-
refresh_attr(i, type);
|
720 |
-
}
|
721 |
|
722 |
-
|
723 |
-
{
|
724 |
-
if(!document.getElementById("attr_name"+x).value)
|
725 |
-
{
|
726 |
-
alert('The name of the attribute is required.');
|
727 |
-
return
|
728 |
-
}
|
729 |
-
|
730 |
-
if(document.getElementById("attr_name"+x).value.toLowerCase()=="style")
|
731 |
-
{
|
732 |
-
alert('Sorry, you cannot add a style attribute here. Use "Class name" instead.');
|
733 |
-
return
|
734 |
-
}
|
735 |
-
|
736 |
-
refresh_attr(id, type);
|
737 |
-
}
|
738 |
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
if(value.toLowerCase()=="style")
|
749 |
-
{
|
750 |
-
alert('Sorry, you cannot add a style attribute here. Use "Class name" instead.');
|
751 |
-
return;
|
752 |
-
}
|
753 |
-
|
754 |
-
if(value==parseInt(value))
|
755 |
-
{
|
756 |
-
alert('The name of the attribute cannot be a number.');
|
757 |
-
return;
|
758 |
-
}
|
759 |
-
|
760 |
-
if(value.indexOf(" ")!=-1)
|
761 |
-
{
|
762 |
-
var regExp = /\s+/g;
|
763 |
-
value=value.replace(regExp,'');
|
764 |
-
x.value=value;
|
765 |
-
alert("The name of the attribute cannot contain a space.");
|
766 |
-
refresh_attr(id, type);
|
767 |
-
return;
|
768 |
-
}
|
769 |
-
|
770 |
-
refresh_attr(id, type);
|
771 |
-
|
772 |
-
}
|
773 |
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
}
|
780 |
|
781 |
-
|
782 |
-
{
|
783 |
-
|
784 |
-
var div = document.createElement('div');
|
785 |
-
var element=document.getElementById(id);
|
786 |
-
element.setAttribute(attr, '');
|
787 |
-
}
|
788 |
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
var table_button = document.createElement('table');
|
797 |
-
|
798 |
-
table_button.setAttribute("width", "100%");
|
799 |
-
table_button.setAttribute("border", "0");
|
800 |
-
table_button.setAttribute("id", "button_opt"+j);
|
801 |
-
table_button.setAttribute("idi", j);
|
802 |
-
var tr_button = document.createElement('tr');
|
803 |
-
var tr_hr = document.createElement('tr');
|
804 |
-
|
805 |
-
var td_button = document.createElement('td');
|
806 |
-
var td_X = document.createElement('td');
|
807 |
-
var td_hr = document.createElement('td');
|
808 |
-
td_hr.setAttribute("colspan", "3");
|
809 |
-
|
810 |
-
tr_hr.appendChild(td_hr);
|
811 |
-
tr_button.appendChild(td_button);
|
812 |
-
tr_button.appendChild(td_X);
|
813 |
-
table_button.appendChild(tr_hr);
|
814 |
-
table_button.appendChild(tr_button);
|
815 |
-
|
816 |
-
var br1 = document.createElement('br');
|
817 |
-
|
818 |
-
var hr = document.createElement('hr');
|
819 |
-
|
820 |
-
hr.setAttribute("id", "br"+j);
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
var el_title_label = document.createElement('label');
|
826 |
-
|
827 |
-
el_title_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
828 |
-
|
829 |
-
el_title_label.innerHTML = "Button name";
|
830 |
-
|
831 |
-
var el_title = document.createElement('input');
|
832 |
-
|
833 |
-
el_title.setAttribute("id", "el_title"+j);
|
834 |
-
|
835 |
-
el_title.setAttribute("type", "text");
|
836 |
-
|
837 |
-
el_title.setAttribute("value", "Button");
|
838 |
-
|
839 |
-
el_title.style.cssText = "width:100px; margin-left:43px; padding:0; border-width: 1px";
|
840 |
-
|
841 |
-
el_title.setAttribute("onKeyUp", "change_label('"+i+"_elementform_id_temp"+j+"', this.value);");
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
var el_func_label = document.createElement('label');
|
846 |
-
|
847 |
-
el_func_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
848 |
-
|
849 |
-
el_func_label.innerHTML = "OnClick function";
|
850 |
-
|
851 |
-
var el_func = document.createElement('input');
|
852 |
-
|
853 |
-
el_func.setAttribute("id", "el_func"+j);
|
854 |
-
|
855 |
-
el_func.setAttribute("type", "text");
|
856 |
-
|
857 |
-
el_func.setAttribute("value", "");
|
858 |
-
|
859 |
-
el_func.style.cssText = "width:100px; margin-left:20px;; padding:0; border-width: 1px";
|
860 |
-
|
861 |
-
el_func.setAttribute("onKeyUp", "change_func('"+i+"_elementform_id_temp"+j+"', this.value);");
|
862 |
-
|
863 |
-
var el_choices_remove = document.createElement('img');
|
864 |
-
|
865 |
-
el_choices_remove.setAttribute("id", "el_button"+j+"_remove");
|
866 |
-
|
867 |
-
el_choices_remove.setAttribute("src", plugin_url+'/images/delete.png');
|
868 |
-
|
869 |
-
el_choices_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
|
870 |
-
|
871 |
-
el_choices_remove.setAttribute("align", 'top');
|
872 |
-
|
873 |
-
el_choices_remove.setAttribute("onClick", "remove_button("+j+","+i+")");
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
td_hr.appendChild(hr);
|
878 |
-
|
879 |
-
td_button.appendChild(el_title_label);
|
880 |
-
|
881 |
-
td_button.appendChild(el_title);
|
882 |
-
td_button.appendChild(br1);
|
883 |
-
td_button.appendChild(el_func_label);
|
884 |
-
|
885 |
-
td_button.appendChild(el_func);
|
886 |
-
td_X.appendChild(el_choices_remove);
|
887 |
-
edit_main_td4.appendChild(table_button);
|
888 |
-
|
889 |
-
element='button'; type='button';
|
890 |
-
|
891 |
-
td2=document.getElementById(i+"_element_sectionform_id_temp");
|
892 |
-
|
893 |
-
var adding = document.createElement(element);
|
894 |
-
adding.setAttribute("type", type);
|
895 |
-
adding.setAttribute("id", i+"_elementform_id_temp"+j);
|
896 |
-
adding.setAttribute("name", i+"_elementform_id_temp"+j);
|
897 |
-
adding.setAttribute("value", "Button");
|
898 |
-
adding.innerHTML = "Button";
|
899 |
-
adding.setAttribute("onclick", "");
|
900 |
-
|
901 |
-
|
902 |
-
td2.appendChild(adding);
|
903 |
-
|
904 |
-
refresh_attr(i,'type_checkbox');
|
905 |
-
}
|
906 |
|
907 |
-
|
908 |
-
{
|
909 |
-
table=document.getElementById('button_opt'+j);
|
910 |
-
button=document.getElementById(i+'_elementform_id_temp'+j);
|
911 |
-
table.parentNode.removeChild(table);
|
912 |
-
button.parentNode.removeChild(button);
|
913 |
-
}
|
914 |
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
|
|
921 |
|
922 |
-
|
923 |
-
{
|
924 |
-
if(document.getElementById(id).value=="yes")
|
925 |
-
document.getElementById(id).setAttribute("value", "no")
|
926 |
-
else
|
927 |
-
document.getElementById(id).setAttribute("value", "yes")
|
928 |
-
}
|
929 |
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
document.getElementById(id+'_element_sectionform_id_temp').setAttribute("class",x);
|
936 |
-
}
|
937 |
|
938 |
-
|
939 |
-
{
|
940 |
-
if(document.getElementById(id+"form_id_temp").value=="yes")
|
941 |
-
{
|
942 |
-
document.getElementById(id+"form_id_temp").setAttribute("value", "no");
|
943 |
-
document.getElementById(id+"_elementform_id_temp").innerHTML="";
|
944 |
-
}
|
945 |
-
else
|
946 |
-
{
|
947 |
-
document.getElementById(id+"form_id_temp").setAttribute("value", "yes")
|
948 |
-
document.getElementById(id+"_elementform_id_temp").innerHTML=" *";
|
949 |
-
}
|
950 |
-
}
|
951 |
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
else
|
959 |
-
{
|
960 |
-
document.getElementById(id).setAttribute("value", "yes")
|
961 |
-
}
|
962 |
-
}
|
963 |
|
964 |
-
|
965 |
-
{
|
966 |
-
if(document.getElementById(id).value=="yes")
|
967 |
-
{
|
968 |
-
document.getElementById(id).setAttribute("value", "no");
|
969 |
-
}
|
970 |
-
else
|
971 |
-
{
|
972 |
-
document.getElementById(id).setAttribute("value", "yes")
|
973 |
-
}
|
974 |
-
}
|
975 |
-
function show_other_input(num)
|
976 |
-
{
|
977 |
-
for(k=0;k<50;k++)
|
978 |
-
if( document.getElementById(num+"_elementform_id_temp"+k))
|
979 |
-
if( document.getElementById(num+"_elementform_id_temp"+k).getAttribute('other'))
|
980 |
-
if( document.getElementById(num+"_elementform_id_temp"+k).getAttribute('other')==1)
|
981 |
-
{
|
982 |
-
element_other=document.getElementById(num+"_elementform_id_temp"+k);
|
983 |
-
break;
|
984 |
-
}
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
parent=element_other.parentNode;
|
989 |
-
|
990 |
-
var br = document.createElement('br');
|
991 |
-
br.setAttribute("id", num+"_other_brform_id_temp");
|
992 |
-
|
993 |
-
var el_other = document.createElement('input');
|
994 |
-
el_other.setAttribute("id", num+"_other_inputform_id_temp");
|
995 |
-
el_other.setAttribute("name", num+"_other_inputform_id_temp");
|
996 |
-
el_other.setAttribute("type", "text");
|
997 |
-
el_other.setAttribute("class", "other_input");
|
998 |
-
parent.appendChild(br);
|
999 |
-
parent.appendChild(el_other);
|
1000 |
|
1001 |
-
|
|
|
|
|
|
|
|
|
|
|
1002 |
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
j++;
|
1028 |
-
element='input';
|
1029 |
-
|
1030 |
-
var table = document.getElementById(num+'_table_little');
|
1031 |
-
var tr = document.createElement('tr');
|
1032 |
-
tr.setAttribute("id", num+"_element_tr"+j);
|
1033 |
-
var td = document.createElement('td');
|
1034 |
-
td.setAttribute("valign", "top");
|
1035 |
-
td.setAttribute("id", num+"_td_little"+j);
|
1036 |
-
td.setAttribute("idi", j);
|
1037 |
-
var adding = document.createElement(element);
|
1038 |
-
adding.setAttribute("type", type);
|
1039 |
-
adding.setAttribute("value", "other");
|
1040 |
-
adding.setAttribute("other", "1");
|
1041 |
-
adding.setAttribute("id", num+"_elementform_id_temp"+j);
|
1042 |
-
if(type=="checkbox")
|
1043 |
-
{
|
1044 |
-
adding.setAttribute("onClick", "if(set_checked('"+num+"','"+j+"','form_id_temp')) show_other_input('"+num+"','form_id_temp');");
|
1045 |
-
adding.setAttribute("name", num+"_elementform_id_temp"+j);
|
1046 |
-
}
|
1047 |
-
else
|
1048 |
-
{
|
1049 |
-
adding.setAttribute("onClick", "set_default('"+num+"','"+j+"','form_id_temp'); show_other_input('"+num+"','form_id_temp');");
|
1050 |
-
adding.setAttribute("name", num+"_elementform_id_temp");
|
1051 |
-
}
|
1052 |
-
|
1053 |
-
|
1054 |
-
var label_adding = document.createElement('label');
|
1055 |
-
label_adding.setAttribute("id", num+"_label_element"+j);
|
1056 |
-
label_adding.setAttribute("class", "ch_rad_label");
|
1057 |
-
label_adding.setAttribute("for",num+"_elementform_id_temp"+j);
|
1058 |
-
label_adding.innerHTML="other";
|
1059 |
-
td.appendChild(adding);
|
1060 |
-
td.appendChild(label_adding);
|
1061 |
-
tr.appendChild(td);
|
1062 |
-
table.appendChild(tr);
|
1063 |
-
|
1064 |
-
var choices_td= document.getElementById('choices');
|
1065 |
-
var br = document.createElement('br');
|
1066 |
-
br.setAttribute("id", "br"+j);
|
1067 |
-
var el_choices = document.createElement('input');
|
1068 |
-
el_choices.setAttribute("id", "el_choices"+j);
|
1069 |
-
el_choices.setAttribute("type", "text");
|
1070 |
-
el_choices.setAttribute("value", "other");
|
1071 |
-
el_choices.style.cssText = "width:100px; margin:0; padding:0; border-width: 1px";
|
1072 |
-
el_choices.setAttribute("onKeyUp", "change_label('"+num+"_label_element"+j+"', this.value); change_in_value('"+num+"_elementform_id_temp"+j+"', this.value)");
|
1073 |
-
|
1074 |
-
var el_choices_remove = document.createElement('img');
|
1075 |
-
el_choices_remove.setAttribute("id", "el_choices"+j+"_remove");
|
1076 |
-
el_choices_remove.setAttribute("src", plugin_url+'/images/delete.png');
|
1077 |
-
el_choices_remove.style.cssText = 'cursor:pointer;vertical-align:middle; margin:3px; display:none';
|
1078 |
-
el_choices_remove.setAttribute("align", 'top');
|
1079 |
-
el_choices_remove.setAttribute("onClick", "remove_choise('"+j+"','"+num+"')");
|
1080 |
-
|
1081 |
-
choices_td.appendChild(br);
|
1082 |
-
choices_td.appendChild(el_choices);
|
1083 |
-
choices_td.appendChild(el_choices_remove);
|
1084 |
-
refresh_attr(num, 'type_checkbox');
|
1085 |
-
if(q==1)
|
1086 |
-
{
|
1087 |
-
flow_hor(num);
|
1088 |
-
}
|
1089 |
-
}
|
1090 |
}
|
1091 |
|
1092 |
-
function
|
1093 |
-
{
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
for(k=0; k<n;k++)
|
1098 |
-
td_array[k]=tbody.childNodes[k].childNodes[0];
|
1099 |
-
|
1100 |
-
for(k=0; k<n;k++)
|
1101 |
-
tbody.removeChild(tbody.childNodes[0]);
|
1102 |
-
|
1103 |
-
var tr = document.createElement('tr');
|
1104 |
-
tr.setAttribute("id", id+"_hor");
|
1105 |
-
|
1106 |
-
tbody.appendChild(tr);
|
1107 |
-
for(k=0; k<n;k++)
|
1108 |
-
tr.appendChild(td_array[k]);
|
1109 |
-
}
|
1110 |
|
1111 |
-
|
1112 |
-
|
1113 |
-
tbody=document.getElementById(id+'_table_little');
|
1114 |
-
tr=document.getElementById(id+'_hor');
|
1115 |
-
td_array= new Array();
|
1116 |
-
n=tr.childNodes.length;
|
1117 |
-
|
1118 |
-
for(k=0; k<n;k++)
|
1119 |
-
td_array[k]=tr.childNodes[k];
|
1120 |
-
|
1121 |
-
tbody.removeChild(tr);
|
1122 |
-
|
1123 |
-
for(k=0; k<n;k++)
|
1124 |
-
{
|
1125 |
-
var tr_little = document.createElement('tr');
|
1126 |
-
tr_little.setAttribute("id", id+"_element_tr"+td_array[k].getAttribute("idi"));
|
1127 |
-
tr_little.appendChild(td_array[k]);
|
1128 |
-
tbody.appendChild(tr_little);
|
1129 |
-
}
|
1130 |
-
}
|
1131 |
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
var chCode1 = e.which || e.keyCode;
|
1136 |
-
if (chCode1 > 31 && (chCode1 < 51 || chCode1 > 57))
|
1137 |
-
return false
|
1138 |
-
else if((document.getElementById('captcha_digit').value+(chCode1-48))>9)
|
1139 |
-
return false;
|
1140 |
-
return true;
|
1141 |
-
}
|
1142 |
|
1143 |
-
|
1144 |
-
|
1145 |
-
if(select_.options[0].selected)
|
1146 |
-
{
|
1147 |
-
select_.options[0].setAttribute("selected", "selected");
|
1148 |
-
select_.options[1].removeAttribute("selected");
|
1149 |
-
}
|
1150 |
-
else
|
1151 |
-
{
|
1152 |
-
select_.options[1].setAttribute("selected", "selected");
|
1153 |
-
select_.options[0].removeAttribute("selected");
|
1154 |
-
}
|
1155 |
|
1156 |
-
|
|
|
1157 |
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
if(document.getElementById('captcha_digit').value)
|
1162 |
-
{
|
1163 |
-
captcha.setAttribute("digit", digit);
|
1164 |
-
|
1165 |
-
captcha.setAttribute("src", url_for_ajax+"?action=formmakerwdcaptcha"+"&digit="+digit+"&i=form_id_temp");
|
1166 |
-
document.getElementById('_wd_captcha_inputform_id_temp').style.width=(document.getElementById('captcha_digit').value*10+15)+"px";
|
1167 |
-
}
|
1168 |
-
else
|
1169 |
-
{
|
1170 |
-
captcha.setAttribute("digit", "6");
|
1171 |
-
captcha.setAttribute("src", url_for_ajax+"?action=formmakerwdcaptcha"+"&digit=6"+"&i=form_id_temp");
|
1172 |
-
document.getElementById('_wd_captcha_inputform_id_temp').style.width=(6*10+15)+"px";
|
1173 |
-
}
|
1174 |
-
}
|
1175 |
|
1176 |
-
function second_no(id)
|
1177 |
-
{
|
1178 |
-
time_box=document.getElementById(id+'_tr_time1');
|
1179 |
-
text_box=document.getElementById(id+'_tr_time2');
|
1180 |
-
second_box=document.getElementById(id+'_td_time_input3');
|
1181 |
-
second_text=document.getElementById(id+'_td_time_label3');
|
1182 |
-
document.getElementById(id+'_td_time_input2').parentNode.removeChild(document.getElementById(id+'_td_time_input2').nextSibling);
|
1183 |
-
time_box.removeChild(second_box);
|
1184 |
-
text_box.removeChild(second_text.previousSibling);
|
1185 |
-
text_box.removeChild(second_text);
|
1186 |
-
|
1187 |
-
}
|
1188 |
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
var td_time_input2_ket = document.createElement('td');
|
1195 |
-
td_time_input2_ket.setAttribute("align", "center");
|
1196 |
-
var td_time_input3 = document.createElement('td');
|
1197 |
-
td_time_input3.setAttribute("id", id+"_td_time_input3");
|
1198 |
-
|
1199 |
-
var td_time_label2_ket = document.createElement('td');
|
1200 |
-
|
1201 |
-
var td_time_label3 = document.createElement('td');
|
1202 |
-
td_time_label3.setAttribute("id", id+"_td_time_label3");
|
1203 |
-
|
1204 |
-
var mm_ = document.createElement('span');
|
1205 |
-
mm_.setAttribute("class", 'wdform_colon');
|
1206 |
-
mm_.style.cssText = "font-style:bold; vertical-align:middle";
|
1207 |
-
mm_.innerHTML=" : ";
|
1208 |
-
td_time_input2_ket.appendChild(mm_);
|
1209 |
-
|
1210 |
-
var ss = document.createElement('input');
|
1211 |
-
|
1212 |
-
ss.setAttribute("type", 'text');
|
1213 |
-
ss.setAttribute("value", w_ss);
|
1214 |
-
|
1215 |
-
ss.setAttribute("class", "time_box");
|
1216 |
-
ss.setAttribute("id", id+"_ssform_id_temp");
|
1217 |
-
ss.setAttribute("name", id+"_ssform_id_temp");
|
1218 |
-
ss.setAttribute("onKeyPress", "return check_second(event, '"+id+"_ssform_id_temp')");
|
1219 |
-
ss.setAttribute("onKeyUp", "change_second('"+id+"_ssform_id_temp')");
|
1220 |
-
ss.setAttribute("onBlur", "add_0('"+id+"_ssform_id_temp')");
|
1221 |
-
var ss_label = document.createElement('label');
|
1222 |
-
ss_label.setAttribute("class", "mini_label");
|
1223 |
-
ss_label.innerHTML="SS";
|
1224 |
-
|
1225 |
-
td_time_input3.appendChild(ss);
|
1226 |
-
td_time_label3.appendChild(ss_label);
|
1227 |
-
|
1228 |
-
if(document.getElementById(id+'_am_pm_select'))
|
1229 |
-
{
|
1230 |
-
select_=document.getElementById(id+"_am_pm_select");
|
1231 |
-
select_text=document.getElementById(id+"_am_pm_label");
|
1232 |
-
|
1233 |
-
time_box.insertBefore(td_time_input3, select_);
|
1234 |
-
time_box.insertBefore(td_time_input2_ket, td_time_input3);
|
1235 |
-
|
1236 |
-
text_box.insertBefore(td_time_label3, select_text);
|
1237 |
-
text_box.insertBefore(td_time_label2_ket, td_time_label3);
|
1238 |
-
}
|
1239 |
-
else
|
1240 |
-
{
|
1241 |
-
time_box.appendChild(td_time_input2_ket);
|
1242 |
-
time_box.appendChild(td_time_input3);
|
1243 |
-
text_box.appendChild(td_time_label2_ket);
|
1244 |
-
text_box.appendChild(td_time_label3);
|
1245 |
-
}
|
1246 |
-
refresh_attr(id, 'type_time');
|
1247 |
-
}
|
1248 |
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
var chCode1 = e.which || e.keyCode;
|
1253 |
-
if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57))
|
1254 |
-
return false;
|
1255 |
-
return true;
|
1256 |
-
}
|
1257 |
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
document.getElementById(id).innerHTML=w;
|
1268 |
-
}
|
1269 |
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
|
|
|
|
|
|
|
|
1274 |
|
1275 |
-
|
1276 |
-
{
|
1277 |
-
|
1278 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1279 |
|
1280 |
-
|
1281 |
-
{
|
1282 |
-
|
1283 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1284 |
|
1285 |
-
|
1286 |
-
{
|
1287 |
-
|
1288 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1289 |
|
1290 |
-
|
1291 |
-
{
|
1292 |
-
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1296 |
|
1297 |
-
|
1298 |
-
{
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
|
1320 |
-
|
1321 |
-
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
|
1345 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1346 |
|
1347 |
-
|
1348 |
-
{
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
|
1375 |
-
|
1376 |
-
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
|
|
|
1398 |
}
|
1399 |
|
1400 |
-
function right_row(id)
|
1401 |
-
{
|
1402 |
-
tr=document.getElementById(id);
|
1403 |
-
table_big=tr.parentNode.parentNode;
|
1404 |
-
td_big=tr.parentNode.parentNode.parentNode;
|
1405 |
-
if(table_big.nextSibling!=null)
|
1406 |
-
{
|
1407 |
-
td_next=table_big.nextSibling;
|
1408 |
-
td_next.firstChild.appendChild(tr);
|
1409 |
-
|
1410 |
-
}
|
1411 |
-
else
|
1412 |
-
{
|
1413 |
-
|
1414 |
-
var new_td = document.createElement('td');
|
1415 |
-
new_td.setAttribute("valign", "top");
|
1416 |
-
|
1417 |
-
var new_table = document.createElement('table');
|
1418 |
-
new_table.setAttribute("class", "wdform_table2");
|
1419 |
-
var new_tbody = document.createElement('tbody');
|
1420 |
-
|
1421 |
-
// tr_big.appendChild(new_td);
|
1422 |
-
|
1423 |
-
td_big.appendChild(new_table);
|
1424 |
-
|
1425 |
-
new_table.appendChild(new_tbody);
|
1426 |
-
|
1427 |
-
new_tbody.appendChild(tr);
|
1428 |
-
|
1429 |
-
}
|
1430 |
-
|
1431 |
-
if(table_big.firstChild.firstChild==null)
|
1432 |
-
td_big.removeChild(table_big);
|
1433 |
-
|
1434 |
-
}
|
1435 |
|
1436 |
-
function
|
1437 |
-
{
|
1438 |
-
|
1439 |
-
|
1440 |
-
|
1441 |
-
|
1442 |
-
|
1443 |
-
|
1444 |
-
|
1445 |
-
|
1446 |
-
|
1447 |
-
|
1448 |
-
|
1449 |
-
|
1450 |
-
|
1451 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1452 |
|
1453 |
-
|
1454 |
-
|
1455 |
-
|
1456 |
-
|
1457 |
-
form_view_elemet =form.parentNode.parentNode.parentNode.parentNode;
|
1458 |
-
form_view_elemet_copy =form.parentNode.parentNode.parentNode.parentNode;
|
1459 |
-
|
1460 |
-
table=form_view_elemet.parentNode;
|
1461 |
-
|
1462 |
-
//alert(table);
|
1463 |
-
|
1464 |
-
while(table)
|
1465 |
-
{
|
1466 |
-
table=table.previousSibling;
|
1467 |
-
while(table)
|
1468 |
-
{
|
1469 |
-
if(table.tagName=="TABLE")
|
1470 |
-
break;
|
1471 |
-
else
|
1472 |
-
table=table.previousSibling;
|
1473 |
-
}
|
1474 |
-
|
1475 |
-
if(!table)
|
1476 |
-
{
|
1477 |
-
alert('Unable to move');
|
1478 |
-
return;
|
1479 |
-
}
|
1480 |
-
form_maker_remove_spaces(table);
|
1481 |
-
if(jQuery(table.firstChild).is(":visible"))
|
1482 |
-
break;
|
1483 |
-
|
1484 |
-
}
|
1485 |
-
|
1486 |
-
|
1487 |
-
n=table.firstChild.childNodes.length;
|
1488 |
-
|
1489 |
-
table.firstChild.childNodes[n-2].firstChild.firstChild.firstChild.appendChild(document.getElementById(id));
|
1490 |
-
|
1491 |
-
/* glob_n=form_view_elemet_copy.firstChild.firstChild.childNodes.length;
|
1492 |
-
for(i=0; i<glob_n; i++)
|
1493 |
-
{
|
1494 |
-
if(table.firstChild.firstChild.childNodes[i])
|
1495 |
-
{
|
1496 |
-
to_add=table.firstChild.firstChild.childNodes[i];
|
1497 |
-
to_add.firstChild.firstChild.appendChild(document.getElementById(id));
|
1498 |
-
}
|
1499 |
-
else
|
1500 |
-
{
|
1501 |
-
to_add=table.firstChild.firstChild.firstChild;
|
1502 |
-
to_add.firstChild.firstChild.appendChild(document.getElementById(id));
|
1503 |
-
}
|
1504 |
-
}*/
|
1505 |
-
|
1506 |
-
|
1507 |
-
refresh_pages(id);
|
1508 |
-
|
1509 |
-
|
1510 |
-
|
1511 |
-
|
1512 |
|
1513 |
}
|
1514 |
|
1515 |
-
function page_down(id)
|
1516 |
-
{
|
1517 |
-
form=document.getElementById(id).parentNode;
|
1518 |
-
|
1519 |
-
form_view_elemet =form.parentNode.parentNode.parentNode.parentNode;
|
1520 |
-
form_view_elemet_copy =form.parentNode.parentNode.parentNode.parentNode;
|
1521 |
-
|
1522 |
-
table=form_view_elemet.parentNode;
|
1523 |
-
|
1524 |
-
while(table)
|
1525 |
-
{
|
1526 |
-
table=table.nextSibling;
|
1527 |
-
|
1528 |
-
while(table)
|
1529 |
-
{
|
1530 |
-
if(table.tagName=="TABLE")
|
1531 |
-
break;
|
1532 |
-
else
|
1533 |
-
table=table.nextSibling;
|
1534 |
-
}
|
1535 |
-
|
1536 |
-
if(!table)
|
1537 |
-
{
|
1538 |
-
alert('Unable to move');
|
1539 |
-
return;
|
1540 |
-
}
|
1541 |
-
|
1542 |
-
if(jQuery(table.firstChild).is(":visible"))
|
1543 |
-
break;
|
1544 |
-
}
|
1545 |
-
|
1546 |
-
n=table.firstChild.childNodes.length;
|
1547 |
-
|
1548 |
-
table.firstChild.firstChild.firstChild.firstChild.firstChild.insertBefore(document.getElementById(id), table.firstChild.firstChild.firstChild.firstChild.firstChild.firstChild);
|
1549 |
-
refresh_pages(id);
|
1550 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1551 |
}
|
1552 |
|
|
|
|
|
|
|
|
|
|
|
1553 |
|
|
|
|
|
|
|
|
|
1554 |
|
1555 |
-
|
1556 |
-
{
|
1557 |
-
select_=document.getElementById('sel_el_pos');
|
1558 |
-
select_.setAttribute("disabled", "disabled");
|
1559 |
-
select_.innerHTML="";
|
1560 |
}
|
1561 |
|
1562 |
-
function
|
1563 |
-
|
1564 |
-
|
1565 |
-
|
1566 |
-
|
1567 |
-
|
1568 |
-
select_.innerHTML="";
|
1569 |
-
|
1570 |
-
for(k=1;k<=form_view_max;k++)
|
1571 |
-
if(document.getElementById('form_id_tempform_view'+k))
|
1572 |
-
{
|
1573 |
-
form_view_element=document.getElementById('form_id_tempform_view'+k);
|
1574 |
-
form_maker_remove_spaces(form_view_element);
|
1575 |
-
n=form_view_element.childNodes.length-2;
|
1576 |
-
for(z=0;z<=n;z++)
|
1577 |
-
{
|
1578 |
-
if(!form_view_element.childNodes[z].id)
|
1579 |
-
{
|
1580 |
-
GLOBAL_tr=form_view_element.childNodes[z];
|
1581 |
-
|
1582 |
-
for (x=0; x < GLOBAL_tr.firstChild.childNodes.length; x++)
|
1583 |
-
{
|
1584 |
-
table=GLOBAL_tr.firstChild.childNodes[x];
|
1585 |
-
tbody=table.firstChild;
|
1586 |
-
for (y=0; y < tbody.childNodes.length; y++)
|
1587 |
-
{
|
1588 |
-
tr=tbody.childNodes[y];
|
1589 |
-
var option = document.createElement('option');
|
1590 |
-
option.setAttribute("id", tr.id+"_sel_el_pos");
|
1591 |
-
option.setAttribute("value", tr.id);
|
1592 |
-
option.innerHTML=document.getElementById( tr.id+'_element_labelform_id_temp').innerHTML;
|
1593 |
-
select_.appendChild(option);
|
1594 |
-
}
|
1595 |
-
}
|
1596 |
-
}
|
1597 |
-
}
|
1598 |
-
}
|
1599 |
-
|
1600 |
-
select_.removeAttribute("disabled");
|
1601 |
-
}
|
1602 |
|
1603 |
-
|
1604 |
-
|
1605 |
-
|
1606 |
-
|
1607 |
-
if(document.getElementById('form_id_tempform_view'+k))
|
1608 |
-
{
|
1609 |
-
form_view_element=document.getElementById('form_id_tempform_view'+k);
|
1610 |
-
form_maker_remove_spaces(form_view_element);
|
1611 |
-
n=form_view_element.childNodes.length-2;
|
1612 |
-
for(z=0;z<=n;z++)
|
1613 |
-
{
|
1614 |
-
if(!form_view_element.childNodes[z].id)
|
1615 |
-
{
|
1616 |
-
GLOBAL_tr=form_view_element.childNodes[z];
|
1617 |
-
|
1618 |
-
for (x=0; x < GLOBAL_tr.firstChild.childNodes.length; x++)
|
1619 |
-
{
|
1620 |
-
table=GLOBAL_tr.firstChild.childNodes[x];
|
1621 |
-
tbody=table.firstChild;
|
1622 |
-
for (y=0; y < tbody.childNodes.length; y++)
|
1623 |
-
{
|
1624 |
-
tr=tbody.childNodes[y];
|
1625 |
-
labels.push( document.getElementById(tr.id+'_element_labelform_id_temp').innerHTML);
|
1626 |
-
}
|
1627 |
-
}
|
1628 |
-
}
|
1629 |
-
}
|
1630 |
-
}
|
1631 |
-
|
1632 |
-
return labels;
|
1633 |
-
}
|
1634 |
|
1635 |
-
|
1636 |
-
|
1637 |
-
|
1638 |
-
|
1639 |
-
checking.setAttribute("checked", "checked");
|
1640 |
-
if(!checking.checked)
|
1641 |
-
{
|
1642 |
-
checking.removeAttribute("checked");
|
1643 |
-
if(checking.getAttribute('other'))
|
1644 |
-
if(checking.getAttribute('other')==1)
|
1645 |
-
{
|
1646 |
-
if(document.getElementById(id+"_other_inputform_id_temp"))
|
1647 |
-
{
|
1648 |
-
document.getElementById(id+"_other_inputform_id_temp").parentNode.removeChild(document.getElementById(id+"_other_brform_id_temp"));
|
1649 |
-
document.getElementById(id+"_other_inputform_id_temp").parentNode.removeChild(document.getElementById(id+"_other_inputform_id_temp"));
|
1650 |
-
}
|
1651 |
-
return false;
|
1652 |
-
}
|
1653 |
-
}
|
1654 |
-
return true;
|
1655 |
-
}
|
1656 |
|
1657 |
-
|
1658 |
-
|
1659 |
-
|
1660 |
-
|
1661 |
-
|
1662 |
-
|
1663 |
-
|
1664 |
-
|
1665 |
-
|
1666 |
-
if(document.getElementById(id+"_other_inputform_id_temp"))
|
1667 |
-
{
|
1668 |
-
document.getElementById(id+"_other_inputform_id_temp").parentNode.removeChild(document.getElementById(id+"_other_brform_id_temp"));
|
1669 |
-
document.getElementById(id+"_other_inputform_id_temp").parentNode.removeChild(document.getElementById(id+"_other_inputform_id_temp"));
|
1670 |
-
}
|
1671 |
-
}
|
1672 |
|
1673 |
-
|
1674 |
-
{
|
1675 |
-
for (p = select_.length - 1; p>=0; p--)
|
1676 |
-
if (select_.options[p].selected)
|
1677 |
-
select_.options[p].setAttribute("selected", "selected");
|
1678 |
-
else
|
1679 |
-
select_.options[p].removeAttribute("selected");
|
1680 |
-
}
|
1681 |
|
1682 |
-
function add_0(id)
|
1683 |
-
{
|
1684 |
-
input=document.getElementById(id);
|
1685 |
-
if(input.value.length==1)
|
1686 |
-
{
|
1687 |
-
input.value='0'+input.value;
|
1688 |
-
input.setAttribute("value", input.value);
|
1689 |
-
}
|
1690 |
}
|
1691 |
|
1692 |
-
function
|
1693 |
-
|
1694 |
-
|
1695 |
-
|
1696 |
-
input=document.getElementById(id);
|
1697 |
-
input.setAttribute("value", input.value);
|
1698 |
-
}
|
1699 |
}
|
1700 |
|
1701 |
-
function
|
1702 |
-
{
|
1703 |
-
if(check_minute(ev, id))
|
1704 |
-
{
|
1705 |
-
input=document.getElementById(id);
|
1706 |
-
input.setAttribute("value", input.value);
|
1707 |
-
}
|
1708 |
-
}
|
1709 |
|
1710 |
-
|
1711 |
-
|
1712 |
-
|
1713 |
-
{
|
1714 |
-
input=document.getElementById(id);
|
1715 |
-
input.setAttribute("value", input.value);
|
1716 |
-
}
|
1717 |
}
|
1718 |
|
1719 |
-
function
|
1720 |
-
|
1721 |
-
|
1722 |
-
|
1723 |
-
|
1724 |
-
|
1725 |
-
|
1726 |
-
hour=parseFloat(hour);
|
1727 |
-
if((hour<0) || (hour>hour_interval))
|
1728 |
-
return false;
|
1729 |
-
return true;
|
1730 |
-
}
|
1731 |
-
|
1732 |
-
function check_minute(e, id)
|
1733 |
-
{
|
1734 |
-
|
1735 |
-
|
1736 |
-
var chCode1 = e.which || e.keyCode;
|
1737 |
-
if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57))
|
1738 |
-
return false;
|
1739 |
-
minute=""+document.getElementById(id).value+String.fromCharCode(chCode1);
|
1740 |
-
|
1741 |
-
minute=parseFloat(minute);
|
1742 |
-
if((minute<0) || (minute>59))
|
1743 |
-
return false;
|
1744 |
-
return true;
|
1745 |
-
}
|
1746 |
-
|
1747 |
-
function check_second(e, id)
|
1748 |
-
{
|
1749 |
-
|
1750 |
-
|
1751 |
-
var chCode1 = e.which || e.keyCode;
|
1752 |
-
if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57))
|
1753 |
-
return false;
|
1754 |
-
second=""+document.getElementById(id).value+String.fromCharCode(chCode1);
|
1755 |
-
|
1756 |
-
second=parseFloat(second);
|
1757 |
-
if((second<0) || (second>59))
|
1758 |
-
return false;
|
1759 |
-
return true;
|
1760 |
-
}
|
1761 |
-
|
1762 |
-
function change_day(ev, id)
|
1763 |
-
{
|
1764 |
-
if(check_day(ev, id))
|
1765 |
-
{
|
1766 |
-
input=document.getElementById(id);
|
1767 |
-
input.setAttribute("value", input.value);
|
1768 |
-
}
|
1769 |
-
}
|
1770 |
|
1771 |
-
|
1772 |
-
|
1773 |
-
|
1774 |
-
|
1775 |
-
|
1776 |
-
|
1777 |
-
}
|
1778 |
-
}
|
1779 |
|
1780 |
-
|
1781 |
-
|
1782 |
-
|
1783 |
-
|
1784 |
-
from=parseFloat(document.getElementById(id).getAttribute('from'));
|
1785 |
-
to=parseFloat(document.getElementById(id).getAttribute('to'));
|
1786 |
-
|
1787 |
-
year=parseFloat(year);
|
1788 |
-
|
1789 |
-
if((year>=from) && (year<=to))
|
1790 |
-
document.getElementById(id).setAttribute("value", year);
|
1791 |
-
else
|
1792 |
-
document.getElementById(id).setAttribute("value", '');
|
1793 |
-
}
|
1794 |
|
1795 |
-
|
1796 |
-
|
1797 |
-
|
1798 |
-
|
1799 |
-
|
1800 |
-
day=""+document.getElementById(id).value+String.fromCharCode(chCode1);
|
1801 |
-
|
1802 |
-
if(day.length>2)
|
1803 |
-
return false;
|
1804 |
-
|
1805 |
-
if(day=='00')
|
1806 |
-
return false;
|
1807 |
-
|
1808 |
-
day=parseFloat(day);
|
1809 |
-
if((day<0) || (day>31))
|
1810 |
-
return false;
|
1811 |
-
return true;
|
1812 |
-
}
|
1813 |
-
|
1814 |
-
function check_month(e, id)
|
1815 |
-
{
|
1816 |
-
|
1817 |
-
|
1818 |
-
var chCode1 = e.which || e.keyCode;
|
1819 |
-
if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57))
|
1820 |
-
return false;
|
1821 |
-
month=""+document.getElementById(id).value+String.fromCharCode(chCode1);
|
1822 |
-
|
1823 |
-
if(month.length>2)
|
1824 |
-
return false;
|
1825 |
-
|
1826 |
-
if(month=='00')
|
1827 |
-
return false;
|
1828 |
-
|
1829 |
-
month=parseFloat(month);
|
1830 |
-
if((month<0) || (month>12))
|
1831 |
-
return false;
|
1832 |
-
return true;
|
1833 |
-
}
|
1834 |
-
|
1835 |
-
function check_year2(id)
|
1836 |
-
{
|
1837 |
-
year=document.getElementById(id).value;
|
1838 |
-
|
1839 |
-
from=parseFloat(document.getElementById(id).getAttribute('from'));
|
1840 |
-
|
1841 |
-
year=parseFloat(year);
|
1842 |
-
|
1843 |
-
if(year<from)
|
1844 |
-
{
|
1845 |
-
document.getElementById(id).value='';
|
1846 |
-
alert('The value of "year" is not valid.');
|
1847 |
-
}
|
1848 |
-
}
|
1849 |
|
1850 |
-
|
1851 |
-
{
|
1852 |
-
var chCode1 = e.which || e.keyCode;
|
1853 |
-
if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57))
|
1854 |
-
return false;
|
1855 |
|
1856 |
-
|
1857 |
-
|
1858 |
-
to=parseFloat(document.getElementById(id).getAttribute('to'));
|
1859 |
-
|
1860 |
-
year=parseFloat(year);
|
1861 |
-
|
1862 |
-
if(year>to)
|
1863 |
-
return false;
|
1864 |
-
return true;
|
1865 |
-
}
|
1866 |
-
|
1867 |
-
function label_top(num)
|
1868 |
-
{
|
1869 |
-
table=document.getElementById(num+'_elemet_tableform_id_temp');
|
1870 |
-
td1=document.getElementById(num+'_label_sectionform_id_temp');
|
1871 |
-
td2=document.getElementById(num+'_element_sectionform_id_temp');
|
1872 |
-
var table_t = document.createElement('tbody');
|
1873 |
-
var new_td1 = document.createElement('td');
|
1874 |
-
new_td1 = td1;
|
1875 |
-
var new_td2 = document.createElement('td');
|
1876 |
-
new_td2 = td2;
|
1877 |
-
var tr1 = document.createElement('tr');
|
1878 |
-
var tr2 = document.createElement('tr');
|
1879 |
-
//table.innerHTML=" ";
|
1880 |
-
while (table.firstChild)
|
1881 |
-
table.removeChild(table.firstChild);
|
1882 |
-
tr1.appendChild(new_td1);
|
1883 |
-
tr2.appendChild(new_td2);
|
1884 |
-
table_t.appendChild(tr1);
|
1885 |
-
table_t.appendChild(tr2);
|
1886 |
-
table.appendChild(table_t);
|
1887 |
-
}
|
1888 |
|
1889 |
-
|
1890 |
-
{
|
1891 |
-
table=document.getElementById(num+'_elemet_tableform_id_temp');
|
1892 |
-
td1=document.getElementById(num+'_label_sectionform_id_temp');
|
1893 |
-
td2=document.getElementById(num+'_element_sectionform_id_temp');
|
1894 |
-
var table_t = document.createElement('tbody');
|
1895 |
-
var new_td1 = document.createElement('td');
|
1896 |
-
new_td1 = td1;
|
1897 |
-
var new_td2 = document.createElement('td');
|
1898 |
-
new_td2 = td2;
|
1899 |
-
var tr = document.createElement('tr');
|
1900 |
-
//table.innerHTML=" ";
|
1901 |
-
while (table.firstChild)
|
1902 |
-
table.removeChild(table.firstChild);
|
1903 |
-
tr.appendChild(new_td1);
|
1904 |
-
tr.appendChild(new_td2);
|
1905 |
-
table_t.appendChild(tr);
|
1906 |
-
table.appendChild(table_t);
|
1907 |
-
}
|
1908 |
|
1909 |
-
function delete_value(id)
|
1910 |
-
{
|
1911 |
-
ofontStyle=document.getElementById(id).className;
|
1912 |
-
if(ofontStyle=="input_deactive")
|
1913 |
-
{
|
1914 |
-
document.getElementById(id).value="";
|
1915 |
-
destroyChildren(document.getElementById(id));
|
1916 |
-
document.getElementById(id).setAttribute("class", "input_active");
|
1917 |
-
document.getElementById(id).className='input_active';
|
1918 |
-
}
|
1919 |
-
}
|
1920 |
|
1921 |
-
|
1922 |
-
{
|
1923 |
-
input=document.getElementById(id);
|
1924 |
-
if(input.value=="")
|
1925 |
-
{
|
1926 |
-
input.value=input.title;
|
1927 |
-
input.className='input_deactive';
|
1928 |
-
input.setAttribute("class", 'input_deactive');
|
1929 |
-
}
|
1930 |
-
}
|
1931 |
|
1932 |
-
|
1933 |
-
{
|
1934 |
-
input=document.getElementById(id);
|
1935 |
-
|
1936 |
-
tag=input.tagName;
|
1937 |
-
if(tag=="TEXTAREA")
|
1938 |
-
{
|
1939 |
-
// destroyChildren(input)
|
1940 |
-
input.innerHTML=input.value;
|
1941 |
-
}
|
1942 |
-
else
|
1943 |
-
input.setAttribute("value", input.value);
|
1944 |
|
1945 |
-
|
1946 |
|
1947 |
-
|
1948 |
-
{
|
1949 |
-
input=document.getElementById(id);
|
1950 |
-
input.title=first_value;
|
1951 |
-
|
1952 |
-
if( window.getComputedStyle )
|
1953 |
-
{
|
1954 |
-
ofontStyle = window.getComputedStyle(input,null).fontStyle;
|
1955 |
-
} else if( input.currentStyle ) {
|
1956 |
-
ofontStyle = input.currentStyle.fontStyle;
|
1957 |
-
}
|
1958 |
-
if(ofontStyle=="italic")
|
1959 |
-
{
|
1960 |
-
input.value=first_value;
|
1961 |
-
input.setAttribute("value", first_value);
|
1962 |
-
}
|
1963 |
-
}
|
1964 |
|
1965 |
-
|
1966 |
-
{
|
1967 |
-
if(typeof(prefix)=='undefined') {prefix=''; postfix=''};
|
1968 |
-
input=document.getElementById(id);
|
1969 |
-
input.value=prefix+destination+postfix;
|
1970 |
-
input.setAttribute("value", prefix+destination+postfix);
|
1971 |
-
|
1972 |
-
}
|
1973 |
|
1974 |
-
|
1975 |
-
{
|
1976 |
-
enable();
|
1977 |
-
document.getElementById('edit_table').innerHTML="";
|
1978 |
-
document.getElementById('show_table').innerHTML="";
|
1979 |
-
document.getElementById('main_editor').style.display="none";
|
1980 |
-
if(document.getElementsByTagName("iframe")[id_ifr_editor]){
|
1981 |
-
ifr_id=document.getElementsByTagName("iframe")[id_ifr_editor].id;
|
1982 |
-
ifr=getIFrameDocument(ifr_id)
|
1983 |
-
|
1984 |
-
ifr.body.innerHTML="";
|
1985 |
-
}
|
1986 |
-
document.getElementById('form_maker_editor').value="";
|
1987 |
-
document.getElementById('editing_id').value="";
|
1988 |
-
document.getElementById('element_type').value="";
|
1989 |
|
1990 |
-
|
1991 |
-
for(x=0; x<12;x++)
|
1992 |
-
{
|
1993 |
-
if(alltypes[x]!='file_upload' && alltypes[x]!='map')
|
1994 |
-
document.getElementById('img_'+alltypes[x]).parentNode.style.backgroundColor='';
|
1995 |
-
}
|
1996 |
|
1997 |
-
|
1998 |
|
1999 |
-
|
2000 |
-
{
|
2001 |
-
document.getElementById(id).innerHTML=label;
|
2002 |
-
document.getElementById(id).value=label;
|
2003 |
-
}
|
2004 |
|
2005 |
-
function change_func(id, label)
|
2006 |
-
{
|
2007 |
-
document.getElementById(id).setAttribute("onclick", label);
|
2008 |
-
}
|
2009 |
|
2010 |
-
|
2011 |
-
{
|
2012 |
-
document.getElementById(id).setAttribute("value", label);
|
2013 |
-
}
|
2014 |
|
2015 |
-
|
2016 |
-
{
|
2017 |
-
document.getElementById(num+'_elementform_id_temp').style.width=size+'px';
|
2018 |
-
if(document.getElementById(num+'_element_input'))
|
2019 |
-
document.getElementById(num+'_element_input').style.width=size+'px';
|
2020 |
-
switch(size)
|
2021 |
-
{
|
2022 |
-
case '111':
|
2023 |
-
{
|
2024 |
-
document.getElementById(num+'_elementform_id_temp').setAttribute("rows", "2"); break;
|
2025 |
-
}
|
2026 |
-
case '222':
|
2027 |
-
{
|
2028 |
-
document.getElementById(num+'_elementform_id_temp').setAttribute("rows", "4");break;
|
2029 |
-
}
|
2030 |
-
case '444':
|
2031 |
-
{
|
2032 |
-
document.getElementById(num+'_elementform_id_temp').setAttribute("rows", "8");break;
|
2033 |
-
}
|
2034 |
-
}
|
2035 |
-
}
|
2036 |
|
2037 |
-
|
2038 |
-
{
|
2039 |
-
var q=0;
|
2040 |
-
if(document.getElementById(num+'_hor'))
|
2041 |
-
{
|
2042 |
-
q=1;
|
2043 |
-
flow_ver(num);
|
2044 |
-
}
|
2045 |
-
j++;
|
2046 |
-
if(type=='radio' || type=='checkbox')
|
2047 |
-
{
|
2048 |
-
element='input';
|
2049 |
-
|
2050 |
-
var table = document.getElementById(num+'_table_little');
|
2051 |
-
var tr = document.createElement('tr');
|
2052 |
-
tr.setAttribute("id", num+"_element_tr"+j);
|
2053 |
-
var td = document.createElement('td');
|
2054 |
-
td.setAttribute("valign", "top");
|
2055 |
-
td.setAttribute("id", num+"_td_little"+j);
|
2056 |
-
td.setAttribute("idi", j);
|
2057 |
-
|
2058 |
-
var adding = document.createElement(element);
|
2059 |
-
adding.setAttribute("type", type);
|
2060 |
-
adding.setAttribute("value", "");
|
2061 |
-
adding.setAttribute("id", num+"_elementform_id_temp"+j);
|
2062 |
-
if(type=='checkbox')
|
2063 |
-
{
|
2064 |
-
adding.setAttribute("onClick", "set_checked('"+num+"','"+j+"','form_id_temp')");
|
2065 |
-
adding.setAttribute("name", num+"_elementform_id_temp"+j);
|
2066 |
-
}
|
2067 |
-
|
2068 |
-
if(type=='radio')
|
2069 |
-
{
|
2070 |
-
adding.setAttribute("onClick", "set_default('"+num+"','"+j+"','form_id_temp')");
|
2071 |
-
adding.setAttribute("name", num+"_elementform_id_temp");
|
2072 |
-
}
|
2073 |
-
|
2074 |
-
|
2075 |
-
var label_adding = document.createElement('label');
|
2076 |
-
label_adding.setAttribute("id", num+"_label_element"+j);
|
2077 |
-
label_adding.setAttribute("class", "ch_rad_label");
|
2078 |
-
label_adding.setAttribute("for",num+"_elementform_id_temp"+j);
|
2079 |
-
td.appendChild(adding);
|
2080 |
-
td.appendChild(label_adding);
|
2081 |
-
tr.appendChild(td);
|
2082 |
-
table.appendChild(tr);
|
2083 |
-
|
2084 |
-
var choices_td= document.getElementById('choices');
|
2085 |
-
var br = document.createElement('br');
|
2086 |
-
br.setAttribute("id", "br"+j);
|
2087 |
-
var el_choices = document.createElement('input');
|
2088 |
-
el_choices.setAttribute("id", "el_choices"+j);
|
2089 |
-
el_choices.setAttribute("type", "text");
|
2090 |
-
el_choices.setAttribute("value", "");
|
2091 |
-
el_choices.style.cssText = "width:100px; margin:0; padding:0; border-width: 1px";
|
2092 |
-
el_choices.setAttribute("onKeyUp", "change_label('"+num+"_label_element"+j+"', this.value); change_in_value('"+num+"_elementform_id_temp"+j+"', this.value)");
|
2093 |
-
|
2094 |
-
var el_choices_remove = document.createElement('img');
|
2095 |
-
el_choices_remove.setAttribute("id", "el_choices"+j+"_remove");
|
2096 |
-
el_choices_remove.setAttribute("src", plugin_url+'/images/delete.png');
|
2097 |
-
el_choices_remove.style.cssText = 'cursor:pointer;vertical-align:middle; margin:3px';
|
2098 |
-
el_choices_remove.setAttribute("align", 'top');
|
2099 |
-
el_choices_remove.setAttribute("onClick", "remove_choise('"+j+"','"+num+"')");
|
2100 |
-
|
2101 |
-
choices_td.appendChild(br);
|
2102 |
-
choices_td.appendChild(el_choices);
|
2103 |
-
choices_td.appendChild(el_choices_remove);
|
2104 |
-
|
2105 |
-
if(type=='checkbox')
|
2106 |
-
{
|
2107 |
-
refresh_id_name(num, 'type_checkbox');
|
2108 |
-
}
|
2109 |
-
|
2110 |
-
if(type=='radio')
|
2111 |
-
{
|
2112 |
-
refresh_id_name(num, 'type_radio');
|
2113 |
-
}
|
2114 |
-
|
2115 |
-
|
2116 |
-
refresh_attr(num, 'type_checkbox');
|
2117 |
-
|
2118 |
-
}
|
2119 |
-
|
2120 |
-
if(type=='select')
|
2121 |
-
{
|
2122 |
-
var select_ = document.getElementById(num+'_elementform_id_temp');
|
2123 |
-
var option = document.createElement('option');
|
2124 |
-
option.setAttribute("id", num+"_option"+j);
|
2125 |
-
|
2126 |
-
select_.appendChild(option);
|
2127 |
-
|
2128 |
-
var choices_td= document.getElementById('choices');
|
2129 |
-
var br = document.createElement('br');
|
2130 |
-
br.setAttribute("id", "br"+j);
|
2131 |
-
var el_choices = document.createElement('input');
|
2132 |
-
el_choices.setAttribute("id", "el_option"+j);
|
2133 |
-
el_choices.setAttribute("type", "text");
|
2134 |
-
el_choices.setAttribute("value", "");
|
2135 |
-
el_choices.style.cssText = "width:100px; margin:0; padding:0; border-width: 1px";
|
2136 |
-
el_choices.setAttribute("onKeyUp", "change_label('"+num+"_option"+j+"', this.value)");
|
2137 |
-
|
2138 |
-
var el_choices_remove = document.createElement('img');
|
2139 |
-
el_choices_remove.setAttribute("id", "el_option"+j+"_remove");
|
2140 |
-
el_choices_remove.setAttribute("src", plugin_url+'/images/delete.png');
|
2141 |
-
el_choices_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
|
2142 |
-
el_choices_remove.setAttribute("align", 'top');
|
2143 |
-
el_choices_remove.setAttribute("onClick", "remove_option('"+j+"','"+num+"')");
|
2144 |
-
|
2145 |
-
var el_choices_dis = document.createElement('input');
|
2146 |
-
el_choices_dis.setAttribute("type", 'checkbox');
|
2147 |
-
el_choices_dis.setAttribute("id", "el_option"+j+"_dis");
|
2148 |
-
el_choices_dis.setAttribute("onClick", "dis_option('"+num+"_option"+j+"', this.checked)");
|
2149 |
-
|
2150 |
-
|
2151 |
-
choices_td.appendChild(br);
|
2152 |
-
choices_td.appendChild(el_choices);
|
2153 |
-
choices_td.appendChild(el_choices_dis);
|
2154 |
-
choices_td.appendChild(el_choices_remove);
|
2155 |
-
}
|
2156 |
-
if(q==1)
|
2157 |
-
{
|
2158 |
-
flow_hor(num);
|
2159 |
-
}
|
2160 |
|
2161 |
-
|
2162 |
|
2163 |
-
|
2164 |
-
{
|
2165 |
-
var q=0;
|
2166 |
-
if(document.getElementById(num+'_hor'))
|
2167 |
-
{
|
2168 |
-
q=1;
|
2169 |
-
flow_ver(num);
|
2170 |
-
}
|
2171 |
-
j++;
|
2172 |
-
var table = document.getElementById(num+'_table_little');
|
2173 |
-
var tr = document.getElementById(num+'_element_tr'+id);
|
2174 |
-
table.removeChild(tr);
|
2175 |
-
|
2176 |
-
var choices_td= document.getElementById('choices');
|
2177 |
-
var el_choices = document.getElementById('el_choices'+id);
|
2178 |
-
var el_choices_remove = document.getElementById('el_choices'+id+'_remove');
|
2179 |
-
var br = document.getElementById('br'+id);
|
2180 |
-
|
2181 |
-
choices_td.removeChild(el_choices);
|
2182 |
-
choices_td.removeChild(el_choices_remove);
|
2183 |
-
choices_td.removeChild(br);
|
2184 |
-
|
2185 |
-
if(q==1)
|
2186 |
-
{
|
2187 |
-
flow_hor(num);
|
2188 |
-
}
|
2189 |
-
refresh_id_name(num, document.getElementById(num+'_typeform_id_temp').value );
|
2190 |
|
2191 |
-
|
2192 |
|
2193 |
-
|
2194 |
-
{
|
2195 |
-
var select_ = document.getElementById(num+'_elementform_id_temp');
|
2196 |
-
var option = document.getElementById(num+'_option'+id);
|
2197 |
-
|
2198 |
-
select_.removeChild(option);
|
2199 |
-
|
2200 |
-
var choices_td= document.getElementById('choices');
|
2201 |
-
var el_choices = document.getElementById('el_option'+id);
|
2202 |
-
var el_choices_dis = document.getElementById('el_option'+id+'_dis');
|
2203 |
-
var el_choices_remove = document.getElementById('el_option'+id+'_remove');
|
2204 |
-
var br = document.getElementById('br'+id);
|
2205 |
-
|
2206 |
-
choices_td.removeChild(el_choices);
|
2207 |
-
choices_td.removeChild(el_choices_dis);
|
2208 |
-
choices_td.removeChild(el_choices_remove);
|
2209 |
-
choices_td.removeChild(br);
|
2210 |
-
}
|
2211 |
|
2212 |
-
|
2213 |
-
var rv = null;
|
2214 |
-
// if contentDocument exists, W3C compliant (Mozilla)
|
2215 |
-
if (document.getElementById(aID).contentDocument){
|
2216 |
-
rv = document.getElementById(aID).contentDocument;
|
2217 |
-
} else {
|
2218 |
-
// IE
|
2219 |
-
rv = document.frames[aID].document;
|
2220 |
-
}
|
2221 |
-
return rv;
|
2222 |
-
}
|
2223 |
|
2224 |
-
|
2225 |
-
{
|
2226 |
-
if(document.getElementsByTagName("iframe")[id_ifr_editor]){
|
2227 |
-
ifr_id=document.getElementsByTagName("iframe")[id_ifr_editor].id;
|
2228 |
-
ifr=getIFrameDocument(ifr_id);
|
2229 |
-
ifr.body.innerHTML="";
|
2230 |
-
}
|
2231 |
|
2232 |
-
|
2233 |
-
|
2234 |
-
document.getElementById('form_maker_editor').value="";
|
2235 |
-
if(document.getElementById('show_table').lastChild)
|
2236 |
-
{
|
2237 |
-
var del1 = document.getElementById('show_table').lastChild;
|
2238 |
-
var del2 = document.getElementById('edit_table').lastChild;
|
2239 |
-
var main1 = document.getElementById('show_table');
|
2240 |
-
var main2 = document.getElementById('edit_table');
|
2241 |
-
main1.removeChild(del1);
|
2242 |
-
main2.removeChild(del2);
|
2243 |
-
}
|
2244 |
-
}
|
2245 |
|
2246 |
-
|
2247 |
-
{
|
2248 |
-
tr_time1 = document.getElementById(num+'_tr_time1')
|
2249 |
-
tr_time2 = document.getElementById(num+'_tr_time2')
|
2250 |
-
var td1 = document.createElement('td');
|
2251 |
-
td1.setAttribute("id", num+"_am_pm_select");
|
2252 |
-
td1.setAttribute("class", "td_am_pm_select");
|
2253 |
-
var td2 = document.createElement('td');
|
2254 |
-
td2.setAttribute("id", num+"_am_pm_label");
|
2255 |
-
td2.setAttribute("class", "td_am_pm_select");
|
2256 |
-
|
2257 |
-
var am_pm_select = document.createElement('select');
|
2258 |
-
am_pm_select.setAttribute("class", "am_pm_select");
|
2259 |
-
am_pm_select.setAttribute("name", num+"_am_pmform_id_temp");
|
2260 |
-
am_pm_select.setAttribute("id", num+"_am_pmform_id_temp");
|
2261 |
-
am_pm_select.setAttribute("onchange", "set_sel_am_pm(this)");
|
2262 |
-
|
2263 |
-
var am_option = document.createElement('option');
|
2264 |
-
am_option.setAttribute("value", "am");
|
2265 |
-
am_option.innerHTML="AM";
|
2266 |
-
|
2267 |
-
var pm_option = document.createElement('option');
|
2268 |
-
pm_option.setAttribute("value", "pm");
|
2269 |
-
pm_option.innerHTML="PM";
|
2270 |
-
|
2271 |
-
if(am_or_pm=="pm")
|
2272 |
-
pm_option.setAttribute("selected", "selected");
|
2273 |
-
else
|
2274 |
-
am_option.setAttribute("selected", "selected");
|
2275 |
-
|
2276 |
-
|
2277 |
-
var am_pm_label = document.createElement('label');
|
2278 |
-
am_pm_label.setAttribute("class", "mini_label");
|
2279 |
-
am_pm_label.innerHTML="AM/PM";
|
2280 |
-
|
2281 |
-
am_pm_select.appendChild(am_option);
|
2282 |
-
am_pm_select.appendChild(pm_option);
|
2283 |
-
td1.appendChild(am_pm_select);
|
2284 |
-
td2.appendChild(am_pm_label);
|
2285 |
-
tr_time1.appendChild(td1);
|
2286 |
-
tr_time2.appendChild(td2);
|
2287 |
-
document.getElementById(num+'_hhform_id_temp').setAttribute("onKeyPress", "return check_hour(event, '"+num+"_hhform_id_temp',"+"'12'"+")");
|
2288 |
-
|
2289 |
-
document.getElementById(num+'_hhform_id_temp').value=w_hh;
|
2290 |
-
document.getElementById(num+'_mmform_id_temp').value=w_mm;
|
2291 |
-
if(document.getElementById(num+'_ssform_id_temp'))
|
2292 |
-
document.getElementById(num+'_ssform_id_temp').value=w_ss;
|
2293 |
-
|
2294 |
-
refresh_attr(num, 'type_time');
|
2295 |
-
}
|
2296 |
|
2297 |
-
|
2298 |
-
{
|
2299 |
-
tr_time1 = document.getElementById(num+'_tr_time1')
|
2300 |
-
td1 = document.getElementById(num+'_am_pm_select')
|
2301 |
-
tr_time2 = document.getElementById(num+'_tr_time2')
|
2302 |
-
td2 = document.getElementById(num+'_am_pm_label')
|
2303 |
-
tr_time1.removeChild(td1);
|
2304 |
-
tr_time2.removeChild(td2);
|
2305 |
-
document.getElementById(num+'_hhform_id_temp').setAttribute("onKeyPress", "return check_hour(event, '"+num+"_hhform_id_temp', '23')");
|
2306 |
-
document.getElementById(num+'_hhform_id_temp').value="";
|
2307 |
-
document.getElementById(num+'_mmform_id_temp').value="";
|
2308 |
-
if(document.getElementById(num+'_ssform_id_temp'))
|
2309 |
-
document.getElementById(num+'_ssform_id_temp').value="";
|
2310 |
-
}
|
2311 |
|
2312 |
-
|
2313 |
-
{
|
2314 |
-
w_size=document.getElementById(num+'_element_firstform_id_temp').style.width;
|
2315 |
-
tr_name1 = document.getElementById(num+'_tr_name1');
|
2316 |
-
tr_name2 = document.getElementById(num+'_tr_name2');
|
2317 |
-
|
2318 |
-
var td_name_input1 = document.createElement('td');
|
2319 |
-
td_name_input1.setAttribute("id", num+"_td_name_input_title");
|
2320 |
-
|
2321 |
-
var td_name_input4 = document.createElement('td');
|
2322 |
-
td_name_input4.setAttribute("id", num+"_td_name_input_middle");
|
2323 |
-
|
2324 |
-
var td_name_label1 = document.createElement('td');
|
2325 |
-
td_name_label1.setAttribute("id", num+"_td_name_label_title");
|
2326 |
-
td_name_label1.setAttribute("align", "left");
|
2327 |
-
|
2328 |
-
var td_name_label4 = document.createElement('td');
|
2329 |
-
td_name_label4.setAttribute("id", num+"_td_name_label_middle");
|
2330 |
-
td_name_label4.setAttribute("align", "left");
|
2331 |
-
|
2332 |
-
var title = document.createElement('input');
|
2333 |
-
title.setAttribute("type", 'text');
|
2334 |
-
|
2335 |
-
title.setAttribute("class", "input_deactive");
|
2336 |
-
|
2337 |
-
title.style.cssText = "margin: 0px 10px 0px 0px; padding: 0px; width:40px";
|
2338 |
-
title.setAttribute("id", num+"_element_titleform_id_temp");
|
2339 |
-
title.setAttribute("name", num+"_element_titleform_id_temp");
|
2340 |
-
title.setAttribute("value", '');
|
2341 |
-
title.setAttribute("title", '');
|
2342 |
-
title.setAttribute("onFocus", 'delete_value("'+num+'_element_titleform_id_temp")');
|
2343 |
-
title.setAttribute("onBlur", 'return_value("'+num+'_element_titleform_id_temp")');
|
2344 |
-
title.setAttribute("onChange", "change_value('"+num+"_element_titleform_id_temp')");
|
2345 |
-
|
2346 |
-
var title_label = document.createElement('label');
|
2347 |
-
title_label.setAttribute("class", "mini_label");
|
2348 |
-
title_label.innerHTML="<!--repstart-->Title<!--repend-->";
|
2349 |
-
|
2350 |
-
var middle = document.createElement('input');
|
2351 |
-
middle.setAttribute("type", 'text');
|
2352 |
-
middle.setAttribute("class", "input_deactive");
|
2353 |
-
middle.style.cssText = "padding: 0px; width:"+w_size;
|
2354 |
-
middle.setAttribute("id", num+"_element_middleform_id_temp");
|
2355 |
-
middle.setAttribute("name", num+"_element_middleform_id_temp");
|
2356 |
-
middle.setAttribute("value", '');
|
2357 |
-
middle.setAttribute("title", '');
|
2358 |
-
middle.setAttribute("onFocus", 'delete_value("'+num+'_element_middleform_id_temp")');
|
2359 |
-
middle.setAttribute("onBlur", 'return_value("'+num+'_element_middleform_id_temp")');
|
2360 |
-
middle.setAttribute("onChange", "change_value('"+num+"_element_middleform_id_temp')");
|
2361 |
-
|
2362 |
-
var middle_label = document.createElement('label');
|
2363 |
-
middle_label.setAttribute("class", "mini_label");
|
2364 |
-
middle_label.innerHTML="<!--repstart-->Middle<!--repend-->";
|
2365 |
-
|
2366 |
-
first_input = document.getElementById(num+'_td_name_input_first');
|
2367 |
-
last_input = document.getElementById(num+'_td_name_input_last');
|
2368 |
-
first_label = document.getElementById(num+'_td_name_label_first');
|
2369 |
-
last_label = document.getElementById(num+'_td_name_label_last');
|
2370 |
-
|
2371 |
-
td_name_input1.appendChild(title);
|
2372 |
-
td_name_input4.appendChild(middle);
|
2373 |
-
|
2374 |
-
tr_name1.insertBefore(td_name_input1, first_input);
|
2375 |
-
tr_name1.insertBefore(td_name_input4, null);
|
2376 |
-
|
2377 |
-
td_name_label1.appendChild(title_label);
|
2378 |
-
td_name_label4.appendChild(middle_label);
|
2379 |
-
tr_name2.insertBefore(td_name_label1, first_label);
|
2380 |
-
tr_name2.insertBefore(td_name_label4, null);
|
2381 |
-
|
2382 |
-
var gic1 = document.createTextNode("-");
|
2383 |
-
var gic2 = document.createTextNode("-");
|
2384 |
-
|
2385 |
-
var el_first_value_title = document.createElement('input');
|
2386 |
-
el_first_value_title.setAttribute("id", "el_first_value_title");
|
2387 |
-
el_first_value_title.setAttribute("type", "text");
|
2388 |
-
el_first_value_title.setAttribute("value", '');
|
2389 |
-
el_first_value_title.style.cssText = "width:50px; margin-left:4px; margin-right:4px";
|
2390 |
-
el_first_value_title.setAttribute("onKeyUp", "change_input_value(this.value,'"+num+"_element_titleform_id_temp')");
|
2391 |
-
|
2392 |
-
var el_first_value_middle = document.createElement('input');
|
2393 |
-
el_first_value_middle.setAttribute("id", "el_first_value_middle");
|
2394 |
-
el_first_value_middle.setAttribute("type", "text");
|
2395 |
-
el_first_value_middle.setAttribute("value", '');
|
2396 |
-
el_first_value_middle.style.cssText = "width:100px; margin-left:4px";
|
2397 |
-
el_first_value_middle.setAttribute("onKeyUp", "change_input_value(this.value,'"+num+"_element_middleform_id_temp')");
|
2398 |
-
|
2399 |
-
el_first_value_first = document.getElementById('el_first_value_first');
|
2400 |
-
parent=el_first_value_first.parentNode;
|
2401 |
-
parent.insertBefore(gic1, el_first_value_first);
|
2402 |
-
parent.insertBefore(el_first_value_title, gic1);
|
2403 |
-
parent.appendChild(gic2);
|
2404 |
-
parent.appendChild(el_first_value_middle);
|
2405 |
-
|
2406 |
-
refresh_attr(num, 'type_name');
|
2407 |
-
}
|
2408 |
|
2409 |
-
|
2410 |
-
{
|
2411 |
-
tr_name1 = document.getElementById(num+'_tr_name1');
|
2412 |
-
tr_name2 = document.getElementById(num+'_tr_name2');
|
2413 |
-
td_name_input1 = document.getElementById(num+'_td_name_input_title');
|
2414 |
-
|
2415 |
-
td_name_input4 = document.getElementById(num+'_td_name_input_middle');
|
2416 |
-
|
2417 |
-
td_name_label1 = document.getElementById(num+'_td_name_label_title');
|
2418 |
-
|
2419 |
-
td_name_label4 =document.getElementById(num+'_td_name_label_middle');
|
2420 |
-
|
2421 |
-
tr_name1.removeChild(td_name_input1);
|
2422 |
-
tr_name1.removeChild(td_name_input4);
|
2423 |
-
tr_name2.removeChild(td_name_label1);
|
2424 |
-
tr_name2.removeChild(td_name_label4);
|
2425 |
-
|
2426 |
-
el_first_value_first = document.getElementById('el_first_value_first');
|
2427 |
-
parent=el_first_value_first.parentNode;
|
2428 |
-
|
2429 |
-
parent.removeChild( document.getElementById('el_first_value_title').nextSibling);
|
2430 |
-
parent.removeChild( document.getElementById('el_first_value_title'));
|
2431 |
-
parent.removeChild( document.getElementById('el_first_value_middle').previousSibling);
|
2432 |
-
parent.removeChild( document.getElementById('el_first_value_middle'));
|
2433 |
|
2434 |
-
|
2435 |
|
2436 |
-
function type_section_break(i, w_editor){
|
2437 |
|
2438 |
-
|
2439 |
-
delete_last_child();
|
2440 |
-
// edit table
|
2441 |
-
oElement=document.getElementById('table_editor');
|
2442 |
-
var iReturnTop = 0;
|
2443 |
-
var iReturnLeft = 0;
|
2444 |
-
while( oElement != null )
|
2445 |
-
{
|
2446 |
-
iReturnTop += oElement.offsetTop;
|
2447 |
-
iReturnLeft += oElement.offsetLeft;
|
2448 |
-
oElement = oElement.offsetParent;
|
2449 |
-
}
|
2450 |
-
|
2451 |
-
document.getElementById('main_editor').style.display="block";
|
2452 |
-
document.getElementById('main_editor').style.left=iReturnLeft+195+"px";
|
2453 |
-
document.getElementById('main_editor').style.top=iReturnTop+70+"px";
|
2454 |
-
|
2455 |
-
|
2456 |
-
|
2457 |
-
if(document.getElementById('form_maker_editor').style.display=="none")
|
2458 |
-
{
|
2459 |
-
ifr_id=document.getElementsByTagName("iframe")[id_ifr_editor].id;
|
2460 |
-
ifr=getIFrameDocument(ifr_id);
|
2461 |
-
ifr.body.innerHTML=w_editor;
|
2462 |
-
}
|
2463 |
-
else
|
2464 |
-
{
|
2465 |
-
document.getElementById('form_maker_editor').value=w_editor;
|
2466 |
-
}
|
2467 |
-
|
2468 |
-
element='div';
|
2469 |
-
|
2470 |
-
|
2471 |
-
var div = document.createElement('div');
|
2472 |
-
div.setAttribute("id", "main_div");
|
2473 |
-
var main_td = document.getElementById('show_table');
|
2474 |
-
main_td.appendChild(div);
|
2475 |
-
|
2476 |
-
var div = document.createElement('div');
|
2477 |
-
div.style.width="600px";
|
2478 |
-
document.getElementById('edit_table').appendChild(div);
|
2479 |
-
}
|
2480 |
|
2481 |
-
|
2482 |
|
2483 |
-
|
2484 |
-
|
2485 |
-
|
2486 |
-
oElement=document.getElementById('table_editor');
|
2487 |
-
var iReturnTop = 0;
|
2488 |
-
var iReturnLeft = 0;
|
2489 |
-
while( oElement != null )
|
2490 |
-
{
|
2491 |
-
iReturnTop += oElement.offsetTop;
|
2492 |
-
iReturnLeft += oElement.offsetLeft;
|
2493 |
-
oElement = oElement.offsetParent;
|
2494 |
-
}
|
2495 |
-
|
2496 |
-
document.getElementById('main_editor').style.display="block";
|
2497 |
-
document.getElementById('main_editor').style.left=iReturnLeft+195+"px";
|
2498 |
-
document.getElementById('main_editor').style.top=iReturnTop+70+"px";
|
2499 |
-
|
2500 |
-
|
2501 |
-
|
2502 |
-
if(document.getElementById('form_maker_editor').style.display=="none")
|
2503 |
-
{
|
2504 |
-
ifr_id=document.getElementsByTagName("iframe")[id_ifr_editor].id;
|
2505 |
-
ifr=getIFrameDocument(ifr_id);
|
2506 |
-
ifr.body.innerHTML=w_editor;
|
2507 |
-
}
|
2508 |
-
else
|
2509 |
-
{
|
2510 |
-
document.getElementById('form_maker_editor').value=w_editor;
|
2511 |
-
}
|
2512 |
-
|
2513 |
-
element='div';
|
2514 |
-
|
2515 |
-
|
2516 |
-
var div = document.createElement('div');
|
2517 |
-
div.setAttribute("id", "main_div");
|
2518 |
-
var main_td = document.getElementById('show_table');
|
2519 |
-
main_td.appendChild(div);
|
2520 |
-
|
2521 |
-
var div = document.createElement('div');
|
2522 |
-
div.style.width="600px";
|
2523 |
-
document.getElementById('edit_table').appendChild(div);
|
2524 |
-
|
2525 |
-
|
2526 |
-
}
|
2527 |
|
2528 |
-
|
|
|
|
|
2529 |
|
2530 |
-
|
2531 |
-
|
2532 |
-
delete_last_child();
|
2533 |
-
// edit table
|
2534 |
-
var edit_div = document.createElement('div');
|
2535 |
-
edit_div.setAttribute("id", "edit_div");
|
2536 |
-
edit_div.setAttribute("style", "border-top:1px dotted black;padding:10px; padding-top:0px; padding-bottom:0px; margin-top:10px;");
|
2537 |
-
|
2538 |
-
var edit_main_table = document.createElement('table');
|
2539 |
-
edit_main_table.setAttribute("id", "edit_main_table");
|
2540 |
-
edit_main_table.setAttribute("cellpadding", "0");
|
2541 |
-
edit_main_table.setAttribute("cellspacing", "0");
|
2542 |
-
|
2543 |
-
var edit_main_tr1 = document.createElement('tr');
|
2544 |
-
edit_main_tr1.setAttribute("valing", "top");
|
2545 |
-
|
2546 |
-
var edit_main_tr2 = document.createElement('tr');
|
2547 |
-
edit_main_tr2.setAttribute("valing", "top");
|
2548 |
-
|
2549 |
-
var edit_main_tr3 = document.createElement('tr');
|
2550 |
-
edit_main_tr3.setAttribute("valing", "top");
|
2551 |
-
|
2552 |
-
var edit_main_tr4 = document.createElement('tr');
|
2553 |
-
edit_main_tr4.setAttribute("valing", "top");
|
2554 |
-
|
2555 |
-
var edit_main_tr5 = document.createElement('tr');
|
2556 |
-
edit_main_tr5.setAttribute("valing", "top");
|
2557 |
-
|
2558 |
-
var edit_main_tr6 = document.createElement('tr');
|
2559 |
-
edit_main_tr6.setAttribute("valing", "top");
|
2560 |
-
|
2561 |
-
var edit_main_tr7 = document.createElement('tr');
|
2562 |
-
edit_main_tr7.setAttribute("valing", "top");
|
2563 |
-
|
2564 |
-
var edit_main_td1 = document.createElement('td');
|
2565 |
-
edit_main_td1.style.cssText = "padding-top:10px";
|
2566 |
-
var edit_main_td1_1 = document.createElement('td');
|
2567 |
-
edit_main_td1_1.style.cssText = "padding-top:10px";
|
2568 |
-
var edit_main_td2 = document.createElement('td');
|
2569 |
-
edit_main_td2.style.cssText = "padding-top:10px";
|
2570 |
-
var edit_main_td2_1 = document.createElement('td');
|
2571 |
-
edit_main_td2_1.style.cssText = "padding-top:10px";
|
2572 |
-
|
2573 |
-
var edit_main_td3 = document.createElement('td');
|
2574 |
-
edit_main_td3.style.cssText = "padding-top:10px";
|
2575 |
-
var edit_main_td3_1 = document.createElement('td');
|
2576 |
-
edit_main_td3_1.style.cssText = "padding-top:10px";
|
2577 |
-
var edit_main_td4 = document.createElement('td');
|
2578 |
-
edit_main_td4.style.cssText = "padding-top:10px";
|
2579 |
-
var edit_main_td4_1 = document.createElement('td');
|
2580 |
-
edit_main_td4_1.style.cssText = "padding-top:10px";
|
2581 |
-
|
2582 |
-
var edit_main_td5 = document.createElement('td');
|
2583 |
-
edit_main_td5.style.cssText = "padding-top:10px";
|
2584 |
-
var edit_main_td5_1 = document.createElement('td');
|
2585 |
-
edit_main_td5_1.style.cssText = "padding-top:10px";
|
2586 |
-
|
2587 |
-
var edit_main_td6 = document.createElement('td');
|
2588 |
-
edit_main_td6.style.cssText = "padding-top:10px";
|
2589 |
-
var edit_main_td6_1 = document.createElement('td');
|
2590 |
-
edit_main_td6_1.style.cssText = "padding-top:10px";
|
2591 |
-
|
2592 |
-
var edit_main_td7 = document.createElement('td');
|
2593 |
-
edit_main_td7.style.cssText = "padding-top:10px";
|
2594 |
-
var edit_main_td7_1 = document.createElement('td');
|
2595 |
-
edit_main_td7_1.style.cssText = "padding-top:10px";
|
2596 |
-
|
2597 |
-
var el_submit_title_label = document.createElement('label');
|
2598 |
-
el_submit_title_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
2599 |
-
el_submit_title_label.innerHTML = "Submit button label";
|
2600 |
-
|
2601 |
-
var el_submit_title_textarea = document.createElement('input');
|
2602 |
-
el_submit_title_textarea.setAttribute("id", "edit_for_title");
|
2603 |
-
el_submit_title_textarea.setAttribute("type", "text");
|
2604 |
-
el_submit_title_textarea.style.cssText = "width:160px";
|
2605 |
-
el_submit_title_textarea.setAttribute("onKeyUp", "change_label('"+i+"_element_submitform_id_temp', this.value)");
|
2606 |
-
el_submit_title_textarea.value = w_submit_title;
|
2607 |
-
var el_submit_func_label = document.createElement('label');
|
2608 |
-
el_submit_func_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
2609 |
-
el_submit_func_label.innerHTML = "Submit function";
|
2610 |
-
var el_submit_func_textarea = document.createElement('input');
|
2611 |
-
el_submit_func_textarea.setAttribute("type", "text");
|
2612 |
-
el_submit_func_textarea.setAttribute("disabled", "disabled");
|
2613 |
-
el_submit_func_textarea.style.cssText = "width:160px";
|
2614 |
-
el_submit_func_textarea.value = "check_required('submit', 'form_id_temp')";
|
2615 |
-
|
2616 |
-
var el_reset_title_label = document.createElement('label');
|
2617 |
-
el_reset_title_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
2618 |
-
el_reset_title_label.innerHTML = "Reset button label";
|
2619 |
-
|
2620 |
-
var el_reset_title_textarea = document.createElement('input');
|
2621 |
-
el_reset_title_textarea.setAttribute("id", "edit_for_title");
|
2622 |
-
el_reset_title_textarea.setAttribute("type", "text");
|
2623 |
-
el_reset_title_textarea.style.cssText = "width:160px";
|
2624 |
-
el_reset_title_textarea.setAttribute("onKeyUp", "change_label('"+i+"_element_resetform_id_temp', this.value)");
|
2625 |
-
el_reset_title_textarea.value = w_reset_title;
|
2626 |
-
|
2627 |
-
|
2628 |
-
var el_reset_active = document.createElement('input');
|
2629 |
-
el_reset_active.setAttribute("type", "checkbox");
|
2630 |
-
el_reset_active.style.cssText = "";
|
2631 |
-
el_reset_active.setAttribute("onClick", "active_reset(this.checked, "+i+")");
|
2632 |
-
if(w_act)
|
2633 |
-
el_reset_active.setAttribute("checked", "checked");
|
2634 |
-
|
2635 |
-
|
2636 |
-
var el_reset_active_label = document.createElement('label');
|
2637 |
-
el_reset_active_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
2638 |
-
el_reset_active_label.innerHTML = "Display Reset button";
|
2639 |
-
|
2640 |
-
|
2641 |
-
|
2642 |
-
|
2643 |
-
var el_reset_func_label = document.createElement('label');
|
2644 |
-
el_reset_func_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
2645 |
-
el_reset_func_label.innerHTML = "Reset function";
|
2646 |
-
var el_reset_func_textarea = document.createElement('input');
|
2647 |
-
el_reset_func_textarea.setAttribute("type", "text");
|
2648 |
-
el_reset_func_textarea.setAttribute("disabled", "disabled");
|
2649 |
-
el_reset_func_textarea.style.cssText = "width:160px";
|
2650 |
-
el_reset_func_textarea.value = "check_required('reset')";
|
2651 |
-
|
2652 |
-
var el_style_label = document.createElement('label');
|
2653 |
-
el_style_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
2654 |
-
el_style_label.innerHTML = "Class name";
|
2655 |
-
|
2656 |
-
var el_style_textarea = document.createElement('input');
|
2657 |
-
el_style_textarea.setAttribute("id", "element_style");
|
2658 |
-
el_style_textarea.setAttribute("type", "text");
|
2659 |
-
el_style_textarea.setAttribute("value", w_class);
|
2660 |
-
el_style_textarea.style.cssText = "width:200px;";
|
2661 |
-
el_style_textarea.setAttribute("onChange", "change_class(this.value,'"+i+"')");
|
2662 |
-
var el_attr_label = document.createElement('label');
|
2663 |
-
el_attr_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
2664 |
-
el_attr_label.innerHTML = "Additional Attributes";
|
2665 |
-
var el_attr_add = document.createElement('img');
|
2666 |
-
el_attr_add.setAttribute("id", "el_choices_add");
|
2667 |
-
el_attr_add.setAttribute("src", plugin_url+'/images/add.png');
|
2668 |
-
el_attr_add.style.cssText = 'cursor:pointer; margin-left:68px';
|
2669 |
-
el_attr_add.setAttribute("title", 'add');
|
2670 |
-
el_attr_add.setAttribute("onClick", "add_attr("+i+", 'type_submit_reset')");
|
2671 |
-
var el_attr_table = document.createElement('table');
|
2672 |
-
el_attr_table.setAttribute("id", 'attributes');
|
2673 |
-
el_attr_table.setAttribute("border", '0');
|
2674 |
-
el_attr_table.style.cssText = 'margin-left:0px';
|
2675 |
-
var el_attr_tr_label = document.createElement('tr');
|
2676 |
-
el_attr_tr_label.setAttribute("idi", '0');
|
2677 |
-
var el_attr_td_name_label = document.createElement('th');
|
2678 |
-
el_attr_td_name_label.style.cssText = 'width:100px';
|
2679 |
-
var el_attr_td_value_label = document.createElement('th');
|
2680 |
-
el_attr_td_value_label.style.cssText = 'width:100px';
|
2681 |
-
var el_attr_td_X_label = document.createElement('th');
|
2682 |
-
el_attr_td_X_label.style.cssText = 'width:10px';
|
2683 |
-
var el_attr_name_label = document.createElement('label');
|
2684 |
-
el_attr_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
|
2685 |
-
el_attr_name_label.innerHTML = "Name";
|
2686 |
-
|
2687 |
-
var el_attr_value_label = document.createElement('label');
|
2688 |
-
el_attr_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
|
2689 |
-
el_attr_value_label.innerHTML = "Value";
|
2690 |
-
|
2691 |
-
el_attr_table.appendChild(el_attr_tr_label);
|
2692 |
-
el_attr_tr_label.appendChild(el_attr_td_name_label);
|
2693 |
-
el_attr_tr_label.appendChild(el_attr_td_value_label);
|
2694 |
-
el_attr_tr_label.appendChild(el_attr_td_X_label);
|
2695 |
-
el_attr_td_name_label.appendChild(el_attr_name_label);
|
2696 |
-
el_attr_td_value_label.appendChild(el_attr_value_label);
|
2697 |
-
|
2698 |
-
n=w_attr_name.length;
|
2699 |
-
for(j=1; j<=n; j++)
|
2700 |
-
{
|
2701 |
-
var el_attr_tr = document.createElement('tr');
|
2702 |
-
el_attr_tr.setAttribute("id", "attr_row_"+j);
|
2703 |
-
el_attr_tr.setAttribute("idi", j);
|
2704 |
-
var el_attr_td_name = document.createElement('td');
|
2705 |
-
el_attr_td_name.style.cssText = 'width:100px';
|
2706 |
-
var el_attr_td_value = document.createElement('td');
|
2707 |
-
el_attr_td_value.style.cssText = 'width:100px';
|
2708 |
-
|
2709 |
-
var el_attr_td_X = document.createElement('td');
|
2710 |
-
var el_attr_name = document.createElement('input');
|
2711 |
-
|
2712 |
-
el_attr_name.setAttribute("type", "text");
|
2713 |
-
|
2714 |
-
el_attr_name.style.cssText = "width:100px";
|
2715 |
-
el_attr_name.setAttribute("value", w_attr_name[j-1]);
|
2716 |
-
el_attr_name.setAttribute("id", "attr_name"+j);
|
2717 |
-
el_attr_name.setAttribute("onChange", "change_attribute_name("+i+", this, 'type_submit_reset')");
|
2718 |
-
|
2719 |
-
var el_attr_value = document.createElement('input');
|
2720 |
-
|
2721 |
-
el_attr_value.setAttribute("type", "text");
|
2722 |
-
|
2723 |
-
el_attr_value.style.cssText = "width:100px";
|
2724 |
-
el_attr_value.setAttribute("value", w_attr_value[j-1]);
|
2725 |
-
el_attr_value.setAttribute("id", "attr_value"+j);
|
2726 |
-
el_attr_value.setAttribute("onChange", "change_attribute_value("+i+", "+j+", 'type_submit_reset')");
|
2727 |
-
|
2728 |
-
var el_attr_remove = document.createElement('img');
|
2729 |
-
el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
|
2730 |
-
el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
|
2731 |
-
el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
|
2732 |
-
el_attr_remove.setAttribute("align", 'top');
|
2733 |
-
el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", 'type_submit_reset')");
|
2734 |
-
el_attr_table.appendChild(el_attr_tr);
|
2735 |
-
el_attr_tr.appendChild(el_attr_td_name);
|
2736 |
-
el_attr_tr.appendChild(el_attr_td_value);
|
2737 |
-
el_attr_tr.appendChild(el_attr_td_X);
|
2738 |
-
el_attr_td_name.appendChild(el_attr_name);
|
2739 |
-
el_attr_td_value.appendChild(el_attr_value);
|
2740 |
-
el_attr_td_X.appendChild(el_attr_remove);
|
2741 |
-
|
2742 |
-
}
|
2743 |
-
|
2744 |
-
var t = document.getElementById('edit_table');
|
2745 |
-
|
2746 |
-
var hr = document.createElement('hr');
|
2747 |
-
var br = document.createElement('br');
|
2748 |
-
var br1 = document.createElement('br');
|
2749 |
-
var br2 = document.createElement('br');
|
2750 |
-
var br3 = document.createElement('br');
|
2751 |
-
var br4 = document.createElement('br');
|
2752 |
-
var br5 = document.createElement('br');
|
2753 |
-
var br6 = document.createElement('br');
|
2754 |
-
var br7 = document.createElement('br');
|
2755 |
-
var br8 = document.createElement('br');
|
2756 |
-
var br9 = document.createElement('br');
|
2757 |
-
edit_main_td1.appendChild(el_submit_title_label);
|
2758 |
-
edit_main_td1.appendChild(br7);
|
2759 |
-
edit_main_td1.appendChild(el_submit_func_label);
|
2760 |
-
edit_main_td1_1.appendChild(el_submit_title_textarea);
|
2761 |
-
edit_main_td1_1.appendChild(br1);
|
2762 |
-
edit_main_td1_1.appendChild(el_submit_func_textarea);
|
2763 |
-
|
2764 |
-
|
2765 |
-
edit_main_td2.appendChild(el_reset_active_label);
|
2766 |
-
edit_main_td2.appendChild(br5);
|
2767 |
-
edit_main_td2.appendChild(el_reset_title_label);
|
2768 |
-
edit_main_td2.appendChild(br8);
|
2769 |
-
edit_main_td2.appendChild(el_reset_func_label);
|
2770 |
-
edit_main_td2_1.appendChild(el_reset_active);
|
2771 |
-
edit_main_td2_1.appendChild(br9);
|
2772 |
-
edit_main_td2_1.appendChild(el_reset_title_textarea);
|
2773 |
-
edit_main_td2_1.appendChild(br2);
|
2774 |
-
edit_main_td2_1.appendChild(el_reset_func_textarea);
|
2775 |
-
|
2776 |
-
edit_main_td3.appendChild(el_style_label);
|
2777 |
-
edit_main_td3_1.appendChild(el_style_textarea);
|
2778 |
-
|
2779 |
-
edit_main_td4.appendChild(el_attr_label);
|
2780 |
-
edit_main_td4.appendChild(el_attr_add);
|
2781 |
-
edit_main_td4.appendChild(br3);
|
2782 |
-
edit_main_td4.appendChild(el_attr_table);
|
2783 |
-
edit_main_td4.setAttribute("colspan", "2");
|
2784 |
-
|
2785 |
-
edit_main_tr1.appendChild(edit_main_td1);
|
2786 |
-
edit_main_tr1.appendChild(edit_main_td1_1);
|
2787 |
-
edit_main_tr2.appendChild(edit_main_td2);
|
2788 |
-
edit_main_tr2.appendChild(edit_main_td2_1);
|
2789 |
-
edit_main_tr3.appendChild(edit_main_td3);
|
2790 |
-
edit_main_tr3.appendChild(edit_main_td3_1);
|
2791 |
-
|
2792 |
-
edit_main_tr4.appendChild(edit_main_td4);
|
2793 |
-
edit_main_tr4.appendChild(edit_main_td4_1);
|
2794 |
-
edit_main_tr5.appendChild(edit_main_td5);
|
2795 |
-
edit_main_tr5.appendChild(edit_main_td5_1);
|
2796 |
-
edit_main_tr6.appendChild(edit_main_td6);
|
2797 |
-
edit_main_tr6.appendChild(edit_main_td6_1);
|
2798 |
-
|
2799 |
-
edit_main_table.appendChild(edit_main_tr1);
|
2800 |
-
edit_main_table.appendChild(edit_main_tr2);
|
2801 |
-
edit_main_table.appendChild(edit_main_tr3);
|
2802 |
-
edit_main_table.appendChild(edit_main_tr4);
|
2803 |
-
// edit_main_table.appendChild(edit_main_tr5);
|
2804 |
-
// edit_main_table.appendChild(edit_main_tr6);
|
2805 |
-
edit_div.appendChild(edit_main_table);
|
2806 |
-
|
2807 |
-
t.appendChild(edit_div);
|
2808 |
-
|
2809 |
-
//show table
|
2810 |
|
2811 |
-
|
2812 |
-
var adding_type = document.createElement("input");
|
2813 |
-
adding_type.setAttribute("type", "hidden");
|
2814 |
-
adding_type.setAttribute("value", "type_submit_reset");
|
2815 |
-
adding_type.setAttribute("name", i+"_typeform_id_temp");
|
2816 |
-
adding_type.setAttribute("id", i+"_typeform_id_temp");
|
2817 |
-
|
2818 |
-
var adding_submit = document.createElement(element);
|
2819 |
-
adding_submit.setAttribute("type", type1);
|
2820 |
-
|
2821 |
-
adding_submit.setAttribute("class", "button_submit");
|
2822 |
-
|
2823 |
-
adding_submit.setAttribute("id", i+"_element_submitform_id_temp");
|
2824 |
-
adding_submit.setAttribute("value", w_submit_title);
|
2825 |
-
adding_submit.innerHTML=w_submit_title;
|
2826 |
-
adding_submit.setAttribute("onClick", "check_required('submit', 'form_id_temp');");
|
2827 |
-
|
2828 |
-
var adding_reset = document.createElement(element);
|
2829 |
-
adding_reset.setAttribute("type", type2);
|
2830 |
-
|
2831 |
-
adding_reset.setAttribute("class", "button_reset");
|
2832 |
-
if(!w_act)
|
2833 |
-
adding_reset.style.display="none";
|
2834 |
-
|
2835 |
-
adding_reset.setAttribute("id", i+"_element_resetform_id_temp");
|
2836 |
-
adding_reset.setAttribute("value", w_reset_title );
|
2837 |
-
adding_reset.setAttribute("onClick", "check_required('reset');");
|
2838 |
-
adding_reset.innerHTML=w_reset_title;
|
2839 |
-
|
2840 |
-
var div = document.createElement('div');
|
2841 |
-
div.setAttribute("id", "main_div");
|
2842 |
-
|
2843 |
-
var table = document.createElement('table');
|
2844 |
-
table.setAttribute("id", i+"_elemet_tableform_id_temp");
|
2845 |
-
|
2846 |
-
var tr = document.createElement('tr');
|
2847 |
-
|
2848 |
-
var td1 = document.createElement('td');
|
2849 |
-
td1.setAttribute("valign", 'middle');
|
2850 |
-
td1.setAttribute("align", 'left');
|
2851 |
-
td1.setAttribute("id", i+"_label_sectionform_id_temp");
|
2852 |
-
td1.style.cssText = 'display:none';
|
2853 |
-
|
2854 |
-
var td2 = document.createElement('td');
|
2855 |
-
td2.setAttribute("valign", 'middle');
|
2856 |
-
td2.setAttribute("align", 'left');
|
2857 |
-
td2.setAttribute("id", i+"_element_sectionform_id_temp");
|
2858 |
-
|
2859 |
-
var br1 = document.createElement('br');
|
2860 |
-
var br2 = document.createElement('br');
|
2861 |
-
var br3 = document.createElement('br');
|
2862 |
-
var br4 = document.createElement('br');
|
2863 |
-
|
2864 |
|
2865 |
-
|
2866 |
-
|
2867 |
-
|
2868 |
-
|
2869 |
-
|
2870 |
-
|
2871 |
-
|
2872 |
-
td1.appendChild(label);
|
2873 |
-
td2.appendChild(adding_type);
|
2874 |
-
td2.appendChild(adding_submit);
|
2875 |
-
td2.appendChild(adding_reset);
|
2876 |
-
|
2877 |
-
tr.appendChild(td1);
|
2878 |
-
tr.appendChild(td2);
|
2879 |
-
table.appendChild(tr);
|
2880 |
-
|
2881 |
-
div.appendChild(table);
|
2882 |
-
div.appendChild(br3);
|
2883 |
-
main_td.appendChild(div);
|
2884 |
-
change_class(w_class, i);
|
2885 |
-
refresh_attr(i, 'type_submit_reset');
|
2886 |
-
}
|
2887 |
|
2888 |
-
function type_hidden(i, w_name, w_value, w_attr_name, w_attr_value){
|
2889 |
|
2890 |
-
|
2891 |
-
|
2892 |
-
delete_last_child();
|
2893 |
-
// edit table
|
2894 |
-
var edit_div = document.createElement('div');
|
2895 |
-
edit_div.setAttribute("id", "edit_div");
|
2896 |
-
edit_div.setAttribute("style", "border-top:1px dotted black;padding:10px; padding-top:0px; padding-bottom:0px; margin-top:10px;");
|
2897 |
-
|
2898 |
-
var edit_main_table = document.createElement('table');
|
2899 |
-
edit_main_table.setAttribute("id", "edit_main_table");
|
2900 |
-
edit_main_table.setAttribute("cellpadding", "0");
|
2901 |
-
edit_main_table.setAttribute("cellspacing", "0");
|
2902 |
-
|
2903 |
-
var edit_main_tr1 = document.createElement('tr');
|
2904 |
-
edit_main_tr1.setAttribute("valing", "top");
|
2905 |
-
|
2906 |
-
var edit_main_tr2 = document.createElement('tr');
|
2907 |
-
edit_main_tr2.setAttribute("valing", "top");
|
2908 |
-
|
2909 |
-
var edit_main_tr3 = document.createElement('tr');
|
2910 |
-
edit_main_tr3.setAttribute("valing", "top");
|
2911 |
-
|
2912 |
-
var edit_main_tr4 = document.createElement('tr');
|
2913 |
-
edit_main_tr4.setAttribute("valing", "top");
|
2914 |
-
|
2915 |
-
var edit_main_tr5 = document.createElement('tr');
|
2916 |
-
edit_main_tr5.setAttribute("valing", "top");
|
2917 |
-
|
2918 |
-
var edit_main_tr6 = document.createElement('tr');
|
2919 |
-
edit_main_tr6.setAttribute("valing", "top");
|
2920 |
-
|
2921 |
-
var edit_main_tr7 = document.createElement('tr');
|
2922 |
-
edit_main_tr7.setAttribute("valing", "top");
|
2923 |
-
|
2924 |
-
var edit_main_td1 = document.createElement('td');
|
2925 |
-
edit_main_td1.style.cssText = "padding-top:10px";
|
2926 |
-
var edit_main_td1_1 = document.createElement('td');
|
2927 |
-
edit_main_td1_1.style.cssText = "padding-top:10px";
|
2928 |
-
var edit_main_td2 = document.createElement('td');
|
2929 |
-
edit_main_td2.style.cssText = "padding-top:10px";
|
2930 |
-
var edit_main_td2_1 = document.createElement('td');
|
2931 |
-
edit_main_td2_1.style.cssText = "padding-top:10px";
|
2932 |
-
|
2933 |
-
var edit_main_td3 = document.createElement('td');
|
2934 |
-
edit_main_td3.style.cssText = "padding-top:10px";
|
2935 |
-
var edit_main_td3_1 = document.createElement('td');
|
2936 |
-
edit_main_td3_1.style.cssText = "padding-top:10px";
|
2937 |
-
var edit_main_td4 = document.createElement('td');
|
2938 |
-
edit_main_td4.style.cssText = "padding-top:10px";
|
2939 |
-
var edit_main_td4_1 = document.createElement('td');
|
2940 |
-
edit_main_td4_1.style.cssText = "padding-top:10px";
|
2941 |
-
|
2942 |
-
var edit_main_td5 = document.createElement('td');
|
2943 |
-
edit_main_td5.style.cssText = "padding-top:10px";
|
2944 |
-
var edit_main_td5_1 = document.createElement('td');
|
2945 |
-
edit_main_td5_1.style.cssText = "padding-top:10px";
|
2946 |
-
|
2947 |
-
var edit_main_td6 = document.createElement('td');
|
2948 |
-
edit_main_td6.style.cssText = "padding-top:10px";
|
2949 |
-
var edit_main_td6_1 = document.createElement('td');
|
2950 |
-
edit_main_td6_1.style.cssText = "padding-top:10px";
|
2951 |
-
|
2952 |
-
var edit_main_td7 = document.createElement('td');
|
2953 |
-
edit_main_td7.style.cssText = "padding-top:10px";
|
2954 |
-
var edit_main_td7_1 = document.createElement('td');
|
2955 |
-
edit_main_td7_1.style.cssText = "padding-top:10px";
|
2956 |
-
var el_field_id_label = document.createElement('label');
|
2957 |
-
el_field_id_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
2958 |
-
el_field_id_label.innerHTML = "Field Id";
|
2959 |
-
|
2960 |
-
var el_field_id_input= document.createElement('input');
|
2961 |
-
el_field_id_input.setAttribute("type", "text");
|
2962 |
-
el_field_id_input.setAttribute("disabled", "disabled");
|
2963 |
-
el_field_id_input.setAttribute("value", i+"_elementform_id_temp");
|
2964 |
-
el_field_id_input.style.cssText = "margin-left: 41px; width:160px";
|
2965 |
-
|
2966 |
-
var el_field_name_label = document.createElement('label');
|
2967 |
-
el_field_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
2968 |
-
el_field_name_label.innerHTML = "Field Name";
|
2969 |
-
|
2970 |
-
var el_field_name_input= document.createElement('input');
|
2971 |
-
el_field_name_input.setAttribute("type", "text");
|
2972 |
-
|
2973 |
-
el_field_name_input.setAttribute("value", w_name);
|
2974 |
-
el_field_name_input.style.cssText = "margin-left: 16px; width:160px";
|
2975 |
-
el_field_name_input.setAttribute("onChange", "change_field_name('"+i+"', this)");
|
2976 |
-
|
2977 |
-
var el_field_value_label = document.createElement('label');
|
2978 |
-
el_field_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
2979 |
-
el_field_value_label.innerHTML = "Field Value";
|
2980 |
-
|
2981 |
-
var el_field_value_input= document.createElement('input');
|
2982 |
-
el_field_value_input.setAttribute("type", "text");
|
2983 |
-
el_field_value_input.setAttribute("value", w_value);
|
2984 |
-
el_field_value_input.style.cssText = "margin-left: 16px; width:160px";
|
2985 |
-
el_field_value_input.setAttribute("onKeyUp", "change_field_value('"+i+"', this.value)");
|
2986 |
-
|
2987 |
-
var el_attr_label = document.createElement('label');
|
2988 |
-
el_attr_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
2989 |
-
el_attr_label.innerHTML = "Additional Attributes";
|
2990 |
-
var el_attr_add = document.createElement('img');
|
2991 |
-
el_attr_add.setAttribute("id", "el_choices_add");
|
2992 |
-
el_attr_add.setAttribute("src", plugin_url+'/images/add.png');
|
2993 |
-
el_attr_add.style.cssText = 'cursor:pointer; margin-left:68px';
|
2994 |
-
el_attr_add.setAttribute("title", 'add');
|
2995 |
-
el_attr_add.setAttribute("onClick", "add_attr("+i+", 'type_text')");
|
2996 |
-
var el_attr_table = document.createElement('table');
|
2997 |
-
el_attr_table.setAttribute("id", 'attributes');
|
2998 |
-
el_attr_table.setAttribute("border", '0');
|
2999 |
-
el_attr_table.style.cssText = 'margin-left:0px';
|
3000 |
-
var el_attr_tr_label = document.createElement('tr');
|
3001 |
-
el_attr_tr_label.setAttribute("idi", '0');
|
3002 |
-
var el_attr_td_name_label = document.createElement('th');
|
3003 |
-
el_attr_td_name_label.style.cssText = 'width:100px';
|
3004 |
-
var el_attr_td_value_label = document.createElement('th');
|
3005 |
-
el_attr_td_value_label.style.cssText = 'width:100px';
|
3006 |
-
var el_attr_td_X_label = document.createElement('th');
|
3007 |
-
el_attr_td_X_label.style.cssText = 'width:10px';
|
3008 |
-
var el_attr_name_label = document.createElement('label');
|
3009 |
-
el_attr_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
|
3010 |
-
el_attr_name_label.innerHTML = "Name";
|
3011 |
-
|
3012 |
-
var el_attr_value_label = document.createElement('label');
|
3013 |
-
el_attr_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
|
3014 |
-
el_attr_value_label.innerHTML = "Value";
|
3015 |
-
|
3016 |
-
el_attr_table.appendChild(el_attr_tr_label);
|
3017 |
-
el_attr_tr_label.appendChild(el_attr_td_name_label);
|
3018 |
-
el_attr_tr_label.appendChild(el_attr_td_value_label);
|
3019 |
-
el_attr_tr_label.appendChild(el_attr_td_X_label);
|
3020 |
-
el_attr_td_name_label.appendChild(el_attr_name_label);
|
3021 |
-
el_attr_td_value_label.appendChild(el_attr_value_label);
|
3022 |
-
|
3023 |
-
n=w_attr_name.length;
|
3024 |
-
for(j=1; j<=n; j++)
|
3025 |
-
{
|
3026 |
-
var el_attr_tr = document.createElement('tr');
|
3027 |
-
el_attr_tr.setAttribute("id", "attr_row_"+j);
|
3028 |
-
el_attr_tr.setAttribute("idi", j);
|
3029 |
-
var el_attr_td_name = document.createElement('td');
|
3030 |
-
el_attr_td_name.style.cssText = 'width:100px';
|
3031 |
-
var el_attr_td_value = document.createElement('td');
|
3032 |
-
el_attr_td_value.style.cssText = 'width:100px';
|
3033 |
-
|
3034 |
-
var el_attr_td_X = document.createElement('td');
|
3035 |
-
var el_attr_name = document.createElement('input');
|
3036 |
-
|
3037 |
-
el_attr_name.setAttribute("type", "text");
|
3038 |
-
|
3039 |
-
el_attr_name.style.cssText = "width:100px";
|
3040 |
-
el_attr_name.setAttribute("value", w_attr_name[j-1]);
|
3041 |
-
el_attr_name.setAttribute("id", "attr_name"+j);
|
3042 |
-
el_attr_name.setAttribute("onChange", "change_attribute_name("+i+", this, 'type_text')");
|
3043 |
-
|
3044 |
-
var el_attr_value = document.createElement('input');
|
3045 |
-
|
3046 |
-
el_attr_value.setAttribute("type", "text");
|
3047 |
-
|
3048 |
-
el_attr_value.style.cssText = "width:100px";
|
3049 |
-
el_attr_value.setAttribute("value", w_attr_value[j-1]);
|
3050 |
-
el_attr_value.setAttribute("id", "attr_value"+j);
|
3051 |
-
el_attr_value.setAttribute("onChange", "change_attribute_value("+i+", "+j+", 'type_text')");
|
3052 |
-
|
3053 |
-
var el_attr_remove = document.createElement('img');
|
3054 |
-
el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
|
3055 |
-
el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
|
3056 |
-
el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
|
3057 |
-
el_attr_remove.setAttribute("align", 'top');
|
3058 |
-
el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", 'type_text')");
|
3059 |
-
el_attr_table.appendChild(el_attr_tr);
|
3060 |
-
el_attr_tr.appendChild(el_attr_td_name);
|
3061 |
-
el_attr_tr.appendChild(el_attr_td_value);
|
3062 |
-
el_attr_tr.appendChild(el_attr_td_X);
|
3063 |
-
el_attr_td_name.appendChild(el_attr_name);
|
3064 |
-
el_attr_td_value.appendChild(el_attr_value);
|
3065 |
-
el_attr_td_X.appendChild(el_attr_remove);
|
3066 |
-
|
3067 |
-
}
|
3068 |
-
|
3069 |
-
var t = document.getElementById('edit_table');
|
3070 |
-
|
3071 |
-
var hr = document.createElement('hr');
|
3072 |
-
var br = document.createElement('br');
|
3073 |
-
var br1 = document.createElement('br');
|
3074 |
-
var br2 = document.createElement('br');
|
3075 |
-
var br3 = document.createElement('br');
|
3076 |
-
var br4 = document.createElement('br');
|
3077 |
-
var br5 = document.createElement('br');
|
3078 |
-
var br6 = document.createElement('br');
|
3079 |
-
edit_main_td1.appendChild(el_field_id_label);
|
3080 |
-
edit_main_td1.appendChild(el_field_id_input);
|
3081 |
-
edit_main_td2.appendChild(el_field_name_label);
|
3082 |
-
edit_main_td2.appendChild(el_field_name_input);
|
3083 |
-
edit_main_td3.appendChild(el_field_value_label);
|
3084 |
-
edit_main_td3.appendChild(el_field_value_input);
|
3085 |
-
edit_main_td4.appendChild(el_attr_label);
|
3086 |
-
edit_main_td4.appendChild(el_attr_add);
|
3087 |
-
edit_main_td4.appendChild(br3);
|
3088 |
-
edit_main_td4.appendChild(el_attr_table);
|
3089 |
-
edit_main_tr1.appendChild(edit_main_td1);
|
3090 |
-
edit_main_tr1.appendChild(edit_main_td1_1);
|
3091 |
-
edit_main_tr2.appendChild(edit_main_td2);
|
3092 |
-
edit_main_tr2.appendChild(edit_main_td2_1);
|
3093 |
-
edit_main_tr3.appendChild(edit_main_td3);
|
3094 |
-
edit_main_tr3.appendChild(edit_main_td3_1);
|
3095 |
-
|
3096 |
-
edit_main_tr4.appendChild(edit_main_td4);
|
3097 |
-
edit_main_tr4.appendChild(edit_main_td4_1);
|
3098 |
-
edit_main_tr5.appendChild(edit_main_td5);
|
3099 |
-
edit_main_tr5.appendChild(edit_main_td5_1);
|
3100 |
-
edit_main_tr6.appendChild(edit_main_td6);
|
3101 |
-
edit_main_tr6.appendChild(edit_main_td6_1);
|
3102 |
-
|
3103 |
-
edit_main_table.appendChild(edit_main_tr1);
|
3104 |
-
edit_main_table.appendChild(edit_main_tr2);
|
3105 |
-
edit_main_table.appendChild(edit_main_tr3);
|
3106 |
-
edit_main_table.appendChild(edit_main_tr4);
|
3107 |
-
// edit_main_table.appendChild(edit_main_tr5);
|
3108 |
-
// edit_main_table.appendChild(edit_main_tr6);
|
3109 |
-
edit_div.appendChild(edit_main_table);
|
3110 |
-
|
3111 |
-
t.appendChild(edit_div);
|
3112 |
-
|
3113 |
-
//show table
|
3114 |
|
3115 |
-
|
3116 |
-
|
3117 |
-
var adding_type = document.createElement("input");
|
3118 |
-
adding_type.setAttribute("type", "hidden");
|
3119 |
-
adding_type.setAttribute("value", "type_hidden");
|
3120 |
-
adding_type.setAttribute("name", i+"_typeform_id_temp");
|
3121 |
-
adding_type.setAttribute("id", i+"_typeform_id_temp");
|
3122 |
-
|
3123 |
-
var adding = document.createElement(element);
|
3124 |
-
adding.setAttribute("type", type);
|
3125 |
-
adding.setAttribute("value", w_value);
|
3126 |
-
adding.setAttribute("id", i+"_elementform_id_temp");
|
3127 |
-
adding.setAttribute("name", w_name);
|
3128 |
-
|
3129 |
-
var div = document.createElement('div');
|
3130 |
-
div.setAttribute("id", "main_div");
|
3131 |
-
|
3132 |
-
var table = document.createElement('table');
|
3133 |
-
table.setAttribute("id", i+"_elemet_tableform_id_temp");
|
3134 |
-
table.setAttribute("cellpadding", '0');
|
3135 |
-
table.setAttribute("cellspacing", '0');
|
3136 |
-
|
3137 |
-
var tr = document.createElement('tr');
|
3138 |
-
|
3139 |
-
var td1 = document.createElement('td');
|
3140 |
-
td1.setAttribute("valign", 'middle');
|
3141 |
-
td1.setAttribute("align", 'left');
|
3142 |
-
td1.setAttribute("id", i+"_label_sectionform_id_temp");
|
3143 |
-
td1.style.cssText = 'display:none';
|
3144 |
-
|
3145 |
-
var td2 = document.createElement('td');
|
3146 |
-
td2.setAttribute("valign", 'middle');
|
3147 |
-
td2.setAttribute("align", 'left');
|
3148 |
-
td2.setAttribute("id", i+"_element_sectionform_id_temp");
|
3149 |
-
|
3150 |
-
var br1 = document.createElement('br');
|
3151 |
-
var br2 = document.createElement('br');
|
3152 |
-
var br3 = document.createElement('br');
|
3153 |
-
var br4 = document.createElement('br');
|
3154 |
-
|
3155 |
|
3156 |
-
|
3157 |
-
|
3158 |
-
|
3159 |
-
|
3160 |
-
|
3161 |
-
var main_td = document.getElementById('show_table');
|
3162 |
-
|
3163 |
-
td1.appendChild(label);
|
3164 |
-
td2.appendChild(adding);
|
3165 |
-
td2.appendChild(adding_type);
|
3166 |
-
tr.appendChild(td1);
|
3167 |
-
tr.appendChild(td2);
|
3168 |
-
table.appendChild(tr);
|
3169 |
-
|
3170 |
-
div.appendChild(table);
|
3171 |
-
div.appendChild(br3);
|
3172 |
-
main_td.appendChild(div);
|
3173 |
-
refresh_attr(i, 'type_text');
|
3174 |
}
|
3175 |
|
3176 |
-
function
|
3177 |
-
|
3178 |
-
|
3179 |
-
|
3180 |
-
|
3181 |
-
edit_div.setAttribute("id", "edit_div");
|
3182 |
-
edit_div.setAttribute("style", "border-top:1px dotted black;padding:10px; padding-top:0px; padding-bottom:0px; margin-top:10px;");
|
3183 |
-
|
3184 |
-
var edit_main_table = document.createElement('table');
|
3185 |
-
edit_main_table.setAttribute("id", "edit_main_table");
|
3186 |
-
edit_main_table.setAttribute("cellpadding", "0");
|
3187 |
-
edit_main_table.setAttribute("cellspacing", "0");
|
3188 |
-
|
3189 |
-
var edit_main_tr1 = document.createElement('tr');
|
3190 |
-
edit_main_tr1.setAttribute("valing", "top");
|
3191 |
-
|
3192 |
-
var edit_main_tr2 = document.createElement('tr');
|
3193 |
-
edit_main_tr2.setAttribute("valing", "top");
|
3194 |
-
|
3195 |
-
var edit_main_tr3 = document.createElement('tr');
|
3196 |
-
edit_main_tr3.setAttribute("valing", "top");
|
3197 |
-
|
3198 |
-
var edit_main_tr4 = document.createElement('tr');
|
3199 |
-
edit_main_tr4.setAttribute("valing", "top");
|
3200 |
-
|
3201 |
-
var edit_main_tr5 = document.createElement('tr');
|
3202 |
-
edit_main_tr5.setAttribute("valing", "top");
|
3203 |
-
|
3204 |
-
var edit_main_tr6 = document.createElement('tr');
|
3205 |
-
edit_main_tr6.setAttribute("valing", "top");
|
3206 |
-
|
3207 |
-
var edit_main_td1 = document.createElement('td');
|
3208 |
-
edit_main_td1.style.cssText = "padding-top:10px";
|
3209 |
-
var edit_main_td1_1 = document.createElement('td');
|
3210 |
-
edit_main_td1_1.style.cssText = "padding-top:10px";
|
3211 |
-
var edit_main_td2 = document.createElement('td');
|
3212 |
-
edit_main_td2.style.cssText = "padding-top:10px";
|
3213 |
-
var edit_main_td2_1 = document.createElement('td');
|
3214 |
-
edit_main_td2_1.style.cssText = "padding-top:10px";
|
3215 |
-
|
3216 |
-
var edit_main_td3 = document.createElement('td');
|
3217 |
-
edit_main_td3.style.cssText = "padding-top:10px";
|
3218 |
-
var edit_main_td3_1 = document.createElement('td');
|
3219 |
-
edit_main_td3_1.style.cssText = "padding-top:10px";
|
3220 |
-
var edit_main_td4 = document.createElement('td');
|
3221 |
-
edit_main_td4.setAttribute("id", "buttons");
|
3222 |
-
edit_main_td4.setAttribute("colspan", "2");
|
3223 |
-
|
3224 |
-
var edit_main_td5 = document.createElement('td');
|
3225 |
-
edit_main_td5.style.cssText = "padding-top:10px";
|
3226 |
-
var edit_main_td5_1 = document.createElement('td');
|
3227 |
-
edit_main_td5_1.style.cssText = "padding-top:10px";
|
3228 |
-
|
3229 |
-
var edit_main_td6 = document.createElement('td');
|
3230 |
-
edit_main_td6.style.cssText = "padding-top:10px";
|
3231 |
-
var edit_main_td6_1 = document.createElement('td');
|
3232 |
-
edit_main_td6_1.style.cssText = "padding-top:10px";
|
3233 |
-
|
3234 |
-
|
3235 |
-
var el_style_label = document.createElement('label');
|
3236 |
-
el_style_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
3237 |
-
el_style_label.innerHTML = "Class name";
|
3238 |
-
|
3239 |
-
var el_style_textarea = document.createElement('input');
|
3240 |
-
el_style_textarea.setAttribute("id", "element_style");
|
3241 |
-
el_style_textarea.setAttribute("type", "text");
|
3242 |
-
el_style_textarea.setAttribute("value", w_class);
|
3243 |
-
el_style_textarea.style.cssText = "width:200px;";
|
3244 |
-
el_style_textarea.setAttribute("onChange", "change_class(this.value,'"+i+"')");
|
3245 |
-
|
3246 |
-
var el_choices_add_label = document.createElement('label');
|
3247 |
-
el_choices_add_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
3248 |
-
el_choices_add_label.innerHTML = "Add a new button ";
|
3249 |
-
var el_choices_add = document.createElement('img');
|
3250 |
-
el_choices_add.setAttribute("id", "el_choices_add");
|
3251 |
-
el_choices_add.setAttribute("src", plugin_url+'/images/add.png');
|
3252 |
-
el_choices_add.style.cssText = 'cursor:pointer;';
|
3253 |
-
el_choices_add.setAttribute("title", 'add');
|
3254 |
-
el_choices_add.setAttribute("onClick", "add_button("+i+")");
|
3255 |
-
|
3256 |
-
|
3257 |
-
var el_attr_label = document.createElement('label');
|
3258 |
-
el_attr_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
3259 |
-
el_attr_label.innerHTML = "Additional Attributes";
|
3260 |
-
var el_attr_add = document.createElement('img');
|
3261 |
-
el_attr_add.setAttribute("id", "el_choices_add");
|
3262 |
-
el_attr_add.setAttribute("src", plugin_url+'/images/add.png');
|
3263 |
-
el_attr_add.style.cssText = 'cursor:pointer; margin-left:68px';
|
3264 |
-
el_attr_add.setAttribute("title", 'add');
|
3265 |
-
el_attr_add.setAttribute("onClick", "add_attr("+i+", 'type_checkbox')");
|
3266 |
-
var el_attr_table = document.createElement('table');
|
3267 |
-
el_attr_table.setAttribute("id", 'attributes');
|
3268 |
-
el_attr_table.setAttribute("border", '0');
|
3269 |
-
el_attr_table.style.cssText = 'margin-left:0px';
|
3270 |
-
var el_attr_tr_label = document.createElement('tr');
|
3271 |
-
el_attr_tr_label.setAttribute("idi", '0');
|
3272 |
-
var el_attr_td_name_label = document.createElement('th');
|
3273 |
-
el_attr_td_name_label.style.cssText = 'width:100px';
|
3274 |
-
var el_attr_td_value_label = document.createElement('th');
|
3275 |
-
el_attr_td_value_label.style.cssText = 'width:100px';
|
3276 |
-
var el_attr_td_X_label = document.createElement('th');
|
3277 |
-
el_attr_td_X_label.style.cssText = 'width:10px';
|
3278 |
-
var el_attr_name_label = document.createElement('label');
|
3279 |
-
el_attr_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
|
3280 |
-
el_attr_name_label.innerHTML = "Name";
|
3281 |
-
|
3282 |
-
var el_attr_value_label = document.createElement('label');
|
3283 |
-
el_attr_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
|
3284 |
-
el_attr_value_label.innerHTML = "Value";
|
3285 |
-
|
3286 |
-
el_attr_table.appendChild(el_attr_tr_label);
|
3287 |
-
el_attr_tr_label.appendChild(el_attr_td_name_label);
|
3288 |
-
el_attr_tr_label.appendChild(el_attr_td_value_label);
|
3289 |
-
el_attr_tr_label.appendChild(el_attr_td_X_label);
|
3290 |
-
el_attr_td_name_label.appendChild(el_attr_name_label);
|
3291 |
-
el_attr_td_value_label.appendChild(el_attr_value_label);
|
3292 |
-
|
3293 |
-
n=w_attr_name.length;
|
3294 |
-
for(j=1; j<=n; j++)
|
3295 |
-
{
|
3296 |
-
var el_attr_tr = document.createElement('tr');
|
3297 |
-
el_attr_tr.setAttribute("id", "attr_row_"+j);
|
3298 |
-
el_attr_tr.setAttribute("idi", j);
|
3299 |
-
var el_attr_td_name = document.createElement('td');
|
3300 |
-
el_attr_td_name.style.cssText = 'width:100px';
|
3301 |
-
var el_attr_td_value = document.createElement('td');
|
3302 |
-
el_attr_td_value.style.cssText = 'width:100px';
|
3303 |
-
|
3304 |
-
var el_attr_td_X = document.createElement('td');
|
3305 |
-
var el_attr_name = document.createElement('input');
|
3306 |
-
|
3307 |
-
el_attr_name.setAttribute("type", "text");
|
3308 |
-
|
3309 |
-
el_attr_name.style.cssText = "width:100px";
|
3310 |
-
el_attr_name.setAttribute("value", w_attr_name[j-1]);
|
3311 |
-
el_attr_name.setAttribute("id", "attr_name"+j);
|
3312 |
-
el_attr_name.setAttribute("onChange", "change_attribute_name("+i+", this, 'type_checkbox')");
|
3313 |
-
|
3314 |
-
var el_attr_value = document.createElement('input');
|
3315 |
-
|
3316 |
-
el_attr_value.setAttribute("type", "text");
|
3317 |
-
|
3318 |
-
el_attr_value.style.cssText = "width:100px";
|
3319 |
-
el_attr_value.setAttribute("value", w_attr_value[j-1]);
|
3320 |
-
el_attr_value.setAttribute("id", "attr_value"+j);
|
3321 |
-
el_attr_value.setAttribute("onChange", "change_attribute_value("+i+", "+j+", 'type_checkbox')");
|
3322 |
-
|
3323 |
-
var el_attr_remove = document.createElement('img');
|
3324 |
-
el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
|
3325 |
-
el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
|
3326 |
-
el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
|
3327 |
-
el_attr_remove.setAttribute("align", 'top');
|
3328 |
-
el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", 'type_checkbox')");
|
3329 |
-
el_attr_table.appendChild(el_attr_tr);
|
3330 |
-
el_attr_tr.appendChild(el_attr_td_name);
|
3331 |
-
el_attr_tr.appendChild(el_attr_td_value);
|
3332 |
-
el_attr_tr.appendChild(el_attr_td_X);
|
3333 |
-
el_attr_td_name.appendChild(el_attr_name);
|
3334 |
-
el_attr_td_value.appendChild(el_attr_value);
|
3335 |
-
el_attr_td_X.appendChild(el_attr_remove);
|
3336 |
-
|
3337 |
-
}
|
3338 |
-
|
3339 |
-
var t = document.getElementById('edit_table');
|
3340 |
-
|
3341 |
-
var br = document.createElement('br');
|
3342 |
-
var br1 = document.createElement('br');
|
3343 |
-
var br2 = document.createElement('br');
|
3344 |
-
var br3 = document.createElement('br');
|
3345 |
-
var br4 = document.createElement('br');
|
3346 |
-
var br5 = document.createElement('br');
|
3347 |
-
var br6 = document.createElement('br');
|
3348 |
-
|
3349 |
-
|
3350 |
-
edit_main_td1.appendChild(el_style_label);
|
3351 |
-
edit_main_td1_1.appendChild(el_style_textarea);
|
3352 |
-
edit_main_td2.appendChild(el_attr_label);
|
3353 |
-
edit_main_td2.appendChild(el_attr_add);
|
3354 |
-
edit_main_td2.appendChild(br3);
|
3355 |
-
edit_main_td2.appendChild(el_attr_table);
|
3356 |
-
edit_main_td2.setAttribute("colspan", "2");
|
3357 |
-
|
3358 |
-
edit_main_td3.appendChild(el_choices_add_label);
|
3359 |
-
edit_main_td3_1.appendChild(el_choices_add);
|
3360 |
-
|
3361 |
-
n=w_title.length;
|
3362 |
-
for(j=0; j<n; j++)
|
3363 |
-
{
|
3364 |
-
var table_button = document.createElement('table');
|
3365 |
-
table_button.setAttribute("width", "100%");
|
3366 |
-
table_button.setAttribute("border", "0");
|
3367 |
-
table_button.setAttribute("id", "button_opt"+j);
|
3368 |
-
table_button.setAttribute("idi", j+1);
|
3369 |
-
var tr_button = document.createElement('tr');
|
3370 |
-
var tr_hr = document.createElement('tr');
|
3371 |
-
|
3372 |
-
var td_button = document.createElement('td');
|
3373 |
-
var td_X = document.createElement('td');
|
3374 |
-
var td_hr = document.createElement('td');
|
3375 |
-
td_hr.setAttribute("colspan", "3");
|
3376 |
-
tr_hr.appendChild(td_hr);
|
3377 |
-
tr_button.appendChild(td_button);
|
3378 |
-
tr_button.appendChild(td_X);
|
3379 |
-
table_button.appendChild(tr_hr);
|
3380 |
-
table_button.appendChild(tr_button);
|
3381 |
-
|
3382 |
-
var br1 = document.createElement('br');
|
3383 |
-
|
3384 |
-
var hr = document.createElement('hr');
|
3385 |
-
hr.setAttribute("id", "br"+j);
|
3386 |
-
|
3387 |
-
|
3388 |
-
var el_title_label = document.createElement('label');
|
3389 |
-
|
3390 |
-
el_title_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
3391 |
-
|
3392 |
-
el_title_label.innerHTML = "Button name";
|
3393 |
-
|
3394 |
-
var el_title = document.createElement('input');
|
3395 |
-
el_title.setAttribute("id", "el_title"+j);
|
3396 |
-
el_title.setAttribute("type", "text");
|
3397 |
-
el_title.setAttribute("value", w_title[j]);
|
3398 |
-
el_title.style.cssText = "width:100px; margin-left:43px; padding:0; border-width: 1px";
|
3399 |
-
el_title.setAttribute("onKeyUp", "change_label('"+i+"_elementform_id_temp"+j+"', this.value);");
|
3400 |
-
|
3401 |
-
var el_func_label = document.createElement('label');
|
3402 |
-
|
3403 |
-
el_func_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
3404 |
-
|
3405 |
-
el_func_label.innerHTML = "OnClick function";
|
3406 |
-
|
3407 |
-
var el_func = document.createElement('input');
|
3408 |
-
el_func.setAttribute("id", "el_func"+j);
|
3409 |
-
el_func.setAttribute("type", "text");
|
3410 |
-
el_func.setAttribute("value", w_func[j]);
|
3411 |
-
el_func.style.cssText = "width:100px; margin-left:20px; padding:0; border-width: 1px";
|
3412 |
-
el_func.setAttribute("onKeyUp", "change_func('"+i+"_elementform_id_temp"+j+"', this.value);");
|
3413 |
-
var el_choices_remove = document.createElement('img');
|
3414 |
-
el_choices_remove.setAttribute("id", "el_button"+j+"_remove");
|
3415 |
-
el_choices_remove.setAttribute("src", plugin_url+'/images/delete.png');
|
3416 |
-
el_choices_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
|
3417 |
-
el_choices_remove.setAttribute("align", 'top');
|
3418 |
-
el_choices_remove.setAttribute("onClick", "remove_button("+j+","+i+")");
|
3419 |
-
|
3420 |
-
td_hr.appendChild(hr);
|
3421 |
-
td_button.appendChild(el_title_label);
|
3422 |
-
td_button.appendChild(el_title);
|
3423 |
-
td_button.appendChild(br1);
|
3424 |
-
td_button.appendChild(el_func_label);
|
3425 |
-
td_button.appendChild(el_func);
|
3426 |
-
td_X.appendChild(el_choices_remove);
|
3427 |
-
edit_main_td4.appendChild(table_button);
|
3428 |
-
|
3429 |
-
}
|
3430 |
-
|
3431 |
-
edit_main_tr1.appendChild(edit_main_td1);
|
3432 |
-
edit_main_tr1.appendChild(edit_main_td1_1);
|
3433 |
-
edit_main_tr2.appendChild(edit_main_td2);
|
3434 |
-
edit_main_tr2.appendChild(edit_main_td2_1);
|
3435 |
-
edit_main_tr3.appendChild(edit_main_td3);
|
3436 |
-
edit_main_tr3.appendChild(edit_main_td3_1);
|
3437 |
-
edit_main_tr4.appendChild(edit_main_td4);
|
3438 |
-
edit_main_tr6.appendChild(edit_main_td6);
|
3439 |
-
edit_main_tr6.appendChild(edit_main_td6_1);
|
3440 |
-
edit_main_tr5.appendChild(edit_main_td5);
|
3441 |
-
edit_main_tr5.appendChild(edit_main_td5_1);
|
3442 |
-
|
3443 |
-
edit_main_table.appendChild(edit_main_tr1);
|
3444 |
-
|
3445 |
-
edit_main_table.appendChild(edit_main_tr3);
|
3446 |
-
edit_main_table.appendChild(edit_main_tr4);
|
3447 |
-
edit_main_table.appendChild(edit_main_tr2);
|
3448 |
-
// edit_main_table.appendChild(edit_main_tr5);
|
3449 |
-
// edit_main_table.appendChild(edit_main_tr6);
|
3450 |
|
3451 |
-
|
3452 |
-
|
3453 |
-
|
3454 |
-
|
3455 |
-
|
|
|
3456 |
|
3457 |
-
|
3458 |
-
|
3459 |
-
|
3460 |
-
|
3461 |
-
|
3462 |
-
|
3463 |
-
|
3464 |
-
|
3465 |
-
|
3466 |
-
|
3467 |
-
|
3468 |
-
|
3469 |
-
|
3470 |
-
|
3471 |
-
|
3472 |
-
|
3473 |
-
|
3474 |
-
td1.setAttribute("align", 'left');
|
3475 |
-
td1.setAttribute("id", i+"_label_sectionform_id_temp");
|
3476 |
-
td1.style.cssText = 'display:none';
|
3477 |
-
var td2 = document.createElement('td');
|
3478 |
-
td2.setAttribute("valign", 'top');
|
3479 |
-
td2.setAttribute("align", 'left');
|
3480 |
-
td2.setAttribute("id", i+"_element_sectionform_id_temp");
|
3481 |
-
|
3482 |
-
var br1 = document.createElement('br');
|
3483 |
-
var br2 = document.createElement('br');
|
3484 |
-
var br3 = document.createElement('br');
|
3485 |
-
var br4 = document.createElement('br');
|
3486 |
-
// table_little -@ sarqaca tbody table_little darela table_little_t
|
3487 |
-
var label = document.createElement('span');
|
3488 |
-
label.setAttribute("id", i+"_element_labelform_id_temp");
|
3489 |
-
label.innerHTML = "button_"+i;
|
3490 |
-
label.style.cssText = 'display:none';
|
3491 |
-
|
3492 |
-
n=w_title.length;
|
3493 |
-
for(j=0; j<n; j++)
|
3494 |
-
{
|
3495 |
-
|
3496 |
-
var adding = document.createElement(element);
|
3497 |
-
adding.setAttribute("type", type);
|
3498 |
-
adding.setAttribute("id", i+"_elementform_id_temp"+j);
|
3499 |
-
adding.setAttribute("name", i+"_elementform_id_temp"+j);
|
3500 |
-
adding.setAttribute("value", w_title[j]);
|
3501 |
-
adding.innerHTML = w_title[j];
|
3502 |
-
adding.setAttribute("onclick", w_func[j]);
|
3503 |
-
|
3504 |
-
|
3505 |
-
td2.appendChild(adding);
|
3506 |
-
}
|
3507 |
-
var main_td = document.getElementById('show_table');
|
3508 |
-
|
3509 |
-
td1.appendChild(label);
|
3510 |
-
|
3511 |
-
td2.appendChild(adding_type);
|
3512 |
-
tr.appendChild(td1);
|
3513 |
-
tr.appendChild(td2);
|
3514 |
-
table.appendChild(tr);
|
3515 |
-
|
3516 |
|
3517 |
-
|
3518 |
-
|
3519 |
-
|
3520 |
-
|
3521 |
-
|
|
|
|
|
3522 |
}
|
3523 |
|
3524 |
-
function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3525 |
|
3526 |
-
element_ids=[ 'option1', 'option2'];
|
3527 |
-
document.getElementById("element_type").value="type_text";
|
3528 |
-
|
3529 |
-
delete_last_child();
|
3530 |
-
// edit table
|
3531 |
-
var edit_div = document.createElement('div');
|
3532 |
-
edit_div.setAttribute("id", "edit_div");
|
3533 |
-
edit_div.setAttribute("style", "border-top:1px dotted black;padding:10px; padding-top:0px; padding-bottom:0px; margin-top:10px;");
|
3534 |
-
|
3535 |
-
var edit_main_table = document.createElement('table');
|
3536 |
-
edit_main_table.setAttribute("id", "edit_main_table");
|
3537 |
-
edit_main_table.setAttribute("cellpadding", "0");
|
3538 |
-
edit_main_table.setAttribute("cellspacing", "0");
|
3539 |
-
edit_main_table.setAttribute("cellpadding", "0");
|
3540 |
-
edit_main_table.setAttribute("cellspacing", "0");
|
3541 |
-
|
3542 |
-
var edit_main_tr1 = document.createElement('tr');
|
3543 |
-
edit_main_tr1.setAttribute("valing", "top");
|
3544 |
-
|
3545 |
-
var edit_main_tr2 = document.createElement('tr');
|
3546 |
-
edit_main_tr2.setAttribute("valing", "top");
|
3547 |
-
|
3548 |
-
var edit_main_tr3 = document.createElement('tr');
|
3549 |
-
edit_main_tr3.setAttribute("valing", "top");
|
3550 |
-
|
3551 |
-
var edit_main_tr4 = document.createElement('tr');
|
3552 |
-
edit_main_tr4.setAttribute("valing", "top");
|
3553 |
-
|
3554 |
-
var edit_main_tr5 = document.createElement('tr');
|
3555 |
-
edit_main_tr5.setAttribute("valing", "top");
|
3556 |
-
|
3557 |
-
var edit_main_tr6 = document.createElement('tr');
|
3558 |
-
edit_main_tr6.setAttribute("valing", "top");
|
3559 |
-
|
3560 |
-
var edit_main_tr7 = document.createElement('tr');
|
3561 |
-
edit_main_tr7.setAttribute("valing", "top");
|
3562 |
-
|
3563 |
-
var edit_main_tr8 = document.createElement('tr');
|
3564 |
-
edit_main_tr8.setAttribute("valing", "top");
|
3565 |
-
|
3566 |
-
var edit_main_tr9 = document.createElement('tr');
|
3567 |
-
edit_main_tr9.setAttribute("valing", "top");
|
3568 |
-
|
3569 |
-
var edit_main_td1 = document.createElement('td');
|
3570 |
-
edit_main_td1.style.cssText = "padding-top:10px";
|
3571 |
-
var edit_main_td1_1 = document.createElement('td');
|
3572 |
-
edit_main_td1_1.style.cssText = "padding-top:10px";
|
3573 |
-
var edit_main_td2 = document.createElement('td');
|
3574 |
-
edit_main_td2.style.cssText = "padding-top:10px";
|
3575 |
-
var edit_main_td2_1 = document.createElement('td');
|
3576 |
-
edit_main_td2_1.style.cssText = "padding-top:10px";
|
3577 |
-
|
3578 |
-
var edit_main_td3 = document.createElement('td');
|
3579 |
-
edit_main_td3.style.cssText = "padding-top:10px";
|
3580 |
-
var edit_main_td3_1 = document.createElement('td');
|
3581 |
-
edit_main_td3_1.style.cssText = "padding-top:10px";
|
3582 |
-
|
3583 |
-
var edit_main_td4 = document.createElement('td');
|
3584 |
-
edit_main_td4.style.cssText = "padding-top:10px";
|
3585 |
-
var edit_main_td4_1 = document.createElement('td');
|
3586 |
-
edit_main_td4_1.style.cssText = "padding-top:10px";
|
3587 |
-
|
3588 |
-
var edit_main_td5 = document.createElement('td');
|
3589 |
-
edit_main_td5.style.cssText = "padding-top:10px";
|
3590 |
-
var edit_main_td5_1 = document.createElement('td');
|
3591 |
-
edit_main_td5_1.style.cssText = "padding-top:10px";
|
3592 |
-
|
3593 |
-
var edit_main_td6 = document.createElement('td');
|
3594 |
-
edit_main_td6.style.cssText = "padding-top:10px";
|
3595 |
-
var edit_main_td6_1 = document.createElement('td');
|
3596 |
-
edit_main_td6_1.style.cssText = "padding-top:10px";
|
3597 |
-
|
3598 |
-
var edit_main_td7 = document.createElement('td');
|
3599 |
-
edit_main_td7.style.cssText = "padding-top:10px";
|
3600 |
-
var edit_main_td7_1 = document.createElement('td');
|
3601 |
-
edit_main_td7_1.style.cssText = "padding-top:10px";
|
3602 |
-
|
3603 |
-
var edit_main_td8 = document.createElement('td');
|
3604 |
-
edit_main_td8.style.cssText = "padding-top:10px";
|
3605 |
-
var edit_main_td8_1 = document.createElement('td');
|
3606 |
-
edit_main_td8_1.style.cssText = "padding-top:10px";
|
3607 |
-
|
3608 |
-
var edit_main_td9 = document.createElement('td');
|
3609 |
-
edit_main_td9.style.cssText = "padding-top:10px";
|
3610 |
-
var edit_main_td9_1 = document.createElement('td');
|
3611 |
-
edit_main_td9_1.style.cssText = "padding-top:10px";
|
3612 |
-
|
3613 |
-
var el_label_label = document.createElement('label');
|
3614 |
-
el_label_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
3615 |
-
el_label_label.innerHTML = "Field label";
|
3616 |
-
|
3617 |
-
var el_label_textarea = document.createElement('textarea');
|
3618 |
-
el_label_textarea.setAttribute("id", "edit_for_label");
|
3619 |
-
el_label_textarea.setAttribute("rows", "4");
|
3620 |
-
el_label_textarea.style.cssText = "width:200px";
|
3621 |
-
el_label_textarea.setAttribute("onKeyUp", "change_label('"+i+"_element_labelform_id_temp', this.value)");
|
3622 |
-
el_label_textarea.innerHTML = w_field_label;
|
3623 |
-
|
3624 |
-
var el_label_position_label = document.createElement('label');
|
3625 |
-
el_label_position_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
3626 |
-
el_label_position_label.innerHTML = "Field label position";
|
3627 |
-
|
3628 |
-
var el_label_position1 = document.createElement('input');
|
3629 |
-
el_label_position1.setAttribute("id", "edit_for_label_position_top");
|
3630 |
-
el_label_position1.setAttribute("type", "radio");
|
3631 |
-
el_label_position1.setAttribute("value", "left");
|
3632 |
-
|
3633 |
-
el_label_position1.setAttribute("name", "edit_for_label_position");
|
3634 |
-
el_label_position1.setAttribute("onchange", "label_left("+i+")");
|
3635 |
-
Left = document.createTextNode("Left");
|
3636 |
-
|
3637 |
-
var el_label_position2 = document.createElement('input');
|
3638 |
-
|
3639 |
-
el_label_position2.setAttribute("id", "edit_for_label_position_left");
|
3640 |
-
el_label_position2.setAttribute("type", "radio");
|
3641 |
-
el_label_position2.setAttribute("value", "top");
|
3642 |
-
el_label_position2.setAttribute("name", "edit_for_label_position");
|
3643 |
-
el_label_position2.setAttribute("onchange", "label_top("+i+")");
|
3644 |
-
Top = document.createTextNode("Top");
|
3645 |
-
|
3646 |
-
if(w_field_label_pos=="top")
|
3647 |
-
el_label_position2.setAttribute("checked", "checked");
|
3648 |
-
else
|
3649 |
-
el_label_position1.setAttribute("checked", "checked");
|
3650 |
-
|
3651 |
-
var el_size_label = document.createElement('label');
|
3652 |
-
el_size_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
3653 |
-
el_size_label.innerHTML = "Field size(px) ";
|
3654 |
-
var el_size = document.createElement('input');
|
3655 |
-
el_size.setAttribute("id", "edit_for_input_size");
|
3656 |
-
el_size.setAttribute("type", "text");
|
3657 |
-
el_size.setAttribute("value", w_size);
|
3658 |
-
|
3659 |
-
el_size.setAttribute("name", "edit_for_size");
|
3660 |
-
el_size.setAttribute("onKeyPress", "return check_isnum(event)");
|
3661 |
-
el_size.setAttribute("onKeyUp", "change_w_style('"+i+"_elementform_id_temp', this.value)");
|
3662 |
-
|
3663 |
-
var el_first_value_label = document.createElement('label');
|
3664 |
-
el_first_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
3665 |
-
el_first_value_label.innerHTML = "Value if empty ";
|
3666 |
-
|
3667 |
-
var el_first_value_input = document.createElement('input');
|
3668 |
-
el_first_value_input.setAttribute("id", "el_first_value_input");
|
3669 |
-
el_first_value_input.setAttribute("type", "text");
|
3670 |
-
el_first_value_input.setAttribute("value", w_title);
|
3671 |
-
el_first_value_input.style.cssText = "width:200px;";
|
3672 |
-
el_first_value_input.setAttribute("onKeyUp", "change_input_value(this.value,'"+i+"_elementform_id_temp')");
|
3673 |
-
|
3674 |
-
var el_required_label = document.createElement('label');
|
3675 |
-
el_required_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
3676 |
-
el_required_label.innerHTML = "Required";
|
3677 |
-
|
3678 |
-
var el_required = document.createElement('input');
|
3679 |
-
el_required.setAttribute("id", "el_send");
|
3680 |
-
el_required.setAttribute("type", "checkbox");
|
3681 |
-
el_required.setAttribute("value", "yes");
|
3682 |
-
el_required.setAttribute("onclick", "set_required('"+i+"_required')");
|
3683 |
-
if(w_required=="yes")
|
3684 |
-
el_required.setAttribute("checked", "checked");
|
3685 |
-
|
3686 |
-
|
3687 |
-
var el_unique_label = document.createElement('label');
|
3688 |
-
el_unique_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
3689 |
-
el_unique_label.innerHTML = "Allow only unique values";
|
3690 |
-
|
3691 |
-
var el_unique = document.createElement('input');
|
3692 |
-
el_unique.setAttribute("id", "el_send");
|
3693 |
-
el_unique.setAttribute("type", "checkbox");
|
3694 |
-
el_unique.setAttribute("value", "yes");
|
3695 |
-
el_unique.setAttribute("onclick", "set_unique('"+i+"_uniqueform_id_temp')");
|
3696 |
-
if(w_unique=="yes")
|
3697 |
-
el_unique.setAttribute("checked", "checked");
|
3698 |
-
|
3699 |
-
|
3700 |
-
|
3701 |
-
var el_style_label = document.createElement('label');
|
3702 |
-
el_style_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
3703 |
-
el_style_label.innerHTML = "Deactive Class name";
|
3704 |
-
|
3705 |
-
var el_style_textarea = document.createElement('input');
|
3706 |
-
el_style_textarea.setAttribute("id", "element_style");
|
3707 |
-
el_style_textarea.setAttribute("type", "text");
|
3708 |
-
el_style_textarea.setAttribute("value", "input_deactive");
|
3709 |
-
el_style_textarea.setAttribute("disabled", "disabled");
|
3710 |
-
el_style_textarea.style.cssText = "width:200px;";
|
3711 |
-
el_style_textarea.setAttribute("onChange", "change_class(this.value,'"+i+"')");
|
3712 |
-
|
3713 |
-
var el_style_label2 = document.createElement('label');
|
3714 |
-
el_style_label2.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
3715 |
-
el_style_label2.innerHTML = "Active Class name";
|
3716 |
-
|
3717 |
-
var el_style_textarea2 = document.createElement('input');
|
3718 |
-
el_style_textarea2.setAttribute("id", "element_style");
|
3719 |
-
el_style_textarea2.setAttribute("type", "text");
|
3720 |
-
el_style_textarea2.setAttribute("value", "input_active");
|
3721 |
-
el_style_textarea2.setAttribute("disabled", "disabled");
|
3722 |
-
el_style_textarea2.style.cssText = "width:200px;";
|
3723 |
-
el_style_textarea2.setAttribute("onChange", "change_class(this.value,'"+i+"')");
|
3724 |
-
|
3725 |
-
var el_attr_label = document.createElement('label');
|
3726 |
-
el_attr_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
3727 |
-
el_attr_label.innerHTML = "Additional Attributes";
|
3728 |
-
|
3729 |
-
var el_attr_add = document.createElement('img');
|
3730 |
-
el_attr_add.setAttribute("id", "el_choices_add");
|
3731 |
-
el_attr_add.setAttribute("src", plugin_url+'/images/add.png');
|
3732 |
-
el_attr_add.style.cssText = 'cursor:pointer; margin-left:68px';
|
3733 |
-
el_attr_add.setAttribute("title", 'add');
|
3734 |
-
el_attr_add.setAttribute("onClick", "add_attr("+i+", 'type_text')");
|
3735 |
-
var el_attr_table = document.createElement('table');
|
3736 |
-
el_attr_table.setAttribute("id", 'attributes');
|
3737 |
-
el_attr_table.setAttribute("border", '0');
|
3738 |
-
el_attr_table.style.cssText = 'margin-left:0px';
|
3739 |
-
var el_attr_tr_label = document.createElement('tr');
|
3740 |
-
el_attr_tr_label.setAttribute("idi", '0');
|
3741 |
-
var el_attr_td_name_label = document.createElement('th');
|
3742 |
-
el_attr_td_name_label.style.cssText = 'width:100px';
|
3743 |
-
var el_attr_td_value_label = document.createElement('th');
|
3744 |
-
el_attr_td_value_label.style.cssText = 'width:100px';
|
3745 |
-
var el_attr_td_X_label = document.createElement('th');
|
3746 |
-
el_attr_td_X_label.style.cssText = 'width:10px';
|
3747 |
-
var el_attr_name_label = document.createElement('label');
|
3748 |
-
el_attr_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
|
3749 |
-
el_attr_name_label.innerHTML = "Name";
|
3750 |
-
|
3751 |
-
var el_attr_value_label = document.createElement('label');
|
3752 |
-
el_attr_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
|
3753 |
-
el_attr_value_label.innerHTML = "Value";
|
3754 |
-
|
3755 |
-
el_attr_table.appendChild(el_attr_tr_label);
|
3756 |
-
el_attr_tr_label.appendChild(el_attr_td_name_label);
|
3757 |
-
el_attr_tr_label.appendChild(el_attr_td_value_label);
|
3758 |
-
el_attr_tr_label.appendChild(el_attr_td_X_label);
|
3759 |
-
el_attr_td_name_label.appendChild(el_attr_name_label);
|
3760 |
-
el_attr_td_value_label.appendChild(el_attr_value_label);
|
3761 |
-
|
3762 |
-
n=w_attr_name.length;
|
3763 |
-
for(j=1; j<=n; j++)
|
3764 |
-
{
|
3765 |
-
var el_attr_tr = document.createElement('tr');
|
3766 |
-
el_attr_tr.setAttribute("id", "attr_row_"+j);
|
3767 |
-
el_attr_tr.setAttribute("idi", j);
|
3768 |
-
var el_attr_td_name = document.createElement('td');
|
3769 |
-
el_attr_td_name.style.cssText = 'width:100px';
|
3770 |
-
var el_attr_td_value = document.createElement('td');
|
3771 |
-
el_attr_td_value.style.cssText = 'width:100px';
|
3772 |
-
|
3773 |
-
var el_attr_td_X = document.createElement('td');
|
3774 |
-
var el_attr_name = document.createElement('input');
|
3775 |
-
|
3776 |
-
el_attr_name.setAttribute("type", "text");
|
3777 |
-
|
3778 |
-
el_attr_name.style.cssText = "width:100px";
|
3779 |
-
el_attr_name.setAttribute("value", w_attr_name[j-1]);
|
3780 |
-
el_attr_name.setAttribute("id", "attr_name"+j);
|
3781 |
-
el_attr_name.setAttribute("onChange", "change_attribute_name("+i+", this, 'type_text')");
|
3782 |
-
|
3783 |
-
var el_attr_value = document.createElement('input');
|
3784 |
-
|
3785 |
-
el_attr_value.setAttribute("type", "text");
|
3786 |
-
|
3787 |
-
el_attr_value.style.cssText = "width:100px";
|
3788 |
-
el_attr_value.setAttribute("value", w_attr_value[j-1]);
|
3789 |
-
el_attr_value.setAttribute("id", "attr_value"+j);
|
3790 |
-
el_attr_value.setAttribute("onChange", "change_attribute_value("+i+", "+j+", 'type_text')");
|
3791 |
-
|
3792 |
-
var el_attr_remove = document.createElement('img');
|
3793 |
-
el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
|
3794 |
-
el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
|
3795 |
-
el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
|
3796 |
-
el_attr_remove.setAttribute("align", 'top');
|
3797 |
-
el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", 'type_text')");
|
3798 |
-
el_attr_table.appendChild(el_attr_tr);
|
3799 |
-
el_attr_tr.appendChild(el_attr_td_name);
|
3800 |
-
el_attr_tr.appendChild(el_attr_td_value);
|
3801 |
-
el_attr_tr.appendChild(el_attr_td_X);
|
3802 |
-
el_attr_td_name.appendChild(el_attr_name);
|
3803 |
-
el_attr_td_value.appendChild(el_attr_value);
|
3804 |
-
el_attr_td_X.appendChild(el_attr_remove);
|
3805 |
-
|
3806 |
-
}
|
3807 |
-
|
3808 |
-
|
3809 |
-
var t = document.getElementById('edit_table');
|
3810 |
-
|
3811 |
-
var br = document.createElement('br');
|
3812 |
-
var br1 = document.createElement('br');
|
3813 |
-
var br2 = document.createElement('br');
|
3814 |
-
var br3 = document.createElement('br');
|
3815 |
-
var br4 = document.createElement('br');
|
3816 |
-
var br5 = document.createElement('br');
|
3817 |
-
var br6 = document.createElement('br');
|
3818 |
-
edit_main_td1.appendChild(el_label_label);
|
3819 |
-
edit_main_td1_1.appendChild(el_label_textarea);
|
3820 |
-
|
3821 |
-
edit_main_td2.appendChild(el_label_position_label);
|
3822 |
-
edit_main_td2.appendChild(br1);
|
3823 |
-
edit_main_td2_1.appendChild(el_label_position1);
|
3824 |
-
edit_main_td2_1.appendChild(Left);
|
3825 |
-
edit_main_td2_1.appendChild(br2);
|
3826 |
-
edit_main_td2_1.appendChild(el_label_position2);
|
3827 |
-
edit_main_td2_1.appendChild(Top);
|
3828 |
-
|
3829 |
-
edit_main_td3.appendChild(el_size_label);
|
3830 |
-
edit_main_td3_1.appendChild(el_size);
|
3831 |
-
|
3832 |
-
edit_main_td4.appendChild(el_first_value_label);
|
3833 |
-
edit_main_td4_1.appendChild(el_first_value_input);
|
3834 |
-
|
3835 |
-
edit_main_td5.appendChild(el_style_label);
|
3836 |
-
edit_main_td5_1.appendChild(el_style_textarea);
|
3837 |
-
|
3838 |
-
edit_main_td9.appendChild(el_style_label2);
|
3839 |
-
edit_main_td9_1.appendChild(el_style_textarea2);
|
3840 |
-
|
3841 |
-
|
3842 |
-
|
3843 |
-
|
3844 |
-
edit_main_td6.appendChild(el_required_label);
|
3845 |
-
edit_main_td6_1.appendChild(el_required);
|
3846 |
-
edit_main_td8.appendChild(el_unique_label);
|
3847 |
-
edit_main_td8_1.appendChild(el_unique);
|
3848 |
-
|
3849 |
-
edit_main_td7.appendChild(el_attr_label);
|
3850 |
-
edit_main_td7.appendChild(el_attr_add);
|
3851 |
-
edit_main_td7.appendChild(br6);
|
3852 |
-
edit_main_td7.appendChild(el_attr_table);
|
3853 |
-
edit_main_td7.setAttribute("colspan", "2");
|
3854 |
-
|
3855 |
-
edit_main_tr1.appendChild(edit_main_td1);
|
3856 |
-
edit_main_tr1.appendChild(edit_main_td1_1);
|
3857 |
-
edit_main_tr2.appendChild(edit_main_td2);
|
3858 |
-
edit_main_tr2.appendChild(edit_main_td2_1);
|
3859 |
-
edit_main_tr3.appendChild(edit_main_td3);
|
3860 |
-
edit_main_tr3.appendChild(edit_main_td3_1);
|
3861 |
-
edit_main_tr4.appendChild(edit_main_td4);
|
3862 |
-
edit_main_tr4.appendChild(edit_main_td4_1);
|
3863 |
-
edit_main_tr5.appendChild(edit_main_td5);
|
3864 |
-
edit_main_tr5.appendChild(edit_main_td5_1);
|
3865 |
-
edit_main_tr6.appendChild(edit_main_td6);
|
3866 |
-
edit_main_tr6.appendChild(edit_main_td6_1);
|
3867 |
-
edit_main_tr8.appendChild(edit_main_td8);
|
3868 |
-
edit_main_tr8.appendChild(edit_main_td8_1);
|
3869 |
-
edit_main_tr7.appendChild(edit_main_td7);
|
3870 |
-
edit_main_tr9.appendChild(edit_main_td9);
|
3871 |
-
edit_main_tr9.appendChild(edit_main_td9_1);
|
3872 |
-
edit_main_table.appendChild(edit_main_tr1);
|
3873 |
-
edit_main_table.appendChild(edit_main_tr2);
|
3874 |
-
edit_main_table.appendChild(edit_main_tr3);
|
3875 |
-
edit_main_table.appendChild(edit_main_tr4);
|
3876 |
-
edit_main_table.appendChild(edit_main_tr5);
|
3877 |
-
edit_main_table.appendChild(edit_main_tr9);
|
3878 |
-
edit_main_table.appendChild(edit_main_tr6);
|
3879 |
-
edit_main_table.appendChild(edit_main_tr8);
|
3880 |
-
edit_main_table.appendChild(edit_main_tr7);
|
3881 |
-
edit_div.appendChild(edit_main_table);
|
3882 |
-
|
3883 |
-
t.appendChild(edit_div);
|
3884 |
-
add_id_and_name(i, 'type_text');
|
3885 |
-
|
3886 |
-
//show table
|
3887 |
|
3888 |
-
|
3889 |
-
|
3890 |
-
|
3891 |
-
|
3892 |
-
|
3893 |
-
|
3894 |
-
|
3895 |
-
|
3896 |
-
|
3897 |
-
|
3898 |
-
|
3899 |
-
|
3900 |
-
|
3901 |
-
var adding_unique= document.createElement("input");
|
3902 |
-
adding_unique.setAttribute("type", "hidden");
|
3903 |
-
adding_unique.setAttribute("value", w_unique);
|
3904 |
-
adding_unique.setAttribute("name", i+"_uniqueform_id_temp");
|
3905 |
-
adding_unique.setAttribute("id", i+"_uniqueform_id_temp");
|
3906 |
-
|
3907 |
-
var adding = document.createElement(element);
|
3908 |
-
adding.setAttribute("type", type);
|
3909 |
-
|
3910 |
-
if(w_title==w_first_val)
|
3911 |
-
{
|
3912 |
-
adding.style.cssText = "width:"+w_size+"px;";
|
3913 |
-
adding.setAttribute("class", "input_deactive");
|
3914 |
-
}
|
3915 |
-
else
|
3916 |
-
{
|
3917 |
-
adding.style.cssText = "width:"+w_size+"px;";
|
3918 |
-
adding.setAttribute("class", "input_active");
|
3919 |
-
}
|
3920 |
-
adding.setAttribute("id", i+"_elementform_id_temp");
|
3921 |
-
adding.setAttribute("name", i+"_elementform_id_temp");
|
3922 |
-
adding.setAttribute("value", w_first_val);
|
3923 |
-
adding.setAttribute("title", w_title);
|
3924 |
-
adding.setAttribute("onFocus", 'delete_value("'+i+'_elementform_id_temp")');
|
3925 |
-
adding.setAttribute("onBlur", 'return_value("'+i+'_elementform_id_temp")');
|
3926 |
-
adding.setAttribute("onChange", 'change_value("'+i+'_elementform_id_temp")');
|
3927 |
-
|
3928 |
-
|
3929 |
-
var div = document.createElement('div');
|
3930 |
-
div.setAttribute("id", "main_div");
|
3931 |
-
|
3932 |
-
var table = document.createElement('table');
|
3933 |
-
table.setAttribute("id", i+"_elemet_tableform_id_temp");
|
3934 |
-
|
3935 |
-
var tr = document.createElement('tr');
|
3936 |
-
|
3937 |
-
var td1 = document.createElement('td');
|
3938 |
-
td1.setAttribute("valign", 'middle');
|
3939 |
-
td1.setAttribute("align", 'left');
|
3940 |
-
td1.setAttribute("id", i+"_label_sectionform_id_temp");
|
3941 |
-
|
3942 |
-
var td2 = document.createElement('td');
|
3943 |
-
td2.setAttribute("valign", 'middle');
|
3944 |
-
td2.setAttribute("align", 'left');
|
3945 |
-
td2.setAttribute("id", i+"_element_sectionform_id_temp");
|
3946 |
-
|
3947 |
-
var br1 = document.createElement('br');
|
3948 |
-
var br2 = document.createElement('br');
|
3949 |
-
var br3 = document.createElement('br');
|
3950 |
-
var br4 = document.createElement('br');
|
3951 |
-
|
3952 |
|
3953 |
-
|
3954 |
-
var label = document.createElement('span');
|
3955 |
-
label.setAttribute("id", i+"_element_labelform_id_temp");
|
3956 |
-
label.innerHTML = w_field_label;
|
3957 |
-
label.setAttribute("class", "label");
|
3958 |
-
|
3959 |
-
var required = document.createElement('span');
|
3960 |
-
required.setAttribute("id", i+"_required_elementform_id_temp");
|
3961 |
-
required.innerHTML = "";
|
3962 |
-
required.setAttribute("class", "required");
|
3963 |
-
if(w_required=="yes")
|
3964 |
-
required.innerHTML = " *";
|
3965 |
-
var main_td = document.getElementById('show_table');
|
3966 |
-
|
3967 |
-
td1.appendChild(label);
|
3968 |
-
td1.appendChild(required);
|
3969 |
-
td2.appendChild(adding_type);
|
3970 |
-
td2.appendChild(adding_required);
|
3971 |
-
td2.appendChild(adding_unique);
|
3972 |
-
td2.appendChild(adding);
|
3973 |
-
tr.appendChild(td1);
|
3974 |
-
tr.appendChild(td2);
|
3975 |
-
table.appendChild(tr);
|
3976 |
-
|
3977 |
-
div.appendChild(table);
|
3978 |
-
div.appendChild(br3);
|
3979 |
-
main_td.appendChild(div);
|
3980 |
-
if(w_field_label_pos=="top")
|
3981 |
-
label_top(i);
|
3982 |
-
change_class(w_class, i);
|
3983 |
-
refresh_attr(i, 'type_text');
|
3984 |
}
|
3985 |
|
3986 |
-
function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3987 |
|
3988 |
-
|
3989 |
-
|
3990 |
-
|
3991 |
-
|
3992 |
-
|
3993 |
-
|
3994 |
-
|
3995 |
-
|
3996 |
-
|
3997 |
-
|
3998 |
-
edit_main_table.setAttribute("id", "edit_main_table");
|
3999 |
-
edit_main_table.setAttribute("cellpadding", "0");
|
4000 |
-
edit_main_table.setAttribute("cellspacing", "0");
|
4001 |
-
|
4002 |
-
var edit_main_tr1 = document.createElement('tr');
|
4003 |
-
edit_main_tr1.setAttribute("valing", "top");
|
4004 |
-
|
4005 |
-
var edit_main_tr2 = document.createElement('tr');
|
4006 |
-
edit_main_tr2.setAttribute("valing", "top");
|
4007 |
-
|
4008 |
-
var edit_main_tr3 = document.createElement('tr');
|
4009 |
-
edit_main_tr3.setAttribute("valing", "top");
|
4010 |
-
|
4011 |
-
var edit_main_tr4 = document.createElement('tr');
|
4012 |
-
edit_main_tr4.setAttribute("valing", "top");
|
4013 |
-
|
4014 |
-
var edit_main_tr5 = document.createElement('tr');
|
4015 |
-
edit_main_tr5.setAttribute("valing", "top");
|
4016 |
-
|
4017 |
-
var edit_main_tr6 = document.createElement('tr');
|
4018 |
-
edit_main_tr6.setAttribute("valing", "top");
|
4019 |
-
|
4020 |
-
var edit_main_tr7 = document.createElement('tr');
|
4021 |
-
edit_main_tr7.setAttribute("valing", "top");
|
4022 |
-
|
4023 |
-
var edit_main_tr8 = document.createElement('tr');
|
4024 |
-
edit_main_tr8.setAttribute("valing", "top");
|
4025 |
-
|
4026 |
-
var edit_main_td1 = document.createElement('td');
|
4027 |
-
edit_main_td1.style.cssText = "padding-top:10px";
|
4028 |
-
var edit_main_td1_1 = document.createElement('td');
|
4029 |
-
edit_main_td1_1.style.cssText = "padding-top:10px";
|
4030 |
-
var edit_main_td2 = document.createElement('td');
|
4031 |
-
edit_main_td2.style.cssText = "padding-top:10px";
|
4032 |
-
var edit_main_td2_1 = document.createElement('td');
|
4033 |
-
edit_main_td2_1.style.cssText = "padding-top:10px";
|
4034 |
-
|
4035 |
-
var edit_main_td3 = document.createElement('td');
|
4036 |
-
edit_main_td3.style.cssText = "padding-top:10px";
|
4037 |
-
var edit_main_td3_1 = document.createElement('td');
|
4038 |
-
edit_main_td3_1.style.cssText = "padding-top:10px";
|
4039 |
-
var edit_main_td4 = document.createElement('td');
|
4040 |
-
edit_main_td4.style.cssText = "padding-top:10px";
|
4041 |
-
var edit_main_td4_1 = document.createElement('td');
|
4042 |
-
edit_main_td4_1.style.cssText = "padding-top:10px";
|
4043 |
-
|
4044 |
-
var edit_main_td5 = document.createElement('td');
|
4045 |
-
edit_main_td5.style.cssText = "padding-top:10px";
|
4046 |
-
var edit_main_td5_1 = document.createElement('td');
|
4047 |
-
edit_main_td5_1.style.cssText = "padding-top:10px";
|
4048 |
-
|
4049 |
-
var edit_main_td6 = document.createElement('td');
|
4050 |
-
edit_main_td6.style.cssText = "padding-top:10px";
|
4051 |
-
var edit_main_td6_1 = document.createElement('td');
|
4052 |
-
edit_main_td6_1.style.cssText = "padding-top:10px";
|
4053 |
-
|
4054 |
-
var edit_main_td7 = document.createElement('td');
|
4055 |
-
edit_main_td7.style.cssText = "padding-top:10px";
|
4056 |
-
var edit_main_td7_1 = document.createElement('td');
|
4057 |
-
edit_main_td7_1.style.cssText = "padding-top:10px";
|
4058 |
-
|
4059 |
-
var edit_main_td8 = document.createElement('td');
|
4060 |
-
edit_main_td8.style.cssText = "padding-top:10px";
|
4061 |
-
var edit_main_td8_1 = document.createElement('td');
|
4062 |
-
edit_main_td8_1.style.cssText = "padding-top:10px";
|
4063 |
-
|
4064 |
-
var el_label_label = document.createElement('label');
|
4065 |
-
el_label_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
4066 |
-
el_label_label.innerHTML = "Field label";
|
4067 |
-
|
4068 |
-
var el_label_textarea = document.createElement('textarea');
|
4069 |
-
el_label_textarea.setAttribute("id", "edit_for_label");
|
4070 |
-
el_label_textarea.setAttribute("rows", "4");
|
4071 |
-
el_label_textarea.style.cssText = "width:200px";
|
4072 |
-
el_label_textarea.setAttribute("onKeyUp", "change_label('"+i+"_element_labelform_id_temp', this.value)");
|
4073 |
-
el_label_textarea.innerHTML = w_field_label;
|
4074 |
-
|
4075 |
-
var el_label_position_label = document.createElement('label');
|
4076 |
-
el_label_position_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
4077 |
-
el_label_position_label.innerHTML = "Field label position";
|
4078 |
-
|
4079 |
-
var el_label_position1 = document.createElement('input');
|
4080 |
-
el_label_position1.setAttribute("id", "edit_for_label_position_top");
|
4081 |
-
el_label_position1.setAttribute("type", "radio");
|
4082 |
-
el_label_position1.setAttribute("value", "left");
|
4083 |
-
|
4084 |
-
el_label_position1.setAttribute("name", "edit_for_label_position");
|
4085 |
-
el_label_position1.setAttribute("onchange", "label_left("+i+")");
|
4086 |
-
Left = document.createTextNode("Left");
|
4087 |
-
|
4088 |
-
var el_label_position2 = document.createElement('input');
|
4089 |
-
|
4090 |
-
el_label_position2.setAttribute("id", "edit_for_label_position_left");
|
4091 |
-
el_label_position2.setAttribute("type", "radio");
|
4092 |
-
el_label_position2.setAttribute("value", "top");
|
4093 |
-
|
4094 |
-
el_label_position2.setAttribute("name", "edit_for_label_position");
|
4095 |
-
el_label_position2.setAttribute("onchange", "label_top("+i+")");
|
4096 |
-
Top = document.createTextNode("Top");
|
4097 |
-
|
4098 |
-
if(w_field_label_pos=="top")
|
4099 |
-
el_label_position2.setAttribute("checked", "checked");
|
4100 |
-
else
|
4101 |
-
el_label_position1.setAttribute("checked", "checked");
|
4102 |
-
|
4103 |
-
var el_size_label = document.createElement('label');
|
4104 |
-
el_size_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
4105 |
-
el_size_label.innerHTML = "Field size(px) ";
|
4106 |
-
var el_size = document.createElement('input');
|
4107 |
-
el_size.setAttribute("id", "edit_for_input_size");
|
4108 |
-
el_size.setAttribute("type", "text");
|
4109 |
-
el_size.setAttribute("value", w_size);
|
4110 |
-
|
4111 |
-
el_size.setAttribute("name", "edit_for_size");
|
4112 |
-
el_size.setAttribute("onKeyPress", "return check_isnum(event)");
|
4113 |
-
el_size.setAttribute("onKeyUp", "change_w_style('"+i+"_elementform_id_temp', this.value)");
|
4114 |
-
|
4115 |
-
var el_first_value_label = document.createElement('label');
|
4116 |
-
el_first_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
4117 |
-
el_first_value_label.innerHTML = "Value if empty ";
|
4118 |
-
|
4119 |
-
var el_first_value_input = document.createElement('input');
|
4120 |
-
el_first_value_input.setAttribute("id", "el_first_value_input");
|
4121 |
-
el_first_value_input.setAttribute("type", "text");
|
4122 |
-
el_first_value_input.setAttribute("value", w_title);
|
4123 |
-
el_first_value_input.style.cssText = "width:200px;";
|
4124 |
-
el_first_value_input.setAttribute("onKeyUp", "change_input_value(this.value,'"+i+"_elementform_id_temp')");
|
4125 |
-
var el_required_label = document.createElement('label');
|
4126 |
-
el_required_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
4127 |
-
el_required_label.innerHTML = "Required";
|
4128 |
-
|
4129 |
-
var el_required = document.createElement('input');
|
4130 |
-
el_required.setAttribute("id", "el_send");
|
4131 |
-
el_required.setAttribute("type", "checkbox");
|
4132 |
-
el_required.setAttribute("value", "yes");
|
4133 |
-
el_required.setAttribute("onclick", "set_required('"+i+"_required')");
|
4134 |
-
if(w_required=="yes")
|
4135 |
-
el_required.setAttribute("checked", "checked");
|
4136 |
-
|
4137 |
-
var el_unique_label = document.createElement('label');
|
4138 |
-
el_unique_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
4139 |
-
el_unique_label.innerHTML = "Allow only unique values";
|
4140 |
-
|
4141 |
-
var el_unique = document.createElement('input');
|
4142 |
-
el_unique.setAttribute("id", "el_send");
|
4143 |
-
el_unique.setAttribute("type", "checkbox");
|
4144 |
-
el_unique.setAttribute("value", "yes");
|
4145 |
-
el_unique.setAttribute("onclick", "set_unique('"+i+"_uniqueform_id_temp')");
|
4146 |
-
if(w_unique=="yes")
|
4147 |
-
el_unique.setAttribute("checked", "checked");
|
4148 |
-
|
4149 |
-
var el_style_label = document.createElement('label');
|
4150 |
-
el_style_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
4151 |
-
el_style_label.innerHTML = "Class name";
|
4152 |
-
|
4153 |
-
var el_style_textarea = document.createElement('input');
|
4154 |
-
el_style_textarea.setAttribute("id", "element_style");
|
4155 |
-
el_style_textarea.setAttribute("type", "text");
|
4156 |
-
el_style_textarea.setAttribute("value", w_class);
|
4157 |
-
el_style_textarea.style.cssText = "width:200px;";
|
4158 |
-
el_style_textarea.setAttribute("onChange", "change_class(this.value,'"+i+"')");
|
4159 |
-
|
4160 |
-
var el_attr_label = document.createElement('label');
|
4161 |
-
el_attr_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
4162 |
-
el_attr_label.innerHTML = "Additional Attributes";
|
4163 |
-
|
4164 |
-
var el_attr_add = document.createElement('img');
|
4165 |
-
el_attr_add.setAttribute("id", "el_choices_add");
|
4166 |
-
el_attr_add.setAttribute("src", plugin_url+'/images/add.png');
|
4167 |
-
el_attr_add.style.cssText = 'cursor:pointer; margin-left:68px';
|
4168 |
-
el_attr_add.setAttribute("title", 'add');
|
4169 |
-
el_attr_add.setAttribute("onClick", "add_attr("+i+", 'type_text')");
|
4170 |
-
var el_attr_table = document.createElement('table');
|
4171 |
-
el_attr_table.setAttribute("id", 'attributes');
|
4172 |
-
el_attr_table.setAttribute("border", '0');
|
4173 |
-
el_attr_table.style.cssText = 'margin-left:0px';
|
4174 |
-
var el_attr_tr_label = document.createElement('tr');
|
4175 |
-
el_attr_tr_label.setAttribute("idi", '0');
|
4176 |
-
var el_attr_td_name_label = document.createElement('th');
|
4177 |
-
el_attr_td_name_label.style.cssText = 'width:100px';
|
4178 |
-
var el_attr_td_value_label = document.createElement('th');
|
4179 |
-
el_attr_td_value_label.style.cssText = 'width:100px';
|
4180 |
-
var el_attr_td_X_label = document.createElement('th');
|
4181 |
-
el_attr_td_X_label.style.cssText = 'width:10px';
|
4182 |
-
var el_attr_name_label = document.createElement('label');
|
4183 |
-
el_attr_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
|
4184 |
-
el_attr_name_label.innerHTML = "Name";
|
4185 |
-
|
4186 |
-
var el_attr_value_label = document.createElement('label');
|
4187 |
-
el_attr_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
|
4188 |
-
el_attr_value_label.innerHTML = "Value";
|
4189 |
-
|
4190 |
-
el_attr_table.appendChild(el_attr_tr_label);
|
4191 |
-
el_attr_tr_label.appendChild(el_attr_td_name_label);
|
4192 |
-
el_attr_tr_label.appendChild(el_attr_td_value_label);
|
4193 |
-
el_attr_tr_label.appendChild(el_attr_td_X_label);
|
4194 |
-
el_attr_td_name_label.appendChild(el_attr_name_label);
|
4195 |
-
el_attr_td_value_label.appendChild(el_attr_value_label);
|
4196 |
-
|
4197 |
-
n=w_attr_name.length;
|
4198 |
-
for(j=1; j<=n; j++)
|
4199 |
-
{
|
4200 |
-
var el_attr_tr = document.createElement('tr');
|
4201 |
-
el_attr_tr.setAttribute("id", "attr_row_"+j);
|
4202 |
-
el_attr_tr.setAttribute("idi", j);
|
4203 |
-
var el_attr_td_name = document.createElement('td');
|
4204 |
-
el_attr_td_name.style.cssText = 'width:100px';
|
4205 |
-
var el_attr_td_value = document.createElement('td');
|
4206 |
-
el_attr_td_value.style.cssText = 'width:100px';
|
4207 |
-
|
4208 |
-
var el_attr_td_X = document.createElement('td');
|
4209 |
-
var el_attr_name = document.createElement('input');
|
4210 |
-
|
4211 |
-
el_attr_name.setAttribute("type", "text");
|
4212 |
-
|
4213 |
-
el_attr_name.style.cssText = "width:100px";
|
4214 |
-
el_attr_name.setAttribute("value", w_attr_name[j-1]);
|
4215 |
-
el_attr_name.setAttribute("id", "attr_name"+j);
|
4216 |
-
el_attr_name.setAttribute("onChange", "change_attribute_name("+i+", this, 'type_text')");
|
4217 |
-
|
4218 |
-
var el_attr_value = document.createElement('input');
|
4219 |
-
|
4220 |
-
el_attr_value.setAttribute("type", "text");
|
4221 |
-
|
4222 |
-
el_attr_value.style.cssText = "width:100px";
|
4223 |
-
el_attr_value.setAttribute("value", w_attr_value[j-1]);
|
4224 |
-
el_attr_value.setAttribute("id", "attr_value"+j);
|
4225 |
-
el_attr_value.setAttribute("onChange", "change_attribute_value("+i+", "+j+", 'type_text')");
|
4226 |
-
|
4227 |
-
var el_attr_remove = document.createElement('img');
|
4228 |
-
el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
|
4229 |
-
el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
|
4230 |
-
el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
|
4231 |
-
el_attr_remove.setAttribute("align", 'top');
|
4232 |
-
el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", 'type_text')");
|
4233 |
-
el_attr_table.appendChild(el_attr_tr);
|
4234 |
-
el_attr_tr.appendChild(el_attr_td_name);
|
4235 |
-
el_attr_tr.appendChild(el_attr_td_value);
|
4236 |
-
el_attr_tr.appendChild(el_attr_td_X);
|
4237 |
-
el_attr_td_name.appendChild(el_attr_name);
|
4238 |
-
el_attr_td_value.appendChild(el_attr_value);
|
4239 |
-
el_attr_td_X.appendChild(el_attr_remove);
|
4240 |
-
|
4241 |
-
}
|
4242 |
-
|
4243 |
-
|
4244 |
-
var t = document.getElementById('edit_table');
|
4245 |
-
|
4246 |
-
var br = document.createElement('br');
|
4247 |
-
var br1 = document.createElement('br');
|
4248 |
-
var br2 = document.createElement('br');
|
4249 |
-
var br3 = document.createElement('br');
|
4250 |
-
var br4 = document.createElement('br');
|
4251 |
-
var br5 = document.createElement('br');
|
4252 |
-
var br6 = document.createElement('br');
|
4253 |
-
edit_main_td1.appendChild(el_label_label);
|
4254 |
-
edit_main_td1_1.appendChild(el_label_textarea);
|
4255 |
-
|
4256 |
-
edit_main_td2.appendChild(el_label_position_label);
|
4257 |
-
edit_main_td2_1.appendChild(el_label_position1);
|
4258 |
-
edit_main_td2_1.appendChild(Left);
|
4259 |
-
edit_main_td2_1.appendChild(br2);
|
4260 |
-
edit_main_td2_1.appendChild(el_label_position2);
|
4261 |
-
edit_main_td2_1.appendChild(Top);
|
4262 |
-
|
4263 |
-
edit_main_td3.appendChild(el_size_label);
|
4264 |
-
edit_main_td3_1.appendChild(el_size);
|
4265 |
-
|
4266 |
-
edit_main_td4.appendChild(el_first_value_label);
|
4267 |
-
edit_main_td4_1.appendChild(el_first_value_input);
|
4268 |
-
|
4269 |
-
edit_main_td5.appendChild(el_style_label);
|
4270 |
-
edit_main_td5_1.appendChild(el_style_textarea);
|
4271 |
-
edit_main_td6.appendChild(el_required_label);
|
4272 |
-
edit_main_td6_1.appendChild(el_required);
|
4273 |
-
|
4274 |
-
edit_main_td8.appendChild(el_unique_label);
|
4275 |
-
edit_main_td8_1.appendChild(el_unique);
|
4276 |
-
|
4277 |
-
|
4278 |
-
edit_main_td7.appendChild(el_attr_label);
|
4279 |
-
edit_main_td7.appendChild(el_attr_add);
|
4280 |
-
edit_main_td7.appendChild(br6);
|
4281 |
-
edit_main_td7.appendChild(el_attr_table);
|
4282 |
-
edit_main_td7.setAttribute("colspan", "2");
|
4283 |
-
|
4284 |
-
edit_main_tr1.appendChild(edit_main_td1);
|
4285 |
-
edit_main_tr1.appendChild(edit_main_td1_1);
|
4286 |
-
edit_main_tr2.appendChild(edit_main_td2);
|
4287 |
-
edit_main_tr2.appendChild(edit_main_td2_1);
|
4288 |
-
edit_main_tr3.appendChild(edit_main_td3);
|
4289 |
-
edit_main_tr3.appendChild(edit_main_td3_1);
|
4290 |
-
edit_main_tr4.appendChild(edit_main_td4);
|
4291 |
-
edit_main_tr4.appendChild(edit_main_td4_1);
|
4292 |
-
edit_main_tr5.appendChild(edit_main_td5);
|
4293 |
-
edit_main_tr5.appendChild(edit_main_td5_1);
|
4294 |
-
edit_main_tr6.appendChild(edit_main_td6);
|
4295 |
-
edit_main_tr6.appendChild(edit_main_td6_1);
|
4296 |
-
edit_main_tr8.appendChild(edit_main_td8);
|
4297 |
-
edit_main_tr8.appendChild(edit_main_td8_1);
|
4298 |
-
edit_main_tr7.appendChild(edit_main_td7);
|
4299 |
-
edit_main_table.appendChild(edit_main_tr1);
|
4300 |
-
edit_main_table.appendChild(edit_main_tr2);
|
4301 |
-
edit_main_table.appendChild(edit_main_tr3);
|
4302 |
-
edit_main_table.appendChild(edit_main_tr4);
|
4303 |
-
edit_main_table.appendChild(edit_main_tr5);
|
4304 |
-
edit_main_table.appendChild(edit_main_tr6);
|
4305 |
-
edit_main_table.appendChild(edit_main_tr8);
|
4306 |
-
edit_main_table.appendChild(edit_main_tr7);
|
4307 |
-
edit_div.appendChild(edit_main_table);
|
4308 |
-
|
4309 |
-
t.appendChild(edit_div);
|
4310 |
-
add_id_and_name(i, 'type_text');
|
4311 |
-
|
4312 |
-
//show table
|
4313 |
|
4314 |
-
|
4315 |
-
|
4316 |
-
|
4317 |
-
|
4318 |
-
|
4319 |
-
|
4320 |
-
|
4321 |
-
|
4322 |
-
|
4323 |
-
|
4324 |
-
|
4325 |
-
|
4326 |
-
|
4327 |
-
|
4328 |
-
|
4329 |
-
|
4330 |
-
|
4331 |
-
|
4332 |
-
|
4333 |
-
|
4334 |
-
var adding = document.createElement(element);
|
4335 |
-
adding.setAttribute("type", type);
|
4336 |
-
|
4337 |
-
if(w_title==w_first_val)
|
4338 |
-
{
|
4339 |
-
adding.style.cssText = "width:"+w_size+"px;";
|
4340 |
-
adding.setAttribute("class", "input_deactive");
|
4341 |
-
}
|
4342 |
-
else
|
4343 |
-
{
|
4344 |
-
adding.style.cssText = "width:"+w_size+"px;";
|
4345 |
-
adding.setAttribute("class", "input_active");
|
4346 |
-
}
|
4347 |
-
adding.setAttribute("id", i+"_elementform_id_temp");
|
4348 |
-
adding.setAttribute("name", i+"_elementform_id_temp");
|
4349 |
-
adding.setAttribute("value", w_first_val);
|
4350 |
-
adding.setAttribute("title", w_title);
|
4351 |
-
adding.setAttribute("onKeyPress", "return check_isnum(event)");
|
4352 |
-
adding.setAttribute("onFocus", 'delete_value("'+i+'_elementform_id_temp")');
|
4353 |
-
adding.setAttribute("onBlur", 'return_value("'+i+'_elementform_id_temp")');
|
4354 |
-
adding.setAttribute("onChange", 'change_value("'+i+'_elementform_id_temp")');
|
4355 |
-
|
4356 |
-
|
4357 |
-
var div = document.createElement('div');
|
4358 |
-
div.setAttribute("id", "main_div");
|
4359 |
-
|
4360 |
-
var table = document.createElement('table');
|
4361 |
-
table.setAttribute("id", i+"_elemet_tableform_id_temp");
|
4362 |
-
|
4363 |
-
var tr = document.createElement('tr');
|
4364 |
-
|
4365 |
-
var td1 = document.createElement('td');
|
4366 |
-
td1.setAttribute("valign", 'middle');
|
4367 |
-
td1.setAttribute("align", 'left');
|
4368 |
-
td1.setAttribute("id", i+"_label_sectionform_id_temp");
|
4369 |
-
|
4370 |
-
var td2 = document.createElement('td');
|
4371 |
-
td2.setAttribute("valign", 'middle');
|
4372 |
-
td2.setAttribute("align", 'left');
|
4373 |
-
td2.setAttribute("id", i+"_element_sectionform_id_temp");
|
4374 |
-
|
4375 |
-
var br1 = document.createElement('br');
|
4376 |
-
var br2 = document.createElement('br');
|
4377 |
-
var br3 = document.createElement('br');
|
4378 |
-
var br4 = document.createElement('br');
|
4379 |
-
|
4380 |
|
4381 |
-
|
4382 |
-
var label = document.createElement('span');
|
4383 |
-
label.setAttribute("id", i+"_element_labelform_id_temp");
|
4384 |
-
label.innerHTML = w_field_label;
|
4385 |
-
label.setAttribute("class", "label");
|
4386 |
-
|
4387 |
-
var required = document.createElement('span');
|
4388 |
-
required.setAttribute("id", i+"_required_elementform_id_temp");
|
4389 |
-
required.innerHTML = "";
|
4390 |
-
required.setAttribute("class", "required");
|
4391 |
-
if(w_required=="yes")
|
4392 |
-
required.innerHTML = " *";
|
4393 |
-
var main_td = document.getElementById('show_table');
|
4394 |
-
|
4395 |
-
td1.appendChild(label);
|
4396 |
-
td1.appendChild(required);
|
4397 |
-
td2.appendChild(adding_type);
|
4398 |
-
td2.appendChild(adding_required);
|
4399 |
-
td2.appendChild(adding_unique);
|
4400 |
-
td2.appendChild(adding);
|
4401 |
-
tr.appendChild(td1);
|
4402 |
-
tr.appendChild(td2);
|
4403 |
-
table.appendChild(tr);
|
4404 |
-
|
4405 |
-
div.appendChild(table);
|
4406 |
-
div.appendChild(br3);
|
4407 |
-
main_td.appendChild(div);
|
4408 |
-
if(w_field_label_pos=="top")
|
4409 |
-
label_top(i);
|
4410 |
-
change_class(w_class, i);
|
4411 |
-
refresh_attr(i, 'type_text');
|
4412 |
-
}
|
4413 |
|
4414 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4415 |
|
4416 |
-
|
|
|
|
|
|
|
|
|
|
|
4417 |
|
4418 |
-
|
4419 |
-
|
4420 |
-
var edit_div = document.createElement('div');
|
4421 |
-
edit_div.setAttribute("id", "edit_div");
|
4422 |
-
edit_div.setAttribute("style", "border-top:1px dotted black;padding:10px; padding-top:0px; padding-bottom:0px; margin-top:10px;");
|
4423 |
-
|
4424 |
-
var edit_main_table = document.createElement('table');
|
4425 |
-
edit_main_table.setAttribute("id", "edit_main_table");
|
4426 |
-
edit_main_table.setAttribute("cellpadding", "0");
|
4427 |
-
edit_main_table.setAttribute("cellspacing", "0");
|
4428 |
-
|
4429 |
-
var edit_main_tr1 = document.createElement('tr');
|
4430 |
-
edit_main_tr1.setAttribute("valing", "top");
|
4431 |
-
|
4432 |
-
var edit_main_tr2 = document.createElement('tr');
|
4433 |
-
edit_main_tr2.setAttribute("valing", "top");
|
4434 |
-
|
4435 |
-
var edit_main_tr3 = document.createElement('tr');
|
4436 |
-
edit_main_tr3.setAttribute("valing", "top");
|
4437 |
-
|
4438 |
-
var edit_main_tr4 = document.createElement('tr');
|
4439 |
-
edit_main_tr4.setAttribute("valing", "top");
|
4440 |
-
|
4441 |
-
var edit_main_tr5 = document.createElement('tr');
|
4442 |
-
edit_main_tr5.setAttribute("valing", "top");
|
4443 |
-
|
4444 |
-
var edit_main_tr6 = document.createElement('tr');
|
4445 |
-
edit_main_tr6.setAttribute("valing", "top");
|
4446 |
-
|
4447 |
-
var edit_main_tr7 = document.createElement('tr');
|
4448 |
-
edit_main_tr7.setAttribute("valing", "top");
|
4449 |
-
|
4450 |
-
var edit_main_td1 = document.createElement('td');
|
4451 |
-
edit_main_td1.style.cssText = "padding-top:10px";
|
4452 |
-
var edit_main_td1_1 = document.createElement('td');
|
4453 |
-
edit_main_td1_1.style.cssText = "padding-top:10px";
|
4454 |
-
var edit_main_td2 = document.createElement('td');
|
4455 |
-
edit_main_td2.style.cssText = "padding-top:10px";
|
4456 |
-
var edit_main_td2_1 = document.createElement('td');
|
4457 |
-
edit_main_td2_1.style.cssText = "padding-top:10px";
|
4458 |
-
|
4459 |
-
var edit_main_td3 = document.createElement('td');
|
4460 |
-
edit_main_td3.style.cssText = "padding-top:10px";
|
4461 |
-
var edit_main_td3_1 = document.createElement('td');
|
4462 |
-
edit_main_td3_1.style.cssText = "padding-top:10px";
|
4463 |
-
|
4464 |
-
var edit_main_td4 = document.createElement('td');
|
4465 |
-
edit_main_td4.style.cssText = "padding-top:10px";
|
4466 |
-
var edit_main_td4_1 = document.createElement('td');
|
4467 |
-
edit_main_td4_1.style.cssText = "padding-top:10px";
|
4468 |
-
|
4469 |
-
var edit_main_td5 = document.createElement('td');
|
4470 |
-
edit_main_td5.style.cssText = "padding-top:10px";
|
4471 |
-
var edit_main_td5_1 = document.createElement('td');
|
4472 |
-
edit_main_td5_1.style.cssText = "padding-top:10px";
|
4473 |
-
|
4474 |
-
var edit_main_td6 = document.createElement('td');
|
4475 |
-
edit_main_td6.style.cssText = "padding-top:10px";
|
4476 |
-
var edit_main_td6_1 = document.createElement('td');
|
4477 |
-
edit_main_td6_1.style.cssText = "padding-top:10px";
|
4478 |
-
|
4479 |
-
var edit_main_td7 = document.createElement('td');
|
4480 |
-
edit_main_td7.style.cssText = "padding-top:10px";
|
4481 |
-
var edit_main_td7_1 = document.createElement('td');
|
4482 |
-
edit_main_td7_1.style.cssText = "padding-top:10px";
|
4483 |
-
|
4484 |
-
var el_label_label = document.createElement('label');
|
4485 |
-
el_label_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
4486 |
-
el_label_label.innerHTML = "Field label";
|
4487 |
-
|
4488 |
-
var el_label_textarea = document.createElement('textarea');
|
4489 |
-
el_label_textarea.setAttribute("id", "edit_for_label");
|
4490 |
-
el_label_textarea.setAttribute("rows", "4");
|
4491 |
-
el_label_textarea.style.cssText = "width:200px;";
|
4492 |
-
el_label_textarea.setAttribute("onKeyUp", "change_label('"+i+"_element_labelform_id_temp', this.value)");
|
4493 |
-
el_label_textarea.innerHTML = w_field_label;
|
4494 |
-
|
4495 |
-
var el_label_position_label = document.createElement('label');
|
4496 |
-
el_label_position_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
4497 |
-
el_label_position_label.innerHTML = "Field label position";
|
4498 |
-
|
4499 |
-
var el_label_position1 = document.createElement('input');
|
4500 |
-
el_label_position1.setAttribute("id", "edit_for_label_position_top");
|
4501 |
-
el_label_position1.setAttribute("type", "radio");
|
4502 |
-
el_label_position1.setAttribute("value", "left");
|
4503 |
-
|
4504 |
-
|
4505 |
-
el_label_position1.setAttribute("name", "edit_for_label_position");
|
4506 |
-
el_label_position1.setAttribute("onchange", "label_left("+i+")");
|
4507 |
-
Left = document.createTextNode("Left");
|
4508 |
-
|
4509 |
-
var el_label_position2 = document.createElement('input');
|
4510 |
-
el_label_position2.setAttribute("id", "edit_for_label_position_left");
|
4511 |
-
el_label_position2.setAttribute("type", "radio");
|
4512 |
-
el_label_position2.setAttribute("value", "top");
|
4513 |
-
|
4514 |
-
|
4515 |
-
el_label_position2.setAttribute("name", "edit_for_label_position");
|
4516 |
-
el_label_position2.setAttribute("onchange", "label_top("+i+")");
|
4517 |
-
Top = document.createTextNode("Top");
|
4518 |
-
|
4519 |
-
if(w_field_label_pos=="top")
|
4520 |
-
|
4521 |
-
el_label_position2.setAttribute("checked", "checked");
|
4522 |
-
else
|
4523 |
-
el_label_position1.setAttribute("checked", "checked");
|
4524 |
-
|
4525 |
-
var el_size_label = document.createElement('label');
|
4526 |
-
el_size_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
4527 |
-
el_size_label.innerHTML = "Field size(px) ";
|
4528 |
-
|
4529 |
-
var el_size = document.createElement('input');
|
4530 |
-
el_size.setAttribute("id", "edit_for_input_size");
|
4531 |
-
el_size.setAttribute("type", "text");
|
4532 |
-
el_size.setAttribute("value", w_size);
|
4533 |
-
|
4534 |
-
el_size.setAttribute("name", "edit_for_size");
|
4535 |
-
el_size.setAttribute("onKeyPress", "return check_isnum(event)");
|
4536 |
-
el_size.setAttribute("onKeyUp", "change_w_style('"+i+"_elementform_id_temp', this.value)");
|
4537 |
-
|
4538 |
-
var el_required_label = document.createElement('label');
|
4539 |
-
el_required_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
4540 |
-
el_required_label.innerHTML = "Required";
|
4541 |
-
|
4542 |
-
var el_required = document.createElement('input');
|
4543 |
-
el_required.setAttribute("id", "el_send");
|
4544 |
-
el_required.setAttribute("type", "checkbox");
|
4545 |
-
el_required.setAttribute("value", "yes");
|
4546 |
-
el_required.setAttribute("onclick", "set_required('"+i+"_required')");
|
4547 |
-
if(w_required=="yes")
|
4548 |
-
|
4549 |
-
el_required.setAttribute("checked", "checked");
|
4550 |
-
|
4551 |
-
var el_unique_label = document.createElement('label');
|
4552 |
-
el_unique_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
4553 |
-
el_unique_label.innerHTML = "Allow only unique values";
|
4554 |
-
|
4555 |
-
var el_unique = document.createElement('input');
|
4556 |
-
el_unique.setAttribute("id", "el_send");
|
4557 |
-
el_unique.setAttribute("type", "checkbox");
|
4558 |
-
el_unique.setAttribute("value", "yes");
|
4559 |
-
el_unique.setAttribute("onclick", "set_unique('"+i+"_uniqueform_id_temp')");
|
4560 |
-
if(w_unique=="yes")
|
4561 |
-
el_unique.setAttribute("checked", "checked");
|
4562 |
-
|
4563 |
-
var el_style_label = document.createElement('label');
|
4564 |
-
el_style_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
4565 |
-
el_style_label.innerHTML = "Class name";
|
4566 |
-
|
4567 |
-
var el_style_textarea = document.createElement('input');
|
4568 |
-
el_style_textarea.setAttribute("id", "element_style");
|
4569 |
-
el_style_textarea.setAttribute("type", "text");
|
4570 |
-
el_style_textarea.setAttribute("value", w_class);
|
4571 |
-
el_style_textarea.style.cssText = "width:200px;";
|
4572 |
-
el_style_textarea.setAttribute("onChange", "change_class(this.value,'"+i+"')");
|
4573 |
-
var el_attr_label = document.createElement('label');
|
4574 |
-
el_attr_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
4575 |
-
el_attr_label.innerHTML = "Additional Attributes";
|
4576 |
-
var el_attr_add = document.createElement('img');
|
4577 |
-
el_attr_add.setAttribute("id", "el_choices_add");
|
4578 |
-
el_attr_add.setAttribute("src", plugin_url+'/images/add.png');
|
4579 |
-
el_attr_add.style.cssText = 'cursor:pointer; margin-left:68px';
|
4580 |
-
el_attr_add.setAttribute("title", 'add');
|
4581 |
-
el_attr_add.setAttribute("onClick", "add_attr("+i+", 'type_text')");
|
4582 |
-
var el_attr_table = document.createElement('table');
|
4583 |
-
el_attr_table.setAttribute("id", 'attributes');
|
4584 |
-
el_attr_table.setAttribute("border", '0');
|
4585 |
-
el_attr_table.style.cssText = 'margin-left:0px';
|
4586 |
-
var el_attr_tr_label = document.createElement('tr');
|
4587 |
-
el_attr_tr_label.setAttribute("idi", '0');
|
4588 |
-
var el_attr_td_name_label = document.createElement('th');
|
4589 |
-
el_attr_td_name_label.style.cssText = 'width:100px';
|
4590 |
-
var el_attr_td_value_label = document.createElement('th');
|
4591 |
-
el_attr_td_value_label.style.cssText = 'width:100px';
|
4592 |
-
var el_attr_td_X_label = document.createElement('th');
|
4593 |
-
el_attr_td_X_label.style.cssText = 'width:10px';
|
4594 |
-
var el_attr_name_label = document.createElement('label');
|
4595 |
-
el_attr_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
|
4596 |
-
el_attr_name_label.innerHTML = "Name";
|
4597 |
-
|
4598 |
-
var el_attr_value_label = document.createElement('label');
|
4599 |
-
el_attr_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
|
4600 |
-
el_attr_value_label.innerHTML = "Value";
|
4601 |
-
|
4602 |
-
el_attr_table.appendChild(el_attr_tr_label);
|
4603 |
-
el_attr_tr_label.appendChild(el_attr_td_name_label);
|
4604 |
-
el_attr_tr_label.appendChild(el_attr_td_value_label);
|
4605 |
-
el_attr_tr_label.appendChild(el_attr_td_X_label);
|
4606 |
-
el_attr_td_name_label.appendChild(el_attr_name_label);
|
4607 |
-
el_attr_td_value_label.appendChild(el_attr_value_label);
|
4608 |
-
|
4609 |
-
n=w_attr_name.length;
|
4610 |
-
for(j=1; j<=n; j++)
|
4611 |
-
{
|
4612 |
-
var el_attr_tr = document.createElement('tr');
|
4613 |
-
el_attr_tr.setAttribute("id", "attr_row_"+j);
|
4614 |
-
el_attr_tr.setAttribute("idi", j);
|
4615 |
-
var el_attr_td_name = document.createElement('td');
|
4616 |
-
el_attr_td_name.style.cssText = 'width:100px';
|
4617 |
-
var el_attr_td_value = document.createElement('td');
|
4618 |
-
el_attr_td_value.style.cssText = 'width:100px';
|
4619 |
-
|
4620 |
-
var el_attr_td_X = document.createElement('td');
|
4621 |
-
var el_attr_name = document.createElement('input');
|
4622 |
-
|
4623 |
-
el_attr_name.setAttribute("type", "text");
|
4624 |
-
|
4625 |
-
el_attr_name.style.cssText = "width:100px";
|
4626 |
-
el_attr_name.setAttribute("value", w_attr_name[j-1]);
|
4627 |
-
el_attr_name.setAttribute("id", "attr_name"+j);
|
4628 |
-
el_attr_name.setAttribute("onChange", "change_attribute_name("+i+", this, 'type_text')");
|
4629 |
-
|
4630 |
-
var el_attr_value = document.createElement('input');
|
4631 |
-
|
4632 |
-
el_attr_value.setAttribute("type", "text");
|
4633 |
-
|
4634 |
-
el_attr_value.style.cssText = "width:100px";
|
4635 |
-
el_attr_value.setAttribute("value", w_attr_value[j-1]);
|
4636 |
-
el_attr_value.setAttribute("id", "attr_value"+j);
|
4637 |
-
el_attr_value.setAttribute("onChange", "change_attribute_value("+i+", "+j+", 'type_text')");
|
4638 |
-
|
4639 |
-
var el_attr_remove = document.createElement('img');
|
4640 |
-
el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
|
4641 |
-
el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
|
4642 |
-
el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
|
4643 |
-
el_attr_remove.setAttribute("align", 'top');
|
4644 |
-
el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", 'type_text')");
|
4645 |
-
el_attr_table.appendChild(el_attr_tr);
|
4646 |
-
el_attr_tr.appendChild(el_attr_td_name);
|
4647 |
-
el_attr_tr.appendChild(el_attr_td_value);
|
4648 |
-
el_attr_tr.appendChild(el_attr_td_X);
|
4649 |
-
el_attr_td_name.appendChild(el_attr_name);
|
4650 |
-
el_attr_td_value.appendChild(el_attr_value);
|
4651 |
-
el_attr_td_X.appendChild(el_attr_remove);
|
4652 |
-
|
4653 |
-
}
|
4654 |
-
|
4655 |
-
var t = document.getElementById('edit_table');
|
4656 |
-
|
4657 |
-
var br = document.createElement('br');
|
4658 |
-
var br1 = document.createElement('br');
|
4659 |
-
var br2 = document.createElement('br');
|
4660 |
-
var br3 = document.createElement('br');
|
4661 |
-
var br4 = document.createElement('br');
|
4662 |
-
var br5 = document.createElement('br');
|
4663 |
-
var br6 = document.createElement('br');
|
4664 |
-
|
4665 |
-
edit_main_td1.appendChild(el_label_label);
|
4666 |
-
edit_main_td1_1.appendChild(el_label_textarea);
|
4667 |
-
|
4668 |
-
edit_main_td2.appendChild(el_label_position_label);
|
4669 |
-
edit_main_td2_1.appendChild(el_label_position1);
|
4670 |
-
edit_main_td2_1.appendChild(Left);
|
4671 |
-
edit_main_td2_1.appendChild(br2);
|
4672 |
-
edit_main_td2_1.appendChild(el_label_position2);
|
4673 |
-
edit_main_td2_1.appendChild(Top);
|
4674 |
-
|
4675 |
-
edit_main_td3.appendChild(el_size_label);
|
4676 |
-
edit_main_td3_1.appendChild(el_size);
|
4677 |
-
|
4678 |
-
edit_main_td4.appendChild(el_style_label);
|
4679 |
-
edit_main_td4_1.appendChild(el_style_textarea);
|
4680 |
-
|
4681 |
-
edit_main_td5.appendChild(el_required_label);
|
4682 |
-
edit_main_td5_1.appendChild(el_required);
|
4683 |
-
|
4684 |
-
edit_main_td7.appendChild(el_unique_label);
|
4685 |
-
edit_main_td7_1.appendChild(el_unique);
|
4686 |
-
|
4687 |
-
edit_main_td6.appendChild(el_attr_label);
|
4688 |
-
edit_main_td6.appendChild(el_attr_add);
|
4689 |
-
edit_main_td6.appendChild(br3);
|
4690 |
-
edit_main_td6.appendChild(el_attr_table);
|
4691 |
-
edit_main_td6.setAttribute("colspan", "2");
|
4692 |
-
|
4693 |
-
|
4694 |
-
edit_main_tr1.appendChild(edit_main_td1);
|
4695 |
-
edit_main_tr1.appendChild(edit_main_td1_1);
|
4696 |
-
edit_main_tr2.appendChild(edit_main_td2);
|
4697 |
-
edit_main_tr2.appendChild(edit_main_td2_1);
|
4698 |
-
edit_main_tr3.appendChild(edit_main_td3);
|
4699 |
-
edit_main_tr3.appendChild(edit_main_td3_1);
|
4700 |
-
edit_main_tr4.appendChild(edit_main_td4);
|
4701 |
-
edit_main_tr4.appendChild(edit_main_td4_1);
|
4702 |
-
edit_main_tr5.appendChild(edit_main_td5);
|
4703 |
-
edit_main_tr5.appendChild(edit_main_td5_1);
|
4704 |
-
edit_main_tr6.appendChild(edit_main_td6);
|
4705 |
-
edit_main_tr7.appendChild(edit_main_td7);
|
4706 |
-
edit_main_tr7.appendChild(edit_main_td7_1);
|
4707 |
-
edit_main_table.appendChild(edit_main_tr1);
|
4708 |
-
edit_main_table.appendChild(edit_main_tr2);
|
4709 |
-
edit_main_table.appendChild(edit_main_tr3);
|
4710 |
-
edit_main_table.appendChild(edit_main_tr4);
|
4711 |
-
edit_main_table.appendChild(edit_main_tr5);
|
4712 |
-
edit_main_table.appendChild(edit_main_tr7);
|
4713 |
-
edit_main_table.appendChild(edit_main_tr6);
|
4714 |
-
edit_div.appendChild(edit_main_table);
|
4715 |
-
|
4716 |
-
t.appendChild(edit_div);
|
4717 |
-
add_id_and_name(i, 'type_text');
|
4718 |
|
4719 |
-
|
|
|
4720 |
|
4721 |
-
|
4722 |
-
|
4723 |
-
|
4724 |
-
adding_type.setAttribute("value", "type_password");
|
4725 |
-
adding_type.setAttribute("name", i+"_typeform_id_temp");
|
4726 |
-
adding_type.setAttribute("id", i+"_typeform_id_temp");
|
4727 |
-
var adding_required= document.createElement("input");
|
4728 |
-
adding_required.setAttribute("type", "hidden");
|
4729 |
-
adding_required.setAttribute("value", w_required);
|
4730 |
-
adding_required.setAttribute("name", i+"_requiredform_id_temp");
|
4731 |
-
adding_required.setAttribute("id", i+"_requiredform_id_temp");
|
4732 |
-
|
4733 |
-
var adding_unique= document.createElement("input");
|
4734 |
-
adding_unique.setAttribute("type", "hidden");
|
4735 |
-
adding_unique.setAttribute("value", w_unique);
|
4736 |
-
adding_unique.setAttribute("name", i+"_uniqueform_id_temp");
|
4737 |
-
adding_unique.setAttribute("id", i+"_uniqueform_id_temp");
|
4738 |
-
|
4739 |
-
var adding = document.createElement(element);
|
4740 |
-
adding.setAttribute("type", type);
|
4741 |
-
adding.setAttribute("id", i+"_elementform_id_temp");
|
4742 |
-
adding.setAttribute("name", i+"_elementform_id_temp");
|
4743 |
-
adding.style.cssText = "width:"+w_size+"px;";
|
4744 |
-
|
4745 |
-
|
4746 |
-
var div = document.createElement('div');
|
4747 |
-
div.setAttribute("id", "main_div");
|
4748 |
-
|
4749 |
-
var table = document.createElement('table');
|
4750 |
-
table.setAttribute("id", i+"_elemet_tableform_id_temp");
|
4751 |
-
|
4752 |
-
var tr = document.createElement('tr');
|
4753 |
-
|
4754 |
-
var td1 = document.createElement('td');
|
4755 |
-
td1.setAttribute("valign", 'middle');
|
4756 |
-
td1.setAttribute("align", 'left');
|
4757 |
-
td1.setAttribute("id", i+"_label_sectionform_id_temp");
|
4758 |
-
|
4759 |
-
var td2 = document.createElement('td');
|
4760 |
-
td2.setAttribute("valign", 'middle');
|
4761 |
-
td2.setAttribute("align", 'left');
|
4762 |
-
td2.setAttribute("id", i+"_element_sectionform_id_temp");
|
4763 |
-
|
4764 |
-
var br1 = document.createElement('br');
|
4765 |
-
var br2 = document.createElement('br');
|
4766 |
-
var br3 = document.createElement('br');
|
4767 |
-
var br4 = document.createElement('br');
|
4768 |
-
|
4769 |
-
|
4770 |
-
var label = document.createElement('span');
|
4771 |
-
label.setAttribute("id", i+"_element_labelform_id_temp");
|
4772 |
-
label.innerHTML = w_field_label;
|
4773 |
-
label.setAttribute("class", "label");
|
4774 |
-
|
4775 |
-
var required = document.createElement('span');
|
4776 |
-
required.setAttribute("id", i+"_required_elementform_id_temp");
|
4777 |
-
required.innerHTML = "";
|
4778 |
-
required.setAttribute("class", "required");
|
4779 |
-
if(w_required=="yes")
|
4780 |
-
required.innerHTML = " *";
|
4781 |
-
var main_td = document.getElementById('show_table');
|
4782 |
-
|
4783 |
-
|
4784 |
-
td1.appendChild(label);
|
4785 |
-
td1.appendChild(required);
|
4786 |
-
td2.appendChild(adding_type);
|
4787 |
-
td2.appendChild(adding_required);
|
4788 |
-
td2.appendChild(adding_unique);
|
4789 |
-
td2.appendChild(adding);
|
4790 |
-
tr.appendChild(td1);
|
4791 |
-
tr.appendChild(td2);
|
4792 |
-
table.appendChild(tr);
|
4793 |
-
|
4794 |
-
div.appendChild(table);
|
4795 |
-
div.appendChild(br3);
|
4796 |
-
main_td.appendChild(div);
|
4797 |
-
if(w_field_label_pos=="top")
|
4798 |
-
label_top(i);
|
4799 |
-
change_class(w_class, i);
|
4800 |
-
refresh_attr(i, 'type_text');
|
4801 |
}
|
4802 |
|
4803 |
-
function
|
4804 |
-
|
4805 |
-
|
|
|
|
|
4806 |
|
4807 |
-
|
4808 |
-
|
4809 |
-
var edit_div = document.createElement('div');
|
4810 |
-
edit_div.setAttribute("id", "edit_div");
|
4811 |
-
edit_div.setAttribute("style", "border-top:1px dotted black;padding:10px; padding-top:0px; padding-bottom:0px; margin-top:10px;");
|
4812 |
-
|
4813 |
-
var edit_main_table = document.createElement('table');
|
4814 |
-
edit_main_table.setAttribute("id", "edit_main_table");
|
4815 |
-
edit_main_table.setAttribute("cellpadding", "0");
|
4816 |
-
edit_main_table.setAttribute("cellspacing", "0");
|
4817 |
-
|
4818 |
-
var edit_main_tr1 = document.createElement('tr');
|
4819 |
-
edit_main_tr1.setAttribute("valing", "top");
|
4820 |
-
|
4821 |
-
var edit_main_tr2 = document.createElement('tr');
|
4822 |
-
edit_main_tr2.setAttribute("valing", "top");
|
4823 |
-
|
4824 |
-
var edit_main_tr3 = document.createElement('tr');
|
4825 |
-
edit_main_tr3.setAttribute("valing", "top");
|
4826 |
-
|
4827 |
-
var edit_main_tr4 = document.createElement('tr');
|
4828 |
-
edit_main_tr4.setAttribute("valing", "top");
|
4829 |
-
|
4830 |
-
var edit_main_tr5 = document.createElement('tr');
|
4831 |
-
edit_main_tr5.setAttribute("valing", "top");
|
4832 |
-
|
4833 |
-
var edit_main_tr6 = document.createElement('tr');
|
4834 |
-
edit_main_tr6.setAttribute("valing", "top");
|
4835 |
-
var edit_main_tr7 = document.createElement('tr');
|
4836 |
-
edit_main_tr7.setAttribute("valing", "top");
|
4837 |
-
|
4838 |
-
var edit_main_tr8 = document.createElement('tr');
|
4839 |
-
edit_main_tr8.setAttribute("valing", "top");
|
4840 |
-
|
4841 |
-
var edit_main_td1 = document.createElement('td');
|
4842 |
-
edit_main_td1.style.cssText = "padding-top:10px";
|
4843 |
-
var edit_main_td1_1 = document.createElement('td');
|
4844 |
-
edit_main_td1_1.style.cssText = "padding-top:10px";
|
4845 |
-
var edit_main_td2 = document.createElement('td');
|
4846 |
-
edit_main_td2.style.cssText = "padding-top:10px";
|
4847 |
-
var edit_main_td2_1 = document.createElement('td');
|
4848 |
-
edit_main_td2_1.style.cssText = "padding-top:10px";
|
4849 |
-
|
4850 |
-
var edit_main_td3 = document.createElement('td');
|
4851 |
-
edit_main_td3.style.cssText = "padding-top:10px";
|
4852 |
-
var edit_main_td3_1 = document.createElement('td');
|
4853 |
-
edit_main_td3_1.style.cssText = "padding-top:10px";
|
4854 |
-
var edit_main_td4 = document.createElement('td');
|
4855 |
-
edit_main_td4.style.cssText = "padding-top:10px";
|
4856 |
-
var edit_main_td4_1 = document.createElement('td');
|
4857 |
-
edit_main_td4_1.style.cssText = "padding-top:10px";
|
4858 |
-
|
4859 |
-
var edit_main_td5 = document.createElement('td');
|
4860 |
-
edit_main_td5.style.cssText = "padding-top:10px";
|
4861 |
-
var edit_main_td5_1 = document.createElement('td');
|
4862 |
-
edit_main_td5_1.style.cssText = "padding-top:10px";
|
4863 |
-
|
4864 |
-
var edit_main_td6 = document.createElement('td');
|
4865 |
-
edit_main_td6.style.cssText = "padding-top:10px";
|
4866 |
-
var edit_main_td6_1 = document.createElement('td');
|
4867 |
-
edit_main_td6_1.style.cssText = "padding-top:10px";
|
4868 |
-
|
4869 |
-
var edit_main_td7 = document.createElement('td');
|
4870 |
-
edit_main_td7.style.cssText = "padding-top:10px";
|
4871 |
-
var edit_main_td7_1 = document.createElement('td');
|
4872 |
-
edit_main_td7_1.style.cssText = "padding-top:10px";
|
4873 |
-
|
4874 |
-
var edit_main_td8 = document.createElement('td');
|
4875 |
-
edit_main_td8.style.cssText = "padding-top:10px";
|
4876 |
-
var edit_main_td8_1 = document.createElement('td');
|
4877 |
-
edit_main_td8_1.style.cssText = "padding-top:10px";
|
4878 |
-
|
4879 |
-
var el_label_label = document.createElement('label');
|
4880 |
-
el_label_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
4881 |
-
el_label_label.innerHTML = "Field label";
|
4882 |
-
|
4883 |
-
var el_label_textarea = document.createElement('textarea');
|
4884 |
-
el_label_textarea.setAttribute("id", "edit_for_label");
|
4885 |
-
el_label_textarea.setAttribute("rows", "4");
|
4886 |
-
el_label_textarea.style.cssText = "width:200px;";
|
4887 |
-
el_label_textarea.setAttribute("onKeyUp", "change_label('"+i+"_element_labelform_id_temp', this.value)");
|
4888 |
-
el_label_textarea.innerHTML = w_field_label;
|
4889 |
-
|
4890 |
-
var el_label_position_label = document.createElement('label');
|
4891 |
-
el_label_position_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
4892 |
-
el_label_position_label.innerHTML = "Field label position";
|
4893 |
-
|
4894 |
-
var el_label_position1 = document.createElement('input');
|
4895 |
-
el_label_position1.setAttribute("id", "edit_for_label_position_top");
|
4896 |
-
el_label_position1.setAttribute("type", "radio");
|
4897 |
-
el_label_position1.setAttribute("value", "left");
|
4898 |
-
|
4899 |
-
|
4900 |
-
el_label_position1.setAttribute("name", "edit_for_label_position");
|
4901 |
-
el_label_position1.setAttribute("onchange", "label_left("+i+")");
|
4902 |
-
Left = document.createTextNode("Left");
|
4903 |
-
|
4904 |
-
var el_label_position2 = document.createElement('input');
|
4905 |
-
el_label_position2.setAttribute("id", "edit_for_label_position_left");
|
4906 |
-
el_label_position2.setAttribute("type", "radio");
|
4907 |
-
el_label_position2.setAttribute("value", "top");
|
4908 |
-
|
4909 |
-
|
4910 |
-
el_label_position2.setAttribute("name", "edit_for_label_position");
|
4911 |
-
el_label_position2.setAttribute("onchange", "label_top("+i+")");
|
4912 |
-
Top = document.createTextNode("Top");
|
4913 |
-
|
4914 |
-
if(w_field_label_pos=="top")
|
4915 |
-
el_label_position2.setAttribute("checked", "checked");
|
4916 |
-
else
|
4917 |
-
el_label_position1.setAttribute("checked", "checked");
|
4918 |
-
|
4919 |
-
var el_size_label = document.createElement('label');
|
4920 |
-
el_size_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
4921 |
-
el_size_label.innerHTML = "Field size(px) ";
|
4922 |
-
|
4923 |
-
var el_size_w = document.createElement('input');
|
4924 |
-
el_size_w.setAttribute("id", "edit_for_input_size");
|
4925 |
-
el_size_w.setAttribute("type", "text");
|
4926 |
-
el_size_w.setAttribute("value", w_size_w);
|
4927 |
-
el_size_w.style.cssText = "margin-right:2px; width: 60px";
|
4928 |
-
el_size_w.setAttribute("name", "edit_for_size");
|
4929 |
-
el_size_w.setAttribute("onKeyPress", "return check_isnum(event)");
|
4930 |
-
el_size_w.setAttribute("onKeyUp", "change_w_style('"+i+"_elementform_id_temp', this.value)");
|
4931 |
-
|
4932 |
-
X = document.createTextNode("x");
|
4933 |
-
|
4934 |
-
var el_size_h = document.createElement('input');
|
4935 |
-
el_size_h.setAttribute("id", "edit_for_input_size");
|
4936 |
-
el_size_h.setAttribute("type", "text");
|
4937 |
-
el_size_h.setAttribute("value", w_size_h);
|
4938 |
-
el_size_h.style.cssText = "margin-left:2px; width:60px";
|
4939 |
-
el_size_h.setAttribute("name", "edit_for_size");
|
4940 |
-
el_size_h.setAttribute("onKeyPress", "return check_isnum(event)");
|
4941 |
-
el_size_h.setAttribute("onKeyUp", "change_h_style('"+i+"_elementform_id_temp', this.value)");
|
4942 |
-
var el_first_value_label = document.createElement('label');
|
4943 |
-
el_first_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
4944 |
-
el_first_value_label.innerHTML = "Value if empty";
|
4945 |
-
|
4946 |
-
var el_first_value_input = document.createElement('input');
|
4947 |
-
el_first_value_input.setAttribute("id", "el_first_value_input");
|
4948 |
-
el_first_value_input.setAttribute("type", "text");
|
4949 |
-
el_first_value_input.setAttribute("value", w_title);
|
4950 |
-
el_first_value_input.style.cssText = "width:200px;";
|
4951 |
-
el_first_value_input.setAttribute("onKeyUp", "change_input_value(this.value,'"+i+"_elementform_id_temp')");
|
4952 |
-
var el_required_label = document.createElement('label');
|
4953 |
-
el_required_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
4954 |
-
el_required_label.innerHTML = "Required";
|
4955 |
-
|
4956 |
-
var el_required = document.createElement('input');
|
4957 |
-
el_required.setAttribute("id", "el_send");
|
4958 |
-
el_required.setAttribute("type", "checkbox");
|
4959 |
-
el_required.setAttribute("value", "yes");
|
4960 |
-
el_required.setAttribute("onclick", "set_required('"+i+"_required')");
|
4961 |
-
if(w_required=="yes")
|
4962 |
-
el_required.setAttribute("checked", "checked");
|
4963 |
-
|
4964 |
-
var el_unique_label = document.createElement('label');
|
4965 |
-
el_unique_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
4966 |
-
el_unique_label.innerHTML = "Allow only unique values";
|
4967 |
-
|
4968 |
-
var el_unique = document.createElement('input');
|
4969 |
-
el_unique.setAttribute("id", "el_send");
|
4970 |
-
el_unique.setAttribute("type", "checkbox");
|
4971 |
-
el_unique.setAttribute("value", "yes");
|
4972 |
-
el_unique.setAttribute("onclick", "set_unique('"+i+"_uniqueform_id_temp')");
|
4973 |
-
if(w_unique=="yes")
|
4974 |
-
el_unique.setAttribute("checked", "checked");
|
4975 |
-
|
4976 |
-
var el_style_label = document.createElement('label');
|
4977 |
-
el_style_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
4978 |
-
el_style_label.innerHTML = "Class name";
|
4979 |
-
|
4980 |
-
var el_style_textarea = document.createElement('input');
|
4981 |
-
el_style_textarea.setAttribute("id", "element_style");
|
4982 |
-
el_style_textarea.setAttribute("type", "text");
|
4983 |
-
el_style_textarea.setAttribute("value", w_class);
|
4984 |
-
el_style_textarea.style.cssText = "width:200px;";
|
4985 |
-
el_style_textarea.setAttribute("onChange", "change_class(this.value,'"+i+"')");
|
4986 |
-
|
4987 |
-
var el_attr_label = document.createElement('label');
|
4988 |
-
el_attr_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
4989 |
-
el_attr_label.innerHTML = "Additional Attributes";
|
4990 |
-
|
4991 |
-
var el_attr_add = document.createElement('img');
|
4992 |
-
el_attr_add.setAttribute("id", "el_choices_add");
|
4993 |
-
el_attr_add.setAttribute("src", plugin_url+'/images/add.png');
|
4994 |
-
el_attr_add.style.cssText = 'cursor:pointer; margin-left:68px';
|
4995 |
-
el_attr_add.setAttribute("title", 'add');
|
4996 |
-
el_attr_add.setAttribute("onClick", "add_attr("+i+", 'type_text')");
|
4997 |
-
var el_attr_table = document.createElement('table');
|
4998 |
-
el_attr_table.setAttribute("id", 'attributes');
|
4999 |
-
el_attr_table.setAttribute("border", '0');
|
5000 |
-
el_attr_table.style.cssText = 'margin-left:0px';
|
5001 |
-
var el_attr_tr_label = document.createElement('tr');
|
5002 |
-
el_attr_tr_label.setAttribute("idi", '0');
|
5003 |
-
var el_attr_td_name_label = document.createElement('th');
|
5004 |
-
el_attr_td_name_label.style.cssText = 'width:100px';
|
5005 |
-
var el_attr_td_value_label = document.createElement('th');
|
5006 |
-
el_attr_td_value_label.style.cssText = 'width:100px';
|
5007 |
-
var el_attr_td_X_label = document.createElement('th');
|
5008 |
-
el_attr_td_X_label.style.cssText = 'width:10px';
|
5009 |
-
var el_attr_name_label = document.createElement('label');
|
5010 |
-
el_attr_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
|
5011 |
-
el_attr_name_label.innerHTML = "Name";
|
5012 |
-
|
5013 |
-
var el_attr_value_label = document.createElement('label');
|
5014 |
-
el_attr_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
|
5015 |
-
el_attr_value_label.innerHTML = "Value";
|
5016 |
-
|
5017 |
-
el_attr_table.appendChild(el_attr_tr_label);
|
5018 |
-
el_attr_tr_label.appendChild(el_attr_td_name_label);
|
5019 |
-
el_attr_tr_label.appendChild(el_attr_td_value_label);
|
5020 |
-
el_attr_tr_label.appendChild(el_attr_td_X_label);
|
5021 |
-
el_attr_td_name_label.appendChild(el_attr_name_label);
|
5022 |
-
el_attr_td_value_label.appendChild(el_attr_value_label);
|
5023 |
-
|
5024 |
-
n=w_attr_name.length;
|
5025 |
-
for(j=1; j<=n; j++)
|
5026 |
-
{
|
5027 |
-
var el_attr_tr = document.createElement('tr');
|
5028 |
-
el_attr_tr.setAttribute("id", "attr_row_"+j);
|
5029 |
-
el_attr_tr.setAttribute("idi", j);
|
5030 |
-
var el_attr_td_name = document.createElement('td');
|
5031 |
-
el_attr_td_name.style.cssText = 'width:100px';
|
5032 |
-
var el_attr_td_value = document.createElement('td');
|
5033 |
-
el_attr_td_value.style.cssText = 'width:100px';
|
5034 |
-
|
5035 |
-
var el_attr_td_X = document.createElement('td');
|
5036 |
-
var el_attr_name = document.createElement('input');
|
5037 |
-
|
5038 |
-
el_attr_name.setAttribute("type", "text");
|
5039 |
-
|
5040 |
-
el_attr_name.style.cssText = "width:100px";
|
5041 |
-
el_attr_name.setAttribute("value", w_attr_name[j-1]);
|
5042 |
-
el_attr_name.setAttribute("id", "attr_name"+j);
|
5043 |
-
el_attr_name.setAttribute("onChange", "change_attribute_name("+i+", this, 'type_text')");
|
5044 |
-
|
5045 |
-
var el_attr_value = document.createElement('input');
|
5046 |
-
|
5047 |
-
el_attr_value.setAttribute("type", "text");
|
5048 |
-
|
5049 |
-
el_attr_value.style.cssText = "width:100px";
|
5050 |
-
el_attr_value.setAttribute("value", w_attr_value[j-1]);
|
5051 |
-
el_attr_value.setAttribute("id", "attr_value"+j);
|
5052 |
-
el_attr_value.setAttribute("onChange", "change_attribute_value("+i+", "+j+", 'type_text')");
|
5053 |
-
|
5054 |
-
var el_attr_remove = document.createElement('img');
|
5055 |
-
el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
|
5056 |
-
el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
|
5057 |
-
el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
|
5058 |
-
el_attr_remove.setAttribute("align", 'top');
|
5059 |
-
el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", 'type_text')");
|
5060 |
-
el_attr_table.appendChild(el_attr_tr);
|
5061 |
-
el_attr_tr.appendChild(el_attr_td_name);
|
5062 |
-
el_attr_tr.appendChild(el_attr_td_value);
|
5063 |
-
el_attr_tr.appendChild(el_attr_td_X);
|
5064 |
-
el_attr_td_name.appendChild(el_attr_name);
|
5065 |
-
el_attr_td_value.appendChild(el_attr_value);
|
5066 |
-
el_attr_td_X.appendChild(el_attr_remove);
|
5067 |
-
|
5068 |
-
}
|
5069 |
-
|
5070 |
-
var t = document.getElementById('edit_table');
|
5071 |
-
|
5072 |
-
var br = document.createElement('br');
|
5073 |
-
var br1 = document.createElement('br');
|
5074 |
-
var br2 = document.createElement('br');
|
5075 |
-
var br3 = document.createElement('br');
|
5076 |
-
var br4 = document.createElement('br');
|
5077 |
-
var br5 = document.createElement('br');
|
5078 |
-
var br6 = document.createElement('br');
|
5079 |
-
|
5080 |
-
edit_main_td1.appendChild(el_label_label);
|
5081 |
-
edit_main_td1_1.appendChild(el_label_textarea);
|
5082 |
-
|
5083 |
-
edit_main_td2.appendChild(el_label_position_label);
|
5084 |
-
edit_main_td2_1.appendChild(el_label_position1);
|
5085 |
-
edit_main_td2_1.appendChild(Left);
|
5086 |
-
edit_main_td2_1.appendChild(br2);
|
5087 |
-
edit_main_td2_1.appendChild(el_label_position2);
|
5088 |
-
edit_main_td2_1.appendChild(Top);
|
5089 |
-
|
5090 |
-
edit_main_td3.appendChild(el_size_label);
|
5091 |
-
|
5092 |
-
edit_main_td3_1.appendChild(el_size_w);
|
5093 |
-
edit_main_td3_1.appendChild(X);
|
5094 |
-
edit_main_td3_1.appendChild(el_size_h);
|
5095 |
-
|
5096 |
-
edit_main_td4.appendChild(el_first_value_label);
|
5097 |
-
edit_main_td4_1.appendChild(el_first_value_input);
|
5098 |
-
|
5099 |
-
edit_main_td5.appendChild(el_style_label);
|
5100 |
-
edit_main_td5_1.appendChild(el_style_textarea);
|
5101 |
-
|
5102 |
-
edit_main_td6.appendChild(el_required_label);
|
5103 |
-
edit_main_td6_1.appendChild(el_required);
|
5104 |
-
|
5105 |
-
edit_main_td8.appendChild(el_unique_label);
|
5106 |
-
edit_main_td8_1.appendChild(el_unique);
|
5107 |
-
|
5108 |
-
edit_main_td7.appendChild(el_attr_label);
|
5109 |
-
edit_main_td7.appendChild(el_attr_add);
|
5110 |
-
edit_main_td7.appendChild(br6);
|
5111 |
-
edit_main_td7.appendChild(el_attr_table);
|
5112 |
-
edit_main_td7.setAttribute("colspan", "2");
|
5113 |
-
|
5114 |
-
|
5115 |
-
edit_main_tr1.appendChild(edit_main_td1);
|
5116 |
-
edit_main_tr1.appendChild(edit_main_td1_1);
|
5117 |
-
edit_main_tr2.appendChild(edit_main_td2);
|
5118 |
-
edit_main_tr2.appendChild(edit_main_td2_1);
|
5119 |
-
edit_main_tr3.appendChild(edit_main_td3);
|
5120 |
-
edit_main_tr3.appendChild(edit_main_td3_1);
|
5121 |
-
edit_main_tr4.appendChild(edit_main_td4);
|
5122 |
-
edit_main_tr4.appendChild(edit_main_td4_1);
|
5123 |
-
edit_main_tr5.appendChild(edit_main_td5);
|
5124 |
-
edit_main_tr5.appendChild(edit_main_td5_1);
|
5125 |
-
edit_main_tr6.appendChild(edit_main_td6);
|
5126 |
-
edit_main_tr6.appendChild(edit_main_td6_1);
|
5127 |
-
edit_main_tr7.appendChild(edit_main_td7);
|
5128 |
-
edit_main_tr7.appendChild(edit_main_td7_1);
|
5129 |
-
edit_main_tr8.appendChild(edit_main_td8);
|
5130 |
-
edit_main_tr8.appendChild(edit_main_td8_1);
|
5131 |
-
edit_main_table.appendChild(edit_main_tr1);
|
5132 |
-
edit_main_table.appendChild(edit_main_tr2);
|
5133 |
-
edit_main_table.appendChild(edit_main_tr3);
|
5134 |
-
edit_main_table.appendChild(edit_main_tr4);
|
5135 |
-
edit_main_table.appendChild(edit_main_tr5);
|
5136 |
-
edit_main_table.appendChild(edit_main_tr6);
|
5137 |
-
edit_main_table.appendChild(edit_main_tr8);
|
5138 |
-
edit_main_table.appendChild(edit_main_tr7);
|
5139 |
-
edit_div.appendChild(edit_main_table);
|
5140 |
-
|
5141 |
-
t.appendChild(edit_div);
|
5142 |
-
add_id_and_name(i, 'type_text');
|
5143 |
|
5144 |
-
|
5145 |
|
5146 |
-
|
5147 |
-
|
5148 |
-
|
5149 |
-
|
5150 |
-
|
5151 |
-
|
5152 |
-
var adding_required= document.createElement("input");
|
5153 |
-
adding_required.setAttribute("type", "hidden");
|
5154 |
-
adding_required.setAttribute("value", w_required);
|
5155 |
-
adding_required.setAttribute("name", i+"_requiredform_id_temp");
|
5156 |
-
adding_required.setAttribute("id", i+"_requiredform_id_temp");
|
5157 |
-
|
5158 |
-
var adding_unique= document.createElement("input");
|
5159 |
-
adding_unique.setAttribute("type", "hidden");
|
5160 |
-
adding_unique.setAttribute("value", w_unique);
|
5161 |
-
adding_unique.setAttribute("name", i+"_uniqueform_id_temp");
|
5162 |
-
adding_unique.setAttribute("id", i+"_uniqueform_id_temp");
|
5163 |
-
|
5164 |
-
var div = document.createElement('div');
|
5165 |
-
div.setAttribute("id", "main_div");
|
5166 |
-
|
5167 |
-
var table = document.createElement('table');
|
5168 |
-
table.setAttribute("id", i+"_elemet_tableform_id_temp");
|
5169 |
-
|
5170 |
-
var tr = document.createElement('tr');
|
5171 |
-
|
5172 |
-
var td1 = document.createElement('td');
|
5173 |
-
td1.setAttribute("valign", 'top');
|
5174 |
-
td1.setAttribute("align", 'left');
|
5175 |
-
td1.setAttribute("id", i+"_label_sectionform_id_temp");
|
5176 |
-
|
5177 |
-
var td2 = document.createElement('td');
|
5178 |
-
td2.setAttribute("valign", 'top');
|
5179 |
-
td2.setAttribute("align", 'left');
|
5180 |
-
td2.setAttribute("id", i+"_element_sectionform_id_temp");
|
5181 |
-
|
5182 |
-
var br1 = document.createElement('br');
|
5183 |
-
var br2 = document.createElement('br');
|
5184 |
-
var br3 = document.createElement('br');
|
5185 |
-
var br4 = document.createElement('br');
|
5186 |
-
|
5187 |
-
var label = document.createElement('span');
|
5188 |
-
label.setAttribute("id", i+"_element_labelform_id_temp");
|
5189 |
-
label.innerHTML = w_field_label;
|
5190 |
-
label.setAttribute("class", "label");
|
5191 |
-
|
5192 |
-
var required = document.createElement('span');
|
5193 |
-
required.setAttribute("id", i+"_required_elementform_id_temp");
|
5194 |
-
required.innerHTML = "";
|
5195 |
-
required.setAttribute("class", "required");
|
5196 |
-
if(w_required=="yes")
|
5197 |
-
required.innerHTML = " *";
|
5198 |
-
var adding = document.createElement(element);
|
5199 |
-
if(w_title==w_first_val)
|
5200 |
-
{
|
5201 |
-
adding.style.cssText = "width:"+w_size_w+"px; height:"+w_size_h+"px;";
|
5202 |
-
adding.setAttribute("class", "input_deactive");
|
5203 |
-
}
|
5204 |
-
else
|
5205 |
-
{
|
5206 |
-
adding.style.cssText = "width:"+w_size_w+"px; height:"+w_size_h+"px;";
|
5207 |
-
adding.setAttribute("class", "input_active");
|
5208 |
-
}
|
5209 |
-
adding.setAttribute("id", i+"_elementform_id_temp");
|
5210 |
-
adding.setAttribute("name", i+"_elementform_id_temp");
|
5211 |
-
adding.setAttribute("title", w_title);
|
5212 |
-
adding.setAttribute("value",w_first_val);
|
5213 |
-
adding.setAttribute("onFocus", "delete_value('"+i+"_elementform_id_temp')");
|
5214 |
-
adding.setAttribute("onBlur", "return_value('"+i+"_elementform_id_temp')");
|
5215 |
-
adding.setAttribute("onChange", "change_value('"+i+"_elementform_id_temp')");
|
5216 |
-
adding.innerHTML=w_first_val;
|
5217 |
-
|
5218 |
-
|
5219 |
-
var main_td = document.getElementById('show_table');
|
5220 |
-
|
5221 |
-
|
5222 |
-
td1.appendChild(label);
|
5223 |
-
td1.appendChild(required);
|
5224 |
-
td2.appendChild(adding_type);
|
5225 |
-
|
5226 |
-
td2.appendChild(adding_required);
|
5227 |
-
td2.appendChild(adding_unique);
|
5228 |
-
td2.appendChild(adding);
|
5229 |
-
tr.appendChild(td1);
|
5230 |
-
tr.appendChild(td2);
|
5231 |
-
table.appendChild(tr);
|
5232 |
-
|
5233 |
-
div.appendChild(table);
|
5234 |
-
div.appendChild(br3);
|
5235 |
-
main_td.appendChild(div);
|
5236 |
-
if(w_field_label_pos=="top")
|
5237 |
-
label_top(i);
|
5238 |
-
change_class(w_class, i);
|
5239 |
-
refresh_attr(i, 'type_text');
|
5240 |
}
|
5241 |
|
5242 |
-
function
|
5243 |
-
document.getElementById("element_type").value="type_phone";
|
5244 |
|
5245 |
-
|
5246 |
-
|
5247 |
-
|
5248 |
-
|
5249 |
-
|
5250 |
-
|
5251 |
-
|
5252 |
-
edit_main_table.setAttribute("id", "edit_main_table");
|
5253 |
-
edit_main_table.setAttribute("cellpadding", "0");
|
5254 |
-
edit_main_table.setAttribute("cellspacing", "0");
|
5255 |
-
|
5256 |
-
var edit_main_tr1 = document.createElement('tr');
|
5257 |
-
edit_main_tr1.setAttribute("valing", "top");
|
5258 |
-
|
5259 |
-
var edit_main_tr2 = document.createElement('tr');
|
5260 |
-
edit_main_tr2.setAttribute("valing", "top");
|
5261 |
-
|
5262 |
-
var edit_main_tr3 = document.createElement('tr');
|
5263 |
-
edit_main_tr3.setAttribute("valing", "top");
|
5264 |
-
|
5265 |
-
var edit_main_tr4 = document.createElement('tr');
|
5266 |
-
edit_main_tr4.setAttribute("valing", "top");
|
5267 |
-
|
5268 |
-
var edit_main_tr5 = document.createElement('tr');
|
5269 |
-
edit_main_tr5.setAttribute("valing", "top");
|
5270 |
-
|
5271 |
-
var edit_main_tr6 = document.createElement('tr');
|
5272 |
-
edit_main_tr6.setAttribute("valing", "top");
|
5273 |
-
|
5274 |
-
var edit_main_tr7 = document.createElement('tr');
|
5275 |
-
edit_main_tr7.setAttribute("valing", "top");
|
5276 |
-
|
5277 |
-
var edit_main_tr8 = document.createElement('tr');
|
5278 |
-
edit_main_tr8.setAttribute("valing", "top");
|
5279 |
-
|
5280 |
-
var edit_main_td1 = document.createElement('td');
|
5281 |
-
edit_main_td1.style.cssText = "padding-top:10px";
|
5282 |
-
var edit_main_td1_1 = document.createElement('td');
|
5283 |
-
edit_main_td1_1.style.cssText = "padding-top:10px";
|
5284 |
-
var edit_main_td2 = document.createElement('td');
|
5285 |
-
edit_main_td2.style.cssText = "padding-top:10px";
|
5286 |
-
var edit_main_td2_1 = document.createElement('td');
|
5287 |
-
edit_main_td2_1.style.cssText = "padding-top:10px";
|
5288 |
-
|
5289 |
-
var edit_main_td3 = document.createElement('td');
|
5290 |
-
edit_main_td3.style.cssText = "padding-top:10px";
|
5291 |
-
var edit_main_td3_1 = document.createElement('td');
|
5292 |
-
edit_main_td3_1.style.cssText = "padding-top:10px";
|
5293 |
-
var edit_main_td4 = document.createElement('td');
|
5294 |
-
edit_main_td4.style.cssText = "padding-top:10px";
|
5295 |
-
var edit_main_td4_1 = document.createElement('td');
|
5296 |
-
edit_main_td4_1.style.cssText = "padding-top:10px";
|
5297 |
-
|
5298 |
-
var edit_main_td5 = document.createElement('td');
|
5299 |
-
edit_main_td5.style.cssText = "padding-top:10px";
|
5300 |
-
var edit_main_td5_1 = document.createElement('td');
|
5301 |
-
edit_main_td5_1.style.cssText = "padding-top:10px";
|
5302 |
-
|
5303 |
-
var edit_main_td6 = document.createElement('td');
|
5304 |
-
edit_main_td6.style.cssText = "padding-top:10px";
|
5305 |
-
var edit_main_td6_1 = document.createElement('td');
|
5306 |
-
edit_main_td6_1.style.cssText = "padding-top:10px";
|
5307 |
-
|
5308 |
-
var edit_main_td7 = document.createElement('td');
|
5309 |
-
edit_main_td7.style.cssText = "padding-top:10px";
|
5310 |
-
var edit_main_td7_1 = document.createElement('td');
|
5311 |
-
edit_main_td7_1.style.cssText = "padding-top:10px";
|
5312 |
-
|
5313 |
-
var edit_main_td8 = document.createElement('td');
|
5314 |
-
edit_main_td8.style.cssText = "padding-top:10px";
|
5315 |
-
var edit_main_td8_1 = document.createElement('td');
|
5316 |
-
edit_main_td8_1.style.cssText = "padding-top:10px";
|
5317 |
-
|
5318 |
-
var el_label_label = document.createElement('label');
|
5319 |
-
el_label_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
5320 |
-
el_label_label.innerHTML = "Field label";
|
5321 |
-
|
5322 |
-
var el_label_textarea = document.createElement('textarea');
|
5323 |
-
el_label_textarea.setAttribute("id", "edit_for_label");
|
5324 |
-
el_label_textarea.setAttribute("rows", "4");
|
5325 |
-
el_label_textarea.style.cssText = "width:200px;";
|
5326 |
-
el_label_textarea.setAttribute("onKeyUp", "change_label('"+i+"_element_labelform_id_temp', this.value)");
|
5327 |
-
el_label_textarea.innerHTML = w_field_label;
|
5328 |
-
|
5329 |
-
var el_label_position_label = document.createElement('label');
|
5330 |
-
el_label_position_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
5331 |
-
el_label_position_label.innerHTML = "Field label position";
|
5332 |
-
|
5333 |
-
var el_label_position1 = document.createElement('input');
|
5334 |
-
el_label_position1.setAttribute("id", "edit_for_label_position_top");
|
5335 |
-
el_label_position1.setAttribute("type", "radio");
|
5336 |
-
el_label_position1.setAttribute("value", "left");
|
5337 |
-
|
5338 |
-
el_label_position1.setAttribute("name", "edit_for_label_position");
|
5339 |
-
el_label_position1.setAttribute("onchange", "label_left("+i+")");
|
5340 |
-
Left = document.createTextNode("Left");
|
5341 |
-
|
5342 |
-
var el_label_position2 = document.createElement('input');
|
5343 |
-
el_label_position2.setAttribute("id", "edit_for_label_position_left");
|
5344 |
-
el_label_position2.setAttribute("type", "radio");
|
5345 |
-
el_label_position2.setAttribute("value", "top");
|
5346 |
-
|
5347 |
-
el_label_position2.setAttribute("name", "edit_for_label_position");
|
5348 |
-
el_label_position2.setAttribute("onchange", "label_top("+i+")");
|
5349 |
-
Top = document.createTextNode("Top");
|
5350 |
-
|
5351 |
-
if(w_field_label_pos=="top")
|
5352 |
-
el_label_position2.setAttribute("checked", "checked");
|
5353 |
-
else
|
5354 |
-
el_label_position1.setAttribute("checked", "checked");
|
5355 |
-
|
5356 |
-
var el_size_label = document.createElement('label');
|
5357 |
-
el_size_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
5358 |
-
el_size_label.innerHTML = "Field size(px) ";
|
5359 |
-
var el_size = document.createElement('input');
|
5360 |
-
el_size.setAttribute("id", "edit_for_input_size");
|
5361 |
-
el_size.setAttribute("type", "text");
|
5362 |
-
el_size.setAttribute("value", w_size);
|
5363 |
-
el_size.setAttribute("name", "edit_for_size");
|
5364 |
-
el_size.setAttribute("onKeyPress", "return check_isnum(event)");
|
5365 |
-
el_size.setAttribute("onKeyUp", "change_w_style('"+i+"_element_lastform_id_temp', this.value);");
|
5366 |
-
|
5367 |
-
var gic = document.createTextNode("-");
|
5368 |
-
|
5369 |
-
var el_first_value_label = document.createElement('label');
|
5370 |
-
el_first_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
5371 |
-
el_first_value_label.innerHTML = "Value if empty ";
|
5372 |
-
|
5373 |
-
var el_first_value_area = document.createElement('input');
|
5374 |
-
el_first_value_area.setAttribute("id", "el_first_value_area");
|
5375 |
-
el_first_value_area.setAttribute("type", "text");
|
5376 |
-
el_first_value_area.setAttribute("value", w_title[0]);
|
5377 |
-
el_first_value_area.style.cssText = "width:50px; margin-right:4px";
|
5378 |
-
el_first_value_area.setAttribute("onKeyUp", "change_input_value(this.value,'"+i+"_element_firstform_id_temp')");
|
5379 |
-
|
5380 |
-
var el_first_value_phone = document.createElement('input');
|
5381 |
-
el_first_value_phone.setAttribute("id", "el_first_value_phone");
|
5382 |
-
el_first_value_phone.setAttribute("type", "text");
|
5383 |
-
el_first_value_phone.setAttribute("value", w_title[1]);
|
5384 |
-
el_first_value_phone.style.cssText = "width:100px; margin-left:4px";
|
5385 |
-
el_first_value_phone.setAttribute("onKeyUp", "change_input_value(this.value,'"+i+"_element_lastform_id_temp')");
|
5386 |
-
|
5387 |
-
|
5388 |
-
var el_required_label = document.createElement('label');
|
5389 |
-
el_required_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
5390 |
-
el_required_label.innerHTML = "Required";
|
5391 |
-
|
5392 |
-
var el_required = document.createElement('input');
|
5393 |
-
el_required.setAttribute("id", "el_send");
|
5394 |
-
el_required.setAttribute("type", "checkbox");
|
5395 |
-
el_required.setAttribute("value", "yes");
|
5396 |
-
el_required.setAttribute("onclick", "set_required('"+i+"_required')");
|
5397 |
-
if(w_required=="yes")
|
5398 |
-
el_required.setAttribute("checked", "checked");
|
5399 |
-
|
5400 |
-
var el_unique_label = document.createElement('label');
|
5401 |
-
el_unique_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
5402 |
-
el_unique_label.innerHTML = "Allow only unique values";
|
5403 |
-
|
5404 |
-
var el_unique = document.createElement('input');
|
5405 |
-
el_unique.setAttribute("id", "el_send");
|
5406 |
-
el_unique.setAttribute("type", "checkbox");
|
5407 |
-
el_unique.setAttribute("value", "yes");
|
5408 |
-
el_unique.setAttribute("onclick", "set_unique('"+i+"_uniqueform_id_temp')");
|
5409 |
-
if(w_unique=="yes")
|
5410 |
-
el_unique.setAttribute("checked", "checked");
|
5411 |
-
|
5412 |
-
var el_style_label = document.createElement('label');
|
5413 |
-
el_style_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
5414 |
-
el_style_label.innerHTML = "Class name";
|
5415 |
-
|
5416 |
-
var el_style_textarea = document.createElement('input');
|
5417 |
-
el_style_textarea.setAttribute("id", "element_style");
|
5418 |
-
el_style_textarea.setAttribute("type", "text");
|
5419 |
-
el_style_textarea.setAttribute("value", w_class);
|
5420 |
-
el_style_textarea.style.cssText = "width:200px;";
|
5421 |
-
el_style_textarea.setAttribute("onChange", "change_class(this.value,'"+i+"')");
|
5422 |
-
|
5423 |
-
var el_attr_label = document.createElement('label');
|
5424 |
-
el_attr_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
5425 |
-
el_attr_label.innerHTML = "Additional Attributes";
|
5426 |
-
|
5427 |
-
var el_attr_add = document.createElement('img');
|
5428 |
-
el_attr_add.setAttribute("id", "el_choices_add");
|
5429 |
-
el_attr_add.setAttribute("src", plugin_url+'/images/add.png');
|
5430 |
-
el_attr_add.style.cssText = 'cursor:pointer; margin-left:68px';
|
5431 |
-
el_attr_add.setAttribute("title", 'add');
|
5432 |
-
el_attr_add.setAttribute("onClick", "add_attr("+i+", 'type_name')");
|
5433 |
-
|
5434 |
-
var el_attr_table = document.createElement('table');
|
5435 |
-
el_attr_table.setAttribute("id", 'attributes');
|
5436 |
-
el_attr_table.setAttribute("border", '0');
|
5437 |
-
el_attr_table.style.cssText = 'margin-left:0px';
|
5438 |
-
var el_attr_tr_label = document.createElement('tr');
|
5439 |
-
el_attr_tr_label.setAttribute("idi", '0');
|
5440 |
-
var el_attr_td_name_label = document.createElement('th');
|
5441 |
-
el_attr_td_name_label.style.cssText = 'width:100px';
|
5442 |
-
var el_attr_td_value_label = document.createElement('th');
|
5443 |
-
el_attr_td_value_label.style.cssText = 'width:100px';
|
5444 |
-
var el_attr_td_X_label = document.createElement('th');
|
5445 |
-
el_attr_td_X_label.style.cssText = 'width:10px';
|
5446 |
-
var el_attr_name_label = document.createElement('label');
|
5447 |
-
el_attr_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
|
5448 |
-
el_attr_name_label.innerHTML = "Name";
|
5449 |
-
|
5450 |
-
var el_attr_value_label = document.createElement('label');
|
5451 |
-
el_attr_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
|
5452 |
-
el_attr_value_label.innerHTML = "Value";
|
5453 |
-
|
5454 |
-
el_attr_table.appendChild(el_attr_tr_label);
|
5455 |
-
el_attr_tr_label.appendChild(el_attr_td_name_label);
|
5456 |
-
el_attr_tr_label.appendChild(el_attr_td_value_label);
|
5457 |
-
el_attr_tr_label.appendChild(el_attr_td_X_label);
|
5458 |
-
el_attr_td_name_label.appendChild(el_attr_name_label);
|
5459 |
-
el_attr_td_value_label.appendChild(el_attr_value_label);
|
5460 |
-
|
5461 |
-
n=w_attr_name.length;
|
5462 |
-
for(j=1; j<=n; j++)
|
5463 |
-
{
|
5464 |
-
var el_attr_tr = document.createElement('tr');
|
5465 |
-
el_attr_tr.setAttribute("id", "attr_row_"+j);
|
5466 |
-
el_attr_tr.setAttribute("idi", j);
|
5467 |
-
var el_attr_td_name = document.createElement('td');
|
5468 |
-
el_attr_td_name.style.cssText = 'width:100px';
|
5469 |
-
var el_attr_td_value = document.createElement('td');
|
5470 |
-
el_attr_td_value.style.cssText = 'width:100px';
|
5471 |
-
|
5472 |
-
var el_attr_td_X = document.createElement('td');
|
5473 |
-
var el_attr_name = document.createElement('input');
|
5474 |
-
|
5475 |
-
el_attr_name.setAttribute("type", "text");
|
5476 |
-
|
5477 |
-
el_attr_name.style.cssText = "width:100px";
|
5478 |
-
el_attr_name.setAttribute("value", w_attr_name[j-1]);
|
5479 |
-
el_attr_name.setAttribute("id", "attr_name"+j);
|
5480 |
-
el_attr_name.setAttribute("onChange", "change_attribute_name("+i+", this, 'type_name')");
|
5481 |
-
|
5482 |
-
var el_attr_value = document.createElement('input');
|
5483 |
-
|
5484 |
-
el_attr_value.setAttribute("type", "text");
|
5485 |
-
|
5486 |
-
el_attr_value.style.cssText = "width:100px";
|
5487 |
-
el_attr_value.setAttribute("value", w_attr_value[j-1]);
|
5488 |
-
el_attr_value.setAttribute("id", "attr_value"+j);
|
5489 |
-
el_attr_value.setAttribute("onChange", "change_attribute_value("+i+", "+j+", 'type_name')");
|
5490 |
-
|
5491 |
-
var el_attr_remove = document.createElement('img');
|
5492 |
-
el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
|
5493 |
-
el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
|
5494 |
-
el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
|
5495 |
-
el_attr_remove.setAttribute("align", 'top');
|
5496 |
-
el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", 'type_name')");
|
5497 |
-
el_attr_table.appendChild(el_attr_tr);
|
5498 |
-
el_attr_tr.appendChild(el_attr_td_name);
|
5499 |
-
el_attr_tr.appendChild(el_attr_td_value);
|
5500 |
-
el_attr_tr.appendChild(el_attr_td_X);
|
5501 |
-
el_attr_td_name.appendChild(el_attr_name);
|
5502 |
-
el_attr_td_value.appendChild(el_attr_value);
|
5503 |
-
el_attr_td_X.appendChild(el_attr_remove);
|
5504 |
-
|
5505 |
-
}
|
5506 |
-
|
5507 |
-
|
5508 |
-
var t = document.getElementById('edit_table');
|
5509 |
-
|
5510 |
-
var br = document.createElement('br');
|
5511 |
-
var br1 = document.createElement('br');
|
5512 |
-
var br2 = document.createElement('br');
|
5513 |
-
var br3 = document.createElement('br');
|
5514 |
-
var br4 = document.createElement('br');
|
5515 |
-
var br5 = document.createElement('br');
|
5516 |
-
var br6 = document.createElement('br');
|
5517 |
-
|
5518 |
-
edit_main_td1.appendChild(el_label_label);
|
5519 |
-
edit_main_td1_1.appendChild(el_label_textarea);
|
5520 |
-
|
5521 |
-
edit_main_td2.appendChild(el_label_position_label);
|
5522 |
-
edit_main_td2_1.appendChild(el_label_position1);
|
5523 |
-
edit_main_td2_1.appendChild(Left);
|
5524 |
-
edit_main_td2_1.appendChild(br2);
|
5525 |
-
edit_main_td2_1.appendChild(el_label_position2);
|
5526 |
-
edit_main_td2_1.appendChild(Top);
|
5527 |
-
|
5528 |
-
edit_main_td3.appendChild(el_first_value_label);
|
5529 |
-
edit_main_td3_1.appendChild(el_first_value_area);
|
5530 |
-
edit_main_td3_1.appendChild(gic);
|
5531 |
-
edit_main_td3_1.appendChild(el_first_value_phone);
|
5532 |
-
|
5533 |
-
|
5534 |
-
edit_main_td4.appendChild(el_style_label);
|
5535 |
-
edit_main_td4_1.appendChild(el_style_textarea);
|
5536 |
-
|
5537 |
-
edit_main_td7.appendChild(el_size_label);
|
5538 |
-
edit_main_td7_1.appendChild(el_size);
|
5539 |
-
|
5540 |
-
edit_main_td5.appendChild(el_required_label);
|
5541 |
-
edit_main_td5_1.appendChild(el_required);
|
5542 |
-
|
5543 |
-
edit_main_td8.appendChild(el_unique_label);
|
5544 |
-
edit_main_td8_1.appendChild(el_unique);
|
5545 |
-
|
5546 |
-
edit_main_td6.appendChild(el_attr_label);
|
5547 |
-
edit_main_td6.appendChild(el_attr_add);
|
5548 |
-
edit_main_td6.appendChild(br3);
|
5549 |
-
edit_main_td6.appendChild(el_attr_table);
|
5550 |
-
edit_main_td6.setAttribute("colspan", "2");
|
5551 |
-
|
5552 |
-
edit_main_tr1.appendChild(edit_main_td1);
|
5553 |
-
edit_main_tr1.appendChild(edit_main_td1_1);
|
5554 |
-
edit_main_tr2.appendChild(edit_main_td2);
|
5555 |
-
edit_main_tr2.appendChild(edit_main_td2_1);
|
5556 |
-
edit_main_tr3.appendChild(edit_main_td3);
|
5557 |
-
edit_main_tr3.appendChild(edit_main_td3_1);
|
5558 |
-
edit_main_tr4.appendChild(edit_main_td4);
|
5559 |
-
edit_main_tr4.appendChild(edit_main_td4_1);
|
5560 |
-
edit_main_tr5.appendChild(edit_main_td5);
|
5561 |
-
edit_main_tr5.appendChild(edit_main_td5_1);
|
5562 |
-
edit_main_tr6.appendChild(edit_main_td6);
|
5563 |
-
edit_main_tr8.appendChild(edit_main_td8);
|
5564 |
-
edit_main_tr8.appendChild(edit_main_td8_1);
|
5565 |
-
edit_main_tr7.appendChild(edit_main_td7);
|
5566 |
-
edit_main_tr7.appendChild(edit_main_td7_1);
|
5567 |
-
edit_main_table.appendChild(edit_main_tr1);
|
5568 |
-
edit_main_table.appendChild(edit_main_tr2);
|
5569 |
-
edit_main_table.appendChild(edit_main_tr3);
|
5570 |
-
edit_main_table.appendChild(edit_main_tr7);
|
5571 |
-
edit_main_table.appendChild(edit_main_tr4);
|
5572 |
-
edit_main_table.appendChild(edit_main_tr5);
|
5573 |
-
edit_main_table.appendChild(edit_main_tr8);
|
5574 |
-
edit_main_table.appendChild(edit_main_tr6);
|
5575 |
-
edit_div.appendChild(edit_main_table);
|
5576 |
-
|
5577 |
-
t.appendChild(edit_div);
|
5578 |
-
add_id_and_name(i, 'type_name');
|
5579 |
|
5580 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5581 |
|
5582 |
-
var adding_type = document.createElement("input");
|
5583 |
-
adding_type.setAttribute("type", "hidden");
|
5584 |
-
adding_type.setAttribute("value", "type_phone");
|
5585 |
-
adding_type.setAttribute("name", i+"_typeform_id_temp");
|
5586 |
-
adding_type.setAttribute("id", i+"_typeform_id_temp");
|
5587 |
-
var adding_required= document.createElement("input");
|
5588 |
-
adding_required.setAttribute("type", "hidden");
|
5589 |
-
adding_required.setAttribute("value", w_required);
|
5590 |
-
adding_required.setAttribute("name", i+"_requiredform_id_temp");
|
5591 |
-
adding_required.setAttribute("id", i+"_requiredform_id_temp");
|
5592 |
-
|
5593 |
-
var adding_unique= document.createElement("input");
|
5594 |
-
adding_unique.setAttribute("type", "hidden");
|
5595 |
-
adding_unique.setAttribute("value", w_unique);
|
5596 |
-
adding_unique.setAttribute("name", i+"_uniqueform_id_temp");
|
5597 |
-
adding_unique.setAttribute("id", i+"_uniqueform_id_temp");
|
5598 |
-
|
5599 |
-
var div = document.createElement('div');
|
5600 |
-
div.setAttribute("id", "main_div");
|
5601 |
-
|
5602 |
-
var table = document.createElement('table');
|
5603 |
-
table.setAttribute("id", i+"_elemet_tableform_id_temp");
|
5604 |
-
|
5605 |
-
|
5606 |
-
var tr = document.createElement('tr');
|
5607 |
-
|
5608 |
-
var td1 = document.createElement('td');
|
5609 |
-
td1.setAttribute("valign", 'top');
|
5610 |
-
td1.setAttribute("align", 'left');
|
5611 |
-
td1.setAttribute("id", i+"_label_sectionform_id_temp");
|
5612 |
-
|
5613 |
-
var td2 = document.createElement('td');
|
5614 |
-
td2.setAttribute("valign", 'top');
|
5615 |
-
td2.setAttribute("align", 'left');
|
5616 |
-
td2.setAttribute("id", i+"_element_sectionform_id_temp");
|
5617 |
-
|
5618 |
-
var table_name = document.createElement('table');
|
5619 |
-
table_name.setAttribute("id", i+"_table_name");
|
5620 |
-
table_name.setAttribute("cellpadding", '0');
|
5621 |
-
table_name.setAttribute("cellspacing", '0');
|
5622 |
-
|
5623 |
-
var tr_name1 = document.createElement('tr');
|
5624 |
-
tr_name1.setAttribute("id", i+"_tr_name1");
|
5625 |
-
|
5626 |
-
var tr_name2 = document.createElement('tr');
|
5627 |
-
tr_name2.setAttribute("id", i+"_tr_name2");
|
5628 |
-
|
5629 |
-
var td_name_input1 = document.createElement('td');
|
5630 |
-
td_name_input1.setAttribute("id", i+"_td_name_input_first");
|
5631 |
-
|
5632 |
-
var td_name_input2 = document.createElement('td');
|
5633 |
-
td_name_input2.setAttribute("id", i+"_td_name_input_last");
|
5634 |
-
|
5635 |
-
var td_name_label1 = document.createElement('td');
|
5636 |
-
td_name_label1.setAttribute("id", i+"_td_name_label_first");
|
5637 |
-
td_name_label1.setAttribute("align", "left");
|
5638 |
-
|
5639 |
-
var td_name_label2 = document.createElement('td');
|
5640 |
-
td_name_label2.setAttribute("id", i+"_td_name_label_last");
|
5641 |
-
td_name_label2.setAttribute("align", "left");
|
5642 |
-
|
5643 |
-
var br1 = document.createElement('br');
|
5644 |
-
var br2 = document.createElement('br');
|
5645 |
-
var br3 = document.createElement('br');
|
5646 |
-
var br4 = document.createElement('br');
|
5647 |
-
|
5648 |
-
|
5649 |
-
var label = document.createElement('span');
|
5650 |
-
label.setAttribute("id", i+"_element_labelform_id_temp");
|
5651 |
-
label.innerHTML = w_field_label;
|
5652 |
-
label.setAttribute("class", "label");
|
5653 |
-
|
5654 |
-
var required = document.createElement('span');
|
5655 |
-
required.setAttribute("id", i+"_required_elementform_id_temp");
|
5656 |
-
required.innerHTML = "";
|
5657 |
-
required.setAttribute("class", "required");
|
5658 |
-
if(w_required=="yes")
|
5659 |
-
required.innerHTML = " *";
|
5660 |
-
|
5661 |
-
var first = document.createElement('input');
|
5662 |
-
first.setAttribute("type", 'text');
|
5663 |
-
|
5664 |
-
if(w_title[0]==w_first_val[0])
|
5665 |
-
first.setAttribute("class", "input_deactive");
|
5666 |
-
else
|
5667 |
-
first.setAttribute("class", "input_active");
|
5668 |
-
|
5669 |
-
first.style.cssText = "width:50px";
|
5670 |
-
first.setAttribute("id", i+"_element_firstform_id_temp");
|
5671 |
-
first.setAttribute("name", i+"_element_firstform_id_temp");
|
5672 |
-
first.setAttribute("value", w_first_val[0]);
|
5673 |
-
first.setAttribute("title", w_title[0]);
|
5674 |
-
first.setAttribute("onFocus", 'delete_value("'+i+'_element_firstform_id_temp")');
|
5675 |
-
first.setAttribute("onBlur", 'return_value("'+i+'_element_firstform_id_temp")');
|
5676 |
-
first.setAttribute("onChange", "change_value('"+i+"_element_firstform_id_temp')");
|
5677 |
-
first.setAttribute("onKeyPress", "return check_isnum(event)");
|
5678 |
-
|
5679 |
-
var gic = document.createElement('span');
|
5680 |
-
gic.setAttribute("class", "wdform_line");
|
5681 |
-
gic.style.cssText = "margin: 0px 4px 0px 4px; padding: 0px;";
|
5682 |
-
gic.innerHTML = "-";
|
5683 |
-
|
5684 |
-
var first_label = document.createElement('label');
|
5685 |
-
first_label.setAttribute("class", "mini_label");
|
5686 |
-
first_label.innerHTML="<!--repstart-->Area Code<!--repend-->";
|
5687 |
-
|
5688 |
-
var last = document.createElement('input');
|
5689 |
-
last.setAttribute("type", 'text');
|
5690 |
-
|
5691 |
-
if(w_title[1]==w_first_val[1])
|
5692 |
-
last.setAttribute("class", "input_deactive");
|
5693 |
-
else
|
5694 |
-
last.setAttribute("class", "input_active");
|
5695 |
-
|
5696 |
-
last.style.cssText = "width:"+w_size+"px";
|
5697 |
-
last.setAttribute("id", i+"_element_lastform_id_temp");
|
5698 |
-
last.setAttribute("name", i+"_element_lastform_id_temp");
|
5699 |
-
last.setAttribute("value", w_first_val[1]);
|
5700 |
-
last.setAttribute("title", w_title[1]);
|
5701 |
-
last.setAttribute("onFocus", 'delete_value("'+i+'_element_lastform_id_temp")');
|
5702 |
-
last.setAttribute("onBlur", 'return_value("'+i+'_element_lastform_id_temp")');
|
5703 |
-
last.setAttribute("onChange", "change_value('"+i+"_element_lastform_id_temp')");
|
5704 |
-
last.setAttribute("onKeyPress", "return check_isnum(event)");
|
5705 |
-
|
5706 |
-
var last_label = document.createElement('label');
|
5707 |
-
last_label.setAttribute("class", "mini_label");
|
5708 |
-
last_label.innerHTML="<!--repstart-->Phone Number<!--repend-->";
|
5709 |
-
|
5710 |
-
var main_td = document.getElementById('show_table');
|
5711 |
-
|
5712 |
-
td1.appendChild(label);
|
5713 |
-
td1.appendChild(required );
|
5714 |
-
|
5715 |
-
td_name_input1.appendChild(first);
|
5716 |
-
td_name_input1.appendChild(gic);
|
5717 |
-
td_name_input2.appendChild(last);
|
5718 |
-
tr_name1.appendChild(td_name_input1);
|
5719 |
-
tr_name1.appendChild(td_name_input2);
|
5720 |
-
|
5721 |
-
td_name_label1.appendChild(first_label);
|
5722 |
-
td_name_label2.appendChild(last_label);
|
5723 |
-
tr_name2.appendChild(td_name_label1);
|
5724 |
-
tr_name2.appendChild(td_name_label2);
|
5725 |
-
table_name.appendChild(tr_name1);
|
5726 |
-
table_name.appendChild(tr_name2);
|
5727 |
-
|
5728 |
-
td2.appendChild(adding_type);
|
5729 |
-
td2.appendChild(adding_required);
|
5730 |
-
td2.appendChild(adding_unique);
|
5731 |
-
td2.appendChild(table_name);
|
5732 |
-
tr.appendChild(td1);
|
5733 |
-
tr.appendChild(td2);
|
5734 |
-
table.appendChild(tr);
|
5735 |
-
|
5736 |
-
div.appendChild(table);
|
5737 |
-
div.appendChild(br3);
|
5738 |
-
main_td.appendChild(div);
|
5739 |
-
|
5740 |
-
if(w_field_label_pos=="top")
|
5741 |
-
label_top(i);
|
5742 |
-
|
5743 |
-
change_class(w_class, i);
|
5744 |
-
refresh_attr(i, 'type_name');
|
5745 |
}
|
5746 |
|
5747 |
-
function
|
5748 |
-
|
|
|
|
|
5749 |
|
5750 |
-
|
5751 |
-
|
5752 |
-
|
5753 |
-
|
5754 |
-
|
5755 |
-
|
5756 |
-
|
5757 |
-
|
5758 |
-
|
5759 |
-
|
5760 |
-
|
5761 |
-
|
5762 |
-
|
5763 |
-
|
5764 |
-
|
5765 |
-
|
5766 |
-
|
5767 |
-
|
5768 |
-
|
5769 |
-
|
5770 |
-
var edit_main_tr4 = document.createElement('tr');
|
5771 |
-
edit_main_tr4.setAttribute("valing", "top");
|
5772 |
-
|
5773 |
-
var edit_main_tr5 = document.createElement('tr');
|
5774 |
-
edit_main_tr5.setAttribute("valing", "top");
|
5775 |
-
|
5776 |
-
var edit_main_tr6 = document.createElement('tr');
|
5777 |
-
edit_main_tr6.setAttribute("valing", "top");
|
5778 |
-
|
5779 |
-
var edit_main_tr7 = document.createElement('tr');
|
5780 |
-
edit_main_tr7.setAttribute("valing", "top");
|
5781 |
-
|
5782 |
-
var edit_main_tr8 = document.createElement('tr');
|
5783 |
-
edit_main_tr8.setAttribute("valing", "top");
|
5784 |
-
|
5785 |
-
var edit_main_tr9 = document.createElement('tr');
|
5786 |
-
edit_main_tr9.setAttribute("valing", "top");
|
5787 |
-
|
5788 |
-
var edit_main_td1 = document.createElement('td');
|
5789 |
-
edit_main_td1.style.cssText = "padding-top:10px";
|
5790 |
-
var edit_main_td1_1 = document.createElement('td');
|
5791 |
-
edit_main_td1_1.style.cssText = "padding-top:10px";
|
5792 |
-
var edit_main_td2 = document.createElement('td');
|
5793 |
-
edit_main_td2.style.cssText = "padding-top:10px";
|
5794 |
-
var edit_main_td2_1 = document.createElement('td');
|
5795 |
-
edit_main_td2_1.style.cssText = "padding-top:10px";
|
5796 |
-
|
5797 |
-
var edit_main_td3 = document.createElement('td');
|
5798 |
-
edit_main_td3.style.cssText = "padding-top:10px";
|
5799 |
-
var edit_main_td3_1 = document.createElement('td');
|
5800 |
-
edit_main_td3_1.style.cssText = "padding-top:10px";
|
5801 |
-
var edit_main_td4 = document.createElement('td');
|
5802 |
-
edit_main_td4.style.cssText = "padding-top:10px";
|
5803 |
-
var edit_main_td4_1 = document.createElement('td');
|
5804 |
-
edit_main_td4_1.style.cssText = "padding-top:10px";
|
5805 |
-
|
5806 |
-
var edit_main_td5 = document.createElement('td');
|
5807 |
-
edit_main_td5.style.cssText = "padding-top:10px";
|
5808 |
-
var edit_main_td5_1 = document.createElement('td');
|
5809 |
-
edit_main_td5_1.style.cssText = "padding-top:10px";
|
5810 |
-
|
5811 |
-
var edit_main_td6 = document.createElement('td');
|
5812 |
-
edit_main_td6.style.cssText = "padding-top:10px";
|
5813 |
-
var edit_main_td6_1 = document.createElement('td');
|
5814 |
-
edit_main_td6_1.style.cssText = "padding-top:10px";
|
5815 |
-
|
5816 |
-
var edit_main_td7 = document.createElement('td');
|
5817 |
-
edit_main_td7.style.cssText = "padding-top:10px";
|
5818 |
-
var edit_main_td7_1 = document.createElement('td');
|
5819 |
-
edit_main_td7_1.style.cssText = "padding-top:10px";
|
5820 |
-
|
5821 |
-
var edit_main_td8 = document.createElement('td');
|
5822 |
-
edit_main_td8.style.cssText = "padding-top:10px";
|
5823 |
-
var edit_main_td8_1 = document.createElement('td');
|
5824 |
-
edit_main_td8_1.style.cssText = "padding-top:10px";
|
5825 |
-
|
5826 |
-
var edit_main_td9 = document.createElement('td');
|
5827 |
-
edit_main_td9.style.cssText = "padding-top:10px";
|
5828 |
-
var edit_main_td9_1 = document.createElement('td');
|
5829 |
-
edit_main_td9_1.style.cssText = "padding-top:10px";
|
5830 |
-
|
5831 |
-
var el_label_label = document.createElement('label');
|
5832 |
-
el_label_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
5833 |
-
el_label_label.innerHTML = "Field label";
|
5834 |
-
|
5835 |
-
var el_label_textarea = document.createElement('textarea');
|
5836 |
-
el_label_textarea.setAttribute("id", "edit_for_label");
|
5837 |
-
el_label_textarea.setAttribute("rows", "4");
|
5838 |
-
el_label_textarea.style.cssText = "width:200px;";
|
5839 |
-
el_label_textarea.setAttribute("onKeyUp", "change_label('"+i+"_element_labelform_id_temp', this.value)");
|
5840 |
-
el_label_textarea.innerHTML = w_field_label;
|
5841 |
-
|
5842 |
-
var el_label_position_label = document.createElement('label');
|
5843 |
-
el_label_position_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
5844 |
-
el_label_position_label.innerHTML = "Field label position";
|
5845 |
-
|
5846 |
-
var el_label_position1 = document.createElement('input');
|
5847 |
-
el_label_position1.setAttribute("id", "edit_for_label_position_top");
|
5848 |
-
el_label_position1.setAttribute("type", "radio");
|
5849 |
-
el_label_position1.setAttribute("value", "left");
|
5850 |
-
|
5851 |
-
|
5852 |
-
el_label_position1.setAttribute("name", "edit_for_label_position");
|
5853 |
-
el_label_position1.setAttribute("onchange", "label_left("+i+")");
|
5854 |
-
Left = document.createTextNode("Left");
|
5855 |
-
|
5856 |
-
var el_label_position2 = document.createElement('input');
|
5857 |
-
el_label_position2.setAttribute("id", "edit_for_label_position_left");
|
5858 |
-
el_label_position2.setAttribute("type", "radio");
|
5859 |
-
el_label_position2.setAttribute("value", "top");
|
5860 |
-
|
5861 |
-
|
5862 |
-
el_label_position2.setAttribute("name", "edit_for_label_position");
|
5863 |
-
el_label_position2.setAttribute("onchange", "label_top("+i+")");
|
5864 |
-
Top = document.createTextNode("Top");
|
5865 |
-
|
5866 |
-
if(w_field_label_pos=="top")
|
5867 |
-
|
5868 |
-
el_label_position2.setAttribute("checked", "checked");
|
5869 |
-
else
|
5870 |
-
|
5871 |
-
el_label_position1.setAttribute("checked", "checked");
|
5872 |
-
|
5873 |
-
var gic = document.createTextNode("-");
|
5874 |
-
|
5875 |
-
var el_first_value_label = document.createElement('label');
|
5876 |
-
el_first_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
5877 |
-
el_first_value_label.innerHTML = "Value if empty ";
|
5878 |
-
|
5879 |
-
var el_first_value_first = document.createElement('input');
|
5880 |
-
el_first_value_first.setAttribute("id", "el_first_value_first");
|
5881 |
-
el_first_value_first.setAttribute("type", "text");
|
5882 |
-
el_first_value_first.setAttribute("value", w_title[0]);
|
5883 |
-
el_first_value_first.style.cssText = "width:80px; margin-left:4px; margin-right:4px";
|
5884 |
-
el_first_value_first.setAttribute("onKeyUp", "change_input_value(this.value,'"+i+"_element_firstform_id_temp')");
|
5885 |
-
|
5886 |
-
var el_first_value_last = document.createElement('input');
|
5887 |
-
el_first_value_last.setAttribute("id", "el_first_value_last");
|
5888 |
-
el_first_value_last.setAttribute("type", "text");
|
5889 |
-
el_first_value_last.setAttribute("value", w_title[1]);
|
5890 |
-
el_first_value_last.style.cssText = "width:80px; margin-left:4px; margin-right:4px";
|
5891 |
-
el_first_value_last.setAttribute("onKeyUp", "change_input_value(this.value,'"+i+"_element_lastform_id_temp')");
|
5892 |
-
|
5893 |
-
var el_size_label = document.createElement('label');
|
5894 |
-
el_size_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
5895 |
-
el_size_label.innerHTML = "Field size(px) ";
|
5896 |
-
var el_size = document.createElement('input');
|
5897 |
-
el_size.setAttribute("id", "edit_for_input_size");
|
5898 |
-
el_size.setAttribute("type", "text");
|
5899 |
-
el_size.setAttribute("value", w_size);
|
5900 |
-
|
5901 |
-
el_size.setAttribute("name", "edit_for_size");
|
5902 |
-
el_size.setAttribute("onKeyPress", "return check_isnum(event)");
|
5903 |
-
el_size.setAttribute("onKeyUp", "change_w_style('"+i+"_element_firstform_id_temp', this.value); change_w_style('"+i+"_element_lastform_id_temp', this.value); change_w_style('"+i+"_element_middleform_id_temp', this.value)");
|
5904 |
-
|
5905 |
-
|
5906 |
-
var el_format_label = document.createElement('label');
|
5907 |
-
el_format_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
5908 |
-
el_format_label.innerHTML = "Name Format";
|
5909 |
-
|
5910 |
-
var el_format_normal = document.createElement('input');
|
5911 |
-
el_format_normal.setAttribute("id", "el_format_normal");
|
5912 |
-
el_format_normal.setAttribute("type", "radio");
|
5913 |
-
el_format_normal.setAttribute("value", "normal");
|
5914 |
-
el_format_normal.setAttribute("name", "edit_for_name_format");
|
5915 |
-
el_format_normal.setAttribute("onchange", "format_normal("+i+")");
|
5916 |
-
el_format_normal.setAttribute("checked", "checked");
|
5917 |
-
Normal = document.createTextNode("Normal");
|
5918 |
-
|
5919 |
-
var el_format_extended = document.createElement('input');
|
5920 |
-
el_format_extended.setAttribute("id", "el_format_extended");
|
5921 |
-
el_format_extended.setAttribute("type", "radio");
|
5922 |
-
el_format_extended.setAttribute("value", "extended");
|
5923 |
-
el_format_extended.setAttribute("name", "edit_for_name_format");
|
5924 |
-
el_format_extended.setAttribute("onchange", "format_extended("+i+")");
|
5925 |
-
Extended = document.createTextNode("Extended");
|
5926 |
-
|
5927 |
-
if(w_name_format=="normal")
|
5928 |
-
|
5929 |
-
el_format_normal.setAttribute("checked", "checked");
|
5930 |
-
else
|
5931 |
-
el_format_extended.setAttribute("checked", "checked");
|
5932 |
-
|
5933 |
-
var el_required_label = document.createElement('label');
|
5934 |
-
el_required_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
5935 |
-
el_required_label.innerHTML = "Required";
|
5936 |
-
|
5937 |
-
var el_required = document.createElement('input');
|
5938 |
-
el_required.setAttribute("id", "el_send");
|
5939 |
-
el_required.setAttribute("type", "checkbox");
|
5940 |
-
el_required.setAttribute("value", "yes");
|
5941 |
-
el_required.setAttribute("onclick", "set_required('"+i+"_required')");
|
5942 |
-
if(w_required=="yes")
|
5943 |
-
el_required.setAttribute("checked", "checked");
|
5944 |
-
|
5945 |
-
var el_unique_label = document.createElement('label');
|
5946 |
-
el_unique_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
5947 |
-
el_unique_label.innerHTML = "Allow only unique values";
|
5948 |
-
|
5949 |
-
var el_unique = document.createElement('input');
|
5950 |
-
el_unique.setAttribute("id", "el_send");
|
5951 |
-
el_unique.setAttribute("type", "checkbox");
|
5952 |
-
el_unique.setAttribute("value", "yes");
|
5953 |
-
el_unique.setAttribute("onclick", "set_unique('"+i+"_uniqueform_id_temp')");
|
5954 |
-
if(w_unique=="yes")
|
5955 |
-
el_unique.setAttribute("checked", "checked");
|
5956 |
-
|
5957 |
-
var el_style_label = document.createElement('label');
|
5958 |
-
el_style_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
5959 |
-
el_style_label.innerHTML = "Class name";
|
5960 |
-
|
5961 |
-
var el_style_textarea = document.createElement('input');
|
5962 |
-
el_style_textarea.setAttribute("id", "element_style");
|
5963 |
-
el_style_textarea.setAttribute("type", "text");
|
5964 |
-
el_style_textarea.setAttribute("value", w_class);
|
5965 |
-
el_style_textarea.style.cssText = "width:200px;";
|
5966 |
-
el_style_textarea.setAttribute("onChange", "change_class(this.value,'"+i+"')");
|
5967 |
-
|
5968 |
-
var el_attr_label = document.createElement('label');
|
5969 |
-
el_attr_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
5970 |
-
el_attr_label.innerHTML = "Additional Attributes";
|
5971 |
-
var el_attr_add = document.createElement('img');
|
5972 |
-
el_attr_add.setAttribute("id", "el_choices_add");
|
5973 |
-
el_attr_add.setAttribute("src", plugin_url+'/images/add.png');
|
5974 |
-
el_attr_add.style.cssText = 'cursor:pointer; margin-left:68px';
|
5975 |
-
el_attr_add.setAttribute("title", 'add');
|
5976 |
-
el_attr_add.setAttribute("onClick", "add_attr("+i+", 'type_name')");
|
5977 |
-
var el_attr_table = document.createElement('table');
|
5978 |
-
el_attr_table.setAttribute("id", 'attributes');
|
5979 |
-
el_attr_table.setAttribute("border", '0');
|
5980 |
-
el_attr_table.style.cssText = 'margin-left:0px';
|
5981 |
-
var el_attr_tr_label = document.createElement('tr');
|
5982 |
-
el_attr_tr_label.setAttribute("idi", '0');
|
5983 |
-
var el_attr_td_name_label = document.createElement('th');
|
5984 |
-
el_attr_td_name_label.style.cssText = 'width:100px';
|
5985 |
-
var el_attr_td_value_label = document.createElement('th');
|
5986 |
-
el_attr_td_value_label.style.cssText = 'width:100px';
|
5987 |
-
var el_attr_td_X_label = document.createElement('th');
|
5988 |
-
el_attr_td_X_label.style.cssText = 'width:10px';
|
5989 |
-
var el_attr_name_label = document.createElement('label');
|
5990 |
-
el_attr_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
|
5991 |
-
el_attr_name_label.innerHTML = "Name";
|
5992 |
-
|
5993 |
-
var el_attr_value_label = document.createElement('label');
|
5994 |
-
el_attr_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
|
5995 |
-
el_attr_value_label.innerHTML = "Value";
|
5996 |
-
|
5997 |
-
el_attr_table.appendChild(el_attr_tr_label);
|
5998 |
-
el_attr_tr_label.appendChild(el_attr_td_name_label);
|
5999 |
-
el_attr_tr_label.appendChild(el_attr_td_value_label);
|
6000 |
-
el_attr_tr_label.appendChild(el_attr_td_X_label);
|
6001 |
-
el_attr_td_name_label.appendChild(el_attr_name_label);
|
6002 |
-
el_attr_td_value_label.appendChild(el_attr_value_label);
|
6003 |
-
|
6004 |
-
n=w_attr_name.length;
|
6005 |
-
for(j=1; j<=n; j++)
|
6006 |
-
{
|
6007 |
-
var el_attr_tr = document.createElement('tr');
|
6008 |
-
el_attr_tr.setAttribute("id", "attr_row_"+j);
|
6009 |
-
el_attr_tr.setAttribute("idi", j);
|
6010 |
-
var el_attr_td_name = document.createElement('td');
|
6011 |
-
el_attr_td_name.style.cssText = 'width:100px';
|
6012 |
-
var el_attr_td_value = document.createElement('td');
|
6013 |
-
el_attr_td_value.style.cssText = 'width:100px';
|
6014 |
-
|
6015 |
-
var el_attr_td_X = document.createElement('td');
|
6016 |
-
var el_attr_name = document.createElement('input');
|
6017 |
-
|
6018 |
-
el_attr_name.setAttribute("type", "text");
|
6019 |
-
|
6020 |
-
el_attr_name.style.cssText = "width:100px";
|
6021 |
-
el_attr_name.setAttribute("value", w_attr_name[j-1]);
|
6022 |
-
el_attr_name.setAttribute("id", "attr_name"+j);
|
6023 |
-
el_attr_name.setAttribute("onChange", "change_attribute_name("+i+", this, 'type_name')");
|
6024 |
-
|
6025 |
-
var el_attr_value = document.createElement('input');
|
6026 |
-
|
6027 |
-
el_attr_value.setAttribute("type", "text");
|
6028 |
-
|
6029 |
-
el_attr_value.style.cssText = "width:100px";
|
6030 |
-
el_attr_value.setAttribute("value", w_attr_value[j-1]);
|
6031 |
-
el_attr_value.setAttribute("id", "attr_value"+j);
|
6032 |
-
el_attr_value.setAttribute("onChange", "change_attribute_value("+i+", "+j+", 'type_name')");
|
6033 |
-
|
6034 |
-
var el_attr_remove = document.createElement('img');
|
6035 |
-
el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
|
6036 |
-
el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
|
6037 |
-
el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
|
6038 |
-
el_attr_remove.setAttribute("align", 'top');
|
6039 |
-
el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", 'type_name')");
|
6040 |
-
el_attr_table.appendChild(el_attr_tr);
|
6041 |
-
el_attr_tr.appendChild(el_attr_td_name);
|
6042 |
-
el_attr_tr.appendChild(el_attr_td_value);
|
6043 |
-
el_attr_tr.appendChild(el_attr_td_X);
|
6044 |
-
el_attr_td_name.appendChild(el_attr_name);
|
6045 |
-
el_attr_td_value.appendChild(el_attr_value);
|
6046 |
-
el_attr_td_X.appendChild(el_attr_remove);
|
6047 |
-
|
6048 |
-
}
|
6049 |
-
|
6050 |
-
|
6051 |
-
var t = document.getElementById('edit_table');
|
6052 |
-
|
6053 |
-
var br = document.createElement('br');
|
6054 |
-
var br1 = document.createElement('br');
|
6055 |
-
var br2 = document.createElement('br');
|
6056 |
-
var br3 = document.createElement('br');
|
6057 |
-
var br4 = document.createElement('br');
|
6058 |
-
var br5 = document.createElement('br');
|
6059 |
-
var br6 = document.createElement('br');
|
6060 |
-
|
6061 |
-
edit_main_td1.appendChild(el_label_label);
|
6062 |
-
edit_main_td1_1.appendChild(el_label_textarea);
|
6063 |
-
|
6064 |
-
edit_main_td2.appendChild(el_label_position_label);
|
6065 |
-
edit_main_td2_1.appendChild(el_label_position1);
|
6066 |
-
edit_main_td2_1.appendChild(Left);
|
6067 |
-
edit_main_td2_1.appendChild(br2);
|
6068 |
-
edit_main_td2_1.appendChild(el_label_position2);
|
6069 |
-
edit_main_td2_1.appendChild(Top);
|
6070 |
-
|
6071 |
-
edit_main_td9.appendChild(el_first_value_label);
|
6072 |
-
edit_main_td9_1.appendChild(el_first_value_first);
|
6073 |
-
edit_main_td9_1.appendChild(gic);
|
6074 |
-
edit_main_td9_1.appendChild(el_first_value_last);
|
6075 |
-
|
6076 |
-
|
6077 |
-
|
6078 |
-
edit_main_td7.appendChild(el_size_label);
|
6079 |
-
edit_main_td7_1.appendChild(el_size);
|
6080 |
-
|
6081 |
-
edit_main_td3.appendChild(el_format_label);
|
6082 |
-
|
6083 |
-
edit_main_td3_1.appendChild(el_format_normal);
|
6084 |
-
edit_main_td3_1.appendChild(Normal);
|
6085 |
-
edit_main_td3_1.appendChild(br6);
|
6086 |
-
edit_main_td3_1.appendChild(el_format_extended);
|
6087 |
-
edit_main_td3_1.appendChild(Extended);
|
6088 |
-
|
6089 |
-
edit_main_td4.appendChild(el_style_label);
|
6090 |
-
edit_main_td4_1.appendChild(el_style_textarea);
|
6091 |
-
|
6092 |
-
edit_main_td5.appendChild(el_required_label);
|
6093 |
-
edit_main_td5_1.appendChild(el_required);
|
6094 |
-
|
6095 |
-
edit_main_td8.appendChild(el_unique_label);
|
6096 |
-
edit_main_td8_1.appendChild(el_unique);
|
6097 |
-
|
6098 |
-
edit_main_td6.appendChild(el_attr_label);
|
6099 |
-
edit_main_td6.appendChild(el_attr_add);
|
6100 |
-
edit_main_td6.appendChild(br3);
|
6101 |
-
edit_main_td6.appendChild(el_attr_table);
|
6102 |
-
edit_main_td6.setAttribute("colspan", "2");
|
6103 |
-
|
6104 |
-
edit_main_tr1.appendChild(edit_main_td1);
|
6105 |
-
edit_main_tr1.appendChild(edit_main_td1_1);
|
6106 |
-
edit_main_tr2.appendChild(edit_main_td2);
|
6107 |
-
edit_main_tr2.appendChild(edit_main_td2_1);
|
6108 |
-
edit_main_tr7.appendChild(edit_main_td7);
|
6109 |
-
edit_main_tr7.appendChild(edit_main_td7_1);
|
6110 |
-
edit_main_tr3.appendChild(edit_main_td3);
|
6111 |
-
edit_main_tr3.appendChild(edit_main_td3_1);
|
6112 |
-
edit_main_tr4.appendChild(edit_main_td4);
|
6113 |
-
edit_main_tr4.appendChild(edit_main_td4_1);
|
6114 |
-
edit_main_tr5.appendChild(edit_main_td5);
|
6115 |
-
edit_main_tr5.appendChild(edit_main_td5_1);
|
6116 |
-
edit_main_tr6.appendChild(edit_main_td6);
|
6117 |
-
edit_main_tr6.appendChild(edit_main_td6_1);
|
6118 |
-
edit_main_tr8.appendChild(edit_main_td8);
|
6119 |
-
edit_main_tr8.appendChild(edit_main_td8_1);
|
6120 |
-
edit_main_tr9.appendChild(edit_main_td9);
|
6121 |
-
edit_main_tr9.appendChild(edit_main_td9_1);
|
6122 |
-
edit_main_table.appendChild(edit_main_tr1);
|
6123 |
-
edit_main_table.appendChild(edit_main_tr2);
|
6124 |
-
edit_main_table.appendChild(edit_main_tr9);
|
6125 |
-
edit_main_table.appendChild(edit_main_tr7);
|
6126 |
-
edit_main_table.appendChild(edit_main_tr3);
|
6127 |
-
edit_main_table.appendChild(edit_main_tr4);
|
6128 |
-
edit_main_table.appendChild(edit_main_tr5);
|
6129 |
-
edit_main_table.appendChild(edit_main_tr8);
|
6130 |
-
edit_main_table.appendChild(edit_main_tr6);
|
6131 |
-
edit_div.appendChild(edit_main_table);
|
6132 |
-
|
6133 |
-
t.appendChild(edit_div);
|
6134 |
-
add_id_and_name(i, 'type_name');
|
6135 |
-
|
6136 |
-
//show table
|
6137 |
|
6138 |
-
var adding_type = document.createElement("input");
|
6139 |
-
adding_type.setAttribute("type", "hidden");
|
6140 |
-
adding_type.setAttribute("value", "type_name");
|
6141 |
-
adding_type.setAttribute("name", i+"_typeform_id_temp");
|
6142 |
-
adding_type.setAttribute("id", i+"_typeform_id_temp");
|
6143 |
-
var adding_required= document.createElement("input");
|
6144 |
-
adding_required.setAttribute("type", "hidden");
|
6145 |
-
adding_required.setAttribute("value", w_required);
|
6146 |
-
adding_required.setAttribute("name", i+"_requiredform_id_temp");
|
6147 |
-
adding_required.setAttribute("id", i+"_requiredform_id_temp");
|
6148 |
-
|
6149 |
-
var adding_unique= document.createElement("input");
|
6150 |
-
adding_unique.setAttribute("type", "hidden");
|
6151 |
-
adding_unique.setAttribute("value", w_unique);
|
6152 |
-
adding_unique.setAttribute("name", i+"_uniqueform_id_temp");
|
6153 |
-
adding_unique.setAttribute("id", i+"_uniqueform_id_temp");
|
6154 |
-
|
6155 |
-
var div = document.createElement('div');
|
6156 |
-
div.setAttribute("id", "main_div");
|
6157 |
-
|
6158 |
-
var table = document.createElement('table');
|
6159 |
-
table.setAttribute("id", i+"_elemet_tableform_id_temp");
|
6160 |
-
|
6161 |
-
|
6162 |
-
var tr = document.createElement('tr');
|
6163 |
-
|
6164 |
-
var td1 = document.createElement('td');
|
6165 |
-
td1.setAttribute("valign", 'top');
|
6166 |
-
td1.setAttribute("align", 'left');
|
6167 |
-
td1.setAttribute("id", i+"_label_sectionform_id_temp");
|
6168 |
-
|
6169 |
-
var td2 = document.createElement('td');
|
6170 |
-
td2.setAttribute("valign", 'top');
|
6171 |
-
td2.setAttribute("align", 'left');
|
6172 |
-
td2.setAttribute("id", i+"_element_sectionform_id_temp");
|
6173 |
-
|
6174 |
-
var table_name = document.createElement('table');
|
6175 |
-
table_name.setAttribute("id", i+"_table_name");
|
6176 |
-
table_name.setAttribute("cellpadding", '0');
|
6177 |
-
table_name.setAttribute("cellspacing", '0');
|
6178 |
-
|
6179 |
-
var tr_name1 = document.createElement('tr');
|
6180 |
-
tr_name1.setAttribute("id", i+"_tr_name1");
|
6181 |
-
|
6182 |
-
var tr_name2 = document.createElement('tr');
|
6183 |
-
tr_name2.setAttribute("id", i+"_tr_name2");
|
6184 |
-
|
6185 |
-
var td_name_input1 = document.createElement('td');
|
6186 |
-
td_name_input1.setAttribute("id", i+"_td_name_input_first");
|
6187 |
-
|
6188 |
-
var td_name_input2 = document.createElement('td');
|
6189 |
-
td_name_input2.setAttribute("id", i+"_td_name_input_last");
|
6190 |
-
|
6191 |
-
var td_name_label1 = document.createElement('td');
|
6192 |
-
td_name_label1.setAttribute("id", i+"_td_name_label_first");
|
6193 |
-
td_name_label1.setAttribute("align", "left");
|
6194 |
-
|
6195 |
-
var td_name_label2 = document.createElement('td');
|
6196 |
-
td_name_label2.setAttribute("id", i+"_td_name_label_last");
|
6197 |
-
td_name_label2.setAttribute("align", "left");
|
6198 |
-
|
6199 |
-
var br1 = document.createElement('br');
|
6200 |
-
var br2 = document.createElement('br');
|
6201 |
-
var br3 = document.createElement('br');
|
6202 |
-
var br4 = document.createElement('br');
|
6203 |
-
|
6204 |
-
|
6205 |
-
var label = document.createElement('span');
|
6206 |
-
label.setAttribute("id", i+"_element_labelform_id_temp");
|
6207 |
-
label.innerHTML = w_field_label;
|
6208 |
-
label.setAttribute("class", "label");
|
6209 |
-
|
6210 |
-
var required = document.createElement('span');
|
6211 |
-
required.setAttribute("id", i+"_required_elementform_id_temp");
|
6212 |
-
required.innerHTML = "";
|
6213 |
-
required.setAttribute("class", "required");
|
6214 |
-
if(w_required=="yes")
|
6215 |
-
required.innerHTML = " *";
|
6216 |
-
var first = document.createElement('input');
|
6217 |
-
first.setAttribute("type", 'text');
|
6218 |
-
if(w_title[0]==w_first_val[0])
|
6219 |
-
first.setAttribute("class", "input_deactive");
|
6220 |
-
else
|
6221 |
-
first.setAttribute("class", "input_active");
|
6222 |
-
|
6223 |
-
first.style.cssText = "margin-right: 10px; width:"+w_size+"px";
|
6224 |
-
first.setAttribute("id", i+"_element_firstform_id_temp");
|
6225 |
-
first.setAttribute("name", i+"_element_firstform_id_temp");
|
6226 |
-
first.setAttribute("value", w_first_val[0]);
|
6227 |
-
first.setAttribute("title", w_title[0]);
|
6228 |
-
first.setAttribute("onFocus", 'delete_value("'+i+'_element_firstform_id_temp")');
|
6229 |
-
first.setAttribute("onBlur", 'return_value("'+i+'_element_firstform_id_temp")');
|
6230 |
-
first.setAttribute("onChange", "change_value('"+i+"_element_firstform_id_temp')");
|
6231 |
-
|
6232 |
-
var first_label = document.createElement('label');
|
6233 |
-
first_label.setAttribute("class", "mini_label");
|
6234 |
-
first_label.innerHTML="<!--repstart-->First<!--repend-->";
|
6235 |
-
|
6236 |
-
var last = document.createElement('input');
|
6237 |
-
last.setAttribute("type", 'text');
|
6238 |
-
|
6239 |
-
if(w_title[1]==w_first_val[1])
|
6240 |
-
last.setAttribute("class", "input_deactive");
|
6241 |
-
else
|
6242 |
-
last.setAttribute("class", "input_active");
|
6243 |
-
|
6244 |
-
last.style.cssText = "margin-right: 10px; width:"+w_size+"px";
|
6245 |
-
last.setAttribute("id", i+"_element_lastform_id_temp");
|
6246 |
-
last.setAttribute("name", i+"_element_lastform_id_temp");
|
6247 |
-
last.setAttribute("value", w_first_val[1]);
|
6248 |
-
last.setAttribute("title", w_title[1]);
|
6249 |
-
last.setAttribute("onFocus", 'delete_value("'+i+'_element_lastform_id_temp")');
|
6250 |
-
last.setAttribute("onBlur", 'return_value("'+i+'_element_lastform_id_temp")');
|
6251 |
-
last.setAttribute("onChange", "change_value('"+i+"_element_lastform_id_temp')");
|
6252 |
-
|
6253 |
-
|
6254 |
-
var last_label = document.createElement('label');
|
6255 |
-
last_label.setAttribute("class", "mini_label");
|
6256 |
-
last_label.innerHTML="<!--repstart-->Last<!--repend-->";
|
6257 |
-
|
6258 |
-
var main_td = document.getElementById('show_table');
|
6259 |
-
|
6260 |
-
td1.appendChild(label);
|
6261 |
-
td1.appendChild(required );
|
6262 |
-
|
6263 |
-
td_name_input1.appendChild(first);
|
6264 |
-
td_name_input2.appendChild(last);
|
6265 |
-
tr_name1.appendChild(td_name_input1);
|
6266 |
-
tr_name1.appendChild(td_name_input2);
|
6267 |
-
|
6268 |
-
td_name_label1.appendChild(first_label);
|
6269 |
-
td_name_label2.appendChild(last_label);
|
6270 |
-
tr_name2.appendChild(td_name_label1);
|
6271 |
-
tr_name2.appendChild(td_name_label2);
|
6272 |
-
table_name.appendChild(tr_name1);
|
6273 |
-
table_name.appendChild(tr_name2);
|
6274 |
-
|
6275 |
-
td2.appendChild(adding_type);
|
6276 |
-
td2.appendChild(adding_required);
|
6277 |
-
td2.appendChild(adding_unique);
|
6278 |
-
td2.appendChild(table_name);
|
6279 |
-
tr.appendChild(td1);
|
6280 |
-
tr.appendChild(td2);
|
6281 |
-
table.appendChild(tr);
|
6282 |
-
|
6283 |
-
div.appendChild(table);
|
6284 |
-
div.appendChild(br3);
|
6285 |
-
main_td.appendChild(div);
|
6286 |
-
|
6287 |
-
if(w_field_label_pos=="top")
|
6288 |
-
label_top(i);
|
6289 |
-
|
6290 |
-
if(w_name_format=="extended")
|
6291 |
-
format_extended(i);
|
6292 |
-
change_class(w_class, i);
|
6293 |
-
refresh_attr(i, 'type_name');
|
6294 |
}
|
6295 |
|
6296 |
-
function
|
|
|
|
|
6297 |
|
6298 |
-
|
|
|
|
|
|
|
6299 |
|
6300 |
-
|
6301 |
-
// edit table
|
6302 |
-
var edit_div = document.createElement('div');
|
6303 |
-
edit_div.setAttribute("id", "edit_div");
|
6304 |
-
edit_div.setAttribute("style", "border-top:1px dotted black;padding:10px; padding-top:0px; padding-bottom:0px; margin-top:10px;");
|
6305 |
-
|
6306 |
-
var edit_main_table = document.createElement('table');
|
6307 |
-
edit_main_table.setAttribute("id", "edit_main_table");
|
6308 |
-
edit_main_table.setAttribute("cellpadding", "0");
|
6309 |
-
edit_main_table.setAttribute("cellspacing", "0");
|
6310 |
-
|
6311 |
-
var edit_main_tr1 = document.createElement('tr');
|
6312 |
-
edit_main_tr1.setAttribute("valing", "top");
|
6313 |
-
|
6314 |
-
var edit_main_tr2 = document.createElement('tr');
|
6315 |
-
edit_main_tr2.setAttribute("valing", "top");
|
6316 |
-
|
6317 |
-
var edit_main_tr3 = document.createElement('tr');
|
6318 |
-
edit_main_tr3.setAttribute("valing", "top");
|
6319 |
-
|
6320 |
-
var edit_main_tr4 = document.createElement('tr');
|
6321 |
-
edit_main_tr4.setAttribute("valing", "top");
|
6322 |
-
|
6323 |
-
var edit_main_tr5 = document.createElement('tr');
|
6324 |
-
edit_main_tr5.setAttribute("valing", "top");
|
6325 |
-
|
6326 |
-
var edit_main_tr6 = document.createElement('tr');
|
6327 |
-
edit_main_tr6.setAttribute("valing", "top");
|
6328 |
-
|
6329 |
-
var edit_main_tr7 = document.createElement('tr');
|
6330 |
-
edit_main_tr7.setAttribute("valing", "top");
|
6331 |
-
|
6332 |
-
var edit_main_tr8 = document.createElement('tr');
|
6333 |
-
edit_main_tr8.setAttribute("valing", "top");
|
6334 |
-
|
6335 |
-
var edit_main_td1 = document.createElement('td');
|
6336 |
-
edit_main_td1.style.cssText = "padding-top:10px";
|
6337 |
-
var edit_main_td1_1 = document.createElement('td');
|
6338 |
-
edit_main_td1_1.style.cssText = "padding-top:10px";
|
6339 |
-
var edit_main_td2 = document.createElement('td');
|
6340 |
-
edit_main_td2.style.cssText = "padding-top:10px";
|
6341 |
-
var edit_main_td2_1 = document.createElement('td');
|
6342 |
-
edit_main_td2_1.style.cssText = "padding-top:10px";
|
6343 |
-
|
6344 |
-
var edit_main_td3 = document.createElement('td');
|
6345 |
-
edit_main_td3.style.cssText = "padding-top:10px";
|
6346 |
-
var edit_main_td3_1 = document.createElement('td');
|
6347 |
-
edit_main_td3_1.style.cssText = "padding-top:10px";
|
6348 |
-
var edit_main_td4 = document.createElement('td');
|
6349 |
-
edit_main_td4.style.cssText = "padding-top:10px";
|
6350 |
-
var edit_main_td4_1 = document.createElement('td');
|
6351 |
-
edit_main_td4_1.style.cssText = "padding-top:10px";
|
6352 |
-
|
6353 |
-
var edit_main_td5 = document.createElement('td');
|
6354 |
-
edit_main_td5.style.cssText = "padding-top:10px";
|
6355 |
-
var edit_main_td5_1 = document.createElement('td');
|
6356 |
-
edit_main_td5_1.style.cssText = "padding-top:10px";
|
6357 |
-
|
6358 |
-
var edit_main_td6 = document.createElement('td');
|
6359 |
-
edit_main_td6.style.cssText = "padding-top:10px";
|
6360 |
-
var edit_main_td6_1 = document.createElement('td');
|
6361 |
-
edit_main_td6_1.style.cssText = "padding-top:10px";
|
6362 |
-
|
6363 |
-
var edit_main_td7 = document.createElement('td');
|
6364 |
-
edit_main_td7.style.cssText = "padding-top:10px";
|
6365 |
-
var edit_main_td7_1 = document.createElement('td');
|
6366 |
-
edit_main_td7_1.style.cssText = "padding-top:10px";
|
6367 |
-
|
6368 |
-
var edit_main_td8 = document.createElement('td');
|
6369 |
-
edit_main_td8.style.cssText = "padding-top:10px";
|
6370 |
-
var edit_main_td8_1 = document.createElement('td');
|
6371 |
-
edit_main_td8_1.style.cssText = "padding-top:10px";
|
6372 |
-
|
6373 |
-
var el_label_label = document.createElement('label');
|
6374 |
-
el_label_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
6375 |
-
el_label_label.innerHTML = "Field label";
|
6376 |
-
|
6377 |
-
var el_label_textarea = document.createElement('textarea');
|
6378 |
-
el_label_textarea.setAttribute("id", "edit_for_label");
|
6379 |
-
el_label_textarea.setAttribute("rows", "4");
|
6380 |
-
el_label_textarea.style.cssText = "width:200px;";
|
6381 |
-
el_label_textarea.setAttribute("onKeyUp", "change_label('"+i+"_element_labelform_id_temp', this.value)");
|
6382 |
-
el_label_textarea.innerHTML = w_field_label;
|
6383 |
-
|
6384 |
-
var el_label_position_label = document.createElement('label');
|
6385 |
-
el_label_position_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
6386 |
-
el_label_position_label.innerHTML = "Field label position";
|
6387 |
-
|
6388 |
-
var el_label_position1 = document.createElement('input');
|
6389 |
-
el_label_position1.setAttribute("id", "edit_for_label_position_top");
|
6390 |
-
el_label_position1.setAttribute("type", "radio");
|
6391 |
-
el_label_position1.setAttribute("value", "left");
|
6392 |
-
|
6393 |
-
|
6394 |
-
el_label_position1.setAttribute("name", "edit_for_label_position");
|
6395 |
-
el_label_position1.setAttribute("onchange", "label_left("+i+")");
|
6396 |
-
Left = document.createTextNode("Left");
|
6397 |
-
|
6398 |
-
var el_label_position2 = document.createElement('input');
|
6399 |
-
el_label_position2.setAttribute("id", "edit_for_label_position_left");
|
6400 |
-
el_label_position2.setAttribute("type", "radio");
|
6401 |
-
el_label_position2.setAttribute("value", "top");
|
6402 |
-
|
6403 |
-
|
6404 |
-
el_label_position2.setAttribute("name", "edit_for_label_position");
|
6405 |
-
el_label_position2.setAttribute("onchange", "label_top("+i+")");
|
6406 |
-
Top = document.createTextNode("Top");
|
6407 |
-
|
6408 |
-
if(w_field_label_pos=="top")
|
6409 |
-
|
6410 |
-
el_label_position2.setAttribute("checked", "checked");
|
6411 |
-
else
|
6412 |
-
|
6413 |
-
el_label_position1.setAttribute("checked", "checked");
|
6414 |
-
|
6415 |
-
var el_size_label = document.createElement('label');
|
6416 |
-
el_size_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
6417 |
-
el_size_label.innerHTML = "Overall size(px) ";
|
6418 |
-
var el_size = document.createElement('input');
|
6419 |
-
el_size.setAttribute("id", "edit_for_input_size");
|
6420 |
-
el_size.setAttribute("type", "text");
|
6421 |
-
el_size.setAttribute("value", w_size);
|
6422 |
-
|
6423 |
-
el_size.setAttribute("name", "edit_for_size");
|
6424 |
-
el_size.setAttribute("onKeyPress", "return check_isnum(event)");
|
6425 |
-
el_size.setAttribute("onKeyUp", "change_w_style('"+i+"_div_address', this.value);");
|
6426 |
-
|
6427 |
-
|
6428 |
-
var el_required_label = document.createElement('label');
|
6429 |
-
el_required_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
6430 |
-
el_required_label.innerHTML = "Required";
|
6431 |
-
|
6432 |
-
var el_required = document.createElement('input');
|
6433 |
-
el_required.setAttribute("id", "el_send");
|
6434 |
-
el_required.setAttribute("type", "checkbox");
|
6435 |
-
el_required.setAttribute("value", "yes");
|
6436 |
-
el_required.setAttribute("onclick", "set_required('"+i+"_required')");
|
6437 |
-
if(w_required=="yes")
|
6438 |
-
el_required.setAttribute("checked", "checked");
|
6439 |
-
|
6440 |
-
var el_style_label = document.createElement('label');
|
6441 |
-
el_style_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
6442 |
-
el_style_label.innerHTML = "Class name";
|
6443 |
-
|
6444 |
-
var el_style_textarea = document.createElement('input');
|
6445 |
-
el_style_textarea.setAttribute("id", "element_style");
|
6446 |
-
el_style_textarea.setAttribute("type", "text");
|
6447 |
-
el_style_textarea.setAttribute("value", w_class);
|
6448 |
-
el_style_textarea.style.cssText = "width:200px;";
|
6449 |
-
el_style_textarea.setAttribute("onChange", "change_class(this.value,'"+i+"')");
|
6450 |
-
|
6451 |
-
var el_attr_label = document.createElement('label');
|
6452 |
-
el_attr_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
6453 |
-
el_attr_label.innerHTML = "Additional Attributes";
|
6454 |
-
var el_attr_add = document.createElement('img');
|
6455 |
-
el_attr_add.setAttribute("id", "el_choices_add");
|
6456 |
-
el_attr_add.setAttribute("src", plugin_url+'/images/add.png');
|
6457 |
-
el_attr_add.style.cssText = 'cursor:pointer; margin-left:68px';
|
6458 |
-
el_attr_add.setAttribute("title", 'add');
|
6459 |
-
el_attr_add.setAttribute("onClick", "add_attr("+i+", 'type_address')");
|
6460 |
-
var el_attr_table = document.createElement('table');
|
6461 |
-
el_attr_table.setAttribute("id", 'attributes');
|
6462 |
-
el_attr_table.setAttribute("border", '0');
|
6463 |
-
el_attr_table.style.cssText = 'margin-left:0px';
|
6464 |
-
var el_attr_tr_label = document.createElement('tr');
|
6465 |
-
el_attr_tr_label.setAttribute("idi", '0');
|
6466 |
-
var el_attr_td_name_label = document.createElement('th');
|
6467 |
-
el_attr_td_name_label.style.cssText = 'width:100px';
|
6468 |
-
var el_attr_td_value_label = document.createElement('th');
|
6469 |
-
el_attr_td_value_label.style.cssText = 'width:100px';
|
6470 |
-
var el_attr_td_X_label = document.createElement('th');
|
6471 |
-
el_attr_td_X_label.style.cssText = 'width:10px';
|
6472 |
-
var el_attr_name_label = document.createElement('label');
|
6473 |
-
el_attr_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
|
6474 |
-
el_attr_name_label.innerHTML = "Name";
|
6475 |
-
|
6476 |
-
var el_attr_value_label = document.createElement('label');
|
6477 |
-
el_attr_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
|
6478 |
-
el_attr_value_label.innerHTML = "Value";
|
6479 |
-
|
6480 |
-
el_attr_table.appendChild(el_attr_tr_label);
|
6481 |
-
el_attr_tr_label.appendChild(el_attr_td_name_label);
|
6482 |
-
el_attr_tr_label.appendChild(el_attr_td_value_label);
|
6483 |
-
el_attr_tr_label.appendChild(el_attr_td_X_label);
|
6484 |
-
el_attr_td_name_label.appendChild(el_attr_name_label);
|
6485 |
-
el_attr_td_value_label.appendChild(el_attr_value_label);
|
6486 |
-
|
6487 |
-
n=w_attr_name.length;
|
6488 |
-
for(j=1; j<=n; j++)
|
6489 |
-
{
|
6490 |
-
var el_attr_tr = document.createElement('tr');
|
6491 |
-
el_attr_tr.setAttribute("id", "attr_row_"+j);
|
6492 |
-
el_attr_tr.setAttribute("idi", j);
|
6493 |
-
var el_attr_td_name = document.createElement('td');
|
6494 |
-
el_attr_td_name.style.cssText = 'width:100px';
|
6495 |
-
var el_attr_td_value = document.createElement('td');
|
6496 |
-
el_attr_td_value.style.cssText = 'width:100px';
|
6497 |
-
|
6498 |
-
var el_attr_td_X = document.createElement('td');
|
6499 |
-
var el_attr_name = document.createElement('input');
|
6500 |
-
|
6501 |
-
el_attr_name.setAttribute("type", "text");
|
6502 |
-
|
6503 |
-
el_attr_name.style.cssText = "width:100px";
|
6504 |
-
el_attr_name.setAttribute("value", w_attr_name[j-1]);
|
6505 |
-
el_attr_name.setAttribute("id", "attr_name"+j);
|
6506 |
-
el_attr_name.setAttribute("onChange", "change_attribute_name("+i+", this, 'type_address')");
|
6507 |
-
|
6508 |
-
var el_attr_value = document.createElement('input');
|
6509 |
-
|
6510 |
-
el_attr_value.setAttribute("type", "text");
|
6511 |
-
|
6512 |
-
el_attr_value.style.cssText = "width:100px";
|
6513 |
-
el_attr_value.setAttribute("value", w_attr_value[j-1]);
|
6514 |
-
el_attr_value.setAttribute("id", "attr_value"+j);
|
6515 |
-
el_attr_value.setAttribute("onChange", "change_attribute_value("+i+", "+j+", 'type_address')");
|
6516 |
-
|
6517 |
-
var el_attr_remove = document.createElement('img');
|
6518 |
-
el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
|
6519 |
-
el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
|
6520 |
-
el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
|
6521 |
-
el_attr_remove.setAttribute("align", 'top');
|
6522 |
-
el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", 'type_address')");
|
6523 |
-
el_attr_table.appendChild(el_attr_tr);
|
6524 |
-
el_attr_tr.appendChild(el_attr_td_name);
|
6525 |
-
el_attr_tr.appendChild(el_attr_td_value);
|
6526 |
-
el_attr_tr.appendChild(el_attr_td_X);
|
6527 |
-
el_attr_td_name.appendChild(el_attr_name);
|
6528 |
-
el_attr_td_value.appendChild(el_attr_value);
|
6529 |
-
el_attr_td_X.appendChild(el_attr_remove);
|
6530 |
-
|
6531 |
-
}
|
6532 |
-
|
6533 |
-
|
6534 |
-
var t = document.getElementById('edit_table');
|
6535 |
-
|
6536 |
-
var br = document.createElement('br');
|
6537 |
-
var br1 = document.createElement('br');
|
6538 |
-
var br2 = document.createElement('br');
|
6539 |
-
var br3 = document.createElement('br');
|
6540 |
-
var br4 = document.createElement('br');
|
6541 |
-
var br5 = document.createElement('br');
|
6542 |
-
var br6 = document.createElement('br');
|
6543 |
-
|
6544 |
-
edit_main_td1.appendChild(el_label_label);
|
6545 |
-
edit_main_td1_1.appendChild(el_label_textarea);
|
6546 |
-
|
6547 |
-
edit_main_td2.appendChild(el_label_position_label);
|
6548 |
-
edit_main_td2_1.appendChild(el_label_position1);
|
6549 |
-
edit_main_td2_1.appendChild(Left);
|
6550 |
-
edit_main_td2_1.appendChild(br2);
|
6551 |
-
edit_main_td2_1.appendChild(el_label_position2);
|
6552 |
-
edit_main_td2_1.appendChild(Top);
|
6553 |
-
|
6554 |
-
edit_main_td7.appendChild(el_size_label);
|
6555 |
-
edit_main_td7_1.appendChild(el_size);
|
6556 |
-
|
6557 |
-
/*edit_main_td3.appendChild(el_format_label);
|
6558 |
-
edit_main_td3.appendChild(br5);
|
6559 |
-
edit_main_td3.appendChild(el_format_normal);
|
6560 |
-
edit_main_td3.appendChild(Normal);
|
6561 |
-
edit_main_td3.appendChild(br6);
|
6562 |
-
edit_main_td3.appendChild(el_format_extended);
|
6563 |
-
edit_main_td3.appendChild(Extended);*/
|
6564 |
-
|
6565 |
-
edit_main_td4.appendChild(el_style_label);
|
6566 |
-
edit_main_td4_1.appendChild(el_style_textarea);
|
6567 |
-
|
6568 |
-
edit_main_td5.appendChild(el_required_label);
|
6569 |
-
edit_main_td5_1.appendChild(el_required);
|
6570 |
-
|
6571 |
-
/* edit_main_td8.appendChild(el_unique_label);
|
6572 |
-
edit_main_td8.appendChild(el_unique);*/
|
6573 |
-
|
6574 |
-
edit_main_td6.appendChild(el_attr_label);
|
6575 |
-
edit_main_td6.appendChild(el_attr_add);
|
6576 |
-
edit_main_td6.appendChild(br3);
|
6577 |
-
edit_main_td6.appendChild(el_attr_table);
|
6578 |
-
edit_main_td6.setAttribute("colspan", "2");
|
6579 |
-
|
6580 |
-
edit_main_tr1.appendChild(edit_main_td1);
|
6581 |
-
edit_main_tr1.appendChild(edit_main_td1_1);
|
6582 |
-
edit_main_tr2.appendChild(edit_main_td2);
|
6583 |
-
edit_main_tr2.appendChild(edit_main_td2_1);
|
6584 |
-
edit_main_tr7.appendChild(edit_main_td7);
|
6585 |
-
edit_main_tr7.appendChild(edit_main_td7_1);
|
6586 |
-
//edit_main_tr3.appendChild(edit_main_td3);
|
6587 |
-
edit_main_tr4.appendChild(edit_main_td4);
|
6588 |
-
edit_main_tr4.appendChild(edit_main_td4_1);
|
6589 |
-
edit_main_tr5.appendChild(edit_main_td5);
|
6590 |
-
edit_main_tr5.appendChild(edit_main_td5_1);
|
6591 |
-
edit_main_tr6.appendChild(edit_main_td6);
|
6592 |
-
edit_main_tr6.appendChild(edit_main_td6_1);
|
6593 |
-
//edit_main_tr8.appendChild(edit_main_td8);
|
6594 |
-
edit_main_table.appendChild(edit_main_tr1);
|
6595 |
-
edit_main_table.appendChild(edit_main_tr2);
|
6596 |
-
edit_main_table.appendChild(edit_main_tr7);
|
6597 |
-
//edit_main_table.appendChild(edit_main_tr3);
|
6598 |
-
edit_main_table.appendChild(edit_main_tr4);
|
6599 |
-
edit_main_table.appendChild(edit_main_tr5);
|
6600 |
-
//edit_main_table.appendChild(edit_main_tr8);
|
6601 |
-
edit_main_table.appendChild(edit_main_tr6);
|
6602 |
-
edit_div.appendChild(edit_main_table);
|
6603 |
-
|
6604 |
-
t.appendChild(edit_div);
|
6605 |
-
add_id_and_name(i, 'type_address');
|
6606 |
|
6607 |
-
|
|
|
6608 |
|
6609 |
-
var adding_type = document.createElement("input");
|
6610 |
-
adding_type.setAttribute("type", "hidden");
|
6611 |
-
adding_type.setAttribute("value", "type_address");
|
6612 |
-
adding_type.setAttribute("name", i+"_typeform_id_temp");
|
6613 |
-
adding_type.setAttribute("id", i+"_typeform_id_temp");
|
6614 |
-
var adding_required= document.createElement("input");
|
6615 |
-
adding_required.setAttribute("type", "hidden");
|
6616 |
-
adding_required.setAttribute("value", w_required);
|
6617 |
-
adding_required.setAttribute("name", i+"_requiredform_id_temp");
|
6618 |
-
adding_required.setAttribute("id", i+"_requiredform_id_temp");
|
6619 |
-
|
6620 |
-
|
6621 |
-
var div = document.createElement('div');
|
6622 |
-
div.setAttribute("id", "main_div");
|
6623 |
-
|
6624 |
-
var table = document.createElement('table');
|
6625 |
-
table.setAttribute("id", i+"_elemet_tableform_id_temp");
|
6626 |
-
|
6627 |
-
|
6628 |
-
var tr = document.createElement('tr');
|
6629 |
-
|
6630 |
-
var td1 = document.createElement('td');
|
6631 |
-
td1.setAttribute("valign", 'top');
|
6632 |
-
td1.setAttribute("align", 'left');
|
6633 |
-
td1.setAttribute("id", i+"_label_sectionform_id_temp");
|
6634 |
-
|
6635 |
-
var td2 = document.createElement('td');
|
6636 |
-
td2.setAttribute("valign", 'top');
|
6637 |
-
td2.setAttribute("align", 'left');
|
6638 |
-
td2.setAttribute("id", i+"_element_sectionform_id_temp");
|
6639 |
-
|
6640 |
-
var div_address = document.createElement('div');
|
6641 |
-
div_address.setAttribute("id", i+"_div_address");
|
6642 |
-
div_address.style.cssText = "width:"+w_size+"px";
|
6643 |
-
|
6644 |
-
var span_addres1 = document.createElement('span');
|
6645 |
-
span_addres1.style.cssText = "float:left; width:100%; padding-bottom: 8px; display:block";
|
6646 |
-
|
6647 |
-
var span_addres2 = document.createElement('span');
|
6648 |
-
span_addres2.style.cssText = "float:left; width:100%; padding-bottom: 8px; display:block";
|
6649 |
-
|
6650 |
-
var span_addres3_1 = document.createElement('span');
|
6651 |
-
span_addres3_1.style.cssText = "float:left; width:48%; padding-bottom: 8px;";
|
6652 |
-
|
6653 |
-
var span_addres3_2 = document.createElement('span');
|
6654 |
-
span_addres3_2.style.cssText = "float:right; width:48%; padding-bottom: 8px;";
|
6655 |
-
|
6656 |
-
var span_addres4_1 = document.createElement('span');
|
6657 |
-
span_addres4_1.style.cssText = "float:left; width:48%; padding-bottom: 8px;";
|
6658 |
-
|
6659 |
-
var span_addres4_2 = document.createElement('span');
|
6660 |
-
span_addres4_2.style.cssText = "float:right; width:48%; padding-bottom: 8px;";
|
6661 |
-
|
6662 |
-
|
6663 |
-
var br1 = document.createElement('br');
|
6664 |
-
var br2 = document.createElement('br');
|
6665 |
-
var br3 = document.createElement('br');
|
6666 |
-
var br4 = document.createElement('br');
|
6667 |
-
|
6668 |
-
|
6669 |
-
var label = document.createElement('span');
|
6670 |
-
label.setAttribute("id", i+"_element_labelform_id_temp");
|
6671 |
-
label.innerHTML = w_field_label;
|
6672 |
-
label.setAttribute("class", "label");
|
6673 |
-
|
6674 |
-
var required = document.createElement('span');
|
6675 |
-
required.setAttribute("id", i+"_required_elementform_id_temp");
|
6676 |
-
required.innerHTML = "";
|
6677 |
-
required.setAttribute("class", "required");
|
6678 |
-
if(w_required=="yes")
|
6679 |
-
required.innerHTML = " *";
|
6680 |
-
|
6681 |
-
var street1 = document.createElement('input');
|
6682 |
-
street1.setAttribute("type", 'text');
|
6683 |
-
street1.style.cssText = "width:100%";
|
6684 |
-
street1.setAttribute("id", i+"_street1form_id_temp");
|
6685 |
-
street1.setAttribute("name", i+"_street1form_id_temp");
|
6686 |
-
street1.setAttribute("onChange", "change_value('"+i+"_street1form_id_temp')");
|
6687 |
-
|
6688 |
-
var street1_label = document.createElement('label');
|
6689 |
-
street1_label.setAttribute("class", "mini_label");
|
6690 |
-
street1_label.style.cssText = "display:block;";
|
6691 |
-
street1_label.innerHTML="<!--repstart-->Street Address<!--repend-->";
|
6692 |
-
|
6693 |
-
var street2 = document.createElement('input');
|
6694 |
-
street2.setAttribute("type", 'text');
|
6695 |
-
street2.style.cssText = "width:100%";
|
6696 |
-
street2.setAttribute("id", i+"_street2form_id_temp");
|
6697 |
-
street2.setAttribute("name", (parseInt(i)+1)+"_street2form_id_temp");
|
6698 |
-
street2.setAttribute("onChange", "change_value('"+i+"_street2form_id_temp')");
|
6699 |
-
|
6700 |
-
var street2_label = document.createElement('label');
|
6701 |
-
street2_label.setAttribute("class", "mini_label");
|
6702 |
-
street2_label.style.cssText = "display:block;";
|
6703 |
-
street2_label.innerHTML="<!--repstart-->Street Address Line 2<!--repend-->";
|
6704 |
-
|
6705 |
-
var city = document.createElement('input');
|
6706 |
-
city.setAttribute("type", 'text');
|
6707 |
-
city.style.cssText = "width:100%";
|
6708 |
-
city.setAttribute("id", i+"_cityform_id_temp");
|
6709 |
-
city.setAttribute("name", (parseInt(i)+2)+"_cityform_id_temp");
|
6710 |
-
city.setAttribute("onChange", "change_value('"+i+"_cityform_id_temp')");
|
6711 |
-
|
6712 |
-
var city_label = document.createElement('label');
|
6713 |
-
city_label.setAttribute("class", "mini_label");
|
6714 |
-
city_label.style.cssText = "display:block;";
|
6715 |
-
city_label.innerHTML="<!--repstart-->City<!--repend-->";
|
6716 |
-
|
6717 |
-
var state = document.createElement('input');
|
6718 |
-
state.setAttribute("type", 'text');
|
6719 |
-
state.style.cssText = "width:100%";
|
6720 |
-
state.setAttribute("id", i+"_stateform_id_temp");
|
6721 |
-
state.setAttribute("name", (parseInt(i)+3)+"_stateform_id_temp");
|
6722 |
-
state.setAttribute("onChange", "change_value('"+i+"_stateform_id_temp')");
|
6723 |
-
|
6724 |
-
var state_label = document.createElement('label');
|
6725 |
-
state_label.setAttribute("class", "mini_label");
|
6726 |
-
state_label.style.cssText = "display:block;";
|
6727 |
-
state_label.innerHTML="<!--repstart-->State / Province / Region<!--repend-->";
|
6728 |
-
|
6729 |
-
|
6730 |
-
|
6731 |
-
var postal = document.createElement('input');
|
6732 |
-
postal.setAttribute("type", 'text');
|
6733 |
-
postal.style.cssText = "width:100%";
|
6734 |
-
postal.setAttribute("id", i+"_postalform_id_temp");
|
6735 |
-
postal.setAttribute("name", (parseInt(i)+4)+"_postalform_id_temp");
|
6736 |
-
postal.setAttribute("onChange", "change_value('"+i+"_postalform_id_temp')");
|
6737 |
-
|
6738 |
-
var postal_label = document.createElement('label');
|
6739 |
-
postal_label.setAttribute("class", "mini_label");
|
6740 |
-
postal_label.style.cssText = "display:block;";
|
6741 |
-
postal_label.innerHTML="<!--repstart-->Postal / Zip Code<!--repend-->";
|
6742 |
-
|
6743 |
-
var country = document.createElement('select');
|
6744 |
-
country.setAttribute("type", 'text');
|
6745 |
-
country.style.cssText = "width:100%";
|
6746 |
-
country.setAttribute("id", i+"_countryform_id_temp");
|
6747 |
-
country.setAttribute("name", (parseInt(i)+5)+"_countryform_id_temp");
|
6748 |
-
country.setAttribute("onChange", "change_value('"+i+"_countryform_id_temp')");
|
6749 |
-
|
6750 |
-
var country_label = document.createElement('label');
|
6751 |
-
country_label.setAttribute("class", "mini_label");
|
6752 |
-
country_label.style.cssText = "display:block;";
|
6753 |
-
country_label.innerHTML="<!--repstart-->Country<!--repend-->";
|
6754 |
-
|
6755 |
-
|
6756 |
-
var option_ = document.createElement('option');
|
6757 |
-
option_.setAttribute("value", "");
|
6758 |
-
option_.innerHTML="";
|
6759 |
-
country.appendChild(option_);
|
6760 |
-
|
6761 |
-
coutries=["Afghanistan","Albania", "Algeria","Andorra","Angola","Antigua and Barbuda","Argentina","Armenia","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Brazil","Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Central African Republic","Chad","Chile","China","Colombi","Comoros","Congo (Brazzaville)","Congo","Costa Rica","Cote d'Ivoire","Croatia","Cuba","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Republic","East Timor (Timor Timur)","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Ethiopia","Fiji","Finland","France","Gabon","Gambia, The","Georgia","Germany","Ghana","Greece","Grenada","Guatemala","Guinea","Guinea-Bissau","Guyana","Haiti","Honduras","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Israel","Italy","Jamaica","Japan","Jordan","Kazakhstan","Kenya","Kiribati","Korea, North","Korea, South","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Macedonia","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Mauritania","Mauritius","Mexico","Micronesia","Moldova","Monaco","Mongolia","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepa","Netherlands","New Zealand","Nicaragua","Niger","Nigeria","Norway","Oman","Pakistan","Palau","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Qatar","Romania","Russia","Rwanda","Saint Kitts and Nevis","Saint Lucia","Saint Vincent","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia and Montenegro","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","Spain","Sri Lanka","Sudan","Suriname","Swaziland","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Togo","Tonga","Trinidad and Tobago","Tunisia","Turkey","Turkmenistan","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States
|
1 |
+
j = 2;//choices id
|
2 |
var c;
|
3 |
+
var need_enable = true;
|
4 |
+
var a = new Array();
|
5 |
+
var plugin_url = "";
|
6 |
+
var id_ifr_editor = 500;
|
7 |
+
var count_of_filds_form = 7;
|
8 |
+
if (ajaxurl.indexOf("://") != -1)
|
9 |
+
var url_for_ajax = ajaxurl;
|
10 |
else
|
11 |
+
var url_for_ajax = location.protocol + '//' + location.host + ajaxurl;
|
12 |
|
13 |
/**
|
14 |
* Remove witespaces from childNodes.
|
31 |
}
|
32 |
}
|
33 |
|
34 |
+
function active_reset(val, id) {
|
35 |
+
if (val) {
|
36 |
+
document.getElementById(id + '_element_resetform_id_temp').style.display = "inline";
|
37 |
+
}
|
38 |
+
else {
|
39 |
+
document.getElementById(id + '_element_resetform_id_temp').style.display = "none";
|
40 |
+
}
|
|
|
|
|
|
|
41 |
}
|
42 |
|
43 |
+
function check_required() {
|
44 |
+
alert('"Submit" and "Reset" buttons are disabled in back end.');
|
|
|
45 |
}
|
46 |
|
47 |
function isNumber(n) {
|
48 |
return !isNaN(parseFloat(n)) && isFinite(n);
|
49 |
}
|
50 |
+
function change_field_name(id, x) {
|
51 |
+
value = x.value;
|
52 |
+
|
53 |
+
if (value == parseInt(value)) {
|
54 |
+
alert('The name of the field cannot be a number.');
|
55 |
+
x.value = "";
|
56 |
+
document.getElementById(id + '_elementform_id_temp').name = '';
|
57 |
+
document.getElementById(id + '_element_labelform_id_temp').innerHTML = '';
|
58 |
+
return;
|
59 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
+
if (value == id + "_elementform_id_temp") {
|
62 |
+
alert('"Field Name" should differ from "Field Id".')
|
63 |
+
x.value = "";
|
64 |
+
}
|
65 |
+
else {
|
66 |
+
document.getElementById(id + '_elementform_id_temp').name = value;
|
67 |
+
document.getElementById(id + '_element_labelform_id_temp').innerHTML = value;
|
68 |
+
}
|
69 |
}
|
70 |
|
71 |
+
function change_field_value(id, value) {
|
72 |
+
document.getElementById(id + '_elementform_id_temp').value = value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
}
|
74 |
|
75 |
+
function return_attributes(id) {
|
76 |
+
attr_names = new Array();
|
77 |
+
attr_value = new Array();
|
78 |
+
var input = document.getElementById(id);
|
79 |
+
if (input) {
|
80 |
+
atr = input.attributes;
|
81 |
+
for (i = 0; i < 30; i++)
|
82 |
+
if (atr[i]) {
|
83 |
+
if (atr[i].name.indexOf("add_") == 0) {
|
84 |
+
attr_names.push(atr[i].name.replace('add_', ''));
|
85 |
+
attr_value.push(atr[i].value);
|
86 |
+
}
|
87 |
+
}
|
88 |
+
}
|
89 |
+
return Array(attr_names, attr_value);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
}
|
91 |
|
92 |
+
function refresh_attr(x, type) {
|
93 |
+
switch (type) {
|
94 |
+
case "type_text":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
|
96 |
+
{
|
97 |
+
id_array = Array();
|
98 |
+
id_array[0] = x + '_elementform_id_temp';
|
99 |
+
break;
|
100 |
+
}
|
101 |
|
102 |
+
case "type_name":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
|
104 |
+
{
|
105 |
+
id_array = Array();
|
106 |
+
id_array[0] = x + '_element_firstform_id_temp';
|
107 |
+
id_array[1] = x + '_element_lastform_id_temp';
|
108 |
+
id_array[2] = x + '_element_titleform_id_temp';
|
109 |
+
id_array[3] = x + '_element_middleform_id_temp';
|
110 |
+
break;
|
111 |
+
}
|
112 |
|
113 |
+
case "type_address":
|
114 |
+
|
115 |
+
{
|
116 |
+
id_array = Array();
|
117 |
+
id_array[0] = x + '_street1form_id_temp';
|
118 |
+
id_array[1] = x + '_street2form_id_temp';
|
119 |
+
id_array[2] = x + '_cityform_id_temp';
|
120 |
+
id_array[3] = x + '_stateform_id_temp';
|
121 |
+
id_array[4] = x + '_postalform_id_temp';
|
122 |
+
id_array[5] = x + '_countryform_id_temp';
|
123 |
+
break;
|
124 |
+
}
|
125 |
|
126 |
+
case "type_checkbox":
|
127 |
|
128 |
+
{
|
129 |
+
id_array = Array();
|
130 |
+
for (z = 0; z < 50; z++)
|
131 |
+
id_array[z] = x + '_elementform_id_temp' + z;
|
132 |
+
break;
|
133 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
|
135 |
+
case "type_time":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
|
137 |
+
{
|
138 |
+
id_array = Array();
|
139 |
+
id_array[0] = x + '_hhform_id_temp';
|
140 |
+
id_array[1] = x + '_mmform_id_temp';
|
141 |
+
id_array[2] = x + '_ssform_id_temp';
|
142 |
+
id_array[3] = x + '_am_pmform_id_temp';
|
143 |
+
break;
|
144 |
+
}
|
145 |
+
case "type_date":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
|
147 |
+
{
|
148 |
+
id_array = Array();
|
149 |
+
id_array[0] = x + '_elementform_id_temp';
|
150 |
+
id_array[1] = x + '_buttonform_id_temp';
|
151 |
+
break;
|
152 |
+
}
|
153 |
|
154 |
+
case "type_date_fields":
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
|
156 |
+
{
|
157 |
+
id_array = Array();
|
158 |
+
id_array[0] = x + '_dayform_id_temp';
|
159 |
+
id_array[1] = x + '_monthform_id_temp';
|
160 |
+
id_array[2] = x + '_yearform_id_temp';
|
161 |
+
break;
|
162 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
|
164 |
+
case "type_captcha":
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
|
166 |
+
{
|
167 |
+
id_array = Array();
|
168 |
+
id_array[0] = '_wd_captchaform_id_temp';
|
169 |
+
id_array[1] = '_wd_captcha_inputform_id_temp';
|
170 |
+
id_array[2] = '_element_refreshform_id_temp';
|
171 |
+
break;
|
172 |
+
}
|
173 |
|
174 |
+
case "type_recaptcha":
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
|
176 |
+
{
|
177 |
+
id_array = Array();
|
178 |
+
id_array[0] = 'wd_recaptchaform_id_temp';
|
179 |
+
break;
|
180 |
+
}
|
|
|
|
|
181 |
|
182 |
+
case "type_submit_reset":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
|
184 |
+
{
|
185 |
+
id_array = Array();
|
186 |
+
id_array[0] = x + '_element_submitform_id_temp';
|
187 |
+
id_array[1] = x + '_element_resetform_id_temp';
|
188 |
+
break;
|
189 |
+
}
|
|
|
|
|
|
|
|
|
|
|
190 |
|
191 |
+
case "type_page_break":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
|
193 |
+
{
|
194 |
+
id_array = Array();
|
195 |
+
id_array[0] = '_div_between';
|
196 |
+
break;
|
197 |
+
}
|
198 |
+
}
|
199 |
|
200 |
+
for (q = 0; q < id_array.length; q++) {
|
201 |
+
id = id_array[q];
|
202 |
+
var input = document.getElementById(id);
|
203 |
+
if (input) {
|
204 |
+
atr = input.attributes;
|
205 |
+
for (i = 0; i < 30; i++)
|
206 |
+
if (atr[i]) {
|
207 |
+
if (atr[i].name.indexOf("add_") == 0) {
|
208 |
+
input.removeAttribute(atr[i].name);
|
209 |
+
i--;
|
210 |
+
}
|
211 |
+
}
|
212 |
+
|
213 |
+
for (i = 0; i < 10; i++)
|
214 |
+
if (document.getElementById("attr_name" + i)) {
|
215 |
+
try {
|
216 |
+
input.setAttribute("add_" + document.getElementById("attr_name" + i).value, document.getElementById("attr_value" + i).value)
|
217 |
+
}
|
218 |
+
catch (err) {
|
219 |
+
alert('Only letters, numbers, hyphens and underscores are allowed.');
|
220 |
+
}
|
221 |
+
}
|
222 |
+
}
|
223 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
224 |
}
|
225 |
|
226 |
+
function add_id_and_name(i, type) {
|
227 |
+
switch (type) {
|
228 |
+
case 'type_text':
|
229 |
+
{
|
230 |
+
var edit_main_table = document.getElementById("edit_main_table");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
|
232 |
+
var edit_main_tr0 = document.createElement('tr');
|
233 |
+
edit_main_tr0.setAttribute("valing", "top");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
234 |
|
235 |
+
var edit_main_td0 = document.createElement('td');
|
236 |
+
edit_main_td0.style.cssText = "padding-top:10px";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
|
238 |
+
var edit_main_td0_1 = document.createElement('td');
|
239 |
+
edit_main_td0_1.style.cssText = "padding-top:10px";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
|
241 |
+
var br = document.createElement('br');
|
242 |
+
var br1 = document.createElement('br');
|
243 |
|
244 |
+
var field_id = document.createElement('label');
|
245 |
+
field_id.style.cssText = "color:#00aeef; font-weight:bold; font-size: 13px; margin-right:27px";
|
246 |
+
field_id.innerHTML = "Field id ";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
248 |
|
249 |
+
var field_id_text = document.createElement('input');
|
250 |
+
field_id_text.setAttribute("size", "50");
|
251 |
+
field_id_text.setAttribute("type", "text");
|
252 |
+
field_id_text.setAttribute("disabled", "disabled");
|
253 |
+
field_id_text.setAttribute("value", i + "_elementform_id_temp");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
|
255 |
+
var field_name = document.createElement('label');
|
256 |
+
field_name.style.cssText = "color:#00aeef; font-weight:bold; font-size: 13px; margin-right:3px";
|
257 |
+
field_name.innerHTML = "Field name ";
|
|
|
|
|
|
|
|
|
|
|
258 |
|
259 |
+
var field_name_text = document.createElement('input');
|
260 |
+
field_name_text.setAttribute("size", "50");
|
261 |
+
field_name_text.setAttribute("type", "text");
|
262 |
+
field_name_text.setAttribute("disabled", "disabled");
|
263 |
+
field_name_text.setAttribute("value", i + "_elementform_id_temp");
|
264 |
|
265 |
+
edit_main_td0.appendChild(field_id);
|
266 |
+
edit_main_td0.appendChild(br);
|
267 |
+
edit_main_td0.appendChild(field_name);
|
|
|
|
|
268 |
|
269 |
+
edit_main_td0_1.appendChild(field_id_text);
|
270 |
+
edit_main_td0_1.appendChild(br1);
|
271 |
+
edit_main_td0_1.appendChild(field_name_text);
|
272 |
+
edit_main_tr0.appendChild(edit_main_td0);
|
273 |
+
edit_main_tr0.appendChild(edit_main_td0_1);
|
274 |
+
edit_main_table.insertBefore(edit_main_tr0, edit_main_table.childNodes[0]);
|
275 |
+
break;
|
276 |
+
}
|
277 |
|
278 |
+
case 'type_address':
|
279 |
+
{
|
280 |
+
var edit_main_table = document.getElementById("edit_main_table");
|
281 |
+
|
282 |
+
var edit_main_tr0 = document.createElement('tr');
|
283 |
+
edit_main_tr0.setAttribute("valing", "top");
|
284 |
+
|
285 |
+
var edit_main_td0 = document.createElement('td');
|
286 |
+
edit_main_td0.style.cssText = "padding-top:10px";
|
287 |
+
edit_main_td0.setAttribute("colspan", "2");
|
288 |
+
|
289 |
+
var br = document.createElement('br');
|
290 |
+
|
291 |
+
var field_id = document.createElement('label');
|
292 |
+
field_id.style.cssText = "color:#00aeef; font-weight:bold; font-size: 13px; margin-right:27px";
|
293 |
+
field_id.innerHTML = "Fields id ";
|
294 |
+
|
295 |
+
|
296 |
+
var field_id_text = document.createElement('input');
|
297 |
+
field_id_text.setAttribute("type", "text");
|
298 |
+
field_id_text.setAttribute("id", "field_id");
|
299 |
+
field_id_text.setAttribute("disabled", "disabled");
|
300 |
+
field_id_text.setAttribute("style", "width:350px");
|
301 |
+
field_id_text.setAttribute("value", i + "_street1form_id_temp, " + i + "_street2form_id_temp, " + i + "_cityform_id_temp, " + i + "_stateform_id_temp, " + i + "_postalform_id_temp, " + i + "_countryform_id_temp");
|
302 |
+
|
303 |
+
var field_name = document.createElement('label');
|
304 |
+
field_name.style.cssText = "color:#00aeef; font-weight:bold; font-size: 13px; margin-right:3px";
|
305 |
+
field_name.innerHTML = "Fields name ";
|
306 |
+
|
307 |
+
var field_name_text = document.createElement('input');
|
308 |
+
field_name_text.setAttribute("type", "text");
|
309 |
+
field_name_text.setAttribute("id", "field_name");
|
310 |
+
field_name_text.setAttribute("disabled", "disabled");
|
311 |
+
field_name_text.setAttribute("style", "width:350px");
|
312 |
+
field_name_text.setAttribute("value", i + "_street1form_id_temp, " + i + "_street2form_id_temp, " + i + "_cityform_id_temp, " + i + "_stateform_id_temp, " + i + "_postalform_id_temp, " + i + "_countryform_id_temp");
|
313 |
+
|
314 |
+
edit_main_td0.appendChild(field_id);
|
315 |
+
edit_main_td0.appendChild(field_id_text);
|
316 |
+
edit_main_td0.appendChild(br);
|
317 |
+
edit_main_td0.appendChild(field_name);
|
318 |
+
edit_main_td0.appendChild(field_name_text);
|
319 |
+
edit_main_tr0.appendChild(edit_main_td0);
|
320 |
+
edit_main_table.insertBefore(edit_main_tr0, edit_main_table.childNodes[0]);
|
321 |
+
break;
|
322 |
+
}
|
323 |
|
324 |
+
case 'type_name':
|
325 |
+
{
|
326 |
+
var edit_main_table = document.getElementById("edit_main_table");
|
327 |
+
|
328 |
+
var edit_main_tr0 = document.createElement('tr');
|
329 |
+
edit_main_tr0.setAttribute("valing", "top");
|
330 |
+
|
331 |
+
var edit_main_td0 = document.createElement('td');
|
332 |
+
edit_main_td0.style.cssText = "padding-top:10px";
|
333 |
+
edit_main_td0.setAttribute("colspan", "2");
|
334 |
+
|
335 |
+
var br = document.createElement('br');
|
336 |
+
|
337 |
+
var field_id = document.createElement('label');
|
338 |
+
field_id.style.cssText = "color:#00aeef; font-weight:bold; font-size: 13px; margin-right:27px";
|
339 |
+
field_id.innerHTML = "Fields id ";
|
340 |
+
|
341 |
+
|
342 |
+
var field_id_text = document.createElement('input');
|
343 |
+
field_id_text.setAttribute("type", "text");
|
344 |
+
field_id_text.setAttribute("id", "field_id");
|
345 |
+
field_id_text.setAttribute("disabled", "disabled");
|
346 |
+
field_id_text.setAttribute("style", "width:350px");
|
347 |
+
field_id_text.setAttribute("value", i + "_element_firstform_id_temp, " + i + "_element_lastform_id_temp");
|
348 |
+
|
349 |
+
var field_name = document.createElement('label');
|
350 |
+
field_name.style.cssText = "color:#00aeef; font-weight:bold; font-size: 13px; margin-right:3px";
|
351 |
+
field_name.innerHTML = "Fields name ";
|
352 |
+
|
353 |
+
var field_name_text = document.createElement('input');
|
354 |
+
field_name_text.setAttribute("type", "text");
|
355 |
+
field_name_text.setAttribute("id", "field_name");
|
356 |
+
field_name_text.setAttribute("disabled", "disabled");
|
357 |
+
field_name_text.setAttribute("style", "width:350px");
|
358 |
+
field_name_text.setAttribute("value", i + "_element_firstform_id_temp, " + i + "_element_lastform_id_temp");
|
359 |
+
|
360 |
+
edit_main_td0.appendChild(field_id);
|
361 |
+
edit_main_td0.appendChild(field_id_text);
|
362 |
+
edit_main_td0.appendChild(br);
|
363 |
+
edit_main_td0.appendChild(field_name);
|
364 |
+
edit_main_td0.appendChild(field_name_text);
|
365 |
+
edit_main_tr0.appendChild(edit_main_td0);
|
366 |
+
edit_main_table.insertBefore(edit_main_tr0, edit_main_table.childNodes[0]);
|
367 |
+
break;
|
368 |
+
}
|
369 |
|
370 |
+
case 'type_radio':
|
371 |
+
{
|
372 |
+
var edit_main_table = document.getElementById("edit_main_table");
|
373 |
+
|
374 |
+
var edit_main_tr0 = document.createElement('tr');
|
375 |
+
edit_main_tr0.setAttribute("valing", "top");
|
376 |
+
|
377 |
+
var edit_main_td0 = document.createElement('td');
|
378 |
+
edit_main_td0.style.cssText = "padding-top:10px";
|
379 |
+
edit_main_td0.setAttribute("colspan", "2");
|
380 |
+
|
381 |
+
var br = document.createElement('br');
|
382 |
+
|
383 |
+
var field_id = document.createElement('label');
|
384 |
+
field_id.style.cssText = "color:#00aeef; font-weight:bold; font-size: 13px; margin-right:27px";
|
385 |
+
field_id.innerHTML = "Fields id ";
|
386 |
+
|
387 |
+
|
388 |
+
var field_id_text = document.createElement('input');
|
389 |
+
field_id_text.setAttribute("type", "text");
|
390 |
+
field_id_text.setAttribute("id", "field_id");
|
391 |
+
field_id_text.setAttribute("disabled", "disabled");
|
392 |
+
field_id_text.setAttribute("style", "width:350px");
|
393 |
+
field_id_text.setAttribute("value", '');
|
394 |
+
|
395 |
+
var field_name = document.createElement('label');
|
396 |
+
field_name.style.cssText = "color:#00aeef; font-weight:bold; font-size: 13px; margin-right:3px";
|
397 |
+
field_name.innerHTML = "Fields name ";
|
398 |
+
|
399 |
+
var field_name_text = document.createElement('input');
|
400 |
+
field_name_text.setAttribute("type", "text");
|
401 |
+
field_name_text.setAttribute("id", "field_name");
|
402 |
+
field_name_text.setAttribute("disabled", "disabled");
|
403 |
+
field_name_text.setAttribute("style", "width:350px");
|
404 |
+
field_name_text.setAttribute("value", '');
|
405 |
+
|
406 |
+
edit_main_td0.appendChild(field_id);
|
407 |
+
edit_main_td0.appendChild(field_id_text);
|
408 |
+
edit_main_td0.appendChild(br);
|
409 |
+
edit_main_td0.appendChild(field_name);
|
410 |
+
edit_main_td0.appendChild(field_name_text);
|
411 |
+
edit_main_tr0.appendChild(edit_main_td0);
|
412 |
+
edit_main_table.insertBefore(edit_main_tr0, edit_main_table.childNodes[0]);
|
413 |
+
refresh_id_name(i, type);
|
414 |
+
break;
|
415 |
+
}
|
416 |
|
417 |
+
case 'type_checkbox':
|
418 |
+
{
|
419 |
+
var edit_main_table = document.getElementById("edit_main_table");
|
420 |
+
|
421 |
+
var edit_main_tr0 = document.createElement('tr');
|
422 |
+
edit_main_tr0.setAttribute("valing", "top");
|
423 |
+
|
424 |
+
var edit_main_td0 = document.createElement('td');
|
425 |
+
edit_main_td0.style.cssText = "padding-top:10px";
|
426 |
+
edit_main_td0.setAttribute("colspan", "2");
|
427 |
+
|
428 |
+
var br = document.createElement('br');
|
429 |
+
|
430 |
+
var field_id = document.createElement('label');
|
431 |
+
field_id.style.cssText = "color:#00aeef; font-weight:bold; font-size: 13px; margin-right:27px";
|
432 |
+
field_id.innerHTML = "Fields id ";
|
433 |
+
|
434 |
+
|
435 |
+
var field_id_text = document.createElement('input');
|
436 |
+
field_id_text.setAttribute("type", "text");
|
437 |
+
field_id_text.setAttribute("id", "field_id");
|
438 |
+
field_id_text.setAttribute("disabled", "disabled");
|
439 |
+
field_id_text.setAttribute("style", "width:350px");
|
440 |
+
field_id_text.setAttribute("value", '');
|
441 |
+
|
442 |
+
var field_name = document.createElement('label');
|
443 |
+
field_name.style.cssText = "color:#00aeef; font-weight:bold; font-size: 13px; margin-right:3px";
|
444 |
+
field_name.innerHTML = "Fields name ";
|
445 |
+
|
446 |
+
var field_name_text = document.createElement('input');
|
447 |
+
field_name_text.setAttribute("type", "text");
|
448 |
+
field_name_text.setAttribute("id", "field_name");
|
449 |
+
field_name_text.setAttribute("disabled", "disabled");
|
450 |
+
field_name_text.setAttribute("style", "width:350px");
|
451 |
+
field_name_text.setAttribute("value", '');
|
452 |
+
|
453 |
+
edit_main_td0.appendChild(field_id);
|
454 |
+
edit_main_td0.appendChild(field_id_text);
|
455 |
+
edit_main_td0.appendChild(br);
|
456 |
+
edit_main_td0.appendChild(field_name);
|
457 |
+
edit_main_td0.appendChild(field_name_text);
|
458 |
+
edit_main_tr0.appendChild(edit_main_td0);
|
459 |
+
edit_main_table.insertBefore(edit_main_tr0, edit_main_table.childNodes[0]);
|
460 |
+
refresh_id_name(i, type);
|
461 |
+
break;
|
462 |
+
}
|
463 |
|
464 |
+
case 'type_time':
|
465 |
+
{
|
466 |
+
var edit_main_table = document.getElementById("edit_main_table");
|
467 |
+
|
468 |
+
var edit_main_tr0 = document.createElement('tr');
|
469 |
+
edit_main_tr0.setAttribute("valing", "top");
|
470 |
+
|
471 |
+
var edit_main_td0 = document.createElement('td');
|
472 |
+
edit_main_td0.style.cssText = "padding-top:10px";
|
473 |
+
var edit_main_td0_1 = document.createElement('td');
|
474 |
+
edit_main_td0_1.style.cssText = "padding-top:10px";
|
475 |
+
|
476 |
+
var br = document.createElement('br');
|
477 |
+
var br1 = document.createElement('br');
|
478 |
+
|
479 |
+
var field_id = document.createElement('label');
|
480 |
+
field_id.style.cssText = "color:#00aeef; font-weight:bold; font-size: 13px; margin-right:27px";
|
481 |
+
field_id.innerHTML = "Fields id ";
|
482 |
+
|
483 |
+
|
484 |
+
var field_id_text = document.createElement('input');
|
485 |
+
field_id_text.setAttribute("size", "50");
|
486 |
+
field_id_text.setAttribute("type", "text");
|
487 |
+
field_id_text.setAttribute("id", "field_id");
|
488 |
+
field_id_text.setAttribute("disabled", "disabled");
|
489 |
+
field_id_text.setAttribute("value", i + "_hhform_id_temp, " + i + "_mmform_id_temp, " + i + "_ssform_id_temp");
|
490 |
+
|
491 |
+
var field_name = document.createElement('label');
|
492 |
+
field_name.style.cssText = "color:#00aeef; font-weight:bold; font-size: 13px; margin-right:3px";
|
493 |
+
field_name.innerHTML = "Fields name ";
|
494 |
+
|
495 |
+
var field_name_text = document.createElement('input');
|
496 |
+
field_name_text.setAttribute("size", "50");
|
497 |
+
field_name_text.setAttribute("type", "text");
|
498 |
+
field_name_text.setAttribute("id", "field_name");
|
499 |
+
field_name_text.setAttribute("disabled", "disabled");
|
500 |
+
field_name_text.setAttribute("value", i + "_hhform_id_temp, " + i + "_mmform_id_temp, " + i + "_ssform_id_temp");
|
501 |
+
|
502 |
+
edit_main_td0.appendChild(field_id);
|
503 |
+
edit_main_td0.appendChild(br1);
|
504 |
+
edit_main_td0.appendChild(field_name);
|
505 |
+
edit_main_td0_1.appendChild(field_id_text);
|
506 |
+
edit_main_td0_1.appendChild(br);
|
507 |
+
edit_main_td0_1.appendChild(field_name_text);
|
508 |
+
|
509 |
+
edit_main_tr0.appendChild(edit_main_td0);
|
510 |
+
edit_main_tr0.appendChild(edit_main_td0_1);
|
511 |
+
edit_main_table.insertBefore(edit_main_tr0, edit_main_table.childNodes[0]);
|
512 |
+
break;
|
513 |
+
}
|
514 |
+
|
515 |
+
case 'type_date_fields':
|
516 |
+
{
|
517 |
+
var edit_main_table = document.getElementById("edit_main_table");
|
518 |
+
|
519 |
+
var edit_main_tr0 = document.createElement('tr');
|
520 |
+
edit_main_tr0.setAttribute("valing", "top");
|
521 |
+
|
522 |
+
var edit_main_td0 = document.createElement('td');
|
523 |
+
edit_main_td0.style.cssText = "padding-top:10px";
|
524 |
+
edit_main_td0.setAttribute("colspan", "2");
|
525 |
+
|
526 |
+
var br = document.createElement('br');
|
527 |
+
|
528 |
+
var field_id = document.createElement('label');
|
529 |
+
field_id.style.cssText = "color:#00aeef; font-weight:bold; font-size: 13px; margin-right:27px";
|
530 |
+
field_id.innerHTML = "Fields id ";
|
531 |
+
|
532 |
+
|
533 |
+
var field_id_text = document.createElement('input');
|
534 |
+
field_id_text.setAttribute("size", "50");
|
535 |
+
field_id_text.setAttribute("type", "text");
|
536 |
+
field_id_text.setAttribute("id", "field_id");
|
537 |
+
field_id_text.setAttribute("disabled", "disabled");
|
538 |
+
field_id_text.setAttribute("value", i + "_dayform_id_temp, " + i + "_monthform_id_temp, " + i + "_yearform_id_temp");
|
539 |
+
|
540 |
+
var field_name = document.createElement('label');
|
541 |
+
field_name.style.cssText = "color:#00aeef; font-weight:bold; font-size: 13px; margin-right:3px";
|
542 |
+
field_name.innerHTML = "Fields name ";
|
543 |
+
|
544 |
+
var field_name_text = document.createElement('input');
|
545 |
+
field_name_text.setAttribute("size", "50");
|
546 |
+
field_name_text.setAttribute("type", "text");
|
547 |
+
field_name_text.setAttribute("id", "field_name");
|
548 |
+
field_name_text.setAttribute("disabled", "disabled");
|
549 |
+
field_name_text.setAttribute("value", i + "_dayform_id_temp, " + i + "_monthform_id_temp, " + i + "_yearform_id_temp");
|
550 |
+
|
551 |
+
edit_main_td0.appendChild(field_id);
|
552 |
+
edit_main_td0.appendChild(field_id_text);
|
553 |
+
edit_main_td0.appendChild(br);
|
554 |
+
edit_main_td0.appendChild(field_name);
|
555 |
+
edit_main_td0.appendChild(field_name_text);
|
556 |
+
edit_main_tr0.appendChild(edit_main_td0);
|
557 |
+
edit_main_table.insertBefore(edit_main_tr0, edit_main_table.childNodes[0]);
|
558 |
+
break;
|
559 |
+
}
|
560 |
|
561 |
+
case 'type_captcha':
|
562 |
+
{
|
563 |
+
var edit_main_table = document.getElementById("edit_main_table");
|
564 |
+
|
565 |
+
var edit_main_tr0 = document.createElement('tr');
|
566 |
+
edit_main_tr0.setAttribute("valing", "top");
|
567 |
+
|
568 |
+
var edit_main_td0 = document.createElement('td');
|
569 |
+
edit_main_td0.style.cssText = "padding-top:10px";
|
570 |
+
|
571 |
+
var edit_main_td0_1 = document.createElement('td');
|
572 |
+
edit_main_td0_1.style.cssText = "padding-top:10px";
|
573 |
+
|
574 |
+
var br = document.createElement('br');
|
575 |
+
var br1 = document.createElement('br');
|
576 |
+
|
577 |
+
var field_id = document.createElement('label');
|
578 |
+
field_id.style.cssText = "color:#00aeef; font-weight:bold; font-size: 13px; margin-right:27px";
|
579 |
+
field_id.innerHTML = "Fields id ";
|
580 |
+
|
581 |
+
|
582 |
+
var field_id_text = document.createElement('input');
|
583 |
+
field_id_text.setAttribute("size", "50");
|
584 |
+
field_id_text.setAttribute("type", "text");
|
585 |
+
field_id_text.setAttribute("id", "field_id");
|
586 |
+
field_id_text.setAttribute("disabled", "disabled");
|
587 |
+
field_id_text.setAttribute("value", "wd_captcha_inputform_id_temp");
|
588 |
+
|
589 |
+
var field_name = document.createElement('label');
|
590 |
+
field_name.style.cssText = "color:#00aeef; font-weight:bold; font-size: 13px; margin-right:3px";
|
591 |
+
field_name.innerHTML = "Fields name ";
|
592 |
+
|
593 |
+
var field_name_text = document.createElement('input');
|
594 |
+
field_name_text.setAttribute("size", "50");
|
595 |
+
field_name_text.setAttribute("type", "text");
|
596 |
+
field_name_text.setAttribute("id", "field_name");
|
597 |
+
field_name_text.setAttribute("disabled", "disabled");
|
598 |
+
field_name_text.setAttribute("value", "captcha_inputform_id_temp");
|
599 |
+
|
600 |
+
edit_main_td0.appendChild(field_id);
|
601 |
+
edit_main_td0.appendChild(br1);
|
602 |
+
edit_main_td0.appendChild(field_name);
|
603 |
+
edit_main_td0_1.appendChild(field_id_text);
|
604 |
+
edit_main_td0_1.appendChild(br);
|
605 |
+
edit_main_td0_1.appendChild(field_name_text);
|
606 |
+
edit_main_tr0.appendChild(edit_main_td0);
|
607 |
+
edit_main_tr0.appendChild(edit_main_td0_1);
|
608 |
+
edit_main_table.insertBefore(edit_main_tr0, edit_main_table.childNodes[0]);
|
609 |
+
break;
|
610 |
+
}
|
611 |
|
612 |
+
}
|
613 |
}
|
614 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
615 |
|
616 |
+
function refresh_id_name(i, type) {
|
617 |
+
switch (type) {
|
618 |
+
case 'type_radio':
|
619 |
+
{
|
620 |
+
document.getElementById('field_id').value = '';
|
621 |
+
for (k = 0; k < 50; k++) {
|
622 |
+
if (document.getElementById(i + '_elementform_id_temp' + k))
|
623 |
+
document.getElementById('field_id').value += i + '_elementform_id_temp' + k + ', ';
|
624 |
+
}
|
625 |
+
a = document.getElementById('field_id').value.slice(0, -2);
|
626 |
+
document.getElementById('field_id').value = a;
|
627 |
+
document.getElementById('field_name').value = i + '_element';
|
628 |
+
|
629 |
+
break
|
630 |
+
}
|
631 |
+
case 'type_checkbox':
|
632 |
+
{
|
633 |
+
document.getElementById('field_id').value = '';
|
634 |
+
for (k = 0; k < 50; k++) {
|
635 |
+
if (document.getElementById(i + '_elementform_id_temp' + k)) {
|
636 |
+
document.getElementById('field_id').value += i + '_elementform_id_temp' + k + ', ';
|
637 |
+
}
|
638 |
+
}
|
639 |
+
a = document.getElementById('field_id').value.slice(0, -2);
|
640 |
+
document.getElementById('field_id').value = a;
|
641 |
+
document.getElementById('field_name').value = a;
|
642 |
|
643 |
+
break
|
644 |
+
}
|
645 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
646 |
|
647 |
}
|
648 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
649 |
|
650 |
+
function add_attr(i, type) {
|
651 |
+
|
652 |
+
var el_attr_table = document.getElementById('attributes');
|
653 |
+
j = parseInt(el_attr_table.lastChild.getAttribute('idi')) + 1;
|
654 |
+
w_attr_name[j] = "attribute";
|
655 |
+
w_attr_value[j] = "value";
|
656 |
+
var el_attr_tr = document.createElement('tr');
|
657 |
+
el_attr_tr.setAttribute("id", "attr_row_" + j);
|
658 |
+
el_attr_tr.setAttribute("idi", j);
|
659 |
+
var el_attr_td_name = document.createElement('td');
|
660 |
+
el_attr_td_name.style.cssText = 'width:100px';
|
661 |
+
var el_attr_td_value = document.createElement('td');
|
662 |
+
el_attr_td_value.style.cssText = 'width:100px';
|
663 |
+
|
664 |
+
var el_attr_td_X = document.createElement('td');
|
665 |
+
var el_attr_name = document.createElement('input');
|
666 |
+
el_attr_name.setAttribute("type", "text");
|
667 |
+
el_attr_name.style.cssText = "width:100px";
|
668 |
+
el_attr_name.setAttribute("value", w_attr_name[j]);
|
669 |
+
el_attr_name.setAttribute("id", "attr_name" + j);
|
670 |
+
el_attr_name.setAttribute("onChange", "change_attribute_name('" + i + "', this, '" + type + "')");
|
671 |
+
|
672 |
+
var el_attr_value = document.createElement('input');
|
673 |
+
el_attr_value.setAttribute("type", "text");
|
674 |
+
el_attr_value.style.cssText = "width:100px";
|
675 |
+
el_attr_value.setAttribute("value", w_attr_value[j]);
|
676 |
+
el_attr_value.setAttribute("id", "attr_value" + j);
|
677 |
+
el_attr_value.setAttribute("onChange", "change_attribute_value('" + i + "', " + j + ", '" + type + "')");
|
678 |
+
|
679 |
+
var el_attr_remove = document.createElement('img');
|
680 |
+
el_attr_remove.setAttribute("id", "el_choices" + j + "_remove");
|
681 |
+
el_attr_remove.setAttribute("src", plugin_url + '/images/delete.png');
|
682 |
+
el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
|
683 |
+
el_attr_remove.setAttribute("align", 'top');
|
684 |
+
el_attr_remove.setAttribute("onClick", "remove_attr(" + j + ", " + i + ", '" + type + "')");
|
685 |
+
el_attr_table.appendChild(el_attr_tr);
|
686 |
+
el_attr_tr.appendChild(el_attr_td_name);
|
687 |
+
el_attr_tr.appendChild(el_attr_td_value);
|
688 |
+
el_attr_tr.appendChild(el_attr_td_X);
|
689 |
+
el_attr_td_name.appendChild(el_attr_name);
|
690 |
+
el_attr_td_value.appendChild(el_attr_value);
|
691 |
+
el_attr_td_X.appendChild(el_attr_remove);
|
692 |
+
refresh_attr(i, type);
|
693 |
}
|
694 |
|
695 |
+
function change_attribute_value(id, x, type) {
|
696 |
+
if (!document.getElementById("attr_name" + x).value) {
|
697 |
+
alert('The name of the attribute is required.');
|
698 |
+
return
|
699 |
+
}
|
700 |
|
701 |
+
if (document.getElementById("attr_name" + x).value.toLowerCase() == "style") {
|
702 |
+
alert('Sorry, you cannot add a style attribute here. Use "Class name" instead.');
|
703 |
+
return
|
704 |
+
}
|
705 |
|
706 |
+
refresh_attr(id, type);
|
|
|
|
|
|
|
|
|
707 |
}
|
708 |
|
709 |
+
function change_attribute_name(id, x, type) {
|
710 |
+
value = x.value;
|
711 |
+
if (!value) {
|
712 |
+
alert('The name of the attribute is required.');
|
713 |
+
return;
|
714 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
715 |
|
716 |
+
if (value.toLowerCase() == "style") {
|
717 |
+
alert('Sorry, you cannot add a style attribute here. Use "Class name" instead.');
|
718 |
+
return;
|
719 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
720 |
|
721 |
+
if (value == parseInt(value)) {
|
722 |
+
alert('The name of the attribute cannot be a number.');
|
723 |
+
return;
|
724 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
725 |
|
726 |
+
if (value.indexOf(" ") != -1) {
|
727 |
+
var regExp = /\s+/g;
|
728 |
+
value = value.replace(regExp, '');
|
729 |
+
x.value = value;
|
730 |
+
alert("The name of the attribute cannot contain a space.");
|
731 |
+
refresh_attr(id, type);
|
732 |
+
return;
|
733 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
734 |
|
735 |
+
refresh_attr(id, type);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
736 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
737 |
}
|
738 |
|
739 |
+
function remove_attr(id, el_id, type) {
|
740 |
+
tr = document.getElementById("attr_row_" + id);
|
741 |
+
tr.parentNode.removeChild(tr);
|
742 |
+
refresh_attr(el_id, type);
|
|
|
|
|
|
|
743 |
}
|
744 |
|
745 |
+
function change_attributes(id, attr) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
746 |
|
747 |
+
var div = document.createElement('div');
|
748 |
+
var element = document.getElementById(id);
|
749 |
+
element.setAttribute(attr, '');
|
|
|
|
|
|
|
|
|
750 |
}
|
751 |
|
752 |
+
function add_button(i) {
|
753 |
+
edit_main_td4 = document.getElementById('buttons');
|
754 |
+
if (edit_main_td4.lastChild)
|
755 |
+
j = parseInt(edit_main_td4.lastChild.getAttribute("idi")) + 1;
|
756 |
+
else
|
757 |
+
j = 1;
|
758 |
+
var table_button = document.createElement('table');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
759 |
|
760 |
+
table_button.setAttribute("width", "100%");
|
761 |
+
table_button.setAttribute("border", "0");
|
762 |
+
table_button.setAttribute("id", "button_opt" + j);
|
763 |
+
table_button.setAttribute("idi", j);
|
764 |
+
var tr_button = document.createElement('tr');
|
765 |
+
var tr_hr = document.createElement('tr');
|
|
|
|
|
766 |
|
767 |
+
var td_button = document.createElement('td');
|
768 |
+
var td_X = document.createElement('td');
|
769 |
+
var td_hr = document.createElement('td');
|
770 |
+
td_hr.setAttribute("colspan", "3");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
771 |
|
772 |
+
tr_hr.appendChild(td_hr);
|
773 |
+
tr_button.appendChild(td_button);
|
774 |
+
tr_button.appendChild(td_X);
|
775 |
+
table_button.appendChild(tr_hr);
|
776 |
+
table_button.appendChild(tr_button);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
777 |
|
778 |
+
var br1 = document.createElement('br');
|
|
|
|
|
|
|
|
|
779 |
|
780 |
+
var hr = document.createElement('hr');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
781 |
|
782 |
+
hr.setAttribute("id", "br" + j);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
783 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
784 |
|
785 |
+
var el_title_label = document.createElement('label');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
786 |
|
787 |
+
el_title_label.style.cssText = "color:#00aeef; font-weight:bold; font-size: 13px";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
788 |
|
789 |
+
el_title_label.innerHTML = "Button name";
|
790 |
|
791 |
+
var el_title = document.createElement('input');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
792 |
|
793 |
+
el_title.setAttribute("id", "el_title" + j);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
794 |
|
795 |
+
el_title.setAttribute("type", "text");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
796 |
|
797 |
+
el_title.setAttribute("value", "Button");
|
|
|
|
|
|
|
|
|
|
|
798 |
|
799 |
+
el_title.style.cssText = "width:100px; margin-left:43px; padding:0; border-width: 1px";
|
800 |
|
801 |
+
el_title.setAttribute("onKeyUp", "change_label('" + i + "_elementform_id_temp" + j + "', this.value);");
|
|
|
|
|
|
|
|
|
802 |
|
|
|
|
|
|
|
|
|
803 |
|
804 |
+
var el_func_label = document.createElement('label');
|
|
|
|
|
|
|
805 |
|
806 |
+
el_func_label.style.cssText = "color:#00aeef; font-weight:bold; font-size: 13px";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
807 |
|
808 |
+
el_func_label.innerHTML = "OnClick function";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
809 |
|
810 |
+
var el_func = document.createElement('input');
|
811 |
|
812 |
+
el_func.setAttribute("id", "el_func" + j);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
813 |
|
814 |
+
el_func.setAttribute("type", "text");
|
815 |
|
816 |
+
el_func.setAttribute("value", "");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
817 |
|
818 |
+
el_func.style.cssText = "width:100px; margin-left:20px;; padding:0; border-width: 1px";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
819 |
|
820 |
+
el_func.setAttribute("onKeyUp", "change_func('" + i + "_elementform_id_temp" + j + "', this.value);");
|
|
|
|
|
|
|
|
|
|
|
|
|
821 |
|
822 |
+
var el_choices_remove = document.createElement('img');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
823 |
|
824 |
+
el_choices_remove.setAttribute("id", "el_button" + j + "_remove");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
825 |
|
826 |
+
el_choices_remove.setAttribute("src", plugin_url + '/images/delete.png');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
827 |
|
828 |
+
el_choices_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
829 |
|
830 |
+
el_choices_remove.setAttribute("align", 'top');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
831 |
|
832 |
+
el_choices_remove.setAttribute("onClick", "remove_button(" + j + "," + i + ")");
|
833 |
|
|
|
834 |
|
835 |
+
td_hr.appendChild(hr);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
836 |
|
837 |
+
td_button.appendChild(el_title_label);
|
838 |
|
839 |
+
td_button.appendChild(el_title);
|
840 |
+
td_button.appendChild(br1);
|
841 |
+
td_button.appendChild(el_func_label);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
842 |
|
843 |
+
td_button.appendChild(el_func);
|
844 |
+
td_X.appendChild(el_choices_remove);
|
845 |
+
edit_main_td4.appendChild(table_button);
|
846 |
|
847 |
+
element = 'button';
|
848 |
+
type = 'button';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
849 |
|
850 |
+
td2 = document.getElementById(i + "_element_sectionform_id_temp");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
851 |
|
852 |
+
var adding = document.createElement(element);
|
853 |
+
adding.setAttribute("type", type);
|
854 |
+
adding.setAttribute("id", i + "_elementform_id_temp" + j);
|
855 |
+
adding.setAttribute("name", i + "_elementform_id_temp" + j);
|
856 |
+
adding.setAttribute("value", "Button");
|
857 |
+
adding.innerHTML = "Button";
|
858 |
+
adding.setAttribute("onclick", "");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
859 |
|
|
|
860 |
|
861 |
+
td2.appendChild(adding);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
862 |
|
863 |
+
refresh_attr(i, 'type_checkbox');
|
864 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
865 |
|
866 |
+
function remove_button(j, i) {
|
867 |
+
table = document.getElementById('button_opt' + j);
|
868 |
+
button = document.getElementById(i + '_elementform_id_temp' + j);
|
869 |
+
table.parentNode.removeChild(table);
|
870 |
+
button.parentNode.removeChild(button);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
871 |
}
|
872 |
|
873 |
+
function change_date_format(value, id) {
|
874 |
+
input_p = document.getElementById(id + '_buttonform_id_temp');
|
875 |
+
input_p.setAttribute("onclick", "return showCalendar('" + id + "_elementform_id_temp' , '" + value + "')");
|
876 |
+
input_p.setAttribute("format", value);
|
877 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
878 |
|
879 |
+
function set_send(id) {
|
880 |
+
if (document.getElementById(id).value == "yes")
|
881 |
+
document.getElementById(id).setAttribute("value", "no")
|
882 |
+
else
|
883 |
+
document.getElementById(id).setAttribute("value", "yes")
|
884 |
+
}
|
885 |
|
886 |
+
function change_class(x, id) {
|
887 |
+
if (document.getElementById(id + '_label_sectionform_id_temp'))
|
888 |
+
document.getElementById(id + '_label_sectionform_id_temp').setAttribute("class", x);
|
889 |
+
if (document.getElementById(id + '_element_sectionform_id_temp'))
|
890 |
+
document.getElementById(id + '_element_sectionform_id_temp').setAttribute("class", x);
|
891 |
+
}
|
892 |
+
|
893 |
+
function set_required(id) {
|
894 |
+
if (document.getElementById(id + "form_id_temp").value == "yes") {
|
895 |
+
document.getElementById(id + "form_id_temp").setAttribute("value", "no");
|
896 |
+
document.getElementById(id + "_elementform_id_temp").innerHTML = "";
|
897 |
+
}
|
898 |
+
else {
|
899 |
+
document.getElementById(id + "form_id_temp").setAttribute("value", "yes")
|
900 |
+
document.getElementById(id + "_elementform_id_temp").innerHTML = " *";
|
901 |
+
}
|
902 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
903 |
|
904 |
+
function set_unique(id) {
|
905 |
+
if (document.getElementById(id).value == "yes") {
|
906 |
+
document.getElementById(id).setAttribute("value", "no");
|
907 |
+
}
|
908 |
+
else {
|
909 |
+
document.getElementById(id).setAttribute("value", "yes")
|
910 |
+
}
|
911 |
}
|
912 |
|
913 |
+
function set_randomize(id) {
|
914 |
+
if (document.getElementById(id).value == "yes") {
|
915 |
+
document.getElementById(id).setAttribute("value", "no");
|
916 |
+
}
|
917 |
+
else {
|
918 |
+
document.getElementById(id).setAttribute("value", "yes")
|
919 |
+
}
|
920 |
+
}
|
921 |
+
function show_other_input(num) {
|
922 |
+
for (k = 0; k < 50; k++)
|
923 |
+
if (document.getElementById(num + "_elementform_id_temp" + k))
|
924 |
+
if (document.getElementById(num + "_elementform_id_temp" + k).getAttribute('other'))
|
925 |
+
if (document.getElementById(num + "_elementform_id_temp" + k).getAttribute('other') == 1) {
|
926 |
+
element_other = document.getElementById(num + "_elementform_id_temp" + k);
|
927 |
+
break;
|
928 |
+
}
|
929 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
930 |
|
931 |
+
parent = element_other.parentNode;
|
932 |
+
|
933 |
+
var br = document.createElement('br');
|
934 |
+
br.setAttribute("id", num + "_other_brform_id_temp");
|
935 |
+
|
936 |
+
var el_other = document.createElement('input');
|
937 |
+
el_other.setAttribute("id", num + "_other_inputform_id_temp");
|
938 |
+
el_other.setAttribute("name", num + "_other_inputform_id_temp");
|
939 |
+
el_other.setAttribute("type", "text");
|
940 |
+
el_other.setAttribute("class", "other_input");
|
941 |
+
parent.appendChild(br);
|
942 |
+
parent.appendChild(el_other);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
943 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
944 |
}
|
945 |
|
946 |
+
function set_allow_other(num, type) {
|
947 |
+
if (document.getElementById(num + '_allow_otherform_id_temp').value == "yes") {
|
948 |
+
document.getElementById(num + '_allow_otherform_id_temp').setAttribute("value", "no");
|
949 |
+
for (k = 0; k < 50; k++)
|
950 |
+
if (document.getElementById(num + "_elementform_id_temp" + k))
|
951 |
+
if (document.getElementById(num + "_elementform_id_temp" + k).getAttribute('other'))
|
952 |
+
if (document.getElementById(num + "_elementform_id_temp" + k).getAttribute('other') == 1) {
|
953 |
+
remove_choise(k, num);
|
954 |
+
break;
|
955 |
+
}
|
956 |
|
957 |
+
}
|
958 |
+
else {
|
959 |
+
document.getElementById(num + '_allow_otherform_id_temp').setAttribute("value", "yes");
|
960 |
+
var q = 0;
|
961 |
+
if (document.getElementById(num + '_hor')) {
|
962 |
+
q = 1;
|
963 |
+
flow_ver(num);
|
964 |
+
}
|
965 |
+
j++;
|
966 |
+
element = 'input';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
967 |
|
968 |
+
var table = document.getElementById(num + '_table_little');
|
969 |
+
var tr = document.createElement('tr');
|
970 |
+
tr.setAttribute("id", num + "_element_tr" + j);
|
971 |
+
var td = document.createElement('td');
|
972 |
+
td.setAttribute("valign", "top");
|
973 |
+
td.setAttribute("id", num + "_td_little" + j);
|
974 |
+
td.setAttribute("idi", j);
|
975 |
+
var adding = document.createElement(element);
|
976 |
+
adding.setAttribute("type", type);
|
977 |
+
adding.setAttribute("value", "other");
|
978 |
+
adding.setAttribute("other", "1");
|
979 |
+
adding.setAttribute("id", num + "_elementform_id_temp" + j);
|
980 |
+
if (type == "checkbox") {
|
981 |
+
adding.setAttribute("onClick", "if(set_checked('" + num + "','" + j + "','form_id_temp')) show_other_input('" + num + "','form_id_temp');");
|
982 |
+
adding.setAttribute("name", num + "_elementform_id_temp" + j);
|
983 |
+
}
|
984 |
+
else {
|
985 |
+
adding.setAttribute("onClick", "set_default('" + num + "','" + j + "','form_id_temp'); show_other_input('" + num + "','form_id_temp');");
|
986 |
+
adding.setAttribute("name", num + "_elementform_id_temp");
|
987 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
988 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
989 |
|
990 |
+
var label_adding = document.createElement('label');
|
991 |
+
label_adding.setAttribute("id", num + "_label_element" + j);
|
992 |
+
label_adding.setAttribute("class", "ch_rad_label");
|
993 |
+
label_adding.setAttribute("for", num + "_elementform_id_temp" + j);
|
994 |
+
label_adding.innerHTML = "other";
|
995 |
+
td.appendChild(adding);
|
996 |
+
td.appendChild(label_adding);
|
997 |
+
tr.appendChild(td);
|
998 |
+
table.appendChild(tr);
|
999 |
+
|
1000 |
+
var choices_td = document.getElementById('choices');
|
1001 |
+
var br = document.createElement('br');
|
1002 |
+
br.setAttribute("id", "br" + j);
|
1003 |
+
var el_choices = document.createElement('input');
|
1004 |
+
el_choices.setAttribute("id", "el_choices" + j);
|
1005 |
+
el_choices.setAttribute("type", "text");
|
1006 |
+
el_choices.setAttribute("value", "other");
|
1007 |
+
el_choices.style.cssText = "width:100px; margin:0; padding:0; border-width: 1px";
|
1008 |
+
el_choices.setAttribute("onKeyUp", "change_label('" + num + "_label_element" + j + "', this.value); change_in_value('" + num + "_elementform_id_temp" + j + "', this.value)");
|
1009 |
+
|
1010 |
+
var el_choices_remove = document.createElement('img');
|
1011 |
+
el_choices_remove.setAttribute("id", "el_choices" + j + "_remove");
|
1012 |
+
el_choices_remove.setAttribute("src", plugin_url + '/images/delete.png');
|
1013 |
+
el_choices_remove.style.cssText = 'cursor:pointer;vertical-align:middle; margin:3px; display:none';
|
1014 |
+
el_choices_remove.setAttribute("align", 'top');
|
1015 |
+
el_choices_remove.setAttribute("onClick", "remove_choise('" + j + "','" + num + "')");
|
1016 |
+
|
1017 |
+
choices_td.appendChild(br);
|
1018 |
+
choices_td.appendChild(el_choices);
|
1019 |
+
choices_td.appendChild(el_choices_remove);
|
1020 |
+
refresh_attr(num, 'type_checkbox');
|
1021 |
+
if (q == 1) {
|
1022 |
+
flow_hor(num);
|
1023 |
+
}
|
1024 |
+
}
|
1025 |
+
}
|
1026 |
|
1027 |
+
function flow_hor(id) {
|
1028 |
+
tbody = document.getElementById(id + '_table_little');
|
1029 |
+
td_array = new Array();
|
1030 |
+
n = tbody.childNodes.length;
|
1031 |
+
for (k = 0; k < n; k++)
|
1032 |
+
td_array[k] = tbody.childNodes[k].childNodes[0];
|
1033 |
|
1034 |
+
for (k = 0; k < n; k++)
|
1035 |
+
tbody.removeChild(tbody.childNodes[0]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1036 |
|
1037 |
+
var tr = document.createElement('tr');
|
1038 |
+
tr.setAttribute("id", id + "_hor");
|
1039 |
|
1040 |
+
tbody.appendChild(tr);
|
1041 |
+
for (k = 0; k < n; k++)
|
1042 |
+
tr.appendChild(td_array[k]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1043 |
}
|
1044 |
|
1045 |
+
function flow_ver(id) {
|
1046 |
+
tbody = document.getElementById(id + '_table_little');
|
1047 |
+
tr = document.getElementById(id + '_hor');
|
1048 |
+
td_array = new Array();
|
1049 |
+
n = tr.childNodes.length;
|
1050 |
|
1051 |
+
for (k = 0; k < n; k++)
|
1052 |
+
td_array[k] = tr.childNodes[k];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1053 |
|
1054 |
+
tbody.removeChild(tr);
|
1055 |
|
1056 |
+
for (k = 0; k < n; k++) {
|
1057 |
+
var tr_little = document.createElement('tr');
|
1058 |
+
tr_little.setAttribute("id", id + "_element_tr" + td_array[k].getAttribute("idi"));
|
1059 |
+
tr_little.appendChild(td_array[k]);
|
1060 |
+
tbody.appendChild(tr_little);
|
1061 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1062 |
}
|
1063 |
|
1064 |
+
function check_isnum_3_10(e) {
|
|
|
1065 |
|
1066 |
+
var chCode1 = e.which || e.keyCode;
|
1067 |
+
if (chCode1 > 31 && (chCode1 < 51 || chCode1 > 57))
|
1068 |
+
return false
|
1069 |
+
else if ((document.getElementById('captcha_digit').value + (chCode1 - 48)) > 9)
|
1070 |
+
return false;
|
1071 |
+
return true;
|
1072 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1073 |
|
1074 |
+
function set_sel_am_pm(select_) {
|
1075 |
+
if (select_.options[0].selected) {
|
1076 |
+
select_.options[0].setAttribute("selected", "selected");
|
1077 |
+
select_.options[1].removeAttribute("selected");
|
1078 |
+
}
|
1079 |
+
else {
|
1080 |
+
select_.options[1].setAttribute("selected", "selected");
|
1081 |
+
select_.options[0].removeAttribute("selected");
|
1082 |
+
}
|
1083 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1084 |
}
|
1085 |
|
1086 |
+
function change_captcha_digit(digit) {
|
1087 |
+
captcha = document.getElementById('_wd_captchaform_id_temp');
|
1088 |
+
if (document.getElementById('captcha_digit').value) {
|
1089 |
+
captcha.setAttribute("digit", digit);
|
1090 |
|
1091 |
+
captcha.setAttribute("src", url_for_ajax + "?action=formmakerwdcaptcha" + "&digit=" + digit + "&i=form_id_temp");
|
1092 |
+
document.getElementById('_wd_captcha_inputform_id_temp').style.width = (document.getElementById('captcha_digit').value * 10 + 15) + "px";
|
1093 |
+
}
|
1094 |
+
else {
|
1095 |
+
captcha.setAttribute("digit", "6");
|
1096 |
+
captcha.setAttribute("src", url_for_ajax + "?action=formmakerwdcaptcha" + "&digit=6" + "&i=form_id_temp");
|
1097 |
+
document.getElementById('_wd_captcha_inputform_id_temp').style.width = (6 * 10 + 15) + "px";
|
1098 |
+
}
|
1099 |
+
}
|
1100 |
+
|
1101 |
+
function second_no(id) {
|
1102 |
+
time_box = document.getElementById(id + '_tr_time1');
|
1103 |
+
text_box = document.getElementById(id + '_tr_time2');
|
1104 |
+
second_box = document.getElementById(id + '_td_time_input3');
|
1105 |
+
second_text = document.getElementById(id + '_td_time_label3');
|
1106 |
+
document.getElementById(id + '_td_time_input2').parentNode.removeChild(document.getElementById(id + '_td_time_input2').nextSibling);
|
1107 |
+
time_box.removeChild(second_box);
|
1108 |
+
text_box.removeChild(second_text.previousSibling);
|
1109 |
+
text_box.removeChild(second_text);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1111 |
}
|
1112 |
|
1113 |
+
function second_yes(id, w_ss) {
|
1114 |
+
time_box = document.getElementById(id + '_tr_time1');
|
1115 |
+
text_box = document.getElementById(id + '_tr_time2');
|
1116 |
|
1117 |
+
var td_time_input2_ket = document.createElement('td');
|
1118 |
+
td_time_input2_ket.setAttribute("align", "center");
|
1119 |
+
var td_time_input3 = document.createElement('td');
|
1120 |
+
td_time_input3.setAttribute("id", id + "_td_time_input3");
|
1121 |
|
1122 |
+
var td_time_label2_ket = document.createElement('td');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1123 |
|
1124 |
+
var td_time_label3 = document.createElement('td');
|
1125 |
+
td_time_label3.setAttribute("id", id + "_td_time_label3");
|
1126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|