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

Version Description

Download this release

Release Info

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

Code changes from version 1.5 to 1.5.2

Form_Maker.php CHANGED
@@ -1,1779 +1,1445 @@
1
- <?php
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;
18
- font-weight:normal;
19
- color:#000000;
20
- width:100% ;
21
- }
22
-
23
- .wdform_tbody1
24
- {
25
- float:left;
26
- }
27
- .wdform_table2
28
- {
29
- padding-right:50px !important;
30
- float:left;
31
- border-spacing: 0px;
32
- border-collapse:separate !important;
33
- }
34
- #edit_main_table label
35
- {
36
- line-height: 19px;
37
- }
38
- #edit_main_table td
39
- {
40
- padding-right: 5px;
41
- }
42
- .time_box
43
- {
44
- border-width:1px;
45
- margin: 0px;
46
- padding: 0px;
47
- text-align:right;
48
- width:30px;
49
- vertical-align:middle
50
- }
51
-
52
- .mini_label
53
- {
54
- font-size:10px;
55
- font-family: 'Lucida Grande', Tahoma, Arial, Verdana, sans-serif;
56
- }
57
-
58
- .ch_rad_label
59
- {
60
- display:inline;
61
- margin-left:5px;
62
- margin-right:15px;
63
- float:none;
64
- }
65
-
66
- .label
67
- {
68
- border:none;
69
- }
70
-
71
-
72
- .td_am_pm_select
73
- {
74
- padding-left:5;
75
- }
76
-
77
- .am_pm_select
78
- {
79
- height: 16px;
80
- margin:0;
81
- padding:0
82
- }
83
-
84
- .input_deactive
85
- {
86
- color:#999999;
87
- font-style:italic;
88
- border-width:1px;
89
- margin: 0px;
90
- padding: 0px
91
- }
92
-
93
- .input_active
94
- {
95
- color:#000000;
96
- font-style:normal;
97
- border-width:1px;
98
- margin: 0px;
99
- padding: 0px
100
- }
101
-
102
- .required
103
- {
104
- border:none;
105
- color:red
106
- }
107
-
108
- .captcha_img
109
- {
110
- border-width:0px;
111
- margin: 0px;
112
- padding: 0px;
113
- cursor:pointer;
114
-
115
-
116
- }
117
-
118
- .captcha_refresh
119
- {
120
- width:30px;
121
- height:30px;
122
- border-width:0px;
123
- 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
131
- {
132
- height:20px;
133
- border-width:1px;
134
- margin: 0px;
135
- padding: 0px;
136
- vertical-align:middle;
137
- }
138
-
139
- .file_upload
140
- {
141
- border-width:1px;
142
- margin: 0px;
143
- padding: 0px
144
- }
145
-
146
- .page_deactive
147
- {
148
- border:1px solid black;
149
- padding:4px 7px 4px 7px;
150
- margin:4px;
151
- cursor:pointer;
152
- background-color:#DBDBDB;
153
- }
154
-
155
- .page_active
156
- {
157
- border:1px solid black;
158
- padding:4px 7px 4px 7px;
159
- margin:4px;
160
- cursor:pointer;
161
- background-color:#878787;
162
- }
163
-
164
- .page_percentage_active
165
- {
166
- padding:0px;
167
- margin:0px;
168
- border-spacing: 0px;
169
- height:30px;
170
- line-height:30px;
171
- background-color:yellow;
172
- border-radius:30px;
173
- font-size:15px;
174
- float:left;
175
- text-align: right !important;
176
- }
177
-
178
-
179
- .page_percentage_deactive
180
- {
181
- height:30px;
182
- line-height:30px;
183
- padding:5px;
184
- border:1px solid black;
185
- width:100%;
186
- background-color:white;
187
- border-radius:30px;
188
- text-align: left !important;
189
- }
190
-
191
- .page_numbers
192
- {
193
- font-size:11px;
194
- }
195
-
196
- .phone_area_code
197
- {
198
- width:50px;
199
- }
200
-
201
- .phone_number
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
- load_plugin_textdomain('form_maker', false, basename( dirname( __FILE__ ) ) . '/languages' );
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
- add_filter('the_content','Form_maker_fornt_end_main',5000);
257
-
258
-
259
- function Form_maker_fornt_end_main($content){
260
-
261
-
262
- $pattern ='[\[Form id="([0-9]*)"\]]';
263
-
264
-
265
- $count_forms_in_post=preg_match_all ( $pattern, $content, $matches_form);
266
- for($jj=0;$jj<$count_forms_in_post;$jj++)
267
- {
268
- $padron=$matches_form[0][$jj];
269
-
270
- $replacment=form_maker_front_end($matches_form[1][$jj]);
271
- $content=str_replace($padron,$replacment,$content);
272
- }
273
- return $content;
274
-
275
- }
276
-
277
- function form_maker_scripts_method() {
278
- wp_enqueue_style("gmap_styles_",plugins_url("css/style_for_map.css",__FILE__),false);
279
- wp_enqueue_script("mootools",plugins_url("js/mootools.js",__FILE__));
280
- wp_enqueue_script("main_g_js",plugins_url("js/main_front_end.js",__FILE__),false);
281
- wp_enqueue_script("Calendar",plugins_url("js/calendar.js",__FILE__),false);
282
- wp_enqueue_script("calendar-setup",plugins_url("js/calendar-setup.js",__FILE__),false);
283
- wp_enqueue_script("calendar_function",plugins_url("js/calendar_function.js",__FILE__),false);
284
- wp_enqueue_style("Css",plugins_url("js/calendar-jos.css",__FILE__),false);
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
- function print_massage($content)
297
- {
298
- $mh_after_head = did_action( 'wp_enqueue_scripts' );
299
- if($mh_after_head==1){
300
- global $wpdb;
301
-
302
-
303
- @session_start();
304
- if(isset($_SESSION['form_submit_type']) && $_SESSION['form_submit_type']){
305
- $type_and_id=$_SESSION['form_submit_type'];
306
- $type_and_id=explode(',',$type_and_id);
307
- $form_get_type=$type_and_id[0];
308
- $form_get_id=$type_and_id[1];
309
- $_SESSION['form_submit_type']=0;
310
- if($form_get_type==3){
311
- $_SESSION['massage_after_submit']="";
312
- $row=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$form_get_id."'");
313
- return $row->submit_text;
314
- }
315
- }
316
- if( isset($_SESSION['massage_after_submit']))
317
- {
318
- if($_SESSION['massage_after_submit']!="")
319
- {
320
-
321
- $message=$_SESSION['massage_after_submit'];
322
- $_SESSION['massage_after_submit']="";
323
-
324
- $returned_content=" <style>
325
- .updated,.error{
326
- border-width:1px !important;
327
- border-style:solid !important;
328
- padding:0 .6em !important;
329
- margin:5px 15px 2px !important;
330
- -moz-border-radius:3px !important;
331
- -khtml-border-radius:3px !important;
332
- -webkit-border-radius:3px !important;
333
- border-radius:3px !important;
334
- }
335
- .updated p, .error p
336
- {
337
- font-size: 12px !important;
338
- margin:.5em 0 !important;
339
- line-height:1 !important;
340
- padding:2px !important;
341
- }
342
- .updated, .error
343
- {
344
- margin:5px 0 15px !important;
345
- }
346
- .updated{
347
- background-color:#ffffe0 !important;
348
- border-color:#e6db55 !important;
349
- }
350
- .error
351
- {
352
- background-color:#ffebe8 !important;
353
- border-color:#c00 !important;
354
- }
355
- error a
356
- {
357
- color:#c00 !important;
358
- }
359
- .error
360
- {
361
- line-height:22px !important;
362
- margin:0 15px !important;
363
- padding:3px 5px !important;
364
- }
365
- .error-div
366
- {
367
- display:block !important;
368
- line-height:36px !important;
369
- float:right !important;
370
- margin-right:20px !important;
371
- }
372
- </style>";
373
-
374
-
375
- if($_SESSION['error_or_no'])
376
- {
377
- $error='error';
378
- }
379
- else
380
- {
381
- $error='updated';
382
- }
383
-
384
- $returned_content.="<div class=\"".$error."\" ><p><strong>".$message."</strong></p></div>".$content;// modified content
385
- return $returned_content;
386
- }
387
- else
388
- {
389
- return $content;
390
- }
391
- }
392
- else
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
- array_push($buttons, "Form_Maker_mce");
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( 'images/formmakerLogoHover.png' , __FILE__ ).') no-repeat !important;}
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
- $icon_url=plugins_url( 'images/FormMakerLogo-16.png' , __FILE__ );
460
- add_menu_page('Theme page title', 'Form Maker', 'manage_options', 'Form_maker', 'Manage_Form_maker', $icon_url);
461
- $page_form= add_submenu_page( 'Form_maker', 'Form Maker Manager', 'Manager', 'manage_options', 'Form_maker', 'Manage_Form_maker');
462
- $page_submits=add_submenu_page( 'Form_maker', 'Form Maker submissions', 'Submissions', 'manage_options', 'Form_maker_Submits', 'Form_maker_Submits');
463
- add_submenu_page( 'Form_maker', 'Form Maker Themes', 'Themes', 'manage_options', 'Form_maker_Themes', 'Form_maker_Themes');
464
- add_submenu_page( 'Form_maker', 'Uninstall Form Maker ', 'Uninstall Form Maker', 'manage_options', 'Uninstall_Form_Maker', 'Uninstall_Form_Maker');
465
-
466
-
467
-
468
- add_action('admin_print_styles-' . $page_form, 'form_maker_admin_styles_scripts');
469
- add_action('admin_print_styles-' . $page_submits, 'form_maker_submits_styles_scripts');
470
- }
471
-
472
-
473
-
474
-
475
- function form_maker_submits_styles_scripts()
476
- {
477
- wp_enqueue_script('word-count');
478
- wp_enqueue_script('post');
479
- wp_enqueue_script('editor');
480
- wp_enqueue_script('media-upload');
481
- wp_admin_css('thickbox');
482
- wp_print_scripts('media-upload');
483
- do_action('admin_print_styles');
484
- wp_enqueue_script( 'common' );
485
- wp_enqueue_script( 'jquery-color' );
486
- wp_enqueue_script('utils');
487
- wp_enqueue_script("mootools",plugins_url("js/mootools.js",__FILE__));
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
- function form_maker_admin_styles_scripts()
500
- {
501
- if(isset($_GET['task']))
502
- {
503
- if($_GET['task']=="update" || $_GET['task']=="save_update" || $_GET['task']=="gotoedit" ||$_GET['task']=="add_form" || $_GET['task']=="edit_form" || $_GET['task']=="Save_Edit_JavaScript" || $_GET['task']=="Save_Actions_after_submission" || $_GET['task']=="Save_Custom_text_in_email_for_administrator" || $_GET['task']=="Save_Custom_text_in_email_for_user")
504
- {
505
- wp_enqueue_script('word-count');
506
- wp_enqueue_script('post');
507
- wp_enqueue_script('editor');
508
- wp_enqueue_script('media-upload');
509
- wp_admin_css('thickbox');
510
- wp_print_scripts('media-upload');
511
-
512
- do_action('admin_print_styles');
513
- wp_enqueue_script( 'common' );
514
- wp_enqueue_script( 'jquery-color' );
515
- if(get_bloginfo('version')<'3.3'){
516
- if (function_exists('add_thickbox')) add_thickbox();
517
- if (function_exists('wp_tiny_mce')) wp_tiny_mce();
518
- }
519
- wp_enqueue_script('utils');
520
- if(get_bloginfo('version')>3.3){
521
- wp_enqueue_script("jquery");
522
-
523
- }
524
- else
525
- {
526
- wp_deregister_script( 'jquery' );
527
- wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js');
528
- wp_enqueue_script( 'jquery' );
529
-
530
-
531
- }
532
- wp_enqueue_script("form_main_js",plugins_url("js/formmaker_free.js",__FILE__));
533
- wp_enqueue_style("styles_form",plugins_url("css/style.css",__FILE__));
534
- wp_enqueue_script("mootools",plugins_url("js/mootools.js",__FILE__));
535
- wp_enqueue_script("f_calendar",plugins_url("js/calendar.js",__FILE__));
536
- wp_enqueue_script("f_calendar_functions",plugins_url("js/calendar_function.js",__FILE__));
537
- wp_enqueue_script("f_calendar_setup",plugins_url("js/calendar-setup.js",__FILE__));
538
-
539
- // wp_enqueue_script("main",plugins_url("js/main.js",__FILE__));
540
- wp_enqueue_style("calendar-jos",plugins_url("js/calendar-jos.css",__FILE__));
541
-
542
-
543
-
544
-
545
- }
546
- }
547
-
548
-
549
-
550
- }
551
-
552
-
553
-
554
- ///////////////////////////////////////// add ajax for form maker functionaliti
555
-
556
-
557
- require_once("form_ajax_functions.php"); //////////// include form ajax functions for next 4 ajax hooks
558
-
559
- add_action('wp_ajax_formmakergeneretexml', 'form_maker_generete_xml'); ///export xml
560
- add_action('wp_ajax_formmakergeneretecsv', 'form_maker_generete_csv'); ///export csv
561
- add_action('wp_ajax_formmakerwdcaptcha', 'form_maker_wd_captcha'); /// generete captcha image and save it code in session
562
- add_action('wp_ajax_formmakerwindow', 'form_maker_window_php'); /// openid window in post or page for editor
563
-
564
- add_action('wp_ajax_nopriv_formmakergeneretexml', 'form_maker_generete_xml'); ///export xml
565
- add_action('wp_ajax_nopriv_formmakergeneretecsv', 'form_maker_generete_csv'); ///export csv
566
- add_action('wp_ajax_nopriv_formmakerwdcaptcha', 'form_maker_wd_captcha'); /// generete captcha image and save it code in session
567
- add_action('wp_ajax_nopriv_formmakerwindow', 'form_maker_window_php'); /// openid window in post or page for editor
568
-
569
-
570
-
571
-
572
-
573
-
574
- ////////////////////////////////////////////
575
- //////////////////////////////////////////// manager
576
- ////////////////////////////////////////////
577
-
578
-
579
-
580
-
581
-
582
- add_action('wp_ajax_fromeditcountryinpopup', 'spider_form_country_edit');
583
-
584
-
585
-
586
- function spider_form_country_edit(){
587
- if(isset($_GET['field_id']))
588
- $id=$_GET['field_id'];
589
- else{
590
- echo "<h2>error cannot get fild id</h2>";
591
- return;
592
- }
593
- html_spider_form_country_edit($id);
594
-
595
- }
596
-
597
-
598
-
599
- function html_spider_form_country_edit($id){
600
-
601
- wp_print_scripts( 'jquery');
602
- wp_print_scripts( 'jquery-ui-core');
603
- wp_print_scripts( 'jquery-ui-widget');
604
- wp_print_scripts( 'jquery-ui-mouse');
605
- wp_print_scripts( 'jquery-ui-slider');
606
- wp_print_scripts( 'jquery-ui-sortable');
607
-
608
-
609
- ?>
610
-
611
- <span style=" position: absolute;right: 29px;" >
612
- <img alt="ADD" title="add" style="cursor:pointer; vertical-align:middle; margin:5px; " src="<?php echo plugins_url('images/save.png',__FILE__); ?>" onclick="save_list()">
613
- <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();">
614
- </span>
615
- <button onclick="select_all()">Select all</button>
616
- <button onclick="remove_all()">Remove all</button>
617
- <ul id="countries_list" style="list-style:none; padding:0px">
618
- </ul>
619
-
620
- <script>
621
-
622
-
623
- selec_coutries=[];
624
-
625
- 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"];
626
-
627
- select_=window.parent.document.getElementById('<?php echo $id ?>_elementform_id_temp');
628
- n=select_.childNodes.length;
629
- for(i=0; i<n; i++)
630
- {
631
-
632
- selec_coutries.push(select_.childNodes[i].value);
633
- var ch = document.createElement('input');
634
- ch.setAttribute("type","checkbox");
635
- ch.setAttribute("checked","checked");
636
- ch.value=select_.childNodes[i].value;
637
- ch.id=i+"ch";
638
- //ch.setAttribute("id",i);
639
-
640
-
641
- var p = document.createElement('span');
642
- p.style.cssText ="color:#000000; font-size: 13px; cursor:move";
643
- p.innerHTML=select_.childNodes[i].value;
644
-
645
- var li = document.createElement('li');
646
- li.style.cssText ="margin:3px; vertical-align:middle";
647
- li.id=i;
648
-
649
- li.appendChild(ch);
650
- li.appendChild(p);
651
-
652
- document.getElementById('countries_list').appendChild(li);
653
- }
654
- cur=i;
655
- m=coutries.length;
656
- for(i=0; i<m; i++)
657
- {
658
- isin=isValueInArray(selec_coutries, coutries[i]);
659
-
660
- if(!isin)
661
- {
662
- var ch = document.createElement('input');
663
- ch.setAttribute("type","checkbox");
664
- ch.value=coutries[i];
665
- ch.id=cur+"ch";
666
-
667
-
668
- var p = document.createElement('span');
669
- p.style.cssText ="color:#000000; font-size: 13px; cursor:move";
670
- p.innerHTML=coutries[i];
671
-
672
- var li = document.createElement('li');
673
- li.style.cssText ="margin:3px; vertical-align:middle";
674
- li.id=cur;
675
-
676
- li.appendChild(ch);
677
- li.appendChild(p);
678
-
679
- document.getElementById('countries_list').appendChild(li);
680
- cur++;
681
- }
682
- }
683
- jQuery(function() {
684
- jQuery( "#countries_list" ).sortable();
685
- jQuery( "#countries_list" ).disableSelection();
686
- });
687
-
688
- function isValueInArray(arr, val) {
689
- inArray = false;
690
- for (x = 0; x < arr.length; x++)
691
- if (val == arr[x])
692
- inArray = true;
693
- return inArray;
694
- }
695
- function save_list()
696
- {
697
- select_.innerHTML=""
698
- ul=document.getElementById('countries_list');
699
- n=ul.childNodes.length;
700
- for(i=0; i<n; i++)
701
- {
702
- if(ul.childNodes[i].tagName=="LI")
703
- {
704
- id=ul.childNodes[i].id;
705
- if(document.getElementById(id+'ch').checked)
706
- {
707
- var option_ = document.createElement('option');
708
- option_.setAttribute("value", document.getElementById(id+'ch').value);
709
- option_.innerHTML=document.getElementById(id+'ch').value;
710
-
711
- select_.appendChild(option_);
712
- }
713
-
714
- }
715
-
716
-
717
- }
718
- window.parent.tb_remove();
719
-
720
-
721
- }
722
-
723
- function select_all()
724
- {
725
- for(i=0; i<194; i++)
726
- {
727
- document.getElementById(i+'ch').checked=true;;
728
- }
729
- }
730
-
731
- function remove_all()
732
- {
733
- for(i=0; i<194; i++)
734
- {
735
- document.getElementById(i+'ch').checked=false;;
736
- }
737
- }
738
- </script>
739
-
740
-
741
-
742
-
743
- <?php
744
-
745
-
746
-
747
-
748
-
749
- }
750
-
751
-
752
-
753
-
754
- function Manage_Form_maker()
755
- {
756
-
757
- require_once("form_maker_functions.php");
758
- require_once("form_maker_functions.html.php");
759
- if(!function_exists('print_html_nav'))
760
- require_once("nav_function/nav_html_func.php");
761
-
762
- global $wpdb;
763
- if(isset($_GET["task"]))
764
- {
765
- $task=$_GET["task"];
766
- }
767
- else
768
- {
769
- $task="show";
770
- }
771
- if(isset($_GET["id"]))
772
- {
773
- $id=$_GET["id"];
774
- }
775
- else
776
- {
777
- $id=0;
778
- }
779
-
780
-
781
- switch($task){
782
-
783
- case 'update':
784
- update_form_maker();
785
- break;
786
-
787
- case 'save_update':
788
- save_update_form_maker();
789
- break;
790
-
791
-
792
- case 'update_complite':
793
- update_complete();
794
- display_form_lists();
795
- break;
796
-
797
- case "add_form" :
798
- add_form();
799
- break;
800
-
801
- case "edit_form" :
802
- edit_form_maker($id);
803
- break;
804
-
805
- case "Save" :
806
- if($id)
807
- apply_form($id);
808
- else
809
- save_form();
810
- display_form_lists();
811
- break;
812
-
813
- case "Apply" :
814
- if($id){
815
- apply_form($id);
816
- }
817
- else
818
- {
819
- save_form();
820
- $id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
821
- }
822
- forchrome($id);
823
- break;
824
-
825
- case "gotoedit" :
826
- gotoedit();
827
- edit_form_maker($id);
828
- break;
829
-
830
- case "remove_form" :
831
- remove_form($id);
832
- display_form_lists();
833
- break;
834
-
835
-
836
-
837
-
838
- // Actions_after_submission
839
- case "Actions_after_submission" :
840
- if($id){
841
- apply_form($id);
842
- }
843
- else
844
- {
845
- save_form();
846
- $id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
847
- }
848
- Actions_after_submission($id);
849
- break;
850
-
851
- case "Save_Actions_after_submission" :
852
- Apply_Actions_after_submission($id);
853
- edit_form_maker($id);
854
- break;
855
-
856
- case "Apply_Actions_after_submission" :
857
- Apply_Actions_after_submission($id);
858
- Actions_after_submission($id);
859
- break;
860
-
861
-
862
- // Edit_JavaScript
863
- case "Edit_JavaScript" :
864
- if($id){
865
- apply_form($id);
866
- }
867
- else
868
- {
869
- save_form();
870
- $id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
871
- }
872
- Edit_JavaScript($id);
873
- break;
874
-
875
- case "Save_Edit_JavaScript" :
876
- Apply_Edit_JavaScript($id);
877
- edit_form_maker($id);
878
- break;
879
-
880
- case "Apply_Edit_JavaScript" :
881
- Apply_Edit_JavaScript($id);
882
- Edit_JavaScript($id);
883
- break;
884
-
885
-
886
-
887
-
888
-
889
-
890
-
891
- // Custom_text_in_email_for_administrator
892
- case "Custom_text_in_email_for_administrator" :
893
- if($id){
894
- apply_form($id);
895
- }
896
- else
897
- {
898
- save_form();
899
- $id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
900
- }
901
- Custom_text_in_email_for_administrator($id);
902
- break;
903
-
904
- case "Save_Custom_text_in_email_for_administrator" :
905
- Apply_Custom_text_in_email_for_administrator($id);
906
- edit_form_maker($id);
907
- break;
908
-
909
- case "Apply_Custom_text_in_email_for_administrator" :
910
- Apply_Custom_text_in_email_for_administrator($id);
911
- Custom_text_in_email_for_administrator($id);
912
- break;
913
-
914
-
915
-
916
-
917
-
918
-
919
-
920
-
921
-
922
-
923
-
924
- // Custom text in email for user
925
- case "Custom_text_in_email_for_user" :
926
- if($id){
927
- apply_form($id);
928
- }
929
- else
930
- {
931
- save_form();
932
- $id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
933
- }
934
- Custom_text_in_email_for_user($id);
935
- break;
936
-
937
- case "Save_Custom_text_in_email_for_user" :
938
- Apply_Custom_text_in_email_for_user($id);
939
- edit_form_maker($id);
940
- break;
941
-
942
- case "Apply_Custom_text_in_email_for_user" :
943
- Apply_Custom_text_in_email_for_user($id);
944
- Custom_text_in_email_for_user($id);
945
- break;
946
- case "save_as_copy":
947
- save_as_copy();
948
- display_form_lists();
949
- break;
950
- default:
951
- display_form_lists();
952
- }
953
-
954
-
955
-
956
-
957
-
958
- }
959
-
960
- ////////////////////////////////////////////
961
- //////////////////////////////////////////// Submi
962
- ////////////////////////////////////////////
963
-
964
- ////map in spubmits
965
-
966
-
967
- add_action('wp_ajax_frommapeditinpopup', 'spider_form_map_edit');
968
-
969
- function spider_form_map_edit(){
970
- if(isset($_GET['long']) && isset($_GET['lat'])){
971
- $long = $_GET['long'];
972
- $lat = $_GET['lat'];
973
-
974
-
975
- ?>
976
- <script src="<?php echo plugins_url("js/if_gmap.js",__FILE__); ?>"></script>
977
- <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
978
-
979
- <table style="margin:0px; padding:0px">
980
- <tr><td><b>Address:</b></td><td><input type="text" id="addrval0" style="border:0px; background:none" size="80" readonly /> </td></tr>
981
- <tr><td><b>Longitude:</b></td> <td><input type="text" id="longval0" style="border:0px; background:none" size="80" readonly /> </td></tr>
982
- <tr><td><b>Latitude:</b></td><td><input type="text" id="latval0" style="border:0px; background:none" size="80" readonly /> </td></tr>
983
- </table>
984
-
985
- <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>
986
-
987
- <script>
988
- if_gmap_init("0");
989
- add_marker_on_map(0, 0, "<?php echo $long ?>", "<?php echo $lat ?>", '');
990
-
991
-
992
- </script>
993
-
994
- <?php
995
-
996
-
997
- die();
998
-
999
- }
1000
- else{
1001
- return 0;
1002
- }
1003
-
1004
- }
1005
-
1006
-
1007
- /////////////////////////////////////////////////////////////////////////////////////
1008
- /////////////////////////////////////////////////////////////////////////////////// priview form
1009
- ///////////////////////////////////////////////////////////////////////////////////
1010
- ///////////////////////////////////////////////////////////////////////////////////
1011
-
1012
- add_action('wp_ajax_frommakerpreview', 'preview_formmaker');
1013
-
1014
-
1015
-
1016
- function html_preview_formmaker($css){
1017
-
1018
- /**
1019
- * @package SpiderFC
1020
- * @author Web-Dorado
1021
- * @copyright (C) 2011 Web-Dorado. All rights reserved.
1022
- * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
1023
- **/
1024
-
1025
- $cmpnt_js_path =plugins_url('js',__FILE__);
1026
- $id='form_id_temp';
1027
- ?>
1028
- <script src="<?php echo $cmpnt_js_path."/if_gmap.js"; ?>"></script>
1029
- <script src="<?php echo $cmpnt_js_path."/main.js"; ?>"></script>
1030
- <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
1031
- <style>
1032
- <?php
1033
- $cmpnt_js_path =plugins_url('',__FILE__);
1034
- echo str_replace('[SITE_ROOT]',$cmpnt_js_path, $css);
1035
-
1036
- ?>
1037
- </style>
1038
- <div id="form_id_temppages" class="wdform_page_navigation" show_title="" show_numbers="" type=""></div>
1039
-
1040
- <form id="form_preview"></form>
1041
- <input type="hidden" id="counter<?php echo $id ?>" value="" name="counter<?php echo $id ?>" />
1042
-
1043
- <script>
1044
- JURI_ROOT ='<?php echo $cmpnt_js_path ?>';
1045
-
1046
- document.getElementById('form_preview').innerHTML = window.parent.document.getElementById('take').innerHTML;
1047
- document.getElementById('form_id_temppages').setAttribute('show_title', window.parent.document.getElementById('pages').getAttribute('show_title'));
1048
- document.getElementById('form_id_temppages').setAttribute('show_numbers', window.parent.document.getElementById('pages').getAttribute('show_numbers'));
1049
- document.getElementById('form_id_temppages').setAttribute('type', window.parent.document.getElementById('pages').getAttribute('type'));
1050
- document.getElementById('counterform_id_temp').value=window.parent.gen;;
1051
-
1052
- form_view_count<?php echo $id ?>=0;
1053
- for(i=1; i<=30; i++)
1054
- {
1055
- if(document.getElementById('<?php echo $id ?>form_view'+i))
1056
- {
1057
- form_view_count<?php echo $id ?>++;
1058
- form_view_max<?php echo $id ?>=i;
1059
- document.getElementById('<?php echo $id ?>form_view'+i).parentNode.removeAttribute('style');
1060
- }
1061
- }
1062
-
1063
- refresh_first();
1064
-
1065
-
1066
- if(form_view_count<?php echo $id ?>>1)
1067
- {
1068
- for(i=1; i<=form_view_max<?php echo $id ?>; i++)
1069
- {
1070
- if(document.getElementById('<?php echo $id ?>form_view'+i))
1071
- {
1072
- first_form_view<?php echo $id ?>=i;
1073
- break;
1074
- }
1075
- }
1076
-
1077
- generate_page_nav(first_form_view<?php echo $id ?>, '<?php echo $id ?>', form_view_count<?php echo $id ?>, form_view_max<?php echo $id ?>);
1078
- }
1079
-
1080
-
1081
- function remove_add_(id)
1082
- {
1083
- attr_name= new Array();
1084
- attr_value= new Array();
1085
- var input = document.getElementById(id);
1086
- atr=input.attributes;
1087
- for(v=0;v<30;v++)
1088
- if(atr[v] )
1089
- {
1090
- if(atr[v].name.indexOf("add_")==0)
1091
- {
1092
- attr_name.push(atr[v].name.replace('add_',''));
1093
- attr_value.push(atr[v].value);
1094
- input.removeAttribute(atr[v].name);
1095
- v--;
1096
- }
1097
- }
1098
- for(v=0;v<attr_name.length; v++)
1099
- {
1100
- input.setAttribute(attr_name[v],attr_value[v])
1101
- }
1102
- }
1103
-
1104
- function refresh_first()
1105
- {
1106
-
1107
- n=window.parent.gen;
1108
- for(i=0; i<n; i++)
1109
- {
1110
- if(document.getElementById(i))
1111
- {
1112
- for(z=0; z<document.getElementById(i).childNodes.length; z++)
1113
- if(document.getElementById(i).childNodes[z].nodeType==3)
1114
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
1115
-
1116
- if(document.getElementById(i).getAttribute('type')=="type_map")
1117
- {
1118
- if_gmap_init(i);
1119
- for(q=0; q<20; q++)
1120
- if(document.getElementById(i+"_elementform_id_temp").getAttribute("long"+q))
1121
- {
1122
-
1123
- w_long=parseFloat(document.getElementById(i+"_elementform_id_temp").getAttribute("long"+q));
1124
- w_lat=parseFloat(document.getElementById(i+"_elementform_id_temp").getAttribute("lat"+q));
1125
- w_info=parseFloat(document.getElementById(i+"_elementform_id_temp").getAttribute("info"+q));
1126
- add_marker_on_map(i,q, w_long, w_lat, w_info, false);
1127
- }
1128
- }
1129
-
1130
- if(document.getElementById(i).getAttribute('type')=="type_mark_map")
1131
- {
1132
- if_gmap_init(i);
1133
- w_long=parseFloat(document.getElementById(i+"_elementform_id_temp").getAttribute("long"+0));
1134
- w_lat=parseFloat(document.getElementById(i+"_elementform_id_temp").getAttribute("lat"+0));
1135
- w_info=parseFloat(document.getElementById(i+"_elementform_id_temp").getAttribute("info"+0));
1136
- add_marker_on_map(i,0, w_long, w_lat, w_info, true);
1137
- }
1138
-
1139
-
1140
-
1141
- if(document.getElementById(i).getAttribute('type')=="type_captcha" || document.getElementById(i).getAttribute('type')=="type_recaptcha")
1142
- {
1143
- if(document.getElementById(i).childNodes[10])
1144
- {
1145
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1146
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1147
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1148
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1149
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1150
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1151
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1152
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1153
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1154
- }
1155
- else
1156
- {
1157
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1158
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1159
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1160
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1161
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1162
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1163
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1164
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1165
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1166
- }
1167
- continue;
1168
- }
1169
-
1170
- if(document.getElementById(i).getAttribute('type')=="type_section_break")
1171
- {
1172
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1173
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1174
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1175
- continue;
1176
- }
1177
-
1178
-
1179
- if(document.getElementById(i).childNodes[10])
1180
- {
1181
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1182
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1183
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1184
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1185
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1186
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1187
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1188
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1189
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1190
- }
1191
- else
1192
- {
1193
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1194
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1195
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1196
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1197
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1198
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1199
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1200
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1201
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1202
- }
1203
- }
1204
- }
1205
-
1206
- for(i=0; i<=n; i++)
1207
- {
1208
- if(document.getElementById(i))
1209
- {
1210
- type=document.getElementById(i).getAttribute("type");
1211
- switch(type)
1212
- {
1213
- case "type_text":
1214
- case "type_number":
1215
- case "type_password":
1216
- case "type_submitter_mail":
1217
- case "type_own_select":
1218
- case "type_country":
1219
- case "type_hidden":
1220
- case "type_map":
1221
- {
1222
- remove_add_(i+"_elementform_id_temp");
1223
- break;
1224
- }
1225
-
1226
- case "type_submit_reset":
1227
- {
1228
- remove_add_(i+"_element_submitform_id_temp");
1229
- if(document.getElementById(i+"_element_resetform_id_temp"))
1230
- remove_add_(i+"_element_resetform_id_temp");
1231
- break;
1232
- }
1233
-
1234
- case "type_captcha":
1235
- {
1236
- remove_add_("_wd_captchaform_id_temp");
1237
- remove_add_("_element_refreshform_id_temp");
1238
- remove_add_("_wd_captcha_inputform_id_temp");
1239
- break;
1240
- }
1241
-
1242
- case "type_recaptcha":
1243
- {
1244
- remove_add_("wd_recaptchaform_id_temp");
1245
- break;
1246
- }
1247
-
1248
- case "type_file_upload":
1249
- {
1250
- remove_add_(i+"_elementform_id_temp");
1251
- break;
1252
- }
1253
-
1254
- case "type_textarea":
1255
- {
1256
- remove_add_(i+"_elementform_id_temp");
1257
-
1258
- break;
1259
- }
1260
-
1261
- case "type_name":
1262
- {
1263
-
1264
- if(document.getElementById(i+"_element_titleform_id_temp"))
1265
- {
1266
- remove_add_(i+"_element_titleform_id_temp");
1267
- remove_add_(i+"_element_firstform_id_temp");
1268
- remove_add_(i+"_element_lastform_id_temp");
1269
- remove_add_(i+"_element_middleform_id_temp");
1270
- }
1271
- else
1272
- {
1273
- remove_add_(i+"_element_firstform_id_temp");
1274
- remove_add_(i+"_element_lastform_id_temp");
1275
-
1276
- }
1277
- break;
1278
-
1279
- }
1280
-
1281
- case "type_phone":
1282
- {
1283
-
1284
- remove_add_(i+"_element_firstform_id_temp");
1285
- remove_add_(i+"_element_lastform_id_temp");
1286
-
1287
- break;
1288
-
1289
- }
1290
- case "type_address":
1291
- {
1292
- remove_add_(i+"_street1form_id_temp");
1293
- remove_add_(i+"_street2form_id_temp");
1294
- remove_add_(i+"_cityform_id_temp");
1295
- remove_add_(i+"_stateform_id_temp");
1296
- remove_add_(i+"_postalform_id_temp");
1297
- remove_add_(i+"_countryform_id_temp");
1298
-
1299
- break;
1300
-
1301
- }
1302
-
1303
-
1304
- case "type_checkbox":
1305
- case "type_radio":
1306
- {
1307
- is=true;
1308
- for(j=0; j<100; j++)
1309
- if(document.getElementById(i+"_elementform_id_temp"+j))
1310
- {
1311
- remove_add_(i+"_elementform_id_temp"+j);
1312
- }
1313
- /* if(document.getElementById(i+"_randomize").value=="yes")
1314
- choises_randomize(i);*/
1315
-
1316
- break;
1317
- }
1318
-
1319
- case "type_button":
1320
- {
1321
- for(j=0; j<100; j++)
1322
- if(document.getElementById(i+"_elementform_id_temp"+j))
1323
- {
1324
- remove_add_(i+"_elementform_id_temp"+j);
1325
- }
1326
- break;
1327
- }
1328
-
1329
- case "type_time":
1330
- {
1331
- if(document.getElementById(i+"_ssform_id_temp"))
1332
- {
1333
- remove_add_(i+"_ssform_id_temp");
1334
- remove_add_(i+"_mmform_id_temp");
1335
- remove_add_(i+"_hhform_id_temp");
1336
- }
1337
- else
1338
- {
1339
- remove_add_(i+"_mmform_id_temp");
1340
- remove_add_(i+"_hhform_id_temp");
1341
- }
1342
- break;
1343
-
1344
- }
1345
-
1346
- case "type_date":
1347
- {
1348
- remove_add_(i+"_elementform_id_temp");
1349
- remove_add_(i+"_buttonform_id_temp");
1350
- break;
1351
- }
1352
- case "type_date_fields":
1353
- {
1354
- remove_add_(i+"_dayform_id_temp");
1355
- remove_add_(i+"_monthform_id_temp");
1356
- remove_add_(i+"_yearform_id_temp");
1357
- break;
1358
- }
1359
- }
1360
- }
1361
- }
1362
-
1363
-
1364
- for(t=1;t<=form_view_max<?php echo $id ?>;t++)
1365
- {
1366
- if(document.getElementById('form_id_tempform_view'+t))
1367
- {
1368
- form_view_element=document.getElementById('form_id_tempform_view'+t);
1369
- xy=form_view_element.childNodes.length-2;
1370
- for(z=0;z<=xy;z++)
1371
- {
1372
- if(form_view_element.childNodes[z])
1373
- if(form_view_element.childNodes[z].nodeType!=3)
1374
- if(!form_view_element.childNodes[z].id)
1375
- {
1376
- del=true;
1377
- GLOBAL_tr=form_view_element.childNodes[z];
1378
- //////////////////////////////////////////////////////////////////////////////////////////
1379
- for (x=0; x < GLOBAL_tr.firstChild.childNodes.length; x++)
1380
- {
1381
- table=GLOBAL_tr.firstChild.childNodes[x];
1382
- tbody=table.firstChild;
1383
- if(tbody.childNodes.length)
1384
- del=false;
1385
- }
1386
-
1387
- if(del)
1388
- {
1389
- form_view_element.removeChild(form_view_element.childNodes[z]);
1390
- }
1391
-
1392
- }
1393
- }
1394
- }
1395
- }
1396
-
1397
-
1398
- for(i=1; i<=window.parent.form_view_max; i++)
1399
- if(document.getElementById('form_id_tempform_view'+i))
1400
- {
1401
- document.getElementById('form_id_tempform_view'+i).parentNode.removeChild(document.getElementById('form_id_tempform_view_img'+i));
1402
- document.getElementById('form_id_tempform_view'+i).removeAttribute('style');
1403
- }
1404
-
1405
- }
1406
-
1407
-
1408
- </script>
1409
- <?php
1410
- die();
1411
- }
1412
- function preview_formmaker()
1413
- {
1414
- global $wpdb;
1415
- if(isset($_GET['id']))
1416
- $getparams=$_GET['id'];
1417
- $query = "SELECT css FROM ".$wpdb->prefix."formmaker_themes WHERE id=".$getparams;
1418
- $css = $wpdb->get_var($query);
1419
- html_preview_formmaker($css);
1420
- }
1421
-
1422
-
1423
-
1424
-
1425
-
1426
-
1427
-
1428
-
1429
-
1430
-
1431
-
1432
-
1433
-
1434
- //////////////////////////////////////////////////////////////////////////////////////
1435
- //////////////////////////////////////////////////////////////////////////////////
1436
- ///////////////////////////////////////////////////////////////////////////////
1437
- ///////////////////////////////////////////////////////////////////////////////
1438
- /////////////////////////////////////////////////////////////////////////////////
1439
-
1440
-
1441
-
1442
- function Form_maker_Submits()
1443
- {
1444
- require_once("Submissions.html.php");
1445
- require_once("Submissions.php");
1446
- if(!function_exists('print_html_nav'))
1447
- require_once("nav_function/nav_html_func.php");
1448
-
1449
-
1450
- global $wpdb;
1451
- if(isset($_GET["task"]))
1452
- {
1453
- $task=$_GET["task"];
1454
- }
1455
- else
1456
- {
1457
- $task="show";
1458
- }
1459
- if(isset($_GET["id"]))
1460
- {
1461
- $id=$_GET["id"];
1462
- }
1463
- else
1464
- {
1465
- $id=0;
1466
- }
1467
- switch($task){
1468
- case "submits" :
1469
- show_submits();
1470
- break;
1471
- case "edit_submit" :
1472
- editSubmit($id);
1473
- break;
1474
- case "remove_submit" :
1475
- remov_submit($id);
1476
- show_submits();
1477
- break;
1478
- case "remov_cheched" :
1479
- remov_cheched_submission();
1480
- show_submits();
1481
- break;
1482
- case "appply_submit" :
1483
- save_submit($id);
1484
- editSubmit($id);
1485
- break;
1486
- case "save_submit" :
1487
- save_submit($id);
1488
- show_submits();
1489
- break;
1490
- case "cancel" :
1491
- show_submits();
1492
- break;
1493
-
1494
-
1495
- default:
1496
- show_submits();
1497
- }
1498
-
1499
-
1500
-
1501
-
1502
-
1503
-
1504
-
1505
- }
1506
- function Form_maker_Themes(){
1507
-
1508
- require_once("Theme_functions.php");
1509
- require_once("Themes_function.html.php");
1510
- if(!function_exists('print_html_nav'))
1511
- require_once("nav_function/nav_html_func.php");
1512
- global $wpdb;
1513
- if(isset($_GET["task"]))
1514
- {
1515
- $task=$_GET["task"];
1516
- }
1517
- else
1518
- {
1519
- $task="";
1520
- }
1521
- if(isset($_GET["id"]))
1522
- {
1523
- $id=$_GET["id"];
1524
- }
1525
- else
1526
- {
1527
- $id=0;
1528
- }
1529
- switch($task){
1530
- case 'theme':
1531
- show_theme();
1532
- break;
1533
- case 'default':
1534
- default_theme($id);
1535
- show_theme();
1536
- break;
1537
-
1538
- case 'add_theme':
1539
- add_theme();
1540
- break;
1541
-
1542
- case 'Save':
1543
- if($id)
1544
- {
1545
- apply_theme($id);
1546
- }
1547
- else
1548
- {
1549
- save_theme();
1550
- }
1551
-
1552
- show_theme();
1553
- break;
1554
-
1555
- case 'Apply':
1556
- if($id)
1557
- {
1558
- apply_theme($id);
1559
- }
1560
- else
1561
- {
1562
- save_theme();
1563
- $id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker_themes");
1564
- }
1565
-
1566
- edit_theme($id);
1567
- break;
1568
-
1569
- case 'edit_theme':
1570
- edit_theme($id);
1571
- break;
1572
-
1573
- case 'remove_theme':
1574
- remove_theme($id);
1575
- show_theme();
1576
- break;
1577
- default:
1578
- show_theme();
1579
- }
1580
-
1581
-
1582
-
1583
-
1584
- }
1585
-
1586
-
1587
-
1588
-
1589
- function Uninstall_Form_Maker()
1590
- {
1591
-
1592
- global $wpdb;
1593
- $base_name = plugin_basename('Form_maker');
1594
- $base_page = 'admin.php?page='.$base_name;
1595
- if(isset($_GET['mode'])){
1596
- $mode = trim($_GET['mode']);
1597
- }
1598
-
1599
- if(!empty($_POST['do'])) {
1600
-
1601
- if($_POST['do']=="UNINSTALL Form Maker") {
1602
- check_admin_referer('Form Maker_uninstall');
1603
- if(trim($_POST['uninstall_Form_yes']) == 'yes') {
1604
-
1605
- 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)!=''){
1606
-
1607
- echo '<div id="message" class="updated fade">';
1608
- echo '<p>';
1609
- echo "Table 'formmaker' has been deleted.";
1610
- $wpdb->query("DELETE FROM ".$wpdb->prefix."formmaker WHERE `id` NOT IN (".get_option('contact_form_forms').")");
1611
- echo '<font style="color:#000;">';
1612
- echo '</font><br />';
1613
- echo '</p>';
1614
- echo '<p>';
1615
- echo "Table 'formmaker_submits' has been deleted.";
1616
- $wpdb->query("DELETE FROM ".$wpdb->prefix."formmaker_submits WHERE `form_id` NOT IN (".get_option('contact_form_forms').")");
1617
- echo '<font style="color:#000;">';
1618
- echo '</font><br />';
1619
- echo '</p>';
1620
- echo '<p>';
1621
- echo "Table 'formmaker_views' has been deleted.";
1622
- $wpdb->query("DELETE FROM ".$wpdb->prefix."formmaker_views WHERE `form_id` NOT IN (".get_option('contact_form_forms').")");
1623
- echo '<font style="color:#000;">';
1624
- echo '</font><br />';
1625
- echo '</p>';
1626
- echo '<p>';
1627
- echo "Table 'formmaker_themes' has been deleted.";
1628
- $wpdb->query("DELETE FROM ".$wpdb->prefix."formmaker_themes WHERE `id` NOT IN (".get_option('contact_form_themes').")");
1629
- echo '<font style="color:#000;">';
1630
- echo '</font><br />';
1631
- echo '</p>';
1632
- echo '</div>';
1633
-
1634
-
1635
- }
1636
- else{
1637
-
1638
-
1639
- echo '<div id="message" class="updated fade">';
1640
- echo '<p>';
1641
- echo "Table 'formmaker' has been deleted.";
1642
- $wpdb->query("DROP TABLE ".$wpdb->prefix."formmaker");
1643
- echo '<font style="color:#000;">';
1644
- echo '</font><br />';
1645
- echo '</p>';
1646
- echo '<p>';
1647
- echo "Table 'formmaker_submits' has been deleted.";
1648
- $wpdb->query("DROP TABLE ".$wpdb->prefix."formmaker_submits");
1649
- echo '<font style="color:#000;">';
1650
- echo '</font><br />';
1651
- echo '</p>';
1652
- echo '<p>';
1653
- echo "Table 'formmaker_views' has been deleted.";
1654
- $wpdb->query("DROP TABLE ".$wpdb->prefix."formmaker_views");
1655
- echo '<font style="color:#000;">';
1656
- echo '</font><br />';
1657
- echo '</p>';
1658
- echo '<p>';
1659
- echo "Table 'formmaker_themes' has been deleted.";
1660
- $wpdb->query("DROP TABLE ".$wpdb->prefix."formmaker_themes");
1661
- echo '<font style="color:#000;">';
1662
- echo '</font><br />';
1663
- echo '</p>';
1664
- echo '</div>';
1665
- }
1666
- $mode = 'end-UNINSTALL';
1667
-
1668
- }
1669
- }
1670
- }
1671
-
1672
-
1673
- if(!isset($mode))
1674
- $mode='';
1675
- switch($mode) {
1676
-
1677
- case 'end-UNINSTALL':
1678
- $deactivate_url = wp_nonce_url('plugins.php?action=deactivate&amp;plugin='.plugin_basename(__FILE__), 'deactivate-plugin_'.plugin_basename(__FILE__)).'&form_maker_uninstall=1';
1679
- echo '<div class="wrap">';
1680
- echo '<div id="icon-Form_maker" class="icon32"><br /></div>';
1681
- echo '<h2>Uninstall Form Maker</h2>';
1682
- 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>';
1683
- echo '</div>';
1684
- break;
1685
- // Main Page
1686
- default:
1687
- ?>
1688
- <form method="post" action="<?php echo admin_url('admin.php?page=Uninstall_Form_Maker'); ?>">
1689
- <?php wp_nonce_field('Form Maker_uninstall'); ?>
1690
- <div class="wrap">
1691
- <div id="icon-Form_maker" class="icon32"><br /></div>
1692
- <h2><?php echo 'Uninstall Form Maker'; ?></h2>
1693
- <p>
1694
- <?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.'; ?>
1695
- </p>
1696
- <p style="color: red">
1697
- <strong><?php echo'WARNING:'; ?></strong><br />
1698
- <?php echo 'Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first.'; ?>
1699
- </p>
1700
- <p style="color: red">
1701
- <strong><?php echo 'The following WordPress Options/Tables will be DELETED:'; ?></strong><br />
1702
- </p>
1703
- <table class="widefat">
1704
- <thead>
1705
- <tr>
1706
- <th><?php echo 'WordPress Tables'; ?></th>
1707
- </tr>
1708
- </thead>
1709
- <tr>
1710
- <td valign="top">
1711
- <ol>
1712
- <?php
1713
- echo '<li>formmaker</li>'."\n";
1714
- echo '<li>formmaker_submits</li>'."\n";
1715
- echo '<li>formmaker_views</li>'."\n";
1716
- echo '<li>formmaker_themes</li>'."\n";
1717
-
1718
- ?>
1719
- </ol>
1720
- </td>
1721
- </tr>
1722
- </table>
1723
- <p style="text-align: center;">
1724
- <?php echo 'Do you really want to uninstall Form Maker?'; ?><br /><br />
1725
- <input type="checkbox" name="uninstall_Form_yes" value="yes" />&nbsp;<?php echo 'Yes'; ?><br /><br />
1726
- <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.'; ?>')" />
1727
- </p>
1728
- </div>
1729
- </form>
1730
- <?php
1731
- } // End switch($mode)
1732
-
1733
- }
1734
-
1735
-
1736
-
1737
- require_once("update_sql.php");
1738
-
1739
-
1740
-
1741
-
1742
-
1743
- function formmaker_activate()
1744
- {
1745
- include 'setup_sql.php';
1746
- set_form_maker_sql();
1747
-
1748
- }
1749
-
1750
-
1751
- if(get_bloginfo ('version')>=3.1){
1752
-
1753
- add_action('plugins_loaded', 'formmaker_chech_update');
1754
-
1755
- }
1756
- else{
1757
- formmaker_chech_update();
1758
- }
1759
-
1760
-
1761
-
1762
-
1763
-
1764
-
1765
- register_activation_hook( __FILE__, 'formmaker_activate' );
1766
-
1767
-
1768
- function sp_form_deactiv(){
1769
- echo $_GET['form_maker_uninstall'];
1770
-
1771
- if(isset($_GET['form_maker_uninstall']))
1772
- {
1773
- if($_GET['form_maker_uninstall']==1){
1774
- delete_option('formmaker_cureent_version');
1775
- }
1776
- }
1777
- }
1778
-
1779
- register_deactivation_hook( __FILE__, 'sp_form_deactiv' );
1
+ <?php
2
+ /*
3
+ Plugin Name: Form Maker
4
+ Plugin URI: http://web-dorado.com/products/form-maker-wordpress.html
5
+ Version: 1.5.2
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;
14
+ font-weight:normal;
15
+ color:#000000;
16
+ width:100% ;
17
+ }
18
+
19
+ .wdform_tbody1
20
+ {
21
+ float:left;
22
+ }
23
+ .wdform_table2
24
+ {
25
+ padding-right:50px !important;
26
+ float:left;
27
+ border-spacing: 0px;
28
+ border-collapse:separate !important;
29
+ }
30
+ #edit_main_table label
31
+ {
32
+ line-height: 19px;
33
+ }
34
+ #edit_main_table td
35
+ {
36
+ padding-right: 5px;
37
+ }
38
+ .time_box
39
+ {
40
+ border-width:1px;
41
+ margin: 0px;
42
+ padding: 0px;
43
+ text-align:right;
44
+ width:30px;
45
+ vertical-align:middle
46
+ }
47
+
48
+ .mini_label
49
+ {
50
+ font-size:10px;
51
+ font-family: 'Lucida Grande', Tahoma, Arial, Verdana, sans-serif;
52
+ }
53
+
54
+ .ch_rad_label
55
+ {
56
+ display:inline;
57
+ margin-left:5px;
58
+ margin-right:15px;
59
+ float:none;
60
+ }
61
+
62
+ .label
63
+ {
64
+ border:none;
65
+ }
66
+
67
+
68
+ .td_am_pm_select
69
+ {
70
+ padding-left:5;
71
+ }
72
+
73
+ .am_pm_select
74
+ {
75
+ height: 16px;
76
+ margin:0;
77
+ padding:0
78
+ }
79
+
80
+ .input_deactive
81
+ {
82
+ color:#999999;
83
+ font-style:italic;
84
+ border-width:1px;
85
+ margin: 0px;
86
+ padding: 0px
87
+ }
88
+
89
+ .input_active
90
+ {
91
+ color:#000000;
92
+ font-style:normal;
93
+ border-width:1px;
94
+ margin: 0px;
95
+ padding: 0px
96
+ }
97
+
98
+ .required
99
+ {
100
+ border:none;
101
+ color:red
102
+ }
103
+
104
+ .captcha_img
105
+ {
106
+ border-width:0px;
107
+ margin: 0px;
108
+ padding: 0px;
109
+ cursor:pointer;
110
+
111
+
112
+ }
113
+
114
+ .captcha_refresh
115
+ {
116
+ width:30px;
117
+ height:30px;
118
+ border-width:0px;
119
+ margin: 0px;
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
127
+ {
128
+ height:20px;
129
+ border-width:1px;
130
+ margin: 0px;
131
+ padding: 0px;
132
+ vertical-align:middle;
133
+ }
134
+
135
+ .file_upload
136
+ {
137
+ border-width:1px;
138
+ margin: 0px;
139
+ padding: 0px
140
+ }
141
+
142
+ .page_deactive
143
+ {
144
+ border:1px solid black;
145
+ padding:4px 7px 4px 7px;
146
+ margin:4px;
147
+ cursor:pointer;
148
+ background-color:#DBDBDB;
149
+ }
150
+
151
+ .page_active
152
+ {
153
+ border:1px solid black;
154
+ padding:4px 7px 4px 7px;
155
+ margin:4px;
156
+ cursor:pointer;
157
+ background-color:#878787;
158
+ }
159
+
160
+ .page_percentage_active
161
+ {
162
+ padding:0px;
163
+ margin:0px;
164
+ border-spacing: 0px;
165
+ height:30px;
166
+ line-height:30px;
167
+ background-color:yellow;
168
+ border-radius:30px;
169
+ font-size:15px;
170
+ float:left;
171
+ text-align: right !important;
172
+ }
173
+
174
+
175
+ .page_percentage_deactive
176
+ {
177
+ height:30px;
178
+ line-height:30px;
179
+ padding:5px;
180
+ border:1px solid black;
181
+ width:100%;
182
+ background-color:white;
183
+ border-radius:30px;
184
+ text-align: left !important;
185
+ }
186
+
187
+ .page_numbers
188
+ {
189
+ font-size:11px;
190
+ }
191
+
192
+ .phone_area_code
193
+ {
194
+ width:50px;
195
+ }
196
+
197
+ .phone_number
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;
284
+ padding:0 .6em !important;
285
+ margin:5px 15px 2px !important;
286
+ -moz-border-radius:3px !important;
287
+ -khtml-border-radius:3px !important;
288
+ -webkit-border-radius:3px !important;
289
+ border-radius:3px !important;
290
+ }
291
+ .updated p, .error p
292
+ {
293
+ font-size: 12px !important;
294
+ margin:.5em 0 !important;
295
+ line-height:1 !important;
296
+ padding:2px !important;
297
+ }
298
+ .updated, .error
299
+ {
300
+ margin:5px 0 15px !important;
301
+ }
302
+ .updated{
303
+ background-color:#ffffe0 !important;
304
+ border-color:#e6db55 !important;
305
+ }
306
+ .error
307
+ {
308
+ background-color:#ffebe8 !important;
309
+ border-color:#c00 !important;
310
+ }
311
+ error a
312
+ {
313
+ color:#c00 !important;
314
+ }
315
+ .error
316
+ {
317
+ line-height:22px !important;
318
+ margin:0 15px !important;
319
+ padding:3px 5px !important;
320
+ }
321
+ .error-div
322
+ {
323
+ display:block !important;
324
+ line-height:36px !important;
325
+ float:right !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')) {
487
+ die('Access Denied');
488
+ }
489
+ }
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>
522
+ <ul id="countries_list" style="list-style:none; padding:0px">
523
+ </ul>
524
+
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')) {
738
+ die('Access Denied');
739
+ }
740
+ }
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')) {
1153
+ die('Access Denied');
1154
+ }
1155
+ }
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&amp;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"/>&nbsp;<?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
+ require_once("update_sql.php");
1424
+ function formmaker_activate() {
1425
+ include 'setup_sql.php';
1426
+ set_form_maker_sql();
1427
+ }
1428
+
1429
+ if (get_bloginfo('version') >= 3.1) {
1430
+ add_action('plugins_loaded', 'formmaker_chech_update');
1431
+ }
1432
+ else {
1433
+ formmaker_chech_update();
1434
+ }
1435
+ register_activation_hook(__FILE__, 'formmaker_activate');
1436
+ function sp_form_deactiv() {
1437
+ echo esc_html($_GET['form_maker_uninstall']);
1438
+ if (isset($_GET['form_maker_uninstall'])) {
1439
+ if (esc_html($_GET['form_maker_uninstall']) == 1) {
1440
+ delete_option('formmaker_cureent_version');
1441
+ }
1442
+ }
1443
+ }
1444
+
1445
+ register_deactivation_hook(__FILE__, 'sp_form_deactiv');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Submissions.html.php CHANGED
@@ -1,882 +1,868 @@
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
- {
7
- $label_titles_copy=$label_titles;
8
- global $wpdb;
9
-
10
- $n=count($rows);
11
- $m=count($labels);
12
- $group_id_s= array();
13
-
14
- $rows_ord_none=array();
15
-
16
- if(count($rows_ord)>0 and $m)
17
- for($i=0; $i <count($rows_ord) ; $i++)
18
- {
19
-
20
- $row = $rows_ord[$i];
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
- display:table-cell !important;
35
- }
36
- </style>
37
- <script type="text/javascript">
38
- function tableOrdering( order, dir, task )
39
- {
40
- var form = document.admin_form;
41
- form.filter_order2.value = order;
42
- form.filter_order_Dir2.value = dir;
43
- submitform( task );
44
- }
45
- function ordering(name,as_or_desc)
46
- {
47
- document.getElementById('asc_or_desc').value=as_or_desc;
48
- document.getElementById('order_by').value=name;
49
- document.getElementById('admin_form').submit();
50
- }
51
- function renderColumns()
52
- {
53
- allTags=document.getElementsByTagName('*');
54
-
55
- for(curTag in allTags)
56
- {
57
- if(typeof(allTags[curTag].className)!="undefined")
58
- if(allTags[curTag].className.indexOf('_fc')>0)
59
- {
60
- curLabel=allTags[curTag].className.replace('_fc','');
61
- if(document.forms.admin_form.hide_label_list.value.indexOf('@'+curLabel+'@')>=0)
62
- allTags[curTag].style.display = 'none';
63
- else
64
- allTags[curTag].style.display = '';
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
- document.forms.admin_form.hide_label_list.value=document.forms.admin_form.hide_label_list.value.replace('@'+label+'@','');
81
- if(document.forms.admin_form.hide_label_list.value=='') document.getElementById('ChBAll').checked=true;
82
-
83
- if(!(ChB.checked))
84
- {
85
- document.forms.admin_form.hide_label_list.value+='@'+label+'@';
86
- document.getElementById('ChBAll').checked=false;
87
- }
88
- renderColumns();
89
- }
90
-
91
- function toggleChBDiv(b)
92
- {
93
- if(b)
94
- {
95
- sizes=window.getSize().size;
96
- document.getElementById("sbox-overlay").style.width=sizes.x+"px";
97
- document.getElementById("sbox-overlay").style.height=sizes.y+"px";
98
- document.getElementById("ChBDiv").style.left=Math.floor((sizes.x-350)/2)+"px";
99
-
100
- document.getElementById("ChBDiv").style.display="block";
101
- document.getElementById("sbox-overlay").style.display="block";
102
- }
103
- else
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
- <?php
113
- if(isset($labels))
114
- {
115
- $templabels=array_merge(array('submitid','submitdate','submitterip'),$labels_id);
116
- $label_titles=array_merge(array('ID','Submit date', "Submitter's IP Address"),$label_titles);
117
- }
118
- ?>
119
-
120
- if(ChBAll.checked)
121
- {
122
- document.forms.admin_form.hide_label_list.value='';
123
-
124
- for(i=0; i<=ChBAll.form.length; i++)
125
- if(typeof(ChBAll.form[i])!="undefined")
126
- if(ChBAll.form[i].type=="checkbox")
127
- ChBAll.form[i].checked=true;
128
- }
129
- else
130
- {
131
- document.forms.admin_form.hide_label_list.value='@<?php echo implode($templabels,'@@') ?>@';
132
-
133
- for(i=0; i<=ChBAll.form.length; i++)
134
- if(typeof(ChBAll.form[i])!="undefined")
135
- if(ChBAll.form[i].type=="checkbox")
136
- ChBAll.form[i].checked=false;
137
- }
138
-
139
- renderColumns();
140
- }
141
-
142
- function remove_all()
143
- {
144
- document.getElementById('startdate').value='';
145
- document.getElementById('enddate').value='';
146
- document.getElementById('ip_search').value='';
147
- <?php
148
- $n=count($rows);
149
-
150
- for($i=0; $i < count($labels) ; $i++)
151
- {
152
- echo "document.getElementById('".$form_id.'_'.$labels_id[$i]."_search').value='';
153
- ";
154
- }
155
- ?>
156
- }
157
-
158
- function show_hide_filter()
159
- {
160
- if(document.getElementById('fields_filter').style.display=="none")
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
- function submit_del(href_in)
171
- {
172
- document.getElementById('admin_form').action=href_in;
173
- document.getElementById('admin_form').submit();
174
- }
175
- <!--
176
- function submitbutton(pressbutton) {
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
- thickDims = function() {
211
- var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
212
-
213
- w = (tbWidth && tbWidth < W - 90) ? tbWidth : W - 200;
214
- h = (tbHeight && tbHeight < H - 60) ? tbHeight : H - 200;
215
-
216
- if ( tbWindow.size() ) {
217
- tbWindow.width(w).height(h);
218
- $('#TB_iframeContent').width(w).height(h - 27);
219
- tbWindow.css({'margin-left': '-' + parseInt((w / 2),10) + 'px'});
220
- if ( typeof document.body.style.maxWidth != 'undefined' )
221
- tbWindow.css({'top':(H-h)/2,'margin-top':'0'});
222
- }
223
- };
224
-
225
- thickDims();
226
- $(window).resize( function() { thickDims() } );
227
-
228
- $('a.thickbox-preview').click( function() {
229
- tb_click.call(this);
230
-
231
- var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text;
232
-
233
- if ( tbWidth = href.match(/&tbWidth=[0-9]+/) )
234
- tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
235
- else
236
- tbWidth = $(window).width() - 90;
237
-
238
- if ( tbHeight = href.match(/&tbHeight=[0-9]+/) )
239
- tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
240
- else
241
- tbHeight = $(window).height() - 60;
242
-
243
- if ( alink.length ) {
244
- url = alink.attr('href') || '';
245
- text = alink.attr('title') || '';
246
- link = '&nbsp; <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
247
- } else {
248
- text = $(this).attr('title') || '';
249
- link = '&nbsp; <span class="tb-theme-preview-link">' + text + '</span>';
250
- }
251
-
252
- $('#TB_title').css({'background-color':'#222','color':'#dfdfdf'});
253
- $('#TB_closeAjaxWindow').css({'float':'left'});
254
- $('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
255
-
256
- $('#TB_iframeContent').width('100%');
257
- thickDims();
258
-
259
- return false;
260
- } );
261
-
262
- // Theme details
263
- $('.theme-detail').click(function () {
264
- $(this).siblings('.themedetaildiv').toggle();
265
- return false;
266
- });
267
-
268
- });
269
-
270
-
271
- </script>
272
-
273
- <style>
274
-
275
- .reports
276
- {
277
- border:1px solid #DEDEDE;
278
- border-radius:11px;
279
- background-color:#F0F0F0;
280
- text-align:center;
281
- width:100px;
282
- }
283
-
284
- .bordered
285
- {
286
- border-radius:8px
287
- }
288
-
289
- .simple_table
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
- <br />
321
- <div style="text-align:center;">
322
- <input type="button" onclick="toggleChBDiv(false);" value="Done" />
323
- </div>
324
- </form>
325
- </div>
326
-
327
- <?php } ?>
328
-
329
- <form action="admin.php?page=Form_maker_Submits" style="overflow-x: scroll;" method="post" id="admin_form" name="admin_form">
330
- <input type="hidden" name="option" value="com_formmaker">
331
- <input type="hidden" name="task" value="submits">
332
- <input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if(isset($_POST['asc_or_desc'])){ echo $_POST['asc_or_desc'];} ?>">
333
- <input type="hidden" name="order_by" id="order_by" value="<?php if(isset($_POST['order_by'])){ echo $_POST['order_by']; } ?>">
334
- <br />
335
- <table width="95%">
336
-
337
- <tr>
338
- <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
339
- <a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank" style="color:red; text-decoration:none;">
340
- <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
341
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
342
- </a>
343
- </div></td>
344
- </tr>
345
-
346
- <tr style="line-height:inherit !important;" >
347
- <td align="left" width="300"> Select a form:
348
- <select name="form_id" id="form_id" onchange="if(document.getElementById('startdate'))remove_all();document.admin_form.submit();">
349
- <option value="0" selected="selected"> Select a Form </option>
350
- <?php
351
- $option='com_formmaker';
352
-
353
- // $form_id=$mainframe-> getUserStateFromRequest( $option.'form_id', 'form_id','id','cmd' );
354
- if( $forms)
355
- for($i=0, $n=count($forms); $i < $n ; $i++)
356
-
357
- {
358
- $form = $forms[$i];
359
-
360
-
361
- if($form_id==$form->id)
362
- {
363
- echo "<option value='".$form->id."' selected='selected'>".$form->title."</option>";
364
- $form_title=$form->title;
365
- }
366
- else
367
- echo "<option value='".$form->id."' >".$form->title."</option>";
368
- }
369
- ?>
370
- </select>
371
- </td>
372
- <?php if(isset($form_id) and $form_id>0): ?>
373
- <td class="reports" ><strong>Entries</strong><br /><?php echo $total_entries; ?></td>
374
- <td class="reports"><strong>Views</strong><br /><?php echo $total_views ?></td>
375
- <td class="reports"><strong>Conversion Rate</strong><br /><?php if($total_views) echo round((($total_entries/$total_views)*100),2).'%'; else echo '0%' ?></td>
376
- <td style="font-size:36px;text-align:center;line-height: initial;">
377
- <?php echo $form_title ?>
378
- </td>
379
- <td style="text-align:right;" width="300">
380
- Export to
381
- <input type="button" value="CSV" onclick="window.location='<?php echo admin_url( 'admin-ajax.php?action=formmakergeneretecsv' ); ?>&form_id=<?php echo $form_id; ?>'" />&nbsp;
382
- <input type="button" value="XML" onclick="window.location='<?php echo admin_url( 'admin-ajax.php?action=formmakergeneretexml' ); ?>&form_id=<?php echo $form_id; ?>'" />
383
- </td>
384
-
385
- </tr>
386
-
387
- <tr>
388
-
389
- <td colspan=5>
390
- <br />
391
- <input type="hidden" name="hide_label_list" value="<?php echo $lists['hide_label_list']; ?>"/>
392
- <img src="<?php echo plugins_url("images/filter_show.png",__FILE__) ?>" width="40" style="vertical-align:bottom; cursor:pointer" onclick="show_hide_filter()" title="Search by fields" id="filter_img" />
393
- <input type="button" onclick="this.form.submit();" value="Go" />
394
- <input type="button" onclick="remove_all();this.form.submit();" value="Reset" />
395
- </td>
396
- <td align="right">
397
- <br /><br />
398
- <?php if(isset($labels)) echo '<input type="button" onclick="toggleChBDiv(true)" value="Add/Remove Columns" />'; ?>
399
- </td>
400
- </tr>
401
-
402
- <?php else: echo '<td><br /><br /><br /></td></tr>'; endif; ?>
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
- <?php
609
-
610
-
611
- $k = 1 - $k;
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
- <?php
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
- <?php
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
- </table>
697
- <?php
698
- }
699
- }
700
- ?>
701
-
702
-
703
-
704
- <input type="hidden" name="boxchecked" value="0">
705
-
706
- <input type="hidden" name="filter_order2" value="<?php echo $lists['order']; ?>" />
707
-
708
- <input type="hidden" name="filter_order_Dir2" value="<?php echo $lists['order_Dir']; ?>" />
709
-
710
- </form>
711
-
712
- <script>
713
- <?php if($ka_fielderov_search){?>
714
- document.getElementById('fields_filter').style.display='';
715
- <?php
716
- }?>
717
- </script>
718
-
719
- <?php
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
- var form = document.adminForm;
743
-
744
- if (pressbutton == 'cancel_submit')
745
- {
746
- submitform( pressbutton );
747
- return;
748
- }
749
-
750
- submitform( pressbutton );
751
- }
752
- function submitform(pressbutton)
753
- {
754
-
755
- document.getElementById('adminForm').action=document.getElementById('adminForm').action+'&task='+pressbutton;
756
- document.getElementById('adminForm').submit();
757
- }
758
- </script>
759
- <table width="90%">
760
- <tbody><tr>
761
- <td width="100%"><h2>Edit Submission</h2></td>
762
- <td align="right"><input type="button" onclick="submitbutton('save_submit')" value="Save" class="button-secondary action"> </td>
763
- <td align="right"><input type="button" onclick="submitbutton('appply_submit')" value="Apply" class="button-secondary action"> </td>
764
- <td align="right"><input type="button" onclick="submitbutton('cancel')" value="Cancel" class="button-secondary action"> </td>
765
- </tr>
766
- </tbody></table>
767
- <form action="admin.php?page=Form_maker_Submits&id=<?php echo $_GET['id']; ?>" method="post" id="adminForm" name="adminForm">
768
- <table class="admintable">
769
- <tr>
770
- <td class="key">
771
- <label for="ID">ID: </label>
772
- </td>
773
- <td >
774
- <?php echo $rows[0]->group_id;?>
775
- </td>
776
- </tr>
777
-
778
- <tr>
779
- <td class="key">
780
- <label for="Date">Date:
781
- </label>
782
- </td>
783
- <td >
784
- <?php echo $rows[0]->date;?>
785
- </td>
786
- </tr>
787
- <tr>
788
- <td class="key">
789
- <label for="IP">IP:</label>
790
- </td>
791
- <td >
792
- <?php echo $rows[0]->ip;?>
793
- </td>
794
- </tr>
795
-
796
- <?php
797
- foreach($labels_id as $key => $label_id)
798
- {
799
- 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')
800
- {
801
- $element_value='';
802
- foreach($rows as $row)
803
- {
804
- if($row->element_label==$label_id)
805
- {
806
- $element_value= $row->element_value;
807
- break;
808
- }
809
- }
810
- if($labels_type[$key]!='type_checkbox')
811
- echo ' <tr>
812
- <td class="key">
813
- <label for="title">
814
- '.$labels_name[$key].'
815
- </label>
816
- </td>
817
- <td >
818
- <input type="text" name="submission_'.$label_id.'" id="submission_'.$label_id.'" value="'.str_replace("*@@url@@*",'',$element_value).'" size="80" />
819
- </td>
820
- </tr>
821
- ';
822
- else
823
- {
824
- $choices = explode('***br***',$element_value);
825
- $choices = array_slice($choices,0, count($choices)-1);
826
- echo ' <tr>
827
- <td class="key" rowspan="'.count($choices).'">
828
- <label for="title">
829
- '.$labels_name[$key].'
830
- </label>
831
- </td>';
832
- foreach($choices as $choice_key => $choice)
833
- echo '
834
- <td >
835
- <input type="text" name="submission_'.$label_id.'_'.$choice_key.'" id="submission_'.$label_id.'_'.$choice_key.'" value="'.$choice.'" size="80" />
836
- </td>
837
- </tr>
838
- ';
839
- }
840
- }
841
- }
842
-
843
- ?>
844
- </table>
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
- <?php
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 = '&nbsp; <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
224
+ } else {
225
+ text = $(this).attr('title') || '';
226
+ link = '&nbsp; <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&nbsp;&nbsp;&nbsp;&nbsp;
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; ?>'"/>&nbsp;
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
- if(!current_user_can('manage_options')) {
4
- die('Access Denied');
5
- }
6
- function show_submits(){
7
-
8
-
9
- global $wpdb;
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
- ///////////////////////////////////////////////////////////////////////////// PAGE NAVI ///////////////////////////////////////////////////
21
-
22
-
23
-
24
- $sort["default_style"]="manage-column column-autor sortable desc";
25
- if(isset($_POST['page_number']))
26
- {
27
-
28
- if($_POST['asc_or_desc'])
29
- {
30
- if(isset($_POST['order_by'])){
31
- $sort["sortid_by"]=$_POST['order_by'];
32
- }
33
- if($_POST['asc_or_desc']==1)
34
- {
35
- $sort["custom_style"]="manage-column column-title sorted asc";
36
- $sort["1_or_2"]="2";
37
- $order="ORDER BY ".$sort["sortid_by"]." ASC";
38
- }
39
- else
40
- {
41
- $sort["custom_style"]="manage-column column-title sorted desc";
42
- $sort["1_or_2"]="1";
43
- $order="ORDER BY ".$sort["sortid_by"]." DESC";
44
- }
45
- }
46
- else{
47
- $sort["sortid_by"]="";
48
- }
49
-
50
- if($_POST['page_number'])
51
- {
52
- $limit=($_POST['page_number']-1)*20;
53
- }
54
- else
55
- {
56
- $limit=0;
57
- }
58
- }
59
- else
60
- {
61
- $sort["sortid_by"]="";
62
- $limit=0;
63
- }
64
-
65
-
66
-
67
-
68
-
69
- ///////////////////////////////////////////////////////////////// END PAGE NAVI ///////////////////////////////////////////////
70
-
71
-
72
-
73
-
74
- $query = "SELECT id, title FROM ".$wpdb->prefix."formmaker WHERE `id` NOT IN(".get_option('contact_form_forms',0).") order by title";
75
- $forms = $wpdb->get_results($query);
76
-
77
- //$task = JRequest::getCmd('task');
78
- if(isset($_POST['form_id'])){
79
- $form_id=$_POST['form_id'];
80
- if($form_id){
81
-
82
- $query = "SELECT id FROM ".$wpdb->prefix."formmaker WHERE id=".$form_id;
83
- $exists = $wpdb->get_var($query);
84
-
85
-
86
- }
87
- else{
88
- $exists ="";
89
- }
90
-
91
- }
92
- else{
93
- $exists ="";
94
- }
95
-
96
- if(!$exists)
97
- $form_id=0;
98
- if(isset($_POST['order_by']) && $_POST['order_by']!="")
99
- $filter_order= $_POST['order_by'];
100
- else
101
- $filter_order='id';
102
- if(isset($_POST['asc_or_desc'])){
103
- if($_POST['asc_or_desc']==1){
104
- $filter_order_Dir= " ASC";
105
- }
106
- else{
107
- $filter_order_Dir=" DESC";
108
- }
109
- }
110
- else{
111
- $filter_order_Dir="";
112
- }
113
- if(isset($_POST['search_submits'])){
114
- $search_submits = $_POST['search_submits'];
115
- $search_submits =strtolower( $search_submits );
116
- }
117
- else{
118
- $search_submits = "";
119
- }
120
- if(isset($_POST['ip_search'])){
121
- $ip_search = $_POST['ip_search'];
122
- $ip_search = strtolower( $ip_search );
123
- }
124
- else{
125
- $ip_search= "";
126
- }
127
- $where = array();
128
-
129
- $where_choices = array();
130
- if(isset($_POST['startdate']))
131
- {
132
- $lists['startdate']= $_POST['startdate'];
133
- }
134
- else
135
- {
136
- $lists['startdate']="";
137
- }
138
-
139
- if(isset($_POST['enddate']))
140
- {
141
- $lists['enddate']= $_POST['enddate'];
142
- }
143
- else
144
- {
145
- $lists['enddate']="";
146
- }
147
-
148
- if(isset($_POST['hide_label_list']))
149
- {
150
- $lists['hide_label_list']= $_POST['hide_label_list'];
151
- }
152
- else
153
- {
154
- $lists['hide_label_list']="";
155
- }
156
- if ( $search_submits ) {
157
- $where[] = 'element_label LIKE "%'.$search_submits.'%"';
158
- }
159
-
160
- if ( $ip_search ) {
161
- $where[] = 'ip LIKE "%'.$ip_search.'%"';
162
- }
163
-
164
- if($lists['startdate']!='')
165
- $where[] =" `date`>='".$lists['startdate']." 00:00:00' ";
166
- if($lists['enddate']!='')
167
- $where[] =" `date`<='".$lists['enddate']." 23:59:59' ";
168
- /*if ($form_id=="")
169
- if($forms)
170
- $form_id=$forms[0]->id;*/
171
-
172
- $where[] = 'form_id="'.$form_id.'"';
173
-
174
- $where = ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' );
175
-
176
- $orderby = ' ';
177
- if ($filter_order == 'id' or $filter_order == 'title' or $filter_order == 'mail')
178
- {
179
-
180
- $orderby = ' ORDER BY `date` desc';
181
- }
182
- else
183
- if(!strpos($filter_order,"_field"))
184
- {
185
- $orderby = ' ORDER BY '.$filter_order .' '. $filter_order_Dir .'';
186
- }
187
- $query = "SELECT * FROM ".$wpdb->prefix."formmaker_submits". $where;
188
- $rows = $wpdb->get_results($query);
189
- $query = "SELECT * FROM ".$wpdb->prefix."formmaker_submits WHERE form_id='". $form_id."'";
190
-
191
- $rowsc = $wpdb->get_results($query);
192
-
193
- //$orderby=$order;
194
-
195
- $where_labels=array();
196
- $n=count($rowsc);
197
- $labels= array();
198
- for($i=0; $i < $n ; $i++)
199
- {
200
- $row = $rowsc[$i];
201
- if(!in_array($row->element_label, $labels))
202
- {
203
- array_push($labels, $row->element_label);
204
- }
205
- }
206
- $sorted_labels_type= array();
207
- $sorted_labels_id= array();
208
- $sorted_labels= array();
209
- $label_titles=array();
210
- if($labels)
211
- {
212
-
213
- $label_id= array();
214
- $label_order= array();
215
- $label_order_original= array();
216
- $label_type= array();
217
- $this_form=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$form_id."'");
218
-
219
- $label_all = explode('#****#',$this_form->label_order);
220
- $label_all = array_slice($label_all,0, count($label_all)-1);
221
-
222
-
223
-
224
- foreach($label_all as $key => $label_each)
225
- {
226
- $label_id_each=explode('#**id**#',$label_each);
227
- array_push($label_id, $label_id_each[0]);
228
-
229
- $label_order_each=explode('#**label**#', $label_id_each[1]);
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 = $_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
- $cids = implode( ',', $cid );
370
- // Create sql statement
371
-
372
- $query = 'DELETE FROM '.$wpdb->prefix.'formmaker_submits'.' WHERE group_id IN ( '. $cids .' )' ;
373
- if($wpdb->query($query)){
374
- ?>
375
- <div class="updated"><p><strong>Items Deleted.</strong></p></div>
376
- <?php
377
- }
378
- else
379
- {
380
- ?>
381
- <div id="message" class="error"><p>Form Maker Submissions Not Deleted</p></div>
382
- <?php
383
- }
384
-
385
- }
386
- else
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
- global $wpdb;
405
-
406
- $query = "SELECT * FROM ".$wpdb->prefix."formmaker_submits WHERE group_id=".$id;
407
-
408
- $rows = $wpdb->get_results($query);
409
- $form=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id=".$rows[0]->form_id);
410
- $label_id= array();
411
- $label_order_original= array();
412
- $label_type= array();
413
-
414
- $label_all = explode('#****#',$form->label_order);
415
- $label_all = array_slice($label_all,0, count($label_all)-1);
416
-
417
-
418
-
419
- foreach($label_all as $key => $label_each)
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
- function save_submit($id){
450
-
451
-
452
- global $wpdb;
453
- $id = $_POST['id'];
454
- $date = $_POST['date'];
455
- $ip = $_POST['ip'];
456
- $form_id=$wpdb->get_var("SELECT form_id FROM ".$wpdb->prefix."formmaker_submits WHERE group_id='".$id."'");
457
- $form =$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$form_id."'");
458
- $label_id= array();
459
- $label_order_original= array();
460
- $label_type= array();
461
-
462
- $label_all = explode('#****#',$form->label_order);
463
- $label_all = array_slice($label_all,0, count($label_all)-1);
464
-
465
-
466
-
467
- foreach($label_all as $key => $label_each)
468
- {
469
- $label_id_each=explode('#**id**#',$label_each);
470
- array_push($label_id, $label_id_each[0]);
471
-
472
- $label_oder_each=explode('#**label**#', $label_id_each[1]);
473
- array_push($label_order_original, $label_oder_each[0]);
474
- array_push($label_type, $label_oder_each[1]);
475
-
476
-
477
-
478
- }
479
-
480
- foreach($label_id as $key => $label_id_1)
481
- {
482
- $element_value=$_POST["submission_".$label_id_1];
483
- if(isset($_POST["submission_".$label_id_1]))
484
- {
485
- $query = "SELECT id FROM ".$wpdb->prefix."formmaker_submits WHERE group_id='".$id."' AND element_label='".$label_id_1."'";
486
- $result=$wpdb->get_var($query);
487
- if($label_type[$key]=='type_file_upload')
488
- if($element_value)
489
- $element_value=$element_value."*@@url@@*";
490
-
491
- if($result)
492
- {
493
- //$query = "UPDATE ".$wpdb->prefix."formmaker_submits SET `element_value`='".$element_value."' WHERE group_id='".$id."' AND element_label='".$label_id_1."'";
494
- $wpdb->update(
495
- $wpdb->prefix."formmaker_submits",
496
- array(
497
- 'element_value' => $element_value,
498
- ),
499
- array( 'group_id' => $id,
500
- 'element_label' => $label_id_1),
501
- array(
502
- '%s',
503
- ),
504
- array( '%d',
505
- '%s' )
506
- );
507
- }
508
- else
509
- {
510
- $wpdb->insert(
511
- $wpdb->prefix."formmaker_submits",
512
- array(
513
- 'form_id' => $form_id,
514
- 'element_label' => $label_id_1,
515
- 'element_value' => $element_value,
516
- 'group_id' => $id,
517
- 'date' => $date,
518
- 'ip' => $ip
519
- ),
520
- array(
521
- '%d',
522
- '%s',
523
- '%s',
524
- '%d',
525
- '%s',
526
- '%s'
527
- )
528
- );
529
- }
530
- }
531
- else
532
- {
533
- $element_value_ch=$_POST["submission_".$label_id_1.'_0'];
534
- if(isset($_POST["submission_".$label_id_1.'_0']))
535
- {
536
- for($z=0; $z<21; $z++ )
537
- {
538
- $element_value_ch=$_POST["submission_".$label_id_1.'_'.$z];
539
- if(isset($element_value_ch))
540
- $element_value=$element_value.$element_value_ch.'***br***';
541
- else
542
- break;
543
- }
544
- $query = "SELECT id FROM ".$wpdb->prefix."formmaker_submits WHERE group_id='".$id."' AND element_label='".$label_id_1."'";
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,181 +1,149 @@
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
-
10
- html_add_theme($def_theme);
11
- }
12
-
13
- function show_theme(){
14
- global $wpdb;
15
- $order="";
16
- $sort["default_style"]="manage-column column-autor sortable desc";
17
- if(isset($_POST['page_number']))
18
- {
19
-
20
- if($_POST['asc_or_desc'])
21
- {
22
- $sort["sortid_by"]=$_POST['order_by'];
23
- if($_POST['asc_or_desc']==1)
24
- {
25
- $sort["custom_style"]="manage-column column-title sorted asc";
26
- $sort["1_or_2"]="2";
27
- $order="ORDER BY ".$sort["sortid_by"]." ASC";
28
- }
29
- else
30
- {
31
- $sort["custom_style"]="manage-column column-title sorted desc";
32
- $sort["1_or_2"]="1";
33
- $order="ORDER BY ".$sort["sortid_by"]." DESC";
34
- }
35
- }
36
-
37
- if($_POST['page_number'])
38
- {
39
- $limit=($_POST['page_number']-1)*20;
40
- }
41
- else
42
- {
43
- $limit=0;
44
- }
45
- }
46
- else
47
- {
48
- $sort["sortid_by"]="";
49
- $limit=0;
50
- }
51
- if(isset($_POST['search_events_by_title'])){
52
- $search_tag=$_POST['search_events_by_title'];
53
- }
54
-
55
- else
56
- {
57
- $search_tag="";
58
- }
59
- if ( $search_tag ) {
60
- $where= ' WHERE title LIKE "%'.$search_tag.'%"';
61
- }
62
- else{
63
- $where="";
64
- }
65
- if($order=="")
66
- $order="ORDER BY `title` ASC";
67
-
68
- if(!$where)
69
- $where=" WHERE `id` NOT IN (".get_option('contact_form_themes',0).")";
70
- else
71
- $where.=" AND `id` NOT IN (".get_option('contact_form_themes',0).")";
72
- // get the total number of records
73
- $query = "SELECT COUNT(*) FROM ".$wpdb->prefix."formmaker_themes". $where;
74
- $total = $wpdb->get_var($query);
75
- $pageNav['total'] =$total;
76
- $pageNav['limit'] = $limit/20+1;
77
- $query = "SELECT * FROM ".$wpdb->prefix."formmaker_themes".$where." ". $order." "." LIMIT ".$limit.",20";
78
- $rows = $wpdb->get_results($query);
79
- html_show_theme($rows, $pageNav, $sort);
80
- }
81
-
82
- function save_theme(){
83
- global $wpdb;
84
- $save_or_no= $wpdb->insert($wpdb->prefix.'formmaker_themes', array(
85
- 'id' => NULL,
86
- 'title' => $_POST["title"],
87
- 'css' => stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST["css"])),
88
- ),
89
- array(
90
- '%d',
91
- '%s',
92
- '%s'
93
- )
94
- );
95
- if(!$save_or_no)
96
- {
97
- ?>
98
- <div class="updated"><p><strong><?php _e('Error. Please install plugin again'); ?></strong></p></div>
99
- <?php
100
- return false;
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 apply_theme($id){
110
- global $wpdb;
111
- $save_or_no= $wpdb->update($wpdb->prefix.'formmaker_themes', array(
112
- 'title' => $_POST["title"],
113
- 'css' =>stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST["css"])),
114
-
115
- ),
116
- array('id'=>$id),
117
- array(
118
- '%s',
119
- '%s'
120
- )
121
- );
122
- ?>
123
- <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
124
- <?php
125
-
126
- return true;
127
-
128
- }
129
-
130
- function edit_theme($id){
131
- global $wpdb;
132
- $row=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker_themes WHERE id='".$id."'");
133
-
134
- html_edit_theme($row, $id);
135
- }
136
-
137
- function remove_theme($id){
138
- global $wpdb;
139
- if($wpdb->get_var("SELECT `default` FROM ".$wpdb->prefix."formmaker_themes WHERE id='".$id."'"))
140
- {
141
- ?>
142
- <div class="updated"><p><strong><?php _e("You can't delete default theme"); ?></strong></p></div>
143
- <?php
144
- return;
145
- }
146
- $sql_remov_tag="DELETE FROM ".$wpdb->prefix."formmaker_themes WHERE id='".$id."'";
147
- if(!$wpdb->query($sql_remov_tag))
148
- {
149
- ?>
150
- <div id="message" class="error"><p>Spider Video Player Theme Not Deleted</p></div>
151
- <?php
152
-
153
- }
154
- else{
155
- ?>
156
- <div class="updated"><p><strong><?php _e('Item Deleted.' ); ?></strong></p></div>
157
- <?php
158
- }
159
- }
160
-
161
- function default_theme($id){
162
- global $wpdb;
163
-
164
- $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).")");
165
- for($i=0;$i<count($ids_for);$i++)
166
- {
167
- $savedd=$wpdb->update($wpdb->prefix.'formmaker_themes', array(
168
- 'default' =>0,
169
- ),
170
- array('id'=>$ids_for[$i]),
171
- array( '%d' )
172
- );
173
- }
174
- $savedd=$wpdb->update($wpdb->prefix.'formmaker_themes', array(
175
- 'default' =>1,
176
- ),
177
- array('id'=>$id),
178
- array( '%d' )
179
- );
180
- }
181
  ?>
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
- 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
- {
14
- alert('Set Theme title');
15
- return;
16
- }
17
-
18
- submitform( pressbutton );
19
- }
20
- function submitform(pressbutton)
21
- {
22
- document.getElementById("adminForm").action=document.getElementById("adminForm").action+"&task="+pressbutton;
23
- document.getElementById("adminForm").submit();
24
- }
25
-
26
- </script>
27
-
28
- <table width="90%">
29
- <thead>
30
- <tr>
31
- <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
32
- <a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank" style="color:red; text-decoration:none;">
33
- <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
34
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
35
- </a>
36
- </div></td>
37
- </tr>
38
- </thead>
39
- <tr>
40
- <td width="100%"><h2>Adding New Theme</h2></td>
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
- <form action="admin.php?page=Form_maker_Themes" method="post" id="adminForm" name="adminForm" >
47
- <table class="admintable">
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
- global $wpdb;
85
- ?>
86
- <script language="javascript">
87
- function ordering(name,as_or_desc)
88
- {
89
- document.getElementById('asc_or_desc').value=as_or_desc;
90
- document.getElementById('order_by').value=name;
91
- document.getElementById('admin_form').submit();
92
- }
93
- function doNothing() {
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
- <td style="width:80px">
120
- <?php echo "<h2>".'Themes'. "</h2>"; ?>
121
- </td>
122
- <td style="width:90px; text-align:right;"><p class="submit" style="padding:0px; text-align:left"><input type="button" value="Add a Theme" name="custom_parametrs" onclick="window.location.href='admin.php?page=Form_maker_Themes&task=add_theme'" /></p></td>
123
- <td style="text-align:right;font-size:16px;padding:20px; padding-right:50px">
124
-
125
- </td>
126
- <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:90%">
127
- <a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank" style="color:red; text-decoration:none;">
128
- <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
129
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
130
- </a>
131
- </div></td>
132
- </tr>
133
- </table>
134
- <?php
135
- if(isset($_POST['serch_or_not'])) {if($_POST['serch_or_not']=="search"){ $serch_value=$_POST['search_events_by_title']; }else{$serch_value="";}}else{$serch_value="";}
136
- $serch_fields='<div class="alignleft actions" style="width:180px;">
137
- <label for="search_events_by_title" style="font-size:14px">Title: </label>
138
- <input type="text" name="search_events_by_title" value="'.$serch_value.'" id="search_events_by_title" onchange="clear_serch_texts()">
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
- print_html_nav($pageNav['total'],$pageNav['limit'],$serch_fields);
146
-
147
- ?>
148
- <table class="wp-list-table widefat fixed pages" style="width:95%">
149
- <thead>
150
- <TR>
151
- <th scope="col" id="id" class="<?php if($sort["sortid_by"]=="id") echo $sort["custom_style"]; else echo $sort["default_style"]; ?>" style=" width:120px" ><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>
152
- <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>
153
- <th>Default</th>
154
- <th style="width:80px">Edit</th>
155
- <th style="width:80px">Delete</th>
156
- </TR>
157
- </thead>
158
- <tbody>
159
- <?php for($i=0; $i<count($rows);$i++){ ?>
160
- <tr>
161
- <td><?php echo $rows[$i]->id; ?></td>
162
- <td><a href="admin.php?page=Form_maker_Themes&task=edit_theme&id=<?php echo $rows[$i]->id?>"><?php echo $rows[$i]->title; ?></a></td>
163
- <td><a <?php if(!$rows[$i]->default) echo 'style="color:#C00"'; ?> href="admin.php?page=Form_maker_Themes&task=default&id=<?php echo $rows[$i]->id?>"><?php if($rows[$i]->default) echo "Default"; else echo "Not Default"; ?></a></td>
164
- <td><a href="admin.php?page=Form_maker_Themes&task=edit_theme&id=<?php echo $rows[$i]->id?>">Edit</a></td>
165
- <td><a href="admin.php?page=Form_maker_Themes&task=remove_theme&id=<?php echo $rows[$i]->id?>">Delete</a></td>
166
- </tr>
167
- <?php } ?>
168
- </tbody>
169
- </table>
170
- <input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if(isset($_POST['asc_or_desc'])) echo $_POST['asc_or_desc'];?>" />
171
- <input type="hidden" name="order_by" id="order_by" value="<?php if(isset($_POST['order_by'])) echo $_POST['order_by'];?>" />
172
-
173
- <?php
174
- ?>
175
-
176
-
177
-
178
- </form>
179
- <?php
180
-
181
- }
182
-
183
- function html_edit_theme($row, $id){
184
-
185
- ?>
186
-
187
-
188
- <script>
189
-
190
- function submitbutton(pressbutton) {
191
-
192
- var form = document.adminForm;
193
-
194
- if (pressbutton == 'cancel_themes')
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
- </script>
214
-
215
-
216
-
217
-
218
-
219
-
220
-
221
-
222
-
223
-
224
-
225
-
226
-
227
-
228
-
229
-
230
-
231
-
232
-
233
-
234
- <table width="90%">
235
- <thead>
236
- <tr>
237
- <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
238
- <a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank" style="color:red; text-decoration:none;">
239
- <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
240
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
241
- </a>
242
- </div></td>
243
- </tr>
244
- </thead>
245
- <tr>
246
- <td width="100%"><h2>Theme <?php echo htmlspecialchars($row->title)?></h2></td>
247
- <td align="right"><input type="button" onclick="submitbutton('Save')" value="Save" class="button-secondary action"> </td>
248
- <td align="right"><input type="button" onclick="submitbutton('Apply')" value="Apply" class="button-secondary action"> </td>
249
- <td align="right"><input type="button" onclick="window.location.href='admin.php?page=Form_maker_Themes'" value="Cancel" class="button-secondary action"> </td>
250
- </tr>
251
- </table>
252
- <form action="admin.php?page=Form_maker_Themes&id=<?php echo $id; ?>" method="post" id="adminForm" name="adminForm" >
253
- <table class="admintable">
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
- function cheched($row,$y)
287
- {
288
- if($row==$y)
289
- {
290
- echo'checked="checked"';
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&nbsp;&nbsp;&nbsp;&nbsp;
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&nbsp;&nbsp;&nbsp;&nbsp;
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&nbsp;&nbsp;&nbsp;&nbsp;
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
@@ -1,54 +1,54 @@
1
- .field_buttons
2
- {
3
- background-color:#00AAF1;
4
- margin:1px;
5
- border-radius:0px;
6
- padding:5px;
7
- height:75px;
8
- width:87px;
9
- cursor:pointer;
10
- }
11
- #edit_div>table>tr
12
- {
13
- vertical-align:top;
14
- }
15
-
16
- #edit_div>table>tr>td
17
- {
18
- border-bottom:1px dotted #D1C8C8;
19
- padding-bottom:10px;
20
- }
21
-
22
- .field_buttons:hover
23
- {
24
- background-color:#0E83EB;
25
- }
26
-
27
- .element_toolbar
28
- {
29
- margin:0px;
30
- padding:0px;
31
- background-color:#F0F0F0
32
- }
33
-
34
- .element_toolbar img
35
- {
36
- margin:2px;
37
- }
38
- .no_spacing
39
- {
40
- padding-right:10px !important;
41
- float:left;
42
- border-spacing: 0px;
43
- }
44
-
45
- .toolbar_padding
46
- {
47
- padding-right: 20px;
48
- }
49
-
50
- .page_toolbar
51
- {
52
- width:30px;
53
- cursor:pointer;
54
  }
1
+ .field_buttons
2
+ {
3
+ background-color:#00AAF1;
4
+ margin:1px;
5
+ border-radius:0px;
6
+ padding:2px;
7
+ height:75px;
8
+ width:87px;
9
+ cursor:pointer;
10
+ }
11
+ #edit_div>table>tr
12
+ {
13
+ vertical-align:top;
14
+ }
15
+
16
+ #edit_div>table>tr>td
17
+ {
18
+ border-bottom:1px dotted #D1C8C8;
19
+ padding-bottom:10px;
20
+ }
21
+
22
+ .field_buttons:hover
23
+ {
24
+ background-color:#0E83EB;
25
+ }
26
+
27
+ .element_toolbar
28
+ {
29
+ margin:0px;
30
+ padding:0px;
31
+ background-color:#F0F0F0
32
+ }
33
+
34
+ .element_toolbar img
35
+ {
36
+ margin:2px;
37
+ }
38
+ .no_spacing
39
+ {
40
+ padding-right:10px !important;
41
+ float:left;
42
+ border-spacing: 0px;
43
+ }
44
+
45
+ .toolbar_padding
46
+ {
47
+ padding-right: 20px;
48
+ }
49
+
50
+ .page_toolbar
51
+ {
52
+ width:30px;
53
+ cursor:pointer;
54
  }
css/style_for_map.css CHANGED
@@ -1,691 +1,691 @@
1
- .d_close-wrapper {
2
- height: 0;
3
- line-height: 0;
4
- position: relative;
5
- }
6
-
7
- #d_close {
8
- height: 20px;
9
- position: absolute;
10
- right: 12px;
11
- top: -5px;
12
- width: 20px;
13
- background-color: #eee;
14
- }
15
-
16
- #d_close .close {
17
- margin: 5px;
18
- opacity: 0.7;
19
- }
20
-
21
- #d_close:hover {
22
- background-color: #ccc;
23
- }
24
-
25
- #d_close:hover .close {
26
- opacity: 1;
27
- }
28
-
29
- .dir-tm {
30
- direction: ltr;
31
- margin: 0 29px 0 44px;
32
- }
33
- .dir-tm .kd-button {
34
- min-width: 50px;
35
- padding: 0;
36
- width: 50px;
37
- }
38
- .dir-tm .kd-button:focus {
39
- -moz-transition: all 0s ease 0s;
40
- border-color: #4D90FE;
41
- outline: medium none;
42
- z-index: 2;
43
- }
44
-
45
- .kd-buttonbar {
46
- overflow: hidden;
47
- }
48
- .kd-buttonbar .kd-button {
49
- float: left;
50
- margin: 0 0 0 16px;
51
- position: relative;
52
- z-index: 1;
53
- }
54
- .kd-buttonbar .kd-combobutton {
55
- float: left;
56
- margin: 0 0 0 16px;
57
- position: relative;
58
- z-index: 1;
59
- }
60
- .kd-buttonbar .kd-button:hover {
61
- z-index: 2;
62
- }
63
- .kd-buttonbar .kd-button:first-child {
64
- margin-left: 0;
65
- }
66
- .kd-buttonbar .kd-button.small {
67
- min-width: 34px;
68
- padding: 0;
69
- width: 34px;
70
- }
71
- .kd-button.small {
72
- min-width: 34px;
73
- padding: 0;
74
- width: 34px;
75
- }
76
- .kd-buttonbar .kd-button.left {
77
- border-radius: 2px 0 0 2px;
78
- }
79
- .kd-button.left {
80
- border-radius: 2px 0 0 2px;
81
- }
82
- .kd-buttonbar .kd-button-left {
83
- border-radius: 2px 0 0 2px;
84
- }
85
- .kd-button-left {
86
- border-radius: 2px 0 0 2px;
87
- }
88
- .kd-buttonbar .kd-button.left:hover {
89
- border-right: 1px solid #C6C6C6;
90
- }
91
- .kd-button.left:hover {
92
- border-right: 1px solid #C6C6C6;
93
- }
94
- .kd-buttonbar .kd-button-left:hover {
95
- border-right: 1px solid #C6C6C6;
96
- }
97
- .kd-button-left:hover {
98
- border-right: 1px solid #C6C6C6;
99
- }
100
- .kd-buttonbar .kd-button.mid {
101
- border-radius: 0 0 0 0;
102
- margin-left: -1px;
103
- }
104
- .kd-button.mid {
105
- border-radius: 0 0 0 0;
106
- margin-left: -1px;
107
- }
108
- .kd-buttonbar .kd-button-mid {
109
- border-radius: 0 0 0 0;
110
- margin-left: -1px;
111
- }
112
- .kd-button-mid {
113
- border-radius: 0 0 0 0;
114
- margin-left: -1px;
115
- }
116
- .kd-buttonbar .kd-button.right {
117
- border-radius: 0 2px 2px 0;
118
- margin-left: -1px;
119
- }
120
- .kd-button.right {
121
- border-radius: 0 2px 2px 0;
122
- margin-left: -1px;
123
- }
124
- .kd-buttonbar .kd-button-right {
125
- border-radius: 0 2px 2px 0;
126
- margin-left: 5px;
127
- }
128
- .kd-button-right {
129
- border-radius: 0 2px 2px 0;
130
- margin-left: -1px;
131
- }
132
- .kd-buttonbar .kd-button.right:hover {
133
- border-left: 1px solid #C6C6C6;
134
- }
135
- .kd-button.right:hover {
136
- border-left: 1px solid #C6C6C6;
137
- }
138
- .kd-buttonbar .kd-button-right:hover {
139
- border-left: 1px solid #C6C6C6;
140
- }
141
- .kd-button-right:hover {
142
- border-left: 1px solid #C6C6C6;
143
- }
144
- .kd-buttonbar-right .kd-button {
145
- float: right;
146
- margin-left: 0;
147
- margin-right: 16px;
148
- }
149
- .kd-buttonbar-right .kd-combobutton {
150
- float: right;
151
- margin-left: 0;
152
- margin-right: 16px;
153
- }
154
- .kd-buttonbar-right .kd-button:first-child {
155
- margin-right: 0;
156
- }
157
- .kd-buttonbar-right .kd-button.left {
158
- margin-right: -1px;
159
- }
160
- .kd-buttonbar-right .kd-button-left {
161
- margin-right: -1px;
162
- }
163
- .kd-buttonbar-right .kd-button.mid {
164
- margin-left: 0;
165
- margin-right: -1px;
166
- }
167
- .kd-buttonbar-right .kd-button-mid {
168
- margin-left: 0;
169
- margin-right: -1px;
170
- }
171
- .kd-buttonbar-right .kd-button.right {
172
- margin-left: 0;
173
- margin-right: 0;
174
- }
175
- .kd-buttonbar-right .kd-button-right {
176
- margin-left: 0;
177
- margin-right: 0;
178
- }
179
- .kd-button {
180
- -moz-transition: all 0.218s ease 0s;
181
- background-color: #F5F5F5;
182
- background-image: -moz-linear-gradient(center top , #F5F5F5, #F1F1F1);
183
- border: 1px solid rgba(0, 0, 0, 0.1);
184
- border-radius: 2px 2px 2px 2px;
185
- color: #444444;
186
- display: inline-block;
187
- font-size: 85%;
188
- font-weight: bold;
189
- height: 20px;
190
- line-height: 20px;
191
- min-width: 54px;
192
- padding: 10px 0 0 !important;
193
- text-align: center;
194
- overflow: visible;
195
- }
196
-
197
-
198
- .msie-7 .kd-button {
199
- overflow: visible;
200
- }
201
- .msie-8 .kd-button {
202
- overflow: visible;
203
- }
204
- .kd-button.mini {
205
- height: 17px;
206
- line-height: 17px;
207
- min-width: 0;
208
- }
209
- .kd-button:hover {
210
- -moz-transition: all 0s ease 0s;
211
- background-color: #F8F8F8;
212
- background-image: -moz-linear-gradient(center top , #F8F8F8, #F1F1F1);
213
- border: 1px solid #C6C6C6;
214
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
215
- color: #333333;
216
- text-decoration: none;
217
- }
218
- .kd-button:active {
219
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) inset;
220
- }
221
- .kd-button:active:hover {
222
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) inset;
223
- }
224
- .kd-button:active:focus {
225
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) inset;
226
- }
227
- .kd-button.selected {
228
- background-color: #DDDDDD;
229
- background-image: -moz-linear-gradient(center top , #DDDDDD, #D0D0D0);
230
- border: 1px solid #CCCCCC;
231
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
232
- color: #333333;
233
- }
234
- .kd-button.selected:hover {
235
- background-color: #EEEEEE;
236
- background-image: -moz-linear-gradient(center top , #EEEEEE, #E0E0E0);
237
- border: 1px solid #CCCCCC;
238
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
239
- color: #333333;
240
- }
241
- .kd-button.selected:active {
242
- background-color: #EEEEEE;
243
- background-image: -moz-linear-gradient(center top , #EEEEEE, #E0E0E0);
244
- border: 1px solid #CCCCCC;
245
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
246
- color: #333333;
247
- }
248
- .kd-button.disabled {
249
- background: none repeat scroll 0 0 #FFFFFF;
250
- border: 1px solid rgba(0, 0, 0, 0.05);
251
- color: #B8B8B8;
252
- cursor: default;
253
- pointer-events: none;
254
- }
255
- .kd-button.disabled:hover {
256
- background: none repeat scroll 0 0 #FFFFFF;
257
- border: 1px solid rgba(0, 0, 0, 0.05);
258
- color: #B8B8B8;
259
- cursor: default;
260
- pointer-events: none;
261
- }
262
- .kd-button.disabled:active {
263
- background: none repeat scroll 0 0 #FFFFFF;
264
- border: 1px solid rgba(0, 0, 0, 0.05);
265
- color: #B8B8B8;
266
- cursor: default;
267
- pointer-events: none;
268
- }
269
- .kd-button:disabled {
270
- background: none repeat scroll 0 0 #FFFFFF;
271
- border: 1px solid rgba(0, 0, 0, 0.05);
272
- color: #B8B8B8;
273
- cursor: default;
274
- pointer-events: none;
275
- }
276
- .kd-button-submit {
277
- background-color: #4D90FE;
278
- background-image: -moz-linear-gradient(center top , #4D90FE, #4787ED);
279
- border: 1px solid #3079ED;
280
- color: #FFFFFF;
281
- }
282
- .kd-button-submit:hover {
283
- background-color: #357AE8;
284
- background-image: -moz-linear-gradient(center top , #4D90FE, #357AE8);
285
- border: 1px solid #2F5BB7;
286
- color: #FFFFFF;
287
- }
288
- .kd-button-share {
289
- background-color: #3D9400;
290
- background-image: -moz-linear-gradient(center top , #3D9400, #398A00);
291
- border: 1px solid #29691D;
292
- color: #FFFFFF;
293
- text-shadow: 0 1px rgba(0, 0, 0, 0.1);
294
- }
295
- .kd-button-share:hover {
296
- background-color: #368200;
297
- background-image: -moz-linear-gradient(center top , #3D9400, #368200);
298
- border: 1px solid #2D6200;
299
- color: #FFFFFF;
300
- text-shadow: 0 1px rgba(0, 0, 0, 0.3);
301
- }
302
-
303
- .ml-loading-img {
304
- background-image: url("assets/css/images/my_location_button_spinner.gif");
305
- height: 10px !important;
306
- width: 10px !important;
307
- }
308
-
309
- .dir-tm .kd-button img {
310
- /* margin: 0; */
311
- opacity: 0.667;
312
- vertical-align: 2px;
313
- }
314
-
315
- .kd-button img {
316
- display: inline-block;
317
- margin: -3px 0 0;
318
- opacity: 0.55;
319
- vertical-align: middle;
320
- }
321
-
322
- .dir-tm-d {
323
- background: url("assets/css/images/directions.png") no-repeat scroll 0 -96px transparent !important;
324
- height: 12px;
325
- width: 15px;
326
- }
327
-
328
- .dir-tm-w {
329
- background: url("assets/css/images/directions.png") no-repeat scroll 0 -489px transparent !important;
330
- height: 16px;
331
- width: 10px;
332
- }
333
-
334
- #d_close .close {
335
- margin: 5px;
336
- opacity: 0.7;
337
- }
338
-
339
- .close {
340
- opacity: 0.7;
341
- overflow: hidden;
342
- }
343
-
344
- .close {
345
- background: url("assets/css/images/utilbuttons.png") no-repeat scroll -108px -26px transparent !important;
346
- height: 10px;
347
- width: 10px;
348
- }
349
-
350
- img {
351
- -moz-user-select: none;
352
- border: 0 none;
353
- margin: 0;
354
- padding: 0;
355
- }
356
-
357
- .kd-button img {
358
- display: inline-block;
359
- margin: -3px 0 0;
360
- opacity: 0.55;
361
- vertical-align: middle;
362
- }
363
-
364
- .dir-reverse {
365
- background: url("assets/css/images/directions.png") no-repeat scroll -10px -489px transparent !important;
366
- height: 12px;
367
- width: 10px;
368
- margin-top: -15px !important;
369
- }
370
- .dir-clear {
371
- clear: both;
372
- font-size: 1px;
373
- height: 0;
374
- line-height: 0;
375
- }
376
-
377
- #dir_wps {
378
- margin-top: 15px;
379
- position: relative;
380
- }
381
-
382
- .dir-wp {
383
- position: relative;
384
- }
385
- .dir-wp .dir-wp-hl {
386
- margin-left: 8px;
387
- margin-right: 26px;
388
- padding: 3px 0;
389
- }
390
- .d-hl .dir-wp-hl {
391
- background: none repeat scroll 0 0 #FFF1A8;
392
- border-radius: 3px 3px 3px 3px;
393
- }
394
- .dir-wp .dir-m {
395
- height: 24px;
396
- left: 15px;
397
- position: absolute;
398
- top: 5px;
399
- width: 24px;
400
- }
401
- .dir-input {
402
- margin: 0 3px 0 36px;
403
- padding: 1px 6px;
404
- text-align: left;
405
- }
406
- .dir-input .wp {
407
- height: 18px;
408
- line-height: 16px;
409
- margin: -1px -6px;
410
- padding: 3px 5px;
411
- width: 95%;
412
- }
413
- .wp:focus + .ml-input {
414
- background-color: #999999;
415
- border-color: #7F7F7F;
416
- border-radius: 1px 1px 1px 1px;
417
- color: #FFFFFF;
418
- width: auto;
419
- }
420
- .kd-input-text-wrp:hover input {
421
- border-color: #A0A0A0 #B9B9B9 #B9B9B9;
422
- border-right: 1px solid #B9B9B9;
423
- border-style: solid;
424
- border-width: 1px;
425
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
426
- }
427
- .kd-input-text-wrp input:focus {
428
- border: 1px solid #4D90FE;
429
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) inset;
430
- outline: medium none;
431
- }
432
- .kd-input-text {
433
- background-color: #FFFFFF;
434
- border-color: #C0C0C0 #D9D9D9 #D9D9D9;
435
- border-radius: 1px 1px 1px 1px;
436
- border-right: 1px solid #D9D9D9;
437
- border-style: solid;
438
- border-width: 1px;
439
- padding-left: 8px;
440
- }
441
- .kd-input-text:hover {
442
- border-color: #A0A0A0 #B9B9B9 #B9B9B9;
443
- border-right: 1px solid #B9B9B9;
444
- border-style: solid;
445
- border-width: 1px;
446
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
447
- }
448
- .kd-input-text:focus {
449
- border: 1px solid #4D90FE;
450
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) inset;
451
- outline: medium none;
452
- }
453
- .ml-input {
454
- background-color: white;
455
- border: 1px solid white;
456
- color: #666666;
457
- font-size: 85%;
458
- font-weight: bold;
459
- height: 15px;
460
- left: 46px;
461
- line-height: 15px;
462
- padding: 1px 6px;
463
- position: absolute;
464
- top: 6px;
465
- }
466
- .dir-ml-img {
467
- display: inline;
468
- height: 9px;
469
- margin-right: 3px;
470
- width: 9px;
471
- }
472
- .dir-rev-wrapper {
473
- height: 0;
474
- line-height: 0;
475
- position: relative;
476
- }
477
- #dir_rev {
478
- cursor: pointer;
479
- padding: 5px;
480
- position: absolute;
481
- right: 8px;
482
- top: -20px;
483
- z-index: 1;
484
- }
485
- #dir_rev .kd-button {
486
- height: 16px;
487
- min-width: 18px;
488
- padding: 0;
489
- width: 18px;
490
- }
491
- #dir_controls {
492
- margin: 0 51px 0 44px;
493
- }
494
- .d_links {
495
- font-size: 100%;
496
- text-align: left;
497
- }
498
- .dir-sub-cntn {
499
- height: 29px;
500
- position: relative;
501
- text-align: left;
502
- }
503
- #d_sub {
504
- height: 22px;
505
- line-height: 16px;
506
- margin: 2px 0 0;
507
- padding: 2px 5px !important;
508
- position: absolute;
509
- /*right: 0;*/
510
- text-transform: uppercase;
511
- }
512
-
513
- #print_sub {
514
- height: 22px;
515
- line-height: 16px;
516
- margin: 2px 0 0 125px;
517
- padding: 2px 5px !important;
518
- position: absolute;
519
- /*right: 0;*/
520
- text-transform: uppercase;
521
- }
522
-
523
- /** Override styles */
524
- .google-map-placeholder img {
525
- max-width: none !important;
526
- max-height: none !important;
527
- background-color: transparent !important;
528
- padding: 0px !important;
529
- margin: 0px !important;
530
- visibility: inherit !important;
531
- }
532
-
533
- .google-map-placeholder div {
534
- overflow: none !important;
535
- }
536
- /** Override styles */
537
-
538
- .google-map-placeholder .bubble-content h4 {
539
- text-align: left !important;
540
- font-size: 14px !important;
541
- border: none !important;
542
- background: none !important;
543
- color: #111111 !important;
544
- font-family: Arial,Tahoma,Verdana !important;
545
- font-weight: bold !important;
546
- line-height: 120% !important;
547
- margin: 0 0 8px !important;
548
- padding: 0 !important;
549
- }
550
-
551
- .google-map-placeholder .bubble-content p {
552
- margin: 0 !important;
553
- padding: 0 !important;
554
- }
555
-
556
- .google-map-placeholder .bubble-content hr {
557
- margin-bottom: 5px !important;
558
- margin-top: 10px !important;
559
- }
560
-
561
- .google-map-placeholder .bubble-content {
562
- font-family: Arial,Tahoma,Verdana !important;
563
- font-size: 13px !important;
564
- line-height: 160% !important;
565
- padding: 0 !important;
566
- margin: 0 !important;
567
- }
568
-
569
- .google-map-placeholder .bubble-content p {
570
- font-family: Arial,Tahoma,Verdana !important;
571
- font-size: 13px !important;
572
- line-height: 160% !important;
573
- color: #555555 !important;
574
- }
575
-
576
- .google-map-placeholder hr {
577
- background-color: #CCCCCC !important;
578
- border: 0 none !important;
579
- height: 1px !important;
580
- }
581
-
582
- .direction-controls-placeholder,
583
- .direction-controls-placeholder input {
584
- font-family: Arial,Tahoma,Verdana !important;
585
- font-size: 12px !important;
586
- line-height: 160% !important;
587
- }
588
-
589
- .direction-controls-placeholder #d_options {
590
- color: #22222 !important;
591
- }
592
-
593
- .direction-controls-placeholder #d_options input {
594
- width: 5% !important;
595
- }
596
-
597
- .bubble-content a {
598
- color: #1982D1 !important;
599
- text-decoration: none !important;
600
- font-weight: normal !important;
601
- }
602
-
603
- .bubble-content a:focus,
604
- .bubble-content a:active,
605
- .bubble-content a:hover {
606
- text-decoration: underline !important;
607
- }
608
-
609
- .direction-controls-placeholder input[type="text"] {
610
- box-shadow: none !important;
611
- color: #000 !important;
612
- }
613
-
614
- .direction-controls-placeholder .d_error {
615
- background-color: pink !important;
616
- }
617
-
618
- .direction-controls-placeholder img {
619
- max-width: 100% !important;
620
- }
621
-
622
- .direction-controls-placeholder input {
623
- margin: 0 !important;
624
- }
625
-
626
- .rendered-directions-placeholder table {
627
- border-collapse: separate !important;
628
- border-spacing: 0 !important;
629
- }
630
-
631
- .rendered-directions-placeholder table,
632
- .rendered-directions-placeholder tr {
633
- border: none !important;
634
- }
635
-
636
- .rendered-directions-placeholder table {
637
- margin: 0 0 10px !important;
638
- }
639
-
640
- .rendered-directions-placeholder table.adp-fullwidth {
641
- border: none !important;
642
- }
643
-
644
- .rendered-directions-placeholder table td {
645
- font-family: Arial,Tahoma,Verdana !important;
646
- font-size: 12px !important;
647
- line-height: 160% !important;
648
- vertical-align:middle !important;
649
- padding: 2px 3px 4px 5px !important;
650
- border: none !important;
651
- }
652
-
653
- .rendered-directions-placeholder table.adp-directions td {
654
- border-top: 1px solid #DDDDDD !important;
655
- }
656
-
657
- .rendered-directions-placeholder table td.adp-listheader {
658
- font-family: Arial,Tahoma,Verdana !important;
659
- font-size: 13px !important;
660
- font-weight: bold !important;
661
- color: blue;
662
- }
663
-
664
-
665
- .rendered-directions-placeholder div.adp-legal {
666
- font-size: 12px !important;
667
- }
668
-
669
- .rendered-directions-placeholder div.adp-list {
670
- border: none !important;
671
- }
672
-
673
-
674
- .rendered-directions-placeholder div.warnbox-content {
675
- font-family: Arial,Tahoma,Verdana !important;
676
- font-size: 13px !important;
677
- }
678
-
679
- .rendered-directions-placeholder div.adp-summary span {
680
- color: blue !important;
681
- font-family: Arial,Tahoma,Verdana !important;
682
- font-size: 13px !important;
683
- font-weight: bold !important;
684
- }
685
-
686
- .map-loading {
687
- background: url("assets/css/images/loading.gif") no-repeat 0 0 transparent !important;
688
- height: 100px;
689
- width: 100px;
690
-
691
  }
1
+ .d_close-wrapper {
2
+ height: 0;
3
+ line-height: 0;
4
+ position: relative;
5
+ }
6
+
7
+ #d_close {
8
+ height: 20px;
9
+ position: absolute;
10
+ right: 12px;
11
+ top: -5px;
12
+ width: 20px;
13
+ background-color: #eee;
14
+ }
15
+
16
+ #d_close .close {
17
+ margin: 5px;
18
+ opacity: 0.7;
19
+ }
20
+
21
+ #d_close:hover {
22
+ background-color: #ccc;
23
+ }
24
+
25
+ #d_close:hover .close {
26
+ opacity: 1;
27
+ }
28
+
29
+ .dir-tm {
30
+ direction: ltr;
31
+ margin: 0 29px 0 44px;
32
+ }
33
+ .dir-tm .kd-button {
34
+ min-width: 50px;
35
+ padding: 0;
36
+ width: 50px;
37
+ }
38
+ .dir-tm .kd-button:focus {
39
+ -moz-transition: all 0s ease 0s;
40
+ border-color: #4D90FE;
41
+ outline: medium none;
42
+ z-index: 2;
43
+ }
44
+
45
+ .kd-buttonbar {
46
+ overflow: hidden;
47
+ }
48
+ .kd-buttonbar .kd-button {
49
+ float: left;
50
+ margin: 0 0 0 16px;
51
+ position: relative;
52
+ z-index: 1;
53
+ }
54
+ .kd-buttonbar .kd-combobutton {
55
+ float: left;
56
+ margin: 0 0 0 16px;
57
+ position: relative;
58
+ z-index: 1;
59
+ }
60
+ .kd-buttonbar .kd-button:hover {
61
+ z-index: 2;
62
+ }
63
+ .kd-buttonbar .kd-button:first-child {
64
+ margin-left: 0;
65
+ }
66
+ .kd-buttonbar .kd-button.small {
67
+ min-width: 34px;
68
+ padding: 0;
69
+ width: 34px;
70
+ }
71
+ .kd-button.small {
72
+ min-width: 34px;
73
+ padding: 0;
74
+ width: 34px;
75
+ }
76
+ .kd-buttonbar .kd-button.left {
77
+ border-radius: 2px 0 0 2px;
78
+ }
79
+ .kd-button.left {
80
+ border-radius: 2px 0 0 2px;
81
+ }
82
+ .kd-buttonbar .kd-button-left {
83
+ border-radius: 2px 0 0 2px;
84
+ }
85
+ .kd-button-left {
86
+ border-radius: 2px 0 0 2px;
87
+ }
88
+ .kd-buttonbar .kd-button.left:hover {
89
+ border-right: 1px solid #C6C6C6;
90
+ }
91
+ .kd-button.left:hover {
92
+ border-right: 1px solid #C6C6C6;
93
+ }
94
+ .kd-buttonbar .kd-button-left:hover {
95
+ border-right: 1px solid #C6C6C6;
96
+ }
97
+ .kd-button-left:hover {
98
+ border-right: 1px solid #C6C6C6;
99
+ }
100
+ .kd-buttonbar .kd-button.mid {
101
+ border-radius: 0 0 0 0;
102
+ margin-left: -1px;
103
+ }
104
+ .kd-button.mid {
105
+ border-radius: 0 0 0 0;
106
+ margin-left: -1px;
107
+ }
108
+ .kd-buttonbar .kd-button-mid {
109
+ border-radius: 0 0 0 0;
110
+ margin-left: -1px;
111
+ }
112
+ .kd-button-mid {
113
+ border-radius: 0 0 0 0;
114
+ margin-left: -1px;
115
+ }
116
+ .kd-buttonbar .kd-button.right {
117
+ border-radius: 0 2px 2px 0;
118
+ margin-left: -1px;
119
+ }
120
+ .kd-button.right {
121
+ border-radius: 0 2px 2px 0;
122
+ margin-left: -1px;
123
+ }
124
+ .kd-buttonbar .kd-button-right {
125
+ border-radius: 0 2px 2px 0;
126
+ margin-left: 5px;
127
+ }
128
+ .kd-button-right {
129
+ border-radius: 0 2px 2px 0;
130
+ margin-left: -1px;
131
+ }
132
+ .kd-buttonbar .kd-button.right:hover {
133
+ border-left: 1px solid #C6C6C6;
134
+ }
135
+ .kd-button.right:hover {
136
+ border-left: 1px solid #C6C6C6;
137
+ }
138
+ .kd-buttonbar .kd-button-right:hover {
139
+ border-left: 1px solid #C6C6C6;
140
+ }
141
+ .kd-button-right:hover {
142
+ border-left: 1px solid #C6C6C6;
143
+ }
144
+ .kd-buttonbar-right .kd-button {
145
+ float: right;
146
+ margin-left: 0;
147
+ margin-right: 16px;
148
+ }
149
+ .kd-buttonbar-right .kd-combobutton {
150
+ float: right;
151
+ margin-left: 0;
152
+ margin-right: 16px;
153
+ }
154
+ .kd-buttonbar-right .kd-button:first-child {
155
+ margin-right: 0;
156
+ }
157
+ .kd-buttonbar-right .kd-button.left {
158
+ margin-right: -1px;
159
+ }
160
+ .kd-buttonbar-right .kd-button-left {
161
+ margin-right: -1px;
162
+ }
163
+ .kd-buttonbar-right .kd-button.mid {
164
+ margin-left: 0;
165
+ margin-right: -1px;
166
+ }
167
+ .kd-buttonbar-right .kd-button-mid {
168
+ margin-left: 0;
169
+ margin-right: -1px;
170
+ }
171
+ .kd-buttonbar-right .kd-button.right {
172
+ margin-left: 0;
173
+ margin-right: 0;
174
+ }
175
+ .kd-buttonbar-right .kd-button-right {
176
+ margin-left: 0;
177
+ margin-right: 0;
178
+ }
179
+ .kd-button {
180
+ -moz-transition: all 0.218s ease 0s;
181
+ background-color: #F5F5F5;
182
+ background-image: -moz-linear-gradient(center top , #F5F5F5, #F1F1F1);
183
+ border: 1px solid rgba(0, 0, 0, 0.1);
184
+ border-radius: 2px 2px 2px 2px;
185
+ color: #444444;
186
+ display: inline-block;
187
+ font-size: 85%;
188
+ font-weight: bold;
189
+ height: 20px;
190
+ line-height: 20px;
191
+ min-width: 54px;
192
+ padding: 10px 0 0 !important;
193
+ text-align: center;
194
+ overflow: visible;
195
+ }
196
+
197
+
198
+ .msie-7 .kd-button {
199
+ overflow: visible;
200
+ }
201
+ .msie-8 .kd-button {
202
+ overflow: visible;
203
+ }
204
+ .kd-button.mini {
205
+ height: 17px;
206
+ line-height: 17px;
207
+ min-width: 0;
208
+ }
209
+ .kd-button:hover {
210
+ -moz-transition: all 0s ease 0s;
211
+ background-color: #F8F8F8;
212
+ background-image: -moz-linear-gradient(center top , #F8F8F8, #F1F1F1);
213
+ border: 1px solid #C6C6C6;
214
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
215
+ color: #333333;
216
+ text-decoration: none;
217
+ }
218
+ .kd-button:active {
219
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) inset;
220
+ }
221
+ .kd-button:active:hover {
222
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) inset;
223
+ }
224
+ .kd-button:active:focus {
225
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) inset;
226
+ }
227
+ .kd-button.selected {
228
+ background-color: #DDDDDD;
229
+ background-image: -moz-linear-gradient(center top , #DDDDDD, #D0D0D0);
230
+ border: 1px solid #CCCCCC;
231
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
232
+ color: #333333;
233
+ }
234
+ .kd-button.selected:hover {
235
+ background-color: #EEEEEE;
236
+ background-image: -moz-linear-gradient(center top , #EEEEEE, #E0E0E0);
237
+ border: 1px solid #CCCCCC;
238
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
239
+ color: #333333;
240
+ }
241
+ .kd-button.selected:active {
242
+ background-color: #EEEEEE;
243
+ background-image: -moz-linear-gradient(center top , #EEEEEE, #E0E0E0);
244
+ border: 1px solid #CCCCCC;
245
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
246
+ color: #333333;
247
+ }
248
+ .kd-button.disabled {
249
+ background: none repeat scroll 0 0 #FFFFFF;
250
+ border: 1px solid rgba(0, 0, 0, 0.05);
251
+ color: #B8B8B8;
252
+ cursor: default;
253
+ pointer-events: none;
254
+ }
255
+ .kd-button.disabled:hover {
256
+ background: none repeat scroll 0 0 #FFFFFF;
257
+ border: 1px solid rgba(0, 0, 0, 0.05);
258
+ color: #B8B8B8;
259
+ cursor: default;
260
+ pointer-events: none;
261
+ }
262
+ .kd-button.disabled:active {
263
+ background: none repeat scroll 0 0 #FFFFFF;
264
+ border: 1px solid rgba(0, 0, 0, 0.05);
265
+ color: #B8B8B8;
266
+ cursor: default;
267
+ pointer-events: none;
268
+ }
269
+ .kd-button:disabled {
270
+ background: none repeat scroll 0 0 #FFFFFF;
271
+ border: 1px solid rgba(0, 0, 0, 0.05);
272
+ color: #B8B8B8;
273
+ cursor: default;
274
+ pointer-events: none;
275
+ }
276
+ .kd-button-submit {
277
+ background-color: #4D90FE;
278
+ background-image: -moz-linear-gradient(center top , #4D90FE, #4787ED);
279
+ border: 1px solid #3079ED;
280
+ color: #FFFFFF;
281
+ }
282
+ .kd-button-submit:hover {
283
+ background-color: #357AE8;
284
+ background-image: -moz-linear-gradient(center top , #4D90FE, #357AE8);
285
+ border: 1px solid #2F5BB7;
286
+ color: #FFFFFF;
287
+ }
288
+ .kd-button-share {
289
+ background-color: #3D9400;
290
+ background-image: -moz-linear-gradient(center top , #3D9400, #398A00);
291
+ border: 1px solid #29691D;
292
+ color: #FFFFFF;
293
+ text-shadow: 0 1px rgba(0, 0, 0, 0.1);
294
+ }
295
+ .kd-button-share:hover {
296
+ background-color: #368200;
297
+ background-image: -moz-linear-gradient(center top , #3D9400, #368200);
298
+ border: 1px solid #2D6200;
299
+ color: #FFFFFF;
300
+ text-shadow: 0 1px rgba(0, 0, 0, 0.3);
301
+ }
302
+
303
+ .ml-loading-img {
304
+ background-image: url("assets/css/images/my_location_button_spinner.gif");
305
+ height: 10px !important;
306
+ width: 10px !important;
307
+ }
308
+
309
+ .dir-tm .kd-button img {
310
+ /* margin: 0; */
311
+ opacity: 0.667;
312
+ vertical-align: 2px;
313
+ }
314
+
315
+ .kd-button img {
316
+ display: inline-block;
317
+ margin: -3px 0 0;
318
+ opacity: 0.55;
319
+ vertical-align: middle;
320
+ }
321
+
322
+ .dir-tm-d {
323
+ background: url("assets/css/images/directions.png") no-repeat scroll 0 -96px transparent !important;
324
+ height: 12px;
325
+ width: 15px;
326
+ }
327
+
328
+ .dir-tm-w {
329
+ background: url("assets/css/images/directions.png") no-repeat scroll 0 -489px transparent !important;
330
+ height: 16px;
331
+ width: 10px;
332
+ }
333
+
334
+ #d_close .close {
335
+ margin: 5px;
336
+ opacity: 0.7;
337
+ }
338
+
339
+ .close {
340
+ opacity: 0.7;
341
+ overflow: hidden;
342
+ }
343
+
344
+ .close {
345
+ background: url("assets/css/images/utilbuttons.png") no-repeat scroll -108px -26px transparent !important;
346
+ height: 10px;
347
+ width: 10px;
348
+ }
349
+
350
+ img {
351
+ -moz-user-select: none;
352
+ border: 0 none;
353
+ margin: 0;
354
+ padding: 0;
355
+ }
356
+
357
+ .kd-button img {
358
+ display: inline-block;
359
+ margin: -3px 0 0;
360
+ opacity: 0.55;
361
+ vertical-align: middle;
362
+ }
363
+
364
+ .dir-reverse {
365
+ background: url("assets/css/images/directions.png") no-repeat scroll -10px -489px transparent !important;
366
+ height: 12px;
367
+ width: 10px;
368
+ margin-top: -15px !important;
369
+ }
370
+ .dir-clear {
371
+ clear: both;
372
+ font-size: 1px;
373
+ height: 0;
374
+ line-height: 0;
375
+ }
376
+
377
+ #dir_wps {
378
+ margin-top: 15px;
379
+ position: relative;
380
+ }
381
+
382
+ .dir-wp {
383
+ position: relative;
384
+ }
385
+ .dir-wp .dir-wp-hl {
386
+ margin-left: 8px;
387
+ margin-right: 26px;
388
+ padding: 3px 0;
389
+ }
390
+ .d-hl .dir-wp-hl {
391
+ background: none repeat scroll 0 0 #FFF1A8;
392
+ border-radius: 3px 3px 3px 3px;
393
+ }
394
+ .dir-wp .dir-m {
395
+ height: 24px;
396
+ left: 15px;
397
+ position: absolute;
398
+ top: 5px;
399
+ width: 24px;
400
+ }
401
+ .dir-input {
402
+ margin: 0 3px 0 36px;
403
+ padding: 1px 6px;
404
+ text-align: left;
405
+ }
406
+ .dir-input .wp {
407
+ height: 18px;
408
+ line-height: 16px;
409
+ margin: -1px -6px;
410
+ padding: 3px 5px;
411
+ width: 95%;
412
+ }
413
+ .wp:focus + .ml-input {
414
+ background-color: #999999;
415
+ border-color: #7F7F7F;
416
+ border-radius: 1px 1px 1px 1px;
417
+ color: #FFFFFF;
418
+ width: auto;
419
+ }
420
+ .kd-input-text-wrp:hover input {
421
+ border-color: #A0A0A0 #B9B9B9 #B9B9B9;
422
+ border-right: 1px solid #B9B9B9;
423
+ border-style: solid;
424
+ border-width: 1px;
425
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
426
+ }
427
+ .kd-input-text-wrp input:focus {
428
+ border: 1px solid #4D90FE;
429
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) inset;
430
+ outline: medium none;
431
+ }
432
+ .kd-input-text {
433
+ background-color: #FFFFFF;
434
+ border-color: #C0C0C0 #D9D9D9 #D9D9D9;
435
+ border-radius: 1px 1px 1px 1px;
436
+ border-right: 1px solid #D9D9D9;
437
+ border-style: solid;
438
+ border-width: 1px;
439
+ padding-left: 8px;
440
+ }
441
+ .kd-input-text:hover {
442
+ border-color: #A0A0A0 #B9B9B9 #B9B9B9;
443
+ border-right: 1px solid #B9B9B9;
444
+ border-style: solid;
445
+ border-width: 1px;
446
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
447
+ }
448
+ .kd-input-text:focus {
449
+ border: 1px solid #4D90FE;
450
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) inset;
451
+ outline: medium none;
452
+ }
453
+ .ml-input {
454
+ background-color: white;
455
+ border: 1px solid white;
456
+ color: #666666;
457
+ font-size: 85%;
458
+ font-weight: bold;
459
+ height: 15px;
460
+ left: 46px;
461
+ line-height: 15px;
462
+ padding: 1px 6px;
463
+ position: absolute;
464
+ top: 6px;
465
+ }
466
+ .dir-ml-img {
467
+ display: inline;
468
+ height: 9px;
469
+ margin-right: 3px;
470
+ width: 9px;
471
+ }
472
+ .dir-rev-wrapper {
473
+ height: 0;
474
+ line-height: 0;
475
+ position: relative;
476
+ }
477
+ #dir_rev {
478
+ cursor: pointer;
479
+ padding: 5px;
480
+ position: absolute;
481
+ right: 8px;
482
+ top: -20px;
483
+ z-index: 1;
484
+ }
485
+ #dir_rev .kd-button {
486
+ height: 16px;
487
+ min-width: 18px;
488
+ padding: 0;
489
+ width: 18px;
490
+ }
491
+ #dir_controls {
492
+ margin: 0 51px 0 44px;
493
+ }
494
+ .d_links {
495
+ font-size: 100%;
496
+ text-align: left;
497
+ }
498
+ .dir-sub-cntn {
499
+ height: 29px;
500
+ position: relative;
501
+ text-align: left;
502
+ }
503
+ #d_sub {
504
+ height: 22px;
505
+ line-height: 16px;
506
+ margin: 2px 0 0;
507
+ padding: 2px 5px !important;
508
+ position: absolute;
509
+ /*right: 0;*/
510
+ text-transform: uppercase;
511
+ }
512
+
513
+ #print_sub {
514
+ height: 22px;
515
+ line-height: 16px;
516
+ margin: 2px 0 0 125px;
517
+ padding: 2px 5px !important;
518
+ position: absolute;
519
+ /*right: 0;*/
520
+ text-transform: uppercase;
521
+ }
522
+
523
+ /** Override styles */
524
+ .google-map-placeholder img {
525
+ max-width: none !important;
526
+ max-height: none !important;
527
+ background-color: transparent !important;
528
+ padding: 0px !important;
529
+ margin: 0px !important;
530
+ visibility: inherit !important;
531
+ }
532
+
533
+ .google-map-placeholder div {
534
+ overflow: none !important;
535
+ }
536
+ /** Override styles */
537
+
538
+ .google-map-placeholder .bubble-content h4 {
539
+ text-align: left !important;
540
+ font-size: 14px !important;
541
+ border: none !important;
542
+ background: none !important;
543
+ color: #111111 !important;
544
+ font-family: Arial,Tahoma,Verdana !important;
545
+ font-weight: bold !important;
546
+ line-height: 120% !important;
547
+ margin: 0 0 8px !important;
548
+ padding: 0 !important;
549
+ }
550
+
551
+ .google-map-placeholder .bubble-content p {
552
+ margin: 0 !important;
553
+ padding: 0 !important;
554
+ }
555
+
556
+ .google-map-placeholder .bubble-content hr {
557
+ margin-bottom: 5px !important;
558
+ margin-top: 10px !important;
559
+ }
560
+
561
+ .google-map-placeholder .bubble-content {
562
+ font-family: Arial,Tahoma,Verdana !important;
563
+ font-size: 13px !important;
564
+ line-height: 160% !important;
565
+ padding: 0 !important;
566
+ margin: 0 !important;
567
+ }
568
+
569
+ .google-map-placeholder .bubble-content p {
570
+ font-family: Arial,Tahoma,Verdana !important;
571
+ font-size: 13px !important;
572
+ line-height: 160% !important;
573
+ color: #555555 !important;
574
+ }
575
+
576
+ .google-map-placeholder hr {
577
+ background-color: #CCCCCC !important;
578
+ border: 0 none !important;
579
+ height: 1px !important;
580
+ }
581
+
582
+ .direction-controls-placeholder,
583
+ .direction-controls-placeholder input {
584
+ font-family: Arial,Tahoma,Verdana !important;
585
+ font-size: 12px !important;
586
+ line-height: 160% !important;
587
+ }
588
+
589
+ .direction-controls-placeholder #d_options {
590
+ color: #22222 !important;
591
+ }
592
+
593
+ .direction-controls-placeholder #d_options input {
594
+ width: 5% !important;
595
+ }
596
+
597
+ .bubble-content a {
598
+ color: #1982D1 !important;
599
+ text-decoration: none !important;
600
+ font-weight: normal !important;
601
+ }
602
+
603
+ .bubble-content a:focus,
604
+ .bubble-content a:active,
605
+ .bubble-content a:hover {
606
+ text-decoration: underline !important;
607
+ }
608
+
609
+ .direction-controls-placeholder input[type="text"] {
610
+ box-shadow: none !important;
611
+ color: #000 !important;
612
+ }
613
+
614
+ .direction-controls-placeholder .d_error {
615
+ background-color: pink !important;
616
+ }
617
+
618
+ .direction-controls-placeholder img {
619
+ max-width: 100% !important;
620
+ }
621
+
622
+ .direction-controls-placeholder input {
623
+ margin: 0 !important;
624
+ }
625
+
626
+ .rendered-directions-placeholder table {
627
+ border-collapse: separate !important;
628
+ border-spacing: 0 !important;
629
+ }
630
+
631
+ .rendered-directions-placeholder table,
632
+ .rendered-directions-placeholder tr {
633
+ border: none !important;
634
+ }
635
+
636
+ .rendered-directions-placeholder table {
637
+ margin: 0 0 10px !important;
638
+ }
639
+
640
+ .rendered-directions-placeholder table.adp-fullwidth {
641
+ border: none !important;
642
+ }
643
+
644
+ .rendered-directions-placeholder table td {
645
+ font-family: Arial,Tahoma,Verdana !important;
646
+ font-size: 12px !important;
647
+ line-height: 160% !important;
648
+ vertical-align:middle !important;
649
+ padding: 2px 3px 4px 5px !important;
650
+ border: none !important;
651
+ }
652
+
653
+ .rendered-directions-placeholder table.adp-directions td {
654
+ border-top: 1px solid #DDDDDD !important;
655
+ }
656
+
657
+ .rendered-directions-placeholder table td.adp-listheader {
658
+ font-family: Arial,Tahoma,Verdana !important;
659
+ font-size: 13px !important;
660
+ font-weight: bold !important;
661
+ color: blue;
662
+ }
663
+
664
+
665
+ .rendered-directions-placeholder div.adp-legal {
666
+ font-size: 12px !important;
667
+ }
668
+
669
+ .rendered-directions-placeholder div.adp-list {
670
+ border: none !important;
671
+ }
672
+
673
+
674
+ .rendered-directions-placeholder div.warnbox-content {
675
+ font-family: Arial,Tahoma,Verdana !important;
676
+ font-size: 13px !important;
677
+ }
678
+
679
+ .rendered-directions-placeholder div.adp-summary span {
680
+ color: blue !important;
681
+ font-family: Arial,Tahoma,Verdana !important;
682
+ font-size: 13px !important;
683
+ font-weight: bold !important;
684
+ }
685
+
686
+ .map-loading {
687
+ background: url("assets/css/images/loading.gif") no-repeat 0 0 transparent !important;
688
+ height: 100px;
689
+ width: 100px;
690
+
691
  }
form_ajax_functions.php CHANGED
@@ -1,623 +1,529 @@
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
- // Direct access must be allowed
11
-
12
-
13
-
14
-
15
-
16
- //////////////////////////////////////////////////// generete CSV
17
- function form_maker_generete_csv(){
18
- if(isset($_GET['action']) && $_GET['action']=='formmakergeneretecsv'){
19
- global $wpdb;
20
- $form_id=$_REQUEST['form_id'];
21
- if(!isset($_SERVER['HTTP_REFERER'])){
22
- header('Location: ../../index.php');
23
- exit;
24
- }
25
-
26
- $query = $wpdb->prepare("SELECT * FROM ".$wpdb->prefix."formmaker_submits where form_id= %d",$form_id);
27
-
28
- $rows = $wpdb->get_results($query);
29
-
30
- $n=count($rows);
31
-
32
- $labels= array();
33
- for($i=0; $i < $n ; $i++)
34
-
35
- {
36
- $row = &$rows[$i];
37
- if(!in_array($row->element_label, $labels))
38
- {
39
- array_push($labels, $row->element_label);
40
- }
41
- }
42
- $label_titles=array();
43
- $sorted_labels= array();
44
-
45
- $query_lable = $wpdb->prepare("SELECT label_order,title FROM ".$wpdb->prefix."formmaker where id= %d",$form_id);
46
-
47
-
48
-
49
- $rows_lable = $wpdb->get_results($query_lable);
50
- $ptn = "/[^a-zA-Z0-9_]/";
51
- $rpltxt = "";
52
-
53
-
54
- $title=preg_replace($ptn, $rpltxt, $rows_lable[0]->title);
55
-
56
- $sorted_labels_id= array();
57
- $sorted_labels= array();
58
- $label_titles=array();
59
- if($labels)
60
- {
61
-
62
- $label_id= array();
63
- $label_order= array();
64
- $label_order_original= array();
65
- $label_type= array();
66
-
67
- ///stexic
68
- $label_all = explode('#****#',$rows_lable[0]->label_order);
69
- $label_all = array_slice($label_all,0, count($label_all)-1);
70
-
71
-
72
-
73
- foreach($label_all as $key => $label_each)
74
- {
75
- $label_id_each=explode('#**id**#',$label_each);
76
- array_push($label_id, $label_id_each[0]);
77
-
78
- $label_oder_each=explode('#**label**#', $label_id_each[1]);
79
-
80
- array_push($label_order_original, $label_oder_each[0]);
81
-
82
- $ptn = "/[^a-zA-Z0-9_]/";
83
- $rpltxt = "";
84
- $label_temp=preg_replace($ptn, $rpltxt, $label_oder_each[0]);
85
- array_push($label_order, $label_temp);
86
-
87
- array_push($label_type, $label_oder_each[1]);
88
-
89
-
90
- //echo $label."<br>";
91
-
92
- }
93
-
94
- foreach($label_id as $key => $label)
95
- if(in_array($label, $labels))
96
- {
97
- array_push($sorted_labels, $label_order[$key]);
98
- array_push($sorted_labels_id, $label);
99
- array_push($label_titles, $label_order_original[$key]);
100
- }
101
-
102
-
103
- }
104
-
105
- $m=count($sorted_labels);
106
- $group_id_s= array();
107
- $l=0;
108
-
109
-
110
- if(count($rows)>0 and $m)
111
- for($i=0; $i <count($rows) ; $i++)
112
- {
113
-
114
- $row = &$rows[$i];
115
-
116
- if(!in_array($row->group_id, $group_id_s))
117
- {
118
-
119
- array_push($group_id_s, $row->group_id);
120
-
121
- }
122
- }
123
-
124
-
125
-
126
- $data=array();
127
-
128
-
129
- for($www=0; $www < count($group_id_s); $www++)
130
- {
131
- $i=$group_id_s[$www];
132
-
133
- $temp= array();
134
- for($j=0; $j < $n ; $j++)
135
- {
136
-
137
- $row = &$rows[$j];
138
-
139
- if($row->group_id==$i)
140
- {
141
-
142
- array_push($temp, $row);
143
- }
144
- }
145
-
146
-
147
-
148
- $f=$temp[0];
149
- $date=$f->date;
150
- $ip=$f->ip;
151
- $data_temp['Submit date']=$date;
152
- $data_temp['Ip']=$ip;
153
-
154
-
155
- $ttt=count($temp);
156
-
157
- // var_dump($temp);
158
- for($h=0; $h < $m ; $h++)
159
- {
160
-
161
- for($g=0; $g < $ttt ; $g++)
162
- {
163
- $t = $temp[$g];
164
- if($t->element_label==$sorted_labels_id[$h])
165
- {
166
- if(strpos($t->element_value,"*@@url@@*"))
167
- {
168
- $new_file=str_replace("*@@url@@*",'', $t->element_value);
169
- $new_filename=explode('/', $new_file);
170
- $data_temp[$label_titles[$h]]=$new_file;
171
- }
172
- else
173
- if(strpos($t->element_value,"***br***"))
174
- {
175
- $data_temp[$label_titles[$h]]= substr(str_replace("***br***",', ', $t->element_value), 0, -2);
176
- }
177
- else
178
- if(strpos($t->element_value,"***map***"))
179
- {
180
- $data_temp[$label_titles[$h]]= 'Longitude:'.substr(str_replace("***map***",', Latitude:', $t->element_value), 0, -2);
181
- }
182
- else
183
- $data_temp[$label_titles[$h]]=$t->element_value;
184
- }
185
- }
186
-
187
-
188
- }
189
- $data[]=$data_temp;
190
- }
191
-
192
-
193
-
194
-
195
- function cleanData(&$str)
196
- {
197
- $str = preg_replace("/\t/", "\\t", $str);
198
- $str = preg_replace("/\r?\n/", "\\n", $str);
199
- if(strstr($str, '"')) $str = '"' . str_replace('"', '""', $str) . '"';
200
- }
201
-
202
- // file name for download
203
- $filename = $title."_" . date('Ymd') . ".csv";
204
-
205
- header("Content-type:application/csv; charset='utf-8'");
206
- header("Content-Disposition: attachment; filename=\"$filename\"");
207
- echo chr(239).chr(187).chr(191);
208
-
209
-
210
- $flag = false;
211
- foreach($data as $row) {
212
- if(!$flag) {
213
- # display field/column names as first row
214
- echo '"'.implode('","', array_keys($row))."\"\r\n";
215
- $flag = true;
216
- }
217
- array_walk($row, 'cleanData');
218
- echo '"'.implode('","',array_values($row))."\"\r\n";
219
- }
220
- die('');
221
- }
222
- }
223
-
224
-
225
-
226
-
227
-
228
-
229
-
230
- /////////////////////////////////////////////////////////////////////////////
231
-
232
-
233
-
234
- ///////////////////////////////////////////////////////////////////////////// generete XML
235
-
236
-
237
-
238
- function form_maker_generete_xml(){
239
- if(isset($_GET['action']) && $_GET['action']=='formmakergeneretexml'){
240
- global $wpdb;
241
- $form_id=$_REQUEST['form_id'];
242
- if(!isset($_SERVER['HTTP_REFERER'])){
243
- header('Location: ../../index.php');
244
- exit;
245
- }
246
- $query = $wpdb->prepare("SELECT * FROM ".$wpdb->prefix."formmaker_submits where form_id= %d",$form_id);
247
- $rows = $wpdb->get_results($query);
248
- $n=count($rows);
249
- $labels= array();
250
- for($i=0; $i < $n ; $i++)
251
- {
252
- $row = &$rows[$i];
253
- if(!in_array($row->element_label, $labels))
254
- {
255
- array_push($labels, $row->element_label);
256
- }
257
- }
258
- $label_titles=array();
259
- $sorted_labels= array();
260
- $query_lable = "SELECT label_order,title FROM ".$wpdb->prefix."formmaker where id=$form_id ";
261
- $rows_lable = $wpdb->get_results($query_lable);
262
- $ptn = "/[^a-zA-Z0-9_]/";
263
- $rpltxt = "";
264
- $title=preg_replace($ptn, $rpltxt, $rows_lable[0]->title);
265
- $sorted_labels_id= array();
266
- $sorted_labels= array();
267
- $label_titles=array();
268
- if($labels)
269
- {
270
- $label_id= array();
271
- $label_order= array();
272
- $label_order_original= array();
273
- $label_type= array();
274
- ///stexic
275
- $label_all = explode('#****#',$rows_lable[0]->label_order);
276
- $label_all = array_slice($label_all,0, count($label_all)-1);
277
- foreach($label_all as $key => $label_each)
278
- {
279
- $label_id_each=explode('#**id**#',$label_each);
280
- array_push($label_id, $label_id_each[0]);
281
- $label_oder_each=explode('#**label**#', $label_id_each[1]);
282
- array_push($label_order_original, $label_oder_each[0]);
283
- $ptn = "/[^a-zA-Z0-9_]/";
284
- $rpltxt = "";
285
- $label_temp=preg_replace($ptn, $rpltxt, $label_oder_each[0]);
286
- array_push($label_order, $label_temp);
287
- array_push($label_type, $label_oder_each[1]);
288
- }
289
- foreach($label_id as $key => $label)
290
- if(in_array($label, $labels))
291
- {
292
- array_push($sorted_labels, $label_order[$key]);
293
- array_push($sorted_labels_id, $label);
294
- array_push($label_titles, $label_order_original[$key]);
295
- }
296
- }
297
- $m=count($sorted_labels);
298
- $group_id_s= array();
299
- $l=0;
300
- if(count($rows)>0 and $m)
301
- for($i=0; $i <count($rows) ; $i++)
302
- {
303
- $row = &$rows[$i];
304
- if(!in_array($row->group_id, $group_id_s))
305
- {
306
- array_push($group_id_s, $row->group_id);
307
-
308
- }
309
- }
310
- $data=array();
311
- for($www=0; $www < count($group_id_s); $www++)
312
- {
313
- $i=$group_id_s[$www];
314
- $temp= array();
315
- for($j=0; $j < $n ; $j++)
316
- {
317
- $row = &$rows[$j];
318
- if($row->group_id==$i)
319
- {
320
- array_push($temp, $row);
321
- }
322
- }
323
- $f=$temp[0];
324
- $date=$f->date;
325
- $ip=$f->ip;
326
- $data_temp['Submit date']=$date;
327
- $data_temp['Ip']=$ip;
328
- $ttt=count($temp);
329
- for($h=0; $h < $m ; $h++)
330
- {
331
- for($g=0; $g < $ttt ; $g++)
332
- {
333
- $t = $temp[$g];
334
- if($t->element_label==$sorted_labels_id[$h])
335
- {
336
- if(strpos($t->element_value,"*@@url@@*"))
337
- {
338
- $new_file=str_replace("*@@url@@*",'', $t->element_value);
339
- $new_filename=explode('/', $new_file);
340
- $data_temp[$label_titles[$h]]=$new_file;
341
- }
342
- else
343
- if(strpos($t->element_value,"***br***"))
344
- {
345
- $data_temp[$label_titles[$h]]= substr(str_replace("***br***",', ', $t->element_value), 0, -2);
346
- }
347
- else
348
- if(strpos($t->element_value,"***map***"))
349
- {
350
- $data_temp[$label_titles[$h]]= 'Longitude:'.substr(str_replace("***map***",', Latitude:', $t->element_value), 0, -2);
351
- }
352
- else
353
- $data_temp[$label_titles[$h]]=$t->element_value;
354
- }
355
- }
356
- }
357
- $data[]=$data_temp;
358
- }
359
- function cleanData(&$str)
360
- {
361
- $str = preg_replace("/\t/", "\\t", $str);
362
- $str = preg_replace("/\r?\n/", "\\n", $str);
363
- if(strstr($str, '"')) $str = '"' . str_replace('"', '""', $str) . '"';
364
- }
365
- $filename = $title."_" . date('Ymd') . ".xml";
366
- header("Content-Disposition: attachment; filename=\"$filename\"");
367
- header("Content-Type:text/xml, charset=utf-8");
368
- $flag = false;
369
- echo '
370
-
371
- <?xml version="1.0" encoding="utf-8" ?>
372
-
373
- <form title="'.$title.'">';
374
- foreach ($data as $key1 => $value1){
375
- echo '<submition>';
376
- foreach ($value1 as $key => $value){
377
- echo '<field title="'.$key.'">';
378
- echo '<![CDATA['.$value."]]>";
379
- echo '</field>';
380
- }
381
- echo '</submition>';
382
- }
383
- echo ' </form>
384
- ';
385
- die('');
386
- }
387
- }
388
-
389
-
390
-
391
-
392
-
393
- //////////////////////////////////////////////////////////////////////
394
-
395
-
396
-
397
-
398
-
399
-
400
- ///////////////////////////////////////////////////////////////////// wd_captcha
401
-
402
-
403
-
404
-
405
-
406
-
407
-
408
-
409
-
410
-
411
- function form_maker_wd_captcha(){
412
- if(isset($_GET['action']) && $_GET['action']=='formmakerwdcaptcha'){
413
- if(isset($_GET["i"]))
414
- $i=$_GET["i"];
415
- else
416
- $i='';
417
- if(isset($_GET['r2']))
418
- $r2=$_GET['r2'];
419
- else
420
- $r2=0;
421
- if(isset($_GET['r']))
422
- $rrr=$_GET['r'];
423
- else
424
- $rrr=0;
425
- $randNum=0+$r2+$rrr;
426
-
427
- if(isset($_GET["digit"]))
428
- $cap_width=$_GET["digit"]*10+15;
429
- else
430
- {
431
- $cap_width=6*10+15;
432
- }
433
- $cap_height=30;
434
- $cap_quality=100;
435
- if(isset($_GET["digit"]))
436
- $cap_length_min=$_GET["digit"];
437
- else
438
- $cap_length_min=6;
439
- if(isset($_GET["digit"]))
440
- $cap_length_max=$_GET["digit"];
441
- else
442
- $cap_length_max=6;
443
- $cap_digital=1;
444
- $cap_latin_char=1;
445
-
446
-
447
-
448
- function code_generic($_length,$_digital=1,$_latin_char=1)
449
- {
450
- $dig=array(0,1,2,3,4,5,6,7,8,9);
451
- $lat=array('a','b','c','d','e','f','g','h','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
452
- $main=array();
453
-
454
- if ($_digital) $main=array_merge($main,$dig);
455
- if ($_latin_char) $main=array_merge($main,$lat);
456
- shuffle($main);
457
- $pass=substr(implode('',$main),0,$_length);
458
- return $pass;
459
- }
460
-
461
- $l=rand($cap_length_min,$cap_length_max);
462
- $code=code_generic($l,$cap_digital,$cap_latin_char);
463
- @session_start();
464
-
465
- $_SESSION[$i.'_wd_captcha_code']=$code;
466
- $canvas=imagecreatetruecolor($cap_width,$cap_height);
467
- $c=imagecolorallocate($canvas,rand(150,255),rand(150,255),rand(150,255));
468
- imagefilledrectangle($canvas,0,0,$cap_width,$cap_height,$c);
469
- $count=strlen($code);
470
- $color_text=imagecolorallocate($canvas,0,0,0);
471
- for($it=0;$it<$count;$it++)
472
- {
473
- $letter=$code[$it];
474
- imagestring($canvas,6,(10*$it+10),$cap_height/4,$letter,$color_text);
475
- }
476
-
477
- for ($c = 0; $c < 150; $c++){
478
- $x = rand(0,$cap_width-1);
479
- $y = rand(0,29);
480
- $col='0x'.rand(0,9).'0'.rand(0,9).'0'.rand(0,9).'0';
481
- imagesetpixel($canvas, $x, $y, $col);
482
- }
483
-
484
-
485
- header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
486
- header('Cache-Control: no-store, no-cache, must-revalidate');
487
- header('Cache-Control: post-check=0, pre-check=0',false);
488
- header('Pragma: no-cache');
489
- header('Content-Type: image/jpeg');
490
- imagejpeg($canvas,null,$cap_quality);
491
- die('');
492
- }
493
- }
494
-
495
-
496
-
497
-
498
-
499
-
500
-
501
-
502
-
503
-
504
- /////////////////////////////////////////////////////////////////////
505
-
506
-
507
-
508
-
509
-
510
-
511
-
512
-
513
-
514
-
515
- ////////////////////////////////////////////////////////////////////// function post or page window php
516
-
517
-
518
-
519
-
520
- function form_maker_window_php(){
521
- if(isset($_GET['action']) && $_GET['action']=='formmakerwindow'){
522
- global $wpdb;
523
- ?>
524
- <html xmlns="http://www.w3.org/1999/xhtml">
525
- <head>
526
- <title>Form Maker</title>
527
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
528
- <script language="javascript" type="text/javascript" src="<?php echo get_option("siteurl"); ?>/wp-includes/js/jquery/jquery.js"></script>
529
- <script language="javascript" type="text/javascript" src="<?php echo get_option("siteurl"); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
530
- <link rel="stylesheet" href="<?php echo get_option("siteurl"); ?>/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css?ver=342-20110630100">
531
- <script language="javascript" type="text/javascript" src="<?php echo get_option("siteurl"); ?>/wp-includes/js/tinymce/utils/mctabs.js"></script>
532
- <script language="javascript" type="text/javascript" src="<?php echo get_option("siteurl"); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
533
- <base target="_self">
534
- </head>
535
- <body id="link" style="" dir="ltr" class="forceColors">
536
- <div class="tabs" role="tablist" tabindex="-1">
537
- <ul>
538
- <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>
539
- </ul>
540
- </div>
541
- <style>
542
- .panel_wrapper{
543
- height:170px !important;
544
- }
545
- </style>
546
- <div class="panel_wrapper">
547
- <div id="Single_product_panel" class="panel current">
548
- <table>
549
- <tr>
550
- <td style="height:100px; width:100px; vertical-align:top;">
551
- Select a Form
552
- </td>
553
- <td style="vertical-align:top">
554
- <select name="Form_Makername" id="Form_Makername" style="width:250px; text-align:center">
555
- <option style="text-align:center" value="- Select Form -" selected="selected">- Select a Form -</option>
556
- <?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);
557
- foreach($ids_Form_Maker as $arr_Form_Maker)
558
- {
559
- ?>
560
- <option value="<?php echo $arr_Form_Maker->id; ?>"><?php echo $arr_Form_Maker->title; ?></option>
561
- <?php }?>
562
- </select>
563
- </td>
564
- </tr>
565
- </table>
566
- </div>
567
- </div>
568
- <div class="mceActionPanel">
569
- <div style="float: left">
570
- <input type="button" id="cancel" name="cancel" value="Cancel" onClick="tinyMCEPopup.close();" />
571
- </div>
572
-
573
- <div style="float: right">
574
- <input type="submit" id="insert" name="insert" value="Insert" onClick="insert_Form_Maker();" />
575
- </div>
576
- </div>
577
- <script type="text/javascript">
578
- function insert_Form_Maker() {
579
- if(document.getElementById('Form_Makername').value=='- Select Form -')
580
- {
581
- tinyMCEPopup.close();
582
- }
583
- else
584
- {
585
- var tagtext;
586
- tagtext='[Form id="'+document.getElementById('Form_Makername').value+'"]';
587
- window.tinyMCE.execInstanceCommand('content', 'mceInsertContent', false, tagtext);
588
- tinyMCEPopup.editor.execCommand('mceRepaint');
589
- tinyMCEPopup.close();
590
- }
591
-
592
- }
593
-
594
- </script>
595
- </body>
596
- </html>
597
- <?php
598
- die('');
599
- }
600
- }
601
-
602
-
603
-
604
-
605
-
606
-
607
-
608
-
609
-
610
-
611
-
612
-
613
-
614
-
615
-
616
-
617
-
618
-
619
-
620
-
621
-
622
-
623
-
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');
15
+ }
16
+ }
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 = str_replace('&amp;', "&", $t->element_value);
115
+ $val = stripslashes(str_replace('&#039;', "'", $t->element_value));
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')) {
160
+ die('Access Denied');
161
+ }
162
+ }
163
+ else {
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('&amp;', "&", $t->element_value);
258
+ $val = stripslashes(str_replace('&#039;', "'", $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;
322
+ }
323
+ $cap_width = $digit * 10 + 15;
324
+ $cap_height = 30;
325
+ $cap_quality = 100;
326
+ $cap_length_min = $digit;
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,3901 +1,3861 @@
1
- <?php
2
-
3
-
4
-
5
- if(!current_user_can('manage_options')) {
6
- die('Access Denied');
7
- }
8
-
9
-
10
- function html_update_form_maker($row, $labels, $themes){
11
-
12
- $form_file_url=plugins_url('',__FILE__);
13
-
14
-
15
- @session_start();
16
- $all_updates = $_SESSION['all_updates'];
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 (pressbutton)
72
- {
73
-
74
-
75
- var form = document.adminForm;
76
-
77
- tox='';
78
-
79
- for(t=1;t<=form_view_max;t++)
80
- {
81
- if(document.getElementById('form_id_tempform_view'+t))
82
- {
83
- form_view_element=document.getElementById('form_id_tempform_view'+t);
84
- n=form_view_element.childNodes.length-2;
85
-
86
- for(z=0;z<=n;z++)
87
- {
88
- if(form_view_element.childNodes[z].nodeType!=3)
89
- if(!form_view_element.childNodes[z].id)
90
- {
91
- GLOBAL_tr=form_view_element.childNodes[z];
92
- //////////////////////////////////////////////////////////////////////////////////////////
93
- for (x=0; x < GLOBAL_tr.firstChild.childNodes.length; x++)
94
- {
95
- table=GLOBAL_tr.firstChild.childNodes[x];
96
- tbody=table.firstChild;
97
- for (y=0; y < tbody.childNodes.length; y++)
98
- {
99
- tr=tbody.childNodes[y];
100
- l_label = document.getElementById( tr.id+'_element_labelform_id_temp').innerHTML;
101
- l_label = l_label.replace(/(\r\n|\n|\r)/gm," ");
102
-
103
- if(tr.getAttribute('type')=="type_address")
104
- {
105
- addr_id=parseInt(tr.id);
106
- tox=tox+addr_id+'#**id**#'+'Street Line'+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
107
- tox=tox+addr_id+'#**id**#'+'Street Line2'+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
108
- tox=tox+addr_id+'#**id**#'+'City'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
109
- tox=tox+addr_id+'#**id**#'+'State'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
110
- tox=tox+addr_id+'#**id**#'+'Postal'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
111
- tox=tox+addr_id+'#**id**#'+'Country'+'#**label**#'+tr.getAttribute('type')+'#****#';
112
- }
113
- else
114
- tox=tox+tr.id+'#**id**#'+l_label+'#**label**#'+tr.getAttribute('type')+'#****#';
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( pressbutton ){
133
-
134
- document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
135
- document.getElementById('adminForm').submit();
136
-
137
- }
138
- function remove_whitespace(node)
139
- {
140
- for (ttt=0; ttt < node.childNodes.length; ttt++)
141
- {
142
- if( node.childNodes[ttt].nodeType == '3')
143
- {
144
- if(!node.childNodes[ttt])
145
- node.removeChild(node.childNodes[ttt]);
146
- }
147
- else
148
- {
149
- if(node.childNodes[ttt].childNodes.length)
150
- remove_whitespace(node.childNodes[ttt]);
151
- }
152
- }
153
- return
154
- }
155
-
156
- function refresh_()
157
- {
158
- document.getElementById('form').value=document.getElementById('take').innerHTML;
159
- gen=document.getElementById('counter').value;
160
- n=gen;
161
- for(i=0; i<n; i++)
162
- {
163
- if(document.getElementById(i))
164
- {
165
- for(z=0; z<document.getElementById(i).childNodes.length; z++)
166
- if(document.getElementById(i).childNodes[z].nodeType==3)
167
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
168
-
169
- if(document.getElementById(i).getAttribute('type')=="type_captcha" || document.getElementById(i).getAttribute('type')=="type_recaptcha")
170
- {
171
- if(document.getElementById(i).childNodes[10])
172
- {
173
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
174
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
175
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
176
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
177
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
178
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
179
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
180
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
181
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
182
- }
183
- else
184
- {
185
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
186
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
187
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
188
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
189
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
190
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
191
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
192
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
193
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
194
- }
195
- continue;
196
- }
197
-
198
- if(document.getElementById(i).childNodes[10])
199
- {
200
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
201
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
202
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
203
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
204
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
205
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
206
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
207
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
208
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
209
- }
210
- else
211
- {
212
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
213
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
214
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
215
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
216
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
217
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
218
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
219
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
220
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
221
- }
222
- }
223
- }
224
-
225
- for(i=0; i<=n; i++)
226
- {
227
- if(document.getElementById(i))
228
- {
229
- type=document.getElementById(i).getAttribute("type");
230
- switch(type)
231
- {
232
- case "type_text":
233
- case "type_number":
234
- case "type_password":
235
- case "type_submitter_mail":
236
- case "type_own_select":
237
- case "type_country":
238
- case "type_hidden":
239
- case "type_map":
240
- {
241
- remove_add_(i+"_elementform_id_temp");
242
- break;
243
- }
244
-
245
- case "type_submit_reset":
246
- {
247
- remove_add_(i+"_element_submitform_id_temp");
248
- if(document.getElementById(i+"_element_resetform_id_temp"))
249
- remove_add_(i+"_element_resetform_id_temp");
250
- break;
251
- }
252
-
253
- case "type_captcha":
254
- {
255
- remove_add_("_wd_captchaform_id_temp");
256
- remove_add_("_element_refreshform_id_temp");
257
- remove_add_("_wd_captcha_inputform_id_temp");
258
- break;
259
- }
260
- case "type_file_upload":
261
- {
262
- remove_add_(i+"_elementform_id_temp");
263
-
264
- break;
265
- }
266
-
267
- case "type_textarea":
268
- {
269
- remove_add_(i+"_elementform_id_temp");
270
-
271
- break;
272
- }
273
-
274
- case "type_name":
275
- {
276
-
277
- if(document.getElementById(i+"_element_titleform_id_temp"))
278
- {
279
- remove_add_(i+"_element_titleform_id_temp");
280
- remove_add_(i+"_element_firstform_id_temp");
281
- remove_add_(i+"_element_lastform_id_temp");
282
- remove_add_(i+"_element_middleform_id_temp");
283
- }
284
- else
285
- {
286
- remove_add_(i+"_element_firstform_id_temp");
287
- remove_add_(i+"_element_lastform_id_temp");
288
- }
289
- break;
290
-
291
- }
292
-
293
- case "type_phone":
294
- {
295
-
296
- remove_add_(i+"_element_firstform_id_temp");
297
- remove_add_(i+"_element_lastform_id_temp");
298
- break;
299
-
300
- }
301
- case "type_address":
302
- {
303
- remove_add_(i+"_street1form_id_temp");
304
- remove_add_(i+"_street2form_id_temp");
305
- remove_add_(i+"_cityform_id_temp");
306
- remove_add_(i+"_stateform_id_temp");
307
- remove_add_(i+"_postalform_id_temp");
308
- remove_add_(i+"_countryform_id_temp");
309
-
310
- break;
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
- document.getElementById('form_front').value=document.getElementById('take').innerHTML;
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
- </script>
502
- <style>
503
- #when_edit
504
- {
505
- position:absolute;
506
- background-color:#666;
507
- z-index:101;
508
- display:none;
509
- width:100%;
510
- height:100%;
511
- opacity: 0.7;
512
- filter: alpha(opacity = 70);
513
- }
514
-
515
- #formMakerDiv
516
- {
517
- position:fixed;
518
- background-color:#666;
519
- z-index:100;
520
- display:none;
521
- left:0;
522
- top:0;
523
- width:100%;
524
- height:100%;
525
- opacity: 0.7;
526
- filter: alpha(opacity = 70);
527
- }
528
- #formMakerDiv1
529
- {
530
- position:fixed;
531
- z-index:100;
532
- background-color:transparent;
533
- top:0;
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" enctype="multipart/form-data">
544
- <table style="border:6px #00aeef solid; background-color:#00aeef" width="100%" cellpadding="0" cellspacing="0">
545
- <tr>
546
-
547
-
548
- <td align="left" valign="middle" rowspan="3" style="padding:10px;">
549
- <img src="<?php echo $form_file_url; ?>/images/formmaker.png" />
550
- </td>
551
-
552
- <td width="70" align="right" valign="middle">
553
-
554
- <span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Form title:&nbsp;&nbsp;</span>
555
-
556
- </td>
557
-
558
- <td width="153" align="center" valign="middle">
559
-
560
- <div style="background-image:url(<?php echo $form_file_url; ?>/images/input.png);">
561
-
562
- <input id="title" name="title" <?php echo 'value="'.htmlspecialchars($row->title).'"' ?> style="background:none; width:151px; height:17px; border:none; font-size:11px" />
563
-
564
- </div>
565
-
566
- </td>
567
-
568
- </tr><tr>
569
-
570
- <td width="300" align="right" valign="middle">
571
-
572
- <span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Email to send submissions to:&nbsp;&nbsp;</span>
573
-
574
- </td>
575
-
576
- <td width="153" align="center" valign="middle">
577
-
578
- <div style="background-image:url(<?php echo $form_file_url; ?>/images/input.png);">
579
-
580
- <input id="mail" name="mail" <?php echo 'value="'.$row->mail.'"' ?> style="background:none; width:151px; height:17px; border:none; font-size:11px" />
581
-
582
- </div>
583
-
584
- </td>
585
-
586
- </tr>
587
-
588
- <tr>
589
-
590
- <td width="300" align="right" valign="middle">
591
-
592
- <span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Theme:&nbsp;&nbsp;</span>
593
-
594
- </td>
595
-
596
- <td width="153" align="center" valign="middle">
597
-
598
- <div style="height:19px">
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
- </div>
618
-
619
- </td>
620
-
621
- </tr>
622
-
623
- <tr>
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 style="padding:0px">
639
- <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
640
- <tr valign="top">
641
- <td width="15%" height="100%" style="border-right:dotted black 1px;" id="field_types">
642
- <div id="when_edit" style="display:none"></div>
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;">&nbsp;</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
- else
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
- <br />
742
- <br />
743
-
744
- <fieldset>
745
-
746
- <legend>
747
-
748
- <h2 style="color:#00aeef">Form</h2>
749
-
750
- </legend>
751
-
752
- <?php
753
- global $first_css;
754
- echo '<style>'. $first_css.'</style>';
755
-
756
- ?>
757
- <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>
758
- <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 ;" ><tr><td width="0%"></td><td align="right"><img src="<?php echo $form_file_url; ?>/images/minus.png" 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 $form_file_url; ?>/images/page_delete.png" title="Delete the page" class="page_toolbar" onclick="remove_page('1')" /></td><td><img src="<?php echo $form_file_url; ?>/images/page_delete_all.png" title="Delete the page with fields" class="page_toolbar" onclick="remove_page_all('1')" /></td><td><img src="<?php echo $form_file_url; ?>/images/page_edit.png" title="Edit the page" class="page_toolbar" onclick="edit_page_break('1')" /></td></tr></tbody></table></div>
759
-
760
- <div id="take_old" style="display:none">
761
- <?php
762
- echo $row->form;
763
-
764
- ?> </div>
765
-
766
- </fieldset>
767
-
768
- <input type="hidden" name="form" id="form">
769
- <input type="hidden" name="form_front" id="form_front">
770
- <input type="hidden" value="<?php echo plugins_url("",__FILE__) ?>" id="form_plugins_url" />
771
- <input type="hidden" name="pagination" id="pagination" />
772
- <input type="hidden" name="show_title" id="show_title" />
773
- <input type="hidden" name="show_numbers" id="show_numbers" />
774
-
775
- <input type="hidden" name="public_key" id="public_key" />
776
- <input type="hidden" name="private_key" id="private_key" />
777
- <input type="hidden" name="recaptcha_theme" id="recaptcha_theme" />
778
-
779
- <input type="hidden" id="label_order" name="label_order" value="<?php echo $row->label_order;?>" />
780
- <input type="hidden" name="counter" id="counter" value="<?php echo $row->counter;?>">
781
-
782
- <script type="text/javascript">
783
- form_view=1;
784
- form_view_count=1;
785
- form_view_max=1;
786
-
787
- function formOnload()
788
- {
789
- //enable maps
790
- form_view=document.getElementById('form_view');
791
- GLOBAL_tr=form_view.firstChild;
792
-
793
- for (qqq=0; qqq < GLOBAL_tr.childNodes.length; qqq++)
794
- {
795
- td=GLOBAL_tr.childNodes[qqq];
796
- tbody=td.firstChild.firstChild;
797
- for (yyy=0; yyy < tbody.childNodes.length; yyy++)
798
- {
799
-
800
-
801
- tr=tbody.childNodes[yyy];
802
- l_id=tr.id;
803
- add_new_field(l_id);
804
- td=GLOBAL_tr.childNodes[qqq];
805
- tbody=td.firstChild.firstChild;
806
- for (zzz=0; zzz < qqq; zzz++)
807
- {
808
- right_row(l_id);
809
- }
810
- }
811
- }
812
- submitbutton('save_update');
813
-
814
- }
815
-
816
- function formAddToOnload()
817
- {
818
- if(formOldFunctionOnLoad){ formOldFunctionOnLoad(); }
819
- formOnload();
820
- }
821
-
822
- function formLoadBody()
823
- {
824
-
825
- formOldFunctionOnLoad = window.onload;
826
- window.onload = formAddToOnload;
827
- }
828
-
829
- var formOldFunctionOnLoad = null;
830
- formLoadBody();
831
-
832
- function add_new_field(id)
833
- {
834
- enable2();
835
- type=document.getElementById(id).getAttribute('type');
836
- //////////////////////////////parameter take
837
- if(document.getElementById(id+'_element_label').innerHTML)
838
- w_field_label=document.getElementById(id+'_element_label').innerHTML;
839
-
840
- w_choices=new Array();
841
- w_choices_checked=new Array();
842
- w_choices_disabled=new Array();
843
- w_allow_other_num=0;
844
-
845
- if(document.getElementById(id+'_label_and_element_section'))
846
- w_field_label_pos="top";
847
- else
848
- w_field_label_pos="left";
849
-
850
- if(document.getElementById(id+"_element"))
851
- {
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
- {
861
- w_class=document.getElementById(id+'_label_section').getAttribute("class");
862
- if(!w_class)
863
- w_class="";
864
- }
865
-
866
- t=0;
867
- gen=id;
868
- switch(type)
869
- {
870
- case 'type_editor':
871
- {
872
- w_editor=document.getElementById(id+"_element_section").innerHTML;
873
- type_editor(gen, w_editor); add(0); 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); add(0); break;
883
- }
884
- case 'type_password':
885
- {
886
- atrs=return_attributes(id+'_element');
887
- w_attr_name=atrs[0];
888
- w_attr_value=atrs[1];
889
- if(w_class=='')
890
- w_class='wdform_input';
891
- type_password(gen, w_field_label, w_field_label_pos, w_size, w_required, 'no', w_class, w_attr_name, w_attr_value); add(0); break;
892
- }
893
- case 'type_textarea':
894
- {
895
- w_first_val=document.getElementById(id+"_element").value;
896
- w_title=document.getElementById(id+"_element").title;
897
- s=document.getElementById(id+"_element").style.height;
898
- w_size_h=s.substring(0,s.length-2);
899
-
900
- atrs=return_attributes(id+'_element');
901
- w_attr_name=atrs[0];
902
- w_attr_value=atrs[1];
903
- 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); add(0); break;
904
- }
905
- case 'type_name':
906
- {
907
- if(document.getElementById(id+'_element_middle'))
908
- w_name_format="extended";
909
- else
910
- w_name_format="normal";
911
-
912
- w_first_val=['', ''];
913
- w_title=['', ''];
914
-
915
-
916
- s=document.getElementById(id+"_element_first").style.width;
917
- w_size=s.substring(0,s.length-2);
918
- atrs=return_attributes(id+'_element_first');
919
- w_attr_name=atrs[0];
920
- w_attr_value=atrs[1];
921
- 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); add(0); break;
922
- }
923
-
924
- case 'type_submitter_mail':
925
- {
926
- w_first_val=document.getElementById(id+"_element").value;
927
- w_title=document.getElementById(id+"_element").title;
928
- w_send=document.getElementById(id+"_send").value;
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
- <input type="hidden" name="id" value="<?php echo $row->id?>" />
1191
-
1192
- <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
1193
-
1194
- <input type="hidden" name="task" value="" />
1195
- <input type="hidden" id="araqel" value="0" />
1196
-
1197
- </form>
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
- function val()
1218
- {
1219
- var form = document.adminForm;
1220
- submitform();
1221
- }
1222
- function submitform( pressbutton ){
1223
-
1224
- document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task=update";
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
- function update_complete(){
1238
-
1239
- ?>
1240
-
1241
- <div class="updated"><p><strong><?php _e('All forms are updated!'); ?></strong></p></div>
1242
- <?php
1243
-
1244
- }
1245
-
1246
-
1247
-
1248
-
1249
-
1250
-
1251
-
1252
- function html_display_form_lists($rows, $pageNav, $sort,$old_version,$can_update_form){
1253
-
1254
-
1255
-
1256
- global $wpdb;
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
- if(!e) var e = window.event;
1278
-
1279
- e.cancelBubble = true;
1280
- e.returnValue = false;
1281
-
1282
- if (e.stopPropagation) {
1283
- e.stopPropagation();
1284
- e.preventDefault();
1285
- }
1286
- }
1287
- }
1288
- </script>
1289
- <style>.calendar .button
1290
- {
1291
- display:table-cell !important;
1292
- }
1293
- </style>
1294
- <form method="post" onkeypress="doNothing()" action="admin.php?page=Form_maker" id="admin_form" name="admin_form">
1295
- <table cellspacing="10" width="100%">
1296
- <tr>
1297
- <td style="width:50px">
1298
- <img src="<?php echo plugins_url("images/formmakerLogo-48.png",__FILE__); ?>" />
1299
- </td>
1300
- <td style="width:140px;">
1301
- <h2 style="vertical-align:top;">Form Maker</h2> </td>
1302
- <td style="width:90px; text-align:right;"><input class="button-secondary action" type="button" value="Add a Form" name="custom_parametrs" onclick="window.location.href='admin.php?page=Form_maker&task=add_form'" /></td>
1303
- <?php if($old_version && $can_update_form) {?> <td style="width:90px; text-align:right;"><input class="button-primary action" type="button" value=" Update Forms" name="update_forms" onclick="window.location.href='admin.php?page=Form_maker&task=update'" /></td><?php } if(!$can_update_form && $old_version){?> <td style="width:90px; text-align:right;"><input class="button-primary action" type="button" value=" Update Forms" name="update_forms" onclick="alert('You cant update the forms of pro version with the free version. Please get the pro version')" /></td><?php }?>
1304
- <td><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:90%">
1305
- <a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank" style="color:red; text-decoration:none;">
1306
- <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
1307
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
1308
- </a>
1309
- </div></td>
1310
- </tr>
1311
- </table>
1312
- <?php
1313
- $serch_value="";
1314
- if(isset($_POST['serch_or_not'])) {if($_POST['serch_or_not']=="search"){ $serch_value=$_POST['search_events_by_title']; }else{$serch_value="";}}
1315
- $serch_fields='<div class="alignleft actions" style="width:180px;">
1316
- <label for="search_events_by_title" style="font-size:14px">Title: </label>
1317
- <input type="text" name="search_events_by_title" value="'.$serch_value.'" id="search_events_by_title" onchange="clear_serch_texts()">
1318
- </div>
1319
- <div class="alignleft actions">
1320
- <input type="button" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\'; document.getElementById(\'serch_or_not\').value=\'search\';
1321
- document.getElementById(\'admin_form\').submit();" class="button-secondary action">
1322
- <input type="button" value="Reset" onclick="window.location.href=\'admin.php?page=Form_maker\'" class="button-secondary action">
1323
- </div>';
1324
- print_html_nav($pageNav['total'],$pageNav['limit'],$serch_fields);
1325
-
1326
- ?>
1327
- <table class="wp-list-table widefat fixed pages" style="width:95%">
1328
- <thead>
1329
- <TR>
1330
- <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>
1331
- <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>
1332
- <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>
1333
- <th style="width:80px">Edit</th>
1334
- <th style="width:80px">Delete</th>
1335
- </TR>
1336
- </thead>
1337
- <tbody>
1338
- <?php for($i=0; $i<count($rows);$i++){ ?>
1339
- <tr>
1340
- <?php
1341
- $old_version = false;
1342
- if(strpos($rows[$i]->form, "wdform_table1")===false)
1343
- {
1344
- $old_version = true;
1345
- }
1346
- ?>
1347
-
1348
-
1349
-
1350
- <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>
1351
- <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>
1352
- <td><?php echo $rows[$i]->mail; ?></td>
1353
- <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>
1354
- <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>
1355
- </tr>
1356
- <?php } ?>
1357
- </tbody>
1358
- </table>
1359
- <input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if(isset($_POST['asc_or_desc'])) echo $_POST['asc_or_desc'];?>" />
1360
- <input type="hidden" name="order_by" id="order_by" value="<?php if(isset($_POST['order_by'])) echo $_POST['order_by'];?>" />
1361
-
1362
- <?php
1363
- ?>
1364
-
1365
-
1366
-
1367
- </form>
1368
- <?php
1369
-
1370
-
1371
-
1372
-
1373
-
1374
- }
1375
-
1376
-
1377
-
1378
-
1379
-
1380
-
1381
-
1382
-
1383
-
1384
-
1385
- function html_add_form($themes){
1386
- ?>
1387
-
1388
- <script type="text/javascript">
1389
-
1390
-
1391
- var thickDims, tbWidth, tbHeight;
1392
- jQuery(document).ready(function($) {
1393
-
1394
- thickDims = function() {
1395
- var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
1396
-
1397
- w = (tbWidth && tbWidth < W - 90) ? tbWidth : W - 40;
1398
- h = (tbHeight && tbHeight < H - 60) ? tbHeight : H - 40;
1399
-
1400
- if ( tbWindow.size() ) {
1401
- tbWindow.width(w).height(h);
1402
- $('#TB_iframeContent').width(w).height(h - 27);
1403
- tbWindow.css({'margin-left': '-' + parseInt((w / 2),10) + 'px'});
1404
- if ( typeof document.body.style.maxWidth != 'undefined' )
1405
- tbWindow.css({'top':(H-h)/2,'margin-top':'0'});
1406
- }
1407
- };
1408
-
1409
- thickDims();
1410
- $(window).resize( function() { thickDims() } );
1411
-
1412
- $('a.thickbox-preview').click( function() {
1413
- tb_click.call(this);
1414
-
1415
- var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text;
1416
-
1417
- if ( tbWidth = href.match(/&tbWidth=[0-9]+/) )
1418
- tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
1419
- else
1420
- tbWidth = $(window).width() - 120;
1421
-
1422
- if ( tbHeight = href.match(/&tbHeight=[0-9]+/) )
1423
- tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
1424
- else
1425
- tbHeight = $(window).height() - 120;
1426
-
1427
- if ( alink.length ) {
1428
- url = alink.attr('href') || '';
1429
- text = alink.attr('title') || '';
1430
- link = '&nbsp; <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
1431
- } else {
1432
- text = $(this).attr('title') || '';
1433
- link = '&nbsp; <span class="tb-theme-preview-link">' + text + '</span>';
1434
- }
1435
-
1436
- $('#TB_title').css({'background-color':'#222','color':'#dfdfdf'});
1437
- $('#TB_closeAjaxWindow').css({'float':'left'});
1438
- $('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
1439
-
1440
- $('#TB_iframeContent').width('100%');
1441
- thickDims();
1442
-
1443
- return false;
1444
- } );
1445
-
1446
- // Theme details
1447
- $('.theme-detail').click(function () {
1448
- $(this).siblings('.themedetaildiv').toggle();
1449
- return false;
1450
- });
1451
-
1452
- });
1453
- function refresh_()
1454
- {
1455
-
1456
- document.getElementById('form').value=document.getElementById('take').innerHTML;
1457
- document.getElementById('counter').value=gen;
1458
-
1459
-
1460
-
1461
-
1462
-
1463
- n=gen;
1464
- for(i=0; i<n; i++)
1465
- {
1466
- if(document.getElementById(i))
1467
- {
1468
- for(z=0; z<document.getElementById(i).childNodes.length; z++)
1469
- if(document.getElementById(i).childNodes[z].nodeType==3)
1470
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
1471
-
1472
- if(document.getElementById(i).getAttribute('type')=="type_captcha" || document.getElementById(i).getAttribute('type')=="type_recaptcha")
1473
- {
1474
- if(document.getElementById(i).childNodes[10])
1475
- {
1476
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1477
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1478
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1479
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1480
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1481
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1482
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1483
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1484
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1485
- }
1486
- else
1487
- {
1488
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1489
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1490
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1491
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1492
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1493
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1494
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1495
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1496
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1497
- }
1498
- continue;
1499
- }
1500
-
1501
- if(document.getElementById(i).getAttribute('type')=="type_section_break")
1502
- {
1503
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1504
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1505
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1506
- continue;
1507
- }
1508
-
1509
-
1510
- if(document.getElementById(i).childNodes[10])
1511
- {
1512
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1513
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1514
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1515
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1516
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1517
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1518
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1519
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1520
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1521
- }
1522
- else
1523
- {
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
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1528
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1529
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1530
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1531
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1532
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1533
- }
1534
- }
1535
- }
1536
-
1537
- for(i=0; i<=n; i++)
1538
- {
1539
- if(document.getElementById(i))
1540
- {
1541
- type=document.getElementById(i).getAttribute("type");
1542
- switch(type)
1543
- {
1544
- case "type_text":
1545
- case "type_number":
1546
- case "type_password":
1547
- case "type_submitter_mail":
1548
- case "type_own_select":
1549
- case "type_country":
1550
- case "type_hidden":
1551
- case "type_map":
1552
- {
1553
- remove_add_(i+"_elementform_id_temp");
1554
- break;
1555
- }
1556
-
1557
- case "type_submit_reset":
1558
- {
1559
- remove_add_(i+"_element_submitform_id_temp");
1560
- if(document.getElementById(i+"_element_resetform_id_temp"))
1561
- remove_add_(i+"_element_resetform_id_temp");
1562
- break;
1563
- }
1564
-
1565
- case "type_captcha":
1566
- {
1567
- remove_add_("_wd_captchaform_id_temp");
1568
- remove_add_("_element_refreshform_id_temp");
1569
- remove_add_("_wd_captcha_inputform_id_temp");
1570
- break;
1571
- }
1572
-
1573
- case "type_recaptcha":
1574
- {
1575
- document.getElementById("public_key").value = document.getElementById("wd_recaptchaform_id_temp").getAttribute("public_key");
1576
- document.getElementById("private_key").value= document.getElementById("wd_recaptchaform_id_temp").getAttribute("private_key");
1577
- document.getElementById("recaptcha_theme").value= document.getElementById("wd_recaptchaform_id_temp").getAttribute("theme");
1578
- document.getElementById('wd_recaptchaform_id_temp').innerHTML='';
1579
- remove_add_("wd_recaptchaform_id_temp");
1580
- break;
1581
- }
1582
-
1583
- case "type_file_upload":
1584
- {
1585
- remove_add_(i+"_elementform_id_temp");
1586
- break;
1587
- }
1588
-
1589
- case "type_textarea":
1590
- {
1591
- remove_add_(i+"_elementform_id_temp");
1592
-
1593
- break;
1594
- }
1595
-
1596
- case "type_name":
1597
- {
1598
-
1599
- if(document.getElementById(i+"_element_titleform_id_temp"))
1600
- {
1601
- remove_add_(i+"_element_titleform_id_temp");
1602
- remove_add_(i+"_element_firstform_id_temp");
1603
- remove_add_(i+"_element_lastform_id_temp");
1604
- remove_add_(i+"_element_middleform_id_temp");
1605
- }
1606
- else
1607
- {
1608
- remove_add_(i+"_element_firstform_id_temp");
1609
- remove_add_(i+"_element_lastform_id_temp");
1610
-
1611
- }
1612
- break;
1613
-
1614
- }
1615
-
1616
- case "type_phone":
1617
- {
1618
-
1619
- remove_add_(i+"_element_firstform_id_temp");
1620
- remove_add_(i+"_element_lastform_id_temp");
1621
-
1622
- break;
1623
-
1624
- }
1625
- case "type_address":
1626
- {
1627
- remove_add_(i+"_street1form_id_temp");
1628
- remove_add_(i+"_street2form_id_temp");
1629
- remove_add_(i+"_cityform_id_temp");
1630
- remove_add_(i+"_stateform_id_temp");
1631
- remove_add_(i+"_postalform_id_temp");
1632
- remove_add_(i+"_countryform_id_temp");
1633
-
1634
- break;
1635
-
1636
- }
1637
-
1638
-
1639
- case "type_checkbox":
1640
- case "type_radio":
1641
- {
1642
- is=true;
1643
- for(j=0; j<100; j++)
1644
- if(document.getElementById(i+"_elementform_id_temp"+j))
1645
- {
1646
- remove_add_(i+"_elementform_id_temp"+j);
1647
- }
1648
- /* if(document.getElementById(i+"_randomize").value=="yes")
1649
- choises_randomize(i);*/
1650
-
1651
- break;
1652
- }
1653
-
1654
- case "type_button":
1655
- {
1656
- for(j=0; j<100; j++)
1657
- if(document.getElementById(i+"_elementform_id_temp"+j))
1658
- {
1659
- remove_add_(i+"_elementform_id_temp"+j);
1660
- }
1661
- break;
1662
- }
1663
-
1664
- case "type_time":
1665
- {
1666
- if(document.getElementById(i+"_ssform_id_temp"))
1667
- {
1668
- remove_add_(i+"_ssform_id_temp");
1669
- remove_add_(i+"_mmform_id_temp");
1670
- remove_add_(i+"_hhform_id_temp");
1671
- }
1672
- else
1673
- {
1674
- remove_add_(i+"_mmform_id_temp");
1675
- remove_add_(i+"_hhform_id_temp");
1676
- }
1677
- break;
1678
-
1679
- }
1680
-
1681
- case "type_date":
1682
- {
1683
- remove_add_(i+"_elementform_id_temp");
1684
- remove_add_(i+"_buttonform_id_temp");
1685
- break;
1686
- }
1687
- case "type_date_fields":
1688
- {
1689
- remove_add_(i+"_dayform_id_temp");
1690
- remove_add_(i+"_monthform_id_temp");
1691
- remove_add_(i+"_yearform_id_temp");
1692
- break;
1693
- }
1694
- }
1695
- }
1696
- }
1697
-
1698
- for(i=1; i<=form_view_max; i++)
1699
- if(document.getElementById('form_id_tempform_view'+i))
1700
- {
1701
- if(document.getElementById('page_next_'+i))
1702
- document.getElementById('page_next_'+i).removeAttribute('src');
1703
- if(document.getElementById('page_previous_'+i))
1704
- document.getElementById('page_previous_'+i).removeAttribute('src');
1705
- document.getElementById('form_id_tempform_view'+i).parentNode.removeChild(document.getElementById('form_id_tempform_view_img'+i));
1706
- document.getElementById('form_id_tempform_view'+i).removeAttribute('style');
1707
- }
1708
-
1709
- document.getElementById('form_front').value=document.getElementById('take').innerHTML;
1710
-
1711
- }
1712
-
1713
- function submitform( pressbutton ){
1714
-
1715
- document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
1716
- document.getElementById('adminForm').submit();
1717
-
1718
- }
1719
-
1720
-
1721
-
1722
-
1723
-
1724
- function submitbutton(pressbutton){
1725
-
1726
- var form = document.adminForm;
1727
- if (pressbutton == 'cancel')
1728
- {
1729
- submitform( pressbutton );
1730
- return;
1731
- }
1732
-
1733
- if (form.title.value == "")
1734
- {
1735
- alert( "The form must have a title." );
1736
- return ;
1737
- }
1738
-
1739
- if(form.mail.value!='')
1740
- {
1741
- subMailArr=form.mail.value.split(',');
1742
- emailListValid=true;
1743
- for(subMailIt=0; subMailIt<subMailArr.length; subMailIt++)
1744
- {
1745
- trimmedMail = subMailArr[subMailIt].replace(/^\s+|\s+$/g, '') ;
1746
- if (trimmedMail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1)
1747
- {
1748
- alert( "This is not a list of valid email addresses." );
1749
- emailListValid=false;
1750
- break;
1751
- }
1752
- }
1753
- if(!emailListValid)
1754
- return;
1755
- }
1756
-
1757
- tox='';
1758
-
1759
- for(t=1;t<=form_view_max;t++)
1760
- {
1761
- if(document.getElementById('form_id_tempform_view'+t))
1762
- {
1763
- form_view_element=document.getElementById('form_id_tempform_view'+t);
1764
- n=form_view_element.childNodes.length-2;
1765
-
1766
- for(z=0;z<=n;z++)
1767
- {
1768
- if(form_view_element.childNodes[z].nodeType!=3)
1769
- if(!form_view_element.childNodes[z].id)
1770
- {
1771
- GLOBAL_tr=form_view_element.childNodes[z];
1772
- //////////////////////////////////////////////////////////////////////////////////////////
1773
- for (x=0; x < GLOBAL_tr.firstChild.childNodes.length; x++)
1774
- {
1775
- table=GLOBAL_tr.firstChild.childNodes[x];
1776
- tbody=table.firstChild;
1777
- for (y=0; y < tbody.childNodes.length; y++)
1778
- {
1779
- tr=tbody.childNodes[y];
1780
- l_label = document.getElementById( tr.id+'_element_labelform_id_temp').innerHTML;
1781
- l_label = l_label.replace(/(\r\n|\n|\r)/gm," ");
1782
-
1783
- if(tr.getAttribute('type')=="type_address")
1784
- {
1785
- addr_id=parseInt(tr.id);
1786
- tox=tox+addr_id+'#**id**#'+'Street Line'+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
1787
- tox=tox+addr_id+'#**id**#'+'Street Line2'+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
1788
- tox=tox+addr_id+'#**id**#'+'City'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1789
- tox=tox+addr_id+'#**id**#'+'State'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1790
- tox=tox+addr_id+'#**id**#'+'Postal'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1791
- tox=tox+addr_id+'#**id**#'+'Country'+'#**label**#'+tr.getAttribute('type')+'#****#';
1792
- }
1793
- else
1794
- tox=tox+tr.id+'#**id**#'+l_label+'#**label**#'+tr.getAttribute('type')+'#****#';
1795
- }
1796
- }
1797
- }
1798
- }
1799
- }
1800
- }
1801
-
1802
- document.getElementById('label_order').value=tox;
1803
- refresh_();
1804
- document.getElementById('pagination').value=document.getElementById('pages').getAttribute("type");
1805
- document.getElementById('show_title').value=document.getElementById('pages').getAttribute("show_title");
1806
- document.getElementById('show_numbers').value=document.getElementById('pages').getAttribute("show_numbers");
1807
-
1808
- submitform( pressbutton );
1809
-
1810
- }
1811
- gen=1;
1812
- form_view=1;
1813
- form_view_max=1;
1814
- form_view_count=1;
1815
-
1816
- function set_preview()
1817
- {
1818
- appWidth =parseInt(document.body.offsetWidth);
1819
- appHeight =parseInt(document.body.offsetHeight);
1820
- document.getElementById('preview_form').href='<?php echo admin_url('admin-ajax.php'); ?>?action=frommakerpreview&id='+document.getElementById('theme').value+'&TB_iframe=1';
1821
- }
1822
-
1823
-
1824
- //add main form id
1825
- function enable()
1826
- {
1827
- for(iiiii=0; iiiii<1000;iiiii++)
1828
- {
1829
- if(document.getElementsByTagName("iframe")[iiiii]){
1830
- if(document.getElementsByTagName("iframe")[iiiii].id=='form_maker_editor_ifr'){
1831
- id_ifr_editor=iiiii;
1832
- break;
1833
- }
1834
- }
1835
- }
1836
- alltypes=Array('customHTML','text','checkbox','radio','time_and_date','select','file_upload','captcha','map','button','page_break','section_break');
1837
- for(x=0; x<12;x++)
1838
- {
1839
- document.getElementById('img_'+alltypes[x]).src="<?php echo plugins_url("images",__FILE__) ?>/"+alltypes[x]+".png";
1840
- }
1841
-
1842
- document.getElementById('formMakerDiv').style.display =(document.getElementById('formMakerDiv').style.display=='block'?'none':'block');
1843
- document.getElementById('formMakerDiv1').style.display =(document.getElementById('formMakerDiv1').style.display=='block'?'none':'block');
1844
- if(document.getElementById('formMakerDiv').offsetWidth)
1845
- document.getElementById('formMakerDiv1').style.width =(document.getElementById('formMakerDiv').offsetWidth - 60)+'px';
1846
- document.getElementById('when_edit').style.display ='none';
1847
- }
1848
-
1849
- function enable2()
1850
- {
1851
- alltypes=Array('customHTML','text','checkbox','radio','time_and_date','select','file_upload','captcha','map','button','page_break','section_break');
1852
- for(x=0; x<12;x++)
1853
- {
1854
- document.getElementById('img_'+alltypes[x]).src="<?php echo plugins_url("images",__FILE__) ?>/"+alltypes[x]+".png";
1855
- }
1856
-
1857
- document.getElementById('formMakerDiv').style.display =(document.getElementById('formMakerDiv').style.display=='block'?'none':'block');
1858
- document.getElementById('formMakerDiv1').style.display =(document.getElementById('formMakerDiv1').style.display=='block'?'none':'block');
1859
- if(document.getElementById('formMakerDiv').offsetWidth)
1860
- document.getElementById('formMakerDiv1').style.width =(document.getElementById('formMakerDiv').offsetWidth - 60)+'px';
1861
- document.getElementById('when_edit').style.display ='block';
1862
- if(document.getElementById('field_types').offsetWidth)
1863
- document.getElementById('when_edit').style.width =document.getElementById('field_types').offsetWidth+'px';
1864
-
1865
- if(document.getElementById('field_types').offsetHeight)
1866
- document.getElementById('when_edit').style.height =document.getElementById('field_types').offsetHeight+'px';
1867
-
1868
- }
1869
-
1870
-
1871
-
1872
- var thickDims, tbWidth, tbHeight;
1873
- jQuery(document).ready(function($) {
1874
-
1875
- thickDims = function() {
1876
- var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
1877
-
1878
- w = (tbWidth && tbWidth < W - 90) ? tbWidth : W - 40;
1879
- h = (tbHeight && tbHeight < H - 60) ? tbHeight : H - 40;
1880
-
1881
- if ( tbWindow.size() ) {
1882
- tbWindow.width(w).height(h);
1883
- $('#TB_iframeContent').width(w).height(h - 27);
1884
- tbWindow.css({'margin-left': '-' + parseInt((w / 2),10) + 'px'});
1885
- if ( typeof document.body.style.maxWidth != 'undefined' )
1886
- tbWindow.css({'top':(H-h)/2,'margin-top':'0'});
1887
- }
1888
- };
1889
-
1890
- thickDims();
1891
- $(window).resize( function() { thickDims() } );
1892
-
1893
- $('a.thickbox-preview').click( function() {
1894
- tb_click.call(this);
1895
-
1896
- var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text;
1897
-
1898
- if ( tbWidth = href.match(/&tbWidth=[0-9]+/) )
1899
- tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
1900
- else
1901
- tbWidth = $(window).width() - 120;
1902
-
1903
- if ( tbHeight = href.match(/&tbHeight=[0-9]+/) )
1904
- tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
1905
- else
1906
- tbHeight = $(window).height() - 120;
1907
-
1908
- if ( alink.length ) {
1909
- url = alink.attr('href') || '';
1910
- text = alink.attr('title') || '';
1911
- link = '&nbsp; <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
1912
- } else {
1913
- text = $(this).attr('title') || '';
1914
- link = '&nbsp; <span class="tb-theme-preview-link">' + text + '</span>';
1915
- }
1916
-
1917
- $('#TB_title').css({'background-color':'#222','color':'#dfdfdf'});
1918
- $('#TB_closeAjaxWindow').css({'float':'left'});
1919
- $('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
1920
-
1921
- $('#TB_iframeContent').width('100%');
1922
- thickDims();
1923
-
1924
- return false;
1925
- } );
1926
-
1927
- // Theme details
1928
- $('.theme-detail').click(function () {
1929
- $(this).siblings('.themedetaildiv').toggle();
1930
- return false;
1931
- });
1932
-
1933
- });
1934
-
1935
- </script>
1936
- <style>
1937
- .calendar .button
1938
- {
1939
- display:table-cell !important;
1940
- }
1941
- #when_edit
1942
- {
1943
- position:absolute;
1944
- background-color:#666;
1945
- z-index:101;
1946
- display:none;
1947
- width:100%;
1948
- height:100%;
1949
- opacity: 0.7;
1950
- filter: alpha(opacity = 70);
1951
- }
1952
- #formMakerDiv
1953
- {
1954
- position:fixed;
1955
- background-color:#666;
1956
- z-index:100;
1957
- display:none;
1958
- left:0;
1959
- top:0;
1960
- width:100%;
1961
- height:100%;
1962
- opacity: 0.7;
1963
- filter: alpha(opacity = 70);
1964
- }
1965
- #formMakerDiv1
1966
- {
1967
- padding-top:20px;
1968
- position:fixed;
1969
- z-index:100;
1970
- background-color:transparent;
1971
- top:0;
1972
- left:0;
1973
- display:none;
1974
- margin-left:30px;
1975
- margin-top:15px;
1976
- }
1977
- </style>
1978
- <?php
1979
- foreach($themes as $theme)
1980
- {
1981
- if($theme->default == 1 )
1982
- {
1983
- $my_selected_theme=$theme->id;
1984
-
1985
- }
1986
- else{
1987
- $my_selected_theme=0;
1988
- }
1989
-
1990
- }
1991
- ?>
1992
- <table width="95%">
1993
- <thead>
1994
- <tr>
1995
- <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
1996
- <a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank" style="color:red; text-decoration:none;">
1997
- <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
1998
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
1999
- </a>
2000
- </div></td>
2001
- </tr>
2002
- </thead>
2003
- <tr>
2004
- <td width="100%" ><?php echo "<h2>Form Maker</h2>"; ?></td>
2005
- <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>
2006
- <td><input type="button" onclick="submitbutton('Actions_after_submission')" value="Actions after submission" class="button-primary" /> </td>
2007
- <td> <input type="button" onclick="submitbutton('Edit_JavaScript')" value="Edit JavaScript" class="button-primary" /> </td>
2008
- <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>
2009
- <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>
2010
- <td align="right"><input type="button" onclick="submitbutton('Save')" value="Save" class="button-secondary action" /> </td>
2011
- <td align="right"><input type="button" onclick="submitbutton('Apply')" value="Apply" class="button-secondary action"/> </td>
2012
- <td align="right"><input type="button" onclick="window.location.href='admin.php?page=Form_maker'" value="Cancel" 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
- <table style="border:6px #00aeef solid; background-color:#00aeef " width="95%" cellpadding="0" cellspacing="0">
2019
- <tr>
2020
-
2021
-
2022
- <td align="left" valign="middle" rowspan="3" style="padding:10px;">
2023
- <img src="<?php echo plugins_url("images/formmaker.png",__FILE__) ?>" />
2024
- </td>
2025
-
2026
- <td width="300" align="right" valign="middle">
2027
-
2028
- <span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Form title:&nbsp;&nbsp;</span>
2029
-
2030
- </td>
2031
-
2032
- <td width="153" height="30px" align="center" valign="middle">
2033
-
2034
- <div style="background-image:url(<?php echo plugins_url("images/input.png",__FILE__) ?>); height:19px">
2035
- <input type="hidden" value="<?php echo plugins_url("",__FILE__) ?>" id="form_plugins_url" />
2036
- <input id="title" name="title" style="background:none; padding:inherit; width:151px; height:19px; border:none; font-size:11px; " />
2037
-
2038
- </div>
2039
-
2040
- </td>
2041
-
2042
- </tr>
2043
-
2044
-
2045
- <tr>
2046
-
2047
- <td width="300" align="right" valign="middle">
2048
-
2049
- <span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Email to send submissions to:&nbsp;&nbsp;</span>
2050
-
2051
- </td>
2052
-
2053
- <td width="153" height="30px" align="center" valign="middle">
2054
-
2055
- <div style="background-image:url(<?php echo plugins_url("images/input.png",__FILE__) ?>); height:19px">
2056
-
2057
- <input id="mail" name="mail" style="background:none; padding:inherit; width:151px; height:19px; border:none; font-size:11px" />
2058
-
2059
- </div>
2060
-
2061
- </td>
2062
-
2063
- </tr>
2064
-
2065
- <tr>
2066
-
2067
- <td width="300" align="right" valign="middle">
2068
-
2069
- <span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Theme:&nbsp;&nbsp;</span>
2070
-
2071
- </td>
2072
-
2073
- <td width="153" height="30px" align="center" valign="middle">
2074
-
2075
- <div style="height:19px">
2076
-
2077
- <select id="theme" name="theme" style="background:transparent; width:151px; height:19px; border:none; font-size:11px" onChange="set_preview()" >
2078
-
2079
- <?php
2080
- $form_theme='';
2081
- foreach($themes as $theme)
2082
- {
2083
- if($theme->default == 1 )
2084
- {
2085
- echo '<option value="'.$theme->id.'" selected>'.$theme->title.'</option>';
2086
- $form_theme=$theme->css;
2087
- }
2088
- else
2089
- echo '<option value="'.$theme->id.'">'.$theme->title.'</option>';
2090
-
2091
- }
2092
- ?>
2093
- </select>
2094
-
2095
- </div>
2096
-
2097
- </td>
2098
-
2099
- </tr>
2100
-
2101
-
2102
-
2103
- <tr>
2104
- <td align="left" colspan="3">
2105
-
2106
- <img src="<?php echo plugins_url("images/addanewfield.png",__FILE__) ?>" onclick="enable(); Enable()" style="cursor:pointer;margin:10px;" />
2107
-
2108
- </td>
2109
- </tr>
2110
- </table>
2111
-
2112
-
2113
-
2114
- <div id="formMakerDiv" onclick="close_window()"></div>
2115
-
2116
- <div id="formMakerDiv1" align="center">
2117
-
2118
- <table border="0" width="100%" cellpadding="0" cellspacing="0" height="100%" style="border:6px #00aeef solid; background-color:#FFF">
2119
- <tr>
2120
- <td style="padding:0px">
2121
- <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
2122
- <tr valign="top">
2123
- <td width="15%" height="100%" style="border-right:dotted black 1px;" id="field_types">
2124
- <div id="when_edit" style="display:none"></div>
2125
- <table border="0" cellpadding="0" cellspacing="3" width="100%">
2126
- <tr>
2127
- <td align="center" onClick="addRow('customHTML')" id="table_editor" class="field_buttons"><img src="<?php echo plugins_url("images/customHTML.png",__FILE__); ?>" style="margin:5px" id="img_customHTML"/></td>
2128
-
2129
- <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>
2130
- </tr>
2131
- <tr>
2132
- <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>
2133
-
2134
- <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>
2135
- </tr>
2136
- <tr>
2137
- <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>
2138
-
2139
- <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>
2140
- </tr>
2141
- <tr>
2142
- <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>
2143
-
2144
- <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>
2145
- </tr>
2146
- <tr>
2147
- <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>
2148
-
2149
- <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>
2150
- </tr>
2151
- <tr>
2152
- <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>
2153
-
2154
- <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>
2155
- </tr>
2156
- </table>
2157
- </td>
2158
- <td width="40%" height="100%" align="left"><div id="edit_table" style="padding:0px; overflow-y:scroll; height:531px" ></div></td>
2159
- <td align="center" valign="top" style="background:url(<?php echo plugins_url("images/border2.png",__FILE__); ?>) repeat-y;">&nbsp;</td>
2160
- <td style="padding:15px">
2161
- <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
2162
-
2163
- <tr>
2164
- <td align="right"><input type="radio" value="end" name="el_pos" checked="checked" id="pos_end" onclick="Disable()"/>
2165
- At The End
2166
- <input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
2167
- At The Beginning
2168
- <input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
2169
- Before
2170
- <select style="width:100px; margin-left:5px" id="sel_el_pos" disabled="disabled">
2171
- </select>
2172
- <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)"/>
2173
- <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()"/>
2174
-
2175
- <hr style=" margin-bottom:10px" />
2176
- </td>
2177
- </tr>
2178
-
2179
- <tr height="100%" valign="top">
2180
- <td id="show_table"></td>
2181
- </tr>
2182
-
2183
- </table>
2184
- </td>
2185
- </tr>
2186
- </table>
2187
- </td>
2188
- </tr>
2189
- </table>
2190
- <input type="hidden" id="old" />
2191
- <input type="hidden" id="old_selected" />
2192
- <input type="hidden" id="element_type" />
2193
- <input type="hidden" id="editing_id" />
2194
- <input type="hidden" id="editing_page_break" />
2195
-
2196
-
2197
- <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'){ ?>
2198
- <div style=" max-width:500px; height:300px;text-align:left" id="poststuff">
2199
- <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 ); ?>
2200
- </div>
2201
- </div>
2202
-
2203
- <?php
2204
-
2205
- }
2206
- else{
2207
- echo "<style>#wp-form_maker_editor-media-buttons{ text-align:left }</style>"; wp_editor("","form_maker_editor");
2208
- }
2209
- }
2210
- else
2211
- {
2212
- ?>
2213
- <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>
2214
- <?php
2215
-
2216
- }
2217
- ?></div>
2218
-
2219
-
2220
- </div>
2221
-
2222
- <?php if(!function_exists ('the_editor'))
2223
- ?>
2224
- <iframe id="tinymce" style="display:none"></iframe>
2225
-
2226
- <?php
2227
- ?>
2228
-
2229
-
2230
-
2231
- <br />
2232
- <br />
2233
-
2234
- <fieldset>
2235
-
2236
- <legend>
2237
-
2238
- <h2 style="color:#00aeef">Form</h2>
2239
-
2240
- </legend>
2241
-
2242
- <style><?php global $first_css;
2243
- echo $first_css; ?></style>
2244
-
2245
- <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>
2246
- <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>
2247
- </fieldset>
2248
-
2249
- <input type="hidden" name="form_front" id="form_front" />
2250
- <input type="hidden" name="form" id="form" />
2251
-
2252
- <input type="hidden" name="counter" id="counter" />
2253
-
2254
- <input type="hidden" name="pagination" id="pagination" />
2255
- <input type="hidden" name="show_title" id="show_title" />
2256
- <input type="hidden" name="show_numbers" id="show_numbers" />
2257
-
2258
- <input type="hidden" name="public_key" id="public_key" />
2259
- <input type="hidden" name="private_key" id="private_key" />
2260
- <input type="hidden" name="recaptcha_theme" id="recaptcha_theme" />
2261
-
2262
- <input type="hidden" name="label_order" id="label_order" />
2263
- <input type="hidden" name="option" value="com_formmaker" />
2264
-
2265
- <input type="hidden" name="task" value="" />
2266
-
2267
- </form>
2268
-
2269
-
2270
- <script>
2271
- plugin_url=document.getElementById('form_plugins_url').value;
2272
- //appWidth =parseInt(document.body.offsetWidth);
2273
- //appHeight =parseInt(document.body.offsetHeight);
2274
- //document.getElementById('toolbar-popup-popup').childNodes[1].href='index.php?option=com_formmaker&task=preview&tmpl=component&theme='+document.getElementById('theme').value;
2275
- //document.getElementById('toolbar-popup-popup').childNodes[1].setAttribute('rel',"{handler: 'iframe', size: {x:"+(appWidth-100)+", y: "+(appHeight-30)+"}}");
2276
- </script>
2277
- <?php
2278
-
2279
-
2280
- }
2281
-
2282
-
2283
-
2284
-
2285
-
2286
-
2287
-
2288
-
2289
-
2290
-
2291
-
2292
-
2293
-
2294
-
2295
- function html_edit_form_maker($row, $labels, $themes){
2296
-
2297
- ?>
2298
-
2299
- <script type="text/javascript">
2300
-
2301
- function gagoo(vvvv) {
2302
- alert('ffff');
2303
- tb_click.call(vvvv);
2304
-
2305
- var alink = $(vvvv).parents('.available-theme').find('.activatelink'), link = '', href = $(vvvv).attr('href'), url, text;
2306
-
2307
- if ( tbWidth = href.match(/&tbWidth=[0-9]+/) )
2308
- tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
2309
- else
2310
- tbWidth = $(window).width() - 120;
2311
-
2312
- if ( tbHeight = href.match(/&tbHeight=[0-9]+/) )
2313
- tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
2314
- else
2315
- tbHeight = $(window).height() - 120;
2316
-
2317
- if ( alink.length ) {
2318
- url = alink.attr('href') || '';
2319
- text = alink.attr('title') || '';
2320
- link = '&nbsp; <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
2321
- } else {
2322
- text = $(vvvv).attr('title') || '';
2323
- link = '&nbsp; <span class="tb-theme-preview-link">' + text + '</span>';
2324
- }
2325
-
2326
- $('#TB_title').css({'background-color':'#222','color':'#dfdfdf'});
2327
- $('#TB_closeAjaxWindow').css({'float':'left'});
2328
- $('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
2329
-
2330
- $('#TB_iframeContent').width('100%');
2331
- thickDims();
2332
-
2333
- return false;
2334
- }
2335
-
2336
-
2337
-
2338
-
2339
- function submitform( pressbutton ){
2340
-
2341
- document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
2342
- document.getElementById('adminForm').submit();
2343
-
2344
- }
2345
- function submitbutton(pressbutton)
2346
-
2347
- {
2348
-
2349
- if(!document.getElementById('araqel'))
2350
- {
2351
- alert('Please wait while page loading');
2352
- return;
2353
- }
2354
- else
2355
- if(document.getElementById('araqel').value=='0')
2356
- {
2357
- alert('Please wait while page loading');
2358
- return;
2359
- }
2360
-
2361
- var form = document.adminForm;
2362
-
2363
- if (pressbutton == 'cancel')
2364
-
2365
- {
2366
-
2367
- submitform( pressbutton );
2368
-
2369
- return;
2370
-
2371
- }
2372
-
2373
- if (form.title.value == "")
2374
-
2375
- {
2376
-
2377
- alert( "The form must have a title." );
2378
- return;
2379
-
2380
- }
2381
-
2382
- if(form.mail.value!='')
2383
- {
2384
- subMailArr=form.mail.value.split(',');
2385
- emailListValid=true;
2386
- for(subMailIt=0; subMailIt<subMailArr.length; subMailIt++)
2387
- {
2388
- trimmedMail = subMailArr[subMailIt].replace(/^\s+|\s+$/g, '') ;
2389
- if (trimmedMail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1)
2390
- {
2391
- alert( "This is not a list of valid email addresses." );
2392
- emailListValid=false;
2393
- break;
2394
- }
2395
- }
2396
- if(!emailListValid)
2397
- return
2398
-
2399
- }
2400
-
2401
- tox='';
2402
- l_id_array=[<?php echo $labels['id']?>];
2403
- l_label_array=[<?php echo $labels['label']?>];
2404
- l_type_array=[<?php echo $labels['type']?>];
2405
- l_id_removed=[];
2406
-
2407
- for(x=0; x< l_id_array.length; x++)
2408
- {
2409
- l_id_removed[x]=true;
2410
- }
2411
-
2412
- for(t=1;t<=form_view_max;t++)
2413
- {
2414
- if(document.getElementById('form_id_tempform_view'+t))
2415
- {
2416
- form_view_element=document.getElementById('form_id_tempform_view'+t);
2417
- n=form_view_element.childNodes.length-2;
2418
-
2419
- for(q=0;q<=n;q++)
2420
- {
2421
- if(form_view_element.childNodes[q].nodeType!=3)
2422
- if(!form_view_element.childNodes[q].id)
2423
- {
2424
- GLOBAL_tr=form_view_element.childNodes[q];
2425
-
2426
- for (x=0; x < GLOBAL_tr.firstChild.childNodes.length; x++)
2427
- {
2428
-
2429
- table=GLOBAL_tr.firstChild.childNodes[x];
2430
- tbody=table.firstChild;
2431
- for (y=0; y < tbody.childNodes.length; y++)
2432
- {
2433
- is_in_old=false;
2434
- tr=tbody.childNodes[y];
2435
- l_id=tr.id;
2436
-
2437
- l_label=document.getElementById( tr.id+'_element_labelform_id_temp').innerHTML;
2438
- l_label = l_label.replace(/(\r\n|\n|\r)/gm," ");
2439
- l_type=tr.getAttribute('type');
2440
- for(z=0; z< l_id_array.length; z++)
2441
- {
2442
- if(l_id_array[z]==l_id)
2443
- {
2444
- l_id_removed[z]=false;
2445
- if(l_type_array[z]=="type_address")
2446
- {
2447
- z++;
2448
- l_id_removed[z]=false;
2449
- z++;
2450
- l_id_removed[z]=false;
2451
- z++;
2452
- l_id_removed[z]=false;
2453
- z++;
2454
- l_id_removed[z]=false;
2455
- z++;
2456
- l_id_removed[z]=false;
2457
- }
2458
- }
2459
- }
2460
-
2461
- if(tr.getAttribute('type')=="type_address")
2462
- {
2463
- addr_id=parseInt(tr.id);
2464
- tox=tox+addr_id+'#**id**#'+'Street Line'+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
2465
- tox=tox+addr_id+'#**id**#'+'Street Line2'+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
2466
- tox=tox+addr_id+'#**id**#'+'City'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
2467
- tox=tox+addr_id+'#**id**#'+'State'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
2468
- tox=tox+addr_id+'#**id**#'+'Postal'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
2469
- tox=tox+addr_id+'#**id**#'+'Country'+'#**label**#'+tr.getAttribute('type')+'#****#';
2470
- }
2471
- else
2472
- tox=tox+l_id+'#**id**#'+l_label+'#**label**#'+l_type+'#****#';
2473
-
2474
-
2475
-
2476
- }
2477
- }
2478
- }
2479
- }
2480
- }
2481
- }
2482
- for(x=0; x< l_id_array.length; x++)
2483
- {
2484
- if(l_id_removed[x])
2485
- tox=tox+l_id_array[x]+'#**id**#'+l_label_array[x]+'#**label**#'+l_type_array[x]+'#****#';
2486
- }
2487
-
2488
-
2489
- document.getElementById('label_order').value=tox;
2490
-
2491
-
2492
- refresh_()
2493
- document.getElementById('pagination').value=document.getElementById('pages').getAttribute("type");
2494
- document.getElementById('show_title').value=document.getElementById('pages').getAttribute("show_title");
2495
- document.getElementById('show_numbers').value=document.getElementById('pages').getAttribute("show_numbers");
2496
-
2497
-
2498
- submitform( pressbutton );
2499
- }
2500
-
2501
- function remove_whitespace(node)
2502
- {
2503
- for (ttt=0; ttt < node.childNodes.length; ttt++)
2504
- {
2505
- if( node.childNodes[ttt].nodeType == '3')
2506
- {
2507
- if(!node.childNodes[ttt])
2508
- node.removeChild(node.childNodes[ttt]);
2509
- }
2510
- else
2511
- {
2512
- if(node.childNodes[ttt].childNodes.length)
2513
- remove_whitespace(node.childNodes[ttt]);
2514
- }
2515
- }
2516
- return
2517
- }
2518
-
2519
- function refresh_()
2520
- {
2521
-
2522
- document.getElementById('form').value=document.getElementById('take').innerHTML;
2523
- document.getElementById('counter').value=gen;
2524
- n=gen;
2525
- for(i=0; i<n; i++)
2526
- {
2527
- if(document.getElementById(i))
2528
- {
2529
- for(z=0; z<document.getElementById(i).childNodes.length; z++)
2530
- if(document.getElementById(i).childNodes[z].nodeType==3)
2531
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
2532
-
2533
- if(document.getElementById(i).getAttribute('type')=="type_captcha" || document.getElementById(i).getAttribute('type')=="type_recaptcha")
2534
- {
2535
- if(document.getElementById(i).childNodes[10])
2536
- {
2537
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
2538
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
2539
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
2540
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
2541
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
2542
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
2543
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
2544
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
2545
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
2546
- }
2547
- else
2548
- {
2549
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
2550
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
2551
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
2552
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
2553
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
2554
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
2555
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
2556
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
2557
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
2558
- }
2559
- continue;
2560
- }
2561
-
2562
- if(document.getElementById(i).getAttribute('type')=="type_section_break")
2563
- {
2564
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
2565
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
2566
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
2567
- continue;
2568
- }
2569
-
2570
-
2571
-
2572
- if(document.getElementById(i).childNodes[10])
2573
- {
2574
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
2575
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
2576
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
2577
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
2578
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
2579
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
2580
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
2581
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
2582
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
2583
- }
2584
- else
2585
- {
2586
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
2587
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
2588
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
2589
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
2590
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
2591
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
2592
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
2593
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
2594
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
2595
- }
2596
- }
2597
- }
2598
-
2599
- for(i=0; i<=n; i++)
2600
- {
2601
- if(document.getElementById(i))
2602
- {
2603
- type=document.getElementById(i).getAttribute("type");
2604
- switch(type)
2605
- {
2606
- case "type_text":
2607
- case "type_number":
2608
- case "type_password":
2609
- case "type_submitter_mail":
2610
- case "type_own_select":
2611
- case "type_country":
2612
- case "type_hidden":
2613
- case "type_map":
2614
- {
2615
- remove_add_(i+"_elementform_id_temp");
2616
- break;
2617
- }
2618
-
2619
- case "type_submit_reset":
2620
- {
2621
- remove_add_(i+"_element_submitform_id_temp");
2622
- if(document.getElementById(i+"_element_resetform_id_temp"))
2623
- remove_add_(i+"_element_resetform_id_temp");
2624
- break;
2625
- }
2626
-
2627
- case "type_captcha":
2628
- {
2629
- remove_add_("_wd_captchaform_id_temp");
2630
- remove_add_("_element_refreshform_id_temp");
2631
- remove_add_("_wd_captcha_inputform_id_temp");
2632
- break;
2633
- }
2634
-
2635
- case "type_recaptcha":
2636
- {
2637
- document.getElementById("public_key").value = document.getElementById("wd_recaptchaform_id_temp").getAttribute("public_key");
2638
- document.getElementById("private_key").value= document.getElementById("wd_recaptchaform_id_temp").getAttribute("private_key");
2639
- document.getElementById("recaptcha_theme").value= document.getElementById("wd_recaptchaform_id_temp").getAttribute("theme");
2640
- document.getElementById('wd_recaptchaform_id_temp').innerHTML='';
2641
- remove_add_("wd_recaptchaform_id_temp");
2642
- break;
2643
- }
2644
-
2645
- case "type_file_upload":
2646
- {
2647
- remove_add_(i+"_elementform_id_temp");
2648
-
2649
- break;
2650
- }
2651
-
2652
- case "type_textarea":
2653
- {
2654
- remove_add_(i+"_elementform_id_temp");
2655
-
2656
- break;
2657
- }
2658
-
2659
- case "type_name":
2660
- {
2661
-
2662
- if(document.getElementById(i+"_element_titleform_id_temp"))
2663
- {
2664
- remove_add_(i+"_element_titleform_id_temp");
2665
- remove_add_(i+"_element_firstform_id_temp");
2666
- remove_add_(i+"_element_lastform_id_temp");
2667
- remove_add_(i+"_element_middleform_id_temp");
2668
- }
2669
- else
2670
- {
2671
- remove_add_(i+"_element_firstform_id_temp");
2672
- remove_add_(i+"_element_lastform_id_temp");
2673
- }
2674
- break;
2675
-
2676
- }
2677
-
2678
- case "type_phone":
2679
- {
2680
-
2681
- remove_add_(i+"_element_firstform_id_temp");
2682
- remove_add_(i+"_element_lastform_id_temp");
2683
- break;
2684
-
2685
- }
2686
- case "type_address":
2687
- {
2688
- remove_add_(i+"_street1form_id_temp");
2689
- remove_add_(i+"_street2form_id_temp");
2690
- remove_add_(i+"_cityform_id_temp");
2691
- remove_add_(i+"_stateform_id_temp");
2692
- remove_add_(i+"_postalform_id_temp");
2693
- remove_add_(i+"_countryform_id_temp");
2694
-
2695
- break;
2696
-
2697
- }
2698
-
2699
-
2700
- case "type_checkbox":
2701
- case "type_radio":
2702
- {
2703
- is=true;
2704
- for(j=0; j<100; j++)
2705
- if(document.getElementById(i+"_elementform_id_temp"+j))
2706
- {
2707
- remove_add_(i+"_elementform_id_temp"+j);
2708
- }
2709
-
2710
- /*if(document.getElementById(i+"_randomize").value=="yes")
2711
- choises_randomize(i);*/
2712
-
2713
- break;
2714
- }
2715
-
2716
- case "type_button":
2717
- {
2718
- for(j=0; j<100; j++)
2719
- if(document.getElementById(i+"_elementform_id_temp"+j))
2720
- {
2721
- remove_add_(i+"_elementform_id_temp"+j);
2722
- }
2723
- break;
2724
- }
2725
-
2726
- case "type_time":
2727
- {
2728
- if(document.getElementById(i+"_ssform_id_temp"))
2729
- {
2730
- remove_add_(i+"_ssform_id_temp");
2731
- remove_add_(i+"_mmform_id_temp");
2732
- remove_add_(i+"_hhform_id_temp");
2733
- }
2734
- else
2735
- {
2736
- remove_add_(i+"_mmform_id_temp");
2737
- remove_add_(i+"_hhform_id_temp");
2738
-
2739
- }
2740
- break;
2741
-
2742
- }
2743
-
2744
- case "type_date":
2745
- {
2746
- remove_add_(i+"_elementform_id_temp");
2747
- remove_add_(i+"_buttonform_id_temp");
2748
-
2749
- break;
2750
- }
2751
- case "type_date_fields":
2752
- {
2753
- remove_add_(i+"_dayform_id_temp");
2754
- remove_add_(i+"_monthform_id_temp");
2755
- remove_add_(i+"_yearform_id_temp");
2756
- break;
2757
- }
2758
- }
2759
- }
2760
- }
2761
-
2762
- for(i=1; i<=form_view_max; i++)
2763
- {
2764
- if(document.getElementById('form_id_tempform_view'+i))
2765
- {
2766
- if(document.getElementById('page_next_'+i))
2767
- document.getElementById('page_next_'+i).removeAttribute('src');
2768
- if(document.getElementById('page_previous_'+i))
2769
- document.getElementById('page_previous_'+i).removeAttribute('src');
2770
-
2771
- document.getElementById('form_id_tempform_view'+i).parentNode.removeChild(document.getElementById('form_id_tempform_view_img'+i));
2772
- document.getElementById('form_id_tempform_view'+i).removeAttribute('style');
2773
- }
2774
- }
2775
-
2776
-
2777
- document.getElementById('form_front').value=document.getElementById('take').innerHTML;
2778
-
2779
- }
2780
-
2781
- function set_preview()
2782
- {
2783
- appWidth =parseInt(document.body.offsetWidth);
2784
- appHeight =parseInt(document.body.offsetHeight);
2785
- document.getElementById('preview_form').href='<?php echo admin_url('admin-ajax.php'); ?>?action=frommakerpreview&id='+document.getElementById('theme').value+'&TB_iframe=1';
2786
- }
2787
-
2788
- gen=<?php echo $row->counter; ?>;//add main form id
2789
- function enable()
2790
- {
2791
- for(iiiii=0; iiiii<1000;iiiii++)
2792
- {
2793
- if(document.getElementsByTagName("iframe")[iiiii]){
2794
- if(document.getElementsByTagName("iframe")[iiiii].id=='form_maker_editor_ifr'){
2795
- id_ifr_editor=iiiii;
2796
- break;
2797
- }
2798
- }
2799
- }
2800
- alltypes=Array('customHTML','text','checkbox','radio','time_and_date','select','file_upload','captcha','map','button','page_break','section_break');
2801
- for(x=0; x<12;x++)
2802
- {
2803
- document.getElementById('img_'+alltypes[x]).src="<?php echo plugins_url("images/",__FILE__) ?>"+alltypes[x]+".png";
2804
- }
2805
-
2806
-
2807
- document.getElementById('formMakerDiv').style.display =(document.getElementById('formMakerDiv').style.display=='block'?'none':'block');
2808
- document.getElementById('formMakerDiv1').style.display =(document.getElementById('formMakerDiv1').style.display=='block'?'none':'block');
2809
-
2810
- if(document.getElementById('formMakerDiv').offsetWidth)
2811
- document.getElementById('formMakerDiv1').style.width =(document.getElementById('formMakerDiv').offsetWidth - 60)+'px';
2812
- document.getElementById('when_edit').style.display ='none';
2813
- }
2814
-
2815
- function enable2()
2816
- {
2817
- alltypes=Array('customHTML','text','checkbox','radio','time_and_date','select','file_upload','captcha','map','button','page_break','section_break');
2818
- for(x=0; x<12;x++)
2819
- {
2820
- document.getElementById('img_'+alltypes[x]).src="<?php echo plugins_url("images/",__FILE__) ?>"+alltypes[x]+".png";
2821
- }
2822
-
2823
-
2824
- document.getElementById('formMakerDiv').style.display =(document.getElementById('formMakerDiv').style.display=='block'?'none':'block');
2825
- document.getElementById('formMakerDiv1').style.display =(document.getElementById('formMakerDiv1').style.display=='block'?'none':'block');
2826
- if(document.getElementById('formMakerDiv').offsetWidth)
2827
- document.getElementById('formMakerDiv1').style.width =(document.getElementById('formMakerDiv').offsetWidth - 60)+'px';
2828
- document.getElementById('when_edit').style.display ='block';
2829
- if(document.getElementById('field_types').offsetWidth)
2830
- document.getElementById('when_edit').style.width =document.getElementById('field_types').offsetWidth+'px';
2831
-
2832
- if(document.getElementById('field_types').offsetHeight)
2833
- document.getElementById('when_edit').style.height =document.getElementById('field_types').offsetHeight+'px';
2834
-
2835
- //document.getElementById('when_edit').style.position='none';
2836
-
2837
- }
2838
-
2839
- var thickDims, tbWidth, tbHeight;
2840
- jQuery(document).ready(function($) {
2841
-
2842
- thickDims = function() {
2843
- var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
2844
-
2845
- w = (tbWidth && tbWidth < W - 90) ? tbWidth : W - 40;
2846
- h = (tbHeight && tbHeight < H - 60) ? tbHeight : H - 40;
2847
-
2848
- if ( tbWindow.size() ) {
2849
- tbWindow.width(w).height(h);
2850
- $('#TB_iframeContent').width(w).height(h - 27);
2851
- tbWindow.css({'margin-left': '-' + parseInt((w / 2),10) + 'px'});
2852
- if ( typeof document.body.style.maxWidth != 'undefined' )
2853
- tbWindow.css({'top':(H-h)/2,'margin-top':'0'});
2854
- }
2855
- };
2856
-
2857
- thickDims();
2858
- $(window).resize( function() { thickDims() } );
2859
-
2860
- $('a.thickbox-preview').click( function() {
2861
- tb_click.call(this);
2862
-
2863
- var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text;
2864
-
2865
- if ( tbWidth = href.match(/&tbWidth=[0-9]+/) )
2866
- tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
2867
- else
2868
- tbWidth = $(window).width() - 120;
2869
-
2870
- if ( tbHeight = href.match(/&tbHeight=[0-9]+/) )
2871
- tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
2872
- else
2873
- tbHeight = $(window).height() - 120;
2874
-
2875
- if ( alink.length ) {
2876
- url = alink.attr('href') || '';
2877
- text = alink.attr('title') || '';
2878
- link = '&nbsp; <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
2879
- } else {
2880
- text = $(this).attr('title') || '';
2881
- link = '&nbsp; <span class="tb-theme-preview-link">' + text + '</span>';
2882
- }
2883
-
2884
- $('#TB_title').css({'background-color':'#222','color':'#dfdfdf'});
2885
- $('#TB_closeAjaxWindow').css({'float':'left'});
2886
- $('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
2887
-
2888
- $('#TB_iframeContent').width('100%');
2889
- thickDims();
2890
-
2891
- return false;
2892
- } );
2893
-
2894
- // Theme details
2895
- $('.theme-detail').click(function () {
2896
- $(this).siblings('.themedetaildiv').toggle();
2897
- return false;
2898
- });
2899
-
2900
- });
2901
-
2902
- </script>
2903
- <style>
2904
- .calendar .button
2905
- {
2906
- display:table-cell !important;
2907
- }
2908
- #when_edit
2909
- {
2910
- position:absolute;
2911
- background-color:#666;
2912
- z-index:101;
2913
- display:none;
2914
- width:100%;
2915
- height:100%;
2916
- opacity: 0.7;
2917
- filter: alpha(opacity = 70);
2918
- }
2919
-
2920
- #formMakerDiv
2921
- {
2922
- position:fixed;
2923
- background-color:#666;
2924
- z-index:100;
2925
- display:none;
2926
- left:0;
2927
- top:0;
2928
- width:100%;
2929
- height:100%;
2930
- opacity: 0.7;
2931
- filter: alpha(opacity = 70);
2932
- }
2933
- #formMakerDiv1
2934
- {
2935
- padding-top:20px;
2936
- position:fixed;
2937
- z-index:100;
2938
- background-color:transparent;
2939
- top:0;
2940
- left:0;
2941
- display:none;
2942
- margin-left:30px;
2943
- margin-top:15px;
2944
- }
2945
- </style>
2946
- <table width="95%">
2947
- <thead>
2948
- <tr>
2949
- <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
2950
- <a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank" style="color:red; text-decoration:none;">
2951
- <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
2952
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
2953
- </a>
2954
- </div></td>
2955
- </tr>
2956
- </thead>
2957
- <tr>
2958
- <td width="100%"><?php echo "<h2>Form Maker</h2>"; ?></td>
2959
- <td><a id="preview_form" href="<?php echo admin_url('admin-ajax.php').'?action=frommakerpreview&id='.$row->theme.'&TB_iframe=1'; ?>" class="thickbox-preview" title="Form Preview" onclick="return false;"><input type="button" value="preview" class="button-primary" /></a> </td>
2960
- <td><input type="button" onclick="submitbutton('Actions_after_submission')" value="Actions after submission" class="button-primary" /> </td>
2961
- <td> <input type="button" onclick="submitbutton('Edit_JavaScript')" value="Edit JavaScript" class="button-primary" /> </td>
2962
- <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>
2963
- <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>
2964
- <td style="width:300px"><input type="button" onclick="submitbutton('save_as_copy')" value="Save As Copy" class="button-secondary action" /> </td>
2965
- <td align="right"><input type="button" onclick="submitbutton('Save')" value="Save" class="button-secondary action" /> </td>
2966
- <td align="right"><input type="button" onclick="submitbutton('Apply')" value="Apply" class="button-secondary action"/> </td>
2967
- <td align="right"><input type="button" onclick="window.location.href='admin.php?page=Form_maker'" value="Cancel" class="button-secondary action" /> </td>
2968
- </tr>
2969
- </table>
2970
- <br />
2971
-
2972
-
2973
-
2974
- <form action="admin.php?page=Form_maker&id=<?php echo $row->id; ?>" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data">
2975
- <table style="border:6px #00aeef solid; background-color:#00aeef" width="95%" cellpadding="0" cellspacing="0">
2976
- <tr>
2977
-
2978
-
2979
- <td align="left" valign="middle" rowspan="3" style="padding:10px;">
2980
- <img src="<?php echo plugins_url("images/formmaker.png",__FILE__) ?>" />
2981
- </td>
2982
-
2983
- <td width="70" align="right" valign="middle">
2984
-
2985
- <span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Form title:&nbsp;&nbsp;</span>
2986
-
2987
- </td>
2988
-
2989
- <td width="153" height="30px" align="center" valign="middle">
2990
-
2991
- <div style="background-image:url(<?php echo plugins_url("images/input.png",__FILE__) ?>);">
2992
-
2993
- <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" />
2994
-
2995
- </div>
2996
-
2997
- </td>
2998
-
2999
- </tr><tr>
3000
-
3001
- <td width="300" align="right" valign="middle">
3002
-
3003
- <span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Email to send submissions to:&nbsp;&nbsp;</span>
3004
-
3005
- </td>
3006
-
3007
- <td width="153" height="30px" align="center" valign="middle">
3008
-
3009
- <div style="background-image:url(<?php echo plugins_url("images/input.png",__FILE__) ?>);">
3010
-
3011
- <input id="mail" name="mail" <?php echo 'value="'.$row->mail.'"' ?> style="background:none; padding:inherit; width:151px; height:17px; border:none; font-size:11px" />
3012
-
3013
- </div>
3014
-
3015
- </td>
3016
-
3017
- </tr>
3018
- <tr>
3019
-
3020
- <td width="300" height="30px" align="right" valign="middle">
3021
-
3022
- <span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Theme:&nbsp;&nbsp;</span>
3023
-
3024
- </td>
3025
-
3026
- <td width="153" align="center" valign="middle">
3027
-
3028
- <div style="height:19px">
3029
-
3030
- <select id="theme" name="theme" style="background:transparent; width:151px; height:19px; border:none; font-size:11px" onChange="set_preview()" >
3031
-
3032
- <?php
3033
- $form_theme='';
3034
- foreach($themes as $theme)
3035
- {
3036
- if($theme->id==$row->theme)
3037
- {
3038
- echo '<option value="'.$theme->id.'" selected>'.$theme->title.'</option>';
3039
- $form_theme=$theme->css;
3040
- }
3041
- else
3042
- echo '<option value="'.$theme->id.'">'.$theme->title.'</option>';
3043
- }
3044
- ?>
3045
- </select>
3046
-
3047
- </div>
3048
-
3049
- </td>
3050
-
3051
- </tr>
3052
-
3053
-
3054
-
3055
- <tr>
3056
- <td align="left" colspan="3">
3057
-
3058
- <img src="<?php echo plugins_url("images/addanewfield.png",__FILE__) ?>" onclick="enable(); Enable()" style="cursor:pointer;margin:10px;" />
3059
-
3060
- </td>
3061
- </tr>
3062
- </table>
3063
-
3064
- <div id="formMakerDiv" onclick="close_window()"></div>
3065
- <div id="formMakerDiv1" style="padding-top:20px" align="center">
3066
-
3067
-
3068
- <table border="0" width="100%" cellpadding="0" cellspacing="0" height="100%" style="border:6px #00aeef solid; background-color:#FFF">
3069
- <tr>
3070
- <td style="padding:0px">
3071
- <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
3072
- <tr valign="top">
3073
- <td width="15%" height="100%" style="border-right:dotted black 1px;" id="field_types">
3074
- <div id="when_edit" style="display:none"></div>
3075
- <table border="0" cellpadding="0" cellspacing="3" width="100%">
3076
- <tr>
3077
- <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>
3078
-
3079
- <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>
3080
- </tr>
3081
- <tr>
3082
- <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>
3083
-
3084
- <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>
3085
- </tr>
3086
- <tr>
3087
- <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>
3088
-
3089
- <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>
3090
- </tr>
3091
- <tr>
3092
- <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>
3093
-
3094
- <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>
3095
- </tr>
3096
- <tr>
3097
- <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>
3098
-
3099
- <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>
3100
- </tr>
3101
- <tr>
3102
- <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>
3103
-
3104
- <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>
3105
- </tr>
3106
- </table>
3107
-
3108
- </td>
3109
- <td width="35%" height="100%" align="left"><div id="edit_table" style="padding:0px; overflow-y:scroll; height:531px" ></div></td>
3110
-
3111
- <td align="center" valign="top" style="background:url(<?php echo plugins_url("images/border2.png",__FILE__) ?>) repeat-y;">&nbsp;</td>
3112
- <td style="padding:15px">
3113
- <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
3114
-
3115
- <tr>
3116
- <td align="right"><input type="radio" value="end" name="el_pos" checked="checked" id="pos_end" onclick="Disable()"/>
3117
- At The End
3118
- <input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
3119
- At The Beginning
3120
- <input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
3121
- Before
3122
- <select style="width:100px; margin-left:5px" id="sel_el_pos" disabled="disabled">
3123
- </select>
3124
- <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)"/>
3125
- <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()"/>
3126
-
3127
- <hr style=" margin-bottom:10px" />
3128
- </td>
3129
- </tr>
3130
-
3131
- <tr height="100%" valign="top">
3132
- <td id="show_table"></td>
3133
- </tr>
3134
-
3135
- </table>
3136
- </td>
3137
- </tr>
3138
- </table>
3139
- </td>
3140
- </tr>
3141
- </table>
3142
-
3143
- <input type="hidden" id="old" />
3144
- <input type="hidden" id="old_selected" />
3145
- <input type="hidden" id="element_type" />
3146
- <input type="hidden" id="editing_id" />
3147
- <input type="hidden" value="<?php echo plugins_url("",__FILE__) ?>" id="form_plugins_url" />
3148
- <div id="main_editor" style="position:absolute; display:none; z-index:140;"><?php if(function_exists ('the_editor') || function_exists ('wp_editor')){
3149
- if(get_bloginfo('version')<'3.3'){
3150
- ?>
3151
- <div style=" max-width:500px; height:300px;text-align:left" id="poststuff">
3152
- <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 ); ?>
3153
- </div>
3154
- </div>
3155
- <?php
3156
-
3157
- }
3158
- else
3159
- {
3160
- echo "<style>#wp-form_maker_editor-media-buttons{ text-align:left }</style>"; wp_editor("","form_maker_editor");
3161
- }
3162
- }
3163
- else
3164
- {
3165
- ?>
3166
- <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>
3167
- <?php
3168
-
3169
- }
3170
- ?></div>
3171
- </div>
3172
-
3173
- <?php if(!function_exists ('the_editor'))
3174
- {
3175
- ?>
3176
- <iframe id="tinymce" style="display:none"></iframe>
3177
-
3178
- <?php
3179
- }
3180
- ?>
3181
-
3182
-
3183
-
3184
- <br />
3185
- <br />
3186
-
3187
- <fieldset>
3188
-
3189
- <legend>
3190
-
3191
- <h2 style="color:#00aeef">Form</h2>
3192
-
3193
- </legend>
3194
-
3195
- <?php
3196
- global $first_css;
3197
- echo '<style>'.$first_css.'</style>';
3198
-
3199
- ?><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
3200
-
3201
- if($row->form)
3202
-
3203
- echo $row->form;
3204
-
3205
- else
3206
-
3207
- 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>';
3208
- ?></div>
3209
-
3210
- </fieldset>
3211
-
3212
- <input type="hidden" name="form" id="form">
3213
- <input type="hidden" name="form_front" id="form_front">
3214
-
3215
- <input type="hidden" name="pagination" id="pagination" />
3216
- <input type="hidden" name="show_title" id="show_title" />
3217
- <input type="hidden" name="show_numbers" id="show_numbers" />
3218
-
3219
- <input type="hidden" name="public_key" id="public_key" />
3220
- <input type="hidden" name="private_key" id="private_key" />
3221
- <input type="hidden" name="recaptcha_theme" id="recaptcha_theme" />
3222
-
3223
- <input type="hidden" id="label_order" name="label_order" value="<?php echo $row->label_order;?>" />
3224
- <input type="hidden" name="counter" id="counter" value="<?php echo $row->counter;?>">
3225
-
3226
- <script type="text/javascript">
3227
-
3228
- function formOnload()
3229
- {
3230
- //enable maps
3231
- for(t=0; t<<?php echo $row->counter;?>; t++)
3232
- if(document.getElementById(t+"_typeform_id_temp"))
3233
- {
3234
- if(document.getElementById(t+"_typeform_id_temp").value=="type_map" || document.getElementById(t+"_typeform_id_temp").value=="type_mark_map")
3235
- {
3236
- if_gmap_init(t);
3237
- for(q=0; q<20; q++)
3238
- if(document.getElementById(t+"_elementform_id_temp").getAttribute("long"+q))
3239
- {
3240
-
3241
- w_long=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("long"+q));
3242
- w_lat=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("lat"+q));
3243
- w_info=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("info"+q));
3244
- add_marker_on_map(t,q, w_long, w_lat, w_info, false);
3245
- }
3246
- }
3247
- else
3248
- if(document.getElementById(t+"_typeform_id_temp").value=="type_date")
3249
- Calendar.setup({
3250
- inputField: t+"_elementform_id_temp",
3251
- ifFormat: document.getElementById(t+"_buttonform_id_temp").getAttribute('format'),
3252
- button: t+"_buttonform_id_temp",
3253
- align: "Tl",
3254
- singleClick: true,
3255
- firstDay: 0
3256
- });
3257
-
3258
- }
3259
-
3260
-
3261
- form_view=1;
3262
- form_view_count=0;
3263
- for(i=1; i<=30; i++)
3264
- {
3265
- if(document.getElementById('form_id_tempform_view'+i))
3266
- {
3267
- form_view_count++;
3268
- form_view_max=i;
3269
- }
3270
- }
3271
-
3272
- if(form_view_count>1)
3273
- {
3274
- for(i=1; i<=form_view_max; i++)
3275
- {
3276
- if(document.getElementById('form_id_tempform_view'+i))
3277
- {
3278
- first_form_view=i;
3279
- break;
3280
- }
3281
- }
3282
- form_view=form_view_max;
3283
-
3284
- generate_page_nav(first_form_view);
3285
-
3286
- var img_EDIT = document.createElement("img");
3287
- img_EDIT.setAttribute("src", "<?php echo plugins_url('',__FILE__) ?>/images/edit.png");
3288
- img_EDIT.style.cssText = "margin-left:40px; cursor:pointer";
3289
- img_EDIT.setAttribute("onclick", 'el_page_navigation()');
3290
-
3291
- var td_EDIT = document.getElementById("edit_page_navigation");
3292
- td_EDIT.appendChild(img_EDIT);
3293
-
3294
- document.getElementById('page_navigation').appendChild(td_EDIT);
3295
-
3296
-
3297
- }
3298
-
3299
-
3300
- //if(document.getElementById('take').innerHTML.indexOf('up_row(')==-1) location.reload(true);
3301
- //else
3302
- document.getElementById('form').value=document.getElementById('take').innerHTML;
3303
- document.getElementById('araqel').value=1;
3304
-
3305
- }
3306
-
3307
- function formAddToOnload()
3308
- {
3309
- if(formOldFunctionOnLoad){ formOldFunctionOnLoad(); }
3310
- formOnload();
3311
- }
3312
-
3313
- function formLoadBody()
3314
- {
3315
- formOldFunctionOnLoad = window.onload;
3316
- window.onload = formAddToOnload;
3317
- }
3318
-
3319
- var formOldFunctionOnLoad = null;
3320
-
3321
- formLoadBody();
3322
-
3323
-
3324
- </script>
3325
-
3326
- <input type="hidden" name="option" value="com_formmaker" />
3327
-
3328
- <input type="hidden" name="id" value="<?php echo $row->id?>" />
3329
-
3330
- <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
3331
-
3332
- <input type="hidden" name="task" value="" />
3333
- <input type="hidden" id="araqel" value="0" />
3334
-
3335
- </form>
3336
-
3337
- <script>
3338
- plugin_url=document.getElementById('form_plugins_url').value;
3339
- appWidth =parseInt(document.body.offsetWidth);
3340
- appHeight =parseInt(document.body.offsetHeight);
3341
- // document.getElementById('toolbar-popup-popup').childNodes[1].href='index.php?option=com_formmaker&task=preview&tmpl=component&theme='+document.getElementById('theme').value;
3342
- // document.getElementById('toolbar-popup-popup').childNodes[1].setAttribute('rel',"{handler: 'iframe', size: {x:"+(appWidth-100)+", y: "+(appHeight-30)+"}}");
3343
- </script>
3344
- <?php
3345
-
3346
-
3347
-
3348
-
3349
-
3350
-
3351
-
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
- function html_Actions_after_submission($row){
3377
- $value="";
3378
- ?>
3379
-
3380
- <script language="javascript" type="text/javascript">
3381
- function remove_article()
3382
- {
3383
- document.getElementById('id_name').value="Select an Article";
3384
- document.getElementById('article_id').value="";
3385
- }
3386
- function set_type(type)
3387
- {
3388
- switch(type)
3389
- {
3390
- case 'post':
3391
- document.getElementById('post').removeAttribute('style');
3392
- document.getElementById('page').setAttribute('style','display:none');
3393
- document.getElementById('custom').setAttribute('style','display:none');
3394
- document.getElementById('url').setAttribute('style','display:none');
3395
- document.getElementById('none').setAttribute('style','display:none');
3396
- break;
3397
-
3398
- case 'page':
3399
- document.getElementById('page').removeAttribute('style');
3400
- document.getElementById('post').setAttribute('style','display:none');
3401
- document.getElementById('custom').setAttribute('style','display:none');
3402
- document.getElementById('url').setAttribute('style','display:none');
3403
- document.getElementById('none').setAttribute('style','display:none');
3404
- break;
3405
-
3406
- case 'custom':
3407
- document.getElementById('page').setAttribute('style','display:none');
3408
- document.getElementById('post').setAttribute('style','display:none');
3409
- document.getElementById('custom').removeAttribute('style');
3410
- document.getElementById('url').setAttribute('style','display:none');
3411
- document.getElementById('none').setAttribute('style','display:none');
3412
- break;
3413
-
3414
- case 'url':
3415
- document.getElementById('page').setAttribute('style','display:none');
3416
- document.getElementById('post').setAttribute('style','display:none');
3417
- document.getElementById('custom').setAttribute('style','display:none');
3418
- document.getElementById('url').removeAttribute('style');
3419
- document.getElementById('none').setAttribute('style','display:none');
3420
- break;
3421
-
3422
- case 'none':
3423
- document.getElementById('page').setAttribute('style','display:none');
3424
- document.getElementById('post').setAttribute('style','display:none');
3425
- document.getElementById('custom').setAttribute('style','display:none');
3426
- document.getElementById('url').setAttribute('style','display:none');
3427
- document.getElementById('none').removeAttribute('style');
3428
- break;
3429
- }
3430
- }
3431
- function submit_in(pressbutton){
3432
-
3433
-
3434
- document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
3435
- document.getElementById('adminForm').submit();
3436
-
3437
- }
3438
- </script>
3439
-
3440
- <style>
3441
- .borderer
3442
- {
3443
- border-radius:5px;
3444
- padding-left:5px;
3445
- background-color:#F0F0F0;
3446
- height:19px;
3447
- width:153px;
3448
- }
3449
- </style>
3450
- <table width="95%">
3451
- <thead><tr>
3452
- <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
3453
- <a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank" style="color:red; text-decoration:none;">
3454
- <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
3455
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
3456
- </a>
3457
- </div></td>
3458
- </tr></thead>
3459
- <tbody>
3460
- <tr>
3461
- <td width="100%"><h2>Actions after submission - <?php echo $row->title; ?></h2></td>
3462
- <td align="right"><input type="button" onclick="submit_in('Save_Actions_after_submission')" value="Save" class="button-secondary action"> </td>
3463
- <td align="right"><input type="button" onclick="submit_in('Apply_Actions_after_submission')" value="Apply" class="button-secondary action"> </td>
3464
- <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>
3465
- </tr>
3466
- </tbody></table>
3467
- <br />
3468
- <form action="admin.php?page=Form_maker&id=<?php echo $row->id; ?>" id="adminForm" method="post" name="adminForm">
3469
- <table >
3470
- <tr valign="top">
3471
- <td class="key">
3472
- <label for="submissioni text"> Action type: </label>
3473
- </td>
3474
- <td>
3475
- <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/>
3476
- <input type="radio" name="submit_text_type" onclick="set_type('post')" value="2" <?php if($row->submit_text_type==2 ) echo "checked" ?> /> Post<br/>
3477
- <input type="radio" name="submit_text_type" onclick="set_type('page')" value="5" <?php if($row->submit_text_type==5 ) echo "checked" ?> /> Page<br/>
3478
- <input type="radio" name="submit_text_type" onclick="set_type('custom')" value="3" <?php if($row->submit_text_type==3 ) echo "checked" ?> /> Custom text<br/>
3479
- <input type="radio" name="submit_text_type" onclick="set_type('url')" value="4" <?php if($row->submit_text_type==4 ) echo "checked" ?> /> URL
3480
- </td>
3481
- </tr>
3482
- <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"' ?> >
3483
- <td class="key">
3484
- <label for="submissioni text"> Stay on form </label>
3485
- </td>
3486
- <td >
3487
- <img src="<?php echo plugins_url("images/tick.png",__FILE__) ?>" border="0">
3488
- </td>
3489
- </tr>
3490
- <tr id="post" <?php if($row->submit_text_type!=2) echo 'style="display:none"' ?> >
3491
- <td class="key">
3492
- <label for="submissioni text"> Post </label>
3493
- </td>
3494
- <td >
3495
- <select name="post_name" style="width:153px; font-size:11px;">
3496
- <option value="0">- Select Post -</option>
3497
- <?php
3498
-
3499
- $args = array(
3500
- 'posts_per_page' => 10000);
3501
- query_posts($args );
3502
-
3503
- // The Loop
3504
- while ( have_posts() ) : the_post(); ?>
3505
- <option value="<?php $x=get_permalink(get_the_ID()); echo $x; ?>" <?php if($row->article_id==$x){echo ' selected="selected"';} ?>> <?php the_title(); ?> </option>
3506
- <?php
3507
- endwhile;
3508
-
3509
- // Reset Query
3510
- wp_reset_query();
3511
-
3512
- ?>
3513
- </select>
3514
-
3515
- </td>
3516
- </tr>
3517
- <tr id="page" <?php if($row->submit_text_type!=5) echo 'style="display:none"' ?> >
3518
- <td class="key">
3519
- <label for="submissioni text"> Page </label>
3520
- </td>
3521
- <td >
3522
- <select name="page_name" style="width:153px; font-size:11px;">
3523
- <option value="0">- Select Page -</option>
3524
- <?php
3525
-
3526
- // The Query
3527
- $pages = get_pages();
3528
-
3529
- // The Loop
3530
- foreach ( $pages as $page ) {?>
3531
- <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>
3532
- <?php
3533
- }
3534
-
3535
- // Reset Query
3536
- wp_reset_query();
3537
-
3538
- ?>
3539
- </select>
3540
-
3541
- </td>
3542
- </tr>
3543
-
3544
-
3545
-
3546
-
3547
- <tr <?php if($row->submit_text_type!=3 ) echo 'style="display:none"' ?> id="custom">
3548
- <td class="key">
3549
- <label for="submissioni text"> Text </label>
3550
- </td>
3551
- <td >
3552
- <?php if(get_bloginfo('version')<'3.3'){ ?>
3553
- <div style="height:300px;text-align:left" id="poststuff">
3554
- <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 ); ?>
3555
- </div>
3556
- </div>
3557
- <?php } else { wp_editor($row->submit_text,"content");}?>
3558
- </td>
3559
- </tr>
3560
- <tr <?php if($row->submit_text_type!=4 ) echo 'style="display:none"' ?> id="url">
3561
- <td class="key">
3562
- <label for="submissioni text"> URL </label>
3563
- </td>
3564
- <td >
3565
- <input type="text" id="url" name="url" style="width:300px" value="<?php echo $row->url ?>" />
3566
- </td>
3567
- </tr>
3568
- </table>
3569
- <input type="hidden" name="option" value="com_formmaker" />
3570
- <input type="hidden" name="id" value="<?php echo $row->id?>" />
3571
- <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
3572
- <input type="hidden" name="task" value="" />
3573
- </form>
3574
-
3575
- <?php
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
- function html_Edit_JavaScript($row){
3601
-
3602
- ?>
3603
- <script type="text/javascript" language="javascript">
3604
- function submit_in(pressbutton){
3605
-
3606
-
3607
- document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
3608
- document.getElementById('adminForm').submit();
3609
-
3610
- }
3611
- </script>
3612
-
3613
- <table width="95%">
3614
- <thead><tr>
3615
- <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
3616
- <a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank" style="color:red; text-decoration:none;">
3617
- <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
3618
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
3619
- </a>
3620
- </div></td>
3621
- </tr></thead>
3622
- <tbody>
3623
- <tr>
3624
- <td width="100%"><h2>Edit JavaScript - <?php echo $row->title; ?></h2></td>
3625
- <td align="right"><input type="button" onclick="submit_in('Save_Edit_JavaScript')" value="Save" class="button-secondary action"> </td>
3626
- <td align="right"><input type="button" onclick="submit_in('Apply_Edit_JavaScript')" value="Apply" class="button-secondary action"> </td>
3627
- <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>
3628
- </tr>
3629
- </tbody></table>
3630
- <br />
3631
- <form action="admin.php?page=Form_maker&id=<?php echo $row->id; ?>" id="adminForm" method="post" name="adminForm">
3632
- <table class="adminform">
3633
-
3634
- <tr>
3635
-
3636
- <th>
3637
-
3638
- <label for="message"> Javascript </label>
3639
-
3640
- </th>
3641
-
3642
- </tr>
3643
-
3644
- <tr>
3645
-
3646
- <td >
3647
-
3648
- <textarea style="margin: 0px;" cols="110" rows="25" name="javascript" id="css" ><?php echo $row->javascript; ?></textarea>
3649
-
3650
- </td>
3651
-
3652
- </tr>
3653
-
3654
- </table>
3655
- </form>
3656
- <?php
3657
-
3658
-
3659
- }
3660
-
3661
-
3662
-
3663
-
3664
-
3665
-
3666
-
3667
-
3668
-
3669
-
3670
-
3671
-
3672
-
3673
-
3674
-
3675
-
3676
-
3677
- function html_Custom_text_in_email_for_administrator($row){
3678
-
3679
-
3680
-
3681
-
3682
-
3683
- ?>
3684
- <script type="text/javascript" language="javascript">
3685
- function submit_in(pressbutton){
3686
-
3687
-
3688
- document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
3689
- document.getElementById('adminForm').submit();
3690
-
3691
- }
3692
- </script>
3693
-
3694
- <table width="95%">
3695
- <thead><tr>
3696
- <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
3697
- <a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank" style="color:red; text-decoration:none;">
3698
- <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
3699
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
3700
- </a>
3701
- </div></td>
3702
- </tr></thead>
3703
- <tbody>
3704
-
3705
- <tr>
3706
- <td width="100%"><h2>Text for Administrator - <?php echo $row->title; ?></h2></td>
3707
- <td align="right"><input type="button" onclick="submit_in('Save_Custom_text_in_email_for_administrator')" value="Save" class="button-secondary action"> </td>
3708
- <td align="right"><input type="button" onclick="submit_in('Apply_Custom_text_in_email_for_administrator')" value="Apply" class="button-secondary action"> </td>
3709
- <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>
3710
- </tr>
3711
- </tbody></table>
3712
- <br />
3713
- <form action="admin.php?page=Form_maker&id=<?php echo $row->id; ?>" id="adminForm" method="post" name="adminForm">
3714
- <table width="95%" style="border-color:#000; border:medium;" >
3715
-
3716
- <tbody>
3717
- <tr>
3718
-
3719
- <th style="text-align:left">
3720
-
3721
- <label for="message" style="text-align:left"> Text before Message </label>
3722
- <br />
3723
- </th>
3724
- </tr>
3725
- <tr>
3726
-
3727
- <td style="width:95%; min-width:500px">
3728
- <?php if(function_exists('wp_editor') || function_exists('the_editor')){
3729
- if(get_bloginfo('version')<'3.3'){
3730
- the_editor ( $row->script1, $idd = 'script1', $prev_id = 'Mail_script1', $media_buttons = true, $tab_index = 1, $extended = true );
3731
- }
3732
- else{
3733
- wp_editor( $row->script1, $idd = 'script1');
3734
- }
3735
- }
3736
- else {?>
3737
-
3738
- <textarea style="width:100%" name="script1" id><?php echo $row->script1 ?></textarea>
3739
- <?php } ?>
3740
- <br />
3741
- </td>
3742
- </tr>
3743
- <tr>
3744
- <td>
3745
- <hr />
3746
- <h2 align="center">MESSAGE</h2>
3747
- <hr />
3748
- <br />
3749
- </td>
3750
- </tr>
3751
- <tr>
3752
-
3753
- <th style="text-align:left">
3754
-
3755
- <label for="message" style="text-align:left"> Text after Message </label>
3756
- <br />
3757
- </th>
3758
- </tr>
3759
- <tr>
3760
-
3761
- <td style="width:70%; min-width:500px"><?php if(function_exists('wp_editor') || function_exists('the_editor')){if(get_bloginfo('version')<'3.3'){
3762
- the_editor ( $row->script2, $idd = 'script2', $prev_id = 'Mail_title2', $media_buttons = true, $tab_index = 2, $extended = true );
3763
- }
3764
- else
3765
- {
3766
- wp_editor($row->script2, $idd = 'script2');
3767
- }
3768
- }else { ?>
3769
-
3770
- <textarea style="width:100%" name="script2"><?php echo $row->script2 ?></textarea>
3771
- <?php } ?></td>
3772
- </tr>
3773
- </tbody>
3774
- </table>
3775
-
3776
- </form>
3777
- <?php
3778
-
3779
-
3780
-
3781
-
3782
-
3783
-
3784
-
3785
-
3786
-
3787
- }
3788
-
3789
-
3790
-
3791
-
3792
-
3793
-
3794
-
3795
-
3796
-
3797
-
3798
-
3799
- function html_Custom_text_in_email_for_user($row){
3800
-
3801
-
3802
-
3803
-
3804
-
3805
- ?>
3806
- <script type="text/javascript" language="javascript">
3807
- function submit_in(pressbutton){
3808
-
3809
-
3810
- document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
3811
- document.getElementById('adminForm').submit();
3812
-
3813
- }
3814
- </script>
3815
-
3816
- <table width="95%">
3817
- <thead><tr>
3818
- <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
3819
- <a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank" style="color:red; text-decoration:none;">
3820
- <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
3821
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
3822
- </a>
3823
- </div></td>
3824
- </tr></thead>
3825
- <tbody>
3826
-
3827
- <tr>
3828
- <td width="100%"><h2>Text for User - <?php echo $row->title; ?></h2></td>
3829
- <td align="right"><input type="button" onclick="submit_in('Save_Custom_text_in_email_for_user')" value="Save" class="button-secondary action"> </td>
3830
- <td align="right"><input type="button" onclick="submit_in('Apply_Custom_text_in_email_for_user')" value="Apply" class="button-secondary action"> </td>
3831
- <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>
3832
- </tr>
3833
- </tbody></table>
3834
- <br />
3835
- <form action="admin.php?page=Form_maker&id=<?php echo $row->id; ?>" id="adminForm" method="post" name="adminForm">
3836
- <table width="95%" style="border-color:#000; border:medium;" >
3837
-
3838
- <tbody>
3839
- <tr>
3840
-
3841
- <th style="text-align:left">
3842
-
3843
- <label for="message" style="text-align:left"> Text before Message </label>
3844
- <br />
3845
- </th>
3846
- </tr>
3847
- <tr>
3848
-
3849
- <td style="width:95%; min-width:500px"><?php if(function_exists('wp_editor') || function_exists('the_editor')){ if(get_bloginfo('version')<'3.3'){
3850
- the_editor ( $row->script_user1, $idd = 'script_user1', $prev_id = 'Mail_script1', $media_buttons = true, $tab_index = 1, $extended = true );
3851
- }
3852
- else
3853
- {
3854
- wp_editor($row->script_user1, $idd = 'script_user1');
3855
- }
3856
- } else {?>
3857
-
3858
- <textarea style="width:100%" name="script_user1" id><?php echo $row->script_user1 ?></textarea>
3859
- <?php } ?>
3860
- <br />
3861
- </td>
3862
- </tr>
3863
- <tr>
3864
- <td>
3865
- <hr />
3866
- <h2 align="center">MESSAGE</h2>
3867
- <hr />
3868
- <br />
3869
- </td>
3870
- </tr>
3871
- <tr>
3872
-
3873
- <th style="text-align:left">
3874
-
3875
- <label for="message" style="text-align:left"> Text after Message </label>
3876
- <br />
3877
- </th>
3878
- </tr>
3879
- <tr>
3880
-
3881
- <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{
3882
- wp_editor( $row->script_user2, $idd = 'script_user2'); }}else { ?>
3883
-
3884
- <textarea style="width:100%" name="script_user2"><?php echo $row->script_user2 ?></textarea>
3885
- <?php } ?></td>
3886
- </tr>
3887
- </tbody>
3888
- </table>
3889
-
3890
- </form>
3891
- <?php
3892
-
3893
-
3894
-
3895
-
3896
-
3897
-
3898
-
3899
-
3900
-
3901
- }
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:&nbsp;&nbsp;</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:&nbsp;&nbsp;</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:&nbsp;&nbsp;</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;">&nbsp;</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&nbsp;&nbsp;&nbsp;&nbsp;
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 = '&nbsp; <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
1468
+ } else {
1469
+ text = $(this).attr('title') || '';
1470
+ link = '&nbsp; <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 = '&nbsp; <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
1896
+ } else {
1897
+ text = $(this).attr('title') || '';
1898
+ link = '&nbsp; <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&nbsp;&nbsp;&nbsp;&nbsp;
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:&nbsp;&nbsp;</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;">&nbsp;</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 = '&nbsp; <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
2294
+ } else {
2295
+ text = $(vvvv).attr('title') || '';
2296
+ link = '&nbsp; <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 = '&nbsp; <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
2781
+ } else {
2782
+ text = $(this).attr('title') || '';
2783
+ link = '&nbsp; <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&nbsp;&nbsp;&nbsp;&nbsp;
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 align="right"><input type="button" onclick="submitbutton('Save')" value="Save" class="button-secondary action"/>
2889
+ </td>
2890
+ <td align="right"><input type="button" onclick="submitbutton('Apply')" value="Apply"
2891
+ class="button-secondary action"/></td>
2892
+ <td align="right"><input type="button" onclick="window.location.href='admin.php?page=Form_maker'" value="Cancel"
2893
+ class="button-secondary action"/></td>
2894
+ </tr>
2895
+ </table>
2896
+ <br/>
2897
+
2898
+
2899
+
2900
+ <form action="admin.php?page=Form_maker&id=<?php echo $row->id; ?>" method="post" name="adminForm" id="adminForm"
2901
+ enctype="multipart/form-data">
2902
+ <div class="formmaker_table" width="100%">
2903
+ <div style="float:left; text-align:center">
2904
+ </br>
2905
+ <img src="<?php echo plugins_url("images/formmaker.png",__FILE__) ?>"/>
2906
+ </br>
2907
+ </br>
2908
+ <img src="<?php echo plugins_url("images/logo.png",__FILE__) ?>"/>
2909
+ </div>
2910
+ <div style="float:right">
2911
+ <span style="font-size:16.76pt; font-family:tahoma; color:#FFFFFF; vertical-align:middle;">Form title:&nbsp;&nbsp;</span>
2912
+ <input id="title" name="title" style="width:160px; height:19px; border:none; font-size:11px;" value="<?php echo $row->title; ?>"/>
2913
+ <br />
2914
+ <img src="<?php echo plugins_url("images/formoptions.png",__FILE__) ?>" onclick="submitbutton('form_options')" style="cursor:pointer;margin:10px 0 10px 10px; float:right"/>
2915
+ <br />
2916
+ <br />
2917
+ <br />
2918
+ <img src="<?php echo plugins_url("images/addanewfield.png",__FILE__) ?>" onclick="enable(); Enable()" style="cursor:pointer;margin:10px 0 10px 10px; float:right"/>
2919
+ </div>
2920
+ </div>
2921
+ <div id="formMakerDiv" onclick="close_window()"></div>
2922
+ <div id="formMakerDiv1" style="padding-top:20px" align="center">
2923
+
2924
+
2925
+ <table border="0" width="100%" cellpadding="0" cellspacing="0" height="100%"
2926
+ style="border:6px #00aeef solid; background-color:#FFF">
2927
+ <tr>
2928
+ <td style="padding:0px">
2929
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
2930
+ <tr valign="top">
2931
+ <td width="15%" height="100%" style="border-right:dotted black 1px;" id="field_types">
2932
+ <div id="when_edit" style="display:none"></div>
2933
+ <table border="0" cellpadding="0" cellspacing="3" width="100%">
2934
+ <tr>
2935
+ <td align="center" onClick="addRow('customHTML')" style="cursor:pointer" id="table_editor"
2936
+ class="field_buttons"><img src="<?php echo plugins_url("images/customHTML.png", __FILE__) ?>"
2937
+ style="margin:5px" id="img_customHTML"/></td>
2938
+
2939
+ <td align="center" onClick="addRow('text')" style="cursor:pointer" id="table_text"
2940
+ class="field_buttons"><img src="<?php echo plugins_url("images/text.png", __FILE__) ?>"
2941
+ style="margin:5px" id="img_text"/></td>
2942
+ </tr>
2943
+ <tr>
2944
+ <td align="center" onClick="addRow('time_and_date')" style="cursor:pointer" id="table_time_and_date"
2945
+ class="field_buttons"><img src="<?php echo plugins_url("images/time_and_date.png", __FILE__) ?>"
2946
+ style="margin:5px" id="img_time_and_date"/></td>
2947
+
2948
+ <td align="center" onClick="addRow('select')" style="cursor:pointer" id="table_select"
2949
+ class="field_buttons"><img src="<?php echo plugins_url("images/select.png", __FILE__) ?>"
2950
+ style="margin:5px" id="img_select"/></td>
2951
+ </tr>
2952
+ <tr>
2953
+ <td align="center" onClick="addRow('checkbox')" style="cursor:pointer" id="table_checkbox"
2954
+ class="field_buttons"><img src="<?php echo plugins_url("images/checkbox.png", __FILE__) ?>"
2955
+ style="margin:5px" id="img_checkbox"/></td>
2956
+
2957
+ <td align="center" onClick="addRow('radio')" style="cursor:pointer" id="table_radio"
2958
+ class="field_buttons"><img src="<?php echo plugins_url("images/radio.png", __FILE__) ?>"
2959
+ style="margin:5px" id="img_radio"/></td>
2960
+ </tr>
2961
+ <tr>
2962
+ <td align="center"
2963
+ onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')"
2964
+ style="background-color: rgb(114, 113, 113) !important; cursor:pointer" id="table_file_upload"
2965
+ class="field_buttons"><img src="<?php echo plugins_url("images/file_upload.png", __FILE__) ?>"
2966
+ style="margin:5px" id="img_file_upload"/></td>
2967
+
2968
+ <td align="center" onClick="addRow('captcha')" style="cursor:pointer" id="table_captcha"
2969
+ class="field_buttons"><img src="<?php echo plugins_url("images/captcha.png", __FILE__) ?>"
2970
+ style="margin:5px" id="img_captcha"/></td>
2971
+ </tr>
2972
+ <tr>
2973
+ <td align="center" onClick="addRow('page_break')" style="cursor:pointer" id="table_page_break"
2974
+ class="field_buttons"><img src="<?php echo plugins_url("images/page_break.png", __FILE__) ?>"
2975
+ style="margin:5px" id="img_page_break"/></td>
2976
+
2977
+ <td align="center" onClick="addRow('section_break')" style="cursor:pointer" id="table_section_break"
2978
+ class="field_buttons"><img src="<?php echo plugins_url("images/section_break.png", __FILE__) ?>"
2979
+ style="margin:5px" id="img_section_break"/></td>
2980
+ </tr>
2981
+ <tr>
2982
+ <td align="center"
2983
+ onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')"
2984
+ style="background-color: rgb(114, 113, 113) !important; cursor:pointer" id="table_map"
2985
+ class="field_buttons"><img src="<?php echo plugins_url("images/map.png", __FILE__) ?>"
2986
+ style="margin:5px" id="img_map"/></td>
2987
+ <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">
2988
+ <img src="<?php echo plugins_url("images/paypal.png",__FILE__) ?>" style="margin:5px" id="img_paypal"/>
2989
+ </td>
2990
+ </tr>
2991
+ <tr>
2992
+ <td align="center" onClick="addRow('button')" colspan=2 style="cursor:pointer" id="table_button"
2993
+ class="field_buttons"><img src="<?php echo plugins_url("images/button.png", __FILE__) ?>"
2994
+ style="margin:5px" id="img_button"/></td>
2995
+ </tr>
2996
+ </table>
2997
+
2998
+ </td>
2999
+ <td width="35%" height="100%" align="left">
3000
+ <div id="edit_table" style="padding:0px; overflow-y:scroll; height:531px"></div>
3001
+ </td>
3002
+
3003
+ <td align="center" valign="top"
3004
+ style="background:url(<?php echo plugins_url("images/border2.png", __FILE__) ?>) repeat-y;">&nbsp;</td>
3005
+ <td style="padding:15px">
3006
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
3007
+
3008
+ <tr>
3009
+ <td align="right"><input type="radio" value="end" name="el_pos" checked="checked" id="pos_end"
3010
+ onclick="Disable()"/>
3011
+ At The End
3012
+ <input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
3013
+ At The Beginning
3014
+ <input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
3015
+ Before
3016
+ <select style="width:100px; margin-left:5px" id="sel_el_pos" disabled="disabled">
3017
+ </select>
3018
+ <img alt="ADD" title="add" style="cursor:pointer; vertical-align:middle; margin:5px"
3019
+ src="<?php echo plugins_url("images/save.png", __FILE__) ?>" onClick="add(0)"/>
3020
+ <img alt="CANCEL" title="cancel" style=" cursor:pointer; vertical-align:middle; margin:5px"
3021
+ src="<?php echo plugins_url("images/cancel_but.png", __FILE__) ?>" onClick="close_window()"/>
3022
+
3023
+ <hr style=" margin-bottom:10px"/>
3024
+ </td>
3025
+ </tr>
3026
+
3027
+ <tr height="100%" valign="top">
3028
+ <td id="show_table"></td>
3029
+ </tr>
3030
+
3031
+ </table>
3032
+ </td>
3033
+ </tr>
3034
+ </table>
3035
+ </td>
3036
+ </tr>
3037
+ </table>
3038
+
3039
+ <input type="hidden" id="old"/>
3040
+ <input type="hidden" id="old_selected"/>
3041
+ <input type="hidden" id="element_type"/>
3042
+ <input type="hidden" id="editing_id"/>
3043
+ <input type="hidden" value="<?php echo plugins_url("", __FILE__) ?>" id="form_plugins_url"/>
3044
+
3045
+ <div id="main_editor"
3046
+ style="position:absolute; display:none; z-index:140;"><?php if (function_exists('the_editor') || function_exists('wp_editor')) {
3047
+ if (get_bloginfo('version') < '3.3') {
3048
+ ?>
3049
+ <div style=" max-width:500px; height:300px;text-align:left" id="poststuff">
3050
+ <div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>"
3051
+ class="postarea"><?php the_editor("", "form_maker_editor", "title", $media_buttons = TRUE, $tab_index = 1, $extended = TRUE); ?>
3052
+ </div>
3053
+ </div>
3054
+ <?php
3055
+ }
3056
+ else {
3057
+ echo "<style>#wp-form_maker_editor-media-buttons{ text-align:left }</style>";
3058
+ wp_editor("", "form_maker_editor");
3059
+ }
3060
+ }
3061
+ else {
3062
+ ?>
3063
+ <textarea name="form_maker_editor" id="form_maker_editor" cols="40" rows="6" style="width: 440px; height: 350px; "
3064
+ class="mce_editable" aria-hidden="true"></textarea>
3065
+ <?php
3066
+ }
3067
+ ?></div>
3068
+ </div>
3069
+
3070
+ <?php if (!function_exists('the_editor')) {
3071
+ ?>
3072
+ <iframe id="tinymce" style="display:none"></iframe>
3073
+
3074
+ <?php
3075
+ }
3076
+ ?>
3077
+
3078
+
3079
+
3080
+ <br/>
3081
+ <br/>
3082
+
3083
+ <fieldset>
3084
+
3085
+ <legend>
3086
+
3087
+ <h2 style="color:#00aeef">Form</h2>
3088
+
3089
+ </legend>
3090
+
3091
+ <?php
3092
+ global $first_css;
3093
+ echo '<style>' . $first_css . '</style>';
3094
+
3095
+ ?>
3096
+ <table width="100%" style="margin:8px">
3097
+ <tr id="page_navigation">
3098
+ <td align="center" width="90%" id="pages" show_title="<?php echo $row->show_title; ?>"
3099
+ show_numbers="<?php echo $row->show_numbers; ?>" type="<?php echo $row->pagination; ?>"></td>
3100
+ <td align="left" id="edit_page_navigation"></td>
3101
+ </tr>
3102
+ </table>
3103
+ <div id="take"><?php
3104
+
3105
+ if ($row->form)
3106
+ echo $row->form;
3107
+ else
3108
+
3109
+ 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>';
3110
+ ?></div>
3111
+ </fieldset>
3112
+ <input type="hidden" name="form" id="form">
3113
+ <input type="hidden" name="form_front" id="form_front">
3114
+ <input type="hidden" name="pagination" id="pagination"/>
3115
+ <input type="hidden" name="show_title" id="show_title"/>
3116
+ <input type="hidden" name="show_numbers" id="show_numbers"/>
3117
+ <input type="hidden" name="public_key" id="public_key"/>
3118
+ <input type="hidden" name="private_key" id="private_key"/>
3119
+ <input type="hidden" name="recaptcha_theme" id="recaptcha_theme"/>
3120
+ <input type="hidden" id="label_order" name="label_order" value="<?php echo $row->label_order;?>"/>
3121
+ <input type="hidden" name="counter" id="counter" value="<?php echo $row->counter;?>">
3122
+ <input type="hidden" id="label_order_current" name="label_order_current" value="<?php echo $row->label_order_current;?>"/>
3123
+ <script type="text/javascript">
3124
+
3125
+ function formOnload() {
3126
+ //enable maps
3127
+ for (t = 0; t <<?php echo $row->counter;?>; t++)
3128
+ if (document.getElementById(t + "_typeform_id_temp")) {
3129
+ if (document.getElementById(t + "_typeform_id_temp").value == "type_map" || document.getElementById(t + "_typeform_id_temp").value == "type_mark_map") {
3130
+ if_gmap_init(t);
3131
+ for (q = 0; q < 20; q++)
3132
+ if (document.getElementById(t + "_elementform_id_temp").getAttribute("long" + q)) {
3133
+
3134
+ w_long = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("long" + q));
3135
+ w_lat = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("lat" + q));
3136
+ w_info = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("info" + q));
3137
+ add_marker_on_map(t, q, w_long, w_lat, w_info, false);
3138
+ }
3139
+ }
3140
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_date")
3141
+ Calendar.setup({
3142
+ inputField:t + "_elementform_id_temp",
3143
+ ifFormat:document.getElementById(t + "_buttonform_id_temp").getAttribute('format'),
3144
+ button:t + "_buttonform_id_temp",
3145
+ align:"Tl",
3146
+ singleClick:true,
3147
+ firstDay:0
3148
+ });
3149
+
3150
+ }
3151
+
3152
+
3153
+ form_view = 1;
3154
+ form_view_count = 0;
3155
+ for (i = 1; i <= 30; i++) {
3156
+ if (document.getElementById('form_id_tempform_view' + i)) {
3157
+ form_view_count++;
3158
+ form_view_max = i;
3159
+ }
3160
+ }
3161
+
3162
+ if (form_view_count > 1) {
3163
+ for (i = 1; i <= form_view_max; i++) {
3164
+ if (document.getElementById('form_id_tempform_view' + i)) {
3165
+ first_form_view = i;
3166
+ break;
3167
+ }
3168
+ }
3169
+ form_view = form_view_max;
3170
+
3171
+ generate_page_nav(first_form_view);
3172
+
3173
+ var img_EDIT = document.createElement("img");
3174
+ img_EDIT.setAttribute("src", "<?php echo plugins_url('', __FILE__) ?>/images/edit.png");
3175
+ img_EDIT.style.cssText = "margin-left:40px; cursor:pointer";
3176
+ img_EDIT.setAttribute("onclick", 'el_page_navigation()');
3177
+
3178
+ var td_EDIT = document.getElementById("edit_page_navigation");
3179
+ td_EDIT.appendChild(img_EDIT);
3180
+
3181
+ document.getElementById('page_navigation').appendChild(td_EDIT);
3182
+
3183
+
3184
+ }
3185
+ document.getElementById('form').value = document.getElementById('take').innerHTML;
3186
+ document.getElementById('araqel').value = 1;
3187
+ }
3188
+ function formAddToOnload() {
3189
+ if (formOldFunctionOnLoad) {
3190
+ formOldFunctionOnLoad();
3191
+ }
3192
+ formOnload();
3193
+ }
3194
+
3195
+ function formLoadBody() {
3196
+ formOldFunctionOnLoad = window.onload;
3197
+ window.onload = formAddToOnload;
3198
+ }
3199
+
3200
+ var formOldFunctionOnLoad = null;
3201
+
3202
+ formLoadBody();
3203
+
3204
+
3205
+ </script>
3206
+
3207
+ <input type="hidden" name="option" value="com_formmaker"/>
3208
+
3209
+ <input type="hidden" name="id" value="<?php echo $row->id?>"/>
3210
+
3211
+ <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>"/>
3212
+
3213
+ <input type="hidden" name="task" value=""/>
3214
+ <input type="hidden" id="araqel" value="0"/>
3215
+
3216
+ </form>
3217
+
3218
+ <script>
3219
+ plugin_url = document.getElementById('form_plugins_url').value;
3220
+ appWidth = parseInt(document.body.offsetWidth);
3221
+ appHeight = parseInt(document.body.offsetHeight);
3222
+ // document.getElementById('toolbar-popup-popup').childNodes[1].href='index.php?option=com_formmaker&task=preview&tmpl=component&theme='+document.getElementById('theme').value;
3223
+ // document.getElementById('toolbar-popup-popup').childNodes[1].setAttribute('rel',"{handler: 'iframe', size: {x:"+(appWidth-100)+", y: "+(appHeight-30)+"}}");
3224
+ </script>
3225
+ <?php
3226
+ }
3227
+
3228
+ function html_form_options($row, $themes) {
3229
+ $label_id = array();
3230
+ $label_label = array();
3231
+ $label_type = array();
3232
+ $label_all = explode('#****#', $row->label_order_current);
3233
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
3234
+ foreach ($label_all as $key => $label_each) {
3235
+ $label_id_each = explode('#**id**#', $label_each);
3236
+ array_push($label_id, $label_id_each[0]);
3237
+ $label_order_each = explode('#**label**#', $label_id_each[1]);
3238
+ array_push($label_label, $label_order_each[0]);
3239
+ array_push($label_type, $label_order_each[1]);
3240
+ }
3241
+ ?>
3242
+ <script language="javascript" type="text/javascript">
3243
+ function submitbutton(pressbutton) {
3244
+ var form = document.adminForm;
3245
+ if (pressbutton == 'cancel') {
3246
+ submit_in(pressbutton);
3247
+ return;
3248
+ }
3249
+ // Set selected ab id to hidden input.
3250
+ var fieldset = document.getElementsByTagName('fieldset');
3251
+ for (i = 0; i < fieldset.length; i++) {
3252
+ if (fieldset[i].style.display != "none") {
3253
+ document.getElementById("fieldset_id").value = fieldset[i].id;
3254
+ }
3255
+ }
3256
+ if (form.mail.value != '') {
3257
+ subMailArr = form.mail.value.split(',');
3258
+ emailListValid = true;
3259
+ for (subMailIt = 0; subMailIt < subMailArr.length; subMailIt++) {
3260
+ trimmedMail = subMailArr[subMailIt].replace(/^\s+|\s+$/g, '');
3261
+ if (trimmedMail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1) {
3262
+ alert("This is not a list of valid email addresses.");
3263
+ emailListValid = false;
3264
+ break;
3265
+ }
3266
+ }
3267
+ if (!emailListValid) {
3268
+ return;
3269
+ }
3270
+ }
3271
+ submit_in(pressbutton);
3272
+ }
3273
+ function check_isnum(e) {
3274
+ var chCode1 = e.which || e.keyCode;
3275
+ if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57)) {
3276
+ return false;
3277
+ }
3278
+ return true;
3279
+ }
3280
+ function insertAtCursor(myField, myValue) {
3281
+ if (myField.style.display == "none") {
3282
+ tinyMCE.execCommand('mceInsertContent', false, "%" + myValue + "%");
3283
+ return;
3284
+ }
3285
+ if (document.selection) {
3286
+ myField.focus();
3287
+ sel = document.selection.createRange();
3288
+ sel.text = myValue;
3289
+ }
3290
+ else if (myField.selectionStart || myField.selectionStart == '0') {
3291
+ var startPos = myField.selectionStart;
3292
+ var endPos = myField.selectionEnd;
3293
+ myField.value = myField.value.substring(0, startPos)
3294
+ + "%" + myValue + "%"
3295
+ + myField.value.substring(endPos, myField.value.length);
3296
+ }
3297
+ else {
3298
+ myField.value += "%" + myValue + "%";
3299
+ }
3300
+ }
3301
+ gen = "<?php echo $row->counter; ?>";
3302
+ form_view_max = 20;
3303
+ function remove_article() {
3304
+ document.getElementById('id_name').value = "Select an Article";
3305
+ document.getElementById('article_id').value = "";
3306
+ }
3307
+ function set_type(type) {
3308
+ switch(type) {
3309
+ case 'post':
3310
+ document.getElementById('post').removeAttribute('style');
3311
+ document.getElementById('page').setAttribute('style','display:none');
3312
+ document.getElementById('custom_text').setAttribute('style','display:none');
3313
+ document.getElementById('url').setAttribute('style','display:none');
3314
+ document.getElementById('none').setAttribute('style','display:none');
3315
+ break;
3316
+ case 'page':
3317
+ document.getElementById('page').removeAttribute('style');
3318
+ document.getElementById('post').setAttribute('style','display:none');
3319
+ document.getElementById('custom_text').setAttribute('style','display:none');
3320
+ document.getElementById('url').setAttribute('style','display:none');
3321
+ document.getElementById('none').setAttribute('style','display:none');
3322
+ break;
3323
+ case 'custom_text':
3324
+ document.getElementById('page').setAttribute('style','display:none');
3325
+ document.getElementById('post').setAttribute('style','display:none');
3326
+ document.getElementById('custom_text').removeAttribute('style');
3327
+ document.getElementById('url').setAttribute('style','display:none');
3328
+ document.getElementById('none').setAttribute('style','display:none');
3329
+ break;
3330
+ case 'url':
3331
+ document.getElementById('page').setAttribute('style','display:none');
3332
+ document.getElementById('post').setAttribute('style','display:none');
3333
+ document.getElementById('custom_text').setAttribute('style','display:none');
3334
+ document.getElementById('url').removeAttribute('style');
3335
+ document.getElementById('none').setAttribute('style','display:none');
3336
+ break;
3337
+ case 'none':
3338
+ document.getElementById('page').setAttribute('style','display:none');
3339
+ document.getElementById('post').setAttribute('style','display:none');
3340
+ document.getElementById('custom_text').setAttribute('style','display:none');
3341
+ document.getElementById('url').setAttribute('style','display:none');
3342
+ document.getElementById('none').removeAttribute('style');
3343
+ break;
3344
+ }
3345
+ }
3346
+ function set_preview() {
3347
+ appWidth = parseInt(document.body.offsetWidth);
3348
+ appHeight = parseInt(document.body.offsetHeight);
3349
+ 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';
3350
+ }
3351
+ function submit_in(pressbutton) {
3352
+ document.getElementById('adminForm').action = document.getElementById('adminForm').action+"&task="+pressbutton;
3353
+ document.getElementById('adminForm').submit();
3354
+ }
3355
+ var thickDims, tbWidth, tbHeight;
3356
+ jQuery(document).ready(function($) {
3357
+ thickDims = function() {
3358
+ var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
3359
+ w = (tbWidth && tbWidth < W - 90) ? tbWidth : W - 40;
3360
+ h = (tbHeight && tbHeight < H - 60) ? tbHeight : H - 40;
3361
+ if (tbWindow.size()) {
3362
+ tbWindow.width(w).height(h);
3363
+ $('#TB_iframeContent').width(w).height(h - 27);
3364
+ tbWindow.css({'margin-left': '-' + parseInt((w / 2),10) + 'px'});
3365
+ if (typeof document.body.style.maxWidth != 'undefined') {
3366
+ tbWindow.css({'top':(H-h)/2,'margin-top':'0'});
3367
+ }
3368
+ }
3369
+ };
3370
+ thickDims();
3371
+ $(window).resize(function() { thickDims() });
3372
+ $('a.thickbox-preview').click( function() {
3373
+ tb_click.call(this);
3374
+ var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text;
3375
+ if (tbWidth = href.match(/&tbWidth=[0-9]+/)) {
3376
+ tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
3377
+ }
3378
+ else {
3379
+ tbWidth = $(window).width() - 120;
3380
+ }
3381
+ if (tbHeight = href.match(/&tbHeight=[0-9]+/)) {
3382
+ tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
3383
+ }
3384
+ else {
3385
+ tbHeight = $(window).height() - 120;
3386
+ }
3387
+ if (alink.length) {
3388
+ url = alink.attr('href') || '';
3389
+ text = alink.attr('title') || '';
3390
+ link = '&nbsp; <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
3391
+ }
3392
+ else {
3393
+ text = $(this).attr('title') || '';
3394
+ link = '&nbsp; <span class="tb-theme-preview-link">' + text + '</span>';
3395
+ }
3396
+ $('#TB_title').css({'background-color':'#222','color':'#dfdfdf'});
3397
+ $('#TB_closeAjaxWindow').css({'float':'left'});
3398
+ $('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
3399
+ $('#TB_iframeContent').width('100%');
3400
+ thickDims();
3401
+ return false;
3402
+ });
3403
+ // Theme details.
3404
+ $('.theme-detail').click(function () {
3405
+ $(this).siblings('.themedetaildiv').toggle();
3406
+ return false;
3407
+ });
3408
+ });
3409
+ </script>
3410
+ <style>
3411
+ .borderer {
3412
+ border-radius:5px;
3413
+ padding-left:5px;
3414
+ background-color:#F0F0F0;
3415
+ height:19px;
3416
+ width:153px;
3417
+ }
3418
+ fieldset.adminform {
3419
+ border-radius: 7px;
3420
+ border: 1px solid;
3421
+ padding: 5px;
3422
+ width: 97%;
3423
+ }
3424
+ table.admintable td.key,
3425
+ table.admintable td.paramlist_key {
3426
+ background-color: #F6F6F6;
3427
+ border-bottom: 1px solid #E9E9E9;
3428
+ border-right: 1px solid #E9E9E9;
3429
+ color: #666666;
3430
+ font-weight: bold;
3431
+ text-align: right;
3432
+ width: 200px;
3433
+ }
3434
+ .submenu-box {
3435
+ background-color: #F4F4F4;
3436
+ border: 1px solid #CCCCCC;
3437
+ border-radius: 7px 7px 7px 7px;
3438
+ padding: 6px 5px;
3439
+ margin: 5px 0;
3440
+ }
3441
+ #submenu li {
3442
+ display: inline;
3443
+ margin: 0;
3444
+ padding: 0;
3445
+ }
3446
+ #submenu {
3447
+ margin: 0;
3448
+ padding: 0;
3449
+ }
3450
+ #general {
3451
+ padding: 0 15px;
3452
+ }
3453
+ #submenu a:hover, #submenu a.active, #submenu span.nolink.active {
3454
+ background: none repeat scroll 0 0 #FFFFFF;
3455
+ color: #146295;
3456
+ }
3457
+ #submenu li a, #submenu span.nolink {
3458
+ border-right: 1px solid #CCCCCC;
3459
+ color: #808080;
3460
+ cursor: pointer;
3461
+ font-size: 1.1em;
3462
+ font-weight: bold;
3463
+ height: 12px;
3464
+ line-height: 14px;
3465
+ padding: 0 15px;
3466
+ }
3467
+ </style>
3468
+ <div style="font-size:14px; font-weight:bold">
3469
+ <a href="http://web-dorado.com/wordpress-form-maker-guide-2.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
3470
+ <br />
3471
+ This section allows you to edit form options.
3472
+ <a href="http://web-dorado.com/wordpress-form-maker-guide-3.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
3473
+ </div>
3474
+ <form action="admin.php?page=Form_maker&id=<?php echo $row->id; ?>" id="adminForm" method="post" name="adminForm">
3475
+ <input type="hidden" name="take" id="take" value="<?php $row->form ?>">
3476
+ <table width="97%">
3477
+ <tbody>
3478
+ <tr>
3479
+ <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>
3480
+ <td style="margin:5px;float:right" align="right"><input type="button" onclick="submitbutton('Apply_form_options')" value="Apply" class="button-secondary action"></td>
3481
+ <td style="margin:5px;float:right" align="right"><input type="button" onclick="submitbutton('Save_form_options')" value="Save" class="button-secondary action"></td>
3482
+ </tr>
3483
+ </tbody>
3484
+ </table>
3485
+ <script>
3486
+ function form_maker_options_tabs(id) {
3487
+ document.getElementById("actions_fieldset").style.display = "none";
3488
+ document.getElementById("custom_fieldset").style.display = "none";
3489
+ document.getElementById("general_fieldset").style.display = "none";
3490
+ document.getElementById("payment_fieldset").style.display = "none";
3491
+ document.getElementById("javascript_fieldset").style.display = "none";
3492
+ document.getElementById("actions").setAttribute('class', '');
3493
+ document.getElementById("custom").setAttribute('class', '');
3494
+ document.getElementById("general").setAttribute('class', '');
3495
+ document.getElementById("payment").setAttribute('class', '');
3496
+ document.getElementById("javascript").setAttribute('class', '');
3497
+ if (document.getElementById(id)) {
3498
+ document.getElementById(id + "_fieldset").style.display = "";
3499
+ document.getElementById(id).setAttribute('class', 'active');
3500
+ }
3501
+ return false;
3502
+ }
3503
+ </script>
3504
+ <div class="submenu-box" style="width:97%">
3505
+ <div class="submenu-pad">
3506
+ <ul id="submenu" class="configuration">
3507
+ <li>
3508
+ <a id="general" onclick="form_maker_options_tabs('general')" href="#">General Options</a>
3509
+ </li>
3510
+ <li>
3511
+ <a id="actions" onclick="form_maker_options_tabs('actions')" href="#">Actions after Submission</a>
3512
+ </li>
3513
+ <li>
3514
+ <a id="payment" onclick="form_maker_options_tabs('payment')" href="#">Payment Options</a>
3515
+ </li>
3516
+ <li>
3517
+ <a id="javascript" onclick="form_maker_options_tabs('javascript')" href="#">JavaScript</a>
3518
+ </li>
3519
+ <li>
3520
+ <a id="custom" onclick="form_maker_options_tabs('custom')" href="#">Custom Text in Email</a>
3521
+ </li>
3522
+ </ul>
3523
+ <div class="clr"></div>
3524
+ </div>
3525
+ </div>
3526
+ <fieldset id="actions_fieldset" class="adminform">
3527
+ <legend style="color:#0B55C4;font-weight: bold;">Actions after submission</legend>
3528
+ <table class="admintable">
3529
+ <tr valign="top">
3530
+ <td class="key">
3531
+ <label for="submissioni text">Action type</label>
3532
+ </td>
3533
+ <td>
3534
+ <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/>
3535
+ <input type="radio" name="submit_text_type" onclick="set_type('post')" value="2" <?php if($row->submit_text_type==2 ) echo "checked"; ?> /> Post<br/>
3536
+ <input type="radio" name="submit_text_type" onclick="set_type('page')" value="5" <?php if($row->submit_text_type==5 ) echo "checked"; ?> /> Page<br/>
3537
+ <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/>
3538
+ <input type="radio" name="submit_text_type" onclick="set_type('url')" value="4" <?php if($row->submit_text_type==4 ) echo "checked"; ?> /> URL
3539
+ </td>
3540
+ </tr>
3541
+ <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"' ?> >
3542
+ <td class="key">
3543
+ <label> Stay on Form </label>
3544
+ </td>
3545
+ <td>
3546
+ <img src="<?php echo plugins_url("images/tick.png",__FILE__); ?>" border="0">
3547
+ </td>
3548
+ </tr>
3549
+ <tr id="post" <?php if ($row->submit_text_type != 2) echo 'style="display:none"'; ?>>
3550
+ <td class="key">
3551
+ <label for="post_name"> Post </label>
3552
+ </td>
3553
+ <td>
3554
+ <select id="post_name" name="post_name" style="width:153px; font-size:11px;">
3555
+ <option value="0">- Select Post -</option>
3556
+ <?php
3557
+ // The Query.
3558
+ $args = array('posts_per_page' => 10000);
3559
+ query_posts($args);
3560
+ // The Loop.
3561
+ while (have_posts()) : the_post(); ?>
3562
+ <option value="<?php $x = get_permalink(get_the_ID()); echo $x; ?>" <?php if ($row->article_id == $x) {echo ' selected="selected"';} ?>><?php the_title(); ?></option>
3563
+ <?php
3564
+ endwhile;
3565
+ // Reset Query.
3566
+ wp_reset_query();
3567
+ ?>
3568
+ </select>
3569
+ </td>
3570
+ </tr>
3571
+ <tr id="page" <?php if($row->submit_text_type!=5) echo 'style="display:none"' ?>>
3572
+ <td class="key">
3573
+ <label for="page_num"> Page </label>
3574
+ </td>
3575
+ <td>
3576
+ <select id="page_num" name="page_name" style="width:153px; font-size:11px;">
3577
+ <option value="0">- Select Page -</option>
3578
+ <?php
3579
+ // The Query.
3580
+ $pages = get_pages();
3581
+ // The Loop.
3582
+ foreach ($pages as $page) {
3583
+ ?>
3584
+ <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>
3585
+ <?php
3586
+ }
3587
+ // Reset Query.
3588
+ wp_reset_query();
3589
+ ?>
3590
+ </select>
3591
+ </td>
3592
+ </tr>
3593
+ <tr <?php if($row->submit_text_type!=3 ) echo 'style="display:none"' ?> id="custom_text">
3594
+ <td class="key">
3595
+ <label for="poststuff"> Text </label>
3596
+ </td>
3597
+ <td>
3598
+ <?php if (get_bloginfo('version') < '3.3'){ ?>
3599
+ <div style="height:200px;text-align:left" id="poststuff">
3600
+ <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>
3601
+ </div>
3602
+ <?php } else { wp_editor($row->submit_text,"content");}?>
3603
+ </td>
3604
+ </tr>
3605
+ <tr <?php if($row->submit_text_type != 4 ) echo 'style="display:none"' ?> id="url">
3606
+ <td class="key">
3607
+ <label for="url"> URL </label>
3608
+ </td>
3609
+ <td>
3610
+ <input type="text" id="url" name="url" style="width:300px" value="<?php echo $row->url ?>" />
3611
+ </td>
3612
+ </tr>
3613
+ </table>
3614
+ </fieldset>
3615
+ <fieldset id="custom_fieldset" class="adminform">
3616
+ <legend style="color:#0B55C4;font-weight: bold;">Custom text in email</legend>
3617
+ <table class="admintable">
3618
+ <tr>
3619
+ <td class="key" valign="top">
3620
+ <label>For Administrator</label>
3621
+ </td>
3622
+ <td>
3623
+ <div style="margin-bottom:5px">
3624
+ <?php
3625
+ for ($i = 0; $i < count($label_label); $i++) {
3626
+ 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") {
3627
+ continue;
3628
+ }
3629
+ $param = "'" . htmlspecialchars(addslashes($label_label[$i])) . "'";
3630
+ $choise = 'document.getElementById(\'script_mail\')';
3631
+ echo '<input style="border:1px solid silver; font-size:10px;" type="button" value="' . htmlspecialchars(addslashes($label_label[$i])) . '" onClick="insertAtCursor(' . $choise . ',' . $param . ')" /> ';
3632
+ }
3633
+ $choise = 'document.getElementById(\'script_mail\')';
3634
+ echo '<input style="border:1px solid silver; font-size:10px; margin:3px;" type="button" value="All fields list" onClick="insertAtCursor(' . $choise . ',\'all\')" /> ';
3635
+ ?>
3636
+ </div>
3637
+ <?php
3638
+ if (function_exists('wp_editor') || function_exists('the_editor')) {
3639
+ if (get_bloginfo('version') < '3.3') {
3640
+ the_editor($row->script_mail, $idd = 'script_mail', $prev_id = 'script_mail', $media_buttons = true, $tab_index = 1, $extended = TRUE);
3641
+ }
3642
+ else {
3643
+ wp_editor($row->script_mail, $idd = 'script_mail');
3644
+ }
3645
+ }
3646
+ else {
3647
+ ?>
3648
+ <textarea name="script_mail" id="script_mail" cols="20" rows="10" style="width:300px; height:450px;"><?php echo $row->script_mail ?></textarea>
3649
+ <?php
3650
+ }
3651
+ ?>
3652
+ </td>
3653
+ </tr>
3654
+ <tr>
3655
+ <td valign="top" height="30"></td>
3656
+ <td valign="top"></td>
3657
+ </tr>
3658
+ <tr>
3659
+ <td class="key" valign="top">
3660
+ <label>For User</label>
3661
+ </td>
3662
+ <td>
3663
+ <div style="margin-bottom:5px">
3664
+ <?php
3665
+ for ($i = 0; $i < count($label_label); $i++) {
3666
+ 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") {
3667
+ continue;
3668
+ }
3669
+ $param = "'" . htmlspecialchars(addslashes($label_label[$i])) . "'";
3670
+ // if (!$is_editor) {
3671
+ $choise = 'document.getElementById(\'script_mail_user\')';
3672
+ echo '<input style="border:1px solid silver; font-size:10px;" type="button" value="' . htmlspecialchars(addslashes($label_label[$i])) . '" onClick="insertAtCursor(' . $choise . ',' . $param . ')" /> ';
3673
+ // }
3674
+ // else {
3675
+ // echo '<input type="button" value="' . htmlspecialchars(addslashes($label_label[$i])) . '" onClick="insertAtCursorEditor(' . $param . ')" /> ';
3676
+ // }
3677
+ }
3678
+ // if (!function_exists('wp_editor') && !function_exists('the_editor')) {
3679
+ $choise = 'document.getElementById(\'script_mail_user\')';
3680
+ echo '<input style="border:1px solid silver; font-size:10px; margin:3px;" type="button" value="All fields list" onClick="insertAtCursor(' . $choise . ',\'all\')" /> ';
3681
+ // }
3682
+ // else {
3683
+ // echo '<input style="margin:3px" type="button" value="All fields list" onClick="insertAtCursorEditor(\'all\')" /> ';
3684
+ // }
3685
+ ?>
3686
+ </div>
3687
+ <?php
3688
+ if (function_exists('wp_editor') || function_exists('the_editor')) {
3689
+ if (get_bloginfo('version') < '3.3') {
3690
+ the_editor($row->script_mail_user, $idd = 'script_mail_user', $prev_id = 'script_mail_user', $media_buttons = true, $tab_index = 1, $extended = TRUE);
3691
+ }
3692
+ else {
3693
+ wp_editor($row->script_mail_user, $idd = 'script_mail_user');
3694
+ }
3695
+ }
3696
+ else {
3697
+ ?>
3698
+ <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>
3699
+ <?php
3700
+ }
3701
+ ?>
3702
+ </td>
3703
+ </tr>
3704
+ </table>
3705
+ </fieldset>
3706
+ <fieldset id="general_fieldset" class="adminform">
3707
+ <legend style="color:#0B55C4;font-weight: bold;">Advanced Options</legend>
3708
+ <table class="admintable" style="float:left">
3709
+ <tr valign="top">
3710
+ <td class="key">
3711
+ <label>Email to send submissions to</label>
3712
+ </td>
3713
+ <td>
3714
+ <input id="mail" name="mail" value="<?php echo $row->mail ?>" style="width:250px;"/>
3715
+ </td>
3716
+ </tr>
3717
+ <tr valign="top">
3718
+ <td class="key">
3719
+ <label>Theme</label>
3720
+ </td>
3721
+ <td>
3722
+ <select id="theme" name="theme" style="width:260px; " onChange="set_preview()">
3723
+ <?php
3724
+ $form_theme = '';
3725
+ foreach ($themes as $theme) {
3726
+ if ($theme->id == $row->theme) {
3727
+ echo '<option value="' . $theme->id . '" selected>' . $theme->title . '</option>';
3728
+ $form_theme=$theme->css;
3729
+ }
3730
+ else
3731
+ echo '<option value="' . $theme->id . '">' . $theme->title . '</option>';
3732
+ }
3733
+ ?>
3734
+ </select>
3735
+ <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;">
3736
+ <input type="button" value="preview" class="button-primary" />
3737
+ </a>
3738
+ </td>
3739
+ </tr>
3740
+ </table>
3741
+ <style>
3742
+ div.wd_preview span {
3743
+ float: none;
3744
+ width: 32px;
3745
+ height: 32px;
3746
+ margin: 0 auto;
3747
+ display: block;
3748
+ }
3749
+ div.wd_preview a {
3750
+ display: block;
3751
+ float: left;
3752
+ white-space: nowrap;
3753
+ border: 1px solid #fbfbfb;
3754
+ padding: 1px 5px;
3755
+ cursor: pointer;
3756
+ text-decoration: none
3757
+ }
3758
+ </style>
3759
+ </fieldset>
3760
+ <fieldset id="payment_fieldset" class="adminform">
3761
+ <legend style="color:#0B55C4;font-weight: bold;">Payment Options</legend>
3762
+ <div class="error">Paypal Options are disabled in free version.</div>
3763
+ <table class="admintable">
3764
+ <tr valign="top">
3765
+ <td class="key">
3766
+ <label>Turn Paypal On</label>
3767
+ </td>
3768
+ <td>
3769
+ <input disabled="disabled" type="radio" name="paypal_mode" id="paypal_mode1" value="1" <?php if ($row->paypal_mode == "1")
3770
+ echo "checked" ?> /> <label for="paypal_mode1">On </label><br/>
3771
+ <input disabled="disabled" type="radio" name="paypal_mode" id="paypal_mode2" value="0" <?php if ($row->paypal_mode != "1")
3772
+ echo "checked" ?> /> <label for="paypal_mode2">Off </label><br/>
3773
+ </td>
3774
+ </tr>
3775
+ <tr valign="top">
3776
+ <td class="key">
3777
+ <label>Checkout Mode</label>
3778
+ </td>
3779
+ <td>
3780
+ <input disabled="disabled" type="radio" name="checkout_mode" id="checkout_mode1"
3781
+ value="production" <?php if ($row->checkout_mode == "production")
3782
+ echo "checked" ?> /> <label for="checkout_mode1">Production </label><br/>
3783
+ <input disabled="disabled" type="radio" name="checkout_mode" id="checkout_mode2"
3784
+ value="testmode" <?php if ($row->checkout_mode != "production")
3785
+ echo "checked" ?> /> <label for="checkout_mode2">Testmode</label><br/>
3786
+ </td>
3787
+ </tr>
3788
+ <tr valign="top">
3789
+ <td class="key">
3790
+ <label>Paypal email</label>
3791
+ </td>
3792
+ <td>
3793
+ <input disabled="disabled" type="text" name="paypal_email" id="paypal_email" value="<?php echo $row->paypal_email; ?>" class="text_area" style="width:250px">
3794
+ </td>
3795
+ </tr>
3796
+ <tr valign="top">
3797
+ <td class="key">
3798
+ <label>Payment Currency</label>
3799
+ </td>
3800
+ <td>
3801
+ <select disabled="disabled" id="payment_currency" name="payment_currency" style="width:253px">
3802
+ <option value="USD" <?php echo (($row->payment_currency == 'USD') ? 'selected' : ''); ?>>$ &#8226; U.S. Dollar</option>
3803
+ <option value="EUR" <?php echo (($row->payment_currency == 'EUR') ? 'selected' : ''); ?>>&#8364; &#8226; Euro</option>
3804
+ <option value="GBP" <?php echo (($row->payment_currency == 'GBP') ? 'selected' : ''); ?>>&#163; &#8226; Pound Sterling</option>
3805
+ <option value="JPY" <?php echo (($row->payment_currency == 'JPY') ? 'selected' : ''); ?>>&#165; &#8226; Japanese Yen</option>
3806
+ <option value="CAD" <?php echo (($row->payment_currency == 'CAD') ? 'selected' : ''); ?>>C$ &#8226; Canadian Dollar</option>
3807
+ <option value="MXN" <?php echo (($row->payment_currency == 'MXN') ? 'selected' : ''); ?>>Mex$ &#8226; Mexican Peso</option>
3808
+ <option value="HKD" <?php echo (($row->payment_currency == 'HKD') ? 'selected' : ''); ?>>HK$ &#8226; Hong Kong Dollar</option>
3809
+ <option value="HUF" <?php echo (($row->payment_currency == 'HUF') ? 'selected' : ''); ?>>Ft &#8226; Hungarian Forint</option>
3810
+ <option value="NOK" <?php echo (($row->payment_currency == 'NOK') ? 'selected' : ''); ?>>kr &#8226; Norwegian Kroner</option>
3811
+ <option value="NZD" <?php echo (($row->payment_currency == 'NZD') ? 'selected' : ''); ?>>NZ$ &#8226; New Zealand Dollar</option>
3812
+ <option value="SGD" <?php echo (($row->payment_currency == 'SGD') ? 'selected' : ''); ?>>S$ &#8226; Singapore Dollar</option>
3813
+ <option value="SEK" <?php echo (($row->payment_currency == 'SEK') ? 'selected' : ''); ?>>kr &#8226; Swedish Kronor</option>
3814
+ <option value="PLN" <?php echo (($row->payment_currency == 'PLN') ? 'selected' : ''); ?>>zl &#8226; Polish Zloty</option>
3815
+ <option value="AUD" <?php echo (($row->payment_currency == 'AUD') ? 'selected' : ''); ?>>A$ &#8226; Australian Dollar</option>
3816
+ <option value="DKK" <?php echo (($row->payment_currency == 'DKK') ? 'selected' : ''); ?>>kr &#8226; Danish Kroner</option>
3817
+ <option value="CHF" <?php echo (($row->payment_currency == 'CHF') ? 'selected' : ''); ?>>CHF &#8226; Swiss Francs</option>
3818
+ <option value="CZK" <?php echo (($row->payment_currency == 'CZK') ? 'selected' : ''); ?>>Kc &#8226; Czech Koruny</option>
3819
+ <option value="ILS" <?php echo (($row->payment_currency == 'ILS') ? 'selected' : ''); ?>>&#8362; &#8226; Israeli Sheqel</option>
3820
+ <option value="BRL" <?php echo (($row->payment_currency == 'BRL') ? 'selected' : ''); ?>>R$ &#8226; Brazilian Real</option>
3821
+ <option value="TWD" <?php echo (($row->payment_currency == 'TWD') ? 'selected' : ''); ?>>NT$ &#8226; Taiwan New Dollars</option>
3822
+ <option value="MYR" <?php echo (($row->payment_currency == 'MYR') ? 'selected' : ''); ?>>RM &#8226; Malaysian Ringgit</option>
3823
+ <option value="PHP" <?php echo (($row->payment_currency == 'PHP') ? 'selected' : ''); ?>>&#8369; &#8226; Philippine Peso</option>
3824
+ <option value="THB" <?php echo (($row->payment_currency == 'THB') ? 'selected' : ''); ?>>&#xe3f; &#8226; Thai Bahtv</option>
3825
+ </select>
3826
+ </td>
3827
+ </tr>
3828
+ <tr valign="top">
3829
+ <td class="key">
3830
+ <label for="tax">Tax</label>
3831
+ </td>
3832
+ <td>
3833
+ <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)"> %
3834
+ </td>
3835
+ </tr>
3836
+ </table>
3837
+ </fieldset>
3838
+ <fieldset id="javascript_fieldset" class="adminform">
3839
+ <legend style="color:#0B55C4;font-weight: bold;">JavaScript</legend>
3840
+ <table class="admintable">
3841
+ <tr valign="top">
3842
+ <td class="key">
3843
+ <label for="javascript">Javascript</label>
3844
+ </td>
3845
+ <td>
3846
+ <textarea style="margin: 0px;" cols="60" rows="30" name="javascript" id="javascript"><?php echo $row->javascript; ?></textarea>
3847
+ </td>
3848
+ </tr>
3849
+ </table>
3850
+ </fieldset>
3851
+ <input type="hidden" name="option" value="com_formmaker"/>
3852
+ <input type="hidden" name="id" value="<?php echo $row->id?>"/>
3853
+ <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>"/>
3854
+ <input type="hidden" name="task" value="" />
3855
+ <input type="hidden" name="fieldset_id" id="fieldset_id" value="<?php echo ((isset($_POST['fieldset_id'])) ? esc_html($_POST['fieldset_id']) : 'general_fieldset'); ?>"/>
3856
+ </form>
3857
+ <script>
3858
+ window.onload = form_maker_options_tabs(document.getElementById("fieldset_id").value.replace("_fieldset", ""));
3859
+ </script>
3860
+ <?php
3861
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
form_maker_functions.php CHANGED
@@ -1,1019 +1,599 @@
1
- <?php
2
-
3
- if(!current_user_can('manage_options')) {
4
- die('Access Denied');
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 submitform( pressbutton ){
43
-
44
- document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task=update_complite";
45
- document.getElementById('adminForm').submit();
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=$_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
- global $wpdb;
173
- $where= '';
174
- $order="";
175
- $sort["default_style"]="manage-column column-autor sortable desc";
176
- $sort["sortid_by"]="";
177
- if(isset($_POST['page_number']))
178
- {
179
-
180
- if($_POST['asc_or_desc'])
181
- {
182
- $sort["sortid_by"]=$_POST['order_by'];
183
- if($_POST['asc_or_desc']==1)
184
- {
185
- $sort["custom_style"]="manage-column column-title sorted asc";
186
- $sort["1_or_2"]="2";
187
- $order="ORDER BY ".$sort["sortid_by"]." ASC";
188
- }
189
- else
190
- {
191
- $sort["custom_style"]="manage-column column-title sorted desc";
192
- $sort["1_or_2"]="1";
193
- $order="ORDER BY ".$sort["sortid_by"]." DESC";
194
- }
195
- }
196
-
197
- if($_POST['page_number'])
198
- {
199
- $limit=($_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=$_POST['search_events_by_title'];
212
- }
213
-
214
- else
215
- {
216
- $search_tag="";
217
- }
218
- if ( $search_tag ) {
219
- $where= ' WHERE title LIKE "%'.$search_tag.'%"';
220
- }
221
-
222
- if($where){
223
- $where.=" AND `id` NOT IN(".get_option('contact_form_forms',0).")";
224
- }
225
- else
226
- {
227
- $where=" WHERE `id` NOT IN(".get_option('contact_form_forms',0).")";
228
- }
229
-
230
- // get the total number of records
231
- $query = "SELECT COUNT(*) FROM ".$wpdb->prefix."formmaker". $where;
232
- $total = $wpdb->get_var($query);
233
- $pageNav['total'] =$total;
234
- $pageNav['limit'] = $limit/20+1;
235
-
236
- $query = "SELECT * FROM ".$wpdb->prefix."formmaker".$where." ". $order." "." LIMIT ".$limit.",20";
237
- $rows = $wpdb->get_results($query);
238
- $old_version = false;
239
- foreach($rows as $row)
240
- {
241
- if(strpos($row->form, "wdform_table1")===false)
242
- {
243
- $old_version = true;
244
- break;
245
- }
246
- }
247
-
248
- $can_update_form=true;
249
- if($old_version)
250
- {
251
- $old_n=0;
252
- foreach($rows as $row)
253
- {
254
-
255
- $count_words_in_form =count(explode("_element_section",$row->form))-count(explode("and_element_section",$row->form));
256
- if(!(strpos($row->form, "type_map")===false)){
257
- $can_update_form=false;
258
- break;
259
- }
260
-
261
- if(!(strpos($row->form, "type_file")===false)){
262
- $can_update_form=false;
263
- break;
264
- }
265
- if($count_words_in_form>5){
266
- $can_update_form=false;
267
- break;
268
- }
269
- if(strpos($row->form, "wdform_table1")===false)
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
- function edit_form_maker($id)
344
- {
345
- global $wpdb;
346
- // load the row from the db table
347
- if(get_option('contact_form_forms',false)){
348
- $row=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$id."' AND `id` NOT IN(".get_option('contact_form_forms').")");
349
- }
350
- else
351
- {
352
- $row=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$id."'");
353
- }
354
- $labels= array();
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
- function save_form()
399
- {
400
- $count_words_in_form = count(explode("_element_section",$_POST["form"]))-count(explode("and_element_section",$_POST["form"]))+count(explode("wdform_table1",$_POST["form"]));
401
- if($count_words_in_form>9)
402
- {
403
- ?>
404
- <div class="updated"><p><strong>The free version is limited up to 5 fields to add. If you need this functionality, you need to buy the commercial version.</strong></p></div>
405
- <?php
406
- return false;
407
- }
408
-
409
- global $wpdb;
410
- if($_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
- }
418
- // before form submit
419
- function before_submit()
420
- {
421
- }
422
- // before form reset
423
- function before_reset()
424
- {
425
- }";
426
- $save_or_no= $wpdb->insert($wpdb->prefix.'formmaker', array(
427
- 'id' => NULL,
428
- 'title' => $_POST["title"],
429
- 'mail' => $_POST["mail"],
430
- 'form' => $no_slash_form,
431
- 'form_front' => $no_slash_form_front,
432
- 'theme' => $_POST["theme"],
433
- 'counter' => $_POST["counter"],
434
- 'label_order' => $_POST["label_order"],
435
- 'pagination' => $_POST["pagination"],
436
- 'show_title' => $_POST["show_title"],
437
- 'show_numbers' => $_POST["show_numbers"],
438
- 'public_key' => $_POST["public_key"],
439
- 'private_key' => $_POST["private_key"],
440
- 'recaptcha_theme' => $_POST["recaptcha_theme"],
441
- 'javascript' => $javascript,
442
- 'script1' =>'',
443
- 'script2' =>'',
444
- 'script_user1' =>'',
445
- 'script_user2' =>'',
446
- 'submit_text' =>'',
447
- 'url' =>'',
448
- 'article_id' =>0,
449
- 'submit_text_type' =>0
450
-
451
- ),
452
- array(
453
- '%d',
454
- '%s',
455
- '%s',
456
- '%s',
457
- '%s',
458
- '%d',
459
- '%d',
460
- '%s',
461
- '%s',
462
- '%s',
463
- '%s',
464
- '%s',
465
- '%s',
466
- '%s',
467
- '%s',
468
- '%s',
469
- '%s',
470
- '%s',
471
- '%s',
472
- '%s',
473
- '%s',
474
- '%s',
475
- '%d'
476
- )
477
- );
478
-
479
- if(!$save_or_no)
480
- {
481
- ?>
482
- <div class="updated"><p><strong><?php _e('Error. Please install plugin again'); ?></strong></p></div>
483
- <?php
484
- return false;
485
- }
486
- $id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
487
- $save_or_no= $wpdb->insert($wpdb->prefix.'formmaker_views', array(
488
- 'form_id' => $id
489
- ),
490
- array(
491
- '%d'
492
- )
493
- );
494
- ?>
495
-
496
- <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
497
- <?php
498
-
499
- return true;
500
- }
501
- else
502
- {
503
- ?>
504
- <h1>Error</h1>
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
- function save_as_copy(){
521
- global $wpdb;
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=".$_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
- '%d',
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
- exit;
612
- }
613
-
614
-
615
-
616
-
617
- }
618
-
619
-
620
-
621
-
622
- function apply_form($id){
623
-
624
- global $wpdb;
625
-
626
-
627
- $count_words_in_form = count(explode("_element_section",$_POST["form"]))-count(explode("and_element_section",$_POST["form"]))+count(explode("wdform_table1",$_POST["form"]));
628
- if($count_words_in_form>9)
629
- {
630
- ?>
631
- <div class="updated"><p><strong>The free version is limited up to 5 fields to add. If you need this functionality, you need to buy the commercial version.</strong></p></div>
632
- <?php
633
- return false;
634
- }
635
- $no_slash_form = stripslashes($_POST['form']);
636
- $no_slash_form_front= stripslashes($_POST['form_front']);
637
- if($_POST["title"]!=''){
638
-
639
- $savedd=$wpdb->update($wpdb->prefix."formmaker", array(
640
- 'title' => $_POST["title"],
641
- 'mail' => $_POST["mail"],
642
- 'form' => $no_slash_form,
643
- 'form_front' => $no_slash_form_front,
644
- 'theme' => $_POST["theme"],
645
- 'counter' => $_POST["counter"],
646
- 'label_order' => $_POST["label_order"],
647
- 'pagination' => $_POST["pagination"],
648
- 'show_title' => $_POST["show_title"],
649
- 'show_numbers' => $_POST["show_numbers"],
650
- 'public_key' => $_POST["public_key"],
651
- 'private_key' => $_POST["private_key"],
652
- 'recaptcha_theme' => $_POST["recaptcha_theme"],
653
- ),
654
- array('id'=>$id),
655
- array(
656
- '%s',
657
- '%s',
658
- '%s',
659
- '%s',
660
- '%d',
661
- '%d',
662
- '%s',
663
- '%s',
664
- '%s',
665
- '%s',
666
- '%s',
667
- '%s',
668
- '%s'
669
- )
670
-
671
- );
672
- ?>
673
- <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
674
- <?php
675
-
676
-
677
- }
678
- else{
679
- ?>
680
- <div class="updated"><p><strong><?php _e('could not save form'); ?></strong></p></div>
681
- <?php
682
- }
683
- }
684
-
685
-
686
-
687
-
688
-
689
-
690
-
691
-
692
-
693
-
694
- function remove_form($id){
695
- global $wpdb;
696
-
697
- // If any item selected
698
-
699
- // Prepare sql statement, if cid array more than one,
700
- // will be "cid1, cid2, ..."
701
- // Create sql statement
702
- $sql_remov_form="DELETE FROM ".$wpdb->prefix."formmaker WHERE id='".$id."'";
703
- if(!$wpdb->query($sql_remov_form))
704
- {
705
- ?>
706
- <div id="message" class="error"><p>Form Not Deleted</p></div>
707
- <?php
708
- return false;
709
- }
710
-
711
- $sql_remov_form="DELETE FROM ".$wpdb->prefix."formmaker_views WHERE form_id='".$id."'";
712
- if(!$wpdb->query($sql_remov_form))
713
- {
714
- ?>
715
- <div id="message" class="error"><p>Form views Not Deleted</p></div>
716
- <?php
717
- return false;
718
- }
719
- $sql_remov_form="DELETE FROM ".$wpdb->prefix."formmaker_submits WHERE form_id='".$id."'";
720
- if(!$wpdb->query($sql_remov_form))
721
- {
722
- ?>
723
- <div id="message" class="error"><p>Form submits Not Deleted</p></div>
724
- <?php
725
- return false;
726
- }
727
-
728
- ?>
729
- <div class="updated"><p><strong><?php _e('Item Deleted.' ); ?></strong></p></div>
730
- <?php
731
-
732
- // Execute query
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
- document.getElementById('adminForm').action="admin.php?page=Form_maker&task=gotoedit&id=<?php echo $id;?>";
762
- document.getElementById('adminForm').submit();
763
- }
764
-
765
- </script>
766
- <form action="index.php" method="post" name="adminForm" id="adminForm">
767
- </form>
768
- <?php
769
- }
770
-
771
- function gotoedit(){
772
-
773
- ?>
774
- <div class="updated"><p><strong><?php _e('Item Saved' ); ?></strong></p></div>
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
- function Apply_Custom_text_in_email_for_user($id){
995
- global $wpdb;
996
- $savedd=$wpdb->update($wpdb->prefix."formmaker", array(
997
- 'script_user1' => stripslashes($_POST["script_user1"]),
998
- 'script_user2' => stripslashes($_POST["script_user2"]),
999
-
1000
- ),
1001
- array('id'=>$id),
1002
- array(
1003
- '%s',
1004
- '%s'
1005
- )
1006
-
1007
- );
1008
- ?>
1009
- <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
1010
- <?php
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
+ }
243
+ // before form submit
244
+ function before_submit()
245
+ {
246
+ }
247
+ // before form reset
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
+ ), array(
278
+ '%d',
279
+ '%s',
280
+ '%s',
281
+ '%s',
282
+ '%s',
283
+ '%d',
284
+ '%d',
285
+ '%s',
286
+ '%s',
287
+ '%s',
288
+ '%s',
289
+ '%s',
290
+ '%s',
291
+ '%s',
292
+ '%s',
293
+ '%s',
294
+ '%s',
295
+ '%s',
296
+ '%s',
297
+ '%s',
298
+ '%s',
299
+ '%s',
300
+ '%d',
301
+ '%s',
302
+ '%s'
303
+ ));
304
+ if (!$save_or_no) {
305
+ ?>
306
+ <div class="updated"><p><strong><?php _e('Error. Please install plugin again'); ?></strong></p></div>
307
+ <?php
308
+ return FALSE;
309
+ }
310
+ $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
311
+ $save_or_no = $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
312
+ 'form_id' => $id
313
+ ), array(
314
+ '%d'
315
+ ));
316
+ ?>
317
+
318
+ <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
319
+ <?php
320
+
321
+ return TRUE;
322
+ }
323
+ else {
324
+ ?>
325
+ <h1>Error</h1>
326
+ <?php
327
+ exit;
328
+ }
329
+ }
330
+ else {
331
+ ?>
332
+ <div class="updated"><p><strong><?php _e('could not save form '); ?></strong></p></div>
333
+ <?php
334
+ }
335
+ }
336
+
337
+ function save_as_copy() {
338
+ global $wpdb;
339
+ if (isset($_POST["label_order"]) && isset($_POST["title"]) && isset($_POST["form"]) && isset($_GET['id'])) {
340
+ $no_slash_form = stripslashes($_POST['form']);
341
+ $no_slash_form_front = stripslashes($_POST['form_front']);
342
+ $form_id = (int) $_GET['id'];
343
+ $row_for_sav_as_copy = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id=" . $form_id);
344
+ $javascript = $row_for_sav_as_copy->javascript;
345
+ $save_or_no = $wpdb->insert($wpdb->prefix . 'formmaker', array(
346
+ 'id' => NULL,
347
+ 'title' => $_POST["title"],
348
+ 'mail' => $row_for_sav_as_copy->mail,
349
+ 'form' => $no_slash_form,
350
+ 'form_front' => $no_slash_form_front,
351
+ 'theme' => $row_for_sav_as_copy->theme,
352
+ 'counter' => $_POST["counter"],
353
+ 'label_order' => $_POST["label_order"],
354
+ 'pagination' => $_POST["pagination"],
355
+ 'show_title' => $_POST["show_title"],
356
+ 'show_numbers' => $_POST["show_numbers"],
357
+ 'public_key' => $_POST["public_key"],
358
+ 'private_key' => $_POST["private_key"],
359
+ 'recaptcha_theme' => $_POST["recaptcha_theme"],
360
+ 'javascript' => $javascript,
361
+ 'script1' => $row_for_sav_as_copy->script1,
362
+ 'script2' => $row_for_sav_as_copy->script2,
363
+ 'script_user1' => $row_for_sav_as_copy->script_user1,
364
+ 'script_user2' => $row_for_sav_as_copy->script_user2,
365
+ 'submit_text' => $row_for_sav_as_copy->submit_text,
366
+ 'url' => $row_for_sav_as_copy->url,
367
+ 'article_id' => $row_for_sav_as_copy->article_id,
368
+ 'submit_text_type' => $row_for_sav_as_copy->submit_text_type,
369
+ 'script_mail' => $row_for_sav_as_copy->script_mail,
370
+ 'script_mail_user' => $row_for_sav_as_copy->script_mail_user,
371
+ 'paypal_mode' => $row_for_sav_as_copy->paypal_mode,
372
+ 'checkout_mode' => $row_for_sav_as_copy->checkout_mode,
373
+ 'paypal_email' => $row_for_sav_as_copy->paypal_email,
374
+ 'payment_currency' => $row_for_sav_as_copy->payment_currency,
375
+ 'tax' => $row_for_sav_as_copy->tax
376
+ ), array(
377
+ '%d',
378
+ '%s',
379
+ '%s',
380
+ '%s',
381
+ '%s',
382
+ '%d',
383
+ '%d',
384
+ '%s',
385
+ '%s',
386
+ '%s',
387
+ '%s',
388
+ '%s',
389
+ '%s',
390
+ '%s',
391
+ '%s',
392
+ '%s',
393
+ '%s',
394
+ '%s',
395
+ '%s',
396
+ '%s',
397
+ '%s',
398
+ '%s',
399
+ '%s',
400
+ '%d',
401
+ '%s',
402
+ '%s',
403
+ '%d',
404
+ '%s',
405
+ '%s',
406
+ '%s',
407
+ '%d'
408
+ ));
409
+ if (!$save_or_no) {
410
+ ?>
411
+ <div class="updated"><p><strong><?php _e('Error. Please install plugin again'); ?></strong></p></div>
412
+ <?php
413
+ return FALSE;
414
+ }
415
+ $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
416
+ $save_or_no = $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
417
+ 'form_id' => $id
418
+ ), array(
419
+ '%d'
420
+ ));
421
+ ?>
422
+
423
+ <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
424
+ <?php
425
+
426
+ return TRUE;
427
+ }
428
+ else {
429
+ ?>
430
+ <h1>Error</h1>
431
+ <
432
+ <?php
433
+ exit;
434
+ }
435
+ }
436
+
437
+ function apply_form($id) {
438
+ global $wpdb;
439
+ $count_words_in_form = count(explode("_element_section", $_POST["form"])) - count(explode("and_element_section", $_POST["form"])) + count(explode("wdform_table1", $_POST["form"]));
440
+ if ($count_words_in_form > 9) {
441
+ ?>
442
+ <div class="updated"><p><strong>The free version is limited up to 5 fields to add. If you need this functionality, you
443
+ need to buy the commercial version.</strong></p></div>
444
+ <?php
445
+ return FALSE;
446
+ }
447
+ $no_slash_form = stripslashes($_POST['form']);
448
+ $no_slash_form_front = stripslashes($_POST['form_front']);
449
+ if ($_POST["title"] != '') {
450
+ $savedd = $wpdb->update($wpdb->prefix . "formmaker", array(
451
+ 'title' => $_POST["title"],
452
+ 'form' => $no_slash_form,
453
+ 'form_front' => $no_slash_form_front,
454
+ 'counter' => $_POST["counter"],
455
+ 'label_order' => $_POST["label_order"],
456
+ 'pagination' => $_POST["pagination"],
457
+ 'show_title' => $_POST["show_title"],
458
+ 'show_numbers' => $_POST["show_numbers"],
459
+ 'public_key' => $_POST["public_key"],
460
+ 'private_key' => $_POST["private_key"],
461
+ 'recaptcha_theme' => $_POST["recaptcha_theme"],
462
+ ), array('id' => $id), array(
463
+ '%s',
464
+ '%s',
465
+ '%s',
466
+ '%d',
467
+ '%s',
468
+ '%s',
469
+ '%s',
470
+ '%s',
471
+ '%s',
472
+ '%s',
473
+ '%s'
474
+ ), array('%d'));
475
+ ?>
476
+ <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
477
+ <?php
478
+ }
479
+ else {
480
+ ?>
481
+ <div class="updated"><p><strong><?php _e('could not save form'); ?></strong></p></div>
482
+ <?php
483
+ }
484
+ }
485
+
486
+ function remove_form($id) {
487
+ global $wpdb;
488
+ // If any item selected
489
+ // Prepare sql statement, if cid array more than one,
490
+ // will be "cid1, cid2, ..."
491
+ // Create sql statement
492
+ $sql_remov_form = "DELETE FROM " . $wpdb->prefix . "formmaker WHERE id='" . $id . "'";
493
+ if (!$wpdb->query($sql_remov_form)) {
494
+ ?>
495
+ <div id="message" class="error"><p>Form Not Deleted</p></div>
496
+ <?php
497
+ return FALSE;
498
+ }
499
+ if ($wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker_views WHERE form_id='" . $id . "'")) {
500
+ $sql_remov_form = "DELETE FROM " . $wpdb->prefix . "formmaker_views WHERE form_id='" . $id . "'";
501
+ if (!$wpdb->query($sql_remov_form)) {
502
+ ?>
503
+ <div id="message" class="error"><p>Form views Not Deleted</p></div>
504
+ <?php
505
+ return FALSE;
506
+ }
507
+ }
508
+ if ($wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id='" . $id . "'")) {
509
+ $sql_remov_form = "DELETE FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id='" . $id . "'";
510
+ if (!$wpdb->query($sql_remov_form)) {
511
+ ?>
512
+ <div id="message" class="error"><p>Form submits Not Deleted</p></div>
513
+ <?php
514
+ return FALSE;
515
+ }
516
+ }
517
+ ?>
518
+ <div class="updated"><p><strong><?php _e('Item Deleted.'); ?></strong></p></div>
519
+ <?php
520
+ // Execute query
521
+ }
522
+
523
+ function forchrome($id) {
524
+ ?>
525
+ <script type="text/javascript">
526
+
527
+
528
+ window.onload = val;
529
+
530
+ function val() {
531
+ document.getElementById('adminForm').action = "admin.php?page=Form_maker&task=gotoedit&id=<?php echo $id;?>";
532
+ document.getElementById('adminForm').submit();
533
+ }
534
+
535
+ </script>
536
+ <form action="index.php" method="post" name="adminForm" id="adminForm">
537
+ </form>
538
+ <?php
539
+ }
540
+
541
+ function gotoedit() {
542
+ ?>
543
+ <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
544
+ <?php
545
+ }
546
+
547
+ // Form options.
548
+ function form_options($id) {
549
+ global $wpdb;
550
+ $row = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $id . "'");
551
+ $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_themes ORDER BY title";
552
+ $themes = $wpdb->get_results($query);
553
+ html_form_options($row, $themes);
554
+ }
555
+
556
+ // Apply form options.
557
+ function Apply_form_options($id) {
558
+ global $wpdb;
559
+ if ($_POST["submit_text_type"] == 5) {
560
+ $sub_te_type = $_POST["page_name"];
561
+ }
562
+ else {
563
+ $sub_te_type = $_POST["post_name"];
564
+ }
565
+ $savedd = $wpdb->update($wpdb->prefix . "formmaker", array(
566
+ 'mail' => $_POST["mail"],
567
+ 'theme' => $_POST["theme"],
568
+ 'javascript' => stripslashes($_POST["javascript"]),
569
+ 'submit_text' => $_POST["content"],
570
+ 'url' => $_POST["url"],
571
+ 'submit_text_type' => $_POST["submit_text_type"],
572
+ 'script_mail' => stripslashes($_POST["script_mail"]),
573
+ 'script_mail_user' => stripslashes($_POST["script_mail_user"]),
574
+ 'article_id' => $sub_te_type,
575
+ 'paypal_mode' => 0,
576
+ 'checkout_mode' => 'testmode',
577
+ 'paypal_email' => '',
578
+ 'payment_currency' => 'USD',
579
+ 'tax' => 0
580
+ ), array('id' => $id), array(
581
+ '%s',
582
+ '%d',
583
+ '%s',
584
+ '%s',
585
+ '%s',
586
+ '%d',
587
+ '%s',
588
+ '%s',
589
+ '%s',
590
+ '%d',
591
+ '%s',
592
+ '%s',
593
+ '%s',
594
+ '%d',
595
+ ), array('%d'));
596
+ ?>
597
+ <div class="updated"><p><strong><?php _e('Changes successfully saved'); ?></strong></p></div>
598
+ <?php
599
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
form_maker_widget.php CHANGED
@@ -1,65 +1,73 @@
1
- <?php
2
- global $form_maker_function__once;
3
- class form_maker_widget extends WP_Widget {
4
-
5
- // Constructor //
6
- function form_maker_widget() {
7
- $widget_ops = array(
8
- 'classname' => 'form_maker_widget',
9
- 'description' => 'Add Form Maker widget.'
10
- ); // Widget Settings
11
- $control_ops = array('id_base' => 'form_maker_widget'); // Widget Control Settings
12
- $this->WP_Widget('form_maker_widget', 'Form Maker', $widget_ops, $control_ops); // Create the widget
13
- }
14
-
15
- // Extract Args
16
- function widget($args, $instance) {
17
- extract($args);
18
- $title = apply_filters('widget_title', $instance['title']);
19
- // Before widget
20
- echo $before_widget;
21
- // Title of widget
22
- if ($title) {
23
- echo $before_title . $title . $after_title;
24
- }
25
- // echo $title;
26
- global $form_maker_function__once;
27
- if ($form_maker_function__once) {
28
- $form_maker_function__once = 0;
29
- }
30
- require_once("front_end_form_maker.php");
31
- echo form_maker_front_end($instance['form_id']);
32
- // After widget
33
- echo $after_widget;
34
- }
35
-
36
- // Update Settings //
37
- function update($new_instance, $old_instance) {
38
- $instance['title'] = $new_instance['title'];
39
- $instance['form_id'] = $new_instance['form_id'];
40
- return $instance;
41
- }
42
-
43
- // Widget Control Panel //
44
- function form($instance) {
45
- $defaults = array('title' => '', 'form_id' => 0);
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'); ?>"name="<?php echo $this->get_field_name('title'); ?>'" type="text" value="<?php echo $instance['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'); ?>" style="width:225px;text-align:center;">
53
- <option style="text-align:center" value="0">- Select a Form -</option>
54
- <?php
55
- $ids_Form_Maker = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."formmaker order by `id` DESC",0);
56
- foreach ($ids_Form_Maker as $arr_Form_Maker) {?>
57
- <option value="<?php echo $arr_Form_Maker->id; ?>" <?php if ($arr_Form_Maker->id == $instance['form_id']) {echo "SELECTED";} ?>><?php echo $arr_Form_Maker->title; ?></option>
58
- <?php }?>
59
- </select>
60
- <?php
61
- }
62
- }
63
-
64
- add_action('widgets_init', create_function('', 'return register_widget("form_maker_widget");'));
 
 
 
 
 
 
 
 
65
  ?>
1
+ <?php
2
+ global $form_maker_function__once;
3
+ class form_maker_widget extends WP_Widget {
4
+
5
+ // Constructor //
6
+ function form_maker_widget() {
7
+ $widget_ops = array(
8
+ 'classname' => 'form_maker_widget',
9
+ 'description' => 'Add Form Maker widget.'
10
+ ); // Widget Settings
11
+ $control_ops = array('id_base' => 'form_maker_widget'); // Widget Control Settings
12
+ $this->WP_Widget('form_maker_widget', 'Form Maker', $widget_ops, $control_ops); // Create the widget
13
+ }
14
+
15
+ // Extract Args
16
+ function widget($args, $instance) {
17
+ extract($args);
18
+ $title = apply_filters('widget_title', $instance['title']);
19
+ // Before widget
20
+ echo $before_widget;
21
+ // Title of widget
22
+ if ($title) {
23
+ echo $before_title . $title . $after_title;
24
+ }
25
+ // echo $title;
26
+ global $form_maker_function__once;
27
+ if ($form_maker_function__once) {
28
+ $form_maker_function__once = 0;
29
+ }
30
+ require_once("front_end_form_maker.php");
31
+ echo form_maker_front_end($instance['form_id']);
32
+ // After widget
33
+ echo $after_widget;
34
+ }
35
+
36
+ // Update Settings //
37
+ function update($new_instance, $old_instance) {
38
+ $instance['title'] = $new_instance['title'];
39
+ $instance['form_id'] = $new_instance['form_id'];
40
+ return $instance;
41
+ }
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
+ }
70
+ }
71
+
72
+ add_action('widgets_init', create_function('', 'return register_widget("form_maker_widget");'));
73
  ?>
front_end_form_maker.php CHANGED
@@ -1,2198 +1,2241 @@
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=$_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=$_POST["captcha_input"];
57
- }
58
- if(isset($_POST["recaptcha_response_field"])){
59
- $recaptcha_response_field=$_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=$_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($recaptcha_response_field))
91
- {
92
- $privatekey = $form->private_key;
93
-
94
- $resp = recaptcha_check_answer ($privatekey,$_SERVER["REMOTE_ADDR"],$_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
- if(isset($_SESSION['show_submit_text'.$id]))
944
- if($_SESSION['show_submit_text'.$id]==1)
945
- {
946
- $_SESSION['show_submit_text'.$id]=0;
947
- $form_maker_front_end.=$row->submit_text;
948
- return;
949
- }
950
- $vives_form=$wpdb->get_var($wpdb->prepare("SELECT views FROM ".$wpdb->prefix."formmaker_views WHERE form_id=%d",$id));
951
- $vives_form=$vives_form+1;
952
- $wpdb->update( $wpdb->prefix."formmaker_views",
953
- array(
954
- 'views' => $vives_form,
955
- ),
956
- array( 'form_id' => $id ),
957
- array(
958
- '%d',
959
- ),
960
- array( '%d' )
961
- );
962
-
963
- /* $cmpnt_js_path =plugins_url("js",__FILE__);
964
- $document->addScript($cmpnt_js_path.'/if_gmap.js');
965
- $document->addScript( JURI::root(true).'/components/com_formmaker/views/formmaker/tmpl/main.js');
966
- $document->addScript( JURI::root(true).'/includes/js/joomla.javascript.js');
967
- $document->addScript('http://maps.google.com/maps/api/js?sensor=false');*/
968
-
969
- $article=$row->article_id;
970
- if($row->form_front){
971
-
972
-
973
- /////////if form is new version
974
-
975
-
976
-
977
-
978
-
979
-
980
- $form_maker_front_end.='<div><script type="text/javascript">'.$row->javascript.'</script>';
981
- $new_form_theme=explode('{',$form_theme);
982
- $count_after_explod_theme=count($new_form_theme);
983
- for($i=0;$i<$count_after_explod_theme;$i++){
984
- $body_or_classes[$i]=explode('}',$new_form_theme[$i]);
985
- }
986
- for($i=0;$i<$count_after_explod_theme;$i++){
987
- if($i==0)
988
- $body_or_classes[$i][0]="#form".$id.' '.str_replace(',',", #form".$id,$body_or_classes[$i][0]);
989
- else
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
- //inch@ petq chi raplace minchev form@ tpi
1007
-
1008
- $captcha_url='components/com_formmaker/wd_captcha.php?digit=';
1009
- $captcha_rep_url='components/com_formmaker/wd_captcha.php?r2='.mt_rand(0,1000).'&digit=';
1010
-
1011
- $rep1=array(
1012
- "<!--repstart-->Title<!--repend-->",
1013
- "<!--repstart-->First<!--repend-->",
1014
- "<!--repstart-->Last<!--repend-->",
1015
- "<!--repstart-->Middle<!--repend-->",
1016
- "<!--repstart-->January<!--repend-->",
1017
- "<!--repstart-->February<!--repend-->",
1018
- "<!--repstart-->March<!--repend-->",
1019
- "<!--repstart-->April<!--repend-->",
1020
- "<!--repstart-->May<!--repend-->",
1021
- "<!--repstart-->June<!--repend-->",
1022
- "<!--repstart-->July<!--repend-->",
1023
- "<!--repstart-->August<!--repend-->",
1024
- "<!--repstart-->September<!--repend-->",
1025
- "<!--repstart-->October<!--repend-->",
1026
- "<!--repstart-->November<!--repend-->",
1027
- "<!--repstart-->December<!--repend-->",
1028
- "<!--repstart-->Street Address<!--repend-->",
1029
- "<!--repstart-->Street Address Line 2<!--repend-->",
1030
- "<!--repstart-->City<!--repend-->",
1031
- "<!--repstart-->State / Province / Region<!--repend-->",
1032
- "<!--repstart-->Postal / Zip Code<!--repend-->",
1033
- "<!--repstart-->Country<!--repend-->",
1034
- "<!--repstart-->Area Code<!--repend-->",
1035
- "<!--repstart-->Phone Number<!--repend-->",
1036
- $captcha_url,
1037
- 'class="captcha_img"',
1038
- plugins_url("images/refresh.png",__FILE__),
1039
- 'form_id_temp',
1040
- 'style="padding-right:170px"');
1041
-
1042
- $rep2=array(
1043
- addslashes(__("Title", 'form_maker')),
1044
- addslashes(__("First", 'form_maker')),
1045
- addslashes(__("Last", 'form_maker')),
1046
- addslashes(__("Middle", 'form_maker')),
1047
- addslashes(__("January", 'form_maker')),
1048
- addslashes(__("February", 'form_maker')),
1049
- addslashes(__("March", 'form_maker')),
1050
- addslashes(__("April", 'form_maker')),
1051
- addslashes(__("May", 'form_maker')),
1052
- addslashes(__("June", 'form_maker')),
1053
- addslashes(__("July", 'form_maker')),
1054
- addslashes(__("August", 'form_maker')),
1055
- addslashes(__("September", 'form_maker')),
1056
- addslashes(__("October", 'form_maker')),
1057
- addslashes(__("November", 'form_maker')),
1058
- addslashes(__("December", 'form_maker')),
1059
- addslashes(__("Street Address", 'form_maker')),
1060
- addslashes(__("Street Address Line 2", 'form_maker')),
1061
- addslashes(__("City", 'form_maker')),
1062
- addslashes(__("State / Province / Region", 'form_maker')),
1063
- addslashes(__("Postal / Zip Code", 'form_maker')),
1064
- addslashes(__("Country", 'form_maker')),
1065
- addslashes(__("Area Code", 'form_maker')),
1066
- addslashes(__("Phone Number", 'form_maker')),
1067
- $captcha_rep_url,
1068
- 'class="captcha_img" style="display:none"',
1069
- plugins_url("images/refresh.png",__FILE__),
1070
- $id,
1071
- '');
1072
-
1073
- $untilupload = str_replace($rep1,$rep2,$row->form_front);
1074
- while(strpos($untilupload, "***destinationskizb")>0)
1075
- {
1076
- $pos1 = strpos($untilupload, "***destinationskizb");
1077
- $pos2 = strpos($untilupload, "***destinationverj");
1078
- $untilupload=str_replace(substr($untilupload, $pos1, $pos2-$pos1+22), "", $untilupload);
1079
- }
1080
- $form_maker_front_end.=$untilupload;
1081
-
1082
- $is_recaptcha=false;
1083
-
1084
-
1085
- $form_maker_front_end.='<script type="text/javascript">';
1086
-
1087
- $form_maker_front_end.='WDF_FILE_TYPE_ERROR = \''.addslashes(__("Sorry, you are not allowed to upload this type of file.", 'form_maker')).'\';
1088
- ';
1089
- $form_maker_front_end.='WDF_INVALID_EMAIL = \''.addslashes(__("This is not a valid email address.", 'form_maker')).'\';
1090
- ';
1091
- $form_maker_front_end.='REQUEST_URI = "'.$_SERVER['REQUEST_URI'].'";
1092
- ';
1093
- $form_maker_front_end.='ReqFieldMsg =\'`FIELDNAME`'.addslashes(__('field is required.', 'form_maker')).'\';
1094
- ';
1095
- $form_maker_front_end.='function formOnload'.$id.'()
1096
- {
1097
- ';//enable maps and refresh captcha
1098
-
1099
-
1100
- foreach($label_type as $key => $type)
1101
- {
1102
- switch ($type)
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('.$label_id[$key].','.$id.');
1110
- for(q=0; q<20; q++)
1111
- if(document.getElementById('.$label_id[$key].'+"_element"+'.$id.').getAttribute("long"+q))
1112
- {
1113
-
1114
- w_long=parseFloat(document.getElementById('.$label_id[$key].'+"_element"+'.$id.').getAttribute("long"+q));
1115
- w_lat=parseFloat(document.getElementById('.$label_id[$key].'+"_element"+'.$id.').getAttribute("lat"+q));
1116
- w_info=parseFloat(document.getElementById('.$label_id[$key].'+"_element"+'.$id.').getAttribute("info"+q));
1117
- add_marker_on_map('.$label_id[$key].',q, w_long, w_lat, w_info,'.$id.',false);
1118
- }
1119
- }';
1120
- break;
1121
-
1122
- case 'type_mark_map':
1123
- $form_maker_front_end.='if(document.getElementById("'.$label_id[$key].'_element'.$id.'"))
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", \''.$label_id[$key].'_long'.$id.'\');
1130
- longit.setAttribute("name", \''.$label_id[$key].'_long'.$id.'\');
1131
-
1132
- var latit = document.createElement(\'input\');
1133
- latit.setAttribute("type", \'hidden\');
1134
- latit.setAttribute("id", \''.$label_id[$key].'_lat'.$id.'\');
1135
- latit.setAttribute("name", \''.$label_id[$key].'_lat'.$id.'\');
1136
-
1137
- document.getElementById("'.$label_id[$key].'_element_section'.$id.'").appendChild(longit);
1138
- document.getElementById("'.$label_id[$key].'_element_section'.$id.'").appendChild(latit);
1139
-
1140
- if_gmap_init('.$label_id[$key].', '.$id.');
1141
-
1142
- w_long=parseFloat(document.getElementById('.$label_id[$key].'+"_element"+'.$id.').getAttribute("long0"));
1143
- w_lat=parseFloat(document.getElementById('.$label_id[$key].'+"_element"+'.$id.').getAttribute("lat0"));
1144
- w_info=parseFloat(document.getElementById('.$label_id[$key].'+"_element"+'.$id.').getAttribute("info0"));
1145
-
1146
-
1147
- longit.value=w_long;
1148
- latit.value=w_lat;
1149
- add_marker_on_map('.$label_id[$key].',0, w_long, w_lat, w_info, '.$id.', true);
1150
- }';
1151
-
1152
- break;
1153
-
1154
- case 'type_captcha':
1155
- $form_maker_front_end.='if(document.getElementById(\'_wd_captcha'.$id.'\'))
1156
- captcha_refresh(\'_wd_captcha\', \''.$id.'\');';
1157
- break;
1158
-
1159
- case 'type_recaptcha':
1160
- $is_recaptcha=true;
1161
-
1162
- break;
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(\''.$label_id[$key].'\', \''.$id.'\');
1170
- }';
1171
- break;
1172
-
1173
- default:
1174
- break;
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'.$id.'){ formOldFunctionOnLoad'.$id.'(); }
1190
- formOnload'.$id.'();
1191
- }
1192
- function formLoadBody'.$id.'()
1193
- {
1194
- formOldFunctionOnLoad'.$id.' = window.onload;
1195
- window.onload = formAddToOnload'.$id.';
1196
- }
1197
- var formOldFunctionOnLoad'.$id.' = null;
1198
- formLoadBody'.$id.'();';
1199
-
1200
-
1201
- if(isset($_POST["captcha_input"])){
1202
- $captcha_input=$_POST["captcha_input"];
1203
- }
1204
- if(isset($_POST["recaptcha_response_field"])){
1205
- $recaptcha_response_field=$_POST["recaptcha_response_field"];
1206
- }
1207
- if(isset($_POST["counter".$id])){
1208
- $counter=$_POST["counter".$id];
1209
- }
1210
- $old_key=-1;
1211
- if(isset($counter))
1212
- {
1213
- foreach($label_type as $key => $type)
1214
- {
1215
- switch ($type)
1216
- {
1217
- case "type_text":
1218
- case "type_number":
1219
- case "type_submitter_mail":{
1220
- $form_maker_front_end.=
1221
- "if(document.getElementById('".$label_id[$key]."_element".$id."'))
1222
- if(document.getElementById('".$label_id[$key]."_element".$id."').title!='".addslashes($_POST[$label_id[$key]."_element".$id])."')
1223
- { document.getElementById('".$label_id[$key]."_element".$id."').value='".addslashes($_POST[$label_id[$key]."_element".$id])."';
1224
- document.getElementById('".$label_id[$key]."_element".$id."').className='input_active';
1225
- }
1226
- ";
1227
- break;
1228
- }
1229
-
1230
- case "type_textarea":{
1231
- $order = array("\r\n", "\n", "\r");
1232
- $form_maker_front_end.=
1233
- "if(document.getElementById('".$label_id[$key]."_element".$id."'))
1234
- if(document.getElementById('".$label_id[$key]."_element".$id."').title!='".str_replace($order,'\n',addslashes($_POST[$label_id[$key]."_element".$id]))."')
1235
- { document.getElementById('".$label_id[$key]."_element".$id."').innerHTML='".str_replace($order,'\n',addslashes($_POST[$label_id[$key]."_element".$id]))."';
1236
- document.getElementById('".$label_id[$key]."_element".$id."').className='input_active';
1237
- }
1238
- ";
1239
- break;
1240
- }
1241
- case "type_name":{
1242
- $element_title=$_POST[$label_id[$key]."_element_title".$id];
1243
- if(isset($_POST[$label_id[$key]."_element_title".$id]))
1244
- {
1245
- $form_maker_front_end.=
1246
- "if(document.getElementById('".$label_id[$key]."_element_first".$id."'))
1247
- {
1248
- if(document.getElementById('".$label_id[$key]."_element_title".$id."').title!='".addslashes($_POST[$label_id[$key]."_element_title".$id])."')
1249
- { document.getElementById('".$label_id[$key]."_element_title".$id."').value='".addslashes($_POST[$label_id[$key]."_element_title".$id])."';
1250
- document.getElementById('".$label_id[$key]."_element_title".$id."').className='input_active';
1251
- }
1252
-
1253
- if(document.getElementById('".$label_id[$key]."_element_first".$id."').title!='".addslashes($_POST[$label_id[$key]."_element_first".$id])."')
1254
- { document.getElementById('".$label_id[$key]."_element_first".$id."').value='".addslashes($_POST[$label_id[$key]."_element_first".$id])."';
1255
- document.getElementById('".$label_id[$key]."_element_first".$id."').className='input_active';
1256
- }
1257
-
1258
- if(document.getElementById('".$label_id[$key]."_element_last".$id."').title!='".addslashes($_POST[$label_id[$key]."_element_last".$id])."')
1259
- { document.getElementById('".$label_id[$key]."_element_last".$id."').value='".addslashes($_POST[$label_id[$key]."_element_last".$id])."';
1260
- document.getElementById('".$label_id[$key]."_element_last".$id."').className='input_active';
1261
- }
1262
-
1263
- if(document.getElementById('".$label_id[$key]."_element_middle".$id."').title!='".addslashes($_POST[$label_id[$key]."_element_middle".$id])."')
1264
- { document.getElementById('".$label_id[$key]."_element_middle".$id."').value='".addslashes($_POST[$label_id[$key]."_element_middle".$id])."';
1265
- document.getElementById('".$label_id[$key]."_element_middle".$id."').className='input_active';
1266
- }
1267
-
1268
- }";
1269
- }
1270
- else
1271
- {
1272
- $form_maker_front_end.=
1273
- "if(document.getElementById('".$label_id[$key]."_element_first".$id."'))
1274
- {
1275
-
1276
- if(document.getElementById('".$label_id[$key]."_element_first".$id."').title!='".addslashes($_POST[$label_id[$key]."_element_first".$id])."')
1277
- { document.getElementById('".$label_id[$key]."_element_first".$id."').value='".addslashes($_POST[$label_id[$key]."_element_first".$id])."';
1278
- document.getElementById('".$label_id[$key]."_element_first".$id."').className='input_active';
1279
- }
1280
-
1281
- if(document.getElementById('".$label_id[$key]."_element_last".$id."').title!='".addslashes($_POST[$label_id[$key]."_element_last".$id])."')
1282
- { document.getElementById('".$label_id[$key]."_element_last".$id."').value='".addslashes($_POST[$label_id[$key]."_element_last".$id])."';
1283
- document.getElementById('".$label_id[$key]."_element_last".$id."').className='input_active';
1284
- }
1285
-
1286
- }";
1287
- }
1288
- break;
1289
- }
1290
-
1291
- case "type_phone":{
1292
-
1293
- $form_maker_front_end.=
1294
- "if(document.getElementById('".$label_id[$key]."_element_first".$id."'))
1295
- {
1296
- if(document.getElementById('".$label_id[$key]."_element_first".$id."').title!='".addslashes($_POST[$label_id[$key]."_element_first".$id])."')
1297
- { document.getElementById('".$label_id[$key]."_element_first".$id."').value='".addslashes($_POST[$label_id[$key]."_element_first".$id])."';
1298
- document.getElementById('".$label_id[$key]."_element_first".$id."').className='input_active';
1299
- }
1300
-
1301
- if(document.getElementById('".$label_id[$key]."_element_last".$id."').title!='".addslashes($_POST[$label_id[$key]."_element_last".$id])."')
1302
- { document.getElementById('".$label_id[$key]."_element_last".$id."').value='".addslashes($_POST[$label_id[$key]."_element_last".$id])."';
1303
- document.getElementById('".$label_id[$key]."_element_last".$id."').className='input_active';
1304
- }
1305
- }";
1306
-
1307
- break;
1308
- }
1309
-
1310
- case "type_address":
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('".$label_id[$key]."_street1".$id."').value='".addslashes($_POST[$label_id[$key]."_street1".$id])."';
1318
- document.getElementById('".$label_id[$key]."_street2".$id."').value='".addslashes($_POST[$label_id[$key+1]."_street2".$id])."';
1319
- document.getElementById('".$label_id[$key]."_city".$id."').value='".addslashes($_POST[$label_id[$key+2]."_city".$id])."';
1320
- document.getElementById('".$label_id[$key]."_state".$id."').value='".addslashes($_POST[$label_id[$key+3]."_state".$id])."';
1321
- document.getElementById('".$label_id[$key]."_postal".$id."').value='".addslashes($_POST[$label_id[$key+4]."_postal".$id])."';
1322
- document.getElementById('".$label_id[$key]."_country".$id."').value='".addslashes($_POST[$label_id[$key+5]."_country".$id])."';
1323
-
1324
- }";
1325
- $old_key=$key+5;
1326
- }
1327
- break;
1328
-
1329
- }
1330
-
1331
-
1332
-
1333
-
1334
- case "type_checkbox":{
1335
-
1336
-
1337
- $is_other=false;
1338
-
1339
- if( $_POST[$label_id[$key]."_allow_other".$id]=="yes")
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('".$label_id[$key]."_other_input".$id."').parentNode.removeChild(document.getElementById('".$label_id[$key]."_other_br".$id."'));
1352
- document.getElementById('".$label_id[$key]."_other_input".$id."').parentNode.removeChild(document.getElementById('".$label_id[$key]."_other_input".$id."'));
1353
- }
1354
- for(k=0; k<30; k++)
1355
- if(document.getElementById('".$label_id[$key]."_element".$id."'+k))
1356
- document.getElementById('".$label_id[$key]."_element".$id."'+k).removeAttribute('checked');
1357
- else break;
1358
- ";
1359
- for($j=0; $j<100; $j++)
1360
- {
1361
- $element=$_POST[$label_id[$key]."_element".$id.$j];
1362
- if(isset($_POST[$label_id[$key]."_element".$id.$j]))
1363
- {
1364
- $form_maker_front_end.=
1365
- "document.getElementById('".$label_id[$key]."_element".$id.$j."').setAttribute('checked', 'checked');
1366
- ";
1367
- }
1368
- }
1369
-
1370
- if($is_other)
1371
- $form_maker_front_end.=
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
- break;
1380
- }
1381
- case "type_radio":{
1382
-
1383
- $is_other=false;
1384
-
1385
- if( $_POST[$label_id[$key]."_allow_other".$id]=="yes")
1386
- {
1387
- $other_element=$_POST[$label_id[$key]."_other_input".$id];
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('".$label_id[$key]."_other_input".$id."').parentNode.removeChild(document.getElementById('".$label_id[$key]."_other_br".$id."'));
1398
- document.getElementById('".$label_id[$key]."_other_input".$id."').parentNode.removeChild(document.getElementById('".$label_id[$key]."_other_input".$id."'));
1399
- }
1400
-
1401
- for(k=0; k<50; k++)
1402
- if(document.getElementById('".$label_id[$key]."_element".$id."'+k))
1403
- {
1404
- document.getElementById('".$label_id[$key]."_element".$id."'+k).removeAttribute('checked');
1405
- if(document.getElementById('".$label_id[$key]."_element".$id."'+k).value=='".addslashes($_POST[$label_id[$key]."_element".$id])."')
1406
- {
1407
- document.getElementById('".$label_id[$key]."_element".$id."'+k).setAttribute('checked', 'checked');
1408
-
1409
- }
1410
- }
1411
- else break;
1412
- ";
1413
- if($is_other)
1414
- $form_maker_front_end.=
1415
- "
1416
- show_other_input('".$label_id[$key]."','".$id."');
1417
- document.getElementById('".$label_id[$key]."_other_input".$id."').value='".$_POST[$label_id[$key]."_other_input".$id]."';
1418
- ";
1419
-
1420
- break;
1421
- }
1422
-
1423
- case "type_time":{
1424
- $ss=$_POST[$label_id[$key]."_ss".$id];
1425
- if(isset($_POST[$label_id[$key]."_ss".$id]))
1426
- {
1427
- $form_maker_front_end.=
1428
- "if(document.getElementById('".$label_id[$key]."_hh".$id."'))
1429
- {
1430
- document.getElementById('".$label_id[$key]."_hh".$id."').value='".$_POST[$label_id[$key]."_hh".$id]."';
1431
- document.getElementById('".$label_id[$key]."_mm".$id."').value='".$_POST[$label_id[$key]."_mm".$id]."';
1432
- document.getElementById('".$label_id[$key]."_ss".$id."').value='".$_POST[$label_id[$key]."_ss".$id]."';
1433
- }";
1434
- }
1435
- else
1436
- {
1437
- $form_maker_front_end.=
1438
- "if(document.getElementById('".$label_id[$key]."_hh".$id."'))
1439
- {
1440
- document.getElementById('".$label_id[$key]."_hh".$id."').value='".$_POST[$label_id[$key]."_hh".$id]."';
1441
- document.getElementById('".$label_id[$key]."_mm".$id."').value='".$_POST[$label_id[$key]."_mm".$id]."';
1442
- }";
1443
- }
1444
- $am_pm=$_POST[$label_id[$key]."_am_pm".$id];
1445
- if(isset($am_pm))
1446
- $form_maker_front_end.=
1447
- "if(document.getElementById('".$label_id[$key]."_am_pm".$id."'))
1448
- document.getElementById('".$label_id[$key]."_am_pm".$id."').value='".$_POST[$label_id[$key]."_am_pm".$id]."';
1449
- ";
1450
- break;
1451
- }
1452
-
1453
-
1454
- case "type_date_fields":{
1455
- $date_fields=explode('-',$_POST[$label_id[$key]."_element".$id]);
1456
- $form_maker_front_end.=
1457
- "if(document.getElementById('".$label_id[$key]."_day".$id."'))
1458
- {
1459
- document.getElementById('".$label_id[$key]."_day".$id."').value='".$date_fields[0]."';
1460
- document.getElementById('".$label_id[$key]."_month".$id."').value='".$date_fields[1]."';
1461
- document.getElementById('".$label_id[$key]."_year".$id."').value='".$date_fields[2]."';
1462
- }";
1463
- break;
1464
- }
1465
-
1466
- case "type_date":
1467
- case "type_own_select":
1468
- case "type_country":{
1469
- $form_maker_front_end.=
1470
- "if(document.getElementById('".$label_id[$key]."_element".$id."'))
1471
- document.getElementById('".$label_id[$key]."_element".$id."').value='".addslashes($_POST[$label_id[$key]."_element".$id])."';
1472
- ";
1473
- break;
1474
- }
1475
-
1476
- default:{
1477
- break;
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(\''.$id.'form_view\'+i))
1493
- {
1494
- form_view_count'.$id.'++;
1495
- form_view_max'.$id.'=i;
1496
- document.getElementById(\''.$id.'form_view\'+i).parentNode.removeAttribute(\'style\');
1497
- }
1498
- }
1499
- if(form_view_count'.$id.'>1)
1500
- {
1501
- for(i=1; i<=form_view_max'.$id.'; i++)
1502
- {
1503
- if(document.getElementById(\''.$id.'form_view\'+i))
1504
- {
1505
- first_form_view'.$id.'=i;
1506
- break;
1507
- }
1508
- }
1509
- generate_page_nav(first_form_view'.$id.', \''.$id.'\', form_view_count'.$id.', form_view_max'.$id.');
1510
- }
1511
- var RecaptchaOptions = {
1512
- theme: "'.$row->recaptcha_theme.'"
1513
- };
1514
- </script>
1515
- </form></div>';
1516
- if($is_recaptcha) {
1517
- /* $document->addScriptDeclaration('var RecaptchaOptions = {
1518
- theme: "'.$row->recaptcha_theme.'"
1519
- };
1520
- ');*/
1521
-
1522
-
1523
- $form_maker_front_end.='<div id="main_recaptcha" style="display:none;">';
1524
-
1525
- // Get a key from https://www.google.com/recaptcha/admin/create
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'.$id.'\'))
1539
- document.getElementById(\'wd_recaptcha'.$id.'\').innerHTML=recaptcha_html;
1540
- </script>';
1541
-
1542
-
1543
-
1544
-
1545
- }
1546
- }
1547
- else
1548
- {
1549
-
1550
-
1551
- $form_maker_front_end.='<script type="text/javascript">'.str_replace ("
1552
- "," ",$row->javascript).'</script>';
1553
- $form_maker_front_end.='<style>'.str_replace('[SITE_ROOT]', plugins_url("",__FILE__),str_replace('.wdform_table1','.form_view',str_replace ("
1554
- "," ",$form_theme ))).'</style>';
1555
-
1556
-
1557
- $form_maker_front_end.="<form name=\"form\" action=\"".$_SERVER['REQUEST_URI']."\" method=\"post\" id=\"form\" enctype=\"multipart/form-data\">
1558
- <input type=\"hidden\" id=\"counter\" value=\"".$row->counter."\" name=\"counter\" />
1559
- <input type=\"hidden\" id=\"Itemid\" value=\"".$Itemid."\" name=\"Itemid\" />";
1560
- $captcha_url=plugins_url("wd_captcha.php",__FILE__).'?digit=';
1561
- $captcha_rep_url=plugins_url("wd_captcha.php",__FILE__).'?r2='.mt_rand(0,1000).'&digit=';
1562
- $rep1=array(
1563
- "<!--repstart-->Title<!--repend-->",
1564
- "<!--repstart-->First<!--repend-->",
1565
- "<!--repstart-->Last<!--repend-->",
1566
- "<!--repstart-->Middle<!--repend-->",
1567
- "<!--repstart-->January<!--repend-->",
1568
- "<!--repstart-->February<!--repend-->",
1569
- "<!--repstart-->March<!--repend-->",
1570
- "<!--repstart-->April<!--repend-->",
1571
- "<!--repstart-->May<!--repend-->",
1572
- "<!--repstart-->June<!--repend-->",
1573
- "<!--repstart-->July<!--repend-->",
1574
- "<!--repstart-->August<!--repend-->",
1575
- "<!--repstart-->September<!--repend-->",
1576
- "<!--repstart-->October<!--repend-->",
1577
- "<!--repstart-->November<!--repend-->",
1578
- "<!--repstart-->December<!--repend-->",
1579
- $captcha_url,
1580
- 'class="captcha_img"',
1581
- plugins_url('images/refresh.png',__FILE__),
1582
- plugins_url('images/delete_el.png',__FILE__),
1583
- plugins_url('images/up.png',__FILE__),
1584
- plugins_url('images/down.png',__FILE__),
1585
- plugins_url('images/left.png',__FILE__),
1586
- plugins_url('images/right.png',__FILE__),
1587
- plugins_url('images/edit.png',__FILE__));
1588
- $rep2=array(
1589
- addslashes(__("Title","form_maker")),
1590
- addslashes(__("First","form_maker")),
1591
- addslashes(__("Last","form_maker")),
1592
- addslashes(__("Middle","form_maker")),
1593
- addslashes(__("January","form_maker")),
1594
- addslashes(__("February","form_maker")),
1595
- addslashes(__("March","form_maker")),
1596
- addslashes(__("April","form_maker")),
1597
- addslashes(__("May","form_maker")),
1598
- addslashes(__("June","form_maker")),
1599
- addslashes(__("July","form_maker")),
1600
- addslashes(__("August","form_maker")),
1601
- addslashes(__("September","form_maker")),
1602
- addslashes(__("October","form_maker")),
1603
- addslashes(__("November","form_maker")),
1604
- addslashes(__("December","form_maker")),
1605
- $captcha_rep_url,
1606
- 'class="captcha_img" style="display:none"',
1607
- plugins_url('images/refresh.png',__FILE__),
1608
- '','','','','','');
1609
- $untilupload = str_replace($rep1,$rep2,$row->form);
1610
- while(strpos($untilupload, "***destinationskizb")>0)
1611
- {
1612
- $pos1 = strpos($untilupload, "***destinationskizb");
1613
- $pos2 = strpos($untilupload, "***destinationverj");
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);
1626
- }
1627
- function formAddToOnload()
1628
- {
1629
- if(formOldFunctionOnLoad){ formOldFunctionOnLoad(); }
1630
- formOnload();
1631
- }
1632
- function formLoadBody()
1633
- {
1634
- formOldFunctionOnLoad = window.onload;
1635
- window.onload = formAddToOnload;
1636
- }
1637
- var formOldFunctionOnLoad = null;
1638
- formLoadBody();
1639
- ";
1640
- if(isset($_POST["captcha_input"]))
1641
- {
1642
- $captcha_input=$_POST["captcha_input"];
1643
- }
1644
- if(isset($_POST["counter"]))
1645
- {
1646
- $counter=$_POST["counter"];
1647
- }
1648
- if(isset($counter))
1649
- if (isset($captcha_input) or is_numeric($ok))
1650
- {
1651
- $session_wd_captcha_code=isset($_SESSION['wd_captcha_code'])?$_SESSION['wd_captcha_code']:'-';
1652
- if($captcha_input!=$session_wd_captcha_code or is_numeric($ok))
1653
- {
1654
- for($i=0; $i<$counter; $i++)
1655
- {
1656
- if(isset($_POST[$i."_type"]))
1657
- {
1658
- $type=$_POST[$i."_type"];
1659
- }
1660
- if(isset($_POST[$i."_type"]))
1661
- {
1662
- switch ($type)
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
- break;
1675
- }
1676
-
1677
- case "type_textarea":{
1678
- $form_maker_front_end.=
1679
- "if(document.getElementById('".$i."_element"."').title!='".addslashes($_POST[$i."_element"])."')
1680
- { document.getElementById('".$i."_element"."').innerHTML='".addslashes($_POST[$i."_element"])."';
1681
- document.getElementById('".$i."_element"."').style.color='#000000';
1682
- document.getElementById('".$i."_element"."').style.fontStyle='normal';
1683
- }
1684
- ";
1685
- break;
1686
- }
1687
- case "type_password":{
1688
- $form_maker_front_end.=
1689
- "document.getElementById('".$i."_element"."').value='';
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
- else
1703
- {
1704
- $form_maker_front_end.=
1705
- "document.getElementById('".$i."_element_first"."').value='".addslashes($_POST[$i."_element_first"])."';
1706
- document.getElementById('".$i."_element_last"."').value='".addslashes($_POST[$i."_element_last"])."';
1707
- "; }
1708
- break;
1709
- }
1710
- case "type_checkbox":{
1711
- $form_maker_front_end.=
1712
- "for(k=0; k<20; k++)
1713
- if(document.getElementById('".$i."_element'+k))
1714
- document.getElementById('".$i."_element'+k).removeAttribute('checked');
1715
- else break; "; for($j=0; $j<100; $j++)
1716
- {
1717
- if(isset($_POST[$i."_element".$j]))
1718
- {
1719
- $form_maker_front_end.=
1720
- "document.getElementById('".$i."_element".$j."').setAttribute('checked', 'checked');
1721
- "; }
1722
- }
1723
- break;
1724
- }
1725
- case "type_radio":{
1726
- $form_maker_front_end.=
1727
- "for(k=0; k<100; k++)
1728
- if(document.getElementById('".$i."_element'+k))
1729
- {
1730
- document.getElementById('".$i."_element'+k).removeAttribute('checked');
1731
- if(document.getElementById('".$i."_element'+k).value=='".addslashes($_POST[$i."_element"])."')
1732
- document.getElementById('".$i."_element'+k).setAttribute('checked', 'checked');
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
- if(isset($_POST[$i."_am_pm"]))
1753
- $form_maker_front_end.=
1754
- "document.getElementById('".$i."_am_pm').value='".$_POST[$i."_am_pm"]."';
1755
- "; break;
1756
- }
1757
- case "type_date":{ $form_maker_front_end.="document.getElementById('".$i."_element"."').value='".$_POST[$i."_element"]."';
1758
- "; break;
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
- break;
1777
- }
1778
- case "type_file":{
1779
- break;
1780
- }
1781
- }
1782
- }
1783
- }
1784
- }
1785
- }
1786
-
1787
- $form_maker_front_end.="n=".$row->counter.";
1788
- for(i=0; i<n; i++)
1789
- {
1790
- if(document.getElementById(i))
1791
- {
1792
- for(z=0; z<document.getElementById(i).childNodes.length; z++)
1793
- if(document.getElementById(i).childNodes[z].nodeType==3)
1794
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
1795
- if(document.getElementById(i).childNodes[7])
1796
- {
1797
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1798
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1799
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1800
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1801
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1802
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1803
- }
1804
- else
1805
- {
1806
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1807
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1808
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1809
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1810
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1811
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1812
- }
1813
- }
1814
- }
1815
- for(i=0; i<=n; i++)
1816
- {
1817
- if(document.getElementById(i))
1818
- {
1819
- type=document.getElementById(i).getAttribute(\"type\");
1820
- switch(type)
1821
- { case \"type_text\":
1822
- case \"type_password\":
1823
- case \"type_submitter_mail\":
1824
- case \"type_own_select\":
1825
- case \"type_country\":
1826
- case \"type_hidden\":
1827
- case \"type_map\":
1828
- {
1829
- remove_add_(i+\"_element\");
1830
- break;
1831
- }
1832
- case \"type_submit_reset\":
1833
- {
1834
- remove_add_(i+\"_element_submit\");
1835
- if(document.getElementById(i+\"_element_reset\"))
1836
- remove_add_(i+\"_element_reset\");
1837
- break;
1838
- }
1839
- case \"type_captcha\":
1840
- { remove_add_(\"wd_captcha\");
1841
- remove_add_(\"element_refresh\");
1842
- remove_add_(\"wd_captcha_input\");
1843
- break;
1844
- }
1845
- case \"type_file_upload\":
1846
- { remove_add_(i+\"_element\");
1847
- if(document.getElementById(i+\"_element\").value==\"\")
1848
- {
1849
- seted=false;
1850
- break;
1851
- }
1852
- ext_available=getfileextension(i);
1853
- if(!ext_available)
1854
- seted=false;
1855
- break;
1856
- }
1857
- case \"type_textarea\":
1858
- {
1859
- remove_add_(i+\"_element\"); if(document.getElementById(i+\"_element\").innerHTML==document.getElementById(i+\"_element\").title || document.getElementById(i+\"_element\").innerHTML==\"\")
1860
- seted=false;
1861
- break;
1862
- }
1863
- case \"type_name\":
1864
- {
1865
- if(document.getElementById(i+\"_element_title\"))
1866
- {
1867
- remove_add_(i+\"_element_title\");
1868
- remove_add_(i+\"_element_first\");
1869
- remove_add_(i+\"_element_last\");
1870
- remove_add_(i+\"_element_middle\");
1871
- if(document.getElementById(i+\"_element_title\").value==\"\" || document.getElementById(i+\"_element_first\").value==\"\" || document.getElementById(i+\"_element_last\").value==\"\" || document.getElementById(i+\"_element_middle\").value==\"\")
1872
- seted=false;
1873
- }
1874
- else
1875
- {
1876
- remove_add_(i+\"_element_first\");
1877
- remove_add_(i+\"_element_last\");
1878
- if(document.getElementById(i+\"_element_first\").value==\"\" || document.getElementById(i+\"_element_last\").value==\"\")
1879
- seted=false;
1880
- }
1881
- break;
1882
- }
1883
- case \"type_checkbox\":
1884
- case \"type_radio\":
1885
- { is=true;
1886
- for(j=0; j<100; j++)
1887
- if(document.getElementById(i+\"_element\"+j))
1888
- {
1889
- remove_add_(i+\"_element\"+j);
1890
- if(document.getElementById(i+\"_element\"+j).checked)
1891
- {
1892
- is=false;
1893
- break;
1894
- }
1895
- }
1896
- if(is)
1897
- seted=false;
1898
- break;
1899
- }
1900
- case \"type_button\":
1901
- {
1902
- for(j=0; j<100; j++)
1903
- if(document.getElementById(i+\"_element\"+j))
1904
- {
1905
- remove_add_(i+\"_element\"+j);
1906
- }
1907
- break;
1908
- }
1909
- case \"type_time\":
1910
- {
1911
- if(document.getElementById(i+\"_ss\"))
1912
- {
1913
- remove_add_(i+\"_ss\");
1914
- remove_add_(i+\"_mm\");
1915
- remove_add_(i+\"_hh\");
1916
- if(document.getElementById(i+\"_ss\").value==\"\" || document.getElementById(i+\"_mm\").value==\"\" || document.getElementById(i+\"_hh\").value==\"\")
1917
- seted=false;
1918
- }
1919
- else
1920
- {
1921
- remove_add_(i+\"_mm\");
1922
- remove_add_(i+\"_hh\");
1923
- if(document.getElementById(i+\"_mm\").value==\"\" || document.getElementById(i+\"_hh\").value==\"\")
1924
- seted=false;
1925
- }
1926
- break;
1927
- }
1928
- case \"type_date\":
1929
- {
1930
- remove_add_(i+\"_element\");
1931
- remove_add_(i+\"_button\");
1932
- if(document.getElementById(i+\"_element\").value==\"\")
1933
- seted=false;
1934
- break;
1935
- }
1936
- case \"type_date_fields\":
1937
- {
1938
- remove_add_(i+\"_day\");
1939
- remove_add_(i+\"_month\");
1940
- remove_add_(i+\"_year\");
1941
- if(document.getElementById(i+\"_day\").value==\"\" || document.getElementById(i+\"_month\").value==\"\" || document.getElementById(i+\"_year\").value==\"\")
1942
- seted=false;
1943
- break;
1944
- }
1945
- }
1946
- }
1947
- }
1948
- function check_year2(id)
1949
- {
1950
- year=document.getElementById(id).value;
1951
- from=parseFloat(document.getElementById(id).getAttribute('from'));
1952
- year=parseFloat(year);
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)
1960
- {
1961
- attr_name= new Array();
1962
- attr_value= new Array();
1963
- var input = document.getElementById(id);
1964
- atr=input.attributes;
1965
- for(v=0;v<30;v++)
1966
- if(atr[v] )
1967
- {
1968
- if(atr[v].name.indexOf(\"add_\")==0)
1969
- {
1970
- attr_name.push(atr[v].name.replace('add_',''));
1971
- attr_value.push(atr[v].value);
1972
- input.removeAttribute(atr[v].name);
1973
- v--;
1974
- }
1975
- }
1976
- for(v=0;v<attr_name.length; v++)
1977
- {
1978
- input.setAttribute(attr_name[v],attr_value[v])
1979
- }
1980
- }
1981
- function getfileextension(id)
1982
- {
1983
- var fileinput = document.getElementById(id+\"_element\");
1984
- var filename = fileinput.value;
1985
- if( filename.length == 0 )
1986
- return true;
1987
- var dot = filename.lastIndexOf(\".\");
1988
- var extension = filename.substr(dot+1,filename.length);
1989
- var exten = document.getElementById(id+\"_extension\").value.replace(\"***extensionverj\"+id+\"***\", \"\").replace(\"***extensionskizb\"+id+\"***\", \"\");
1990
- exten=exten.split(',');
1991
- for(x=0 ; x<exten.length; x++)
1992
- {
1993
- exten[x]=exten[x].replace(/\./g,'');
1994
- exten[x]=exten[x].replace(/ /g,'');
1995
- if(extension.toLowerCase()==exten[x].toLowerCase())
1996
- return true;
1997
- }
1998
- return false;
1999
- }
2000
- function check_required(but_type)
2001
- {
2002
- if(but_type=='reset')
2003
- {
2004
- window.location.reload( true );
2005
- return;
2006
- }
2007
- n=".$row->counter.";
2008
- ext_available=true;
2009
- seted=true;
2010
- for(i=0; i<=n; i++)
2011
- {
2012
- if(seted)
2013
- {
2014
- if(document.getElementById(i))
2015
- if(document.getElementById(i+\"_required\"))
2016
- if(document.getElementById(i+\"_required\").value==\"yes\")
2017
- {
2018
- type=document.getElementById(i).getAttribute(\"type\");
2019
- switch(type)
2020
- {
2021
- case \"type_text\":
2022
- case \"type_password\":
2023
- case \"type_submitter_mail\":
2024
- case \"type_own_select\":
2025
- case \"type_country\":
2026
- {
2027
- if(document.getElementById(i+\"_element\").value==document.getElementById(i+\"_element\").title || document.getElementById(i+\"_element\").value==\"\")
2028
- seted=false;
2029
- break;
2030
- }
2031
- case \"type_file_upload\":
2032
- {
2033
- if(document.getElementById(i+\"_element\").value==\"\")
2034
- {
2035
- seted=false;
2036
- break;
2037
- }
2038
- ext_available=getfileextension(i);
2039
- if(!ext_available)
2040
- seted=false;
2041
- break;
2042
- }
2043
- case \"type_textarea\":
2044
- {
2045
- if(document.getElementById(i+\"_element\").innerHTML==document.getElementById(i+\"_element\").title || document.getElementById(i+\"_element\").innerHTML==\"\")
2046
- seted=false;
2047
- break;
2048
- }
2049
- case \"type_name\":
2050
- {
2051
- if(document.getElementById(i+\"_element_title\"))
2052
- {
2053
- if(document.getElementById(i+\"_element_title\").value==\"\" || document.getElementById(i+\"_element_first\").value==\"\" || document.getElementById(i+\"_element_last\").value==\"\" || document.getElementById(i+\"_element_middle\").value==\"\")
2054
- seted=false;
2055
- }
2056
- else
2057
- {
2058
- if(document.getElementById(i+\"_element_first\").value==\"\" || document.getElementById(i+\"_element_last\").value==\"\")
2059
- seted=false;
2060
- }
2061
- break;
2062
- }
2063
- case \"type_checkbox\":
2064
- case \"type_radio\":
2065
- {
2066
- is=true;
2067
- for(j=0; j<100; j++)
2068
- if(document.getElementById(i+\"_element\"+j))
2069
- if(document.getElementById(i+\"_element\"+j).checked)
2070
- {
2071
- is=false;
2072
- break;
2073
- }
2074
- if(is)
2075
- seted=false;
2076
- break;
2077
- }
2078
- case \"type_time\":
2079
- {
2080
- if(document.getElementById(i+\"_ss\"))
2081
- {
2082
- if(document.getElementById(i+\"_ss\").value==\"\" || document.getElementById(i+\"_mm\").value==\"\" || document.getElementById(i+\"_hh\").value==\"\")
2083
- seted=false;
2084
- }
2085
- else
2086
- {
2087
- if(document.getElementById(i+\"_mm\").value==\"\" || document.getElementById(i+\"_hh\").value==\"\")
2088
- seted=false;
2089
- }
2090
- break;
2091
- }
2092
- case \"type_date\":
2093
- {
2094
- if(document.getElementById(i+\"_element\").value==\"\")
2095
- seted=false;
2096
- break;
2097
- }
2098
- case \"type_date_fields\":
2099
- {
2100
- if(document.getElementById(i+\"_day\").value==\"\" || document.getElementById(i+\"_month\").value==\"\" || document.getElementById(i+\"_year\").value==\"\")
2101
- seted=false;
2102
- break;
2103
- }
2104
- }
2105
- }
2106
- else
2107
- {
2108
- type=document.getElementById(i).getAttribute(\"type\");
2109
- if(type==\"type_file_upload\")
2110
- ext_available=getfileextension(i);
2111
- if(!ext_available)
2112
- seted=false;
2113
- }
2114
- }
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
- }
2129
- if(seted)
2130
- for(i=0; i<=n; i++)
2131
- {
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
- }
2139
- if(seted)
2140
- create_headers();
2141
- }
2142
- function create_headers()
2143
- { form_=document.getElementById('form');
2144
- n=".$row->counter.";
2145
- for(i=0; i<n; i++)
2146
- { if(document.getElementById(i))
2147
- {if(document.getElementById(i).getAttribute(\"type\")!=\"type_map\")
2148
- if(document.getElementById(i).getAttribute(\"type\")!=\"type_captcha\")
2149
- if(document.getElementById(i).getAttribute(\"type\")!=\"type_submit_reset\")
2150
- if(document.getElementById(i).getAttribute(\"type\")!=\"type_button\")
2151
- if(document.getElementById(i+'_element_label'))
2152
- { var input = document.createElement('input');
2153
- input.setAttribute(\"type\", 'hidden');
2154
- input.setAttribute(\"name\", i+'_element_label');
2155
- input.value=i;
2156
- form_.appendChild(input);
2157
- if(document.getElementById(i).getAttribute(\"type\")==\"type_date_fields\")
2158
- { var input = document.createElement('input');
2159
- input.setAttribute(\"type\", 'hidden');
2160
- input.setAttribute(\"name\", i+'_element'); input.value=document.getElementById(i+'_day').value+'-'+document.getElementById(i+'_month').value+'-'+document.getElementById(i+'_year').value;
2161
- form_.appendChild(input);
2162
- }
2163
- }
2164
- }
2165
- }
2166
- 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);
1699
+ }
1700
+ function formAddToOnload()
1701
+ {
1702
+ if(formOldFunctionOnLoad){ formOldFunctionOnLoad(); }
1703
+ formOnload();
1704
+ }
1705
+ function formLoadBody()
1706
+ {
1707
+ formOldFunctionOnLoad = window.onload;
1708
+ window.onload = formAddToOnload;
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))
1858
+ {
1859
+ for(z=0; z<document.getElementById(i).childNodes.length; z++)
1860
+ if(document.getElementById(i).childNodes[z].nodeType==3)
1861
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
1862
+ if(document.getElementById(i).childNodes[7])
1863
+ {
1864
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1865
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1866
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1867
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1868
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1869
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1870
+ }
1871
+ else
1872
+ {
1873
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1874
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1875
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1876
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1877
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1878
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1879
+ }
1880
+ }
1881
+ }
1882
+ for(i=0; i<=n; i++)
1883
+ {
1884
+ if(document.getElementById(i))
1885
+ {
1886
+ type=document.getElementById(i).getAttribute(\"type\");
1887
+ switch(type)
1888
+ { case \"type_text\":
1889
+ case \"type_password\":
1890
+ case \"type_submitter_mail\":
1891
+ case \"type_own_select\":
1892
+ case \"type_country\":
1893
+ case \"type_hidden\":
1894
+ case \"type_map\":
1895
+ {
1896
+ remove_add_(i+\"_element\");
1897
+ break;
1898
+ }
1899
+ case \"type_submit_reset\":
1900
+ {
1901
+ remove_add_(i+\"_element_submit\");
1902
+ if(document.getElementById(i+\"_element_reset\"))
1903
+ remove_add_(i+\"_element_reset\");
1904
+ break;
1905
+ }
1906
+ case \"type_captcha\":
1907
+ { remove_add_(\"wd_captcha\");
1908
+ remove_add_(\"element_refresh\");
1909
+ remove_add_(\"wd_captcha_input\");
1910
+ break;
1911
+ }
1912
+ case \"type_file_upload\":
1913
+ { remove_add_(i+\"_element\");
1914
+ if(document.getElementById(i+\"_element\").value==\"\")
1915
+ {
1916
+ seted=false;
1917
+ break;
1918
+ }
1919
+ ext_available=getfileextension(i);
1920
+ if(!ext_available)
1921
+ seted=false;
1922
+ break;
1923
+ }
1924
+ case \"type_textarea\":
1925
+ {
1926
+ remove_add_(i+\"_element\"); if(document.getElementById(i+\"_element\").innerHTML==document.getElementById(i+\"_element\").title || document.getElementById(i+\"_element\").innerHTML==\"\")
1927
+ seted=false;
1928
+ break;
1929
+ }
1930
+ case \"type_name\":
1931
+ {
1932
+ if(document.getElementById(i+\"_element_title\"))
1933
+ {
1934
+ remove_add_(i+\"_element_title\");
1935
+ remove_add_(i+\"_element_first\");
1936
+ remove_add_(i+\"_element_last\");
1937
+ remove_add_(i+\"_element_middle\");
1938
+ if(document.getElementById(i+\"_element_title\").value==\"\" || document.getElementById(i+\"_element_first\").value==\"\" || document.getElementById(i+\"_element_last\").value==\"\" || document.getElementById(i+\"_element_middle\").value==\"\")
1939
+ seted=false;
1940
+ }
1941
+ else
1942
+ {
1943
+ remove_add_(i+\"_element_first\");
1944
+ remove_add_(i+\"_element_last\");
1945
+ if(document.getElementById(i+\"_element_first\").value==\"\" || document.getElementById(i+\"_element_last\").value==\"\")
1946
+ seted=false;
1947
+ }
1948
+ break;
1949
+ }
1950
+ case \"type_checkbox\":
1951
+ case \"type_radio\":
1952
+ { is=true;
1953
+ for(j=0; j<100; j++)
1954
+ if(document.getElementById(i+\"_element\"+j))
1955
+ {
1956
+ remove_add_(i+\"_element\"+j);
1957
+ if(document.getElementById(i+\"_element\"+j).checked)
1958
+ {
1959
+ is=false;
1960
+ break;
1961
+ }
1962
+ }
1963
+ if(is)
1964
+ seted=false;
1965
+ break;
1966
+ }
1967
+ case \"type_button\":
1968
+ {
1969
+ for(j=0; j<100; j++)
1970
+ if(document.getElementById(i+\"_element\"+j))
1971
+ {
1972
+ remove_add_(i+\"_element\"+j);
1973
+ }
1974
+ break;
1975
+ }
1976
+ case \"type_time\":
1977
+ {
1978
+ if(document.getElementById(i+\"_ss\"))
1979
+ {
1980
+ remove_add_(i+\"_ss\");
1981
+ remove_add_(i+\"_mm\");
1982
+ remove_add_(i+\"_hh\");
1983
+ if(document.getElementById(i+\"_ss\").value==\"\" || document.getElementById(i+\"_mm\").value==\"\" || document.getElementById(i+\"_hh\").value==\"\")
1984
+ seted=false;
1985
+ }
1986
+ else
1987
+ {
1988
+ remove_add_(i+\"_mm\");
1989
+ remove_add_(i+\"_hh\");
1990
+ if(document.getElementById(i+\"_mm\").value==\"\" || document.getElementById(i+\"_hh\").value==\"\")
1991
+ seted=false;
1992
+ }
1993
+ break;
1994
+ }
1995
+ case \"type_date\":
1996
+ {
1997
+ remove_add_(i+\"_element\");
1998
+ remove_add_(i+\"_button\");
1999
+ if(document.getElementById(i+\"_element\").value==\"\")
2000
+ seted=false;
2001
+ break;
2002
+ }
2003
+ case \"type_date_fields\":
2004
+ {
2005
+ remove_add_(i+\"_day\");
2006
+ remove_add_(i+\"_month\");
2007
+ remove_add_(i+\"_year\");
2008
+ if(document.getElementById(i+\"_day\").value==\"\" || document.getElementById(i+\"_month\").value==\"\" || document.getElementById(i+\"_year\").value==\"\")
2009
+ seted=false;
2010
+ break;
2011
+ }
2012
+ }
2013
+ }
2014
+ }
2015
+ function check_year2(id)
2016
+ {
2017
+ year=document.getElementById(id).value;
2018
+ from=parseFloat(document.getElementById(id).getAttribute('from'));
2019
+ year=parseFloat(year);
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)
2027
+ {
2028
+ attr_name= new Array();
2029
+ attr_value= new Array();
2030
+ var input = document.getElementById(id);
2031
+ atr=input.attributes;
2032
+ for(v=0;v<30;v++)
2033
+ if(atr[v] )
2034
+ {
2035
+ if(atr[v].name.indexOf(\"add_\")==0)
2036
+ {
2037
+ attr_name.push(atr[v].name.replace('add_',''));
2038
+ attr_value.push(atr[v].value);
2039
+ input.removeAttribute(atr[v].name);
2040
+ v--;
2041
+ }
2042
+ }
2043
+ for(v=0;v<attr_name.length; v++)
2044
+ {
2045
+ input.setAttribute(attr_name[v],attr_value[v])
2046
+ }
2047
+ }
2048
+ function getfileextension(id)
2049
+ {
2050
+ var fileinput = document.getElementById(id+\"_element\");
2051
+ var filename = fileinput.value;
2052
+ if( filename.length == 0 )
2053
+ return true;
2054
+ var dot = filename.lastIndexOf(\".\");
2055
+ var extension = filename.substr(dot+1,filename.length);
2056
+ var exten = document.getElementById(id+\"_extension\").value.replace(\"***extensionverj\"+id+\"***\", \"\").replace(\"***extensionskizb\"+id+\"***\", \"\");
2057
+ exten=exten.split(',');
2058
+ for(x=0 ; x<exten.length; x++)
2059
+ {
2060
+ exten[x]=exten[x].replace(/\./g,'');
2061
+ exten[x]=exten[x].replace(/ /g,'');
2062
+ if(extension.toLowerCase()==exten[x].toLowerCase())
2063
+ return true;
2064
+ }
2065
+ return false;
2066
+ }
2067
+ function check_required(but_type)
2068
+ {
2069
+ if(but_type=='reset')
2070
+ {
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++)
2078
+ {
2079
+ if(seted)
2080
+ {
2081
+ if(document.getElementById(i))
2082
+ if(document.getElementById(i+\"_required\"))
2083
+ if(document.getElementById(i+\"_required\").value==\"yes\")
2084
+ {
2085
+ type=document.getElementById(i).getAttribute(\"type\");
2086
+ switch(type)
2087
+ {
2088
+ case \"type_text\":
2089
+ case \"type_password\":
2090
+ case \"type_submitter_mail\":
2091
+ case \"type_own_select\":
2092
+ case \"type_country\":
2093
+ {
2094
+ if(document.getElementById(i+\"_element\").value==document.getElementById(i+\"_element\").title || document.getElementById(i+\"_element\").value==\"\")
2095
+ seted=false;
2096
+ break;
2097
+ }
2098
+ case \"type_file_upload\":
2099
+ {
2100
+ if(document.getElementById(i+\"_element\").value==\"\")
2101
+ {
2102
+ seted=false;
2103
+ break;
2104
+ }
2105
+ ext_available=getfileextension(i);
2106
+ if(!ext_available)
2107
+ seted=false;
2108
+ break;
2109
+ }
2110
+ case \"type_textarea\":
2111
+ {
2112
+ if(document.getElementById(i+\"_element\").innerHTML==document.getElementById(i+\"_element\").title || document.getElementById(i+\"_element\").innerHTML==\"\")
2113
+ seted=false;
2114
+ break;
2115
+ }
2116
+ case \"type_name\":
2117
+ {
2118
+ if(document.getElementById(i+\"_element_title\"))
2119
+ {
2120
+ if(document.getElementById(i+\"_element_title\").value==\"\" || document.getElementById(i+\"_element_first\").value==\"\" || document.getElementById(i+\"_element_last\").value==\"\" || document.getElementById(i+\"_element_middle\").value==\"\")
2121
+ seted=false;
2122
+ }
2123
+ else
2124
+ {
2125
+ if(document.getElementById(i+\"_element_first\").value==\"\" || document.getElementById(i+\"_element_last\").value==\"\")
2126
+ seted=false;
2127
+ }
2128
+ break;
2129
+ }
2130
+ case \"type_checkbox\":
2131
+ case \"type_radio\":
2132
+ {
2133
+ is=true;
2134
+ for(j=0; j<100; j++)
2135
+ if(document.getElementById(i+\"_element\"+j))
2136
+ if(document.getElementById(i+\"_element\"+j).checked)
2137
+ {
2138
+ is=false;
2139
+ break;
2140
+ }
2141
+ if(is)
2142
+ seted=false;
2143
+ break;
2144
+ }
2145
+ case \"type_time\":
2146
+ {
2147
+ if(document.getElementById(i+\"_ss\"))
2148
+ {
2149
+ if(document.getElementById(i+\"_ss\").value==\"\" || document.getElementById(i+\"_mm\").value==\"\" || document.getElementById(i+\"_hh\").value==\"\")
2150
+ seted=false;
2151
+ }
2152
+ else
2153
+ {
2154
+ if(document.getElementById(i+\"_mm\").value==\"\" || document.getElementById(i+\"_hh\").value==\"\")
2155
+ seted=false;
2156
+ }
2157
+ break;
2158
+ }
2159
+ case \"type_date\":
2160
+ {
2161
+ if(document.getElementById(i+\"_element\").value==\"\")
2162
+ seted=false;
2163
+ break;
2164
+ }
2165
+ case \"type_date_fields\":
2166
+ {
2167
+ if(document.getElementById(i+\"_day\").value==\"\" || document.getElementById(i+\"_month\").value==\"\" || document.getElementById(i+\"_year\").value==\"\")
2168
+ seted=false;
2169
+ break;
2170
+ }
2171
+ }
2172
+ }
2173
+ else
2174
+ {
2175
+ type=document.getElementById(i).getAttribute(\"type\");
2176
+ if(type==\"type_file_upload\")
2177
+ ext_available=getfileextension(i);
2178
+ if(!ext_available)
2179
+ seted=false;
2180
+ }
2181
+ }
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
+ }
2196
+ if(seted)
2197
+ for(i=0; i<=n; i++)
2198
+ {
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
+ }
2206
+ if(seted)
2207
+ create_headers();
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\")
2215
+ if(document.getElementById(i).getAttribute(\"type\")!=\"type_captcha\")
2216
+ if(document.getElementById(i).getAttribute(\"type\")!=\"type_submit_reset\")
2217
+ if(document.getElementById(i).getAttribute(\"type\")!=\"type_button\")
2218
+ if(document.getElementById(i+'_element_label'))
2219
+ { var input = document.createElement('input');
2220
+ input.setAttribute(\"type\", 'hidden');
2221
+ input.setAttribute(\"name\", i+'_element_label');
2222
+ input.value=i;
2223
+ form_.appendChild(input);
2224
+ if(document.getElementById(i).getAttribute(\"type\")==\"type_date_fields\")
2225
+ { var input = document.createElement('input');
2226
+ input.setAttribute(\"type\", 'hidden');
2227
+ input.setAttribute(\"name\", i+'_element'); input.value=document.getElementById(i+'_day').value+'-'+document.getElementById(i+'_month').value+'-'+document.getElementById(i+'_year').value;
2228
+ form_.appendChild(input);
2229
+ }
2230
+ }
2231
+ }
2232
+ }
2233
+ form_.submit();
2234
+ }
2235
+ </script>
2236
+ </form></div>";
2237
+ }
2238
+ return $form_maker_front_end;
2239
+ }
2240
+
2241
+
generate_csv.php DELETED
@@ -1,237 +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
- if(!isset($_SERVER['HTTP_REFERER'])){
35
- header('Location: ../../index.php');
36
- exit;
37
- }
38
-
39
- $query = $wpdb->prepare("SELECT * FROM ".$wpdb->prefix."formmaker_submits where form_id= %d",$form_id);
40
-
41
- $rows = $wpdb->get_results($query);
42
-
43
- $n=count($rows);
44
-
45
- $labels= array();
46
- for($i=0; $i < $n ; $i++)
47
-
48
- {
49
- $row = &$rows[$i];
50
- if(!in_array($row->element_label, $labels))
51
- {
52
- array_push($labels, $row->element_label);
53
- }
54
- }
55
- $label_titles=array();
56
- $sorted_labels= array();
57
-
58
- $query_lable = $wpdb->prepare("SELECT label_order,title FROM ".$wpdb->prefix."formmaker where id= %d",$form_id);
59
-
60
-
61
-
62
- $rows_lable = $wpdb->get_results($query_lable);
63
- $ptn = "/[^a-zA-Z0-9_]/";
64
- $rpltxt = "";
65
-
66
-
67
- $title=preg_replace($ptn, $rpltxt, $rows_lable[0]->title);
68
-
69
- $sorted_labels_id= array();
70
- $sorted_labels= array();
71
- $label_titles=array();
72
- if($labels)
73
- {
74
-
75
- $label_id= array();
76
- $label_order= array();
77
- $label_order_original= array();
78
- $label_type= array();
79
-
80
- ///stexic
81
- $label_all = explode('#****#',$rows_lable[0]->label_order);
82
- $label_all = array_slice($label_all,0, count($label_all)-1);
83
-
84
-
85
-
86
- foreach($label_all as $key => $label_each)
87
- {
88
- $label_id_each=explode('#**id**#',$label_each);
89
- array_push($label_id, $label_id_each[0]);
90
-
91
- $label_oder_each=explode('#**label**#', $label_id_each[1]);
92
-
93
- array_push($label_order_original, $label_oder_each[0]);
94
-
95
- $ptn = "/[^a-zA-Z0-9_]/";
96
- $rpltxt = "";
97
- $label_temp=preg_replace($ptn, $rpltxt, $label_oder_each[0]);
98
- array_push($label_order, $label_temp);
99
-
100
- array_push($label_type, $label_oder_each[1]);
101
-
102
-
103
- //echo $label."<br>";
104
-
105
- }
106
-
107
- foreach($label_id as $key => $label)
108
- if(in_array($label, $labels))
109
- {
110
- array_push($sorted_labels, $label_order[$key]);
111
- array_push($sorted_labels_id, $label);
112
- array_push($label_titles, $label_order_original[$key]);
113
- }
114
-
115
-
116
- }
117
-
118
- $m=count($sorted_labels);
119
- $group_id_s= array();
120
- $l=0;
121
-
122
-
123
- if(count($rows)>0 and $m)
124
- for($i=0; $i <count($rows) ; $i++)
125
- {
126
-
127
- $row = &$rows[$i];
128
-
129
- if(!in_array($row->group_id, $group_id_s))
130
- {
131
-
132
- array_push($group_id_s, $row->group_id);
133
-
134
- }
135
- }
136
-
137
-
138
-
139
- $data=array();
140
-
141
-
142
- for($www=0; $www < count($group_id_s); $www++)
143
- {
144
- $i=$group_id_s[$www];
145
-
146
- $temp= array();
147
- for($j=0; $j < $n ; $j++)
148
- {
149
-
150
- $row = &$rows[$j];
151
-
152
- if($row->group_id==$i)
153
- {
154
-
155
- array_push($temp, $row);
156
- }
157
- }
158
-
159
-
160
-
161
- $f=$temp[0];
162
- $date=$f->date;
163
- $ip=$f->ip;
164
- $data_temp['Submit date']=$date;
165
- $data_temp['Ip']=$ip;
166
-
167
-
168
- $ttt=count($temp);
169
-
170
- // var_dump($temp);
171
- for($h=0; $h < $m ; $h++)
172
- {
173
-
174
- for($g=0; $g < $ttt ; $g++)
175
- {
176
- $t = $temp[$g];
177
- if($t->element_label==$sorted_labels_id[$h])
178
- {
179
- if(strpos($t->element_value,"*@@url@@*"))
180
- {
181
- $new_file=str_replace("*@@url@@*",'', $t->element_value);
182
- $new_filename=explode('/', $new_file);
183
- $data_temp[$label_titles[$h]]=$new_file;
184
- }
185
- else
186
- if(strpos($t->element_value,"***br***"))
187
- {
188
- $data_temp[$label_titles[$h]]= substr(str_replace("***br***",', ', $t->element_value), 0, -2);
189
- }
190
- else
191
- if(strpos($t->element_value,"***map***"))
192
- {
193
- $data_temp[$label_titles[$h]]= 'Longitude:'.substr(str_replace("***map***",', Latitude:', $t->element_value), 0, -2);
194
- }
195
- else
196
- $data_temp[$label_titles[$h]]=$t->element_value;
197
- }
198
- }
199
-
200
-
201
- }
202
- $data[]=$data_temp;
203
- }
204
-
205
-
206
-
207
-
208
- function cleanData(&$str)
209
- {
210
- $str = preg_replace("/\t/", "\\t", $str);
211
- $str = preg_replace("/\r?\n/", "\\n", $str);
212
- if(strstr($str, '"')) $str = '"' . str_replace('"', '""', $str) . '"';
213
- }
214
-
215
- // file name for download
216
- $filename = $title."_" . date('Ymd') . ".csv";
217
-
218
- header("Content-type:application/csv; charset='utf-8'");
219
- header("Content-Disposition: attachment; filename=\"$filename\"");
220
- echo chr(239).chr(187).chr(191);
221
-
222
-
223
- $flag = false;
224
- foreach($data as $row) {
225
- if(!$flag) {
226
- # display field/column names as first row
227
- echo '"'.implode('","', array_keys($row))."\"\r\n";
228
- $flag = true;
229
- }
230
- array_walk($row, 'cleanData');
231
- echo '"'.implode('","',array_values($row))."\"\r\n";
232
- }
233
-
234
-
235
-
236
-
237
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
generate_xml.php DELETED
@@ -1,467 +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
- if(!isset($_SERVER['HTTP_REFERER'])){
46
-
47
- header('Location: ../../index.php');
48
-
49
- exit;
50
-
51
- }
52
-
53
-
54
-
55
- $query = $wpdb->prepare("SELECT * FROM ".$wpdb->prefix."formmaker_submits where form_id= %d",$form_id);
56
-
57
- $rows = $wpdb->get_results($query);
58
-
59
- $n=count($rows);
60
-
61
- $labels= array();
62
-
63
- for($i=0; $i < $n ; $i++)
64
-
65
-
66
-
67
- {
68
-
69
- $row = &$rows[$i];
70
-
71
- if(!in_array($row->element_label, $labels))
72
-
73
- {
74
-
75
- array_push($labels, $row->element_label);
76
-
77
- }
78
-
79
- }
80
-
81
- $label_titles=array();
82
-
83
- $sorted_labels= array();
84
-
85
-
86
-
87
- $query_lable = "SELECT label_order,title FROM ".$wpdb->prefix."formmaker where id=$form_id ";
88
-
89
-
90
-
91
- $rows_lable = $wpdb->get_results($query_lable);
92
-
93
-
94
-
95
-
96
- $ptn = "/[^a-zA-Z0-9_]/";
97
-
98
- $rpltxt = "";
99
-
100
-
101
-
102
-
103
-
104
- $title=preg_replace($ptn, $rpltxt, $rows_lable[0]->title);
105
-
106
-
107
-
108
- $sorted_labels_id= array();
109
-
110
- $sorted_labels= array();
111
-
112
- $label_titles=array();
113
-
114
- if($labels)
115
-
116
- {
117
-
118
-
119
-
120
- $label_id= array();
121
-
122
- $label_order= array();
123
-
124
- $label_order_original= array();
125
-
126
- $label_type= array();
127
-
128
-
129
-
130
- ///stexic
131
-
132
- $label_all = explode('#****#',$rows_lable[0]->label_order);
133
-
134
- $label_all = array_slice($label_all,0, count($label_all)-1);
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
- foreach($label_all as $key => $label_each)
143
-
144
- {
145
-
146
- $label_id_each=explode('#**id**#',$label_each);
147
-
148
- array_push($label_id, $label_id_each[0]);
149
-
150
-
151
-
152
- $label_oder_each=explode('#**label**#', $label_id_each[1]);
153
-
154
-
155
-
156
- array_push($label_order_original, $label_oder_each[0]);
157
-
158
-
159
-
160
- $ptn = "/[^a-zA-Z0-9_]/";
161
-
162
- $rpltxt = "";
163
-
164
- $label_temp=preg_replace($ptn, $rpltxt, $label_oder_each[0]);
165
-
166
- array_push($label_order, $label_temp);
167
-
168
-
169
-
170
- array_push($label_type, $label_oder_each[1]);
171
-
172
-
173
-
174
-
175
-
176
- //echo $label."<br>";
177
-
178
-
179
-
180
- }
181
-
182
-
183
-
184
- foreach($label_id as $key => $label)
185
-
186
- if(in_array($label, $labels))
187
-
188
- {
189
-
190
- array_push($sorted_labels, $label_order[$key]);
191
-
192
- array_push($sorted_labels_id, $label);
193
-
194
- array_push($label_titles, $label_order_original[$key]);
195
-
196
- }
197
-
198
-
199
-
200
-
201
-
202
- }
203
-
204
-
205
-
206
- $m=count($sorted_labels);
207
-
208
- $group_id_s= array();
209
-
210
- $l=0;
211
-
212
-
213
-
214
- //var_dump($label_titles);
215
-
216
- if(count($rows)>0 and $m)
217
-
218
- for($i=0; $i <count($rows) ; $i++)
219
-
220
- {
221
-
222
-
223
-
224
- $row = &$rows[$i];
225
-
226
-
227
-
228
- if(!in_array($row->group_id, $group_id_s))
229
-
230
- {
231
-
232
-
233
-
234
- array_push($group_id_s, $row->group_id);
235
-
236
-
237
-
238
- }
239
-
240
- }
241
-
242
-
243
-
244
-
245
-
246
-
247
-
248
- $data=array();
249
-
250
-
251
-
252
-
253
-
254
- for($www=0; $www < count($group_id_s); $www++)
255
-
256
- {
257
-
258
- $i=$group_id_s[$www];
259
-
260
-
261
-
262
- $temp= array();
263
-
264
- for($j=0; $j < $n ; $j++)
265
-
266
- {
267
-
268
-
269
-
270
- $row = &$rows[$j];
271
-
272
-
273
-
274
- if($row->group_id==$i)
275
-
276
- {
277
-
278
-
279
-
280
- array_push($temp, $row);
281
-
282
- }
283
-
284
- }
285
-
286
-
287
-
288
-
289
-
290
-
291
-
292
- $f=$temp[0];
293
-
294
- $date=$f->date;
295
-
296
- $ip=$f->ip;
297
-
298
- $data_temp['Submit date']=$date;
299
-
300
- $data_temp['Ip']=$ip;
301
-
302
-
303
-
304
-
305
-
306
- $ttt=count($temp);
307
-
308
-
309
-
310
- // var_dump($temp);
311
-
312
- for($h=0; $h < $m ; $h++)
313
-
314
- {
315
-
316
-
317
-
318
- for($g=0; $g < $ttt ; $g++)
319
-
320
- {
321
-
322
- $t = $temp[$g];
323
-
324
- if($t->element_label==$sorted_labels_id[$h])
325
-
326
- {
327
-
328
- if(strpos($t->element_value,"*@@url@@*"))
329
-
330
- {
331
-
332
- $new_file=str_replace("*@@url@@*",'', $t->element_value);
333
-
334
- $new_filename=explode('/', $new_file);
335
-
336
- $data_temp[$label_titles[$h]]=$new_file;
337
-
338
- }
339
-
340
- else
341
- if(strpos($t->element_value,"***br***"))
342
- {
343
- $data_temp[$label_titles[$h]]= substr(str_replace("***br***",', ', $t->element_value), 0, -2);
344
- }
345
- else
346
- if(strpos($t->element_value,"***map***"))
347
- {
348
- $data_temp[$label_titles[$h]]= 'Longitude:'.substr(str_replace("***map***",', Latitude:', $t->element_value), 0, -2);
349
- }
350
- else
351
- $data_temp[$label_titles[$h]]=$t->element_value;
352
-
353
- }
354
-
355
- }
356
-
357
-
358
-
359
-
360
-
361
- }
362
-
363
- $data[]=$data_temp;
364
-
365
- }
366
-
367
- // var_dump($data);
368
-
369
-
370
-
371
-
372
-
373
- function cleanData(&$str)
374
-
375
- {
376
-
377
- $str = preg_replace("/\t/", "\\t", $str);
378
-
379
- $str = preg_replace("/\r?\n/", "\\n", $str);
380
-
381
- if(strstr($str, '"')) $str = '"' . str_replace('"', '""', $str) . '"';
382
-
383
- }
384
-
385
-
386
-
387
- // file name for download
388
-
389
- $filename = $title."_" . date('Ymd') . ".xml";
390
-
391
-
392
-
393
- header("Content-Disposition: attachment; filename=\"$filename\"");
394
-
395
- header("Content-Type:text/xml, charset=utf-8");
396
-
397
-
398
-
399
-
400
-
401
- $flag = false;
402
-
403
- /*
404
-
405
- foreach($data as $row) {
406
-
407
- if(!$flag) {
408
-
409
- # display field/column names as first row
410
-
411
- echo implode("\t", array_keys($row)) . "\r\n";
412
-
413
- $flag = true;
414
-
415
- }
416
-
417
- array_walk($row, 'cleanData');
418
-
419
- echo implode("\t", array_values($row)) . "\r\n";
420
-
421
- }
422
-
423
- */
424
-
425
- echo '
426
-
427
- <?xml version="1.0" encoding="utf-8" ?>
428
-
429
- <form title="'.$title.'">';
430
-
431
-
432
-
433
- foreach ($data as $key1 => $value1){
434
-
435
- echo '<submition>';
436
-
437
-
438
-
439
- foreach ($value1 as $key => $value){
440
-
441
- echo '<field title="'.$key.'">';
442
-
443
- echo '<![CDATA['.$value."]]>";
444
-
445
- echo '</field>';
446
-
447
- }
448
-
449
-
450
-
451
- echo '</submition>';
452
-
453
- }
454
-
455
-
456
-
457
- echo '';
458
-
459
- echo ' </form>
460
-
461
- ';
462
-
463
-
464
-
465
-
466
-
467
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/calendar-jos.css CHANGED
@@ -1,198 +1,198 @@
1
- /* The main calendar widget. DIV containing a table. */
2
-
3
- div.calendar {
4
- position: relative;
5
- z-index: 100;
6
- width: 226px;
7
- }
8
-
9
- .calendar, .calendar table {
10
- border: 1px solid #cccccc;
11
- font-size: 11px;
12
- color: #000;
13
- cursor: default;
14
- background: #efefef;
15
- font-family: arial,verdana,sans-serif;
16
- }
17
-
18
- /* Header part -- contains navigation buttons and day names. */
19
-
20
- .calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
21
- text-align: center; /* They are the navigation buttons */
22
- padding: 2px; /* Make the buttons seem like they're pressing */
23
- border:0px;
24
- height:inherit;
25
-
26
- }
27
- .button {
28
-
29
- -webkit-border-radius: 11px !important;;
30
- border-radius: 11px !important;;
31
- text-shadow: white 0px 1px 0px;
32
- bbackground-origin: padding-box;
33
- border-bottom-width: 1px;
34
- border-left-width: 1px;
35
- border-right-width: 1px;
36
- border-top-width: 1px;
37
- }
38
-
39
- .calendar thead .title { /* This holds the current "month, year" */
40
- font-weight: bold; /* Pressing it will take you to the current date */
41
- text-align: center;
42
- background: #333333;
43
- color: #ffffff;
44
- padding: 2px;
45
- }
46
-
47
- .calendar thead .headrow { /* Row <TR> containing navigation buttons */
48
- background: #dedede;
49
- color: #000;
50
- }
51
-
52
- .calendar thead .name { /* Cells <TD> containing the day names */
53
- border-bottom: 1px solid #cccccc;
54
- padding: 2px;
55
- text-align: center;
56
- color: #000;
57
- }
58
-
59
- .calendar thead .weekend { /* How a weekend day name shows in header */
60
- color:#666666 !important;
61
- }
62
-
63
- .calendar thead .hilite { /* How do the buttons in header appear when hover */
64
- background: #bbbbbb;
65
- color: #000000;
66
- border: 1px solid #cccccc;
67
- padding: 1px;
68
- }
69
-
70
- .calendar thead .active { /* Active (pressed) buttons in header */
71
- background: #c77;
72
- padding: 2px 0px 0px 2px;
73
- }
74
-
75
- .calendar thead .daynames { /* Row <TR> containing the day names */
76
- background: #dddddd;
77
- }
78
-
79
- /* The body part -- contains all the days in month. */
80
-
81
- .calendar tbody .day { /* Cells <TD> containing month days dates */
82
- width: 2em;
83
- text-align: right;
84
- padding: 2px 4px 2px 2px;
85
- }
86
-
87
- .calendar table .wn {
88
- padding: 2px 3px 2px 2px;
89
- border-right: 1px solid #cccccc;
90
- background: #dddddd;
91
- }
92
-
93
- .calendar tbody .rowhilite td {
94
- background: #666666;
95
- color: #ffffff;
96
- }
97
-
98
- .calendar tbody .rowhilite td.wn {
99
- background: #666666;
100
- color: #ffffff;
101
- }
102
- .calendar table
103
- {
104
- border-collapse:inherit !important;
105
- }
106
-
107
- .calendar tbody td.hilite { /* Hovered cells <TD> */
108
- background: #999999;
109
- padding: 1px 3px 1px 1px;
110
- border: 1px solid #666666;
111
- }
112
-
113
- .calendar tbody td.active { /* Active (pressed) cells <TD> */
114
- background: #000000;
115
- color: #ffffff;
116
- padding: 2px 2px 0px 2px;
117
- }
118
-
119
- .calendar tbody td.selected { /* Cell showing today date */
120
- font-weight: bold;
121
- border: 1px solid #000;
122
- padding: 1px 3px 1px 1px;
123
- background: #000000;
124
- color: #ffffff;
125
- }
126
-
127
- .calendar tbody td.weekend { /* Cells showing weekend days */
128
- color: #cccccc;
129
- }
130
-
131
- .calendar tbody td.today { font-weight: bold; }
132
-
133
- .calendar tbody .disabled { color: #999; }
134
-
135
- .calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
136
- visibility: hidden;
137
- }
138
-
139
- .calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
140
- display: none;
141
- }
142
-
143
- /* The footer part -- status bar and "Close" button */
144
-
145
- .calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
146
- text-align: center;
147
- background: #cccccc;
148
- color: #000;
149
- }
150
-
151
- .calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
152
- border-top: 1px solid #cccccc;
153
- background: #efefef;
154
- color: #000000;
155
- }
156
-
157
- .calendar tfoot .hilite { /* Hover style for buttons in footer */
158
- background: #666666;
159
- border: 1px solid #f40;
160
- padding: 1px;
161
- }
162
-
163
- .calendar tfoot .active { /* Active (pressed) style for buttons in footer */
164
- background: #999999;
165
- padding: 2px 0px 0px 2px;
166
- }
167
-
168
- /* Combo boxes (menus that display months/years for direct selection) */
169
-
170
- .combo {
171
- position: absolute;
172
- display: none;
173
- top: 0px;
174
- left: 0px;
175
- width: 4em;
176
- cursor: default;
177
- border: 1px solid #655;
178
- background: #ffffff;
179
- color: #000;
180
- font-size: smaller;
181
- }
182
-
183
- .combo .label {
184
- width: 100%;
185
- text-align: center;
186
- }
187
-
188
- .combo .hilite {
189
- background: #fc8;
190
- }
191
-
192
- .combo .active {
193
- border-top: 1px solid #cccccc;
194
- border-bottom: 1px solid #cccccc;
195
- background: #efefef;
196
- font-weight: bold;
197
-
198
- }
1
+ /* The main calendar widget. DIV containing a table. */
2
+
3
+ div.calendar {
4
+ position: relative;
5
+ z-index: 100;
6
+ width: 226px;
7
+ }
8
+
9
+ .calendar, .calendar table {
10
+ border: 1px solid #cccccc;
11
+ font-size: 11px;
12
+ color: #000;
13
+ cursor: default;
14
+ background: #efefef;
15
+ font-family: arial,verdana,sans-serif;
16
+ }
17
+
18
+ /* Header part -- contains navigation buttons and day names. */
19
+
20
+ .calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
21
+ text-align: center; /* They are the navigation buttons */
22
+ padding: 2px; /* Make the buttons seem like they're pressing */
23
+ border:0px;
24
+ height:inherit;
25
+
26
+ }
27
+ .button {
28
+
29
+ -webkit-border-radius: 11px !important;;
30
+ border-radius: 11px !important;;
31
+ text-shadow: white 0px 1px 0px;
32
+ bbackground-origin: padding-box;
33
+ border-bottom-width: 1px;
34
+ border-left-width: 1px;
35
+ border-right-width: 1px;
36
+ border-top-width: 1px;
37
+ }
38
+
39
+ .calendar thead .title { /* This holds the current "month, year" */
40
+ font-weight: bold; /* Pressing it will take you to the current date */
41
+ text-align: center;
42
+ background: #333333;
43
+ color: #ffffff;
44
+ padding: 2px;
45
+ }
46
+
47
+ .calendar thead .headrow { /* Row <TR> containing navigation buttons */
48
+ background: #dedede;
49
+ color: #000;
50
+ }
51
+
52
+ .calendar thead .name { /* Cells <TD> containing the day names */
53
+ border-bottom: 1px solid #cccccc;
54
+ padding: 2px;
55
+ text-align: center;
56
+ color: #000;
57
+ }
58
+
59
+ .calendar thead .weekend { /* How a weekend day name shows in header */
60
+ color:#666666 !important;
61
+ }
62
+
63
+ .calendar thead .hilite { /* How do the buttons in header appear when hover */
64
+ background: #bbbbbb;
65
+ color: #000000;
66
+ border: 1px solid #cccccc;
67
+ padding: 1px;
68
+ }
69
+
70
+ .calendar thead .active { /* Active (pressed) buttons in header */
71
+ background: #c77;
72
+ padding: 2px 0px 0px 2px;
73
+ }
74
+
75
+ .calendar thead .daynames { /* Row <TR> containing the day names */
76
+ background: #dddddd;
77
+ }
78
+
79
+ /* The body part -- contains all the days in month. */
80
+
81
+ .calendar tbody .day { /* Cells <TD> containing month days dates */
82
+ width: 2em;
83
+ text-align: right;
84
+ padding: 2px 4px 2px 2px;
85
+ }
86
+
87
+ .calendar table .wn {
88
+ padding: 2px 3px 2px 2px;
89
+ border-right: 1px solid #cccccc;
90
+ background: #dddddd;
91
+ }
92
+
93
+ .calendar tbody .rowhilite td {
94
+ background: #666666;
95
+ color: #ffffff;
96
+ }
97
+
98
+ .calendar tbody .rowhilite td.wn {
99
+ background: #666666;
100
+ color: #ffffff;
101
+ }
102
+ .calendar table
103
+ {
104
+ border-collapse:inherit !important;
105
+ }
106
+
107
+ .calendar tbody td.hilite { /* Hovered cells <TD> */
108
+ background: #999999;
109
+ padding: 1px 3px 1px 1px;
110
+ border: 1px solid #666666;
111
+ }
112
+
113
+ .calendar tbody td.active { /* Active (pressed) cells <TD> */
114
+ background: #000000;
115
+ color: #ffffff;
116
+ padding: 2px 2px 0px 2px;
117
+ }
118
+
119
+ .calendar tbody td.selected { /* Cell showing today date */
120
+ font-weight: bold;
121
+ border: 1px solid #000;
122
+ padding: 1px 3px 1px 1px;
123
+ background: #000000;
124
+ color: #ffffff;
125
+ }
126
+
127
+ .calendar tbody td.weekend { /* Cells showing weekend days */
128
+ color: #cccccc;
129
+ }
130
+
131
+ .calendar tbody td.today { font-weight: bold; }
132
+
133
+ .calendar tbody .disabled { color: #999; }
134
+
135
+ .calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
136
+ visibility: hidden;
137
+ }
138
+
139
+ .calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
140
+ display: none;
141
+ }
142
+
143
+ /* The footer part -- status bar and "Close" button */
144
+
145
+ .calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
146
+ text-align: center;
147
+ background: #cccccc;
148
+ color: #000;
149
+ }
150
+
151
+ .calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
152
+ border-top: 1px solid #cccccc;
153
+ background: #efefef;
154
+ color: #000000;
155
+ }
156
+
157
+ .calendar tfoot .hilite { /* Hover style for buttons in footer */
158
+ background: #666666;
159
+ border: 1px solid #f40;
160
+ padding: 1px;
161
+ }
162
+
163
+ .calendar tfoot .active { /* Active (pressed) style for buttons in footer */
164
+ background: #999999;
165
+ padding: 2px 0px 0px 2px;
166
+ }
167
+
168
+ /* Combo boxes (menus that display months/years for direct selection) */
169
+
170
+ .combo {
171
+ position: absolute;
172
+ display: none;
173
+ top: 0px;
174
+ left: 0px;
175
+ width: 4em;
176
+ cursor: default;
177
+ border: 1px solid #655;
178
+ background: #ffffff;
179
+ color: #000;
180
+ font-size: smaller;
181
+ }
182
+
183
+ .combo .label {
184
+ width: 100%;
185
+ text-align: center;
186
+ }
187
+
188
+ .combo .hilite {
189
+ background: #fc8;
190
+ }
191
+
192
+ .combo .active {
193
+ border-top: 1px solid #cccccc;
194
+ border-bottom: 1px solid #cccccc;
195
+ background: #efefef;
196
+ font-weight: bold;
197
+
198
+ }
js/calendar.js CHANGED
@@ -1,36 +1,36 @@
1
- /* Copyright Mihai Bazon, 2002-2005 | www.bazon.net/mishoo
2
- * -----------------------------------------------------------
3
- *
4
- * The DHTML Calendar, version 1.0 "It is happening again"
5
- *
6
- * Details and latest version at:
7
- * www.dynarch.com/projects/calendar
8
- *
9
- * This script is developed by Dynarch.com. Visit us at www.dynarch.com.
10
- *
11
- * This script is distributed under the GNU Lesser General Public License.
12
- * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
13
- */
14
- Calendar=function(firstDayOfWeek,dateStr,onSelected,onClose){
15
- Calendar._DN = new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday");Calendar._SDN = new Array ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"); Calendar._FD = 0; Calendar._MN = new Array ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); Calendar._SMN = new Array ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");Calendar._TT = {};Calendar._TT["INFO"] = "About the Calendar";
16
- Calendar._TT["ABOUT"] =
17
- "DHTML Date/Time Selector\n" +
18
- "(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" +
19
- "For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
20
- "Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." +
21
- "\n\n" +
22
- "Date selection:\n" +
23
- "- Use the \xab, \xbb buttons to select year\n" +
24
- "- Use the " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " buttons to select month\n" +
25
- "- Hold mouse button on any of the above buttons for faster selection.";
26
- Calendar._TT["ABOUT_TIME"] = "\n\n" +
27
- "Time selection:\n" +
28
- "- Click on any of the time parts to increase it\n" +
29
- "- or Shift-click to decrease it\n" +
30
- "- or click and drag for faster selection.";
31
-
32
- Calendar._TT["PREV_YEAR"] = "Click to move to the previous year. Click and hold for a list of years.";Calendar._TT["PREV_MONTH"] = "Click to move to the previous month. Click and hold for a list of the months."; Calendar._TT["GO_TODAY"] = "Go to today";Calendar._TT["NEXT_MONTH"] = "Click to move to the next month. Click and hold for a list of the months.";Calendar._TT["NEXT_YEAR"] = "Click to move to the next year. Click and hold for a list of years.";Calendar._TT["SEL_DATE"] = "Select a date.";Calendar._TT["DRAG_TO_MOVE"] = "Drag to move";Calendar._TT["PART_TODAY"] = " (Today)";Calendar._TT["DAY_FIRST"] = "Display %s first";Calendar._TT["WEEKEND"] = "0,6";Calendar._TT["CLOSE"] = "Close";Calendar._TT["TODAY"] = "Today";Calendar._TT["TIME_PART"] = "(Shift-)Click or Drag to change the value.";Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; Calendar._TT["TT_DATE_FORMAT"] = "%A, %B %e";Calendar._TT["WK"] = "wk";Calendar._TT["TIME"] = "Time:";
33
-
34
-
35
-
36
  this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=onSelected||null;this.onClose=onClose||null;this.dragging=false;this.hidden=false;this.minYear=1970;this.maxYear=2050;this.dateFormat=Calendar._TT["DEF_DATE_FORMAT"];this.ttDateFormat=Calendar._TT["TT_DATE_FORMAT"];this.isPopup=true;this.weekNumbers=true;this.firstDayOfWeek=typeof firstDayOfWeek=="number"?firstDayOfWeek:Calendar._FD;this.showsOtherMonths=false;this.dateStr=dateStr;this.ar_days=null;this.showsTime=false;this.time24=true;this.yearStep=2;this.hiliteToday=true;this.multiple=null;this.table=null;this.element=null;this.tbody=null;this.firstdayname=null;this.monthsCombo=null;this.yearsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.hilitedYear=null;this.activeYear=null;this.dateClicked=false;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined")Calendar._SDN_len=3;var ar=new Array();for(var i=8;i>0;){ar[--i]=Calendar._DN[i].substr(0,Calendar._SDN_len);}Calendar._SDN=ar;if(typeof Calendar._SMN_len=="undefined")Calendar._SMN_len=3;ar=new Array();for(var i=12;i>0;){ar[--i]=Calendar._MN[i].substr(0,Calendar._SMN_len);}Calendar._SMN=ar;}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos=function(el){var SL=0,ST=0;var is_div=/^div$/i.test(el.tagName);if(is_div&&el.scrollLeft)SL=el.scrollLeft;if(is_div&&el.scrollTop)ST=el.scrollTop;var r={x:el.offsetLeft-SL,y:el.offsetTop-ST};if(el.offsetParent){var tmp=this.getAbsolutePos(el.offsetParent);r.x+=tmp.x;r.y+=tmp.y;}return r;};Calendar.isRelated=function(el,evt){var related=evt.relatedTarget;if(!related){var type=evt.type;if(type=="mouseover"){related=evt.fromElement;}else if(type=="mouseout"){related=evt.toElement;}}while(related){if(related==el){return true;}related=related.parentNode;}return false;};Calendar.removeClass=function(el,className){if(!(el&&el.className)){return;}var cls=el.className.split(" ");var ar=new Array();for(var i=cls.length;i>0;){if(cls[--i]!=className){ar[ar.length]=cls[i];}}el.className=ar.join(" ");};Calendar.addClass=function(el,className){Calendar.removeClass(el,className);el.className+=" "+className;};Calendar.getElement=function(ev){var f=Calendar.is_ie?window.event.srcElement:ev.currentTarget;while(f.nodeType!=1||/^div$/i.test(f.tagName))f=f.parentNode;return f;};Calendar.getTargetElement=function(ev){var f=Calendar.is_ie?window.event.srcElement:ev.target;while(f.nodeType!=1)f=f.parentNode;return f;};Calendar.stopEvent=function(ev){ev||(ev=window.event);if(Calendar.is_ie){ev.cancelBubble=true;ev.returnValue=false;}else{ev.preventDefault();ev.stopPropagation();}return false;};Calendar.addEvent=function(el,evname,func){if(el.attachEvent){el.attachEvent("on"+evname,func);}else if(el.addEventListener){el.addEventListener(evname,func,true);}else{el["on"+evname]=func;}};Calendar.removeEvent=function(el,evname,func){if(el.detachEvent){el.detachEvent("on"+evname,func);}else if(el.removeEventListener){el.removeEventListener(evname,func,true);}else{el["on"+evname]=null;}};Calendar.createElement=function(type,parent){var el=null;if(document.createElementNS){el=document.createElementNS("http://www.w3.org/1999/xhtml",type);}else{el=document.createElement(type);}if(typeof parent!="undefined"){parent.appendChild(el);}return el;};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true);}}};Calendar.findMonth=function(el){if(typeof el.month!="undefined"){return el;}else if(typeof el.parentNode.month!="undefined"){return el.parentNode;}return null;};Calendar.findYear=function(el){if(typeof el.year!="undefined"){return el;}else if(typeof el.parentNode.year!="undefined"){return el.parentNode;}return null;};Calendar.showMonthsCombo=function(){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var mc=cal.monthsCombo;if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}if(cal.activeMonth){Calendar.removeClass(cal.activeMonth,"active");}var mon=cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()];Calendar.addClass(mon,"active");cal.activeMonth=mon;var s=mc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else{var mcw=mc.offsetWidth;if(typeof mcw=="undefined")mcw=50;s.left=(cd.offsetLeft+cd.offsetWidth-mcw)+"px";}s.top=(cd.offsetTop+cd.offsetHeight)+"px";};Calendar.showYearsCombo=function(fwd){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var yc=cal.yearsCombo;if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}if(cal.activeYear){Calendar.removeClass(cal.activeYear,"active");}cal.activeYear=null;var Y=cal.date.getFullYear()+(fwd?1:-1);var yr=yc.firstChild;var show=false;for(var i=12;i>0;--i){if(Y>=cal.minYear&&Y<=cal.maxYear){yr.innerHTML=Y;yr.year=Y;yr.style.display="block";show=true;}else{yr.style.display="none";}yr=yr.nextSibling;Y+=fwd?cal.yearStep:-cal.yearStep;}if(show){var s=yc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else{var ycw=yc.offsetWidth;if(typeof ycw=="undefined")ycw=50;s.left=(cd.offsetLeft+cd.offsetWidth-ycw)+"px";}s.top=(cd.offsetTop+cd.offsetHeight)+"px";}};Calendar.tableMouseUp=function(ev){var cal=Calendar._C;if(!cal){return false;}if(cal.timeout){clearTimeout(cal.timeout);}var el=cal.activeDiv;if(!el){return false;}var target=Calendar.getTargetElement(ev);ev||(ev=window.event);Calendar.removeClass(el,"active");if(target==el||target.parentNode==el){Calendar.cellClick(el,ev);}var mon=Calendar.findMonth(target);var date=null;if(mon){date=new Date(cal.date);if(mon.month!=date.getMonth()){date.setMonth(mon.month);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}else{var year=Calendar.findYear(target);if(year){date=new Date(cal.date);if(year.year!=date.getFullYear()){date.setFullYear(year.year);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}}with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);cal._hideCombos();_C=null;return stopEvent(ev);}};Calendar.tableMouseOver=function(ev){var cal=Calendar._C;if(!cal){return;}var el=cal.activeDiv;var target=Calendar.getTargetElement(ev);if(target==el||target.parentNode==el){Calendar.addClass(el,"hilite active");Calendar.addClass(el.parentNode,"rowhilite");}else{if(typeof el.navtype=="undefined"||(el.navtype!=50&&(el.navtype==0||Math.abs(el.navtype)>2)))Calendar.removeClass(el,"active");Calendar.removeClass(el,"hilite");Calendar.removeClass(el.parentNode,"rowhilite");}ev||(ev=window.event);if(el.navtype==50&&target!=el){var pos=Calendar.getAbsolutePos(el);var w=el.offsetWidth;var x=ev.clientX;var dx;var decrease=true;if(x>pos.x+w){dx=x-pos.x-w;decrease=false;}else dx=pos.x-x;if(dx<0)dx=0;var range=el._range;var current=el._current;var count=Math.floor(dx/10)%range.length;for(var i=range.length;--i>=0;)if(range[i]==current)break;while(count-->0)if(decrease){if(--i<0)i=range.length-1;}else if(++i>=range.length)i=0;var newval=range[i];el.innerHTML=newval;cal.onUpdateTime();}var mon=Calendar.findMonth(target);if(mon){if(mon.month!=cal.date.getMonth()){if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}Calendar.addClass(mon,"hilite");cal.hilitedMonth=mon;}else if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}}else{if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}var year=Calendar.findYear(target);if(year){if(year.year!=cal.date.getFullYear()){if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}Calendar.addClass(year,"hilite");cal.hilitedYear=year;}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}return Calendar.stopEvent(ev);};Calendar.tableMouseDown=function(ev){if(Calendar.getTargetElement(ev)==Calendar.getElement(ev)){return Calendar.stopEvent(ev);}};Calendar.calDragIt=function(ev){var cal=Calendar._C;if(!(cal&&cal.dragging)){return false;}var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft;}else{posX=ev.pageX;posY=ev.pageY;}cal.hideShowCovered();var st=cal.element.style;st.left=(posX-cal.xOffs)+"px";st.top=(posY-cal.yOffs)+"px";return Calendar.stopEvent(ev);};Calendar.calDragEnd=function(ev){var cal=Calendar._C;if(!cal){return false;}cal.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(ev);}cal.hideShowCovered();};Calendar.dayMouseDown=function(ev){var el=Calendar.getElement(ev);if(el.disabled){return false;}var cal=el.calendar;cal.activeDiv=el;Calendar._C=cal;if(el.navtype!=300)with(Calendar){if(el.navtype==50){el._current=el.innerHTML;addEvent(document,"mousemove",tableMouseOver);}else addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver);addClass(el,"hilite active");addEvent(document,"mouseup",tableMouseUp);}else if(cal.isPopup){cal._dragStart(ev);}if(el.navtype==-1||el.navtype==1){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout("Calendar.showMonthsCombo()",250);}else if(el.navtype==-2||el.navtype==2){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250);}else{cal.timeout=null;}return Calendar.stopEvent(ev);};Calendar.dayMouseDblClick=function(ev){Calendar.cellClick(Calendar.getElement(ev),ev||window.event);if(Calendar.is_ie){document.selection.empty();}};Calendar.dayMouseOver=function(ev){var el=Calendar.getElement(ev);if(Calendar.isRelated(el,ev)||Calendar._C||el.disabled){return false;}if(el.ttip){if(el.ttip.substr(0,1)=="_"){el.ttip=el.caldate.print(el.calendar.ttDateFormat)+el.ttip.substr(1);}el.calendar.tooltips.innerHTML=el.ttip;}if(el.navtype!=300){Calendar.addClass(el,"hilite");if(el.caldate){Calendar.addClass(el.parentNode,"rowhilite");}}return Calendar.stopEvent(ev);};Calendar.dayMouseOut=function(ev){with(Calendar){var el=getElement(ev);if(isRelated(el,ev)||_C||el.disabled)return false;removeClass(el,"hilite");if(el.caldate)removeClass(el.parentNode,"rowhilite");if(el.calendar)el.calendar.tooltips.innerHTML=_TT["SEL_DATE"];return stopEvent(ev);}};Calendar.cellClick=function(el,ev){var cal=el.calendar;var closing=false;var newdate=false;var date=null;if(typeof el.navtype=="undefined"){if(cal.currentDateEl){Calendar.removeClass(cal.currentDateEl,"selected");Calendar.addClass(el,"selected");closing=(cal.currentDateEl==el);if(!closing){cal.currentDateEl=el;}}cal.date.setDateOnly(el.caldate);date=cal.date;var other_month=!(cal.dateClicked=!el.otherMonth);if(!other_month&&!cal.currentDateEl)cal._toggleMultipleDate(new Date(date));else newdate=!el.disabled;if(other_month)cal._init(cal.firstDayOfWeek,date);}else{if(el.navtype==200){Calendar.removeClass(el,"hilite");cal.callCloseHandler();return;}date=new Date(cal.date);if(el.navtype==0)date.setDateOnly(new Date());cal.dateClicked=false;var year=date.getFullYear();var mon=date.getMonth();function setMonth(m){var day=date.getDate();var max=date.getMonthDays(m);if(day>max){date.setDate(max);}date.setMonth(m);};switch(el.navtype){case 400:Calendar.removeClass(el,"hilite");var text=Calendar._TT["ABOUT"];if(typeof text!="undefined"){text+=cal.showsTime?Calendar._TT["ABOUT_TIME"]:"";}else{text="Help and about box text is not translated into this language.\n"+"If you know this language and you feel generous please update\n"+"the corresponding file in \"lang\" subdir to match calendar-en.js\n"+"and send it back to <mihai_bazon@yahoo.com> to get it into the distribution ;-)\n\n"+"Thank you!\n"+"http://dynarch.com/mishoo/calendar.epl\n";}alert(text);return;case-2:if(year>cal.minYear){date.setFullYear(year-1);}break;case-1:if(mon>0){setMonth(mon-1);}else if(year-->cal.minYear){date.setFullYear(year);setMonth(11);}break;case 1:if(mon<11){setMonth(mon+1);}else if(year<cal.maxYear){date.setFullYear(year+1);setMonth(0);}break;case 2:if(year<cal.maxYear){date.setFullYear(year+1);}break;case 100:cal.setFirstDayOfWeek(el.fdow);return;case 50:var range=el._range;var current=el.innerHTML;for(var i=range.length;--i>=0;)if(range[i]==current)break;if(ev&&ev.shiftKey){if(--i<0)i=range.length-1;}else if(++i>=range.length)i=0;var newval=range[i];el.innerHTML=newval;cal.onUpdateTime();return;case 0:if((typeof cal.getDateStatus=="function")&&cal.getDateStatus(date,date.getFullYear(),date.getMonth(),date.getDate())){return false;}break;}if(!date.equalsTo(cal.date)){cal.setDate(date);newdate=true;}else if(el.navtype==0)newdate=closing=true;}if(newdate){ev&&cal.callHandler();}if(closing){Calendar.removeClass(el,"hilite");ev&&cal.callCloseHandler();}};Calendar.prototype.create=function(_par){var parent=null;if(!_par){parent=document.getElementsByTagName("body")[0];this.isPopup=true;}else{parent=_par;this.isPopup=false;}this.date=this.dateStr?new Date(this.dateStr):new Date();var table=Calendar.createElement("table");this.table=table;table.cellSpacing=0;table.cellPadding=0;table.calendar=this;Calendar.addEvent(table,"mousedown",Calendar.tableMouseDown);var div=Calendar.createElement("div");this.element=div;div.className="calendar";if(this.isPopup){div.style.position="absolute";div.style.display="none";}div.appendChild(table);var thead=Calendar.createElement("thead",table);var cell=null;var row=null;var cal=this;var hh=function(text,cs,navtype){cell=Calendar.createElement("td",row);cell.colSpan=cs;cell.className="button";if(navtype!=0&&Math.abs(navtype)<=2)cell.className+=" nav";Calendar._add_evs(cell);cell.calendar=cal;cell.navtype=navtype;cell.innerHTML="<div unselectable='on'>"+text+"</div>";return cell;};row=Calendar.createElement("tr",thead);var title_length=6;(this.isPopup)&&--title_length;(this.weekNumbers)&&++title_length;hh("?",1,400).ttip=Calendar._TT["INFO"];this.title=hh("",title_length,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT["DRAG_TO_MOVE"];this.title.style.cursor="move";hh("&#x00d7;",1,200).ttip=Calendar._TT["CLOSE"];}row=Calendar.createElement("tr",thead);row.className="headrow";this._nav_py=hh("&#x00ab;",1,-2);this._nav_py.ttip=Calendar._TT["PREV_YEAR"];this._nav_pm=hh("&#x2039;",1,-1);this._nav_pm.ttip=Calendar._TT["PREV_MONTH"];this._nav_now=hh(Calendar._TT["TODAY"],this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT["GO_TODAY"];this._nav_nm=hh("&#x203a;",1,1);this._nav_nm.ttip=Calendar._TT["NEXT_MONTH"];this._nav_ny=hh("&#x00bb;",1,2);this._nav_ny.ttip=Calendar._TT["NEXT_YEAR"];row=Calendar.createElement("tr",thead);row.className="daynames";if(this.weekNumbers){cell=Calendar.createElement("td",row);cell.className="name wn";cell.innerHTML=Calendar._TT["WK"];}for(var i=7;i>0;--i){cell=Calendar.createElement("td",row);if(!i){cell.navtype=100;cell.calendar=this;Calendar._add_evs(cell);}}this.firstdayname=(this.weekNumbers)?row.firstChild.nextSibling:row.firstChild;this._displayWeekdays();var tbody=Calendar.createElement("tbody",table);this.tbody=tbody;for(i=6;i>0;--i){row=Calendar.createElement("tr",tbody);if(this.weekNumbers){cell=Calendar.createElement("td",row);}for(var j=7;j>0;--j){cell=Calendar.createElement("td",row);cell.calendar=this;Calendar._add_evs(cell);}}if(this.showsTime){row=Calendar.createElement("tr",tbody);row.className="time";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;cell.innerHTML=Calendar._TT["TIME"]||"&nbsp;";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=this.weekNumbers?4:3;(function(){function makeTimePart(className,init,range_start,range_end){var part=Calendar.createElement("span",cell);part.className=className;part.innerHTML=init;part.calendar=cal;part.ttip=Calendar._TT["TIME_PART"];part.navtype=50;part._range=[];if(typeof range_start!="number")part._range=range_start;else{for(var i=range_start;i<=range_end;++i){var txt;if(i<10&&range_end>=10)txt='0'+i;else txt=''+i;part._range[part._range.length]=txt;}}Calendar._add_evs(part);return part;};var hrs=cal.date.getHours();var mins=cal.date.getMinutes();var t12=!cal.time24;var pm=(hrs>12);if(t12&&pm)hrs-=12;var H=makeTimePart("hour",hrs,t12?1:0,t12?12:23);var span=Calendar.createElement("span",cell);span.innerHTML=":";span.className="colon";var M=makeTimePart("minute",mins,0,59);var AP=null;cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;if(t12)AP=makeTimePart("ampm",pm?"pm":"am",["am","pm"]);else cell.innerHTML="&nbsp;";cal.onSetTime=function(){var pm,hrs=this.date.getHours(),mins=this.date.getMinutes();if(t12){pm=(hrs>=12);if(pm)hrs-=12;if(hrs==0)hrs=12;AP.innerHTML=pm?"pm":"am";}H.innerHTML=(hrs<10)?("0"+hrs):hrs;M.innerHTML=(mins<10)?("0"+mins):mins;};cal.onUpdateTime=function(){var date=this.date;var h=parseInt(H.innerHTML,10);if(t12){if(/pm/i.test(AP.innerHTML)&&h<12)h+=12;else if(/am/i.test(AP.innerHTML)&&h==12)h=0;}var d=date.getDate();var m=date.getMonth();var y=date.getFullYear();date.setHours(h);date.setMinutes(parseInt(M.innerHTML,10));date.setFullYear(y);date.setMonth(m);date.setDate(d);this.dateClicked=false;this.callHandler();};})();}else{this.onSetTime=this.onUpdateTime=function(){};}var tfoot=Calendar.createElement("tfoot",table);row=Calendar.createElement("tr",tfoot);row.className="footrow";cell=hh(Calendar._TT["SEL_DATE"],this.weekNumbers?8:7,300);cell.className="ttip";if(this.isPopup){cell.ttip=Calendar._TT["DRAG_TO_MOVE"];cell.style.cursor="move";}this.tooltips=cell;div=Calendar.createElement("div",this.element);this.monthsCombo=div;div.className="combo";for(i=0;i<Calendar._MN.length;++i){var mn=Calendar.createElement("div");mn.className=Calendar.is_ie?"label-IEfix":"label";mn.month=i;mn.innerHTML=Calendar._SMN[i];div.appendChild(mn);}div=Calendar.createElement("div",this.element);this.yearsCombo=div;div.className="combo";for(i=12;i>0;--i){var yr=Calendar.createElement("div");yr.className=Calendar.is_ie?"label-IEfix":"label";div.appendChild(yr);}this._init(this.firstDayOfWeek,this.date);parent.appendChild(this.element);};Calendar._keyEvent=function(ev){var cal=window._dynarch_popupCalendar;if(!cal||cal.multiple)return false;(Calendar.is_ie)&&(ev=window.event);var act=(Calendar.is_ie||ev.type=="keypress"),K=ev.keyCode;if(ev.ctrlKey){switch(K){case 37:act&&Calendar.cellClick(cal._nav_pm);break;case 38:act&&Calendar.cellClick(cal._nav_py);break;case 39:act&&Calendar.cellClick(cal._nav_nm);break;case 40:act&&Calendar.cellClick(cal._nav_ny);break;default:return false;}}else switch(K){case 32:Calendar.cellClick(cal._nav_now);break;case 27:act&&cal.callCloseHandler();break;case 37:case 38:case 39:case 40:if(act){var prev,x,y,ne,el,step;prev=K==37||K==38;step=(K==37||K==39)?1:7;function setVars(){el=cal.currentDateEl;var p=el.pos;x=p&15;y=p>>4;ne=cal.ar_days[y][x];};setVars();function prevMonth(){var date=new Date(cal.date);date.setDate(date.getDate()-step);cal.setDate(date);};function nextMonth(){var date=new Date(cal.date);date.setDate(date.getDate()+step);cal.setDate(date);};while(1){switch(K){case 37:if(--x>=0)ne=cal.ar_days[y][x];else{x=6;K=38;continue;}break;case 38:if(--y>=0)ne=cal.ar_days[y][x];else{prevMonth();setVars();}break;case 39:if(++x<7)ne=cal.ar_days[y][x];else{x=0;K=40;continue;}break;case 40:if(++y<cal.ar_days.length)ne=cal.ar_days[y][x];else{nextMonth();setVars();}break;}break;}if(ne){if(!ne.disabled)Calendar.cellClick(ne);else if(prev)prevMonth();else nextMonth();}}break;case 13:if(act)Calendar.cellClick(cal.currentDateEl,ev);break;default:return false;}return Calendar.stopEvent(ev);};Calendar.prototype._init=function(firstDayOfWeek,date){var today=new Date(),TY=today.getFullYear(),TM=today.getMonth(),TD=today.getDate();this.table.style.visibility="hidden";var year=date.getFullYear();if(year<this.minYear){year=this.minYear;date.setFullYear(year);}else if(year>this.maxYear){year=this.maxYear;date.setFullYear(year);}this.firstDayOfWeek=firstDayOfWeek;this.date=new Date(date);var month=date.getMonth();var mday=date.getDate();var no_days=date.getMonthDays();date.setDate(1);var day1=(date.getDay()-this.firstDayOfWeek)%7;if(day1<0)day1+=7;date.setDate(-day1);date.setDate(date.getDate()+1);var row=this.tbody.firstChild;var MN=Calendar._SMN[month];var ar_days=this.ar_days=new Array();var weekend=Calendar._TT["WEEKEND"];var dates=this.multiple?(this.datesCells={}):null;for(var i=0;i<6;++i,row=row.nextSibling){var cell=row.firstChild;if(this.weekNumbers){cell.className="day wn";cell.innerHTML=date.getWeekNumber();cell=cell.nextSibling;}row.className="daysrow";var hasdays=false,iday,dpos=ar_days[i]=[];for(var j=0;j<7;++j,cell=cell.nextSibling,date.setDate(iday+1)){iday=date.getDate();var wday=date.getDay();cell.className="day";cell.pos=i<<4|j;dpos[j]=cell;var current_month=(date.getMonth()==month);if(!current_month){if(this.showsOtherMonths){cell.className+=" othermonth";cell.otherMonth=true;}else{cell.className="emptycell";cell.innerHTML="&nbsp;";cell.disabled=true;continue;}}else{cell.otherMonth=false;hasdays=true;}cell.disabled=false;cell.innerHTML=this.getDateText?this.getDateText(date,iday):iday;if(dates)dates[date.print("%Y%m%d")]=cell;if(this.getDateStatus){var status=this.getDateStatus(date,year,month,iday);if(this.getDateToolTip){var toolTip=this.getDateToolTip(date,year,month,iday);if(toolTip)cell.title=toolTip;}if(status===true){cell.className+=" disabled";cell.disabled=true;}else{if(/disabled/i.test(status))cell.disabled=true;cell.className+=" "+status;}}if(!cell.disabled){cell.caldate=new Date(date);cell.ttip="_";if(!this.multiple&&current_month&&iday==mday&&this.hiliteToday){cell.className+=" selected";this.currentDateEl=cell;}if(date.getFullYear()==TY&&date.getMonth()==TM&&iday==TD){cell.className+=" today";cell.ttip+=Calendar._TT["PART_TODAY"];}if(weekend.indexOf(wday.toString())!=-1)cell.className+=cell.otherMonth?" oweekend":" weekend";}}if(!(hasdays||this.showsOtherMonths))row.className="emptyrow";}this.title.innerHTML=Calendar._MN[month]+", "+year;this.onSetTime();this.table.style.visibility="visible";this._initMultipleDates();};Calendar.prototype._initMultipleDates=function(){if(this.multiple){for(var i in this.multiple){var cell=this.datesCells[i];var d=this.multiple[i];if(!d)continue;if(cell)cell.className+=" selected";}}};Calendar.prototype._toggleMultipleDate=function(date){if(this.multiple){var ds=date.print("%Y%m%d");var cell=this.datesCells[ds];if(cell){var d=this.multiple[ds];if(!d){Calendar.addClass(cell,"selected");this.multiple[ds]=date;}else{Calendar.removeClass(cell,"selected");delete this.multiple[ds];}}}};Calendar.prototype.setDateToolTipHandler=function(unaryFunction){this.getDateToolTip=unaryFunction;};Calendar.prototype.setDate=function(date){if(!date.equalsTo(this.date)){this._init(this.firstDayOfWeek,date);}};Calendar.prototype.refresh=function(){this._init(this.firstDayOfWeek,this.date);};Calendar.prototype.setFirstDayOfWeek=function(firstDayOfWeek){this._init(firstDayOfWeek,this.date);this._displayWeekdays();};Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(unaryFunction){this.getDateStatus=unaryFunction;};Calendar.prototype.setRange=function(a,z){this.minYear=a;this.maxYear=z;};Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.date.print(this.dateFormat));}};Calendar.prototype.callCloseHandler=function(){if(this.onClose){this.onClose(this);}this.hideShowCovered();};Calendar.prototype.destroy=function(){var el=this.element.parentNode;el.removeChild(this.element);Calendar._C=null;window._dynarch_popupCalendar=null;};Calendar.prototype.reparent=function(new_parent){var el=this.element;el.parentNode.removeChild(el);new_parent.appendChild(el);};Calendar._checkCalendar=function(ev){var calendar=window._dynarch_popupCalendar;if(!calendar){return false;}var el=Calendar.is_ie?Calendar.getElement(ev):Calendar.getTargetElement(ev);for(;el!=null&&el!=calendar.element;el=el.parentNode);if(el==null){window._dynarch_popupCalendar.callCloseHandler();return Calendar.stopEvent(ev);}};Calendar.prototype.show=function(){var rows=this.table.getElementsByTagName("tr");for(var i=rows.length;i>0;){var row=rows[--i];Calendar.removeClass(row,"rowhilite");var cells=row.getElementsByTagName("td");for(var j=cells.length;j>0;){var cell=cells[--j];Calendar.removeClass(cell,"hilite");Calendar.removeClass(cell,"active");}}this.element.style.display="block";this.hidden=false;if(this.isPopup){window._dynarch_popupCalendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document,"mousedown",Calendar._checkCalendar);}this.hideShowCovered();};Calendar.prototype.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar);}this.element.style.display="none";this.hidden=true;this.hideShowCovered();};Calendar.prototype.showAt=function(x,y){var s=this.element.style;s.left=x+"px";s.top=y+"px";this.show();};Calendar.prototype.showAtElement=function(el,opts){var self=this;var p=Calendar.getAbsolutePos(el);if(!opts||typeof opts!="string"){this.showAt(p.x,p.y+el.offsetHeight);return true;}function fixPosition(box){if(box.x<0)box.x=0;if(box.y<0)box.y=0;var cp=document.createElement("div");var s=cp.style;s.position="absolute";s.right=s.bottom=s.width=s.height="0px";document.body.appendChild(cp);var br=Calendar.getAbsolutePos(cp);document.body.removeChild(cp);if(Calendar.is_ie){br.y+=document.body.scrollTop;br.x+=document.body.scrollLeft;}else{br.y+=window.scrollY;br.x+=window.scrollX;}var tmp=box.x+box.width-br.x;if(tmp>0)box.x-=tmp;tmp=box.y+box.height-br.y;if(tmp>0)box.y-=tmp;};this.element.style.display="block";Calendar.continuation_for_the_fucking_khtml_browser=function(){var w=self.element.offsetWidth;var h=self.element.offsetHeight;self.element.style.display="none";var valign=opts.substr(0,1);var halign="l";if(opts.length>1){halign=opts.substr(1,1);}switch(valign){case "T":p.y-=h;break;case "B":p.y+=el.offsetHeight;break;case "C":p.y+=(el.offsetHeight-h)/2;break;case "t":p.y+=el.offsetHeight-h;break;case "b":break;}switch(halign){case "L":p.x-=w;break;case "R":p.x+=el.offsetWidth;break;case "C":p.x+=(el.offsetWidth-w)/2;break;case "l":p.x+=el.offsetWidth-w;break;case "r":break;}p.width=w;p.height=h+40;self.monthsCombo.style.display="none";fixPosition(p);self.showAt(p.x,p.y);};if(Calendar.is_khtml)setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()",10);else Calendar.continuation_for_the_fucking_khtml_browser();};Calendar.prototype.setDateFormat=function(str){this.dateFormat=str;};Calendar.prototype.setTtDateFormat=function(str){this.ttDateFormat=str;};Calendar.prototype.parseDate=function(str,fmt){if(!fmt)fmt=this.dateFormat;this.setDate(Date.parseDate(str,fmt));};Calendar.prototype.hideShowCovered=function(){if(!Calendar.is_ie&&!Calendar.is_opera)return;function getVisib(obj){var value=obj.style.visibility;if(!value){if(document.defaultView&&typeof(document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml)value=document.defaultView. getComputedStyle(obj,"").getPropertyValue("visibility");else value='';}else if(obj.currentStyle){value=obj.currentStyle.visibility;}else value='';}return value;};var tags=new Array("applet","iframe","select");var el=this.element;var p=Calendar.getAbsolutePos(el);var EX1=p.x;var EX2=el.offsetWidth+EX1;var EY1=p.y;var EY2=el.offsetHeight+EY1;for(var k=tags.length;k>0;){var ar=document.getElementsByTagName(tags[--k]);var cc=null;for(var i=ar.length;i>0;){cc=ar[--i];p=Calendar.getAbsolutePos(cc);var CX1=p.x;var CX2=cc.offsetWidth+CX1;var CY1=p.y;var CY2=cc.offsetHeight+CY1;if(this.hidden||(CX1>EX2)||(CX2<EX1)||(CY1>EY2)||(CY2<EY1)){if(!cc.__msh_save_visibility){cc.__msh_save_visibility=getVisib(cc);}cc.style.visibility=cc.__msh_save_visibility;}else{if(!cc.__msh_save_visibility){cc.__msh_save_visibility=getVisib(cc);}cc.style.visibility="hidden";}}}};Calendar.prototype._displayWeekdays=function(){var fdow=this.firstDayOfWeek;var cell=this.firstdayname;var weekend=Calendar._TT["WEEKEND"];for(var i=0;i<7;++i){cell.className="day name";var realday=(i+fdow)%7;if(i){cell.ttip=Calendar._TT["DAY_FIRST"].replace("%s",Calendar._DN[realday]);cell.navtype=100;cell.calendar=this;cell.fdow=realday;Calendar._add_evs(cell);}if(weekend.indexOf(realday.toString())!=-1){Calendar.addClass(cell,"weekend");}cell.innerHTML=Calendar._SDN[(i+fdow)%7];cell=cell.nextSibling;}};Calendar.prototype._hideCombos=function(){this.monthsCombo.style.display="none";this.yearsCombo.style.display="none";};Calendar.prototype._dragStart=function(ev){if(this.dragging){return;}this.dragging=true;var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft;}else{posY=ev.clientY+window.scrollY;posX=ev.clientX+window.scrollX;}var st=this.element.style;this.xOffs=posX-parseInt(st.left);this.yOffs=posY-parseInt(st.top);with(Calendar){addEvent(document,"mousemove",calDragIt);addEvent(document,"mouseup",calDragEnd);}};Date._MD=new Array(31,28,31,30,31,30,31,31,30,31,30,31);Date.SECOND=1000;Date.MINUTE=60*Date.SECOND;Date.HOUR=60*Date.MINUTE;Date.DAY=24*Date.HOUR;Date.WEEK=7*Date.DAY;Date.parseDate=function(str,fmt){var today=new Date();var y=0;var m=-1;var d=0;var a=str.split(/\W+/);var b=fmt.match(/%./g);var i=0,j=0;var hr=0;var min=0;for(i=0;i<a.length;++i){if(!a[i])continue;switch(b[i]){case "%d":case "%e":d=parseInt(a[i],10);break;case "%m":m=parseInt(a[i],10)-1;break;case "%Y":case "%y":y=parseInt(a[i],10);(y<100)&&(y+=(y>29)?1900:2000);break;case "%b":case "%B":for(j=0;j<12;++j){if(Calendar._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){m=j;break;}}break;case "%H":case "%I":case "%k":case "%l":hr=parseInt(a[i],10);break;case "%P":case "%p":if(/pm/i.test(a[i])&&hr<12)hr+=12;else if(/am/i.test(a[i])&&hr>=12)hr-=12;break;case "%M":min=parseInt(a[i],10);break;}}if(isNaN(y))y=today.getFullYear();if(isNaN(m))m=today.getMonth();if(isNaN(d))d=today.getDate();if(isNaN(hr))hr=today.getHours();if(isNaN(min))min=today.getMinutes();if(y!=0&&m!=-1&&d!=0)return new Date(y,m,d,hr,min,0);y=0;m=-1;d=0;for(i=0;i<a.length;++i){if(a[i].search(/[a-zA-Z]+/)!=-1){var t=-1;for(j=0;j<12;++j){if(Calendar._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){t=j;break;}}if(t!=-1){if(m!=-1){d=m+1;}m=t;}}else if(parseInt(a[i],10)<=12&&m==-1){m=a[i]-1;}else if(parseInt(a[i],10)>31&&y==0){y=parseInt(a[i],10);(y<100)&&(y+=(y>29)?1900:2000);}else if(d==0){d=a[i];}}if(y==0)y=today.getFullYear();if(m!=-1&&d!=0)return new Date(y,m,d,hr,min,0);return today;};Date.prototype.getMonthDays=function(month){var year=this.getFullYear();if(typeof month=="undefined"){month=this.getMonth();}if(((0==(year%4))&&((0!=(year%100))||(0==(year%400))))&&month==1){return 29;}else{return Date._MD[month];}};Date.prototype.getDayOfYear=function(){var now=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var then=new Date(this.getFullYear(),0,0,0,0,0);var time=now-then;return Math.floor(time/Date.DAY);};Date.prototype.getWeekNumber=function(){var d=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var DoW=d.getDay();d.setDate(d.getDate()-(DoW+6)%7+3);var ms=d.valueOf();d.setMonth(0);d.setDate(4);return Math.round((ms-d.valueOf())/(7*864e5))+1;};Date.prototype.equalsTo=function(date){return((this.getFullYear()==date.getFullYear())&&(this.getMonth()==date.getMonth())&&(this.getDate()==date.getDate())&&(this.getHours()==date.getHours())&&(this.getMinutes()==date.getMinutes()));};Date.prototype.setDateOnly=function(date){var tmp=new Date(date);this.setDate(1);this.setFullYear(tmp.getFullYear());this.setMonth(tmp.getMonth());this.setDate(tmp.getDate());};Date.prototype.print=function(str){var m=this.getMonth();var d=this.getDate();var y=this.getFullYear();var wn=this.getWeekNumber();var w=this.getDay();var s={};var hr=this.getHours();var pm=(hr>=12);var ir=(pm)?(hr-12):hr;var dy=this.getDayOfYear();if(ir==0)ir=12;var min=this.getMinutes();var sec=this.getSeconds();s["%a"]=Calendar._SDN[w];s["%A"]=Calendar._DN[w];s["%b"]=Calendar._SMN[m];s["%B"]=Calendar._MN[m];s["%C"]=1+Math.floor(y/100);s["%d"]=(d<10)?("0"+d):d;s["%e"]=d;s["%H"]=(hr<10)?("0"+hr):hr;s["%I"]=(ir<10)?("0"+ir):ir;s["%j"]=(dy<100)?((dy<10)?("00"+dy):("0"+dy)):dy;s["%k"]=hr;s["%l"]=ir;s["%m"]=(m<9)?("0"+(1+m)):(1+m);s["%M"]=(min<10)?("0"+min):min;s["%n"]="\n";s["%p"]=pm?"PM":"AM";s["%P"]=pm?"pm":"am";s["%s"]=Math.floor(this.getTime()/1000);s["%S"]=(sec<10)?("0"+sec):sec;s["%t"]="\t";s["%U"]=s["%W"]=s["%V"]=(wn<10)?("0"+wn):wn;s["%u"]=w+1;s["%w"]=w;s["%y"]=(''+y).substr(2,2);s["%Y"]=y;s["%%"]="%";var re=/%./g;if(!Calendar.is_ie5&&!Calendar.is_khtml)return str.replace(re,function(par){return s[par]||par;});var a=str.match(re);for(var i=0;i<a.length;i++){var tmp=s[a[i]];if(tmp){re=new RegExp(a[i],'g');str=str.replace(re,tmp);}}return str;};Date.prototype.__msh_oldSetFullYear=Date.prototype.setFullYear;Date.prototype.setFullYear=function(y){var d=new Date(this);d.__msh_oldSetFullYear(y);if(d.getMonth()!=this.getMonth())this.setDate(28);this.__msh_oldSetFullYear(y);};window._dynarch_popupCalendar=null;
1
+ /* Copyright Mihai Bazon, 2002-2005 | www.bazon.net/mishoo
2
+ * -----------------------------------------------------------
3
+ *
4
+ * The DHTML Calendar, version 1.0 "It is happening again"
5
+ *
6
+ * Details and latest version at:
7
+ * www.dynarch.com/projects/calendar
8
+ *
9
+ * This script is developed by Dynarch.com. Visit us at www.dynarch.com.
10
+ *
11
+ * This script is distributed under the GNU Lesser General Public License.
12
+ * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
13
+ */
14
+ Calendar=function(firstDayOfWeek,dateStr,onSelected,onClose){
15
+ Calendar._DN = new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday");Calendar._SDN = new Array ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"); Calendar._FD = 0; Calendar._MN = new Array ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); Calendar._SMN = new Array ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");Calendar._TT = {};Calendar._TT["INFO"] = "About the Calendar";
16
+ Calendar._TT["ABOUT"] =
17
+ "DHTML Date/Time Selector\n" +
18
+ "(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" +
19
+ "For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
20
+ "Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." +
21
+ "\n\n" +
22
+ "Date selection:\n" +
23
+ "- Use the \xab, \xbb buttons to select year\n" +
24
+ "- Use the " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " buttons to select month\n" +
25
+ "- Hold mouse button on any of the above buttons for faster selection.";
26
+ Calendar._TT["ABOUT_TIME"] = "\n\n" +
27
+ "Time selection:\n" +
28
+ "- Click on any of the time parts to increase it\n" +
29
+ "- or Shift-click to decrease it\n" +
30
+ "- or click and drag for faster selection.";
31
+
32
+ Calendar._TT["PREV_YEAR"] = "Click to move to the previous year. Click and hold for a list of years.";Calendar._TT["PREV_MONTH"] = "Click to move to the previous month. Click and hold for a list of the months."; Calendar._TT["GO_TODAY"] = "Go to today";Calendar._TT["NEXT_MONTH"] = "Click to move to the next month. Click and hold for a list of the months.";Calendar._TT["NEXT_YEAR"] = "Click to move to the next year. Click and hold for a list of years.";Calendar._TT["SEL_DATE"] = "Select a date.";Calendar._TT["DRAG_TO_MOVE"] = "Drag to move";Calendar._TT["PART_TODAY"] = " (Today)";Calendar._TT["DAY_FIRST"] = "Display %s first";Calendar._TT["WEEKEND"] = "0,6";Calendar._TT["CLOSE"] = "Close";Calendar._TT["TODAY"] = "Today";Calendar._TT["TIME_PART"] = "(Shift-)Click or Drag to change the value.";Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; Calendar._TT["TT_DATE_FORMAT"] = "%A, %B %e";Calendar._TT["WK"] = "wk";Calendar._TT["TIME"] = "Time:";
33
+
34
+
35
+
36
  this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=onSelected||null;this.onClose=onClose||null;this.dragging=false;this.hidden=false;this.minYear=1970;this.maxYear=2050;this.dateFormat=Calendar._TT["DEF_DATE_FORMAT"];this.ttDateFormat=Calendar._TT["TT_DATE_FORMAT"];this.isPopup=true;this.weekNumbers=true;this.firstDayOfWeek=typeof firstDayOfWeek=="number"?firstDayOfWeek:Calendar._FD;this.showsOtherMonths=false;this.dateStr=dateStr;this.ar_days=null;this.showsTime=false;this.time24=true;this.yearStep=2;this.hiliteToday=true;this.multiple=null;this.table=null;this.element=null;this.tbody=null;this.firstdayname=null;this.monthsCombo=null;this.yearsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.hilitedYear=null;this.activeYear=null;this.dateClicked=false;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined")Calendar._SDN_len=3;var ar=new Array();for(var i=8;i>0;){ar[--i]=Calendar._DN[i].substr(0,Calendar._SDN_len);}Calendar._SDN=ar;if(typeof Calendar._SMN_len=="undefined")Calendar._SMN_len=3;ar=new Array();for(var i=12;i>0;){ar[--i]=Calendar._MN[i].substr(0,Calendar._SMN_len);}Calendar._SMN=ar;}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos=function(el){var SL=0,ST=0;var is_div=/^div$/i.test(el.tagName);if(is_div&&el.scrollLeft)SL=el.scrollLeft;if(is_div&&el.scrollTop)ST=el.scrollTop;var r={x:el.offsetLeft-SL,y:el.offsetTop-ST};if(el.offsetParent){var tmp=this.getAbsolutePos(el.offsetParent);r.x+=tmp.x;r.y+=tmp.y;}return r;};Calendar.isRelated=function(el,evt){var related=evt.relatedTarget;if(!related){var type=evt.type;if(type=="mouseover"){related=evt.fromElement;}else if(type=="mouseout"){related=evt.toElement;}}while(related){if(related==el){return true;}related=related.parentNode;}return false;};Calendar.removeClass=function(el,className){if(!(el&&el.className)){return;}var cls=el.className.split(" ");var ar=new Array();for(var i=cls.length;i>0;){if(cls[--i]!=className){ar[ar.length]=cls[i];}}el.className=ar.join(" ");};Calendar.addClass=function(el,className){Calendar.removeClass(el,className);el.className+=" "+className;};Calendar.getElement=function(ev){var f=Calendar.is_ie?window.event.srcElement:ev.currentTarget;while(f.nodeType!=1||/^div$/i.test(f.tagName))f=f.parentNode;return f;};Calendar.getTargetElement=function(ev){var f=Calendar.is_ie?window.event.srcElement:ev.target;while(f.nodeType!=1)f=f.parentNode;return f;};Calendar.stopEvent=function(ev){ev||(ev=window.event);if(Calendar.is_ie){ev.cancelBubble=true;ev.returnValue=false;}else{ev.preventDefault();ev.stopPropagation();}return false;};Calendar.addEvent=function(el,evname,func){if(el.attachEvent){el.attachEvent("on"+evname,func);}else if(el.addEventListener){el.addEventListener(evname,func,true);}else{el["on"+evname]=func;}};Calendar.removeEvent=function(el,evname,func){if(el.detachEvent){el.detachEvent("on"+evname,func);}else if(el.removeEventListener){el.removeEventListener(evname,func,true);}else{el["on"+evname]=null;}};Calendar.createElement=function(type,parent){var el=null;if(document.createElementNS){el=document.createElementNS("http://www.w3.org/1999/xhtml",type);}else{el=document.createElement(type);}if(typeof parent!="undefined"){parent.appendChild(el);}return el;};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true);}}};Calendar.findMonth=function(el){if(typeof el.month!="undefined"){return el;}else if(typeof el.parentNode.month!="undefined"){return el.parentNode;}return null;};Calendar.findYear=function(el){if(typeof el.year!="undefined"){return el;}else if(typeof el.parentNode.year!="undefined"){return el.parentNode;}return null;};Calendar.showMonthsCombo=function(){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var mc=cal.monthsCombo;if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}if(cal.activeMonth){Calendar.removeClass(cal.activeMonth,"active");}var mon=cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()];Calendar.addClass(mon,"active");cal.activeMonth=mon;var s=mc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else{var mcw=mc.offsetWidth;if(typeof mcw=="undefined")mcw=50;s.left=(cd.offsetLeft+cd.offsetWidth-mcw)+"px";}s.top=(cd.offsetTop+cd.offsetHeight)+"px";};Calendar.showYearsCombo=function(fwd){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var yc=cal.yearsCombo;if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}if(cal.activeYear){Calendar.removeClass(cal.activeYear,"active");}cal.activeYear=null;var Y=cal.date.getFullYear()+(fwd?1:-1);var yr=yc.firstChild;var show=false;for(var i=12;i>0;--i){if(Y>=cal.minYear&&Y<=cal.maxYear){yr.innerHTML=Y;yr.year=Y;yr.style.display="block";show=true;}else{yr.style.display="none";}yr=yr.nextSibling;Y+=fwd?cal.yearStep:-cal.yearStep;}if(show){var s=yc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else{var ycw=yc.offsetWidth;if(typeof ycw=="undefined")ycw=50;s.left=(cd.offsetLeft+cd.offsetWidth-ycw)+"px";}s.top=(cd.offsetTop+cd.offsetHeight)+"px";}};Calendar.tableMouseUp=function(ev){var cal=Calendar._C;if(!cal){return false;}if(cal.timeout){clearTimeout(cal.timeout);}var el=cal.activeDiv;if(!el){return false;}var target=Calendar.getTargetElement(ev);ev||(ev=window.event);Calendar.removeClass(el,"active");if(target==el||target.parentNode==el){Calendar.cellClick(el,ev);}var mon=Calendar.findMonth(target);var date=null;if(mon){date=new Date(cal.date);if(mon.month!=date.getMonth()){date.setMonth(mon.month);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}else{var year=Calendar.findYear(target);if(year){date=new Date(cal.date);if(year.year!=date.getFullYear()){date.setFullYear(year.year);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}}with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);cal._hideCombos();_C=null;return stopEvent(ev);}};Calendar.tableMouseOver=function(ev){var cal=Calendar._C;if(!cal){return;}var el=cal.activeDiv;var target=Calendar.getTargetElement(ev);if(target==el||target.parentNode==el){Calendar.addClass(el,"hilite active");Calendar.addClass(el.parentNode,"rowhilite");}else{if(typeof el.navtype=="undefined"||(el.navtype!=50&&(el.navtype==0||Math.abs(el.navtype)>2)))Calendar.removeClass(el,"active");Calendar.removeClass(el,"hilite");Calendar.removeClass(el.parentNode,"rowhilite");}ev||(ev=window.event);if(el.navtype==50&&target!=el){var pos=Calendar.getAbsolutePos(el);var w=el.offsetWidth;var x=ev.clientX;var dx;var decrease=true;if(x>pos.x+w){dx=x-pos.x-w;decrease=false;}else dx=pos.x-x;if(dx<0)dx=0;var range=el._range;var current=el._current;var count=Math.floor(dx/10)%range.length;for(var i=range.length;--i>=0;)if(range[i]==current)break;while(count-->0)if(decrease){if(--i<0)i=range.length-1;}else if(++i>=range.length)i=0;var newval=range[i];el.innerHTML=newval;cal.onUpdateTime();}var mon=Calendar.findMonth(target);if(mon){if(mon.month!=cal.date.getMonth()){if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}Calendar.addClass(mon,"hilite");cal.hilitedMonth=mon;}else if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}}else{if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}var year=Calendar.findYear(target);if(year){if(year.year!=cal.date.getFullYear()){if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}Calendar.addClass(year,"hilite");cal.hilitedYear=year;}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}return Calendar.stopEvent(ev);};Calendar.tableMouseDown=function(ev){if(Calendar.getTargetElement(ev)==Calendar.getElement(ev)){return Calendar.stopEvent(ev);}};Calendar.calDragIt=function(ev){var cal=Calendar._C;if(!(cal&&cal.dragging)){return false;}var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft;}else{posX=ev.pageX;posY=ev.pageY;}cal.hideShowCovered();var st=cal.element.style;st.left=(posX-cal.xOffs)+"px";st.top=(posY-cal.yOffs)+"px";return Calendar.stopEvent(ev);};Calendar.calDragEnd=function(ev){var cal=Calendar._C;if(!cal){return false;}cal.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(ev);}cal.hideShowCovered();};Calendar.dayMouseDown=function(ev){var el=Calendar.getElement(ev);if(el.disabled){return false;}var cal=el.calendar;cal.activeDiv=el;Calendar._C=cal;if(el.navtype!=300)with(Calendar){if(el.navtype==50){el._current=el.innerHTML;addEvent(document,"mousemove",tableMouseOver);}else addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver);addClass(el,"hilite active");addEvent(document,"mouseup",tableMouseUp);}else if(cal.isPopup){cal._dragStart(ev);}if(el.navtype==-1||el.navtype==1){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout("Calendar.showMonthsCombo()",250);}else if(el.navtype==-2||el.navtype==2){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250);}else{cal.timeout=null;}return Calendar.stopEvent(ev);};Calendar.dayMouseDblClick=function(ev){Calendar.cellClick(Calendar.getElement(ev),ev||window.event);if(Calendar.is_ie){document.selection.empty();}};Calendar.dayMouseOver=function(ev){var el=Calendar.getElement(ev);if(Calendar.isRelated(el,ev)||Calendar._C||el.disabled){return false;}if(el.ttip){if(el.ttip.substr(0,1)=="_"){el.ttip=el.caldate.print(el.calendar.ttDateFormat)+el.ttip.substr(1);}el.calendar.tooltips.innerHTML=el.ttip;}if(el.navtype!=300){Calendar.addClass(el,"hilite");if(el.caldate){Calendar.addClass(el.parentNode,"rowhilite");}}return Calendar.stopEvent(ev);};Calendar.dayMouseOut=function(ev){with(Calendar){var el=getElement(ev);if(isRelated(el,ev)||_C||el.disabled)return false;removeClass(el,"hilite");if(el.caldate)removeClass(el.parentNode,"rowhilite");if(el.calendar)el.calendar.tooltips.innerHTML=_TT["SEL_DATE"];return stopEvent(ev);}};Calendar.cellClick=function(el,ev){var cal=el.calendar;var closing=false;var newdate=false;var date=null;if(typeof el.navtype=="undefined"){if(cal.currentDateEl){Calendar.removeClass(cal.currentDateEl,"selected");Calendar.addClass(el,"selected");closing=(cal.currentDateEl==el);if(!closing){cal.currentDateEl=el;}}cal.date.setDateOnly(el.caldate);date=cal.date;var other_month=!(cal.dateClicked=!el.otherMonth);if(!other_month&&!cal.currentDateEl)cal._toggleMultipleDate(new Date(date));else newdate=!el.disabled;if(other_month)cal._init(cal.firstDayOfWeek,date);}else{if(el.navtype==200){Calendar.removeClass(el,"hilite");cal.callCloseHandler();return;}date=new Date(cal.date);if(el.navtype==0)date.setDateOnly(new Date());cal.dateClicked=false;var year=date.getFullYear();var mon=date.getMonth();function setMonth(m){var day=date.getDate();var max=date.getMonthDays(m);if(day>max){date.setDate(max);}date.setMonth(m);};switch(el.navtype){case 400:Calendar.removeClass(el,"hilite");var text=Calendar._TT["ABOUT"];if(typeof text!="undefined"){text+=cal.showsTime?Calendar._TT["ABOUT_TIME"]:"";}else{text="Help and about box text is not translated into this language.\n"+"If you know this language and you feel generous please update\n"+"the corresponding file in \"lang\" subdir to match calendar-en.js\n"+"and send it back to <mihai_bazon@yahoo.com> to get it into the distribution ;-)\n\n"+"Thank you!\n"+"http://dynarch.com/mishoo/calendar.epl\n";}alert(text);return;case-2:if(year>cal.minYear){date.setFullYear(year-1);}break;case-1:if(mon>0){setMonth(mon-1);}else if(year-->cal.minYear){date.setFullYear(year);setMonth(11);}break;case 1:if(mon<11){setMonth(mon+1);}else if(year<cal.maxYear){date.setFullYear(year+1);setMonth(0);}break;case 2:if(year<cal.maxYear){date.setFullYear(year+1);}break;case 100:cal.setFirstDayOfWeek(el.fdow);return;case 50:var range=el._range;var current=el.innerHTML;for(var i=range.length;--i>=0;)if(range[i]==current)break;if(ev&&ev.shiftKey){if(--i<0)i=range.length-1;}else if(++i>=range.length)i=0;var newval=range[i];el.innerHTML=newval;cal.onUpdateTime();return;case 0:if((typeof cal.getDateStatus=="function")&&cal.getDateStatus(date,date.getFullYear(),date.getMonth(),date.getDate())){return false;}break;}if(!date.equalsTo(cal.date)){cal.setDate(date);newdate=true;}else if(el.navtype==0)newdate=closing=true;}if(newdate){ev&&cal.callHandler();}if(closing){Calendar.removeClass(el,"hilite");ev&&cal.callCloseHandler();}};Calendar.prototype.create=function(_par){var parent=null;if(!_par){parent=document.getElementsByTagName("body")[0];this.isPopup=true;}else{parent=_par;this.isPopup=false;}this.date=this.dateStr?new Date(this.dateStr):new Date();var table=Calendar.createElement("table");this.table=table;table.cellSpacing=0;table.cellPadding=0;table.calendar=this;Calendar.addEvent(table,"mousedown",Calendar.tableMouseDown);var div=Calendar.createElement("div");this.element=div;div.className="calendar";if(this.isPopup){div.style.position="absolute";div.style.display="none";}div.appendChild(table);var thead=Calendar.createElement("thead",table);var cell=null;var row=null;var cal=this;var hh=function(text,cs,navtype){cell=Calendar.createElement("td",row);cell.colSpan=cs;cell.className="button";if(navtype!=0&&Math.abs(navtype)<=2)cell.className+=" nav";Calendar._add_evs(cell);cell.calendar=cal;cell.navtype=navtype;cell.innerHTML="<div unselectable='on'>"+text+"</div>";return cell;};row=Calendar.createElement("tr",thead);var title_length=6;(this.isPopup)&&--title_length;(this.weekNumbers)&&++title_length;hh("?",1,400).ttip=Calendar._TT["INFO"];this.title=hh("",title_length,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT["DRAG_TO_MOVE"];this.title.style.cursor="move";hh("&#x00d7;",1,200).ttip=Calendar._TT["CLOSE"];}row=Calendar.createElement("tr",thead);row.className="headrow";this._nav_py=hh("&#x00ab;",1,-2);this._nav_py.ttip=Calendar._TT["PREV_YEAR"];this._nav_pm=hh("&#x2039;",1,-1);this._nav_pm.ttip=Calendar._TT["PREV_MONTH"];this._nav_now=hh(Calendar._TT["TODAY"],this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT["GO_TODAY"];this._nav_nm=hh("&#x203a;",1,1);this._nav_nm.ttip=Calendar._TT["NEXT_MONTH"];this._nav_ny=hh("&#x00bb;",1,2);this._nav_ny.ttip=Calendar._TT["NEXT_YEAR"];row=Calendar.createElement("tr",thead);row.className="daynames";if(this.weekNumbers){cell=Calendar.createElement("td",row);cell.className="name wn";cell.innerHTML=Calendar._TT["WK"];}for(var i=7;i>0;--i){cell=Calendar.createElement("td",row);if(!i){cell.navtype=100;cell.calendar=this;Calendar._add_evs(cell);}}this.firstdayname=(this.weekNumbers)?row.firstChild.nextSibling:row.firstChild;this._displayWeekdays();var tbody=Calendar.createElement("tbody",table);this.tbody=tbody;for(i=6;i>0;--i){row=Calendar.createElement("tr",tbody);if(this.weekNumbers){cell=Calendar.createElement("td",row);}for(var j=7;j>0;--j){cell=Calendar.createElement("td",row);cell.calendar=this;Calendar._add_evs(cell);}}if(this.showsTime){row=Calendar.createElement("tr",tbody);row.className="time";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;cell.innerHTML=Calendar._TT["TIME"]||"&nbsp;";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=this.weekNumbers?4:3;(function(){function makeTimePart(className,init,range_start,range_end){var part=Calendar.createElement("span",cell);part.className=className;part.innerHTML=init;part.calendar=cal;part.ttip=Calendar._TT["TIME_PART"];part.navtype=50;part._range=[];if(typeof range_start!="number")part._range=range_start;else{for(var i=range_start;i<=range_end;++i){var txt;if(i<10&&range_end>=10)txt='0'+i;else txt=''+i;part._range[part._range.length]=txt;}}Calendar._add_evs(part);return part;};var hrs=cal.date.getHours();var mins=cal.date.getMinutes();var t12=!cal.time24;var pm=(hrs>12);if(t12&&pm)hrs-=12;var H=makeTimePart("hour",hrs,t12?1:0,t12?12:23);var span=Calendar.createElement("span",cell);span.innerHTML=":";span.className="colon";var M=makeTimePart("minute",mins,0,59);var AP=null;cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;if(t12)AP=makeTimePart("ampm",pm?"pm":"am",["am","pm"]);else cell.innerHTML="&nbsp;";cal.onSetTime=function(){var pm,hrs=this.date.getHours(),mins=this.date.getMinutes();if(t12){pm=(hrs>=12);if(pm)hrs-=12;if(hrs==0)hrs=12;AP.innerHTML=pm?"pm":"am";}H.innerHTML=(hrs<10)?("0"+hrs):hrs;M.innerHTML=(mins<10)?("0"+mins):mins;};cal.onUpdateTime=function(){var date=this.date;var h=parseInt(H.innerHTML,10);if(t12){if(/pm/i.test(AP.innerHTML)&&h<12)h+=12;else if(/am/i.test(AP.innerHTML)&&h==12)h=0;}var d=date.getDate();var m=date.getMonth();var y=date.getFullYear();date.setHours(h);date.setMinutes(parseInt(M.innerHTML,10));date.setFullYear(y);date.setMonth(m);date.setDate(d);this.dateClicked=false;this.callHandler();};})();}else{this.onSetTime=this.onUpdateTime=function(){};}var tfoot=Calendar.createElement("tfoot",table);row=Calendar.createElement("tr",tfoot);row.className="footrow";cell=hh(Calendar._TT["SEL_DATE"],this.weekNumbers?8:7,300);cell.className="ttip";if(this.isPopup){cell.ttip=Calendar._TT["DRAG_TO_MOVE"];cell.style.cursor="move";}this.tooltips=cell;div=Calendar.createElement("div",this.element);this.monthsCombo=div;div.className="combo";for(i=0;i<Calendar._MN.length;++i){var mn=Calendar.createElement("div");mn.className=Calendar.is_ie?"label-IEfix":"label";mn.month=i;mn.innerHTML=Calendar._SMN[i];div.appendChild(mn);}div=Calendar.createElement("div",this.element);this.yearsCombo=div;div.className="combo";for(i=12;i>0;--i){var yr=Calendar.createElement("div");yr.className=Calendar.is_ie?"label-IEfix":"label";div.appendChild(yr);}this._init(this.firstDayOfWeek,this.date);parent.appendChild(this.element);};Calendar._keyEvent=function(ev){var cal=window._dynarch_popupCalendar;if(!cal||cal.multiple)return false;(Calendar.is_ie)&&(ev=window.event);var act=(Calendar.is_ie||ev.type=="keypress"),K=ev.keyCode;if(ev.ctrlKey){switch(K){case 37:act&&Calendar.cellClick(cal._nav_pm);break;case 38:act&&Calendar.cellClick(cal._nav_py);break;case 39:act&&Calendar.cellClick(cal._nav_nm);break;case 40:act&&Calendar.cellClick(cal._nav_ny);break;default:return false;}}else switch(K){case 32:Calendar.cellClick(cal._nav_now);break;case 27:act&&cal.callCloseHandler();break;case 37:case 38:case 39:case 40:if(act){var prev,x,y,ne,el,step;prev=K==37||K==38;step=(K==37||K==39)?1:7;function setVars(){el=cal.currentDateEl;var p=el.pos;x=p&15;y=p>>4;ne=cal.ar_days[y][x];};setVars();function prevMonth(){var date=new Date(cal.date);date.setDate(date.getDate()-step);cal.setDate(date);};function nextMonth(){var date=new Date(cal.date);date.setDate(date.getDate()+step);cal.setDate(date);};while(1){switch(K){case 37:if(--x>=0)ne=cal.ar_days[y][x];else{x=6;K=38;continue;}break;case 38:if(--y>=0)ne=cal.ar_days[y][x];else{prevMonth();setVars();}break;case 39:if(++x<7)ne=cal.ar_days[y][x];else{x=0;K=40;continue;}break;case 40:if(++y<cal.ar_days.length)ne=cal.ar_days[y][x];else{nextMonth();setVars();}break;}break;}if(ne){if(!ne.disabled)Calendar.cellClick(ne);else if(prev)prevMonth();else nextMonth();}}break;case 13:if(act)Calendar.cellClick(cal.currentDateEl,ev);break;default:return false;}return Calendar.stopEvent(ev);};Calendar.prototype._init=function(firstDayOfWeek,date){var today=new Date(),TY=today.getFullYear(),TM=today.getMonth(),TD=today.getDate();this.table.style.visibility="hidden";var year=date.getFullYear();if(year<this.minYear){year=this.minYear;date.setFullYear(year);}else if(year>this.maxYear){year=this.maxYear;date.setFullYear(year);}this.firstDayOfWeek=firstDayOfWeek;this.date=new Date(date);var month=date.getMonth();var mday=date.getDate();var no_days=date.getMonthDays();date.setDate(1);var day1=(date.getDay()-this.firstDayOfWeek)%7;if(day1<0)day1+=7;date.setDate(-day1);date.setDate(date.getDate()+1);var row=this.tbody.firstChild;var MN=Calendar._SMN[month];var ar_days=this.ar_days=new Array();var weekend=Calendar._TT["WEEKEND"];var dates=this.multiple?(this.datesCells={}):null;for(var i=0;i<6;++i,row=row.nextSibling){var cell=row.firstChild;if(this.weekNumbers){cell.className="day wn";cell.innerHTML=date.getWeekNumber();cell=cell.nextSibling;}row.className="daysrow";var hasdays=false,iday,dpos=ar_days[i]=[];for(var j=0;j<7;++j,cell=cell.nextSibling,date.setDate(iday+1)){iday=date.getDate();var wday=date.getDay();cell.className="day";cell.pos=i<<4|j;dpos[j]=cell;var current_month=(date.getMonth()==month);if(!current_month){if(this.showsOtherMonths){cell.className+=" othermonth";cell.otherMonth=true;}else{cell.className="emptycell";cell.innerHTML="&nbsp;";cell.disabled=true;continue;}}else{cell.otherMonth=false;hasdays=true;}cell.disabled=false;cell.innerHTML=this.getDateText?this.getDateText(date,iday):iday;if(dates)dates[date.print("%Y%m%d")]=cell;if(this.getDateStatus){var status=this.getDateStatus(date,year,month,iday);if(this.getDateToolTip){var toolTip=this.getDateToolTip(date,year,month,iday);if(toolTip)cell.title=toolTip;}if(status===true){cell.className+=" disabled";cell.disabled=true;}else{if(/disabled/i.test(status))cell.disabled=true;cell.className+=" "+status;}}if(!cell.disabled){cell.caldate=new Date(date);cell.ttip="_";if(!this.multiple&&current_month&&iday==mday&&this.hiliteToday){cell.className+=" selected";this.currentDateEl=cell;}if(date.getFullYear()==TY&&date.getMonth()==TM&&iday==TD){cell.className+=" today";cell.ttip+=Calendar._TT["PART_TODAY"];}if(weekend.indexOf(wday.toString())!=-1)cell.className+=cell.otherMonth?" oweekend":" weekend";}}if(!(hasdays||this.showsOtherMonths))row.className="emptyrow";}this.title.innerHTML=Calendar._MN[month]+", "+year;this.onSetTime();this.table.style.visibility="visible";this._initMultipleDates();};Calendar.prototype._initMultipleDates=function(){if(this.multiple){for(var i in this.multiple){var cell=this.datesCells[i];var d=this.multiple[i];if(!d)continue;if(cell)cell.className+=" selected";}}};Calendar.prototype._toggleMultipleDate=function(date){if(this.multiple){var ds=date.print("%Y%m%d");var cell=this.datesCells[ds];if(cell){var d=this.multiple[ds];if(!d){Calendar.addClass(cell,"selected");this.multiple[ds]=date;}else{Calendar.removeClass(cell,"selected");delete this.multiple[ds];}}}};Calendar.prototype.setDateToolTipHandler=function(unaryFunction){this.getDateToolTip=unaryFunction;};Calendar.prototype.setDate=function(date){if(!date.equalsTo(this.date)){this._init(this.firstDayOfWeek,date);}};Calendar.prototype.refresh=function(){this._init(this.firstDayOfWeek,this.date);};Calendar.prototype.setFirstDayOfWeek=function(firstDayOfWeek){this._init(firstDayOfWeek,this.date);this._displayWeekdays();};Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(unaryFunction){this.getDateStatus=unaryFunction;};Calendar.prototype.setRange=function(a,z){this.minYear=a;this.maxYear=z;};Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.date.print(this.dateFormat));}};Calendar.prototype.callCloseHandler=function(){if(this.onClose){this.onClose(this);}this.hideShowCovered();};Calendar.prototype.destroy=function(){var el=this.element.parentNode;el.removeChild(this.element);Calendar._C=null;window._dynarch_popupCalendar=null;};Calendar.prototype.reparent=function(new_parent){var el=this.element;el.parentNode.removeChild(el);new_parent.appendChild(el);};Calendar._checkCalendar=function(ev){var calendar=window._dynarch_popupCalendar;if(!calendar){return false;}var el=Calendar.is_ie?Calendar.getElement(ev):Calendar.getTargetElement(ev);for(;el!=null&&el!=calendar.element;el=el.parentNode);if(el==null){window._dynarch_popupCalendar.callCloseHandler();return Calendar.stopEvent(ev);}};Calendar.prototype.show=function(){var rows=this.table.getElementsByTagName("tr");for(var i=rows.length;i>0;){var row=rows[--i];Calendar.removeClass(row,"rowhilite");var cells=row.getElementsByTagName("td");for(var j=cells.length;j>0;){var cell=cells[--j];Calendar.removeClass(cell,"hilite");Calendar.removeClass(cell,"active");}}this.element.style.display="block";this.hidden=false;if(this.isPopup){window._dynarch_popupCalendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document,"mousedown",Calendar._checkCalendar);}this.hideShowCovered();};Calendar.prototype.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar);}this.element.style.display="none";this.hidden=true;this.hideShowCovered();};Calendar.prototype.showAt=function(x,y){var s=this.element.style;s.left=x+"px";s.top=y+"px";this.show();};Calendar.prototype.showAtElement=function(el,opts){var self=this;var p=Calendar.getAbsolutePos(el);if(!opts||typeof opts!="string"){this.showAt(p.x,p.y+el.offsetHeight);return true;}function fixPosition(box){if(box.x<0)box.x=0;if(box.y<0)box.y=0;var cp=document.createElement("div");var s=cp.style;s.position="absolute";s.right=s.bottom=s.width=s.height="0px";document.body.appendChild(cp);var br=Calendar.getAbsolutePos(cp);document.body.removeChild(cp);if(Calendar.is_ie){br.y+=document.body.scrollTop;br.x+=document.body.scrollLeft;}else{br.y+=window.scrollY;br.x+=window.scrollX;}var tmp=box.x+box.width-br.x;if(tmp>0)box.x-=tmp;tmp=box.y+box.height-br.y;if(tmp>0)box.y-=tmp;};this.element.style.display="block";Calendar.continuation_for_the_fucking_khtml_browser=function(){var w=self.element.offsetWidth;var h=self.element.offsetHeight;self.element.style.display="none";var valign=opts.substr(0,1);var halign="l";if(opts.length>1){halign=opts.substr(1,1);}switch(valign){case "T":p.y-=h;break;case "B":p.y+=el.offsetHeight;break;case "C":p.y+=(el.offsetHeight-h)/2;break;case "t":p.y+=el.offsetHeight-h;break;case "b":break;}switch(halign){case "L":p.x-=w;break;case "R":p.x+=el.offsetWidth;break;case "C":p.x+=(el.offsetWidth-w)/2;break;case "l":p.x+=el.offsetWidth-w;break;case "r":break;}p.width=w;p.height=h+40;self.monthsCombo.style.display="none";fixPosition(p);self.showAt(p.x,p.y);};if(Calendar.is_khtml)setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()",10);else Calendar.continuation_for_the_fucking_khtml_browser();};Calendar.prototype.setDateFormat=function(str){this.dateFormat=str;};Calendar.prototype.setTtDateFormat=function(str){this.ttDateFormat=str;};Calendar.prototype.parseDate=function(str,fmt){if(!fmt)fmt=this.dateFormat;this.setDate(Date.parseDate(str,fmt));};Calendar.prototype.hideShowCovered=function(){if(!Calendar.is_ie&&!Calendar.is_opera)return;function getVisib(obj){var value=obj.style.visibility;if(!value){if(document.defaultView&&typeof(document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml)value=document.defaultView. getComputedStyle(obj,"").getPropertyValue("visibility");else value='';}else if(obj.currentStyle){value=obj.currentStyle.visibility;}else value='';}return value;};var tags=new Array("applet","iframe","select");var el=this.element;var p=Calendar.getAbsolutePos(el);var EX1=p.x;var EX2=el.offsetWidth+EX1;var EY1=p.y;var EY2=el.offsetHeight+EY1;for(var k=tags.length;k>0;){var ar=document.getElementsByTagName(tags[--k]);var cc=null;for(var i=ar.length;i>0;){cc=ar[--i];p=Calendar.getAbsolutePos(cc);var CX1=p.x;var CX2=cc.offsetWidth+CX1;var CY1=p.y;var CY2=cc.offsetHeight+CY1;if(this.hidden||(CX1>EX2)||(CX2<EX1)||(CY1>EY2)||(CY2<EY1)){if(!cc.__msh_save_visibility){cc.__msh_save_visibility=getVisib(cc);}cc.style.visibility=cc.__msh_save_visibility;}else{if(!cc.__msh_save_visibility){cc.__msh_save_visibility=getVisib(cc);}cc.style.visibility="hidden";}}}};Calendar.prototype._displayWeekdays=function(){var fdow=this.firstDayOfWeek;var cell=this.firstdayname;var weekend=Calendar._TT["WEEKEND"];for(var i=0;i<7;++i){cell.className="day name";var realday=(i+fdow)%7;if(i){cell.ttip=Calendar._TT["DAY_FIRST"].replace("%s",Calendar._DN[realday]);cell.navtype=100;cell.calendar=this;cell.fdow=realday;Calendar._add_evs(cell);}if(weekend.indexOf(realday.toString())!=-1){Calendar.addClass(cell,"weekend");}cell.innerHTML=Calendar._SDN[(i+fdow)%7];cell=cell.nextSibling;}};Calendar.prototype._hideCombos=function(){this.monthsCombo.style.display="none";this.yearsCombo.style.display="none";};Calendar.prototype._dragStart=function(ev){if(this.dragging){return;}this.dragging=true;var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft;}else{posY=ev.clientY+window.scrollY;posX=ev.clientX+window.scrollX;}var st=this.element.style;this.xOffs=posX-parseInt(st.left);this.yOffs=posY-parseInt(st.top);with(Calendar){addEvent(document,"mousemove",calDragIt);addEvent(document,"mouseup",calDragEnd);}};Date._MD=new Array(31,28,31,30,31,30,31,31,30,31,30,31);Date.SECOND=1000;Date.MINUTE=60*Date.SECOND;Date.HOUR=60*Date.MINUTE;Date.DAY=24*Date.HOUR;Date.WEEK=7*Date.DAY;Date.parseDate=function(str,fmt){var today=new Date();var y=0;var m=-1;var d=0;var a=str.split(/\W+/);var b=fmt.match(/%./g);var i=0,j=0;var hr=0;var min=0;for(i=0;i<a.length;++i){if(!a[i])continue;switch(b[i]){case "%d":case "%e":d=parseInt(a[i],10);break;case "%m":m=parseInt(a[i],10)-1;break;case "%Y":case "%y":y=parseInt(a[i],10);(y<100)&&(y+=(y>29)?1900:2000);break;case "%b":case "%B":for(j=0;j<12;++j){if(Calendar._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){m=j;break;}}break;case "%H":case "%I":case "%k":case "%l":hr=parseInt(a[i],10);break;case "%P":case "%p":if(/pm/i.test(a[i])&&hr<12)hr+=12;else if(/am/i.test(a[i])&&hr>=12)hr-=12;break;case "%M":min=parseInt(a[i],10);break;}}if(isNaN(y))y=today.getFullYear();if(isNaN(m))m=today.getMonth();if(isNaN(d))d=today.getDate();if(isNaN(hr))hr=today.getHours();if(isNaN(min))min=today.getMinutes();if(y!=0&&m!=-1&&d!=0)return new Date(y,m,d,hr,min,0);y=0;m=-1;d=0;for(i=0;i<a.length;++i){if(a[i].search(/[a-zA-Z]+/)!=-1){var t=-1;for(j=0;j<12;++j){if(Calendar._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){t=j;break;}}if(t!=-1){if(m!=-1){d=m+1;}m=t;}}else if(parseInt(a[i],10)<=12&&m==-1){m=a[i]-1;}else if(parseInt(a[i],10)>31&&y==0){y=parseInt(a[i],10);(y<100)&&(y+=(y>29)?1900:2000);}else if(d==0){d=a[i];}}if(y==0)y=today.getFullYear();if(m!=-1&&d!=0)return new Date(y,m,d,hr,min,0);return today;};Date.prototype.getMonthDays=function(month){var year=this.getFullYear();if(typeof month=="undefined"){month=this.getMonth();}if(((0==(year%4))&&((0!=(year%100))||(0==(year%400))))&&month==1){return 29;}else{return Date._MD[month];}};Date.prototype.getDayOfYear=function(){var now=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var then=new Date(this.getFullYear(),0,0,0,0,0);var time=now-then;return Math.floor(time/Date.DAY);};Date.prototype.getWeekNumber=function(){var d=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var DoW=d.getDay();d.setDate(d.getDate()-(DoW+6)%7+3);var ms=d.valueOf();d.setMonth(0);d.setDate(4);return Math.round((ms-d.valueOf())/(7*864e5))+1;};Date.prototype.equalsTo=function(date){return((this.getFullYear()==date.getFullYear())&&(this.getMonth()==date.getMonth())&&(this.getDate()==date.getDate())&&(this.getHours()==date.getHours())&&(this.getMinutes()==date.getMinutes()));};Date.prototype.setDateOnly=function(date){var tmp=new Date(date);this.setDate(1);this.setFullYear(tmp.getFullYear());this.setMonth(tmp.getMonth());this.setDate(tmp.getDate());};Date.prototype.print=function(str){var m=this.getMonth();var d=this.getDate();var y=this.getFullYear();var wn=this.getWeekNumber();var w=this.getDay();var s={};var hr=this.getHours();var pm=(hr>=12);var ir=(pm)?(hr-12):hr;var dy=this.getDayOfYear();if(ir==0)ir=12;var min=this.getMinutes();var sec=this.getSeconds();s["%a"]=Calendar._SDN[w];s["%A"]=Calendar._DN[w];s["%b"]=Calendar._SMN[m];s["%B"]=Calendar._MN[m];s["%C"]=1+Math.floor(y/100);s["%d"]=(d<10)?("0"+d):d;s["%e"]=d;s["%H"]=(hr<10)?("0"+hr):hr;s["%I"]=(ir<10)?("0"+ir):ir;s["%j"]=(dy<100)?((dy<10)?("00"+dy):("0"+dy)):dy;s["%k"]=hr;s["%l"]=ir;s["%m"]=(m<9)?("0"+(1+m)):(1+m);s["%M"]=(min<10)?("0"+min):min;s["%n"]="\n";s["%p"]=pm?"PM":"AM";s["%P"]=pm?"pm":"am";s["%s"]=Math.floor(this.getTime()/1000);s["%S"]=(sec<10)?("0"+sec):sec;s["%t"]="\t";s["%U"]=s["%W"]=s["%V"]=(wn<10)?("0"+wn):wn;s["%u"]=w+1;s["%w"]=w;s["%y"]=(''+y).substr(2,2);s["%Y"]=y;s["%%"]="%";var re=/%./g;if(!Calendar.is_ie5&&!Calendar.is_khtml)return str.replace(re,function(par){return s[par]||par;});var a=str.match(re);for(var i=0;i<a.length;i++){var tmp=s[a[i]];if(tmp){re=new RegExp(a[i],'g');str=str.replace(re,tmp);}}return str;};Date.prototype.__msh_oldSetFullYear=Date.prototype.setFullYear;Date.prototype.setFullYear=function(y){var d=new Date(this);d.__msh_oldSetFullYear(y);if(d.getMonth()!=this.getMonth())this.setDate(28);this.__msh_oldSetFullYear(y);};window._dynarch_popupCalendar=null;
js/calendar_function.js CHANGED
@@ -1,573 +1,573 @@
1
- // <?php !! This fools phpdocumentor into parsing this file
2
- /**
3
- * @version $Id: joomla.javascript.js 14401 2010-01-26 14:10:00Z louis $
4
- * @package Joomla
5
- * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
6
- * @license GNU/GPL
7
- * Joomla! is Free Software
8
- */
9
-
10
- /**
11
- * Overlib Styling Declarations to allow CSS class override of styles
12
- *
13
- */
14
- var ol_fgclass='ol-foreground';
15
- var ol_bgclass='ol-background';
16
- var ol_textfontclass='ol-textfont';
17
- var ol_captionfontclass='ol-captionfont';
18
- var ol_closefontclass='ol-closefont';
19
-
20
- // general utility for browsing a named array or object
21
- function xshow(o) {
22
- s = '';
23
- for(e in o) {s += e+'='+o[e]+'\n';}
24
- alert( s );
25
- }
26
-
27
- /**
28
- * Writes a dynamically generated list
29
- * @param string The parameters to insert into the <select> tag
30
- * @param array A javascript array of list options in the form [key,value,text]
31
- * @param string The key to display for the initial state of the list
32
- * @param string The original key that was selected
33
- * @param string The original item value that was selected
34
- */
35
- function writeDynaList( selectParams, source, key, orig_key, orig_val ) {
36
- var html = '\n <select ' + selectParams + '>';
37
- var i = 0;
38
- for (x in source) {
39
- if (source[x][0] == key) {
40
- var selected = '';
41
- if ((orig_key == key && orig_val == source[x][1]) || (i == 0 && orig_key != key)) {
42
- selected = 'selected="selected"';
43
- }
44
- html += '\n <option value="'+source[x][1]+'" '+selected+'>'+source[x][2]+'</option>';
45
- }
46
- i++;
47
- }
48
- html += '\n </select>';
49
-
50
- document.writeln( html );
51
- }
52
-
53
- /**
54
- * Changes a dynamically generated list
55
- * @param string The name of the list to change
56
- * @param array A javascript array of list options in the form [key,value,text]
57
- * @param string The key to display
58
- * @param string The original key that was selected
59
- * @param string The original item value that was selected
60
- */
61
- function changeDynaList( listname, source, key, orig_key, orig_val ) {
62
- var list = eval( 'document.adminForm.' + listname );
63
-
64
- // empty the list
65
- for (i in list.options.length) {
66
- list.options[i] = null;
67
- }
68
- i = 0;
69
- for (x in source) {
70
- if (source[x][0] == key) {
71
- opt = new Option();
72
- opt.value = source[x][1];
73
- opt.text = source[x][2];
74
-
75
- if ((orig_key == key && orig_val == opt.value) || i == 0) {
76
- opt.selected = true;
77
- }
78
- list.options[i++] = opt;
79
- }
80
- }
81
- list.length = i;
82
- }
83
-
84
- /**
85
- * Adds a select item(s) from one list to another
86
- */
87
- function addSelectedToList( frmName, srcListName, tgtListName ) {
88
- var form = eval( 'document.' + frmName );
89
- var srcList = eval( 'form.' + srcListName );
90
- var tgtList = eval( 'form.' + tgtListName );
91
-
92
- var srcLen = srcList.length;
93
- var tgtLen = tgtList.length;
94
- var tgt = "x";
95
-
96
- //build array of target items
97
- for (var i=tgtLen-1; i > -1; i--) {
98
- tgt += "," + tgtList.options[i].value + ","
99
- }
100
-
101
- //Pull selected resources and add them to list
102
- //for (var i=srcLen-1; i > -1; i--) {
103
- for (var i=0; i < srcLen; i++) {
104
- if (srcList.options[i].selected && tgt.indexOf( "," + srcList.options[i].value + "," ) == -1) {
105
- opt = new Option( srcList.options[i].text, srcList.options[i].value );
106
- tgtList.options[tgtList.length] = opt;
107
- }
108
- }
109
- }
110
-
111
- function delSelectedFromList( frmName, srcListName ) {
112
- var form = eval( 'document.' + frmName );
113
- var srcList = eval( 'form.' + srcListName );
114
-
115
- var srcLen = srcList.length;
116
-
117
- for (var i=srcLen-1; i > -1; i--) {
118
- if (srcList.options[i].selected) {
119
- srcList.options[i] = null;
120
- }
121
- }
122
- }
123
-
124
- function moveInList( frmName, srcListName, index, to) {
125
- var form = eval( 'document.' + frmName );
126
- var srcList = eval( 'form.' + srcListName );
127
- var total = srcList.options.length-1;
128
-
129
- if (index == -1) {
130
- return false;
131
- }
132
- if (to == +1 && index == total) {
133
- return false;
134
- }
135
- if (to == -1 && index == 0) {
136
- return false;
137
- }
138
-
139
- var items = new Array;
140
- var values = new Array;
141
-
142
- for (i=total; i >= 0; i--) {
143
- items[i] = srcList.options[i].text;
144
- values[i] = srcList.options[i].value;
145
- }
146
- for (i = total; i >= 0; i--) {
147
- if (index == i) {
148
- srcList.options[i + to] = new Option(items[i],values[i], 0, 1);
149
- srcList.options[i] = new Option(items[i+to], values[i+to]);
150
- i--;
151
- } else {
152
- srcList.options[i] = new Option(items[i], values[i]);
153
- }
154
- }
155
- srcList.focus();
156
- return true;
157
- }
158
-
159
- function getSelectedOption( frmName, srcListName ) {
160
- var form = eval( 'document.' + frmName );
161
- var srcList = eval( 'form.' + srcListName );
162
-
163
- i = srcList.selectedIndex;
164
- if (i != null && i > -1) {
165
- return srcList.options[i];
166
- } else {
167
- return null;
168
- }
169
- }
170
-
171
- function setSelectedValue( frmName, srcListName, value ) {
172
- var form = eval( 'document.' + frmName );
173
- var srcList = eval( 'form.' + srcListName );
174
-
175
- var srcLen = srcList.length;
176
-
177
- for (var i=0; i < srcLen; i++) {
178
- srcList.options[i].selected = false;
179
- if (srcList.options[i].value == value) {
180
- srcList.options[i].selected = true;
181
- }
182
- }
183
- }
184
-
185
- function getSelectedRadio( frmName, srcGroupName ) {
186
- var form = eval( 'document.' + frmName );
187
- var srcGroup = eval( 'form.' + srcGroupName );
188
-
189
- return radioGetCheckedValue( srcGroup );
190
- }
191
-
192
- // return the value of the radio button that is checked
193
- // return an empty string if none are checked, or
194
- // there are no radio buttons
195
- function radioGetCheckedValue(radioObj) {
196
- if (!radioObj) {
197
- return '';
198
- }
199
- var n = radioObj.length;
200
- if (n == undefined) {
201
- if (radioObj.checked) {
202
- return radioObj.value;
203
- } else {
204
- return '';
205
- }
206
- }
207
- for (var i = 0; i < n; i++) {
208
- if(radioObj[i].checked) {
209
- return radioObj[i].value;
210
- }
211
- }
212
- return '';
213
- }
214
-
215
- function getSelectedValue( frmName, srcListName ) {
216
- var form = eval( 'document.' + frmName );
217
- var srcList = eval( 'form.' + srcListName );
218
-
219
- i = srcList.selectedIndex;
220
- if (i != null && i > -1) {
221
- return srcList.options[i].value;
222
- } else {
223
- return null;
224
- }
225
- }
226
-
227
- function getSelectedText( frmName, srcListName ) {
228
- var form = eval( 'document.' + frmName );
229
- var srcList = eval( 'form.' + srcListName );
230
-
231
- i = srcList.selectedIndex;
232
- if (i != null && i > -1) {
233
- return srcList.options[i].text;
234
- } else {
235
- return null;
236
- }
237
- }
238
-
239
- function chgSelectedValue( frmName, srcListName, value ) {
240
- var form = eval( 'document.' + frmName );
241
- var srcList = eval( 'form.' + srcListName );
242
-
243
- i = srcList.selectedIndex;
244
- if (i != null && i > -1) {
245
- srcList.options[i].value = value;
246
- return true;
247
- } else {
248
- return false;
249
- }
250
- }
251
-
252
- /**
253
- * Toggles the check state of a group of boxes
254
- *
255
- * Checkboxes must have an id attribute in the form cb0, cb1...
256
- * @param The number of box to 'check'
257
- * @param An alternative field name
258
- */
259
-
260
- function listItemTask( id, task ) {
261
- var f = document.adminForm;
262
- cb = eval( 'f.' + id );
263
- if (cb) {
264
- for (i = 0; true; i++) {
265
- cbx = eval('f.cb'+i);
266
- if (!cbx) break;
267
- cbx.checked = false;
268
- } // for
269
- cb.checked = true;
270
- f.boxchecked.value = 1;
271
- submitbutton(task);
272
- }
273
- return false;
274
- }
275
-
276
- function hideMainMenu() {
277
- if (document.adminForm.hidemainmenu) {
278
- document.adminForm.hidemainmenu.value=1;
279
- }
280
- }
281
-
282
- function isChecked(isitchecked){
283
- if (isitchecked == true){
284
- document.adminForm.boxchecked.value++;
285
- }
286
- else {
287
- document.adminForm.boxchecked.value--;
288
- }
289
- }
290
-
291
- /**
292
- * Default function. Usually would be overriden by the component
293
- *//*
294
- function submitbutton(pressbutton) {
295
- submitform(pressbutton);
296
- }
297
- */
298
- /**
299
- * Submit the admin form
300
- */
301
- function submitform(pressbutton){
302
- if (pressbutton) {
303
- document.adminForm.task.value=pressbutton;
304
- }
305
- if (typeof document.adminForm.onsubmit == "function") {
306
- document.adminForm.onsubmit();
307
- }
308
- document.adminForm.submit();
309
- }
310
-
311
- /**
312
- * Submit the control panel admin form
313
- */
314
- function submitcpform(sectionid, id){
315
- document.adminForm.sectionid.value=sectionid;
316
- document.adminForm.id.value=id;
317
- submitbutton("edit");
318
- }
319
-
320
- /**
321
- * Getting radio button that is selected.
322
- */
323
- function getSelected(allbuttons){
324
- for (i=0;i<allbuttons.length;i++) {
325
- if (allbuttons[i].checked) {
326
- return allbuttons[i].value
327
- }
328
- }
329
- return null;
330
- }
331
-
332
- // JS Calendar
333
- var calendar = null; // remember the calendar object so that we reuse
334
- // it and avoid creating another
335
-
336
- // This function gets called when an end-user clicks on some date
337
- function selected(cal, date) {
338
- cal.sel.value = date; // just update the value of the input field
339
- }
340
-
341
- // And this gets called when the end-user clicks on the _selected_ date,
342
- // or clicks the "Close" (X) button. It just hides the calendar without
343
- // destroying it.
344
- function closeHandler(cal) {
345
- cal.hide(); // hide the calendar
346
-
347
- // don't check mousedown on document anymore (used to be able to hide the
348
- // calendar when someone clicks outside it, see the showCalendar function).
349
- Calendar.removeEvent(document, "mousedown", checkCalendar);
350
- }
351
-
352
- // This gets called when the user presses a mouse button anywhere in the
353
- // document, if the calendar is shown. If the click was outside the open
354
- // calendar this function closes it.
355
- function checkCalendar(ev) {
356
- var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev);
357
- for (; el != null; el = el.parentNode)
358
- // FIXME: allow end-user to click some link without closing the
359
- // calendar. Good to see real-time stylesheet change :)
360
- if (el == calendar.element || el.tagName == "A") break;
361
- if (el == null) {
362
- // calls closeHandler which should hide the calendar.
363
- calendar.callCloseHandler(); Calendar.stopEvent(ev);
364
- }
365
- }
366
-
367
- // This function shows the calendar under the element having the given id.
368
- // It takes care of catching "mousedown" signals on document and hiding the
369
- // calendar if the click was outside.
370
- function showCalendar(id, dateFormat) {
371
- var el = document.getElementById(id);
372
- if (calendar != null) {
373
- // we already have one created, so just update it.
374
- calendar.hide(); // hide the existing calendar
375
- calendar.parseDate(el.value); // set it to a new date
376
- } else {
377
- // first-time call, create the calendar
378
- var cal = new Calendar(true, null, selected, closeHandler);
379
- calendar = cal; // remember the calendar in the global
380
- cal.setRange(1900, 2070); // min/max year allowed
381
-
382
- if ( dateFormat ) // optional date format
383
- {
384
- cal.setDateFormat(dateFormat);
385
- }
386
-
387
- calendar.create(); // create a popup calendar
388
- calendar.parseDate(el.value); // set it to a new date
389
- }
390
- calendar.sel = el; // inform it about the input field in use
391
- calendar.showAtElement(el); // show the calendar next to the input field
392
-
393
- // catch mousedown on the document
394
- Calendar.addEvent(document, "mousedown", checkCalendar);
395
- return false;
396
- }
397
-
398
- /**
399
- * Pops up a new window in the middle of the screen
400
- */
401
- function popupWindow(mypage, myname, w, h, scroll) {
402
- var winl = (screen.width - w) / 2;
403
- var wint = (screen.height - h) / 2;
404
- winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
405
- win = window.open(mypage, myname, winprops)
406
- if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
407
- }
408
-
409
- // LTrim(string) : Returns a copy of a string without leading spaces.
410
- function ltrim(str)
411
- {
412
- var whitespace = new String(" \t\n\r");
413
- var s = new String(str);
414
- if (whitespace.indexOf(s.charAt(0)) != -1) {
415
- var j=0, i = s.length;
416
- while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
417
- j++;
418
- s = s.substring(j, i);
419
- }
420
- return s;
421
- }
422
-
423
- //RTrim(string) : Returns a copy of a string without trailing spaces.
424
- function rtrim(str)
425
- {
426
- var whitespace = new String(" \t\n\r");
427
- var s = new String(str);
428
- if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
429
- var i = s.length - 1; // Get length of string
430
- while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
431
- i--;
432
- s = s.substring(0, i+1);
433
- }
434
- return s;
435
- }
436
-
437
- // Trim(string) : Returns a copy of a string without leading or trailing spaces
438
- function trim(str) {
439
- return rtrim(ltrim(str));
440
- }
441
-
442
- function mosDHTML(){
443
- this.ver=navigator.appVersion
444
- this.agent=navigator.userAgent
445
- this.dom=document.getElementById?1:0
446
- this.opera5=this.agent.indexOf("Opera 5")<-1
447
- this.ie5=(this.ver.indexOf("MSIE 5")<-1 && this.dom && !this.opera5)?1:0;
448
- this.ie6=(this.ver.indexOf("MSIE 6")<-1 && this.dom && !this.opera5)?1:0;
449
- this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
450
- this.ie=this.ie4||this.ie5||this.ie6
451
- this.mac=this.agent.indexOf("Mac")<-1
452
- this.ns6=(this.dom && parseInt(this.ver) <= 5) ?1:0;
453
- this.ns4=(document.layers && !this.dom)?1:0;
454
- this.bw=(this.ie6||this.ie5||this.ie4||this.ns4||this.ns6||this.opera5);
455
-
456
- this.activeTab = '';
457
- this.onTabStyle = 'ontab';
458
- this.offTabStyle = 'offtab';
459
-
460
- this.setElemStyle = function(elem,style) {
461
- document.getElementById(elem).className = style;
462
- }
463
- this.showElem = function(id) {
464
- if ((elem = document.getElementById(id))) {
465
- elem.style.visibility = 'visible';
466
- elem.style.display = 'block';
467
- }
468
- }
469
- this.hideElem = function(id) {
470
- if ((elem = document.getElementById(id))) {
471
- elem.style.visibility = 'hidden';
472
- elem.style.display = 'none';
473
- }
474
- }
475
- this.cycleTab = function(name) {
476
- if (this.activeTab) {
477
- this.setElemStyle( this.activeTab, this.offTabStyle );
478
- page = this.activeTab.replace( 'tab', 'page' );
479
- this.hideElem(page);
480
- }
481
- this.setElemStyle( name, this.onTabStyle );
482
- this.activeTab = name;
483
- page = this.activeTab.replace( 'tab', 'page' );
484
- this.showElem(page);
485
- }
486
- return this;
487
- }
488
- var dhtml = new mosDHTML();
489
-
490
- // needed for Table Column ordering
491
- function tableOrdering( order, dir, task ) {
492
- var form = document.adminForm;
493
-
494
- form.filter_order.value = order;
495
- form.filter_order_Dir.value = dir;
496
- submitform( task );
497
- }
498
-
499
- function saveorder( n, task ) {
500
- checkAll_button( n, task );
501
- }
502
-
503
- //needed by saveorder function
504
- function checkAll_button( n, task ) {
505
-
506
- if (!task ) {
507
- task = 'saveorder';
508
- }
509
-
510
- for ( var j = 0; j <= n; j++ ) {
511
- box = eval( "document.adminForm.cb" + j );
512
- if ( box ) {
513
- if ( box.checked == false ) {
514
- box.checked = true;
515
- }
516
- } else {
517
- alert("You cannot change the order of items, as an item in the list is `Checked Out`");
518
- return;
519
- }
520
- }
521
- submitform(task);
522
- }
523
- /**
524
- * @param object A form element
525
- * @param string The name of the element to find
526
- */
527
- function getElementByName( f, name ) {
528
- if (f.elements) {
529
- for (i=0, n=f.elements.length; i < n; i++) {
530
- if (f.elements[i].name == name) {
531
- return f.elements[i];
532
- }
533
- }
534
- }
535
- return null;
536
- }
537
-
538
- function go2( pressbutton, menu, id ) {
539
- var form = document.adminForm;
540
-
541
- if (form.imagelist && form.images) {
542
- // assemble the images back into one field
543
- var temp = new Array;
544
- for (var i=0, n=form.imagelist.options.length; i < n; i++) {
545
- temp[i] = form.imagelist.options[i].value;
546
- }
547
- form.images.value = temp.join( '\n' );
548
- }
549
-
550
- if (pressbutton == 'go2menu') {
551
- form.menu.value = menu;
552
- submitform( pressbutton );
553
- return;
554
- }
555
-
556
- if (pressbutton == 'go2menuitem') {
557
- form.menu.value = menu;
558
- form.menuid.value = id;
559
- submitform( pressbutton );
560
- return;
561
- }
562
- }
563
- /**
564
- * Verifies if the string is in a valid email format
565
- * @param string
566
- * @return boolean
567
- */
568
- function isEmail( text )
569
- {
570
- var pattern = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
571
- var regex = new RegExp( pattern );
572
- return regex.test( text );
573
  }
1
+ // <?php !! This fools phpdocumentor into parsing this file
2
+ /**
3
+ * @version $Id: joomla.javascript.js 14401 2010-01-26 14:10:00Z louis $
4
+ * @package Joomla
5
+ * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
6
+ * @license GNU/GPL
7
+ * Joomla! is Free Software
8
+ */
9
+
10
+ /**
11
+ * Overlib Styling Declarations to allow CSS class override of styles
12
+ *
13
+ */
14
+ var ol_fgclass='ol-foreground';
15
+ var ol_bgclass='ol-background';
16
+ var ol_textfontclass='ol-textfont';
17
+ var ol_captionfontclass='ol-captionfont';
18
+ var ol_closefontclass='ol-closefont';
19
+
20
+ // general utility for browsing a named array or object
21
+ function xshow(o) {
22
+ s = '';
23
+ for(e in o) {s += e+'='+o[e]+'\n';}
24
+ alert( s );
25
+ }
26
+
27
+ /**
28
+ * Writes a dynamically generated list
29
+ * @param string The parameters to insert into the <select> tag
30
+ * @param array A javascript array of list options in the form [key,value,text]
31
+ * @param string The key to display for the initial state of the list
32
+ * @param string The original key that was selected
33
+ * @param string The original item value that was selected
34
+ */
35
+ function writeDynaList( selectParams, source, key, orig_key, orig_val ) {
36
+ var html = '\n <select ' + selectParams + '>';
37
+ var i = 0;
38
+ for (x in source) {
39
+ if (source[x][0] == key) {
40
+ var selected = '';
41
+ if ((orig_key == key && orig_val == source[x][1]) || (i == 0 && orig_key != key)) {
42
+ selected = 'selected="selected"';
43
+ }
44
+ html += '\n <option value="'+source[x][1]+'" '+selected+'>'+source[x][2]+'</option>';
45
+ }
46
+ i++;
47
+ }
48
+ html += '\n </select>';
49
+
50
+ document.writeln( html );
51
+ }
52
+
53
+ /**
54
+ * Changes a dynamically generated list
55
+ * @param string The name of the list to change
56
+ * @param array A javascript array of list options in the form [key,value,text]
57
+ * @param string The key to display
58
+ * @param string The original key that was selected
59
+ * @param string The original item value that was selected
60
+ */
61
+ function changeDynaList( listname, source, key, orig_key, orig_val ) {
62
+ var list = eval( 'document.adminForm.' + listname );
63
+
64
+ // empty the list
65
+ for (i in list.options.length) {
66
+ list.options[i] = null;
67
+ }
68
+ i = 0;
69
+ for (x in source) {
70
+ if (source[x][0] == key) {
71
+ opt = new Option();
72
+ opt.value = source[x][1];
73
+ opt.text = source[x][2];
74
+
75
+ if ((orig_key == key && orig_val == opt.value) || i == 0) {
76
+ opt.selected = true;
77
+ }
78
+ list.options[i++] = opt;
79
+ }
80
+ }
81
+ list.length = i;
82
+ }
83
+
84
+ /**
85
+ * Adds a select item(s) from one list to another
86
+ */
87
+ function addSelectedToList( frmName, srcListName, tgtListName ) {
88
+ var form = eval( 'document.' + frmName );
89
+ var srcList = eval( 'form.' + srcListName );
90
+ var tgtList = eval( 'form.' + tgtListName );
91
+
92
+ var srcLen = srcList.length;
93
+ var tgtLen = tgtList.length;
94
+ var tgt = "x";
95
+
96
+ //build array of target items
97
+ for (var i=tgtLen-1; i > -1; i--) {
98
+ tgt += "," + tgtList.options[i].value + ","
99
+ }
100
+
101
+ //Pull selected resources and add them to list
102
+ //for (var i=srcLen-1; i > -1; i--) {
103
+ for (var i=0; i < srcLen; i++) {
104
+ if (srcList.options[i].selected && tgt.indexOf( "," + srcList.options[i].value + "," ) == -1) {
105
+ opt = new Option( srcList.options[i].text, srcList.options[i].value );
106
+ tgtList.options[tgtList.length] = opt;
107
+ }
108
+ }
109
+ }
110
+
111
+ function delSelectedFromList( frmName, srcListName ) {
112
+ var form = eval( 'document.' + frmName );
113
+ var srcList = eval( 'form.' + srcListName );
114
+
115
+ var srcLen = srcList.length;
116
+
117
+ for (var i=srcLen-1; i > -1; i--) {
118
+ if (srcList.options[i].selected) {
119
+ srcList.options[i] = null;
120
+ }
121
+ }
122
+ }
123
+
124
+ function moveInList( frmName, srcListName, index, to) {
125
+ var form = eval( 'document.' + frmName );
126
+ var srcList = eval( 'form.' + srcListName );
127
+ var total = srcList.options.length-1;
128
+
129
+ if (index == -1) {
130
+ return false;
131
+ }
132
+ if (to == +1 && index == total) {
133
+ return false;
134
+ }
135
+ if (to == -1 && index == 0) {
136
+ return false;
137
+ }
138
+
139
+ var items = new Array;
140
+ var values = new Array;
141
+
142
+ for (i=total; i >= 0; i--) {
143
+ items[i] = srcList.options[i].text;
144
+ values[i] = srcList.options[i].value;
145
+ }
146
+ for (i = total; i >= 0; i--) {
147
+ if (index == i) {
148
+ srcList.options[i + to] = new Option(items[i],values[i], 0, 1);
149
+ srcList.options[i] = new Option(items[i+to], values[i+to]);
150
+ i--;
151
+ } else {
152
+ srcList.options[i] = new Option(items[i], values[i]);
153
+ }
154
+ }
155
+ srcList.focus();
156
+ return true;
157
+ }
158
+
159
+ function getSelectedOption( frmName, srcListName ) {
160
+ var form = eval( 'document.' + frmName );
161
+ var srcList = eval( 'form.' + srcListName );
162
+
163
+ i = srcList.selectedIndex;
164
+ if (i != null && i > -1) {
165
+ return srcList.options[i];
166
+ } else {
167
+ return null;
168
+ }
169
+ }
170
+
171
+ function setSelectedValue( frmName, srcListName, value ) {
172
+ var form = eval( 'document.' + frmName );
173
+ var srcList = eval( 'form.' + srcListName );
174
+
175
+ var srcLen = srcList.length;
176
+
177
+ for (var i=0; i < srcLen; i++) {
178
+ srcList.options[i].selected = false;
179
+ if (srcList.options[i].value == value) {
180
+ srcList.options[i].selected = true;
181
+ }
182
+ }
183
+ }
184
+
185
+ function getSelectedRadio( frmName, srcGroupName ) {
186
+ var form = eval( 'document.' + frmName );
187
+ var srcGroup = eval( 'form.' + srcGroupName );
188
+
189
+ return radioGetCheckedValue( srcGroup );
190
+ }
191
+
192
+ // return the value of the radio button that is checked
193
+ // return an empty string if none are checked, or
194
+ // there are no radio buttons
195
+ function radioGetCheckedValue(radioObj) {
196
+ if (!radioObj) {
197
+ return '';
198
+ }
199
+ var n = radioObj.length;
200
+ if (n == undefined) {
201
+ if (radioObj.checked) {
202
+ return radioObj.value;
203
+ } else {
204
+ return '';
205
+ }
206
+ }
207
+ for (var i = 0; i < n; i++) {
208
+ if(radioObj[i].checked) {
209
+ return radioObj[i].value;
210
+ }
211
+ }
212
+ return '';
213
+ }
214
+
215
+ function getSelectedValue( frmName, srcListName ) {
216
+ var form = eval( 'document.' + frmName );
217
+ var srcList = eval( 'form.' + srcListName );
218
+
219
+ i = srcList.selectedIndex;
220
+ if (i != null && i > -1) {
221
+ return srcList.options[i].value;
222
+ } else {
223
+ return null;
224
+ }
225
+ }
226
+
227
+ function getSelectedText( frmName, srcListName ) {
228
+ var form = eval( 'document.' + frmName );
229
+ var srcList = eval( 'form.' + srcListName );
230
+
231
+ i = srcList.selectedIndex;
232
+ if (i != null && i > -1) {
233
+ return srcList.options[i].text;
234
+ } else {
235
+ return null;
236
+ }
237
+ }
238
+
239
+ function chgSelectedValue( frmName, srcListName, value ) {
240
+ var form = eval( 'document.' + frmName );
241
+ var srcList = eval( 'form.' + srcListName );
242
+
243
+ i = srcList.selectedIndex;
244
+ if (i != null && i > -1) {
245
+ srcList.options[i].value = value;
246
+ return true;
247
+ } else {
248
+ return false;
249
+ }
250
+ }
251
+
252
+ /**
253
+ * Toggles the check state of a group of boxes
254
+ *
255
+ * Checkboxes must have an id attribute in the form cb0, cb1...
256
+ * @param The number of box to 'check'
257
+ * @param An alternative field name
258
+ */
259
+
260
+ function listItemTask( id, task ) {
261
+ var f = document.adminForm;
262
+ cb = eval( 'f.' + id );
263
+ if (cb) {
264
+ for (i = 0; true; i++) {
265
+ cbx = eval('f.cb'+i);
266
+ if (!cbx) break;
267
+ cbx.checked = false;
268
+ } // for
269
+ cb.checked = true;
270
+ f.boxchecked.value = 1;
271
+ submitbutton(task);
272
+ }
273
+ return false;
274
+ }
275
+
276
+ function hideMainMenu() {
277
+ if (document.adminForm.hidemainmenu) {
278
+ document.adminForm.hidemainmenu.value=1;
279
+ }
280
+ }
281
+
282
+ function isChecked(isitchecked){
283
+ if (isitchecked == true){
284
+ document.adminForm.boxchecked.value++;
285
+ }
286
+ else {
287
+ document.adminForm.boxchecked.value--;
288
+ }
289
+ }
290
+
291
+ /**
292
+ * Default function. Usually would be overriden by the component
293
+ *//*
294
+ function submitbutton(pressbutton) {
295
+ submitform(pressbutton);
296
+ }
297
+ */
298
+ /**
299
+ * Submit the admin form
300
+ */
301
+ function submitform(pressbutton){
302
+ if (pressbutton) {
303
+ document.adminForm.task.value=pressbutton;
304
+ }
305
+ if (typeof document.adminForm.onsubmit == "function") {
306
+ document.adminForm.onsubmit();
307
+ }
308
+ document.adminForm.submit();
309
+ }
310
+
311
+ /**
312
+ * Submit the control panel admin form
313
+ */
314
+ function submitcpform(sectionid, id){
315
+ document.adminForm.sectionid.value=sectionid;
316
+ document.adminForm.id.value=id;
317
+ submitbutton("edit");
318
+ }
319
+
320
+ /**
321
+ * Getting radio button that is selected.
322
+ */
323
+ function getSelected(allbuttons){
324
+ for (i=0;i<allbuttons.length;i++) {
325
+ if (allbuttons[i].checked) {
326
+ return allbuttons[i].value
327
+ }
328
+ }
329
+ return null;
330
+ }
331
+
332
+ // JS Calendar
333
+ var calendar = null; // remember the calendar object so that we reuse
334
+ // it and avoid creating another
335
+
336
+ // This function gets called when an end-user clicks on some date
337
+ function selected(cal, date) {
338
+ cal.sel.value = date; // just update the value of the input field
339
+ }
340
+
341
+ // And this gets called when the end-user clicks on the _selected_ date,
342
+ // or clicks the "Close" (X) button. It just hides the calendar without
343
+ // destroying it.
344
+ function closeHandler(cal) {
345
+ cal.hide(); // hide the calendar
346
+
347
+ // don't check mousedown on document anymore (used to be able to hide the
348
+ // calendar when someone clicks outside it, see the showCalendar function).
349
+ Calendar.removeEvent(document, "mousedown", checkCalendar);
350
+ }
351
+
352
+ // This gets called when the user presses a mouse button anywhere in the
353
+ // document, if the calendar is shown. If the click was outside the open
354
+ // calendar this function closes it.
355
+ function checkCalendar(ev) {
356
+ var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev);
357
+ for (; el != null; el = el.parentNode)
358
+ // FIXME: allow end-user to click some link without closing the
359
+ // calendar. Good to see real-time stylesheet change :)
360
+ if (el == calendar.element || el.tagName == "A") break;
361
+ if (el == null) {
362
+ // calls closeHandler which should hide the calendar.
363
+ calendar.callCloseHandler(); Calendar.stopEvent(ev);
364
+ }
365
+ }
366
+
367
+ // This function shows the calendar under the element having the given id.
368
+ // It takes care of catching "mousedown" signals on document and hiding the
369
+ // calendar if the click was outside.
370
+ function showCalendar(id, dateFormat) {
371
+ var el = document.getElementById(id);
372
+ if (calendar != null) {
373
+ // we already have one created, so just update it.
374
+ calendar.hide(); // hide the existing calendar
375
+ calendar.parseDate(el.value); // set it to a new date
376
+ } else {
377
+ // first-time call, create the calendar
378
+ var cal = new Calendar(true, null, selected, closeHandler);
379
+ calendar = cal; // remember the calendar in the global
380
+ cal.setRange(1900, 2070); // min/max year allowed
381
+
382
+ if ( dateFormat ) // optional date format
383
+ {
384
+ cal.setDateFormat(dateFormat);
385
+ }
386
+
387
+ calendar.create(); // create a popup calendar
388
+ calendar.parseDate(el.value); // set it to a new date
389
+ }
390
+ calendar.sel = el; // inform it about the input field in use
391
+ calendar.showAtElement(el); // show the calendar next to the input field
392
+
393
+ // catch mousedown on the document
394
+ Calendar.addEvent(document, "mousedown", checkCalendar);
395
+ return false;
396
+ }
397
+
398
+ /**
399
+ * Pops up a new window in the middle of the screen
400
+ */
401
+ function popupWindow(mypage, myname, w, h, scroll) {
402
+ var winl = (screen.width - w) / 2;
403
+ var wint = (screen.height - h) / 2;
404
+ winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
405
+ win = window.open(mypage, myname, winprops)
406
+ if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
407
+ }
408
+
409
+ // LTrim(string) : Returns a copy of a string without leading spaces.
410
+ function ltrim(str)
411
+ {
412
+ var whitespace = new String(" \t\n\r");
413
+ var s = new String(str);
414
+ if (whitespace.indexOf(s.charAt(0)) != -1) {
415
+ var j=0, i = s.length;
416
+ while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
417
+ j++;
418
+ s = s.substring(j, i);
419
+ }
420
+ return s;
421
+ }
422
+
423
+ //RTrim(string) : Returns a copy of a string without trailing spaces.
424
+ function rtrim(str)
425
+ {
426
+ var whitespace = new String(" \t\n\r");
427
+ var s = new String(str);
428
+ if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
429
+ var i = s.length - 1; // Get length of string
430
+ while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
431
+ i--;
432
+ s = s.substring(0, i+1);
433
+ }
434
+ return s;
435
+ }
436
+
437
+ // Trim(string) : Returns a copy of a string without leading or trailing spaces
438
+ function trim(str) {
439
+ return rtrim(ltrim(str));
440
+ }
441
+
442
+ function mosDHTML(){
443
+ this.ver=navigator.appVersion
444
+ this.agent=navigator.userAgent
445
+ this.dom=document.getElementById?1:0
446
+ this.opera5=this.agent.indexOf("Opera 5")<-1
447
+ this.ie5=(this.ver.indexOf("MSIE 5")<-1 && this.dom && !this.opera5)?1:0;
448
+ this.ie6=(this.ver.indexOf("MSIE 6")<-1 && this.dom && !this.opera5)?1:0;
449
+ this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
450
+ this.ie=this.ie4||this.ie5||this.ie6
451
+ this.mac=this.agent.indexOf("Mac")<-1
452
+ this.ns6=(this.dom && parseInt(this.ver) <= 5) ?1:0;
453
+ this.ns4=(document.layers && !this.dom)?1:0;
454
+ this.bw=(this.ie6||this.ie5||this.ie4||this.ns4||this.ns6||this.opera5);
455
+
456
+ this.activeTab = '';
457
+ this.onTabStyle = 'ontab';
458
+ this.offTabStyle = 'offtab';
459
+
460
+ this.setElemStyle = function(elem,style) {
461
+ document.getElementById(elem).className = style;
462
+ }
463
+ this.showElem = function(id) {
464
+ if ((elem = document.getElementById(id))) {
465
+ elem.style.visibility = 'visible';
466
+ elem.style.display = 'block';
467
+ }
468
+ }
469
+ this.hideElem = function(id) {
470
+ if ((elem = document.getElementById(id))) {
471
+ elem.style.visibility = 'hidden';
472
+ elem.style.display = 'none';
473
+ }
474
+ }
475
+ this.cycleTab = function(name) {
476
+ if (this.activeTab) {
477
+ this.setElemStyle( this.activeTab, this.offTabStyle );
478
+ page = this.activeTab.replace( 'tab', 'page' );
479
+ this.hideElem(page);
480
+ }
481
+ this.setElemStyle( name, this.onTabStyle );
482
+ this.activeTab = name;
483
+ page = this.activeTab.replace( 'tab', 'page' );
484
+ this.showElem(page);
485
+ }
486
+ return this;
487
+ }
488
+ var dhtml = new mosDHTML();
489
+
490
+ // needed for Table Column ordering
491
+ function tableOrdering( order, dir, task ) {
492
+ var form = document.adminForm;
493
+
494
+ form.filter_order.value = order;
495
+ form.filter_order_Dir.value = dir;
496
+ submitform( task );
497
+ }
498
+
499
+ function saveorder( n, task ) {
500
+ checkAll_button( n, task );
501
+ }
502
+
503
+ //needed by saveorder function
504
+ function checkAll_button( n, task ) {
505
+
506
+ if (!task ) {
507
+ task = 'saveorder';
508
+ }
509
+
510
+ for ( var j = 0; j <= n; j++ ) {
511
+ box = eval( "document.adminForm.cb" + j );
512
+ if ( box ) {
513
+ if ( box.checked == false ) {
514
+ box.checked = true;
515
+ }
516
+ } else {
517
+ alert("You cannot change the order of items, as an item in the list is `Checked Out`");
518
+ return;
519
+ }
520
+ }
521
+ submitform(task);
522
+ }
523
+ /**
524
+ * @param object A form element
525
+ * @param string The name of the element to find
526
+ */
527
+ function getElementByName( f, name ) {
528
+ if (f.elements) {
529
+ for (i=0, n=f.elements.length; i < n; i++) {
530
+ if (f.elements[i].name == name) {
531
+ return f.elements[i];
532
+ }
533
+ }
534
+ }
535
+ return null;
536
+ }
537
+
538
+ function go2( pressbutton, menu, id ) {
539
+ var form = document.adminForm;
540
+
541
+ if (form.imagelist && form.images) {
542
+ // assemble the images back into one field
543
+ var temp = new Array;
544
+ for (var i=0, n=form.imagelist.options.length; i < n; i++) {
545
+ temp[i] = form.imagelist.options[i].value;
546
+ }
547
+ form.images.value = temp.join( '\n' );
548
+ }
549
+
550
+ if (pressbutton == 'go2menu') {
551
+ form.menu.value = menu;
552
+ submitform( pressbutton );
553
+ return;
554
+ }
555
+
556
+ if (pressbutton == 'go2menuitem') {
557
+ form.menu.value = menu;
558
+ form.menuid.value = id;
559
+ submitform( pressbutton );
560
+ return;
561
+ }
562
+ }
563
+ /**
564
+ * Verifies if the string is in a valid email format
565
+ * @param string
566
+ * @return boolean
567
+ */
568
+ function isEmail( text )
569
+ {
570
+ var pattern = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
571
+ var regex = new RegExp( pattern );
572
+ return regex.test( text );
573
  }
js/editor_plugin.js CHANGED
@@ -1,24 +1,24 @@
1
- (function() {
2
- tinymce.create('tinymce.plugins.Form_Maker_mce', {
3
- init : function(ed, url){
4
-
5
- ed.addCommand('mceForm_Maker_mce', function() {
6
- ed.windowManager.open({
7
- file : ((ajaxurl.indexOf("://") != -1) ? ajaxurl:(location.protocol+'//'+location.host+ajaxurl))+"?action=formmakerwindow",
8
- width : 400 + ed.getLang('Form_Maker_mce.delta_width', 0),
9
- height : 250 + ed.getLang('Form_Maker_mce.delta_height', 0),
10
- inline : 1
11
- }, {
12
- plugin_url : url // Plugin absolute URL
13
- });
14
- });
15
- ed.addButton('Form_Maker_mce', {
16
- title : 'Insert Form_Maker',
17
- cmd : 'mceForm_Maker_mce',
18
- });
19
- }
20
- });
21
-
22
- tinymce.PluginManager.add('Form_Maker_mce', tinymce.plugins.Form_Maker_mce);
23
-
24
  })();
1
+ (function() {
2
+ tinymce.create('tinymce.plugins.Form_Maker_mce', {
3
+ init : function(ed, url){
4
+
5
+ ed.addCommand('mceForm_Maker_mce', function() {
6
+ ed.windowManager.open({
7
+ file : ((ajaxurl.indexOf("://") != -1) ? ajaxurl:(location.protocol+'//'+location.host+ajaxurl))+"?action=formmakerwindow",
8
+ width : 400 + ed.getLang('Form_Maker_mce.delta_width', 0),
9
+ height : 250 + ed.getLang('Form_Maker_mce.delta_height', 0),
10
+ inline : 1
11
+ }, {
12
+ plugin_url : url // Plugin absolute URL
13
+ });
14
+ });
15
+ ed.addButton('Form_Maker_mce', {
16
+ title : 'Insert Form_Maker',
17
+ cmd : 'mceForm_Maker_mce',
18
+ });
19
+ }
20
+ });
21
+
22
+ tinymce.PluginManager.add('Form_Maker_mce', tinymce.plugins.Form_Maker_mce);
23
+
24
  })();
js/formmaker_free.js CHANGED
@@ -1,17183 +1,16679 @@
1
- j=2;//choices id
2
- var c;
3
- var a=new Array();
4
- var plugin_url="";
5
- var id_ifr_editor=500;
6
- var count_of_filds_form=7;
7
- if(ajaxurl.indexOf("://") != -1)
8
- var url_for_ajax=ajaxurl;
9
- else
10
- var url_for_ajax=location.protocol+'//'+location.host+ajaxurl;
11
-
12
- /**
13
- * Remove witespaces from childNodes.
14
- */
15
- function form_maker_remove_spaces(parent) {
16
- if (!parent) {
17
- parent = document;
18
- }
19
- var children = parent.childNodes;
20
- for (var i = children.length - 1; i >= 0; i--) {
21
- var child = children[i];
22
- if (child.nodeType == 3) {
23
- if (child.data.match(/^\s+$/)) {
24
- parent.removeChild(child);
25
- }
26
- }
27
- else {
28
- form_maker_remove_spaces(child);
29
- }
30
- }
31
- }
32
-
33
- function active_reset(val, id)
34
- {
35
- if(val)
36
- {
37
- document.getElementById(id+'_element_resetform_id_temp').style.display="inline";
38
- }
39
- else
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
- value=x.value;
56
-
57
- if(value==parseInt(value))
58
- {
59
- alert('The name of the field cannot be a number.');
60
- x.value="";
61
- document.getElementById(id+'_elementform_id_temp').name='';
62
- document.getElementById(id+'_element_labelform_id_temp').innerHTML='';
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
- function change_field_value(id, value)
79
- {
80
- document.getElementById(id+'_elementform_id_temp').value=value;
81
- }
82
-
83
- function return_attributes(id)
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 refresh_attr(x,type)
105
- {
106
- switch(type)
107
- {
108
- case "type_text":
109
-
110
- {
111
- id_array=Array();
112
- id_array[0]=x+'_elementform_id_temp';
113
- break;
114
- }
115
-
116
- case "type_name":
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 add_id_and_name(i,type)
245
- {
246
- switch(type)
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
- function refresh_id_name(i, type)
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
- function add_attr(i, type)
677
- {
678
-
679
- var el_attr_table=document.getElementById('attributes');
680
- j=parseInt(el_attr_table.lastChild.getAttribute('idi'))+1;
681
- w_attr_name[j]="attribute";
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
- function change_attribute_value(id, x, type)
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
- function change_attribute_name(id, x, type)
740
- {
741
- value=x.value;
742
- if(!value)
743
- {
744
- alert('The name of the attribute is required.');
745
- return;
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
- function remove_attr(id, el_id,type)
775
- {
776
- tr=document.getElementById("attr_row_"+id);
777
- tr.parentNode.removeChild(tr);
778
- refresh_attr(el_id, type);
779
- }
780
-
781
- function change_attributes(id, attr)
782
- {
783
-
784
- var div = document.createElement('div');
785
- var element=document.getElementById(id);
786
- element.setAttribute(attr, '');
787
- }
788
-
789
- function add_button(i)
790
- {
791
- edit_main_td4=document.getElementById('buttons');
792
- if(edit_main_td4.lastChild)
793
- j=parseInt(edit_main_td4.lastChild.getAttribute("idi"))+1;
794
- else
795
- j=1;
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
- function remove_button(j,i)
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
- function change_date_format(value, id)
916
- {
917
- input_p=document.getElementById(id+'_buttonform_id_temp');
918
- input_p.setAttribute("onclick", "return showCalendar('"+id+"_elementform_id_temp' , '"+value+"')");
919
- input_p.setAttribute("format", value);
920
- }
921
-
922
- function set_send(id)
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
- function change_class(x,id)
931
- {
932
- if(document.getElementById(id+'_label_sectionform_id_temp'))
933
- document.getElementById(id+'_label_sectionform_id_temp').setAttribute("class",x);
934
- if(document.getElementById(id+'_element_sectionform_id_temp'))
935
- document.getElementById(id+'_element_sectionform_id_temp').setAttribute("class",x);
936
- }
937
-
938
- function set_required(id)
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
- function set_unique(id)
953
- {
954
- if(document.getElementById(id).value=="yes")
955
- {
956
- document.getElementById(id).setAttribute("value", "no");
957
- }
958
- else
959
- {
960
- document.getElementById(id).setAttribute("value", "yes")
961
- }
962
- }
963
-
964
- function set_randomize(id)
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
- function set_allow_other(num, type)
1004
- {
1005
- if(document.getElementById(num+'_allow_otherform_id_temp').value=="yes")
1006
- {
1007
- document.getElementById(num+'_allow_otherform_id_temp').setAttribute("value", "no");
1008
- for(k=0;k<50;k++)
1009
- if( document.getElementById(num+"_elementform_id_temp"+k))
1010
- if( document.getElementById(num+"_elementform_id_temp"+k).getAttribute('other'))
1011
- if( document.getElementById(num+"_elementform_id_temp"+k).getAttribute('other')==1)
1012
- {
1013
- remove_choise(k,num);
1014
- break;
1015
- }
1016
-
1017
- }
1018
- else
1019
- {
1020
- document.getElementById(num+'_allow_otherform_id_temp').setAttribute("value", "yes");
1021
- var q=0;
1022
- if(document.getElementById(num+'_hor'))
1023
- {
1024
- q=1;
1025
- flow_ver(num);
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 flow_hor(id)
1093
- {
1094
- tbody=document.getElementById(id+'_table_little');
1095
- td_array= new Array();
1096
- n=tbody.childNodes.length;
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
- function flow_ver(id)
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
- function check_isnum_3_10(e)
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
- function set_sel_am_pm(select_)
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
- function change_captcha_digit(digit)
1159
- {
1160
- captcha=document.getElementById('_wd_captchaform_id_temp');
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
- function second_yes(id, w_ss)
1190
- {
1191
- time_box=document.getElementById(id+'_tr_time1');
1192
- text_box=document.getElementById(id+'_tr_time2');
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="&nbsp;:&nbsp;";
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
- function check_isnum(e)
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
- function change_w_style(id, w)
1259
- {
1260
- if(document.getElementById(id))
1261
- document.getElementById(id).style.width=w+"px";
1262
- }
1263
-
1264
- function change_w_label(id, w)
1265
- {
1266
- if(document.getElementById(id))
1267
- document.getElementById(id).innerHTML=w;
1268
- }
1269
-
1270
- function change_h_style(id, h)
1271
- {
1272
- document.getElementById(id).style.height=h+"px";
1273
- }
1274
-
1275
- function change_w(id, w)
1276
- {
1277
- document.getElementById(id).setAttribute("width", w)
1278
- }
1279
-
1280
- function change_h(id, h)
1281
- {
1282
- document.getElementById(id).setAttribute("height", h);
1283
- }
1284
-
1285
- function change_key(value, attribute)
1286
- {
1287
- document.getElementById('wd_recaptchaform_id_temp').setAttribute(attribute, value);
1288
- }
1289
-
1290
- function captcha_refresh(id)
1291
- {
1292
- srcArr=document.getElementById(id+"form_id_temp").src.split("&r=");
1293
- document.getElementById(id+"form_id_temp").src=srcArr[0]+'&r='+Math.floor(Math.random()*100);
1294
- document.getElementById(id+"_inputform_id_temp").value='';
1295
- }
1296
-
1297
- function up_row(id)
1298
- {
1299
- form=document.getElementById(id).parentNode;
1300
- k=0;
1301
-
1302
- while(form.childNodes[k])
1303
- {
1304
- if(form.childNodes[k].getAttribute("id"))
1305
- if(id==form.childNodes[k].getAttribute("id"))
1306
- break;
1307
- k++;
1308
- }
1309
-
1310
- if(k!=0)
1311
- {
1312
- up=form.childNodes[k-1];
1313
- down=form.childNodes[k];
1314
- form.removeChild(down);
1315
- form.insertBefore(down, up);
1316
- return;
1317
- }
1318
-
1319
- ///////////en depqum yerb section breaka
1320
- form_view_elemet =form.parentNode.parentNode.parentNode.parentNode;
1321
-
1322
- current_tr =form.parentNode.parentNode.parentNode;
1323
-
1324
- if(current_tr.previousSibling)
1325
- if(current_tr.previousSibling.nodeType==3)
1326
- {
1327
- if(current_tr.previousSibling.previousSibling.getAttribute('type'))
1328
- {
1329
- current_tr.previousSibling.previousSibling.previousSibling.previousSibling.firstChild.firstChild.firstChild.appendChild(document.getElementById(id));
1330
- return;
1331
- }
1332
- }
1333
- else
1334
- {
1335
- if(current_tr.previousSibling.getAttribute('type'))
1336
- {
1337
- current_tr.previousSibling.previousSibling.firstChild.firstChild.firstChild.appendChild(document.getElementById(id));
1338
- return;
1339
- }
1340
- }
1341
-
1342
-
1343
- ///////////pagei mej
1344
- page_up(id);
1345
- }
1346
-
1347
- function down_row(id)
1348
- {
1349
- form=document.getElementById(id).parentNode;
1350
- l=form.childNodes.length;
1351
- k=0;
1352
- while(form.childNodes[k])
1353
- {
1354
- if(id==form.childNodes[k].id)
1355
- break;
1356
- k++;
1357
- }
1358
-
1359
- if(k!=l-1)
1360
- {
1361
- ///////////ira mej
1362
- up=form.childNodes[k];
1363
- down=form.childNodes[k+2];
1364
- form.removeChild(up);
1365
-
1366
- if(!down)
1367
- down=null;
1368
-
1369
- form.insertBefore(up, down);
1370
- return;
1371
- }
1372
- ///////////en depqum yerb section breaka
1373
- form_view_elemet =form.parentNode.parentNode.parentNode.parentNode;
1374
-
1375
- current_tr =form.parentNode.parentNode.parentNode;
1376
-
1377
- if(current_tr.nextSibling.nodeType==3)
1378
- {
1379
- if(current_tr.nextSibling.nextSibling.getAttribute('type'))
1380
- {
1381
- current_tr.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.firstChild.firstChild.appendChild(document.getElementById(id));
1382
- return;
1383
- }
1384
- }
1385
- else
1386
- {
1387
- if(current_tr.nextSibling.getAttribute('type'))
1388
- {
1389
- current_tr.nextSibling.nextSibling.firstChild.firstChild.firstChild.appendChild(document.getElementById(id));
1390
- return;
1391
- }
1392
- }
1393
-
1394
-
1395
- ///////////pagei mej
1396
- page_down(id);
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 left_row(id)
1437
- {
1438
- tr=document.getElementById(id);
1439
- td_big=tr.parentNode.parentNode.parentNode;
1440
- table_big=tr.parentNode.parentNode;
1441
- if(table_big.previousSibling!=null)
1442
- {
1443
-
1444
- table_previous=table_big.previousSibling;
1445
- table_previous.firstChild.appendChild(tr);
1446
-
1447
- if(table_big.firstChild.firstChild==null)
1448
- td_big.removeChild(table_big);
1449
- }
1450
-
1451
- }
1452
-
1453
- function page_up(id)
1454
- {
1455
- form=document.getElementById(id).parentNode;
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
- function Disable()
1556
- {
1557
- select_=document.getElementById('sel_el_pos');
1558
- select_.setAttribute("disabled", "disabled");
1559
- select_.innerHTML="";
1560
- }
1561
-
1562
- function Enable()
1563
- {
1564
- var pos=document.getElementsByName("el_pos");
1565
- pos[0].setAttribute("checked", "checked");
1566
-
1567
- select_ = document.getElementById('sel_el_pos');
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
- function all_labels()
1604
- {
1605
- labels=new Array();
1606
- for(k=1;k<=form_view_max;k++)
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
- function set_checked(id,j)
1636
- {
1637
- checking=document.getElementById(id+"_elementform_id_temp"+j);
1638
- if(checking.checked)
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
- function set_default(id, j)
1658
- {
1659
- for(k=0; k<100; k++)
1660
- if(document.getElementById(id+"_elementform_id_temp"+k))
1661
- if(!document.getElementById(id+"_elementform_id_temp"+k).checked)
1662
- document.getElementById(id+"_elementform_id_temp"+k).removeAttribute("checked");
1663
- else
1664
- document.getElementById(id+"_elementform_id_temp"+j).setAttribute("checked", "checked");
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
- function set_select(select_)
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 change_hour(ev, id, hour_interval)
1693
- {
1694
- if(check_hour(ev, id, hour_interval))
1695
- {
1696
- input=document.getElementById(id);
1697
- input.setAttribute("value", input.value);
1698
- }
1699
- }
1700
-
1701
- function change_minute(ev, id)
1702
- {
1703
- if(check_minute(ev, id))
1704
- {
1705
- input=document.getElementById(id);
1706
- input.setAttribute("value", input.value);
1707
- }
1708
- }
1709
-
1710
- function change_second(ev, id)
1711
- {
1712
- if(check_second(ev, id))
1713
- {
1714
- input=document.getElementById(id);
1715
- input.setAttribute("value", input.value);
1716
- }
1717
- }
1718
-
1719
- function check_hour(e, id, hour_interval)
1720
- {
1721
- var chCode1 = e.which || e.keyCode;
1722
- if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57))
1723
- return false;
1724
- hour=""+document.getElementById(id).value+String.fromCharCode(chCode1);
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
- function change_month(ev, id)
1772
- {
1773
- if(check_month(ev, id))
1774
- {
1775
- input=document.getElementById(id);
1776
- input.setAttribute("value", input.value);
1777
- }
1778
- }
1779
-
1780
- function change_year(id)
1781
- {
1782
- year=document.getElementById(id).value;
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
- function check_day(e, id)
1796
- {
1797
- var chCode1 = e.which || e.keyCode;
1798
- if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57))
1799
- return false;
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
- function check_year1(e, id)
1851
- {
1852
- var chCode1 = e.which || e.keyCode;
1853
- if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57))
1854
- return false;
1855
-
1856
- year=""+document.getElementById(id).value+String.fromCharCode(chCode1);
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
- function label_left(num)
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
- function return_value(id)
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
- function change_value(id)
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
- function change_input_value(first_value, id)
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
- function change_file_value(destination, id, prefix , postfix )
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
- function close_window()
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
- alltypes=Array('customHTML','text','checkbox','radio','time_and_date','select','file_upload','captcha','map','button','page_break','section_break');
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
- function change_label(id, label)
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
- function change_in_value(id, label)
2011
- {
2012
- document.getElementById(id).setAttribute("value", label);
2013
- }
2014
-
2015
- function change_size(size, num)
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
- function add_choise(type, num)
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
- function remove_choise(id, num)
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
- function remove_option(id, num)
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
- function getIFrameDocument(aID){
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
- function delete_last_child()
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
- document.getElementById('main_editor').style.display="none";
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
- function format_12(num, am_or_pm, w_hh, w_mm, w_ss)
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
- function format_24(num)
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
- function format_extended(num)
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
- function format_normal(num)
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
- document.getElementById("element_type").value="type_section_break";
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
- function type_editor(i, w_editor){
2482
-
2483
- document.getElementById("element_type").value="type_editor";
2484
- delete_last_child();
2485
- // edit table
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
- function type_submit_reset(i, w_submit_title , w_reset_title , w_class, w_act, w_attr_name, w_attr_value){
2529
-
2530
- document.getElementById("element_type").value="type_submit_reset";
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
- element='button'; type1='button'; type2='button';
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
- var label = document.createElement('span');
2867
- label.setAttribute("id", i+"_element_labelform_id_temp");
2868
- label.style.cssText = 'display:none';
2869
- label.innerHTML = "type_submit_reset_"+i;
2870
- var main_td = document.getElementById('show_table');
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
- document.getElementById("element_type").value="type_hidden";
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
- element='input'; type='hidden';
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
- var label = document.createElement('span');
3158
- label.setAttribute("id", i+"_element_labelform_id_temp");
3159
- label.style.cssText = 'display:none';
3160
- label.innerHTML = w_name;
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 type_button(i, w_title , w_func , w_class, w_attr_name, w_attr_value){
3177
- document.getElementById("element_type").value="type_button";
3178
- delete_last_child();
3179
- // edit table
3180
- var edit_div = document.createElement('div');
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&nbsp;";
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
- edit_div.appendChild(edit_main_table);
3452
-
3453
- t.appendChild(edit_div);
3454
-
3455
- //show table
3456
-
3457
- element='button'; type='button';
3458
- var adding_type = document.createElement("input");
3459
- adding_type.setAttribute("type", "hidden");
3460
- adding_type.setAttribute("value", "type_button");
3461
- adding_type.setAttribute("name", i+"_typeform_id_temp");
3462
- adding_type.setAttribute("id", i+"_typeform_id_temp");
3463
- var div = document.createElement('div');
3464
- div.setAttribute("id", "main_div");
3465
- //tbody sarqac
3466
-
3467
-
3468
- var table = document.createElement('table');
3469
- table.setAttribute("id", i+"_elemet_tableform_id_temp");
3470
-
3471
- var tr = document.createElement('tr');
3472
- var td1 = document.createElement('td');
3473
- td1.setAttribute("valign", 'middle');
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
- div.appendChild(table);
3518
- div.appendChild(br1);
3519
- main_td.appendChild(div);
3520
- change_class(w_class, i);
3521
- refresh_attr(i, 'type_checkbox');
3522
- }
3523
-
3524
- function type_text(i, w_field_label, w_field_label_pos, w_size, w_first_val, w_title, w_required, w_unique, w_class, w_attr_name, w_attr_value) {
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_sty