Contact Form by WD – responsive drag & drop contact form builder tool - Version 1.5.1

Version Description

Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 Contact Form by WD – responsive drag & drop contact form builder tool
Version 1.5.1
Comparing to
See all releases

Code changes from version 1.5 to 1.5.1

Submissions.html.php CHANGED
@@ -1,850 +1,850 @@
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
- alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.');
48
- }
49
- function renderColumns()
50
- {
51
- allTags=document.getElementsByTagName('*');
52
-
53
- for(curTag in allTags)
54
- {
55
- if(typeof(allTags[curTag].className)!="undefined")
56
- if(allTags[curTag].className.indexOf('_fc')>0)
57
- {
58
- curLabel=allTags[curTag].className.replace('_fc','');
59
- if(document.forms.admin_form.hide_label_list.value.indexOf('@'+curLabel+'@')>=0)
60
- allTags[curTag].style.display = 'none';
61
- else
62
- allTags[curTag].style.display = '';
63
- }
64
- if(typeof(allTags[curTag].id)!="undefined")
65
- if(allTags[curTag].id.indexOf('_fc')>0)
66
- {
67
- curLabel=allTags[curTag].id.replace('_fc','');
68
- if(document.forms.admin_form.hide_label_list.value.indexOf('@'+curLabel+'@')>=0)
69
- allTags[curTag].style.display = 'none';
70
- else
71
- allTags[curTag].style.display = '';
72
- }
73
- }
74
- }
75
-
76
- function clickLabChB(label, ChB)
77
- {
78
- document.forms.admin_form.hide_label_list.value=document.forms.admin_form.hide_label_list.value.replace('@'+label+'@','');
79
- if(document.forms.admin_form.hide_label_list.value=='') document.getElementById('ChBAll').checked=true;
80
-
81
- if(!(ChB.checked))
82
- {
83
- document.forms.admin_form.hide_label_list.value+='@'+label+'@';
84
- document.getElementById('ChBAll').checked=false;
85
- }
86
- renderColumns();
87
- }
88
-
89
-
90
- function clickLabChBAll(ChBAll)
91
- {
92
- <?php
93
- if(isset($labels))
94
- {
95
- $templabels=array_merge(array('submitid','submitdate','submitterip'),$labels_id);
96
- $label_titles=array_merge(array('ID','Submit date', "Submitter's IP Address"),$label_titles);
97
- }
98
- ?>
99
-
100
- if(ChBAll.checked)
101
- {
102
- document.forms.admin_form.hide_label_list.value='';
103
-
104
- for(i=0; i<=ChBAll.form.length; i++)
105
- if(typeof(ChBAll.form[i])!="undefined")
106
- if(ChBAll.form[i].type=="checkbox")
107
- ChBAll.form[i].checked=true;
108
- }
109
- else
110
- {
111
- document.forms.admin_form.hide_label_list.value='@<?php echo implode($templabels,'@@') ?>@';
112
-
113
- for(i=0; i<=ChBAll.form.length; i++)
114
- if(typeof(ChBAll.form[i])!="undefined")
115
- if(ChBAll.form[i].type=="checkbox")
116
- ChBAll.form[i].checked=false;
117
- }
118
-
119
- renderColumns();
120
- }
121
-
122
- function remove_all()
123
- {
124
- document.getElementById('startdate').value='';
125
- document.getElementById('enddate').value='';
126
- document.getElementById('ip_search').value='';
127
- <?php
128
- $n=count($rows);
129
-
130
- for($i=0; $i < count($labels) ; $i++)
131
- {
132
- echo "document.getElementById('".$form_id.'_'.$labels_id[$i]."_search').value='';
133
- ";
134
- }
135
- ?>
136
- }
137
-
138
- function show_hide_filter()
139
- {
140
- if(document.getElementById('fields_filter').style.display=="none")
141
- {
142
- document.getElementById('fields_filter').style.display='';
143
- document.getElementById('filter_img').src='<?php echo plugins_url('images/filter_hide.png',__FILE__) ?>';
144
- }
145
- else{
146
- document.getElementById('fields_filter').style.display="none";
147
- document.getElementById('filter_img').src='<?php echo plugins_url('images/filter_show.png',__FILE__) ?>';
148
- }
149
- }
150
- function submit_del(href_in)
151
- {
152
- document.getElementById('admin_form').action=href_in;
153
- document.getElementById('admin_form').submit();
154
- }
155
- <!--
156
- function submitbutton(pressbutton) {
157
- var form = document.adminForm;
158
- if (pressbutton == 'cancel_theme') {
159
- submitform( pressbutton );
160
- return;
161
- }
162
-
163
- if(document.getElementById('title').value==''){
164
- alert('The theme must have a title')
165
- return;
166
- }
167
- submitform( pressbutton );
168
- }
169
-
170
-
171
-
172
-
173
- function submitform( pressbutton ){
174
- document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
175
- document.getElementById('adminForm').submit();
176
- }
177
- //-->
178
-
179
- function change_width(){
180
- width=parseInt(document.getElementById('width').value)+45+parseInt(document.getElementById('border_width').value);
181
- height=550;
182
-
183
- document.getElementById('spider_calendar_preview').href="http://localhost/wordpress/wp-content/plugins/spider-calendar/preview.php?TB_iframe=1&tbWidth="+width+"&tbHeight="+height;
184
- }
185
-
186
-
187
- var thickDims, tbWidth, tbHeight;
188
- jQuery(document).ready(function($) {
189
-
190
- thickDims = function() {
191
- var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
192
-
193
- w = (tbWidth && tbWidth < W - 90) ? tbWidth : W - 200;
194
- h = (tbHeight && tbHeight < H - 60) ? tbHeight : H - 200;
195
-
196
- if ( tbWindow.size() ) {
197
- tbWindow.width(w).height(h);
198
- $('#TB_iframeContent').width(w).height(h - 27);
199
- tbWindow.css({'margin-left': '-' + parseInt((w / 2),10) + 'px'});
200
- if ( typeof document.body.style.maxWidth != 'undefined' )
201
- tbWindow.css({'top':(H-h)/2,'margin-top':'0'});
202
- }
203
- };
204
-
205
- thickDims();
206
- $(window).resize( function() { thickDims() } );
207
-
208
- $('a.thickbox-preview').click( function() {
209
- tb_click.call(this);
210
-
211
- var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text;
212
-
213
- if ( tbWidth = href.match(/&tbWidth=[0-9]+/) )
214
- tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
215
- else
216
- tbWidth = $(window).width() - 90;
217
-
218
- if ( tbHeight = href.match(/&tbHeight=[0-9]+/) )
219
- tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
220
- else
221
- tbHeight = $(window).height() - 60;
222
-
223
- if ( alink.length ) {
224
- url = alink.attr('href') || '';
225
- text = alink.attr('title') || '';
226
- link = '&nbsp; <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
227
- } else {
228
- text = $(this).attr('title') || '';
229
- link = '&nbsp; <span class="tb-theme-preview-link">' + text + '</span>';
230
- }
231
-
232
- $('#TB_title').css({'background-color':'#222','color':'#dfdfdf'});
233
- $('#TB_closeAjaxWindow').css({'float':'left'});
234
- $('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
235
-
236
- $('#TB_iframeContent').width('100%');
237
- thickDims();
238
-
239
- return false;
240
- } );
241
-
242
- // Theme details
243
- $('.theme-detail').click(function () {
244
- $(this).siblings('.themedetaildiv').toggle();
245
- return false;
246
- });
247
-
248
- });
249
-
250
-
251
- </script>
252
-
253
- <style>
254
-
255
- .reports
256
- {
257
- border:1px solid #DEDEDE;
258
- border-radius:11px;
259
- background-color:#F0F0F0;
260
- text-align:center;
261
- width:100px;
262
- }
263
-
264
- .bordered
265
- {
266
- border-radius:8px
267
- }
268
-
269
- .simple_table
270
- {
271
- background-color:transparent; !important
272
- }
273
- </style>
274
- <?php
275
- if(isset($labels))
276
- {
277
- ?>
278
- <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>
279
- <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">
280
-
281
- <form action="#">
282
- <p style="font-weight:bold; font-size:18px;margin-top: 0px;">
283
- Select Columns
284
- </p>
285
-
286
- <input type="checkbox" <?php if($lists['hide_label_list']==='') echo 'checked="checked"' ?> onclick="clickLabChBAll(this)" id="ChBAll" />All</br>
287
-
288
- <?php
289
-
290
- foreach($templabels as $key => $curlabel)
291
- {
292
- if(strpos($lists['hide_label_list'],'@'.$curlabel.'@')===false)
293
- echo '<input type="checkbox" checked="checked" onclick="clickLabChB(\''.$curlabel.'\', this)" />'.$label_titles[$key].'<br />';
294
- else
295
- echo '<input type="checkbox" onclick="clickLabChB(\''.$curlabel.'\', this)" />'.$label_titles[$key].'<br />';
296
- }
297
-
298
-
299
- ?>
300
- <br />
301
- <div style="text-align:center;">
302
- <input type="button" onclick="toggleChBDiv(false);" value="Done" />
303
- </div>
304
- </form>
305
- </div>
306
-
307
- <?php } ?>
308
-
309
- <form action="admin.php?page=contact_form_Submits" style="overflow-x: scroll;" method="post" id="admin_form" name="admin_form">
310
- <input type="hidden" name="option" value="com_formmaker">
311
- <input type="hidden" name="task" value="submits">
312
- <input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if(isset($_POST['asc_or_desc'])) echo $_POST['asc_or_desc'] ?>">
313
- <input type="hidden" name="order_by" id="order_by" value="<?php if(isset($_POST['order_by'])) echo $_POST['order_by'] ?>">
314
- <br />
315
- <table width="95%">
316
- <tr>
317
- <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
318
- <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="color:red; text-decoration:none;">
319
- <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
320
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
321
- </a>
322
- </div></td>
323
- </tr>
324
- <tr style="line-height:inherit !important;" >
325
- <td align="left" width="300"> Select a form:
326
- <select name="form_id" id="form_id" onchange="if(document.getElementById('startdate'))remove_all();document.admin_form.submit();">
327
- <option value="0" selected="selected"> Select a Form </option>
328
- <?php
329
- $option='com_formmaker';
330
-
331
- // $form_id=$mainframe-> getUserStateFromRequest( $option.'form_id', 'form_id','id','cmd' );
332
- if( $forms)
333
- for($i=0, $n=count($forms); $i < $n ; $i++)
334
-
335
- {
336
- $form = $forms[$i];
337
-
338
-
339
- if($form_id==$form->id)
340
- {
341
- echo "<option value='".$form->id."' selected='selected'>".$form->title."</option>";
342
- $form_title=$form->title;
343
- }
344
- else
345
- echo "<option value='".$form->id."' >".$form->title."</option>";
346
- }
347
- ?>
348
- </select>
349
- </td>
350
- <?php if(isset($form_id) and $form_id>0): ?>
351
- <td class="reports" ><strong>Entries</strong><br /><?php echo $total_entries; ?></td>
352
- <td class="reports"><strong>Views</strong><br /><?php echo $total_views ?></td>
353
- <td class="reports"><strong>Conversion Rate</strong><br /><?php if($total_views) echo round((($total_entries/$total_views)*100),2).'%'; else echo '0%' ?></td>
354
- <td style="font-size:36px;text-align:center;line-height: initial;">
355
- <?php echo $form_title ?>
356
- </td>
357
- <td style="text-align:right;" width="300">
358
- Export to
359
- <input type="button" value="CSV" onclick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.');" />&nbsp;
360
- <input type="button" value="XML" onclick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.');" />
361
- </td>
362
-
363
- </tr>
364
-
365
- <tr>
366
-
367
- <td colspan=5>
368
- <br />
369
- <input type="hidden" name="hide_label_list" value="<?php echo $lists['hide_label_list']; ?>"/>
370
- <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" />
371
- <input type="button" onclick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.');" value="Go" />
372
- <input type="button" onclick="remove_all();this.form.submit();" value="Reset" />
373
- </td>
374
- <td align="right">
375
- <br /><br />
376
- <?php if(isset($labels)) echo '<input type="button" onclick="alert(\'This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.\');" value="Add/Remove Columns" />'; ?>
377
- </td>
378
- </tr>
379
-
380
- <?php else: echo '<td><br /><br /><br /></td></tr>'; endif; ?>
381
- </table>
382
- <?php print_html_nav($pageNav['total'],$pageNav['limit']);
383
- ?>
384
- <table class="wp-list-table widefat fixed posts" style="width:95%; table-layout: inherit !important;" >
385
- <thead>
386
- <tr>
387
- <th width="3%"><?php echo '#'; ?></th>
388
-
389
- <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input type="checkbox"></th>
390
- <?php
391
-
392
-
393
- ?> <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
394
- ?> <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
395
- ?> <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
396
-
397
-
398
-
399
- $n=count($rows);
400
-
401
-
402
- for($i=0; $i < count($labels) ; $i++)
403
- {
404
- if(strpos($lists['hide_label_list'],'@'.$labels_id[$i].'@')===false) $styleStr='';
405
- else $styleStr='display:none;';
406
- if($sorted_labels_type[$i]=='type_address')
407
- switch($label_titles_copy[$i])
408
- {
409
- case 'Street Line': $field_title=__('Street Address', 'form_maker'); break;
410
- case 'Street Line2': $field_title=__('Street Address Line 2', 'form_maker'); break;
411
- case 'City': $field_title=__('City', 'form_maker'); break;
412
- case 'State': $field_title=__('State / Province / Region', 'form_maker'); break;
413
- case 'Postal': $field_title=__('Postal / Zip Code', 'form_maker'); break;
414
- case 'Country': $field_title=__('Country', 'form_maker'); break;
415
- default : $field_title=$label_titles_copy[$i]; break;
416
- }
417
- else
418
- $field_title=$label_titles_copy[$i];
419
- ?>
420
-
421
- <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>
422
-
423
- <?php }
424
- ?>
425
- <th style="width:80px">Edit</th>
426
- <th style="width:80px"><a href="javascript:submit_del('admin.php?page=contact_form_Submits&task=remov_cheched')">Delete</a></th>
427
- </tr>
428
- <tr id="fields_filter" style="display:none">
429
- <th width="3%"></th>
430
- <th width="3%"></th>
431
- <th width="4%" class="submitid_fc" <?php if(!(strpos($lists['hide_label_list'],'@submitid@')===false)) echo 'style="display:none;"';?> ></th>
432
- <th width="150" class="submitdate_fc" style="margin:inherit; <?php if(!(strpos($lists['hide_label_list'],'@submitdate@')===false)) echo 'display:none;';?>">
433
- <table align="center" style="margin:auto" class="simple_table">
434
- <tr class="simple_table">
435
- <td class="simple_table" style="text-align:left">From:</td>
436
- <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>
437
- <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>
438
- </tr>
439
- <tr class="simple_table">
440
- <td style="text-align:left" class="simple_table">To:</td>
441
- <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>
442
- <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>
443
- </tr>
444
- </table>
445
- </th>
446
- <th width="100"class="submitterip_fc" <?php if(!(strpos($lists['hide_label_list'],'@submitterip@')===false)) echo 'style="display:none;"';?>>
447
- <input type="text" name="ip_search" id="ip_search" value="<?php echo $lists['ip_search'] ?>" onChange="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.');"/>
448
- </th>
449
- <?php
450
- $n=count($rows);
451
- $ka_fielderov_search=false;
452
-
453
- if($lists['ip_search'] || $lists['startdate'] || $lists['enddate']){
454
- $ka_fielderov_search=true;
455
- }
456
-
457
- for($i=0; $i < count($labels) ; $i++)
458
- {
459
- if(strpos($lists['hide_label_list'],'@'.$labels_id[$i].'@')===false)
460
- $styleStr='';
461
- else
462
- $styleStr='style="display:none;"';
463
-
464
- if(!$ka_fielderov_search)
465
- if($lists[$form_id.'_'.$labels_id[$i].'_search'])
466
- {
467
- $ka_fielderov_search=true;
468
- }
469
-
470
- if($sorted_labels_type[$i]!='type_mark_map')
471
- 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="alert(\'This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.\');" >'.'</th>';
472
- else
473
- echo '<th class="'.$labels_id[$i].'_fc" '.$styleStr.'>'.'</th>';
474
- }
475
- ?>
476
- <th></th><th></th>
477
- </tr>
478
- </thead>
479
- <?php
480
- $k = 0;
481
- $m=count($labels);
482
- $group_id_s= array();
483
- $l=0;
484
- if(count($rows_ord)>0 and $m)
485
- for($i=0; $i <count($rows_ord); $i++)
486
- {
487
-
488
- $row =$rows_ord[$i];
489
-
490
- if(!in_array($row->group_id, $group_id_s))
491
- {
492
-
493
- array_push($group_id_s, $row->group_id);
494
-
495
- }
496
-
497
- }
498
- for($www=0, $qqq=count($group_id_s); $www < $qqq ; $www++)
499
- {
500
- $i=$group_id_s[$www];
501
-
502
- $temp= array();
503
- for($j=0; $j < $n ; $j++)
504
- {
505
- $row = $rows[$j];
506
- if($row->group_id==$i)
507
- {
508
- array_push($temp, $row);
509
- }
510
- }
511
- $f=$temp[0];
512
- $date=$f->date;
513
- $ip=$f->ip;
514
- // $checked = JHTML::_('grid.id', $www, $group_id_s[$www]);
515
- $link="admin.php?page=contact_form_Submits&task=edit_submit&id=".$f->group_id;
516
- ?>
517
-
518
- <tr class="<?php echo "row$k"; ?>">
519
-
520
- <td ><?php echo $www+1;?></td>
521
-
522
- <th style="text-align:center" class="check-column"><input type="checkbox" name="post[]" value="<?php echo $f->group_id; ?>"></th>
523
-
524
- <?php
525
-
526
- if(strpos($lists['hide_label_list'],'@submitid@')===false)
527
- echo '<td class="submitid_fc"><a href="'.$link.'" >'.$f->group_id.'</a></td>';
528
- else
529
- echo '<td class="submitid_fc" style="display:none;"><a href="'.$link.'" >'.$f->group_id.'</a></td>';
530
-
531
- if(strpos($lists['hide_label_list'],'@submitdate@')===false)
532
- echo '<td class="submitdate_fc"><a href="'.$link.'" >'.$date.'</a></td>';
533
- else
534
- echo '<td class="submitdate_fc" style="display:none;"><a href="'.$link.'" >'.$date.'</a></td>';
535
-
536
- if(strpos($lists['hide_label_list'],'@submitterip@')===false)
537
- echo '<td class="submitterip_fc"><a href="'.$link.'" >'.$ip.'</a></td>';
538
- else
539
- echo '<td class="submitterip_fc" style="display:none;"><a href="'.$link.'" >'.$ip.'</a></td>';
540
-
541
-
542
-
543
- //print_r($temp);
544
- $ttt=count($temp);
545
- for($h=0; $h < $m ; $h++)
546
- {
547
- $not_label=true;
548
- for($g=0; $g < $ttt ; $g++)
549
- {
550
- $t = $temp[$g];
551
- if(strpos($lists['hide_label_list'],'@'.$labels_id[$h].'@')===false) $styleStr='';
552
- else $styleStr='style="display:none;"';
553
- if($t->element_label==$labels_id[$h])
554
- {
555
-
556
- if(strpos($t->element_value,"***map***"))
557
- {
558
- $map_params=explode('***map***',$t->element_value);
559
-
560
- $longit =$map_params[0];
561
- $latit =$map_params[1];
562
-
563
- 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>";
564
- }
565
- else
566
-
567
- if(strpos($t->element_value,"*@@url@@*"))
568
- {
569
- $new_file=str_replace("*@@url@@*",'', str_replace("***br***",'<br>', $t->element_value));
570
- $new_filename=explode('/', $new_file);
571
- echo '<td class="'.$labels_id[$h].'_fc" '.$styleStr.'><a target="_blank" href="'.$new_file.'">'.$new_filename[count($new_filename)-1]."</td>";
572
- }
573
- else
574
- echo '<td class="'.$labels_id[$h].'_fc" '.$styleStr.'><pre style="font-family:inherit">'.str_replace("***br***",'<br>', $t->element_value).'</pre></td>';
575
- $not_label=false;
576
- }
577
- }
578
- if($not_label)
579
- echo '<td class="'.$labels_id[$h].'_fc" '.$styleStr.'></td>';
580
- }
581
- ?>
582
- <td><a href="javascript:submit_del('admin.php?page=contact_form_Submits&task=edit_submit&id=<?php echo $f->group_id; ?>')">Edit</a></td>
583
- <td><a href="javascript:submit_del('admin.php?page=contact_form_Submits&task=remove_submit&id=<?php echo $f->group_id; ?>')">Delete</a></td>
584
- </tr>
585
-
586
- <?php
587
-
588
-
589
- $k = 1 - $k;
590
-
591
- }
592
-
593
- ?>
594
-
595
- </table>
596
-
597
-
598
-
599
- <?php
600
- foreach($sorted_labels_type as $key => $label_type)
601
- {
602
- if($label_type=="type_checkbox" || $label_type=="type_radio" || $label_type=="type_own_select" || $label_type=="type_country")
603
- {
604
- ?>
605
- <br />
606
- <br />
607
-
608
- <strong><?php echo $label_titles_copy[$key]?></strong>
609
- <br />
610
- <br />
611
-
612
- <?php
613
-
614
- $query = "SELECT element_value FROM ".$wpdb->prefix."formmaker_submits ".$where_choices." AND element_label='".$labels_id[$key]."'";
615
- $choices = $wpdb->get_results($query);
616
- $colors=array('#2CBADE','#FE6400');
617
- $choices_labels=array();
618
- $choices_count=array();
619
- $all=count($choices);
620
- $unanswered=0;
621
- foreach($choices as $key => $choice)
622
- {
623
- if($choice->element_value=='')
624
- {
625
- $unanswered++;
626
- }
627
- else
628
- {
629
- if(!in_array( $choice->element_value,$choices_labels))
630
- {
631
- array_push($choices_labels, $choice->element_value);
632
- array_push($choices_count, 0);
633
- }
634
-
635
- $choices_count[array_search($choice->element_value, $choices_labels)]++;
636
- }
637
- }
638
- array_multisort($choices_count,SORT_DESC,$choices_labels);
639
- ?>
640
- <table width="95%" style="width:95%" class="wp-list-table widefat fixed posts">
641
- <thead>
642
- <tr>
643
- <th width="20%">Choices</th>
644
- <th>Percentage</th>
645
- <th width="10%">Count</th>
646
- </tr>
647
- </thead>
648
- <?php
649
- foreach($choices_labels as $key => $choices_label)
650
- {
651
- ?>
652
- <tr>
653
- <td><?php echo str_replace("***br***",'<br>', $choices_label)?></td>
654
- <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>
655
- <td><?php echo $choices_count[$key]?></td>
656
- </tr>
657
- <?php
658
- }
659
-
660
- if($unanswered){
661
- ?>
662
- <tr>
663
- <td colspan="2" align="right">Unanswered</th>
664
- <td><strong><?php echo $unanswered;?></strong></th>
665
- </tr>
666
-
667
- <?php
668
- }
669
- ?>
670
- <tr>
671
- <td colspan="2" align="right"><strong>Total</strong></th>
672
- <td><strong><?php echo $all;?></strong></th>
673
- </tr>
674
-
675
- </table>
676
- <?php
677
- }
678
- }
679
- ?>
680
-
681
-
682
-
683
- <input type="hidden" name="boxchecked" value="0">
684
-
685
- <input type="hidden" name="filter_order2" value="<?php echo $lists['order']; ?>" />
686
-
687
- <input type="hidden" name="filter_order_Dir2" value="<?php echo $lists['order_Dir']; ?>" />
688
-
689
- </form>
690
-
691
- <script>
692
- <?php if($ka_fielderov_search){?>
693
- document.getElementById('fields_filter').style.display='';
694
- <?php
695
- }?>
696
- </script>
697
-
698
- <?php
699
-
700
-
701
- }
702
-
703
-
704
-
705
-
706
-
707
-
708
-
709
-
710
-
711
-
712
-
713
-
714
-
715
- function html_editSubmit($rows, $labels_id ,$labels_name,$labels_type){
716
- ?>
717
-
718
- <script language="javascript" type="text/javascript">
719
-
720
- function submitbutton(pressbutton) {
721
- var form = document.adminForm;
722
-
723
- if (pressbutton == 'cancel_submit')
724
- {
725
- submitform( pressbutton );
726
- return;
727
- }
728
-
729
- submitform( pressbutton );
730
- }
731
- function submitform(pressbutton)
732
- {
733
-
734
- document.getElementById('adminForm').action=document.getElementById('adminForm').action+'&task='+pressbutton;
735
- document.getElementById('adminForm').submit();
736
- }
737
- </script>
738
- <table width="90%">
739
- <tbody>
740
- <tr>
741
- <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
742
- <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="color:red; text-decoration:none;">
743
- <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
744
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
745
- </a>
746
- </div></td>
747
- </tr>
748
- <tr>
749
- <td width="100%"><h2>Edit Submission</h2></td>
750
- <td align="right"><input type="button" onclick="submitbutton('save_submit')" value="Save" class="button-secondary action"> </td>
751
- <td align="right"><input type="button" onclick="submitbutton('appply_submit')" value="Apply" class="button-secondary action"> </td>
752
- <td align="right"><input type="button" onclick="submitbutton('cancel')" value="Cancel" class="button-secondary action"> </td>
753
- </tr>
754
- </tbody></table>
755
- <form action="admin.php?page=contact_form_Submits&id=<?php echo $_GET['id']; ?>" method="post" id="adminForm" name="adminForm">
756
- <table class="admintable">
757
- <tr>
758
- <td class="key">
759
- <label for="ID">ID: </label>
760
- </td>
761
- <td >
762
- <?php echo $rows[0]->group_id;?>
763
- </td>
764
- </tr>
765
-
766
- <tr>
767
- <td class="key">
768
- <label for="Date">Date:
769
- </label>
770
- </td>
771
- <td >
772
- <?php echo $rows[0]->date;?>
773
- </td>
774
- </tr>
775
- <tr>
776
- <td class="key">
777
- <label for="IP">IP:</label>
778
- </td>
779
- <td >
780
- <?php echo $rows[0]->ip;?>
781
- </td>
782
- </tr>
783
-
784
- <?php
785
- foreach($labels_id as $key => $label_id)
786
- {
787
- 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')
788
- {
789
- $element_value='';
790
- foreach($rows as $row)
791
- {
792
- if($row->element_label==$label_id)
793
- {
794
- $element_value= $row->element_value;
795
- break;
796
- }
797
- }
798
- if($labels_type[$key]!='type_checkbox')
799
- echo ' <tr>
800
- <td class="key">
801
- <label for="title">
802
- '.$labels_name[$key].'
803
- </label>
804
- </td>
805
- <td >
806
- <input type="text" name="submission_'.$label_id.'" id="submission_'.$label_id.'" value="'.str_replace("*@@url@@*",'',$element_value).'" size="80" />
807
- </td>
808
- </tr>
809
- ';
810
- else
811
- {
812
- $choices = explode('***br***',$element_value);
813
- $choices = array_slice($choices,0, count($choices)-1);
814
- echo ' <tr>
815
- <td class="key" rowspan="'.count($choices).'">
816
- <label for="title">
817
- '.$labels_name[$key].'
818
- </label>
819
- </td>';
820
- foreach($choices as $choice_key => $choice)
821
- echo '
822
- <td >
823
- <input type="text" name="submission_'.$label_id.'_'.$choice_key.'" id="submission_'.$label_id.'_'.$choice_key.'" value="'.$choice.'" size="80" />
824
- </td>
825
- </tr>
826
- ';
827
- }
828
- }
829
- }
830
-
831
- ?>
832
- </table>
833
- <input type="hidden" name="option" value="com_formmaker" />
834
- <input type="hidden" name="id" value="<?php echo $rows[0]->group_id?>" />
835
- <input type="hidden" name="form_id" value="<?php echo $rows[0]->form_id?>" />
836
- <input type="hidden" name="date" value="<?php echo $rows[0]->date?>" />
837
- <input type="hidden" name="ip" value="<?php echo $rows[0]->ip?>" />
838
- <input type="hidden" name="task" value="save_submit" />
839
- </form>
840
- <?php
841
-
842
-
843
-
844
-
845
- }
846
-
847
-
848
-
849
-
850
  ?>
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
+ alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.');
48
+ }
49
+ function renderColumns()
50
+ {
51
+ allTags=document.getElementsByTagName('*');
52
+
53
+ for(curTag in allTags)
54
+ {
55
+ if(typeof(allTags[curTag].className)!="undefined")
56
+ if(allTags[curTag].className.indexOf('_fc')>0)
57
+ {
58
+ curLabel=allTags[curTag].className.replace('_fc','');
59
+ if(document.forms.admin_form.hide_label_list.value.indexOf('@'+curLabel+'@')>=0)
60
+ allTags[curTag].style.display = 'none';
61
+ else
62
+ allTags[curTag].style.display = '';
63
+ }
64
+ if(typeof(allTags[curTag].id)!="undefined")
65
+ if(allTags[curTag].id.indexOf('_fc')>0)
66
+ {
67
+ curLabel=allTags[curTag].id.replace('_fc','');
68
+ if(document.forms.admin_form.hide_label_list.value.indexOf('@'+curLabel+'@')>=0)
69
+ allTags[curTag].style.display = 'none';
70
+ else
71
+ allTags[curTag].style.display = '';
72
+ }
73
+ }
74
+ }
75
+
76
+ function clickLabChB(label, ChB)
77
+ {
78
+ document.forms.admin_form.hide_label_list.value=document.forms.admin_form.hide_label_list.value.replace('@'+label+'@','');
79
+ if(document.forms.admin_form.hide_label_list.value=='') document.getElementById('ChBAll').checked=true;
80
+
81
+ if(!(ChB.checked))
82
+ {
83
+ document.forms.admin_form.hide_label_list.value+='@'+label+'@';
84
+ document.getElementById('ChBAll').checked=false;
85
+ }
86
+ renderColumns();
87
+ }
88
+
89
+
90
+ function clickLabChBAll(ChBAll)
91
+ {
92
+ <?php
93
+ if(isset($labels))
94
+ {
95
+ $templabels=array_merge(array('submitid','submitdate','submitterip'),$labels_id);
96
+ $label_titles=array_merge(array('ID','Submit date', "Submitter's IP Address"),$label_titles);
97
+ }
98
+ ?>
99
+
100
+ if(ChBAll.checked)
101
+ {
102
+ document.forms.admin_form.hide_label_list.value='';
103
+
104
+ for(i=0; i<=ChBAll.form.length; i++)
105
+ if(typeof(ChBAll.form[i])!="undefined")
106
+ if(ChBAll.form[i].type=="checkbox")
107
+ ChBAll.form[i].checked=true;
108
+ }
109
+ else
110
+ {
111
+ document.forms.admin_form.hide_label_list.value='@<?php echo implode($templabels,'@@') ?>@';
112
+
113
+ for(i=0; i<=ChBAll.form.length; i++)
114
+ if(typeof(ChBAll.form[i])!="undefined")
115
+ if(ChBAll.form[i].type=="checkbox")
116
+ ChBAll.form[i].checked=false;
117
+ }
118
+
119
+ renderColumns();
120
+ }
121
+
122
+ function remove_all()
123
+ {
124
+ document.getElementById('startdate').value='';
125
+ document.getElementById('enddate').value='';
126
+ document.getElementById('ip_search').value='';
127
+ <?php
128
+ $n=count($rows);
129
+
130
+ for($i=0; $i < count($labels) ; $i++)
131
+ {
132
+ echo "document.getElementById('".$form_id.'_'.$labels_id[$i]."_search').value='';
133
+ ";
134
+ }
135
+ ?>
136
+ }
137
+
138
+ function show_hide_filter()
139
+ {
140
+ if(document.getElementById('fields_filter').style.display=="none")
141
+ {
142
+ document.getElementById('fields_filter').style.display='';
143
+ document.getElementById('filter_img').src='<?php echo plugins_url('images/filter_hide.png',__FILE__) ?>';
144
+ }
145
+ else{
146
+ document.getElementById('fields_filter').style.display="none";
147
+ document.getElementById('filter_img').src='<?php echo plugins_url('images/filter_show.png',__FILE__) ?>';
148
+ }
149
+ }
150
+ function submit_del(href_in)
151
+ {
152
+ document.getElementById('admin_form').action=href_in;
153
+ document.getElementById('admin_form').submit();
154
+ }
155
+ <!--
156
+ function submitbutton(pressbutton) {
157
+ var form = document.adminForm;
158
+ if (pressbutton == 'cancel_theme') {
159
+ submitform( pressbutton );
160
+ return;
161
+ }
162
+
163
+ if(document.getElementById('title').value==''){
164
+ alert('The theme must have a title')
165
+ return;
166
+ }
167
+ submitform( pressbutton );
168
+ }
169
+
170
+
171
+
172
+
173
+ function submitform( pressbutton ){
174
+ document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
175
+ document.getElementById('adminForm').submit();
176
+ }
177
+ //-->
178
+
179
+ function change_width(){
180
+ width=parseInt(document.getElementById('width').value)+45+parseInt(document.getElementById('border_width').value);
181
+ height=550;
182
+
183
+ document.getElementById('spider_calendar_preview').href="http://localhost/wordpress/wp-content/plugins/spider-calendar/preview.php?TB_iframe=1&tbWidth="+width+"&tbHeight="+height;
184
+ }
185
+
186
+
187
+ var thickDims, tbWidth, tbHeight;
188
+ jQuery(document).ready(function($) {
189
+
190
+ thickDims = function() {
191
+ var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
192
+
193
+ w = (tbWidth && tbWidth < W - 90) ? tbWidth : W - 200;
194
+ h = (tbHeight && tbHeight < H - 60) ? tbHeight : H - 200;
195
+
196
+ if ( tbWindow.size() ) {
197
+ tbWindow.width(w).height(h);
198
+ $('#TB_iframeContent').width(w).height(h - 27);
199
+ tbWindow.css({'margin-left': '-' + parseInt((w / 2),10) + 'px'});
200
+ if ( typeof document.body.style.maxWidth != 'undefined' )
201
+ tbWindow.css({'top':(H-h)/2,'margin-top':'0'});
202
+ }
203
+ };
204
+
205
+ thickDims();
206
+ $(window).resize( function() { thickDims() } );
207
+
208
+ $('a.thickbox-preview').click( function() {
209
+ tb_click.call(this);
210
+
211
+ var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text;
212
+
213
+ if ( tbWidth = href.match(/&tbWidth=[0-9]+/) )
214
+ tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
215
+ else
216
+ tbWidth = $(window).width() - 90;
217
+
218
+ if ( tbHeight = href.match(/&tbHeight=[0-9]+/) )
219
+ tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
220
+ else
221
+ tbHeight = $(window).height() - 60;
222
+
223
+ if ( alink.length ) {
224
+ url = alink.attr('href') || '';
225
+ text = alink.attr('title') || '';
226
+ link = '&nbsp; <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
227
+ } else {
228
+ text = $(this).attr('title') || '';
229
+ link = '&nbsp; <span class="tb-theme-preview-link">' + text + '</span>';
230
+ }
231
+
232
+ $('#TB_title').css({'background-color':'#222','color':'#dfdfdf'});
233
+ $('#TB_closeAjaxWindow').css({'float':'left'});
234
+ $('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
235
+
236
+ $('#TB_iframeContent').width('100%');
237
+ thickDims();
238
+
239
+ return false;
240
+ } );
241
+
242
+ // Theme details
243
+ $('.theme-detail').click(function () {
244
+ $(this).siblings('.themedetaildiv').toggle();
245
+ return false;
246
+ });
247
+
248
+ });
249
+
250
+
251
+ </script>
252
+
253
+ <style>
254
+
255
+ .reports
256
+ {
257
+ border:1px solid #DEDEDE;
258
+ border-radius:11px;
259
+ background-color:#F0F0F0;
260
+ text-align:center;
261
+ width:100px;
262
+ }
263
+
264
+ .bordered
265
+ {
266
+ border-radius:8px
267
+ }
268
+
269
+ .simple_table
270
+ {
271
+ background-color:transparent; !important
272
+ }
273
+ </style>
274
+ <?php
275
+ if(isset($labels))
276
+ {
277
+ ?>
278
+ <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>
279
+ <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">
280
+
281
+ <form action="#">
282
+ <p style="font-weight:bold; font-size:18px;margin-top: 0px;">
283
+ Select Columns
284
+ </p>
285
+
286
+ <input type="checkbox" <?php if($lists['hide_label_list']==='') echo 'checked="checked"' ?> onclick="clickLabChBAll(this)" id="ChBAll" />All</br>
287
+
288
+ <?php
289
+
290
+ foreach($templabels as $key => $curlabel)
291
+ {
292
+ if(strpos($lists['hide_label_list'],'@'.$curlabel.'@')===false)
293
+ echo '<input type="checkbox" checked="checked" onclick="clickLabChB(\''.$curlabel.'\', this)" />'.$label_titles[$key].'<br />';
294
+ else
295
+ echo '<input type="checkbox" onclick="clickLabChB(\''.$curlabel.'\', this)" />'.$label_titles[$key].'<br />';
296
+ }
297
+
298
+
299
+ ?>
300
+ <br />
301
+ <div style="text-align:center;">
302
+ <input type="button" onclick="toggleChBDiv(false);" value="Done" />
303
+ </div>
304
+ </form>
305
+ </div>
306
+
307
+ <?php } ?>
308
+
309
+ <form action="admin.php?page=contact_form_Submits" style="overflow-x: scroll;" method="post" id="admin_form" name="admin_form">
310
+ <input type="hidden" name="option" value="com_formmaker">
311
+ <input type="hidden" name="task" value="submits">
312
+ <input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if(isset($_POST['asc_or_desc'])) echo esc_html($_POST['asc_or_desc']) ?>">
313
+ <input type="hidden" name="order_by" id="order_by" value="<?php if(isset($_POST['order_by'])) echo esc_html($_POST['order_by']) ?>">
314
+ <br />
315
+ <table width="95%">
316
+ <tr>
317
+ <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
318
+ <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="color:red; text-decoration:none;">
319
+ <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
320
+ Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
321
+ </a>
322
+ </div></td>
323
+ </tr>
324
+ <tr style="line-height:inherit !important;" >
325
+ <td align="left" width="300"> Select a form:
326
+ <select name="form_id" id="form_id" onchange="if(document.getElementById('startdate'))remove_all();document.admin_form.submit();">
327
+ <option value="0" selected="selected"> Select a Form </option>
328
+ <?php
329
+ $option='com_formmaker';
330
+
331
+ // $form_id=$mainframe-> getUserStateFromRequest( $option.'form_id', 'form_id','id','cmd' );
332
+ if( $forms)
333
+ for($i=0, $n=count($forms); $i < $n ; $i++)
334
+
335
+ {
336
+ $form = $forms[$i];
337
+
338
+
339
+ if($form_id==$form->id)
340
+ {
341
+ echo "<option value='".$form->id."' selected='selected'>".$form->title."</option>";
342
+ $form_title=$form->title;
343
+ }
344
+ else
345
+ echo "<option value='".$form->id."' >".$form->title."</option>";
346
+ }
347
+ ?>
348
+ </select>
349
+ </td>
350
+ <?php if(isset($form_id) and $form_id>0): ?>
351
+ <td class="reports" ><strong>Entries</strong><br /><?php echo $total_entries; ?></td>
352
+ <td class="reports"><strong>Views</strong><br /><?php echo $total_views ?></td>
353
+ <td class="reports"><strong>Conversion Rate</strong><br /><?php if($total_views) echo round((($total_entries/$total_views)*100),2).'%'; else echo '0%' ?></td>
354
+ <td style="font-size:36px;text-align:center;line-height: initial;">
355
+ <?php echo $form_title ?>
356
+ </td>
357
+ <td style="text-align:right;" width="300">
358
+ Export to
359
+ <input type="button" value="CSV" onclick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.');" />&nbsp;
360
+ <input type="button" value="XML" onclick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.');" />
361
+ </td>
362
+
363
+ </tr>
364
+
365
+ <tr>
366
+
367
+ <td colspan=5>
368
+ <br />
369
+ <input type="hidden" name="hide_label_list" value="<?php echo $lists['hide_label_list']; ?>"/>
370
+ <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" />
371
+ <input type="button" onclick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.');" value="Go" />
372
+ <input type="button" onclick="remove_all();this.form.submit();" value="Reset" />
373
+ </td>
374
+ <td align="right">
375
+ <br /><br />
376
+ <?php if(isset($labels)) echo '<input type="button" onclick="alert(\'This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.\');" value="Add/Remove Columns" />'; ?>
377
+ </td>
378
+ </tr>
379
+
380
+ <?php else: echo '<td><br /><br /><br /></td></tr>'; endif; ?>
381
+ </table>
382
+ <?php print_html_nav($pageNav['total'],$pageNav['limit']);
383
+ ?>
384
+ <table class="wp-list-table widefat fixed posts" style="width:95%; table-layout: inherit !important;" >
385
+ <thead>
386
+ <tr>
387
+ <th width="3%"><?php echo '#'; ?></th>
388
+
389
+ <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input type="checkbox"></th>
390
+ <?php
391
+
392
+
393
+ ?> <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
394
+ ?> <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
395
+ ?> <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
396
+
397
+
398
+
399
+ $n=count($rows);
400
+
401
+
402
+ for($i=0; $i < count($labels) ; $i++)
403
+ {
404
+ if(strpos($lists['hide_label_list'],'@'.$labels_id[$i].'@')===false) $styleStr='';
405
+ else $styleStr='display:none;';
406
+ if($sorted_labels_type[$i]=='type_address')
407
+ switch($label_titles_copy[$i])
408
+ {
409
+ case 'Street Line': $field_title=__('Street Address', 'form_maker'); break;
410
+ case 'Street Line2': $field_title=__('Street Address Line 2', 'form_maker'); break;
411
+ case 'City': $field_title=__('City', 'form_maker'); break;
412
+ case 'State': $field_title=__('State / Province / Region', 'form_maker'); break;
413
+ case 'Postal': $field_title=__('Postal / Zip Code', 'form_maker'); break;
414
+ case 'Country': $field_title=__('Country', 'form_maker'); break;
415
+ default : $field_title=$label_titles_copy[$i]; break;
416
+ }
417
+ else
418
+ $field_title=$label_titles_copy[$i];
419
+ ?>
420
+
421
+ <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>
422
+
423
+ <?php }
424
+ ?>
425
+ <th style="width:80px">Edit</th>
426
+ <th style="width:80px"><a href="javascript:submit_del('admin.php?page=contact_form_Submits&task=remov_cheched')">Delete</a></th>
427
+ </tr>
428
+ <tr id="fields_filter" style="display:none">
429
+ <th width="3%"></th>
430
+ <th width="3%"></th>
431
+ <th width="4%" class="submitid_fc" <?php if(!(strpos($lists['hide_label_list'],'@submitid@')===false)) echo 'style="display:none;"';?> ></th>
432
+ <th width="150" class="submitdate_fc" style="margin:inherit; <?php if(!(strpos($lists['hide_label_list'],'@submitdate@')===false)) echo 'display:none;';?>">
433
+ <table align="center" style="margin:auto" class="simple_table">
434
+ <tr class="simple_table">
435
+ <td class="simple_table" style="text-align:left">From:</td>
436
+ <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>
437
+ <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>
438
+ </tr>
439
+ <tr class="simple_table">
440
+ <td style="text-align:left" class="simple_table">To:</td>
441
+ <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>
442
+ <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>
443
+ </tr>
444
+ </table>
445
+ </th>
446
+ <th width="100"class="submitterip_fc" <?php if(!(strpos($lists['hide_label_list'],'@submitterip@')===false)) echo 'style="display:none;"';?>>
447
+ <input type="text" name="ip_search" id="ip_search" value="<?php echo $lists['ip_search'] ?>" onChange="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.');"/>
448
+ </th>
449
+ <?php
450
+ $n=count($rows);
451
+ $ka_fielderov_search=false;
452
+
453
+ if($lists['ip_search'] || $lists['startdate'] || $lists['enddate']){
454
+ $ka_fielderov_search=true;
455
+ }
456
+
457
+ for($i=0; $i < count($labels) ; $i++)
458
+ {
459
+ if(strpos($lists['hide_label_list'],'@'.$labels_id[$i].'@')===false)
460
+ $styleStr='';
461
+ else
462
+ $styleStr='style="display:none;"';
463
+
464
+ if(!$ka_fielderov_search)
465
+ if($lists[$form_id.'_'.$labels_id[$i].'_search'])
466
+ {
467
+ $ka_fielderov_search=true;
468
+ }
469
+
470
+ if($sorted_labels_type[$i]!='type_mark_map')
471
+ 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="alert(\'This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.\');" >'.'</th>';
472
+ else
473
+ echo '<th class="'.$labels_id[$i].'_fc" '.$styleStr.'>'.'</th>';
474
+ }
475
+ ?>
476
+ <th></th><th></th>
477
+ </tr>
478
+ </thead>
479
+ <?php
480
+ $k = 0;
481
+ $m=count($labels);
482
+ $group_id_s= array();
483
+ $l=0;
484
+ if(count($rows_ord)>0 and $m)
485
+ for($i=0; $i <count($rows_ord); $i++)
486
+ {
487
+
488
+ $row =$rows_ord[$i];
489
+
490
+ if(!in_array($row->group_id, $group_id_s))
491
+ {
492
+
493
+ array_push($group_id_s, $row->group_id);
494
+
495
+ }
496
+
497
+ }
498
+ for($www=0, $qqq=count($group_id_s); $www < $qqq ; $www++)
499
+ {
500
+ $i=$group_id_s[$www];
501
+
502
+ $temp= array();
503
+ for($j=0; $j < $n ; $j++)
504
+ {
505
+ $row = $rows[$j];
506
+ if($row->group_id==$i)
507
+ {
508
+ array_push($temp, $row);
509
+ }
510
+ }
511
+ $f=$temp[0];
512
+ $date=$f->date;
513
+ $ip=$f->ip;
514
+ // $checked = JHTML::_('grid.id', $www, $group_id_s[$www]);
515
+ $link="admin.php?page=contact_form_Submits&task=edit_submit&id=".$f->group_id;
516
+ ?>
517
+
518
+ <tr class="<?php echo "row$k"; ?>">
519
+
520
+ <td ><?php echo $www+1;?></td>
521
+
522
+ <th style="text-align:center" class="check-column"><input type="checkbox" name="post[]" value="<?php echo $f->group_id; ?>"></th>
523
+
524
+ <?php
525
+
526
+ if(strpos($lists['hide_label_list'],'@submitid@')===false)
527
+ echo '<td class="submitid_fc"><a href="'.$link.'" >'.$f->group_id.'</a></td>';
528
+ else
529
+ echo '<td class="submitid_fc" style="display:none;"><a href="'.$link.'" >'.$f->group_id.'</a></td>';
530
+
531
+ if(strpos($lists['hide_label_list'],'@submitdate@')===false)
532
+ echo '<td class="submitdate_fc"><a href="'.$link.'" >'.$date.'</a></td>';
533
+ else
534
+ echo '<td class="submitdate_fc" style="display:none;"><a href="'.$link.'" >'.$date.'</a></td>';
535
+
536
+ if(strpos($lists['hide_label_list'],'@submitterip@')===false)
537
+ echo '<td class="submitterip_fc"><a href="'.$link.'" >'.$ip.'</a></td>';
538
+ else
539
+ echo '<td class="submitterip_fc" style="display:none;"><a href="'.$link.'" >'.$ip.'</a></td>';
540
+
541
+
542
+
543
+ //print_r($temp);
544
+ $ttt=count($temp);
545
+ for($h=0; $h < $m ; $h++)
546
+ {
547
+ $not_label=true;
548
+ for($g=0; $g < $ttt ; $g++)
549
+ {
550
+ $t = $temp[$g];
551
+ if(strpos($lists['hide_label_list'],'@'.$labels_id[$h].'@')===false) $styleStr='';
552
+ else $styleStr='style="display:none;"';
553
+ if($t->element_label==$labels_id[$h])
554
+ {
555
+
556
+ if(strpos($t->element_value,"***map***"))
557
+ {
558
+ $map_params=explode('***map***',$t->element_value);
559
+
560
+ $longit =$map_params[0];
561
+ $latit =$map_params[1];
562
+
563
+ 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>";
564
+ }
565
+ else
566
+
567
+ if(strpos($t->element_value,"*@@url@@*"))
568
+ {
569
+ $new_file=str_replace("*@@url@@*",'', str_replace("***br***",'<br>', $t->element_value));
570
+ $new_filename=explode('/', $new_file);
571
+ echo '<td class="'.$labels_id[$h].'_fc" '.$styleStr.'><a target="_blank" href="'.$new_file.'">'.$new_filename[count($new_filename)-1]."</td>";
572
+ }
573
+ else
574
+ echo '<td class="'.$labels_id[$h].'_fc" '.$styleStr.'><pre style="font-family:inherit">'.str_replace("***br***",'<br>', $t->element_value).'</pre></td>';
575
+ $not_label=false;
576
+ }
577
+ }
578
+ if($not_label)
579
+ echo '<td class="'.$labels_id[$h].'_fc" '.$styleStr.'></td>';
580
+ }
581
+ ?>
582
+ <td><a href="javascript:submit_del('admin.php?page=contact_form_Submits&task=edit_submit&id=<?php echo $f->group_id; ?>')">Edit</a></td>
583
+ <td><a href="javascript:submit_del('admin.php?page=contact_form_Submits&task=remove_submit&id=<?php echo $f->group_id; ?>')">Delete</a></td>
584
+ </tr>
585
+
586
+ <?php
587
+
588
+
589
+ $k = 1 - $k;
590
+
591
+ }
592
+
593
+ ?>
594
+
595
+ </table>
596
+
597
+
598
+
599
+ <?php
600
+ foreach($sorted_labels_type as $key => $label_type)
601
+ {
602
+ if($label_type=="type_checkbox" || $label_type=="type_radio" || $label_type=="type_own_select" || $label_type=="type_country")
603
+ {
604
+ ?>
605
+ <br />
606
+ <br />
607
+
608
+ <strong><?php echo $label_titles_copy[$key]?></strong>
609
+ <br />
610
+ <br />
611
+
612
+ <?php
613
+
614
+ $query = "SELECT element_value FROM ".$wpdb->prefix."formmaker_submits ".$where_choices." AND element_label='".$labels_id[$key]."'";
615
+ $choices = $wpdb->get_results($query);
616
+ $colors=array('#2CBADE','#FE6400');
617
+ $choices_labels=array();
618
+ $choices_count=array();
619
+ $all=count($choices);
620
+ $unanswered=0;
621
+ foreach($choices as $key => $choice)
622
+ {
623
+ if($choice->element_value=='')
624
+ {
625
+ $unanswered++;
626
+ }
627
+ else
628
+ {
629
+ if(!in_array( $choice->element_value,$choices_labels))
630
+ {
631
+ array_push($choices_labels, $choice->element_value);
632
+ array_push($choices_count, 0);
633
+ }
634
+
635
+ $choices_count[array_search($choice->element_value, $choices_labels)]++;
636
+ }
637
+ }
638
+ array_multisort($choices_count,SORT_DESC,$choices_labels);
639
+ ?>
640
+ <table width="95%" style="width:95%" class="wp-list-table widefat fixed posts">
641
+ <thead>
642
+ <tr>
643
+ <th width="20%">Choices</th>
644
+ <th>Percentage</th>
645
+ <th width="10%">Count</th>
646
+ </tr>
647
+ </thead>
648
+ <?php
649
+ foreach($choices_labels as $key => $choices_label)
650
+ {
651
+ ?>
652
+ <tr>
653
+ <td><?php echo str_replace("***br***",'<br>', $choices_label)?></td>
654
+ <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>
655
+ <td><?php echo $choices_count[$key]?></td>
656
+ </tr>
657
+ <?php
658
+ }
659
+
660
+ if($unanswered){
661
+ ?>
662
+ <tr>
663
+ <td colspan="2" align="right">Unanswered</th>
664
+ <td><strong><?php echo $unanswered;?></strong></th>
665
+ </tr>
666
+
667
+ <?php
668
+ }
669
+ ?>
670
+ <tr>
671
+ <td colspan="2" align="right"><strong>Total</strong></th>
672
+ <td><strong><?php echo $all;?></strong></th>
673
+ </tr>
674
+
675
+ </table>
676
+ <?php
677
+ }
678
+ }
679
+ ?>
680
+
681
+
682
+
683
+ <input type="hidden" name="boxchecked" value="0">
684
+
685
+ <input type="hidden" name="filter_order2" value="<?php echo $lists['order']; ?>" />
686
+
687
+ <input type="hidden" name="filter_order_Dir2" value="<?php echo $lists['order_Dir']; ?>" />
688
+
689
+ </form>
690
+
691
+ <script>
692
+ <?php if($ka_fielderov_search){?>
693
+ document.getElementById('fields_filter').style.display='';
694
+ <?php
695
+ }?>
696
+ </script>
697
+
698
+ <?php
699
+
700
+
701
+ }
702
+
703
+
704
+
705
+
706
+
707
+
708
+
709
+
710
+
711
+
712
+
713
+
714
+
715
+ function html_editSubmit($rows, $labels_id ,$labels_name,$labels_type){
716
+ ?>
717
+
718
+ <script language="javascript" type="text/javascript">
719
+
720
+ function submitbutton(pressbutton) {
721
+ var form = document.adminForm;
722
+
723
+ if (pressbutton == 'cancel_submit')
724
+ {
725
+ submitform( pressbutton );
726
+ return;
727
+ }
728
+
729
+ submitform( pressbutton );
730
+ }
731
+ function submitform(pressbutton)
732
+ {
733
+
734
+ document.getElementById('adminForm').action=document.getElementById('adminForm').action+'&task='+pressbutton;
735
+ document.getElementById('adminForm').submit();
736
+ }
737
+ </script>
738
+ <table width="90%">
739
+ <tbody>
740
+ <tr>
741
+ <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
742
+ <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="color:red; text-decoration:none;">
743
+ <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
744
+ Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
745
+ </a>
746
+ </div></td>
747
+ </tr>
748
+ <tr>
749
+ <td width="100%"><h2>Edit Submission</h2></td>
750
+ <td align="right"><input type="button" onclick="submitbutton('save_submit')" value="Save" class="button-secondary action"> </td>
751
+ <td align="right"><input type="button" onclick="submitbutton('appply_submit')" value="Apply" class="button-secondary action"> </td>
752
+ <td align="right"><input type="button" onclick="submitbutton('cancel')" value="Cancel" class="button-secondary action"> </td>
753
+ </tr>
754
+ </tbody></table>
755
+ <form action="admin.php?page=contact_form_Submits&id=<?php echo (int) $_GET['id']; ?>" method="post" id="adminForm" name="adminForm">
756
+ <table class="admintable">
757
+ <tr>
758
+ <td class="key">
759
+ <label for="ID">ID: </label>
760
+ </td>
761
+ <td >
762
+ <?php echo $rows[0]->group_id;?>
763
+ </td>
764
+ </tr>
765
+
766
+ <tr>
767
+ <td class="key">
768
+ <label for="Date">Date:
769
+ </label>
770
+ </td>
771
+ <td >
772
+ <?php echo $rows[0]->date;?>
773
+ </td>
774
+ </tr>
775
+ <tr>
776
+ <td class="key">
777
+ <label for="IP">IP:</label>
778
+ </td>
779
+ <td >
780
+ <?php echo $rows[0]->ip;?>
781
+ </td>
782
+ </tr>
783
+
784
+ <?php
785
+ foreach($labels_id as $key => $label_id)
786
+ {
787
+ 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')
788
+ {
789
+ $element_value='';
790
+ foreach($rows as $row)
791
+ {
792
+ if($row->element_label==$label_id)
793
+ {
794
+ $element_value= $row->element_value;
795
+ break;
796
+ }
797
+ }
798
+ if($labels_type[$key]!='type_checkbox')
799
+ echo ' <tr>
800
+ <td class="key">
801
+ <label for="title">
802
+ '.$labels_name[$key].'
803
+ </label>
804
+ </td>
805
+ <td >
806
+ <input type="text" name="submission_'.$label_id.'" id="submission_'.$label_id.'" value="'.str_replace("*@@url@@*",'',$element_value).'" size="80" />
807
+ </td>
808
+ </tr>
809
+ ';
810
+ else
811
+ {
812
+ $choices = explode('***br***',$element_value);
813
+ $choices = array_slice($choices,0, count($choices)-1);
814
+ echo ' <tr>
815
+ <td class="key" rowspan="'.count($choices).'">
816
+ <label for="title">
817
+ '.$labels_name[$key].'
818
+ </label>
819
+ </td>';
820
+ foreach($choices as $choice_key => $choice)
821
+ echo '
822
+ <td >
823
+ <input type="text" name="submission_'.$label_id.'_'.$choice_key.'" id="submission_'.$label_id.'_'.$choice_key.'" value="'.$choice.'" size="80" />
824
+ </td>
825
+ </tr>
826
+ ';
827
+ }
828
+ }
829
+ }
830
+
831
+ ?>
832
+ </table>
833
+ <input type="hidden" name="option" value="com_formmaker" />
834
+ <input type="hidden" name="id" value="<?php echo $rows[0]->group_id?>" />
835
+ <input type="hidden" name="form_id" value="<?php echo $rows[0]->form_id?>" />
836
+ <input type="hidden" name="date" value="<?php echo $rows[0]->date?>" />
837
+ <input type="hidden" name="ip" value="<?php echo $rows[0]->ip?>" />
838
+ <input type="hidden" name="task" value="save_submit" />
839
+ </form>
840
+ <?php
841
+
842
+
843
+
844
+
845
+ }
846
+
847
+
848
+
849
+
850
  ?>
Submissions.php CHANGED
@@ -1,590 +1,590 @@
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
- $sort["sortid_by"]=$_POST['order_by'];
31
- if($_POST['asc_or_desc']==1)
32
- {
33
- $sort["custom_style"]="manage-column column-title sorted asc";
34
- $sort["1_or_2"]="2";
35
- $order="ORDER BY ".$sort["sortid_by"]." ASC";
36
- }
37
- else
38
- {
39
- $sort["custom_style"]="manage-column column-title sorted desc";
40
- $sort["1_or_2"]="1";
41
- $order="ORDER BY ".$sort["sortid_by"]." DESC";
42
- }
43
- }
44
- else{
45
- $sort["sortid_by"]="";
46
- }
47
-
48
- if($_POST['page_number'])
49
- {
50
- $limit=($_POST['page_number']-1)*20;
51
- }
52
- else
53
- {
54
- $limit=0;
55
- }
56
- }
57
- else
58
- {
59
- $sort["sortid_by"]="";
60
- $limit=0;
61
- }
62
-
63
-
64
-
65
-
66
-
67
- ///////////////////////////////////////////////////////////////// END PAGE NAVI ///////////////////////////////////////////////
68
-
69
-
70
-
71
-
72
- $query = "SELECT `id`,`title` FROM ".$wpdb->prefix."formmaker WHERE `id` IN(".get_option('contact_form_forms').") ORDER BY `title`";
73
- $forms = $wpdb->get_results($query);
74
-
75
- //$task = JRequest::getCmd('task');
76
- if(isset($_POST['form_id'])){
77
- $form_id=$_POST['form_id'];
78
-
79
- if($form_id){
80
-
81
- $query = "SELECT id FROM ".$wpdb->prefix."formmaker where id=".$form_id;
82
- $exists = $wpdb->get_var($query);
83
- }
84
- else{
85
- $exists ="";
86
- }
87
-
88
- }
89
- else{
90
- $form_id="";
91
- $exists ="";
92
- }
93
- if(!$exists)
94
- $form_id=0;
95
- if(isset($_POST['order_by']) && $_POST['order_by']!="")
96
- $filter_order= $_POST['order_by'];
97
- else
98
- $filter_order='id';
99
- if(isset($_POST['asc_or_desc'])){
100
- if($_POST['asc_or_desc']==1)
101
- $filter_order_Dir= " ASC";
102
- else
103
- $filter_order_Dir=" DESC";
104
- }
105
- else{
106
- $filter_order_Dir="";
107
- }
108
- if(isset($_POST['search_submits'])){
109
- $search_submits = $_POST['search_submits'];
110
- $search_submits =strtolower( $search_submits );
111
- }
112
- else{
113
- $search_submits = "";
114
- }
115
- if(isset($_POST['ip_search'])){
116
- $ip_search = $_POST['ip_search'];
117
- $ip_search = strtolower( $ip_search );
118
- }
119
- else{
120
- $ip_search= "";
121
- }
122
- $where = array();
123
- $where_choices = array();
124
- if(isset($_POST['startdate']))
125
- {
126
- $lists['startdate']= $_POST['startdate'];
127
- }
128
- else
129
- {
130
- $lists['startdate']="";
131
- }
132
-
133
- if(isset($_POST['enddate']))
134
- {
135
- $lists['enddate']= $_POST['enddate'];
136
- }
137
- else
138
- {
139
- $lists['enddate']="";
140
- }
141
-
142
- if(isset($_POST['hide_label_list']))
143
- {
144
- $lists['hide_label_list']= $_POST['hide_label_list'];
145
- }
146
- else
147
- {
148
- $lists['hide_label_list']="";
149
- }
150
-
151
-
152
-
153
-
154
-
155
-
156
- /*if ($form_id=="")
157
- if($forms)
158
- $form_id=$forms[0]->id;*/
159
-
160
- $where[] = 'form_id="'.$form_id.'"';
161
-
162
- $where = ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' );
163
-
164
-
165
- if ($filter_order == 'id' or $filter_order == 'title' or $filter_order == 'mail')
166
- {
167
-
168
- $orderby = ' ORDER BY `date` desc';
169
- }
170
- else
171
- if(!strpos($filter_order,"_field"))
172
- {
173
- $orderby = ' ORDER BY '.$filter_order .' '. $filter_order_Dir .'';
174
- }
175
- $query = "SELECT * FROM ".$wpdb->prefix."formmaker_submits". $where;
176
- $rows = $wpdb->get_results($query);
177
- $query = "SELECT * FROM ".$wpdb->prefix."formmaker_submits WHERE form_id='". $form_id."'";
178
-
179
- $rowsc = $wpdb->get_results($query);
180
-
181
- //$orderby=$order;
182
-
183
- $where_labels=array();
184
- $n=count($rowsc);
185
- $labels= array();
186
- for($i=0; $i < $n ; $i++)
187
- {
188
- $row = $rowsc[$i];
189
- if(!in_array($row->element_label, $labels))
190
- {
191
- array_push($labels, $row->element_label);
192
- }
193
- }
194
- $sorted_labels_type= array();
195
- $sorted_labels_id= array();
196
- $sorted_labels= array();
197
- $label_titles=array();
198
- if($labels)
199
- {
200
-
201
- $label_id= array();
202
- $label_order= array();
203
- $label_order_original= array();
204
- $label_type= array();
205
- $this_form=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$form_id."'");
206
-
207
- $label_all = explode('#****#',$this_form->label_order);
208
- $label_all = array_slice($label_all,0, count($label_all)-1);
209
-
210
-
211
-
212
- foreach($label_all as $key => $label_each)
213
- {
214
- $label_id_each=explode('#**id**#',$label_each);
215
- array_push($label_id, $label_id_each[0]);
216
-
217
- $label_order_each=explode('#**label**#', $label_id_each[1]);
218
-
219
- array_push($label_order_original, $label_order_each[0]);
220
-
221
- $ptn = "/[^a-zA-Z0-9_]/";
222
- $rpltxt = "";
223
- $label_temp=preg_replace($ptn, $rpltxt, $label_order_each[0]);
224
- array_push($label_order, $label_temp);
225
-
226
- array_push($label_type, $label_order_each[1]);
227
- }
228
-
229
- foreach($label_id as $key => $label)
230
- if(in_array($label, $labels))
231
- {
232
- array_push($sorted_labels_type, $label_type[$key]);
233
- array_push($sorted_labels, $label_order[$key]);
234
- array_push($sorted_labels_id, $label);
235
- array_push($label_titles, $label_order_original[$key]);
236
- $search_temp = $_POST[$form_id.'_'.$label.'_search'];
237
- $search_temp = strtolower( $search_temp );
238
- $lists[$form_id.'_'.$label.'_search'] = $search_temp;
239
-
240
- if ( $search_temp ) {
241
- $where_labels[] = '(group_id in (SELECT group_id FROM '.$wpdb->prefix.'formmaker_submits WHERE element_label='.$label.'))';
242
- }
243
-
244
- }
245
- }
246
-
247
- $where_labels = ( count( $where_labels ) ? ' ' . implode( ' AND ', $where_labels ) : '' );
248
- if($where_labels)
249
- $where= $where.' AND '.$where_labels;
250
-
251
- $rows_ord = array();
252
- if(strpos($filter_order,"_field"))
253
- {
254
-
255
- $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";
256
-
257
-
258
- if($wpdb->query($query)){ echo "database error";}
259
-
260
- $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;
261
-
262
- $rows_ord = $wpdb->get_results($query);
263
-
264
- }
265
-
266
- $query = 'SELECT group_id, date, ip FROM '.$wpdb->prefix.'formmaker_submits'. $where.' group by group_id '. $orderby;
267
- $group_ids=$wpdb->get_results($query);
268
- $total = count($group_ids);
269
-
270
-
271
- $query = 'SELECT count(distinct group_id) FROM '.$wpdb->prefix.'formmaker_submits where form_id ="'.$form_id.'"';
272
- $total_entries=$wpdb->get_var($query);
273
-
274
- if(count($rows_ord)!=0){
275
- $group_ids=$rows_ord;
276
- $total = count($rows_ord);
277
-
278
- $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 ";
279
- $rows_ord = $wpdb->get_results($query);
280
-
281
-
282
- }
283
-
284
-
285
-
286
-
287
-
288
- $where2 = array();
289
- $where_choices=$where;
290
- for($i=$limit; $i<$limit+20; $i++)
291
- {
292
- if($i<$total)
293
- $where2 [] ="group_id='".$group_ids[$i]->group_id."'";
294
-
295
- }
296
- $where2 = ( count( $where2 ) ? ' AND ( ' . implode( ' OR ', $where2 ).' )' : '' );
297
- $where=$where.$where2;
298
- $query = "SELECT * FROM ".$wpdb->prefix."formmaker_submits ". $where." ".$orderby.'';
299
- $rows =$wpdb->get_results($query);
300
-
301
- $pageNav['total'] =$total;
302
- $pageNav['limit'] = $limit/20+1;
303
-
304
- $query = 'SELECT `views` FROM '.$wpdb->prefix.'formmaker_views WHERE form_id="'.$form_id.'"';
305
- $total_views = $wpdb->get_var($query);
306
-
307
-
308
- $lists['order_Dir'] = $filter_order_Dir;
309
-
310
- $lists['order'] = $filter_order;
311
-
312
-
313
-
314
- // search filter
315
-
316
- $lists['search_submits']= $search_submits;
317
- $lists['ip_search']=$ip_search;
318
-
319
- if(count($rows_ord)==0)
320
- $rows_ord=$rows;
321
- // display function
322
- 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);
323
-
324
-
325
- }
326
- function remov_submit($id){
327
- global $wpdb;
328
- $query="DELETE FROM ".$wpdb->prefix."formmaker_submits WHERE group_id='".$id."'";
329
- if($wpdb->query($query)){
330
- ?>
331
- <div class="updated"><p><strong>Item Deleted.</strong></p></div>
332
- <?php
333
- }
334
- else
335
- {
336
- ?>
337
- <div id="message" class="error"><p>Form Maker Submission Not Deleted</p></div>
338
- <?php
339
- }
340
- }
341
-
342
-
343
-
344
-
345
-
346
- function remov_cheched_submission()
347
- {
348
- global $wpdb;
349
- $cid=$_POST['post'];
350
-
351
- if (count( $cid )) {
352
-
353
-
354
- $cids = implode( ',', $cid );
355
- // Create sql statement
356
-
357
- $query = 'DELETE FROM '.$wpdb->prefix.'formmaker_submits'.' WHERE group_id IN ( '. $cids .' )' ;
358
- if($wpdb->query($query)){
359
- ?>
360
- <div class="updated"><p><strong>Items Deleted.</strong></p></div>
361
- <?php
362
- }
363
- else
364
- {
365
- ?>
366
- <div id="message" class="error"><p>Form Maker Submissions Not Deleted</p></div>
367
- <?php
368
- }
369
-
370
- }
371
- else
372
- {
373
- ?>
374
- <div id="message" class="error"><p>Submissions Not Selected</p></div>
375
- <?php
376
- }
377
- }
378
-
379
-
380
-
381
-
382
-
383
-
384
-
385
-
386
-
387
- function editSubmit($id)
388
- {
389
- global $wpdb;
390
-
391
- $query = "SELECT * FROM ".$wpdb->prefix."formmaker_submits WHERE group_id=".$id;
392
-
393
- $rows = $wpdb->get_results($query);
394
- $form=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id=".$rows[0]->form_id);
395
- $label_id= array();
396
- $label_order_original= array();
397
- $label_type= array();
398
-
399
- $label_all = explode('#****#',$form->label_order);
400
- $label_all = array_slice($label_all,0, count($label_all)-1);
401
-
402
-
403
-
404
- foreach($label_all as $key => $label_each)
405
- {
406
- $label_id_each=explode('#**id**#',$label_each);
407
- array_push($label_id, $label_id_each[0]);
408
-
409
- $label_oder_each=explode('#**label**#', $label_id_each[1]);
410
- array_push($label_order_original, $label_oder_each[0]);
411
- array_push($label_type, $label_oder_each[1]);
412
-
413
-
414
-
415
- }
416
-
417
- // display function
418
-
419
- html_editSubmit($rows, $label_id ,$label_order_original,$label_type);
420
-
421
-
422
- }
423
-
424
-
425
-
426
-
427
-
428
-
429
-
430
-
431
-
432
-
433
-
434
- function save_submit($id){
435
-
436
-
437
- global $wpdb;
438
- $id = $_POST['id'];
439
- $date = $_POST['date'];
440
- $ip = $_POST['ip'];
441
- $form_id=$wpdb->get_var("SELECT form_id FROM ".$wpdb->prefix."formmaker_submits WHERE group_id='".$id."'");
442
- $form =$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$form_id."'");
443
- $label_id= array();
444
- $label_order_original= array();
445
- $label_type= array();
446
-
447
- $label_all = explode('#****#',$form->label_order);
448
- $label_all = array_slice($label_all,0, count($label_all)-1);
449
-
450
-
451
-
452
- foreach($label_all as $key => $label_each)
453
- {
454
- $label_id_each=explode('#**id**#',$label_each);
455
- array_push($label_id, $label_id_each[0]);
456
-
457
- $label_oder_each=explode('#**label**#', $label_id_each[1]);
458
- array_push($label_order_original, $label_oder_each[0]);
459
- array_push($label_type, $label_oder_each[1]);
460
-
461
-
462
-
463
- }
464
-
465
- foreach($label_id as $key => $label_id_1)
466
- {
467
- $element_value=$_POST["submission_".$label_id_1];
468
- if(isset($_POST["submission_".$label_id_1]))
469
- {
470
- $query = "SELECT id FROM ".$wpdb->prefix."formmaker_submits WHERE group_id='".$id."' AND element_label='".$label_id_1."'";
471
- $result=$wpdb->get_var($query);
472
- if($label_type[$key]=='type_file_upload')
473
- if($element_value)
474
- $element_value=$element_value."*@@url@@*";
475
-
476
- if($result)
477
- {
478
- //$query = "UPDATE ".$wpdb->prefix."formmaker_submits SET `element_value`='".$element_value."' WHERE group_id='".$id."' AND element_label='".$label_id_1."'";
479
- $wpdb->update(
480
- $wpdb->prefix."formmaker_submits",
481
- array(
482
- 'element_value' => $element_value,
483
- ),
484
- array( 'group_id' => $id,
485
- 'element_label' => $label_id_1),
486
- array(
487
- '%s',
488
- ),
489
- array( '%d',
490
- '%s' )
491
- );
492
- }
493
- else
494
- {
495
- $wpdb->insert(
496
- $wpdb->prefix."formmaker_submits",
497
- array(
498
- 'form_id' => $form_id,
499
- 'element_label' => $label_id_1,
500
- 'element_value' => $element_value,
501
- 'group_id' => $id,
502
- 'date' => $date,
503
- 'ip' => $ip
504
- ),
505
- array(
506
- '%d',
507
- '%s',
508
- '%s',
509
- '%d',
510
- '%s',
511
- '%s'
512
- )
513
- );
514
- }
515
- }
516
- else
517
- {
518
- $element_value_ch=$_POST["submission_".$label_id_1.'_0'];
519
- if(isset($_POST["submission_".$label_id_1.'_0']))
520
- {
521
- for($z=0; $z<21; $z++ )
522
- {
523
- $element_value_ch=$_POST["submission_".$label_id_1.'_'.$z];
524
- if(isset($element_value_ch))
525
- $element_value=$element_value.$element_value_ch.'***br***';
526
- else
527
- break;
528
- }
529
- $query = "SELECT id FROM ".$wpdb->prefix."formmaker_submits WHERE group_id='".$id."' AND element_label='".$label_id_1."'";
530
-
531
- $result=$wpdb->get_var($query);
532
- if($result)
533
- {
534
- $query = "UPDATE ".$wpdb->prefix."formmaker_submits SET `element_value`='".$element_value."' WHERE group_id='".$id."' AND element_label='".$label_id_1."'";
535
- $wpdb->update(
536
- $wpdb->prefix."formmaker_submits",
537
- array(
538
- 'element_value' => $element_value,
539
- ),
540
- array( 'group_id' => $id,
541
- 'element_label' => $label_id_1),
542
- array(
543
- '%s',
544
- ),
545
- array( '%d',
546
- '%s' )
547
- );
548
- }
549
- else
550
- {
551
- $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."')" ;
552
- $wpdb->insert(
553
- $wpdb->prefix."formmaker_submits",
554
- array(
555
- 'form_id' => $form_id,
556
- 'element_label' => $label_id_1,
557
- 'element_value' => $element_value,
558
- 'group_id' => $id,
559
- 'date' => $date,
560
- 'ip' => $ip
561
- ),
562
- array(
563
- '%d',
564
- '%s',
565
- '%s',
566
- '%d',
567
- '%s',
568
- '%s'
569
- )
570
- );
571
- }
572
-
573
- }
574
-
575
- }
576
-
577
-
578
- }
579
-
580
- }
581
-
582
-
583
-
584
-
585
-
586
-
587
-
588
-
589
-
590
  ?>
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
+ $sort["sortid_by"]=esc_html($_POST['order_by']);
31
+ if($_POST['asc_or_desc']==1)
32
+ {
33
+ $sort["custom_style"]="manage-column column-title sorted asc";
34
+ $sort["1_or_2"]="2";
35
+ $order="ORDER BY ".$sort["sortid_by"]." ASC";
36
+ }
37
+ else
38
+ {
39
+ $sort["custom_style"]="manage-column column-title sorted desc";
40
+ $sort["1_or_2"]="1";
41
+ $order="ORDER BY ".$sort["sortid_by"]." DESC";
42
+ }
43
+ }
44
+ else{
45
+ $sort["sortid_by"]="";
46
+ }
47
+
48
+ if($_POST['page_number'])
49
+ {
50
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
51
+ }
52
+ else
53
+ {
54
+ $limit=0;
55
+ }
56
+ }
57
+ else
58
+ {
59
+ $sort["sortid_by"]="";
60
+ $limit=0;
61
+ }
62
+
63
+
64
+
65
+
66
+
67
+ ///////////////////////////////////////////////////////////////// END PAGE NAVI ///////////////////////////////////////////////
68
+
69
+
70
+
71
+
72
+ $query = "SELECT `id`,`title` FROM ".$wpdb->prefix."formmaker WHERE `id` IN(".get_option('contact_form_forms').") ORDER BY `title`";
73
+ $forms = $wpdb->get_results($query);
74
+
75
+ //$task = JRequest::getCmd('task');
76
+ if(isset($_POST['form_id'])){
77
+ $form_id = (int) $_POST['form_id'];
78
+
79
+ if($form_id){
80
+
81
+ $query = "SELECT id FROM ".$wpdb->prefix."formmaker where id=".$form_id;
82
+ $exists = $wpdb->get_var($query);
83
+ }
84
+ else{
85
+ $exists ="";
86
+ }
87
+
88
+ }
89
+ else{
90
+ $form_id="";
91
+ $exists ="";
92
+ }
93
+ if(!$exists)
94
+ $form_id=0;
95
+ if(isset($_POST['order_by']) && $_POST['order_by']!="")
96
+ $filter_order= esc_html($_POST['order_by']);
97
+ else
98
+ $filter_order='id';
99
+ if(isset($_POST['asc_or_desc'])){
100
+ if($_POST['asc_or_desc']==1)
101
+ $filter_order_Dir= " ASC";
102
+ else
103
+ $filter_order_Dir=" DESC";
104
+ }
105
+ else{
106
+ $filter_order_Dir="";
107
+ }
108
+ if(isset($_POST['search_submits'])){
109
+ $search_submits = esc_html($_POST['search_submits']);
110
+ $search_submits =strtolower( $search_submits );
111
+ }
112
+ else{
113
+ $search_submits = "";
114
+ }
115
+ if(isset($_POST['ip_search'])){
116
+ $ip_search = esc_html($_POST['ip_search']);
117
+ $ip_search = strtolower( $ip_search );
118
+ }
119
+ else{
120
+ $ip_search= "";
121
+ }
122
+ $where = array();
123
+ $where_choices = array();
124
+ if(isset($_POST['startdate']))
125
+ {
126
+ $lists['startdate']= esc_html($_POST['startdate']);
127
+ }
128
+ else
129
+ {
130
+ $lists['startdate']="";
131
+ }
132
+
133
+ if(isset($_POST['enddate']))
134
+ {
135
+ $lists['enddate']= esc_html($_POST['enddate']);
136
+ }
137
+ else
138
+ {
139
+ $lists['enddate']="";
140
+ }
141
+
142
+ if(isset($_POST['hide_label_list']))
143
+ {
144
+ $lists['hide_label_list']= esc_html($_POST['hide_label_list']);
145
+ }
146
+ else
147
+ {
148
+ $lists['hide_label_list']="";
149
+ }
150
+
151
+
152
+
153
+
154
+
155
+
156
+ /*if ($form_id=="")
157
+ if($forms)
158
+ $form_id=$forms[0]->id;*/
159
+
160
+ $where[] = 'form_id="'.$form_id.'"';
161
+
162
+ $where = ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' );
163
+
164
+
165
+ if ($filter_order == 'id' or $filter_order == 'title' or $filter_order == 'mail')
166
+ {
167
+
168
+ $orderby = ' ORDER BY `date` desc';
169
+ }
170
+ else
171
+ if(!strpos($filter_order,"_field"))
172
+ {
173
+ $orderby = ' ORDER BY '.$filter_order .' '. $filter_order_Dir .'';
174
+ }
175
+ $query = "SELECT * FROM ".$wpdb->prefix."formmaker_submits". $where;
176
+ $rows = $wpdb->get_results($query);
177
+ $query = "SELECT * FROM ".$wpdb->prefix."formmaker_submits WHERE form_id='". $form_id."'";
178
+
179
+ $rowsc = $wpdb->get_results($query);
180
+
181
+ //$orderby=$order;
182
+
183
+ $where_labels=array();
184
+ $n=count($rowsc);
185
+ $labels= array();
186
+ for($i=0; $i < $n ; $i++)
187
+ {
188
+ $row = $rowsc[$i];
189
+ if(!in_array($row->element_label, $labels))
190
+ {
191
+ array_push($labels, $row->element_label);
192
+ }
193
+ }
194
+ $sorted_labels_type= array();
195
+ $sorted_labels_id= array();
196
+ $sorted_labels= array();
197
+ $label_titles=array();
198
+ if($labels)
199
+ {
200
+
201
+ $label_id= array();
202
+ $label_order= array();
203
+ $label_order_original= array();
204
+ $label_type= array();
205
+ $this_form=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$form_id."'");
206
+
207
+ $label_all = explode('#****#',$this_form->label_order);
208
+ $label_all = array_slice($label_all,0, count($label_all)-1);
209
+
210
+
211
+
212
+ foreach($label_all as $key => $label_each)
213
+ {
214
+ $label_id_each=explode('#**id**#',$label_each);
215
+ array_push($label_id, $label_id_each[0]);
216
+
217
+ $label_order_each=explode('#**label**#', $label_id_each[1]);
218
+
219
+ array_push($label_order_original, $label_order_each[0]);
220
+
221
+ $ptn = "/[^a-zA-Z0-9_]/";
222
+ $rpltxt = "";
223
+ $label_temp=preg_replace($ptn, $rpltxt, $label_order_each[0]);
224
+ array_push($label_order, $label_temp);
225
+
226
+ array_push($label_type, $label_order_each[1]);
227
+ }
228
+
229
+ foreach($label_id as $key => $label)
230
+ if(in_array($label, $labels))
231
+ {
232
+ array_push($sorted_labels_type, $label_type[$key]);
233
+ array_push($sorted_labels, $label_order[$key]);
234
+ array_push($sorted_labels_id, $label);
235
+ array_push($label_titles, $label_order_original[$key]);
236
+ $search_temp = $_POST[$form_id.'_'.$label.'_search'];
237
+ $search_temp = strtolower( $search_temp );
238
+ $lists[$form_id.'_'.$label.'_search'] = $search_temp;
239
+
240
+ if ( $search_temp ) {
241
+ $where_labels[] = '(group_id in (SELECT group_id FROM '.$wpdb->prefix.'formmaker_submits WHERE element_label='.$label.'))';
242
+ }
243
+
244
+ }
245
+ }
246
+
247
+ $where_labels = ( count( $where_labels ) ? ' ' . implode( ' AND ', $where_labels ) : '' );
248
+ if($where_labels)
249
+ $where= $where.' AND '.$where_labels;
250
+
251
+ $rows_ord = array();
252
+ if(strpos($filter_order,"_field"))
253
+ {
254
+
255
+ $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";
256
+
257
+
258
+ if($wpdb->query($query)){ echo "database error";}
259
+
260
+ $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;
261
+
262
+ $rows_ord = $wpdb->get_results($query);
263
+
264
+ }
265
+
266
+ $query = 'SELECT group_id, date, ip FROM '.$wpdb->prefix.'formmaker_submits'. $where.' group by group_id '. $orderby;
267
+ $group_ids=$wpdb->get_results($query);
268
+ $total = count($group_ids);
269
+
270
+
271
+ $query = 'SELECT count(distinct group_id) FROM '.$wpdb->prefix.'formmaker_submits where form_id ="'.$form_id.'"';
272
+ $total_entries=$wpdb->get_var($query);
273
+
274
+ if(count($rows_ord)!=0){
275
+ $group_ids=$rows_ord;
276
+ $total = count($rows_ord);
277
+
278
+ $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 ";
279
+ $rows_ord = $wpdb->get_results($query);
280
+
281
+
282
+ }
283
+
284
+
285
+
286
+
287
+
288
+ $where2 = array();
289
+ $where_choices=$where;
290
+ for($i=$limit; $i<$limit+20; $i++)
291
+ {
292
+ if($i<$total)
293
+ $where2 [] ="group_id='".$group_ids[$i]->group_id."'";
294
+
295
+ }
296
+ $where2 = ( count( $where2 ) ? ' AND ( ' . implode( ' OR ', $where2 ).' )' : '' );
297
+ $where=$where.$where2;
298
+ $query = "SELECT * FROM ".$wpdb->prefix."formmaker_submits ". $where." ".$orderby.'';
299
+ $rows =$wpdb->get_results($query);
300
+
301
+ $pageNav['total'] =$total;
302
+ $pageNav['limit'] = $limit/20+1;
303
+
304
+ $query = 'SELECT `views` FROM '.$wpdb->prefix.'formmaker_views WHERE form_id="'.$form_id.'"';
305
+ $total_views = $wpdb->get_var($query);
306
+
307
+
308
+ $lists['order_Dir'] = $filter_order_Dir;
309
+
310
+ $lists['order'] = $filter_order;
311
+
312
+
313
+
314
+ // search filter
315
+
316
+ $lists['search_submits']= $search_submits;
317
+ $lists['ip_search']=$ip_search;
318
+
319
+ if(count($rows_ord)==0)
320
+ $rows_ord=$rows;
321
+ // display function
322
+ 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);
323
+
324
+
325
+ }
326
+ function remov_submit($id){
327
+ global $wpdb;
328
+ $query="DELETE FROM ".$wpdb->prefix."formmaker_submits WHERE group_id='".$id."'";
329
+ if($wpdb->query($query)){
330
+ ?>
331
+ <div class="updated"><p><strong>Item Deleted.</strong></p></div>
332
+ <?php
333
+ }
334
+ else
335
+ {
336
+ ?>
337
+ <div id="message" class="error"><p>Form Maker Submission Not Deleted</p></div>
338
+ <?php
339
+ }
340
+ }
341
+
342
+
343
+
344
+
345
+
346
+ function remov_cheched_submission()
347
+ {
348
+ global $wpdb;
349
+ $cid=$_POST['post'];
350
+
351
+ if (count( $cid )) {
352
+
353
+
354
+ $cids =esc_html( implode( ',', $cid ));
355
+ // Create sql statement
356
+
357
+ $query = 'DELETE FROM '.$wpdb->prefix.'formmaker_submits'.' WHERE group_id IN ( '. $cids .' )' ;
358
+ if($wpdb->query($query)){
359
+ ?>
360
+ <div class="updated"><p><strong>Items Deleted.</strong></p></div>
361
+ <?php
362
+ }
363
+ else
364
+ {
365
+ ?>
366
+ <div id="message" class="error"><p>Form Maker Submissions Not Deleted</p></div>
367
+ <?php
368
+ }
369
+
370
+ }
371
+ else
372
+ {
373
+ ?>
374
+ <div id="message" class="error"><p>Submissions Not Selected</p></div>
375
+ <?php
376
+ }
377
+ }
378
+
379
+
380
+
381
+
382
+
383
+
384
+
385
+
386
+
387
+ function editSubmit($id)
388
+ {
389
+ global $wpdb;
390
+
391
+ $query = "SELECT * FROM ".$wpdb->prefix."formmaker_submits WHERE group_id=".$id;
392
+
393
+ $rows = $wpdb->get_results($query);
394
+ $form=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id=".$rows[0]->form_id);
395
+ $label_id= array();
396
+ $label_order_original= array();
397
+ $label_type= array();
398
+
399
+ $label_all = explode('#****#',$form->label_order);
400
+ $label_all = array_slice($label_all,0, count($label_all)-1);
401
+
402
+
403
+
404
+ foreach($label_all as $key => $label_each)
405
+ {
406
+ $label_id_each=explode('#**id**#',$label_each);
407
+ array_push($label_id, $label_id_each[0]);
408
+
409
+ $label_oder_each=explode('#**label**#', $label_id_each[1]);
410
+ array_push($label_order_original, $label_oder_each[0]);
411
+ array_push($label_type, $label_oder_each[1]);
412
+
413
+
414
+
415
+ }
416
+
417
+ // display function
418
+
419
+ html_editSubmit($rows, $label_id ,$label_order_original,$label_type);
420
+
421
+
422
+ }
423
+
424
+
425
+
426
+
427
+
428
+
429
+
430
+
431
+
432
+
433
+
434
+ function save_submit($id){
435
+
436
+
437
+ global $wpdb;
438
+ $id = (int) $_POST['id'];
439
+ $date = esc_html($_POST['date']);
440
+ $ip = esc_html($_POST['ip']);
441
+ $form_id=$wpdb->get_var("SELECT form_id FROM ".$wpdb->prefix."formmaker_submits WHERE group_id='".$id."'");
442
+ $form =$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$form_id."'");
443
+ $label_id= array();
444
+ $label_order_original= array();
445
+ $label_type= array();
446
+
447
+ $label_all = explode('#****#',$form->label_order);
448
+ $label_all = array_slice($label_all,0, count($label_all)-1);
449
+
450
+
451
+
452
+ foreach($label_all as $key => $label_each)
453
+ {
454
+ $label_id_each=explode('#**id**#',$label_each);
455
+ array_push($label_id, $label_id_each[0]);
456
+
457
+ $label_oder_each=explode('#**label**#', $label_id_each[1]);
458
+ array_push($label_order_original, $label_oder_each[0]);
459
+ array_push($label_type, $label_oder_each[1]);
460
+
461
+
462
+
463
+ }
464
+
465
+ foreach($label_id as $key => $label_id_1)
466
+ {
467
+ $element_value=$_POST["submission_".$label_id_1];
468
+ if(isset($_POST["submission_".$label_id_1]))
469
+ {
470
+ $query = "SELECT id FROM ".$wpdb->prefix."formmaker_submits WHERE group_id='".$id."' AND element_label='".$label_id_1."'";
471
+ $result=$wpdb->get_var($query);
472
+ if($label_type[$key]=='type_file_upload')
473
+ if($element_value)
474
+ $element_value=$element_value."*@@url@@*";
475
+
476
+ if($result)
477
+ {
478
+ //$query = "UPDATE ".$wpdb->prefix."formmaker_submits SET `element_value`='".$element_value."' WHERE group_id='".$id."' AND element_label='".$label_id_1."'";
479
+ $wpdb->update(
480
+ $wpdb->prefix."formmaker_submits",
481
+ array(
482
+ 'element_value' => $element_value,
483
+ ),
484
+ array( 'group_id' => $id,
485
+ 'element_label' => $label_id_1),
486
+ array(
487
+ '%s',
488
+ ),
489
+ array( '%d',
490
+ '%s' )
491
+ );
492
+ }
493
+ else
494
+ {
495
+ $wpdb->insert(
496
+ $wpdb->prefix."formmaker_submits",
497
+ array(
498
+ 'form_id' => $form_id,
499
+ 'element_label' => $label_id_1,
500
+ 'element_value' => $element_value,
501
+ 'group_id' => $id,
502
+ 'date' => $date,
503
+ 'ip' => $ip
504
+ ),
505
+ array(
506
+ '%d',
507
+ '%s',
508
+ '%s',
509
+ '%d',
510
+ '%s',
511
+ '%s'
512
+ )
513
+ );
514
+ }
515
+ }
516
+ else
517
+ {
518
+ $element_value_ch=$_POST["submission_".$label_id_1.'_0'];
519
+ if(isset($_POST["submission_".$label_id_1.'_0']))
520
+ {
521
+ for($z=0; $z<21; $z++ )
522
+ {
523
+ $element_value_ch=$_POST["submission_".$label_id_1.'_'.$z];
524
+ if(isset($element_value_ch))
525
+ $element_value=$element_value.$element_value_ch.'***br***';
526
+ else
527
+ break;
528
+ }
529
+ $query = "SELECT id FROM ".$wpdb->prefix."formmaker_submits WHERE group_id='".$id."' AND element_label='".$label_id_1."'";
530
+
531
+ $result=$wpdb->get_var($query);
532
+ if($result)
533
+ {
534
+ $query = "UPDATE ".$wpdb->prefix."formmaker_submits SET `element_value`='".$element_value."' WHERE group_id='".$id."' AND element_label='".$label_id_1."'";
535
+ $wpdb->update(
536
+ $wpdb->prefix."formmaker_submits",
537
+ array(
538
+ 'element_value' => $element_value,
539
+ ),
540
+ array( 'group_id' => $id,
541
+ 'element_label' => $label_id_1),
542
+ array(
543
+ '%s',
544
+ ),
545
+ array( '%d',
546
+ '%s' )
547
+ );
548
+ }
549
+ else
550
+ {
551
+ $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."')" ;
552
+ $wpdb->insert(
553
+ $wpdb->prefix."formmaker_submits",
554
+ array(
555
+ 'form_id' => $form_id,
556
+ 'element_label' => $label_id_1,
557
+ 'element_value' => $element_value,
558
+ 'group_id' => $id,
559
+ 'date' => $date,
560
+ 'ip' => $ip
561
+ ),
562
+ array(
563
+ '%d',
564
+ '%s',
565
+ '%s',
566
+ '%d',
567
+ '%s',
568
+ '%s'
569
+ )
570
+ );
571
+ }
572
+
573
+ }
574
+
575
+ }
576
+
577
+
578
+ }
579
+
580
+ }
581
+
582
+
583
+
584
+
585
+
586
+
587
+
588
+
589
+
590
  ?>
Theme_functions.php CHANGED
@@ -1,217 +1,217 @@
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";
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
- else
37
- {
38
- $sort["sortid_by"]="";
39
- }
40
-
41
- if($_POST['page_number'])
42
- {
43
- $limit=($_POST['page_number']-1)*20;
44
- }
45
- else
46
- {
47
- $limit=0;
48
- }
49
- }
50
- else
51
- {
52
- $sort["sortid_by"]="";
53
- $limit=0;
54
- }
55
- if(isset($_POST['search_events_by_title'])){
56
- $search_tag=$_POST['search_events_by_title'];
57
- }
58
-
59
- else
60
- {
61
- $search_tag="";
62
- }
63
- if ( $search_tag ) {
64
- $where= ' WHERE title LIKE "%'.$search_tag.'%"';
65
- }
66
- else{
67
- $where="";
68
- }
69
- if($order=="")
70
- $order="ORDER BY `title` ASC";
71
-
72
-
73
-
74
- if(get_option('contact_form_themes')!=''){
75
- if($where)
76
- {
77
- $where.=' AND `id` IN ('.get_option('contact_form_themes').')';
78
- }
79
- else
80
- {
81
- $where.=' WHERE `id` IN ('.get_option('contact_form_themes').')';
82
- }
83
-
84
- }
85
- else
86
- {
87
- if($where)
88
- {
89
- $where.=' AND `id` IN (0)';
90
- }
91
- else
92
- {
93
- $where.=' WHERE `id` IN (0)';
94
- }
95
-
96
- }
97
-
98
-
99
- // get the total number of records
100
- $query = "SELECT COUNT(*) FROM ".$wpdb->prefix."formmaker_themes". $where;
101
- $total = $wpdb->get_var($query);
102
- $pageNav['total'] =$total;
103
- $pageNav['limit'] = $limit/20+1;
104
-
105
- $query = "SELECT * FROM ".$wpdb->prefix."formmaker_themes".$where." ". $order." "." LIMIT ".$limit.",20";
106
- $rows = $wpdb->get_results($query);
107
- html_show_theme($rows, $pageNav, $sort);
108
- }
109
-
110
- function save_theme(){
111
- global $wpdb;
112
- $save_or_no= $wpdb->insert($wpdb->prefix.'formmaker_themes', array(
113
- 'id' => NULL,
114
- 'title' => $_POST["title"],
115
- 'css' => stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST["css"])),
116
- ),
117
- array(
118
- '%d',
119
- '%s',
120
- '%s'
121
- )
122
- );
123
- if(!$save_or_no)
124
- {
125
- ?>
126
- <div class="updated"><p><strong><?php _e('Error. Please install plugin again'); ?></strong></p></div>
127
- <?php
128
- return false;
129
- }if(get_option('contact_form_themes','')){
130
-
131
-
132
- $xxxxxxx=get_option('contact_form_themes','').','.$wpdb->get_var("SELECT MAX(`id`) FROM ".$wpdb->prefix."formmaker_themes");
133
- }
134
- else
135
- {
136
- $xxxxxxx=get_option('contact_form_themes','').$wpdb->get_var("SELECT MAX(`id`) FROM ".$wpdb->prefix."formmaker_themes");
137
- }
138
- update_option('contact_form_themes',$xxxxxxx);
139
- ?>
140
- <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
141
- <?php
142
-
143
- return true;
144
-
145
- }
146
- function apply_theme($id){
147
- global $wpdb;
148
- $save_or_no= $wpdb->update($wpdb->prefix.'formmaker_themes', array(
149
- 'title' => $_POST["title"],
150
- 'css' =>stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST["css"])),
151
-
152
- ),
153
- array('id'=>$id),
154
- array(
155
- '%s',
156
- '%s'
157
- )
158
- );
159
- ?>
160
- <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
161
- <?php
162
-
163
- return true;
164
-
165
- }
166
-
167
- function edit_theme($id){
168
- global $wpdb;
169
- $row=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker_themes WHERE id='".$id."'");
170
-
171
- html_edit_theme($row, $id);
172
- }
173
-
174
- function remove_theme($id){
175
- global $wpdb;
176
- if($wpdb->get_var("SELECT `default` FROM ".$wpdb->prefix."formmaker_themes WHERE id='".$id."'"))
177
- {
178
- ?>
179
- <div class="updated"><p><strong><?php _e("You can't delete default theme"); ?></strong></p></div>
180
- <?php
181
- return;
182
- }
183
- $sql_remov_tag="DELETE FROM ".$wpdb->prefix."formmaker_themes WHERE id='".$id."'";
184
- if(!$wpdb->query($sql_remov_tag))
185
- {
186
- ?>
187
- <div id="message" class="error"><p>Spider Video Player Theme Not Deleted</p></div>
188
- <?php
189
-
190
- }
191
- else{
192
- ?>
193
- <div class="updated"><p><strong><?php _e('Item Deleted.' ); ?></strong></p></div>
194
- <?php
195
- }
196
- }
197
-
198
- function default_theme($id){
199
- global $wpdb;
200
- $ids_for=$wpdb->get_col("SELECT id FROM ".$wpdb->prefix."formmaker_themes WHERE `default`=1");
201
- for($i=0;$i<count($ids_for);$i++)
202
- {
203
- $savedd=$wpdb->update($wpdb->prefix.'formmaker_themes', array(
204
- 'default' =>0,
205
- ),
206
- array('id'=>$ids_for[$i]),
207
- array( '%d' )
208
- );
209
- }
210
- $savedd=$wpdb->update($wpdb->prefix.'formmaker_themes', array(
211
- 'default' =>1,
212
- ),
213
- array('id'=>$id),
214
- array( '%d' )
215
- );
216
- }
217
  ?>
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";
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"]=esc_html($_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
+ else
37
+ {
38
+ $sort["sortid_by"]="";
39
+ }
40
+
41
+ if($_POST['page_number'])
42
+ {
43
+ $limit=((int) $_POST['page_number']-1)*20;
44
+ }
45
+ else
46
+ {
47
+ $limit=0;
48
+ }
49
+ }
50
+ else
51
+ {
52
+ $sort["sortid_by"]="";
53
+ $limit=0;
54
+ }
55
+ if(isset($_POST['search_events_by_title'])){
56
+ $search_tag=esc_html($_POST['search_events_by_title']);
57
+ }
58
+
59
+ else
60
+ {
61
+ $search_tag="";
62
+ }
63
+ if ( $search_tag ) {
64
+ $where= ' WHERE title LIKE "%'.$search_tag.'%"';
65
+ }
66
+ else{
67
+ $where="";
68
+ }
69
+ if($order=="")
70
+ $order="ORDER BY `title` ASC";
71
+
72
+
73
+
74
+ if(get_option('contact_form_themes')!=''){
75
+ if($where)
76
+ {
77
+ $where.=' AND `id` IN ('.get_option('contact_form_themes').')';
78
+ }
79
+ else
80
+ {
81
+ $where.=' WHERE `id` IN ('.get_option('contact_form_themes').')';
82
+ }
83
+
84
+ }
85
+ else
86
+ {
87
+ if($where)
88
+ {
89
+ $where.=' AND `id` IN (0)';
90
+ }
91
+ else
92
+ {
93
+ $where.=' WHERE `id` IN (0)';
94
+ }
95
+
96
+ }
97
+
98
+
99
+ // get the total number of records
100
+ $query = "SELECT COUNT(*) FROM ".$wpdb->prefix."formmaker_themes". $where;
101
+ $total = $wpdb->get_var($query);
102
+ $pageNav['total'] =$total;
103
+ $pageNav['limit'] = $limit/20+1;
104
+
105
+ $query = "SELECT * FROM ".$wpdb->prefix."formmaker_themes".$where." ". $order." "." LIMIT ".$limit.",20";
106
+ $rows = $wpdb->get_results($query);
107
+ html_show_theme($rows, $pageNav, $sort);
108
+ }
109
+
110
+ function save_theme(){
111
+ global $wpdb;
112
+ $save_or_no= $wpdb->insert($wpdb->prefix.'formmaker_themes', array(
113
+ 'id' => NULL,
114
+ 'title' => $_POST["title"],
115
+ 'css' => stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST["css"])),
116
+ ),
117
+ array(
118
+ '%d',
119
+ '%s',
120
+ '%s'
121
+ )
122
+ );
123
+ if(!$save_or_no)
124
+ {
125
+ ?>
126
+ <div class="updated"><p><strong><?php _e('Error. Please install plugin again'); ?></strong></p></div>
127
+ <?php
128
+ return false;
129
+ }if(get_option('contact_form_themes','')){
130
+
131
+
132
+ $xxxxxxx=get_option('contact_form_themes','').','.$wpdb->get_var("SELECT MAX(`id`) FROM ".$wpdb->prefix."formmaker_themes");
133
+ }
134
+ else
135
+ {
136
+ $xxxxxxx=get_option('contact_form_themes','').$wpdb->get_var("SELECT MAX(`id`) FROM ".$wpdb->prefix."formmaker_themes");
137
+ }
138
+ update_option('contact_form_themes',$xxxxxxx);
139
+ ?>
140
+ <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
141
+ <?php
142
+
143
+ return true;
144
+
145
+ }
146
+ function apply_theme($id){
147
+ global $wpdb;
148
+ $save_or_no= $wpdb->update($wpdb->prefix.'formmaker_themes', array(
149
+ 'title' => $_POST["title"],
150
+ 'css' =>stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST["css"])),
151
+
152
+ ),
153
+ array('id'=>$id),
154
+ array(
155
+ '%s',
156
+ '%s'
157
+ )
158
+ );
159
+ ?>
160
+ <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
161
+ <?php
162
+
163
+ return true;
164
+
165
+ }
166
+
167
+ function edit_theme($id){
168
+ global $wpdb;
169
+ $row=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker_themes WHERE id='".$id."'");
170
+
171
+ html_edit_theme($row, $id);
172
+ }
173
+
174
+ function remove_theme($id){
175
+ global $wpdb;
176
+ if($wpdb->get_var("SELECT `default` FROM ".$wpdb->prefix."formmaker_themes WHERE id='".$id."'"))
177
+ {
178
+ ?>
179
+ <div class="updated"><p><strong><?php _e("You can't delete default theme"); ?></strong></p></div>
180
+ <?php
181
+ return;
182
+ }
183
+ $sql_remov_tag="DELETE FROM ".$wpdb->prefix."formmaker_themes WHERE id='".$id."'";
184
+ if(!$wpdb->query($sql_remov_tag))
185
+ {
186
+ ?>
187
+ <div id="message" class="error"><p>Spider Video Player Theme Not Deleted</p></div>
188
+ <?php
189
+
190
+ }
191
+ else{
192
+ ?>
193
+ <div class="updated"><p><strong><?php _e('Item Deleted.' ); ?></strong></p></div>
194
+ <?php
195
+ }
196
+ }
197
+
198
+ function default_theme($id){
199
+ global $wpdb;
200
+ $ids_for=$wpdb->get_col("SELECT id FROM ".$wpdb->prefix."formmaker_themes WHERE `default`=1");
201
+ for($i=0;$i<count($ids_for);$i++)
202
+ {
203
+ $savedd=$wpdb->update($wpdb->prefix.'formmaker_themes', array(
204
+ 'default' =>0,
205
+ ),
206
+ array('id'=>$ids_for[$i]),
207
+ array( '%d' )
208
+ );
209
+ }
210
+ $savedd=$wpdb->update($wpdb->prefix.'formmaker_themes', array(
211
+ 'default' =>1,
212
+ ),
213
+ array('id'=>$id),
214
+ array( '%d' )
215
+ );
216
+ }
217
  ?>
Themes_function.html.php CHANGED
@@ -1,290 +1,290 @@
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
- <tr>
30
- <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
31
- <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="color:red; text-decoration:none;">
32
- <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
33
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
34
- </a>
35
- </div></td>
36
- </tr>
37
- <tr>
38
- <td width="100%"><h2>Adding New Theme</h2></td>
39
- <td align="right"><input type="button" onclick="submitbutton('Save')" value="Save" class="button-secondary action"> </td>
40
- <td align="right"><input type="button" onclick="submitbutton('Apply')" value="Apply" class="button-secondary action"> </td>
41
- <td align="right"><input type="button" onclick="window.location.href='admin.php?page=contact_form_Themes'" value="Cancel" class="button-secondary action"> </td>
42
- </tr>
43
- </table>
44
- <form action="admin.php?page=contact_form_Themes" method="post" id="adminForm" name="adminForm" >
45
- <table class="admintable">
46
-
47
-
48
- <tr>
49
- <td class="key">
50
- <label for="title">
51
- Title of theme:
52
- </label>
53
- </td>
54
- <td >
55
- <input type="text" name="title" id="title" size="80"/>
56
- </td>
57
- </tr>
58
- <tr>
59
- <td class="key">
60
- <label for="title">
61
- Css:
62
- </label>
63
- </td>
64
- <td >
65
- <textarea name="css" id="css" rows=30 cols=100><?php echo $def_theme->css ?></textarea>
66
- </td>
67
- </tr>
68
- </table>
69
- <input type="hidden" name="option" value="com_formmaker" />
70
- <input type="hidden" name="task" value="" />
71
- </form>
72
-
73
-
74
-
75
-
76
-
77
- <?php
78
- }
79
-
80
- function html_show_theme($rows, $pageNav, $sort){
81
-
82
- global $wpdb;
83
- ?>
84
- <script language="javascript">
85
- function ordering(name,as_or_desc)
86
- {
87
- document.getElementById('asc_or_desc').value=as_or_desc;
88
- document.getElementById('order_by').value=name;
89
- document.getElementById('admin_form').submit();
90
- }
91
- function doNothing() {
92
- var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
93
- if( keyCode == 13 ) {
94
-
95
-
96
- if(!e) var e = window.event;
97
-
98
- e.cancelBubble = true;
99
- e.returnValue = false;
100
-
101
- if (e.stopPropagation) {
102
- e.stopPropagation();
103
- e.preventDefault();
104
- }
105
- }
106
- }
107
- </script>
108
- <script language="JavaScript">
109
-
110
- </script>
111
- <form method="post" onkeypress="doNothing()" action="admin.php?page=contact_form_Themes" id="admin_form" name="admin_form">
112
- <table cellspacing="10" width="95%">
113
-
114
-
115
-
116
- <tr>
117
- <td style="width:80px">
118
- <?php echo "<h2>".'Themes'. "</h2>"; ?>
119
- </td>
120
-
121
- <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=contact_form_Themes&task=add_theme'" /></p></td>
122
- <td style="text-align:right;font-size:16px;padding:20px; padding-right:50px">
123
-
124
- </td>
125
- <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
126
- <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="color:red; text-decoration:none;">
127
- <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
128
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
129
- </a>
130
- </td>
131
- </tr>
132
- </table>
133
- <?php
134
- 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="";}
135
- $serch_fields='<div class="alignleft actions" style="width:180px;">
136
- <label for="search_events_by_title" style="font-size:14px">Title: </label>
137
- <input type="text" name="search_events_by_title" value="'.$serch_value.'" id="search_events_by_title" onchange="clear_serch_texts()">
138
- </div>
139
- <div class="alignleft actions">
140
- <input type="button" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\'; document.getElementById(\'serch_or_not\').value=\'search\';
141
- document.getElementById(\'admin_form\').submit();" class="button-secondary action">
142
- <input type="button" value="Reset" onclick="window.location.href=\'admin.php?page=contact_form_Themes\'" class="button-secondary action">
143
- </div>';
144
- print_html_nav($pageNav['total'],$pageNav['limit'],$serch_fields);
145
-
146
- ?>
147
- <table class="wp-list-table widefat fixed pages" style="width:95%">
148
- <thead>
149
- <TR>
150
- <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>
151
- <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>
152
- <th>Default</th>
153
- <th style="width:80px">Edit</th>
154
- <th style="width:80px">Delete</th>
155
- </TR>
156
- </thead>
157
- <tbody>
158
- <?php for($i=0; $i<count($rows);$i++){ ?>
159
- <tr>
160
- <td><?php echo $rows[$i]->id; ?></td>
161
- <td><a href="admin.php?page=contact_form_Themes&task=edit_theme&id=<?php echo $rows[$i]->id?>"><?php echo $rows[$i]->title; ?></a></td>
162
- <td><a <?php if(!$rows[$i]->default) echo 'style="color:#C00"'; ?> href="admin.php?page=contact_form_Themes&task=default&id=<?php echo $rows[$i]->id?>"><?php if($rows[$i]->default) echo "Default"; else echo "Not Default"; ?></a></td>
163
- <td><a href="admin.php?page=contact_form_Themes&task=edit_theme&id=<?php echo $rows[$i]->id?>">Edit</a></td>
164
- <td><a href="admin.php?page=contact_form_Themes&task=remove_theme&id=<?php echo $rows[$i]->id?>">Delete</a></td>
165
- </tr>
166
- <?php } ?>
167
- </tbody>
168
- </table>
169
- <input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if(isset($_POST['asc_or_desc'])) echo $_POST['asc_or_desc'];?>" />
170
- <input type="hidden" name="order_by" id="order_by" value="<?php if(isset($_POST['order_by'])) echo $_POST['order_by'];?>" />
171
-
172
- <?php
173
- ?>
174
-
175
-
176
-
177
- </form>
178
- <?php
179
-
180
- }
181
-
182
- function html_edit_theme($row, $id){
183
-
184
- ?>
185
-
186
-
187
- <script>
188
-
189
- function submitbutton(pressbutton) {
190
-
191
- var form = document.adminForm;
192
-
193
- if (pressbutton == 'cancel_themes')
194
- {
195
- submitform( pressbutton );
196
- return;
197
- }
198
- if(form.title.value=="")
199
- {
200
- alert('Set Theme title');
201
- return;
202
- }
203
-
204
- submitform( pressbutton );
205
- }
206
- function submitform(pressbutton)
207
- {
208
- document.getElementById("adminForm").action=document.getElementById("adminForm").action+"&task="+pressbutton;
209
- document.getElementById("adminForm").submit();
210
- }
211
-
212
- </script>
213
-
214
-
215
-
216
-
217
-
218
-
219
-
220
-
221
-
222
-
223
-
224
-
225
-
226
-
227
-
228
-
229
-
230
-
231
-
232
-
233
- <table width="90%">
234
- <tr>
235
- <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
236
- <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="color:red; text-decoration:none;">
237
- <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
238
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
239
- </a>
240
- </div></td>
241
- </tr>
242
- <tr>
243
- <td width="100%"><h2>Theme <?php echo htmlspecialchars($row->title)?></h2></td>
244
- <td align="right"><input type="button" onclick="submitbutton('Save')" value="Save" class="button-secondary action"> </td>
245
- <td align="right"><input type="button" onclick="submitbutton('Apply')" value="Apply" class="button-secondary action"> </td>
246
- <td align="right"><input type="button" onclick="window.location.href='admin.php?page=contact_form_Themes'" value="Cancel" class="button-secondary action"> </td>
247
- </tr>
248
- </table>
249
- <form action="admin.php?page=contact_form_Themes&id=<?php echo $id; ?>" method="post" id="adminForm" name="adminForm" >
250
- <table class="admintable">
251
-
252
-
253
- <tr>
254
- <td class="key">
255
- <label for="title">
256
- Title of theme:
257
- </label>
258
- </td>
259
- <td >
260
- <input type="text" name="title" id="title" value="<?php echo htmlspecialchars($row->title) ?>" size="80"/>
261
- </td>
262
- </tr>
263
- <tr>
264
- <td class="key">
265
- <label for="title">
266
- Css:
267
- </label>
268
- </td>
269
- <td >
270
- <textarea name="css" id="css" rows=30 cols=100><?php echo htmlspecialchars($row->css) ?></textarea>
271
- </td>
272
- </tr>
273
- </table>
274
- <input type="hidden" name="option" value="com_formmaker" />
275
- <input type="hidden" name="id" value="<?php echo $row->id?>" />
276
- <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
277
- <input type="hidden" name="task" value="" />
278
- </form>
279
-
280
-
281
- <?php
282
- }
283
- function cheched($row,$y)
284
- {
285
- if($row==$y)
286
- {
287
- echo'checked="checked"';
288
- }
289
- }
290
  ?>
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
+ <tr>
30
+ <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
31
+ <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="color:red; text-decoration:none;">
32
+ <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
33
+ Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
34
+ </a>
35
+ </div></td>
36
+ </tr>
37
+ <tr>
38
+ <td width="100%"><h2>Adding New Theme</h2></td>
39
+ <td align="right"><input type="button" onclick="submitbutton('Save')" value="Save" class="button-secondary action"> </td>
40
+ <td align="right"><input type="button" onclick="submitbutton('Apply')" value="Apply" class="button-secondary action"> </td>
41
+ <td align="right"><input type="button" onclick="window.location.href='admin.php?page=contact_form_Themes'" value="Cancel" class="button-secondary action"> </td>
42
+ </tr>
43
+ </table>
44
+ <form action="admin.php?page=contact_form_Themes" method="post" id="adminForm" name="adminForm" >
45
+ <table class="admintable">
46
+
47
+
48
+ <tr>
49
+ <td class="key">
50
+ <label for="title">
51
+ Title of theme:
52
+ </label>
53
+ </td>
54
+ <td >
55
+ <input type="text" name="title" id="title" size="80"/>
56
+ </td>
57
+ </tr>
58
+ <tr>
59
+ <td class="key">
60
+ <label for="title">
61
+ Css:
62
+ </label>
63
+ </td>
64
+ <td >
65
+ <textarea name="css" id="css" rows=30 cols=100><?php echo $def_theme->css ?></textarea>
66
+ </td>
67
+ </tr>
68
+ </table>
69
+ <input type="hidden" name="option" value="com_formmaker" />
70
+ <input type="hidden" name="task" value="" />
71
+ </form>
72
+
73
+
74
+
75
+
76
+
77
+ <?php
78
+ }
79
+
80
+ function html_show_theme($rows, $pageNav, $sort){
81
+
82
+ global $wpdb;
83
+ ?>
84
+ <script language="javascript">
85
+ function ordering(name,as_or_desc)
86
+ {
87
+ document.getElementById('asc_or_desc').value=as_or_desc;
88
+ document.getElementById('order_by').value=name;
89
+ document.getElementById('admin_form').submit();
90
+ }
91
+ function doNothing() {
92
+ var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
93
+ if( keyCode == 13 ) {
94
+
95
+
96
+ if(!e) var e = window.event;
97
+
98
+ e.cancelBubble = true;
99
+ e.returnValue = false;
100
+
101
+ if (e.stopPropagation) {
102
+ e.stopPropagation();
103
+ e.preventDefault();
104
+ }
105
+ }
106
+ }
107
+ </script>
108
+ <script language="JavaScript">
109
+
110
+ </script>
111
+ <form method="post" onkeypress="doNothing()" action="admin.php?page=contact_form_Themes" id="admin_form" name="admin_form">
112
+ <table cellspacing="10" width="95%">
113
+
114
+
115
+
116
+ <tr>
117
+ <td style="width:80px">
118
+ <?php echo "<h2>".'Themes'. "</h2>"; ?>
119
+ </td>
120
+
121
+ <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=contact_form_Themes&task=add_theme'" /></p></td>
122
+ <td style="text-align:right;font-size:16px;padding:20px; padding-right:50px">
123
+
124
+ </td>
125
+ <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
126
+ <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="color:red; text-decoration:none;">
127
+ <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
128
+ Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
129
+ </a>
130
+ </td>
131
+ </tr>
132
+ </table>
133
+ <?php
134
+ 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="";}
135
+ $serch_fields='<div class="alignleft actions" style="width:180px;">
136
+ <label for="search_events_by_title" style="font-size:14px">Title: </label>
137
+ <input type="text" name="search_events_by_title" value="'.$serch_value.'" id="search_events_by_title" onchange="clear_serch_texts()">
138
+ </div>
139
+ <div class="alignleft actions">
140
+ <input type="button" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\'; document.getElementById(\'serch_or_not\').value=\'search\';
141
+ document.getElementById(\'admin_form\').submit();" class="button-secondary action">
142
+ <input type="button" value="Reset" onclick="window.location.href=\'admin.php?page=contact_form_Themes\'" class="button-secondary action">
143
+ </div>';
144
+ print_html_nav($pageNav['total'],$pageNav['limit'],$serch_fields);
145
+
146
+ ?>
147
+ <table class="wp-list-table widefat fixed pages" style="width:95%">
148
+ <thead>
149
+ <TR>
150
+ <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>
151
+ <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>
152
+ <th>Default</th>
153
+ <th style="width:80px">Edit</th>
154
+ <th style="width:80px">Delete</th>
155
+ </TR>
156
+ </thead>
157
+ <tbody>
158
+ <?php for($i=0; $i<count($rows);$i++){ ?>
159
+ <tr>
160
+ <td><?php echo $rows[$i]->id; ?></td>
161
+ <td><a href="admin.php?page=contact_form_Themes&task=edit_theme&id=<?php echo $rows[$i]->id?>"><?php echo $rows[$i]->title; ?></a></td>
162
+ <td><a <?php if(!$rows[$i]->default) echo 'style="color:#C00"'; ?> href="admin.php?page=contact_form_Themes&task=default&id=<?php echo $rows[$i]->id?>"><?php if($rows[$i]->default) echo "Default"; else echo "Not Default"; ?></a></td>
163
+ <td><a href="admin.php?page=contact_form_Themes&task=edit_theme&id=<?php echo $rows[$i]->id?>">Edit</a></td>
164
+ <td><a href="admin.php?page=contact_form_Themes&task=remove_theme&id=<?php echo $rows[$i]->id?>">Delete</a></td>
165
+ </tr>
166
+ <?php } ?>
167
+ </tbody>
168
+ </table>
169
+ <input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if(isset($_POST['asc_or_desc'])) echo esc_html($_POST['asc_or_desc']);?>" />
170
+ <input type="hidden" name="order_by" id="order_by" value="<?php if(isset($_POST['order_by'])) echo esc_html($_POST['order_by']);?>" />
171
+
172
+ <?php
173
+ ?>
174
+
175
+
176
+
177
+ </form>
178
+ <?php
179
+
180
+ }
181
+
182
+ function html_edit_theme($row, $id){
183
+
184
+ ?>
185
+
186
+
187
+ <script>
188
+
189
+ function submitbutton(pressbutton) {
190
+
191
+ var form = document.adminForm;
192
+
193
+ if (pressbutton == 'cancel_themes')
194
+ {
195
+ submitform( pressbutton );
196
+ return;
197
+ }
198
+ if(form.title.value=="")
199
+ {
200
+ alert('Set Theme title');
201
+ return;
202
+ }
203
+
204
+ submitform( pressbutton );
205
+ }
206
+ function submitform(pressbutton)
207
+ {
208
+ document.getElementById("adminForm").action=document.getElementById("adminForm").action+"&task="+pressbutton;
209
+ document.getElementById("adminForm").submit();
210
+ }
211
+
212
+ </script>
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+ <table width="90%">
234
+ <tr>
235
+ <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
236
+ <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="color:red; text-decoration:none;">
237
+ <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
238
+ Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
239
+ </a>
240
+ </div></td>
241
+ </tr>
242
+ <tr>
243
+ <td width="100%"><h2>Theme <?php echo htmlspecialchars($row->title)?></h2></td>
244
+ <td align="right"><input type="button" onclick="submitbutton('Save')" value="Save" class="button-secondary action"> </td>
245
+ <td align="right"><input type="button" onclick="submitbutton('Apply')" value="Apply" class="button-secondary action"> </td>
246
+ <td align="right"><input type="button" onclick="window.location.href='admin.php?page=contact_form_Themes'" value="Cancel" class="button-secondary action"> </td>
247
+ </tr>
248
+ </table>
249
+ <form action="admin.php?page=contact_form_Themes&id=<?php echo $id; ?>" method="post" id="adminForm" name="adminForm" >
250
+ <table class="admintable">
251
+
252
+
253
+ <tr>
254
+ <td class="key">
255
+ <label for="title">
256
+ Title of theme:
257
+ </label>
258
+ </td>
259
+ <td >
260
+ <input type="text" name="title" id="title" value="<?php echo htmlspecialchars($row->title) ?>" size="80"/>
261
+ </td>
262
+ </tr>
263
+ <tr>
264
+ <td class="key">
265
+ <label for="title">
266
+ Css:
267
+ </label>
268
+ </td>
269
+ <td >
270
+ <textarea name="css" id="css" rows=30 cols=100><?php echo htmlspecialchars($row->css) ?></textarea>
271
+ </td>
272
+ </tr>
273
+ </table>
274
+ <input type="hidden" name="option" value="com_formmaker" />
275
+ <input type="hidden" name="id" value="<?php echo $row->id?>" />
276
+ <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
277
+ <input type="hidden" name="task" value="" />
278
+ </form>
279
+
280
+
281
+ <?php
282
+ }
283
+ function cheched($row,$y)
284
+ {
285
+ if($row==$y)
286
+ {
287
+ echo'checked="checked"';
288
+ }
289
+ }
290
  ?>
contact_form.php CHANGED
@@ -1,1714 +1,1729 @@
1
- <?php
2
- /*
3
- Plugin Name: Contact Form FREE
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
-
16
- $first_css = ".wdform_table1
17
- {
18
- font-size:14px;
19
- font-weight:normal;
20
- color:#000000;
21
- width:100% ;
22
- }
23
-
24
- .wdform_tbody1
25
- {
26
- float:left;
27
- }
28
- .wdform_table2
29
- {
30
- padding-right:50px !important;
31
- float:left;
32
- border-spacing: 0px;
33
- border-collapse:separate !important;
34
- }
35
- #edit_main_table label
36
- {
37
- line-height: 19px;
38
- }
39
- #edit_main_table td
40
- {
41
- padding-right: 5px;
42
- }
43
- .time_box
44
- {
45
- border-width:1px;
46
- margin: 0px;
47
- padding: 0px;
48
- text-align:right;
49
- width:30px;
50
- vertical-align:middle
51
- }
52
-
53
- .mini_label
54
- {
55
- font-size:10px;
56
- font-family: 'Lucida Grande', Tahoma, Arial, Verdana, sans-serif;
57
- }
58
-
59
- .ch_rad_label
60
- {
61
- display:inline;
62
- margin-left:5px;
63
- margin-right:15px;
64
- float:none;
65
- }
66
-
67
- .label
68
- {
69
- border:none;
70
- }
71
-
72
-
73
- .td_am_pm_select
74
- {
75
- padding-left:5;
76
- }
77
-
78
- .am_pm_select
79
- {
80
- height: 16px;
81
- margin:0;
82
- padding:0
83
- }
84
-
85
- .input_deactive
86
- {
87
- color:#999999;
88
- font-style:italic;
89
- border-width:1px;
90
- margin: 0px;
91
- padding: 0px
92
- }
93
-
94
- .input_active
95
- {
96
- color:#000000;
97
- font-style:normal;
98
- border-width:1px;
99
- margin: 0px;
100
- padding: 0px
101
- }
102
-
103
- .required
104
- {
105
- border:none;
106
- color:red
107
- }
108
-
109
- .captcha_img
110
- {
111
- border-width:0px;
112
- margin: 0px;
113
- padding: 0px;
114
- cursor:pointer;
115
-
116
-
117
- }
118
-
119
- .captcha_refresh
120
- {
121
- width:30px;
122
- height:30px;
123
- border-width:0px;
124
- margin: 0px;
125
- padding: 0px;
126
- vertical-align:middle;
127
- cursor:pointer;
128
- background-image: url(".plugins_url('images/refresh_black.png',__FILE__).");
129
- }
130
-
131
- .captcha_input
132
- {
133
- height:20px;
134
- border-width:1px;
135
- margin: 0px;
136
- padding: 0px;
137
- vertical-align:middle;
138
- }
139
-
140
- .file_upload
141
- {
142
- border-width:1px;
143
- margin: 0px;
144
- padding: 0px
145
- }
146
-
147
- .page_deactive
148
- {
149
- border:1px solid black;
150
- padding:4px 7px 4px 7px;
151
- margin:4px;
152
- cursor:pointer;
153
- background-color:#DBDBDB;
154
- }
155
-
156
- .page_active
157
- {
158
- border:1px solid black;
159
- padding:4px 7px 4px 7px;
160
- margin:4px;
161
- cursor:pointer;
162
- background-color:#878787;
163
- }
164
-
165
- .page_percentage_active
166
- {
167
- padding:0px;
168
- margin:0px;
169
- border-spacing: 0px;
170
- height:30px;
171
- line-height:30px;
172
- background-color:yellow;
173
- border-radius:30px;
174
- font-size:15px;
175
- float:left;
176
- text-align: right !important;
177
- }
178
-
179
-
180
- .page_percentage_deactive
181
- {
182
- height:30px;
183
- line-height:30px;
184
- padding:5px;
185
- border:1px solid black;
186
- width:100%;
187
- background-color:white;
188
- border-radius:30px;
189
- text-align: left !important;
190
- }
191
-
192
- .page_numbers
193
- {
194
- font-size:11px;
195
- }
196
-
197
- .phone_area_code
198
- {
199
- width:50px;
200
- }
201
-
202
- .phone_number
203
- {
204
- width:100px;
205
- }";
206
-
207
-
208
-
209
-
210
-
211
-
212
-
213
-
214
-
215
-
216
-
217
-
218
-
219
-
220
-
221
-
222
-
223
-
224
-
225
-
226
-
227
- //////////////////////////////////////////////////////////////////
228
-
229
-
230
-
231
-
232
-
233
-
234
- require_once("front_end_contact_form.php");
235
- require_once("contact_form_maker_widget.php");
236
- require_once('recaptchalib.php');
237
-
238
- add_action( 'init', 'contact_form_language_load' );
239
-
240
- function contact_form_language_load() {
241
- load_plugin_textdomain('form_maker', false, basename( dirname( __FILE__ ) ) . '/languages' );
242
- }
243
- add_action('init', 'spider_contact_form_output_buffer');
244
- function spider_contact_form_output_buffer() {
245
- ob_start();
246
- }
247
-
248
-
249
-
250
-
251
-
252
-
253
- add_filter('the_content','Contact_Form_maker_fornt_end_main',5000);
254
-
255
-
256
- function Contact_Form_maker_fornt_end_main($content){
257
-
258
- if(!get_option('form_maker_pro_active',false)){
259
-
260
-
261
- $pattern ='[\[contact_form id="([0-9]*)"\]]';
262
-
263
-
264
- $count_forms_in_post=preg_match_all ( $pattern, $content, $matches_form);
265
- for($jj=0;$jj<$count_forms_in_post;$jj++)
266
- {
267
- $padron=$matches_form[0][$jj];
268
-
269
- $replacment=contact_form_front_end($matches_form[1][$jj]);
270
- $content=str_replace($padron,$replacment,$content);
271
- }
272
- }
273
- return $content;
274
- }
275
-
276
-
277
-
278
-
279
-
280
- function contact_form_scripts_method() {
281
-
282
- if(!get_option('form_maker_pro_active',false)){
283
- wp_enqueue_style("gmap_styles_",plugins_url("css/style_for_map.css",__FILE__),false);
284
- wp_enqueue_script("mootools",plugins_url("js/mootools.js",__FILE__));
285
- wp_enqueue_script("main_g_js",plugins_url("js/main_front_end.js",__FILE__),false);
286
- wp_enqueue_script("Gmap","http://maps.google.com/maps/api/js?sensor=false",false);
287
- wp_enqueue_script("if_gmap",plugins_url("js/if_gmap_front_end.js",__FILE__),false);
288
- wp_enqueue_script("Calendar",plugins_url("js/calendar.js",__FILE__),false);
289
- wp_enqueue_script("calendar-setup",plugins_url("js/calendar-setup.js",__FILE__),false);
290
- wp_enqueue_script("calendar_function",plugins_url("js/calendar_function.js",__FILE__),false);
291
-
292
- wp_enqueue_style("Css",plugins_url("js/calendar-jos.css",__FILE__),false);
293
- }
294
-
295
- }
296
-
297
- add_action('wp_enqueue_scripts', 'contact_form_scripts_method');
298
-
299
-
300
-
301
- ///////////////////////////// FORNT END Print message
302
-
303
- for($ii=0;$ii<100;$ii++){
304
- remove_filter('the_content','do_shortcode',$ii);
305
- remove_filter('the_content','wpautop',$ii);
306
- }
307
- add_filter('the_content','wpautop',10);
308
- add_filter('the_content','do_shortcode',11);
309
-
310
- function print_massage_contact_form($content)
311
- {
312
-
313
- if(!get_option('form_maker_pro_active',false)){
314
- $mh_after_head = did_action( 'wp_enqueue_scripts' );
315
- if($mh_after_head==1){
316
- global $wpdb;
317
-
318
-
319
- @session_start();
320
- if(isset($_SESSION['form_submit_type']) && $_SESSION['form_submit_type']){
321
- $type_and_id=$_SESSION['form_submit_type'];
322
- $type_and_id=explode(',',$type_and_id);
323
- $form_get_type=$type_and_id[0];
324
- $form_get_id=$type_and_id[1];
325
- $_SESSION['form_submit_type']=0;
326
- if($form_get_type==3){
327
- $_SESSION['massage_after_submit']="";
328
- $row=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$form_get_id."'");
329
- return $row->submit_text;
330
- }
331
- }
332
- if( isset($_SESSION['massage_after_submit']))
333
- {
334
- if($_SESSION['massage_after_submit']!="")
335
- {
336
-
337
- $message=$_SESSION['massage_after_submit'];
338
- $_SESSION['massage_after_submit']="";
339
-
340
- $returned_content=" <style>
341
- .updated,.error{
342
- border-width:1px !important;
343
- border-style:solid !important;
344
- padding:0 .6em !important;
345
- margin:5px 15px 2px !important;
346
- -moz-border-radius:3px !important;
347
- -khtml-border-radius:3px !important;
348
- -webkit-border-radius:3px !important;
349
- border-radius:3px !important;
350
- }
351
- .updated p, .error p
352
- {
353
- font-size: 12px !important;
354
- margin:.5em 0 !important;
355
- line-height:1 !important;
356
- padding:2px !important;
357
- }
358
- .updated, .error
359
- {
360
- margin:5px 0 15px !important;
361
- }
362
- .updated{
363
- background-color:#ffffe0 !important;
364
- border-color:#e6db55 !important;
365
- }
366
- .error
367
- {
368
- background-color:#ffebe8 !important;
369
- border-color:#c00 !important;
370
- }
371
- error a
372
- {
373
- color:#c00 !important;
374
- }
375
- .error
376
- {
377
- line-height:22px !important;
378
- margin:0 15px !important;
379
- padding:3px 5px !important;
380
- }
381
- .error-div
382
- {
383
- display:block !important;
384
- line-height:36px !important;
385
- float:right !important;
386
- margin-right:20px !important;
387
- }
388
- </style>";
389
-
390
-
391
- if($_SESSION['error_or_no'])
392
- {
393
- $error='error';
394
- }
395
- else
396
- {
397
- $error='updated';
398
- }
399
-
400
- $returned_content.="<div class=\"".$error."\" ><p><strong>".$message."</strong></p></div>".$content;// modified content
401
- return $returned_content;
402
- }
403
- else
404
- {
405
- return $content;
406
- }
407
- }
408
- else
409
- {
410
- return $content;
411
- }
412
- }
413
- else
414
- {
415
- return $content;
416
- }
417
- }
418
-
419
- else
420
- return $content;
421
- }
422
-
423
-
424
- add_filter('the_content', 'print_massage_contact_form');
425
-
426
-
427
- ///////////////////////////// FORNT END FUNCTION
428
- //// add front end
429
-
430
-
431
-
432
- //// add editor new mce button
433
- add_filter('mce_external_plugins', "contact_form_register");
434
- add_filter('mce_buttons', 'contact_form_add_button', 0);
435
-
436
-
437
- /// function for add new button
438
- function contact_form_add_button($buttons)
439
- {
440
-
441
- if(!get_option('form_maker_pro_active',false)){
442
-
443
- array_push($buttons, "contact_form_mce");
444
-
445
- }
446
- return $buttons;
447
- }
448
- /// function for registr new button
449
- function contact_form_register($plugin_array)
450
- {
451
-
452
- if(!get_option('form_maker_pro_active',false)){
453
-
454
- $url = plugins_url( 'js/editor_plugin.js' , __FILE__ );
455
- $plugin_array["contact_form_mce"] = $url;
456
-
457
- }
458
- return $plugin_array;
459
- }
460
-
461
-
462
-
463
-
464
-
465
-
466
-
467
-
468
-
469
-
470
-
471
-
472
-
473
-
474
-
475
-
476
-
477
-
478
-
479
-
480
-
481
-
482
-
483
-
484
-
485
- ///////////////////////////////////////// add ajax for form maker functionaliti
486
-
487
-
488
- require_once("contact_form_ajax_functions.php"); //////////// include form ajax functions for next 2 ajax hooks
489
-
490
- add_action('wp_ajax_formcontactwdcaptcha', 'form_contact_wd_captcha'); /// generete captcha image and save it code in session
491
- add_action('wp_ajax_formcontactwindow', 'form_contact_window_php'); /// openid window in post or page for editor
492
-
493
- add_action('wp_ajax_nopriv_formcontactwdcaptcha', 'form_contact_wd_captcha'); /// generete captcha image and save it code in session
494
- add_action('wp_ajax_nopriv_formcontactwindow', 'form_contact_window_php'); /// openid window in post or page for editor
495
-
496
-
497
-
498
-
499
- ////////////////////////////////////////////////////////////////////////////
500
-
501
-
502
-
503
-
504
-
505
-
506
-
507
-
508
-
509
-
510
-
511
-
512
-
513
-
514
-
515
-
516
-
517
-
518
-
519
-
520
-
521
-
522
-
523
- function add_button_style_contact_form()
524
- {
525
- echo '<style type="text/css">
526
- .wp_themeSkin span.mce_contact_form_mce {background:url('.plugins_url( 'images/formmakerLogo.png' , __FILE__ ).') no-repeat !important;}
527
- .wp_themeSkin .mceButtonEnabled:hover span.mce_contact_form_mce,.wp_themeSkin .mceButtonActive span.mce_contact_form_mce
528
- {background:url('.plugins_url( 'images/formmakerLogoHover.png' , __FILE__ ).') no-repeat !important;}
529
- </style>';
530
- }
531
-
532
- add_action('admin_head', 'add_button_style_contact_form');
533
-
534
-
535
-
536
-
537
-
538
-
539
-
540
- add_action('admin_menu', 'contact_form_options_panel');
541
- function contact_form_options_panel(){
542
-
543
- if(!get_option('form_maker_pro_active',false)){
544
- $icon_url=plugins_url( 'images/FormMakerLogo-16.png' , __FILE__ );
545
- add_menu_page('Theme page title', 'Contact Form', 'manage_options', 'contact_form', 'Manage_contact_form', $icon_url);
546
- $page_form= add_submenu_page( 'contact_form', 'Contact Form Manager', 'Manager', 'manage_options', 'contact_form', 'Manage_contact_form');
547
- $page_submits=add_submenu_page( 'contact_form', 'Contact Form Submissions', 'Submissions', 'manage_options', 'contact_form_Submits', 'contact_form_Submits');
548
- add_submenu_page( 'contact_form', 'Licensing', 'Licensing', 'manage_options', 'contact_form_Licensing', 'contact_form_Licensing');
549
- add_submenu_page( 'contact_form', 'Contact Form Themes', 'Themes', 'manage_options', 'contact_form_Themes', 'contact_form_Themes');
550
- add_submenu_page( 'contact_form', 'Uninstall Contact Form ', 'Uninstall Contact Form', 'manage_options', 'Uninstall_contact_form', 'Uninstall_contact_form');
551
-
552
-
553
-
554
- add_action('admin_print_styles-' . $page_form, 'contact_form_admin_styles_scripts');
555
- add_action('admin_print_styles-' . $page_submits, 'contact_form_submits_styles_scripts');
556
- }
557
- }
558
-
559
-
560
-
561
- function contact_form_Licensing(){
562
-
563
-
564
- ?>
565
- <div style="width:95%">
566
- <p>
567
- This plugin is the non-commercial version of the Contact Form. Use of this plugin is free. You can add unlimited number of the fields. The limitation is on the some types of the fields (Time and Date, Select, Check box, Radio and File Upload). If you want to use those fields, you are required to purchase a license. </p>
568
- <br /><br />
569
- <a href="http://web-dorado.com/files/fromContactForm.php" class="button-primary" target="_blank">Purchase a License</a>
570
- <br /><br /><br />
571
- <p>After the purchasing the commercial version follow this steps:</p>
572
- <ol>
573
- <li>Deactivate Contact Form Plugin</li>
574
- <li>Delete Contact Form Plugin</li>
575
- <li>Install the downloaded commercial version of the plugin</li>
576
- </ol>
577
- </div>
578
- <?php
579
-
580
-
581
-
582
-
583
- }
584
- function contact_form_submits_styles_scripts()
585
- {
586
-
587
-
588
- wp_enqueue_script('word-count');
589
- wp_enqueue_script('post');
590
- wp_enqueue_script('editor');
591
- wp_enqueue_script('media-upload');
592
- wp_admin_css('thickbox');
593
- wp_print_scripts('media-upload');
594
- do_action('admin_print_styles');
595
- wp_enqueue_script( 'common' );
596
- wp_enqueue_script( 'jquery-color' );
597
- wp_print_scripts('editor');
598
- if (function_exists('add_thickbox')) add_thickbox();
599
- if(get_bloginfo('version')<'3.3')
600
- if (function_exists('wp_tiny_mce')) wp_tiny_mce();
601
- wp_enqueue_script('utils');
602
- wp_enqueue_script("mootools",plugins_url("js/mootools.js",__FILE__));
603
- wp_enqueue_script("f_calendar",plugins_url("js/calendar.js",__FILE__));
604
- wp_enqueue_script("f_calendar_functions",plugins_url("js/calendar_function.js",__FILE__));
605
- wp_enqueue_script("f_calendar_setup",plugins_url("js/calendar-setup.js",__FILE__));
606
- wp_enqueue_style("calendar-jos",plugins_url("js/calendar-jos.css",__FILE__));
607
- }
608
-
609
-
610
-
611
-
612
-
613
-
614
- function contact_form_admin_styles_scripts()
615
- {
616
- if(isset($_GET['task']))
617
- {
618
- if($_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")
619
- {
620
- wp_enqueue_script('word-count');
621
- wp_enqueue_script('post');
622
- wp_enqueue_script('editor');
623
- wp_enqueue_script('media-upload');
624
- wp_admin_css('thickbox');
625
- wp_print_scripts('media-upload');
626
- if(get_bloginfo('version')<'3.3')
627
- wp_print_scripts('editor-functions');
628
- do_action('admin_print_styles');
629
- wp_enqueue_script( 'common' );
630
- wp_enqueue_script( 'jquery-color' );
631
- if(get_bloginfo('version')<'3.3')
632
- wp_print_scripts('editor');
633
- if (function_exists('add_thickbox')) add_thickbox();
634
- if(get_bloginfo('version')<'3.3')
635
- if (function_exists('wp_tiny_mce')) wp_tiny_mce();
636
- wp_enqueue_script('utils');
637
- if(get_bloginfo('version')>3.3){
638
- wp_enqueue_script("jquery");
639
-
640
- }
641
- else
642
- {
643
- wp_deregister_script( 'jquery' );
644
- wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js');
645
- wp_enqueue_script( 'jquery' );
646
-
647
-
648
- }
649
- wp_enqueue_script("gmap_form",plugins_url("js/if_gmap_back_end.js",__FILE__));
650
- wp_enqueue_script("form_main_js_free",plugins_url("js/formmaker_free.js",__FILE__));
651
- wp_enqueue_script("gmap_form_api",'http://maps.google.com/maps/api/js?sensor=false');
652
- wp_enqueue_style("styles_form",plugins_url("css/style.css",__FILE__));
653
- wp_enqueue_script("mootools",plugins_url("js/mootools.js",__FILE__));
654
- wp_enqueue_script("f_calendar",plugins_url("js/calendar.js",__FILE__));
655
- wp_enqueue_script("f_calendar_functions",plugins_url("js/calendar_function.js",__FILE__));
656
- wp_enqueue_script("f_calendar_setup",plugins_url("js/calendar-setup.js",__FILE__));
657
-
658
- // wp_enqueue_script("main",plugins_url("js/main.js",__FILE__));
659
- wp_enqueue_style("calendar-jos",plugins_url("js/calendar-jos.css",__FILE__));
660
-
661
-
662
-
663
-
664
- }
665
- }
666
-
667
-
668
-
669
- }
670
-
671
-
672
-
673
-
674
-
675
-
676
-
677
-
678
-
679
-
680
-
681
-
682
-
683
-
684
-
685
-
686
- function Manage_contact_form()
687
- {
688
-
689
- require_once("contact_form_functions.php");
690
- require_once("contact_form_functions.html.php");
691
- if(!function_exists('print_html_nav'))
692
- require_once("nav_function/nav_html_func.php");
693
-
694
-
695
- global $wpdb;
696
- if(isset($_GET["task"]))
697
- {
698
- $task=$_GET["task"];
699
- }
700
- else
701
- {
702
- $task="show";
703
- }
704
- if(isset($_GET["id"]))
705
- {
706
- $id=$_GET["id"];
707
- }
708
- else
709
- {
710
- $id=0;
711
- }
712
-
713
-
714
- switch($task){
715
-
716
- case "add_form" :
717
- add_form();
718
- break;
719
-
720
- case "edit_form" :
721
- edit_contact_form($id);
722
- break;
723
-
724
- case "Save" :
725
- if($id)
726
- apply_form($id);
727
- else
728
- save_form();
729
- display_form_lists();
730
- break;
731
-
732
- case "Apply" :
733
- if($id){
734
- apply_form($id);
735
- }
736
- else
737
- {
738
- save_form();
739
- $id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
740
- }
741
- forchrome($id);
742
- break;
743
-
744
- case "gotoedit" :
745
- gotoedit();
746
- edit_contact_form($id);
747
- break;
748
-
749
- case "remove_form" :
750
- remove_form($id);
751
- display_form_lists();
752
- break;
753
-
754
-
755
-
756
-
757
- // Actions_after_submission
758
- case "Actions_after_submission" :
759
- if($id){
760
- apply_form($id);
761
- }
762
- else
763
- {
764
- save_form();
765
- $id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
766
- }
767
- Actions_after_submission($id);
768
- break;
769
-
770
- case "Save_Actions_after_submission" :
771
- Apply_Actions_after_submission($id);
772
- edit_contact_form($id);
773
- break;
774
-
775
- case "Apply_Actions_after_submission" :
776
- Apply_Actions_after_submission($id);
777
- Actions_after_submission($id);
778
- break;
779
-
780
-
781
- // Edit_JavaScript
782
- case "Edit_JavaScript" :
783
- if($id){
784
- apply_form($id);
785
- }
786
- else
787
- {
788
- save_form();
789
- $id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
790
- }
791
- Edit_JavaScript($id);
792
- break;
793
-
794
- case "Save_Edit_JavaScript" :
795
- Apply_Edit_JavaScript($id);
796
- edit_contact_form($id);
797
- break;
798
-
799
- case "Apply_Edit_JavaScript" :
800
- Apply_Edit_JavaScript($id);
801
- Edit_JavaScript($id);
802
- break;
803
-
804
-
805
-
806
-
807
-
808
-
809
-
810
- // Custom_text_in_email_for_administrator
811
- case "Custom_text_in_email_for_administrator" :
812
- if($id){
813
- apply_form($id);
814
- }
815
- else
816
- {
817
- save_form();
818
- $id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
819
- }
820
- Custom_text_in_email_for_administrator($id);
821
- break;
822
-
823
- case "Save_Custom_text_in_email_for_administrator" :
824
- Apply_Custom_text_in_email_for_administrator($id);
825
- edit_contact_form($id);
826
- break;
827
-
828
- case "Apply_Custom_text_in_email_for_administrator" :
829
- Apply_Custom_text_in_email_for_administrator($id);
830
- Custom_text_in_email_for_administrator($id);
831
- break;
832
-
833
-
834
-
835
-
836
-
837
-
838
-
839
-
840
-
841
-
842
-
843
- // Custom text in email for user
844
- case "Custom_text_in_email_for_user" :
845
- if($id){
846
- apply_form($id);
847
- }
848
- else
849
- {
850
- save_form();
851
- $id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
852
- }
853
- Custom_text_in_email_for_user($id);
854
- break;
855
-
856
- case "Save_Custom_text_in_email_for_user" :
857
- Apply_Custom_text_in_email_for_user($id);
858
- edit_contact_form($id);
859
- break;
860
-
861
- case "Apply_Custom_text_in_email_for_user" :
862
- Apply_Custom_text_in_email_for_user($id);
863
- Custom_text_in_email_for_user($id);
864
- break;
865
- case "save_as_copy":
866
- save_as_copy();
867
- display_form_lists();
868
- break;
869
- default:
870
- display_form_lists();
871
- }
872
-
873
-
874
-
875
-
876
-
877
- }
878
-
879
- ////////////////////////////////////////////
880
- //////////////////////////////////////////// Submi
881
- ////////////////////////////////////////////
882
-
883
- ////map in spubmits
884
-
885
-
886
- add_action('wp_ajax_contactfrommapeditinpopup', 'spider_contact_form_map_edit');
887
-
888
- function spider_contact_form_map_edit(){
889
- if(isset($_GET['long']) && isset($_GET['lat'])){
890
- $long = $_GET['long'];
891
- $lat = $_GET['lat'];
892
-
893
-
894
- ?>
895
- <script src="<?php echo plugins_url("js/if_gmap_back_end.js",__FILE__); ?>"></script>
896
- <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
897
-
898
- <table style="margin:0px; padding:0px">
899
- <tr><td><b>Address:</b></td><td><input type="text" id="addrval0" style="border:0px; background:none" size="80" readonly /> </td></tr>
900
- <tr><td><b>Longitude:</b></td> <td><input type="text" id="longval0" style="border:0px; background:none" size="80" readonly /> </td></tr>
901
- <tr><td><b>Latitude:</b></td><td><input type="text" id="latval0" style="border:0px; background:none" size="80" readonly /> </td></tr>
902
- </table>
903
-
904
- <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>
905
-
906
- <script>
907
- if_gmap_init("0");
908
- add_marker_on_map(0, 0, "<?php echo $long ?>", "<?php echo $lat ?>", '');
909
-
910
-
911
- </script>
912
-
913
- <?php
914
-
915
-
916
- die();
917
-
918
- }
919
- else{
920
- return 0;
921
- }
922
-
923
- }
924
-
925
-
926
- /////////////////////////////////////////////////////////////////////////////////////
927
- /////////////////////////////////////////////////////////////////////////////////// priview form
928
- ///////////////////////////////////////////////////////////////////////////////////
929
- ///////////////////////////////////////////////////////////////////////////////////
930
-
931
- add_action('wp_ajax_frommakerpreview', 'preview_contact_form');
932
-
933
-
934
-
935
- function html_preview_contact_form($css){
936
-
937
- /**
938
- * @package SpiderFC
939
- * @author Web-Dorado
940
- * @copyright (C) 2011 Web-Dorado. All rights reserved.
941
- * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
942
- **/
943
-
944
- $cmpnt_js_path =plugins_url('js',__FILE__);
945
- $id='form_id_temp';
946
- ?>
947
- <script src="<?php echo $cmpnt_js_path."/if_gmap_back_end.js"; ?>"></script>
948
- <script src="<?php echo $cmpnt_js_path."/main.js"; ?>"></script>
949
- <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
950
- <style>
951
- <?php
952
- $cmpnt_js_path =plugins_url('',__FILE__);
953
- echo str_replace('[SITE_ROOT]',$cmpnt_js_path, $css);
954
-
955
- ?>
956
- </style>
957
- <div id="form_id_temppages" class="wdform_page_navigation" show_title="" show_numbers="" type=""></div>
958
-
959
- <form id="form_preview"></form>
960
- <input type="hidden" id="counter<?php echo $id ?>" value="" name="counter<?php echo $id ?>" />
961
-
962
- <script>
963
- JURI_ROOT ='<?php echo $cmpnt_js_path ?>';
964
-
965
- document.getElementById('form_preview').innerHTML = window.parent.document.getElementById('take').innerHTML;
966
- document.getElementById('form_id_temppages').setAttribute('show_title', window.parent.document.getElementById('pages').getAttribute('show_title'));
967
- document.getElementById('form_id_temppages').setAttribute('show_numbers', window.parent.document.getElementById('pages').getAttribute('show_numbers'));
968
- document.getElementById('form_id_temppages').setAttribute('type', window.parent.document.getElementById('pages').getAttribute('type'));
969
- document.getElementById('counterform_id_temp').value=window.parent.gen;;
970
-
971
- form_view_count<?php echo $id ?>=0;
972
- for(i=1; i<=30; i++)
973
- {
974
- if(document.getElementById('<?php echo $id ?>form_view'+i))
975
- {
976
- form_view_count<?php echo $id ?>++;
977
- form_view_max<?php echo $id ?>=i;
978
- document.getElementById('<?php echo $id ?>form_view'+i).parentNode.removeAttribute('style');
979
- }
980
- }
981
-
982
- refresh_first();
983
-
984
-
985
- if(form_view_count<?php echo $id ?>>1)
986
- {
987
- for(i=1; i<=form_view_max<?php echo $id ?>; i++)
988
- {
989
- if(document.getElementById('<?php echo $id ?>form_view'+i))
990
- {
991
- first_form_view<?php echo $id ?>=i;
992
- break;
993
- }
994
- }
995
-
996
- generate_page_nav(first_form_view<?php echo $id ?>, '<?php echo $id ?>', form_view_count<?php echo $id ?>, form_view_max<?php echo $id ?>);
997
- }
998
-
999
-
1000
- function remove_add_(id)
1001
- {
1002
- attr_name= new Array();
1003
- attr_value= new Array();
1004
- var input = document.getElementById(id);
1005
- atr=input.attributes;
1006
- for(v=0;v<30;v++)
1007
- if(atr[v] )
1008
- {
1009
- if(atr[v].name.indexOf("add_")==0)
1010
- {
1011
- attr_name.push(atr[v].name.replace('add_',''));
1012
- attr_value.push(atr[v].value);
1013
- input.removeAttribute(atr[v].name);
1014
- v--;
1015
- }
1016
- }
1017
- for(v=0;v<attr_name.length; v++)
1018
- {
1019
- input.setAttribute(attr_name[v],attr_value[v])
1020
- }
1021
- }
1022
-
1023
- function refresh_first()
1024
- {
1025
-
1026
- n=window.parent.gen;
1027
- for(i=0; i<n; i++)
1028
- {
1029
- if(document.getElementById(i))
1030
- {
1031
- for(z=0; z<document.getElementById(i).childNodes.length; z++)
1032
- if(document.getElementById(i).childNodes[z].nodeType==3)
1033
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
1034
-
1035
- if(document.getElementById(i).getAttribute('type')=="type_map")
1036
- {
1037
- if_gmap_init(i);
1038
- for(q=0; q<20; q++)
1039
- if(document.getElementById(i+"_elementform_id_temp").getAttribute("long"+q))
1040
- {
1041
-
1042
- w_long=parseFloat(document.getElementById(i+"_elementform_id_temp").getAttribute("long"+q));
1043
- w_lat=parseFloat(document.getElementById(i+"_elementform_id_temp").getAttribute("lat"+q));
1044
- w_info=parseFloat(document.getElementById(i+"_elementform_id_temp").getAttribute("info"+q));
1045
- add_marker_on_map(i,q, w_long, w_lat, w_info, false);
1046
- }
1047
- }
1048
-
1049
- if(document.getElementById(i).getAttribute('type')=="type_mark_map")
1050
- {
1051
- if_gmap_init(i);
1052
- w_long=parseFloat(document.getElementById(i+"_elementform_id_temp").getAttribute("long"+0));
1053
- w_lat=parseFloat(document.getElementById(i+"_elementform_id_temp").getAttribute("lat"+0));
1054
- w_info=parseFloat(document.getElementById(i+"_elementform_id_temp").getAttribute("info"+0));
1055
- add_marker_on_map(i,0, w_long, w_lat, w_info, true);
1056
- }
1057
-
1058
-
1059
-
1060
- if(document.getElementById(i).getAttribute('type')=="type_captcha" || document.getElementById(i).getAttribute('type')=="type_recaptcha")
1061
- {
1062
- if(document.getElementById(i).childNodes[10])
1063
- {
1064
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1065
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1066
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1067
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1068
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1069
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1070
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1071
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1072
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1073
- }
1074
- else
1075
- {
1076
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1077
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1078
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1079
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1080
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1081
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1082
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1083
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1084
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1085
- }
1086
- continue;
1087
- }
1088
-
1089
- if(document.getElementById(i).getAttribute('type')=="type_section_break")
1090
- {
1091
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1092
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1093
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1094
- continue;
1095
- }
1096
-
1097
-
1098
- if(document.getElementById(i).childNodes[10])
1099
- {
1100
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1101
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1102
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1103
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1104
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1105
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1106
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1107
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1108
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1109
- }
1110
- else
1111
- {
1112
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1113
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1114
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1115
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1116
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1117
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1118
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1119
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1120
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1121
- }
1122
- }
1123
- }
1124
-
1125
- for(i=0; i<=n; i++)
1126
- {
1127
- if(document.getElementById(i))
1128
- {
1129
- type=document.getElementById(i).getAttribute("type");
1130
- switch(type)
1131
- {
1132
- case "type_text":
1133
- case "type_number":
1134
- case "type_password":
1135
- case "type_submitter_mail":
1136
- case "type_own_select":
1137
- case "type_country":
1138
- case "type_hidden":
1139
- case "type_map":
1140
- {
1141
- remove_add_(i+"_elementform_id_temp");
1142
- break;
1143
- }
1144
-
1145
- case "type_submit_reset":
1146
- {
1147
- remove_add_(i+"_element_submitform_id_temp");
1148
- if(document.getElementById(i+"_element_resetform_id_temp"))
1149
- remove_add_(i+"_element_resetform_id_temp");
1150
- break;
1151
- }
1152
-
1153
- case "type_captcha":
1154
- {
1155
- remove_add_("_wd_captchaform_id_temp");
1156
- remove_add_("_element_refreshform_id_temp");
1157
- remove_add_("_wd_captcha_inputform_id_temp");
1158
- break;
1159
- }
1160
-
1161
- case "type_recaptcha":
1162
- {
1163
- remove_add_("wd_recaptchaform_id_temp");
1164
- break;
1165
- }
1166
-
1167
- case "type_file_upload":
1168
- {
1169
- remove_add_(i+"_elementform_id_temp");
1170
- break;
1171
- }
1172
-
1173
- case "type_textarea":
1174
- {
1175
- remove_add_(i+"_elementform_id_temp");
1176
-
1177
- break;
1178
- }
1179
-
1180
- case "type_name":
1181
- {
1182
-
1183
- if(document.getElementById(i+"_element_titleform_id_temp"))
1184
- {
1185
- remove_add_(i+"_element_titleform_id_temp");
1186
- remove_add_(i+"_element_firstform_id_temp");
1187
- remove_add_(i+"_element_lastform_id_temp");
1188
- remove_add_(i+"_element_middleform_id_temp");
1189
- }
1190
- else
1191
- {
1192
- remove_add_(i+"_element_firstform_id_temp");
1193
- remove_add_(i+"_element_lastform_id_temp");
1194
-
1195
- }
1196
- break;
1197
-
1198
- }
1199
-
1200
- case "type_phone":
1201
- {
1202
-
1203
- remove_add_(i+"_element_firstform_id_temp");
1204
- remove_add_(i+"_element_lastform_id_temp");
1205
-
1206
- break;
1207
-
1208
- }
1209
- case "type_address":
1210
- {
1211
- remove_add_(i+"_street1form_id_temp");
1212
- remove_add_(i+"_street2form_id_temp");
1213
- remove_add_(i+"_cityform_id_temp");
1214
- remove_add_(i+"_stateform_id_temp");
1215
- remove_add_(i+"_postalform_id_temp");
1216
- remove_add_(i+"_countryform_id_temp");
1217
-
1218
- break;
1219
-
1220
- }
1221
-
1222
-
1223
- case "type_checkbox":
1224
- case "type_radio":
1225
- {
1226
- is=true;
1227
- for(j=0; j<100; j++)
1228
- if(document.getElementById(i+"_elementform_id_temp"+j))
1229
- {
1230
- remove_add_(i+"_elementform_id_temp"+j);
1231
- }
1232
- /* if(document.getElementById(i+"_randomize").value=="yes")
1233
- choises_randomize(i);*/
1234
-
1235
- break;
1236
- }
1237
-
1238
- case "type_button":
1239
- {
1240
- for(j=0; j<100; j++)
1241
- if(document.getElementById(i+"_elementform_id_temp"+j))
1242
- {
1243
- remove_add_(i+"_elementform_id_temp"+j);
1244
- }
1245
- break;
1246
- }
1247
-
1248
- case "type_time":
1249
- {
1250
- if(document.getElementById(i+"_ssform_id_temp"))
1251
- {
1252
- remove_add_(i+"_ssform_id_temp");
1253
- remove_add_(i+"_mmform_id_temp");
1254
- remove_add_(i+"_hhform_id_temp");
1255
- }
1256
- else
1257
- {
1258
- remove_add_(i+"_mmform_id_temp");
1259
- remove_add_(i+"_hhform_id_temp");
1260
- }
1261
- break;
1262
-
1263
- }
1264
-
1265
- case "type_date":
1266
- {
1267
- remove_add_(i+"_elementform_id_temp");
1268
- remove_add_(i+"_buttonform_id_temp");
1269
- break;
1270
- }
1271
- case "type_date_fields":
1272
- {
1273
- remove_add_(i+"_dayform_id_temp");
1274
- remove_add_(i+"_monthform_id_temp");
1275
- remove_add_(i+"_yearform_id_temp");
1276
- break;
1277
- }
1278
- }
1279
- }
1280
- }
1281
-
1282
-
1283
- for(t=1;t<=form_view_max<?php echo $id ?>;t++)
1284
- {
1285
- if(document.getElementById('form_id_tempform_view'+t))
1286
- {
1287
- form_view_element=document.getElementById('form_id_tempform_view'+t);
1288
- xy=form_view_element.childNodes.length-2;
1289
- for(z=0;z<=xy;z++)
1290
- {
1291
- if(form_view_element.childNodes[z])
1292
- if(form_view_element.childNodes[z].nodeType!=3)
1293
- if(!form_view_element.childNodes[z].id)
1294
- {
1295
- del=true;
1296
- GLOBAL_tr=form_view_element.childNodes[z];
1297
- //////////////////////////////////////////////////////////////////////////////////////////
1298
- for (x=0; x < GLOBAL_tr.firstChild.childNodes.length; x++)
1299
- {
1300
- table=GLOBAL_tr.firstChild.childNodes[x];
1301
- tbody=table.firstChild;
1302
- if(tbody.childNodes.length)
1303
- del=false;
1304
- }
1305
-
1306
- if(del)
1307
- {
1308
- form_view_element.removeChild(form_view_element.childNodes[z]);
1309
- }
1310
-
1311
- }
1312
- }
1313
- }
1314
- }
1315
-
1316
-
1317
- for(i=1; i<=window.parent.form_view_max; i++)
1318
- if(document.getElementById('form_id_tempform_view'+i))
1319
- {
1320
- document.getElementById('form_id_tempform_view'+i).parentNode.removeChild(document.getElementById('form_id_tempform_view_img'+i));
1321
- document.getElementById('form_id_tempform_view'+i).removeAttribute('style');
1322
- }
1323
-
1324
- }
1325
-
1326
-
1327
- </script>
1328
- <?php
1329
- die();
1330
- }
1331
- function preview_contact_form()
1332
- {
1333
- global $wpdb;
1334
- if(isset($_GET['id']))
1335
- $getparams=$_GET['id'];
1336
- $query = "SELECT css FROM ".$wpdb->prefix."formmaker_themes WHERE id=".$getparams;
1337
- $css = $wpdb->get_var($query);
1338
- html_preview_contact_form($css);
1339
- }
1340
-
1341
-
1342
-
1343
-
1344
-
1345
-
1346
-
1347
-
1348
-
1349
-
1350
-
1351
-
1352
-
1353
- //////////////////////////////////////////////////////////////////////////////////////
1354
- //////////////////////////////////////////////////////////////////////////////////
1355
- ///////////////////////////////////////////////////////////////////////////////
1356
- ///////////////////////////////////////////////////////////////////////////////
1357
- /////////////////////////////////////////////////////////////////////////////////
1358
-
1359
-
1360
-
1361
- function contact_form_Submits()
1362
- {
1363
- require_once("Submissions.html.php");
1364
- require_once("Submissions.php");
1365
- if(!function_exists('print_html_nav'))
1366
- require_once("nav_function/nav_html_func.php");
1367
-
1368
-
1369
- global $wpdb;
1370
- if(isset($_GET["task"]))
1371
- {
1372
- $task=$_GET["task"];
1373
- }
1374
- else
1375
- {
1376
- $task="show";
1377
- }
1378
- if(isset($_GET["id"]))
1379
- {
1380
- $id=$_GET["id"];
1381
- }
1382
- else
1383
- {
1384
- $id=0;
1385
- }
1386
- switch($task){
1387
- case "submits" :
1388
- show_submits();
1389
- break;
1390
- case "edit_submit" :
1391
- editSubmit($id);
1392
- break;
1393
- case "remove_submit" :
1394
- remov_submit($id);
1395
- show_submits();
1396
- break;
1397
- case "remov_cheched" :
1398
- remov_cheched_submission();
1399
- show_submits();
1400
- break;
1401
- case "appply_submit" :
1402
- save_submit($id);
1403
- editSubmit($id);
1404
- break;
1405
- case "save_submit" :
1406
- save_submit($id);
1407
- show_submits();
1408
- break;
1409
- case "cancel" :
1410
- show_submits();
1411
- break;
1412
-
1413
-
1414
- default:
1415
- show_submits();
1416
- }
1417
-
1418
-
1419
-
1420
-
1421
-
1422
-
1423
-
1424
- }
1425
- function contact_form_Themes(){
1426
-
1427
-
1428
-
1429
-
1430
- require_once("Theme_functions.php");
1431
- require_once("Themes_function.html.php");
1432
- if(!function_exists('print_html_nav'))
1433
- require_once("nav_function/nav_html_func.php");
1434
- global $wpdb;
1435
- if(isset($_GET["task"]))
1436
- {
1437
- $task=$_GET["task"];
1438
- }
1439
- else
1440
- {
1441
- $task="";
1442
- }
1443
- if(isset($_GET["id"]))
1444
- {
1445
- $id=$_GET["id"];
1446
- }
1447
- else
1448
- {
1449
- $id=0;
1450
- }
1451
- switch($task){
1452
- case 'theme':
1453
- show_theme();
1454
- break;
1455
- case 'default':
1456
- default_theme($id);
1457
- show_theme();
1458
- break;
1459
-
1460
- case 'add_theme':
1461
- add_theme();
1462
- break;
1463
-
1464
- case 'Save':
1465
- if($id)
1466
- {
1467
- apply_theme($id);
1468
- }
1469
- else
1470
- {
1471
- save_theme();
1472
- }
1473
-
1474
- show_theme();
1475
- break;
1476
-
1477
- case 'Apply':
1478
- if($id)
1479
- {
1480
- apply_theme($id);
1481
- }
1482
- else
1483
- {
1484
- save_theme();
1485
- $id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker_themes");
1486
- }
1487
-
1488
- edit_theme($id);
1489
- break;
1490
-
1491
- case 'edit_theme':
1492
- edit_theme($id);
1493
- break;
1494
-
1495
- case 'remove_theme':
1496
- remove_theme($id);
1497
- show_theme();
1498
- break;
1499
- default:
1500
- show_theme();
1501
- }
1502
-
1503
-
1504
-
1505
-
1506
- }
1507
-
1508
-
1509
-
1510
-
1511
- function Uninstall_contact_form()
1512
- {
1513
-
1514
- global $wpdb;
1515
-
1516
-
1517
-
1518
- include 'setup_sql.php';
1519
- set_contact_form_sql();
1520
- $base_name = plugin_basename('contact_form');
1521
- $base_page = 'admin.php?page='.$base_name;
1522
- if(isset($_GET['mode'])){
1523
- $mode = trim($_GET['mode']);
1524
- }
1525
- if(!empty($_POST['do'])) {
1526
-
1527
- if($_POST['do']=="UNINSTALL Form Maker") {
1528
- check_admin_referer('Form Maker_uninstall');
1529
- if(trim($_POST['uninstall_Form_yes']) == 'yes') {
1530
-
1531
- $true_or_false_forms=$wpdb->get_var("SELECT COUNT(*) FROM ".$wpdb->prefix."formmaker WHERE `id` NOT IN (".get_option('contact_form_forms').")");
1532
- $true_or_false_themes=$wpdb->get_var("SELECT COUNT(*) FROM ".$wpdb->prefix."formmaker WHERE `id` NOT IN (".get_option('contact_form_themes').")");
1533
- //////////////////////////////ddddddddddddddddddddddddddddddddddddd
1534
- if($true_or_false_forms || $true_or_false_themes){
1535
- echo '<div id="message" class="updated fade">';
1536
- echo '<p>';
1537
- echo "Table 'formmaker' has been deleted.";
1538
- $wpdb->query("DELETE FROM ".$wpdb->prefix."formmaker WHERE `id` IN (".get_option('contact_form_forms').")");
1539
- echo '<font style="color:#000;">';
1540
- echo '</font><br />';
1541
- echo '</p>';
1542
- echo '<p>';
1543
- echo "Table 'formmaker_submits' has been deleted.";
1544
- $wpdb->query("DELETE FROM ".$wpdb->prefix."formmaker_submits WHERE `form_id` IN (".get_option('contact_form_forms').")");
1545
- echo '<font style="color:#000;">';
1546
- echo '</font><br />';
1547
- echo '</p>';
1548
- echo '<p>';
1549
- echo "Table 'formmaker_views' has been deleted.";
1550
- $wpdb->query("DELETE FROM ".$wpdb->prefix."formmaker_views WHERE `form_id` IN (".get_option('contact_form_forms').")");
1551
- echo '<font style="color:#000;">';
1552
- echo '</font><br />';
1553
- echo '</p>';
1554
- echo '<p>';
1555
- echo "Table 'formmaker_themes' has been deleted.";
1556
- $wpdb->query("DELETE FROM ".$wpdb->prefix."formmaker_themes WHERE `id` IN (".get_option('contact_form_themes').")");
1557
- echo '<font style="color:#000;">';
1558
- echo '</font><br />';
1559
- echo '</p>';
1560
- echo '</div>';
1561
- }
1562
- else
1563
- {
1564
- echo '<div id="message" class="updated fade">';
1565
- echo '<p>';
1566
- echo "Table 'formmaker' has been deleted.";
1567
- $wpdb->query("DROP TABLE ".$wpdb->prefix."formmaker");
1568
- echo '<font style="color:#000;">';
1569
- echo '</font><br />';
1570
- echo '</p>';
1571
- echo '<p>';
1572
- echo "Table 'formmaker_submits' has been deleted.";
1573
- $wpdb->query("DROP TABLE ".$wpdb->prefix."formmaker_submits");
1574
- echo '<font style="color:#000;">';
1575
- echo '</font><br />';
1576
- echo '</p>';
1577
- echo '<p>';
1578
- echo "Table 'formmaker_views' has been deleted.";
1579
- $wpdb->query("DROP TABLE ".$wpdb->prefix."formmaker_views");
1580
- echo '<font style="color:#000;">';
1581
- echo '</font><br />';
1582
- echo '</p>';
1583
- echo '<p>';
1584
- echo "Table 'formmaker_themes' has been deleted.";
1585
- $wpdb->query("DROP TABLE ".$wpdb->prefix."formmaker_themes");
1586
- echo '<font style="color:#000;">';
1587
- echo '</font><br />';
1588
- echo '</p>';
1589
- echo '</div>';
1590
- }
1591
- delete_option('contact_form_forms');
1592
- delete_option('contact_form_themes');
1593
- $mode = 'end-UNINSTALL';
1594
-
1595
- }
1596
- }
1597
- }
1598
-
1599
-
1600
- if(!isset($mode))
1601
- $mode='';
1602
- switch($mode) {
1603
-
1604
- case 'end-UNINSTALL':
1605
- $deactivate_url = wp_nonce_url('plugins.php?action=deactivate&amp;plugin='.plugin_basename(__FILE__), 'deactivate-plugin_'.plugin_basename(__FILE__)).'&contact_form_uninstall=1';
1606
- echo '<div class="wrap">';
1607
- echo '<div id="icon-contact_form" class="icon32"><br /></div>';
1608
- echo '<h2>Uninstall Form Maker</h2>';
1609
- 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>';
1610
- echo '</div>';
1611
- break;
1612
- // Main Page
1613
- default:
1614
- ?>
1615
- <form method="post" action="<?php echo admin_url('admin.php?page=Uninstall_contact_form'); ?>">
1616
- <?php wp_nonce_field('Form Maker_uninstall'); ?>
1617
- <div class="wrap">
1618
- <div id="icon-contact_form" class="icon32"><br /></div>
1619
- <h2><?php echo 'Uninstall Form Maker'; ?></h2>
1620
- <p>
1621
- <?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.'; ?>
1622
- </p>
1623
- <p style="color: red">
1624
- <strong><?php echo'WARNING:'; ?></strong><br />
1625
- <?php echo 'Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first.'; ?>
1626
- </p>
1627
- <p style="color: red">
1628
- <strong><?php echo 'The following WordPress Options/Tables will be DELETED:'; ?></strong><br />
1629
- </p>
1630
- <table class="widefat">
1631
- <thead>
1632
- <tr>
1633
- <th><?php echo 'WordPress Tables'; ?></th>
1634
- </tr>
1635
- </thead>
1636
- <tr>
1637
- <td valign="top">
1638
- <ol>
1639
- <?php
1640
- echo '<li>formmaker</li>'."\n";
1641
- echo '<li>formmaker_submits</li>'."\n";
1642
- echo '<li>formmaker_views</li>'."\n";
1643
- echo '<li>formmaker_themes</li>'."\n";
1644
-
1645
- ?>
1646
- </ol>
1647
- </td>
1648
- </tr>
1649
- </table>
1650
- <p style="text-align: center;">
1651
- <?php echo 'Do you really want to uninstall Form Maker?'; ?><br /><br />
1652
- <input type="checkbox" name="uninstall_Form_yes" value="yes" />&nbsp;<?php echo 'Yes'; ?><br /><br />
1653
- <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.'; ?>')" />
1654
- </p>
1655
- </div>
1656
-
1657
- </form>
1658
- <?php
1659
- }
1660
- }
1661
- function compare_version_fm($cur_ver,$ver_of_com){
1662
- $cur_ver=explode('.',$cur_ver);
1663
- $ver_of_com=explode('.',$ver_of_com);
1664
- for($jj=0;$jj<10;$jj++){
1665
- if(isset($cur_ver[$jj]) && isset($ver_of_com[$jj]))
1666
- {
1667
- if((int)$cur_ver[$jj]<(int)$ver_of_com[$jj]){
1668
-
1669
- return true;
1670
- }
1671
- else
1672
- {
1673
- if((int)$cur_ver[$jj]>(int)$ver_of_com[$jj])
1674
- return 0;
1675
- }
1676
- }
1677
- }
1678
- return 0;
1679
- }
1680
-
1681
- //echo admin_url().wp_nonce_url('update.php?action=upgrade-plugin&amp;plugin=player/Player.php', 'upgrade-plugin_player/Player.php');
1682
-
1683
- function contact_form_activate()
1684
- {
1685
- $al_plug=get_plugins();
1686
- foreach($al_plug as $key=>$plug)
1687
- {
1688
- if($key=='form-maker/Form_Maker.php')
1689
- if(compare_version_fm($plug['Version'],'1.4.0')){
1690
- if(get_option('contact_form_do_activation_redirect',false))
1691
- add_option('contact_form_do_activation_redirect', true);
1692
- else
1693
- update_option('contact_form_do_activation_redirect', true);
1694
-
1695
- }
1696
- }
1697
-
1698
- include 'setup_sql.php';
1699
- set_contact_form_sql();
1700
-
1701
- }
1702
-
1703
- function contact_form_redirect() {
1704
- if (get_option('contact_form_do_activation_redirect')== true) {
1705
- update_option('contact_form_do_activation_redirect', false);
1706
- wp_redirect(str_replace ('&amp;','&',admin_url().wp_nonce_url('update.php?action=upgrade-plugin&plugin=form-maker%2FForm_Maker.php', 'upgrade-plugin_form-maker/Form_Maker.php')));
1707
- exit;
1708
- }
1709
- }
1710
- add_action('admin_init', 'contact_form_redirect',0);
1711
-
1712
- register_activation_hook( __FILE__, 'contact_form_activate' );
1713
-
1714
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Contact Form FREE
4
+ Plugin URI: http://web-dorado.com/products/form-maker-wordpress.html
5
+ Version: 1.5.1
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
+
16
+ $first_css = ".wdform_table1
17
+ {
18
+ font-size:14px;
19
+ font-weight:normal;
20
+ color:#000000;
21
+ width:100% ;
22
+ }
23
+
24
+ .wdform_tbody1
25
+ {
26
+ float:left;
27
+ }
28
+ .wdform_table2
29
+ {
30
+ padding-right:50px !important;
31
+ float:left;
32
+ border-spacing: 0px;
33
+ border-collapse:separate !important;
34
+ }
35
+ #edit_main_table label
36
+ {
37
+ line-height: 19px;
38
+ }
39
+ #edit_main_table td
40
+ {
41
+ padding-right: 5px;
42
+ }
43
+ .time_box
44
+ {
45
+ border-width:1px;
46
+ margin: 0px;
47
+ padding: 0px;
48
+ text-align:right;
49
+ width:30px;
50
+ vertical-align:middle
51
+ }
52
+
53
+ .mini_label
54
+ {
55
+ font-size:10px;
56
+ font-family: 'Lucida Grande', Tahoma, Arial, Verdana, sans-serif;
57
+ }
58
+
59
+ .ch_rad_label
60
+ {
61
+ display:inline;
62
+ margin-left:5px;
63
+ margin-right:15px;
64
+ float:none;
65
+ }
66
+
67
+ .label
68
+ {
69
+ border:none;
70
+ }
71
+
72
+
73
+ .td_am_pm_select
74
+ {
75
+ padding-left:5;
76
+ }
77
+
78
+ .am_pm_select
79
+ {
80
+ height: 16px;
81
+ margin:0;
82
+ padding:0
83
+ }
84
+
85
+ .input_deactive
86
+ {
87
+ color:#999999;
88
+ font-style:italic;
89
+ border-width:1px;
90
+ margin: 0px;
91
+ padding: 0px
92
+ }
93
+
94
+ .input_active
95
+ {
96
+ color:#000000;
97
+ font-style:normal;
98
+ border-width:1px;
99
+ margin: 0px;
100
+ padding: 0px
101
+ }
102
+
103
+ .required
104
+ {
105
+ border:none;
106
+ color:red
107
+ }
108
+
109
+ .captcha_img
110
+ {
111
+ border-width:0px;
112
+ margin: 0px;
113
+ padding: 0px;
114
+ cursor:pointer;
115
+
116
+
117
+ }
118
+
119
+ .captcha_refresh
120
+ {
121
+ width:30px;
122
+ height:30px;
123
+ border-width:0px;
124
+ margin: 0px;
125
+ padding: 0px;
126
+ vertical-align:middle;
127
+ cursor:pointer;
128
+ background-image: url(".plugins_url('images/refresh_black.png',__FILE__).");
129
+ }
130
+
131
+ .captcha_input
132
+ {
133
+ height:20px;
134
+ border-width:1px;
135
+ margin: 0px;
136
+ padding: 0px;
137
+ vertical-align:middle;
138
+ }
139
+
140
+ .file_upload
141
+ {
142
+ border-width:1px;
143
+ margin: 0px;
144
+ padding: 0px
145
+ }
146
+
147
+ .page_deactive
148
+ {
149
+ border:1px solid black;
150
+ padding:4px 7px 4px 7px;
151
+ margin:4px;
152
+ cursor:pointer;
153
+ background-color:#DBDBDB;
154
+ }
155
+
156
+ .page_active
157
+ {
158
+ border:1px solid black;
159
+ padding:4px 7px 4px 7px;
160
+ margin:4px;
161
+ cursor:pointer;
162
+ background-color:#878787;
163
+ }
164
+
165
+ .page_percentage_active
166
+ {
167
+ padding:0px;
168
+ margin:0px;
169
+ border-spacing: 0px;
170
+ height:30px;
171
+ line-height:30px;
172
+ background-color:yellow;
173
+ border-radius:30px;
174
+ font-size:15px;
175
+ float:left;
176
+ text-align: right !important;
177
+ }
178
+
179
+
180
+ .page_percentage_deactive
181
+ {
182
+ height:30px;
183
+ line-height:30px;
184
+ padding:5px;
185
+ border:1px solid black;
186
+ width:100%;
187
+ background-color:white;
188
+ border-radius:30px;
189
+ text-align: left !important;
190
+ }
191
+
192
+ .page_numbers
193
+ {
194
+ font-size:11px;
195
+ }
196
+
197
+ .phone_area_code
198
+ {
199
+ width:50px;
200
+ }
201
+
202
+ .phone_number
203
+ {
204
+ width:100px;
205
+ }";
206
+
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+ //////////////////////////////////////////////////////////////////
228
+
229
+
230
+
231
+
232
+
233
+
234
+ require_once("front_end_contact_form.php");
235
+ require_once("contact_form_maker_widget.php");
236
+ require_once('recaptchalib.php');
237
+
238
+ add_action( 'init', 'contact_form_language_load' );
239
+
240
+ function contact_form_language_load() {
241
+ load_plugin_textdomain('form_maker', false, basename( dirname( __FILE__ ) ) . '/languages' );
242
+ }
243
+ add_action('init', 'spider_contact_form_output_buffer');
244
+ function spider_contact_form_output_buffer() {
245
+ ob_start();
246
+ }
247
+
248
+
249
+
250
+
251
+
252
+
253
+ add_filter('the_content','Contact_Form_maker_fornt_end_main',5000);
254
+
255
+
256
+ function Contact_Form_maker_fornt_end_main($content){
257
+
258
+ if(!get_option('form_maker_pro_active',false)){
259
+
260
+
261
+ $pattern ='[\[contact_form id="([0-9]*)"\]]';
262
+
263
+
264
+ $count_forms_in_post=preg_match_all ( $pattern, $content, $matches_form);
265
+ for($jj=0;$jj<$count_forms_in_post;$jj++)
266
+ {
267
+ $padron=$matches_form[0][$jj];
268
+
269
+ $replacment=contact_form_front_end($matches_form[1][$jj]);
270
+ $content=str_replace($padron,$replacment,$content);
271
+ }
272
+ }
273
+ return $content;
274
+ }
275
+
276
+
277
+
278
+
279
+
280
+ function contact_form_scripts_method() {
281
+
282
+ if(!get_option('form_maker_pro_active',false)){
283
+ wp_enqueue_style("gmap_styles_",plugins_url("css/style_for_map.css",__FILE__),false);
284
+ // wp_enqueue_script("mootools",plugins_url("js/mootools.js",__FILE__));
285
+ wp_enqueue_script("main_g_js",plugins_url("js/main_front_end.js",__FILE__),false);
286
+ wp_enqueue_script("Gmap","http://maps.google.com/maps/api/js?sensor=false",false);
287
+ wp_enqueue_script("if_gmap",plugins_url("js/if_gmap_front_end.js",__FILE__),false);
288
+ wp_enqueue_script("Calendar",plugins_url("js/calendar.js",__FILE__),false);
289
+ wp_enqueue_script("calendar-setup",plugins_url("js/calendar-setup.js",__FILE__),false);
290
+ wp_enqueue_script("calendar_function",plugins_url("js/calendar_function.js",__FILE__),false);
291
+
292
+ wp_enqueue_style("Css",plugins_url("js/calendar-jos.css",__FILE__),false);
293
+ }
294
+
295
+ }
296
+
297
+ add_action('wp_enqueue_scripts', 'contact_form_scripts_method');
298
+
299
+
300
+
301
+ ///////////////////////////// FORNT END Print message
302
+
303
+ for($ii=0;$ii<100;$ii++){
304
+ remove_filter('the_content','do_shortcode',$ii);
305
+ remove_filter('the_content','wpautop',$ii);
306
+ }
307
+ add_filter('the_content','wpautop',10);
308
+ add_filter('the_content','do_shortcode',11);
309
+
310
+ function print_massage_contact_form($content)
311
+ {
312
+
313
+ if(!get_option('form_maker_pro_active',false)){
314
+ $mh_after_head = did_action( 'wp_enqueue_scripts' );
315
+ if($mh_after_head==1){
316
+ global $wpdb;
317
+
318
+
319
+ @session_start();
320
+ if(isset($_SESSION['form_submit_type']) && $_SESSION['form_submit_type']){
321
+ $type_and_id=$_SESSION['form_submit_type'];
322
+ $type_and_id=explode(',',$type_and_id);
323
+ $form_get_type=$type_and_id[0];
324
+ $form_get_id=$type_and_id[1];
325
+ $_SESSION['form_submit_type']=0;
326
+ if($form_get_type==3){
327
+ $_SESSION['massage_after_submit']="";
328
+ $row=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$form_get_id."'");
329
+ return $row->submit_text;
330
+ }
331
+ }
332
+ if( isset($_SESSION['massage_after_submit']))
333
+ {
334
+ if($_SESSION['massage_after_submit']!="")
335
+ {
336
+
337
+ $message=$_SESSION['massage_after_submit'];
338
+ $_SESSION['massage_after_submit']="";
339
+
340
+ $returned_content=" <style>
341
+ .updated,.error{
342
+ border-width:1px !important;
343
+ border-style:solid !important;
344
+ padding:0 .6em !important;
345
+ margin:5px 15px 2px !important;
346
+ -moz-border-radius:3px !important;
347
+ -khtml-border-radius:3px !important;
348
+ -webkit-border-radius:3px !important;
349
+ border-radius:3px !important;
350
+ }
351
+ .updated p, .error p
352
+ {
353
+ font-size: 12px !important;
354
+ margin:.5em 0 !important;
355
+ line-height:1 !important;
356
+ padding:2px !important;
357
+ }
358
+ .updated, .error
359
+ {
360
+ margin:5px 0 15px !important;
361
+ }
362
+ .updated{
363
+ background-color:#ffffe0 !important;
364
+ border-color:#e6db55 !important;
365
+ }
366
+ .error
367
+ {
368
+ background-color:#ffebe8 !important;
369
+ border-color:#c00 !important;
370
+ }
371
+ error a
372
+ {
373
+ color:#c00 !important;
374
+ }
375
+ .error
376
+ {
377
+ line-height:22px !important;
378
+ margin:0 15px !important;
379
+ padding:3px 5px !important;
380
+ }
381
+ .error-div
382
+ {
383
+ display:block !important;
384
+ line-height:36px !important;
385
+ float:right !important;
386
+ margin-right:20px !important;
387
+ }
388
+ </style>";
389
+
390
+
391
+ if($_SESSION['error_or_no'])
392
+ {
393
+ $error='error';
394
+ }
395
+ else
396
+ {
397
+ $error='updated';
398
+ }
399
+
400
+ $returned_content.="<div class=\"".$error."\" ><p><strong>".$message."</strong></p></div>".$content;// modified content
401
+ return $returned_content;
402
+ }
403
+ else
404
+ {
405
+ return $content;
406
+ }
407
+ }
408
+ else
409
+ {
410
+ return $content;
411
+ }
412
+ }
413
+ else
414
+ {
415
+ return $content;
416
+ }
417
+ }
418
+
419
+ else
420
+ return $content;
421
+ }
422
+
423
+
424
+ add_filter('the_content', 'print_massage_contact_form');
425
+
426
+
427
+ ///////////////////////////// FORNT END FUNCTION
428
+ //// add front end
429
+
430
+
431
+
432
+ //// add editor new mce button
433
+ add_filter('mce_external_plugins', "contact_form_register");
434
+ add_filter('mce_buttons', 'contact_form_add_button', 0);
435
+
436
+
437
+ /// function for add new button
438
+ function contact_form_add_button($buttons)
439
+ {
440
+
441
+ if(!get_option('form_maker_pro_active',false)){
442
+
443
+ array_push($buttons, "contact_form_mce");
444
+
445
+ }
446
+ return $buttons;
447
+ }
448
+ /// function for registr new button
449
+ function contact_form_register($plugin_array)
450
+ {
451
+
452
+ if(!get_option('form_maker_pro_active',false)){
453
+
454
+ $url = plugins_url( 'js/editor_plugin.js' , __FILE__ );
455
+ $plugin_array["contact_form_mce"] = $url;
456
+
457
+ }
458
+ return $plugin_array;
459
+ }
460
+
461
+
462
+
463
+
464
+
465
+
466
+
467
+
468
+
469
+
470
+
471
+
472
+
473
+
474
+
475
+
476
+
477
+
478
+
479
+
480
+
481
+
482
+
483
+
484
+
485
+ ///////////////////////////////////////// add ajax for form maker functionaliti
486
+
487
+
488
+ require_once("contact_form_ajax_functions.php"); //////////// include form ajax functions for next 2 ajax hooks
489
+
490
+ add_action('wp_ajax_formcontactwdcaptcha', 'form_contact_wd_captcha'); /// generete captcha image and save it code in session
491
+ add_action('wp_ajax_formcontactwindow', 'form_contact_window_php'); /// openid window in post or page for editor
492
+
493
+ add_action('wp_ajax_nopriv_formcontactwdcaptcha', 'form_contact_wd_captcha'); /// generete captcha image and save it code in session
494
+ add_action('wp_ajax_nopriv_formcontactwindow', 'form_contact_window_php'); /// openid window in post or page for editor
495
+
496
+
497
+
498
+
499
+ ////////////////////////////////////////////////////////////////////////////
500
+
501
+
502
+
503
+
504
+
505
+
506
+
507
+
508
+
509
+
510
+
511
+
512
+
513
+
514
+
515
+
516
+
517
+
518
+
519
+
520
+
521
+
522
+
523
+ function add_button_style_contact_form()
524
+ {
525
+ echo '<style type="text/css">
526
+ .wp_themeSkin span.mce_contact_form_mce {background:url('.plugins_url( 'images/formmakerLogo.png' , __FILE__ ).') no-repeat !important;}
527
+ .wp_themeSkin .mceButtonEnabled:hover span.mce_contact_form_mce,.wp_themeSkin .mceButtonActive span.mce_contact_form_mce
528
+ {background:url('.plugins_url( 'images/formmakerLogoHover.png' , __FILE__ ).') no-repeat !important;}
529
+ </style>';
530
+ }
531
+
532
+ add_action('admin_head', 'add_button_style_contact_form');
533
+
534
+
535
+
536
+
537
+
538
+
539
+
540
+ add_action('admin_menu', 'contact_form_options_panel');
541
+ function contact_form_options_panel(){
542
+
543
+ if(!get_option('form_maker_pro_active',false)){
544
+ $icon_url=plugins_url( 'images/FormMakerLogo-16.png' , __FILE__ );
545
+ add_menu_page('Theme page title', 'Contact Form', 'manage_options', 'contact_form', 'Manage_contact_form', $icon_url);
546
+ $page_form= add_submenu_page( 'contact_form', 'Contact Form Manager', 'Manager', 'manage_options', 'contact_form', 'Manage_contact_form');
547
+ $page_submits=add_submenu_page( 'contact_form', 'Contact Form Submissions', 'Submissions', 'manage_options', 'contact_form_Submits', 'contact_form_Submits');
548
+ add_submenu_page( 'contact_form', 'Licensing', 'Licensing', 'manage_options', 'contact_form_Licensing', 'contact_form_Licensing');
549
+ add_submenu_page( 'contact_form', 'Contact Form Themes', 'Themes', 'manage_options', 'contact_form_Themes', 'contact_form_Themes');
550
+ add_submenu_page( 'contact_form', 'Uninstall Contact Form ', 'Uninstall Contact Form', 'manage_options', 'Uninstall_contact_form', 'Uninstall_contact_form');
551
+
552
+
553
+
554
+ add_action('admin_print_styles-' . $page_form, 'contact_form_admin_styles_scripts');
555
+ add_action('admin_print_styles-' . $page_submits, 'contact_form_submits_styles_scripts');
556
+ }
557
+ }
558
+
559
+
560
+
561
+ function contact_form_Licensing(){
562
+
563
+
564
+ ?>
565
+ <div style="width:95%">
566
+ <p>
567
+ This plugin is the non-commercial version of the Contact Form. Use of this plugin is free. You can add unlimited number of the fields. The limitation is on the some types of the fields (Time and Date, Select, Check box, Radio and File Upload). If you want to use those fields, you are required to purchase a license. </p>
568
+ <br /><br />
569
+ <a href="http://web-dorado.com/files/fromContactForm.php" class="button-primary" target="_blank">Purchase a License</a>
570
+ <br /><br /><br />
571
+ <p>After the purchasing the commercial version follow this steps:</p>
572
+ <ol>
573
+ <li>Deactivate Contact Form Plugin</li>
574
+ <li>Delete Contact Form Plugin</li>
575
+ <li>Install the downloaded commercial version of the plugin</li>
576
+ </ol>
577
+ </div>
578
+ <?php
579
+
580
+
581
+
582
+
583
+ }
584
+ function contact_form_submits_styles_scripts()
585
+ {
586
+
587
+
588
+ wp_enqueue_script('word-count');
589
+ wp_enqueue_script('post');
590
+ wp_enqueue_script('editor');
591
+ wp_enqueue_script('media-upload');
592
+ wp_admin_css('thickbox');
593
+ wp_print_scripts('media-upload');
594
+ do_action('admin_print_styles');
595
+ wp_enqueue_script( 'common' );
596
+ wp_enqueue_script( 'jquery-color' );
597
+ wp_print_scripts('editor');
598
+ if (function_exists('add_thickbox')) add_thickbox();
599
+ if(get_bloginfo('version')<'3.3')
600
+ if (function_exists('wp_tiny_mce')) wp_tiny_mce();
601
+ wp_enqueue_script('utils');
602
+ wp_enqueue_script("mootools",plugins_url("js/mootools.js",__FILE__));
603
+ wp_enqueue_script("f_calendar",plugins_url("js/calendar.js",__FILE__));
604
+ wp_enqueue_script("f_calendar_functions",plugins_url("js/calendar_function.js",__FILE__));
605
+ wp_enqueue_script("f_calendar_setup",plugins_url("js/calendar-setup.js",__FILE__));
606
+ wp_enqueue_style("calendar-jos",plugins_url("js/calendar-jos.css",__FILE__));
607
+ }
608
+
609
+
610
+
611
+
612
+
613
+
614
+ function contact_form_admin_styles_scripts()
615
+ {
616
+ if(isset($_GET['task']))
617
+ {
618
+ if(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")
619
+ {
620
+ wp_enqueue_script('word-count');
621
+ wp_enqueue_script('post');
622
+ wp_enqueue_script('editor');
623
+ wp_enqueue_script('media-upload');
624
+ wp_admin_css('thickbox');
625
+ wp_print_scripts('media-upload');
626
+ if(get_bloginfo('version')<'3.3')
627
+ wp_print_scripts('editor-functions');
628
+ do_action('admin_print_styles');
629
+ wp_enqueue_script( 'common' );
630
+ wp_enqueue_script( 'jquery-color' );
631
+ if(get_bloginfo('version')<'3.3')
632
+ wp_print_scripts('editor');
633
+ if (function_exists('add_thickbox')) add_thickbox();
634
+ if(get_bloginfo('version')<'3.3')
635
+ if (function_exists('wp_tiny_mce')) wp_tiny_mce();
636
+ wp_enqueue_script('utils');
637
+ if(get_bloginfo('version')>3.3){
638
+ wp_enqueue_script("jquery");
639
+
640
+ }
641
+ else
642
+ {
643
+ wp_deregister_script( 'jquery' );
644
+ wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js');
645
+ wp_enqueue_script( 'jquery' );
646
+
647
+
648
+ }
649
+ wp_enqueue_script("gmap_form",plugins_url("js/if_gmap_back_end.js",__FILE__));
650
+ wp_enqueue_script("form_main_js_free",plugins_url("js/formmaker_free.js",__FILE__));
651
+ wp_enqueue_script("gmap_form_api",'http://maps.google.com/maps/api/js?sensor=false');
652
+ wp_enqueue_style("styles_form",plugins_url("css/style.css",__FILE__));
653
+ wp_enqueue_script("mootools",plugins_url("js/mootools.js",__FILE__));
654
+ wp_enqueue_script("f_calendar",plugins_url("js/calendar.js",__FILE__));
655
+ wp_enqueue_script("f_calendar_functions",plugins_url("js/calendar_function.js",__FILE__));
656
+ wp_enqueue_script("f_calendar_setup",plugins_url("js/calendar-setup.js",__FILE__));
657
+
658
+ // wp_enqueue_script("main",plugins_url("js/main.js",__FILE__));
659
+ wp_enqueue_style("calendar-jos",plugins_url("js/calendar-jos.css",__FILE__));
660
+
661
+
662
+
663
+
664
+ }
665
+ }
666
+
667
+
668
+
669
+ }
670
+
671
+
672
+
673
+
674
+
675
+
676
+
677
+
678
+
679
+
680
+
681
+
682
+
683
+
684
+
685
+
686
+ function Manage_contact_form()
687
+ {
688
+
689
+ require_once("contact_form_functions.php");
690
+ require_once("contact_form_functions.html.php");
691
+ if(!function_exists('print_html_nav'))
692
+ require_once("nav_function/nav_html_func.php");
693
+
694
+
695
+ global $wpdb;
696
+ if(isset($_GET["task"]))
697
+ {
698
+ $task=esc_html($_GET["task"]);
699
+ }
700
+ else
701
+ {
702
+ $task="show";
703
+ }
704
+ if(isset($_GET["id"]))
705
+ {
706
+ $id = (int) $_GET["id"];
707
+ }
708
+ else
709
+ {
710
+ $id=0;
711
+ }
712
+
713
+
714
+ switch($task){
715
+
716
+ case "add_form" :
717
+ add_form();
718
+ break;
719
+
720
+ case "edit_form" :
721
+ edit_contact_form($id);
722
+ break;
723
+
724
+ case "Save" :
725
+ if($id)
726
+ apply_form($id);
727
+ else
728
+ save_form();
729
+ display_form_lists();
730
+ break;
731
+
732
+ case "Apply" :
733
+ if($id){
734
+ apply_form($id);
735
+ }
736
+ else
737
+ {
738
+ save_form();
739
+ $id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
740
+ }
741
+ forchrome($id);
742
+ break;
743
+
744
+ case "gotoedit" :
745
+ gotoedit();
746
+ edit_contact_form($id);
747
+ break;
748
+
749
+ case "remove_form" :
750
+ remove_form($id);
751
+ display_form_lists();
752
+ break;
753
+
754
+
755
+
756
+
757
+ // Actions_after_submission
758
+ case "Actions_after_submission" :
759
+ if($id){
760
+ apply_form($id);
761
+ }
762
+ else
763
+ {
764
+ save_form();
765
+ $id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
766
+ }
767
+ Actions_after_submission($id);
768
+ break;
769
+
770
+ case "Save_Actions_after_submission" :
771
+ Apply_Actions_after_submission($id);
772
+ edit_contact_form($id);
773
+ break;
774
+
775
+ case "Apply_Actions_after_submission" :
776
+ Apply_Actions_after_submission($id);
777
+ Actions_after_submission($id);
778
+ break;
779
+
780
+
781
+ // Edit_JavaScript
782
+ case "Edit_JavaScript" :
783
+ if($id){
784
+ apply_form($id);
785
+ }
786
+ else
787
+ {
788
+ save_form();
789
+ $id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
790
+ }
791
+ Edit_JavaScript($id);
792
+ break;
793
+
794
+ case "Save_Edit_JavaScript" :
795
+ Apply_Edit_JavaScript($id);
796
+ edit_contact_form($id);
797
+ break;
798
+
799
+ case "Apply_Edit_JavaScript" :
800
+ Apply_Edit_JavaScript($id);
801
+ Edit_JavaScript($id);
802
+ break;
803
+
804
+
805
+
806
+
807
+
808
+
809
+
810
+ // Custom_text_in_email_for_administrator
811
+ case "Custom_text_in_email_for_administrator" :
812
+ if($id){
813
+ apply_form($id);
814
+ }
815
+ else
816
+ {
817
+ save_form();
818
+ $id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
819
+ }
820
+ Custom_text_in_email_for_administrator($id);
821
+ break;
822
+
823
+ case "Save_Custom_text_in_email_for_administrator" :
824
+ Apply_Custom_text_in_email_for_administrator($id);
825
+ edit_contact_form($id);
826
+ break;
827
+
828
+ case "Apply_Custom_text_in_email_for_administrator" :
829
+ Apply_Custom_text_in_email_for_administrator($id);
830
+ Custom_text_in_email_for_administrator($id);
831
+ break;
832
+
833
+
834
+
835
+
836
+
837
+
838
+
839
+
840
+
841
+
842
+
843
+ // Custom text in email for user
844
+ case "Custom_text_in_email_for_user" :
845
+ if($id){
846
+ apply_form($id);
847
+ }
848
+ else
849
+ {
850
+ save_form();
851
+ $id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
852
+ }
853
+ Custom_text_in_email_for_user($id);
854
+ break;
855
+
856
+ case "Save_Custom_text_in_email_for_user" :
857
+ Apply_Custom_text_in_email_for_user($id);
858
+ edit_contact_form($id);
859
+ break;
860
+
861
+ case "Apply_Custom_text_in_email_for_user" :
862
+ Apply_Custom_text_in_email_for_user($id);
863
+ Custom_text_in_email_for_user($id);
864
+ break;
865
+ case "save_as_copy":
866
+ save_as_copy();
867
+ display_form_lists();
868
+ break;
869
+ default:
870
+ display_form_lists();
871
+ }
872
+
873
+
874
+
875
+
876
+
877
+ }
878
+
879
+ ////////////////////////////////////////////
880
+ //////////////////////////////////////////// Submi
881
+ ////////////////////////////////////////////
882
+
883
+ ////map in spubmits
884
+
885
+
886
+ add_action('wp_ajax_contactfrommapeditinpopup', 'spider_contact_form_map_edit');
887
+
888
+ function spider_contact_form_map_edit(){
889
+ if (function_exists('current_user_can')) {
890
+ if (!current_user_can('manage_options')) {
891
+ die('Access Denied');
892
+ }
893
+ }
894
+ else {
895
+ die('Access Denied');
896
+ }
897
+ if(isset($_GET['long']) && isset($_GET['lat'])){
898
+ $long = esc_html($_GET['long']);
899
+ $lat = esc_html($_GET['lat']);
900
+
901
+
902
+ ?>
903
+ <script src="<?php echo plugins_url("js/if_gmap_back_end.js",__FILE__); ?>"></script>
904
+ <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
905
+
906
+ <table style="margin:0px; padding:0px">
907
+ <tr><td><b>Address:</b></td><td><input type="text" id="addrval0" style="border:0px; background:none" size="80" readonly /> </td></tr>
908
+ <tr><td><b>Longitude:</b></td> <td><input type="text" id="longval0" style="border:0px; background:none" size="80" readonly /> </td></tr>
909
+ <tr><td><b>Latitude:</b></td><td><input type="text" id="latval0" style="border:0px; background:none" size="80" readonly /> </td></tr>
910
+ </table>
911
+
912
+ <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>
913
+
914
+ <script>
915
+ if_gmap_init("0");
916
+ add_marker_on_map(0, 0, "<?php echo $long ?>", "<?php echo $lat ?>", '');
917
+
918
+
919
+ </script>
920
+
921
+ <?php
922
+
923
+
924
+ die();
925
+
926
+ }
927
+ else{
928
+ return 0;
929
+ }
930
+
931
+ }
932
+
933
+
934
+ /////////////////////////////////////////////////////////////////////////////////////
935
+ /////////////////////////////////////////////////////////////////////////////////// priview form
936
+ ///////////////////////////////////////////////////////////////////////////////////
937
+ ///////////////////////////////////////////////////////////////////////////////////
938
+
939
+ add_action('wp_ajax_frommakerpreview', 'preview_contact_form');
940
+
941
+
942
+
943
+ function html_preview_contact_form($css){
944
+
945
+ /**
946
+ * @package SpiderFC
947
+ * @author Web-Dorado
948
+ * @copyright (C) 2011 Web-Dorado. All rights reserved.
949
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
950
+ **/
951
+
952
+ $cmpnt_js_path =plugins_url('js',__FILE__);
953
+ $id='form_id_temp';
954
+ ?>
955
+ <script src="<?php echo $cmpnt_js_path."/if_gmap_back_end.js"; ?>"></script>
956
+ <script src="<?php echo $cmpnt_js_path."/main.js"; ?>"></script>
957
+ <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
958
+ <style>
959
+ <?php
960
+ $cmpnt_js_path =plugins_url('',__FILE__);
961
+ echo str_replace('[SITE_ROOT]',$cmpnt_js_path, $css);
962
+
963
+ ?>
964
+ </style>
965
+ <div id="form_id_temppages" class="wdform_page_navigation" show_title="" show_numbers="" type=""></div>
966
+
967
+ <form id="form_preview"></form>
968
+ <input type="hidden" id="counter<?php echo $id ?>" value="" name="counter<?php echo $id ?>" />
969
+
970
+ <script>
971
+ JURI_ROOT ='<?php echo $cmpnt_js_path ?>';
972
+
973
+ document.getElementById('form_preview').innerHTML = window.parent.document.getElementById('take').innerHTML;
974
+ document.getElementById('form_id_temppages').setAttribute('show_title', window.parent.document.getElementById('pages').getAttribute('show_title'));
975
+ document.getElementById('form_id_temppages').setAttribute('show_numbers', window.parent.document.getElementById('pages').getAttribute('show_numbers'));
976
+ document.getElementById('form_id_temppages').setAttribute('type', window.parent.document.getElementById('pages').getAttribute('type'));
977
+ document.getElementById('counterform_id_temp').value=window.parent.gen;;
978
+
979
+ form_view_count<?php echo $id ?>=0;
980
+ for(i=1; i<=30; i++)
981
+ {
982
+ if(document.getElementById('<?php echo $id ?>form_view'+i))
983
+ {
984
+ form_view_count<?php echo $id ?>++;
985
+ form_view_max<?php echo $id ?>=i;
986
+ document.getElementById('<?php echo $id ?>form_view'+i).parentNode.removeAttribute('style');
987
+ }
988
+ }
989
+
990
+ refresh_first();
991
+
992
+
993
+ if(form_view_count<?php echo $id ?>>1)
994
+ {
995
+ for(i=1; i<=form_view_max<?php echo $id ?>; i++)
996
+ {
997
+ if(document.getElementById('<?php echo $id ?>form_view'+i))
998
+ {
999
+ first_form_view<?php echo $id ?>=i;
1000
+ break;
1001
+ }
1002
+ }
1003
+
1004
+ generate_page_nav(first_form_view<?php echo $id ?>, '<?php echo $id ?>', form_view_count<?php echo $id ?>, form_view_max<?php echo $id ?>);
1005
+ }
1006
+
1007
+
1008
+ function remove_add_(id)
1009
+ {
1010
+ attr_name= new Array();
1011
+ attr_value= new Array();
1012
+ var input = document.getElementById(id);
1013
+ atr=input.attributes;
1014
+ for(v=0;v<30;v++)
1015
+ if(atr[v] )
1016
+ {
1017
+ if(atr[v].name.indexOf("add_")==0)
1018
+ {
1019
+ attr_name.push(atr[v].name.replace('add_',''));
1020
+ attr_value.push(atr[v].value);
1021
+ input.removeAttribute(atr[v].name);
1022
+ v--;
1023
+ }
1024
+ }
1025
+ for(v=0;v<attr_name.length; v++)
1026
+ {
1027
+ input.setAttribute(attr_name[v],attr_value[v])
1028
+ }
1029
+ }
1030
+
1031
+ function refresh_first()
1032
+ {
1033
+
1034
+ n=window.parent.gen;
1035
+ for(i=0; i<n; i++)
1036
+ {
1037
+ if(document.getElementById(i))
1038
+ {
1039
+ for(z=0; z<document.getElementById(i).childNodes.length; z++)
1040
+ if(document.getElementById(i).childNodes[z].nodeType==3)
1041
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
1042
+
1043
+ if(document.getElementById(i).getAttribute('type')=="type_map")
1044
+ {
1045
+ if_gmap_init(i);
1046
+ for(q=0; q<20; q++)
1047
+ if(document.getElementById(i+"_elementform_id_temp").getAttribute("long"+q))
1048
+ {
1049
+
1050
+ w_long=parseFloat(document.getElementById(i+"_elementform_id_temp").getAttribute("long"+q));
1051
+ w_lat=parseFloat(document.getElementById(i+"_elementform_id_temp").getAttribute("lat"+q));
1052
+ w_info=parseFloat(document.getElementById(i+"_elementform_id_temp").getAttribute("info"+q));
1053
+ add_marker_on_map(i,q, w_long, w_lat, w_info, false);
1054
+ }
1055
+ }
1056
+
1057
+ if(document.getElementById(i).getAttribute('type')=="type_mark_map")
1058
+ {
1059
+ if_gmap_init(i);
1060
+ w_long=parseFloat(document.getElementById(i+"_elementform_id_temp").getAttribute("long"+0));
1061
+ w_lat=parseFloat(document.getElementById(i+"_elementform_id_temp").getAttribute("lat"+0));
1062
+ w_info=parseFloat(document.getElementById(i+"_elementform_id_temp").getAttribute("info"+0));
1063
+ add_marker_on_map(i,0, w_long, w_lat, w_info, true);
1064
+ }
1065
+
1066
+
1067
+
1068
+ if(document.getElementById(i).getAttribute('type')=="type_captcha" || document.getElementById(i).getAttribute('type')=="type_recaptcha")
1069
+ {
1070
+ if(document.getElementById(i).childNodes[10])
1071
+ {
1072
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1073
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1074
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1075
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1076
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1077
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1078
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1079
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1080
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1081
+ }
1082
+ else
1083
+ {
1084
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1085
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1086
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1087
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1088
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1089
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1090
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1091
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1092
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1093
+ }
1094
+ continue;
1095
+ }
1096
+
1097
+ if(document.getElementById(i).getAttribute('type')=="type_section_break")
1098
+ {
1099
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1100
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1101
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1102
+ continue;
1103
+ }
1104
+
1105
+
1106
+ if(document.getElementById(i).childNodes[10])
1107
+ {
1108
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1109
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1110
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1111
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1112
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1113
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1114
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1115
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1116
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1117
+ }
1118
+ else
1119
+ {
1120
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1121
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1122
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1123
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1124
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1125
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1126
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1127
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1128
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1129
+ }
1130
+ }
1131
+ }
1132
+
1133
+ for(i=0; i<=n; i++)
1134
+ {
1135
+ if(document.getElementById(i))
1136
+ {
1137
+ type=document.getElementById(i).getAttribute("type");
1138
+ switch(type)
1139
+ {
1140
+ case "type_text":
1141
+ case "type_number":
1142
+ case "type_password":
1143
+ case "type_submitter_mail":
1144
+ case "type_own_select":
1145
+ case "type_country":
1146
+ case "type_hidden":
1147
+ case "type_map":
1148
+ {
1149
+ remove_add_(i+"_elementform_id_temp");
1150
+ break;
1151
+ }
1152
+
1153
+ case "type_submit_reset":
1154
+ {
1155
+ remove_add_(i+"_element_submitform_id_temp");
1156
+ if(document.getElementById(i+"_element_resetform_id_temp"))
1157
+ remove_add_(i+"_element_resetform_id_temp");
1158
+ break;
1159
+ }
1160
+
1161
+ case "type_captcha":
1162
+ {
1163
+ remove_add_("_wd_captchaform_id_temp");
1164
+ remove_add_("_element_refreshform_id_temp");
1165
+ remove_add_("_wd_captcha_inputform_id_temp");
1166
+ break;
1167
+ }
1168
+
1169
+ case "type_recaptcha":
1170
+ {
1171
+ remove_add_("wd_recaptchaform_id_temp");
1172
+ break;
1173
+ }
1174
+
1175
+ case "type_file_upload":
1176
+ {
1177
+ remove_add_(i+"_elementform_id_temp");
1178
+ break;
1179
+ }
1180
+
1181
+ case "type_textarea":
1182
+ {
1183
+ remove_add_(i+"_elementform_id_temp");
1184
+
1185
+ break;
1186
+ }
1187
+
1188
+ case "type_name":
1189
+ {
1190
+
1191
+ if(document.getElementById(i+"_element_titleform_id_temp"))
1192
+ {
1193
+ remove_add_(i+"_element_titleform_id_temp");
1194
+ remove_add_(i+"_element_firstform_id_temp");
1195
+ remove_add_(i+"_element_lastform_id_temp");
1196
+ remove_add_(i+"_element_middleform_id_temp");
1197
+ }
1198
+ else
1199
+ {
1200
+ remove_add_(i+"_element_firstform_id_temp");
1201
+ remove_add_(i+"_element_lastform_id_temp");
1202
+
1203
+ }
1204
+ break;
1205
+
1206
+ }
1207
+
1208
+ case "type_phone":
1209
+ {
1210
+
1211
+ remove_add_(i+"_element_firstform_id_temp");
1212
+ remove_add_(i+"_element_lastform_id_temp");
1213
+
1214
+ break;
1215
+
1216
+ }
1217
+ case "type_address":
1218
+ {
1219
+ remove_add_(i+"_street1form_id_temp");
1220
+ remove_add_(i+"_street2form_id_temp");
1221
+ remove_add_(i+"_cityform_id_temp");
1222
+ remove_add_(i+"_stateform_id_temp");
1223
+ remove_add_(i+"_postalform_id_temp");
1224
+ remove_add_(i+"_countryform_id_temp");
1225
+
1226
+ break;
1227
+
1228
+ }
1229
+
1230
+
1231
+ case "type_checkbox":
1232
+ case "type_radio":
1233
+ {
1234
+ is=true;
1235
+ for(j=0; j<100; j++)
1236
+ if(document.getElementById(i+"_elementform_id_temp"+j))
1237
+ {
1238
+ remove_add_(i+"_elementform_id_temp"+j);
1239
+ }
1240
+ /* if(document.getElementById(i+"_randomize").value=="yes")
1241
+ choises_randomize(i);*/
1242
+
1243
+ break;
1244
+ }
1245
+
1246
+ case "type_button":
1247
+ {
1248
+ for(j=0; j<100; j++)
1249
+ if(document.getElementById(i+"_elementform_id_temp"+j))
1250
+ {
1251
+ remove_add_(i+"_elementform_id_temp"+j);
1252
+ }
1253
+ break;
1254
+ }
1255
+
1256
+ case "type_time":
1257
+ {
1258
+ if(document.getElementById(i+"_ssform_id_temp"))
1259
+ {
1260
+ remove_add_(i+"_ssform_id_temp");
1261
+ remove_add_(i+"_mmform_id_temp");
1262
+ remove_add_(i+"_hhform_id_temp");
1263
+ }
1264
+ else
1265
+ {
1266
+ remove_add_(i+"_mmform_id_temp");
1267
+ remove_add_(i+"_hhform_id_temp");
1268
+ }
1269
+ break;
1270
+
1271
+ }
1272
+
1273
+ case "type_date":
1274
+ {
1275
+ remove_add_(i+"_elementform_id_temp");
1276
+ remove_add_(i+"_buttonform_id_temp");
1277
+ break;
1278
+ }
1279
+ case "type_date_fields":
1280
+ {
1281
+ remove_add_(i+"_dayform_id_temp");
1282
+ remove_add_(i+"_monthform_id_temp");
1283
+ remove_add_(i+"_yearform_id_temp");
1284
+ break;
1285
+ }
1286
+ }
1287
+ }
1288
+ }
1289
+
1290
+
1291
+ for(t=1;t<=form_view_max<?php echo $id ?>;t++)
1292
+ {
1293
+ if(document.getElementById('form_id_tempform_view'+t))
1294
+ {
1295
+ form_view_element=document.getElementById('form_id_tempform_view'+t);
1296
+ xy=form_view_element.childNodes.length-2;
1297
+ for(z=0;z<=xy;z++)
1298
+ {
1299
+ if(form_view_element.childNodes[z])
1300
+ if(form_view_element.childNodes[z].nodeType!=3)
1301
+ if(!form_view_element.childNodes[z].id)
1302
+ {
1303
+ del=true;
1304
+ GLOBAL_tr=form_view_element.childNodes[z];
1305
+ //////////////////////////////////////////////////////////////////////////////////////////
1306
+ for (x=0; x < GLOBAL_tr.firstChild.childNodes.length; x++)
1307
+ {
1308
+ table=GLOBAL_tr.firstChild.childNodes[x];
1309
+ tbody=table.firstChild;
1310
+ if(tbody.childNodes.length)
1311
+ del=false;
1312
+ }
1313
+
1314
+ if(del)
1315
+ {
1316
+ form_view_element.removeChild(form_view_element.childNodes[z]);
1317
+ }
1318
+
1319
+ }
1320
+ }
1321
+ }
1322
+ }
1323
+
1324
+
1325
+ for(i=1; i<=window.parent.form_view_max; i++)
1326
+ if(document.getElementById('form_id_tempform_view'+i))
1327
+ {
1328
+ document.getElementById('form_id_tempform_view'+i).parentNode.removeChild(document.getElementById('form_id_tempform_view_img'+i));
1329
+ document.getElementById('form_id_tempform_view'+i).removeAttribute('style');
1330
+ }
1331
+
1332
+ }
1333
+
1334
+
1335
+ </script>
1336
+ <?php
1337
+ die();
1338
+ }
1339
+ function preview_contact_form() {
1340
+ if (function_exists('current_user_can')) {
1341
+ if (!current_user_can('manage_options')) {
1342
+ die('Access Denied');
1343
+ }
1344
+ }
1345
+ else {
1346
+ die('Access Denied');
1347
+ }
1348
+ global $wpdb;
1349
+ if(isset($_GET['id']))
1350
+ $getparams = (int) $_GET['id'];
1351
+ $query = "SELECT css FROM ".$wpdb->prefix."formmaker_themes WHERE id=".$getparams;
1352
+ $css = $wpdb->get_var($query);
1353
+ html_preview_contact_form($css);
1354
+ }
1355
+
1356
+
1357
+
1358
+
1359
+
1360
+
1361
+
1362
+
1363
+
1364
+
1365
+
1366
+
1367
+
1368
+ //////////////////////////////////////////////////////////////////////////////////////
1369
+ //////////////////////////////////////////////////////////////////////////////////
1370
+ ///////////////////////////////////////////////////////////////////////////////
1371
+ ///////////////////////////////////////////////////////////////////////////////
1372
+ /////////////////////////////////////////////////////////////////////////////////
1373
+
1374
+
1375
+
1376
+ function contact_form_Submits()
1377
+ {
1378
+ require_once("Submissions.html.php");
1379
+ require_once("Submissions.php");
1380
+ if(!function_exists('print_html_nav'))
1381
+ require_once("nav_function/nav_html_func.php");
1382
+
1383
+
1384
+ global $wpdb;
1385
+ if(isset($_GET["task"]))
1386
+ {
1387
+ $task = esc_html($_GET["task"]);
1388
+ }
1389
+ else
1390
+ {
1391
+ $task="show";
1392
+ }
1393
+ if(isset($_GET["id"]))
1394
+ {
1395
+ $id = (int) $_GET["id"];
1396
+ }
1397
+ else
1398
+ {
1399
+ $id=0;
1400
+ }
1401
+ switch($task){
1402
+ case "submits" :
1403
+ show_submits();
1404
+ break;
1405
+ case "edit_submit" :
1406
+ editSubmit($id);
1407
+ break;
1408
+ case "remove_submit" :
1409
+ remov_submit($id);
1410
+ show_submits();
1411
+ break;
1412
+ case "remov_cheched" :
1413
+ remov_cheched_submission();
1414
+ show_submits();
1415
+ break;
1416
+ case "appply_submit" :
1417
+ save_submit($id);
1418
+ editSubmit($id);
1419
+ break;
1420
+ case "save_submit" :
1421
+ save_submit($id);
1422
+ show_submits();
1423
+ break;
1424
+ case "cancel" :
1425
+ show_submits();
1426
+ break;
1427
+
1428
+
1429
+ default:
1430
+ show_submits();
1431
+ }
1432
+
1433
+
1434
+
1435
+
1436
+
1437
+
1438
+
1439
+ }
1440
+ function contact_form_Themes(){
1441
+
1442
+
1443
+
1444
+
1445
+ require_once("Theme_functions.php");
1446
+ require_once("Themes_function.html.php");
1447
+ if(!function_exists('print_html_nav'))
1448
+ require_once("nav_function/nav_html_func.php");
1449
+ global $wpdb;
1450
+ if(isset($_GET["task"]))
1451
+ {
1452
+ $task = esc_html($_GET["task"]);
1453
+ }
1454
+ else
1455
+ {
1456
+ $task="";
1457
+ }
1458
+ if(isset($_GET["id"]))
1459
+ {
1460
+ $id = (int) $_GET["id"];
1461
+ }
1462
+ else
1463
+ {
1464
+ $id=0;
1465
+ }
1466
+ switch($task){
1467
+ case 'theme':
1468
+ show_theme();
1469
+ break;
1470
+ case 'default':
1471
+ default_theme($id);
1472
+ show_theme();
1473
+ break;
1474
+
1475
+ case 'add_theme':
1476
+ add_theme();
1477
+ break;
1478
+
1479
+ case 'Save':
1480
+ if($id)
1481
+ {
1482
+ apply_theme($id);
1483
+ }
1484
+ else
1485
+ {
1486
+ save_theme();
1487
+ }
1488
+
1489
+ show_theme();
1490
+ break;
1491
+
1492
+ case 'Apply':
1493
+ if($id)
1494
+ {
1495
+ apply_theme($id);
1496
+ }
1497
+ else
1498
+ {
1499
+ save_theme();
1500
+ $id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker_themes");
1501
+ }
1502
+
1503
+ edit_theme($id);
1504
+ break;
1505
+
1506
+ case 'edit_theme':
1507
+ edit_theme($id);
1508
+ break;
1509
+
1510
+ case 'remove_theme':
1511
+ remove_theme($id);
1512
+ show_theme();
1513
+ break;
1514
+ default:
1515
+ show_theme();
1516
+ }
1517
+
1518
+
1519
+
1520
+
1521
+ }
1522
+
1523
+
1524
+
1525
+
1526
+ function Uninstall_contact_form()
1527
+ {
1528
+
1529
+ global $wpdb;
1530
+
1531
+
1532
+
1533
+ include 'setup_sql.php';
1534
+ set_contact_form_sql();
1535
+ $base_name = plugin_basename('contact_form');
1536
+ $base_page = 'admin.php?page='.$base_name;
1537
+ if(isset($_GET['mode'])){
1538
+ $mode = trim(esc_html($_GET['mode']));
1539
+ }
1540
+ if(!empty($_POST['do'])) {
1541
+
1542
+ if($_POST['do']=="UNINSTALL Form Maker") {
1543
+ check_admin_referer('Form Maker_uninstall');
1544
+ if(trim($_POST['uninstall_Form_yes']) == 'yes') {
1545
+
1546
+ $true_or_false_forms=$wpdb->get_var("SELECT COUNT(*) FROM ".$wpdb->prefix."formmaker WHERE `id` NOT IN (".get_option('contact_form_forms').")");
1547
+ $true_or_false_themes=$wpdb->get_var("SELECT COUNT(*) FROM ".$wpdb->prefix."formmaker WHERE `id` NOT IN (".get_option('contact_form_themes').")");
1548
+ //////////////////////////////ddddddddddddddddddddddddddddddddddddd
1549
+ if($true_or_false_forms || $true_or_false_themes){
1550
+ echo '<div id="message" class="updated fade">';
1551
+ echo '<p>';
1552
+ echo "Table 'formmaker' has been deleted.";
1553
+ $wpdb->query("DELETE FROM ".$wpdb->prefix."formmaker WHERE `id` IN (".get_option('contact_form_forms').")");
1554
+ echo '<font style="color:#000;">';
1555
+ echo '</font><br />';
1556
+ echo '</p>';
1557
+ echo '<p>';
1558
+ echo "Table 'formmaker_submits' has been deleted.";
1559
+ $wpdb->query("DELETE FROM ".$wpdb->prefix."formmaker_submits WHERE `form_id` IN (".get_option('contact_form_forms').")");
1560
+ echo '<font style="color:#000;">';
1561
+ echo '</font><br />';
1562
+ echo '</p>';
1563
+ echo '<p>';
1564
+ echo "Table 'formmaker_views' has been deleted.";
1565
+ $wpdb->query("DELETE FROM ".$wpdb->prefix."formmaker_views WHERE `form_id` IN (".get_option('contact_form_forms').")");
1566
+ echo '<font style="color:#000;">';
1567
+ echo '</font><br />';
1568
+ echo '</p>';
1569
+ echo '<p>';
1570
+ echo "Table 'formmaker_themes' has been deleted.";
1571
+ $wpdb->query("DELETE FROM ".$wpdb->prefix."formmaker_themes WHERE `id` IN (".get_option('contact_form_themes').")");
1572
+ echo '<font style="color:#000;">';
1573
+ echo '</font><br />';
1574
+ echo '</p>';
1575
+ echo '</div>';
1576
+ }
1577
+ else
1578
+ {
1579
+ echo '<div id="message" class="updated fade">';
1580
+ echo '<p>';
1581
+ echo "Table 'formmaker' has been deleted.";
1582
+ $wpdb->query("DROP TABLE ".$wpdb->prefix."formmaker");
1583
+ echo '<font style="color:#000;">';
1584
+ echo '</font><br />';
1585
+ echo '</p>';
1586
+ echo '<p>';
1587
+ echo "Table 'formmaker_submits' has been deleted.";
1588
+ $wpdb->query("DROP TABLE ".$wpdb->prefix."formmaker_submits");
1589
+ echo '<font style="color:#000;">';
1590
+ echo '</font><br />';
1591
+ echo '</p>';
1592
+ echo '<p>';
1593
+ echo "Table 'formmaker_views' has been deleted.";
1594
+ $wpdb->query("DROP TABLE ".$wpdb->prefix."formmaker_views");
1595
+ echo '<font style="color:#000;">';
1596
+ echo '</font><br />';
1597
+ echo '</p>';
1598
+ echo '<p>';
1599
+ echo "Table 'formmaker_themes' has been deleted.";
1600
+ $wpdb->query("DROP TABLE ".$wpdb->prefix."formmaker_themes");
1601
+ echo '<font style="color:#000;">';
1602
+ echo '</font><br />';
1603
+ echo '</p>';
1604
+ echo '</div>';
1605
+ }
1606
+ delete_option('contact_form_forms');
1607
+ delete_option('contact_form_themes');
1608
+ $mode = 'end-UNINSTALL';
1609
+
1610
+ }
1611
+ }
1612
+ }
1613
+
1614
+
1615
+ if(!isset($mode))
1616
+ $mode='';
1617
+ switch($mode) {
1618
+
1619
+ case 'end-UNINSTALL':
1620
+ $deactivate_url = wp_nonce_url('plugins.php?action=deactivate&amp;plugin='.plugin_basename(__FILE__), 'deactivate-plugin_'.plugin_basename(__FILE__)).'&contact_form_uninstall=1';
1621
+ echo '<div class="wrap">';
1622
+ echo '<div id="icon-contact_form" class="icon32"><br /></div>';
1623
+ echo '<h2>Uninstall Form Maker</h2>';
1624
+ 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>';
1625
+ echo '</div>';
1626
+ break;
1627
+ // Main Page
1628
+ default:
1629
+ ?>
1630
+ <form method="post" action="<?php echo admin_url('admin.php?page=Uninstall_contact_form'); ?>">
1631
+ <?php wp_nonce_field('Form Maker_uninstall'); ?>
1632
+ <div class="wrap">
1633
+ <div id="icon-contact_form" class="icon32"><br /></div>
1634
+ <h2><?php echo 'Uninstall Form Maker'; ?></h2>
1635
+ <p>
1636
+ <?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.'; ?>
1637
+ </p>
1638
+ <p style="color: red">
1639
+ <strong><?php echo'WARNING:'; ?></strong><br />
1640
+ <?php echo 'Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first.'; ?>
1641
+ </p>
1642
+ <p style="color: red">
1643
+ <strong><?php echo 'The following WordPress Options/Tables will be DELETED:'; ?></strong><br />
1644
+ </p>
1645
+ <table class="widefat">
1646
+ <thead>
1647
+ <tr>
1648
+ <th><?php echo 'WordPress Tables'; ?></th>
1649
+ </tr>
1650
+ </thead>
1651
+ <tr>
1652
+ <td valign="top">
1653
+ <ol>
1654
+ <?php
1655
+ echo '<li>formmaker</li>'."\n";
1656
+ echo '<li>formmaker_submits</li>'."\n";
1657
+ echo '<li>formmaker_views</li>'."\n";
1658
+ echo '<li>formmaker_themes</li>'."\n";
1659
+
1660
+ ?>
1661
+ </ol>
1662
+ </td>
1663
+ </tr>
1664
+ </table>
1665
+ <p style="text-align: center;">
1666
+ <?php echo 'Do you really want to uninstall Form Maker?'; ?><br /><br />
1667
+ <input type="checkbox" name="uninstall_Form_yes" value="yes" />&nbsp;<?php echo 'Yes'; ?><br /><br />
1668
+ <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.'; ?>')" />
1669
+ </p>
1670
+ </div>
1671
+
1672
+ </form>
1673
+ <?php
1674
+ }
1675
+ }
1676
+ function compare_version_fm($cur_ver,$ver_of_com){
1677
+ $cur_ver=explode('.',$cur_ver);
1678
+ $ver_of_com=explode('.',$ver_of_com);
1679
+ for($jj=0;$jj<10;$jj++){
1680
+ if(isset($cur_ver[$jj]) && isset($ver_of_com[$jj]))
1681
+ {
1682
+ if((int)$cur_ver[$jj]<(int)$ver_of_com[$jj]){
1683
+
1684
+ return true;
1685
+ }
1686
+ else
1687
+ {
1688
+ if((int)$cur_ver[$jj]>(int)$ver_of_com[$jj])
1689
+ return 0;
1690
+ }
1691
+ }
1692
+ }
1693
+ return 0;
1694
+ }
1695
+
1696
+ //echo admin_url().wp_nonce_url('update.php?action=upgrade-plugin&amp;plugin=player/Player.php', 'upgrade-plugin_player/Player.php');
1697
+
1698
+ function contact_form_activate()
1699
+ {
1700
+ $al_plug=get_plugins();
1701
+ foreach($al_plug as $key=>$plug)
1702
+ {
1703
+ if($key=='form-maker/Form_Maker.php')
1704
+ if(compare_version_fm($plug['Version'],'1.4.0')){
1705
+ if(get_option('contact_form_do_activation_redirect',false))
1706
+ add_option('contact_form_do_activation_redirect', true);
1707
+ else
1708
+ update_option('contact_form_do_activation_redirect', true);
1709
+
1710
+ }
1711
+ }
1712
+
1713
+ include 'setup_sql.php';
1714
+ set_contact_form_sql();
1715
+
1716
+ }
1717
+
1718
+ function contact_form_redirect() {
1719
+ if (get_option('contact_form_do_activation_redirect')== true) {
1720
+ update_option('contact_form_do_activation_redirect', false);
1721
+ wp_redirect(str_replace ('&amp;','&',admin_url().wp_nonce_url('update.php?action=upgrade-plugin&plugin=form-maker%2FForm_Maker.php', 'upgrade-plugin_form-maker/Form_Maker.php')));
1722
+ exit;
1723
+ }
1724
+ }
1725
+ add_action('admin_init', 'contact_form_redirect',0);
1726
+
1727
+ register_activation_hook( __FILE__, 'contact_form_activate' );
1728
+
1729
+
contact_form_ajax_functions.php CHANGED
@@ -1,239 +1,234 @@
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
- ///////////////////////////////////////////////////////////////////// wd_captcha
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
- function form_contact_wd_captcha(){
28
- if(isset($_GET['action']) && $_GET['action']=='formcontactwdcaptcha'){
29
- if(isset($_GET["i"]))
30
- $i=$_GET["i"];
31
- else
32
- $i='';
33
- if(isset($_GET['r2']))
34
- $r2=$_GET['r2'];
35
- else
36
- $r2=0;
37
- if(isset($_GET['r']))
38
- $rrr=$_GET['r'];
39
- else
40
- $rrr=0;
41
- $randNum=0+$r2+$rrr;
42
-
43
- if(isset($_GET["digit"]))
44
- $cap_width=$_GET["digit"]*10+15;
45
- else
46
- {
47
- $cap_width=6*10+15;
48
- }
49
- $cap_height=30;
50
- $cap_quality=100;
51
- if(isset($_GET["digit"]))
52
- $cap_length_min=$_GET["digit"];
53
- else
54
- $cap_length_min=6;
55
- if(isset($_GET["digit"]))
56
- $cap_length_max=$_GET["digit"];
57
- else
58
- $cap_length_max=6;
59
- $cap_digital=1;
60
- $cap_latin_char=1;
61
-
62
-
63
-
64
- function code_generic($_length,$_digital=1,$_latin_char=1)
65
- {
66
- $dig=array(0,1,2,3,4,5,6,7,8,9);
67
- $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');
68
- $main=array();
69
-
70
- if ($_digital) $main=array_merge($main,$dig);
71
- if ($_latin_char) $main=array_merge($main,$lat);
72
- shuffle($main);
73
- $pass=substr(implode('',$main),0,$_length);
74
- return $pass;
75
- }
76
-
77
- $l=rand($cap_length_min,$cap_length_max);
78
- $code=code_generic($l,$cap_digital,$cap_latin_char);
79
- @session_start();
80
-
81
- $_SESSION[$i.'_wd_captcha_code']=$code;
82
- $canvas=imagecreatetruecolor($cap_width,$cap_height);
83
- $c=imagecolorallocate($canvas,rand(150,255),rand(150,255),rand(150,255));
84
- imagefilledrectangle($canvas,0,0,$cap_width,$cap_height,$c);
85
- $count=strlen($code);
86
- $color_text=imagecolorallocate($canvas,0,0,0);
87
- for($it=0;$it<$count;$it++)
88
- {
89
- $letter=$code[$it];
90
- imagestring($canvas,6,(10*$it+10),$cap_height/4,$letter,$color_text);
91
- }
92
-
93
- for ($c = 0; $c < 150; $c++){
94
- $x = rand(0,$cap_width-1);
95
- $y = rand(0,29);
96
- $col='0x'.rand(0,9).'0'.rand(0,9).'0'.rand(0,9).'0';
97
- imagesetpixel($canvas, $x, $y, $col);
98
- }
99
-
100
-
101
- header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
102
- header('Cache-Control: no-store, no-cache, must-revalidate');
103
- header('Cache-Control: post-check=0, pre-check=0',false);
104
- header('Pragma: no-cache');
105
- header('Content-Type: image/jpeg');
106
- imagejpeg($canvas,null,$cap_quality);
107
- die('');
108
- }
109
- }
110
-
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
-
120
- /////////////////////////////////////////////////////////////////////
121
-
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
-
130
-
131
- ////////////////////////////////////////////////////////////////////// function post or page window php
132
-
133
-
134
-
135
-
136
- function form_contact_window_php(){
137
- if(isset($_GET['action']) && $_GET['action']=='formcontactwindow'){
138
- global $wpdb;
139
- ?>
140
- <html xmlns="http://www.w3.org/1999/xhtml">
141
- <head>
142
- <title>Contact Form</title>
143
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
144
- <script language="javascript" type="text/javascript" src="<?php echo get_option("siteurl"); ?>/wp-includes/js/jquery/jquery.js"></script>
145
- <script language="javascript" type="text/javascript" src="<?php echo get_option("siteurl"); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
146
- <link rel="stylesheet" href="<?php echo get_option("siteurl"); ?>/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css?ver=342-20110630100">
147
- <script language="javascript" type="text/javascript" src="<?php echo get_option("siteurl"); ?>/wp-includes/js/tinymce/utils/mctabs.js"></script>
148
- <script language="javascript" type="text/javascript" src="<?php echo get_option("siteurl"); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
149
- <base target="_self">
150
- </head>
151
- <body id="link" style="" dir="ltr" class="forceColors">
152
- <div class="tabs" role="tablist" tabindex="-1">
153
- <ul>
154
- <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">Contact Form</a></span></li>
155
- </ul>
156
- </div>
157
- <style>
158
- .panel_wrapper{
159
- height:170px !important;
160
- }
161
- </style>
162
- <div class="panel_wrapper">
163
- <div id="Single_product_panel" class="panel current">
164
- <table>
165
- <tr>
166
- <td style="height:100px; width:100px; vertical-align:top;">
167
- Select a Form
168
- </td>
169
- <td style="vertical-align:top">
170
- <select name="Form_Makername" id="Form_Makername" style="width:250px; text-align:center">
171
- <option style="text-align:center" value="- Select Form -" selected="selected">- Select a Form -</option>
172
- <?php $ids_Form_Maker=$wpdb->get_results("SELECT * FROM ".$wpdb->prefix."formmaker WHERE `id` IN(".get_option('contact_form_forms',0).") order by `id` DESC",0);
173
- foreach($ids_Form_Maker as $arr_Form_Maker)
174
- {
175
- ?>
176
- <option value="<?php echo $arr_Form_Maker->id; ?>"><?php echo $arr_Form_Maker->title; ?></option>
177
- <?php }?>
178
- </select>
179
- </td>
180
- </tr>
181
- </table>
182
- </div>
183
- </div>
184
- <div class="mceActionPanel">
185
- <div style="float: left">
186
- <input type="button" id="cancel" name="cancel" value="Cancel" onClick="tinyMCEPopup.close();" />
187
- </div>
188
-
189
- <div style="float: right">
190
- <input type="submit" id="insert" name="insert" value="Insert" onClick="insert_Form_Maker();" />
191
- </div>
192
- </div>
193
- <script type="text/javascript">
194
- function insert_Form_Maker() {
195
- if(document.getElementById('Form_Makername').value=='- Select Form -')
196
- {
197
- tinyMCEPopup.close();
198
- }
199
- else
200
- {
201
- var tagtext;
202
- tagtext='[contact_form id="'+document.getElementById('Form_Makername').value+'"]';
203
- window.tinyMCE.execInstanceCommand('content', 'mceInsertContent', false, tagtext);
204
- tinyMCEPopup.editor.execCommand('mceRepaint');
205
- tinyMCEPopup.close();
206
- }
207
-
208
- }
209
-
210
- </script>
211
- </body>
212
- </html>
213
- <?php
214
- die('');
215
- }
216
- }
217
-
218
-
219
-
220
-
221
-
222
-
223
-
224
-
225
-
226
-
227
-
228
-
229
-
230
-
231
-
232
-
233
-
234
-
235
-
236
-
237
-
238
-
239
-
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
+ ///////////////////////////////////////////////////////////////////// wd_captcha
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+ function form_contact_wd_captcha(){
28
+ if(isset($_GET['action']) && esc_html($_GET['action'])=='formcontactwdcaptcha'){
29
+ if(isset($_GET["i"]))
30
+ $i=(int) $_GET["i"];
31
+ else
32
+ $i='';
33
+ if(isset($_GET['r2']))
34
+ $r2=(int) $_GET['r2'];
35
+ else
36
+ $r2=0;
37
+ if(isset($_GET['r']))
38
+ $rrr=(int) $_GET['r'];
39
+ else
40
+ $rrr=0;
41
+ $randNum=0+$r2+$rrr;
42
+
43
+ if (isset($_GET["digit"])) {
44
+ $digit = (int) $_GET["digit"];
45
+ }
46
+ else {
47
+ $digit = 6;
48
+ }
49
+ $cap_width = $digit * 10 + 15;
50
+ $cap_height = 30;
51
+ $cap_quality = 100;
52
+ $cap_length_min = $digit;
53
+ $cap_length_max = $digit;
54
+ $cap_digital = 1;
55
+ $cap_latin_char = 1;
56
+
57
+
58
+
59
+ function code_generic($_length,$_digital=1,$_latin_char=1)
60
+ {
61
+ $dig=array(0,1,2,3,4,5,6,7,8,9);
62
+ $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');
63
+ $main=array();
64
+
65
+ if ($_digital) $main=array_merge($main,$dig);
66
+ if ($_latin_char) $main=array_merge($main,$lat);
67
+ shuffle($main);
68
+ $pass=substr(implode('',$main),0,$_length);
69
+ return $pass;
70
+ }
71
+
72
+ $l=rand($cap_length_min,$cap_length_max);
73
+ $code=code_generic($l,$cap_digital,$cap_latin_char);
74
+ @session_start();
75
+
76
+ $_SESSION[$i.'_wd_captcha_code']=$code;
77
+ $canvas=imagecreatetruecolor($cap_width,$cap_height);
78
+ $c=imagecolorallocate($canvas,rand(150,255),rand(150,255),rand(150,255));
79
+ imagefilledrectangle($canvas,0,0,$cap_width,$cap_height,$c);
80
+ $count=strlen($code);
81
+ $color_text=imagecolorallocate($canvas,0,0,0);
82
+ for($it=0;$it<$count;$it++)
83
+ {
84
+ $letter=$code[$it];
85
+ imagestring($canvas,6,(10*$it+10),$cap_height/4,$letter,$color_text);
86
+ }
87
+
88
+ for ($c = 0; $c < 150; $c++){
89
+ $x = rand(0,$cap_width-1);
90
+ $y = rand(0,29);
91
+ $col='0x'.rand(0,9).'0'.rand(0,9).'0'.rand(0,9).'0';
92
+ imagesetpixel($canvas, $x, $y, $col);
93
+ }
94
+
95
+
96
+ header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
97
+ header('Cache-Control: no-store, no-cache, must-revalidate');
98
+ header('Cache-Control: post-check=0, pre-check=0',false);
99
+ header('Pragma: no-cache');
100
+ header('Content-Type: image/jpeg');
101
+ imagejpeg($canvas,null,$cap_quality);
102
+ die('');
103
+ }
104
+ }
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+ /////////////////////////////////////////////////////////////////////
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+ ////////////////////////////////////////////////////////////////////// function post or page window php
127
+
128
+
129
+
130
+
131
+ function form_contact_window_php(){
132
+ if(isset($_GET['action']) && esc_html($_GET['action'])=='formcontactwindow'){
133
+ global $wpdb;
134
+ ?>
135
+ <html xmlns="http://www.w3.org/1999/xhtml">
136
+ <head>
137
+ <title>Contact Form</title>
138
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
139
+ <script language="javascript" type="text/javascript" src="<?php echo get_option("siteurl"); ?>/wp-includes/js/jquery/jquery.js"></script>
140
+ <script language="javascript" type="text/javascript" src="<?php echo get_option("siteurl"); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
141
+ <link rel="stylesheet" href="<?php echo get_option("siteurl"); ?>/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css?ver=342-20110630100">
142
+ <script language="javascript" type="text/javascript" src="<?php echo get_option("siteurl"); ?>/wp-includes/js/tinymce/utils/mctabs.js"></script>
143
+ <script language="javascript" type="text/javascript" src="<?php echo get_option("siteurl"); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
144
+ <base target="_self">
145
+ </head>
146
+ <body id="link" style="" dir="ltr" class="forceColors">
147
+ <div class="tabs" role="tablist" tabindex="-1">
148
+ <ul>
149
+ <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">Contact Form</a></span></li>
150
+ </ul>
151
+ </div>
152
+ <style>
153
+ .panel_wrapper{
154
+ height:170px !important;
155
+ }
156
+ </style>
157
+ <div class="panel_wrapper">
158
+ <div id="Single_product_panel" class="panel current">
159
+ <table>
160
+ <tr>
161
+ <td style="height:100px; width:100px; vertical-align:top;">
162
+ Select a Form
163
+ </td>
164
+ <td style="vertical-align:top">
165
+ <select name="Form_Makername" id="Form_Makername" style="width:250px; text-align:center">
166
+ <option style="text-align:center" value="- Select Form -" selected="selected">- Select a Form -</option>
167
+ <?php $ids_Form_Maker=$wpdb->get_results("SELECT * FROM ".$wpdb->prefix."formmaker WHERE `id` IN(".get_option('contact_form_forms',0).") order by `id` DESC",0);
168
+ foreach($ids_Form_Maker as $arr_Form_Maker)
169
+ {
170
+ ?>
171
+ <option value="<?php echo $arr_Form_Maker->id; ?>"><?php echo $arr_Form_Maker->title; ?></option>
172
+ <?php }?>
173
+ </select>
174
+ </td>
175
+ </tr>
176
+ </table>
177
+ </div>
178
+ </div>
179
+ <div class="mceActionPanel">
180
+ <div style="float: left">
181
+ <input type="button" id="cancel" name="cancel" value="Cancel" onClick="tinyMCEPopup.close();" />
182
+ </div>
183
+
184
+ <div style="float: right">
185
+ <input type="submit" id="insert" name="insert" value="Insert" onClick="insert_Form_Maker();" />
186
+ </div>
187
+ </div>
188
+ <script type="text/javascript">
189
+ function insert_Form_Maker() {
190
+ if(document.getElementById('Form_Makername').value=='- Select Form -')
191
+ {
192
+ tinyMCEPopup.close();
193
+ }
194
+ else
195
+ {
196
+ var tagtext;
197
+ tagtext='[contact_form id="'+document.getElementById('Form_Makername').value+'"]';
198
+ window.tinyMCE.execInstanceCommand('content', 'mceInsertContent', false, tagtext);
199
+ tinyMCEPopup.editor.execCommand('mceRepaint');
200
+ tinyMCEPopup.close();
201
+ }
202
+
203
+ }
204
+
205
+ </script>
206
+ </body>
207
+ </html>
208
+ <?php
209
+ die('');
210
+ }
211
+ }
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
 
 
 
 
 
contact_form_functions.html.php CHANGED
@@ -1,2506 +1,2506 @@
1
- <?php
2
-
3
-
4
-
5
- if(!current_user_can('manage_options')) {
6
- die('Access Denied');
7
- }
8
- function html_display_form_lists($rows, $pageNav, $sort,$old_version){
9
-
10
-
11
-
12
- global $wpdb;
13
- ?>
14
- <script language="javascript">
15
- function confirmation(href,title) {
16
- var answer = confirm("Are you sure you want to delete '"+title+"'?")
17
- if (answer){
18
- document.getElementById('admin_form').action=href;
19
- document.getElementById('admin_form').submit();
20
- }
21
- }
22
- function ordering(name,as_or_desc)
23
- {
24
- document.getElementById('asc_or_desc').value=as_or_desc;
25
- document.getElementById('order_by').value=name;
26
- document.getElementById('admin_form').submit();
27
- }
28
- function doNothing() {
29
- var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
30
- if( keyCode == 13 ) {
31
-
32
-
33
- if(!e) var e = window.event;
34
-
35
- e.cancelBubble = true;
36
- e.returnValue = false;
37
-
38
- if (e.stopPropagation) {
39
- e.stopPropagation();
40
- e.preventDefault();
41
- }
42
- }
43
- }
44
- </script>
45
- <form method="post" onkeypress="doNothing()" action="admin.php?page=contact_form" id="admin_form" name="admin_form">
46
- <table cellspacing="10" width="95%">
47
- <tr>
48
- <td style="width:50px">
49
- <img src="<?php echo plugins_url("images/formmakerLogo-48.png",__FILE__); ?>" />
50
- </td>
51
- <td style="width:140px;">
52
- <h2 style="vertical-align:top;">Contact Form</h2> </td>
53
- <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=contact_form&task=add_form'" /></td>
54
- <?php if($old_version) {?> <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=contact_form&task=update'" /></td><?php }?>
55
- <td style="text-align:right;font-size:16px;padding:20px; padding-right:50px">
56
- <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
57
- <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="color:red; text-decoration:none;">
58
- <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
59
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
60
- </a>
61
- </td>
62
- </tr>
63
- </table>
64
- <?php
65
- $serch_value="";
66
- if(isset($_POST['serch_or_not'])) {if($_POST['serch_or_not']=="search"){ $serch_value=$_POST['search_events_by_title']; }else{$serch_value="";}}
67
- $serch_fields='<div class="alignleft actions" style="width:180px;">
68
- <label for="search_events_by_title" style="font-size:14px">Title: </label>
69
- <input type="text" name="search_events_by_title" value="'.$serch_value.'" id="search_events_by_title" onchange="clear_serch_texts()">
70
- </div>
71
- <div class="alignleft actions">
72
- <input type="button" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\'; document.getElementById(\'serch_or_not\').value=\'search\';
73
- document.getElementById(\'admin_form\').submit();" class="button-secondary action">
74
- <input type="button" value="Reset" onclick="window.location.href=\'admin.php?page=contact_form\'" class="button-secondary action">
75
- </div>';
76
- print_html_nav($pageNav['total'],$pageNav['limit'],$serch_fields);
77
-
78
- ?>
79
- <table class="wp-list-table widefat fixed pages" style="width:95%">
80
- <thead>
81
- <TR>
82
- <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>
83
- <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>
84
- <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>
85
- <th style="width:80px">Edit</th>
86
- <th style="width:80px">Delete</th>
87
- </TR>
88
- </thead>
89
- <tbody>
90
- <?php for($i=0; $i<count($rows);$i++){ ?>
91
- <tr>
92
- <?php
93
- $old_version = false;
94
- if(strpos($rows[$i]->form, "wdform_table1")===false)
95
- {
96
- $old_version = true;
97
- }
98
- ?>
99
-
100
-
101
-
102
- <td><?php if(!$old_version) { ?><a href="admin.php?page=contact_form&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>
103
- <td><?php if(!$old_version) { ?><a href="admin.php?page=contact_form&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>
104
- <td><?php echo $rows[$i]->mail; ?></td>
105
- <td><?php if(!$old_version) { ?><a href="admin.php?page=contact_form&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>
106
- <td><a href="javascript:confirmation('admin.php?page=contact_form&task=remove_form&id=<?php echo $rows[$i]->id?>','<?php echo $rows[$i]->title; ?>')">Delete</a></td>
107
- </tr>
108
- <?php } ?>
109
- </tbody>
110
- </table>
111
- <input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if(isset($_POST['asc_or_desc'])) echo $_POST['asc_or_desc'];?>" />
112
- <input type="hidden" name="order_by" id="order_by" value="<?php if(isset($_POST['order_by'])) echo $_POST['order_by'];?>" />
113
-
114
- <?php
115
- ?>
116
-
117
-
118
-
119
- </form>
120
- <?php
121
-
122
-
123
-
124
-
125
-
126
- }
127
-
128
-
129
-
130
-
131
-
132
-
133
-
134
-
135
-
136
-
137
- function html_add_form($themes){
138
- ?>
139
-
140
- <script type="text/javascript">
141
-
142
-
143
- function refresh_()
144
- {
145
-
146
- document.getElementById('form').value=document.getElementById('take').innerHTML;
147
- document.getElementById('counter').value=gen;
148
-
149
-
150
-
151
-
152
-
153
- n=gen;
154
- for(i=0; i<n; i++)
155
- {
156
- if(document.getElementById(i))
157
- {
158
- for(z=0; z<document.getElementById(i).childNodes.length; z++)
159
- if(document.getElementById(i).childNodes[z].nodeType==3)
160
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
161
-
162
- if(document.getElementById(i).getAttribute('type')=="type_captcha" || document.getElementById(i).getAttribute('type')=="type_recaptcha")
163
- {
164
- if(document.getElementById(i).childNodes[10])
165
- {
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
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
173
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
174
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
175
- }
176
- else
177
- {
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
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
184
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
185
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
186
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
187
- }
188
- continue;
189
- }
190
-
191
- if(document.getElementById(i).getAttribute('type')=="type_section_break")
192
- {
193
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
194
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
195
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
196
- continue;
197
- }
198
-
199
-
200
- if(document.getElementById(i).childNodes[10])
201
- {
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
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
210
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
211
- }
212
- else
213
- {
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
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
222
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
223
- }
224
- }
225
- }
226
-
227
- for(i=0; i<=n; i++)
228
- {
229
- if(document.getElementById(i))
230
- {
231
- type=document.getElementById(i).getAttribute("type");
232
- switch(type)
233
- {
234
- case "type_text":
235
- case "type_number":
236
- case "type_password":
237
- case "type_submitter_mail":
238
- case "type_own_select":
239
- case "type_country":
240
- case "type_hidden":
241
- case "type_map":
242
- {
243
- remove_add_(i+"_elementform_id_temp");
244
- break;
245
- }
246
-
247
- case "type_submit_reset":
248
- {
249
- remove_add_(i+"_element_submitform_id_temp");
250
- if(document.getElementById(i+"_element_resetform_id_temp"))
251
- remove_add_(i+"_element_resetform_id_temp");
252
- break;
253
- }
254
-
255
- case "type_captcha":
256
- {
257
- remove_add_("_wd_captchaform_id_temp");
258
- remove_add_("_element_refreshform_id_temp");
259
- remove_add_("_wd_captcha_inputform_id_temp");
260
- break;
261
- }
262
-
263
- case "type_recaptcha":
264
- {
265
- document.getElementById("public_key").value = document.getElementById("wd_recaptchaform_id_temp").getAttribute("public_key");
266
- document.getElementById("private_key").value= document.getElementById("wd_recaptchaform_id_temp").getAttribute("private_key");
267
- document.getElementById("recaptcha_theme").value= document.getElementById("wd_recaptchaform_id_temp").getAttribute("theme");
268
- document.getElementById('wd_recaptchaform_id_temp').innerHTML='';
269
- remove_add_("wd_recaptchaform_id_temp");
270
- break;
271
- }
272
-
273
- case "type_file_upload":
274
- {
275
- remove_add_(i+"_elementform_id_temp");
276
- break;
277
- }
278
-
279
- case "type_textarea":
280
- {
281
- remove_add_(i+"_elementform_id_temp");
282
-
283
- break;
284
- }
285
-
286
- case "type_name":
287
- {
288
-
289
- if(document.getElementById(i+"_element_titleform_id_temp"))
290
- {
291
- remove_add_(i+"_element_titleform_id_temp");
292
- remove_add_(i+"_element_firstform_id_temp");
293
- remove_add_(i+"_element_lastform_id_temp");
294
- remove_add_(i+"_element_middleform_id_temp");
295
- }
296
- else
297
- {
298
- remove_add_(i+"_element_firstform_id_temp");
299
- remove_add_(i+"_element_lastform_id_temp");
300
-
301
- }
302
- break;
303
-
304
- }
305
-
306
- case "type_phone":
307
- {
308
-
309
- remove_add_(i+"_element_firstform_id_temp");
310
- remove_add_(i+"_element_lastform_id_temp");
311
-
312
- break;
313
-
314
- }
315
- case "type_address":
316
- {
317
- remove_add_(i+"_street1form_id_temp");
318
- remove_add_(i+"_street2form_id_temp");
319
- remove_add_(i+"_cityform_id_temp");
320
- remove_add_(i+"_stateform_id_temp");
321
- remove_add_(i+"_postalform_id_temp");
322
- remove_add_(i+"_countryform_id_temp");
323
-
324
- break;
325
-
326
- }
327
-
328
-
329
- case "type_checkbox":
330
- case "type_radio":
331
- {
332
- is=true;
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
- /* if(document.getElementById(i+"_randomize").value=="yes")
339
- choises_randomize(i);*/
340
-
341
- break;
342
- }
343
-
344
- case "type_button":
345
- {
346
- for(j=0; j<100; j++)
347
- if(document.getElementById(i+"_elementform_id_temp"+j))
348
- {
349
- remove_add_(i+"_elementform_id_temp"+j);
350
- }
351
- break;
352
- }
353
-
354
- case "type_time":
355
- {
356
- if(document.getElementById(i+"_ssform_id_temp"))
357
- {
358
- remove_add_(i+"_ssform_id_temp");
359
- remove_add_(i+"_mmform_id_temp");
360
- remove_add_(i+"_hhform_id_temp");
361
- }
362
- else
363
- {
364
- remove_add_(i+"_mmform_id_temp");
365
- remove_add_(i+"_hhform_id_temp");
366
- }
367
- break;
368
-
369
- }
370
-
371
- case "type_date":
372
- {
373
- remove_add_(i+"_elementform_id_temp");
374
- remove_add_(i+"_buttonform_id_temp");
375
- break;
376
- }
377
- case "type_date_fields":
378
- {
379
- remove_add_(i+"_dayform_id_temp");
380
- remove_add_(i+"_monthform_id_temp");
381
- remove_add_(i+"_yearform_id_temp");
382
- break;
383
- }
384
- }
385
- }
386
- }
387
-
388
- for(i=1; i<=form_view_max; i++)
389
- if(document.getElementById('form_id_tempform_view'+i))
390
- {
391
- if(document.getElementById('page_next_'+i))
392
- document.getElementById('page_next_'+i).removeAttribute('src');
393
- if(document.getElementById('page_previous_'+i))
394
- document.getElementById('page_previous_'+i).removeAttribute('src');
395
- document.getElementById('form_id_tempform_view'+i).parentNode.removeChild(document.getElementById('form_id_tempform_view_img'+i));
396
- document.getElementById('form_id_tempform_view'+i).removeAttribute('style');
397
- }
398
-
399
- document.getElementById('form_front').value=document.getElementById('take').innerHTML;
400
-
401
- }
402
-
403
- function submitform( pressbutton ){
404
-
405
- document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
406
- document.getElementById('adminForm').submit();
407
-
408
- }
409
-
410
-
411
-
412
-
413
-
414
- function submitbutton(pressbutton){
415
-
416
- var form = document.adminForm;
417
- if (pressbutton == 'cancel')
418
- {
419
- submitform( pressbutton );
420
- return;
421
- }
422
-
423
- if (form.title.value == "")
424
- {
425
- alert( "The form must have a title." );
426
- return ;
427
- }
428
-
429
- if(form.mail.value!='')
430
- {
431
- subMailArr=form.mail.value.split(',');
432
- emailListValid=true;
433
- for(subMailIt=0; subMailIt<subMailArr.length; subMailIt++)
434
- {
435
- trimmedMail = subMailArr[subMailIt].replace(/^\s+|\s+$/g, '') ;
436
- if (trimmedMail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1)
437
- {
438
- alert( "This is not a list of valid email addresses." );
439
- emailListValid=false;
440
- break;
441
- }
442
- }
443
- if(!emailListValid)
444
- return;
445
- }
446
-
447
- tox='';
448
-
449
- for(t=1;t<=form_view_max;t++)
450
- {
451
- if(document.getElementById('form_id_tempform_view'+t))
452
- {
453
- form_view_element=document.getElementById('form_id_tempform_view'+t);
454
- n=form_view_element.childNodes.length-2;
455
-
456
- for(z=0;z<=n;z++)
457
- {
458
- if(form_view_element.childNodes[z].nodeType!=3)
459
- if(!form_view_element.childNodes[z].id)
460
- {
461
- GLOBAL_tr=form_view_element.childNodes[z];
462
- //////////////////////////////////////////////////////////////////////////////////////////
463
- for (x=0; x < GLOBAL_tr.firstChild.childNodes.length; x++)
464
- {
465
- table=GLOBAL_tr.firstChild.childNodes[x];
466
- tbody=table.firstChild;
467
- for (y=0; y < tbody.childNodes.length; y++)
468
- {
469
- tr=tbody.childNodes[y];
470
- l_label = document.getElementById( tr.id+'_element_labelform_id_temp').innerHTML;
471
- l_label = l_label.replace(/(\r\n|\n|\r)/gm," ");
472
-
473
- if(tr.getAttribute('type')=="type_address")
474
- {
475
- addr_id=parseInt(tr.id);
476
- tox=tox+addr_id+'#**id**#'+'Street Line'+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
477
- tox=tox+addr_id+'#**id**#'+'Street Line2'+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
478
- tox=tox+addr_id+'#**id**#'+'City'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
479
- tox=tox+addr_id+'#**id**#'+'State'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
480
- tox=tox+addr_id+'#**id**#'+'Postal'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
481
- tox=tox+addr_id+'#**id**#'+'Country'+'#**label**#'+tr.getAttribute('type')+'#****#';
482
- }
483
- else
484
- tox=tox+tr.id+'#**id**#'+l_label+'#**label**#'+tr.getAttribute('type')+'#****#';
485
- }
486
- }
487
- }
488
- }
489
- }
490
- }
491
-
492
- document.getElementById('label_order').value=tox;
493
- refresh_();
494
- document.getElementById('pagination').value=document.getElementById('pages').getAttribute("type");
495
- document.getElementById('show_title').value=document.getElementById('pages').getAttribute("show_title");
496
- document.getElementById('show_numbers').value=document.getElementById('pages').getAttribute("show_numbers");
497
-
498
- submitform( pressbutton );
499
-
500
- }
501
- gen=1;
502
- form_view=1;
503
- form_view_max=1;
504
- form_view_count=1;
505
-
506
- function set_preview()
507
- {
508
- appWidth =parseInt(document.body.offsetWidth);
509
- appHeight =parseInt(document.body.offsetHeight);
510
- document.getElementById('preview_form').href='<?php echo admin_url('admin-ajax.php'); ?>?action=frommakerpreview&id='+document.getElementById('theme').value+'&TB_iframe=1';
511
- }
512
-
513
-
514
- //add main form id
515
- function enable()
516
- {
517
- for(iiiii=0; iiiii<1000;iiiii++)
518
- {
519
- if(document.getElementsByTagName("iframe")[iiiii]){
520
- if(document.getElementsByTagName("iframe")[iiiii].id=='contact_form_editor_ifr'){
521
- id_ifr_editor=iiiii;
522
- break;
523
- }
524
- }
525
- }
526
- alltypes=Array('customHTML','text','checkbox','radio','time_and_date','select','file_upload','captcha','map','button','page_break','section_break');
527
- for(x=0; x<12;x++)
528
- {
529
- document.getElementById('img_'+alltypes[x]).src="<?php echo plugins_url("images",__FILE__) ?>/"+alltypes[x]+".png";
530
- }
531
-
532
- document.getElementById('formMakerDiv').style.display =(document.getElementById('formMakerDiv').style.display=='block'?'none':'block');
533
- document.getElementById('formMakerDiv1').style.display =(document.getElementById('formMakerDiv1').style.display=='block'?'none':'block');
534
- if(document.getElementById('formMakerDiv').offsetWidth)
535
- document.getElementById('formMakerDiv1').style.width =(document.getElementById('formMakerDiv').offsetWidth - 60)+'px';
536
- document.getElementById('when_edit').style.display ='none';
537
- }
538
-
539
- function enable2()
540
- {
541
- alltypes=Array('customHTML','text','checkbox','radio','time_and_date','select','file_upload','captcha','map','button','page_break','section_break');
542
- for(x=0; x<12;x++)
543
- {
544
- document.getElementById('img_'+alltypes[x]).src="<?php echo plugins_url("images",__FILE__) ?>/"+alltypes[x]+".png";
545
- }
546
-
547
- document.getElementById('formMakerDiv').style.display =(document.getElementById('formMakerDiv').style.display=='block'?'none':'block');
548
- document.getElementById('formMakerDiv1').style.display =(document.getElementById('formMakerDiv1').style.display=='block'?'none':'block');
549
- if(document.getElementById('formMakerDiv').offsetWidth)
550
- document.getElementById('formMakerDiv1').style.width =(document.getElementById('formMakerDiv').offsetWidth - 60)+'px';
551
- document.getElementById('when_edit').style.display ='block';
552
- if(document.getElementById('field_types').offsetWidth)
553
- document.getElementById('when_edit').style.width =document.getElementById('field_types').offsetWidth+'px';
554
-
555
- if(document.getElementById('field_types').offsetHeight)
556
- document.getElementById('when_edit').style.height =document.getElementById('field_types').offsetHeight+'px';
557
-
558
- }
559
-
560
-
561
-
562
- var thickDims, tbWidth, tbHeight;
563
- jQuery(document).ready(function($) {
564
-
565
- thickDims = function() {
566
- var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
567
-
568
- w = (tbWidth && tbWidth < W - 90) ? tbWidth : W - 40;
569
- h = (tbHeight && tbHeight < H - 60) ? tbHeight : H - 40;
570
-
571
- if ( tbWindow.size() ) {
572
- tbWindow.width(w).height(h);
573
- $('#TB_iframeContent').width(w).height(h - 27);
574
- tbWindow.css({'margin-left': '-' + parseInt((w / 2),10) + 'px'});
575
- if ( typeof document.body.style.maxWidth != 'undefined' )
576
- tbWindow.css({'top':(H-h)/2,'margin-top':'0'});
577
- }
578
- };
579
-
580
- thickDims();
581
- $(window).resize( function() { thickDims() } );
582
-
583
- $('a.thickbox-preview').click( function() {
584
- tb_click.call(this);
585
-
586
- var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text;
587
-
588
- if ( tbWidth = href.match(/&tbWidth=[0-9]+/) )
589
- tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
590
- else
591
- tbWidth = $(window).width() - 120;
592
-
593
- if ( tbHeight = href.match(/&tbHeight=[0-9]+/) )
594
- tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
595
- else
596
- tbHeight = $(window).height() - 120;
597
-
598
- if ( alink.length ) {
599
- url = alink.attr('href') || '';
600
- text = alink.attr('title') || '';
601
- link = '&nbsp; <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
602
- } else {
603
- text = $(this).attr('title') || '';
604
- link = '&nbsp; <span class="tb-theme-preview-link">' + text + '</span>';
605
- }
606
-
607
- $('#TB_title').css({'background-color':'#222','color':'#dfdfdf'});
608
- $('#TB_closeAjaxWindow').css({'float':'left'});
609
- $('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
610
-
611
- $('#TB_iframeContent').width('100%');
612
- thickDims();
613
-
614
- return false;
615
- } );
616
-
617
- // Theme details
618
- $('.theme-detail').click(function () {
619
- $(this).siblings('.themedetaildiv').toggle();
620
- return false;
621
- });
622
-
623
- });
624
-
625
- </script>
626
- <style>
627
- .calendar .button
628
- {
629
- display:table-cell !important;
630
- }
631
- #when_edit
632
- {
633
- position:absolute;
634
- background-color:#666;
635
- z-index:101;
636
- display:none;
637
- width:100%;
638
- height:100%;
639
- opacity: 0.7;
640
- filter: alpha(opacity = 70);
641
- }
642
- #formMakerDiv
643
- {
644
- position:fixed;
645
- background-color:#666;
646
- z-index:100;
647
- display:none;
648
- left:0;
649
- top:0;
650
- width:100%;
651
- height:100%;
652
- opacity: 0.7;
653
- filter: alpha(opacity = 70);
654
- }
655
- #formMakerDiv1
656
- {
657
- padding-top:20px;
658
- position:fixed;
659
- z-index:100;
660
- background-color:transparent;
661
- top:0;
662
- left:0;
663
- display:none;
664
- margin-left:30px;
665
- margin-top:15px;
666
- }
667
- </style>
668
- <?php
669
- foreach($themes as $theme)
670
- {
671
- if($theme->default == 1 )
672
- {
673
- $my_selected_theme=$theme->id;
674
-
675
- }
676
-
677
- }
678
- ?>
679
- <table width="95%">
680
- <tr>
681
- <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
682
- <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="color:red; text-decoration:none;">
683
- <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
684
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
685
- </a></div>
686
- </td>
687
- </tr>
688
- <tr>
689
- <td width="100%" ><?php echo "<h2>Contact Form</h2>"; ?></td>
690
- <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>
691
- <td><input type="button" onclick="submitbutton('Actions_after_submission')" value="Actions after submission" class="button-primary" /> </td>
692
- <td> <input type="button" onclick="submitbutton('Edit_JavaScript')" value="Edit JavaScript" class="button-primary" /> </td>
693
- <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>
694
- <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>
695
- <td align="right"><input type="button" onclick="submitbutton('Save')" value="Save" class="button-secondary action" /> </td>
696
- <td align="right"><input type="button" onclick="submitbutton('Apply')" value="Apply" class="button-secondary action"/> </td>
697
- <td align="right"><input type="button" onclick="window.location.href='admin.php?page=contact_form'" value="Cancel" class="button-secondary action" /> </td>
698
- </tr>
699
- </table>
700
- <br />
701
-
702
- <form action="admin.php?page=contact_form" method="post" id="adminForm" name="adminForm" enctype="multipart/form-data">
703
- <table style="border:6px #00aeef solid; background-color:#00aeef " width="95%" cellpadding="0" cellspacing="0">
704
- <tr>
705
-
706
-
707
- <td align="left" valign="middle" rowspan="3" style="padding:10px;">
708
- <img src="<?php echo plugins_url("images/FormMaker.png",__FILE__) ?>" />
709
- </td>
710
-
711
- <td width="300" align="right" valign="middle">
712
-
713
- <span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Form title:&nbsp;&nbsp;</span>
714
-
715
- </td>
716
-
717
- <td width="153" height="30px" align="center" valign="middle">
718
-
719
- <div style="background-image:url(<?php echo plugins_url("images/input.png",__FILE__) ?>); height:19px">
720
- <input type="hidden" value="<?php echo plugins_url("",__FILE__) ?>" id="form_plugins_url" />
721
- <input id="title" name="title" style="background:none; padding:inherit; width:151px; height:19px; border:none; font-size:11px; " />
722
-
723
- </div>
724
-
725
- </td>
726
-
727
- </tr>
728
-
729
-
730
- <tr>
731
-
732
- <td width="300" align="right" valign="middle">
733
-
734
- <span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Email to send submissions to:&nbsp;&nbsp;</span>
735
-
736
- </td>
737
-
738
- <td width="153" height="30px" align="center" valign="middle">
739
-
740
- <div style="background-image:url(<?php echo plugins_url("images/input.png",__FILE__) ?>); height:19px">
741
-
742
- <input id="mail" name="mail" style="background:none; padding:inherit; width:151px; height:19px; border:none; font-size:11px" />
743
-
744
- </div>
745
-
746
- </td>
747
-
748
- </tr>
749
-
750
- <tr>
751
-
752
- <td width="300" align="right" valign="middle">
753
-
754
- <span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Theme:&nbsp;&nbsp;</span>
755
-
756
- </td>
757
-
758
- <td width="153" height="30px" align="center" valign="middle">
759
-
760
- <div style="height:19px">
761
-
762
- <select id="theme" name="theme" style="background:transparent; width:151px; height:19px; border:none; font-size:11px" onChange="set_preview()" >
763
-
764
- <?php
765
- $form_theme='';
766
- foreach($themes as $theme)
767
- {
768
- if($theme->default == 1 )
769
- {
770
- echo '<option value="'.$theme->id.'" selected>'.$theme->title.'</option>';
771
- $form_theme=$theme->css;
772
- }
773
- else
774
- echo '<option value="'.$theme->id.'">'.$theme->title.'</option>';
775
-
776
- }
777
- ?>
778
- </select>
779
-
780
- </div>
781
-
782
- </td>
783
-
784
- </tr>
785
-
786
-
787
-
788
- <tr>
789
- <td align="left" colspan="3">
790
-
791
- <img src="<?php echo plugins_url("images/addanewfield.png",__FILE__) ?>" onclick="enable(); Enable()" style="cursor:pointer;margin:10px;" />
792
-
793
- </td>
794
- </tr>
795
- </table>
796
-
797
-
798
-
799
- <div id="formMakerDiv" onclick="close_window()"></div>
800
-
801
- <div id="formMakerDiv1" align="center">
802
-
803
- <table border="0" width="100%" cellpadding="0" cellspacing="0" height="100%" style="border:6px #00aeef solid; background-color:#FFF">
804
- <tr>
805
- <td style="padding:0px">
806
- <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
807
- <tr valign="top">
808
- <td width="15%" height="100%" style="border-right:dotted black 1px;" id="field_types">
809
- <div id="when_edit" style="display:none"></div>
810
- <table border="0" cellpadding="0" cellspacing="3" width="100%">
811
- <tr>
812
- <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>
813
-
814
- <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>
815
- </tr>
816
- <tr>
817
- <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.')" id="table_time_and_date" style="background-color: rgb(114, 113, 113) !important;" class="field_buttons"><img src="<?php echo plugins_url("images/time_and_date.png",__FILE__); ?>" style="margin:5px" id="img_time_and_date"/></td>
818
-
819
- <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.')" id="table_select" style="background-color: rgb(114, 113, 113) !important;" class="field_buttons" ><img src="<?php echo plugins_url("images/select.png",__FILE__); ?>" style="margin:5px" id="img_select"/></td>
820
- </tr>
821
- <tr>
822
- <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.')" id="table_checkbox" style="background-color: rgb(114, 113, 113) !important;" class="field_buttons"><img src="<?php echo plugins_url("images/checkbox.png",__FILE__); ?>" style="margin:5px" id="img_checkbox"/></td>
823
-
824
- <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.')" id="table_radio" style="background-color: rgb(114, 113, 113) !important;" class="field_buttons"><img src="<?php echo plugins_url("images/radio.png",__FILE__); ?>" style="margin:5px" id="img_radio"/></td>
825
- </tr>
826
- <tr>
827
- <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.')" id="table_file_upload" style="background-color: rgb(114, 113, 113) !important;" class="field_buttons"><img src="<?php echo plugins_url("images/file_upload.png",__FILE__); ?>" style="margin:5px" id="img_file_upload"/></td>
828
-
829
- <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>
830
- </tr>
831
- <tr>
832
- <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>
833
-
834
- <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>
835
- </tr>
836
- <tr>
837
- <td align="center" onClick="addRow('map')" id="table_map" class="field_buttons"><img src="<?php echo plugins_url("images/map.png",__FILE__); ?>" style="margin:5px" id="img_map"/></td>
838
-
839
- <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>
840
- </tr>
841
- </table>
842
- </td>
843
- <td width="40%" height="100%" align="left"><div id="edit_table" style="padding:0px; overflow-y:scroll; height:531px" ></div></td>
844
- <td align="center" valign="top" style="background:url(<?php echo plugins_url("images/border2.png",__FILE__); ?>) repeat-y;">&nbsp;</td>
845
- <td style="padding:15px">
846
- <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
847
-
848
- <tr>
849
- <td align="right"><input type="radio" value="end" name="el_pos" checked="checked" id="pos_end" onclick="Disable()"/>
850
- At The End
851
- <input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
852
- At The Beginning
853
- <input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
854
- Before
855
- <select style="width:100px; margin-left:5px" id="sel_el_pos" disabled="disabled">
856
- </select>
857
- <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)"/>
858
- <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()"/>
859
-
860
- <hr style=" margin-bottom:10px" />
861
- </td>
862
- </tr>
863
-
864
- <tr height="100%" valign="top">
865
- <td id="show_table"></td>
866
- </tr>
867
-
868
- </table>
869
- </td>
870
- </tr>
871
- </table>
872
- </td>
873
- </tr>
874
- </table>
875
- <input type="hidden" id="old" />
876
- <input type="hidden" id="old_selected" />
877
- <input type="hidden" id="element_type" />
878
- <input type="hidden" id="editing_id" />
879
- <input type="hidden" id="editing_page_break" />
880
- <div id="main_editor" style="position:absolute; display:none; z-index:140;"><?php
881
- if(function_exists ('the_editor') || function_exists ('wp_editor')){
882
- if(get_bloginfo('version')<'3.3'){?>
883
- <div style=" max-width:500px; height:300px;text-align:left" id="poststuff">
884
- <div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea"><?php the_editor("","contact_form_editor","title",$media_buttons = true, $tab_index = 1, $extended = true ); ?>
885
- </div>
886
- <?php } else { echo "<style>#wp-contact_form_editor-media-buttons{ text-align:left }</style>"; wp_editor("","contact_form_editor");}?>
887
- </div>
888
- <?php
889
-
890
-
891
-
892
- }
893
- else
894
- {
895
- ?>
896
- <textarea name="editor" id="editor" cols="40" rows="6" style="width: 450px; height: 350px; " class="mce_editable" aria-hidden="true"></textarea>
897
- <?php
898
-
899
- }
900
- ?>
901
-
902
-
903
- </div>
904
-
905
- <?php if(!function_exists ('the_editor'))
906
- ?>
907
- <iframe id="tinymce" style="display:none"></iframe>
908
-
909
- <?php
910
- ?>
911
-
912
-
913
-
914
- <br />
915
- <br />
916
-
917
- <fieldset>
918
-
919
- <legend>
920
-
921
- <h2 style="color:#00aeef">Form</h2>
922
-
923
- </legend>
924
-
925
- <style><?php global $first_css;
926
- echo $first_css; ?></style>
927
-
928
- <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>
929
- <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>
930
- </fieldset>
931
-
932
- <input type="hidden" name="form_front" id="form_front" />
933
- <input type="hidden" name="form" id="form" />
934
-
935
- <input type="hidden" name="counter" id="counter" />
936
-
937
- <input type="hidden" name="pagination" id="pagination" />
938
- <input type="hidden" name="show_title" id="show_title" />
939
- <input type="hidden" name="show_numbers" id="show_numbers" />
940
-
941
- <input type="hidden" name="public_key" id="public_key" />
942
- <input type="hidden" name="private_key" id="private_key" />
943
- <input type="hidden" name="recaptcha_theme" id="recaptcha_theme" />
944
-
945
- <input type="hidden" name="label_order" id="label_order" />
946
- <input type="hidden" name="option" value="com_formmaker" />
947
-
948
- <input type="hidden" name="task" value="" />
949
-
950
- </form>
951
-
952
- <script>
953
- plugin_url=document.getElementById('form_plugins_url').value;
954
- //appWidth =parseInt(document.body.offsetWidth);
955
- //appHeight =parseInt(document.body.offsetHeight);
956
- //document.getElementById('toolbar-popup-popup').childNodes[1].href='index.php?option=com_formmaker&task=preview&tmpl=component&theme='+document.getElementById('theme').value;
957
- //document.getElementById('toolbar-popup-popup').childNodes[1].setAttribute('rel',"{handler: 'iframe', size: {x:"+(appWidth-100)+", y: "+(appHeight-30)+"}}");
958
- </script>
959
- <?php
960
-
961
-
962
- }
963
-
964
-
965
-
966
-
967
-
968
-
969
-
970
-
971
-
972
-
973
-
974
-
975
-
976
-
977
- function html_edit_contact_form($row, $labels, $themes){
978
-
979
- ?>
980
-
981
- <script type="text/javascript">
982
-
983
-
984
-
985
- function submitform( pressbutton ){
986
-
987
- document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
988
- document.getElementById('adminForm').submit();
989
-
990
- }
991
- function submitbutton(pressbutton)
992
-
993
- {
994
-
995
- if(!document.getElementById('araqel'))
996
- {
997
- alert('Please wait while page loading');
998
- return;
999
- }
1000
- else
1001
- if(document.getElementById('araqel').value=='0')
1002
- {
1003
- alert('Please wait while page loading');
1004
- return;
1005
- }
1006
-
1007
- var form = document.adminForm;
1008
-
1009
- if (pressbutton == 'cancel')
1010
-
1011
- {
1012
-
1013
- submitform( pressbutton );
1014
-
1015
- return;
1016
-
1017
- }
1018
-
1019
- if (form.title.value == "")
1020
-
1021
- {
1022
-
1023
- alert( "The form must have a title." );
1024
- return;
1025
-
1026
- }
1027
-
1028
- if(form.mail.value!='')
1029
- {
1030
- subMailArr=form.mail.value.split(',');
1031
- emailListValid=true;
1032
- for(subMailIt=0; subMailIt<subMailArr.length; subMailIt++)
1033
- {
1034
- trimmedMail = subMailArr[subMailIt].replace(/^\s+|\s+$/g, '') ;
1035
- if (trimmedMail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1)
1036
- {
1037
- alert( "This is not a list of valid email addresses." );
1038
- emailListValid=false;
1039
- break;
1040
- }
1041
- }
1042
- if(!emailListValid)
1043
- return
1044
-
1045
- }
1046
-
1047
- tox='';
1048
- l_id_array=[<?php echo $labels['id']?>];
1049
- l_label_array=[<?php echo $labels['label']?>];
1050
- l_type_array=[<?php echo $labels['type']?>];
1051
- l_id_removed=[];
1052
-
1053
- for(x=0; x< l_id_array.length; x++)
1054
- {
1055
- l_id_removed[x]=true;
1056
- }
1057
-
1058
- for(t=1;t<=form_view_max;t++)
1059
- {
1060
- if(document.getElementById('form_id_tempform_view'+t))
1061
- {
1062
- form_view_element=document.getElementById('form_id_tempform_view'+t);
1063
- n=form_view_element.childNodes.length-2;
1064
-
1065
- for(q=0;q<=n;q++)
1066
- {
1067
- if(form_view_element.childNodes[q].nodeType!=3)
1068
- if(!form_view_element.childNodes[q].id)
1069
- {
1070
- GLOBAL_tr=form_view_element.childNodes[q];
1071
-
1072
- for (x=0; x < GLOBAL_tr.firstChild.childNodes.length; x++)
1073
- {
1074
-
1075
- table=GLOBAL_tr.firstChild.childNodes[x];
1076
- tbody=table.firstChild;
1077
- for (y=0; y < tbody.childNodes.length; y++)
1078
- {
1079
- is_in_old=false;
1080
- tr=tbody.childNodes[y];
1081
- l_id=tr.id;
1082
-
1083
- l_label=document.getElementById( tr.id+'_element_labelform_id_temp').innerHTML;
1084
- l_label = l_label.replace(/(\r\n|\n|\r)/gm," ");
1085
- l_type=tr.getAttribute('type');
1086
- for(z=0; z< l_id_array.length; z++)
1087
- {
1088
- if(l_id_array[z]==l_id)
1089
- {
1090
- l_id_removed[z]=false;
1091
- if(l_type_array[z]=="type_address")
1092
- {
1093
- z++;
1094
- l_id_removed[z]=false;
1095
- z++;
1096
- l_id_removed[z]=false;
1097
- z++;
1098
- l_id_removed[z]=false;
1099
- z++;
1100
- l_id_removed[z]=false;
1101
- z++;
1102
- l_id_removed[z]=false;
1103
- }
1104
- }
1105
- }
1106
-
1107
- if(tr.getAttribute('type')=="type_address")
1108
- {
1109
- addr_id=parseInt(tr.id);
1110
- tox=tox+addr_id+'#**id**#'+'Street Line'+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
1111
- tox=tox+addr_id+'#**id**#'+'Street Line2'+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
1112
- tox=tox+addr_id+'#**id**#'+'City'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1113
- tox=tox+addr_id+'#**id**#'+'State'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1114
- tox=tox+addr_id+'#**id**#'+'Postal'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1115
- tox=tox+addr_id+'#**id**#'+'Country'+'#**label**#'+tr.getAttribute('type')+'#****#';
1116
- }
1117
- else
1118
- tox=tox+l_id+'#**id**#'+l_label+'#**label**#'+l_type+'#****#';
1119
-
1120
-
1121
-
1122
- }
1123
- }
1124
- }
1125
- }
1126
- }
1127
- }
1128
- for(x=0; x< l_id_array.length; x++)
1129
- {
1130
- if(l_id_removed[x])
1131
- tox=tox+l_id_array[x]+'#**id**#'+l_label_array[x]+'#**label**#'+l_type_array[x]+'#****#';
1132
- }
1133
-
1134
-
1135
- document.getElementById('label_order').value=tox;
1136
-
1137
-
1138
- refresh_()
1139
- document.getElementById('pagination').value=document.getElementById('pages').getAttribute("type");
1140
- document.getElementById('show_title').value=document.getElementById('pages').getAttribute("show_title");
1141
- document.getElementById('show_numbers').value=document.getElementById('pages').getAttribute("show_numbers");
1142
-
1143
-
1144
- submitform( pressbutton );
1145
- }
1146
-
1147
- function remove_whitespace(node)
1148
- {
1149
- for (ttt=0; ttt < node.childNodes.length; ttt++)
1150
- {
1151
- if( node.childNodes[ttt].nodeType == '3')
1152
- {
1153
- if(!node.childNodes[ttt])
1154
- node.removeChild(node.childNodes[ttt]);
1155
- }
1156
- else
1157
- {
1158
- if(node.childNodes[ttt].childNodes.length)
1159
- remove_whitespace(node.childNodes[ttt]);
1160
- }
1161
- }
1162
- return
1163
- }
1164
-
1165
- function refresh_()
1166
- {
1167
-
1168
- document.getElementById('form').value=document.getElementById('take').innerHTML;
1169
- document.getElementById('counter').value=gen;
1170
- n=gen;
1171
- for(i=0; i<n; i++)
1172
- {
1173
- if(document.getElementById(i))
1174
- {
1175
- for(z=0; z<document.getElementById(i).childNodes.length; z++)
1176
- if(document.getElementById(i).childNodes[z].nodeType==3)
1177
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
1178
-
1179
- if(document.getElementById(i).getAttribute('type')=="type_captcha" || document.getElementById(i).getAttribute('type')=="type_recaptcha")
1180
- {
1181
- if(document.getElementById(i).childNodes[10])
1182
- {
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
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1191
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1192
- }
1193
- else
1194
- {
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
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1203
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1204
- }
1205
- continue;
1206
- }
1207
-
1208
- if(document.getElementById(i).getAttribute('type')=="type_section_break")
1209
- {
1210
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1211
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1212
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1213
- continue;
1214
- }
1215
-
1216
-
1217
-
1218
- if(document.getElementById(i).childNodes[10])
1219
- {
1220
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1221
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1222
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1223
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1224
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1225
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1226
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1227
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1228
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1229
- }
1230
- else
1231
- {
1232
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1233
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1234
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1235
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1236
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1237
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1238
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1239
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1240
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1241
- }
1242
- }
1243
- }
1244
-
1245
- for(i=0; i<=n; i++)
1246
- {
1247
- if(document.getElementById(i))
1248
- {
1249
- type=document.getElementById(i).getAttribute("type");
1250
- switch(type)
1251
- {
1252
- case "type_text":
1253
- case "type_number":
1254
- case "type_password":
1255
- case "type_submitter_mail":
1256
- case "type_own_select":
1257
- case "type_country":
1258
- case "type_hidden":
1259
- case "type_map":
1260
- {
1261
- remove_add_(i+"_elementform_id_temp");
1262
- break;
1263
- }
1264
-
1265
- case "type_submit_reset":
1266
- {
1267
- remove_add_(i+"_element_submitform_id_temp");
1268
- if(document.getElementById(i+"_element_resetform_id_temp"))
1269
- remove_add_(i+"_element_resetform_id_temp");
1270
- break;
1271
- }
1272
-
1273
- case "type_captcha":
1274
- {
1275
- remove_add_("_wd_captchaform_id_temp");
1276
- remove_add_("_element_refreshform_id_temp");
1277
- remove_add_("_wd_captcha_inputform_id_temp");
1278
- break;
1279
- }
1280
-
1281
- case "type_recaptcha":
1282
- {
1283
- document.getElementById("public_key").value = document.getElementById("wd_recaptchaform_id_temp").getAttribute("public_key");
1284
- document.getElementById("private_key").value= document.getElementById("wd_recaptchaform_id_temp").getAttribute("private_key");
1285
- document.getElementById("recaptcha_theme").value= document.getElementById("wd_recaptchaform_id_temp").getAttribute("theme");
1286
- document.getElementById('wd_recaptchaform_id_temp').innerHTML='';
1287
- remove_add_("wd_recaptchaform_id_temp");
1288
- break;
1289
- }
1290
-
1291
- case "type_file_upload":
1292
- {
1293
- remove_add_(i+"_elementform_id_temp");
1294
-
1295
- break;
1296
- }
1297
-
1298
- case "type_textarea":
1299
- {
1300
- remove_add_(i+"_elementform_id_temp");
1301
-
1302
- break;
1303
- }
1304
-
1305
- case "type_name":
1306
- {
1307
-
1308
- if(document.getElementById(i+"_element_titleform_id_temp"))
1309
- {
1310
- remove_add_(i+"_element_titleform_id_temp");
1311
- remove_add_(i+"_element_firstform_id_temp");
1312
- remove_add_(i+"_element_lastform_id_temp");
1313
- remove_add_(i+"_element_middleform_id_temp");
1314
- }
1315
- else
1316
- {
1317
- remove_add_(i+"_element_firstform_id_temp");
1318
- remove_add_(i+"_element_lastform_id_temp");
1319
- }
1320
- break;
1321
-
1322
- }
1323
-
1324
- case "type_phone":
1325
- {
1326
-
1327
- remove_add_(i+"_element_firstform_id_temp");
1328
- remove_add_(i+"_element_lastform_id_temp");
1329
- break;
1330
-
1331
- }
1332
- case "type_address":
1333
- {
1334
- remove_add_(i+"_street1form_id_temp");
1335
- remove_add_(i+"_street2form_id_temp");
1336
- remove_add_(i+"_cityform_id_temp");
1337
- remove_add_(i+"_stateform_id_temp");
1338
- remove_add_(i+"_postalform_id_temp");
1339
- remove_add_(i+"_countryform_id_temp");
1340
-
1341
- break;
1342
-
1343
- }
1344
-
1345
-
1346
- case "type_checkbox":
1347
- case "type_radio":
1348
- {
1349
- is=true;
1350
- for(j=0; j<100; j++)
1351
- if(document.getElementById(i+"_elementform_id_temp"+j))
1352
- {
1353
- remove_add_(i+"_elementform_id_temp"+j);
1354
- }
1355
-
1356
- /*if(document.getElementById(i+"_randomize").value=="yes")
1357
- choises_randomize(i);*/
1358
-
1359
- break;
1360
- }
1361
-
1362
- case "type_button":
1363
- {
1364
- for(j=0; j<100; j++)
1365
- if(document.getElementById(i+"_elementform_id_temp"+j))
1366
- {
1367
- remove_add_(i+"_elementform_id_temp"+j);
1368
- }
1369
- break;
1370
- }
1371
-
1372
- case "type_time":
1373
- {
1374
- if(document.getElementById(i+"_ssform_id_temp"))
1375
- {
1376
- remove_add_(i+"_ssform_id_temp");
1377
- remove_add_(i+"_mmform_id_temp");
1378
- remove_add_(i+"_hhform_id_temp");
1379
- }
1380
- else
1381
- {
1382
- remove_add_(i+"_mmform_id_temp");
1383
- remove_add_(i+"_hhform_id_temp");
1384
-
1385
- }
1386
- break;
1387
-
1388
- }
1389
-
1390
- case "type_date":
1391
- {
1392
- remove_add_(i+"_elementform_id_temp");
1393
- remove_add_(i+"_buttonform_id_temp");
1394
-
1395
- break;
1396
- }
1397
- case "type_date_fields":
1398
- {
1399
- remove_add_(i+"_dayform_id_temp");
1400
- remove_add_(i+"_monthform_id_temp");
1401
- remove_add_(i+"_yearform_id_temp");
1402
- break;
1403
- }
1404
- }
1405
- }
1406
- }
1407
-
1408
- for(i=1; i<=form_view_max; i++)
1409
- {
1410
- if(document.getElementById('form_id_tempform_view'+i))
1411
- {
1412
- if(document.getElementById('page_next_'+i))
1413
- document.getElementById('page_next_'+i).removeAttribute('src');
1414
- if(document.getElementById('page_previous_'+i))
1415
- document.getElementById('page_previous_'+i).removeAttribute('src');
1416
-
1417
- document.getElementById('form_id_tempform_view'+i).parentNode.removeChild(document.getElementById('form_id_tempform_view_img'+i));
1418
- document.getElementById('form_id_tempform_view'+i).removeAttribute('style');
1419
- }
1420
- }
1421
-
1422
-
1423
- document.getElementById('form_front').value=document.getElementById('take').innerHTML;
1424
-
1425
- }
1426
-
1427
- function set_preview()
1428
- {
1429
- appWidth =parseInt(document.body.offsetWidth);
1430
- appHeight =parseInt(document.body.offsetHeight);
1431
- document.getElementById('preview_form').href='<?php echo admin_url('admin-ajax.php'); ?>?action=frommakerpreview&id='+document.getElementById('theme').value+'&TB_iframe=1';
1432
- }
1433
-
1434
- gen=<?php echo $row->counter; ?>;//add main form id
1435
- function enable()
1436
- {
1437
- for(iiiii=0; iiiii<1000;iiiii++)
1438
- {
1439
- if(document.getElementsByTagName("iframe")[iiiii]){
1440
- if(document.getElementsByTagName("iframe")[iiiii].id=='contact_form_editor_ifr'){
1441
- id_ifr_editor=iiiii;
1442
- break;
1443
- }
1444
- }
1445
- }
1446
- alltypes=Array('customHTML','text','checkbox','radio','time_and_date','select','file_upload','captcha','map','button','page_break','section_break');
1447
- for(x=0; x<12;x++)
1448
- {
1449
- document.getElementById('img_'+alltypes[x]).src="<?php echo plugins_url("images/",__FILE__) ?>"+alltypes[x]+".png";
1450
- }
1451
-
1452
-
1453
- document.getElementById('formMakerDiv').style.display =(document.getElementById('formMakerDiv').style.display=='block'?'none':'block');
1454
- document.getElementById('formMakerDiv1').style.display =(document.getElementById('formMakerDiv1').style.display=='block'?'none':'block');
1455
-
1456
- if(document.getElementById('formMakerDiv').offsetWidth)
1457
- document.getElementById('formMakerDiv1').style.width =(document.getElementById('formMakerDiv').offsetWidth - 60)+'px';
1458
- document.getElementById('when_edit').style.display ='none';
1459
- }
1460
-
1461
- function enable2()
1462
- {
1463
-
1464
- alltypes=Array('customHTML','text','checkbox','radio','time_and_date','select','file_upload','captcha','map','button','page_break','section_break');
1465
- for(x=0; x<12;x++)
1466
- {
1467
-
1468
- document.getElementById('img_'+alltypes[x]).src="<?php echo plugins_url("images/",__FILE__) ?>"+alltypes[x]+".png";
1469
- }
1470
-
1471
-
1472
- document.getElementById('formMakerDiv').style.display =(document.getElementById('formMakerDiv').style.display=='block'?'none':'block');
1473
- document.getElementById('formMakerDiv1').style.display =(document.getElementById('formMakerDiv1').style.display=='block'?'none':'block');
1474
- if(document.getElementById('formMakerDiv').offsetWidth)
1475
- document.getElementById('formMakerDiv1').style.width =(document.getElementById('formMakerDiv').offsetWidth - 60)+'px';
1476
- document.getElementById('when_edit').style.display ='block';
1477
- if(document.getElementById('field_types').offsetWidth)
1478
- document.getElementById('when_edit').style.width =document.getElementById('field_types').offsetWidth+'px';
1479
-
1480
- if(document.getElementById('field_types').offsetHeight)
1481
- document.getElementById('when_edit').style.height =document.getElementById('field_types').offsetHeight+'px';
1482
-
1483
- //document.getElementById('when_edit').style.position='none';
1484
-
1485
- }
1486
-
1487
- var thickDims, tbWidth, tbHeight;
1488
- jQuery(document).ready(function($) {
1489
-
1490
- thickDims = function() {
1491
- var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
1492
-
1493
- w = (tbWidth && tbWidth < W - 90) ? tbWidth : W - 40;
1494
- h = (tbHeight && tbHeight < H - 60) ? tbHeight : H - 40;
1495
-
1496
- if ( tbWindow.size() ) {
1497
- tbWindow.width(w).height(h);
1498
- $('#TB_iframeContent').width(w).height(h - 27);
1499
- tbWindow.css({'margin-left': '-' + parseInt((w / 2),10) + 'px'});
1500
- if ( typeof document.body.style.maxWidth != 'undefined' )
1501
- tbWindow.css({'top':(H-h)/2,'margin-top':'0'});
1502
- }
1503
- };
1504
-
1505
- thickDims();
1506
- $(window).resize( function() { thickDims() } );
1507
-
1508
- $('a.thickbox-preview').click( function() {
1509
- tb_click.call(this);
1510
-
1511
- var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text;
1512
-
1513
- if ( tbWidth = href.match(/&tbWidth=[0-9]+/) )
1514
- tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
1515
- else
1516
- tbWidth = $(window).width() - 120;
1517
-
1518
- if ( tbHeight = href.match(/&tbHeight=[0-9]+/) )
1519
- tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
1520
- else
1521
- tbHeight = $(window).height() - 120;
1522
-
1523
- if ( alink.length ) {
1524
- url = alink.attr('href') || '';
1525
- text = alink.attr('title') || '';
1526
- link = '&nbsp; <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
1527
- } else {
1528
- text = $(this).attr('title') || '';
1529
- link = '&nbsp; <span class="tb-theme-preview-link">' + text + '</span>';
1530
- }
1531
-
1532
- $('#TB_title').css({'background-color':'#222','color':'#dfdfdf'});
1533
- $('#TB_closeAjaxWindow').css({'float':'left'});
1534
- $('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
1535
-
1536
- $('#TB_iframeContent').width('100%');
1537
- thickDims();
1538
-
1539
- return false;
1540
- } );
1541
-
1542
- // Theme details
1543
- $('.theme-detail').click(function () {
1544
- $(this).siblings('.themedetaildiv').toggle();
1545
- return false;
1546
- });
1547
-
1548
- });
1549
-
1550
- </script>
1551
- <style>
1552
- .calendar .button
1553
- {
1554
- display:table-cell !important;
1555
- }
1556
- #when_edit
1557
- {
1558
- position:absolute;
1559
- background-color:#666;
1560
- z-index:101;
1561
- display:none;
1562
- width:100%;
1563
- height:100%;
1564
- opacity: 0.7;
1565
- filter: alpha(opacity = 70);
1566
- }
1567
-
1568
- #formMakerDiv
1569
- {
1570
- position:fixed;
1571
- background-color:#666;
1572
- z-index:100;
1573
- display:none;
1574
- left:0;
1575
- top:0;
1576
- width:100%;
1577
- height:100%;
1578
- opacity: 0.7;
1579
- filter: alpha(opacity = 70);
1580
- }
1581
- #formMakerDiv1
1582
- {
1583
- padding-top:20px;
1584
- position:fixed;
1585
- z-index:100;
1586
- background-color:transparent;
1587
- top:0;
1588
- left:0;
1589
- display:none;
1590
- margin-left:30px;
1591
- margin-top:15px;
1592
- }
1593
- </style>
1594
- <table width="95%">
1595
- <tr>
1596
- <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
1597
- <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="color:red; text-decoration:none;">
1598
- <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
1599
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
1600
- </a></div>
1601
- </td>
1602
- </tr>
1603
- <tr>
1604
- <td width="100%"><?php echo "<h2>Contact Form</h2>"; ?></td>
1605
- <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>
1606
- <td><input type="button" onclick="submitbutton('Actions_after_submission')" value="Actions after submission" class="button-primary" /> </td>
1607
- <td> <input type="button" onclick="submitbutton('Edit_JavaScript')" value="Edit JavaScript" class="button-primary" /> </td>
1608
- <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>
1609
- <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>
1610
- <td style="width:300px"><input type="button" onclick="submitbutton('save_as_copy')" value="Save As Copy" class="button-secondary action" /> </td>
1611
- <td align="right"><input type="button" onclick="submitbutton('Save')" value="Save" class="button-secondary action" /> </td>
1612
- <td align="right"><input type="button" onclick="submitbutton('Apply')" value="Apply" class="button-secondary action"/> </td>
1613
- <td align="right"><input type="button" onclick="window.location.href='admin.php?page=contact_form'" value="Cancel" class="button-secondary action" /> </td>
1614
- </tr>
1615
- </table>
1616
- <br />
1617
-
1618
-
1619
-
1620
- <form action="admin.php?page=contact_form&id=<?php echo $row->id; ?>" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data">
1621
- <table style="border:6px #00aeef solid; background-color:#00aeef" width="95%" cellpadding="0" cellspacing="0">
1622
- <tr>
1623
-
1624
-
1625
- <td align="left" valign="middle" rowspan="3" style="padding:10px;">
1626
- <img src="<?php echo plugins_url("images/FormMaker.png",__FILE__) ?>" />
1627
- </td>
1628
-
1629
- <td width="70" align="right" valign="middle">
1630
-
1631
- <span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Form title:&nbsp;&nbsp;</span>
1632
-
1633
- </td>
1634
-
1635
- <td width="153" height="30px" align="center" valign="middle">
1636
-
1637
- <div style="background-image:url(<?php echo plugins_url("images/input.png",__FILE__) ?>);">
1638
-
1639
- <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" />
1640
-
1641
- </div>
1642
-
1643
- </td>
1644
-
1645
- </tr><tr>
1646
-
1647
- <td width="300" align="right" valign="middle">
1648
-
1649
- <span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Email to send submissions to:&nbsp;&nbsp;</span>
1650
-
1651
- </td>
1652
-
1653
- <td width="153" height="30px" align="center" valign="middle">
1654
-
1655
- <div style="background-image:url(<?php echo plugins_url("images/input.png",__FILE__) ?>);">
1656
-
1657
- <input id="mail" name="mail" <?php echo 'value="'.$row->mail.'"' ?> style="background:none; padding:inherit; width:151px; height:17px; border:none; font-size:11px" />
1658
-
1659
- </div>
1660
-
1661
- </td>
1662
-
1663
- </tr>
1664
- <tr>
1665
-
1666
- <td width="300" height="30px" align="right" valign="middle">
1667
-
1668
- <span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Theme:&nbsp;&nbsp;</span>
1669
-
1670
- </td>
1671
-
1672
- <td width="153" align="center" valign="middle">
1673
-
1674
- <div style="height:19px">
1675
-
1676
- <select id="theme" name="theme" style="background:transparent; width:151px; height:19px; border:none; font-size:11px" onChange="set_preview()" >
1677
-
1678
- <?php
1679
- $form_theme='';
1680
- foreach($themes as $theme)
1681
- {
1682
- if($theme->id==$row->theme)
1683
- {
1684
- echo '<option value="'.$theme->id.'" selected>'.$theme->title.'</option>';
1685
- $form_theme=$theme->css;
1686
- }
1687
- else
1688
- echo '<option value="'.$theme->id.'">'.$theme->title.'</option>';
1689
- }
1690
- ?>
1691
- </select>
1692
-
1693
- </div>
1694
-
1695
- </td>
1696
-
1697
- </tr>
1698
-
1699
-
1700
-
1701
- <tr>
1702
- <td align="left" colspan="3">
1703
-
1704
- <img src="<?php echo plugins_url("images/addanewfield.png",__FILE__) ?>" onclick="enable(); Enable()" style="cursor:pointer;margin:10px;" />
1705
-
1706
- </td>
1707
- </tr>
1708
- </table>
1709
-
1710
- <div id="formMakerDiv" onclick="close_window()"></div>
1711
- <div id="formMakerDiv1" style="padding-top:20px" align="center">
1712
-
1713
-
1714
- <table border="0" width="100%" cellpadding="0" cellspacing="0" height="100%" style="border:6px #00aeef solid; background-color:#FFF">
1715
- <tr>
1716
- <td style="padding:0px">
1717
- <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
1718
- <tr valign="top">
1719
- <td width="15%" height="100%" style="border-right:dotted black 1px;" id="field_types">
1720
- <div id="when_edit" style="display:none"></div>
1721
- <table border="0" cellpadding="0" cellspacing="3" width="100%">
1722
- <tr>
1723
- <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>
1724
-
1725
- <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>
1726
- </tr>
1727
- <tr>
1728
- <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="cursor:pointer; background-color: rgb(114, 113, 113) !important;" 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>
1729
-
1730
- <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="cursor:pointer; background-color: rgb(114, 113, 113) !important;" id="table_select" class="field_buttons"><img src="<?php echo plugins_url("images/select.png",__FILE__) ?>" style="margin:5px" id="img_select"/></td>
1731
- </tr>
1732
- <tr>
1733
- <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="cursor:pointer; background-color: rgb(114, 113, 113) !important;" id="table_checkbox" class="field_buttons"><img src="<?php echo plugins_url("images/checkbox.png",__FILE__) ?>" style="margin:5px" id="img_checkbox"/></td>
1734
-
1735
- <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="cursor:pointer; background-color: rgb(114, 113, 113) !important;" id="table_radio" class="field_buttons"><img src="<?php echo plugins_url("images/radio.png",__FILE__) ?>" style="margin:5px" id="img_radio"/></td>
1736
- </tr>
1737
- <tr>
1738
- <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="cursor:pointer; 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>
1739
-
1740
- <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>
1741
- </tr>
1742
- <tr>
1743
- <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>
1744
-
1745
- <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>
1746
- </tr>
1747
- <tr>
1748
- <td align="center" onClick="addRow('map')" style="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>
1749
-
1750
- <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>
1751
- </tr>
1752
- </table>
1753
-
1754
- </td>
1755
- <td width="35%" height="100%" align="left"><div id="edit_table" style="padding:0px; overflow-y:scroll; height:531px" ></div></td>
1756
-
1757
- <td align="center" valign="top" style="background:url(<?php echo plugins_url("images/border2.png",__FILE__) ?>) repeat-y;">&nbsp;</td>
1758
- <td style="padding:15px">
1759
- <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
1760
-
1761
- <tr>
1762
- <td align="right"><input type="radio" value="end" name="el_pos" checked="checked" id="pos_end" onclick="Disable()"/>
1763
- At The End
1764
- <input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
1765
- At The Beginning
1766
- <input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
1767
- Before
1768
- <select style="width:100px; margin-left:5px" id="sel_el_pos" disabled="disabled">
1769
- </select>
1770
- <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)"/>
1771
- <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()"/>
1772
-
1773
- <hr style=" margin-bottom:10px" />
1774
- </td>
1775
- </tr>
1776
-
1777
- <tr height="100%" valign="top">
1778
- <td id="show_table"></td>
1779
- </tr>
1780
-
1781
- </table>
1782
- </td>
1783
- </tr>
1784
- </table>
1785
- </td>
1786
- </tr>
1787
- </table>
1788
-
1789
- <input type="hidden" id="old" />
1790
- <input type="hidden" id="old_selected" />
1791
- <input type="hidden" id="element_type" />
1792
- <input type="hidden" id="editing_id" />
1793
- <input type="hidden" value="<?php echo plugins_url("",__FILE__) ?>" id="form_plugins_url" />
1794
- <div id="main_editor" style="position:absolute; display:none; z-index:140;"> <?php if(function_exists ('the_editor') || function_exists ('wp_editor')){
1795
- if(get_bloginfo('version')<'3.3'){?>
1796
- <div style=" max-width:500px; height:300px;text-align:left" id="poststuff">
1797
- <div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea"><?php the_editor("","contact_form_editor","title",$media_buttons = true, $tab_index = 1, $extended = true ); ?>
1798
- </div>
1799
- </div>
1800
- <?php } else { echo "<style>#wp-contact_form_editor-media-buttons{ text-align:left }</style>"; wp_editor("","contact_form_editor");}?>
1801
-
1802
- <?php
1803
- }
1804
- else
1805
- {
1806
- ?>
1807
- <textarea name="contact_form_editor" id="contact_form_editor" cols="40" rows="6" style="width: 440px; height: 350px; " class="mce_editable" aria-hidden="true"></textarea>
1808
- <?php
1809
-
1810
- }
1811
- ?></div>
1812
- </div>
1813
-
1814
- <?php if(!function_exists ('the_editor'))
1815
- {
1816
- ?>
1817
- <iframe id="tinymce" style="display:none"></iframe>
1818
-
1819
- <?php
1820
- }
1821
- ?>
1822
-
1823
-
1824
-
1825
- <br />
1826
- <br />
1827
-
1828
- <fieldset>
1829
-
1830
- <legend>
1831
-
1832
- <h2 style="color:#00aeef">Form</h2>
1833
-
1834
- </legend>
1835
-
1836
- <?php
1837
- global $first_css;
1838
- echo '<style>'.$first_css.'</style>';
1839
-
1840
- ?><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
1841
-
1842
- if($row->form)
1843
-
1844
- echo $row->form;
1845
-
1846
- else
1847
-
1848
- 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>';
1849
- ?></div>
1850
-
1851
- </fieldset>
1852
-
1853
- <input type="hidden" name="form" id="form">
1854
- <input type="hidden" name="form_front" id="form_front">
1855
-
1856
- <input type="hidden" name="pagination" id="pagination" />
1857
- <input type="hidden" name="show_title" id="show_title" />
1858
- <input type="hidden" name="show_numbers" id="show_numbers" />
1859
-
1860
- <input type="hidden" name="public_key" id="public_key" />
1861
- <input type="hidden" name="private_key" id="private_key" />
1862
- <input type="hidden" name="recaptcha_theme" id="recaptcha_theme" />
1863
-
1864
- <input type="hidden" id="label_order" name="label_order" value="<?php echo $row->label_order;?>" />
1865
- <input type="hidden" name="counter" id="counter" value="<?php echo $row->counter;?>">
1866
-
1867
- <script type="text/javascript">
1868
-
1869
- function formOnload()
1870
- {
1871
- //enable maps
1872
- for(t=0; t<<?php echo $row->counter;?>; t++)
1873
- if(document.getElementById(t+"_typeform_id_temp"))
1874
- {
1875
- if(document.getElementById(t+"_typeform_id_temp").value=="type_map" || document.getElementById(t+"_typeform_id_temp").value=="type_mark_map")
1876
- {
1877
- if_gmap_init(t);
1878
- for(q=0; q<20; q++)
1879
- if(document.getElementById(t+"_elementform_id_temp").getAttribute("long"+q))
1880
- {
1881
-
1882
- w_long=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("long"+q));
1883
- w_lat=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("lat"+q));
1884
- w_info=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("info"+q));
1885
- add_marker_on_map(t,q, w_long, w_lat, w_info, false);
1886
- }
1887
- }
1888
- else
1889
- if(document.getElementById(t+"_typeform_id_temp").value=="type_date")
1890
- Calendar.setup({
1891
- inputField: t+"_elementform_id_temp",
1892
- ifFormat: document.getElementById(t+"_buttonform_id_temp").getAttribute('format'),
1893
- button: t+"_buttonform_id_temp",
1894
- align: "Tl",
1895
- singleClick: true,
1896
- firstDay: 0
1897
- });
1898
-
1899
- }
1900
-
1901
-
1902
- form_view=1;
1903
- form_view_count=0;
1904
- for(i=1; i<=30; i++)
1905
- {
1906
- if(document.getElementById('form_id_tempform_view'+i))
1907
- {
1908
- form_view_count++;
1909
- form_view_max=i;
1910
- }
1911
- }
1912
-
1913
- if(form_view_count>1)
1914
- {
1915
- for(i=1; i<=form_view_max; i++)
1916
- {
1917
- if(document.getElementById('form_id_tempform_view'+i))
1918
- {
1919
- first_form_view=i;
1920
- break;
1921
- }
1922
- }
1923
- form_view=form_view_max;
1924
-
1925
- generate_page_nav(first_form_view);
1926
-
1927
- var img_EDIT = document.createElement("img");
1928
- img_EDIT.setAttribute("src", "<?php echo plugins_url('',__FILE__) ?>/images/edit.png");
1929
- img_EDIT.style.cssText = "margin-left:40px; cursor:pointer";
1930
- img_EDIT.setAttribute("onclick", 'el_page_navigation()');
1931
-
1932
- var td_EDIT = document.getElementById("edit_page_navigation");
1933
- td_EDIT.appendChild(img_EDIT);
1934
-
1935
- document.getElementById('page_navigation').appendChild(td_EDIT);
1936
-
1937
-
1938
- }
1939
-
1940
-
1941
- //if(document.getElementById('take').innerHTML.indexOf('up_row(')==-1) location.reload(true);
1942
- //else
1943
- document.getElementById('form').value=document.getElementById('take').innerHTML;
1944
- document.getElementById('araqel').value=1;
1945
-
1946
- }
1947
-
1948
- function formAddToOnload()
1949
- {
1950
- if(formOldFunctionOnLoad){ formOldFunctionOnLoad(); }
1951
- formOnload();
1952
- }
1953
-
1954
- function formLoadBody()
1955
- {
1956
- formOldFunctionOnLoad = window.onload;
1957
- window.onload = formAddToOnload;
1958
- }
1959
-
1960
- var formOldFunctionOnLoad = null;
1961
-
1962
- formLoadBody();
1963
-
1964
-
1965
- </script>
1966
-
1967
- <input type="hidden" name="option" value="com_formmaker" />
1968
-
1969
- <input type="hidden" name="id" value="<?php echo $row->id?>" />
1970
-
1971
- <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
1972
-
1973
- <input type="hidden" name="task" value="" />
1974
- <input type="hidden" id="araqel" value="0" />
1975
-
1976
- </form>
1977
-
1978
- <script>
1979
- plugin_url=document.getElementById('form_plugins_url').value;
1980
- appWidth =parseInt(document.body.offsetWidth);
1981
- appHeight =parseInt(document.body.offsetHeight);
1982
- // document.getElementById('toolbar-popup-popup').childNodes[1].href='index.php?option=com_formmaker&task=preview&tmpl=component&theme='+document.getElementById('theme').value;
1983
- // document.getElementById('toolbar-popup-popup').childNodes[1].setAttribute('rel',"{handler: 'iframe', size: {x:"+(appWidth-100)+", y: "+(appHeight-30)+"}}");
1984
- </script>
1985
- <?php
1986
-
1987
-
1988
-
1989
-
1990
-
1991
-
1992
-
1993
- }
1994
-
1995
-
1996
-
1997
-
1998
-
1999
-
2000
-
2001
-
2002
-
2003
-
2004
-
2005
-
2006
-
2007
-
2008
-
2009
-
2010
-
2011
-
2012
-
2013
-
2014
-
2015
-
2016
-
2017
- function html_Actions_after_submission($row){
2018
- $value="";
2019
- ?>
2020
-
2021
- <script language="javascript" type="text/javascript">
2022
- function remove_article()
2023
- {
2024
- document.getElementById('id_name').value="Select an Article";
2025
- document.getElementById('article_id').value="";
2026
- }
2027
- function set_type(type)
2028
- {
2029
- switch(type)
2030
- {
2031
- case 'post':
2032
- document.getElementById('post').removeAttribute('style');
2033
- document.getElementById('page').setAttribute('style','display:none');
2034
- document.getElementById('custom').setAttribute('style','display:none');
2035
- document.getElementById('url').setAttribute('style','display:none');
2036
- document.getElementById('none').setAttribute('style','display:none');
2037
- break;
2038
-
2039
- case 'page':
2040
- document.getElementById('page').removeAttribute('style');
2041
- document.getElementById('post').setAttribute('style','display:none');
2042
- document.getElementById('custom').setAttribute('style','display:none');
2043
- document.getElementById('url').setAttribute('style','display:none');
2044
- document.getElementById('none').setAttribute('style','display:none');
2045
- break;
2046
-
2047
- case 'custom':
2048
- document.getElementById('page').setAttribute('style','display:none');
2049
- document.getElementById('post').setAttribute('style','display:none');
2050
- document.getElementById('custom').removeAttribute('style');
2051
- document.getElementById('url').setAttribute('style','display:none');
2052
- document.getElementById('none').setAttribute('style','display:none');
2053
- break;
2054
-
2055
- case 'url':
2056
- document.getElementById('page').setAttribute('style','display:none');
2057
- document.getElementById('post').setAttribute('style','display:none');
2058
- document.getElementById('custom').setAttribute('style','display:none');
2059
- document.getElementById('url').removeAttribute('style');
2060
- document.getElementById('none').setAttribute('style','display:none');
2061
- break;
2062
-
2063
- case 'none':
2064
- document.getElementById('page').setAttribute('style','display:none');
2065
- document.getElementById('post').setAttribute('style','display:none');
2066
- document.getElementById('custom').setAttribute('style','display:none');
2067
- document.getElementById('url').setAttribute('style','display:none');
2068
- document.getElementById('none').removeAttribute('style');
2069
- break;
2070
- }
2071
- }
2072
- function submit_in(pressbutton){
2073
-
2074
-
2075
- document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
2076
- document.getElementById('adminForm').submit();
2077
-
2078
- }
2079
- </script>
2080
-
2081
- <style>
2082
- .borderer
2083
- {
2084
- border-radius:5px;
2085
- padding-left:5px;
2086
- background-color:#F0F0F0;
2087
- height:19px;
2088
- width:153px;
2089
- }
2090
- </style>
2091
- <table width="95%">
2092
- <tbody>
2093
- <tr>
2094
- <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
2095
- <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="color:red; text-decoration:none;">
2096
- <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
2097
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
2098
- </a></div>
2099
- </td>
2100
- </tr><tr>
2101
- <td width="100%"><h2>Actions after submission - <?php echo $row->title; ?></h2></td>
2102
- <td align="right"><input type="button" onclick="submit_in('Save_Actions_after_submission')" value="Save" class="button-secondary action"> </td>
2103
- <td align="right"><input type="button" onclick="submit_in('Apply_Actions_after_submission')" value="Apply" class="button-secondary action"> </td>
2104
- <td align="right"><input type="button" onclick="window.location.href='admin.php?page=contact_form&task=edit_form&id=<?php echo $row->id; ?>'" value="Cancel" class="button-secondary action"> </td>
2105
- </tr>
2106
- </tbody></table>
2107
- <br />
2108
- <form action="admin.php?page=contact_form&id=<?php echo $row->id; ?>" id="adminForm" method="post" name="adminForm">
2109
- <table >
2110
- <tr valign="top">
2111
- <td class="key">
2112
- <label for="submissioni text"> Action type: </label>
2113
- </td>
2114
- <td>
2115
- <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/>
2116
- <input type="radio" name="submit_text_type" onclick="set_type('post')" value="2" <?php if($row->submit_text_type==2 ) echo "checked" ?> /> Post<br/>
2117
- <input type="radio" name="submit_text_type" onclick="set_type('page')" value="5" <?php if($row->submit_text_type==5 ) echo "checked" ?> /> Page<br/>
2118
- <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/>
2119
- <input type="radio" name="submit_text_type" onclick="set_type('url')" value="4" <?php if($row->submit_text_type==4 ) echo "checked" ?> /> URL
2120
- </td>
2121
- </tr>
2122
- <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"' ?> >
2123
- <td class="key">
2124
- <label for="submissioni text"> Stay on form </label>
2125
- </td>
2126
- <td >
2127
- <img src="<?php echo plugins_url("images/tick.png",__FILE__) ?>" border="0">
2128
- </td>
2129
- </tr>
2130
- <tr id="post" <?php if($row->submit_text_type!=2) echo 'style="display:none"' ?> >
2131
- <td class="key">
2132
- <label for="submissioni text"> Post </label>
2133
- </td>
2134
- <td >
2135
- <select name="post_name" style="width:153px; font-size:11px;">
2136
- <option value="0">- Select Post -</option>
2137
- <?php
2138
- // The Loop
2139
- query_posts('');
2140
- while ( have_posts() ) : the_post(); ?>
2141
- <option value="<?php $x=get_permalink(get_the_ID()); echo $x; ?>" <?php if($row->article_id==$x){echo ' selected="selected"';} ?>> <?php the_title(); ?> </option>
2142
- <?php
2143
- endwhile;
2144
-
2145
- // Reset Query
2146
- wp_reset_query();
2147
-
2148
- ?>
2149
- </select>
2150
-
2151
- </td>
2152
- </tr>
2153
- <tr id="page" <?php if($row->submit_text_type!=5) echo 'style="display:none"' ?> >
2154
- <td class="key">
2155
- <label for="submissioni text"> Page </label>
2156
- </td>
2157
- <td >
2158
- <select name="page_name" style="width:153px; font-size:11px;">
2159
- <option value="0">- Select Page -</option>
2160
- <?php
2161
-
2162
- // The Query
2163
- $pages = get_pages();
2164
-
2165
- // The Loop
2166
- foreach ( $pages as $page ) {?>
2167
- <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>
2168
- <?php
2169
- }
2170
-
2171
- // Reset Query
2172
- wp_reset_query();
2173
-
2174
- ?>
2175
- </select>
2176
-
2177
- </td>
2178
- </tr>
2179
-
2180
-
2181
-
2182
-
2183
- <tr <?php if($row->submit_text_type!=3 ) echo 'style="display:none"' ?> id="custom">
2184
- <td class="key">
2185
- <label for="submissioni text"> Text </label>
2186
- </td>
2187
- <td >
2188
- <div style="height:300px;text-align:left" id="poststuff">
2189
- <?php if(get_bloginfo('version')<'3.3'){ ?>
2190
- <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 ); ?>
2191
- <?php }else { wp_editor($row->submit_text,"content");}?>
2192
- </div>
2193
- </div>
2194
- </td>
2195
- </tr>
2196
- <tr <?php if($row->submit_text_type!=4 ) echo 'style="display:none"' ?> id="url">
2197
- <td class="key">
2198
- <label for="submissioni text"> URL </label>
2199
- </td>
2200
- <td >
2201
- <input type="text" id="url" name="url" style="width:300px" value="<?php echo $row->url ?>" />
2202
- </td>
2203
- </tr>
2204
- </table>
2205
- <input type="hidden" name="option" value="com_formmaker" />
2206
- <input type="hidden" name="id" value="<?php echo $row->id?>" />
2207
- <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
2208
- <input type="hidden" name="task" value="" />
2209
- </form>
2210
-
2211
- <?php
2212
-
2213
-
2214
- }
2215
-
2216
-
2217
-
2218
-
2219
-
2220
-
2221
-
2222
-
2223
-
2224
-
2225
-
2226
-
2227
-
2228
-
2229
-
2230
-
2231
-
2232
-
2233
-
2234
-
2235
-
2236
- function html_Edit_JavaScript($row){
2237
-
2238
- ?>
2239
- <script type="text/javascript" language="javascript">
2240
- function submit_in(pressbutton){
2241
-
2242
-
2243
- document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
2244
- document.getElementById('adminForm').submit();
2245
-
2246
- }
2247
- </script>
2248
-
2249
- <table width="95%">
2250
- <tbody>
2251
- <tr>
2252
- <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
2253
- <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="color:red; text-decoration:none;">
2254
- <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
2255
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
2256
- </a></div>
2257
- </td>
2258
- </tr><tr>
2259
- <td width="100%"><h2>Edit JavaScript - <?php echo $row->title; ?></h2></td>
2260
- <td align="right"><input type="button" onclick="submit_in('Save_Edit_JavaScript')" value="Save" class="button-secondary action"> </td>
2261
- <td align="right"><input type="button" onclick="submit_in('Apply_Edit_JavaScript')" value="Apply" class="button-secondary action"> </td>
2262
- <td align="right"><input type="button" onclick="window.location.href='admin.php?page=contact_form&task=edit_form&id=<?php echo $row->id; ?>'" value="Cancel" class="button-secondary action"> </td>
2263
- </tr>
2264
- </tbody></table>
2265
- <br />
2266
- <form action="admin.php?page=contact_form&id=<?php echo $row->id; ?>" id="adminForm" method="post" name="adminForm">
2267
- <table class="adminform">
2268
-
2269
- <tr>
2270
-
2271
- <th>
2272
-
2273
- <label for="message"> Javascript </label>
2274
-
2275
- </th>
2276
-
2277
- </tr>
2278
-
2279
- <tr>
2280
-
2281
- <td >
2282
-
2283
- <textarea style="margin: 0px;" cols="110" rows="25" name="javascript" id="css" ><?php echo $row->javascript; ?></textarea>
2284
-
2285
- </td>
2286
-
2287
- </tr>
2288
-
2289
- </table>
2290
- </form>
2291
- <?php
2292
-
2293
-
2294
- }
2295
-
2296
-
2297
-
2298
-
2299
-
2300
-
2301
-
2302
-
2303
-
2304
-
2305
-
2306
-
2307
-
2308
-
2309
-
2310
-
2311
-
2312
- function html_Custom_text_in_email_for_administrator($row){
2313
-
2314
-
2315
-
2316
-
2317
-
2318
- ?>
2319
- <script type="text/javascript" language="javascript">
2320
- function submit_in(pressbutton){
2321
-
2322
-
2323
- document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
2324
- document.getElementById('adminForm').submit();
2325
-
2326
- }
2327
- </script>
2328
-
2329
- <table width="95%">
2330
- <tbody> <tr>
2331
- <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
2332
- <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="color:red; text-decoration:none;">
2333
- <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
2334
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
2335
- </a></div>
2336
- </td>
2337
- </tr><tr>
2338
- <td width="100%"><h2>Text for Administrator - <?php echo $row->title; ?></h2></td>
2339
- <td align="right"><input type="button" onclick="submit_in('Save_Custom_text_in_email_for_administrator')" value="Save" class="button-secondary action"> </td>
2340
- <td align="right"><input type="button" onclick="submit_in('Apply_Custom_text_in_email_for_administrator')" value="Apply" class="button-secondary action"> </td>
2341
- <td align="right"><input type="button" onclick="window.location.href='admin.php?page=contact_form&task=edit_form&id=<?php echo $row->id; ?>'" value="Cancel" class="button-secondary action"> </td>
2342
- </tr>
2343
- </tbody></table>
2344
- <br />
2345
- <form action="admin.php?page=contact_form&id=<?php echo $row->id; ?>" id="adminForm" method="post" name="adminForm">
2346
- <table width="95%" style="border-color:#000; border:medium;" >
2347
-
2348
- <tbody>
2349
- <tr>
2350
-
2351
- <th style="text-align:left">
2352
-
2353
- <label for="message" style="text-align:left"> Text before Message </label>
2354
- <br />
2355
- </th>
2356
- </tr>
2357
- <tr>
2358
-
2359
- <td style="width:95%; min-width:500px"><?php if(function_exists('the_editor') || function_exists('wp_editor')){if(get_bloginfo('version')<'3.3'){ the_editor ( $row->script1, $idd = 'script1', $prev_id = 'Mail_script1', $media_buttons = true, $tab_index = 1, $extended = true );} else wp_editor($row->script1, $idd = 'script1') ;} else {?>
2360
-
2361
- <textarea style="width:100%" name="script1" id><?php echo $row->script1 ?></textarea>
2362
- <?php } ?>
2363
- <br />
2364
- </td>
2365
- </tr>
2366
- <tr>
2367
- <td>
2368
- <hr />
2369
- <h2 align="center">MESSAGE</h2>
2370
- <hr />
2371
- <br />
2372
- </td>
2373
- </tr>
2374
- <tr>
2375
-
2376
- <th style="text-align:left">
2377
-
2378
- <label for="message" style="text-align:left"> Text after Message </label>
2379
- <br />
2380
- </th>
2381
- </tr>
2382
- <tr>
2383
-
2384
- <td style="width:70%; min-width:500px"><?php if(function_exists('the_editor') || function_exists('wp_editor')){ if(get_bloginfo('version')<'3.3' ){the_editor ( $row->script2, $idd = 'script2', $prev_id = 'Mail_title2', $media_buttons = true, $tab_index = 2, $extended = true );}else wp_editor($row->script2, $idd = 'script2');}else { ?>
2385
-
2386
- <textarea style="width:100%" name="script2"><?php echo $row->script2 ?></textarea>
2387
- <?php } ?></td>
2388
- </tr>
2389
- </tbody>
2390
- </table>
2391
-
2392
- </form>
2393
- <?php
2394
-
2395
-
2396
-
2397
-
2398
-
2399
-
2400
-
2401
-
2402
-
2403
- }
2404
-
2405
-
2406
-
2407
-
2408
-
2409
-
2410
-
2411
-
2412
-
2413
-
2414
-
2415
- function html_Custom_text_in_email_for_user($row){
2416
-
2417
-
2418
-
2419
-
2420
-
2421
- ?>
2422
- <script type="text/javascript" language="javascript">
2423
- function submit_in(pressbutton){
2424
-
2425
-
2426
- document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
2427
- document.getElementById('adminForm').submit();
2428
-
2429
- }
2430
- </script>
2431
-
2432
- <table width="95%">
2433
- <tbody> <tr>
2434
- <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
2435
- <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="color:red; text-decoration:none;">
2436
- <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
2437
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
2438
- </a></div>
2439
- </td>
2440
- </tr><tr>
2441
- <td width="100%"><h2>Text for User - <?php echo $row->title; ?></h2></td>
2442
- <td align="right"><input type="button" onclick="submit_in('Save_Custom_text_in_email_for_user')" value="Save" class="button-secondary action"> </td>
2443
- <td align="right"><input type="button" onclick="submit_in('Apply_Custom_text_in_email_for_user')" value="Apply" class="button-secondary action"> </td>
2444
- <td align="right"><input type="button" onclick="window.location.href='admin.php?page=contact_form&task=edit_form&id=<?php echo $row->id; ?>'" value="Cancel" class="button-secondary action"> </td>
2445
- </tr>
2446
- </tbody></table>
2447
- <br />
2448
- <form action="admin.php?page=contact_form&id=<?php echo $row->id; ?>" id="adminForm" method="post" name="adminForm">
2449
- <table width="95%" style="border-color:#000; border:medium;" >
2450
-
2451
- <tbody>
2452
- <tr>
2453
-
2454
- <th style="text-align:left">
2455
-
2456
- <label for="message" style="text-align:left"> Text before Message </label>
2457
- <br />
2458
- </th>
2459
- </tr>
2460
- <tr>
2461
-
2462
- <td style="width:95%; min-width:500px"><?php if(function_exists('wp_editor') || function_exists('the_editor')){if(get_bloginfo('version')<'3.3'){ the_editor ( $row->script_user1, $idd = 'script_user1', $prev_id = 'Mail_script1', $media_buttons = true, $tab_index = 1, $extended = true );} else wp_editor($row->script_user1, $idd = 'script_user1');} else {?>
2463
-
2464
- <textarea style="width:100%" name="script_user1" id><?php echo $row->script_user1 ?></textarea>
2465
- <?php } ?>
2466
- <br />
2467
- </td>
2468
- </tr>
2469
- <tr>
2470
- <td>
2471
- <hr />
2472
- <h2 align="center">MESSAGE</h2>
2473
- <hr />
2474
- <br />
2475
- </td>
2476
- </tr>
2477
- <tr>
2478
-
2479
- <th style="text-align:left">
2480
-
2481
- <label for="message" style="text-align:left"> Text after Message </label>
2482
- <br />
2483
- </th>
2484
- </tr>
2485
- <tr>
2486
-
2487
- <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 wp_editor($row->script_user2, $idd = 'script_user2');}else { ?>
2488
-
2489
- <textarea style="width:100%" name="script_user2"><?php echo $row->script_user2 ?></textarea>
2490
- <?php } ?></td>
2491
- </tr>
2492
- </tbody>
2493
- </table>
2494
-
2495
- </form>
2496
- <?php
2497
-
2498
-
2499
-
2500
-
2501
-
2502
-
2503
-
2504
-
2505
-
2506
- }
1
+ <?php
2
+
3
+
4
+
5
+ if(!current_user_can('manage_options')) {
6
+ die('Access Denied');
7
+ }
8
+ function html_display_form_lists($rows, $pageNav, $sort,$old_version){
9
+
10
+
11
+
12
+ global $wpdb;
13
+ ?>
14
+ <script language="javascript">
15
+ function confirmation(href,title) {
16
+ var answer = confirm("Are you sure you want to delete '"+title+"'?")
17
+ if (answer){
18
+ document.getElementById('admin_form').action=href;
19
+ document.getElementById('admin_form').submit();
20
+ }
21
+ }
22
+ function ordering(name,as_or_desc)
23
+ {
24
+ document.getElementById('asc_or_desc').value=as_or_desc;
25
+ document.getElementById('order_by').value=name;
26
+ document.getElementById('admin_form').submit();
27
+ }
28
+ function doNothing() {
29
+ var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
30
+ if( keyCode == 13 ) {
31
+
32
+
33
+ if(!e) var e = window.event;
34
+
35
+ e.cancelBubble = true;
36
+ e.returnValue = false;
37
+
38
+ if (e.stopPropagation) {
39
+ e.stopPropagation();
40
+ e.preventDefault();
41
+ }
42
+ }
43
+ }
44
+ </script>
45
+ <form method="post" onkeypress="doNothing()" action="admin.php?page=contact_form" id="admin_form" name="admin_form">
46
+ <table cellspacing="10" width="95%">
47
+ <tr>
48
+ <td style="width:50px">
49
+ <img src="<?php echo plugins_url("images/formmakerLogo-48.png",__FILE__); ?>" />
50
+ </td>
51
+ <td style="width:140px;">
52
+ <h2 style="vertical-align:top;">Contact Form</h2> </td>
53
+ <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=contact_form&task=add_form'" /></td>
54
+ <?php if($old_version) {?> <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=contact_form&task=update'" /></td><?php }?>
55
+ <td style="text-align:right;font-size:16px;padding:20px; padding-right:50px">
56
+ <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
57
+ <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="color:red; text-decoration:none;">
58
+ <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
59
+ Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
60
+ </a>
61
+ </td>
62
+ </tr>
63
+ </table>
64
+ <?php
65
+ $serch_value="";
66
+ if(isset($_POST['serch_or_not'])) {if(esc_html($_POST['serch_or_not'])=="search"){ $serch_value=esc_html($_POST['search_events_by_title']); }else{$serch_value="";}}
67
+ $serch_fields='<div class="alignleft actions" style="width:180px;">
68
+ <label for="search_events_by_title" style="font-size:14px">Title: </label>
69
+ <input type="text" name="search_events_by_title" value="'.$serch_value.'" id="search_events_by_title" onchange="clear_serch_texts()">
70
+ </div>
71
+ <div class="alignleft actions">
72
+ <input type="button" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\'; document.getElementById(\'serch_or_not\').value=\'search\';
73
+ document.getElementById(\'admin_form\').submit();" class="button-secondary action">
74
+ <input type="button" value="Reset" onclick="window.location.href=\'admin.php?page=contact_form\'" class="button-secondary action">
75
+ </div>';
76
+ print_html_nav($pageNav['total'],$pageNav['limit'],$serch_fields);
77
+
78
+ ?>
79
+ <table class="wp-list-table widefat fixed pages" style="width:95%">
80
+ <thead>
81
+ <TR>
82
+ <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>
83
+ <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>
84
+ <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>
85
+ <th style="width:80px">Edit</th>
86
+ <th style="width:80px">Delete</th>
87
+ </TR>
88
+ </thead>
89
+ <tbody>
90
+ <?php for($i=0; $i<count($rows);$i++){ ?>
91
+ <tr>
92
+ <?php
93
+ $old_version = false;
94
+ if(strpos($rows[$i]->form, "wdform_table1")===false)
95
+ {
96
+ $old_version = true;
97
+ }
98
+ ?>
99
+
100
+
101
+
102
+ <td><?php if(!$old_version) { ?><a href="admin.php?page=contact_form&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>
103
+ <td><?php if(!$old_version) { ?><a href="admin.php?page=contact_form&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>
104
+ <td><?php echo $rows[$i]->mail; ?></td>
105
+ <td><?php if(!$old_version) { ?><a href="admin.php?page=contact_form&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>
106
+ <td><a href="javascript:confirmation('admin.php?page=contact_form&task=remove_form&id=<?php echo $rows[$i]->id?>','<?php echo $rows[$i]->title; ?>')">Delete</a></td>
107
+ </tr>
108
+ <?php } ?>
109
+ </tbody>
110
+ </table>
111
+ <input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if(isset($_POST['asc_or_desc'])) echo esc_html($_POST['asc_or_desc']);?>" />
112
+ <input type="hidden" name="order_by" id="order_by" value="<?php if(isset($_POST['order_by'])) echo esc_html($_POST['order_by']);?>" />
113
+
114
+ <?php
115
+ ?>
116
+
117
+
118
+
119
+ </form>
120
+ <?php
121
+
122
+
123
+
124
+
125
+
126
+ }
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+ function html_add_form($themes){
138
+ ?>
139
+
140
+ <script type="text/javascript">
141
+
142
+
143
+ function refresh_()
144
+ {
145
+
146
+ document.getElementById('form').value=document.getElementById('take').innerHTML;
147
+ document.getElementById('counter').value=gen;
148
+
149
+
150
+
151
+
152
+
153
+ n=gen;
154
+ for(i=0; i<n; i++)
155
+ {
156
+ if(document.getElementById(i))
157
+ {
158
+ for(z=0; z<document.getElementById(i).childNodes.length; z++)
159
+ if(document.getElementById(i).childNodes[z].nodeType==3)
160
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
161
+
162
+ if(document.getElementById(i).getAttribute('type')=="type_captcha" || document.getElementById(i).getAttribute('type')=="type_recaptcha")
163
+ {
164
+ if(document.getElementById(i).childNodes[10])
165
+ {
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
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
173
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
174
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
175
+ }
176
+ else
177
+ {
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
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
184
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
185
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
186
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
187
+ }
188
+ continue;
189
+ }
190
+
191
+ if(document.getElementById(i).getAttribute('type')=="type_section_break")
192
+ {
193
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
194
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
195
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
196
+ continue;
197
+ }
198
+
199
+
200
+ if(document.getElementById(i).childNodes[10])
201
+ {
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
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
210
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
211
+ }
212
+ else
213
+ {
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
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
222
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
223
+ }
224
+ }
225
+ }
226
+
227
+ for(i=0; i<=n; i++)
228
+ {
229
+ if(document.getElementById(i))
230
+ {
231
+ type=document.getElementById(i).getAttribute("type");
232
+ switch(type)
233
+ {
234
+ case "type_text":
235
+ case "type_number":
236
+ case "type_password":
237
+ case "type_submitter_mail":
238
+ case "type_own_select":
239
+ case "type_country":
240
+ case "type_hidden":
241
+ case "type_map":
242
+ {
243
+ remove_add_(i+"_elementform_id_temp");
244
+ break;
245
+ }
246
+
247
+ case "type_submit_reset":
248
+ {
249
+ remove_add_(i+"_element_submitform_id_temp");
250
+ if(document.getElementById(i+"_element_resetform_id_temp"))
251
+ remove_add_(i+"_element_resetform_id_temp");
252
+ break;
253
+ }
254
+
255
+ case "type_captcha":
256
+ {
257
+ remove_add_("_wd_captchaform_id_temp");
258
+ remove_add_("_element_refreshform_id_temp");
259
+ remove_add_("_wd_captcha_inputform_id_temp");
260
+ break;
261
+ }
262
+
263
+ case "type_recaptcha":
264
+ {
265
+ document.getElementById("public_key").value = document.getElementById("wd_recaptchaform_id_temp").getAttribute("public_key");
266
+ document.getElementById("private_key").value= document.getElementById("wd_recaptchaform_id_temp").getAttribute("private_key");
267
+ document.getElementById("recaptcha_theme").value= document.getElementById("wd_recaptchaform_id_temp").getAttribute("theme");
268
+ document.getElementById('wd_recaptchaform_id_temp').innerHTML='';
269
+ remove_add_("wd_recaptchaform_id_temp");
270
+ break;
271
+ }
272
+
273
+ case "type_file_upload":
274
+ {
275
+ remove_add_(i+"_elementform_id_temp");
276
+ break;
277
+ }
278
+
279
+ case "type_textarea":
280
+ {
281
+ remove_add_(i+"_elementform_id_temp");
282
+
283
+ break;
284
+ }
285
+
286
+ case "type_name":
287
+ {
288
+
289
+ if(document.getElementById(i+"_element_titleform_id_temp"))
290
+ {
291
+ remove_add_(i+"_element_titleform_id_temp");
292
+ remove_add_(i+"_element_firstform_id_temp");
293
+ remove_add_(i+"_element_lastform_id_temp");
294
+ remove_add_(i+"_element_middleform_id_temp");
295
+ }
296
+ else
297
+ {
298
+ remove_add_(i+"_element_firstform_id_temp");
299
+ remove_add_(i+"_element_lastform_id_temp");
300
+
301
+ }
302
+ break;
303
+
304
+ }
305
+
306
+ case "type_phone":
307
+ {
308
+
309
+ remove_add_(i+"_element_firstform_id_temp");
310
+ remove_add_(i+"_element_lastform_id_temp");
311
+
312
+ break;
313
+
314
+ }
315
+ case "type_address":
316
+ {
317
+ remove_add_(i+"_street1form_id_temp");
318
+ remove_add_(i+"_street2form_id_temp");
319
+ remove_add_(i+"_cityform_id_temp");
320
+ remove_add_(i+"_stateform_id_temp");
321
+ remove_add_(i+"_postalform_id_temp");
322
+ remove_add_(i+"_countryform_id_temp");
323
+
324
+ break;
325
+
326
+ }
327
+
328
+
329
+ case "type_checkbox":
330
+ case "type_radio":
331
+ {
332
+ is=true;
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
+ /* if(document.getElementById(i+"_randomize").value=="yes")
339
+ choises_randomize(i);*/
340
+
341
+ break;
342
+ }
343
+
344
+ case "type_button":
345
+ {
346
+ for(j=0; j<100; j++)
347
+ if(document.getElementById(i+"_elementform_id_temp"+j))
348
+ {
349
+ remove_add_(i+"_elementform_id_temp"+j);
350
+ }
351
+ break;
352
+ }
353
+
354
+ case "type_time":
355
+ {
356
+ if(document.getElementById(i+"_ssform_id_temp"))
357
+ {
358
+ remove_add_(i+"_ssform_id_temp");
359
+ remove_add_(i+"_mmform_id_temp");
360
+ remove_add_(i+"_hhform_id_temp");
361
+ }
362
+ else
363
+ {
364
+ remove_add_(i+"_mmform_id_temp");
365
+ remove_add_(i+"_hhform_id_temp");
366
+ }
367
+ break;
368
+
369
+ }
370
+
371
+ case "type_date":
372
+ {
373
+ remove_add_(i+"_elementform_id_temp");
374
+ remove_add_(i+"_buttonform_id_temp");
375
+ break;
376
+ }
377
+ case "type_date_fields":
378
+ {
379
+ remove_add_(i+"_dayform_id_temp");
380
+ remove_add_(i+"_monthform_id_temp");
381
+ remove_add_(i+"_yearform_id_temp");
382
+ break;
383
+ }
384
+ }
385
+ }
386
+ }
387
+
388
+ for(i=1; i<=form_view_max; i++)
389
+ if(document.getElementById('form_id_tempform_view'+i))
390
+ {
391
+ if(document.getElementById('page_next_'+i))
392
+ document.getElementById('page_next_'+i).removeAttribute('src');
393
+ if(document.getElementById('page_previous_'+i))
394
+ document.getElementById('page_previous_'+i).removeAttribute('src');
395
+ document.getElementById('form_id_tempform_view'+i).parentNode.removeChild(document.getElementById('form_id_tempform_view_img'+i));
396
+ document.getElementById('form_id_tempform_view'+i).removeAttribute('style');
397
+ }
398
+
399
+ document.getElementById('form_front').value=document.getElementById('take').innerHTML;
400
+
401
+ }
402
+
403
+ function submitform( pressbutton ){
404
+
405
+ document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
406
+ document.getElementById('adminForm').submit();
407
+
408
+ }
409
+
410
+
411
+
412
+
413
+
414
+ function submitbutton(pressbutton){
415
+
416
+ var form = document.adminForm;
417
+ if (pressbutton == 'cancel')
418
+ {
419
+ submitform( pressbutton );
420
+ return;
421
+ }
422
+
423
+ if (form.title.value == "")
424
+ {
425
+ alert( "The form must have a title." );
426
+ return ;
427
+ }
428
+
429
+ if(form.mail.value!='')
430
+ {
431
+ subMailArr=form.mail.value.split(',');
432
+ emailListValid=true;
433
+ for(subMailIt=0; subMailIt<subMailArr.length; subMailIt++)
434
+ {
435
+ trimmedMail = subMailArr[subMailIt].replace(/^\s+|\s+$/g, '') ;
436
+ if (trimmedMail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1)
437
+ {
438
+ alert( "This is not a list of valid email addresses." );
439
+ emailListValid=false;
440
+ break;
441
+ }
442
+ }
443
+ if(!emailListValid)
444
+ return;
445
+ }
446
+
447
+ tox='';
448
+
449
+ for(t=1;t<=form_view_max;t++)
450
+ {
451
+ if(document.getElementById('form_id_tempform_view'+t))
452
+ {
453
+ form_view_element=document.getElementById('form_id_tempform_view'+t);
454
+ n=form_view_element.childNodes.length-2;
455
+
456
+ for(z=0;z<=n;z++)
457
+ {
458
+ if(form_view_element.childNodes[z].nodeType!=3)
459
+ if(!form_view_element.childNodes[z].id)
460
+ {
461
+ GLOBAL_tr=form_view_element.childNodes[z];
462
+ //////////////////////////////////////////////////////////////////////////////////////////
463
+ for (x=0; x < GLOBAL_tr.firstChild.childNodes.length; x++)
464
+ {
465
+ table=GLOBAL_tr.firstChild.childNodes[x];
466
+ tbody=table.firstChild;
467
+ for (y=0; y < tbody.childNodes.length; y++)
468
+ {
469
+ tr=tbody.childNodes[y];
470
+ l_label = document.getElementById( tr.id+'_element_labelform_id_temp').innerHTML;
471
+ l_label = l_label.replace(/(\r\n|\n|\r)/gm," ");
472
+
473
+ if(tr.getAttribute('type')=="type_address")
474
+ {
475
+ addr_id=parseInt(tr.id);
476
+ tox=tox+addr_id+'#**id**#'+'Street Line'+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
477
+ tox=tox+addr_id+'#**id**#'+'Street Line2'+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
478
+ tox=tox+addr_id+'#**id**#'+'City'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
479
+ tox=tox+addr_id+'#**id**#'+'State'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
480
+ tox=tox+addr_id+'#**id**#'+'Postal'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
481
+ tox=tox+addr_id+'#**id**#'+'Country'+'#**label**#'+tr.getAttribute('type')+'#****#';
482
+ }
483
+ else
484
+ tox=tox+tr.id+'#**id**#'+l_label+'#**label**#'+tr.getAttribute('type')+'#****#';
485
+ }
486
+ }
487
+ }
488
+ }
489
+ }
490
+ }
491
+
492
+ document.getElementById('label_order').value=tox;
493
+ refresh_();
494
+ document.getElementById('pagination').value=document.getElementById('pages').getAttribute("type");
495
+ document.getElementById('show_title').value=document.getElementById('pages').getAttribute("show_title");
496
+ document.getElementById('show_numbers').value=document.getElementById('pages').getAttribute("show_numbers");
497
+
498
+ submitform( pressbutton );
499
+
500
+ }
501
+ gen=1;
502
+ form_view=1;
503
+ form_view_max=1;
504
+ form_view_count=1;
505
+
506
+ function set_preview()
507
+ {
508
+ appWidth =parseInt(document.body.offsetWidth);
509
+ appHeight =parseInt(document.body.offsetHeight);
510
+ document.getElementById('preview_form').href='<?php echo admin_url('admin-ajax.php'); ?>?action=frommakerpreview&id='+document.getElementById('theme').value+'&TB_iframe=1';
511
+ }
512
+
513
+
514
+ //add main form id
515
+ function enable()
516
+ {
517
+ for(iiiii=0; iiiii<1000;iiiii++)
518
+ {
519
+ if(document.getElementsByTagName("iframe")[iiiii]){
520
+ if(document.getElementsByTagName("iframe")[iiiii].id=='contact_form_editor_ifr'){
521
+ id_ifr_editor=iiiii;
522
+ break;
523
+ }
524
+ }
525
+ }
526
+ alltypes=Array('customHTML','text','checkbox','radio','time_and_date','select','file_upload','captcha','map','button','page_break','section_break');
527
+ for(x=0; x<12;x++)
528
+ {
529
+ document.getElementById('img_'+alltypes[x]).src="<?php echo plugins_url("images",__FILE__) ?>/"+alltypes[x]+".png";
530
+ }
531
+
532
+ document.getElementById('formMakerDiv').style.display =(document.getElementById('formMakerDiv').style.display=='block'?'none':'block');
533
+ document.getElementById('formMakerDiv1').style.display =(document.getElementById('formMakerDiv1').style.display=='block'?'none':'block');
534
+ if(document.getElementById('formMakerDiv').offsetWidth)
535
+ document.getElementById('formMakerDiv1').style.width =(document.getElementById('formMakerDiv').offsetWidth - 60)+'px';
536
+ document.getElementById('when_edit').style.display ='none';
537
+ }
538
+
539
+ function enable2()
540
+ {
541
+ alltypes=Array('customHTML','text','checkbox','radio','time_and_date','select','file_upload','captcha','map','button','page_break','section_break');
542
+ for(x=0; x<12;x++)
543
+ {
544
+ document.getElementById('img_'+alltypes[x]).src="<?php echo plugins_url("images",__FILE__) ?>/"+alltypes[x]+".png";
545
+ }
546
+
547
+ document.getElementById('formMakerDiv').style.display =(document.getElementById('formMakerDiv').style.display=='block'?'none':'block');
548
+ document.getElementById('formMakerDiv1').style.display =(document.getElementById('formMakerDiv1').style.display=='block'?'none':'block');
549
+ if(document.getElementById('formMakerDiv').offsetWidth)
550
+ document.getElementById('formMakerDiv1').style.width =(document.getElementById('formMakerDiv').offsetWidth - 60)+'px';
551
+ document.getElementById('when_edit').style.display ='block';
552
+ if(document.getElementById('field_types').offsetWidth)
553
+ document.getElementById('when_edit').style.width =document.getElementById('field_types').offsetWidth+'px';
554
+
555
+ if(document.getElementById('field_types').offsetHeight)
556
+ document.getElementById('when_edit').style.height =document.getElementById('field_types').offsetHeight+'px';
557
+
558
+ }
559
+
560
+
561
+
562
+ var thickDims, tbWidth, tbHeight;
563
+ jQuery(document).ready(function($) {
564
+
565
+ thickDims = function() {
566
+ var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
567
+
568
+ w = (tbWidth && tbWidth < W - 90) ? tbWidth : W - 40;
569
+ h = (tbHeight && tbHeight < H - 60) ? tbHeight : H - 40;
570
+
571
+ if ( tbWindow.size() ) {
572
+ tbWindow.width(w).height(h);
573
+ $('#TB_iframeContent').width(w).height(h - 27);
574
+ tbWindow.css({'margin-left': '-' + parseInt((w / 2),10) + 'px'});
575
+ if ( typeof document.body.style.maxWidth != 'undefined' )
576
+ tbWindow.css({'top':(H-h)/2,'margin-top':'0'});
577
+ }
578
+ };
579
+
580
+ thickDims();
581
+ $(window).resize( function() { thickDims() } );
582
+
583
+ $('a.thickbox-preview').click( function() {
584
+ tb_click.call(this);
585
+
586
+ var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text;
587
+
588
+ if ( tbWidth = href.match(/&tbWidth=[0-9]+/) )
589
+ tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
590
+ else
591
+ tbWidth = $(window).width() - 120;
592
+
593
+ if ( tbHeight = href.match(/&tbHeight=[0-9]+/) )
594
+ tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
595
+ else
596
+ tbHeight = $(window).height() - 120;
597
+
598
+ if ( alink.length ) {
599
+ url = alink.attr('href') || '';
600
+ text = alink.attr('title') || '';
601
+ link = '&nbsp; <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
602
+ } else {
603
+ text = $(this).attr('title') || '';
604
+ link = '&nbsp; <span class="tb-theme-preview-link">' + text + '</span>';
605
+ }
606
+
607
+ $('#TB_title').css({'background-color':'#222','color':'#dfdfdf'});
608
+ $('#TB_closeAjaxWindow').css({'float':'left'});
609
+ $('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
610
+
611
+ $('#TB_iframeContent').width('100%');
612
+ thickDims();
613
+
614
+ return false;
615
+ } );
616
+
617
+ // Theme details
618
+ $('.theme-detail').click(function () {
619
+ $(this).siblings('.themedetaildiv').toggle();
620
+ return false;
621
+ });
622
+
623
+ });
624
+
625
+ </script>
626
+ <style>
627
+ .calendar .button
628
+ {
629
+ display:table-cell !important;
630
+ }
631
+ #when_edit
632
+ {
633
+ position:absolute;
634
+ background-color:#666;
635
+ z-index:101;
636
+ display:none;
637
+ width:100%;
638
+ height:100%;
639
+ opacity: 0.7;
640
+ filter: alpha(opacity = 70);
641
+ }
642
+ #formMakerDiv
643
+ {
644
+ position:fixed;
645
+ background-color:#666;
646
+ z-index:100;
647
+ display:none;
648
+ left:0;
649
+ top:0;
650
+ width:100%;
651
+ height:100%;
652
+ opacity: 0.7;
653
+ filter: alpha(opacity = 70);
654
+ }
655
+ #formMakerDiv1
656
+ {
657
+ padding-top:20px;
658
+ position:fixed;
659
+ z-index:100;
660
+ background-color:transparent;
661
+ top:0;
662
+ left:0;
663
+ display:none;
664
+ margin-left:30px;
665
+ margin-top:15px;
666
+ }
667
+ </style>
668
+ <?php
669
+ foreach($themes as $theme)
670
+ {
671
+ if($theme->default == 1 )
672
+ {
673
+ $my_selected_theme=$theme->id;
674
+
675
+ }
676
+
677
+ }
678
+ ?>
679
+ <table width="95%">
680
+ <tr>
681
+ <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
682
+ <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="color:red; text-decoration:none;">
683
+ <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
684
+ Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
685
+ </a></div>
686
+ </td>
687
+ </tr>
688
+ <tr>
689
+ <td width="100%" ><?php echo "<h2>Contact Form</h2>"; ?></td>
690
+ <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>
691
+ <td><input type="button" onclick="submitbutton('Actions_after_submission')" value="Actions after submission" class="button-primary" /> </td>
692
+ <td> <input type="button" onclick="submitbutton('Edit_JavaScript')" value="Edit JavaScript" class="button-primary" /> </td>
693
+ <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>
694
+ <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>
695
+ <td align="right"><input type="button" onclick="submitbutton('Save')" value="Save" class="button-secondary action" /> </td>
696
+ <td align="right"><input type="button" onclick="submitbutton('Apply')" value="Apply" class="button-secondary action"/> </td>
697
+ <td align="right"><input type="button" onclick="window.location.href='admin.php?page=contact_form'" value="Cancel" class="button-secondary action" /> </td>
698
+ </tr>
699
+ </table>
700
+ <br />
701
+
702
+ <form action="admin.php?page=contact_form" method="post" id="adminForm" name="adminForm" enctype="multipart/form-data">
703
+ <table style="border:6px #00aeef solid; background-color:#00aeef " width="95%" cellpadding="0" cellspacing="0">
704
+ <tr>
705
+
706
+
707
+ <td align="left" valign="middle" rowspan="3" style="padding:10px;">
708
+ <img src="<?php echo plugins_url("images/FormMaker.png",__FILE__) ?>" />
709
+ </td>
710
+
711
+ <td width="300" align="right" valign="middle">
712
+
713
+ <span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Form title:&nbsp;&nbsp;</span>
714
+
715
+ </td>
716
+
717
+ <td width="153" height="30px" align="center" valign="middle">
718
+
719
+ <div style="background-image:url(<?php echo plugins_url("images/input.png",__FILE__) ?>); height:19px">
720
+ <input type="hidden" value="<?php echo plugins_url("",__FILE__) ?>" id="form_plugins_url" />
721
+ <input id="title" name="title" style="background:none; padding:inherit; width:151px; height:19px; border:none; font-size:11px; " />
722
+
723
+ </div>
724
+
725
+ </td>
726
+
727
+ </tr>
728
+
729
+
730
+ <tr>
731
+
732
+ <td width="300" align="right" valign="middle">
733
+
734
+ <span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Email to send submissions to:&nbsp;&nbsp;</span>
735
+
736
+ </td>
737
+
738
+ <td width="153" height="30px" align="center" valign="middle">
739
+
740
+ <div style="background-image:url(<?php echo plugins_url("images/input.png",__FILE__) ?>); height:19px">
741
+
742
+ <input id="mail" name="mail" style="background:none; padding:inherit; width:151px; height:19px; border:none; font-size:11px" />
743
+
744
+ </div>
745
+
746
+ </td>
747
+
748
+ </tr>
749
+
750
+ <tr>
751
+
752
+ <td width="300" align="right" valign="middle">
753
+
754
+ <span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Theme:&nbsp;&nbsp;</span>
755
+
756
+ </td>
757
+
758
+ <td width="153" height="30px" align="center" valign="middle">
759
+
760
+ <div style="height:19px">
761
+
762
+ <select id="theme" name="theme" style="background:transparent; width:151px; height:19px; border:none; font-size:11px" onChange="set_preview()" >
763
+
764
+ <?php
765
+ $form_theme='';
766
+ foreach($themes as $theme)
767
+ {
768
+ if($theme->default == 1 )
769
+ {
770
+ echo '<option value="'.$theme->id.'" selected>'.$theme->title.'</option>';
771
+ $form_theme=$theme->css;
772
+ }
773
+ else
774
+ echo '<option value="'.$theme->id.'">'.$theme->title.'</option>';
775
+
776
+ }
777
+ ?>
778
+ </select>
779
+
780
+ </div>
781
+
782
+ </td>
783
+
784
+ </tr>
785
+
786
+
787
+
788
+ <tr>
789
+ <td align="left" colspan="3">
790
+
791
+ <img src="<?php echo plugins_url("images/addanewfield.png",__FILE__) ?>" onclick="enable(); Enable()" style="cursor:pointer;margin:10px;" />
792
+
793
+ </td>
794
+ </tr>
795
+ </table>
796
+
797
+
798
+
799
+ <div id="formMakerDiv" onclick="close_window()"></div>
800
+
801
+ <div id="formMakerDiv1" align="center">
802
+
803
+ <table border="0" width="100%" cellpadding="0" cellspacing="0" height="100%" style="border:6px #00aeef solid; background-color:#FFF">
804
+ <tr>
805
+ <td style="padding:0px">
806
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
807
+ <tr valign="top">
808
+ <td width="15%" height="100%" style="border-right:dotted black 1px;" id="field_types">
809
+ <div id="when_edit" style="display:none"></div>
810
+ <table border="0" cellpadding="0" cellspacing="3" width="100%">
811
+ <tr>
812
+ <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>
813
+
814
+ <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>
815
+ </tr>
816
+ <tr>
817
+ <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.')" id="table_time_and_date" style="background-color: rgb(114, 113, 113) !important;" class="field_buttons"><img src="<?php echo plugins_url("images/time_and_date.png",__FILE__); ?>" style="margin:5px" id="img_time_and_date"/></td>
818
+
819
+ <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.')" id="table_select" style="background-color: rgb(114, 113, 113) !important;" class="field_buttons" ><img src="<?php echo plugins_url("images/select.png",__FILE__); ?>" style="margin:5px" id="img_select"/></td>
820
+ </tr>
821
+ <tr>
822
+ <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.')" id="table_checkbox" style="background-color: rgb(114, 113, 113) !important;" class="field_buttons"><img src="<?php echo plugins_url("images/checkbox.png",__FILE__); ?>" style="margin:5px" id="img_checkbox"/></td>
823
+
824
+ <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.')" id="table_radio" style="background-color: rgb(114, 113, 113) !important;" class="field_buttons"><img src="<?php echo plugins_url("images/radio.png",__FILE__); ?>" style="margin:5px" id="img_radio"/></td>
825
+ </tr>
826
+ <tr>
827
+ <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.')" id="table_file_upload" style="background-color: rgb(114, 113, 113) !important;" class="field_buttons"><img src="<?php echo plugins_url("images/file_upload.png",__FILE__); ?>" style="margin:5px" id="img_file_upload"/></td>
828
+
829
+ <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>
830
+ </tr>
831
+ <tr>
832
+ <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>
833
+
834
+ <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>
835
+ </tr>
836
+ <tr>
837
+ <td align="center" onClick="addRow('map')" id="table_map" class="field_buttons"><img src="<?php echo plugins_url("images/map.png",__FILE__); ?>" style="margin:5px" id="img_map"/></td>
838
+
839
+ <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>
840
+ </tr>
841
+ </table>
842
+ </td>
843
+ <td width="40%" height="100%" align="left"><div id="edit_table" style="padding:0px; overflow-y:scroll; height:531px" ></div></td>
844
+ <td align="center" valign="top" style="background:url(<?php echo plugins_url("images/border2.png",__FILE__); ?>) repeat-y;">&nbsp;</td>
845
+ <td style="padding:15px">
846
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
847
+
848
+ <tr>
849
+ <td align="right"><input type="radio" value="end" name="el_pos" checked="checked" id="pos_end" onclick="Disable()"/>
850
+ At The End
851
+ <input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
852
+ At The Beginning
853
+ <input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
854
+ Before
855
+ <select style="width:100px; margin-left:5px" id="sel_el_pos" disabled="disabled">
856
+ </select>
857
+ <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)"/>
858
+ <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()"/>
859
+
860
+ <hr style=" margin-bottom:10px" />
861
+ </td>
862
+ </tr>
863
+
864
+ <tr height="100%" valign="top">
865
+ <td id="show_table"></td>
866
+ </tr>
867
+
868
+ </table>
869
+ </td>
870
+ </tr>
871
+ </table>
872
+ </td>
873
+ </tr>
874
+ </table>
875
+ <input type="hidden" id="old" />
876
+ <input type="hidden" id="old_selected" />
877
+ <input type="hidden" id="element_type" />
878
+ <input type="hidden" id="editing_id" />
879
+ <input type="hidden" id="editing_page_break" />
880
+ <div id="main_editor" style="position:absolute; display:none; z-index:140;"><?php
881
+ if(function_exists ('the_editor') || function_exists ('wp_editor')){
882
+ if(get_bloginfo('version')<'3.3'){?>
883
+ <div style=" max-width:500px; height:300px;text-align:left" id="poststuff">
884
+ <div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea"><?php the_editor("","contact_form_editor","title",$media_buttons = true, $tab_index = 1, $extended = true ); ?>
885
+ </div>
886
+ <?php } else { echo "<style>#wp-contact_form_editor-media-buttons{ text-align:left }</style>"; wp_editor("","contact_form_editor");}?>
887
+ </div>
888
+ <?php
889
+
890
+
891
+
892
+ }
893
+ else
894
+ {
895
+ ?>
896
+ <textarea name="editor" id="editor" cols="40" rows="6" style="width: 450px; height: 350px; " class="mce_editable" aria-hidden="true"></textarea>
897
+ <?php
898
+
899
+ }
900
+ ?>
901
+
902
+
903
+ </div>
904
+
905
+ <?php if(!function_exists ('the_editor'))
906
+ ?>
907
+ <iframe id="tinymce" style="display:none"></iframe>
908
+
909
+ <?php
910
+ ?>
911
+
912
+
913
+
914
+ <br />
915
+ <br />
916
+
917
+ <fieldset>
918
+
919
+ <legend>
920
+
921
+ <h2 style="color:#00aeef">Form</h2>
922
+
923
+ </legend>
924
+
925
+ <style><?php global $first_css;
926
+ echo $first_css; ?></style>
927
+
928
+ <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>
929
+ <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>
930
+ </fieldset>
931
+
932
+ <input type="hidden" name="form_front" id="form_front" />
933
+ <input type="hidden" name="form" id="form" />
934
+
935
+ <input type="hidden" name="counter" id="counter" />
936
+
937
+ <input type="hidden" name="pagination" id="pagination" />
938
+ <input type="hidden" name="show_title" id="show_title" />
939
+ <input type="hidden" name="show_numbers" id="show_numbers" />
940
+
941
+ <input type="hidden" name="public_key" id="public_key" />
942
+ <input type="hidden" name="private_key" id="private_key" />
943
+ <input type="hidden" name="recaptcha_theme" id="recaptcha_theme" />
944
+
945
+ <input type="hidden" name="label_order" id="label_order" />
946
+ <input type="hidden" name="option" value="com_formmaker" />
947
+
948
+ <input type="hidden" name="task" value="" />
949
+
950
+ </form>
951
+
952
+ <script>
953
+ plugin_url=document.getElementById('form_plugins_url').value;
954
+ //appWidth =parseInt(document.body.offsetWidth);
955
+ //appHeight =parseInt(document.body.offsetHeight);
956
+ //document.getElementById('toolbar-popup-popup').childNodes[1].href='index.php?option=com_formmaker&task=preview&tmpl=component&theme='+document.getElementById('theme').value;
957
+ //document.getElementById('toolbar-popup-popup').childNodes[1].setAttribute('rel',"{handler: 'iframe', size: {x:"+(appWidth-100)+", y: "+(appHeight-30)+"}}");
958
+ </script>
959
+ <?php
960
+
961
+
962
+ }
963
+
964
+
965
+
966
+
967
+
968
+
969
+
970
+
971
+
972
+
973
+
974
+
975
+
976
+
977
+ function html_edit_contact_form($row, $labels, $themes){
978
+
979
+ ?>
980
+
981
+ <script type="text/javascript">
982
+
983
+
984
+
985
+ function submitform( pressbutton ){
986
+
987
+ document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
988
+ document.getElementById('adminForm').submit();
989
+
990
+ }
991
+ function submitbutton(pressbutton)
992
+
993
+ {
994
+
995
+ if(!document.getElementById('araqel'))
996
+ {
997
+ alert('Please wait while page loading');
998
+ return;
999
+ }
1000
+ else
1001
+ if(document.getElementById('araqel').value=='0')
1002
+ {
1003
+ alert('Please wait while page loading');
1004
+ return;
1005
+ }
1006
+
1007
+ var form = document.adminForm;
1008
+
1009
+ if (pressbutton == 'cancel')
1010
+
1011
+ {
1012
+
1013
+ submitform( pressbutton );
1014
+
1015
+ return;
1016
+
1017
+ }
1018
+
1019
+ if (form.title.value == "")
1020
+
1021
+ {
1022
+
1023
+ alert( "The form must have a title." );
1024
+ return;
1025
+
1026
+ }
1027
+
1028
+ if(form.mail.value!='')
1029
+ {
1030
+ subMailArr=form.mail.value.split(',');
1031
+ emailListValid=true;
1032
+ for(subMailIt=0; subMailIt<subMailArr.length; subMailIt++)
1033
+ {
1034
+ trimmedMail = subMailArr[subMailIt].replace(/^\s+|\s+$/g, '') ;
1035
+ if (trimmedMail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1)
1036
+ {
1037
+ alert( "This is not a list of valid email addresses." );
1038
+ emailListValid=false;
1039
+ break;
1040
+ }
1041
+ }
1042
+ if(!emailListValid)
1043
+ return
1044
+
1045
+ }
1046
+
1047
+ tox='';
1048
+ l_id_array=[<?php echo $labels['id']?>];
1049
+ l_label_array=[<?php echo $labels['label']?>];
1050
+ l_type_array=[<?php echo $labels['type']?>];
1051
+ l_id_removed=[];
1052
+
1053
+ for(x=0; x< l_id_array.length; x++)
1054
+ {
1055
+ l_id_removed[x]=true;
1056
+ }
1057
+
1058
+ for(t=1;t<=form_view_max;t++)
1059
+ {
1060
+ if(document.getElementById('form_id_tempform_view'+t))
1061
+ {
1062
+ form_view_element=document.getElementById('form_id_tempform_view'+t);
1063
+ n=form_view_element.childNodes.length-2;
1064
+
1065
+ for(q=0;q<=n;q++)
1066
+ {
1067
+ if(form_view_element.childNodes[q].nodeType!=3)
1068
+ if(!form_view_element.childNodes[q].id)
1069
+ {
1070
+ GLOBAL_tr=form_view_element.childNodes[q];
1071
+
1072
+ for (x=0; x < GLOBAL_tr.firstChild.childNodes.length; x++)
1073
+ {
1074
+
1075
+ table=GLOBAL_tr.firstChild.childNodes[x];
1076
+ tbody=table.firstChild;
1077
+ for (y=0; y < tbody.childNodes.length; y++)
1078
+ {
1079
+ is_in_old=false;
1080
+ tr=tbody.childNodes[y];
1081
+ l_id=tr.id;
1082
+
1083
+ l_label=document.getElementById( tr.id+'_element_labelform_id_temp').innerHTML;
1084
+ l_label = l_label.replace(/(\r\n|\n|\r)/gm," ");
1085
+ l_type=tr.getAttribute('type');
1086
+ for(z=0; z< l_id_array.length; z++)
1087
+ {
1088
+ if(l_id_array[z]==l_id)
1089
+ {
1090
+ l_id_removed[z]=false;
1091
+ if(l_type_array[z]=="type_address")
1092
+ {
1093
+ z++;
1094
+ l_id_removed[z]=false;
1095
+ z++;
1096
+ l_id_removed[z]=false;
1097
+ z++;
1098
+ l_id_removed[z]=false;
1099
+ z++;
1100
+ l_id_removed[z]=false;
1101
+ z++;
1102
+ l_id_removed[z]=false;
1103
+ }
1104
+ }
1105
+ }
1106
+
1107
+ if(tr.getAttribute('type')=="type_address")
1108
+ {
1109
+ addr_id=parseInt(tr.id);
1110
+ tox=tox+addr_id+'#**id**#'+'Street Line'+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
1111
+ tox=tox+addr_id+'#**id**#'+'Street Line2'+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
1112
+ tox=tox+addr_id+'#**id**#'+'City'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1113
+ tox=tox+addr_id+'#**id**#'+'State'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1114
+ tox=tox+addr_id+'#**id**#'+'Postal'+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1115
+ tox=tox+addr_id+'#**id**#'+'Country'+'#**label**#'+tr.getAttribute('type')+'#****#';
1116
+ }
1117
+ else
1118
+ tox=tox+l_id+'#**id**#'+l_label+'#**label**#'+l_type+'#****#';
1119
+
1120
+
1121
+
1122
+ }
1123
+ }
1124
+ }
1125
+ }
1126
+ }
1127
+ }
1128
+ for(x=0; x< l_id_array.length; x++)
1129
+ {
1130
+ if(l_id_removed[x])
1131
+ tox=tox+l_id_array[x]+'#**id**#'+l_label_array[x]+'#**label**#'+l_type_array[x]+'#****#';
1132
+ }
1133
+
1134
+
1135
+ document.getElementById('label_order').value=tox;
1136
+
1137
+
1138
+ refresh_()
1139
+ document.getElementById('pagination').value=document.getElementById('pages').getAttribute("type");
1140
+ document.getElementById('show_title').value=document.getElementById('pages').getAttribute("show_title");
1141
+ document.getElementById('show_numbers').value=document.getElementById('pages').getAttribute("show_numbers");
1142
+
1143
+
1144
+ submitform( pressbutton );
1145
+ }
1146
+
1147
+ function remove_whitespace(node)
1148
+ {
1149
+ for (ttt=0; ttt < node.childNodes.length; ttt++)
1150
+ {
1151
+ if( node.childNodes[ttt].nodeType == '3')
1152
+ {
1153
+ if(!node.childNodes[ttt])
1154
+ node.removeChild(node.childNodes[ttt]);
1155
+ }
1156
+ else
1157
+ {
1158
+ if(node.childNodes[ttt].childNodes.length)
1159
+ remove_whitespace(node.childNodes[ttt]);
1160
+ }
1161
+ }
1162
+ return
1163
+ }
1164
+
1165
+ function refresh_()
1166
+ {
1167
+
1168
+ document.getElementById('form').value=document.getElementById('take').innerHTML;
1169
+ document.getElementById('counter').value=gen;
1170
+ n=gen;
1171
+ for(i=0; i<n; i++)
1172
+ {
1173
+ if(document.getElementById(i))
1174
+ {
1175
+ for(z=0; z<document.getElementById(i).childNodes.length; z++)
1176
+ if(document.getElementById(i).childNodes[z].nodeType==3)
1177
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
1178
+
1179
+ if(document.getElementById(i).getAttribute('type')=="type_captcha" || document.getElementById(i).getAttribute('type')=="type_recaptcha")
1180
+ {
1181
+ if(document.getElementById(i).childNodes[10])
1182
+ {
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
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1191
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1192
+ }
1193
+ else
1194
+ {
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
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1203
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1204
+ }
1205
+ continue;
1206
+ }
1207
+
1208
+ if(document.getElementById(i).getAttribute('type')=="type_section_break")
1209
+ {
1210
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1211
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1212
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1213
+ continue;
1214
+ }
1215
+
1216
+
1217
+
1218
+ if(document.getElementById(i).childNodes[10])
1219
+ {
1220
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1221
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1222
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1223
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1224
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1225
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1226
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1227
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1228
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1229
+ }
1230
+ else
1231
+ {
1232
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1233
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1234
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1235
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1236
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1237
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1238
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1239
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1240
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1241
+ }
1242
+ }
1243
+ }
1244
+
1245
+ for(i=0; i<=n; i++)
1246
+ {
1247
+ if(document.getElementById(i))
1248
+ {
1249
+ type=document.getElementById(i).getAttribute("type");
1250
+ switch(type)
1251
+ {
1252
+ case "type_text":
1253
+ case "type_number":
1254
+ case "type_password":
1255
+ case "type_submitter_mail":
1256
+ case "type_own_select":
1257
+ case "type_country":
1258
+ case "type_hidden":
1259
+ case "type_map":
1260
+ {
1261
+ remove_add_(i+"_elementform_id_temp");
1262
+ break;
1263
+ }
1264
+
1265
+ case "type_submit_reset":
1266
+ {
1267
+ remove_add_(i+"_element_submitform_id_temp");
1268
+ if(document.getElementById(i+"_element_resetform_id_temp"))
1269
+ remove_add_(i+"_element_resetform_id_temp");
1270
+ break;
1271
+ }
1272
+
1273
+ case "type_captcha":
1274
+ {
1275
+ remove_add_("_wd_captchaform_id_temp");
1276
+ remove_add_("_element_refreshform_id_temp");
1277
+ remove_add_("_wd_captcha_inputform_id_temp");
1278
+ break;
1279
+ }
1280
+
1281
+ case "type_recaptcha":
1282
+ {
1283
+ document.getElementById("public_key").value = document.getElementById("wd_recaptchaform_id_temp").getAttribute("public_key");
1284
+ document.getElementById("private_key").value= document.getElementById("wd_recaptchaform_id_temp").getAttribute("private_key");
1285
+ document.getElementById("recaptcha_theme").value= document.getElementById("wd_recaptchaform_id_temp").getAttribute("theme");
1286
+ document.getElementById('wd_recaptchaform_id_temp').innerHTML='';
1287
+ remove_add_("wd_recaptchaform_id_temp");
1288
+ break;
1289
+ }
1290
+
1291
+ case "type_file_upload":
1292
+ {
1293
+ remove_add_(i+"_elementform_id_temp");
1294
+
1295
+ break;
1296
+ }
1297
+
1298
+ case "type_textarea":
1299
+ {
1300
+ remove_add_(i+"_elementform_id_temp");
1301
+
1302
+ break;
1303
+ }
1304
+
1305
+ case "type_name":
1306
+ {
1307
+
1308
+ if(document.getElementById(i+"_element_titleform_id_temp"))
1309
+ {
1310
+ remove_add_(i+"_element_titleform_id_temp");
1311
+ remove_add_(i+"_element_firstform_id_temp");
1312
+ remove_add_(i+"_element_lastform_id_temp");
1313
+ remove_add_(i+"_element_middleform_id_temp");
1314
+ }
1315
+ else
1316
+ {
1317
+ remove_add_(i+"_element_firstform_id_temp");
1318
+ remove_add_(i+"_element_lastform_id_temp");
1319
+ }
1320
+ break;
1321
+
1322
+ }
1323
+
1324
+ case "type_phone":
1325
+ {
1326
+
1327
+ remove_add_(i+"_element_firstform_id_temp");
1328
+ remove_add_(i+"_element_lastform_id_temp");
1329
+ break;
1330
+
1331
+ }
1332
+ case "type_address":
1333
+ {
1334
+ remove_add_(i+"_street1form_id_temp");
1335
+ remove_add_(i+"_street2form_id_temp");
1336
+ remove_add_(i+"_cityform_id_temp");
1337
+ remove_add_(i+"_stateform_id_temp");
1338
+ remove_add_(i+"_postalform_id_temp");
1339
+ remove_add_(i+"_countryform_id_temp");
1340
+
1341
+ break;
1342
+
1343
+ }
1344
+
1345
+
1346
+ case "type_checkbox":
1347
+ case "type_radio":
1348
+ {
1349
+ is=true;
1350
+ for(j=0; j<100; j++)
1351
+ if(document.getElementById(i+"_elementform_id_temp"+j))
1352
+ {
1353
+ remove_add_(i+"_elementform_id_temp"+j);
1354
+ }
1355
+
1356
+ /*if(document.getElementById(i+"_randomize").value=="yes")
1357
+ choises_randomize(i);*/
1358
+
1359
+ break;
1360
+ }
1361
+
1362
+ case "type_button":
1363
+ {
1364
+ for(j=0; j<100; j++)
1365
+ if(document.getElementById(i+"_elementform_id_temp"+j))
1366
+ {
1367
+ remove_add_(i+"_elementform_id_temp"+j);
1368
+ }
1369
+ break;
1370
+ }
1371
+
1372
+ case "type_time":
1373
+ {
1374
+ if(document.getElementById(i+"_ssform_id_temp"))
1375
+ {
1376
+ remove_add_(i+"_ssform_id_temp");
1377
+ remove_add_(i+"_mmform_id_temp");
1378
+ remove_add_(i+"_hhform_id_temp");
1379
+ }
1380
+ else
1381
+ {
1382
+ remove_add_(i+"_mmform_id_temp");
1383
+ remove_add_(i+"_hhform_id_temp");
1384
+
1385
+ }
1386
+ break;
1387
+
1388
+ }
1389
+
1390
+ case "type_date":
1391
+ {
1392
+ remove_add_(i+"_elementform_id_temp");
1393
+ remove_add_(i+"_buttonform_id_temp");
1394
+
1395
+ break;
1396
+ }
1397
+ case "type_date_fields":
1398
+ {
1399
+ remove_add_(i+"_dayform_id_temp");
1400
+ remove_add_(i+"_monthform_id_temp");
1401
+ remove_add_(i+"_yearform_id_temp");
1402
+ break;
1403
+ }
1404
+ }
1405
+ }
1406
+ }
1407
+
1408
+ for(i=1; i<=form_view_max; i++)
1409
+ {
1410
+ if(document.getElementById('form_id_tempform_view'+i))
1411
+ {
1412
+ if(document.getElementById('page_next_'+i))
1413
+ document.getElementById('page_next_'+i).removeAttribute('src');
1414
+ if(document.getElementById('page_previous_'+i))
1415
+ document.getElementById('page_previous_'+i).removeAttribute('src');
1416
+
1417
+ document.getElementById('form_id_tempform_view'+i).parentNode.removeChild(document.getElementById('form_id_tempform_view_img'+i));
1418
+ document.getElementById('form_id_tempform_view'+i).removeAttribute('style');
1419
+ }
1420
+ }
1421
+
1422
+
1423
+ document.getElementById('form_front').value=document.getElementById('take').innerHTML;
1424
+
1425
+ }
1426
+
1427
+ function set_preview()
1428
+ {
1429
+ appWidth =parseInt(document.body.offsetWidth);
1430
+ appHeight =parseInt(document.body.offsetHeight);
1431
+ document.getElementById('preview_form').href='<?php echo admin_url('admin-ajax.php'); ?>?action=frommakerpreview&id='+document.getElementById('theme').value+'&TB_iframe=1';
1432
+ }
1433
+
1434
+ gen=<?php echo $row->counter; ?>;//add main form id
1435
+ function enable()
1436
+ {
1437
+ for(iiiii=0; iiiii<1000;iiiii++)
1438
+ {
1439
+ if(document.getElementsByTagName("iframe")[iiiii]){
1440
+ if(document.getElementsByTagName("iframe")[iiiii].id=='contact_form_editor_ifr'){
1441
+ id_ifr_editor=iiiii;
1442
+ break;
1443
+ }
1444
+ }
1445
+ }
1446
+ alltypes=Array('customHTML','text','checkbox','radio','time_and_date','select','file_upload','captcha','map','button','page_break','section_break');
1447
+ for(x=0; x<12;x++)
1448
+ {
1449
+ document.getElementById('img_'+alltypes[x]).src="<?php echo plugins_url("images/",__FILE__) ?>"+alltypes[x]+".png";
1450
+ }
1451
+
1452
+
1453
+ document.getElementById('formMakerDiv').style.display =(document.getElementById('formMakerDiv').style.display=='block'?'none':'block');
1454
+ document.getElementById('formMakerDiv1').style.display =(document.getElementById('formMakerDiv1').style.display=='block'?'none':'block');
1455
+
1456
+ if(document.getElementById('formMakerDiv').offsetWidth)
1457
+ document.getElementById('formMakerDiv1').style.width =(document.getElementById('formMakerDiv').offsetWidth - 60)+'px';
1458
+ document.getElementById('when_edit').style.display ='none';
1459
+ }
1460
+
1461
+ function enable2()
1462
+ {
1463
+
1464
+ alltypes=Array('customHTML','text','checkbox','radio','time_and_date','select','file_upload','captcha','map','button','page_break','section_break');
1465
+ for(x=0; x<12;x++)
1466
+ {
1467
+
1468
+ document.getElementById('img_'+alltypes[x]).src="<?php echo plugins_url("images/",__FILE__) ?>"+alltypes[x]+".png";
1469
+ }
1470
+
1471
+
1472
+ document.getElementById('formMakerDiv').style.display =(document.getElementById('formMakerDiv').style.display=='block'?'none':'block');
1473
+ document.getElementById('formMakerDiv1').style.display =(document.getElementById('formMakerDiv1').style.display=='block'?'none':'block');
1474
+ if(document.getElementById('formMakerDiv').offsetWidth)
1475
+ document.getElementById('formMakerDiv1').style.width =(document.getElementById('formMakerDiv').offsetWidth - 60)+'px';
1476
+ document.getElementById('when_edit').style.display ='block';
1477
+ if(document.getElementById('field_types').offsetWidth)
1478
+ document.getElementById('when_edit').style.width =document.getElementById('field_types').offsetWidth+'px';
1479
+
1480
+ if(document.getElementById('field_types').offsetHeight)
1481
+ document.getElementById('when_edit').style.height =document.getElementById('field_types').offsetHeight+'px';
1482
+
1483
+ //document.getElementById('when_edit').style.position='none';
1484
+
1485
+ }
1486
+
1487
+ var thickDims, tbWidth, tbHeight;
1488
+ jQuery(document).ready(function($) {
1489
+
1490
+ thickDims = function() {
1491
+ var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
1492
+
1493
+ w = (tbWidth && tbWidth < W - 90) ? tbWidth : W - 40;
1494
+ h = (tbHeight && tbHeight < H - 60) ? tbHeight : H - 40;
1495
+
1496
+ if ( tbWindow.size() ) {
1497
+ tbWindow.width(w).height(h);
1498
+ $('#TB_iframeContent').width(w).height(h - 27);
1499
+ tbWindow.css({'margin-left': '-' + parseInt((w / 2),10) + 'px'});
1500
+ if ( typeof document.body.style.maxWidth != 'undefined' )
1501
+ tbWindow.css({'top':(H-h)/2,'margin-top':'0'});
1502
+ }
1503
+ };
1504
+
1505
+ thickDims();
1506
+ $(window).resize( function() { thickDims() } );
1507
+
1508
+ $('a.thickbox-preview').click( function() {
1509
+ tb_click.call(this);
1510
+
1511
+ var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text;
1512
+
1513
+ if ( tbWidth = href.match(/&tbWidth=[0-9]+/) )
1514
+ tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
1515
+ else
1516
+ tbWidth = $(window).width() - 120;
1517
+
1518
+ if ( tbHeight = href.match(/&tbHeight=[0-9]+/) )
1519
+ tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
1520
+ else
1521
+ tbHeight = $(window).height() - 120;
1522
+
1523
+ if ( alink.length ) {
1524
+ url = alink.attr('href') || '';
1525
+ text = alink.attr('title') || '';
1526
+ link = '&nbsp; <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
1527
+ } else {
1528
+ text = $(this).attr('title') || '';
1529
+ link = '&nbsp; <span class="tb-theme-preview-link">' + text + '</span>';
1530
+ }
1531
+
1532
+ $('#TB_title').css({'background-color':'#222','color':'#dfdfdf'});
1533
+ $('#TB_closeAjaxWindow').css({'float':'left'});
1534
+ $('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
1535
+
1536
+ $('#TB_iframeContent').width('100%');
1537
+ thickDims();
1538
+
1539
+ return false;
1540
+ } );
1541
+
1542
+ // Theme details
1543
+ $('.theme-detail').click(function () {
1544
+ $(this).siblings('.themedetaildiv').toggle();
1545
+ return false;
1546
+ });
1547
+
1548
+ });
1549
+
1550
+ </script>
1551
+ <style>
1552
+ .calendar .button
1553
+ {
1554
+ display:table-cell !important;
1555
+ }
1556
+ #when_edit
1557
+ {
1558
+ position:absolute;
1559
+ background-color:#666;
1560
+ z-index:101;
1561
+ display:none;
1562
+ width:100%;
1563
+ height:100%;
1564
+ opacity: 0.7;
1565
+ filter: alpha(opacity = 70);
1566
+ }
1567
+
1568
+ #formMakerDiv
1569
+ {
1570
+ position:fixed;
1571
+ background-color:#666;
1572
+ z-index:100;
1573
+ display:none;
1574
+ left:0;
1575
+ top:0;
1576
+ width:100%;
1577
+ height:100%;
1578
+ opacity: 0.7;
1579
+ filter: alpha(opacity = 70);
1580
+ }
1581
+ #formMakerDiv1
1582
+ {
1583
+ padding-top:20px;
1584
+ position:fixed;
1585
+ z-index:100;
1586
+ background-color:transparent;
1587
+ top:0;
1588
+ left:0;
1589
+ display:none;
1590
+ margin-left:30px;
1591
+ margin-top:15px;
1592
+ }
1593
+ </style>
1594
+ <table width="95%">
1595
+ <tr>
1596
+ <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
1597
+ <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="color:red; text-decoration:none;">
1598
+ <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
1599
+ Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
1600
+ </a></div>
1601
+ </td>
1602
+ </tr>
1603
+ <tr>
1604
+ <td width="100%"><?php echo "<h2>Contact Form</h2>"; ?></td>
1605
+ <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>
1606
+ <td><input type="button" onclick="submitbutton('Actions_after_submission')" value="Actions after submission" class="button-primary" /> </td>
1607
+ <td> <input type="button" onclick="submitbutton('Edit_JavaScript')" value="Edit JavaScript" class="button-primary" /> </td>
1608
+ <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>
1609
+ <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>
1610
+ <td style="width:300px"><input type="button" onclick="submitbutton('save_as_copy')" value="Save As Copy" class="button-secondary action" /> </td>
1611
+ <td align="right"><input type="button" onclick="submitbutton('Save')" value="Save" class="button-secondary action" /> </td>
1612
+ <td align="right"><input type="button" onclick="submitbutton('Apply')" value="Apply" class="button-secondary action"/> </td>
1613
+ <td align="right"><input type="button" onclick="window.location.href='admin.php?page=contact_form'" value="Cancel" class="button-secondary action" /> </td>
1614
+ </tr>
1615
+ </table>
1616
+ <br />
1617
+
1618
+
1619
+
1620
+ <form action="admin.php?page=contact_form&id=<?php echo $row->id; ?>" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data">
1621
+ <table style="border:6px #00aeef solid; background-color:#00aeef" width="95%" cellpadding="0" cellspacing="0">
1622
+ <tr>
1623
+
1624
+
1625
+ <td align="left" valign="middle" rowspan="3" style="padding:10px;">
1626
+ <img src="<?php echo plugins_url("images/FormMaker.png",__FILE__) ?>" />
1627
+ </td>
1628
+
1629
+ <td width="70" align="right" valign="middle">
1630
+
1631
+ <span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Form title:&nbsp;&nbsp;</span>
1632
+
1633
+ </td>
1634
+
1635
+ <td width="153" height="30px" align="center" valign="middle">
1636
+
1637
+ <div style="background-image:url(<?php echo plugins_url("images/input.png",__FILE__) ?>);">
1638
+
1639
+ <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" />
1640
+
1641
+ </div>
1642
+
1643
+ </td>
1644
+
1645
+ </tr><tr>
1646
+
1647
+ <td width="300" align="right" valign="middle">
1648
+
1649
+ <span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Email to send submissions to:&nbsp;&nbsp;</span>
1650
+
1651
+ </td>
1652
+
1653
+ <td width="153" height="30px" align="center" valign="middle">
1654
+
1655
+ <div style="background-image:url(<?php echo plugins_url("images/input.png",__FILE__) ?>);">
1656
+
1657
+ <input id="mail" name="mail" <?php echo 'value="'.$row->mail.'"' ?> style="background:none; padding:inherit; width:151px; height:17px; border:none; font-size:11px" />
1658
+
1659
+ </div>
1660
+
1661
+ </td>
1662
+
1663
+ </tr>
1664
+ <tr>
1665
+
1666
+ <td width="300" height="30px" align="right" valign="middle">
1667
+
1668
+ <span style="font-size:16.76pt; font-family:BauhausItcTEEMed; color:#FFFFFF; vertical-align:middle;">Theme:&nbsp;&nbsp;</span>
1669
+
1670
+ </td>
1671
+
1672
+ <td width="153" align="center" valign="middle">
1673
+
1674
+ <div style="height:19px">
1675
+
1676
+ <select id="theme" name="theme" style="background:transparent; width:151px; height:19px; border:none; font-size:11px" onChange="set_preview()" >
1677
+
1678
+ <?php
1679
+ $form_theme='';
1680
+ foreach($themes as $theme)
1681
+ {
1682
+ if($theme->id==$row->theme)
1683
+ {
1684
+ echo '<option value="'.$theme->id.'" selected>'.$theme->title.'</option>';
1685
+ $form_theme=$theme->css;
1686
+ }
1687
+ else
1688
+ echo '<option value="'.$theme->id.'">'.$theme->title.'</option>';
1689
+ }
1690
+ ?>
1691
+ </select>
1692
+
1693
+ </div>
1694
+
1695
+ </td>
1696
+
1697
+ </tr>
1698
+
1699
+
1700
+
1701
+ <tr>
1702
+ <td align="left" colspan="3">
1703
+
1704
+ <img src="<?php echo plugins_url("images/addanewfield.png",__FILE__) ?>" onclick="enable(); Enable()" style="cursor:pointer;margin:10px;" />
1705
+
1706
+ </td>
1707
+ </tr>
1708
+ </table>
1709
+
1710
+ <div id="formMakerDiv" onclick="close_window()"></div>
1711
+ <div id="formMakerDiv1" style="padding-top:20px" align="center">
1712
+
1713
+
1714
+ <table border="0" width="100%" cellpadding="0" cellspacing="0" height="100%" style="border:6px #00aeef solid; background-color:#FFF">
1715
+ <tr>
1716
+ <td style="padding:0px">
1717
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
1718
+ <tr valign="top">
1719
+ <td width="15%" height="100%" style="border-right:dotted black 1px;" id="field_types">
1720
+ <div id="when_edit" style="display:none"></div>
1721
+ <table border="0" cellpadding="0" cellspacing="3" width="100%">
1722
+ <tr>
1723
+ <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>
1724
+
1725
+ <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>
1726
+ </tr>
1727
+ <tr>
1728
+ <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="cursor:pointer; background-color: rgb(114, 113, 113) !important;" 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>
1729
+
1730
+ <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="cursor:pointer; background-color: rgb(114, 113, 113) !important;" id="table_select" class="field_buttons"><img src="<?php echo plugins_url("images/select.png",__FILE__) ?>" style="margin:5px" id="img_select"/></td>
1731
+ </tr>
1732
+ <tr>
1733
+ <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="cursor:pointer; background-color: rgb(114, 113, 113) !important;" id="table_checkbox" class="field_buttons"><img src="<?php echo plugins_url("images/checkbox.png",__FILE__) ?>" style="margin:5px" id="img_checkbox"/></td>
1734
+
1735
+ <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="cursor:pointer; background-color: rgb(114, 113, 113) !important;" id="table_radio" class="field_buttons"><img src="<?php echo plugins_url("images/radio.png",__FILE__) ?>" style="margin:5px" id="img_radio"/></td>
1736
+ </tr>
1737
+ <tr>
1738
+ <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="cursor:pointer; 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>
1739
+
1740
+ <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>
1741
+ </tr>
1742
+ <tr>
1743
+ <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>
1744
+
1745
+ <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>
1746
+ </tr>
1747
+ <tr>
1748
+ <td align="center" onClick="addRow('map')" style="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>
1749
+
1750
+ <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>
1751
+ </tr>
1752
+ </table>
1753
+
1754
+ </td>
1755
+ <td width="35%" height="100%" align="left"><div id="edit_table" style="padding:0px; overflow-y:scroll; height:531px" ></div></td>
1756
+
1757
+ <td align="center" valign="top" style="background:url(<?php echo plugins_url("images/border2.png",__FILE__) ?>) repeat-y;">&nbsp;</td>
1758
+ <td style="padding:15px">
1759
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
1760
+
1761
+ <tr>
1762
+ <td align="right"><input type="radio" value="end" name="el_pos" checked="checked" id="pos_end" onclick="Disable()"/>
1763
+ At The End
1764
+ <input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
1765
+ At The Beginning
1766
+ <input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
1767
+ Before
1768
+ <select style="width:100px; margin-left:5px" id="sel_el_pos" disabled="disabled">
1769
+ </select>
1770
+ <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)"/>
1771
+ <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()"/>
1772
+
1773
+ <hr style=" margin-bottom:10px" />
1774
+ </td>
1775
+ </tr>
1776
+
1777
+ <tr height="100%" valign="top">
1778
+ <td id="show_table"></td>
1779
+ </tr>
1780
+
1781
+ </table>
1782
+ </td>
1783
+ </tr>
1784
+ </table>
1785
+ </td>
1786
+ </tr>
1787
+ </table>
1788
+
1789
+ <input type="hidden" id="old" />
1790
+ <input type="hidden" id="old_selected" />
1791
+ <input type="hidden" id="element_type" />
1792
+ <input type="hidden" id="editing_id" />
1793
+ <input type="hidden" value="<?php echo plugins_url("",__FILE__) ?>" id="form_plugins_url" />
1794
+ <div id="main_editor" style="position:absolute; display:none; z-index:140;"> <?php if(function_exists ('the_editor') || function_exists ('wp_editor')){
1795
+ if(get_bloginfo('version')<'3.3'){?>
1796
+ <div style=" max-width:500px; height:300px;text-align:left" id="poststuff">
1797
+ <div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea"><?php the_editor("","contact_form_editor","title",$media_buttons = true, $tab_index = 1, $extended = true ); ?>
1798
+ </div>
1799
+ </div>
1800
+ <?php } else { echo "<style>#wp-contact_form_editor-media-buttons{ text-align:left }</style>"; wp_editor("","contact_form_editor");}?>
1801
+
1802
+ <?php
1803
+ }
1804
+ else
1805
+ {
1806
+ ?>
1807
+ <textarea name="contact_form_editor" id="contact_form_editor" cols="40" rows="6" style="width: 440px; height: 350px; " class="mce_editable" aria-hidden="true"></textarea>
1808
+ <?php
1809
+
1810
+ }
1811
+ ?></div>
1812
+ </div>
1813
+
1814
+ <?php if(!function_exists ('the_editor'))
1815
+ {
1816
+ ?>
1817
+ <iframe id="tinymce" style="display:none"></iframe>
1818
+
1819
+ <?php
1820
+ }
1821
+ ?>
1822
+
1823
+
1824
+
1825
+ <br />
1826
+ <br />
1827
+
1828
+ <fieldset>
1829
+
1830
+ <legend>
1831
+
1832
+ <h2 style="color:#00aeef">Form</h2>
1833
+
1834
+ </legend>
1835
+
1836
+ <?php
1837
+ global $first_css;
1838
+ echo '<style>'.$first_css.'</style>';
1839
+
1840
+ ?><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
1841
+
1842
+ if($row->form)
1843
+
1844
+ echo $row->form;
1845
+
1846
+ else
1847
+
1848
+ 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>';
1849
+ ?></div>
1850
+
1851
+ </fieldset>
1852
+
1853
+ <input type="hidden" name="form" id="form">
1854
+ <input type="hidden" name="form_front" id="form_front">
1855
+
1856
+ <input type="hidden" name="pagination" id="pagination" />
1857
+ <input type="hidden" name="show_title" id="show_title" />
1858
+ <input type="hidden" name="show_numbers" id="show_numbers" />
1859
+
1860
+ <input type="hidden" name="public_key" id="public_key" />
1861
+ <input type="hidden" name="private_key" id="private_key" />
1862
+ <input type="hidden" name="recaptcha_theme" id="recaptcha_theme" />
1863
+
1864
+ <input type="hidden" id="label_order" name="label_order" value="<?php echo $row->label_order;?>" />
1865
+ <input type="hidden" name="counter" id="counter" value="<?php echo $row->counter;?>">
1866
+
1867
+ <script type="text/javascript">
1868
+
1869
+ function formOnload()
1870
+ {
1871
+ //enable maps
1872
+ for(t=0; t<<?php echo $row->counter;?>; t++)
1873
+ if(document.getElementById(t+"_typeform_id_temp"))
1874
+ {
1875
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_map" || document.getElementById(t+"_typeform_id_temp").value=="type_mark_map")
1876
+ {
1877
+ if_gmap_init(t);
1878
+ for(q=0; q<20; q++)
1879
+ if(document.getElementById(t+"_elementform_id_temp").getAttribute("long"+q))
1880
+ {
1881
+
1882
+ w_long=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("long"+q));
1883
+ w_lat=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("lat"+q));
1884
+ w_info=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("info"+q));
1885
+ add_marker_on_map(t,q, w_long, w_lat, w_info, false);
1886
+ }
1887
+ }
1888
+ else
1889
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_date")
1890
+ Calendar.setup({
1891
+ inputField: t+"_elementform_id_temp",
1892
+ ifFormat: document.getElementById(t+"_buttonform_id_temp").getAttribute('format'),
1893
+ button: t+"_buttonform_id_temp",
1894
+ align: "Tl",
1895
+ singleClick: true,
1896
+ firstDay: 0
1897
+ });
1898
+
1899
+ }
1900
+
1901
+
1902
+ form_view=1;
1903
+ form_view_count=0;
1904
+ for(i=1; i<=30; i++)
1905
+ {
1906
+ if(document.getElementById('form_id_tempform_view'+i))
1907
+ {
1908
+ form_view_count++;
1909
+ form_view_max=i;
1910
+ }
1911
+ }
1912
+
1913
+ if(form_view_count>1)
1914
+ {
1915
+ for(i=1; i<=form_view_max; i++)
1916
+ {
1917
+ if(document.getElementById('form_id_tempform_view'+i))
1918
+ {
1919
+ first_form_view=i;
1920
+ break;
1921
+ }
1922
+ }
1923
+ form_view=form_view_max;
1924
+
1925
+ generate_page_nav(first_form_view);
1926
+
1927
+ var img_EDIT = document.createElement("img");
1928
+ img_EDIT.setAttribute("src", "<?php echo plugins_url('',__FILE__) ?>/images/edit.png");
1929
+ img_EDIT.style.cssText = "margin-left:40px; cursor:pointer";
1930
+ img_EDIT.setAttribute("onclick", 'el_page_navigation()');
1931
+
1932
+ var td_EDIT = document.getElementById("edit_page_navigation");
1933
+ td_EDIT.appendChild(img_EDIT);
1934
+
1935
+ document.getElementById('page_navigation').appendChild(td_EDIT);
1936
+
1937
+
1938
+ }
1939
+
1940
+
1941
+ //if(document.getElementById('take').innerHTML.indexOf('up_row(')==-1) location.reload(true);
1942
+ //else
1943
+ document.getElementById('form').value=document.getElementById('take').innerHTML;
1944
+ document.getElementById('araqel').value=1;
1945
+
1946
+ }
1947
+
1948
+ function formAddToOnload()
1949
+ {
1950
+ if(formOldFunctionOnLoad){ formOldFunctionOnLoad(); }
1951
+ formOnload();
1952
+ }
1953
+
1954
+ function formLoadBody()
1955
+ {
1956
+ formOldFunctionOnLoad = window.onload;
1957
+ window.onload = formAddToOnload;
1958
+ }
1959
+
1960
+ var formOldFunctionOnLoad = null;
1961
+
1962
+ formLoadBody();
1963
+
1964
+
1965
+ </script>
1966
+
1967
+ <input type="hidden" name="option" value="com_formmaker" />
1968
+
1969
+ <input type="hidden" name="id" value="<?php echo $row->id?>" />
1970
+
1971
+ <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
1972
+
1973
+ <input type="hidden" name="task" value="" />
1974
+ <input type="hidden" id="araqel" value="0" />
1975
+
1976
+ </form>
1977
+
1978
+ <script>
1979
+ plugin_url=document.getElementById('form_plugins_url').value;
1980
+ appWidth =parseInt(document.body.offsetWidth);
1981
+ appHeight =parseInt(document.body.offsetHeight);
1982
+ // document.getElementById('toolbar-popup-popup').childNodes[1].href='index.php?option=com_formmaker&task=preview&tmpl=component&theme='+document.getElementById('theme').value;
1983
+ // document.getElementById('toolbar-popup-popup').childNodes[1].setAttribute('rel',"{handler: 'iframe', size: {x:"+(appWidth-100)+", y: "+(appHeight-30)+"}}");
1984
+ </script>
1985
+ <?php
1986
+
1987
+
1988
+
1989
+
1990
+
1991
+
1992
+
1993
+ }
1994
+
1995
+
1996
+
1997
+
1998
+
1999
+
2000
+
2001
+
2002
+
2003
+
2004
+
2005
+
2006
+
2007
+
2008
+
2009
+
2010
+
2011
+
2012
+
2013
+
2014
+
2015
+
2016
+
2017
+ function html_Actions_after_submission($row){
2018
+ $value="";
2019
+ ?>
2020
+
2021
+ <script language="javascript" type="text/javascript">
2022
+ function remove_article()
2023
+ {
2024
+ document.getElementById('id_name').value="Select an Article";
2025
+ document.getElementById('article_id').value="";
2026
+ }
2027
+ function set_type(type)
2028
+ {
2029
+ switch(type)
2030
+ {
2031
+ case 'post':
2032
+ document.getElementById('post').removeAttribute('style');
2033
+ document.getElementById('page').setAttribute('style','display:none');
2034
+ document.getElementById('custom').setAttribute('style','display:none');
2035
+ document.getElementById('url').setAttribute('style','display:none');
2036
+ document.getElementById('none').setAttribute('style','display:none');
2037
+ break;
2038
+
2039
+ case 'page':
2040
+ document.getElementById('page').removeAttribute('style');
2041
+ document.getElementById('post').setAttribute('style','display:none');
2042
+ document.getElementById('custom').setAttribute('style','display:none');
2043
+ document.getElementById('url').setAttribute('style','display:none');
2044
+ document.getElementById('none').setAttribute('style','display:none');
2045
+ break;
2046
+
2047
+ case 'custom':
2048
+ document.getElementById('page').setAttribute('style','display:none');
2049
+ document.getElementById('post').setAttribute('style','display:none');
2050
+ document.getElementById('custom').removeAttribute('style');
2051
+ document.getElementById('url').setAttribute('style','display:none');
2052
+ document.getElementById('none').setAttribute('style','display:none');
2053
+ break;
2054
+
2055
+ case 'url':
2056
+ document.getElementById('page').setAttribute('style','display:none');
2057
+ document.getElementById('post').setAttribute('style','display:none');
2058
+ document.getElementById('custom').setAttribute('style','display:none');
2059
+ document.getElementById('url').removeAttribute('style');
2060
+ document.getElementById('none').setAttribute('style','display:none');
2061
+ break;
2062
+
2063
+ case 'none':
2064
+ document.getElementById('page').setAttribute('style','display:none');
2065
+ document.getElementById('post').setAttribute('style','display:none');
2066
+ document.getElementById('custom').setAttribute('style','display:none');
2067
+ document.getElementById('url').setAttribute('style','display:none');
2068
+ document.getElementById('none').removeAttribute('style');
2069
+ break;
2070
+ }
2071
+ }
2072
+ function submit_in(pressbutton){
2073
+
2074
+
2075
+ document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
2076
+ document.getElementById('adminForm').submit();
2077
+
2078
+ }
2079
+ </script>
2080
+
2081
+ <style>
2082
+ .borderer
2083
+ {
2084
+ border-radius:5px;
2085
+ padding-left:5px;
2086
+ background-color:#F0F0F0;
2087
+ height:19px;
2088
+ width:153px;
2089
+ }
2090
+ </style>
2091
+ <table width="95%">
2092
+ <tbody>
2093
+ <tr>
2094
+ <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
2095
+ <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="color:red; text-decoration:none;">
2096
+ <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
2097
+ Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
2098
+ </a></div>
2099
+ </td>
2100
+ </tr><tr>
2101
+ <td width="100%"><h2>Actions after submission - <?php echo $row->title; ?></h2></td>
2102
+ <td align="right"><input type="button" onclick="submit_in('Save_Actions_after_submission')" value="Save" class="button-secondary action"> </td>
2103
+ <td align="right"><input type="button" onclick="submit_in('Apply_Actions_after_submission')" value="Apply" class="button-secondary action"> </td>
2104
+ <td align="right"><input type="button" onclick="window.location.href='admin.php?page=contact_form&task=edit_form&id=<?php echo $row->id; ?>'" value="Cancel" class="button-secondary action"> </td>
2105
+ </tr>
2106
+ </tbody></table>
2107
+ <br />
2108
+ <form action="admin.php?page=contact_form&id=<?php echo $row->id; ?>" id="adminForm" method="post" name="adminForm">
2109
+ <table >
2110
+ <tr valign="top">
2111
+ <td class="key">
2112
+ <label for="submissioni text"> Action type: </label>
2113
+ </td>
2114
+ <td>
2115
+ <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/>
2116
+ <input type="radio" name="submit_text_type" onclick="set_type('post')" value="2" <?php if($row->submit_text_type==2 ) echo "checked" ?> /> Post<br/>
2117
+ <input type="radio" name="submit_text_type" onclick="set_type('page')" value="5" <?php if($row->submit_text_type==5 ) echo "checked" ?> /> Page<br/>
2118
+ <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/>
2119
+ <input type="radio" name="submit_text_type" onclick="set_type('url')" value="4" <?php if($row->submit_text_type==4 ) echo "checked" ?> /> URL
2120
+ </td>
2121
+ </tr>
2122
+ <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"' ?> >
2123
+ <td class="key">
2124
+ <label for="submissioni text"> Stay on form </label>
2125
+ </td>
2126
+ <td >
2127
+ <img src="<?php echo plugins_url("images/tick.png",__FILE__) ?>" border="0">
2128
+ </td>
2129
+ </tr>
2130
+ <tr id="post" <?php if($row->submit_text_type!=2) echo 'style="display:none"' ?> >
2131
+ <td class="key">
2132
+ <label for="submissioni text"> Post </label>
2133
+ </td>
2134
+ <td >
2135
+ <select name="post_name" style="width:153px; font-size:11px;">
2136
+ <option value="0">- Select Post -</option>
2137
+ <?php
2138
+ // The Loop
2139
+ query_posts('');
2140
+ while ( have_posts() ) : the_post(); ?>
2141
+ <option value="<?php $x=get_permalink(get_the_ID()); echo $x; ?>" <?php if($row->article_id==$x){echo ' selected="selected"';} ?>> <?php the_title(); ?> </option>
2142
+ <?php
2143
+ endwhile;
2144
+
2145
+ // Reset Query
2146
+ wp_reset_query();
2147
+
2148
+ ?>
2149
+ </select>
2150
+
2151
+ </td>
2152
+ </tr>
2153
+ <tr id="page" <?php if($row->submit_text_type!=5) echo 'style="display:none"' ?> >
2154
+ <td class="key">
2155
+ <label for="submissioni text"> Page </label>
2156
+ </td>
2157
+ <td >
2158
+ <select name="page_name" style="width:153px; font-size:11px;">
2159
+ <option value="0">- Select Page -</option>
2160
+ <?php
2161
+
2162
+ // The Query
2163
+ $pages = get_pages();
2164
+
2165
+ // The Loop
2166
+ foreach ( $pages as $page ) {?>
2167
+ <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>
2168
+ <?php
2169
+ }
2170
+
2171
+ // Reset Query
2172
+ wp_reset_query();
2173
+
2174
+ ?>
2175
+ </select>
2176
+
2177
+ </td>
2178
+ </tr>
2179
+
2180
+
2181
+
2182
+
2183
+ <tr <?php if($row->submit_text_type!=3 ) echo 'style="display:none"' ?> id="custom">
2184
+ <td class="key">
2185
+ <label for="submissioni text"> Text </label>
2186
+ </td>
2187
+ <td >
2188
+ <div style="height:300px;text-align:left" id="poststuff">
2189
+ <?php if(get_bloginfo('version')<'3.3'){ ?>
2190
+ <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 ); ?>
2191
+ <?php }else { wp_editor($row->submit_text,"content");}?>
2192
+ </div>
2193
+ </div>
2194
+ </td>
2195
+ </tr>
2196
+ <tr <?php if($row->submit_text_type!=4 ) echo 'style="display:none"' ?> id="url">
2197
+ <td class="key">
2198
+ <label for="submissioni text"> URL </label>
2199
+ </td>
2200
+ <td >
2201
+ <input type="text" id="url" name="url" style="width:300px" value="<?php echo $row->url ?>" />
2202
+ </td>
2203
+ </tr>
2204
+ </table>
2205
+ <input type="hidden" name="option" value="com_formmaker" />
2206
+ <input type="hidden" name="id" value="<?php echo $row->id?>" />
2207
+ <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
2208
+ <input type="hidden" name="task" value="" />
2209
+ </form>
2210
+
2211
+ <?php
2212
+
2213
+
2214
+ }
2215
+
2216
+
2217
+
2218
+
2219
+
2220
+
2221
+
2222
+
2223
+
2224
+
2225
+
2226
+
2227
+
2228
+
2229
+
2230
+
2231
+
2232
+
2233
+
2234
+
2235
+
2236
+ function html_Edit_JavaScript($row){
2237
+
2238
+ ?>
2239
+ <script type="text/javascript" language="javascript">
2240
+ function submit_in(pressbutton){
2241
+
2242
+
2243
+ document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
2244
+ document.getElementById('adminForm').submit();
2245
+
2246
+ }
2247
+ </script>
2248
+
2249
+ <table width="95%">
2250
+ <tbody>
2251
+ <tr>
2252
+ <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
2253
+ <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="color:red; text-decoration:none;">
2254
+ <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
2255
+ Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
2256
+ </a></div>
2257
+ </td>
2258
+ </tr><tr>
2259
+ <td width="100%"><h2>Edit JavaScript - <?php echo $row->title; ?></h2></td>
2260
+ <td align="right"><input type="button" onclick="submit_in('Save_Edit_JavaScript')" value="Save" class="button-secondary action"> </td>
2261
+ <td align="right"><input type="button" onclick="submit_in('Apply_Edit_JavaScript')" value="Apply" class="button-secondary action"> </td>
2262
+ <td align="right"><input type="button" onclick="window.location.href='admin.php?page=contact_form&task=edit_form&id=<?php echo $row->id; ?>'" value="Cancel" class="button-secondary action"> </td>
2263
+ </tr>
2264
+ </tbody></table>
2265
+ <br />
2266
+ <form action="admin.php?page=contact_form&id=<?php echo $row->id; ?>" id="adminForm" method="post" name="adminForm">
2267
+ <table class="adminform">
2268
+
2269
+ <tr>
2270
+
2271
+ <th>
2272
+
2273
+ <label for="message"> Javascript </label>
2274
+
2275
+ </th>
2276
+
2277
+ </tr>
2278
+
2279
+ <tr>
2280
+
2281
+ <td >
2282
+
2283
+ <textarea style="margin: 0px;" cols="110" rows="25" name="javascript" id="css" ><?php echo $row->javascript; ?></textarea>
2284
+
2285
+ </td>
2286
+
2287
+ </tr>
2288
+
2289
+ </table>
2290
+ </form>
2291
+ <?php
2292
+
2293
+
2294
+ }
2295
+
2296
+
2297
+
2298
+
2299
+
2300
+
2301
+
2302
+
2303
+
2304
+
2305
+
2306
+
2307
+
2308
+
2309
+
2310
+
2311
+
2312
+ function html_Custom_text_in_email_for_administrator($row){
2313
+
2314
+
2315
+
2316
+
2317
+
2318
+ ?>
2319
+ <script type="text/javascript" language="javascript">
2320
+ function submit_in(pressbutton){
2321
+
2322
+
2323
+ document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
2324
+ document.getElementById('adminForm').submit();
2325
+
2326
+ }
2327
+ </script>
2328
+
2329
+ <table width="95%">
2330
+ <tbody> <tr>
2331
+ <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
2332
+ <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="color:red; text-decoration:none;">
2333
+ <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
2334
+ Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
2335
+ </a></div>
2336
+ </td>
2337
+ </tr><tr>
2338
+ <td width="100%"><h2>Text for Administrator - <?php echo $row->title; ?></h2></td>
2339
+ <td align="right"><input type="button" onclick="submit_in('Save_Custom_text_in_email_for_administrator')" value="Save" class="button-secondary action"> </td>
2340
+ <td align="right"><input type="button" onclick="submit_in('Apply_Custom_text_in_email_for_administrator')" value="Apply" class="button-secondary action"> </td>
2341
+ <td align="right"><input type="button" onclick="window.location.href='admin.php?page=contact_form&task=edit_form&id=<?php echo $row->id; ?>'" value="Cancel" class="button-secondary action"> </td>
2342
+ </tr>
2343
+ </tbody></table>
2344
+ <br />
2345
+ <form action="admin.php?page=contact_form&id=<?php echo $row->id; ?>" id="adminForm" method="post" name="adminForm">
2346
+ <table width="95%" style="border-color:#000; border:medium;" >
2347
+
2348
+ <tbody>
2349
+ <tr>
2350
+
2351
+ <th style="text-align:left">
2352
+
2353
+ <label for="message" style="text-align:left"> Text before Message </label>
2354
+ <br />
2355
+ </th>
2356
+ </tr>
2357
+ <tr>
2358
+
2359
+ <td style="width:95%; min-width:500px"><?php if(function_exists('the_editor') || function_exists('wp_editor')){if(get_bloginfo('version')<'3.3'){ the_editor ( $row->script1, $idd = 'script1', $prev_id = 'Mail_script1', $media_buttons = true, $tab_index = 1, $extended = true );} else wp_editor($row->script1, $idd = 'script1') ;} else {?>
2360
+
2361
+ <textarea style="width:100%" name="script1" id><?php echo $row->script1 ?></textarea>
2362
+ <?php } ?>
2363
+ <br />
2364
+ </td>
2365
+ </tr>
2366
+ <tr>
2367
+ <td>
2368
+ <hr />
2369
+ <h2 align="center">MESSAGE</h2>
2370
+ <hr />
2371
+ <br />
2372
+ </td>
2373
+ </tr>
2374
+ <tr>
2375
+
2376
+ <th style="text-align:left">
2377
+
2378
+ <label for="message" style="text-align:left"> Text after Message </label>
2379
+ <br />
2380
+ </th>
2381
+ </tr>
2382
+ <tr>
2383
+
2384
+ <td style="width:70%; min-width:500px"><?php if(function_exists('the_editor') || function_exists('wp_editor')){ if(get_bloginfo('version')<'3.3' ){the_editor ( $row->script2, $idd = 'script2', $prev_id = 'Mail_title2', $media_buttons = true, $tab_index = 2, $extended = true );}else wp_editor($row->script2, $idd = 'script2');}else { ?>
2385
+
2386
+ <textarea style="width:100%" name="script2"><?php echo $row->script2 ?></textarea>
2387
+ <?php } ?></td>
2388
+ </tr>
2389
+ </tbody>
2390
+ </table>
2391
+
2392
+ </form>
2393
+ <?php
2394
+
2395
+
2396
+
2397
+
2398
+
2399
+
2400
+
2401
+
2402
+
2403
+ }
2404
+
2405
+
2406
+
2407
+
2408
+
2409
+
2410
+
2411
+
2412
+
2413
+
2414
+
2415
+ function html_Custom_text_in_email_for_user($row){
2416
+
2417
+
2418
+
2419
+
2420
+
2421
+ ?>
2422
+ <script type="text/javascript" language="javascript">
2423
+ function submit_in(pressbutton){
2424
+
2425
+
2426
+ document.getElementById('adminForm').action=document.getElementById('adminForm').action+"&task="+pressbutton;
2427
+ document.getElementById('adminForm').submit();
2428
+
2429
+ }
2430
+ </script>
2431
+
2432
+ <table width="95%">
2433
+ <tbody> <tr>
2434
+ <td colspan="11"><div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
2435
+ <a href="http://web-dorado.com/files/fromContactForm.php" target="_blank" style="color:red; text-decoration:none;">
2436
+ <img src="<?php echo plugins_url( 'images/header.png' , __FILE__ ); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
2437
+ Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
2438
+ </a></div>
2439
+ </td>
2440
+ </tr><tr>
2441
+ <td width="100%"><h2>Text for User - <?php echo $row->title; ?></h2></td>
2442
+ <td align="right"><input type="button" onclick="submit_in('Save_Custom_text_in_email_for_user')" value="Save" class="button-secondary action"> </td>
2443
+ <td align="right"><input type="button" onclick="submit_in('Apply_Custom_text_in_email_for_user')" value="Apply" class="button-secondary action"> </td>
2444
+ <td align="right"><input type="button" onclick="window.location.href='admin.php?page=contact_form&task=edit_form&id=<?php echo $row->id; ?>'" value="Cancel" class="button-secondary action"> </td>
2445
+ </tr>
2446
+ </tbody></table>
2447
+ <br />
2448
+ <form action="admin.php?page=contact_form&id=<?php echo $row->id; ?>" id="adminForm" method="post" name="adminForm">
2449
+ <table width="95%" style="border-color:#000; border:medium;" >
2450
+
2451
+ <tbody>
2452
+ <tr>
2453
+
2454
+ <th style="text-align:left">
2455
+
2456
+ <label for="message" style="text-align:left"> Text before Message </label>
2457
+ <br />
2458
+ </th>
2459
+ </tr>
2460
+ <tr>
2461
+
2462
+ <td style="width:95%; min-width:500px"><?php if(function_exists('wp_editor') || function_exists('the_editor')){if(get_bloginfo('version')<'3.3'){ the_editor ( $row->script_user1, $idd = 'script_user1', $prev_id = 'Mail_script1', $media_buttons = true, $tab_index = 1, $extended = true );} else wp_editor($row->script_user1, $idd = 'script_user1');} else {?>
2463
+
2464
+ <textarea style="width:100%" name="script_user1" id><?php echo $row->script_user1 ?></textarea>
2465
+ <?php } ?>
2466
+ <br />
2467
+ </td>
2468
+ </tr>
2469
+ <tr>
2470
+ <td>
2471
+ <hr />
2472
+ <h2 align="center">MESSAGE</h2>
2473
+ <hr />
2474
+ <br />
2475
+ </td>
2476
+ </tr>
2477
+ <tr>
2478
+
2479
+ <th style="text-align:left">
2480
+
2481
+ <label for="message" style="text-align:left"> Text after Message </label>
2482
+ <br />
2483
+ </th>
2484
+ </tr>
2485
+ <tr>
2486
+
2487
+ <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 wp_editor($row->script_user2, $idd = 'script_user2');}else { ?>
2488
+
2489
+ <textarea style="width:100%" name="script_user2"><?php echo $row->script_user2 ?></textarea>
2490
+ <?php } ?></td>
2491
+ </tr>
2492
+ </tbody>
2493
+ </table>
2494
+
2495
+ </form>
2496
+ <?php
2497
+
2498
+
2499
+
2500
+
2501
+
2502
+
2503
+
2504
+
2505
+
2506
+ }
contact_form_functions.php CHANGED
@@ -1,839 +1,840 @@
1
- <?php
2
-
3
- if(!current_user_can('manage_options')) {
4
- die('Access Denied');
5
- }
6
-
7
-
8
-
9
-
10
- function display_form_lists(){
11
-
12
- global $wpdb;
13
- $sort["default_style"]="manage-column column-autor sortable desc";
14
- $sort["sortid_by"]="";
15
- if(isset($_POST['page_number']))
16
- {
17
-
18
- if($_POST['asc_or_desc'])
19
- {
20
- $sort["sortid_by"]=$_POST['order_by'];
21
- if($_POST['asc_or_desc']==1)
22
- {
23
- $sort["custom_style"]="manage-column column-title sorted asc";
24
- $sort["1_or_2"]="2";
25
- $order="ORDER BY ".$sort["sortid_by"]." ASC";
26
- }
27
- else
28
- {
29
- $sort["custom_style"]="manage-column column-title sorted desc";
30
- $sort["1_or_2"]="1";
31
- $order="ORDER BY ".$sort["sortid_by"]." DESC";
32
- }
33
- }
34
- else{
35
-
36
- $order="";
37
- }
38
-
39
- if($_POST['page_number'])
40
- {
41
- $limit=($_POST['page_number']-1)*20;
42
- }
43
- else
44
- {
45
- $limit=0;
46
- }
47
- }
48
- else
49
- {
50
- $order="";
51
- $limit=0;
52
- }
53
- if(isset($_POST['search_events_by_title'])){
54
- $search_tag=$_POST['search_events_by_title'];
55
- }
56
-
57
- else
58
- {
59
- $search_tag="";
60
- }
61
- if ( $search_tag ) {
62
- $where= ' WHERE title LIKE "%'.$search_tag.'%"';
63
- }
64
- else{
65
- $where="";
66
- }
67
- get_option('contact_form_forms');
68
- if(get_option('contact_form_forms')!=''){
69
- if($where)
70
- {
71
- $where.=' AND `id` IN ('.get_option('contact_form_forms').')';
72
- }
73
- else
74
- {
75
- $where.=' WHERE `id` IN ('.get_option('contact_form_forms').')';
76
- }
77
-
78
- }
79
- else
80
- {
81
- if($where)
82
- {
83
- $where.=' AND `id` IN (0)';
84
- }
85
- else
86
- {
87
- $where.=' WHERE `id` IN (0)';
88
- }
89
-
90
- }
91
-
92
-
93
-
94
- // get the total number of records
95
- $query = "SELECT COUNT(*) FROM ".$wpdb->prefix."formmaker". $where;
96
- $total = $wpdb->get_var($query);
97
- $pageNav['total'] =$total;
98
- $pageNav['limit'] = $limit/20+1;
99
-
100
- $query = "SELECT * FROM ".$wpdb->prefix."formmaker".$where." ". $order." "." LIMIT ".$limit.",20";
101
- $rows = $wpdb->get_results($query);
102
- $old_version = false;
103
- foreach($rows as $row)
104
- {
105
- if(strpos($row->form, "wdform_table1")===false)
106
- {
107
- $old_version = true;
108
- break;
109
- }
110
- }
111
-
112
- if($old_version)
113
- {
114
- $old_n=0;
115
- foreach($rows as $row)
116
- {
117
- if(strpos($row->form, "wdform_table1")===false)
118
- {
119
- $old_n++;
120
- }
121
- }
122
-
123
- @session_start();
124
- $_SESSION['all_updates']=$old_n;
125
- $_SESSION['current_updates']=0;
126
- }
127
-
128
- html_display_form_lists($rows, $pageNav, $sort,$old_version);
129
-
130
-
131
-
132
-
133
-
134
- }
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
- ////////////////////////////////// ADD FORM
143
-
144
-
145
-
146
-
147
-
148
-
149
-
150
-
151
-
152
- function add_form()
153
- {
154
-
155
- global $wpdb;
156
- $wpdb->show_errors();
157
- $query = "SELECT * FROM ".$wpdb->prefix."formmaker_themes WHERE `id` IN(".get_option('contact_form_themes').") ORDER BY title";
158
- $themes =$wpdb->get_results($query);
159
- html_add_form($themes);
160
-
161
- }
162
-
163
-
164
-
165
-
166
-
167
-
168
-
169
-
170
-
171
-
172
-
173
-
174
-
175
-
176
- ////////////////////////////////////// Edit Form
177
-
178
-
179
-
180
-
181
-
182
-
183
-
184
-
185
-
186
-
187
-
188
-
189
-
190
-
191
-
192
-
193
- function edit_contact_form($id)
194
- {
195
- global $wpdb;
196
- // load the row from the db table
197
- $row=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$id."' AND `id` IN(".get_option('contact_form_forms').")" );
198
-
199
- $labels= array();
200
-
201
- $label_id= array();
202
- $label_order_original= array();
203
- $label_type= array();
204
-
205
- $label_all = explode('#****#',$row->label_order);
206
- $label_all = array_slice($label_all,0, count($label_all)-1);
207
-
208
-
209
-
210
- foreach($label_all as $key => $label_each)
211
- {
212
- $label_id_each=explode('#**id**#',$label_each);
213
- array_push($label_id, $label_id_each[0]);
214
-
215
- $label_oder_each=explode('#**label**#', $label_id_each[1]);
216
- array_push($label_order_original, addslashes($label_oder_each[0]));
217
- array_push($label_type, $label_oder_each[1]);
218
-
219
-
220
-
221
- }
222
-
223
- $labels['id']='"'.implode('","',$label_id).'"';
224
- $labels['label']='"'.implode('","',$label_order_original).'"';
225
- $labels['type']='"'.implode('","',$label_type).'"';
226
-
227
- $query = "SELECT * FROM ".$wpdb->prefix."formmaker_themes WHERE `id` IN(".get_option('contact_form_themes').") ORDER BY title";
228
- $themes = $wpdb->get_results($query);
229
-
230
-
231
- html_edit_contact_form($row, $labels, $themes);
232
-
233
- }
234
-
235
-
236
-
237
-
238
-
239
-
240
-
241
-
242
-
243
- function save_form()
244
- {
245
-
246
- global $wpdb;
247
- if($_POST["title"]!=''){
248
- if(isset($_POST["label_order"]) && isset($_POST["title"]) && isset($_POST["form"])){
249
- $no_slash_form = stripslashes($_POST['form']);
250
- $no_slash_form_front= stripslashes($_POST['form_front']);
251
- $javascript="// before form is load
252
- function before_load()
253
- {
254
- }
255
- // before form submit
256
- function before_submit()
257
- {
258
- }
259
- // before form reset
260
- function before_reset()
261
- {
262
- }";
263
- $save_or_no= $wpdb->insert($wpdb->prefix.'formmaker', array(
264
- 'id' => NULL,
265
- 'title' => $_POST["title"],
266
- 'mail' => $_POST["mail"],
267
- 'form' => $no_slash_form,
268
- 'form_front' => $no_slash_form_front,
269
- 'theme' => $_POST["theme"],
270
- 'counter' => $_POST["counter"],
271
- 'label_order' => $_POST["label_order"],
272
- 'pagination' => $_POST["pagination"],
273
- 'show_title' => $_POST["show_title"],
274
- 'show_numbers' => $_POST["show_numbers"],
275
- 'public_key' => $_POST["public_key"],
276
- 'private_key' => $_POST["private_key"],
277
- 'recaptcha_theme' => $_POST["recaptcha_theme"],
278
- 'javascript' => $javascript
279
-
280
- ),
281
- array(
282
- '%d',
283
- '%s',
284
- '%s',
285
- '%s',
286
- '%s',
287
- '%d',
288
- '%d',
289
- '%s',
290
- '%s',
291
- '%s',
292
- '%s',
293
- '%s',
294
- '%s',
295
- '%s',
296
- '%s'
297
- )
298
- );
299
-
300
- if(!$save_or_no)
301
- {
302
-
303
- ?>
304
- <div class="updated"><p><strong><?php _e('Error. Please install plugin again'); ?></strong></p></div>
305
- <?php
306
- return false;
307
- }
308
- $id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
309
- $save_or_no= $wpdb->insert($wpdb->prefix.'formmaker_views', array(
310
- 'form_id' => $id
311
- ),
312
- array(
313
- '%d'
314
- )
315
- );
316
- ?>
317
-
318
- <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
319
- <?php
320
- $MAX_ID=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
321
- update_option( 'contact_form_forms', ( (get_option('contact_form_forms'))? (get_option('contact_form_forms')).','.$MAX_ID : $MAX_ID));
322
- return true;
323
- }
324
- else
325
- {
326
- ?>
327
- <h1>Error</h1>
328
- <?php
329
- exit;
330
- }
331
-
332
- }
333
- else{
334
- ?>
335
- <div class="updated"><p><strong><?php _e('could not save form '); ?></strong></p></div>
336
- <?php
337
- }
338
-
339
-
340
- }
341
-
342
-
343
- function save_as_copy(){
344
- global $wpdb;
345
-
346
-
347
- if(isset($_POST["label_order"]) && isset($_POST["title"]) && isset($_POST["form"]) && isset($_GET['id'])){
348
- $no_slash_form = stripslashes($_POST['form']);
349
- $no_slash_form_front= stripslashes($_POST['form_front']);
350
- $row_for_sav_as_copy=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id=".$_GET['id']);
351
- $javascript=$row_for_sav_as_copy->javascript;
352
-
353
- $save_or_no= $wpdb->insert($wpdb->prefix.'formmaker', array(
354
- 'id' => NULL,
355
- 'title' => $_POST["title"],
356
- 'mail' => $_POST["mail"],
357
- 'form' => $no_slash_form,
358
- 'form_front' => $no_slash_form_front,
359
- 'theme' => $_POST["theme"],
360
- 'counter' => $_POST["counter"],
361
- 'label_order' => $_POST["label_order"],
362
- 'pagination' => $_POST["pagination"],
363
- 'show_title' => $_POST["show_title"],
364
- 'show_numbers' => $_POST["show_numbers"],
365
- 'public_key' => $_POST["public_key"],
366
- 'private_key' => $_POST["private_key"],
367
- 'recaptcha_theme' => $_POST["recaptcha_theme"],
368
- 'javascript' => $javascript,
369
- 'script1' => $row_for_sav_as_copy->script1,
370
- 'script2' => $row_for_sav_as_copy->script2,
371
- 'script_user1' => $row_for_sav_as_copy->script_user1,
372
- 'script_user2' => $row_for_sav_as_copy->script_user2,
373
- 'submit_text' => $row_for_sav_as_copy->submit_text,
374
- 'url' => $row_for_sav_as_copy->url,
375
- 'article_id' => $row_for_sav_as_copy->article_id,
376
- ),
377
- array(
378
- '%d',
379
- '%s',
380
- '%s',
381
- '%s',
382
- '%s',
383
- '%d',
384
- '%d',
385
- '%d',
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
- '%s'
401
- )
402
- );
403
-
404
- if(!$save_or_no)
405
- {
406
-
407
- ?>
408
- <div class="updated"><p><strong><?php _e('Error. Please install plugin again'); ?></strong></p></div>
409
- <?php
410
- return false;
411
- }
412
- $MAX_ID=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
413
- update_option( 'contact_form_forms', ( (get_option('contact_form_forms'))? (get_option('contact_form_forms')).','.$MAX_ID : $MAX_ID));
414
- $id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
415
- $save_or_no= $wpdb->insert($wpdb->prefix.'formmaker_views', array(
416
- 'form_id' => $id
417
- ),
418
- array(
419
- '%d'
420
- )
421
- );
422
- ?>
423
-
424
- <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
425
- <?php
426
-
427
- return true;
428
- }
429
- else
430
- {
431
- ?>
432
- <h1>Error</h1>
433
- <
434
- <?php
435
- exit;
436
- }
437
-
438
-
439
-
440
-
441
- }
442
-
443
-
444
-
445
-
446
- function apply_form($id){
447
-
448
- global $wpdb;
449
- $no_slash_form = stripslashes($_POST['form']);
450
- $no_slash_form_front= stripslashes($_POST['form_front']);
451
- if($_POST["title"]!=''){
452
-
453
- $savedd=$wpdb->update($wpdb->prefix."formmaker", array(
454
- 'title' => $_POST["title"],
455
- 'mail' => $_POST["mail"],
456
- 'form' => $no_slash_form,
457
- 'form_front' => $no_slash_form_front,
458
- 'theme' => $_POST["theme"],
459
- 'counter' => $_POST["counter"],
460
- 'label_order' => $_POST["label_order"],
461
- 'pagination' => $_POST["pagination"],
462
- 'show_title' => $_POST["show_title"],
463
- 'show_numbers' => $_POST["show_numbers"],
464
- 'public_key' => $_POST["public_key"],
465
- 'private_key' => $_POST["private_key"],
466
- 'recaptcha_theme' => $_POST["recaptcha_theme"],
467
- ),
468
- array('id'=>$id),
469
- array(
470
- '%s',
471
- '%s',
472
- '%s',
473
- '%s',
474
- '%d',
475
- '%d',
476
- '%s',
477
- '%s',
478
- '%s',
479
- '%s',
480
- '%s',
481
- '%s',
482
- '%s'
483
- )
484
-
485
- );
486
- ?>
487
- <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
488
- <?php
489
-
490
-
491
- }
492
- else{
493
- ?>
494
- <div class="updated"><p><strong><?php _e('could not save form'); ?></strong></p></div>
495
- <?php
496
- }
497
- }
498
-
499
-
500
-
501
-
502
-
503
-
504
-
505
-
506
-
507
-
508
- function remove_form($id){
509
- global $wpdb;
510
-
511
- // If any item selected
512
-
513
- // Prepare sql statement, if cid array more than one,
514
- // will be "cid1, cid2, ..."
515
- // Create sql statement
516
-
517
- $arr=explode(',' , get_option('contact_form_forms'));
518
-
519
- $arr = array_diff($arr, array($id));
520
- $arr =implode(',',$arr );
521
- update_option( 'contact_form_forms', $arr);
522
- $sql_remov_form="DELETE FROM ".$wpdb->prefix."formmaker WHERE id='".$id."'";
523
- if(!$wpdb->query($sql_remov_form))
524
- {
525
- ?>
526
- <div id="message" class="error"><p>Form Not Deleted</p></div>
527
- <?php
528
- return false;
529
- }
530
-
531
- $sql_remov_form="DELETE FROM ".$wpdb->prefix."formmaker_views WHERE form_id='".$id."'";
532
- if(!$wpdb->query($sql_remov_form))
533
- {
534
- ?>
535
- <div id="message" class="error"><p>Form views Not Deleted</p></div>
536
- <?php
537
- return false;
538
- }
539
- $sql_remov_form="DELETE FROM ".$wpdb->prefix."formmaker_submits WHERE form_id='".$id."'";
540
- if(!$wpdb->query($sql_remov_form))
541
- {
542
- ?>
543
- <div id="message" class="error"><p>Form submits Not Deleted</p></div>
544
- <?php
545
- return false;
546
- }
547
-
548
- ?>
549
- <div class="updated"><p><strong><?php _e('Item Deleted.' ); ?></strong></p></div>
550
- <?php
551
-
552
- // Execute query
553
- }
554
-
555
-
556
-
557
-
558
-
559
-
560
-
561
-
562
-
563
-
564
-
565
-
566
-
567
-
568
-
569
-
570
-
571
-
572
- function forchrome($id){
573
- ?>
574
- <script type="text/javascript">
575
-
576
-
577
- window.onload=val;
578
-
579
- function val()
580
- {
581
- document.getElementById('adminForm').action="admin.php?page=contact_form&task=gotoedit&id=<?php echo $id;?>";
582
- document.getElementById('adminForm').submit();
583
- }
584
-
585
- </script>
586
- <form action="index.php" method="post" name="adminForm" id="adminForm">
587
- </form>
588
- <?php
589
- }
590
-
591
- function gotoedit(){
592
-
593
- ?>
594
- <div class="updated"><p><strong><?php _e('Item Saved' ); ?></strong></p></div>
595
- <?php
596
-
597
- }
598
-
599
-
600
-
601
-
602
-
603
-
604
-
605
-
606
- //////////////////////////////////////////// Actions after submission
607
-
608
-
609
-
610
-
611
-
612
-
613
-
614
-
615
-
616
-
617
-
618
-
619
-
620
-
621
-
622
- function Actions_after_submission($id){
623
- global $wpdb;
624
- $row=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$id."'");
625
- html_Actions_after_submission($row);
626
- }
627
-
628
-
629
-
630
-
631
- function Apply_Actions_after_submission($id){
632
- global $wpdb;
633
- if($_POST["submit_text_type"]==5)
634
- $sub_te_type= $_POST["page_name"];
635
- else
636
- {
637
- $sub_te_type= $_POST["post_name"];
638
- }
639
-
640
- $savedd=$wpdb->update($wpdb->prefix."formmaker", array(
641
- // 'javascript' => $_POST["counter"],
642
- 'submit_text' => $_POST["content"],
643
- 'url' => $_POST["url"],
644
- 'submit_text_type' => $_POST["submit_text_type"],
645
- // 'script1' => $_POST["show_numbers"],
646
- // 'script2' => $_POST["show_numbers"],
647
- // 'script_user1' => $_POST["show_numbers"],
648
- // 'script_user2' => $_POST["show_numbers"],
649
-
650
- 'article_id' =>$sub_te_type,
651
-
652
- ),
653
- array('id'=>$id),
654
- array(
655
- '%s',
656
- '%s',
657
- '%d',
658
- '%s'
659
- )
660
-
661
- );
662
-
663
- ?>
664
- <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
665
- <?php
666
-
667
- }
668
-
669
-
670
-
671
-
672
-
673
-
674
-
675
-
676
- //////////////////////////////////////////// Edit JavaScript
677
-
678
-
679
-
680
-
681
-
682
-
683
-
684
-
685
-
686
-
687
-
688
-
689
-
690
-
691
-
692
- function Edit_JavaScript($id){
693
- global $wpdb;
694
- $row=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$id."'");
695
- html_Edit_JavaScript($row);
696
- }
697
-
698
-
699
-
700
-
701
- function Apply_Edit_JavaScript($id){
702
- global $wpdb;
703
- $savedd=$wpdb->update($wpdb->prefix."formmaker", array(
704
- 'javascript' => stripslashes($_POST["javascript"]),
705
-
706
- // 'script1' => $_POST["show_numbers"],
707
- // 'script2' => $_POST["show_numbers"],
708
- // 'script_user1' => $_POST["show_numbers"],
709
- // 'script_user2' => $_POST["show_numbers"],
710
-
711
-
712
-
713
- ),
714
- array('id'=>$id),
715
- array(
716
- '%s'
717
- )
718
-
719
- );
720
- ?>
721
- <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
722
- <?php
723
-
724
-
725
- }
726
-
727
-
728
-
729
- //////////////////////////////////////////// Edit Custom text in email for administrator
730
-
731
-
732
-
733
-
734
-
735
-
736
-
737
-
738
-
739
-
740
-
741
-
742
-
743
-
744
-
745
- function Custom_text_in_email_for_administrator($id){
746
- global $wpdb;
747
- $row=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$id."'");
748
- html_Custom_text_in_email_for_administrator($row);
749
- }
750
-
751
-
752
-
753
-
754
- function Apply_Custom_text_in_email_for_administrator($id){
755
- global $wpdb;
756
- $savedd=$wpdb->update($wpdb->prefix."formmaker", array(
757
- 'script1' => stripslashes($_POST["script1"]),
758
- 'script2' => stripslashes($_POST["script2"]),
759
-
760
- ),
761
- array('id'=>$id),
762
- array(
763
- '%s',
764
- '%s'
765
- )
766
-
767
- );
768
- ?>
769
- <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
770
- <?php
771
-
772
-
773
-
774
- }
775
-
776
-
777
-
778
-
779
-
780
-
781
-
782
-
783
-
784
-
785
- //////////////////////////////////////////// Edit JavaScript
786
-
787
-
788
-
789
-
790
-
791
-
792
-
793
-
794
-
795
-
796
-
797
-
798
-
799
-
800
-
801
-
802
-
803
-
804
-
805
- function Custom_text_in_email_for_user($id){
806
- global $wpdb;
807
- $row=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$id."'");
808
- html_Custom_text_in_email_for_user($row);
809
- }
810
-
811
-
812
-
813
-
814
- function Apply_Custom_text_in_email_for_user($id){
815
- global $wpdb;
816
- $savedd=$wpdb->update($wpdb->prefix."formmaker", array(
817
- 'script_user1' => stripslashes($_POST["script_user1"]),
818
- 'script_user2' => stripslashes($_POST["script_user2"]),
819
-
820
- ),
821
- array('id'=>$id),
822
- array(
823
- '%s',
824
- '%s'
825
- )
826
-
827
- );
828
- ?>
829
- <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
830
- <?php
831
-
832
-
833
- }
834
-
835
-
836
-
837
-
838
-
839
-
 
1
+ <?php
2
+
3
+ if(!current_user_can('manage_options')) {
4
+ die('Access Denied');
5
+ }
6
+
7
+
8
+
9
+
10
+ function display_form_lists(){
11
+
12
+ global $wpdb;
13
+ $sort["default_style"]="manage-column column-autor sortable desc";
14
+ $sort["sortid_by"]="";
15
+ if(isset($_POST['page_number']))
16
+ {
17
+
18
+ if($_POST['asc_or_desc'])
19
+ {
20
+ $sort["sortid_by"] = $wpdb->escape($_POST['order_by']);
21
+ if($_POST['asc_or_desc']==1)
22
+ {
23
+ $sort["custom_style"]="manage-column column-title sorted asc";
24
+ $sort["1_or_2"]="2";
25
+ $order="ORDER BY ".$sort["sortid_by"]." ASC";
26
+ }
27
+ else
28
+ {
29
+ $sort["custom_style"]="manage-column column-title sorted desc";
30
+ $sort["1_or_2"]="1";
31
+ $order="ORDER BY ".$sort["sortid_by"]." DESC";
32
+ }
33
+ }
34
+ else{
35
+
36
+ $order="";
37
+ }
38
+
39
+ if($_POST['page_number'])
40
+ {
41
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
42
+ }
43
+ else
44
+ {
45
+ $limit=0;
46
+ }
47
+ }
48
+ else
49
+ {
50
+ $order="";
51
+ $limit=0;
52
+ }
53
+ if(isset($_POST['search_events_by_title'])){
54
+ $search_tag = esc_html($_POST['search_events_by_title']);
55
+ }
56
+
57
+ else
58
+ {
59
+ $search_tag="";
60
+ }
61
+ if ( $search_tag ) {
62
+ $where= ' WHERE title LIKE "%'.$search_tag.'%"';
63
+ }
64
+ else{
65
+ $where="";
66
+ }
67
+ get_option('contact_form_forms');
68
+ if(get_option('contact_form_forms')!=''){
69
+ if($where)
70
+ {
71
+ $where.=' AND `id` IN ('.get_option('contact_form_forms').')';
72
+ }
73
+ else
74
+ {
75
+ $where.=' WHERE `id` IN ('.get_option('contact_form_forms').')';
76
+ }
77
+
78
+ }
79
+ else
80
+ {
81
+ if($where)
82
+ {
83
+ $where.=' AND `id` IN (0)';
84
+ }
85
+ else
86
+ {
87
+ $where.=' WHERE `id` IN (0)';
88
+ }
89
+
90
+ }
91
+
92
+
93
+
94
+ // get the total number of records
95
+ $query = "SELECT COUNT(*) FROM ".$wpdb->prefix."formmaker". $where;
96
+ $total = $wpdb->get_var($query);
97
+ $pageNav['total'] =$total;
98
+ $pageNav['limit'] = $limit/20+1;
99
+
100
+ $query = "SELECT * FROM ".$wpdb->prefix."formmaker".$where." ". $order." "." LIMIT ".$limit.",20";
101
+ $rows = $wpdb->get_results($query);
102
+ $old_version = false;
103
+ foreach($rows as $row)
104
+ {
105
+ if(strpos($row->form, "wdform_table1")===false)
106
+ {
107
+ $old_version = true;
108
+ break;
109
+ }
110
+ }
111
+
112
+ if($old_version)
113
+ {
114
+ $old_n=0;
115
+ foreach($rows as $row)
116
+ {
117
+ if(strpos($row->form, "wdform_table1")===false)
118
+ {
119
+ $old_n++;
120
+ }
121
+ }
122
+
123
+ @session_start();
124
+ $_SESSION['all_updates']=$old_n;
125
+ $_SESSION['current_updates']=0;
126
+ }
127
+
128
+ html_display_form_lists($rows, $pageNav, $sort,$old_version);
129
+
130
+
131
+
132
+
133
+
134
+ }
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+ ////////////////////////////////// ADD FORM
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+ function add_form()
153
+ {
154
+
155
+ global $wpdb;
156
+ $wpdb->show_errors();
157
+ $query = "SELECT * FROM ".$wpdb->prefix."formmaker_themes WHERE `id` IN(".get_option('contact_form_themes').") ORDER BY title";
158
+ $themes =$wpdb->get_results($query);
159
+ html_add_form($themes);
160
+
161
+ }
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+ ////////////////////////////////////// Edit Form
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+ function edit_contact_form($id)
194
+ {
195
+ global $wpdb;
196
+ // load the row from the db table
197
+ $row=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$id."' AND `id` IN(".get_option('contact_form_forms').")" );
198
+
199
+ $labels= array();
200
+
201
+ $label_id= array();
202
+ $label_order_original= array();
203
+ $label_type= array();
204
+
205
+ $label_all = explode('#****#',$row->label_order);
206
+ $label_all = array_slice($label_all,0, count($label_all)-1);
207
+
208
+
209
+
210
+ foreach($label_all as $key => $label_each)
211
+ {
212
+ $label_id_each=explode('#**id**#',$label_each);
213
+ array_push($label_id, $label_id_each[0]);
214
+
215
+ $label_oder_each=explode('#**label**#', $label_id_each[1]);
216
+ array_push($label_order_original, addslashes($label_oder_each[0]));
217
+ array_push($label_type, $label_oder_each[1]);
218
+
219
+
220
+
221
+ }
222
+
223
+ $labels['id']='"'.implode('","',$label_id).'"';
224
+ $labels['label']='"'.implode('","',$label_order_original).'"';
225
+ $labels['type']='"'.implode('","',$label_type).'"';
226
+
227
+ $query = "SELECT * FROM ".$wpdb->prefix."formmaker_themes WHERE `id` IN(".get_option('contact_form_themes').") ORDER BY title";
228
+ $themes = $wpdb->get_results($query);
229
+
230
+
231
+ html_edit_contact_form($row, $labels, $themes);
232
+
233
+ }
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+ function save_form()
244
+ {
245
+
246
+ global $wpdb;
247
+ if($_POST["title"]!=''){
248
+ if(isset($_POST["label_order"]) && isset($_POST["title"]) && isset($_POST["form"])){
249
+ $no_slash_form = stripslashes($_POST['form']);
250
+ $no_slash_form_front= stripslashes($_POST['form_front']);
251
+ $javascript="// before form is load
252
+ function before_load()
253
+ {
254
+ }
255
+ // before form submit
256
+ function before_submit()
257
+ {
258
+ }
259
+ // before form reset
260
+ function before_reset()
261
+ {
262
+ }";
263
+ $save_or_no= $wpdb->insert($wpdb->prefix.'formmaker', array(
264
+ 'id' => NULL,
265
+ 'title' => $_POST["title"],
266
+ 'mail' => $_POST["mail"],
267
+ 'form' => $no_slash_form,
268
+ 'form_front' => $no_slash_form_front,
269
+ 'theme' => $_POST["theme"],
270
+ 'counter' => $_POST["counter"],
271
+ 'label_order' => $_POST["label_order"],
272
+ 'pagination' => $_POST["pagination"],
273
+ 'show_title' => $_POST["show_title"],
274
+ 'show_numbers' => $_POST["show_numbers"],
275
+ 'public_key' => $_POST["public_key"],
276
+ 'private_key' => $_POST["private_key"],
277
+ 'recaptcha_theme' => $_POST["recaptcha_theme"],
278
+ 'javascript' => $javascript
279
+
280
+ ),
281
+ array(
282
+ '%d',
283
+ '%s',
284
+ '%s',
285
+ '%s',
286
+ '%s',
287
+ '%d',
288
+ '%d',
289
+ '%s',
290
+ '%s',
291
+ '%s',
292
+ '%s',
293
+ '%s',
294
+ '%s',
295
+ '%s',
296
+ '%s'
297
+ )
298
+ );
299
+
300
+ if(!$save_or_no)
301
+ {
302
+
303
+ ?>
304
+ <div class="updated"><p><strong><?php _e('Error. Please install plugin again'); ?></strong></p></div>
305
+ <?php
306
+ return false;
307
+ }
308
+ $id=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
309
+ $save_or_no= $wpdb->insert($wpdb->prefix.'formmaker_views', array(
310
+ 'form_id' => $id
311
+ ),
312
+ array(
313
+ '%d'
314
+ )
315
+ );
316
+ ?>
317
+
318
+ <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
319
+ <?php
320
+ $MAX_ID=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
321
+ update_option( 'contact_form_forms', ( (get_option('contact_form_forms'))? (get_option('contact_form_forms')).','.$MAX_ID : $MAX_ID));
322
+ return true;
323
+ }
324
+ else
325
+ {
326
+ ?>
327
+ <h1>Error</h1>
328
+ <?php
329
+ exit;
330
+ }
331
+
332
+ }
333
+ else{
334
+ ?>
335
+ <div class="updated"><p><strong><?php _e('could not save form '); ?></strong></p></div>
336
+ <?php
337
+ }
338
+
339
+
340
+ }
341
+
342
+
343
+ function save_as_copy(){
344
+ global $wpdb;
345
+
346
+
347
+ if(isset($_POST["label_order"]) && isset($_POST["title"]) && isset($_POST["form"]) && isset($_GET['id'])){
348
+ $no_slash_form = stripslashes($_POST['form']);
349
+ $no_slash_form_front= stripslashes($_POST['form_front']);
350
+ $form_id = (int) $_GET['id'];
351
+ $row_for_sav_as_copy=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id=". $form_id);
352
+ $javascript=$row_for_sav_as_copy->javascript;
353
+
354
+ $save_or_no= $wpdb->insert($wpdb->prefix.'formmaker', array(
355
+ 'id' => NULL,
356
+ 'title' => $_POST["title"],
357
+ 'mail' => $_POST["mail"],
358
+ 'form' => $no_slash_form,
359
+ 'form_front' => $no_slash_form_front,
360
+ 'theme' => $_POST["theme"],
361
+ 'counter' => $_POST["counter"],
362
+ 'label_order' => $_POST["label_order"],
363
+ 'pagination' => $_POST["pagination"],
364
+ 'show_title' => $_POST["show_title"],
365
+ 'show_numbers' => $_POST["show_numbers"],
366
+ 'public_key' => $_POST["public_key"],
367
+ 'private_key' => $_POST["private_key"],
368
+ 'recaptcha_theme' => $_POST["recaptcha_theme"],
369
+ 'javascript' => $javascript,
370
+ 'script1' => $row_for_sav_as_copy->script1,
371
+ 'script2' => $row_for_sav_as_copy->script2,
372
+ 'script_user1' => $row_for_sav_as_copy->script_user1,
373
+ 'script_user2' => $row_for_sav_as_copy->script_user2,
374
+ 'submit_text' => $row_for_sav_as_copy->submit_text,
375
+ 'url' => $row_for_sav_as_copy->url,
376
+ 'article_id' => $row_for_sav_as_copy->article_id,
377
+ ),
378
+ array(
379
+ '%d',
380
+ '%s',
381
+ '%s',
382
+ '%s',
383
+ '%s',
384
+ '%d',
385
+ '%d',
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
+ '%s',
401
+ '%s'
402
+ )
403
+ );
404
+
405
+ if(!$save_or_no)
406
+ {
407
+
408
+ ?>
409
+ <div class="updated"><p><strong><?php _e('Error. Please install plugin again'); ?></strong></p></div>
410
+ <?php
411
+ return false;
412
+ }
413
+ $MAX_ID=$wpdb->get_var("SELECT MAX(id) FROM ".$wpdb->prefix."formmaker");
414
+ update_option( 'contact_form_forms', ( (get_option('contact_form_forms'))? (get_option('contact_form_forms')).','.$MAX_ID : $MAX_ID));
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
+ ),
419
+ array(
420
+ '%d'
421
+ )
422
+ );
423
+ ?>
424
+
425
+ <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
426
+ <?php
427
+
428
+ return true;
429
+ }
430
+ else
431
+ {
432
+ ?>
433
+ <h1>Error</h1>
434
+ <
435
+ <?php
436
+ exit;
437
+ }
438
+
439
+
440
+
441
+
442
+ }
443
+
444
+
445
+
446
+
447
+ function apply_form($id){
448
+
449
+ global $wpdb;
450
+ $no_slash_form = stripslashes($_POST['form']);
451
+ $no_slash_form_front= stripslashes($_POST['form_front']);
452
+ if($_POST["title"]!=''){
453
+
454
+ $savedd=$wpdb->update($wpdb->prefix."formmaker", array(
455
+ 'title' => $_POST["title"],
456
+ 'mail' => $_POST["mail"],
457
+ 'form' => $no_slash_form,
458
+ 'form_front' => $no_slash_form_front,
459
+ 'theme' => $_POST["theme"],
460
+ 'counter' => $_POST["counter"],
461
+ 'label_order' => $_POST["label_order"],
462
+ 'pagination' => $_POST["pagination"],
463
+ 'show_title' => $_POST["show_title"],
464
+ 'show_numbers' => $_POST["show_numbers"],
465
+ 'public_key' => $_POST["public_key"],
466
+ 'private_key' => $_POST["private_key"],
467
+ 'recaptcha_theme' => $_POST["recaptcha_theme"],
468
+ ),
469
+ array('id'=>$id),
470
+ array(
471
+ '%s',
472
+ '%s',
473
+ '%s',
474
+ '%s',
475
+ '%d',
476
+ '%d',
477
+ '%s',
478
+ '%s',
479
+ '%s',
480
+ '%s',
481
+ '%s',
482
+ '%s',
483
+ '%s'
484
+ )
485
+
486
+ );
487
+ ?>
488
+ <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
489
+ <?php
490
+
491
+
492
+ }
493
+ else{
494
+ ?>
495
+ <div class="updated"><p><strong><?php _e('could not save form'); ?></strong></p></div>
496
+ <?php
497
+ }
498
+ }
499
+
500
+
501
+
502
+
503
+
504
+
505
+
506
+
507
+
508
+
509
+ function remove_form($id){
510
+ global $wpdb;
511
+
512
+ // If any item selected
513
+
514
+ // Prepare sql statement, if cid array more than one,
515
+ // will be "cid1, cid2, ..."
516
+ // Create sql statement
517
+
518
+ $arr=explode(',' , get_option('contact_form_forms'));
519
+
520
+ $arr = array_diff($arr, array($id));
521
+ $arr =implode(',',$arr );
522
+ update_option( 'contact_form_forms', $arr);
523
+ $sql_remov_form="DELETE FROM ".$wpdb->prefix."formmaker WHERE id='".$id."'";
524
+ if(!$wpdb->query($sql_remov_form))
525
+ {
526
+ ?>
527
+ <div id="message" class="error"><p>Form Not Deleted</p></div>
528
+ <?php
529
+ return false;
530
+ }
531
+
532
+ $sql_remov_form="DELETE FROM ".$wpdb->prefix."formmaker_views WHERE form_id='".$id."'";
533
+ if(!$wpdb->query($sql_remov_form))
534
+ {
535
+ ?>
536
+ <div id="message" class="error"><p>Form views Not Deleted</p></div>
537
+ <?php
538
+ return false;
539
+ }
540
+ $sql_remov_form="DELETE FROM ".$wpdb->prefix."formmaker_submits WHERE form_id='".$id."'";
541
+ if(!$wpdb->query($sql_remov_form))
542
+ {
543
+ ?>
544
+ <div id="message" class="error"><p>Form submits Not Deleted</p></div>
545
+ <?php
546
+ return false;
547
+ }
548
+
549
+ ?>
550
+ <div class="updated"><p><strong><?php _e('Item Deleted.' ); ?></strong></p></div>
551
+ <?php
552
+
553
+ // Execute query
554
+ }
555
+
556
+
557
+
558
+
559
+
560
+
561
+
562
+
563
+
564
+
565
+
566
+
567
+
568
+
569
+
570
+
571
+
572
+
573
+ function forchrome($id){
574
+ ?>
575
+ <script type="text/javascript">
576
+
577
+
578
+ window.onload=val;
579
+
580
+ function val()
581
+ {
582
+ document.getElementById('adminForm').action="admin.php?page=contact_form&task=gotoedit&id=<?php echo $id;?>";
583
+ document.getElementById('adminForm').submit();
584
+ }
585
+
586
+ </script>
587
+ <form action="index.php" method="post" name="adminForm" id="adminForm">
588
+ </form>
589
+ <?php
590
+ }
591
+
592
+ function gotoedit(){
593
+
594
+ ?>
595
+ <div class="updated"><p><strong><?php _e('Item Saved' ); ?></strong></p></div>
596
+ <?php
597
+
598
+ }
599
+
600
+
601
+
602
+
603
+
604
+
605
+
606
+
607
+ //////////////////////////////////////////// Actions after submission
608
+
609
+
610
+
611
+
612
+
613
+
614
+
615
+
616
+
617
+
618
+
619
+
620
+
621
+
622
+
623
+ function Actions_after_submission($id){
624
+ global $wpdb;
625
+ $row=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$id."'");
626
+ html_Actions_after_submission($row);
627
+ }
628
+
629
+
630
+
631
+
632
+ function Apply_Actions_after_submission($id){
633
+ global $wpdb;
634
+ if($_POST["submit_text_type"]==5)
635
+ $sub_te_type= esc_html($_POST["page_name"]);
636
+ else
637
+ {
638
+ $sub_te_type= esc_html($_POST["post_name"]);
639
+ }
640
+
641
+ $savedd=$wpdb->update($wpdb->prefix."formmaker", array(
642
+ // 'javascript' => $_POST["counter"],
643
+ 'submit_text' => $_POST["content"],
644
+ 'url' => $_POST["url"],
645
+ 'submit_text_type' => $_POST["submit_text_type"],
646
+ // 'script1' => $_POST["show_numbers"],
647
+ // 'script2' => $_POST["show_numbers"],
648
+ // 'script_user1' => $_POST["show_numbers"],
649
+ // 'script_user2' => $_POST["show_numbers"],
650
+
651
+ 'article_id' =>$sub_te_type,
652
+
653
+ ),
654
+ array('id'=>$id),
655
+ array(
656
+ '%s',
657
+ '%s',
658
+ '%d',
659
+ '%s'
660
+ )
661
+
662
+ );
663
+
664
+ ?>
665
+ <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
666
+ <?php
667
+
668
+ }
669
+
670
+
671
+
672
+
673
+
674
+
675
+
676
+
677
+ //////////////////////////////////////////// Edit JavaScript
678
+
679
+
680
+
681
+
682
+
683
+
684
+
685
+
686
+
687
+
688
+
689
+
690
+
691
+
692
+
693
+ function Edit_JavaScript($id){
694
+ global $wpdb;
695
+ $row=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$id."'");
696
+ html_Edit_JavaScript($row);
697
+ }
698
+
699
+
700
+
701
+
702
+ function Apply_Edit_JavaScript($id){
703
+ global $wpdb;
704
+ $savedd=$wpdb->update($wpdb->prefix."formmaker", array(
705
+ 'javascript' => stripslashes($_POST["javascript"]),
706
+
707
+ // 'script1' => $_POST["show_numbers"],
708
+ // 'script2' => $_POST["show_numbers"],
709
+ // 'script_user1' => $_POST["show_numbers"],
710
+ // 'script_user2' => $_POST["show_numbers"],
711
+
712
+
713
+
714
+ ),
715
+ array('id'=>$id),
716
+ array(
717
+ '%s'
718
+ )
719
+
720
+ );
721
+ ?>
722
+ <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
723
+ <?php
724
+
725
+
726
+ }
727
+
728
+
729
+
730
+ //////////////////////////////////////////// Edit Custom text in email for administrator
731
+
732
+
733
+
734
+
735
+
736
+
737
+
738
+
739
+
740
+
741
+
742
+
743
+
744
+
745
+
746
+ function Custom_text_in_email_for_administrator($id){
747
+ global $wpdb;
748
+ $row=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$id."'");
749
+ html_Custom_text_in_email_for_administrator($row);
750
+ }
751
+
752
+
753
+
754
+
755
+ function Apply_Custom_text_in_email_for_administrator($id){
756
+ global $wpdb;
757
+ $savedd=$wpdb->update($wpdb->prefix."formmaker", array(
758
+ 'script1' => stripslashes($_POST["script1"]),
759
+ 'script2' => stripslashes($_POST["script2"]),
760
+
761
+ ),
762
+ array('id'=>$id),
763
+ array(
764
+ '%s',
765
+ '%s'
766
+ )
767
+
768
+ );
769
+ ?>
770
+ <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
771
+ <?php
772
+
773
+
774
+
775
+ }
776
+
777
+
778
+
779
+
780
+
781
+
782
+
783
+
784
+
785
+
786
+ //////////////////////////////////////////// Edit JavaScript
787
+
788
+
789
+
790
+
791
+
792
+
793
+
794
+
795
+
796
+
797
+
798
+
799
+
800
+
801
+
802
+
803
+
804
+
805
+
806
+ function Custom_text_in_email_for_user($id){
807
+ global $wpdb;
808
+ $row=$wpdb->get_row("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id='".$id."'");
809
+ html_Custom_text_in_email_for_user($row);
810
+ }
811
+
812
+
813
+
814
+
815
+ function Apply_Custom_text_in_email_for_user($id){
816
+ global $wpdb;
817
+ $savedd=$wpdb->update($wpdb->prefix."formmaker", array(
818
+ 'script_user1' => stripslashes($_POST["script_user1"]),
819
+ 'script_user2' => stripslashes($_POST["script_user2"]),
820
+
821
+ ),
822
+ array('id'=>$id),
823
+ array(
824
+ '%s',
825
+ '%s'
826
+ )
827
+
828
+ );
829
+ ?>
830
+ <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
831
+ <?php
832
+
833
+
834
+ }
835
+
836
+
837
+
838
+
839
+
840
+
contact_form_maker_widget.php CHANGED
@@ -1,65 +1,65 @@
1
- <?php
2
- global $contact_form_maker_function__once;
3
- class contact_form_maker_widget extends WP_Widget {
4
-
5
- // Constructor //
6
- function contact_form_maker_widget() {
7
- $widget_ops = array(
8
- 'classname' => 'contact_form_maker_widget',
9
- 'description' => 'Add Form Maker widget.'
10
- ); // Widget Settings
11
- $control_ops = array('id_base' => 'contact_form_maker_widget'); // Widget Control Settings
12
- $this->WP_Widget('contact_form_maker_widget', 'Contact 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 $contact_form_maker_function__once;
27
- if ($contact_form_maker_function__once) {
28
- $contact_form_maker_function__once = 0;
29
- }
30
- require_once("front_end_contact_form.php");
31
- echo contact_form_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_contact_form_maker = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."formmaker order by `id` DESC",0);
56
- foreach ($ids_contact_form_maker as $arr_contact_form_maker) {?>
57
- <option value="<?php echo $arr_contact_form_maker->id; ?>" <?php if ($arr_contact_form_maker->id == $instance['form_id']) {echo "SELECTED";} ?>><?php echo $arr_contact_form_maker->title; ?></option>
58
- <?php }?>
59
- </select>
60
- <?php
61
- }
62
- }
63
-
64
- add_action('widgets_init', create_function('', 'return register_widget("contact_form_maker_widget");'));
65
  ?>
1
+ <?php
2
+ global $contact_form_maker_function__once;
3
+ class contact_form_maker_widget extends WP_Widget {
4
+
5
+ // Constructor //
6
+ function contact_form_maker_widget() {
7
+ $widget_ops = array(
8
+ 'classname' => 'contact_form_maker_widget',
9
+ 'description' => 'Add Form Maker widget.'
10
+ ); // Widget Settings
11
+ $control_ops = array('id_base' => 'contact_form_maker_widget'); // Widget Control Settings
12
+ $this->WP_Widget('contact_form_maker_widget', 'Contact 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 $contact_form_maker_function__once;
27
+ if ($contact_form_maker_function__once) {
28
+ $contact_form_maker_function__once = 0;
29
+ }
30
+ require_once("front_end_contact_form.php");
31
+ echo contact_form_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_contact_form_maker = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."formmaker order by `id` DESC",0);
56
+ foreach ($ids_contact_form_maker as $arr_contact_form_maker) {?>
57
+ <option value="<?php echo $arr_contact_form_maker->id; ?>" <?php if ($arr_contact_form_maker->id == $instance['form_id']) {echo "SELECTED";} ?>><?php echo $arr_contact_form_maker->title; ?></option>
58
+ <?php }?>
59
+ </select>
60
+ <?php
61
+ }
62
+ }
63
+
64
+ add_action('widgets_init', create_function('', 'return register_widget("contact_form_maker_widget");'));
65
  ?>
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: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
  }
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
  }
front_end_contact_form.php CHANGED
@@ -1,1550 +1,1550 @@
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 show_contact_form($id)
11
- {
12
- global $wpdb;
13
- $row=$wpdb->get_row($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id=%d",$id ));
14
-
15
- if(!$row)
16
- return false;
17
- if(isset($_POST['Itemid'])){
18
- $Itemid=$_POST["Itemid".$id];
19
- }
20
- else{
21
- $Itemid="";
22
- }
23
-
24
- $form_theme=$wpdb->get_var($wpdb->prepare("SELECT css FROM ".$wpdb->prefix."formmaker_themes WHERE id=%d",$row->theme ));
25
- if(!$form_theme)
26
- return false;
27
-
28
- $label_id= array();
29
- $label_type= array();
30
-
31
- $label_all = explode('#****#',$row->label_order);
32
- $label_all = array_slice($label_all,0, count($label_all)-1);
33
-
34
- foreach($label_all as $key => $label_each)
35
- {
36
- $label_id_each=explode('#**id**#',$label_each);
37
- array_push($label_id, $label_id_each[0]);
38
-
39
- $label_order_each=explode('#**label**#', $label_id_each[1]);
40
-
41
- array_push($label_type, $label_order_each[1]);
42
- }
43
-
44
- return array($row, $Itemid, $label_id, $label_type, $form_theme);
45
- }
46
-
47
- function save_contact_form_data($form,$id)
48
- {
49
-
50
-
51
- $all_files=array();
52
- @session_start();
53
- if(isset($_POST["captcha_input"])){
54
- $captcha_input=$_POST["captcha_input"];
55
- }
56
- if(isset($_POST["recaptcha_response_field"])){
57
- $recaptcha_response_field=$_POST["recaptcha_response_field"];
58
- }
59
- $id_for_old=$id;
60
- if(!$form->form_front)
61
- $id='';
62
- if(isset($_POST["counter".$id]))
63
- {
64
- $counter=$_POST["counter".$id];
65
- if (isset($_POST["captcha_input"]))
66
- {
67
- $session_wd_captcha_code=isset($_SESSION[$id.'_wd_captcha_code'])?$_SESSION[$id.'_wd_captcha_code']:'-';
68
- if($captcha_input==$session_wd_captcha_code)
69
- {
70
-
71
-
72
- $all_files=contact_form_save_db($counter,$id_for_old);
73
- if(is_numeric($all_files))
74
- remove_contact_date($all_files,$id_for_old);
75
- else
76
- if(isset($counter))
77
- contact_form_gen_mail($counter, $all_files,$id_for_old);
78
-
79
- }
80
- else
81
- {
82
- echo "<script> alert('".addslashes(__('Error, incorrect Security code.', 'form_maker'))."');
83
- </script>";
84
- }
85
- }
86
-
87
- else
88
- if(isset($recaptcha_response_field))
89
- {
90
- $privatekey = $form->private_key;
91
-
92
- $resp = recaptcha_check_answer ($privatekey,$_SERVER["REMOTE_ADDR"],$_POST["recaptcha_challenge_field"],$recaptcha_response_field);
93
- if($resp->is_valid)
94
- {
95
- $all_files=contact_form_save_db($counter,$id_for_old);
96
- if(is_numeric($all_files))
97
- remove_contact_date($all_files,$id_for_old);
98
- else
99
- if(isset($counter))
100
- contact_form_gen_mail($counter, $all_files, $id_for_old);
101
-
102
- }
103
- else
104
- {
105
- echo "<script> alert('".addslashes(__('Error, incorrect Security code.', 'form_maker'))."');
106
- </script>";
107
- }
108
- }
109
-
110
- else
111
- {
112
-
113
- $all_files=contact_form_save_db($counter, $id_for_old);
114
- if(is_numeric($all_files))
115
- remove_contact_date($all_files, $id_for_old);
116
- else
117
- if(isset($counter))
118
- contact_form_gen_mail($counter, $all_files, $id_for_old);
119
-
120
- }
121
-
122
-
123
- return $all_files;
124
- }
125
-
126
- return $all_files;
127
-
128
-
129
- }
130
-
131
- function contact_form_save_db($counter,$id)
132
- {
133
-
134
- global $wpdb;
135
- $chgnac=true;
136
- $all_files=array();
137
- $form=$wpdb->get_row($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id= %d",$id));
138
-
139
- $id_old=$id;
140
- if(!$form->form_front){
141
- $id='';
142
-
143
- }
144
- $label_id= array();
145
- $label_label= array();
146
- $label_type= array();
147
-
148
- $label_all = explode('#****#',$form->label_order);
149
- $label_all = array_slice($label_all,0, count($label_all)-1);
150
-
151
- foreach($label_all as $key => $label_each)
152
- {
153
- $label_id_each=explode('#**id**#',$label_each);
154
- array_push($label_id, $label_id_each[0]);
155
-
156
- $label_order_each=explode('#**label**#', $label_id_each[1]);
157
-
158
- array_push($label_label, $label_order_each[0]);
159
- array_push($label_type, $label_order_each[1]);
160
- }
161
-
162
-
163
-
164
- $max = $wpdb->get_var("SELECT MAX( group_id ) FROM ".$wpdb->prefix."formmaker_submits" );
165
- foreach($label_type as $key => $type)
166
- {
167
- $value='';
168
- 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")
169
- continue;
170
-
171
- $i=$label_id[$key];
172
-
173
- if($type!="type_address")
174
- {
175
- $deleted=$_POST[$i."_type".$id];
176
- if(!isset($_POST[$i."_type".$id]))
177
- break;
178
- }
179
-
180
- switch ($type)
181
- {
182
- case 'type_text':
183
- case 'type_password':
184
- case 'type_textarea':
185
- case "type_submitter_mail":
186
- case "type_date":
187
- case "type_own_select":
188
- case "type_country":
189
- case "type_number":
190
- {
191
- $value=$_POST[$i."_element".$id];
192
- break;
193
- }
194
- case "type_mark_map":
195
- {
196
- $value=$_POST[$i."_long".$id].'***map***'.$_POST[$i."_lat".$id];
197
- break;
198
- }
199
-
200
- case "type_date_fields":
201
- {
202
- $value=$_POST[$i."_day".$id].'-'.$_POST[$i."_month".$id].'-'.$_POST[$i."_year".$id];
203
- break;
204
- }
205
-
206
- case "type_time":
207
- {
208
- $ss=$_POST[$i."_ss".$id];
209
- if(isset($_POST[$i."_ss".$id]))
210
- $value=$_POST[$i."_hh".$id].':'.$_POST[$i."_mm".$id].':'.$_POST[$i."_ss".$id];
211
- else
212
- $value=$_POST[$i."_hh".$id].':'.$_POST[$i."_mm".$id];
213
-
214
- $am_pm=$_POST[$i."_am_pm".$id];
215
- if(isset($_POST[$i."_am_pm".$id]))
216
- $value=$value.' '.$_POST[$i."_am_pm".$id];
217
-
218
- break;
219
- }
220
-
221
- case "type_phone":
222
- {
223
- $value=$_POST[$i."_element_first".$id].' '.$_POST[$i."_element_last".$id];
224
-
225
- break;
226
- }
227
-
228
- case "type_name":
229
- {
230
- $element_title=$_POST[$i."_element_title".$id];
231
- if(isset($_POST[$i."_element_title".$id]))
232
- $value=$_POST[$i."_element_title".$id].' '.$_POST[$i."_element_first".$id].' '.$_POST[$i."_element_last".$id].' '.$_POST[$i."_element_middle".$id];
233
- else
234
- $value=$_POST[$i."_element_first".$id].' '.$_POST[$i."_element_last".$id];
235
-
236
- break;
237
- }
238
-
239
- case "type_file_upload":
240
- {
241
- $file = $_FILES[$i.'_file'.$id];
242
- if($file['name'])
243
- {
244
- $untilupload = $form->form;
245
- $pos1 = strpos($untilupload, "***destinationskizb".$i."***");
246
- $pos2 = strpos($untilupload, "***destinationverj".$i."***");
247
- $destination = substr($untilupload, $pos1+(23+(strlen($i)-1)), $pos2-$pos1-(23+(strlen($i)-1)));
248
- $pos1 = strpos($untilupload, "***extensionskizb".$i."***");
249
- $pos2 = strpos($untilupload, "***extensionverj".$i."***");
250
- $extension = substr($untilupload, $pos1+(21+(strlen($i)-1)), $pos2-$pos1-(21+(strlen($i)-1)));
251
- $pos1 = strpos($untilupload, "***max_sizeskizb".$i."***");
252
- $pos2 = strpos($untilupload, "***max_sizeverj".$i."***");
253
- $max_size = substr($untilupload, $pos1+(20+(strlen($i)-1)), $pos2-$pos1-(20+(strlen($i)-1)));
254
- $fileName = $file['name'];
255
- $destination=str_replace(site_url().'/','',$destination);
256
- /*$destination = JPATH_SITE.DS.$_POST[$i.'_destination');
257
- $extension = $_POST[$i.'_extension');
258
- $max_size = $_POST[$i.'_max_size');*/
259
-
260
- $fileSize = $file['size'];
261
-
262
- if($fileSize > $max_size*1024)
263
- {
264
- echo "<script> alert('".addslashes(__('The file exceeds the allowed size of', 'form_maker')).$max_size." KB');</script>";
265
- return ($max+1);
266
- }
267
-
268
- $uploadedFileNameParts = explode('.',$fileName);
269
- $uploadedFileExtension = array_pop($uploadedFileNameParts);
270
- $to=strlen($fileName)-strlen($uploadedFileExtension)-1;
271
-
272
- $fileNameFree= substr($fileName,0, $to);
273
- $invalidFileExts = explode(',', $extension);
274
- $extOk = false;
275
-
276
- foreach($invalidFileExts as $key => $value)
277
- {
278
- if( is_numeric(strpos(strtolower($value), strtolower($uploadedFileExtension) )) )
279
- {
280
- $extOk = true;
281
- }
282
- }
283
-
284
- if ($extOk == false)
285
- {
286
- echo "<script> alert('".addslashes(__('Sorry, you are not allowed to upload this type of file.', 'form_maker'))."');</script>";
287
- return ($max+1);
288
- }
289
-
290
- $fileTemp = $file['tmp_name'];
291
- $p=1;
292
- while(file_exists( $destination."/".$fileName))
293
- {
294
- $to=strlen($file['name'])-strlen($uploadedFileExtension)-1;
295
- $fileName= substr($fileName,0, $to).'('.$p.').'.$uploadedFileExtension;
296
- $p++;
297
- }
298
-
299
- if(is_dir(ABSPATH.$destination)){
300
- if(!move_uploaded_file($fileTemp, ABSPATH.$destination.'/'.$fileName))
301
- {
302
- echo "<script> alert('".addslashes(__('Error, file cannot be moved.', 'form_maker'))."');</script>";
303
- return ($max+1);
304
-
305
- }
306
-
307
- }
308
- else
309
- {
310
- echo "<script> alert('".addslashes(__('Error, file cannot be moved.', 'form_maker'))."');</script>";
311
- return ($max+1);
312
- }
313
- $value= site_url().'/'.$destination.'/'.$fileName.'*@@url@@*';
314
-
315
- $file['tmp_name']=$destination."/".$fileName;
316
-
317
- array_push($all_files,$file);
318
-
319
- }
320
- break;
321
- }
322
-
323
- case 'type_address':
324
- {
325
- $value='*#*#*#';
326
- if(isset($_POST[$i."_street1".$id]))
327
- {
328
- $value=$_POST[$i."_street1".$id];
329
- break;
330
- }
331
-
332
- if(isset($_POST[$i."_street2".$id]))
333
- {
334
- $value=$_POST[$i."_street2".$id];
335
- break;
336
- }
337
-
338
- if(isset($_POST[$i."_city".$id]))
339
- {
340
- $value=$_POST[$i."_city".$id];
341
- break;
342
- }
343
-
344
-
345
- if(isset($_POST[$i."_state".$id]))
346
- {
347
- $value=$_POST[$i."_state".$id];
348
- break;
349
- }
350
-
351
-
352
- if(isset($_POST[$i."_postal".$id]))
353
- {
354
- $value=$_POST[$i."_postal".$id];
355
- break;
356
- }
357
-
358
-
359
- if(isset($_POST[$i."_country".$id]))
360
- {
361
- $value=$_POST[$i."_country".$id];
362
- break;
363
- }
364
-
365
- break;
366
- }
367
-
368
- case "type_hidden":
369
- {
370
- $value=$_POST[$label_label[$key]];
371
- break;
372
- }
373
-
374
- case "type_radio":
375
- {
376
- $element=$_POST[$i."_other_input".$id];
377
- if(isset($element))
378
- {
379
- $value=$element;
380
- break;
381
- }
382
-
383
- $value=$_POST[$i."_element".$id];
384
- break;
385
- }
386
-
387
- case "type_checkbox":
388
- {
389
-
390
-
391
- $start=-1;
392
- $value='';
393
- for($j=0; $j<100; $j++)
394
- {
395
-
396
- //$element=$_POST[$i."_element".$id.$j];
397
-
398
- if(isset($_POST[$i."_element".$id.$j]))
399
- {
400
- $start=$j;
401
- break;
402
- }
403
- }
404
- $other_element_id=-1;
405
- $is_other=$_POST[$i."_allow_other".$id];
406
- if($is_other=="yes")
407
- {
408
- $other_element_id=$_POST[$i."_allow_other_num".$id];
409
- }
410
-
411
- if($start!=-1)
412
- {
413
- for($j=$start; $j<100; $j++)
414
- {
415
- //$element=$_POST[$i."_element".$id.$j];
416
- if(isset($_POST[$i."_element".$id.$j])){
417
-
418
- if($j==$other_element_id)
419
- {
420
-
421
- $value=$value.$_POST[$i."_other_input".$id].'***br***';
422
- }
423
- else
424
- {
425
-
426
- $value=$value.$_POST[$i."_element".$id.$j].'***br***';
427
- }
428
- }
429
- }
430
- }
431
- break;
432
- }
433
-
434
- }
435
-
436
- if($type=="type_address")
437
- if( $value=='*#*#*#')
438
- break;
439
-
440
- $unique_element=$_POST[$i."_unique".$id];
441
- if($unique_element=='yes')
442
- {
443
- $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)));
444
- if ($unique)
445
- {
446
- 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>";
447
- return ($max+1);
448
- }
449
- }
450
- $ip=$_SERVER['REMOTE_ADDR'];
451
- $r=$wpdb->prefix."formmaker_submits";
452
-
453
- $save_or_no=$wpdb->insert($r, array(
454
- 'form_id' => $id_old,
455
- 'element_label' => $i,
456
- 'element_value' => addslashes($value),
457
- 'group_id' => ($max+1),
458
- 'date' => date('Y-m-d H:i:s'),
459
- 'ip' => $ip,
460
- ),
461
- array(
462
- '%d',
463
- '%s',
464
- '%s',
465
- '%d',
466
- '%s',
467
- '%s'
468
-
469
- )
470
- );
471
-
472
- if (!$save_or_no){return false;}
473
- $chgnac=false;
474
- }
475
- if($chgnac)
476
- { global $wpdb;
477
-
478
- if(count($all_files)==0)
479
- @session_start();
480
- if($form->submit_text_type!=4)
481
-
482
- $_SESSION['massage_after_submit']=addslashes(addslashes(__('Nothing was submitted.', 'form_maker')));
483
- $_SESSION['error_or_no']=1;
484
- $_SESSION['form_submit_type']=$form->submit_text_type.",".$form->id;
485
- wp_redirect($_SERVER["REQUEST_URI"]);
486
- exit;
487
- }
488
- return $all_files;
489
- }
490
-
491
-
492
-
493
- function contact_form_gen_mail($counter, $all_files, $id)
494
- {
495
- @session_start();
496
- global $wpdb;
497
-
498
- $row=$wpdb->get_row($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id=%d",$id));
499
- if(!$row->form_front)
500
- {
501
- $id='';
502
- }
503
- $label_order_original= array();
504
- $label_order_ids= array();
505
- $label_label= array();
506
- $label_type= array();
507
- $cc=array();
508
- $row_mail_one_time=1;
509
- $label_all = explode('#****#',$row->label_order);
510
- $label_all = array_slice($label_all,0, count($label_all)-1);
511
- foreach($label_all as $key => $label_each)
512
- {
513
- $label_id_each=explode('#**id**#',$label_each);
514
- $label_id=$label_id_each[0];
515
- array_push($label_order_ids,$label_id);
516
-
517
- $label_order_each=explode('#**label**#', $label_id_each[1]);
518
- $label_order_original[$label_id]=$label_order_each[0];
519
- array_push($label_label, $label_order_each[0]);
520
- array_push($label_type, $label_order_each[1]);
521
- }
522
-
523
-
524
- $list='<table border="1" cellpadding="3" cellspacing="0" style="width:600px;">';
525
- foreach($label_order_ids as $key => $label_order_id)
526
- {
527
- $i=$label_order_id;
528
- $type=$_POST[$i."_type".$id];
529
- if(isset($_POST[$i."_type".$id]))
530
- 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")
531
- {
532
- $element_label=$label_order_original[$i];
533
-
534
- switch ($type)
535
- {
536
- case 'type_text':
537
- case 'type_password':
538
- case 'type_textarea':
539
- case "type_date":
540
- case "type_own_select":
541
- case "type_country":
542
- case "type_number":
543
- {
544
- $element=$_POST[$i."_element".$id];
545
- if(isset($_POST[$i."_element".$id]))
546
- {
547
- $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="font-family:inherit; margin:0px; padding:0px">'.$element.'</pre></td></tr>';
548
- }
549
- break;
550
-
551
-
552
- }
553
-
554
- case "type_submitter_mail":
555
- {
556
- $element=$_POST[$i."_element".$id];
557
- if(isset($_POST[$i."_element".$id]))
558
- {
559
- $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="font-family:inherit; margin:0px; padding:0px">'.$element.'</pre></td></tr>';
560
- if($_POST[$i."_send".$id]=="yes")
561
- array_push($cc, $element);
562
- }
563
- break;
564
- }
565
-
566
- case "type_time":
567
- {
568
-
569
- $hh=$_POST[$i."_hh".$id];
570
- if(isset($_POST[$i."_hh".$id]))
571
- {
572
- $ss=$_POST[$i."_ss".$id];
573
- if(isset($_POST[$i."_ss".$id]))
574
- $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >'.$_POST[$i."_hh".$id].':'.$_POST[$i."_mm".$id].':'.$_POST[$i."_ss".$id];
575
- else
576
- $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >'.$_POST[$i."_hh".$id].':'.$_POST[$i."_mm".$id];
577
- $am_pm=$_POST[$i."_am_pm".$id];
578
- if(isset($_POST[$i."_am_pm".$id]))
579
- $list=$list.' '.$_POST[$i."_am_pm".$id].'</td></tr>';
580
- else
581
- $list=$list.'</td></tr>';
582
- }
583
-
584
- break;
585
- }
586
-
587
- case "type_phone":
588
- {
589
- $element_first=$_POST[$i."_element_first".$id];
590
- if(isset($_POST[$i."_element_first".$id]))
591
- {
592
- $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >'.$_POST[$i."_element_first".$id].' '.$_POST[$i."_element_last".$id].'</td></tr>';
593
- }
594
- break;
595
- }
596
-
597
- case "type_name":
598
- {
599
- $element_first=$_POST[$i."_element_first".$id];
600
- if(isset($_POST[$i."_element_first".$id]))
601
- {
602
- $element_title=$_POST[$i."_element_title".$id];
603
- if(isset($_POST[$i."_element_title".$id]))
604
- $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>';
605
- else
606
- $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >'.$_POST[$i."_element_first".$id].' '.$_POST[$i."_element_last".$id].'</td></tr>';
607
- }
608
- break;
609
- }
610
- case "type_mark_map":
611
- {
612
-
613
- if(isset($_POST[$i."_long".$id]))
614
- {
615
- $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >Longitude:'.$_POST[$i."_long".$id].'<br/>Latitude:'.$_POST[$i."_lat".$id].'</td></tr>';
616
- }
617
- break;
618
- }
619
-
620
- case "type_address":
621
- {
622
- $street1=$_POST[$i."_street1".$id];
623
- if(isset($_POST[$i."_street1".$id]))
624
- {
625
- $list=$list.'<tr valign="top"><td >'.$label_order_original[$i].'</td><td >'.$_POST[$i."_street1".$id].'</td></tr>';
626
- $i++;
627
- $list=$list.'<tr valign="top"><td >'.$label_order_original[$i].'</td><td >'.$_POST[$i."_street2".$id].'</td></tr>';
628
- $i++;
629
- $list=$list.'<tr valign="top"><td >'.$label_order_original[$i].'</td><td >'.$_POST[$i."_city".$id].'</td></tr>';
630
- $i++;
631
- $list=$list.'<tr valign="top"><td >'.$label_order_original[$i].'</td><td >'.$_POST[$i."_state".$id].'</td></tr>';
632
- $i++;
633
- $list=$list.'<tr valign="top"><td >'.$label_order_original[$i].'</td><td >'.$_POST[$i."_postal".$id].'</td></tr>';
634
- $i++;
635
- $list=$list.'<tr valign="top"><td >'.$label_order_original[$i].'</td><td >'.$_POST[$i."_country".$id].'</td></tr>';
636
- $i++;
637
- }
638
- break;
639
- }
640
-
641
- case "type_date_fields":
642
- {
643
- $day=$_POST[$i."_day".$id];
644
- if(isset($_POST[$i."_day".$id]))
645
- {
646
- $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >'.$_POST[$i."_day".$id].'-'.$_POST[$i."_month".$id].'-'.$_POST[$i."_year".$id].'</td></tr>';
647
- }
648
- break;
649
- }
650
-
651
- case "type_radio":
652
- {
653
- $element=$_POST[$i."_other_input".$id];
654
- if(isset($_POST[$i."_other_input".$id]))
655
- {
656
- $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >'.$_POST[$i."_other_input".$id].'</td></tr>';
657
- break;
658
- }
659
-
660
- $element=$_POST[$i."_element".$id];
661
- if(isset($_POST[$i."_element".$id]))
662
- {
663
- $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="font-family:inherit; margin:0px; padding:0px">'.$element.'</pre></td></tr>';
664
- }
665
- break;
666
- }
667
-
668
- case "type_checkbox":
669
- {
670
- $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >';
671
-
672
- $start=-1;
673
- for($j=0; $j<100; $j++)
674
- {
675
- if(isset($_POST[$i."_element".$id.$j]))
676
- {
677
- $start=$j;
678
- break;
679
- }
680
- }
681
- $other_element_id=-1;
682
- $is_other=$_POST[$i."_allow_other".$id];
683
- if($is_other=="yes")
684
- {
685
- $other_element_id=$_POST[$i."_allow_other_num".$id];
686
- }
687
-
688
-
689
- if($start!=-1)
690
- {
691
- for($j=$start; $j<100; $j++)
692
- {
693
-
694
- $element=$_POST[$i."_element".$id.$j];
695
- if(isset($_POST[$i."_element".$id.$j]))
696
- if($j==$other_element_id)
697
- {
698
- $list=$list.$_POST[$i."_other_input".$id].'<br>';
699
- }
700
- else
701
-
702
- $list=$list.$_POST[$i."_element".$id.$j].'<br>';
703
- }
704
- $list=$list.'</td></tr>';
705
- }
706
-
707
-
708
- break;
709
- }
710
- default: break;
711
- }
712
-
713
- }
714
-
715
- }
716
- $list=$list.'</table>';
717
- $list = wordwrap($list, 70, "\n", true);
718
- add_filter('wp_mail_content_type',create_function('', 'return "text/html";'));
719
- var_dump($all_files);
720
- for($k=0;$k<count($all_files);$k++){
721
- $attachment[$k]= dirname(__FILE__). '/uploads/'.$all_files[$k]['name'];
722
- }
723
- if(isset($cc[0]))
724
- {
725
- foreach ($cc as $c)
726
- {
727
-
728
-
729
- if($c)
730
- {
731
-
732
- $recipient = $c;
733
- $subject = $row->title;
734
- $body = $row->script_user1.'<br>'.$list.'<br>'.$row->script_user2;
735
- $send=wp_mail($recipient, $subject, $body, "",$attachment);
736
- }
737
-
738
-
739
- if($row->mail)
740
- {
741
- if($c)
742
- {
743
- $headers_form_mail = 'From: '.$c.' <'.$c.'>' . "\r\n";
744
-
745
- }
746
- else
747
- {
748
- $headers_form_mail ="";
749
- }
750
- if($row_mail_one_time){
751
- $recipient = $row->mail;
752
- $subject = $row->title;
753
- $body = $row->script1.'<br>'.$list.'<br>'.$row->script2;
754
- $mode = 1;
755
-
756
- $send=wp_mail($recipient, $subject, $body, $headers_form_mail,$attachment);
757
- $row_mail_one_time=0;
758
- }
759
- }
760
- }
761
- }
762
- else
763
- {
764
- if($row->mail)
765
- {
766
- $recipient = $row->mail;
767
- $subject = $row->title;
768
- $body = $row->script1.'<br>'.$list.'<br>'.$row->script2;
769
- $mode = 1;
770
-
771
- $send=wp_mail($recipient, $subject, $body, "",$attachment);
772
- }
773
- }
774
- if($row->mail)
775
- {
776
- if ( $send != true )
777
- {
778
- @session_start();
779
- $_SESSION['error_or_no']=1;
780
- $msg=addslashes(__('Error, email was not sent.', 'form_maker'));
781
- }
782
- else
783
- {
784
- @session_start();
785
- $_SESSION['error_or_no']=0;
786
- $msg=addslashes(__('Your form was successfully submitted.', 'form_maker'));
787
- }
788
- }
789
- else
790
- {
791
-
792
- @session_start();
793
- $_SESSION['error_or_no']=0;
794
- $msg=addslashes(__('Your form was successfully submitted.', 'form_maker'));
795
- }
796
-
797
- switch($row->submit_text_type)
798
- {
799
- case "2":
800
- case "5":
801
- {
802
- @session_start();
803
- if($row->submit_text_type!=4)
804
- $_SESSION['massage_after_submit']=$msg;
805
- $_SESSION['form_submit_type']=$row->submit_text_type.",".$row->id;
806
- if($row->article_id)
807
- wp_redirect($row->article_id);
808
- else
809
- wp_redirect($_SERVER["REQUEST_URI"]);
810
-
811
- exit;
812
- break;
813
- }
814
- case "3":
815
- {
816
- @session_start();
817
- if($row->submit_text_type!=4)
818
- $_SESSION['massage_after_submit']=$msg;
819
- $_SESSION['form_submit_type']=$row->submit_text_type.",".$row->id;
820
- wp_redirect($_SERVER["REQUEST_URI"]);
821
-
822
- exit;
823
- break;
824
- }
825
- case "4":
826
- {
827
- @session_start();
828
- if($row->submit_text_type!=4)
829
- $_SESSION['massage_after_submit']=$msg;
830
- $_SESSION['form_submit_type']=$row->submit_text_type.",".$row->id;
831
- wp_redirect($row->url);
832
-
833
- exit;
834
- break;
835
- }
836
- default:
837
- {
838
- @session_start();
839
- if($row->submit_text_type!=4)
840
- $_SESSION['massage_after_submit']= $msg;
841
- $_SESSION['form_submit_type']=$row->submit_text_type.",".$row->id;
842
- wp_redirect($_SERVER["REQUEST_URI"]);
843
-
844
- exit;
845
- break;
846
- }
847
- }
848
- }
849
-
850
- /*function sendMail($from='', $fromname='', $recipient, $subject, $body, $mode=0, $cc=null, $bcc=null, $attachment=null, $replyto=null, $replytoname=null)
851
- {
852
- $recipient=explode (',', str_replace(' ', '', $recipient ));
853
- // Get a JMail instance
854
- $mail = &JFactory::getMailer();
855
-
856
- $mail->setSender(array($from, $fromname));
857
- $mail->setSubject($subject);
858
- $mail->setBody($body);
859
-
860
- // Are we sending the email as HTML?
861
- if ($mode) {
862
- $mail->IsHTML(true);
863
- }
864
-
865
- $mail->addRecipient($recipient);
866
- $mail->addCC($cc);
867
- $mail->addBCC($bcc);
868
-
869
- if($attachment)
870
- foreach($attachment as $attachment_temp)
871
- {
872
- $mail->addAttachment($attachment_temp[0], $attachment_temp[1], $attachment_temp[2]);
873
- }
874
-
875
- // Take care of reply email addresses
876
- if (is_array($replyto)) {
877
- $numReplyTo = count($replyto);
878
- for ($i=0; $i < $numReplyTo; $i++){
879
- $mail->addReplyTo(array($replyto[$i], $replytoname[$i]));
880
- }
881
- } elseif (isset($replyto)) {
882
- $mail->addReplyTo(array($replyto, $replytoname));
883
- }
884
-
885
- return $mail->Send();
886
- }
887
-
888
- */
889
-
890
- function remove_contact_date($group_id)
891
- {
892
- global $wpdb;
893
- $wpdb->query($wpdb->prepare('DELETE FROM '.$wpdb->prefix.'formmaker_submits WHERE group_id= %d',$group_id));
894
-
895
- }
896
-
897
-
898
-
899
-
900
-
901
-
902
-
903
-
904
-
905
-
906
-
907
-
908
-
909
- ////////////////////////////////////////////////////// DISPLAY
910
-
911
-
912
-
913
-
914
-
915
-
916
-
917
-
918
-
919
-
920
-
921
-
922
- function contact_form_front_end($id){
923
- $form_maker_front_end="";
924
- $result =show_contact_form($id);
925
- if(!$result)
926
- return;
927
- $ok =save_contact_form_data($result[0],$id);
928
- if(is_numeric($ok))
929
- remove_contact_date($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
- return $form_maker_front_end;
1548
- }
1549
-
1550
-
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 show_contact_form($id)
11
+ {
12
+ global $wpdb;
13
+ $row=$wpdb->get_row($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id=%d",$id ));
14
+
15
+ if(!$row)
16
+ return false;
17
+ if(isset($_POST['Itemid'])){
18
+ $Itemid = esc_html($_POST["Itemid" . $id]);
19
+ }
20
+ else{
21
+ $Itemid="";
22
+ }
23
+
24
+ $form_theme=$wpdb->get_var($wpdb->prepare("SELECT css FROM ".$wpdb->prefix."formmaker_themes WHERE id=%d",$row->theme ));
25
+ if(!$form_theme)
26
+ return false;
27
+
28
+ $label_id= array();
29
+ $label_type= array();
30
+
31
+ $label_all = explode('#****#',$row->label_order);
32
+ $label_all = array_slice($label_all,0, count($label_all)-1);
33
+
34
+ foreach($label_all as $key => $label_each)
35
+ {
36
+ $label_id_each=explode('#**id**#',$label_each);
37
+ array_push($label_id, $label_id_each[0]);
38
+
39
+ $label_order_each=explode('#**label**#', $label_id_each[1]);
40
+
41
+ array_push($label_type, $label_order_each[1]);
42
+ }
43
+
44
+ return array($row, $Itemid, $label_id, $label_type, $form_theme);
45
+ }
46
+
47
+ function save_contact_form_data($form,$id)
48
+ {
49
+
50
+
51
+ $all_files=array();
52
+ @session_start();
53
+ if(isset($_POST["captcha_input"])){
54
+ $captcha_input = esc_html($_POST["captcha_input"]);
55
+ }
56
+ if(isset($_POST["recaptcha_response_field"])){
57
+ $recaptcha_response_field = esc_html($_POST["recaptcha_response_field"]);
58
+ }
59
+ $id_for_old=$id;
60
+ if(!$form->form_front)
61
+ $id='';
62
+ if(isset($_POST["counter".$id]))
63
+ {
64
+ $counter = esc_html($_POST["counter".$id]);
65
+ if (isset($_POST["captcha_input"]))
66
+ {
67
+ $session_wd_captcha_code=isset($_SESSION[$id.'_wd_captcha_code'])?$_SESSION[$id.'_wd_captcha_code']:'-';
68
+ if($captcha_input==$session_wd_captcha_code)
69
+ {
70
+
71
+
72
+ $all_files=contact_form_save_db($counter,$id_for_old);
73
+ if(is_numeric($all_files))
74
+ remove_contact_date($all_files,$id_for_old);
75
+ else
76
+ if(isset($counter))
77
+ contact_form_gen_mail($counter, $all_files,$id_for_old);
78
+
79
+ }
80
+ else
81
+ {
82
+ echo "<script> alert('".addslashes(__('Error, incorrect Security code.', 'form_maker'))."');
83
+ </script>";
84
+ }
85
+ }
86
+
87
+ else
88
+ if(isset($recaptcha_response_field))
89
+ {
90
+ $privatekey = $form->private_key;
91
+
92
+ $resp = recaptcha_check_answer ($privatekey,$_SERVER["REMOTE_ADDR"],$_POST["recaptcha_challenge_field"],$recaptcha_response_field);
93
+ if($resp->is_valid)
94
+ {
95
+ $all_files=contact_form_save_db($counter,$id_for_old);
96
+ if(is_numeric($all_files))
97
+ remove_contact_date($all_files,$id_for_old);
98
+ else
99
+ if(isset($counter))
100
+ contact_form_gen_mail($counter, $all_files, $id_for_old);
101
+
102
+ }
103
+ else
104
+ {
105
+ echo "<script> alert('".addslashes(__('Error, incorrect Security code.', 'form_maker'))."');
106
+ </script>";
107
+ }
108
+ }
109
+
110
+ else
111
+ {
112
+
113
+ $all_files=contact_form_save_db($counter, $id_for_old);
114
+ if(is_numeric($all_files))
115
+ remove_contact_date($all_files, $id_for_old);
116
+ else
117
+ if(isset($counter))
118
+ contact_form_gen_mail($counter, $all_files, $id_for_old);
119
+
120
+ }
121
+
122
+
123
+ return $all_files;
124
+ }
125
+
126
+ return $all_files;
127
+
128
+
129
+ }
130
+
131
+ function contact_form_save_db($counter,$id)
132
+ {
133
+
134
+ global $wpdb;
135
+ $chgnac=true;
136
+ $all_files=array();
137
+ $form=$wpdb->get_row($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id= %d",$id));
138
+
139
+ $id_old=$id;
140
+ if(!$form->form_front){
141
+ $id='';
142
+
143
+ }
144
+ $label_id= array();
145
+ $label_label= array();
146
+ $label_type= array();
147
+
148
+ $label_all = explode('#****#',$form->label_order);
149
+ $label_all = array_slice($label_all,0, count($label_all)-1);
150
+
151
+ foreach($label_all as $key => $label_each)
152
+ {
153
+ $label_id_each=explode('#**id**#',$label_each);
154
+ array_push($label_id, $label_id_each[0]);
155
+
156
+ $label_order_each=explode('#**label**#', $label_id_each[1]);
157
+
158
+ array_push($label_label, $label_order_each[0]);
159
+ array_push($label_type, $label_order_each[1]);
160
+ }
161
+
162
+
163
+
164
+ $max = $wpdb->get_var("SELECT MAX( group_id ) FROM ".$wpdb->prefix."formmaker_submits" );
165
+ foreach($label_type as $key => $type)
166
+ {
167
+ $value='';
168
+ 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")
169
+ continue;
170
+
171
+ $i=$label_id[$key];
172
+
173
+ if($type!="type_address")
174
+ {
175
+ $deleted=$_POST[$i."_type".$id];
176
+ if(!isset($_POST[$i."_type".$id]))
177
+ break;
178
+ }
179
+
180
+ switch ($type)
181
+ {
182
+ case 'type_text':
183
+ case 'type_password':
184
+ case 'type_textarea':
185
+ case "type_submitter_mail":
186
+ case "type_date":
187
+ case "type_own_select":
188
+ case "type_country":
189
+ case "type_number":
190
+ {
191
+ $value=$_POST[$i."_element".$id];
192
+ break;
193
+ }
194
+ case "type_mark_map":
195
+ {
196
+ $value=$_POST[$i."_long".$id].'***map***'.$_POST[$i."_lat".$id];
197
+ break;
198
+ }
199
+
200
+ case "type_date_fields":
201
+ {
202
+ $value=$_POST[$i."_day".$id].'-'.$_POST[$i."_month".$id].'-'.$_POST[$i."_year".$id];
203
+ break;
204
+ }
205
+
206
+ case "type_time":
207
+ {
208
+ $ss=$_POST[$i."_ss".$id];
209
+ if(isset($_POST[$i."_ss".$id]))
210
+ $value=$_POST[$i."_hh".$id].':'.$_POST[$i."_mm".$id].':'.$_POST[$i."_ss".$id];
211
+ else
212
+ $value=$_POST[$i."_hh".$id].':'.$_POST[$i."_mm".$id];
213
+
214
+ $am_pm=$_POST[$i."_am_pm".$id];
215
+ if(isset($_POST[$i."_am_pm".$id]))
216
+ $value=$value.' '.$_POST[$i."_am_pm".$id];
217
+
218
+ break;
219
+ }
220
+
221
+ case "type_phone":
222
+ {
223
+ $value=$_POST[$i."_element_first".$id].' '.$_POST[$i."_element_last".$id];
224
+
225
+ break;
226
+ }
227
+
228
+ case "type_name":
229
+ {
230
+ $element_title=$_POST[$i."_element_title".$id];
231
+ if(isset($_POST[$i."_element_title".$id]))
232
+ $value=$_POST[$i."_element_title".$id].' '.$_POST[$i."_element_first".$id].' '.$_POST[$i."_element_last".$id].' '.$_POST[$i."_element_middle".$id];
233
+ else
234
+ $value=$_POST[$i."_element_first".$id].' '.$_POST[$i."_element_last".$id];
235
+
236
+ break;
237
+ }
238
+
239
+ case "type_file_upload":
240
+ {
241
+ $file = $_FILES[$i.'_file'.$id];
242
+ if($file['name'])
243
+ {
244
+ $untilupload = $form->form;
245
+ $pos1 = strpos($untilupload, "***destinationskizb".$i."***");
246
+ $pos2 = strpos($untilupload, "***destinationverj".$i."***");
247
+ $destination = substr($untilupload, $pos1+(23+(strlen($i)-1)), $pos2-$pos1-(23+(strlen($i)-1)));
248
+ $pos1 = strpos($untilupload, "***extensionskizb".$i."***");
249
+ $pos2 = strpos($untilupload, "***extensionverj".$i."***");
250
+ $extension = substr($untilupload, $pos1+(21+(strlen($i)-1)), $pos2-$pos1-(21+(strlen($i)-1)));
251
+ $pos1 = strpos($untilupload, "***max_sizeskizb".$i."***");
252
+ $pos2 = strpos($untilupload, "***max_sizeverj".$i."***");
253
+ $max_size = substr($untilupload, $pos1+(20+(strlen($i)-1)), $pos2-$pos1-(20+(strlen($i)-1)));
254
+ $fileName = $file['name'];
255
+ $destination=str_replace(site_url().'/','',$destination);
256
+ /*$destination = JPATH_SITE.DS.$_POST[$i.'_destination');
257
+ $extension = $_POST[$i.'_extension');
258
+ $max_size = $_POST[$i.'_max_size');*/
259
+
260
+ $fileSize = $file['size'];
261
+
262
+ if($fileSize > $max_size*1024)
263
+ {
264
+ echo "<script> alert('".addslashes(__('The file exceeds the allowed size of', 'form_maker')).$max_size." KB');</script>";
265
+ return ($max+1);
266
+ }
267
+
268
+ $uploadedFileNameParts = explode('.',$fileName);
269
+ $uploadedFileExtension = array_pop($uploadedFileNameParts);
270
+ $to=strlen($fileName)-strlen($uploadedFileExtension)-1;
271
+
272
+ $fileNameFree= substr($fileName,0, $to);
273
+ $invalidFileExts = explode(',', $extension);
274
+ $extOk = false;
275
+
276
+ foreach($invalidFileExts as $key => $value)
277
+ {
278
+ if( is_numeric(strpos(strtolower($value), strtolower($uploadedFileExtension) )) )
279
+ {
280
+ $extOk = true;
281
+ }
282
+ }
283
+
284
+ if ($extOk == false)
285
+ {
286
+ echo "<script> alert('".addslashes(__('Sorry, you are not allowed to upload this type of file.', 'form_maker'))."');</script>";
287
+ return ($max+1);
288
+ }
289
+
290
+ $fileTemp = $file['tmp_name'];
291
+ $p=1;
292
+ while(file_exists( $destination."/".$fileName))
293
+ {
294
+ $to=strlen($file['name'])-strlen($uploadedFileExtension)-1;
295
+ $fileName= substr($fileName,0, $to).'('.$p.').'.$uploadedFileExtension;
296
+ $p++;
297
+ }
298
+
299
+ if(is_dir(ABSPATH.$destination)){
300
+ if(!move_uploaded_file($fileTemp, ABSPATH.$destination.'/'.$fileName))
301
+ {
302
+ echo "<script> alert('".addslashes(__('Error, file cannot be moved.', 'form_maker'))."');</script>";
303
+ return ($max+1);
304
+
305
+ }
306
+
307
+ }
308
+ else
309
+ {
310
+ echo "<script> alert('".addslashes(__('Error, file cannot be moved.', 'form_maker'))."');</script>";
311
+ return ($max+1);
312
+ }
313
+ $value= site_url().'/'.$destination.'/'.$fileName.'*@@url@@*';
314
+
315
+ $file['tmp_name']=$destination."/".$fileName;
316
+
317
+ array_push($all_files,$file);
318
+
319
+ }
320
+ break;
321
+ }
322
+
323
+ case 'type_address':
324
+ {
325
+ $value='*#*#*#';
326
+ if(isset($_POST[$i."_street1".$id]))
327
+ {
328
+ $value=$_POST[$i."_street1".$id];
329
+ break;
330
+ }
331
+
332
+ if(isset($_POST[$i."_street2".$id]))
333
+ {
334
+ $value=$_POST[$i."_street2".$id];
335
+ break;
336
+ }
337
+
338
+ if(isset($_POST[$i."_city".$id]))
339
+ {
340
+ $value=$_POST[$i."_city".$id];
341
+ break;
342
+ }
343
+
344
+
345
+ if(isset($_POST[$i."_state".$id]))
346
+ {
347
+ $value=$_POST[$i."_state".$id];
348
+ break;
349
+ }
350
+
351
+
352
+ if(isset($_POST[$i."_postal".$id]))
353
+ {
354
+ $value=$_POST[$i."_postal".$id];
355
+ break;
356
+ }
357
+
358
+
359
+ if(isset($_POST[$i."_country".$id]))
360
+ {
361
+ $value=$_POST[$i."_country".$id];
362
+ break;
363
+ }
364
+
365
+ break;
366
+ }
367
+
368
+ case "type_hidden":
369
+ {
370
+ $value=$_POST[$label_label[$key]];
371
+ break;
372
+ }
373
+
374
+ case "type_radio":
375
+ {
376
+ $element=$_POST[$i."_other_input".$id];
377
+ if(isset($element))
378
+ {
379
+ $value=$element;
380
+ break;
381
+ }
382
+
383
+ $value=$_POST[$i."_element".$id];
384
+ break;
385
+ }
386
+
387
+ case "type_checkbox":
388
+ {
389
+
390
+
391
+ $start=-1;
392
+ $value='';
393
+ for($j=0; $j<100; $j++)
394
+ {
395
+
396
+ //$element=$_POST[$i."_element".$id.$j];
397
+
398
+ if(isset($_POST[$i."_element".$id.$j]))
399
+ {
400
+ $start=$j;
401
+ break;
402
+ }
403
+ }
404
+ $other_element_id=-1;
405
+ $is_other=$_POST[$i."_allow_other".$id];
406
+ if($is_other=="yes")
407
+ {
408
+ $other_element_id=$_POST[$i."_allow_other_num".$id];
409
+ }
410
+
411
+ if($start!=-1)
412
+ {
413
+ for($j=$start; $j<100; $j++)
414
+ {
415
+ //$element=$_POST[$i."_element".$id.$j];
416
+ if(isset($_POST[$i."_element".$id.$j])){
417
+
418
+ if($j==$other_element_id)
419
+ {
420
+
421
+ $value=$value.$_POST[$i."_other_input".$id].'***br***';
422
+ }
423
+ else
424
+ {
425
+
426
+ $value=$value.$_POST[$i."_element".$id.$j].'***br***';
427
+ }
428
+ }
429
+ }
430
+ }
431
+ break;
432
+ }
433
+
434
+ }
435
+
436
+ if($type=="type_address")
437
+ if( $value=='*#*#*#')
438
+ break;
439
+
440
+ $unique_element=$_POST[$i."_unique".$id];
441
+ if($unique_element=='yes')
442
+ {
443
+ $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)));
444
+ if ($unique)
445
+ {
446
+ 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>";
447
+ return ($max+1);
448
+ }
449
+ }
450
+ $ip=$_SERVER['REMOTE_ADDR'];
451
+ $r=$wpdb->prefix."formmaker_submits";
452
+
453
+ $save_or_no=$wpdb->insert($r, array(
454
+ 'form_id' => $id_old,
455
+ 'element_label' => $i,
456
+ 'element_value' => addslashes($value),
457
+ 'group_id' => ($max+1),
458
+ 'date' => date('Y-m-d H:i:s'),
459
+ 'ip' => $ip,
460
+ ),
461
+ array(
462
+ '%d',
463
+ '%s',
464
+ '%s',
465
+ '%d',
466
+ '%s',
467
+ '%s'
468
+
469
+ )
470
+ );
471
+
472
+ if (!$save_or_no){return false;}
473
+ $chgnac=false;
474
+ }
475
+ if($chgnac)
476
+ { global $wpdb;
477
+
478
+ if(count($all_files)==0)
479
+ @session_start();
480
+ if($form->submit_text_type!=4)
481
+
482
+ $_SESSION['massage_after_submit']=addslashes(addslashes(__('Nothing was submitted.', 'form_maker')));
483
+ $_SESSION['error_or_no']=1;
484
+ $_SESSION['form_submit_type']=$form->submit_text_type.",".$form->id;
485
+ wp_redirect($_SERVER["REQUEST_URI"]);
486
+ exit;
487
+ }
488
+ return $all_files;
489
+ }
490
+
491
+
492
+
493
+ function contact_form_gen_mail($counter, $all_files, $id)
494
+ {
495
+ @session_start();
496
+ global $wpdb;
497
+
498
+ $row=$wpdb->get_row($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."formmaker WHERE id=%d",$id));
499
+ if(!$row->form_front)
500
+ {
501
+ $id='';
502
+ }
503
+ $label_order_original= array();
504
+ $label_order_ids= array();
505
+ $label_label= array();
506
+ $label_type= array();
507
+ $cc=array();
508
+ $row_mail_one_time=1;
509
+ $label_all = explode('#****#',$row->label_order);
510
+ $label_all = array_slice($label_all,0, count($label_all)-1);
511
+ foreach($label_all as $key => $label_each)
512
+ {
513
+ $label_id_each=explode('#**id**#',$label_each);
514
+ $label_id=$label_id_each[0];
515
+ array_push($label_order_ids,$label_id);
516
+
517
+ $label_order_each=explode('#**label**#', $label_id_each[1]);
518
+ $label_order_original[$label_id]=$label_order_each[0];
519
+ array_push($label_label, $label_order_each[0]);
520
+ array_push($label_type, $label_order_each[1]);
521
+ }
522
+
523
+
524
+ $list='<table border="1" cellpadding="3" cellspacing="0" style="width:600px;">';
525
+ foreach($label_order_ids as $key => $label_order_id)
526
+ {
527
+ $i=$label_order_id;
528
+ $type=$_POST[$i."_type".$id];
529
+ if(isset($_POST[$i."_type".$id]))
530
+ 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")
531
+ {
532
+ $element_label=$label_order_original[$i];
533
+
534
+ switch ($type)
535
+ {
536
+ case 'type_text':
537
+ case 'type_password':
538
+ case 'type_textarea':
539
+ case "type_date":
540
+ case "type_own_select":
541
+ case "type_country":
542
+ case "type_number":
543
+ {
544
+ $element=$_POST[$i."_element".$id];
545
+ if(isset($_POST[$i."_element".$id]))
546
+ {
547
+ $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="font-family:inherit; margin:0px; padding:0px">'.$element.'</pre></td></tr>';
548
+ }
549
+ break;
550
+
551
+
552
+ }
553
+
554
+ case "type_submitter_mail":
555
+ {
556
+ $element=$_POST[$i."_element".$id];
557
+ if(isset($_POST[$i."_element".$id]))
558
+ {
559
+ $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="font-family:inherit; margin:0px; padding:0px">'.$element.'</pre></td></tr>';
560
+ if($_POST[$i."_send".$id]=="yes")
561
+ array_push($cc, $element);
562
+ }
563
+ break;
564
+ }
565
+
566
+ case "type_time":
567
+ {
568
+
569
+ $hh=$_POST[$i."_hh".$id];
570
+ if(isset($_POST[$i."_hh".$id]))
571
+ {
572
+ $ss=$_POST[$i."_ss".$id];
573
+ if(isset($_POST[$i."_ss".$id]))
574
+ $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >'.$_POST[$i."_hh".$id].':'.$_POST[$i."_mm".$id].':'.$_POST[$i."_ss".$id];
575
+ else
576
+ $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >'.$_POST[$i."_hh".$id].':'.$_POST[$i."_mm".$id];
577
+ $am_pm=$_POST[$i."_am_pm".$id];
578
+ if(isset($_POST[$i."_am_pm".$id]))
579
+ $list=$list.' '.$_POST[$i."_am_pm".$id].'</td></tr>';
580
+ else
581
+ $list=$list.'</td></tr>';
582
+ }
583
+
584
+ break;
585
+ }
586
+
587
+ case "type_phone":
588
+ {
589
+ $element_first=$_POST[$i."_element_first".$id];
590
+ if(isset($_POST[$i."_element_first".$id]))
591
+ {
592
+ $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >'.$_POST[$i."_element_first".$id].' '.$_POST[$i."_element_last".$id].'</td></tr>';
593
+ }
594
+ break;
595
+ }
596
+
597
+ case "type_name":
598
+ {
599
+ $element_first=$_POST[$i."_element_first".$id];
600
+ if(isset($_POST[$i."_element_first".$id]))
601
+ {
602
+ $element_title=$_POST[$i."_element_title".$id];
603
+ if(isset($_POST[$i."_element_title".$id]))
604
+ $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>';
605
+ else
606
+ $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >'.$_POST[$i."_element_first".$id].' '.$_POST[$i."_element_last".$id].'</td></tr>';
607
+ }
608
+ break;
609
+ }
610
+ case "type_mark_map":
611
+ {
612
+
613
+ if(isset($_POST[$i."_long".$id]))
614
+ {
615
+ $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >Longitude:'.$_POST[$i."_long".$id].'<br/>Latitude:'.$_POST[$i."_lat".$id].'</td></tr>';
616
+ }
617
+ break;
618
+ }
619
+
620
+ case "type_address":
621
+ {
622
+ $street1=$_POST[$i."_street1".$id];
623
+ if(isset($_POST[$i."_street1".$id]))
624
+ {
625
+ $list=$list.'<tr valign="top"><td >'.$label_order_original[$i].'</td><td >'.$_POST[$i."_street1".$id].'</td></tr>';
626
+ $i++;
627
+ $list=$list.'<tr valign="top"><td >'.$label_order_original[$i].'</td><td >'.$_POST[$i."_street2".$id].'</td></tr>';
628
+ $i++;
629
+ $list=$list.'<tr valign="top"><td >'.$label_order_original[$i].'</td><td >'.$_POST[$i."_city".$id].'</td></tr>';
630
+ $i++;
631
+ $list=$list.'<tr valign="top"><td >'.$label_order_original[$i].'</td><td >'.$_POST[$i."_state".$id].'</td></tr>';
632
+ $i++;
633
+ $list=$list.'<tr valign="top"><td >'.$label_order_original[$i].'</td><td >'.$_POST[$i."_postal".$id].'</td></tr>';
634
+ $i++;
635
+ $list=$list.'<tr valign="top"><td >'.$label_order_original[$i].'</td><td >'.$_POST[$i."_country".$id].'</td></tr>';
636
+ $i++;
637
+ }
638
+ break;
639
+ }
640
+
641
+ case "type_date_fields":
642
+ {
643
+ $day=$_POST[$i."_day".$id];
644
+ if(isset($_POST[$i."_day".$id]))
645
+ {
646
+ $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >'.$_POST[$i."_day".$id].'-'.$_POST[$i."_month".$id].'-'.$_POST[$i."_year".$id].'</td></tr>';
647
+ }
648
+ break;
649
+ }
650
+
651
+ case "type_radio":
652
+ {
653
+ $element=$_POST[$i."_other_input".$id];
654
+ if(isset($_POST[$i."_other_input".$id]))
655
+ {
656
+ $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >'.$_POST[$i."_other_input".$id].'</td></tr>';
657
+ break;
658
+ }
659
+
660
+ $element=$_POST[$i."_element".$id];
661
+ if(isset($_POST[$i."_element".$id]))
662
+ {
663
+ $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="font-family:inherit; margin:0px; padding:0px">'.$element.'</pre></td></tr>';
664
+ }
665
+ break;
666
+ }
667
+
668
+ case "type_checkbox":
669
+ {
670
+ $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td >';
671
+
672
+ $start=-1;
673
+ for($j=0; $j<100; $j++)
674
+ {
675
+ if(isset($_POST[$i."_element".$id.$j]))
676
+ {
677
+ $start=$j;
678
+ break;
679
+ }
680
+ }
681
+ $other_element_id=-1;
682
+ $is_other=$_POST[$i."_allow_other".$id];
683
+ if($is_other=="yes")
684
+ {
685
+ $other_element_id=$_POST[$i."_allow_other_num".$id];
686
+ }
687
+
688
+
689
+ if($start!=-1)
690
+ {
691
+ for($j=$start; $j<100; $j++)
692
+ {
693
+
694
+ $element=$_POST[$i."_element".$id.$j];
695
+ if(isset($_POST[$i."_element".$id.$j]))
696
+ if($j==$other_element_id)
697
+ {
698
+ $list=$list.$_POST[$i."_other_input".$id].'<br>';
699
+ }
700
+ else
701
+
702
+ $list=$list.$_POST[$i."_element".$id.$j].'<br>';
703
+ }
704
+ $list=$list.'</td></tr>';
705
+ }
706
+
707
+
708
+ break;
709
+ }
710
+ default: break;
711
+ }
712
+
713
+ }
714
+
715
+ }
716
+ $list=$list.'</table>';
717
+ $list = wordwrap($list, 70, "\n", true);
718
+ add_filter('wp_mail_content_type',create_function('', 'return "text/html";'));
719
+ var_dump($all_files);
720
+ for($k=0;$k<count($all_files);$k++){
721
+ $attachment[$k]= dirname(__FILE__). '/uploads/'.$all_files[$k]['name'];
722
+ }
723
+ if(isset($cc[0]))
724
+ {
725
+ foreach ($cc as $c)
726
+ {
727
+
728
+
729
+ if($c)
730
+ {
731
+
732
+ $recipient = $c;
733
+ $subject = $row->title;
734
+ $body = $row->script_user1.'<br>'.$list.'<br>'.$row->script_user2;
735
+ $send=wp_mail($recipient, $subject, $body, "",$attachment);
736
+ }
737
+
738
+
739
+ if($row->mail)
740
+ {
741
+ if($c)
742
+ {
743
+ $headers_form_mail = 'From: '.$c.' <'.$c.'>' . "\r\n";
744
+
745
+ }
746
+ else
747
+ {
748
+ $headers_form_mail ="";
749
+ }
750
+ if($row_mail_one_time){
751
+ $recipient = $row->mail;
752
+ $subject = $row->title;
753
+ $body = $row->script1.'<br>'.$list.'<br>'.$row->script2;
754
+ $mode = 1;
755
+
756
+ $send=wp_mail($recipient, $subject, $body, $headers_form_mail,$attachment);
757
+ $row_mail_one_time=0;
758
+ }
759
+ }
760
+ }
761
+ }
762
+ else
763
+ {
764
+ if($row->mail)
765
+ {
766
+ $recipient = $row->mail;
767
+ $subject = $row->title;
768
+ $body = $row->script1.'<br>'.$list.'<br>'.$row->script2;
769
+ $mode = 1;
770
+
771
+ $send=wp_mail($recipient, $subject, $body, "",$attachment);
772
+ }
773
+ }
774
+ if($row->mail)
775
+ {
776
+ if ( $send != true )
777
+ {
778
+ @session_start();
779
+ $_SESSION['error_or_no']=1;
780
+ $msg=addslashes(__('Error, email was not sent.', 'form_maker'));
781
+ }
782
+ else
783
+ {
784
+ @session_start();
785
+ $_SESSION['error_or_no']=0;
786
+ $msg=addslashes(__('Your form was successfully submitted.', 'form_maker'));
787
+ }
788
+ }
789
+ else
790
+ {
791
+
792
+ @session_start();
793
+ $_SESSION['error_or_no']=0;
794
+ $msg=addslashes(__('Your form was successfully submitted.', 'form_maker'));
795
+ }
796
+
797
+ switch($row->submit_text_type)
798
+ {
799
+ case "2":
800
+ case "5":
801
+ {
802
+ @session_start();
803
+ if($row->submit_text_type!=4)
804
+ $_SESSION['massage_after_submit']=$msg;
805
+ $_SESSION['form_submit_type']=$row->submit_text_type.",".$row->id;
806
+ if($row->article_id)
807
+ wp_redirect($row->article_id);
808
+ else
809
+ wp_redirect($_SERVER["REQUEST_URI"]);
810
+
811
+ exit;
812
+ break;
813
+ }
814
+ case "3":
815
+ {
816
+ @session_start();
817
+ if($row->submit_text_type!=4)
818
+ $_SESSION['massage_after_submit']=$msg;
819
+ $_SESSION['form_submit_type']=$row->submit_text_type.",".$row->id;
820
+ wp_redirect($_SERVER["REQUEST_URI"]);
821
+
822
+ exit;
823
+ break;
824
+ }
825
+ case "4":
826
+ {
827
+ @session_start();
828
+ if($row->submit_text_type!=4)
829
+ $_SESSION['massage_after_submit']=$msg;
830
+ $_SESSION['form_submit_type']=$row->submit_text_type.",".$row->id;
831
+ wp_redirect($row->url);
832
+
833
+ exit;
834
+ break;
835
+ }
836
+ default:
837
+ {
838
+ @session_start();
839
+ if($row->submit_text_type!=4)
840
+ $_SESSION['massage_after_submit']= $msg;
841
+ $_SESSION['form_submit_type']=$row->submit_text_type.",".$row->id;
842
+ wp_redirect($_SERVER["REQUEST_URI"]);
843
+
844
+ exit;
845
+ break;
846
+ }
847
+ }
848
+ }
849
+
850
+ /*function sendMail($from='', $fromname='', $recipient, $subject, $body, $mode=0, $cc=null, $bcc=null, $attachment=null, $replyto=null, $replytoname=null)
851
+ {
852
+ $recipient=explode (',', str_replace(' ', '', $recipient ));
853
+ // Get a JMail instance
854
+ $mail = &JFactory::getMailer();
855
+
856
+ $mail->setSender(array($from, $fromname));
857
+ $mail->setSubject($subject);
858
+ $mail->setBody($body);
859
+
860
+ // Are we sending the email as HTML?
861
+ if ($mode) {
862
+ $mail->IsHTML(true);
863
+ }
864
+
865
+ $mail->addRecipient($recipient);
866
+ $mail->addCC($cc);
867
+ $mail->addBCC($bcc);
868
+
869
+ if($attachment)
870
+ foreach($attachment as $attachment_temp)
871
+ {
872
+ $mail->addAttachment($attachment_temp[0], $attachment_temp[1], $attachment_temp[2]);
873
+ }
874
+
875
+ // Take care of reply email addresses
876
+ if (is_array($replyto)) {
877
+ $numReplyTo = count($replyto);
878
+ for ($i=0; $i < $numReplyTo; $i++){
879
+ $mail->addReplyTo(array($replyto[$i], $replytoname[$i]));
880
+ }
881
+ } elseif (isset($replyto)) {
882
+ $mail->addReplyTo(array($replyto, $replytoname));
883
+ }
884
+
885
+ return $mail->Send();
886
+ }
887
+
888
+ */
889
+
890
+ function remove_contact_date($group_id)
891
+ {
892
+ global $wpdb;
893
+ $wpdb->query($wpdb->prepare('DELETE FROM '.$wpdb->prefix.'formmaker_submits WHERE group_id= %d',$group_id));
894
+
895
+ }
896
+
897
+
898
+
899
+
900
+
901
+
902
+
903
+
904
+
905
+
906
+
907
+
908
+
909
+ ////////////////////////////////////////////////////// DISPLAY
910
+
911
+
912
+
913
+
914
+
915
+
916
+
917
+
918
+
919
+
920
+
921
+
922
+ function contact_form_front_end($id){
923
+ $form_maker_front_end="";
924
+ $result =show_contact_form($id);
925
+ if(!$result)
926
+ return;
927
+ $ok =save_contact_form_data($result[0],$id);
928
+ if(is_numeric($ok))
929
+ remove_contact_date($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=esc_html($_POST["captcha_input"]);
1203
+ }
1204
+ if(isset($_POST["recaptcha_response_field"])){
1205
+ $recaptcha_response_field=esc_html($_POST["recaptcha_response_field"]);
1206
+ }
1207
+ if(isset($_POST["counter".$id])){
1208
+ $counter=esc_html($_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
+ return $form_maker_front_end;
1548
+ }
1549
+
1550
+
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,22 +1,22 @@
1
- (function() {
2
- tinymce.create('tinymce.plugins.contact_form_mce', {
3
- init :function(ed, url){
4
- ed.addCommand('mcecontact_form_mce', function() {
5
- ed.windowManager.open({
6
- file :((ajaxurl.indexOf("://") != -1) ? ajaxurl:(location.protocol+'//'+location.host+ajaxurl))+"?action=formcontactwindow",
7
- width : 400 + ed.getLang('contact_form_mce.delta_width', 0),
8
- height : 250 + ed.getLang('contact_form_mce.delta_height', 0),
9
- inline : 1
10
- }, {
11
- plugin_url : url // Plugin absolute URL
12
- });
13
- });
14
- ed.addButton('contact_form_mce', {
15
- title : 'Insert Contact Form',
16
- cmd : 'mcecontact_form_mce',
17
- });
18
- }
19
- });
20
- tinymce.PluginManager.add('contact_form_mce', tinymce.plugins.contact_form_mce);
21
-
22
  })();
1
+ (function() {
2
+ tinymce.create('tinymce.plugins.contact_form_mce', {
3
+ init :function(ed, url){
4
+ ed.addCommand('mcecontact_form_mce', function() {
5
+ ed.windowManager.open({
6
+ file :((ajaxurl.indexOf("://") != -1) ? ajaxurl:(location.protocol+'//'+location.host+ajaxurl))+"?action=formcontactwindow",
7
+ width : 400 + ed.getLang('contact_form_mce.delta_width', 0),
8
+ height : 250 + ed.getLang('contact_form_mce.delta_height', 0),
9
+ inline : 1
10
+ }, {
11
+ plugin_url : url // Plugin absolute URL
12
+ });
13
+ });
14
+ ed.addButton('contact_form_mce', {
15
+ title : 'Insert Contact Form',
16
+ cmd : 'mcecontact_form_mce',
17
+ });
18
+ }
19
+ });
20
+ tinymce.PluginManager.add('contact_form_mce', tinymce.plugins.contact_form_mce);
21
+
22
  })();
js/formmaker_free.js CHANGED
@@ -1,17709 +1,17709 @@
1
- j=2;//choices id
2
- var c;
3
- var a=new Array();
4
- var plugin_url="";
5
- var id_ifr_editor=500;
6
- if(ajaxurl.indexOf("://") !=-1)
7
- var url_for_ajax=ajaxurl;
8
- else
9
- var url_for_ajax=location.protocol+'//'+location.host+ajaxurl;
10
-
11
- /**
12
- * Remove witespaces from childNodes.
13
- */
14
- function form_maker_remove_spaces(parent) {
15
- if (!parent) {
16
- parent = document;
17
- }
18
- var children = parent.childNodes;
19
- for (var i = children.length - 1; i >= 0; i--) {
20
- var child = children[i];
21
- if (child.nodeType == 3) {
22
- if (child.data.match(/^\s+$/)) {
23
- parent.removeChild(child);
24
- }
25
- }
26
- else {
27
- form_maker_remove_spaces(child);
28
- }
29
- }
30
- }
31
-
32
- function active_reset(val, id)
33
- {
34
- if(val)
35
- {
36
- document.getElementById(id+'_element_resetform_id_temp').style.display="inline";
37
- }
38
- else
39
- {
40
- document.getElementById(id+'_element_resetform_id_temp').style.display="none";
41
- }
42
- }
43
-
44
- function check_required()
45
- {
46
- alert('"Submit" and "Reset" buttons are disabled in back end.');
47
- }
48
-
49
- function isNumber(n) {
50
- return !isNaN(parseFloat(n)) && isFinite(n);
51
- }
52
- function change_field_name(id, x)
53
- {
54
- value=x.value;
55
-
56
- if(value==parseInt(value))
57
- {
58
- alert('The name of the field cannot be a number.');
59
- x.value="";
60
- document.getElementById(id+'_elementform_id_temp').name='';
61
- document.getElementById(id+'_element_labelform_id_temp').innerHTML='';
62
- return;
63
- }
64
-
65
- if(value==id+"_elementform_id_temp")
66
- {
67
- alert('"Field Name" should differ from "Field Id".')
68
- x.value="";
69
- }
70
- else
71
- {
72
- document.getElementById(id+'_elementform_id_temp').name=value;
73
- document.getElementById(id+'_element_labelform_id_temp').innerHTML=value;
74
- }
75
- }
76
-
77
- function change_field_value(id, value)
78
- {
79
- document.getElementById(id+'_elementform_id_temp').value=value;
80
- }
81
-
82
- function return_attributes(id)
83
- {
84
- attr_names= new Array();
85
- attr_value= new Array();
86
- var input=document.getElementById(id);
87
- if(input)
88
- {
89
- atr=input.attributes;
90
- for(i=0;i<30;i++)
91
- if(atr[i] )
92
- {
93
- if(atr[i].name.indexOf("add_")==0)
94
- {
95
- attr_names.push(atr[i].name.replace('add_',''));
96
- attr_value.push(atr[i].value);
97
- }
98
- }
99
- }
100
- return Array(attr_names, attr_value);
101
- }
102
-
103
- function refresh_attr(x,type)
104
- {
105
- switch(type)
106
- {
107
- case "type_text":
108
-
109
- {
110
- id_array=Array();
111
- id_array[0]=x+'_elementform_id_temp';
112
- break;
113
- }
114
-
115
- case "type_name":
116
-
117
- {
118
- id_array=Array();
119
- id_array[0]=x+'_element_firstform_id_temp';
120
- id_array[1]=x+'_element_lastform_id_temp';
121
- id_array[2]=x+'_element_titleform_id_temp';
122
- id_array[3]=x+'_element_middleform_id_temp';
123
- break;
124
- }
125
-
126
- case "type_address":
127
-
128
- {
129
- id_array=Array();
130
- id_array[0]=x+'_street1form_id_temp';
131
- id_array[1]=x+'_street2form_id_temp';
132
- id_array[2]=x+'_cityform_id_temp';
133
- id_array[3]=x+'_stateform_id_temp';
134
- id_array[4]=x+'_postalform_id_temp';
135
- id_array[5]=x+'_countryform_id_temp';
136
- break;
137
- }
138
-
139
- case "type_checkbox":
140
-
141
- {
142
- id_array=Array();
143
- for(z=0;z<50;z++)
144
- id_array[z]=x+'_elementform_id_temp'+z;
145
- break;
146
- }
147
-
148
- case "type_time":
149
-
150
- {
151
- id_array=Array();
152
- id_array[0]=x+'_hhform_id_temp';
153
- id_array[1]=x+'_mmform_id_temp';
154
- id_array[2]=x+'_ssform_id_temp';
155
- id_array[3]=x+'_am_pmform_id_temp';
156
- break;
157
- }
158
- case "type_date":
159
-
160
- {
161
- id_array=Array();
162
- id_array[0]=x+'_elementform_id_temp';
163
- id_array[1]=x+'_buttonform_id_temp';
164
- break;
165
- }
166
-
167
- case "type_date_fields":
168
-
169
- {
170
- id_array=Array();
171
- id_array[0]=x+'_dayform_id_temp';
172
- id_array[1]=x+'_monthform_id_temp';
173
- id_array[2]=x+'_yearform_id_temp';
174
- break;
175
- }
176
-
177
- case "type_captcha":
178
-
179
- {
180
- id_array=Array();
181
- id_array[0]='_wd_captchaform_id_temp';
182
- id_array[1]='_wd_captcha_inputform_id_temp';
183
- id_array[2]='_element_refreshform_id_temp';
184
- break;
185
- }
186
-
187
- case "type_recaptcha":
188
-
189
- {
190
- id_array=Array();
191
- id_array[0]='wd_recaptchaform_id_temp';
192
- break;
193
- }
194
-
195
- case "type_submit_reset":
196
-
197
- {
198
- id_array=Array();
199
- id_array[0]=x+'_element_submitform_id_temp';
200
- id_array[1]=x+'_element_resetform_id_temp';
201
- break;
202
- }
203
-
204
- case "type_page_break":
205
-
206
- {
207
- id_array=Array();
208
- id_array[0]='_div_between';
209
- break;
210
- }
211
- }
212
-
213
- for(q=0; q<id_array.length;q++)
214
- {
215
- id=id_array[q];
216
- var input=document.getElementById(id);
217
- if(input)
218
- {
219
- atr=input.attributes;
220
- for(i=0;i<30;i++)
221
- if(atr[i])
222
- {
223
- if(atr[i].name.indexOf("add_")==0)
224
- {
225
- input.removeAttribute(atr[i].name);
226
- i--;
227
- }
228
- }
229
-
230
- for(i=0;i<10;i++)
231
- if(document.getElementById("attr_name"+i))
232
- {
233
- try{input.setAttribute("add_"+document.getElementById("attr_name"+i).value, document.getElementById("attr_value"+i).value)}
234
- catch(err)
235
- {
236
- alert('Only letters, numbers, hyphens and underscores are allowed.');
237
- }
238
- }
239
- }
240
- }
241
- }
242
-
243
- function add_id_and_name(i,type)
244
- {
245
- switch(type)
246
- {
247
- case 'type_text':
248
- {
249
- var edit_main_table=document.getElementById("edit_main_table");
250
-
251
- var edit_main_tr0 = document.createElement('tr');
252
- edit_main_tr0.setAttribute("valing", "top");
253
-
254
- var edit_main_td0 = document.createElement('td');
255
- edit_main_td0.style.cssText = "padding-top:10px";
256
-
257
- var edit_main_td0_1 = document.createElement('td');
258
- edit_main_td0_1.style.cssText = "padding-top:10px";
259
-
260
- var br = document.createElement('br');
261
- var br1 = document.createElement('br');
262
-
263
- var field_id = document.createElement('label');
264
- field_id.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:27px";
265
- field_id.innerHTML = "Field id ";
266
-
267
-
268
- var field_id_text = document.createElement('input');
269
- field_id_text.setAttribute("size", "50");
270
- field_id_text.setAttribute("type", "text");
271
- field_id_text.setAttribute("disabled", "disabled");
272
- field_id_text.setAttribute("value", i+"_elementform_id_temp");
273
-
274
- var field_name = document.createElement('label');
275
- field_name.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:3px";
276
- field_name.innerHTML = "Field name ";
277
-
278
- var field_name_text = document.createElement('input');
279
- field_name_text.setAttribute("size", "50");
280
- field_name_text.setAttribute("type", "text");
281
- field_name_text.setAttribute("disabled", "disabled");
282
- field_name_text.setAttribute("value", i+"_elementform_id_temp");
283
-
284
- edit_main_td0.appendChild(field_id);
285
- edit_main_td0.appendChild(br);
286
- edit_main_td0.appendChild(field_name);
287
-
288
- edit_main_td0_1.appendChild(field_id_text);
289
- edit_main_td0_1.appendChild(br1);
290
- edit_main_td0_1.appendChild(field_name_text);
291
- edit_main_tr0.appendChild(edit_main_td0);
292
- edit_main_tr0.appendChild(edit_main_td0_1);
293
- edit_main_table.insertBefore(edit_main_tr0,edit_main_table.childNodes[0]);
294
- break;
295
- }
296
-
297
- case 'type_address':
298
- {
299
- var edit_main_table=document.getElementById("edit_main_table");
300
-
301
- var edit_main_tr0 = document.createElement('tr');
302
- edit_main_tr0.setAttribute("valing", "top");
303
-
304
- var edit_main_td0 = document.createElement('td');
305
- edit_main_td0.style.cssText = "padding-top:10px";
306
- edit_main_td0.setAttribute("colspan", "2");
307
-
308
- var br = document.createElement('br');
309
-
310
- var field_id = document.createElement('label');
311
- field_id.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:27px";
312
- field_id.innerHTML = "Fields id ";
313
-
314
-
315
- var field_id_text = document.createElement('input');
316
- field_id_text.setAttribute("type", "text");
317
- field_id_text.setAttribute("id", "field_id");
318
- field_id_text.setAttribute("disabled", "disabled");
319
- field_id_text.setAttribute("style", "width:350px");
320
- 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");
321
-
322
- var field_name = document.createElement('label');
323
- field_name.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:3px";
324
- field_name.innerHTML = "Fields name ";
325
-
326
- var field_name_text = document.createElement('input');
327
- field_name_text.setAttribute("type", "text");
328
- field_name_text.setAttribute("id", "field_name");
329
- field_name_text.setAttribute("disabled", "disabled");
330
- field_name_text.setAttribute("style", "width:350px");
331
- 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");
332
-
333
- edit_main_td0.appendChild(field_id);
334
- edit_main_td0.appendChild(field_id_text);
335
- edit_main_td0.appendChild(br);
336
- edit_main_td0.appendChild(field_name);
337
- edit_main_td0.appendChild(field_name_text);
338
- edit_main_tr0.appendChild(edit_main_td0);
339
- edit_main_table.insertBefore(edit_main_tr0,edit_main_table.childNodes[0]);
340
- break;
341
- }
342
-
343
- case 'type_name':
344
- {
345
- var edit_main_table=document.getElementById("edit_main_table");
346
-
347
- var edit_main_tr0 = document.createElement('tr');
348
- edit_main_tr0.setAttribute("valing", "top");
349
-
350
- var edit_main_td0 = document.createElement('td');
351
- edit_main_td0.style.cssText = "padding-top:10px";
352
- edit_main_td0.setAttribute("colspan", "2");
353
-
354
- var br = document.createElement('br');
355
-
356
- var field_id = document.createElement('label');
357
- field_id.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:27px";
358
- field_id.innerHTML = "Fields id ";
359
-
360
-
361
- var field_id_text = document.createElement('input');
362
- field_id_text.setAttribute("type", "text");
363
- field_id_text.setAttribute("id", "field_id");
364
- field_id_text.setAttribute("disabled", "disabled");
365
- field_id_text.setAttribute("style", "width:350px");
366
- field_id_text.setAttribute("value", i+"_element_firstform_id_temp, "+i+"_element_lastform_id_temp");
367
-
368
- var field_name = document.createElement('label');
369
- field_name.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:3px";
370
- field_name.innerHTML = "Fields name ";
371
-
372
- var field_name_text = document.createElement('input');
373
- field_name_text.setAttribute("type", "text");
374
- field_name_text.setAttribute("id", "field_name");
375
- field_name_text.setAttribute("disabled", "disabled");
376
- field_name_text.setAttribute("style", "width:350px");
377
- field_name_text.setAttribute("value", i+"_element_firstform_id_temp, "+i+"_element_lastform_id_temp");
378
-
379
- edit_main_td0.appendChild(field_id);
380
- edit_main_td0.appendChild(field_id_text);
381
- edit_main_td0.appendChild(br);
382
- edit_main_td0.appendChild(field_name);
383
- edit_main_td0.appendChild(field_name_text);
384
- edit_main_tr0.appendChild(edit_main_td0);
385
- edit_main_table.insertBefore(edit_main_tr0,edit_main_table.childNodes[0]);
386
- break;
387
- }
388
-
389
- case 'type_radio':
390
- {
391
- var edit_main_table=document.getElementById("edit_main_table");
392
-
393
- var edit_main_tr0 = document.createElement('tr');
394
- edit_main_tr0.setAttribute("valing", "top");
395
-
396
- var edit_main_td0 = document.createElement('td');
397
- edit_main_td0.style.cssText = "padding-top:10px";
398
- edit_main_td0.setAttribute("colspan", "2");
399
-
400
- var br = document.createElement('br');
401
-
402
- var field_id = document.createElement('label');
403
- field_id.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:27px";
404
- field_id.innerHTML = "Fields id ";
405
-
406
-
407
- var field_id_text = document.createElement('input');
408
- field_id_text.setAttribute("type", "text");
409
- field_id_text.setAttribute("id", "field_id");
410
- field_id_text.setAttribute("disabled", "disabled");
411
- field_id_text.setAttribute("style", "width:350px");
412
- field_id_text.setAttribute("value", '');
413
-
414
- var field_name = document.createElement('label');
415
- field_name.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:3px";
416
- field_name.innerHTML = "Fields name ";
417
-
418
- var field_name_text = document.createElement('input');
419
- field_name_text.setAttribute("type", "text");
420
- field_name_text.setAttribute("id", "field_name");
421
- field_name_text.setAttribute("disabled", "disabled");
422
- field_name_text.setAttribute("style", "width:350px");
423
- field_name_text.setAttribute("value", '');
424
-
425
- edit_main_td0.appendChild(field_id);
426
- edit_main_td0.appendChild(field_id_text);
427
- edit_main_td0.appendChild(br);
428
- edit_main_td0.appendChild(field_name);
429
- edit_main_td0.appendChild(field_name_text);
430
- edit_main_tr0.appendChild(edit_main_td0);
431
- edit_main_table.insertBefore(edit_main_tr0,edit_main_table.childNodes[0]);
432
- refresh_id_name(i, type);
433
- break;
434
- }
435
-
436
- case 'type_checkbox':
437
- {
438
- var edit_main_table=document.getElementById("edit_main_table");
439
-
440
- var edit_main_tr0 = document.createElement('tr');
441
- edit_main_tr0.setAttribute("valing", "top");
442
-
443
- var edit_main_td0 = document.createElement('td');
444
- edit_main_td0.style.cssText = "padding-top:10px";
445
- edit_main_td0.setAttribute("colspan", "2");
446
-
447
- var br = document.createElement('br');
448
-
449
- var field_id = document.createElement('label');
450
- field_id.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:27px";
451
- field_id.innerHTML = "Fields id ";
452
-
453
-
454
- var field_id_text = document.createElement('input');
455
- field_id_text.setAttribute("type", "text");
456
- field_id_text.setAttribute("id", "field_id");
457
- field_id_text.setAttribute("disabled", "disabled");
458
- field_id_text.setAttribute("style", "width:350px");
459
- field_id_text.setAttribute("value", '');
460
-
461
- var field_name = document.createElement('label');
462
- field_name.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:3px";
463
- field_name.innerHTML = "Fields name ";
464
-
465
- var field_name_text = document.createElement('input');
466
- field_name_text.setAttribute("type", "text");
467
- field_name_text.setAttribute("id", "field_name");
468
- field_name_text.setAttribute("disabled", "disabled");
469
- field_name_text.setAttribute("style", "width:350px");
470
- field_name_text.setAttribute("value", '');
471
-
472
- edit_main_td0.appendChild(field_id);
473
- edit_main_td0.appendChild(field_id_text);
474
- edit_main_td0.appendChild(br);
475
- edit_main_td0.appendChild(field_name);
476
- edit_main_td0.appendChild(field_name_text);
477
- edit_main_tr0.appendChild(edit_main_td0);
478
- edit_main_table.insertBefore(edit_main_tr0,edit_main_table.childNodes[0]);
479
- refresh_id_name(i, type);
480
- break;
481
- }
482
-
483
- case 'type_time':
484
- {
485
- var edit_main_table=document.getElementById("edit_main_table");
486
-
487
- var edit_main_tr0 = document.createElement('tr');
488
- edit_main_tr0.setAttribute("valing", "top");
489
-
490
- var edit_main_td0 = document.createElement('td');
491
- edit_main_td0.style.cssText = "padding-top:10px";
492
- var edit_main_td0_1 = document.createElement('td');
493
- edit_main_td0_1.style.cssText = "padding-top:10px";
494
-
495
- var br = document.createElement('br');
496
- var br1 = document.createElement('br');
497
-
498
- var field_id = document.createElement('label');
499
- field_id.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:27px";
500
- field_id.innerHTML = "Fields id ";
501
-
502
-
503
- var field_id_text = document.createElement('input');
504
- field_id_text.setAttribute("size", "50");
505
- field_id_text.setAttribute("type", "text");
506
- field_id_text.setAttribute("id", "field_id");
507
- field_id_text.setAttribute("disabled", "disabled");
508
- field_id_text.setAttribute("value", i+"_hhform_id_temp, "+i+"_mmform_id_temp, "+i+"_ssform_id_temp");
509
-
510
- var field_name = document.createElement('label');
511
- field_name.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:3px";
512
- field_name.innerHTML = "Fields name ";
513
-
514
- var field_name_text = document.createElement('input');
515
- field_name_text.setAttribute("size", "50");
516
- field_name_text.setAttribute("type", "text");
517
- field_name_text.setAttribute("id", "field_name");
518
- field_name_text.setAttribute("disabled", "disabled");
519
- field_name_text.setAttribute("value", i+"_hhform_id_temp, "+i+"_mmform_id_temp, "+i+"_ssform_id_temp");
520
-
521
- edit_main_td0.appendChild(field_id);
522
- edit_main_td0.appendChild(br1);
523
- edit_main_td0.appendChild(field_name);
524
- edit_main_td0_1.appendChild(field_id_text);
525
- edit_main_td0_1.appendChild(br);
526
- edit_main_td0_1.appendChild(field_name_text);
527
-
528
- edit_main_tr0.appendChild(edit_main_td0);
529
- edit_main_tr0.appendChild(edit_main_td0_1);
530
- edit_main_table.insertBefore(edit_main_tr0,edit_main_table.childNodes[0]);
531
- break;
532
- }
533
-
534
- case 'type_date_fields':
535
- {
536
- var edit_main_table=document.getElementById("edit_main_table");
537
-
538
- var edit_main_tr0 = document.createElement('tr');
539
- edit_main_tr0.setAttribute("valing", "top");
540
-
541
- var edit_main_td0 = document.createElement('td');
542
- edit_main_td0.style.cssText = "padding-top:10px";
543
- edit_main_td0.setAttribute("colspan", "2");
544
-
545
- var br = document.createElement('br');
546
-
547
- var field_id = document.createElement('label');
548
- field_id.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:27px";
549
- field_id.innerHTML = "Fields id ";
550
-
551
-
552
- var field_id_text = document.createElement('input');
553
- field_id_text.setAttribute("size", "50");
554
- field_id_text.setAttribute("type", "text");
555
- field_id_text.setAttribute("id", "field_id");
556
- field_id_text.setAttribute("disabled", "disabled");
557
- field_id_text.setAttribute("value", i+"_dayform_id_temp, "+i+"_monthform_id_temp, "+i+"_yearform_id_temp");
558
-
559
- var field_name = document.createElement('label');
560
- field_name.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:3px";
561
- field_name.innerHTML = "Fields name ";
562
-
563
- var field_name_text = document.createElement('input');
564
- field_name_text.setAttribute("size", "50");
565
- field_name_text.setAttribute("type", "text");
566
- field_name_text.setAttribute("id", "field_name");
567
- field_name_text.setAttribute("disabled", "disabled");
568
- field_name_text.setAttribute("value", i+"_dayform_id_temp, "+i+"_monthform_id_temp, "+i+"_yearform_id_temp");
569
-
570
- edit_main_td0.appendChild(field_id);
571
- edit_main_td0.appendChild(field_id_text);
572
- edit_main_td0.appendChild(br);
573
- edit_main_td0.appendChild(field_name);
574
- edit_main_td0.appendChild(field_name_text);
575
- edit_main_tr0.appendChild(edit_main_td0);
576
- edit_main_table.insertBefore(edit_main_tr0,edit_main_table.childNodes[0]);
577
- break;
578
- }
579
-
580
- case 'type_captcha':
581
- {
582
- var edit_main_table=document.getElementById("edit_main_table");
583
-
584
- var edit_main_tr0 = document.createElement('tr');
585
- edit_main_tr0.setAttribute("valing", "top");
586
-
587
- var edit_main_td0 = document.createElement('td');
588
- edit_main_td0.style.cssText = "padding-top:10px";
589
-
590
- var edit_main_td0_1 = document.createElement('td');
591
- edit_main_td0_1.style.cssText = "padding-top:10px";
592
-
593
- var br = document.createElement('br');
594
- var br1 = document.createElement('br');
595
-
596
- var field_id = document.createElement('label');
597
- field_id.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:27px";
598
- field_id.innerHTML = "Fields id ";
599
-
600
-
601
- var field_id_text = document.createElement('input');
602
- field_id_text.setAttribute("size", "50");
603
- field_id_text.setAttribute("type", "text");
604
- field_id_text.setAttribute("id", "field_id");
605
- field_id_text.setAttribute("disabled", "disabled");
606
- field_id_text.setAttribute("value", "wd_captcha_inputform_id_temp");
607
-
608
- var field_name = document.createElement('label');
609
- field_name.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px; margin-right:3px";
610
- field_name.innerHTML = "Fields name ";
611
-
612
- var field_name_text = document.createElement('input');
613
- field_name_text.setAttribute("size", "50");
614
- field_name_text.setAttribute("type", "text");
615
- field_name_text.setAttribute("id", "field_name");
616
- field_name_text.setAttribute("disabled", "disabled");
617
- field_name_text.setAttribute("value", "captcha_inputform_id_temp");
618
-
619
- edit_main_td0.appendChild(field_id);
620
- edit_main_td0.appendChild(br1);
621
- edit_main_td0.appendChild(field_name);
622
- edit_main_td0_1.appendChild(field_id_text);
623
- edit_main_td0_1.appendChild(br);
624
- edit_main_td0_1.appendChild(field_name_text);
625
- edit_main_tr0.appendChild(edit_main_td0);
626
- edit_main_tr0.appendChild(edit_main_td0_1);
627
- edit_main_table.insertBefore(edit_main_tr0,edit_main_table.childNodes[0]);
628
- break;
629
- }
630
-
631
- }
632
- }
633
-
634
-
635
- function refresh_id_name(i, type)
636
- {
637
- switch(type)
638
- {
639
- case 'type_radio':
640
- {
641
- document.getElementById('field_id').value='';
642
- for(k=0; k<50;k++)
643
- {
644
- if(document.getElementById(i+'_elementform_id_temp'+k))
645
- document.getElementById('field_id').value +=i+'_elementform_id_temp'+k+', ';
646
- }
647
- a=document.getElementById('field_id').value.slice(0,-2);
648
- document.getElementById('field_id').value=a;
649
- document.getElementById('field_name').value =i+'_element';
650
-
651
- break
652
- }
653
- case 'type_checkbox':
654
- {
655
- document.getElementById('field_id').value='';
656
- for(k=0; k<50;k++)
657
- {
658
- if(document.getElementById(i+'_elementform_id_temp'+k))
659
- {
660
- document.getElementById('field_id').value +=i+'_elementform_id_temp'+k+', ';
661
- }
662
- }
663
- a=document.getElementById('field_id').value.slice(0,-2);
664
- document.getElementById('field_id').value =a;
665
- document.getElementById('field_name').value =a;
666
-
667
- break
668
- }
669
- }
670
-
671
- }
672
-
673
-
674
-
675
- function add_attr(i, type)
676
- {
677
-
678
- var el_attr_table=document.getElementById('attributes');
679
- j=parseInt(el_attr_table.lastChild.getAttribute('idi'))+1;
680
- w_attr_name[j]="attribute";
681
- w_attr_value[j]="value";
682
- var el_attr_tr = document.createElement('tr');
683
- el_attr_tr.setAttribute("id", "attr_row_"+j);
684
- el_attr_tr.setAttribute("idi", j);
685
- var el_attr_td_name = document.createElement('td');
686
- el_attr_td_name.style.cssText = 'width:100px';
687
- var el_attr_td_value = document.createElement('td');
688
- el_attr_td_value.style.cssText = 'width:100px';
689
-
690
- var el_attr_td_X = document.createElement('td');
691
- var el_attr_name = document.createElement('input');
692
- el_attr_name.setAttribute("type", "text");
693
- el_attr_name.style.cssText = "width:100px";
694
- el_attr_name.setAttribute("value", w_attr_name[j]);
695
- el_attr_name.setAttribute("id", "attr_name"+j);
696
- el_attr_name.setAttribute("onChange", "change_attribute_name('"+i+"', this, '"+type+"')");
697
-
698
- var el_attr_value = document.createElement('input');
699
- el_attr_value.setAttribute("type", "text");
700
- el_attr_value.style.cssText = "width:100px";
701
- el_attr_value.setAttribute("value", w_attr_value[j]);
702
- el_attr_value.setAttribute("id", "attr_value"+j);
703
- el_attr_value.setAttribute("onChange", "change_attribute_value('"+i+"', "+j+", '"+type+"')");
704
-
705
- var el_attr_remove = document.createElement('img');
706
- el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
707
- el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
708
- el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
709
- el_attr_remove.setAttribute("align", 'top');
710
- el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", '"+type+"')");
711
- el_attr_table.appendChild(el_attr_tr);
712
- el_attr_tr.appendChild(el_attr_td_name);
713
- el_attr_tr.appendChild(el_attr_td_value);
714
- el_attr_tr.appendChild(el_attr_td_X);
715
- el_attr_td_name.appendChild(el_attr_name);
716
- el_attr_td_value.appendChild(el_attr_value);
717
- el_attr_td_X.appendChild(el_attr_remove);
718
- refresh_attr(i, type);
719
- }
720
-
721
- function change_attribute_value(id, x, type)
722
- {
723
- if(!document.getElementById("attr_name"+x).value)
724
- {
725
- alert('The name of the attribute is required.');
726
- return
727
- }
728
-
729
- if(document.getElementById("attr_name"+x).value.toLowerCase()=="style")
730
- {
731
- alert('Sorry, you cannot add a style attribute here. Use "Class name" instead.');
732
- return
733
- }
734
-
735
- refresh_attr(id, type);
736
- }
737
-
738
- function change_attribute_name(id, x, type)
739
- {
740
- value=x.value;
741
- if(!value)
742
- {
743
- alert('The name of the attribute is required.');
744
- return;
745
- }
746
-
747
- if(value.toLowerCase()=="style")
748
- {
749
- alert('Sorry, you cannot add a style attribute here. Use "Class name" instead.');
750
- return;
751
- }
752
-
753
- if(value==parseInt(value))
754
- {
755
- alert('The name of the attribute cannot be a number.');
756
- return;
757
- }
758
-
759
- if(value.indexOf(" ")!=-1)
760
- {
761
- var regExp = /\s+/g;
762
- value=value.replace(regExp,'');
763
- x.value=value;
764
- alert("The name of the attribute cannot contain a space.");
765
- refresh_attr(id, type);
766
- return;
767
- }
768
-
769
- refresh_attr(id, type);
770
-
771
- }
772
-
773
- function remove_attr(id, el_id,type)
774
- {
775
- tr=document.getElementById("attr_row_"+id);
776
- tr.parentNode.removeChild(tr);
777
- refresh_attr(el_id, type);
778
- }
779
-
780
- function change_attributes(id, attr)
781
- {
782
-
783
- var div = document.createElement('div');
784
- var element=document.getElementById(id);
785
- element.setAttribute(attr, '');
786
- }
787
-
788
- function add_button(i)
789
- {
790
- edit_main_td4=document.getElementById('buttons');
791
- if(edit_main_td4.lastChild)
792
- j=parseInt(edit_main_td4.lastChild.getAttribute("idi"))+1;
793
- else
794
- j=1;
795
- var table_button = document.createElement('table');
796
-
797
- table_button.setAttribute("width", "100%");
798
- table_button.setAttribute("border", "0");
799
- table_button.setAttribute("id", "button_opt"+j);
800
- table_button.setAttribute("idi", j);
801
- var tr_button = document.createElement('tr');
802
- var tr_hr = document.createElement('tr');
803
-
804
- var td_button = document.createElement('td');
805
- var td_X = document.createElement('td');
806
- var td_hr = document.createElement('td');
807
- td_hr.setAttribute("colspan", "3");
808
-
809
- tr_hr.appendChild(td_hr);
810
- tr_button.appendChild(td_button);
811
- tr_button.appendChild(td_X);
812
- table_button.appendChild(tr_hr);
813
- table_button.appendChild(tr_button);
814
-
815
- var br1 = document.createElement('br');
816
-
817
- var hr = document.createElement('hr');
818
-
819
- hr.setAttribute("id", "br"+j);
820
-
821
-
822
-
823
-
824
- var el_title_label = document.createElement('label');
825
-
826
- el_title_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
827
-
828
- el_title_label.innerHTML = "Button name";
829
-
830
- var el_title = document.createElement('input');
831
-
832
- el_title.setAttribute("id", "el_title"+j);
833
-
834
- el_title.setAttribute("type", "text");
835
-
836
- el_title.setAttribute("value", "Button");
837
-
838
- el_title.style.cssText = "width:100px; margin-left:43px; padding:0; border-width: 1px";
839
-
840
- el_title.setAttribute("onKeyUp", "change_label('"+i+"_elementform_id_temp"+j+"', this.value);");
841
-
842
-
843
-
844
- var el_func_label = document.createElement('label');
845
-
846
- el_func_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
847
-
848
- el_func_label.innerHTML = "OnClick function";
849
-
850
- var el_func = document.createElement('input');
851
-
852
- el_func.setAttribute("id", "el_func"+j);
853
-
854
- el_func.setAttribute("type", "text");
855
-
856
- el_func.setAttribute("value", "");
857
-
858
- el_func.style.cssText = "width:100px; margin-left:20px;; padding:0; border-width: 1px";
859
-
860
- el_func.setAttribute("onKeyUp", "change_func('"+i+"_elementform_id_temp"+j+"', this.value);");
861
-
862
- var el_choices_remove = document.createElement('img');
863
-
864
- el_choices_remove.setAttribute("id", "el_button"+j+"_remove");
865
-
866
- el_choices_remove.setAttribute("src", plugin_url+'/images/delete.png');
867
-
868
- el_choices_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
869
-
870
- el_choices_remove.setAttribute("align", 'top');
871
-
872
- el_choices_remove.setAttribute("onClick", "remove_button("+j+","+i+")");
873
-
874
-
875
-
876
- td_hr.appendChild(hr);
877
-
878
- td_button.appendChild(el_title_label);
879
-
880
- td_button.appendChild(el_title);
881
- td_button.appendChild(br1);
882
- td_button.appendChild(el_func_label);
883
-
884
- td_button.appendChild(el_func);
885
- td_X.appendChild(el_choices_remove);
886
- edit_main_td4.appendChild(table_button);
887
-
888
- element='button'; type='button';
889
-
890
- td2=document.getElementById(i+"_element_sectionform_id_temp");
891
-
892
- var adding = document.createElement(element);
893
- adding.setAttribute("type", type);
894
- adding.setAttribute("id", i+"_elementform_id_temp"+j);
895
- adding.setAttribute("name", i+"_elementform_id_temp"+j);
896
- adding.setAttribute("value", "Button");
897
- adding.innerHTML = "Button";
898
- adding.setAttribute("onclick", "");
899
-
900
-
901
- td2.appendChild(adding);
902
-
903
- refresh_attr(i,'type_checkbox');
904
- }
905
-
906
- function remove_button(j,i)
907
- {
908
- table=document.getElementById('button_opt'+j);
909
- button=document.getElementById(i+'_elementform_id_temp'+j);
910
- table.parentNode.removeChild(table);
911
- button.parentNode.removeChild(button);
912
- }
913
-
914
- function change_date_format(value, id)
915
- {
916
- input_p=document.getElementById(id+'_buttonform_id_temp');
917
- input_p.setAttribute("onclick", "return showCalendar('"+id+"_elementform_id_temp' , '"+value+"')");
918
- input_p.setAttribute("format", value);
919
- }
920
-
921
- function set_send(id)
922
- {
923
- if(document.getElementById(id).value=="yes")
924
- document.getElementById(id).setAttribute("value", "no")
925
- else
926
- document.getElementById(id).setAttribute("value", "yes")
927
- }
928
-
929
- function change_class(x,id)
930
- {
931
- if(document.getElementById(id+'_label_sectionform_id_temp'))
932
- document.getElementById(id+'_label_sectionform_id_temp').setAttribute("class",x);
933
- if(document.getElementById(id+'_element_sectionform_id_temp'))
934
- document.getElementById(id+'_element_sectionform_id_temp').setAttribute("class",x);
935
- }
936
-
937
- function set_required(id)
938
- {
939
- if(document.getElementById(id+"form_id_temp").value=="yes")
940
- {
941
- document.getElementById(id+"form_id_temp").setAttribute("value", "no");
942
- document.getElementById(id+"_elementform_id_temp").innerHTML="";
943
- }
944
- else
945
- {
946
- document.getElementById(id+"form_id_temp").setAttribute("value", "yes")
947
- document.getElementById(id+"_elementform_id_temp").innerHTML=" *";
948
- }
949
- }
950
-
951
- function set_unique(id)
952
- {
953
- if(document.getElementById(id).value=="yes")
954
- {
955
- document.getElementById(id).setAttribute("value", "no");
956
- }
957
- else
958
- {
959
- document.getElementById(id).setAttribute("value", "yes")
960
- }
961
- }
962
-
963
- function set_randomize(id)
964
- {
965
- if(document.getElementById(id).value=="yes")
966
- {
967
- document.getElementById(id).setAttribute("value", "no");
968
- }
969
- else
970
- {
971
- document.getElementById(id).setAttribute("value", "yes")
972
- }
973
- }
974
- function show_other_input(num)
975
- {
976
- for(k=0;k<50;k++)
977
- if( document.getElementById(num+"_elementform_id_temp"+k))
978
- if( document.getElementById(num+"_elementform_id_temp"+k).getAttribute('other'))
979
- if( document.getElementById(num+"_elementform_id_temp"+k).getAttribute('other')==1)
980
- {
981
- element_other=document.getElementById(num+"_elementform_id_temp"+k);
982
- break;
983
- }
984
-
985
-
986
-
987
- parent=element_other.parentNode;
988
-
989
- var br = document.createElement('br');
990
- br.setAttribute("id", num+"_other_brform_id_temp");
991
-
992
- var el_other = document.createElement('input');
993
- el_other.setAttribute("id", num+"_other_inputform_id_temp");
994
- el_other.setAttribute("name", num+"_other_inputform_id_temp");
995
- el_other.setAttribute("type", "text");
996
- el_other.setAttribute("class", "other_input");
997
- parent.appendChild(br);
998
- parent.appendChild(el_other);
999
-
1000
- }
1001
-
1002
- function set_allow_other(num, type)
1003
- {
1004
- if(document.getElementById(num+'_allow_otherform_id_temp').value=="yes")
1005
- {
1006
- document.getElementById(num+'_allow_otherform_id_temp').setAttribute("value", "no");
1007
- for(k=0;k<50;k++)
1008
- if( document.getElementById(num+"_elementform_id_temp"+k))
1009
- if( document.getElementById(num+"_elementform_id_temp"+k).getAttribute('other'))
1010
- if( document.getElementById(num+"_elementform_id_temp"+k).getAttribute('other')==1)
1011
- {
1012
- remove_choise(k,num);
1013
- break;
1014
- }
1015
-
1016
- }
1017
- else
1018
- {
1019
- document.getElementById(num+'_allow_otherform_id_temp').setAttribute("value", "yes");
1020
- var q=0;
1021
- if(document.getElementById(num+'_hor'))
1022
- {
1023
- q=1;
1024
- flow_ver(num);
1025
- }
1026
- j++;
1027
- element='input';
1028
-
1029
- var table = document.getElementById(num+'_table_little');
1030
- var tr = document.createElement('tr');
1031
- tr.setAttribute("id", num+"_element_tr"+j);
1032
- var td = document.createElement('td');
1033
- td.setAttribute("valign", "top");
1034
- td.setAttribute("id", num+"_td_little"+j);
1035
- td.setAttribute("idi", j);
1036
- var adding = document.createElement(element);
1037
- adding.setAttribute("type", type);
1038
- adding.setAttribute("value", "other");
1039
- adding.setAttribute("other", "1");
1040
- adding.setAttribute("id", num+"_elementform_id_temp"+j);
1041
- if(type=="checkbox")
1042
- {
1043
- adding.setAttribute("onClick", "if(set_checked('"+num+"','"+j+"','form_id_temp')) show_other_input('"+num+"','form_id_temp');");
1044
- adding.setAttribute("name", num+"_elementform_id_temp"+j);
1045
- }
1046
- else
1047
- {
1048
- adding.setAttribute("onClick", "set_default('"+num+"','"+j+"','form_id_temp'); show_other_input('"+num+"','form_id_temp');");
1049
- adding.setAttribute("name", num+"_elementform_id_temp");
1050
- }
1051
-
1052
-
1053
- var label_adding = document.createElement('label');
1054
- label_adding.setAttribute("id", num+"_label_element"+j);
1055
- label_adding.setAttribute("class", "ch_rad_label");
1056
- label_adding.setAttribute("for",num+"_elementform_id_temp"+j);
1057
- label_adding.innerHTML="other";
1058
- td.appendChild(adding);
1059
- td.appendChild(label_adding);
1060
- tr.appendChild(td);
1061
- table.appendChild(tr);
1062
-
1063
- var choices_td= document.getElementById('choices');
1064
- var br = document.createElement('br');
1065
- br.setAttribute("id", "br"+j);
1066
- var el_choices = document.createElement('input');
1067
- el_choices.setAttribute("id", "el_choices"+j);
1068
- el_choices.setAttribute("type", "text");
1069
- el_choices.setAttribute("value", "other");
1070
- el_choices.style.cssText = "width:100px; margin:0; padding:0; border-width: 1px";
1071
- el_choices.setAttribute("onKeyUp", "change_label('"+num+"_label_element"+j+"', this.value); change_in_value('"+num+"_elementform_id_temp"+j+"', this.value)");
1072
-
1073
- var el_choices_remove = document.createElement('img');
1074
- el_choices_remove.setAttribute("id", "el_choices"+j+"_remove");
1075
- el_choices_remove.setAttribute("src", plugin_url+'/images/delete.png');
1076
- el_choices_remove.style.cssText = 'cursor:pointer;vertical-align:middle; margin:3px; display:none';
1077
- el_choices_remove.setAttribute("align", 'top');
1078
- el_choices_remove.setAttribute("onClick", "remove_choise('"+j+"','"+num+"')");
1079
-
1080
- choices_td.appendChild(br);
1081
- choices_td.appendChild(el_choices);
1082
- choices_td.appendChild(el_choices_remove);
1083
- refresh_attr(num, 'type_checkbox');
1084
- if(q==1)
1085
- {
1086
- flow_hor(num);
1087
- }
1088
- }
1089
- }
1090
-
1091
- function flow_hor(id)
1092
- {
1093
- tbody=document.getElementById(id+'_table_little');
1094
- td_array= new Array();
1095
- n=tbody.childNodes.length;
1096
- for(k=0; k<n;k++)
1097
- td_array[k]=tbody.childNodes[k].childNodes[0];
1098
-
1099
- for(k=0; k<n;k++)
1100
- tbody.removeChild(tbody.childNodes[0]);
1101
-
1102
- var tr = document.createElement('tr');
1103
- tr.setAttribute("id", id+"_hor");
1104
-
1105
- tbody.appendChild(tr);
1106
- for(k=0; k<n;k++)
1107
- tr.appendChild(td_array[k]);
1108
- }
1109
-
1110
- function flow_ver(id)
1111
- {
1112
- tbody=document.getElementById(id+'_table_little');
1113
- tr=document.getElementById(id+'_hor');
1114
- td_array= new Array();
1115
- n=tr.childNodes.length;
1116
-
1117
- for(k=0; k<n;k++)
1118
- td_array[k]=tr.childNodes[k];
1119
-
1120
- tbody.removeChild(tr);
1121
-
1122
- for(k=0; k<n;k++)
1123
- {
1124
- var tr_little = document.createElement('tr');
1125
- tr_little.setAttribute("id", id+"_element_tr"+td_array[k].getAttribute("idi"));
1126
- tr_little.appendChild(td_array[k]);
1127
- tbody.appendChild(tr_little);
1128
- }
1129
- }
1130
-
1131
- function check_isnum_3_10(e)
1132
- {
1133
-
1134
- var chCode1 = e.which || e.keyCode;
1135
- if (chCode1 > 31 && (chCode1 < 51 || chCode1 > 57))
1136
- return false
1137
- else if((document.getElementById('captcha_digit').value+(chCode1-48))>9)
1138
- return false;
1139
- return true;
1140
- }
1141
-
1142
- function set_sel_am_pm(select_)
1143
- {
1144
- if(select_.options[0].selected)
1145
- {
1146
- select_.options[0].setAttribute("selected", "selected");
1147
- select_.options[1].removeAttribute("selected");
1148
- }
1149
- else
1150
- {
1151
- select_.options[1].setAttribute("selected", "selected");
1152
- select_.options[0].removeAttribute("selected");
1153
- }
1154
-
1155
- }
1156
-
1157
- function change_captcha_digit(digit)
1158
- {
1159
- captcha=document.getElementById('_wd_captchaform_id_temp');
1160
- if(document.getElementById('captcha_digit').value)
1161
- {
1162
- captcha.setAttribute("digit", digit);
1163
-
1164
- captcha.setAttribute("src", url_for_ajax+"?action=formcontactwdcaptcha"+"&digit="+digit+"&i=form_id_temp");
1165
- document.getElementById('_wd_captcha_inputform_id_temp').style.width=(document.getElementById('captcha_digit').value*10+15)+"px";
1166
- }
1167
- else
1168
- {
1169
- captcha.setAttribute("digit", "6");
1170
- captcha.setAttribute("src", url_for_ajax+"?action=formcontactwdcaptcha"+"&digit=6"+"&i=form_id_temp");
1171
- document.getElementById('_wd_captcha_inputform_id_temp').style.width=(6*10+15)+"px";
1172
- }
1173
- }
1174
-
1175
- function second_no(id)
1176
- {
1177
- time_box=document.getElementById(id+'_tr_time1');
1178
- text_box=document.getElementById(id+'_tr_time2');
1179
- second_box=document.getElementById(id+'_td_time_input3');
1180
- second_text=document.getElementById(id+'_td_time_label3');
1181
- document.getElementById(id+'_td_time_input2').parentNode.removeChild(document.getElementById(id+'_td_time_input2').nextSibling);
1182
- time_box.removeChild(second_box);
1183
- text_box.removeChild(second_text.previousSibling);
1184
- text_box.removeChild(second_text);
1185
-
1186
- }
1187
-
1188
- function second_yes(id, w_ss)
1189
- {
1190
- time_box=document.getElementById(id+'_tr_time1');
1191
- text_box=document.getElementById(id+'_tr_time2');
1192
-
1193
- var td_time_input2_ket = document.createElement('td');
1194
- td_time_input2_ket.setAttribute("align", "center");
1195
- var td_time_input3 = document.createElement('td');
1196
- td_time_input3.setAttribute("id", id+"_td_time_input3");
1197
-
1198
- var td_time_label2_ket = document.createElement('td');
1199
-
1200
- var td_time_label3 = document.createElement('td');
1201
- td_time_label3.setAttribute("id", id+"_td_time_label3");
1202
-
1203
- var mm_ = document.createElement('span');
1204
- mm_.setAttribute("class", 'wdform_colon');
1205
- mm_.style.cssText = "font-style:bold; vertical-align:middle";
1206
- mm_.innerHTML="&nbsp;:&nbsp;";
1207
- td_time_input2_ket.appendChild(mm_);
1208
-
1209
- var ss = document.createElement('input');
1210
-
1211
- ss.setAttribute("type", 'text');
1212
- ss.setAttribute("value", w_ss);
1213
-
1214
- ss.setAttribute("class", "time_box");
1215
- ss.setAttribute("id", id+"_ssform_id_temp");
1216
- ss.setAttribute("name", id+"_ssform_id_temp");
1217
- ss.setAttribute("onKeyPress", "return check_second(event, '"+id+"_ssform_id_temp')");
1218
- ss.setAttribute("onKeyUp", "change_second('"+id+"_ssform_id_temp')");
1219
- ss.setAttribute("onBlur", "add_0('"+id+"_ssform_id_temp')");
1220
- var ss_label = document.createElement('label');
1221
- ss_label.setAttribute("class", "mini_label");
1222
- ss_label.innerHTML="SS";
1223
-
1224
- td_time_input3.appendChild(ss);
1225
- td_time_label3.appendChild(ss_label);
1226
-
1227
- if(document.getElementById(id+'_am_pm_select'))
1228
- {
1229
- select_=document.getElementById(id+"_am_pm_select");
1230
- select_text=document.getElementById(id+"_am_pm_label");
1231
-
1232
- time_box.insertBefore(td_time_input3, select_);
1233
- time_box.insertBefore(td_time_input2_ket, td_time_input3);
1234
-
1235
- text_box.insertBefore(td_time_label3, select_text);
1236
- text_box.insertBefore(td_time_label2_ket, td_time_label3);
1237
- }
1238
- else
1239
- {
1240
- time_box.appendChild(td_time_input2_ket);
1241
- time_box.appendChild(td_time_input3);
1242
- text_box.appendChild(td_time_label2_ket);
1243
- text_box.appendChild(td_time_label3);
1244
- }
1245
- refresh_attr(id, 'type_time');
1246
- }
1247
-
1248
- function check_isnum(e)
1249
- {
1250
-
1251
- var chCode1 = e.which || e.keyCode;
1252
- if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57))
1253
- return false;
1254
- return true;
1255
- }
1256
-
1257
- function change_w_style(id, w)
1258
- {
1259
- if(document.getElementById(id))
1260
- document.getElementById(id).style.width=w+"px";
1261
- }
1262
-
1263
- function change_w_label(id, w)
1264
- {
1265
- if(document.getElementById(id))
1266
- document.getElementById(id).innerHTML=w;
1267
- }
1268
-
1269
- function change_h_style(id, h)
1270
- {
1271
- document.getElementById(id).style.height=h+"px";
1272
- }
1273
-
1274
- function change_w(id, w)
1275
- {
1276
- document.getElementById(id).setAttribute("width", w)
1277
- }
1278
-
1279
- function change_h(id, h)
1280
- {
1281
- document.getElementById(id).setAttribute("height", h);
1282
- }
1283
-
1284
- function change_key(value, attribute)
1285
- {
1286
- document.getElementById('wd_recaptchaform_id_temp').setAttribute(attribute, value);
1287
- }
1288
-
1289
- function captcha_refresh(id)
1290
- {
1291
- srcArr=document.getElementById(id+"form_id_temp").src.split("&r=");
1292
- document.getElementById(id+"form_id_temp").src=srcArr[0]+'&r='+Math.floor(Math.random()*100);
1293
- document.getElementById(id+"_inputform_id_temp").value='';
1294
- }
1295
-
1296
- function up_row(id)
1297
- {
1298
- form=document.getElementById(id).parentNode;
1299
- k=0;
1300
-
1301
- while(form.childNodes[k])
1302
- {
1303
- if(form.childNodes[k].getAttribute("id"))
1304
- if(id==form.childNodes[k].getAttribute("id"))
1305
- break;
1306
- k++;
1307
- }
1308
-
1309
- if(k!=0)
1310
- {
1311
- up=form.childNodes[k-1];
1312
- down=form.childNodes[k];
1313
- form.removeChild(down);
1314
- form.insertBefore(down, up);
1315
- return;
1316
- }
1317
-
1318
- ///////////en depqum yerb section breaka
1319
- form_view_elemet =form.parentNode.parentNode.parentNode.parentNode;
1320
-
1321
- current_tr =form.parentNode.parentNode.parentNode;
1322
-
1323
- if(current_tr.previousSibling)
1324
- if(current_tr.previousSibling.nodeType==3)
1325
- {
1326
- if(current_tr.previousSibling.previousSibling.getAttribute('type'))
1327
- {
1328
- current_tr.previousSibling.previousSibling.previousSibling.previousSibling.firstChild.firstChild.firstChild.appendChild(document.getElementById(id));
1329
- return;
1330
- }
1331
- }
1332
- else
1333
- {
1334
- if(current_tr.previousSibling.getAttribute('type'))
1335
- {
1336
- current_tr.previousSibling.previousSibling.firstChild.firstChild.firstChild.appendChild(document.getElementById(id));
1337
- return;
1338
- }
1339
- }
1340
-
1341
-
1342
- ///////////pagei mej
1343
- page_up(id);
1344
- }
1345
-
1346
- function down_row(id)
1347
- {
1348
- form=document.getElementById(id).parentNode;
1349
- l=form.childNodes.length;
1350
- k=0;
1351
- while(form.childNodes[k])
1352
- {
1353
- if(id==form.childNodes[k].id)
1354
- break;
1355
- k++;
1356
- }
1357
-
1358
- if(k!=l-1)
1359
- {
1360
- ///////////ira mej
1361
- up=form.childNodes[k];
1362
- down=form.childNodes[k+2];
1363
- form.removeChild(up);
1364
-
1365
- if(!down)
1366
- down=null;
1367
-
1368
- form.insertBefore(up, down);
1369
- return;
1370
- }
1371
- ///////////en depqum yerb section breaka
1372
- form_view_elemet =form.parentNode.parentNode.parentNode.parentNode;
1373
-
1374
- current_tr =form.parentNode.parentNode.parentNode;
1375
-
1376
- if(current_tr.nextSibling.nodeType==3)
1377
- {
1378
- if(current_tr.nextSibling.nextSibling.getAttribute('type'))
1379
- {
1380
- current_tr.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.firstChild.firstChild.appendChild(document.getElementById(id));
1381
- return;
1382
- }
1383
- }
1384
- else
1385
- {
1386
- if(current_tr.nextSibling.getAttribute('type'))
1387
- {
1388
- current_tr.nextSibling.nextSibling.firstChild.firstChild.firstChild.appendChild(document.getElementById(id));
1389
- return;
1390
- }
1391
- }
1392
-
1393
-
1394
- ///////////pagei mej
1395
- page_down(id);
1396
-
1397
- }
1398
-
1399
- function right_row(id)
1400
- {
1401
- tr=document.getElementById(id);
1402
- table_big=tr.parentNode.parentNode;
1403
- td_big=tr.parentNode.parentNode.parentNode;
1404
- if(table_big.nextSibling!=null)
1405
- {
1406
- td_next=table_big.nextSibling;
1407
- td_next.firstChild.appendChild(tr);
1408
-
1409
- }
1410
- else
1411
- {
1412
-
1413
- var new_td = document.createElement('td');
1414
- new_td.setAttribute("valign", "top");
1415
-
1416
- var new_table = document.createElement('table');
1417
- new_table.setAttribute("class", "wdform_table2");
1418
- var new_tbody = document.createElement('tbody');
1419
-
1420
- // tr_big.appendChild(new_td);
1421
-
1422
- td_big.appendChild(new_table);
1423
-
1424
- new_table.appendChild(new_tbody);
1425
-
1426
- new_tbody.appendChild(tr);
1427
-
1428
- }
1429
-
1430
- if(table_big.firstChild.firstChild==null)
1431
- td_big.removeChild(table_big);
1432
-
1433
- }
1434
-
1435
- function left_row(id)
1436
- {
1437
- tr=document.getElementById(id);
1438
- td_big=tr.parentNode.parentNode.parentNode;
1439
- table_big=tr.parentNode.parentNode;
1440
- if(table_big.previousSibling!=null)
1441
- {
1442
-
1443
- table_previous=table_big.previousSibling;
1444
- table_previous.firstChild.appendChild(tr);
1445
-
1446
- if(table_big.firstChild.firstChild==null)
1447
- td_big.removeChild(table_big);
1448
- }
1449
-
1450
- }
1451
-
1452
- function page_up(id)
1453
- {
1454
- form=document.getElementById(id).parentNode;
1455
-
1456
- form_view_elemet =form.parentNode.parentNode.parentNode.parentNode;
1457
- form_view_elemet_copy =form.parentNode.parentNode.parentNode.parentNode;
1458
-
1459
- table=form_view_elemet.parentNode;
1460
-
1461
- //alert(table);
1462
-
1463
- while(table)
1464
- {
1465
- table=table.previousSibling;
1466
- while(table)
1467
- {
1468
- if(table.tagName=="TABLE")
1469
- break;
1470
- else
1471
- table=table.previousSibling;
1472
- }
1473
-
1474
- if(!table)
1475
- {
1476
- alert('Unable to move');
1477
- return;
1478
- }
1479
- form_maker_remove_spaces(table);
1480
- if(jQuery(table.firstChild).is(":visible"))
1481
- break;
1482
-
1483
- }
1484
-
1485
-
1486
- n=table.firstChild.childNodes.length;
1487
-
1488
- table.firstChild.childNodes[n-2].firstChild.firstChild.firstChild.appendChild(document.getElementById(id));
1489
-
1490
- /* glob_n=form_view_elemet_copy.firstChild.firstChild.childNodes.length;
1491
- for(i=0; i<glob_n; i++)
1492
- {
1493
- if(table.firstChild.firstChild.childNodes[i])
1494
- {
1495
- to_add=table.firstChild.firstChild.childNodes[i];
1496
- to_add.firstChild.firstChild.appendChild(document.getElementById(id));
1497
- }
1498
- else
1499
- {
1500
- to_add=table.firstChild.firstChild.firstChild;
1501
- to_add.firstChild.firstChild.appendChild(document.getElementById(id));
1502
- }
1503
- }*/
1504
-
1505
-
1506
- refresh_pages(id);
1507
-
1508
-
1509
-
1510
-
1511
-
1512
- }
1513
-
1514
- function page_down(id)
1515
- {
1516
- form=document.getElementById(id).parentNode;
1517
-
1518
- form_view_elemet =form.parentNode.parentNode.parentNode.parentNode;
1519
- form_view_elemet_copy =form.parentNode.parentNode.parentNode.parentNode;
1520
-
1521
- table=form_view_elemet.parentNode;
1522
-
1523
- while(table)
1524
- {
1525
- table=table.nextSibling;
1526
-
1527
- while(table)
1528
- {
1529
- if(table.tagName=="TABLE")
1530
- break;
1531
- else
1532
- table=table.nextSibling;
1533
- }
1534
-
1535
- if(!table)
1536
- {
1537
- alert('Unable to move');
1538
- return;
1539
- }
1540
-
1541
- if(jQuery(table.firstChild).is(":visible"))
1542
- break;
1543
- }
1544
-
1545
- n=table.firstChild.childNodes.length;
1546
-
1547
- table.firstChild.firstChild.firstChild.firstChild.firstChild.insertBefore(document.getElementById(id), table.firstChild.firstChild.firstChild.firstChild.firstChild.firstChild);
1548
- refresh_pages(id);
1549
-
1550
- }
1551
-
1552
-
1553
-
1554
- function Disable()
1555
- {
1556
- select_=document.getElementById('sel_el_pos');
1557
- select_.setAttribute("disabled", "disabled");
1558
- select_.innerHTML="";
1559
- }
1560
-
1561
- function Enable()
1562
- {
1563
- var pos=document.getElementsByName("el_pos");
1564
- pos[0].setAttribute("checked", "checked");
1565
-
1566
- select_ = document.getElementById('sel_el_pos');
1567
- select_.innerHTML="";
1568
-
1569
- for(k=1;k<=form_view_max;k++)
1570
- if(document.getElementById('form_id_tempform_view'+k))
1571
- {
1572
- form_view_element=document.getElementById('form_id_tempform_view'+k);
1573
- form_maker_remove_spaces(form_view_element);
1574
- n=form_view_element.childNodes.length-2;
1575
- for(z=0;z<=n;z++)
1576
- {
1577
- if(!form_view_element.childNodes[z].id)
1578
- {
1579
- GLOBAL_tr=form_view_element.childNodes[z];
1580
-
1581
- for (x=0; x < GLOBAL_tr.firstChild.childNodes.length; x++)
1582
- {
1583
- table=GLOBAL_tr.firstChild.childNodes[x];
1584
- tbody=table.firstChild;
1585
- for (y=0; y < tbody.childNodes.length; y++)
1586
- {
1587
- tr=tbody.childNodes[y];
1588
- var option = document.createElement('option');
1589
- option.setAttribute("id", tr.id+"_sel_el_pos");
1590
- option.setAttribute("value", tr.id);
1591
- option.innerHTML=document.getElementById( tr.id+'_element_labelform_id_temp').innerHTML;
1592
- select_.appendChild(option);
1593
- }
1594
- }
1595
- }
1596
- }
1597
- }
1598
-
1599
- select_.removeAttribute("disabled");
1600
- }
1601
-
1602
- function all_labels()
1603
- {
1604
- labels=new Array();
1605
- for(k=1;k<=form_view_max;k++)
1606
- if(document.getElementById('form_id_tempform_view'+k))
1607
- {
1608
- form_view_element=document.getElementById('form_id_tempform_view'+k);
1609
- form_maker_remove_spaces(form_view_element);
1610
- n=form_view_element.childNodes.length-2;
1611
- for(z=0;z<=n;z++)
1612
- {
1613
- if(!form_view_element.childNodes[z].id)
1614
- {
1615
- GLOBAL_tr=form_view_element.childNodes[z];
1616
-
1617
- for (x=0; x < GLOBAL_tr.firstChild.childNodes.length; x++)
1618
- {
1619
- table=GLOBAL_tr.firstChild.childNodes[x];
1620
- tbody=table.firstChild;
1621
- for (y=0; y < tbody.childNodes.length; y++)
1622
- {
1623
- tr=tbody.childNodes[y];
1624
- labels.push( document.getElementById(tr.id+'_element_labelform_id_temp').innerHTML);
1625
- }
1626
- }
1627
- }
1628
- }
1629
- }
1630
-
1631
- return labels;
1632
- }
1633
-
1634
- function set_checked(id,j)
1635
- {
1636
- checking=document.getElementById(id+"_elementform_id_temp"+j);
1637
- if(checking.checked)
1638
- checking.setAttribute("checked", "checked");
1639
- if(!checking.checked)
1640
- {
1641
- checking.removeAttribute("checked");
1642
- if(checking.getAttribute('other'))
1643
- if(checking.getAttribute('other')==1)
1644
- {
1645
- if(document.getElementById(id+"_other_inputform_id_temp"))
1646
- {
1647
- document.getElementById(id+"_other_inputform_id_temp").parentNode.removeChild(document.getElementById(id+"_other_brform_id_temp"));
1648
- document.getElementById(id+"_other_inputform_id_temp").parentNode.removeChild(document.getElementById(id+"_other_inputform_id_temp"));
1649
- }
1650
- return false;
1651
- }
1652
- }
1653
- return true;
1654
- }
1655
-
1656
- function set_default(id, j)
1657
- {
1658
- for(k=0; k<100; k++)
1659
- if(document.getElementById(id+"_elementform_id_temp"+k))
1660
- if(!document.getElementById(id+"_elementform_id_temp"+k).checked)
1661
- document.getElementById(id+"_elementform_id_temp"+k).removeAttribute("checked");
1662
- else
1663
- document.getElementById(id+"_elementform_id_temp"+j).setAttribute("checked", "checked");
1664
-
1665
- if(document.getElementById(id+"_other_inputform_id_temp"))
1666
- {
1667
- document.getElementById(id+"_other_inputform_id_temp").parentNode.removeChild(document.getElementById(id+"_other_brform_id_temp"));
1668
- document.getElementById(id+"_other_inputform_id_temp").parentNode.removeChild(document.getElementById(id+"_other_inputform_id_temp"));
1669
- }
1670
- }
1671
-
1672
- function set_select(select_)
1673
- {
1674
- for (p = select_.length - 1; p>=0; p--)
1675
- if (select_.options[p].selected)
1676
- select_.options[p].setAttribute("selected", "selected");
1677
- else
1678
- select_.options[p].removeAttribute("selected");
1679
- }
1680
-
1681
- function add_0(id)
1682
- {
1683
- input=document.getElementById(id);
1684
- if(input.value.length==1)
1685
- {
1686
- input.value='0'+input.value;
1687
- input.setAttribute("value", input.value);
1688
- }
1689
- }
1690
-
1691
- function change_hour(ev, id, hour_interval)
1692
- {
1693
- if(check_hour(ev, id, hour_interval))
1694
- {
1695
- input=document.getElementById(id);
1696
- input.setAttribute("value", input.value);
1697
- }
1698
- }
1699
-
1700
- function change_minute(ev, id)
1701
- {
1702
- if(check_minute(ev, id))
1703
- {
1704
- input=document.getElementById(id);
1705
- input.setAttribute("value", input.value);
1706
- }
1707
- }
1708
-
1709
- function change_second(ev, id)
1710
- {
1711
- if(check_second(ev, id))
1712
- {
1713
- input=document.getElementById(id);
1714
- input.setAttribute("value", input.value);
1715
- }
1716
- }
1717
-
1718
- function check_hour(e, id, hour_interval)
1719
- {
1720
- var chCode1 = e.which || e.keyCode;
1721
- if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57))
1722
- return false;
1723
- hour=""+document.getElementById(id).value+String.fromCharCode(chCode1);
1724
-
1725
- hour=parseFloat(hour);
1726
- if((hour<0) || (hour>hour_interval))
1727
- return false;
1728
- return true;
1729
- }
1730
-
1731
- function check_minute(e, id)
1732
- {
1733
-
1734
-
1735
- var chCode1 = e.which || e.keyCode;
1736
- if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57))
1737
- return false;
1738
- minute=""+document.getElementById(id).value+String.fromCharCode(chCode1);
1739
-
1740
- minute=parseFloat(minute);
1741
- if((minute<0) || (minute>59))
1742
- return false;
1743
- return true;
1744
- }
1745
-
1746
- function check_second(e, id)
1747
- {
1748
-
1749
-
1750
- var chCode1 = e.which || e.keyCode;
1751
- if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57))
1752
- return false;
1753
- second=""+document.getElementById(id).value+String.fromCharCode(chCode1);
1754
-
1755
- second=parseFloat(second);
1756
- if((second<0) || (second>59))
1757
- return false;
1758
- return true;
1759
- }
1760
-
1761
- function change_day(ev, id)
1762
- {
1763
- if(check_day(ev, id))
1764
- {
1765
- input=document.getElementById(id);
1766
- input.setAttribute("value", input.value);
1767
- }
1768
- }
1769
-
1770
- function change_month(ev, id)
1771
- {
1772
- if(check_month(ev, id))
1773
- {
1774
- input=document.getElementById(id);
1775
- input.setAttribute("value", input.value);
1776
- }
1777
- }
1778
-
1779
- function change_year(id)
1780
- {
1781
- year=document.getElementById(id).value;
1782
-
1783
- from=parseFloat(document.getElementById(id).getAttribute('from'));
1784
- to=parseFloat(document.getElementById(id).getAttribute('to'));
1785
-
1786
- year=parseFloat(year);
1787
-
1788
- if((year>=from) && (year<=to))
1789
- document.getElementById(id).setAttribute("value", year);
1790
- else
1791
- document.getElementById(id).setAttribute("value", '');
1792
- }
1793
-
1794
- function check_day(e, id)
1795
- {
1796
- var chCode1 = e.which || e.keyCode;
1797
- if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57))
1798
- return false;
1799
- day=""+document.getElementById(id).value+String.fromCharCode(chCode1);
1800
-
1801
- if(day.length>2)
1802
- return false;
1803
-
1804
- if(day=='00')
1805
- return false;
1806
-
1807
- day=parseFloat(day);
1808
- if((day<0) || (day>31))
1809
- return false;
1810
- return true;
1811
- }
1812
-
1813
- function check_month(e, id)
1814
- {
1815
-
1816
-
1817
- var chCode1 = e.which || e.keyCode;
1818
- if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57))
1819
- return false;
1820
- month=""+document.getElementById(id).value+String.fromCharCode(chCode1);
1821
-
1822
- if(month.length>2)
1823
- return false;
1824
-
1825
- if(month=='00')
1826
- return false;
1827
-
1828
- month=parseFloat(month);
1829
- if((month<0) || (month>12))
1830
- return false;
1831
- return true;
1832
- }
1833
-
1834
- function check_year2(id)
1835
- {
1836
- year=document.getElementById(id).value;
1837
-
1838
- from=parseFloat(document.getElementById(id).getAttribute('from'));
1839
-
1840
- year=parseFloat(year);
1841
-
1842
- if(year<from)
1843
- {
1844
- document.getElementById(id).value='';
1845
- alert('The value of "year" is not valid.');
1846
- }
1847
- }
1848
-
1849
- function check_year1(e, id)
1850
- {
1851
- var chCode1 = e.which || e.keyCode;
1852
- if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57))
1853
- return false;
1854
-
1855
- year=""+document.getElementById(id).value+String.fromCharCode(chCode1);
1856
-
1857
- to=parseFloat(document.getElementById(id).getAttribute('to'));
1858
-
1859
- year=parseFloat(year);
1860
-
1861
- if(year>to)
1862
- return false;
1863
- return true;
1864
- }
1865
-
1866
- function label_top(num)
1867
- {
1868
- table=document.getElementById(num+'_elemet_tableform_id_temp');
1869
- td1=document.getElementById(num+'_label_sectionform_id_temp');
1870
- td2=document.getElementById(num+'_element_sectionform_id_temp');
1871
- var table_t = document.createElement('tbody');
1872
- var new_td1 = document.createElement('td');
1873
- new_td1 = td1;
1874
- var new_td2 = document.createElement('td');
1875
- new_td2 = td2;
1876
- var tr1 = document.createElement('tr');
1877
- var tr2 = document.createElement('tr');
1878
- //table.innerHTML=" ";
1879
- while (table.firstChild)
1880
- table.removeChild(table.firstChild);
1881
- tr1.appendChild(new_td1);
1882
- tr2.appendChild(new_td2);
1883
- table_t.appendChild(tr1);
1884
- table_t.appendChild(tr2);
1885
- table.appendChild(table_t);
1886
- }
1887
-
1888
- function label_left(num)
1889
- {
1890
- table=document.getElementById(num+'_elemet_tableform_id_temp');
1891
- td1=document.getElementById(num+'_label_sectionform_id_temp');
1892
- td2=document.getElementById(num+'_element_sectionform_id_temp');
1893
- var table_t = document.createElement('tbody');
1894
- var new_td1 = document.createElement('td');
1895
- new_td1 = td1;
1896
- var new_td2 = document.createElement('td');
1897
- new_td2 = td2;
1898
- var tr = document.createElement('tr');
1899
- //table.innerHTML=" ";
1900
- while (table.firstChild)
1901
- table.removeChild(table.firstChild);
1902
- tr.appendChild(new_td1);
1903
- tr.appendChild(new_td2);
1904
- table_t.appendChild(tr);
1905
- table.appendChild(table_t);
1906
- }
1907
-
1908
- function delete_value(id)
1909
- {
1910
- ofontStyle=document.getElementById(id).className;
1911
- if(ofontStyle=="input_deactive")
1912
- {
1913
- document.getElementById(id).value="";
1914
- destroyChildren(document.getElementById(id));
1915
- document.getElementById(id).setAttribute("class", "input_active");
1916
- document.getElementById(id).className='input_active';
1917
- }
1918
- }
1919
-
1920
- function return_value(id)
1921
- {
1922
- input=document.getElementById(id);
1923
- if(input.value=="")
1924
- {
1925
- input.value=input.title;
1926
- input.className='input_deactive';
1927
- input.setAttribute("class", 'input_deactive');
1928
- }
1929
- }
1930
-
1931
- function change_value(id)
1932
- {
1933
- input=document.getElementById(id);
1934
-
1935
- tag=input.tagName;
1936
- if(tag=="TEXTAREA")
1937
- {
1938
- // destroyChildren(input)
1939
- input.innerHTML=input.value;
1940
- }
1941
- else
1942
- input.setAttribute("value", input.value);
1943
-
1944
- }
1945
-
1946
- function change_input_value(first_value, id)
1947
- {
1948
- input=document.getElementById(id);
1949
- input.title=first_value;
1950
-
1951
- if( window.getComputedStyle )
1952
- {
1953
- ofontStyle = window.getComputedStyle(input,null).fontStyle;
1954
- } else if( input.currentStyle ) {
1955
- ofontStyle = input.currentStyle.fontStyle;
1956
- }
1957
- if(ofontStyle=="italic")
1958
- {
1959
- input.value=first_value;
1960
- input.setAttribute("value", first_value);
1961
- }
1962
- }
1963
-
1964
- function change_file_value(destination, id, prefix , postfix )
1965
- {
1966
- if(typeof(prefix)=='undefined') {prefix=''; postfix=''};
1967
- input=document.getElementById(id);
1968
- input.value=prefix+destination+postfix;
1969
- input.setAttribute("value", prefix+destination+postfix);
1970
-
1971
- }
1972
-
1973
- function close_window()
1974
- {
1975
- enable();
1976
- document.getElementById('edit_table').innerHTML="";
1977
- document.getElementById('show_table').innerHTML="";
1978
- document.getElementById('main_editor').style.display="none";
1979
- if(document.getElementsByTagName("iframe")[id_ifr_editor]){
1980
- ifr_id=document.getElementsByTagName("iframe")[id_ifr_editor].id;
1981
- ifr=getIFrameDocument(ifr_id)
1982
-
1983
- ifr.body.innerHTML="";
1984
- }
1985
- document.getElementById('contact_form_editor').value="";
1986
- document.getElementById('editing_id').value="";
1987
- document.getElementById('element_type').value="";
1988
-
1989
- alltypes=Array('customHTML','text','checkbox','radio','time_and_date','select','file_upload','captcha','map','button','page_break','section_break');
1990
- for(x=0; x<12;x++)
1991
- {
1992
- if(alltypes[x]!='checkbox' && alltypes[x]!='radio' && alltypes[x]!='time_and_date' && alltypes[x]!='select' && alltypes[x]!='file_upload')
1993
- document.getElementById('img_'+alltypes[x]).parentNode.style.backgroundColor='';
1994
- }
1995
-
1996
- }
1997
-
1998
- function change_label(id, label)
1999
- {
2000
- document.getElementById(id).innerHTML=label;
2001
- document.getElementById(id).value=label;
2002
- }
2003
-
2004
- function change_func(id, label)
2005
- {
2006
- document.getElementById(id).setAttribute("onclick", label);
2007
- }
2008
-
2009
- function change_in_value(id, label)
2010
- {
2011
- document.getElementById(id).setAttribute("value", label);
2012
- }
2013
-
2014
- function change_size(size, num)
2015
- {
2016
- document.getElementById(num+'_elementform_id_temp').style.width=size+'px';
2017
- if(document.getElementById(num+'_element_input'))
2018
- document.getElementById(num+'_element_input').style.width=size+'px';
2019
- switch(size)
2020
- {
2021
- case '111':
2022
- {
2023
- document.getElementById(num+'_elementform_id_temp').setAttribute("rows", "2"); break;
2024
- }
2025
- case '222':
2026
- {
2027
- document.getElementById(num+'_elementform_id_temp').setAttribute("rows", "4");break;
2028
- }
2029
- case '444':
2030
- {
2031
- document.getElementById(num+'_elementform_id_temp').setAttribute("rows", "8");break;
2032
- }
2033
- }
2034
- }
2035
-
2036
- function add_choise(type, num)
2037
- {
2038
- var q=0;
2039
- if(document.getElementById(num+'_hor'))
2040
- {
2041
- q=1;
2042
- flow_ver(num);
2043
- }
2044
- j++;
2045
- if(type=='radio' || type=='checkbox')
2046
- {
2047
- element='input';
2048
-
2049
- var table = document.getElementById(num+'_table_little');
2050
- var tr = document.createElement('tr');
2051
- tr.setAttribute("id", num+"_element_tr"+j);
2052
- var td = document.createElement('td');
2053
- td.setAttribute("valign", "top");
2054
- td.setAttribute("id", num+"_td_little"+j);
2055
- td.setAttribute("idi", j);
2056
-
2057
- var adding = document.createElement(element);
2058
- adding.setAttribute("type", type);
2059
- adding.setAttribute("value", "");
2060
- adding.setAttribute("id", num+"_elementform_id_temp"+j);
2061
- if(type=='checkbox')
2062
- {
2063
- adding.setAttribute("onClick", "set_checked('"+num+"','"+j+"','form_id_temp')");
2064
- adding.setAttribute("name", num+"_elementform_id_temp"+j);
2065
- }
2066
-
2067
- if(type=='radio')
2068
- {
2069
- adding.setAttribute("onClick", "set_default('"+num+"','"+j+"','form_id_temp')");
2070
- adding.setAttribute("name", num+"_elementform_id_temp");
2071
- }
2072
-
2073
-
2074
- var label_adding = document.createElement('label');
2075
- label_adding.setAttribute("id", num+"_label_element"+j);
2076
- label_adding.setAttribute("class", "ch_rad_label");
2077
- label_adding.setAttribute("for",num+"_elementform_id_temp"+j);
2078
- td.appendChild(adding);
2079
- td.appendChild(label_adding);
2080
- tr.appendChild(td);
2081
- table.appendChild(tr);
2082
-
2083
- var choices_td= document.getElementById('choices');
2084
- var br = document.createElement('br');
2085
- br.setAttribute("id", "br"+j);
2086
- var el_choices = document.createElement('input');
2087
- el_choices.setAttribute("id", "el_choices"+j);
2088
- el_choices.setAttribute("type", "text");
2089
- el_choices.setAttribute("value", "");
2090
- el_choices.style.cssText = "width:100px; margin:0; padding:0; border-width: 1px";
2091
- el_choices.setAttribute("onKeyUp", "change_label('"+num+"_label_element"+j+"', this.value); change_in_value('"+num+"_elementform_id_temp"+j+"', this.value)");
2092
-
2093
- var el_choices_remove = document.createElement('img');
2094
- el_choices_remove.setAttribute("id", "el_choices"+j+"_remove");
2095
- el_choices_remove.setAttribute("src", plugin_url+'/images/delete.png');
2096
- el_choices_remove.style.cssText = 'cursor:pointer;vertical-align:middle; margin:3px';
2097
- el_choices_remove.setAttribute("align", 'top');
2098
- el_choices_remove.setAttribute("onClick", "remove_choise('"+j+"','"+num+"')");
2099
-
2100
- choices_td.appendChild(br);
2101
- choices_td.appendChild(el_choices);
2102
- choices_td.appendChild(el_choices_remove);
2103
-
2104
- if(type=='checkbox')
2105
- {
2106
- refresh_id_name(num, 'type_checkbox');
2107
- }
2108
-
2109
- if(type=='radio')
2110
- {
2111
- refresh_id_name(num, 'type_radio');
2112
- }
2113
-
2114
-
2115
- refresh_attr(num, 'type_checkbox');
2116
-
2117
- }
2118
-
2119
- if(type=='select')
2120
- {
2121
- var select_ = document.getElementById(num+'_elementform_id_temp');
2122
- var option = document.createElement('option');
2123
- option.setAttribute("id", num+"_option"+j);
2124
-
2125
- select_.appendChild(option);
2126
-
2127
- var choices_td= document.getElementById('choices');
2128
- var br = document.createElement('br');
2129
- br.setAttribute("id", "br"+j);
2130
- var el_choices = document.createElement('input');
2131
- el_choices.setAttribute("id", "el_option"+j);
2132
- el_choices.setAttribute("type", "text");
2133
- el_choices.setAttribute("value", "");
2134
- el_choices.style.cssText = "width:100px; margin:0; padding:0; border-width: 1px";
2135
- el_choices.setAttribute("onKeyUp", "change_label('"+num+"_option"+j+"', this.value)");
2136
-
2137
- var el_choices_remove = document.createElement('img');
2138
- el_choices_remove.setAttribute("id", "el_option"+j+"_remove");
2139
- el_choices_remove.setAttribute("src", plugin_url+'/images/delete.png');
2140
- el_choices_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
2141
- el_choices_remove.setAttribute("align", 'top');
2142
- el_choices_remove.setAttribute("onClick", "remove_option('"+j+"','"+num+"')");
2143
-
2144
- var el_choices_dis = document.createElement('input');
2145
- el_choices_dis.setAttribute("type", 'checkbox');
2146
- el_choices_dis.setAttribute("id", "el_option"+j+"_dis");
2147
- el_choices_dis.setAttribute("onClick", "dis_option('"+num+"_option"+j+"', this.checked)");
2148
-
2149
-
2150
- choices_td.appendChild(br);
2151
- choices_td.appendChild(el_choices);
2152
- choices_td.appendChild(el_choices_dis);
2153
- choices_td.appendChild(el_choices_remove);
2154
- }
2155
- if(q==1)
2156
- {
2157
- flow_hor(num);
2158
- }
2159
-
2160
- }
2161
-
2162
- function remove_choise(id, num)
2163
- {
2164
- var q=0;
2165
- if(document.getElementById(num+'_hor'))
2166
- {
2167
- q=1;
2168
- flow_ver(num);
2169
- }
2170
- j++;
2171
- var table = document.getElementById(num+'_table_little');
2172
- var tr = document.getElementById(num+'_element_tr'+id);
2173
- table.removeChild(tr);
2174
-
2175
- var choices_td= document.getElementById('choices');
2176
- var el_choices = document.getElementById('el_choices'+id);
2177
- var el_choices_remove = document.getElementById('el_choices'+id+'_remove');
2178
- var br = document.getElementById('br'+id);
2179
-
2180
- choices_td.removeChild(el_choices);
2181
- choices_td.removeChild(el_choices_remove);
2182
- choices_td.removeChild(br);
2183
-
2184
- if(q==1)
2185
- {
2186
- flow_hor(num);
2187
- }
2188
- refresh_id_name(num, document.getElementById(num+'_typeform_id_temp').value );
2189
-
2190
- }
2191
-
2192
- function remove_option(id, num)
2193
- {
2194
- var select_ = document.getElementById(num+'_elementform_id_temp');
2195
- var option = document.getElementById(num+'_option'+id);
2196
-
2197
- select_.removeChild(option);
2198
-
2199
- var choices_td= document.getElementById('choices');
2200
- var el_choices = document.getElementById('el_option'+id);
2201
- var el_choices_dis = document.getElementById('el_option'+id+'_dis');
2202
- var el_choices_remove = document.getElementById('el_option'+id+'_remove');
2203
- var br = document.getElementById('br'+id);
2204
-
2205
- choices_td.removeChild(el_choices);
2206
- choices_td.removeChild(el_choices_dis);
2207
- choices_td.removeChild(el_choices_remove);
2208
- choices_td.removeChild(br);
2209
- }
2210
-
2211
- function getIFrameDocument(aID){
2212
- var rv = null;
2213
- // if contentDocument exists, W3C compliant (Mozilla)
2214
- if (document.getElementById(aID).contentDocument){
2215
- rv = document.getElementById(aID).contentDocument;
2216
- } else {
2217
- // IE
2218
- rv = document.frames[aID].document;
2219
- }
2220
- return rv;
2221
- }
2222
-
2223
- function delete_last_child()
2224
- {
2225
- if(document.getElementsByTagName("iframe")[id_ifr_editor]){
2226
- ifr_id=document.getElementsByTagName("iframe")[id_ifr_editor].id;
2227
- ifr=getIFrameDocument(ifr_id);
2228
- ifr.body.innerHTML="";
2229
- }
2230
-
2231
- document.getElementById('main_editor').style.display="none";
2232
-
2233
- document.getElementById('contact_form_editor').value="";
2234
- if(document.getElementById('show_table').lastChild)
2235
- {
2236
- var del1 = document.getElementById('show_table').lastChild;
2237
- var del2 = document.getElementById('edit_table').lastChild;
2238
- var main1 = document.getElementById('show_table');
2239
- var main2 = document.getElementById('edit_table');
2240
- main1.removeChild(del1);
2241
- main2.removeChild(del2);
2242
- }
2243
- }
2244
-
2245
- function format_12(num, am_or_pm, w_hh, w_mm, w_ss)
2246
- {
2247
- tr_time1 = document.getElementById(num+'_tr_time1')
2248
- tr_time2 = document.getElementById(num+'_tr_time2')
2249
- var td1 = document.createElement('td');
2250
- td1.setAttribute("id", num+"_am_pm_select");
2251
- td1.setAttribute("class", "td_am_pm_select");
2252
- var td2 = document.createElement('td');
2253
- td2.setAttribute("id", num+"_am_pm_label");
2254
- td2.setAttribute("class", "td_am_pm_select");
2255
-
2256
- var am_pm_select = document.createElement('select');
2257
- am_pm_select.setAttribute("class", "am_pm_select");
2258
- am_pm_select.setAttribute("name", num+"_am_pmform_id_temp");
2259
- am_pm_select.setAttribute("id", num+"_am_pmform_id_temp");
2260
- am_pm_select.setAttribute("onchange", "set_sel_am_pm(this)");
2261
-
2262
- var am_option = document.createElement('option');
2263
- am_option.setAttribute("value", "am");
2264
- am_option.innerHTML="AM";
2265
-
2266
- var pm_option = document.createElement('option');
2267
- pm_option.setAttribute("value", "pm");
2268
- pm_option.innerHTML="PM";
2269
-
2270
- if(am_or_pm=="pm")
2271
- pm_option.setAttribute("selected", "selected");
2272
- else
2273
- am_option.setAttribute("selected", "selected");
2274
-
2275
-
2276
- var am_pm_label = document.createElement('label');
2277
- am_pm_label.setAttribute("class", "mini_label");
2278
- am_pm_label.innerHTML="AM/PM";
2279
-
2280
- am_pm_select.appendChild(am_option);
2281
- am_pm_select.appendChild(pm_option);
2282
- td1.appendChild(am_pm_select);
2283
- td2.appendChild(am_pm_label);
2284
- tr_time1.appendChild(td1);
2285
- tr_time2.appendChild(td2);
2286
- document.getElementById(num+'_hhform_id_temp').setAttribute("onKeyPress", "return check_hour(event, '"+num+"_hhform_id_temp',"+"'12'"+")");
2287
-
2288
- document.getElementById(num+'_hhform_id_temp').value=w_hh;
2289
- document.getElementById(num+'_mmform_id_temp').value=w_mm;
2290
- if(document.getElementById(num+'_ssform_id_temp'))
2291
- document.getElementById(num+'_ssform_id_temp').value=w_ss;
2292
-
2293
- refresh_attr(num, 'type_time');
2294
- }
2295
-
2296
- function format_24(num)
2297
- {
2298
- tr_time1 = document.getElementById(num+'_tr_time1')
2299
- td1 = document.getElementById(num+'_am_pm_select')
2300
- tr_time2 = document.getElementById(num+'_tr_time2')
2301
- td2 = document.getElementById(num+'_am_pm_label')
2302
- tr_time1.removeChild(td1);
2303
- tr_time2.removeChild(td2);
2304
- document.getElementById(num+'_hhform_id_temp').setAttribute("onKeyPress", "return check_hour(event, '"+num+"_hhform_id_temp', '23')");
2305
- document.getElementById(num+'_hhform_id_temp').value="";
2306
- document.getElementById(num+'_mmform_id_temp').value="";
2307
- if(document.getElementById(num+'_ssform_id_temp'))
2308
- document.getElementById(num+'_ssform_id_temp').value="";
2309
- }
2310
-
2311
- function format_extended(num)
2312
- {
2313
- w_size=document.getElementById(num+'_element_firstform_id_temp').style.width;
2314
- tr_name1 = document.getElementById(num+'_tr_name1');
2315
- tr_name2 = document.getElementById(num+'_tr_name2');
2316
-
2317
- var td_name_input1 = document.createElement('td');
2318
- td_name_input1.setAttribute("id", num+"_td_name_input_title");
2319
-
2320
- var td_name_input4 = document.createElement('td');
2321
- td_name_input4.setAttribute("id", num+"_td_name_input_middle");
2322
-
2323
- var td_name_label1 = document.createElement('td');
2324
- td_name_label1.setAttribute("id", num+"_td_name_label_title");
2325
- td_name_label1.setAttribute("align", "left");
2326
-
2327
- var td_name_label4 = document.createElement('td');
2328
- td_name_label4.setAttribute("id", num+"_td_name_label_middle");
2329
- td_name_label4.setAttribute("align", "left");
2330
-
2331
- var title = document.createElement('input');
2332
- title.setAttribute("type", 'text');
2333
-
2334
- title.setAttribute("class", "input_deactive");
2335
-
2336
- title.style.cssText = "margin: 0px 10px 0px 0px; padding: 0px; width:40px";
2337
- title.setAttribute("id", num+"_element_titleform_id_temp");
2338
- title.setAttribute("name", num+"_element_titleform_id_temp");
2339
- title.setAttribute("value", '');
2340
- title.setAttribute("title", '');
2341
- title.setAttribute("onFocus", 'delete_value("'+num+'_element_titleform_id_temp")');
2342
- title.setAttribute("onBlur", 'return_value("'+num+'_element_titleform_id_temp")');
2343
- title.setAttribute("onChange", "change_value('"+num+"_element_titleform_id_temp')");
2344
-
2345
- var title_label = document.createElement('label');
2346
- title_label.setAttribute("class", "mini_label");
2347
- title_label.innerHTML="<!--repstart-->Title<!--repend-->";
2348
-
2349
- var middle = document.createElement('input');
2350
- middle.setAttribute("type", 'text');
2351
- middle.setAttribute("class", "input_deactive");
2352
- middle.style.cssText = "padding: 0px; width:"+w_size;
2353
- middle.setAttribute("id", num+"_element_middleform_id_temp");
2354
- middle.setAttribute("name", num+"_element_middleform_id_temp");
2355
- middle.setAttribute("value", '');
2356
- middle.setAttribute("title", '');
2357
- middle.setAttribute("onFocus", 'delete_value("'+num+'_element_middleform_id_temp")');
2358
- middle.setAttribute("onBlur", 'return_value("'+num+'_element_middleform_id_temp")');
2359
- middle.setAttribute("onChange", "change_value('"+num+"_element_middleform_id_temp')");
2360
-
2361
- var middle_label = document.createElement('label');
2362
- middle_label.setAttribute("class", "mini_label");
2363
- middle_label.innerHTML="<!--repstart-->Middle<!--repend-->";
2364
-
2365
- first_input = document.getElementById(num+'_td_name_input_first');
2366
- last_input = document.getElementById(num+'_td_name_input_last');
2367
- first_label = document.getElementById(num+'_td_name_label_first');
2368
- last_label = document.getElementById(num+'_td_name_label_last');
2369
-
2370
- td_name_input1.appendChild(title);
2371
- td_name_input4.appendChild(middle);
2372
-
2373
- tr_name1.insertBefore(td_name_input1, first_input);
2374
- tr_name1.insertBefore(td_name_input4, null);
2375
-
2376
- td_name_label1.appendChild(title_label);
2377
- td_name_label4.appendChild(middle_label);
2378
- tr_name2.insertBefore(td_name_label1, first_label);
2379
- tr_name2.insertBefore(td_name_label4, null);
2380
-
2381
- var gic1 = document.createTextNode("-");
2382
- var gic2 = document.createTextNode("-");
2383
-
2384
- var el_first_value_title = document.createElement('input');
2385
- el_first_value_title.setAttribute("id", "el_first_value_title");
2386
- el_first_value_title.setAttribute("type", "text");
2387
- el_first_value_title.setAttribute("value", '');
2388
- el_first_value_title.style.cssText = "width:50px; margin-left:4px; margin-right:4px";
2389
- el_first_value_title.setAttribute("onKeyUp", "change_input_value(this.value,'"+num+"_element_titleform_id_temp')");
2390
-
2391
- var el_first_value_middle = document.createElement('input');
2392
- el_first_value_middle.setAttribute("id", "el_first_value_middle");
2393
- el_first_value_middle.setAttribute("type", "text");
2394
- el_first_value_middle.setAttribute("value", '');
2395
- el_first_value_middle.style.cssText = "width:100px; margin-left:4px";
2396
- el_first_value_middle.setAttribute("onKeyUp", "change_input_value(this.value,'"+num+"_element_middleform_id_temp')");
2397
-
2398
- el_first_value_first = document.getElementById('el_first_value_first');
2399
- parent=el_first_value_first.parentNode;
2400
- parent.insertBefore(gic1, el_first_value_first);
2401
- parent.insertBefore(el_first_value_title, gic1);
2402
- parent.appendChild(gic2);
2403
- parent.appendChild(el_first_value_middle);
2404
-
2405
- refresh_attr(num, 'type_name');
2406
- }
2407
-
2408
- function format_normal(num)
2409
- {
2410
- tr_name1 = document.getElementById(num+'_tr_name1');
2411
- tr_name2 = document.getElementById(num+'_tr_name2');
2412
- td_name_input1 = document.getElementById(num+'_td_name_input_title');
2413
-
2414
- td_name_input4 = document.getElementById(num+'_td_name_input_middle');
2415
-
2416
- td_name_label1 = document.getElementById(num+'_td_name_label_title');
2417
-
2418
- td_name_label4 =document.getElementById(num+'_td_name_label_middle');
2419
-
2420
- tr_name1.removeChild(td_name_input1);
2421
- tr_name1.removeChild(td_name_input4);
2422
- tr_name2.removeChild(td_name_label1);
2423
- tr_name2.removeChild(td_name_label4);
2424
-
2425
- el_first_value_first = document.getElementById('el_first_value_first');
2426
- parent=el_first_value_first.parentNode;
2427
-
2428
- parent.removeChild( document.getElementById('el_first_value_title').nextSibling);
2429
- parent.removeChild( document.getElementById('el_first_value_title'));
2430
- parent.removeChild( document.getElementById('el_first_value_middle').previousSibling);
2431
- parent.removeChild( document.getElementById('el_first_value_middle'));
2432
-
2433
- }
2434
-
2435
- function type_section_break(i, w_editor){
2436
-
2437
- document.getElementById("element_type").value="type_section_break";
2438
- delete_last_child();
2439
- // edit table
2440
- oElement=document.getElementById('table_editor');
2441
- var iReturnTop = 0;
2442
- var iReturnLeft = 0;
2443
- while( oElement != null )
2444
- {
2445
- iReturnTop += oElement.offsetTop;
2446
- iReturnLeft += oElement.offsetLeft;
2447
- oElement = oElement.offsetParent;
2448
- }
2449
-
2450
- document.getElementById('main_editor').style.display="block";
2451
- document.getElementById('main_editor').style.left=iReturnLeft+195+"px";
2452
- document.getElementById('main_editor').style.top=iReturnTop+70+"px";
2453
-
2454
-
2455
-
2456
- if(document.getElementById('contact_form_editor').style.display=="none")
2457
- {
2458
- ifr_id=document.getElementsByTagName("iframe")[id_ifr_editor].id;
2459
- ifr=getIFrameDocument(ifr_id);
2460
- ifr.body.innerHTML=w_editor;
2461
- }
2462
- else
2463
- {
2464
- document.getElementById('contact_form_editor').value=w_editor;
2465
- }
2466
-
2467
- element='div';
2468
-
2469
-
2470
- var div = document.createElement('div');
2471
- div.setAttribute("id", "main_div");
2472
- var main_td = document.getElementById('show_table');
2473
- main_td.appendChild(div);
2474
-
2475
- var div = document.createElement('div');
2476
- div.style.width="600px";
2477
- document.getElementById('edit_table').appendChild(div);
2478
- }
2479
-
2480
- function type_editor(i, w_editor){
2481
-
2482
- document.getElementById("element_type").value="type_editor";
2483
- delete_last_child();
2484
- // edit table
2485
- oElement=document.getElementById('table_editor');
2486
- var iReturnTop = 0;
2487
- var iReturnLeft = 0;
2488
- while( oElement != null )
2489
- {
2490
- iReturnTop += oElement.offsetTop;
2491
- iReturnLeft += oElement.offsetLeft;
2492
- oElement = oElement.offsetParent;
2493
- }
2494
-
2495
- document.getElementById('main_editor').style.display="block";
2496
- document.getElementById('main_editor').style.left=iReturnLeft+195+"px";
2497
- document.getElementById('main_editor').style.top=iReturnTop+70+"px";
2498
-
2499
-
2500
-
2501
- if(document.getElementById('contact_form_editor').style.display=="none")
2502
- {
2503
- ifr_id=document.getElementsByTagName("iframe")[id_ifr_editor].id;
2504
- ifr=getIFrameDocument(ifr_id);
2505
- ifr.body.innerHTML=w_editor;
2506
- }
2507
- else
2508
- {
2509
- document.getElementById('contact_form_editor').value=w_editor;
2510
- }
2511
-
2512
- element='div';
2513
-
2514
-
2515
- var div = document.createElement('div');
2516
- div.setAttribute("id", "main_div");
2517
- var main_td = document.getElementById('show_table');
2518
- main_td.appendChild(div);
2519
-
2520
- var div = document.createElement('div');
2521
- div.style.width="600px";
2522
- document.getElementById('edit_table').appendChild(div);
2523
-
2524
-
2525
- }
2526
-
2527
- function type_submit_reset(i, w_submit_title , w_reset_title , w_class, w_act, w_attr_name, w_attr_value){
2528
-
2529
- document.getElementById("element_type").value="type_submit_reset";
2530
-
2531
- delete_last_child();
2532
- // edit table
2533
- var edit_div = document.createElement('div');
2534
- edit_div.setAttribute("id", "edit_div");
2535
- edit_div.setAttribute("style", "border-top:1px dotted black;padding:10px; padding-top:0px; padding-bottom:0px; margin-top:10px;");
2536
-
2537
- var edit_main_table = document.createElement('table');
2538
- edit_main_table.setAttribute("id", "edit_main_table");
2539
- edit_main_table.setAttribute("cellpadding", "0");
2540
- edit_main_table.setAttribute("cellspacing", "0");
2541
-
2542
- var edit_main_tr1 = document.createElement('tr');
2543
- edit_main_tr1.setAttribute("valing", "top");
2544
-
2545
- var edit_main_tr2 = document.createElement('tr');
2546
- edit_main_tr2.setAttribute("valing", "top");
2547
-
2548
- var edit_main_tr3 = document.createElement('tr');
2549
- edit_main_tr3.setAttribute("valing", "top");
2550
-
2551
- var edit_main_tr4 = document.createElement('tr');
2552
- edit_main_tr4.setAttribute("valing", "top");
2553
-
2554
- var edit_main_tr5 = document.createElement('tr');
2555
- edit_main_tr5.setAttribute("valing", "top");
2556
-
2557
- var edit_main_tr6 = document.createElement('tr');
2558
- edit_main_tr6.setAttribute("valing", "top");
2559
-
2560
- var edit_main_tr7 = document.createElement('tr');
2561
- edit_main_tr7.setAttribute("valing", "top");
2562
-
2563
- var edit_main_td1 = document.createElement('td');
2564
- edit_main_td1.style.cssText = "padding-top:10px";
2565
- var edit_main_td1_1 = document.createElement('td');
2566
- edit_main_td1_1.style.cssText = "padding-top:10px";
2567
- var edit_main_td2 = document.createElement('td');
2568
- edit_main_td2.style.cssText = "padding-top:10px";
2569
- var edit_main_td2_1 = document.createElement('td');
2570
- edit_main_td2_1.style.cssText = "padding-top:10px";
2571
-
2572
- var edit_main_td3 = document.createElement('td');
2573
- edit_main_td3.style.cssText = "padding-top:10px";
2574
- var edit_main_td3_1 = document.createElement('td');
2575
- edit_main_td3_1.style.cssText = "padding-top:10px";
2576
- var edit_main_td4 = document.createElement('td');
2577
- edit_main_td4.style.cssText = "padding-top:10px";
2578
- var edit_main_td4_1 = document.createElement('td');
2579
- edit_main_td4_1.style.cssText = "padding-top:10px";
2580
-
2581
- var edit_main_td5 = document.createElement('td');
2582
- edit_main_td5.style.cssText = "padding-top:10px";
2583
- var edit_main_td5_1 = document.createElement('td');
2584
- edit_main_td5_1.style.cssText = "padding-top:10px";
2585
-
2586
- var edit_main_td6 = document.createElement('td');
2587
- edit_main_td6.style.cssText = "padding-top:10px";
2588
- var edit_main_td6_1 = document.createElement('td');
2589
- edit_main_td6_1.style.cssText = "padding-top:10px";
2590
-
2591
- var edit_main_td7 = document.createElement('td');
2592
- edit_main_td7.style.cssText = "padding-top:10px";
2593
- var edit_main_td7_1 = document.createElement('td');
2594
- edit_main_td7_1.style.cssText = "padding-top:10px";
2595
-
2596
- var el_submit_title_label = document.createElement('label');
2597
- el_submit_title_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
2598
- el_submit_title_label.innerHTML = "Submit button label";
2599
-
2600
- var el_submit_title_textarea = document.createElement('input');
2601
- el_submit_title_textarea.setAttribute("id", "edit_for_title");
2602
- el_submit_title_textarea.setAttribute("type", "text");
2603
- el_submit_title_textarea.style.cssText = "width:160px";
2604
- el_submit_title_textarea.setAttribute("onKeyUp", "change_label('"+i+"_element_submitform_id_temp', this.value)");
2605
- el_submit_title_textarea.value = w_submit_title;
2606
- var el_submit_func_label = document.createElement('label');
2607
- el_submit_func_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
2608
- el_submit_func_label.innerHTML = "Submit function";
2609
- var el_submit_func_textarea = document.createElement('input');
2610
- el_submit_func_textarea.setAttribute("type", "text");
2611
- el_submit_func_textarea.setAttribute("disabled", "disabled");
2612
- el_submit_func_textarea.style.cssText = "width:160px";
2613
- el_submit_func_textarea.value = "check_required('submit', 'form_id_temp')";
2614
-
2615
- var el_reset_title_label = document.createElement('label');
2616
- el_reset_title_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
2617
- el_reset_title_label.innerHTML = "Reset button label";
2618
-
2619
- var el_reset_title_textarea = document.createElement('input');
2620
- el_reset_title_textarea.setAttribute("id", "edit_for_title");
2621
- el_reset_title_textarea.setAttribute("type", "text");
2622
- el_reset_title_textarea.style.cssText = "width:160px";
2623
- el_reset_title_textarea.setAttribute("onKeyUp", "change_label('"+i+"_element_resetform_id_temp', this.value)");
2624
- el_reset_title_textarea.value = w_reset_title;
2625
-
2626
-
2627
- var el_reset_active = document.createElement('input');
2628
- el_reset_active.setAttribute("type", "checkbox");
2629
- el_reset_active.style.cssText = "";
2630
- el_reset_active.setAttribute("onClick", "active_reset(this.checked, "+i+")");
2631
- if(w_act)
2632
- el_reset_active.setAttribute("checked", "checked");
2633
-
2634
-
2635
- var el_reset_active_label = document.createElement('label');
2636
- el_reset_active_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
2637
- el_reset_active_label.innerHTML = "Display Reset button";
2638
-
2639
-
2640
-
2641
-
2642
- var el_reset_func_label = document.createElement('label');
2643
- el_reset_func_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
2644
- el_reset_func_label.innerHTML = "Reset function";
2645
- var el_reset_func_textarea = document.createElement('input');
2646
- el_reset_func_textarea.setAttribute("type", "text");
2647
- el_reset_func_textarea.setAttribute("disabled", "disabled");
2648
- el_reset_func_textarea.style.cssText = "width:160px";
2649
- el_reset_func_textarea.value = "check_required('reset')";
2650
-
2651
- var el_style_label = document.createElement('label');
2652
- el_style_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
2653
- el_style_label.innerHTML = "Class name";
2654
-
2655
- var el_style_textarea = document.createElement('input');
2656
- el_style_textarea.setAttribute("id", "element_style");
2657
- el_style_textarea.setAttribute("type", "text");
2658
- el_style_textarea.setAttribute("value", w_class);
2659
- el_style_textarea.style.cssText = "width:200px;";
2660
- el_style_textarea.setAttribute("onChange", "change_class(this.value,'"+i+"')");
2661
- var el_attr_label = document.createElement('label');
2662
- el_attr_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
2663
- el_attr_label.innerHTML = "Additional Attributes";
2664
- var el_attr_add = document.createElement('img');
2665
- el_attr_add.setAttribute("id", "el_choices_add");
2666
- el_attr_add.setAttribute("src", plugin_url+'/images/add.png');
2667
- el_attr_add.style.cssText = 'cursor:pointer; margin-left:68px';
2668
- el_attr_add.setAttribute("title", 'add');
2669
- el_attr_add.setAttribute("onClick", "add_attr("+i+", 'type_submit_reset')");
2670
- var el_attr_table = document.createElement('table');
2671
- el_attr_table.setAttribute("id", 'attributes');
2672
- el_attr_table.setAttribute("border", '0');
2673
- el_attr_table.style.cssText = 'margin-left:0px';
2674
- var el_attr_tr_label = document.createElement('tr');
2675
- el_attr_tr_label.setAttribute("idi", '0');
2676
- var el_attr_td_name_label = document.createElement('th');
2677
- el_attr_td_name_label.style.cssText = 'width:100px';
2678
- var el_attr_td_value_label = document.createElement('th');
2679
- el_attr_td_value_label.style.cssText = 'width:100px';
2680
- var el_attr_td_X_label = document.createElement('th');
2681
- el_attr_td_X_label.style.cssText = 'width:10px';
2682
- var el_attr_name_label = document.createElement('label');
2683
- el_attr_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
2684
- el_attr_name_label.innerHTML = "Name";
2685
-
2686
- var el_attr_value_label = document.createElement('label');
2687
- el_attr_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
2688
- el_attr_value_label.innerHTML = "Value";
2689
-
2690
- el_attr_table.appendChild(el_attr_tr_label);
2691
- el_attr_tr_label.appendChild(el_attr_td_name_label);
2692
- el_attr_tr_label.appendChild(el_attr_td_value_label);
2693
- el_attr_tr_label.appendChild(el_attr_td_X_label);
2694
- el_attr_td_name_label.appendChild(el_attr_name_label);
2695
- el_attr_td_value_label.appendChild(el_attr_value_label);
2696
-
2697
- n=w_attr_name.length;
2698
- for(j=1; j<=n; j++)
2699
- {
2700
- var el_attr_tr = document.createElement('tr');
2701
- el_attr_tr.setAttribute("id", "attr_row_"+j);
2702
- el_attr_tr.setAttribute("idi", j);
2703
- var el_attr_td_name = document.createElement('td');
2704
- el_attr_td_name.style.cssText = 'width:100px';
2705
- var el_attr_td_value = document.createElement('td');
2706
- el_attr_td_value.style.cssText = 'width:100px';
2707
-
2708
- var el_attr_td_X = document.createElement('td');
2709
- var el_attr_name = document.createElement('input');
2710
-
2711
- el_attr_name.setAttribute("type", "text");
2712
-
2713
- el_attr_name.style.cssText = "width:100px";
2714
- el_attr_name.setAttribute("value", w_attr_name[j-1]);
2715
- el_attr_name.setAttribute("id", "attr_name"+j);
2716
- el_attr_name.setAttribute("onChange", "change_attribute_name("+i+", this, 'type_submit_reset')");
2717
-
2718
- var el_attr_value = document.createElement('input');
2719
-
2720
- el_attr_value.setAttribute("type", "text");
2721
-
2722
- el_attr_value.style.cssText = "width:100px";
2723
- el_attr_value.setAttribute("value", w_attr_value[j-1]);
2724
- el_attr_value.setAttribute("id", "attr_value"+j);
2725
- el_attr_value.setAttribute("onChange", "change_attribute_value("+i+", "+j+", 'type_submit_reset')");
2726
-
2727
- var el_attr_remove = document.createElement('img');
2728
- el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
2729
- el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
2730
- el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
2731
- el_attr_remove.setAttribute("align", 'top');
2732
- el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", 'type_submit_reset')");
2733
- el_attr_table.appendChild(el_attr_tr);
2734
- el_attr_tr.appendChild(el_attr_td_name);
2735
- el_attr_tr.appendChild(el_attr_td_value);
2736
- el_attr_tr.appendChild(el_attr_td_X);
2737
- el_attr_td_name.appendChild(el_attr_name);
2738
- el_attr_td_value.appendChild(el_attr_value);
2739
- el_attr_td_X.appendChild(el_attr_remove);
2740
-
2741
- }
2742
-
2743
- var t = document.getElementById('edit_table');
2744
-
2745
- var hr = document.createElement('hr');
2746
- var br = document.createElement('br');
2747
- var br1 = document.createElement('br');
2748
- var br2 = document.createElement('br');
2749
- var br3 = document.createElement('br');
2750
- var br4 = document.createElement('br');
2751
- var br5 = document.createElement('br');
2752
- var br6 = document.createElement('br');
2753
- var br7 = document.createElement('br');
2754
- var br8 = document.createElement('br');
2755
- var br9 = document.createElement('br');
2756
- edit_main_td1.appendChild(el_submit_title_label);
2757
- edit_main_td1.appendChild(br7);
2758
- edit_main_td1.appendChild(el_submit_func_label);
2759
- edit_main_td1_1.appendChild(el_submit_title_textarea);
2760
- edit_main_td1_1.appendChild(br1);
2761
- edit_main_td1_1.appendChild(el_submit_func_textarea);
2762
-
2763
-
2764
- edit_main_td2.appendChild(el_reset_active_label);
2765
- edit_main_td2.appendChild(br5);
2766
- edit_main_td2.appendChild(el_reset_title_label);
2767
- edit_main_td2.appendChild(br8);
2768
- edit_main_td2.appendChild(el_reset_func_label);
2769
- edit_main_td2_1.appendChild(el_reset_active);
2770
- edit_main_td2_1.appendChild(br9);
2771
- edit_main_td2_1.appendChild(el_reset_title_textarea);
2772
- edit_main_td2_1.appendChild(br2);
2773
- edit_main_td2_1.appendChild(el_reset_func_textarea);
2774
-
2775
- edit_main_td3.appendChild(el_style_label);
2776
- edit_main_td3_1.appendChild(el_style_textarea);
2777
-
2778
- edit_main_td4.appendChild(el_attr_label);
2779
- edit_main_td4.appendChild(el_attr_add);
2780
- edit_main_td4.appendChild(br3);
2781
- edit_main_td4.appendChild(el_attr_table);
2782
- edit_main_td4.setAttribute("colspan", "2");
2783
-
2784
- edit_main_tr1.appendChild(edit_main_td1);
2785
- edit_main_tr1.appendChild(edit_main_td1_1);
2786
- edit_main_tr2.appendChild(edit_main_td2);
2787
- edit_main_tr2.appendChild(edit_main_td2_1);
2788
- edit_main_tr3.appendChild(edit_main_td3);
2789
- edit_main_tr3.appendChild(edit_main_td3_1);
2790
-
2791
- edit_main_tr4.appendChild(edit_main_td4);
2792
- edit_main_tr4.appendChild(edit_main_td4_1);
2793
- edit_main_tr5.appendChild(edit_main_td5);
2794
- edit_main_tr5.appendChild(edit_main_td5_1);
2795
- edit_main_tr6.appendChild(edit_main_td6);
2796
- edit_main_tr6.appendChild(edit_main_td6_1);
2797
-
2798
- edit_main_table.appendChild(edit_main_tr1);
2799
- edit_main_table.appendChild(edit_main_tr2);
2800
- edit_main_table.appendChild(edit_main_tr3);
2801
- edit_main_table.appendChild(edit_main_tr4);
2802
- // edit_main_table.appendChild(edit_main_tr5);
2803
- // edit_main_table.appendChild(edit_main_tr6);
2804
- edit_div.appendChild(edit_main_table);
2805
-
2806
- t.appendChild(edit_div);
2807
-
2808
- //show table
2809
-
2810
- element='button'; type1='button'; type2='button';
2811
- var adding_type = document.createElement("input");
2812
- adding_type.setAttribute("type", "hidden");
2813
- adding_type.setAttribute("value", "type_submit_reset");
2814
- adding_type.setAttribute("name", i+"_typeform_id_temp");
2815
- adding_type.setAttribute("id", i+"_typeform_id_temp");
2816
-
2817
- var adding_submit = document.createElement(element);
2818
- adding_submit.setAttribute("type", type1);
2819
-
2820
- adding_submit.setAttribute("class", "button_submit");
2821
-
2822
- adding_submit.setAttribute("id", i+"_element_submitform_id_temp");
2823
- adding_submit.setAttribute("value", w_submit_title);
2824
- adding_submit.innerHTML=w_submit_title;
2825
- adding_submit.setAttribute("onClick", "check_required('submit', 'form_id_temp');");
2826
-
2827
- var adding_reset = document.createElement(element);
2828
- adding_reset.setAttribute("type", type2);
2829
-
2830
- adding_reset.setAttribute("class", "button_reset");
2831
- if(!w_act)
2832
- adding_reset.style.display="none";
2833
-
2834
- adding_reset.setAttribute("id", i+"_element_resetform_id_temp");
2835
- adding_reset.setAttribute("value", w_reset_title );
2836
- adding_reset.setAttribute("onClick", "check_required('reset');");
2837
- adding_reset.innerHTML=w_reset_title;
2838
-
2839
- var div = document.createElement('div');
2840
- div.setAttribute("id", "main_div");
2841
-
2842
- var table = document.createElement('table');
2843
- table.setAttribute("id", i+"_elemet_tableform_id_temp");
2844
-
2845
- var tr = document.createElement('tr');
2846
-
2847
- var td1 = document.createElement('td');
2848
- td1.setAttribute("valign", 'middle');
2849
- td1.setAttribute("align", 'left');
2850
- td1.setAttribute("id", i+"_label_sectionform_id_temp");
2851
- td1.style.cssText = 'display:none';
2852
-
2853
- var td2 = document.createElement('td');
2854
- td2.setAttribute("valign", 'middle');
2855
- td2.setAttribute("align", 'left');
2856
- td2.setAttribute("id", i+"_element_sectionform_id_temp");
2857
-
2858
- var br1 = document.createElement('br');
2859
- var br2 = document.createElement('br');
2860
- var br3 = document.createElement('br');
2861
- var br4 = document.createElement('br');
2862
-
2863
-
2864
-
2865
- var label = document.createElement('span');
2866
- label.setAttribute("id", i+"_element_labelform_id_temp");
2867
- label.style.cssText = 'display:none';
2868
- label.innerHTML = "type_submit_reset_"+i;
2869
- var main_td = document.getElementById('show_table');
2870
-
2871
- td1.appendChild(label);
2872
- td2.appendChild(adding_type);
2873
- td2.appendChild(adding_submit);
2874
- td2.appendChild(adding_reset);
2875
-
2876
- tr.appendChild(td1);
2877
- tr.appendChild(td2);
2878
- table.appendChild(tr);
2879
-
2880
- div.appendChild(table);
2881
- div.appendChild(br3);
2882
- main_td.appendChild(div);
2883
- change_class(w_class, i);
2884
- refresh_attr(i, 'type_submit_reset');
2885
- }
2886
-
2887
- function type_hidden(i, w_name, w_value, w_attr_name, w_attr_value){
2888
-
2889
- document.getElementById("element_type").value="type_hidden";
2890
-
2891
- delete_last_child();
2892
- // edit table
2893
- var edit_div = document.createElement('div');
2894
- edit_div.setAttribute("id", "edit_div");
2895
- edit_div.setAttribute("style", "border-top:1px dotted black;padding:10px; padding-top:0px; padding-bottom:0px; margin-top:10px;");
2896
-
2897
- var edit_main_table = document.createElement('table');
2898
- edit_main_table.setAttribute("id", "edit_main_table");
2899
- edit_main_table.setAttribute("cellpadding", "0");
2900
- edit_main_table.setAttribute("cellspacing", "0");
2901
-
2902
- var edit_main_tr1 = document.createElement('tr');
2903
- edit_main_tr1.setAttribute("valing", "top");
2904
-
2905
- var edit_main_tr2 = document.createElement('tr');
2906
- edit_main_tr2.setAttribute("valing", "top");
2907
-
2908
- var edit_main_tr3 = document.createElement('tr');
2909
- edit_main_tr3.setAttribute("valing", "top");
2910
-
2911
- var edit_main_tr4 = document.createElement('tr');
2912
- edit_main_tr4.setAttribute("valing", "top");
2913
-
2914
- var edit_main_tr5 = document.createElement('tr');
2915
- edit_main_tr5.setAttribute("valing", "top");
2916
-
2917
- var edit_main_tr6 = document.createElement('tr');
2918
- edit_main_tr6.setAttribute("valing", "top");
2919
-
2920
- var edit_main_tr7 = document.createElement('tr');
2921
- edit_main_tr7.setAttribute("valing", "top");
2922
-
2923
- var edit_main_td1 = document.createElement('td');
2924
- edit_main_td1.style.cssText = "padding-top:10px";
2925
- var edit_main_td1_1 = document.createElement('td');
2926
- edit_main_td1_1.style.cssText = "padding-top:10px";
2927
- var edit_main_td2 = document.createElement('td');
2928
- edit_main_td2.style.cssText = "padding-top:10px";
2929
- var edit_main_td2_1 = document.createElement('td');
2930
- edit_main_td2_1.style.cssText = "padding-top:10px";
2931
-
2932
- var edit_main_td3 = document.createElement('td');
2933
- edit_main_td3.style.cssText = "padding-top:10px";
2934
- var edit_main_td3_1 = document.createElement('td');
2935
- edit_main_td3_1.style.cssText = "padding-top:10px";
2936
- var edit_main_td4 = document.createElement('td');
2937
- edit_main_td4.style.cssText = "padding-top:10px";
2938
- var edit_main_td4_1 = document.createElement('td');
2939
- edit_main_td4_1.style.cssText = "padding-top:10px";
2940
-
2941
- var edit_main_td5 = document.createElement('td');
2942
- edit_main_td5.style.cssText = "padding-top:10px";
2943
- var edit_main_td5_1 = document.createElement('td');
2944
- edit_main_td5_1.style.cssText = "padding-top:10px";
2945
-
2946
- var edit_main_td6 = document.createElement('td');
2947
- edit_main_td6.style.cssText = "padding-top:10px";
2948
- var edit_main_td6_1 = document.createElement('td');
2949
- edit_main_td6_1.style.cssText = "padding-top:10px";
2950
-
2951
- var edit_main_td7 = document.createElement('td');
2952
- edit_main_td7.style.cssText = "padding-top:10px";
2953
- var edit_main_td7_1 = document.createElement('td');
2954
- edit_main_td7_1.style.cssText = "padding-top:10px";
2955
- var el_field_id_label = document.createElement('label');
2956
- el_field_id_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
2957
- el_field_id_label.innerHTML = "Field Id";
2958
-
2959
- var el_field_id_input= document.createElement('input');
2960
- el_field_id_input.setAttribute("type", "text");
2961
- el_field_id_input.setAttribute("disabled", "disabled");
2962
- el_field_id_input.setAttribute("value", i+"_elementform_id_temp");
2963
- el_field_id_input.style.cssText = "margin-left: 41px; width:160px";
2964
-
2965
- var el_field_name_label = document.createElement('label');
2966
- el_field_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
2967
- el_field_name_label.innerHTML = "Field Name";
2968
-
2969
- var el_field_name_input= document.createElement('input');
2970
- el_field_name_input.setAttribute("type", "text");
2971
-
2972
- el_field_name_input.setAttribute("value", w_name);
2973
- el_field_name_input.style.cssText = "margin-left: 16px; width:160px";
2974
- el_field_name_input.setAttribute("onChange", "change_field_name('"+i+"', this)");
2975
-
2976
- var el_field_value_label = document.createElement('label');
2977
- el_field_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
2978
- el_field_value_label.innerHTML = "Field Value";
2979
-
2980
- var el_field_value_input= document.createElement('input');
2981
- el_field_value_input.setAttribute("type", "text");
2982
- el_field_value_input.setAttribute("value", w_value);
2983
- el_field_value_input.style.cssText = "margin-left: 16px; width:160px";
2984
- el_field_value_input.setAttribute("onKeyUp", "change_field_value('"+i+"', this.value)");
2985
-
2986
- var el_attr_label = document.createElement('label');
2987
- el_attr_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
2988
- el_attr_label.innerHTML = "Additional Attributes";
2989
- var el_attr_add = document.createElement('img');
2990
- el_attr_add.setAttribute("id", "el_choices_add");
2991
- el_attr_add.setAttribute("src", plugin_url+'/images/add.png');
2992
- el_attr_add.style.cssText = 'cursor:pointer; margin-left:68px';
2993
- el_attr_add.setAttribute("title", 'add');
2994
- el_attr_add.setAttribute("onClick", "add_attr("+i+", 'type_text')");
2995
- var el_attr_table = document.createElement('table');
2996
- el_attr_table.setAttribute("id", 'attributes');
2997
- el_attr_table.setAttribute("border", '0');
2998
- el_attr_table.style.cssText = 'margin-left:0px';
2999
- var el_attr_tr_label = document.createElement('tr');
3000
- el_attr_tr_label.setAttribute("idi", '0');
3001
- var el_attr_td_name_label = document.createElement('th');
3002
- el_attr_td_name_label.style.cssText = 'width:100px';
3003
- var el_attr_td_value_label = document.createElement('th');
3004
- el_attr_td_value_label.style.cssText = 'width:100px';
3005
- var el_attr_td_X_label = document.createElement('th');
3006
- el_attr_td_X_label.style.cssText = 'width:10px';
3007
- var el_attr_name_label = document.createElement('label');
3008
- el_attr_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
3009
- el_attr_name_label.innerHTML = "Name";
3010
-
3011
- var el_attr_value_label = document.createElement('label');
3012
- el_attr_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
3013
- el_attr_value_label.innerHTML = "Value";
3014
-
3015
- el_attr_table.appendChild(el_attr_tr_label);
3016
- el_attr_tr_label.appendChild(el_attr_td_name_label);
3017
- el_attr_tr_label.appendChild(el_attr_td_value_label);
3018
- el_attr_tr_label.appendChild(el_attr_td_X_label);
3019
- el_attr_td_name_label.appendChild(el_attr_name_label);
3020
- el_attr_td_value_label.appendChild(el_attr_value_label);
3021
-
3022
- n=w_attr_name.length;
3023
- for(j=1; j<=n; j++)
3024
- {
3025
- var el_attr_tr = document.createElement('tr');
3026
- el_attr_tr.setAttribute("id", "attr_row_"+j);
3027
- el_attr_tr.setAttribute("idi", j);
3028
- var el_attr_td_name = document.createElement('td');
3029
- el_attr_td_name.style.cssText = 'width:100px';
3030
- var el_attr_td_value = document.createElement('td');
3031
- el_attr_td_value.style.cssText = 'width:100px';
3032
-
3033
- var el_attr_td_X = document.createElement('td');
3034
- var el_attr_name = document.createElement('input');
3035
-
3036
- el_attr_name.setAttribute("type", "text");
3037
-
3038
- el_attr_name.style.cssText = "width:100px";
3039
- el_attr_name.setAttribute("value", w_attr_name[j-1]);
3040
- el_attr_name.setAttribute("id", "attr_name"+j);
3041
- el_attr_name.setAttribute("onChange", "change_attribute_name("+i+", this, 'type_text')");
3042
-
3043
- var el_attr_value = document.createElement('input');
3044
-
3045
- el_attr_value.setAttribute("type", "text");
3046
-
3047
- el_attr_value.style.cssText = "width:100px";
3048
- el_attr_value.setAttribute("value", w_attr_value[j-1]);
3049
- el_attr_value.setAttribute("id", "attr_value"+j);
3050
- el_attr_value.setAttribute("onChange", "change_attribute_value("+i+", "+j+", 'type_text')");
3051
-
3052
- var el_attr_remove = document.createElement('img');
3053
- el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
3054
- el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
3055
- el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
3056
- el_attr_remove.setAttribute("align", 'top');
3057
- el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", 'type_text')");
3058
- el_attr_table.appendChild(el_attr_tr);
3059
- el_attr_tr.appendChild(el_attr_td_name);
3060
- el_attr_tr.appendChild(el_attr_td_value);
3061
- el_attr_tr.appendChild(el_attr_td_X);
3062
- el_attr_td_name.appendChild(el_attr_name);
3063
- el_attr_td_value.appendChild(el_attr_value);
3064
- el_attr_td_X.appendChild(el_attr_remove);
3065
-
3066
- }
3067
-
3068
- var t = document.getElementById('edit_table');
3069
-
3070
- var hr = document.createElement('hr');
3071
- var br = document.createElement('br');
3072
- var br1 = document.createElement('br');
3073
- var br2 = document.createElement('br');
3074
- var br3 = document.createElement('br');
3075
- var br4 = document.createElement('br');
3076
- var br5 = document.createElement('br');
3077
- var br6 = document.createElement('br');
3078
- edit_main_td1.appendChild(el_field_id_label);
3079
- edit_main_td1.appendChild(el_field_id_input);
3080
- edit_main_td2.appendChild(el_field_name_label);
3081
- edit_main_td2.appendChild(el_field_name_input);
3082
- edit_main_td3.appendChild(el_field_value_label);
3083
- edit_main_td3.appendChild(el_field_value_input);
3084
- edit_main_td4.appendChild(el_attr_label);
3085
- edit_main_td4.appendChild(el_attr_add);
3086
- edit_main_td4.appendChild(br3);
3087
- edit_main_td4.appendChild(el_attr_table);
3088
- edit_main_tr1.appendChild(edit_main_td1);
3089
- edit_main_tr1.appendChild(edit_main_td1_1);
3090
- edit_main_tr2.appendChild(edit_main_td2);
3091
- edit_main_tr2.appendChild(edit_main_td2_1);
3092
- edit_main_tr3.appendChild(edit_main_td3);
3093
- edit_main_tr3.appendChild(edit_main_td3_1);
3094
-
3095
- edit_main_tr4.appendChild(edit_main_td4);
3096
- edit_main_tr4.appendChild(edit_main_td4_1);
3097
- edit_main_tr5.appendChild(edit_main_td5);
3098
- edit_main_tr5.appendChild(edit_main_td5_1);
3099
- edit_main_tr6.appendChild(edit_main_td6);
3100
- edit_main_tr6.appendChild(edit_main_td6_1);
3101
-
3102
- edit_main_table.appendChild(edit_main_tr1);
3103
- edit_main_table.appendChild(edit_main_tr2);
3104
- edit_main_table.appendChild(edit_main_tr3);
3105
- edit_main_table.appendChild(edit_main_tr4);
3106
- // edit_main_table.appendChild(edit_main_tr5);
3107
- // edit_main_table.appendChild(edit_main_tr6);
3108
- edit_div.appendChild(edit_main_table);
3109
-
3110
- t.appendChild(edit_div);
3111
-
3112
- //show table
3113
-
3114
- element='input'; type='hidden';
3115
-
3116
- var adding_type = document.createElement("input");
3117
- adding_type.setAttribute("type", "hidden");
3118
- adding_type.setAttribute("value", "type_hidden");
3119
- adding_type.setAttribute("name", i+"_typeform_id_temp");
3120
- adding_type.setAttribute("id", i+"_typeform_id_temp");
3121
-
3122
- var adding = document.createElement(element);
3123
- adding.setAttribute("type", type);
3124
- adding.setAttribute("value", w_value);
3125
- adding.setAttribute("id", i+"_elementform_id_temp");
3126
- adding.setAttribute("name", w_name);
3127
-
3128
- var div = document.createElement('div');
3129
- div.setAttribute("id", "main_div");
3130
-
3131
- var table = document.createElement('table');
3132
- table.setAttribute("id", i+"_elemet_tableform_id_temp");
3133
- table.setAttribute("cellpadding", '0');
3134
- table.setAttribute("cellspacing", '0');
3135
-
3136
- var tr = document.createElement('tr');
3137
-
3138
- var td1 = document.createElement('td');
3139
- td1.setAttribute("valign", 'middle');
3140
- td1.setAttribute("align", 'left');
3141
- td1.setAttribute("id", i+"_label_sectionform_id_temp");
3142
- td1.style.cssText = 'display:none';
3143
-
3144
- var td2 = document.createElement('td');
3145
- td2.setAttribute("valign", 'middle');
3146
- td2.setAttribute("align", 'left');
3147
- td2.setAttribute("id", i+"_element_sectionform_id_temp");
3148
-
3149
- var br1 = document.createElement('br');
3150
- var br2 = document.createElement('br');
3151
- var br3 = document.createElement('br');
3152
- var br4 = document.createElement('br');
3153
-
3154
-
3155
-
3156
- var label = document.createElement('span');
3157
- label.setAttribute("id", i+"_element_labelform_id_temp");
3158
- label.style.cssText = 'display:none';
3159
- label.innerHTML = w_name;
3160
- var main_td = document.getElementById('show_table');
3161
-
3162
- td1.appendChild(label);
3163
- td2.appendChild(adding);
3164
- td2.appendChild(adding_type);
3165
- tr.appendChild(td1);
3166
- tr.appendChild(td2);
3167
- table.appendChild(tr);
3168
-
3169
- div.appendChild(table);
3170
- div.appendChild(br3);
3171
- main_td.appendChild(div);
3172
- refresh_attr(i, 'type_text');
3173
- }
3174
-
3175
- function type_button(i, w_title , w_func , w_class, w_attr_name, w_attr_value){
3176
- document.getElementById("element_type").value="type_button";
3177
- delete_last_child();
3178
- // edit table
3179
- var edit_div = document.createElement('div');
3180
- edit_div.setAttribute("id", "edit_div");
3181
- edit_div.setAttribute("style", "border-top:1px dotted black;padding:10px; padding-top:0px; padding-bottom:0px; margin-top:10px;");
3182
-
3183
- var edit_main_table = document.createElement('table');
3184
- edit_main_table.setAttribute("id", "edit_main_table");
3185
- edit_main_table.setAttribute("cellpadding", "0");
3186
- edit_main_table.setAttribute("cellspacing", "0");
3187
-
3188
- var edit_main_tr1 = document.createElement('tr');
3189
- edit_main_tr1.setAttribute("valing", "top");
3190
-
3191
- var edit_main_tr2 = document.createElement('tr');
3192
- edit_main_tr2.setAttribute("valing", "top");
3193
-
3194
- var edit_main_tr3 = document.createElement('tr');
3195
- edit_main_tr3.setAttribute("valing", "top");
3196
-
3197
- var edit_main_tr4 = document.createElement('tr');
3198
- edit_main_tr4.setAttribute("valing", "top");
3199
-
3200
- var edit_main_tr5 = document.createElement('tr');
3201
- edit_main_tr5.setAttribute("valing", "top");
3202
-
3203
- var edit_main_tr6 = document.createElement('tr');
3204
- edit_main_tr6.setAttribute("valing", "top");
3205
-
3206
- var edit_main_td1 = document.createElement('td');
3207
- edit_main_td1.style.cssText = "padding-top:10px";
3208
- var edit_main_td1_1 = document.createElement('td');
3209
- edit_main_td1_1.style.cssText = "padding-top:10px";
3210
- var edit_main_td2 = document.createElement('td');
3211
- edit_main_td2.style.cssText = "padding-top:10px";
3212
- var edit_main_td2_1 = document.createElement('td');
3213
- edit_main_td2_1.style.cssText = "padding-top:10px";
3214
-
3215
- var edit_main_td3 = document.createElement('td');
3216
- edit_main_td3.style.cssText = "padding-top:10px";
3217
- var edit_main_td3_1 = document.createElement('td');
3218
- edit_main_td3_1.style.cssText = "padding-top:10px";
3219
- var edit_main_td4 = document.createElement('td');
3220
- edit_main_td4.setAttribute("id", "buttons");
3221
- edit_main_td4.setAttribute("colspan", "2");
3222
-
3223
- var edit_main_td5 = document.createElement('td');
3224
- edit_main_td5.style.cssText = "padding-top:10px";
3225
- var edit_main_td5_1 = document.createElement('td');
3226
- edit_main_td5_1.style.cssText = "padding-top:10px";
3227
-
3228
- var edit_main_td6 = document.createElement('td');
3229
- edit_main_td6.style.cssText = "padding-top:10px";
3230
- var edit_main_td6_1 = document.createElement('td');
3231
- edit_main_td6_1.style.cssText = "padding-top:10px";
3232
-
3233
-
3234
- var el_style_label = document.createElement('label');
3235
- el_style_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
3236
- el_style_label.innerHTML = "Class name";
3237
-
3238
- var el_style_textarea = document.createElement('input');
3239
- el_style_textarea.setAttribute("id", "element_style");
3240
- el_style_textarea.setAttribute("type", "text");
3241
- el_style_textarea.setAttribute("value", w_class);
3242
- el_style_textarea.style.cssText = "width:200px;";
3243
- el_style_textarea.setAttribute("onChange", "change_class(this.value,'"+i+"')");
3244
-
3245
- var el_choices_add_label = document.createElement('label');
3246
- el_choices_add_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
3247
- el_choices_add_label.innerHTML = "Add a new button&nbsp;";
3248
- var el_choices_add = document.createElement('img');
3249
- el_choices_add.setAttribute("id", "el_choices_add");
3250
- el_choices_add.setAttribute("src", plugin_url+'/images/add.png');
3251
- el_choices_add.style.cssText = 'cursor:pointer;';
3252
- el_choices_add.setAttribute("title", 'add');
3253
- el_choices_add.setAttribute("onClick", "add_button("+i+")");
3254
-
3255
-
3256
- var el_attr_label = document.createElement('label');
3257
- el_attr_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
3258
- el_attr_label.innerHTML = "Additional Attributes";
3259
- var el_attr_add = document.createElement('img');
3260
- el_attr_add.setAttribute("id", "el_choices_add");
3261
- el_attr_add.setAttribute("src", plugin_url+'/images/add.png');
3262
- el_attr_add.style.cssText = 'cursor:pointer; margin-left:68px';
3263
- el_attr_add.setAttribute("title", 'add');
3264
- el_attr_add.setAttribute("onClick", "add_attr("+i+", 'type_checkbox')");
3265
- var el_attr_table = document.createElement('table');
3266
- el_attr_table.setAttribute("id", 'attributes');
3267
- el_attr_table.setAttribute("border", '0');
3268
- el_attr_table.style.cssText = 'margin-left:0px';
3269
- var el_attr_tr_label = document.createElement('tr');
3270
- el_attr_tr_label.setAttribute("idi", '0');
3271
- var el_attr_td_name_label = document.createElement('th');
3272
- el_attr_td_name_label.style.cssText = 'width:100px';
3273
- var el_attr_td_value_label = document.createElement('th');
3274
- el_attr_td_value_label.style.cssText = 'width:100px';
3275
- var el_attr_td_X_label = document.createElement('th');
3276
- el_attr_td_X_label.style.cssText = 'width:10px';
3277
- var el_attr_name_label = document.createElement('label');
3278
- el_attr_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
3279
- el_attr_name_label.innerHTML = "Name";
3280
-
3281
- var el_attr_value_label = document.createElement('label');
3282
- el_attr_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
3283
- el_attr_value_label.innerHTML = "Value";
3284
-
3285
- el_attr_table.appendChild(el_attr_tr_label);
3286
- el_attr_tr_label.appendChild(el_attr_td_name_label);
3287
- el_attr_tr_label.appendChild(el_attr_td_value_label);
3288
- el_attr_tr_label.appendChild(el_attr_td_X_label);
3289
- el_attr_td_name_label.appendChild(el_attr_name_label);
3290
- el_attr_td_value_label.appendChild(el_attr_value_label);
3291
-
3292
- n=w_attr_name.length;
3293
- for(j=1; j<=n; j++)
3294
- {
3295
- var el_attr_tr = document.createElement('tr');
3296
- el_attr_tr.setAttribute("id", "attr_row_"+j);
3297
- el_attr_tr.setAttribute("idi", j);
3298
- var el_attr_td_name = document.createElement('td');
3299
- el_attr_td_name.style.cssText = 'width:100px';
3300
- var el_attr_td_value = document.createElement('td');
3301
- el_attr_td_value.style.cssText = 'width:100px';
3302
-
3303
- var el_attr_td_X = document.createElement('td');
3304
- var el_attr_name = document.createElement('input');
3305
-
3306
- el_attr_name.setAttribute("type", "text");
3307
-
3308
- el_attr_name.style.cssText = "width:100px";
3309
- el_attr_name.setAttribute("value", w_attr_name[j-1]);
3310
- el_attr_name.setAttribute("id", "attr_name"+j);
3311
- el_attr_name.setAttribute("onChange", "change_attribute_name("+i+", this, 'type_checkbox')");
3312
-
3313
- var el_attr_value = document.createElement('input');
3314
-
3315
- el_attr_value.setAttribute("type", "text");
3316
-
3317
- el_attr_value.style.cssText = "width:100px";
3318
- el_attr_value.setAttribute("value", w_attr_value[j-1]);
3319
- el_attr_value.setAttribute("id", "attr_value"+j);
3320
- el_attr_value.setAttribute("onChange", "change_attribute_value("+i+", "+j+", 'type_checkbox')");
3321
-
3322
- var el_attr_remove = document.createElement('img');
3323
- el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
3324
- el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
3325
- el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
3326
- el_attr_remove.setAttribute("align", 'top');
3327
- el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", 'type_checkbox')");
3328
- el_attr_table.appendChild(el_attr_tr);
3329
- el_attr_tr.appendChild(el_attr_td_name);
3330
- el_attr_tr.appendChild(el_attr_td_value);
3331
- el_attr_tr.appendChild(el_attr_td_X);
3332
- el_attr_td_name.appendChild(el_attr_name);
3333
- el_attr_td_value.appendChild(el_attr_value);
3334
- el_attr_td_X.appendChild(el_attr_remove);
3335
-
3336
- }
3337
-
3338
- var t = document.getElementById('edit_table');
3339
-
3340
- var br = document.createElement('br');
3341
- var br1 = document.createElement('br');
3342
- var br2 = document.createElement('br');
3343
- var br3 = document.createElement('br');
3344
- var br4 = document.createElement('br');
3345
- var br5 = document.createElement('br');
3346
- var br6 = document.createElement('br');
3347
-
3348
-
3349
- edit_main_td1.appendChild(el_style_label);
3350
- edit_main_td1_1.appendChild(el_style_textarea);
3351
- edit_main_td2.appendChild(el_attr_label);
3352
- edit_main_td2.appendChild(el_attr_add);
3353
- edit_main_td2.appendChild(br3);
3354
- edit_main_td2.appendChild(el_attr_table);
3355
- edit_main_td2.setAttribute("colspan", "2");
3356
-
3357
- edit_main_td3.appendChild(el_choices_add_label);
3358
- edit_main_td3_1.appendChild(el_choices_add);
3359
-
3360
- n=w_title.length;
3361
- for(j=0; j<n; j++)
3362
- {
3363
- var table_button = document.createElement('table');
3364
- table_button.setAttribute("width", "100%");
3365
- table_button.setAttribute("border", "0");
3366
- table_button.setAttribute("id", "button_opt"+j);
3367
- table_button.setAttribute("idi", j+1);
3368
- var tr_button = document.createElement('tr');
3369
- var tr_hr = document.createElement('tr');
3370
-
3371
- var td_button = document.createElement('td');
3372
- var td_X = document.createElement('td');
3373
- var td_hr = document.createElement('td');
3374
- td_hr.setAttribute("colspan", "3");
3375
- tr_hr.appendChild(td_hr);
3376
- tr_button.appendChild(td_button);
3377
- tr_button.appendChild(td_X);
3378
- table_button.appendChild(tr_hr);
3379
- table_button.appendChild(tr_button);
3380
-
3381
- var br1 = document.createElement('br');
3382
-
3383
- var hr = document.createElement('hr');
3384
- hr.setAttribute("id", "br"+j);
3385
-
3386
-
3387
- var el_title_label = document.createElement('label');
3388
-
3389
- el_title_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
3390
-
3391
- el_title_label.innerHTML = "Button name";
3392
-
3393
- var el_title = document.createElement('input');
3394
- el_title.setAttribute("id", "el_title"+j);
3395
- el_title.setAttribute("type", "text");
3396
- el_title.setAttribute("value", w_title[j]);
3397
- el_title.style.cssText = "width:100px; margin-left:43px; padding:0; border-width: 1px";
3398
- el_title.setAttribute("onKeyUp", "change_label('"+i+"_elementform_id_temp"+j+"', this.value);");
3399
-
3400
- var el_func_label = document.createElement('label');
3401
-
3402
- el_func_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
3403
-
3404
- el_func_label.innerHTML = "OnClick function";
3405
-
3406
- var el_func = document.createElement('input');
3407
- el_func.setAttribute("id", "el_func"+j);
3408
- el_func.setAttribute("type", "text");
3409
- el_func.setAttribute("value", w_func[j]);
3410
- el_func.style.cssText = "width:100px; margin-left:20px; padding:0; border-width: 1px";
3411
- el_func.setAttribute("onKeyUp", "change_func('"+i+"_elementform_id_temp"+j+"', this.value);");
3412
- var el_choices_remove = document.createElement('img');
3413
- el_choices_remove.setAttribute("id", "el_button"+j+"_remove");
3414
- el_choices_remove.setAttribute("src", plugin_url+'/images/delete.png');
3415
- el_choices_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
3416
- el_choices_remove.setAttribute("align", 'top');
3417
- el_choices_remove.setAttribute("onClick", "remove_button("+j+","+i+")");
3418
-
3419
- td_hr.appendChild(hr);
3420
- td_button.appendChild(el_title_label);
3421
- td_button.appendChild(el_title);
3422
- td_button.appendChild(br1);
3423
- td_button.appendChild(el_func_label);
3424
- td_button.appendChild(el_func);
3425
- td_X.appendChild(el_choices_remove);
3426
- edit_main_td4.appendChild(table_button);
3427
-
3428
- }
3429
-
3430
- edit_main_tr1.appendChild(edit_main_td1);
3431
- edit_main_tr1.appendChild(edit_main_td1_1);
3432
- edit_main_tr2.appendChild(edit_main_td2);
3433
- edit_main_tr2.appendChild(edit_main_td2_1);
3434
- edit_main_tr3.appendChild(edit_main_td3);
3435
- edit_main_tr3.appendChild(edit_main_td3_1);
3436
- edit_main_tr4.appendChild(edit_main_td4);
3437
- edit_main_tr6.appendChild(edit_main_td6);
3438
- edit_main_tr6.appendChild(edit_main_td6_1);
3439
- edit_main_tr5.appendChild(edit_main_td5);
3440
- edit_main_tr5.appendChild(edit_main_td5_1);
3441
-
3442
- edit_main_table.appendChild(edit_main_tr1);
3443
-
3444
- edit_main_table.appendChild(edit_main_tr3);
3445
- edit_main_table.appendChild(edit_main_tr4);
3446
- edit_main_table.appendChild(edit_main_tr2);
3447
- // edit_main_table.appendChild(edit_main_tr5);
3448
- // edit_main_table.appendChild(edit_main_tr6);
3449
-
3450
- edit_div.appendChild(edit_main_table);
3451
-
3452
- t.appendChild(edit_div);
3453
-
3454
- //show table
3455
-
3456
- element='button'; type='button';
3457
- var adding_type = document.createElement("input");
3458
- adding_type.setAttribute("type", "hidden");
3459
- adding_type.setAttribute("value", "type_button");
3460
- adding_type.setAttribute("name", i+"_typeform_id_temp");
3461
- adding_type.setAttribute("id", i+"_typeform_id_temp");
3462
- var div = document.createElement('div');
3463
- div.setAttribute("id", "main_div");
3464
- //tbody sarqac
3465
-
3466
-
3467
- var table = document.createElement('table');
3468
- table.setAttribute("id", i+"_elemet_tableform_id_temp");
3469
-
3470
- var tr = document.createElement('tr');
3471
- var td1 = document.createElement('td');
3472
- td1.setAttribute("valign", 'middle');
3473
- td1.setAttribute("align", 'left');
3474
- td1.setAttribute("id", i+"_label_sectionform_id_temp");
3475
- td1.style.cssText = 'display:none';
3476
- var td2 = document.createElement('td');
3477
- td2.setAttribute("valign", 'top');
3478
- td2.setAttribute("align", 'left');
3479
- td2.setAttribute("id", i+"_element_sectionform_id_temp");
3480
-
3481
- var br1 = document.createElement('br');
3482
- var br2 = document.createElement('br');
3483
- var br3 = document.createElement('br');
3484
- var br4 = document.createElement('br');
3485
- // table_little -@ sarqaca tbody table_little darela table_little_t
3486
- var label = document.createElement('span');
3487
- label.setAttribute("id", i+"_element_labelform_id_temp");
3488
- label.innerHTML = "button_"+i;
3489
- label.style.cssText = 'display:none';
3490
-
3491
- n=w_title.length;
3492
- for(j=0; j<n; j++)
3493
- {
3494
-
3495
- var adding = document.createElement(element);
3496
- adding.setAttribute("type", type);
3497
- adding.setAttribute("id", i+"_elementform_id_temp"+j);
3498
- adding.setAttribute("name", i+"_elementform_id_temp"+j);
3499
- adding.setAttribute("value", w_title[j]);
3500
- adding.innerHTML = w_title[j];
3501
- adding.setAttribute("onclick", w_func[j]);
3502
-
3503
-
3504
- td2.appendChild(adding);
3505
- }
3506
- var main_td = document.getElementById('show_table');
3507
-
3508
- td1.appendChild(label);
3509
-
3510
- td2.appendChild(adding_type);
3511
- tr.appendChild(td1);
3512
- tr.appendChild(td2);
3513
- table.appendChild(tr);
3514
-
3515
-
3516
- div.appendChild(table);
3517
- div.appendChild(br1);
3518
- main_td.appendChild(div);
3519
- change_class(w_class, i);
3520
- refresh_attr(i, 'type_checkbox');
3521
- }
3522
-
3523
- 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) {
3524
-
3525
- element_ids=[ 'option1', 'option2'];
3526
- document.getElementById("element_type").value="type_text";
3527
-
3528
- delete_last_child();
3529
- // edit table
3530
- var edit_div = document.createElement('div');
3531
- edit_div.setAttribute("id", "edit_div");
3532
- edit_div.setAttribute("style", "border-top:1px dotted black;padding:10px; padding-top:0px; padding-bottom:0px; margin-top:10px;");
3533
-
3534
- var edit_main_table = document.createElement('table');
3535
- edit_main_table.setAttribute("id", "edit_main_table");
3536
- edit_main_table.setAttribute("cellpadding", "0");
3537
- edit_main_table.setAttribute("cellspacing", "0");
3538
- edit_main_table.setAttribute("cellpadding", "0");
3539
- edit_main_table.setAttribute("cellspacing", "0");
3540
-
3541
- var edit_main_tr1 = document.createElement('tr');
3542
- edit_main_tr1.setAttribute("valing", "top");
3543
-
3544
- var edit_main_tr2 = document.createElement('tr');
3545
- edit_main_tr2.setAttribute("valing", "top");
3546
-
3547
- var edit_main_tr3 = document.createElement('tr');
3548
- edit_main_tr3.setAttribute("valing", "top");
3549
-
3550
- var edit_main_tr4 = document.createElement('tr');
3551
- edit_main_tr4.setAttribute("valing", "top");
3552
-
3553
- var edit_main_tr5 = document.createElement('tr');
3554
- edit_main_tr5.setAttribute("valing", "top");
3555
-
3556
- var edit_main_tr6 = document.createElement('tr');
3557
- edit_main_tr6.setAttribute("valing", "top");
3558
-
3559
- var edit_main_tr7 = document.createElement('tr');
3560
- edit_main_tr7.setAttribute("valing", "top");
3561
-
3562
- var edit_main_tr8 = document.createElement('tr');
3563
- edit_main_tr8.setAttribute("valing", "top");
3564
-
3565
- var edit_main_tr9 = document.createElement('tr');
3566
- edit_main_tr9.setAttribute("valing", "top");
3567
-
3568
- var edit_main_td1 = document.createElement('td');
3569
- edit_main_td1.style.cssText = "padding-top:10px";
3570
- var edit_main_td1_1 = document.createElement('td');
3571
- edit_main_td1_1.style.cssText = "padding-top:10px";
3572
- var edit_main_td2 = document.createElement('td');
3573
- edit_main_td2.style.cssText = "padding-top:10px";
3574
- var edit_main_td2_1 = document.createElement('td');
3575
- edit_main_td2_1.style.cssText = "padding-top:10px";
3576
-
3577
- var edit_main_td3 = document.createElement('td');
3578
- edit_main_td3.style.cssText = "padding-top:10px";
3579
- var edit_main_td3_1 = document.createElement('td');
3580
- edit_main_td3_1.style.cssText = "padding-top:10px";
3581
-
3582
- var edit_main_td4 = document.createElement('td');
3583
- edit_main_td4.style.cssText = "padding-top:10px";
3584
- var edit_main_td4_1 = document.createElement('td');
3585
- edit_main_td4_1.style.cssText = "padding-top:10px";
3586
-
3587
- var edit_main_td5 = document.createElement('td');
3588
- edit_main_td5.style.cssText = "padding-top:10px";
3589
- var edit_main_td5_1 = document.createElement('td');
3590
- edit_main_td5_1.style.cssText = "padding-top:10px";
3591
-
3592
- var edit_main_td6 = document.createElement('td');
3593
- edit_main_td6.style.cssText = "padding-top:10px";
3594
- var edit_main_td6_1 = document.createElement('td');
3595
- edit_main_td6_1.style.cssText = "padding-top:10px";
3596
-
3597
- var edit_main_td7 = document.createElement('td');
3598
- edit_main_td7.style.cssText = "padding-top:10px";
3599
- var edit_main_td7_1 = document.createElement('td');
3600
- edit_main_td7_1.style.cssText = "padding-top:10px";
3601
-
3602
- var edit_main_td8 = document.createElement('td');
3603
- edit_main_td8.style.cssText = "padding-top:10px";
3604
- var edit_main_td8_1 = document.createElement('td');
3605
- edit_main_td8_1.style.cssText = "padding-top:10px";
3606
-
3607
- var edit_main_td9 = document.createElement('td');
3608
- edit_main_td9.style.cssText = "padding-top:10px";
3609
- var edit_main_td9_1 = document.createElement('td');
3610
- edit_main_td9_1.style.cssText = "padding-top:10px";
3611
-
3612
- var el_label_label = document.createElement('label');
3613
- el_label_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
3614
- el_label_label.innerHTML = "Field label";
3615
-
3616
- var el_label_textarea = document.createElement('textarea');
3617
- el_label_textarea.setAttribute("id", "edit_for_label");
3618
- el_label_textarea.setAttribute("rows", "4");
3619
- el_label_textarea.style.cssText = "width:200px";
3620
- el_label_textarea.setAttribute("onKeyUp", "change_label('"+i+"_element_labelform_id_temp', this.value)");
3621
- el_label_textarea.innerHTML = w_field_label;
3622
-
3623
- var el_label_position_label = document.createElement('label');
3624
- el_label_position_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
3625
- el_label_position_label.innerHTML = "Field label position";
3626
-
3627
- var el_label_position1 = document.createElement('input');
3628
- el_label_position1.setAttribute("id", "edit_for_label_position_top");
3629
- el_label_position1.setAttribute("type", "radio");
3630
- el_label_position1.setAttribute("value", "left");
3631
-
3632
- el_label_position1.setAttribute("name", "edit_for_label_position");
3633
- el_label_position1.setAttribute("onchange", "label_left("+i+")");
3634
- Left = document.createTextNode("Left");
3635
-
3636
- var el_label_position2 = document.createElement('input');
3637
-
3638
- el_label_position2.setAttribute("id", "edit_for_label_position_left");
3639
- el_label_position2.setAttribute("type", "radio");
3640
- el_label_position2.setAttribute("value", "top");
3641
- el_label_position2.setAttribute("name", "edit_for_label_position");
3642
- el_label_position2.setAttribute("onchange", "label_top("+i+")");
3643
- Top = document.createTextNode("Top");
3644
-
3645
- if(w_field_label_pos=="top")
3646
- el_label_position2.setAttribute("checked", "checked");
3647
- else
3648
- el_label_position1.setAttribute("checked", "checked");
3649
-
3650
- var el_size_label = document.createElement('label');
3651
- el_size_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
3652
- el_size_label.innerHTML = "Field size(px) ";
3653
- var el_size = document.createElement('input');
3654
- el_size.setAttribute("id", "edit_for_input_size");
3655
- el_size.setAttribute("type", "text");
3656
- el_size.setAttribute("value", w_size);
3657
-
3658
- el_size.setAttribute("name", "edit_for_size");
3659
- el_size.setAttribute("onKeyPress", "return check_isnum(event)");
3660
- el_size.setAttribute("onKeyUp", "change_w_style('"+i+"_elementform_id_temp', this.value)");
3661
-
3662
- var el_first_value_label = document.createElement('label');
3663
- el_first_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
3664
- el_first_value_label.innerHTML = "Value if empty ";
3665
-
3666
- var el_first_value_input = document.createElement('input');
3667
- el_first_value_input.setAttribute("id", "el_first_value_input");
3668
- el_first_value_input.setAttribute("type", "text");
3669
- el_first_value_input.setAttribute("value", w_title);
3670
- el_first_value_input.style.cssText = "width:200px;";
3671
- el_first_value_input.setAttribute("onKeyUp", "change_input_value(this.value,'"+i+"_elementform_id_temp')");
3672
-
3673
- var el_required_label = document.createElement('label');
3674
- el_required_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
3675
- el_required_label.innerHTML = "Required";
3676
-
3677
- var el_required = document.createElement('input');
3678
- el_required.setAttribute("id", "el_send");
3679
- el_required.setAttribute("type", "checkbox");
3680
- el_required.setAttribute("value", "yes");
3681
- el_required.setAttribute("onclick", "set_required('"+i+"_required')");
3682
- if(w_required=="yes")
3683
- el_required.setAttribute("checked", "checked");
3684
-
3685
-
3686
- var el_unique_label = document.createElement('label');
3687
- el_unique_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
3688
- el_unique_label.innerHTML = "Allow only unique values";
3689
-
3690
- var el_unique = document.createElement('input');
3691
- el_unique.setAttribute("id", "el_send");
3692
- el_unique.setAttribute("type", "checkbox");
3693
- el_unique.setAttribute("value", "yes");
3694
- el_unique.setAttribute("onclick", "set_unique('"+i+"_uniqueform_id_temp')");
3695
- if(w_unique=="yes")
3696
- el_unique.setAttribute("checked", "checked");
3697
-
3698
-
3699
-
3700
- var el_style_label = document.createElement('label');
3701
- el_style_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
3702
- el_style_label.innerHTML = "Deactive Class name";
3703
-
3704
- var el_style_textarea = document.createElement('input');
3705
- el_style_textarea.setAttribute("id", "element_style");
3706
- el_style_textarea.setAttribute("type", "text");
3707
- el_style_textarea.setAttribute("value", "input_deactive");
3708
- el_style_textarea.setAttribute("disabled", "disabled");
3709
- el_style_textarea.style.cssText = "width:200px;";
3710
- el_style_textarea.setAttribute("onChange", "change_class(this.value,'"+i+"')");
3711
-
3712
- var el_style_label2 = document.createElement('label');
3713
- el_style_label2.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
3714
- el_style_label2.innerHTML = "Active Class name";
3715
-
3716
- var el_style_textarea2 = document.createElement('input');
3717
- el_style_textarea2.setAttribute("id", "element_style");
3718
- el_style_textarea2.setAttribute("type", "text");
3719
- el_style_textarea2.setAttribute("value", "input_active");
3720
- el_style_textarea2.setAttribute("disabled", "disabled");
3721
- el_style_textarea2.style.cssText = "width:200px;";
3722
- el_style_textarea2.setAttribute("onChange", "change_class(this.value,'"+i+"')");
3723
-
3724
- var el_attr_label = document.createElement('label');
3725
- el_attr_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
3726
- el_attr_label.innerHTML = "Additional Attributes";
3727
-
3728
- var el_attr_add = document.createElement('img');
3729
- el_attr_add.setAttribute("id", "el_choices_add");
3730
- el_attr_add.setAttribute("src", plugin_url+'/images/add.png');
3731
- el_attr_add.style.cssText = 'cursor:pointer; margin-left:68px';
3732
- el_attr_add.setAttribute("title", 'add');
3733
- el_attr_add.setAttribute("onClick", "add_attr("+i+", 'type_text')");
3734
- var el_attr_table = document.createElement('table');
3735
- el_attr_table.setAttribute("id", 'attributes');
3736
- el_attr_table.setAttribute("border", '0');
3737
- el_attr_table.style.cssText = 'margin-left:0px';
3738
- var el_attr_tr_label = document.createElement('tr');
3739
- el_attr_tr_label.setAttribute("idi", '0');
3740
- var el_attr_td_name_label = document.createElement('th');
3741
- el_attr_td_name_label.style.cssText = 'width:100px';
3742
- var el_attr_td_value_label = document.createElement('th');
3743
- el_attr_td_value_label.style.cssText = 'width:100px';
3744
- var el_attr_td_X_label = document.createElement('th');
3745
- el_attr_td_X_label.style.cssText = 'width:10px';
3746
- var el_attr_name_label = document.createElement('label');
3747
- el_attr_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
3748
- el_attr_name_label.innerHTML = "Name";
3749
-
3750
- var el_attr_value_label = document.createElement('label');
3751
- el_attr_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
3752
- el_attr_value_label.innerHTML = "Value";
3753
-
3754
- el_attr_table.appendChild(el_attr_tr_label);
3755
- el_attr_tr_label.appendChild(el_attr_td_name_label);
3756
- el_attr_tr_label.appendChild(el_attr_td_value_label);
3757
- el_attr_tr_label.appendChild(el_attr_td_X_label);
3758
- el_attr_td_name_label.appendChild(el_attr_name_label);
3759
- el_attr_td_value_label.appendChild(el_attr_value_label);
3760
-
3761
- n=w_attr_name.length;
3762
- for(j=1; j<=n; j++)
3763
- {
3764
- var el_attr_tr = document.createElement('tr');
3765
- el_attr_tr.setAttribute("id", "attr_row_"+j);
3766
- el_attr_tr.setAttribute("idi", j);
3767
- var el_attr_td_name = document.createElement('td');
3768
- el_attr_td_name.style.cssText = 'width:100px';
3769
- var el_attr_td_value = document.createElement('td');
3770
- el_attr_td_value.style.cssText = 'width:100px';
3771
-
3772
- var el_attr_td_X = document.createElement('td');
3773
- var el_attr_name = document.createElement('input');
3774
-
3775
- el_attr_name.setAttribute("type", "text");
3776
-
3777
- el_attr_name.style.cssText = "width:100px";
3778
- el_attr_name.setAttribute("value", w_attr_name[j-1]);
3779
- el_attr_name.setAttribute("id", "attr_name"+j);
3780
- el_attr_name.setAttribute("onChange", "change_attribute_name("+i+", this, 'type_text')");
3781
-
3782
- var el_attr_value = document.createElement('input');
3783
-
3784
- el_attr_value.setAttribute("type", "text");
3785
-
3786
- el_attr_value.style.cssText = "width:100px";
3787
- el_attr_value.setAttribute("value", w_attr_value[j-1]);
3788
- el_attr_value.setAttribute("id", "attr_value"+j);
3789
- el_attr_value.setAttribute("onChange", "change_attribute_value("+i+", "+j+", 'type_text')");
3790
-
3791
- var el_attr_remove = document.createElement('img');
3792
- el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
3793
- el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
3794
- el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
3795
- el_attr_remove.setAttribute("align", 'top');
3796
- el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", 'type_text')");
3797
- el_attr_table.appendChild(el_attr_tr);
3798
- el_attr_tr.appendChild(el_attr_td_name);
3799
- el_attr_tr.appendChild(el_attr_td_value);
3800
- el_attr_tr.appendChild(el_attr_td_X);
3801
- el_attr_td_name.appendChild(el_attr_name);
3802
- el_attr_td_value.appendChild(el_attr_value);
3803
- el_attr_td_X.appendChild(el_attr_remove);
3804
-
3805
- }
3806
-
3807
-
3808
- var t = document.getElementById('edit_table');
3809
-
3810
- var br = document.createElement('br');
3811
- var br1 = document.createElement('br');
3812
- var br2 = document.createElement('br');
3813
- var br3 = document.createElement('br');
3814
- var br4 = document.createElement('br');
3815
- var br5 = document.createElement('br');
3816
- var br6 = document.createElement('br');
3817
- edit_main_td1.appendChild(el_label_label);
3818
- edit_main_td1_1.appendChild(el_label_textarea);
3819
-
3820
- edit_main_td2.appendChild(el_label_position_label);
3821
- edit_main_td2.appendChild(br1);
3822
- edit_main_td2_1.appendChild(el_label_position1);
3823
- edit_main_td2_1.appendChild(Left);
3824
- edit_main_td2_1.appendChild(br2);
3825
- edit_main_td2_1.appendChild(el_label_position2);
3826
- edit_main_td2_1.appendChild(Top);
3827
-
3828
- edit_main_td3.appendChild(el_size_label);
3829
- edit_main_td3_1.appendChild(el_size);
3830
-
3831
- edit_main_td4.appendChild(el_first_value_label);
3832
- edit_main_td4_1.appendChild(el_first_value_input);
3833
-
3834
- edit_main_td5.appendChild(el_style_label);
3835
- edit_main_td5_1.appendChild(el_style_textarea);
3836
-
3837
- edit_main_td9.appendChild(el_style_label2);
3838
- edit_main_td9_1.appendChild(el_style_textarea2);
3839
-
3840
-
3841
-
3842
-
3843
- edit_main_td6.appendChild(el_required_label);
3844
- edit_main_td6_1.appendChild(el_required);
3845
- edit_main_td8.appendChild(el_unique_label);
3846
- edit_main_td8_1.appendChild(el_unique);
3847
-
3848
- edit_main_td7.appendChild(el_attr_label);
3849
- edit_main_td7.appendChild(el_attr_add);
3850
- edit_main_td7.appendChild(br6);
3851
- edit_main_td7.appendChild(el_attr_table);
3852
- edit_main_td7.setAttribute("colspan", "2");
3853
-
3854
- edit_main_tr1.appendChild(edit_main_td1);
3855
- edit_main_tr1.appendChild(edit_main_td1_1);
3856
- edit_main_tr2.appendChild(edit_main_td2);
3857
- edit_main_tr2.appendChild(edit_main_td2_1);
3858
- edit_main_tr3.appendChild(edit_main_td3);
3859
- edit_main_tr3.appendChild(edit_main_td3_1);
3860
- edit_main_tr4.appendChild(edit_main_td4);
3861
- edit_main_tr4.appendChild(edit_main_td4_1);
3862
- edit_main_tr5.appendChild(edit_main_td5);
3863
- edit_main_tr5.appendChild(edit_main_td5_1);
3864
- edit_main_tr6.appendChild(edit_main_td6);
3865
- edit_main_tr6.appendChild(edit_main_td6_1);
3866
- edit_main_tr8.appendChild(edit_main_td8);
3867
- edit_main_tr8.appendChild(edit_main_td8_1);
3868
- edit_main_tr7.appendChild(edit_main_td7);
3869
- edit_main_tr9.appendChild(edit_main_td9);
3870
- edit_main_tr9.appendChild(edit_main_td9_1);
3871
- edit_main_table.appendChild(edit_main_tr1);
3872
- edit_main_table.appendChild(edit_main_tr2);
3873
- edit_main_table.appendChild(edit_main_tr3);
3874
- edit_main_table.appendChild(edit_main_tr4);
3875
- edit_main_table.appendChild(edit_main_tr5);
3876
- edit_main_table.appendChild(edit_main_tr9);
3877
- edit_main_table.appendChild(edit_main_tr6);
3878
- edit_main_table.appendChild(edit_main_tr8);
3879
- edit_main_table.appendChild(edit_main_tr7);
3880
- edit_div.appendChild(edit_main_table);
3881
-
3882
- t.appendChild(edit_div);
3883
- add_id_and_name(i, 'type_text');
3884
-
3885
- //show table
3886
-
3887
- element='input'; type='text';
3888
- var adding_type = document.createElement("input");
3889
- adding_type.setAttribute("type", "hidden");
3890
- adding_type.setAttribute("value", "type_text");
3891
- adding_type.setAttribute("name", i+"_typeform_id_temp");
3892
- adding_type.setAttribute("id", i+"_typeform_id_temp");
3893
-
3894
- var adding_required= document.createElement("input");
3895
- adding_required.setAttribute("type", "hidden");
3896
- adding_required.setAttribute("value", w_required);
3897
- adding_required.setAttribute("name", i+"_requiredform_id_temp");
3898
- adding_required.setAttribute("id", i+"_requiredform_id_temp");
3899
-
3900
- var adding_unique= document.createElement("input");
3901
- adding_unique.setAttribute("type", "hidden");
3902
- adding_unique.setAttribute("value", w_unique);
3903
- adding_unique.setAttribute("name", i+"_uniqueform_id_temp");
3904
- adding_unique.setAttribute("id", i+"_uniqueform_id_temp");
3905
-
3906
- var adding = document.createElement(element);
3907
- adding.setAttribute("type", type);
3908
-
3909
- if(w_title==w_first_val)
3910
- {
3911
- adding.style.cssText = "width:"+w_size+"px;";
3912
- adding.setAttribute("class", "input_deactive");
3913
- }
3914
- else
3915
- {
3916
- adding.style.cssText = "width:"+w_size+"px;";
3917
- adding.setAttribute("class", "input_active");
3918
- }
3919
- adding.setAttribute("id", i+"_elementform_id_temp");
3920
- adding.setAttribute("name", i+"_elementform_id_temp");
3921
- adding.setAttribute("value", w_first_val);
3922
- adding.setAttribute("title", w_title);
3923
- adding.setAttribute("onFocus", 'delete_value("'+i+'_elementform_id_temp")');
3924
- adding.setAttribute("onBlur", 'return_value("'+i+'_elementform_id_temp")');
3925
- adding.setAttribute("onChange", 'change_value("'+i+'_elementform_id_temp")');
3926
-
3927
-
3928
- var div = document.createElement('div');
3929
- div.setAttribute("id", "main_div");
3930
-
3931
- var table = document.createElement('table');
3932
- table.setAttribute("id", i+"_elemet_tableform_id_temp");
3933
-
3934
- var tr = document.createElement('tr');
3935
-
3936
- var td1 = document.createElement('td');
3937
- td1.setAttribute("valign", 'middle');
3938
- td1.setAttribute("align", 'left');
3939
- td1.setAttribute("id", i+"_label_sectionform_id_temp");
3940
-
3941
- var td2 = document.createElement('td');
3942
- td2.setAttribute("valign", 'middle');
3943
- td2.setAttribute("align", 'left');
3944
- td2.setAttribute("id", i+"_element_sectionform_id_temp");
3945
-
3946
- var br1 = document.createElement('br');
3947
- var br2 = document.createElement('br');
3948
- var br3 = document.createElement('br');
3949
- var br4 = document.createElement('br');
3950
-
3951
-
3952
-
3953
- var label = document.createElement('span');
3954
- label.setAttribute("id", i+"_element_labelform_id_temp");
3955
- label.innerHTML = w_field_label;
3956
- label.setAttribute("class", "label");
3957
-
3958
- var required = document.createElement('span');
3959
- required.setAttribute("id", i+"_required_elementform_id_temp");
3960
- required.innerHTML = "";
3961
- required.setAttribute("class", "required");
3962
- if(w_required=="yes")
3963
- required.innerHTML = " *";
3964
- var main_td = document.getElementById('show_table');
3965
-
3966
- td1.appendChild(label);
3967
- td1.appendChild(required);
3968
- td2.appendChild(adding_type);
3969
- td2.appendChild(adding_required);
3970
- td2.appendChild(adding_unique);
3971
- td2.appendChild(adding);
3972
- tr.appendChild(td1);
3973
- tr.appendChild(td2);
3974
- table.appendChild(tr);
3975
-
3976
- div.appendChild(table);
3977
- div.appendChild(br3);
3978
- main_td.appendChild(div);
3979
- if(w_field_label_pos=="top")
3980
- label_top(i);
3981
- change_class(w_class, i);
3982
- refresh_attr(i, 'type_text');
3983
- }
3984
-
3985
- function type_number(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) {
3986
-
3987
- element_ids=[ 'option1', 'option2'];
3988
- document.getElementById("element_type").value="type_number";
3989
-
3990
- delete_last_child();
3991
- // edit table
3992
- var edit_div = document.createElement('div');
3993
- edit_div.setAttribute("id", "edit_div");
3994
- edit_div.setAttribute("style", "border-top:1px dotted black;padding:10px; padding-top:0px; padding-bottom:0px; margin-top:10px;");
3995
-
3996
- var edit_main_table = document.createElement('table');
3997
- edit_main_table.setAttribute("id", "edit_main_table");
3998
- edit_main_table.setAttribute("cellpadding", "0");
3999
- edit_main_table.setAttribute("cellspacing", "0");
4000
-
4001
- var edit_main_tr1 = document.createElement('tr');
4002
- edit_main_tr1.setAttribute("valing", "top");
4003
-
4004
- var edit_main_tr2 = document.createElement('tr');
4005
- edit_main_tr2.setAttribute("valing", "top");
4006
-
4007
- var edit_main_tr3 = document.createElement('tr');
4008
- edit_main_tr3.setAttribute("valing", "top");
4009
-
4010
- var edit_main_tr4 = document.createElement('tr');
4011
- edit_main_tr4.setAttribute("valing", "top");
4012
-
4013
- var edit_main_tr5 = document.createElement('tr');
4014
- edit_main_tr5.setAttribute("valing", "top");
4015
-
4016
- var edit_main_tr6 = document.createElement('tr');
4017
- edit_main_tr6.setAttribute("valing", "top");
4018
-
4019
- var edit_main_tr7 = document.createElement('tr');
4020
- edit_main_tr7.setAttribute("valing", "top");
4021
-
4022
- var edit_main_tr8 = document.createElement('tr');
4023
- edit_main_tr8.setAttribute("valing", "top");
4024
-
4025
- var edit_main_td1 = document.createElement('td');
4026
- edit_main_td1.style.cssText = "padding-top:10px";
4027
- var edit_main_td1_1 = document.createElement('td');
4028
- edit_main_td1_1.style.cssText = "padding-top:10px";
4029
- var edit_main_td2 = document.createElement('td');
4030
- edit_main_td2.style.cssText = "padding-top:10px";
4031
- var edit_main_td2_1 = document.createElement('td');
4032
- edit_main_td2_1.style.cssText = "padding-top:10px";
4033
-
4034
- var edit_main_td3 = document.createElement('td');
4035
- edit_main_td3.style.cssText = "padding-top:10px";
4036
- var edit_main_td3_1 = document.createElement('td');
4037
- edit_main_td3_1.style.cssText = "padding-top:10px";
4038
- var edit_main_td4 = document.createElement('td');
4039
- edit_main_td4.style.cssText = "padding-top:10px";
4040
- var edit_main_td4_1 = document.createElement('td');
4041
- edit_main_td4_1.style.cssText = "padding-top:10px";
4042
-
4043
- var edit_main_td5 = document.createElement('td');
4044
- edit_main_td5.style.cssText = "padding-top:10px";
4045
- var edit_main_td5_1 = document.createElement('td');
4046
- edit_main_td5_1.style.cssText = "padding-top:10px";
4047
-
4048
- var edit_main_td6 = document.createElement('td');
4049
- edit_main_td6.style.cssText = "padding-top:10px";
4050
- var edit_main_td6_1 = document.createElement('td');
4051
- edit_main_td6_1.style.cssText = "padding-top:10px";
4052
-
4053
- var edit_main_td7 = document.createElement('td');
4054
- edit_main_td7.style.cssText = "padding-top:10px";
4055
- var edit_main_td7_1 = document.createElement('td');
4056
- edit_main_td7_1.style.cssText = "padding-top:10px";
4057
-
4058
- var edit_main_td8 = document.createElement('td');
4059
- edit_main_td8.style.cssText = "padding-top:10px";
4060
- var edit_main_td8_1 = document.createElement('td');
4061
- edit_main_td8_1.style.cssText = "padding-top:10px";
4062
-
4063
- var el_label_label = document.createElement('label');
4064
- el_label_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
4065
- el_label_label.innerHTML = "Field label";
4066
-
4067
- var el_label_textarea = document.createElement('textarea');
4068
- el_label_textarea.setAttribute("id", "edit_for_label");
4069
- el_label_textarea.setAttribute("rows", "4");
4070
- el_label_textarea.style.cssText = "width:200px";
4071
- el_label_textarea.setAttribute("onKeyUp", "change_label('"+i+"_element_labelform_id_temp', this.value)");
4072
- el_label_textarea.innerHTML = w_field_label;
4073
-
4074
- var el_label_position_label = document.createElement('label');
4075
- el_label_position_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
4076
- el_label_position_label.innerHTML = "Field label position";
4077
-
4078
- var el_label_position1 = document.createElement('input');
4079
- el_label_position1.setAttribute("id", "edit_for_label_position_top");
4080
- el_label_position1.setAttribute("type", "radio");
4081
- el_label_position1.setAttribute("value", "left");
4082
-
4083
- el_label_position1.setAttribute("name", "edit_for_label_position");
4084
- el_label_position1.setAttribute("onchange", "label_left("+i+")");
4085
- Left = document.createTextNode("Left");
4086
-
4087
- var el_label_position2 = document.createElement('input');
4088
-
4089
- el_label_position2.setAttribute("id", "edit_for_label_position_left");
4090
- el_label_position2.setAttribute("type", "radio");
4091
- el_label_position2.setAttribute("value", "top");
4092
-
4093
- el_label_position2.setAttribute("name", "edit_for_label_position");
4094
- el_label_position2.setAttribute("onchange", "label_top("+i+")");
4095
- Top = document.createTextNode("Top");
4096
-
4097
- if(w_field_label_pos=="top")
4098
- el_label_position2.setAttribute("checked", "checked");
4099
- else
4100
- el_label_position1.setAttribute("checked", "checked");
4101
-
4102
- var el_size_label = document.createElement('label');
4103
- el_size_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
4104
- el_size_label.innerHTML = "Field size(px) ";
4105
- var el_size = document.createElement('input');
4106
- el_size.setAttribute("id", "edit_for_input_size");
4107
- el_size.setAttribute("type", "text");
4108
- el_size.setAttribute("value", w_size);
4109
-
4110
- el_size.setAttribute("name", "edit_for_size");
4111
- el_size.setAttribute("onKeyPress", "return check_isnum(event)");
4112
- el_size.setAttribute("onKeyUp", "change_w_style('"+i+"_elementform_id_temp', this.value)");
4113
-
4114
- var el_first_value_label = document.createElement('label');
4115
- el_first_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
4116
- el_first_value_label.innerHTML = "Value if empty ";
4117
-
4118
- var el_first_value_input = document.createElement('input');
4119
- el_first_value_input.setAttribute("id", "el_first_value_input");
4120
- el_first_value_input.setAttribute("type", "text");
4121
- el_first_value_input.setAttribute("value", w_title);
4122
- el_first_value_input.style.cssText = "width:200px;";
4123
- el_first_value_input.setAttribute("onKeyUp", "change_input_value(this.value,'"+i+"_elementform_id_temp')");
4124
- var el_required_label = document.createElement('label');
4125
- el_required_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
4126
- el_required_label.innerHTML = "Required";
4127
-
4128
- var el_required = document.createElement('input');
4129
- el_required.setAttribute("id", "el_send");
4130
- el_required.setAttribute("type", "checkbox");
4131
- el_required.setAttribute("value", "yes");
4132
- el_required.setAttribute("onclick", "set_required('"+i+"_required')");
4133
- if(w_required=="yes")
4134
- el_required.setAttribute("checked", "checked");
4135
-
4136
- var el_unique_label = document.createElement('label');
4137
- el_unique_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
4138
- el_unique_label.innerHTML = "Allow only unique values";
4139
-
4140
- var el_unique = document.createElement('input');
4141
- el_unique.setAttribute("id", "el_send");
4142
- el_unique.setAttribute("type", "checkbox");
4143
- el_unique.setAttribute("value", "yes");
4144
- el_unique.setAttribute("onclick", "set_unique('"+i+"_uniqueform_id_temp')");
4145
- if(w_unique=="yes")
4146
- el_unique.setAttribute("checked", "checked");
4147
-
4148
- var el_style_label = document.createElement('label');
4149
- el_style_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
4150
- el_style_label.innerHTML = "Class name";
4151
-
4152
- var el_style_textarea = document.createElement('input');
4153
- el_style_textarea.setAttribute("id", "element_style");
4154
- el_style_textarea.setAttribute("type", "text");
4155
- el_style_textarea.setAttribute("value", w_class);
4156
- el_style_textarea.style.cssText = "width:200px;";
4157
- el_style_textarea.setAttribute("onChange", "change_class(this.value,'"+i+"')");
4158
-
4159
- var el_attr_label = document.createElement('label');
4160
- el_attr_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
4161
- el_attr_label.innerHTML = "Additional Attributes";
4162
-
4163
- var el_attr_add = document.createElement('img');
4164
- el_attr_add.setAttribute("id", "el_choices_add");
4165
- el_attr_add.setAttribute("src", plugin_url+'/images/add.png');
4166
- el_attr_add.style.cssText = 'cursor:pointer; margin-left:68px';
4167
- el_attr_add.setAttribute("title", 'add');
4168
- el_attr_add.setAttribute("onClick", "add_attr("+i+", 'type_text')");
4169
- var el_attr_table = document.createElement('table');
4170
- el_attr_table.setAttribute("id", 'attributes');
4171
- el_attr_table.setAttribute("border", '0');
4172
- el_attr_table.style.cssText = 'margin-left:0px';
4173
- var el_attr_tr_label = document.createElement('tr');
4174
- el_attr_tr_label.setAttribute("idi", '0');
4175
- var el_attr_td_name_label = document.createElement('th');
4176
- el_attr_td_name_label.style.cssText = 'width:100px';
4177
- var el_attr_td_value_label = document.createElement('th');
4178
- el_attr_td_value_label.style.cssText = 'width:100px';
4179
- var el_attr_td_X_label = document.createElement('th');
4180
- el_attr_td_X_label.style.cssText = 'width:10px';
4181
- var el_attr_name_label = document.createElement('label');
4182
- el_attr_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
4183
- el_attr_name_label.innerHTML = "Name";
4184
-
4185
- var el_attr_value_label = document.createElement('label');
4186
- el_attr_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
4187
- el_attr_value_label.innerHTML = "Value";
4188
-
4189
- el_attr_table.appendChild(el_attr_tr_label);
4190
- el_attr_tr_label.appendChild(el_attr_td_name_label);
4191
- el_attr_tr_label.appendChild(el_attr_td_value_label);
4192
- el_attr_tr_label.appendChild(el_attr_td_X_label);
4193
- el_attr_td_name_label.appendChild(el_attr_name_label);
4194
- el_attr_td_value_label.appendChild(el_attr_value_label);
4195
-
4196
- n=w_attr_name.length;
4197
- for(j=1; j<=n; j++)
4198
- {
4199
- var el_attr_tr = document.createElement('tr');
4200
- el_attr_tr.setAttribute("id", "attr_row_"+j);
4201
- el_attr_tr.setAttribute("idi", j);
4202
- var el_attr_td_name = document.createElement('td');
4203
- el_attr_td_name.style.cssText = 'width:100px';
4204
- var el_attr_td_value = document.createElement('td');
4205
- el_attr_td_value.style.cssText = 'width:100px';
4206
-
4207
- var el_attr_td_X = document.createElement('td');
4208
- var el_attr_name = document.createElement('input');
4209
-
4210
- el_attr_name.setAttribute("type", "text");
4211
-
4212
- el_attr_name.style.cssText = "width:100px";
4213
- el_attr_name.setAttribute("value", w_attr_name[j-1]);
4214
- el_attr_name.setAttribute("id", "attr_name"+j);
4215
- el_attr_name.setAttribute("onChange", "change_attribute_name("+i+", this, 'type_text')");
4216
-
4217
- var el_attr_value = document.createElement('input');
4218
-
4219
- el_attr_value.setAttribute("type", "text");
4220
-
4221
- el_attr_value.style.cssText = "width:100px";
4222
- el_attr_value.setAttribute("value", w_attr_value[j-1]);
4223
- el_attr_value.setAttribute("id", "attr_value"+j);
4224
- el_attr_value.setAttribute("onChange", "change_attribute_value("+i+", "+j+", 'type_text')");
4225
-
4226
- var el_attr_remove = document.createElement('img');
4227
- el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
4228
- el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
4229
- el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
4230
- el_attr_remove.setAttribute("align", 'top');
4231
- el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", 'type_text')");
4232
- el_attr_table.appendChild(el_attr_tr);
4233
- el_attr_tr.appendChild(el_attr_td_name);
4234
- el_attr_tr.appendChild(el_attr_td_value);
4235
- el_attr_tr.appendChild(el_attr_td_X);
4236
- el_attr_td_name.appendChild(el_attr_name);
4237
- el_attr_td_value.appendChild(el_attr_value);
4238
- el_attr_td_X.appendChild(el_attr_remove);
4239
-
4240
- }
4241
-
4242
-
4243
- var t = document.getElementById('edit_table');
4244
-
4245
- var br = document.createElement('br');
4246
- var br1 = document.createElement('br');
4247
- var br2 = document.createElement('br');
4248
- var br3 = document.createElement('br');
4249
- var br4 = document.createElement('br');
4250
- var br5 = document.createElement('br');
4251
- var br6 = document.createElement('br');
4252
- edit_main_td1.appendChild(el_label_label);
4253
- edit_main_td1_1.appendChild(el_label_textarea);
4254
-
4255
- edit_main_td2.appendChild(el_label_position_label);
4256
- edit_main_td2_1.appendChild(el_label_position1);
4257
- edit_main_td2_1.appendChild(Left);
4258
- edit_main_td2_1.appendChild(br2);
4259
- edit_main_td2_1.appendChild(el_label_position2);
4260
- edit_main_td2_1.appendChild(Top);
4261
-
4262
- edit_main_td3.appendChild(el_size_label);
4263
- edit_main_td3_1.appendChild(el_size);
4264
-
4265
- edit_main_td4.appendChild(el_first_value_label);
4266
- edit_main_td4_1.appendChild(el_first_value_input);
4267
-
4268
- edit_main_td5.appendChild(el_style_label);
4269
- edit_main_td5_1.appendChild(el_style_textarea);
4270
- edit_main_td6.appendChild(el_required_label);
4271
- edit_main_td6_1.appendChild(el_required);
4272
-
4273
- edit_main_td8.appendChild(el_unique_label);
4274
- edit_main_td8_1.appendChild(el_unique);
4275
-
4276
-
4277
- edit_main_td7.appendChild(el_attr_label);
4278
- edit_main_td7.appendChild(el_attr_add);
4279
- edit_main_td7.appendChild(br6);
4280
- edit_main_td7.appendChild(el_attr_table);
4281
- edit_main_td7.setAttribute("colspan", "2");
4282
-
4283
- edit_main_tr1.appendChild(edit_main_td1);
4284
- edit_main_tr1.appendChild(edit_main_td1_1);
4285
- edit_main_tr2.appendChild(edit_main_td2);
4286
- edit_main_tr2.appendChild(edit_main_td2_1);
4287
- edit_main_tr3.appendChild(edit_main_td3);
4288
- edit_main_tr3.appendChild(edit_main_td3_1);
4289
- edit_main_tr4.appendChild(edit_main_td4);
4290
- edit_main_tr4.appendChild(edit_main_td4_1);
4291
- edit_main_tr5.appendChild(edit_main_td5);
4292
- edit_main_tr5.appendChild(edit_main_td5_1);
4293
- edit_main_tr6.appendChild(edit_main_td6);
4294
- edit_main_tr6.appendChild(edit_main_td6_1);
4295
- edit_main_tr8.appendChild(edit_main_td8);
4296
- edit_main_tr8.appendChild(edit_main_td8_1);
4297
- edit_main_tr7.appendChild(edit_main_td7);
4298
- edit_main_table.appendChild(edit_main_tr1);
4299
- edit_main_table.appendChild(edit_main_tr2);
4300
- edit_main_table.appendChild(edit_main_tr3);
4301
- edit_main_table.appendChild(edit_main_tr4);
4302
- edit_main_table.appendChild(edit_main_tr5);
4303
- edit_main_table.appendChild(edit_main_tr6);
4304
- edit_main_table.appendChild(edit_main_tr8);
4305
- edit_main_table.appendChild(edit_main_tr7);
4306
- edit_div.appendChild(edit_main_table);
4307
-
4308
- t.appendChild(edit_div);
4309
- add_id_and_name(i, 'type_text');
4310
-
4311
- //show table
4312
-
4313
- element='input'; type='text';
4314
- var adding_type = document.createElement("input");
4315
- adding_type.setAttribute("type", "hidden");
4316
- adding_type.setAttribute("value", "type_number");
4317
- adding_type.setAttribute("name", i+"_typeform_id_temp");
4318
- adding_type.setAttribute("id", i+"_typeform_id_temp");
4319
-
4320
- var adding_required= document.createElement("input");
4321
- adding_required.setAttribute("type", "hidden");
4322
- adding_required.setAttribute("value", w_required);
4323
- adding_required.setAttribute("name", i+"_requiredform_id_temp");
4324
- adding_required.setAttribute("id", i+"_requiredform_id_temp");
4325
-
4326
- var adding_unique= document.createElement("input");
4327
- adding_unique.setAttribute("type", "hidden");
4328
- adding_unique.setAttribute("value", w_unique);
4329
- adding_unique.setAttribute("name", i+"_uniqueform_id_temp");
4330
- adding_unique.setAttribute("id", i+"_uniqueform_id_temp");
4331
-
4332
-
4333
- var adding = document.createElement(element);
4334
- adding.setAttribute("type", type);
4335
-
4336
- if(w_title==w_first_val)
4337
- {
4338
- adding.style.cssText = "width:"+w_size+"px;";
4339
- adding.setAttribute("class", "input_deactive");
4340
- }
4341
- else
4342
- {
4343
- adding.style.cssText = "width:"+w_size+"px;";
4344
- adding.setAttribute("class", "input_active");
4345
- }
4346
- adding.setAttribute("id", i+"_elementform_id_temp");
4347
- adding.setAttribute("name", i+"_elementform_id_temp");
4348
- adding.setAttribute("value", w_first_val);
4349
- adding.setAttribute("title", w_title);
4350
- adding.setAttribute("onKeyPress", "return check_isnum(event)");
4351
- adding.setAttribute("onFocus", 'delete_value("'+i+'_elementform_id_temp")');
4352
- adding.setAttribute("onBlur", 'return_value("'+i+'_elementform_id_temp")');
4353
- adding.setAttribute("onChange", 'change_value("'+i+'_elementform_id_temp")');
4354
-
4355
-
4356
- var div = document.createElement('div');
4357
- div.setAttribute("id", "main_div");
4358
-
4359
- var table = document.createElement('table');
4360
- table.setAttribute("id", i+"_elemet_tableform_id_temp");
4361
-
4362
- var tr = document.createElement('tr');
4363
-
4364
- var td1 = document.createElement('td');
4365
- td1.setAttribute("valign", 'middle');
4366
- td1.setAttribute("align", 'left');
4367
- td1.setAttribute("id", i+"_label_sectionform_id_temp");
4368
-
4369
- var td2 = document.createElement('td');
4370
- td2.setAttribute("valign", 'middle');
4371
- td2.setAttribute("align", 'left');
4372
- td2.setAttribute("id", i+"_element_sectionform_id_temp");
4373
-
4374
- var br1 = document.createElement('br');
4375
- var br2 = document.createElement('br');
4376
- var br3 = document.createElement('br');
4377
- var br4 = document.createElement('br');
4378
-
4379
-
4380
-
4381
- var label = document.createElement('span');
4382
- label.setAttribute("id", i+"_element_labelform_id_temp");
4383
- label.innerHTML = w_field_label;
4384
- label.setAttribute("class", "label");
4385
-
4386
- var required = document.createElement('span');
4387
- required.setAttribute("id", i+"_required_elementform_id_temp");
4388
- required.innerHTML = "";
4389
- required.setAttribute("class", "required");
4390
- if(w_required=="yes")
4391
- required.innerHTML = " *";
4392
- var main_td = document.getElementById('show_table');
4393
-
4394
- td1.appendChild(label);
4395
- td1.appendChild(required);
4396
- td2.appendChild(adding_type);
4397
- td2.appendChild(adding_required);
4398
- td2.appendChild(adding_unique);
4399
- td2.appendChild(adding);
4400
- tr.appendChild(td1);
4401
- tr.appendChild(td2);
4402
- table.appendChild(tr);
4403
-
4404
- div.appendChild(table);
4405
- div.appendChild(br3);
4406
- main_td.appendChild(div);
4407
- if(w_field_label_pos=="top")
4408
- label_top(i);
4409
- change_class(w_class, i);
4410
- refresh_attr(i, 'type_text');
4411
- }
4412
-
4413
- function type_password(i, w_field_label, w_field_label_pos, w_size, w_required, w_unique, w_class, w_attr_name, w_attr_value) {
4414
-
4415
- document.getElementById("element_type").value="type_password";
4416
-
4417
- delete_last_child();
4418
- // edit table
4419
- var edit_div = document.createElement('div');
4420
- edit_div.setAttribute("id", "edit_div");
4421
- edit_div.setAttribute("style", "border-top:1px dotted black;padding:10px; padding-top:0px; padding-bottom:0px; margin-top:10px;");
4422
-
4423
- var edit_main_table = document.createElement('table');
4424
- edit_main_table.setAttribute("id", "edit_main_table");
4425
- edit_main_table.setAttribute("cellpadding", "0");
4426
- edit_main_table.setAttribute("cellspacing", "0");
4427
-
4428
- var edit_main_tr1 = document.createElement('tr');
4429
- edit_main_tr1.setAttribute("valing", "top");
4430
-
4431
- var edit_main_tr2 = document.createElement('tr');
4432
- edit_main_tr2.setAttribute("valing", "top");
4433
-
4434
- var edit_main_tr3 = document.createElement('tr');
4435
- edit_main_tr3.setAttribute("valing", "top");
4436
-
4437
- var edit_main_tr4 = document.createElement('tr');
4438
- edit_main_tr4.setAttribute("valing", "top");
4439
-
4440
- var edit_main_tr5 = document.createElement('tr');
4441
- edit_main_tr5.setAttribute("valing", "top");
4442
-
4443
- var edit_main_tr6 = document.createElement('tr');
4444
- edit_main_tr6.setAttribute("valing", "top");
4445
-
4446
- var edit_main_tr7 = document.createElement('tr');
4447
- edit_main_tr7.setAttribute("valing", "top");
4448
-
4449
- var edit_main_td1 = document.createElement('td');
4450
- edit_main_td1.style.cssText = "padding-top:10px";
4451
- var edit_main_td1_1 = document.createElement('td');
4452
- edit_main_td1_1.style.cssText = "padding-top:10px";
4453
- var edit_main_td2 = document.createElement('td');
4454
- edit_main_td2.style.cssText = "padding-top:10px";
4455
- var edit_main_td2_1 = document.createElement('td');
4456
- edit_main_td2_1.style.cssText = "padding-top:10px";
4457
-
4458
- var edit_main_td3 = document.createElement('td');
4459
- edit_main_td3.style.cssText = "padding-top:10px";
4460
- var edit_main_td3_1 = document.createElement('td');
4461
- edit_main_td3_1.style.cssText = "padding-top:10px";
4462
-
4463
- var edit_main_td4 = document.createElement('td');
4464
- edit_main_td4.style.cssText = "padding-top:10px";
4465
- var edit_main_td4_1 = document.createElement('td');
4466
- edit_main_td4_1.style.cssText = "padding-top:10px";
4467
-
4468
- var edit_main_td5 = document.createElement('td');
4469
- edit_main_td5.style.cssText = "padding-top:10px";
4470
- var edit_main_td5_1 = document.createElement('td');
4471
- edit_main_td5_1.style.cssText = "padding-top:10px";
4472
-
4473
- var edit_main_td6 = document.createElement('td');
4474
- edit_main_td6.style.cssText = "padding-top:10px";
4475
- var edit_main_td6_1 = document.createElement('td');
4476
- edit_main_td6_1.style.cssText = "padding-top:10px";
4477
-
4478
- var edit_main_td7 = document.createElement('td');
4479
- edit_main_td7.style.cssText = "padding-top:10px";
4480
- var edit_main_td7_1 = document.createElement('td');
4481
- edit_main_td7_1.style.cssText = "padding-top:10px";
4482
-
4483
- var el_label_label = document.createElement('label');
4484
- el_label_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
4485
- el_label_label.innerHTML = "Field label";
4486
-
4487
- var el_label_textarea = document.createElement('textarea');
4488
- el_label_textarea.setAttribute("id", "edit_for_label");
4489
- el_label_textarea.setAttribute("rows", "4");
4490
- el_label_textarea.style.cssText = "width:200px;";
4491
- el_label_textarea.setAttribute("onKeyUp", "change_label('"+i+"_element_labelform_id_temp', this.value)");
4492
- el_label_textarea.innerHTML = w_field_label;
4493
-
4494
- var el_label_position_label = document.createElement('label');
4495
- el_label_position_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
4496
- el_label_position_label.innerHTML = "Field label position";
4497
-
4498
- var el_label_position1 = document.createElement('input');
4499
- el_label_position1.setAttribute("id", "edit_for_label_position_top");
4500
- el_label_position1.setAttribute("type", "radio");
4501
- el_label_position1.setAttribute("value", "left");
4502
-
4503
-
4504
- el_label_position1.setAttribute("name", "edit_for_label_position");
4505
- el_label_position1.setAttribute("onchange", "label_left("+i+")");
4506
- Left = document.createTextNode("Left");
4507
-
4508
- var el_label_position2 = document.createElement('input');
4509
- el_label_position2.setAttribute("id", "edit_for_label_position_left");
4510
- el_label_position2.setAttribute("type", "radio");
4511
- el_label_position2.setAttribute("value", "top");
4512
-
4513
-
4514
- el_label_position2.setAttribute("name", "edit_for_label_position");
4515
- el_label_position2.setAttribute("onchange", "label_top("+i+")");
4516
- Top = document.createTextNode("Top");
4517
-
4518
- if(w_field_label_pos=="top")
4519
-
4520
- el_label_position2.setAttribute("checked", "checked");
4521
- else
4522
- el_label_position1.setAttribute("checked", "checked");
4523
-
4524
- var el_size_label = document.createElement('label');
4525
- el_size_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
4526
- el_size_label.innerHTML = "Field size(px) ";
4527
-
4528
- var el_size = document.createElement('input');
4529
- el_size.setAttribute("id", "edit_for_input_size");
4530
- el_size.setAttribute("type", "text");
4531
- el_size.setAttribute("value", w_size);
4532
-
4533
- el_size.setAttribute("name", "edit_for_size");
4534
- el_size.setAttribute("onKeyPress", "return check_isnum(event)");
4535
- el_size.setAttribute("onKeyUp", "change_w_style('"+i+"_elementform_id_temp', this.value)");
4536
-
4537
- var el_required_label = document.createElement('label');
4538
- el_required_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
4539
- el_required_label.innerHTML = "Required";
4540
-
4541
- var el_required = document.createElement('input');
4542
- el_required.setAttribute("id", "el_send");
4543
- el_required.setAttribute("type", "checkbox");
4544
- el_required.setAttribute("value", "yes");
4545
- el_required.setAttribute("onclick", "set_required('"+i+"_required')");
4546
- if(w_required=="yes")
4547
-
4548
- el_required.setAttribute("checked", "checked");
4549
-
4550
- var el_unique_label = document.createElement('label');
4551
- el_unique_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
4552
- el_unique_label.innerHTML = "Allow only unique values";
4553
-
4554
- var el_unique = document.createElement('input');
4555
- el_unique.setAttribute("id", "el_send");
4556
- el_unique.setAttribute("type", "checkbox");
4557
- el_unique.setAttribute("value", "yes");
4558
- el_unique.setAttribute("onclick", "set_unique('"+i+"_uniqueform_id_temp')");
4559
- if(w_unique=="yes")
4560
- el_unique.setAttribute("checked", "checked");
4561
-
4562
- var el_style_label = document.createElement('label');
4563
- el_style_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
4564
- el_style_label.innerHTML = "Class name";
4565
-
4566
- var el_style_textarea = document.createElement('input');
4567
- el_style_textarea.setAttribute("id", "element_style");
4568
- el_style_textarea.setAttribute("type", "text");
4569
- el_style_textarea.setAttribute("value", w_class);
4570
- el_style_textarea.style.cssText = "width:200px;";
4571
- el_style_textarea.setAttribute("onChange", "change_class(this.value,'"+i+"')");
4572
- var el_attr_label = document.createElement('label');
4573
- el_attr_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
4574
- el_attr_label.innerHTML = "Additional Attributes";
4575
- var el_attr_add = document.createElement('img');
4576
- el_attr_add.setAttribute("id", "el_choices_add");
4577
- el_attr_add.setAttribute("src", plugin_url+'/images/add.png');
4578
- el_attr_add.style.cssText = 'cursor:pointer; margin-left:68px';
4579
- el_attr_add.setAttribute("title", 'add');
4580
- el_attr_add.setAttribute("onClick", "add_attr("+i+", 'type_text')");
4581
- var el_attr_table = document.createElement('table');
4582
- el_attr_table.setAttribute("id", 'attributes');
4583
- el_attr_table.setAttribute("border", '0');
4584
- el_attr_table.style.cssText = 'margin-left:0px';
4585
- var el_attr_tr_label = document.createElement('tr');
4586
- el_attr_tr_label.setAttribute("idi", '0');
4587
- var el_attr_td_name_label = document.createElement('th');
4588
- el_attr_td_name_label.style.cssText = 'width:100px';
4589
- var el_attr_td_value_label = document.createElement('th');
4590
- el_attr_td_value_label.style.cssText = 'width:100px';
4591
- var el_attr_td_X_label = document.createElement('th');
4592
- el_attr_td_X_label.style.cssText = 'width:10px';
4593
- var el_attr_name_label = document.createElement('label');
4594
- el_attr_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
4595
- el_attr_name_label.innerHTML = "Name";
4596
-
4597
- var el_attr_value_label = document.createElement('label');
4598
- el_attr_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
4599
- el_attr_value_label.innerHTML = "Value";
4600
-
4601
- el_attr_table.appendChild(el_attr_tr_label);
4602
- el_attr_tr_label.appendChild(el_attr_td_name_label);
4603
- el_attr_tr_label.appendChild(el_attr_td_value_label);
4604
- el_attr_tr_label.appendChild(el_attr_td_X_label);
4605
- el_attr_td_name_label.appendChild(el_attr_name_label);
4606
- el_attr_td_value_label.appendChild(el_attr_value_label);
4607
-
4608
- n=w_attr_name.length;
4609
- for(j=1; j<=n; j++)
4610
- {
4611
- var el_attr_tr = document.createElement('tr');
4612
- el_attr_tr.setAttribute("id", "attr_row_"+j);
4613
- el_attr_tr.setAttribute("idi", j);
4614
- var el_attr_td_name = document.createElement('td');
4615
- el_attr_td_name.style.cssText = 'width:100px';
4616
- var el_attr_td_value = document.createElement('td');
4617
- el_attr_td_value.style.cssText = 'width:100px';
4618
-
4619
- var el_attr_td_X = document.createElement('td');
4620
- var el_attr_name = document.createElement('input');
4621
-
4622
- el_attr_name.setAttribute("type", "text");
4623
-
4624
- el_attr_name.style.cssText = "width:100px";
4625
- el_attr_name.setAttribute("value", w_attr_name[j-1]);
4626
- el_attr_name.setAttribute("id", "attr_name"+j);
4627
- el_attr_name.setAttribute("onChange", "change_attribute_name("+i+", this, 'type_text')");
4628
-
4629
- var el_attr_value = document.createElement('input');
4630
-
4631
- el_attr_value.setAttribute("type", "text");
4632
-
4633
- el_attr_value.style.cssText = "width:100px";
4634
- el_attr_value.setAttribute("value", w_attr_value[j-1]);
4635
- el_attr_value.setAttribute("id", "attr_value"+j);
4636
- el_attr_value.setAttribute("onChange", "change_attribute_value("+i+", "+j+", 'type_text')");
4637
-
4638
- var el_attr_remove = document.createElement('img');
4639
- el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
4640
- el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
4641
- el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
4642
- el_attr_remove.setAttribute("align", 'top');
4643
- el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", 'type_text')");
4644
- el_attr_table.appendChild(el_attr_tr);
4645
- el_attr_tr.appendChild(el_attr_td_name);
4646
- el_attr_tr.appendChild(el_attr_td_value);
4647
- el_attr_tr.appendChild(el_attr_td_X);
4648
- el_attr_td_name.appendChild(el_attr_name);
4649
- el_attr_td_value.appendChild(el_attr_value);
4650
- el_attr_td_X.appendChild(el_attr_remove);
4651
-
4652
- }
4653
-
4654
- var t = document.getElementById('edit_table');
4655
-
4656
- var br = document.createElement('br');
4657
- var br1 = document.createElement('br');
4658
- var br2 = document.createElement('br');
4659
- var br3 = document.createElement('br');
4660
- var br4 = document.createElement('br');
4661
- var br5 = document.createElement('br');
4662
- var br6 = document.createElement('br');
4663
-
4664
- edit_main_td1.appendChild(el_label_label);
4665
- edit_main_td1_1.appendChild(el_label_textarea);
4666
-
4667
- edit_main_td2.appendChild(el_label_position_label);
4668
- edit_main_td2_1.appendChild(el_label_position1);
4669
- edit_main_td2_1.appendChild(Left);
4670
- edit_main_td2_1.appendChild(br2);
4671
- edit_main_td2_1.appendChild(el_label_position2);
4672
- edit_main_td2_1.appendChild(Top);
4673
-
4674
- edit_main_td3.appendChild(el_size_label);
4675
- edit_main_td3_1.appendChild(el_size);
4676
-
4677
- edit_main_td4.appendChild(el_style_label);
4678
- edit_main_td4_1.appendChild(el_style_textarea);
4679
-
4680
- edit_main_td5.appendChild(el_required_label);
4681
- edit_main_td5_1.appendChild(el_required);
4682
-
4683
- edit_main_td7.appendChild(el_unique_label);
4684
- edit_main_td7_1.appendChild(el_unique);
4685
-
4686
- edit_main_td6.appendChild(el_attr_label);
4687
- edit_main_td6.appendChild(el_attr_add);
4688
- edit_main_td6.appendChild(br3);
4689
- edit_main_td6.appendChild(el_attr_table);
4690
- edit_main_td6.setAttribute("colspan", "2");
4691
-
4692
-
4693
- edit_main_tr1.appendChild(edit_main_td1);
4694
- edit_main_tr1.appendChild(edit_main_td1_1);
4695
- edit_main_tr2.appendChild(edit_main_td2);
4696
- edit_main_tr2.appendChild(edit_main_td2_1);
4697
- edit_main_tr3.appendChild(edit_main_td3);
4698
- edit_main_tr3.appendChild(edit_main_td3_1);
4699
- edit_main_tr4.appendChild(edit_main_td4);
4700
- edit_main_tr4.appendChild(edit_main_td4_1);
4701
- edit_main_tr5.appendChild(edit_main_td5);
4702
- edit_main_tr5.appendChild(edit_main_td5_1);
4703
- edit_main_tr6.appendChild(edit_main_td6);
4704
- edit_main_tr7.appendChild(edit_main_td7);
4705
- edit_main_tr7.appendChild(edit_main_td7_1);
4706
- edit_main_table.appendChild(edit_main_tr1);
4707
- edit_main_table.appendChild(edit_main_tr2);
4708
- edit_main_table.appendChild(edit_main_tr3);
4709
- edit_main_table.appendChild(edit_main_tr4);
4710
- edit_main_table.appendChild(edit_main_tr5);
4711
- edit_main_table.appendChild(edit_main_tr7);
4712
- edit_main_table.appendChild(edit_main_tr6);
4713
- edit_div.appendChild(edit_main_table);
4714
-
4715
- t.appendChild(edit_div);
4716
- add_id_and_name(i, 'type_text');
4717
-
4718
- //show table
4719
-
4720
- element='input'; type='password';
4721
- var adding_type = document.createElement("input");
4722
- adding_type.setAttribute("type", "hidden");
4723
- adding_type.setAttribute("value", "type_password");
4724
- adding_type.setAttribute("name", i+"_typeform_id_temp");
4725
- adding_type.setAttribute("id", i+"_typeform_id_temp");
4726
- var adding_required= document.createElement("input");
4727
- adding_required.setAttribute("type", "hidden");
4728
- adding_required.setAttribute("value", w_required);
4729
- adding_required.setAttribute("name", i+"_requiredform_id_temp");
4730
- adding_required.setAttribute("id", i+"_requiredform_id_temp");
4731
-
4732
- var adding_unique= document.createElement("input");
4733
- adding_unique.setAttribute("type", "hidden");
4734
- adding_unique.setAttribute("value", w_unique);
4735
- adding_unique.setAttribute("name", i+"_uniqueform_id_temp");
4736
- adding_unique.setAttribute("id", i+"_uniqueform_id_temp");
4737
-
4738
- var adding = document.createElement(element);
4739
- adding.setAttribute("type", type);
4740
- adding.setAttribute("id", i+"_elementform_id_temp");
4741
- adding.setAttribute("name", i+"_elementform_id_temp");
4742
- adding.style.cssText = "width:"+w_size+"px;";
4743
-
4744
-
4745
- var div = document.createElement('div');
4746
- div.setAttribute("id", "main_div");
4747
-
4748
- var table = document.createElement('table');
4749
- table.setAttribute("id", i+"_elemet_tableform_id_temp");
4750
-
4751
- var tr = document.createElement('tr');
4752
-
4753
- var td1 = document.createElement('td');
4754
- td1.setAttribute("valign", 'middle');
4755
- td1.setAttribute("align", 'left');
4756
- td1.setAttribute("id", i+"_label_sectionform_id_temp");
4757
-
4758
- var td2 = document.createElement('td');
4759
- td2.setAttribute("valign", 'middle');
4760
- td2.setAttribute("align", 'left');
4761
- td2.setAttribute("id", i+"_element_sectionform_id_temp");
4762
-
4763
- var br1 = document.createElement('br');
4764
- var br2 = document.createElement('br');
4765
- var br3 = document.createElement('br');
4766
- var br4 = document.createElement('br');
4767
-
4768
-
4769
- var label = document.createElement('span');
4770
- label.setAttribute("id", i+"_element_labelform_id_temp");
4771
- label.innerHTML = w_field_label;
4772
- label.setAttribute("class", "label");
4773
-
4774
- var required = document.createElement('span');
4775
- required.setAttribute("id", i+"_required_elementform_id_temp");
4776
- required.innerHTML = "";
4777
- required.setAttribute("class", "required");
4778
- if(w_required=="yes")
4779
- required.innerHTML = " *";
4780
- var main_td = document.getElementById('show_table');
4781
-
4782
-
4783
- td1.appendChild(label);
4784
- td1.appendChild(required);
4785
- td2.appendChild(adding_type);
4786
- td2.appendChild(adding_required);
4787
- td2.appendChild(adding_unique);
4788
- td2.appendChild(adding);
4789
- tr.appendChild(td1);
4790
- tr.appendChild(td2);
4791
- table.appendChild(tr);
4792
-
4793
- div.appendChild(table);
4794
- div.appendChild(br3);
4795
- main_td.appendChild(div);
4796
- if(w_field_label_pos=="top")
4797
- label_top(i);
4798
- change_class(w_class, i);
4799
- refresh_attr(i, 'type_text');
4800
- }
4801
-
4802
- function type_textarea(i, w_field_label, w_field_label_pos, w_size_w, w_size_h, w_first_val, w_title, w_required, w_unique, w_class, w_attr_name, w_attr_value){
4803
-
4804
- document.getElementById("element_type").value="type_textarea";
4805
-
4806
- delete_last_child();
4807
- // edit table
4808
- var edit_div = document.createElement('div');
4809
- edit_div.setAttribute("id", "edit_div");
4810
- edit_div.setAttribute("style", "border-top:1px dotted black;padding:10px; padding-top:0px; padding-bottom:0px; margin-top:10px;");
4811
-
4812
- var edit_main_table = document.createElement('table');
4813
- edit_main_table.setAttribute("id", "edit_main_table");
4814
- edit_main_table.setAttribute("cellpadding", "0");
4815
- edit_main_table.setAttribute("cellspacing", "0");
4816
-
4817
- var edit_main_tr1 = document.createElement('tr');
4818
- edit_main_tr1.setAttribute("valing", "top");
4819
-
4820
- var edit_main_tr2 = document.createElement('tr');
4821
- edit_main_tr2.setAttribute("valing", "top");
4822
-
4823
- var edit_main_tr3 = document.createElement('tr');
4824
- edit_main_tr3.setAttribute("valing", "top");
4825
-
4826
- var edit_main_tr4 = document.createElement('tr');
4827
- edit_main_tr4.setAttribute("valing", "top");
4828
-
4829
- var edit_main_tr5 = document.createElement('tr');
4830
- edit_main_tr5.setAttribute("valing", "top");
4831
-
4832
- var edit_main_tr6 = document.createElement('tr');
4833
- edit_main_tr6.setAttribute("valing", "top");
4834
- var edit_main_tr7 = document.createElement('tr');
4835
- edit_main_tr7.setAttribute("valing", "top");
4836
-
4837
- var edit_main_tr8 = document.createElement('tr');
4838
- edit_main_tr8.setAttribute("valing", "top");
4839
-
4840
- var edit_main_td1 = document.createElement('td');
4841
- edit_main_td1.style.cssText = "padding-top:10px";
4842
- var edit_main_td1_1 = document.createElement('td');
4843
- edit_main_td1_1.style.cssText = "padding-top:10px";
4844
- var edit_main_td2 = document.createElement('td');
4845
- edit_main_td2.style.cssText = "padding-top:10px";
4846
- var edit_main_td2_1 = document.createElement('td');
4847
- edit_main_td2_1.style.cssText = "padding-top:10px";
4848
-
4849
- var edit_main_td3 = document.createElement('td');
4850
- edit_main_td3.style.cssText = "padding-top:10px";
4851
- var edit_main_td3_1 = document.createElement('td');
4852
- edit_main_td3_1.style.cssText = "padding-top:10px";
4853
- var edit_main_td4 = document.createElement('td');
4854
- edit_main_td4.style.cssText = "padding-top:10px";
4855
- var edit_main_td4_1 = document.createElement('td');
4856
- edit_main_td4_1.style.cssText = "padding-top:10px";
4857
-
4858
- var edit_main_td5 = document.createElement('td');
4859
- edit_main_td5.style.cssText = "padding-top:10px";
4860
- var edit_main_td5_1 = document.createElement('td');
4861
- edit_main_td5_1.style.cssText = "padding-top:10px";
4862
-
4863
- var edit_main_td6 = document.createElement('td');
4864
- edit_main_td6.style.cssText = "padding-top:10px";
4865
- var edit_main_td6_1 = document.createElement('td');
4866
- edit_main_td6_1.style.cssText = "padding-top:10px";
4867
-
4868
- var edit_main_td7 = document.createElement('td');
4869
- edit_main_td7.style.cssText = "padding-top:10px";
4870
- var edit_main_td7_1 = document.createElement('td');
4871
- edit_main_td7_1.style.cssText = "padding-top:10px";
4872
-
4873
- var edit_main_td8 = document.createElement('td');
4874
- edit_main_td8.style.cssText = "padding-top:10px";
4875
- var edit_main_td8_1 = document.createElement('td');
4876
- edit_main_td8_1.style.cssText = "padding-top:10px";
4877
-
4878
- var el_label_label = document.createElement('label');
4879
- el_label_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
4880
- el_label_label.innerHTML = "Field label";
4881
-
4882
- var el_label_textarea = document.createElement('textarea');
4883
- el_label_textarea.setAttribute("id", "edit_for_label");
4884
- el_label_textarea.setAttribute("rows", "4");
4885
- el_label_textarea.style.cssText = "width:200px;";
4886
- el_label_textarea.setAttribute("onKeyUp", "change_label('"+i+"_element_labelform_id_temp', this.value)");
4887
- el_label_textarea.innerHTML = w_field_label;
4888
-
4889
- var el_label_position_label = document.createElement('label');
4890
- el_label_position_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
4891
- el_label_position_label.innerHTML = "Field label position";
4892
-
4893
- var el_label_position1 = document.createElement('input');
4894
- el_label_position1.setAttribute("id", "edit_for_label_position_top");
4895
- el_label_position1.setAttribute("type", "radio");
4896
- el_label_position1.setAttribute("value", "left");
4897
-
4898
-
4899
- el_label_position1.setAttribute("name", "edit_for_label_position");
4900
- el_label_position1.setAttribute("onchange", "label_left("+i+")");
4901
- Left = document.createTextNode("Left");
4902
-
4903
- var el_label_position2 = document.createElement('input');
4904
- el_label_position2.setAttribute("id", "edit_for_label_position_left");
4905
- el_label_position2.setAttribute("type", "radio");
4906
- el_label_position2.setAttribute("value", "top");
4907
-
4908
-
4909
- el_label_position2.setAttribute("name", "edit_for_label_position");
4910
- el_label_position2.setAttribute("onchange", "label_top("+i+")");
4911
- Top = document.createTextNode("Top");
4912
-
4913
- if(w_field_label_pos=="top")
4914
- el_label_position2.setAttribute("checked", "checked");
4915
- else
4916
- el_label_position1.setAttribute("checked", "checked");
4917
-
4918
- var el_size_label = document.createElement('label');
4919
- el_size_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
4920
- el_size_label.innerHTML = "Field size(px) ";
4921
-
4922
- var el_size_w = document.createElement('input');
4923
- el_size_w.setAttribute("id", "edit_for_input_size");
4924
- el_size_w.setAttribute("type", "text");
4925
- el_size_w.setAttribute("value", w_size_w);
4926
- el_size_w.style.cssText = "margin-right:2px; width: 60px";
4927
- el_size_w.setAttribute("name", "edit_for_size");
4928
- el_size_w.setAttribute("onKeyPress", "return check_isnum(event)");
4929
- el_size_w.setAttribute("onKeyUp", "change_w_style('"+i+"_elementform_id_temp', this.value)");
4930
-
4931
- X = document.createTextNode("x");
4932
-
4933
- var el_size_h = document.createElement('input');
4934
- el_size_h.setAttribute("id", "edit_for_input_size");
4935
- el_size_h.setAttribute("type", "text");
4936
- el_size_h.setAttribute("value", w_size_h);
4937
- el_size_h.style.cssText = "margin-left:2px; width:60px";
4938
- el_size_h.setAttribute("name", "edit_for_size");
4939
- el_size_h.setAttribute("onKeyPress", "return check_isnum(event)");
4940
- el_size_h.setAttribute("onKeyUp", "change_h_style('"+i+"_elementform_id_temp', this.value)");
4941
- var el_first_value_label = document.createElement('label');
4942
- el_first_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
4943
- el_first_value_label.innerHTML = "Value if empty";
4944
-
4945
- var el_first_value_input = document.createElement('input');
4946
- el_first_value_input.setAttribute("id", "el_first_value_input");
4947
- el_first_value_input.setAttribute("type", "text");
4948
- el_first_value_input.setAttribute("value", w_title);
4949
- el_first_value_input.style.cssText = "width:200px;";
4950
- el_first_value_input.setAttribute("onKeyUp", "change_input_value(this.value,'"+i+"_elementform_id_temp')");
4951
- var el_required_label = document.createElement('label');
4952
- el_required_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
4953
- el_required_label.innerHTML = "Required";
4954
-
4955
- var el_required = document.createElement('input');
4956
- el_required.setAttribute("id", "el_send");
4957
- el_required.setAttribute("type", "checkbox");
4958
- el_required.setAttribute("value", "yes");
4959
- el_required.setAttribute("onclick", "set_required('"+i+"_required')");
4960
- if(w_required=="yes")
4961
- el_required.setAttribute("checked", "checked");
4962
-
4963
- var el_unique_label = document.createElement('label');
4964
- el_unique_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
4965
- el_unique_label.innerHTML = "Allow only unique values";
4966
-
4967
- var el_unique = document.createElement('input');
4968
- el_unique.setAttribute("id", "el_send");
4969
- el_unique.setAttribute("type", "checkbox");
4970
- el_unique.setAttribute("value", "yes");
4971
- el_unique.setAttribute("onclick", "set_unique('"+i+"_uniqueform_id_temp')");
4972
- if(w_unique=="yes")
4973
- el_unique.setAttribute("checked", "checked");
4974
-
4975
- var el_style_label = document.createElement('label');
4976
- el_style_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
4977
- el_style_label.innerHTML = "Class name";
4978
-
4979
- var el_style_textarea = document.createElement('input');
4980
- el_style_textarea.setAttribute("id", "element_style");
4981
- el_style_textarea.setAttribute("type", "text");
4982
- el_style_textarea.setAttribute("value", w_class);
4983
- el_style_textarea.style.cssText = "width:200px;";
4984
- el_style_textarea.setAttribute("onChange", "change_class(this.value,'"+i+"')");
4985
-
4986
- var el_attr_label = document.createElement('label');
4987
- el_attr_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
4988
- el_attr_label.innerHTML = "Additional Attributes";
4989
-
4990
- var el_attr_add = document.createElement('img');
4991
- el_attr_add.setAttribute("id", "el_choices_add");
4992
- el_attr_add.setAttribute("src", plugin_url+'/images/add.png');
4993
- el_attr_add.style.cssText = 'cursor:pointer; margin-left:68px';
4994
- el_attr_add.setAttribute("title", 'add');
4995
- el_attr_add.setAttribute("onClick", "add_attr("+i+", 'type_text')");
4996
- var el_attr_table = document.createElement('table');
4997
- el_attr_table.setAttribute("id", 'attributes');
4998
- el_attr_table.setAttribute("border", '0');
4999
- el_attr_table.style.cssText = 'margin-left:0px';
5000
- var el_attr_tr_label = document.createElement('tr');
5001
- el_attr_tr_label.setAttribute("idi", '0');
5002
- var el_attr_td_name_label = document.createElement('th');
5003
- el_attr_td_name_label.style.cssText = 'width:100px';
5004
- var el_attr_td_value_label = document.createElement('th');
5005
- el_attr_td_value_label.style.cssText = 'width:100px';
5006
- var el_attr_td_X_label = document.createElement('th');
5007
- el_attr_td_X_label.style.cssText = 'width:10px';
5008
- var el_attr_name_label = document.createElement('label');
5009
- el_attr_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
5010
- el_attr_name_label.innerHTML = "Name";
5011
-
5012
- var el_attr_value_label = document.createElement('label');
5013
- el_attr_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
5014
- el_attr_value_label.innerHTML = "Value";
5015
-
5016
- el_attr_table.appendChild(el_attr_tr_label);
5017
- el_attr_tr_label.appendChild(el_attr_td_name_label);
5018
- el_attr_tr_label.appendChild(el_attr_td_value_label);
5019
- el_attr_tr_label.appendChild(el_attr_td_X_label);
5020
- el_attr_td_name_label.appendChild(el_attr_name_label);
5021
- el_attr_td_value_label.appendChild(el_attr_value_label);
5022
-
5023
- n=w_attr_name.length;
5024
- for(j=1; j<=n; j++)
5025
- {
5026
- var el_attr_tr = document.createElement('tr');
5027
- el_attr_tr.setAttribute("id", "attr_row_"+j);
5028
- el_attr_tr.setAttribute("idi", j);
5029
- var el_attr_td_name = document.createElement('td');
5030
- el_attr_td_name.style.cssText = 'width:100px';
5031
- var el_attr_td_value = document.createElement('td');
5032
- el_attr_td_value.style.cssText = 'width:100px';
5033
-
5034
- var el_attr_td_X = document.createElement('td');
5035
- var el_attr_name = document.createElement('input');
5036
-
5037
- el_attr_name.setAttribute("type", "text");
5038
-
5039
- el_attr_name.style.cssText = "width:100px";
5040
- el_attr_name.setAttribute("value", w_attr_name[j-1]);
5041
- el_attr_name.setAttribute("id", "attr_name"+j);
5042
- el_attr_name.setAttribute("onChange", "change_attribute_name("+i+", this, 'type_text')");
5043
-
5044
- var el_attr_value = document.createElement('input');
5045
-
5046
- el_attr_value.setAttribute("type", "text");
5047
-
5048
- el_attr_value.style.cssText = "width:100px";
5049
- el_attr_value.setAttribute("value", w_attr_value[j-1]);
5050
- el_attr_value.setAttribute("id", "attr_value"+j);
5051
- el_attr_value.setAttribute("onChange", "change_attribute_value("+i+", "+j+", 'type_text')");
5052
-
5053
- var el_attr_remove = document.createElement('img');
5054
- el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
5055
- el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
5056
- el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
5057
- el_attr_remove.setAttribute("align", 'top');
5058
- el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", 'type_text')");
5059
- el_attr_table.appendChild(el_attr_tr);
5060
- el_attr_tr.appendChild(el_attr_td_name);
5061
- el_attr_tr.appendChild(el_attr_td_value);
5062
- el_attr_tr.appendChild(el_attr_td_X);
5063
- el_attr_td_name.appendChild(el_attr_name);
5064
- el_attr_td_value.appendChild(el_attr_value);
5065
- el_attr_td_X.appendChild(el_attr_remove);
5066
-
5067
- }
5068
-
5069
- var t = document.getElementById('edit_table');
5070
-
5071
- var br = document.createElement('br');
5072
- var br1 = document.createElement('br');
5073
- var br2 = document.createElement('br');
5074
- var br3 = document.createElement('br');
5075
- var br4 = document.createElement('br');
5076
- var br5 = document.createElement('br');
5077
- var br6 = document.createElement('br');
5078
-
5079
- edit_main_td1.appendChild(el_label_label);
5080
- edit_main_td1_1.appendChild(el_label_textarea);
5081
-
5082
- edit_main_td2.appendChild(el_label_position_label);
5083
- edit_main_td2_1.appendChild(el_label_position1);
5084
- edit_main_td2_1.appendChild(Left);
5085
- edit_main_td2_1.appendChild(br2);
5086
- edit_main_td2_1.appendChild(el_label_position2);
5087
- edit_main_td2_1.appendChild(Top);
5088
-
5089
- edit_main_td3.appendChild(el_size_label);
5090
-
5091
- edit_main_td3_1.appendChild(el_size_w);
5092
- edit_main_td3_1.appendChild(X);
5093
- edit_main_td3_1.appendChild(el_size_h);
5094
-
5095
- edit_main_td4.appendChild(el_first_value_label);
5096
- edit_main_td4_1.appendChild(el_first_value_input);
5097
-
5098
- edit_main_td5.appendChild(el_style_label);
5099
- edit_main_td5_1.appendChild(el_style_textarea);
5100
-
5101
- edit_main_td6.appendChild(el_required_label);
5102
- edit_main_td6_1.appendChild(el_required);
5103
-
5104
- edit_main_td8.appendChild(el_unique_label);
5105
- edit_main_td8_1.appendChild(el_unique);
5106
-
5107
- edit_main_td7.appendChild(el_attr_label);
5108
- edit_main_td7.appendChild(el_attr_add);
5109
- edit_main_td7.appendChild(br6);
5110
- edit_main_td7.appendChild(el_attr_table);
5111
- edit_main_td7.setAttribute("colspan", "2");
5112
-
5113
-
5114
- edit_main_tr1.appendChild(edit_main_td1);
5115
- edit_main_tr1.appendChild(edit_main_td1_1);
5116
- edit_main_tr2.appendChild(edit_main_td2);
5117
- edit_main_tr2.appendChild(edit_main_td2_1);
5118
- edit_main_tr3.appendChild(edit_main_td3);
5119
- edit_main_tr3.appendChild(edit_main_td3_1);
5120
- edit_main_tr4.appendChild(edit_main_td4);
5121
- edit_main_tr4.appendChild(edit_main_td4_1);
5122
- edit_main_tr5.appendChild(edit_main_td5);
5123
- edit_main_tr5.appendChild(edit_main_td5_1);
5124
- edit_main_tr6.appendChild(edit_main_td6);
5125
- edit_main_tr6.appendChild(edit_main_td6_1);
5126
- edit_main_tr7.appendChild(edit_main_td7);
5127
- edit_main_tr7.appendChild(edit_main_td7_1);
5128
- edit_main_tr8.appendChild(edit_main_td8);
5129
- edit_main_tr8.appendChild(edit_main_td8_1);
5130
- edit_main_table.appendChild(edit_main_tr1);
5131
- edit_main_table.appendChild(edit_main_tr2);
5132
- edit_main_table.appendChild(edit_main_tr3);
5133
- edit_main_table.appendChild(edit_main_tr4);
5134
- edit_main_table.appendChild(edit_main_tr5);
5135
- edit_main_table.appendChild(edit_main_tr6);
5136
- edit_main_table.appendChild(edit_main_tr8);
5137
- edit_main_table.appendChild(edit_main_tr7);
5138
- edit_div.appendChild(edit_main_table);
5139
-
5140
- t.appendChild(edit_div);
5141
- add_id_and_name(i, 'type_text');
5142
-
5143
- //show table
5144
-
5145
- element='textarea';
5146
- var adding_type = document.createElement("input");
5147
- adding_type.setAttribute("type", "hidden");
5148
- adding_type.setAttribute("value", "type_textarea");
5149
- adding_type.setAttribute("name", i+"_typeform_id_temp");
5150
- adding_type.setAttribute("id", i+"_typeform_id_temp");
5151
- var adding_required= document.createElement("input");
5152
- adding_required.setAttribute("type", "hidden");
5153
- adding_required.setAttribute("value", w_required);
5154
- adding_required.setAttribute("name", i+"_requiredform_id_temp");
5155
- adding_required.setAttribute("id", i+"_requiredform_id_temp");
5156
-
5157
- var adding_unique= document.createElement("input");
5158
- adding_unique.setAttribute("type", "hidden");
5159
- adding_unique.setAttribute("value", w_unique);
5160
- adding_unique.setAttribute("name", i+"_uniqueform_id_temp");
5161
- adding_unique.setAttribute("id", i+"_uniqueform_id_temp");
5162
-
5163
- var div = document.createElement('div');
5164
- div.setAttribute("id", "main_div");
5165
-
5166
- var table = document.createElement('table');
5167
- table.setAttribute("id", i+"_elemet_tableform_id_temp");
5168
-
5169
- var tr = document.createElement('tr');
5170
-
5171
- var td1 = document.createElement('td');
5172
- td1.setAttribute("valign", 'top');
5173
- td1.setAttribute("align", 'left');
5174
- td1.setAttribute("id", i+"_label_sectionform_id_temp");
5175
-
5176
- var td2 = document.createElement('td');
5177
- td2.setAttribute("valign", 'top');
5178
- td2.setAttribute("align", 'left');
5179
- td2.setAttribute("id", i+"_element_sectionform_id_temp");
5180
-
5181
- var br1 = document.createElement('br');
5182
- var br2 = document.createElement('br');
5183
- var br3 = document.createElement('br');
5184
- var br4 = document.createElement('br');
5185
-
5186
- var label = document.createElement('span');
5187
- label.setAttribute("id", i+"_element_labelform_id_temp");
5188
- label.innerHTML = w_field_label;
5189
- label.setAttribute("class", "label");
5190
-
5191
- var required = document.createElement('span');
5192
- required.setAttribute("id", i+"_required_elementform_id_temp");
5193
- required.innerHTML = "";
5194
- required.setAttribute("class", "required");
5195
- if(w_required=="yes")
5196
- required.innerHTML = " *";
5197
- var adding = document.createElement(element);
5198
- if(w_title==w_first_val)
5199
- {
5200
- adding.style.cssText = "width:"+w_size_w+"px; height:"+w_size_h+"px;";
5201
- adding.setAttribute("class", "input_deactive");
5202
- }
5203
- else
5204
- {
5205
- adding.style.cssText = "width:"+w_size_w+"px; height:"+w_size_h+"px;";
5206
- adding.setAttribute("class", "input_active");
5207
- }
5208
- adding.setAttribute("id", i+"_elementform_id_temp");
5209
- adding.setAttribute("name", i+"_elementform_id_temp");
5210
- adding.setAttribute("title", w_title);
5211
- adding.setAttribute("value",w_first_val);
5212
- adding.setAttribute("onFocus", "delete_value('"+i+"_elementform_id_temp')");
5213
- adding.setAttribute("onBlur", "return_value('"+i+"_elementform_id_temp')");
5214
- adding.setAttribute("onChange", "change_value('"+i+"_elementform_id_temp')");
5215
- adding.innerHTML=w_first_val;
5216
-
5217
-
5218
- var main_td = document.getElementById('show_table');
5219
-
5220
-
5221
- td1.appendChild(label);
5222
- td1.appendChild(required);
5223
- td2.appendChild(adding_type);
5224
-
5225
- td2.appendChild(adding_required);
5226
- td2.appendChild(adding_unique);
5227
- td2.appendChild(adding);
5228
- tr.appendChild(td1);
5229
- tr.appendChild(td2);
5230
- table.appendChild(tr);
5231
-
5232
- div.appendChild(table);
5233
- div.appendChild(br3);
5234
- main_td.appendChild(div);
5235
- if(w_field_label_pos=="top")
5236
- label_top(i);
5237
- change_class(w_class, i);
5238
- refresh_attr(i, 'type_text');
5239
- }
5240
-
5241
- function type_phone(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) {
5242
- document.getElementById("element_type").value="type_phone";
5243
-
5244
- delete_last_child();
5245
- // edit table
5246
- var edit_div = document.createElement('div');
5247
- edit_div.setAttribute("id", "edit_div");
5248
- edit_div.setAttribute("style", "border-top:1px dotted black;padding:10px; padding-top:0px; padding-bottom:0px; margin-top:10px;");
5249
-
5250
- var edit_main_table = document.createElement('table');
5251
- edit_main_table.setAttribute("id", "edit_main_table");
5252
- edit_main_table.setAttribute("cellpadding", "0");
5253
- edit_main_table.setAttribute("cellspacing", "0");
5254
-
5255
- var edit_main_tr1 = document.createElement('tr');
5256
- edit_main_tr1.setAttribute("valing", "top");
5257
-
5258
- var edit_main_tr2 = document.createElement('tr');
5259
- edit_main_tr2.setAttribute("valing", "top");
5260
-
5261
- var edit_main_tr3 = document.createElement('tr');
5262
- edit_main_tr3.setAttribute("valing", "top");
5263
-
5264
- var edit_main_tr4 = document.createElement('tr');
5265
- edit_main_tr4.setAttribute("valing", "top");
5266
-
5267
- var edit_main_tr5 = document.createElement('tr');
5268
- edit_main_tr5.setAttribute("valing", "top");
5269
-
5270
- var edit_main_tr6 = document.createElement('tr');
5271
- edit_main_tr6.setAttribute("valing", "top");
5272
-
5273
- var edit_main_tr7 = document.createElement('tr');
5274
- edit_main_tr7.setAttribute("valing", "top");
5275
-
5276
- var edit_main_tr8 = document.createElement('tr');
5277
- edit_main_tr8.setAttribute("valing", "top");
5278
-
5279
- var edit_main_td1 = document.createElement('td');
5280
- edit_main_td1.style.cssText = "padding-top:10px";
5281
- var edit_main_td1_1 = document.createElement('td');
5282
- edit_main_td1_1.style.cssText = "padding-top:10px";
5283
- var edit_main_td2 = document.createElement('td');
5284
- edit_main_td2.style.cssText = "padding-top:10px";
5285
- var edit_main_td2_1 = document.createElement('td');
5286
- edit_main_td2_1.style.cssText = "padding-top:10px";
5287
-
5288
- var edit_main_td3 = document.createElement('td');
5289
- edit_main_td3.style.cssText = "padding-top:10px";
5290
- var edit_main_td3_1 = document.createElement('td');
5291
- edit_main_td3_1.style.cssText = "padding-top:10px";
5292
- var edit_main_td4 = document.createElement('td');
5293
- edit_main_td4.style.cssText = "padding-top:10px";
5294
- var edit_main_td4_1 = document.createElement('td');
5295
- edit_main_td4_1.style.cssText = "padding-top:10px";
5296
-
5297
- var edit_main_td5 = document.createElement('td');
5298
- edit_main_td5.style.cssText = "padding-top:10px";
5299
- var edit_main_td5_1 = document.createElement('td');
5300
- edit_main_td5_1.style.cssText = "padding-top:10px";
5301
-
5302
- var edit_main_td6 = document.createElement('td');
5303
- edit_main_td6.style.cssText = "padding-top:10px";
5304
- var edit_main_td6_1 = document.createElement('td');
5305
- edit_main_td6_1.style.cssText = "padding-top:10px";
5306
-
5307
- var edit_main_td7 = document.createElement('td');
5308
- edit_main_td7.style.cssText = "padding-top:10px";
5309
- var edit_main_td7_1 = document.createElement('td');
5310
- edit_main_td7_1.style.cssText = "padding-top:10px";
5311
-
5312
- var edit_main_td8 = document.createElement('td');
5313
- edit_main_td8.style.cssText = "padding-top:10px";
5314
- var edit_main_td8_1 = document.createElement('td');
5315
- edit_main_td8_1.style.cssText = "padding-top:10px";
5316
-
5317
- var el_label_label = document.createElement('label');
5318
- el_label_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
5319
- el_label_label.innerHTML = "Field label";
5320
-
5321
- var el_label_textarea = document.createElement('textarea');
5322
- el_label_textarea.setAttribute("id", "edit_for_label");
5323
- el_label_textarea.setAttribute("rows", "4");
5324
- el_label_textarea.style.cssText = "width:200px;";
5325
- el_label_textarea.setAttribute("onKeyUp", "change_label('"+i+"_element_labelform_id_temp', this.value)");
5326
- el_label_textarea.innerHTML = w_field_label;
5327
-
5328
- var el_label_position_label = document.createElement('label');
5329
- el_label_position_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
5330
- el_label_position_label.innerHTML = "Field label position";
5331
-
5332
- var el_label_position1 = document.createElement('input');
5333
- el_label_position1.setAttribute("id", "edit_for_label_position_top");
5334
- el_label_position1.setAttribute("type", "radio");
5335
- el_label_position1.setAttribute("value", "left");
5336
-
5337
- el_label_position1.setAttribute("name", "edit_for_label_position");
5338
- el_label_position1.setAttribute("onchange", "label_left("+i+")");
5339
- Left = document.createTextNode("Left");
5340
-
5341
- var el_label_position2 = document.createElement('input');
5342
- el_label_position2.setAttribute("id", "edit_for_label_position_left");
5343
- el_label_position2.setAttribute("type", "radio");
5344
- el_label_position2.setAttribute("value", "top");
5345
-
5346
- el_label_position2.setAttribute("name", "edit_for_label_position");
5347
- el_label_position2.setAttribute("onchange", "label_top("+i+")");
5348
- Top = document.createTextNode("Top");
5349
-
5350
- if(w_field_label_pos=="top")
5351
- el_label_position2.setAttribute("checked", "checked");
5352
- else
5353
- el_label_position1.setAttribute("checked", "checked");
5354
-
5355
- var el_size_label = document.createElement('label');
5356
- el_size_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
5357
- el_size_label.innerHTML = "Field size(px) ";
5358
- var el_size = document.createElement('input');
5359
- el_size.setAttribute("id", "edit_for_input_size");
5360
- el_size.setAttribute("type", "text");
5361
- el_size.setAttribute("value", w_size);
5362
- el_size.setAttribute("name", "edit_for_size");
5363
- el_size.setAttribute("onKeyPress", "return check_isnum(event)");
5364
- el_size.setAttribute("onKeyUp", "change_w_style('"+i+"_element_lastform_id_temp', this.value);");
5365
-
5366
- var gic = document.createTextNode("-");
5367
-
5368
- var el_first_value_label = document.createElement('label');
5369
- el_first_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
5370
- el_first_value_label.innerHTML = "Value if empty ";
5371
-
5372
- var el_first_value_area = document.createElement('input');
5373
- el_first_value_area.setAttribute("id", "el_first_value_area");
5374
- el_first_value_area.setAttribute("type", "text");
5375
- el_first_value_area.setAttribute("value", w_title[0]);
5376
- el_first_value_area.style.cssText = "width:50px; margin-right:4px";
5377
- el_first_value_area.setAttribute("onKeyUp", "change_input_value(this.value,'"+i+"_element_firstform_id_temp')");
5378
-
5379
- var el_first_value_phone = document.createElement('input');
5380
- el_first_value_phone.setAttribute("id", "el_first_value_phone");
5381
- el_first_value_phone.setAttribute("type", "text");
5382
- el_first_value_phone.setAttribute("value", w_title[1]);
5383
- el_first_value_phone.style.cssText = "width:100px; margin-left:4px";
5384
- el_first_value_phone.setAttribute("onKeyUp", "change_input_value(this.value,'"+i+"_element_lastform_id_temp')");
5385
-
5386
-
5387
- var el_required_label = document.createElement('label');
5388
- el_required_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
5389
- el_required_label.innerHTML = "Required";
5390
-
5391
- var el_required = document.createElement('input');
5392
- el_required.setAttribute("id", "el_send");
5393
- el_required.setAttribute("type", "checkbox");
5394
- el_required.setAttribute("value", "yes");
5395
- el_required.setAttribute("onclick", "set_required('"+i+"_required')");
5396
- if(w_required=="yes")
5397
- el_required.setAttribute("checked", "checked");
5398
-
5399
- var el_unique_label = document.createElement('label');
5400
- el_unique_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
5401
- el_unique_label.innerHTML = "Allow only unique values";
5402
-
5403
- var el_unique = document.createElement('input');
5404
- el_unique.setAttribute("id", "el_send");
5405
- el_unique.setAttribute("type", "checkbox");
5406
- el_unique.setAttribute("value", "yes");
5407
- el_unique.setAttribute("onclick", "set_unique('"+i+"_uniqueform_id_temp')");
5408
- if(w_unique=="yes")
5409
- el_unique.setAttribute("checked", "checked");
5410
-
5411
- var el_style_label = document.createElement('label');
5412
- el_style_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
5413
- el_style_label.innerHTML = "Class name";
5414
-
5415
- var el_style_textarea = document.createElement('input');
5416
- el_style_textarea.setAttribute("id", "element_style");
5417
- el_style_textarea.setAttribute("type", "text");
5418
- el_style_textarea.setAttribute("value", w_class);
5419
- el_style_textarea.style.cssText = "width:200px;";
5420
- el_style_textarea.setAttribute("onChange", "change_class(this.value,'"+i+"')");
5421
-
5422
- var el_attr_label = document.createElement('label');
5423
- el_attr_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
5424
- el_attr_label.innerHTML = "Additional Attributes";
5425
-
5426
- var el_attr_add = document.createElement('img');
5427
- el_attr_add.setAttribute("id", "el_choices_add");
5428
- el_attr_add.setAttribute("src", plugin_url+'/images/add.png');
5429
- el_attr_add.style.cssText = 'cursor:pointer; margin-left:68px';
5430
- el_attr_add.setAttribute("title", 'add');
5431
- el_attr_add.setAttribute("onClick", "add_attr("+i+", 'type_name')");
5432
-
5433
- var el_attr_table = document.createElement('table');
5434
- el_attr_table.setAttribute("id", 'attributes');
5435
- el_attr_table.setAttribute("border", '0');
5436
- el_attr_table.style.cssText = 'margin-left:0px';
5437
- var el_attr_tr_label = document.createElement('tr');
5438
- el_attr_tr_label.setAttribute("idi", '0');
5439
- var el_attr_td_name_label = document.createElement('th');
5440
- el_attr_td_name_label.style.cssText = 'width:100px';
5441
- var el_attr_td_value_label = document.createElement('th');
5442
- el_attr_td_value_label.style.cssText = 'width:100px';
5443
- var el_attr_td_X_label = document.createElement('th');
5444
- el_attr_td_X_label.style.cssText = 'width:10px';
5445
- var el_attr_name_label = document.createElement('label');
5446
- el_attr_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
5447
- el_attr_name_label.innerHTML = "Name";
5448
-
5449
- var el_attr_value_label = document.createElement('label');
5450
- el_attr_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
5451
- el_attr_value_label.innerHTML = "Value";
5452
-
5453
- el_attr_table.appendChild(el_attr_tr_label);
5454
- el_attr_tr_label.appendChild(el_attr_td_name_label);
5455
- el_attr_tr_label.appendChild(el_attr_td_value_label);
5456
- el_attr_tr_label.appendChild(el_attr_td_X_label);
5457
- el_attr_td_name_label.appendChild(el_attr_name_label);
5458
- el_attr_td_value_label.appendChild(el_attr_value_label);
5459
-
5460
- n=w_attr_name.length;
5461
- for(j=1; j<=n; j++)
5462
- {
5463
- var el_attr_tr = document.createElement('tr');
5464
- el_attr_tr.setAttribute("id", "attr_row_"+j);
5465
- el_attr_tr.setAttribute("idi", j);
5466
- var el_attr_td_name = document.createElement('td');
5467
- el_attr_td_name.style.cssText = 'width:100px';
5468
- var el_attr_td_value = document.createElement('td');
5469
- el_attr_td_value.style.cssText = 'width:100px';
5470
-
5471
- var el_attr_td_X = document.createElement('td');
5472
- var el_attr_name = document.createElement('input');
5473
-
5474
- el_attr_name.setAttribute("type", "text");
5475
-
5476
- el_attr_name.style.cssText = "width:100px";
5477
- el_attr_name.setAttribute("value", w_attr_name[j-1]);
5478
- el_attr_name.setAttribute("id", "attr_name"+j);
5479
- el_attr_name.setAttribute("onChange", "change_attribute_name("+i+", this, 'type_name')");
5480
-
5481
- var el_attr_value = document.createElement('input');
5482
-
5483
- el_attr_value.setAttribute("type", "text");
5484
-
5485
- el_attr_value.style.cssText = "width:100px";
5486
- el_attr_value.setAttribute("value", w_attr_value[j-1]);
5487
- el_attr_value.setAttribute("id", "attr_value"+j);
5488
- el_attr_value.setAttribute("onChange", "change_attribute_value("+i+", "+j+", 'type_name')");
5489
-
5490
- var el_attr_remove = document.createElement('img');
5491
- el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
5492
- el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
5493
- el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
5494
- el_attr_remove.setAttribute("align", 'top');
5495
- el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", 'type_name')");
5496
- el_attr_table.appendChild(el_attr_tr);
5497
- el_attr_tr.appendChild(el_attr_td_name);
5498
- el_attr_tr.appendChild(el_attr_td_value);
5499
- el_attr_tr.appendChild(el_attr_td_X);
5500
- el_attr_td_name.appendChild(el_attr_name);
5501
- el_attr_td_value.appendChild(el_attr_value);
5502
- el_attr_td_X.appendChild(el_attr_remove);
5503
-
5504
- }
5505
-
5506
-
5507
- var t = document.getElementById('edit_table');
5508
-
5509
- var br = document.createElement('br');
5510
- var br1 = document.createElement('br');
5511
- var br2 = document.createElement('br');
5512
- var br3 = document.createElement('br');
5513
- var br4 = document.createElement('br');
5514
- var br5 = document.createElement('br');
5515
- var br6 = document.createElement('br');
5516
-
5517
- edit_main_td1.appendChild(el_label_label);
5518
- edit_main_td1_1.appendChild(el_label_textarea);
5519
-
5520
- edit_main_td2.appendChild(el_label_position_label);
5521
- edit_main_td2_1.appendChild(el_label_position1);
5522
- edit_main_td2_1.appendChild(Left);
5523
- edit_main_td2_1.appendChild(br2);
5524
- edit_main_td2_1.appendChild(el_label_position2);
5525
- edit_main_td2_1.appendChild(Top);
5526
-
5527
- edit_main_td3.appendChild(el_first_value_label);
5528
- edit_main_td3_1.appendChild(el_first_value_area);
5529
- edit_main_td3_1.appendChild(gic);
5530
- edit_main_td3_1.appendChild(el_first_value_phone);
5531
-
5532
-
5533
- edit_main_td4.appendChild(el_style_label);
5534
- edit_main_td4_1.appendChild(el_style_textarea);
5535
-
5536
- edit_main_td7.appendChild(el_size_label);
5537
- edit_main_td7_1.appendChild(el_size);
5538
-
5539
- edit_main_td5.appendChild(el_required_label);
5540
- edit_main_td5_1.appendChild(el_required);
5541
-
5542
- edit_main_td8.appendChild(el_unique_label);
5543
- edit_main_td8_1.appendChild(el_unique);
5544
-
5545
- edit_main_td6.appendChild(el_attr_label);
5546
- edit_main_td6.appendChild(el_attr_add);
5547
- edit_main_td6.appendChild(br3);
5548
- edit_main_td6.appendChild(el_attr_table);
5549
- edit_main_td6.setAttribute("colspan", "2");
5550
-
5551
- edit_main_tr1.appendChild(edit_main_td1);
5552
- edit_main_tr1.appendChild(edit_main_td1_1);
5553
- edit_main_tr2.appendChild(edit_main_td2);
5554
- edit_main_tr2.appendChild(edit_main_td2_1);
5555
- edit_main_tr3.appendChild(edit_main_td3);
5556
- edit_main_tr3.appendChild(edit_main_td3_1);
5557
- edit_main_tr4.appendChild(edit_main_td4);
5558
- edit_main_tr4.appendChild(edit_main_td4_1);
5559
- edit_main_tr5.appendChild(edit_main_td5);
5560
- edit_main_tr5.appendChild(edit_main_td5_1);
5561
- edit_main_tr6.appendChild(edit_main_td6);
5562
- edit_main_tr8.appendChild(edit_main_td8);
5563
- edit_main_tr8.appendChild(edit_main_td8_1);
5564
- edit_main_tr7.appendChild(edit_main_td7);
5565
- edit_main_tr7.appendChild(edit_main_td7_1);
5566
- edit_main_table.appendChild(edit_main_tr1);
5567
- edit_main_table.appendChild(edit_main_tr2);
5568
- edit_main_table.appendChild(edit_main_tr3);
5569
- edit_main_table.appendChild(edit_main_tr7);
5570
- edit_main_table.appendChild(edit_main_tr4);
5571
- edit_main_table.appendChild(edit_main_tr5);
5572
- edit_main_table.appendChild(edit_main_tr8);
5573
- edit_main_table.appendChild(edit_main_tr6);
5574
- edit_div.appendChild(edit_main_table);
5575
-
5576
- t.appendChild(edit_div);
5577
- add_id_and_name(i, 'type_name');
5578
-
5579
- //show table
5580
-
5581
- var adding_type = document.createElement("input");
5582
- adding_type.setAttribute("type", "hidden");
5583
- adding_type.setAttribute("value", "type_phone");
5584
- adding_type.setAttribute("name", i+"_typeform_id_temp");
5585
- adding_type.setAttribute("id", i+"_typeform_id_temp");
5586
- var adding_required= document.createElement("input");
5587
- adding_required.setAttribute("type", "hidden");
5588
- adding_required.setAttribute("value", w_required);
5589
- adding_required.setAttribute("name", i+"_requiredform_id_temp");
5590
- adding_required.setAttribute("id", i+"_requiredform_id_temp");
5591
-
5592
- var adding_unique= document.createElement("input");
5593
- adding_unique.setAttribute("type", "hidden");
5594
- adding_unique.setAttribute("value", w_unique);
5595
- adding_unique.setAttribute("name", i+"_uniqueform_id_temp");
5596
- adding_unique.setAttribute("id", i+"_uniqueform_id_temp");
5597
-
5598
- var div = document.createElement('div');
5599
- div.setAttribute("id", "main_div");
5600
-
5601
- var table = document.createElement('table');
5602
- table.setAttribute("id", i+"_elemet_tableform_id_temp");
5603
-
5604
-
5605
- var tr = document.createElement('tr');
5606
-
5607
- var td1 = document.createElement('td');
5608
- td1.setAttribute("valign", 'top');
5609
- td1.setAttribute("align", 'left');
5610
- td1.setAttribute("id", i+"_label_sectionform_id_temp");
5611
-
5612
- var td2 = document.createElement('td');
5613
- td2.setAttribute("valign", 'top');
5614
- td2.setAttribute("align", 'left');
5615
- td2.setAttribute("id", i+"_element_sectionform_id_temp");
5616
-
5617
- var table_name = document.createElement('table');
5618
- table_name.setAttribute("id", i+"_table_name");
5619
- table_name.setAttribute("cellpadding", '0');
5620
- table_name.setAttribute("cellspacing", '0');
5621
-
5622
- var tr_name1 = document.createElement('tr');
5623
- tr_name1.setAttribute("id", i+"_tr_name1");
5624
-
5625
- var tr_name2 = document.createElement('tr');
5626
- tr_name2.setAttribute("id", i+"_tr_name2");
5627
-
5628
- var td_name_input1 = document.createElement('td');
5629
- td_name_input1.setAttribute("id", i+"_td_name_input_first");
5630
-
5631
- var td_name_input2 = document.createElement('td');
5632
- td_name_input2.setAttribute("id", i+"_td_name_input_last");
5633
-
5634
- var td_name_label1 = document.createElement('td');
5635
- td_name_label1.setAttribute("id", i+"_td_name_label_first");
5636
- td_name_label1.setAttribute("align", "left");
5637
-
5638
- var td_name_label2 = document.createElement('td');
5639
- td_name_label2.setAttribute("id", i+"_td_name_label_last");
5640
- td_name_label2.setAttribute("align", "left");
5641
-
5642
- var br1 = document.createElement('br');
5643
- var br2 = document.createElement('br');
5644
- var br3 = document.createElement('br');
5645
- var br4 = document.createElement('br');
5646
-
5647
-
5648
- var label = document.createElement('span');
5649
- label.setAttribute("id", i+"_element_labelform_id_temp");
5650
- label.innerHTML = w_field_label;
5651
- label.setAttribute("class", "label");
5652
-
5653
- var required = document.createElement('span');
5654
- required.setAttribute("id", i+"_required_elementform_id_temp");
5655
- required.innerHTML = "";
5656
- required.setAttribute("class", "required");
5657
- if(w_required=="yes")
5658
- required.innerHTML = " *";
5659
-
5660
- var first = document.createElement('input');
5661
- first.setAttribute("type", 'text');
5662
-
5663
- if(w_title[0]==w_first_val[0])
5664
- first.setAttribute("class", "input_deactive");
5665
- else
5666
- first.setAttribute("class", "input_active");
5667
-
5668
- first.style.cssText = "width:50px";
5669
- first.setAttribute("id", i+"_element_firstform_id_temp");
5670
- first.setAttribute("name", i+"_element_firstform_id_temp");
5671
- first.setAttribute("value", w_first_val[0]);
5672
- first.setAttribute("title", w_title[0]);
5673
- first.setAttribute("onFocus", 'delete_value("'+i+'_element_firstform_id_temp")');
5674
- first.setAttribute("onBlur", 'return_value("'+i+'_element_firstform_id_temp")');
5675
- first.setAttribute("onChange", "change_value('"+i+"_element_firstform_id_temp')");
5676
- first.setAttribute("onKeyPress", "return check_isnum(event)");
5677
-
5678
- var gic = document.createElement('span');
5679
- gic.setAttribute("class", "wdform_line");
5680
- gic.style.cssText = "margin: 0px 4px 0px 4px; padding: 0px;";
5681
- gic.innerHTML = "-";
5682
-
5683
- var first_label = document.createElement('label');
5684
- first_label.setAttribute("class", "mini_label");
5685
- first_label.innerHTML="<!--repstart-->Area Code<!--repend-->";
5686
-
5687
- var last = document.createElement('input');
5688
- last.setAttribute("type", 'text');
5689
-
5690
- if(w_title[1]==w_first_val[1])
5691
- last.setAttribute("class", "input_deactive");
5692
- else
5693
- last.setAttribute("class", "input_active");
5694
-
5695
- last.style.cssText = "width:"+w_size+"px";
5696
- last.setAttribute("id", i+"_element_lastform_id_temp");
5697
- last.setAttribute("name", i+"_element_lastform_id_temp");
5698
- last.setAttribute("value", w_first_val[1]);
5699
- last.setAttribute("title", w_title[1]);
5700
- last.setAttribute("onFocus", 'delete_value("'+i+'_element_lastform_id_temp")');
5701
- last.setAttribute("onBlur", 'return_value("'+i+'_element_lastform_id_temp")');
5702
- last.setAttribute("onChange", "change_value('"+i+"_element_lastform_id_temp')");
5703
- last.setAttribute("onKeyPress", "return check_isnum(event)");
5704
-
5705
- var last_label = document.createElement('label');
5706
- last_label.setAttribute("class", "mini_label");
5707
- last_label.innerHTML="<!--repstart-->Phone Number<!--repend-->";
5708
-
5709
- var main_td = document.getElementById('show_table');
5710
-
5711
- td1.appendChild(label);
5712
- td1.appendChild(required );
5713
-
5714
- td_name_input1.appendChild(first);
5715
- td_name_input1.appendChild(gic);
5716
- td_name_input2.appendChild(last);
5717
- tr_name1.appendChild(td_name_input1);
5718
- tr_name1.appendChild(td_name_input2);
5719
-
5720
- td_name_label1.appendChild(first_label);
5721
- td_name_label2.appendChild(last_label);
5722
- tr_name2.appendChild(td_name_label1);
5723
- tr_name2.appendChild(td_name_label2);
5724
- table_name.appendChild(tr_name1);
5725
- table_name.appendChild(tr_name2);
5726
-
5727
- td2.appendChild(adding_type);
5728
- td2.appendChild(adding_required);
5729
- td2.appendChild(adding_unique);
5730
- td2.appendChild(table_name);
5731
- tr.appendChild(td1);
5732
- tr.appendChild(td2);
5733
- table.appendChild(tr);
5734
-
5735
- div.appendChild(table);
5736
- div.appendChild(br3);
5737
- main_td.appendChild(div);
5738
-
5739
- if(w_field_label_pos=="top")
5740
- label_top(i);
5741
-
5742
- change_class(w_class, i);
5743
- refresh_attr(i, 'type_name');
5744
- }
5745
-
5746
- function type_name(i, w_field_label, w_field_label_pos, w_first_val, w_title, w_size, w_name_format, w_required, w_unique, w_class, w_attr_name, w_attr_value) {
5747
- document.getElementById("element_type").value="type_name";
5748
-
5749
- delete_last_child();
5750
- // edit table
5751
- var edit_div = document.createElement('div');
5752
- edit_div.setAttribute("id", "edit_div");
5753
- edit_div.setAttribute("style", "border-top:1px dotted black;padding:10px; padding-top:0px; padding-bottom:0px; margin-top:10px;");
5754
-
5755
- var edit_main_table = document.createElement('table');
5756
- edit_main_table.setAttribute("id", "edit_main_table");
5757
- edit_main_table.setAttribute("cellpadding", "0");
5758
- edit_main_table.setAttribute("cellspacing", "0");
5759
-
5760
- var edit_main_tr1 = document.createElement('tr');
5761
- edit_main_tr1.setAttribute("valing", "top");
5762
-
5763
- var edit_main_tr2 = document.createElement('tr');
5764
- edit_main_tr2.setAttribute("valing", "top");
5765
-
5766
- var edit_main_tr3 = document.createElement('tr');
5767
- edit_main_tr3.setAttribute("valing", "top");
5768
-
5769
- var edit_main_tr4 = document.createElement('tr');
5770
- edit_main_tr4.setAttribute("valing", "top");
5771
-
5772
- var edit_main_tr5 = document.createElement('tr');
5773
- edit_main_tr5.setAttribute("valing", "top");
5774
-
5775
- var edit_main_tr6 = document.createElement('tr');
5776
- edit_main_tr6.setAttribute("valing", "top");
5777
-
5778
- var edit_main_tr7 = document.createElement('tr');
5779
- edit_main_tr7.setAttribute("valing", "top");
5780
-
5781
- var edit_main_tr8 = document.createElement('tr');
5782
- edit_main_tr8.setAttribute("valing", "top");
5783
-
5784
- var edit_main_tr9 = document.createElement('tr');
5785
- edit_main_tr9.setAttribute("valing", "top");
5786
-
5787
- var edit_main_td1 = document.createElement('td');
5788
- edit_main_td1.style.cssText = "padding-top:10px";
5789
- var edit_main_td1_1 = document.createElement('td');
5790
- edit_main_td1_1.style.cssText = "padding-top:10px";
5791
- var edit_main_td2 = document.createElement('td');
5792
- edit_main_td2.style.cssText = "padding-top:10px";
5793
- var edit_main_td2_1 = document.createElement('td');
5794
- edit_main_td2_1.style.cssText = "padding-top:10px";
5795
-
5796
- var edit_main_td3 = document.createElement('td');
5797
- edit_main_td3.style.cssText = "padding-top:10px";
5798
- var edit_main_td3_1 = document.createElement('td');
5799
- edit_main_td3_1.style.cssText = "padding-top:10px";
5800
- var edit_main_td4 = document.createElement('td');
5801
- edit_main_td4.style.cssText = "padding-top:10px";
5802
- var edit_main_td4_1 = document.createElement('td');
5803
- edit_main_td4_1.style.cssText = "padding-top:10px";
5804
-
5805
- var edit_main_td5 = document.createElement('td');
5806
- edit_main_td5.style.cssText = "padding-top:10px";
5807
- var edit_main_td5_1 = document.createElement('td');
5808
- edit_main_td5_1.style.cssText = "padding-top:10px";
5809
-
5810
- var edit_main_td6 = document.createElement('td');
5811
- edit_main_td6.style.cssText = "padding-top:10px";
5812
- var edit_main_td6_1 = document.createElement('td');
5813
- edit_main_td6_1.style.cssText = "padding-top:10px";
5814
-
5815
- var edit_main_td7 = document.createElement('td');
5816
- edit_main_td7.style.cssText = "padding-top:10px";
5817
- var edit_main_td7_1 = document.createElement('td');
5818
- edit_main_td7_1.style.cssText = "padding-top:10px";
5819
-
5820
- var edit_main_td8 = document.createElement('td');
5821
- edit_main_td8.style.cssText = "padding-top:10px";
5822
- var edit_main_td8_1 = document.createElement('td');
5823
- edit_main_td8_1.style.cssText = "padding-top:10px";
5824
-
5825
- var edit_main_td9 = document.createElement('td');
5826
- edit_main_td9.style.cssText = "padding-top:10px";
5827
- var edit_main_td9_1 = document.createElement('td');
5828
- edit_main_td9_1.style.cssText = "padding-top:10px";
5829
-
5830
- var el_label_label = document.createElement('label');
5831
- el_label_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
5832
- el_label_label.innerHTML = "Field label";
5833
-
5834
- var el_label_textarea = document.createElement('textarea');
5835
- el_label_textarea.setAttribute("id", "edit_for_label");
5836
- el_label_textarea.setAttribute("rows", "4");
5837
- el_label_textarea.style.cssText = "width:200px;";
5838
- el_label_textarea.setAttribute("onKeyUp", "change_label('"+i+"_element_labelform_id_temp', this.value)");
5839
- el_label_textarea.innerHTML = w_field_label;
5840
-
5841
- var el_label_position_label = document.createElement('label');
5842
- el_label_position_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
5843
- el_label_position_label.innerHTML = "Field label position";
5844
-
5845
- var el_label_position1 = document.createElement('input');
5846
- el_label_position1.setAttribute("id", "edit_for_label_position_top");
5847
- el_label_position1.setAttribute("type", "radio");
5848
- el_label_position1.setAttribute("value", "left");
5849
-
5850
-
5851
- el_label_position1.setAttribute("name", "edit_for_label_position");
5852
- el_label_position1.setAttribute("onchange", "label_left("+i+")");
5853
- Left = document.createTextNode("Left");
5854
-
5855
- var el_label_position2 = document.createElement('input');
5856
- el_label_position2.setAttribute("id", "edit_for_label_position_left");
5857
- el_label_position2.setAttribute("type", "radio");
5858
- el_label_position2.setAttribute("value", "top");
5859
-
5860
-
5861
- el_label_position2.setAttribute("name", "edit_for_label_position");
5862
- el_label_position2.setAttribute("onchange", "label_top("+i+")");
5863
- Top = document.createTextNode("Top");
5864
-
5865
- if(w_field_label_pos=="top")
5866
-
5867
- el_label_position2.setAttribute("checked", "checked");
5868
- else
5869
-
5870
- el_label_position1.setAttribute("checked", "checked");
5871
-
5872
- var gic = document.createTextNode("-");
5873
-
5874
- var el_first_value_label = document.createElement('label');
5875
- el_first_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
5876
- el_first_value_label.innerHTML = "Value if empty ";
5877
-
5878
- var el_first_value_first = document.createElement('input');
5879
- el_first_value_first.setAttribute("id", "el_first_value_first");
5880
- el_first_value_first.setAttribute("type", "text");
5881
- el_first_value_first.setAttribute("value", w_title[0]);
5882
- el_first_value_first.style.cssText = "width:80px; margin-left:4px; margin-right:4px";
5883
- el_first_value_first.setAttribute("onKeyUp", "change_input_value(this.value,'"+i+"_element_firstform_id_temp')");
5884
-
5885
- var el_first_value_last = document.createElement('input');
5886
- el_first_value_last.setAttribute("id", "el_first_value_last");
5887
- el_first_value_last.setAttribute("type", "text");
5888
- el_first_value_last.setAttribute("value", w_title[1]);
5889
- el_first_value_last.style.cssText = "width:80px; margin-left:4px; margin-right:4px";
5890
- el_first_value_last.setAttribute("onKeyUp", "change_input_value(this.value,'"+i+"_element_lastform_id_temp')");
5891
-
5892
- var el_size_label = document.createElement('label');
5893
- el_size_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
5894
- el_size_label.innerHTML = "Field size(px) ";
5895
- var el_size = document.createElement('input');
5896
- el_size.setAttribute("id", "edit_for_input_size");
5897
- el_size.setAttribute("type", "text");
5898
- el_size.setAttribute("value", w_size);
5899
-
5900
- el_size.setAttribute("name", "edit_for_size");
5901
- el_size.setAttribute("onKeyPress", "return check_isnum(event)");
5902
- el_size.setAttribute("onKeyUp", "change_w_style('"+i+"_element_firstform_id_temp', this.value); change_w_style('"+i+"_element_lastform_id_temp', this.value); change_w_style('"+i+"_element_middleform_id_temp', this.value)");
5903
-
5904
-
5905
- var el_format_label = document.createElement('label');
5906
- el_format_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
5907
- el_format_label.innerHTML = "Name Format";
5908
-
5909
- var el_format_normal = document.createElement('input');
5910
- el_format_normal.setAttribute("id", "el_format_normal");
5911
- el_format_normal.setAttribute("type", "radio");
5912
- el_format_normal.setAttribute("value", "normal");
5913
- el_format_normal.setAttribute("name", "edit_for_name_format");
5914
- el_format_normal.setAttribute("onchange", "format_normal("+i+")");
5915
- el_format_normal.setAttribute("checked", "checked");
5916
- Normal = document.createTextNode("Normal");
5917
-
5918
- var el_format_extended = document.createElement('input');
5919
- el_format_extended.setAttribute("id", "el_format_extended");
5920
- el_format_extended.setAttribute("type", "radio");
5921
- el_format_extended.setAttribute("value", "extended");
5922
- el_format_extended.setAttribute("name", "edit_for_name_format");
5923
- el_format_extended.setAttribute("onchange", "format_extended("+i+")");
5924
- Extended = document.createTextNode("Extended");
5925
-
5926
- if(w_name_format=="normal")
5927
-
5928
- el_format_normal.setAttribute("checked", "checked");
5929
- else
5930
- el_format_extended.setAttribute("checked", "checked");
5931
-
5932
- var el_required_label = document.createElement('label');
5933
- el_required_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
5934
- el_required_label.innerHTML = "Required";
5935
-
5936
- var el_required = document.createElement('input');
5937
- el_required.setAttribute("id", "el_send");
5938
- el_required.setAttribute("type", "checkbox");
5939
- el_required.setAttribute("value", "yes");
5940
- el_required.setAttribute("onclick", "set_required('"+i+"_required')");
5941
- if(w_required=="yes")
5942
- el_required.setAttribute("checked", "checked");
5943
-
5944
- var el_unique_label = document.createElement('label');
5945
- el_unique_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
5946
- el_unique_label.innerHTML = "Allow only unique values";
5947
-
5948
- var el_unique = document.createElement('input');
5949
- el_unique.setAttribute("id", "el_send");
5950
- el_unique.setAttribute("type", "checkbox");
5951
- el_unique.setAttribute("value", "yes");
5952
- el_unique.setAttribute("onclick", "set_unique('"+i+"_uniqueform_id_temp')");
5953
- if(w_unique=="yes")
5954
- el_unique.setAttribute("checked", "checked");
5955
-
5956
- var el_style_label = document.createElement('label');
5957
- el_style_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
5958
- el_style_label.innerHTML = "Class name";
5959
-
5960
- var el_style_textarea = document.createElement('input');
5961
- el_style_textarea.setAttribute("id", "element_style");
5962
- el_style_textarea.setAttribute("type", "text");
5963
- el_style_textarea.setAttribute("value", w_class);
5964
- el_style_textarea.style.cssText = "width:200px;";
5965
- el_style_textarea.setAttribute("onChange", "change_class(this.value,'"+i+"')");
5966
-
5967
- var el_attr_label = document.createElement('label');
5968
- el_attr_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
5969
- el_attr_label.innerHTML = "Additional Attributes";
5970
- var el_attr_add = document.createElement('img');
5971
- el_attr_add.setAttribute("id", "el_choices_add");
5972
- el_attr_add.setAttribute("src", plugin_url+'/images/add.png');
5973
- el_attr_add.style.cssText = 'cursor:pointer; margin-left:68px';
5974
- el_attr_add.setAttribute("title", 'add');
5975
- el_attr_add.setAttribute("onClick", "add_attr("+i+", 'type_name')");
5976
- var el_attr_table = document.createElement('table');
5977
- el_attr_table.setAttribute("id", 'attributes');
5978
- el_attr_table.setAttribute("border", '0');
5979
- el_attr_table.style.cssText = 'margin-left:0px';
5980
- var el_attr_tr_label = document.createElement('tr');
5981
- el_attr_tr_label.setAttribute("idi", '0');
5982
- var el_attr_td_name_label = document.createElement('th');
5983
- el_attr_td_name_label.style.cssText = 'width:100px';
5984
- var el_attr_td_value_label = document.createElement('th');
5985
- el_attr_td_value_label.style.cssText = 'width:100px';
5986
- var el_attr_td_X_label = document.createElement('th');
5987
- el_attr_td_X_label.style.cssText = 'width:10px';
5988
- var el_attr_name_label = document.createElement('label');
5989
- el_attr_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
5990
- el_attr_name_label.innerHTML = "Name";
5991
-
5992
- var el_attr_value_label = document.createElement('label');
5993
- el_attr_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
5994
- el_attr_value_label.innerHTML = "Value";
5995
-
5996
- el_attr_table.appendChild(el_attr_tr_label);
5997
- el_attr_tr_label.appendChild(el_attr_td_name_label);
5998
- el_attr_tr_label.appendChild(el_attr_td_value_label);
5999
- el_attr_tr_label.appendChild(el_attr_td_X_label);
6000
- el_attr_td_name_label.appendChild(el_attr_name_label);
6001
- el_attr_td_value_label.appendChild(el_attr_value_label);
6002
-
6003
- n=w_attr_name.length;
6004
- for(j=1; j<=n; j++)
6005
- {
6006
- var el_attr_tr = document.createElement('tr');
6007
- el_attr_tr.setAttribute("id", "attr_row_"+j);
6008
- el_attr_tr.setAttribute("idi", j);
6009
- var el_attr_td_name = document.createElement('td');
6010
- el_attr_td_name.style.cssText = 'width:100px';
6011
- var el_attr_td_value = document.createElement('td');
6012
- el_attr_td_value.style.cssText = 'width:100px';
6013
-
6014
- var el_attr_td_X = document.createElement('td');
6015
- var el_attr_name = document.createElement('input');
6016
-
6017
- el_attr_name.setAttribute("type", "text");
6018
-
6019
- el_attr_name.style.cssText = "width:100px";
6020
- el_attr_name.setAttribute("value", w_attr_name[j-1]);
6021
- el_attr_name.setAttribute("id", "attr_name"+j);
6022
- el_attr_name.setAttribute("onChange", "change_attribute_name("+i+", this, 'type_name')");
6023
-
6024
- var el_attr_value = document.createElement('input');
6025
-
6026
- el_attr_value.setAttribute("type", "text");
6027
-
6028
- el_attr_value.style.cssText = "width:100px";
6029
- el_attr_value.setAttribute("value", w_attr_value[j-1]);
6030
- el_attr_value.setAttribute("id", "attr_value"+j);
6031
- el_attr_value.setAttribute("onChange", "change_attribute_value("+i+", "+j+", 'type_name')");
6032
-
6033
- var el_attr_remove = document.createElement('img');
6034
- el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
6035
- el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
6036
- el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
6037
- el_attr_remove.setAttribute("align", 'top');
6038
- el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", 'type_name')");
6039
- el_attr_table.appendChild(el_attr_tr);
6040
- el_attr_tr.appendChild(el_attr_td_name);
6041
- el_attr_tr.appendChild(el_attr_td_value);
6042
- el_attr_tr.appendChild(el_attr_td_X);
6043
- el_attr_td_name.appendChild(el_attr_name);
6044
- el_attr_td_value.appendChild(el_attr_value);
6045
- el_attr_td_X.appendChild(el_attr_remove);
6046
-
6047
- }
6048
-
6049
-
6050
- var t = document.getElementById('edit_table');
6051
-
6052
- var br = document.createElement('br');
6053
- var br1 = document.createElement('br');
6054
- var br2 = document.createElement('br');
6055
- var br3 = document.createElement('br');
6056
- var br4 = document.createElement('br');
6057
- var br5 = document.createElement('br');
6058
- var br6 = document.createElement('br');
6059
-
6060
- edit_main_td1.appendChild(el_label_label);
6061
- edit_main_td1_1.appendChild(el_label_textarea);
6062
-
6063
- edit_main_td2.appendChild(el_label_position_label);
6064
- edit_main_td2_1.appendChild(el_label_position1);
6065
- edit_main_td2_1.appendChild(Left);
6066
- edit_main_td2_1.appendChild(br2);
6067
- edit_main_td2_1.appendChild(el_label_position2);
6068
- edit_main_td2_1.appendChild(Top);
6069
-
6070
- edit_main_td9.appendChild(el_first_value_label);
6071
- edit_main_td9_1.appendChild(el_first_value_first);
6072
- edit_main_td9_1.appendChild(gic);
6073
- edit_main_td9_1.appendChild(el_first_value_last);
6074
-
6075
-
6076
-
6077
- edit_main_td7.appendChild(el_size_label);
6078
- edit_main_td7_1.appendChild(el_size);
6079
-
6080
- edit_main_td3.appendChild(el_format_label);
6081
-
6082
- edit_main_td3_1.appendChild(el_format_normal);
6083
- edit_main_td3_1.appendChild(Normal);
6084
- edit_main_td3_1.appendChild(br6);
6085
- edit_main_td3_1.appendChild(el_format_extended);
6086
- edit_main_td3_1.appendChild(Extended);
6087
-
6088
- edit_main_td4.appendChild(el_style_label);
6089
- edit_main_td4_1.appendChild(el_style_textarea);
6090
-
6091
- edit_main_td5.appendChild(el_required_label);
6092
- edit_main_td5_1.appendChild(el_required);
6093
-
6094
- edit_main_td8.appendChild(el_unique_label);
6095
- edit_main_td8_1.appendChild(el_unique);
6096
-
6097
- edit_main_td6.appendChild(el_attr_label);
6098
- edit_main_td6.appendChild(el_attr_add);
6099
- edit_main_td6.appendChild(br3);
6100
- edit_main_td6.appendChild(el_attr_table);
6101
- edit_main_td6.setAttribute("colspan", "2");
6102
-
6103
- edit_main_tr1.appendChild(edit_main_td1);
6104
- edit_main_tr1.appendChild(edit_main_td1_1);
6105
- edit_main_tr2.appendChild(edit_main_td2);
6106
- edit_main_tr2.appendChild(edit_main_td2_1);
6107
- edit_main_tr7.appendChild(edit_main_td7);
6108
- edit_main_tr7.appendChild(edit_main_td7_1);
6109
- edit_main_tr3.appendChild(edit_main_td3);
6110
- edit_main_tr3.appendChild(edit_main_td3_1);
6111
- edit_main_tr4.appendChild(edit_main_td4);
6112
- edit_main_tr4.appendChild(edit_main_td4_1);
6113
- edit_main_tr5.appendChild(edit_main_td5);
6114
- edit_main_tr5.appendChild(edit_main_td5_1);
6115
- edit_main_tr6.appendChild(edit_main_td6);
6116
- edit_main_tr6.appendChild(edit_main_td6_1);
6117
- edit_main_tr8.appendChild(edit_main_td8);
6118
- edit_main_tr8.appendChild(edit_main_td8_1);
6119
- edit_main_tr9.appendChild(edit_main_td9);
6120
- edit_main_tr9.appendChild(edit_main_td9_1);
6121
- edit_main_table.appendChild(edit_main_tr1);
6122
- edit_main_table.appendChild(edit_main_tr2);
6123
- edit_main_table.appendChild(edit_main_tr9);
6124
- edit_main_table.appendChild(edit_main_tr7);
6125
- edit_main_table.appendChild(edit_main_tr3);
6126
- edit_main_table.appendChild(edit_main_tr4);
6127
- edit_main_table.appendChild(edit_main_tr5);
6128
- edit_main_table.appendChild(edit_main_tr8);
6129
- edit_main_table.appendChild(edit_main_tr6);
6130
- edit_div.appendChild(edit_main_table);
6131
-
6132
- t.appendChild(edit_div);
6133
- add_id_and_name(i, 'type_name');
6134
-
6135
- //show table
6136
-
6137
- var adding_type = document.createElement("input");
6138
- adding_type.setAttribute("type", "hidden");
6139
- adding_type.setAttribute("value", "type_name");
6140
- adding_type.setAttribute("name", i+"_typeform_id_temp");
6141
- adding_type.setAttribute("id", i+"_typeform_id_temp");
6142
- var adding_required= document.createElement("input");
6143
- adding_required.setAttribute("type", "hidden");
6144
- adding_required.setAttribute("value", w_required);
6145
- adding_required.setAttribute("name", i+"_requiredform_id_temp");
6146
- adding_required.setAttribute("id", i+"_requiredform_id_temp");
6147
-
6148
- var adding_unique= document.createElement("input");
6149
- adding_unique.setAttribute("type", "hidden");
6150
- adding_unique.setAttribute("value", w_unique);
6151
- adding_unique.setAttribute("name", i+"_uniqueform_id_temp");
6152
- adding_unique.setAttribute("id", i+"_uniqueform_id_temp");
6153
-
6154
- var div = document.createElement('div');
6155
- div.setAttribute("id", "main_div");
6156
-
6157
- var table = document.createElement('table');
6158
- table.setAttribute("id", i+"_elemet_tableform_id_temp");
6159
-
6160
-
6161
- var tr = document.createElement('tr');
6162
-
6163
- var td1 = document.createElement('td');
6164
- td1.setAttribute("valign", 'top');
6165
- td1.setAttribute("align", 'left');
6166
- td1.setAttribute("id", i+"_label_sectionform_id_temp");
6167
-
6168
- var td2 = document.createElement('td');
6169
- td2.setAttribute("valign", 'top');
6170
- td2.setAttribute("align", 'left');
6171
- td2.setAttribute("id", i+"_element_sectionform_id_temp");
6172
-
6173
- var table_name = document.createElement('table');
6174
- table_name.setAttribute("id", i+"_table_name");
6175
- table_name.setAttribute("cellpadding", '0');
6176
- table_name.setAttribute("cellspacing", '0');
6177
-
6178
- var tr_name1 = document.createElement('tr');
6179
- tr_name1.setAttribute("id", i+"_tr_name1");
6180
-
6181
- var tr_name2 = document.createElement('tr');
6182
- tr_name2.setAttribute("id", i+"_tr_name2");
6183
-
6184
- var td_name_input1 = document.createElement('td');
6185
- td_name_input1.setAttribute("id", i+"_td_name_input_first");
6186
-
6187
- var td_name_input2 = document.createElement('td');
6188
- td_name_input2.setAttribute("id", i+"_td_name_input_last");
6189
-
6190
- var td_name_label1 = document.createElement('td');
6191
- td_name_label1.setAttribute("id", i+"_td_name_label_first");
6192
- td_name_label1.setAttribute("align", "left");
6193
-
6194
- var td_name_label2 = document.createElement('td');
6195
- td_name_label2.setAttribute("id", i+"_td_name_label_last");
6196
- td_name_label2.setAttribute("align", "left");
6197
-
6198
- var br1 = document.createElement('br');
6199
- var br2 = document.createElement('br');
6200
- var br3 = document.createElement('br');
6201
- var br4 = document.createElement('br');
6202
-
6203
-
6204
- var label = document.createElement('span');
6205
- label.setAttribute("id", i+"_element_labelform_id_temp");
6206
- label.innerHTML = w_field_label;
6207
- label.setAttribute("class", "label");
6208
-
6209
- var required = document.createElement('span');
6210
- required.setAttribute("id", i+"_required_elementform_id_temp");
6211
- required.innerHTML = "";
6212
- required.setAttribute("class", "required");
6213
- if(w_required=="yes")
6214
- required.innerHTML = " *";
6215
- var first = document.createElement('input');
6216
- first.setAttribute("type", 'text');
6217
- if(w_title[0]==w_first_val[0])
6218
- first.setAttribute("class", "input_deactive");
6219
- else
6220
- first.setAttribute("class", "input_active");
6221
-
6222
- first.style.cssText = "margin-right: 10px; width:"+w_size+"px";
6223
- first.setAttribute("id", i+"_element_firstform_id_temp");
6224
- first.setAttribute("name", i+"_element_firstform_id_temp");
6225
- first.setAttribute("value", w_first_val[0]);
6226
- first.setAttribute("title", w_title[0]);
6227
- first.setAttribute("onFocus", 'delete_value("'+i+'_element_firstform_id_temp")');
6228
- first.setAttribute("onBlur", 'return_value("'+i+'_element_firstform_id_temp")');
6229
- first.setAttribute("onChange", "change_value('"+i+"_element_firstform_id_temp')");
6230
-
6231
- var first_label = document.createElement('label');
6232
- first_label.setAttribute("class", "mini_label");
6233
- first_label.innerHTML="<!--repstart-->First<!--repend-->";
6234
-
6235
- var last = document.createElement('input');
6236
- last.setAttribute("type", 'text');
6237
-
6238
- if(w_title[1]==w_first_val[1])
6239
- last.setAttribute("class", "input_deactive");
6240
- else
6241
- last.setAttribute("class", "input_active");
6242
-
6243
- last.style.cssText = "margin-right: 10px; width:"+w_size+"px";
6244
- last.setAttribute("id", i+"_element_lastform_id_temp");
6245
- last.setAttribute("name", i+"_element_lastform_id_temp");
6246
- last.setAttribute("value", w_first_val[1]);
6247
- last.setAttribute("title", w_title[1]);
6248
- last.setAttribute("onFocus", 'delete_value("'+i+'_element_lastform_id_temp")');
6249
- last.setAttribute("onBlur", 'return_value("'+i+'_element_lastform_id_temp")');
6250
- last.setAttribute("onChange", "change_value('"+i+"_element_lastform_id_temp')");
6251
-
6252
-
6253
- var last_label = document.createElement('label');
6254
- last_label.setAttribute("class", "mini_label");
6255
- last_label.innerHTML="<!--repstart-->Last<!--repend-->";
6256
-
6257
- var main_td = document.getElementById('show_table');
6258
-
6259
- td1.appendChild(label);
6260
- td1.appendChild(required );
6261
-
6262
- td_name_input1.appendChild(first);
6263
- td_name_input2.appendChild(last);
6264
- tr_name1.appendChild(td_name_input1);
6265
- tr_name1.appendChild(td_name_input2);
6266
-
6267
- td_name_label1.appendChild(first_label);
6268
- td_name_label2.appendChild(last_label);
6269
- tr_name2.appendChild(td_name_label1);
6270
- tr_name2.appendChild(td_name_label2);
6271
- table_name.appendChild(tr_name1);
6272
- table_name.appendChild(tr_name2);
6273
-
6274
- td2.appendChild(adding_type);
6275
- td2.appendChild(adding_required);
6276
- td2.appendChild(adding_unique);
6277
- td2.appendChild(table_name);
6278
- tr.appendChild(td1);
6279
- tr.appendChild(td2);
6280
- table.appendChild(tr);
6281
-
6282
- div.appendChild(table);
6283
- div.appendChild(br3);
6284
- main_td.appendChild(div);
6285
-
6286
- if(w_field_label_pos=="top")
6287
- label_top(i);
6288
-
6289
- if(w_name_format=="extended")
6290
- format_extended(i);
6291
- change_class(w_class, i);
6292
- refresh_attr(i, 'type_name');
6293
- }
6294
-
6295
- function type_address(i, w_field_label, w_field_label_pos, w_size, w_required, w_class, w_attr_name, w_attr_value) {
6296
-
6297
- document.getElementById("element_type").value="type_address";
6298
-
6299
- delete_last_child();
6300
- // edit table
6301
- var edit_div = document.createElement('div');
6302
- edit_div.setAttribute("id", "edit_div");
6303
- edit_div.setAttribute("style", "border-top:1px dotted black;padding:10px; padding-top:0px; padding-bottom:0px; margin-top:10px;");
6304
-
6305
- var edit_main_table = document.createElement('table');
6306
- edit_main_table.setAttribute("id", "edit_main_table");
6307
- edit_main_table.setAttribute("cellpadding", "0");
6308
- edit_main_table.setAttribute("cellspacing", "0");
6309
-
6310
- var edit_main_tr1 = document.createElement('tr');
6311
- edit_main_tr1.setAttribute("valing", "top");
6312
-
6313
- var edit_main_tr2 = document.createElement('tr');
6314
- edit_main_tr2.setAttribute("valing", "top");
6315
-
6316
- var edit_main_tr3 = document.createElement('tr');
6317
- edit_main_tr3.setAttribute("valing", "top");
6318
-
6319
- var edit_main_tr4 = document.createElement('tr');
6320
- edit_main_tr4.setAttribute("valing", "top");
6321
-
6322
- var edit_main_tr5 = document.createElement('tr');
6323
- edit_main_tr5.setAttribute("valing", "top");
6324
-
6325
- var edit_main_tr6 = document.createElement('tr');
6326
- edit_main_tr6.setAttribute("valing", "top");
6327
-
6328
- var edit_main_tr7 = document.createElement('tr');
6329
- edit_main_tr7.setAttribute("valing", "top");
6330
-
6331
- var edit_main_tr8 = document.createElement('tr');
6332
- edit_main_tr8.setAttribute("valing", "top");
6333
-
6334
- var edit_main_td1 = document.createElement('td');
6335
- edit_main_td1.style.cssText = "padding-top:10px";
6336
- var edit_main_td1_1 = document.createElement('td');
6337
- edit_main_td1_1.style.cssText = "padding-top:10px";
6338
- var edit_main_td2 = document.createElement('td');
6339
- edit_main_td2.style.cssText = "padding-top:10px";
6340
- var edit_main_td2_1 = document.createElement('td');
6341
- edit_main_td2_1.style.cssText = "padding-top:10px";
6342
-
6343
- var edit_main_td3 = document.createElement('td');
6344
- edit_main_td3.style.cssText = "padding-top:10px";
6345
- var edit_main_td3_1 = document.createElement('td');
6346
- edit_main_td3_1.style.cssText = "padding-top:10px";
6347
- var edit_main_td4 = document.createElement('td');
6348
- edit_main_td4.style.cssText = "padding-top:10px";
6349
- var edit_main_td4_1 = document.createElement('td');
6350
- edit_main_td4_1.style.cssText = "padding-top:10px";
6351
-
6352
- var edit_main_td5 = document.createElement('td');
6353
- edit_main_td5.style.cssText = "padding-top:10px";
6354
- var edit_main_td5_1 = document.createElement('td');
6355
- edit_main_td5_1.style.cssText = "padding-top:10px";
6356
-
6357
- var edit_main_td6 = document.createElement('td');
6358
- edit_main_td6.style.cssText = "padding-top:10px";
6359
- var edit_main_td6_1 = document.createElement('td');
6360
- edit_main_td6_1.style.cssText = "padding-top:10px";
6361
-
6362
- var edit_main_td7 = document.createElement('td');
6363
- edit_main_td7.style.cssText = "padding-top:10px";
6364
- var edit_main_td7_1 = document.createElement('td');
6365
- edit_main_td7_1.style.cssText = "padding-top:10px";
6366
-
6367
- var edit_main_td8 = document.createElement('td');
6368
- edit_main_td8.style.cssText = "padding-top:10px";
6369
- var edit_main_td8_1 = document.createElement('td');
6370
- edit_main_td8_1.style.cssText = "padding-top:10px";
6371
-
6372
- var el_label_label = document.createElement('label');
6373
- el_label_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
6374
- el_label_label.innerHTML = "Field label";
6375
-
6376
- var el_label_textarea = document.createElement('textarea');
6377
- el_label_textarea.setAttribute("id", "edit_for_label");
6378
- el_label_textarea.setAttribute("rows", "4");
6379
- el_label_textarea.style.cssText = "width:200px;";
6380
- el_label_textarea.setAttribute("onKeyUp", "change_label('"+i+"_element_labelform_id_temp', this.value)");
6381
- el_label_textarea.innerHTML = w_field_label;
6382
-
6383
- var el_label_position_label = document.createElement('label');
6384
- el_label_position_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
6385
- el_label_position_label.innerHTML = "Field label position";
6386
-
6387
- var el_label_position1 = document.createElement('input');
6388
- el_label_position1.setAttribute("id", "edit_for_label_position_top");
6389
- el_label_position1.setAttribute("type", "radio");
6390
- el_label_position1.setAttribute("value", "left");
6391
-
6392
-
6393
- el_label_position1.setAttribute("name", "edit_for_label_position");
6394
- el_label_position1.setAttribute("onchange", "label_left("+i+")");
6395
- Left = document.createTextNode("Left");
6396
-
6397
- var el_label_position2 = document.createElement('input');
6398
- el_label_position2.setAttribute("id", "edit_for_label_position_left");
6399
- el_label_position2.setAttribute("type", "radio");
6400
- el_label_position2.setAttribute("value", "top");
6401
-
6402
-
6403
- el_label_position2.setAttribute("name", "edit_for_label_position");
6404
- el_label_position2.setAttribute("onchange", "label_top("+i+")");
6405
- Top = document.createTextNode("Top");
6406
-
6407
- if(w_field_label_pos=="top")
6408
-
6409
- el_label_position2.setAttribute("checked", "checked");
6410
- else
6411
-
6412
- el_label_position1.setAttribute("checked", "checked");
6413
-
6414
- var el_size_label = document.createElement('label');
6415
- el_size_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
6416
- el_size_label.innerHTML = "Obshii size(px) ";
6417
- var el_size = document.createElement('input');
6418
- el_size.setAttribute("id", "edit_for_input_size");
6419
- el_size.setAttribute("type", "text");
6420
- el_size.setAttribute("value", w_size);
6421
-
6422
- el_size.setAttribute("name", "edit_for_size");
6423
- el_size.setAttribute("onKeyPress", "return check_isnum(event)");
6424
- el_size.setAttribute("onKeyUp", "change_w_style('"+i+"_div_address', this.value);");
6425
-
6426
-
6427
- var el_required_label = document.createElement('label');
6428
- el_required_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
6429
- el_required_label.innerHTML = "Required";
6430
-
6431
- var el_required = document.createElement('input');
6432
- el_required.setAttribute("id", "el_send");
6433
- el_required.setAttribute("type", "checkbox");
6434
- el_required.setAttribute("value", "yes");
6435
- el_required.setAttribute("onclick", "set_required('"+i+"_required')");
6436
- if(w_required=="yes")
6437
- el_required.setAttribute("checked", "checked");
6438
-
6439
- var el_style_label = document.createElement('label');
6440
- el_style_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
6441
- el_style_label.innerHTML = "Class name";
6442
-
6443
- var el_style_textarea = document.createElement('input');
6444
- el_style_textarea.setAttribute("id", "element_style");
6445
- el_style_textarea.setAttribute("type", "text");
6446
- el_style_textarea.setAttribute("value", w_class);
6447
- el_style_textarea.style.cssText = "width:200px;";
6448
- el_style_textarea.setAttribute("onChange", "change_class(this.value,'"+i+"')");
6449
-
6450
- var el_attr_label = document.createElement('label');
6451
- el_attr_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
6452
- el_attr_label.innerHTML = "Additional Attributes";
6453
- var el_attr_add = document.createElement('img');
6454
- el_attr_add.setAttribute("id", "el_choices_add");
6455
- el_attr_add.setAttribute("src", plugin_url+'/images/add.png');
6456
- el_attr_add.style.cssText = 'cursor:pointer; margin-left:68px';
6457
- el_attr_add.setAttribute("title", 'add');
6458
- el_attr_add.setAttribute("onClick", "add_attr("+i+", 'type_address')");
6459
- var el_attr_table = document.createElement('table');
6460
- el_attr_table.setAttribute("id", 'attributes');
6461
- el_attr_table.setAttribute("border", '0');
6462
- el_attr_table.style.cssText = 'margin-left:0px';
6463
- var el_attr_tr_label = document.createElement('tr');
6464
- el_attr_tr_label.setAttribute("idi", '0');
6465
- var el_attr_td_name_label = document.createElement('th');
6466
- el_attr_td_name_label.style.cssText = 'width:100px';
6467
- var el_attr_td_value_label = document.createElement('th');
6468
- el_attr_td_value_label.style.cssText = 'width:100px';
6469
- var el_attr_td_X_label = document.createElement('th');
6470
- el_attr_td_X_label.style.cssText = 'width:10px';
6471
- var el_attr_name_label = document.createElement('label');
6472
- el_attr_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
6473
- el_attr_name_label.innerHTML = "Name";
6474
-
6475
- var el_attr_value_label = document.createElement('label');
6476
- el_attr_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
6477
- el_attr_value_label.innerHTML = "Value";
6478
-
6479
- el_attr_table.appendChild(el_attr_tr_label);
6480
- el_attr_tr_label.appendChild(el_attr_td_name_label);
6481
- el_attr_tr_label.appendChild(el_attr_td_value_label);
6482
- el_attr_tr_label.appendChild(el_attr_td_X_label);
6483
- el_attr_td_name_label.appendChild(el_attr_name_label);
6484
- el_attr_td_value_label.appendChild(el_attr_value_label);
6485
-
6486
- n=w_attr_name.length;
6487
- for(j=1; j<=n; j++)
6488
- {
6489
- var el_attr_tr = document.createElement('tr');
6490
- el_attr_tr.setAttribute("id", "attr_row_"+j);
6491
- el_attr_tr.setAttribute("idi", j);
6492
- var el_attr_td_name = document.createElement('td');
6493
- el_attr_td_name.style.cssText = 'width:100px';
6494
- var el_attr_td_value = document.createElement('td');
6495
- el_attr_td_value.style.cssText = 'width:100px';
6496
-
6497
- var el_attr_td_X = document.createElement('td');
6498
- var el_attr_name = document.createElement('input');
6499
-
6500
- el_attr_name.setAttribute("type", "text");
6501
-
6502
- el_attr_name.style.cssText = "width:100px";
6503
- el_attr_name.setAttribute("value", w_attr_name[j-1]);
6504
- el_attr_name.setAttribute("id", "attr_name"+j);
6505
- el_attr_name.setAttribute("onChange", "change_attribute_name("+i+", this, 'type_address')");
6506
-
6507
- var el_attr_value = document.createElement('input');
6508
-
6509
- el_attr_value.setAttribute("type", "text");
6510
-
6511
- el_attr_value.style.cssText = "width:100px";
6512
- el_attr_value.setAttribute("value", w_attr_value[j-1]);
6513
- el_attr_value.setAttribute("id", "attr_value"+j);
6514
- el_attr_value.setAttribute("onChange", "change_attribute_value("+i+", "+j+", 'type_address')");
6515
-
6516
- var el_attr_remove = document.createElement('img');
6517
- el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
6518
- el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
6519
- el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
6520
- el_attr_remove.setAttribute("align", 'top');
6521
- el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", 'type_address')");
6522
- el_attr_table.appendChild(el_attr_tr);
6523
- el_attr_tr.appendChild(el_attr_td_name);
6524
- el_attr_tr.appendChild(el_attr_td_value);
6525
- el_attr_tr.appendChild(el_attr_td_X);
6526
- el_attr_td_name.appendChild(el_attr_name);
6527
- el_attr_td_value.appendChild(el_attr_value);
6528
- el_attr_td_X.appendChild(el_attr_remove);
6529
-
6530
- }
6531
-
6532
-
6533
- var t = document.getElementById('edit_table');
6534
-
6535
- var br = document.createElement('br');
6536
- var br1 = document.createElement('br');
6537
- var br2 = document.createElement('br');
6538
- var br3 = document.createElement('br');
6539
- var br4 = document.createElement('br');
6540
- var br5 = document.createElement('br');
6541
- var br6 = document.createElement('br');
6542
-
6543
- edit_main_td1.appendChild(el_label_label);
6544
- edit_main_td1_1.appendChild(el_label_textarea);
6545
-
6546
- edit_main_td2.appendChild(el_label_position_label);
6547
- edit_main_td2_1.appendChild(el_label_position1);
6548
- edit_main_td2_1.appendChild(Left);
6549
- edit_main_td2_1.appendChild(br2);
6550
- edit_main_td2_1.appendChild(el_label_position2);
6551
- edit_main_td2_1.appendChild(Top);
6552
-
6553
- edit_main_td7.appendChild(el_size_label);
6554
- edit_main_td7_1.appendChild(el_size);
6555
-
6556
- /*edit_main_td3.appendChild(el_format_label);
6557
- edit_main_td3.appendChild(br5);
6558
- edit_main_td3.appendChild(el_format_normal);
6559
- edit_main_td3.appendChild(Normal);
6560
- edit_main_td3.appendChild(br6);
6561
- edit_main_td3.appendChild(el_format_extended);
6562
- edit_main_td3.appendChild(Extended);*/
6563
-
6564
- edit_main_td4.appendChild(el_style_label);
6565
- edit_main_td4_1.appendChild(el_style_textarea);
6566
-
6567
- edit_main_td5.appendChild(el_required_label);
6568
- edit_main_td5_1.appendChild(el_required);
6569
-
6570
- /* edit_main_td8.appendChild(el_unique_label);
6571
- edit_main_td8.appendChild(el_unique);*/
6572
-
6573
- edit_main_td6.appendChild(el_attr_label);
6574
- edit_main_td6.appendChild(el_attr_add);
6575
- edit_main_td6.appendChild(br3);
6576
- edit_main_td6.appendChild(el_attr_table);
6577
- edit_main_td6.setAttribute("colspan", "2");
6578
-
6579
- edit_main_tr1.appendChild(edit_main_td1);
6580
- edit_main_tr1.appendChild(edit_main_td1_1);
6581
- edit_main_tr2.appendChild(edit_main_td2);
6582
- edit_main_tr2.appendChild(edit_main_td2_1);
6583
- edit_main_tr7.appendChild(edit_main_td7);
6584
- edit_main_tr7.appendChild(edit_main_td7_1);
6585
- //edit_main_tr3.appendChild(edit_main_td3);
6586
- edit_main_tr4.appendChild(edit_main_td4);
6587
- edit_main_tr4.appendChild(edit_main_td4_1);
6588
- edit_main_tr5.appendChild(edit_main_td5);
6589
- edit_main_tr5.appendChild(edit_main_td5_1);
6590
- edit_main_tr6.appendChild(edit_main_td6);
6591
- edit_main_tr6.appendChild(edit_main_td6_1);
6592
- //edit_main_tr8.appendChild(edit_main_td8);
6593
- edit_main_table.appendChild(edit_main_tr1);
6594
- edit_main_table.appendChild(edit_main_tr2);
6595
- edit_main_table.appendChild(edit_main_tr7);
6596
- //edit_main_table.appendChild(edit_main_tr3);
6597
- edit_main_table.appendChild(edit_main_tr4);
6598
- edit_main_table.appendChild(edit_main_tr5);
6599
- //edit_main_table.appendChild(edit_main_tr8);
6600
- edit_main_table.appendChild(edit_main_tr6);
6601
- edit_div.appendChild(edit_main_table);
6602
-
6603
- t.appendChild(edit_div);
6604
- add_id_and_name(i, 'type_address');
6605
-
6606
- //show table
6607
-
6608
- var adding_type = document.createElement("input");
6609
- adding_type.setAttribute("type", "hidden");
6610
- adding_type.setAttribute("value", "type_address");
6611
- adding_type.setAttribute("name", i+"_typeform_id_temp");
6612
- adding_type.setAttribute("id", i+"_typeform_id_temp");
6613
- var adding_required= document.createElement("input");
6614
- adding_required.setAttribute("type", "hidden");
6615
- adding_required.setAttribute("value", w_required);
6616
- adding_required.setAttribute("name", i+"_requiredform_id_temp");
6617
- adding_required.setAttribute("id", i+"_requiredform_id_temp");
6618
-
6619
-
6620
- var div = document.createElement('div');
6621
- div.setAttribute("id", "main_div");
6622
-
6623
- var table = document.createElement('table');
6624
- table.setAttribute("id", i+"_elemet_tableform_id_temp");
6625
-
6626
-
6627
- var tr = document.createElement('tr');
6628
-
6629
- var td1 = document.createElement('td');
6630
- td1.setAttribute("valign", 'top');
6631
- td1.setAttribute("align", 'left');
6632
- td1.setAttribute("id", i+"_label_sectionform_id_temp");
6633
-
6634
- var td2 = document.createElement('td');
6635
- td2.setAttribute("valign", 'top');
6636
- td2.setAttribute("align", 'left');
6637
- td2.setAttribute("id", i+"_element_sectionform_id_temp");
6638
-
6639
- var div_address = document.createElement('div');
6640
- div_address.setAttribute("id", i+"_div_address");
6641
- div_address.style.cssText = "width:"+w_size+"px";
6642
-
6643
- var span_addres1 = document.createElement('span');
6644
- span_addres1.style.cssText = "float:left; width:100%; padding-bottom: 8px; display:block";
6645
-
6646
- var span_addres2 = document.createElement('span');
6647
- span_addres2.style.cssText = "float:left; width:100%; padding-bottom: 8px; display:block";
6648
-
6649
- var span_addres3_1 = document.createElement('span');
6650
- span_addres3_1.style.cssText = "float:left; width:48%; padding-bottom: 8px;";
6651
-
6652
- var span_addres3_2 = document.createElement('span');
6653
- span_addres3_2.style.cssText = "float:right; width:48%; padding-bottom: 8px;";
6654
-
6655
- var span_addres4_1 = document.createElement('span');
6656
- span_addres4_1.style.cssText = "float:left; width:48%; padding-bottom: 8px;";
6657
-
6658
- var span_addres4_2 = document.createElement('span');
6659
- span_addres4_2.style.cssText = "float:right; width:48%; padding-bottom: 8px;";
6660
-
6661
-
6662
- var br1 = document.createElement('br');
6663
- var br2 = document.createElement('br');
6664
- var br3 = document.createElement('br');
6665
- var br4 = document.createElement('br');
6666
-
6667
-
6668
- var label = document.createElement('span');
6669
- label.setAttribute("id", i+"_element_labelform_id_temp");
6670
- label.innerHTML = w_field_label;
6671
- label.setAttribute("class", "label");
6672
-
6673
- var required = document.createElement('span');
6674
- required.setAttribute("id", i+"_required_elementform_id_temp");
6675
- required.innerHTML = "";
6676
- required.setAttribute("class", "required");
6677
- if(w_required=="yes")
6678
- required.innerHTML = " *";
6679
-
6680
- var street1 = document.createElement('input');
6681
- street1.setAttribute("type", 'text');
6682
- street1.style.cssText = "width:100%";
6683
- street1.setAttribute("id", i+"_street1form_id_temp");
6684
- street1.setAttribute("name", i+"_street1form_id_temp");
6685
- street1.setAttribute("onChange", "change_value('"+i+"_street1form_id_temp')");
6686
-
6687
- var street1_label = document.createElement('label');
6688
- street1_label.setAttribute("class", "mini_label");
6689
- street1_label.style.cssText = "display:block;";
6690
- street1_label.innerHTML="<!--repstart-->Street Address<!--repend-->";
6691
-
6692
- var street2 = document.createElement('input');
6693
- street2.setAttribute("type", 'text');
6694
- street2.style.cssText = "width:100%";
6695
- street2.setAttribute("id", i+"_street2form_id_temp");
6696
- street2.setAttribute("name", (parseInt(i)+1)+"_street2form_id_temp");
6697
- street2.setAttribute("onChange", "change_value('"+i+"_street2form_id_temp')");
6698
-
6699
- var street2_label = document.createElement('label');
6700
- street2_label.setAttribute("class", "mini_label");
6701
- street2_label.style.cssText = "display:block;";
6702
- street2_label.innerHTML="<!--repstart-->Street Address Line 2<!--repend-->";
6703
-
6704
- var city = document.createElement('input');
6705
- city.setAttribute("type", 'text');
6706
- city.style.cssText = "width:100%";
6707
- city.setAttribute("id", i+"_cityform_id_temp");
6708
- city.setAttribute("name", (parseInt(i)+2)+"_cityform_id_temp");
6709
- city.setAttribute("onChange", "change_value('"+i+"_cityform_id_temp')");
6710
-
6711
- var city_label = document.createElement('label');
6712
- city_label.setAttribute("class", "mini_label");
6713
- city_label.style.cssText = "display:block;";
6714
- city_label.innerHTML="<!--repstart-->City<!--repend-->";
6715
-
6716
- var state = document.createElement('input');
6717
- state.setAttribute("type", 'text');
6718
- state.style.cssText = "width:100%";
6719
- state.setAttribute("id", i+"_stateform_id_temp");
6720
- state.setAttribute("name", (parseInt(i)+3)+"_stateform_id_temp");
6721
- state.setAttribute("onChange", "change_value('"+i+"_stateform_id_temp')");
6722
-
6723
- var state_label = document.createElement('label');
6724
- state_label.setAttribute("class", "mini_label");
6725
- state_label.style.cssText = "display:block;";
6726
- state_label.innerHTML="<!--repstart-->State / Province / Region<!--repend-->";
6727
-
6728
-
6729
-
6730
- var postal = document.createElement('input');
6731
- postal.setAttribute("type", 'text');
6732
- postal.style.cssText = "width:100%";
6733
- postal.setAttribute("id", i+"_postalform_id_temp");
6734
- postal.setAttribute("name", (parseInt(i)+4)+"_postalform_id_temp");
6735
- postal.setAttribute("onChange", "change_value('"+i+"_postalform_id_temp')");
6736
-
6737
- var postal_label = document.createElement('label');
6738
- postal_label.setAttribute("class", "mini_label");
6739
- postal_label.style.cssText = "display:block;";
6740
- postal_label.innerHTML="<!--repstart-->Postal / Zip Code<!--repend-->";
6741
-
6742
- var country = document.createElement('select');
6743
- country.setAttribute("type", 'text');
6744
- country.style.cssText = "width:100%";
6745
- country.setAttribute("id", i+"_countryform_id_temp");
6746
- country.setAttribute("name", (parseInt(i)+5)+"_countryform_id_temp");
6747
- country.setAttribute("onChange", "change_value('"+i+"_countryform_id_temp')");
6748
-
6749
- var country_label = document.createElement('label');
6750
- country_label.setAttribute("class", "mini_label");
6751
- country_label.style.cssText = "display:block;";
6752
- country_label.innerHTML="<!--repstart-->Country<!--repend-->";
6753
-
6754
-
6755
- var option_ = document.createElement('option');
6756
- option_.setAttribute("value", "");
6757
- option_.innerHTML="";
6758
- country.appendChild(option_);
6759
-
6760
- 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"];
6761
- for(r=0;r<coutries.length;r++)
6762
- {
6763
- var option_ = document.createElement('option');
6764
- option_.setAttribute("value", coutries[r]);
6765
- option_.innerHTML=coutries[r];
6766
- country.appendChild(option_);
6767
- }
6768
-
6769
-
6770
-
6771
-
6772
-
6773
-
6774
-
6775
-
6776
-
6777
- var main_td = document.getElementById('show_table');
6778
-
6779
- td1.appendChild(label);
6780
- td1.appendChild(required );
6781
-
6782
-
6783
- span_addres1.appendChild(street1);
6784
- span_addres1.appendChild(street1_label);
6785
-
6786
- span_addres2.appendChild(street2);
6787
- span_addres2.appendChild(street2_label);
6788
-
6789
- span_addres3_1.appendChild(city);
6790
- span_addres3_1.appendChild(city_label);
6791
- span_addres3_2.appendChild(state);
6792
- span_addres3_2.appendChild(state_label);
6793
-
6794
-
6795
- span_addres4_1.appendChild(postal);
6796
- span_addres4_1.appendChild(postal_label);
6797
- span_addres4_2.appendChild(country);
6798
- span_addres4_2.appendChild(country_label);
6799
-
6800
-
6801
- div_address.appendChild(span_addres1);
6802
- div_address.appendChild(span_addres2);
6803
- div_address.appendChild(span_addres3_1);
6804
- div_address.appendChild(span_addres3_2);
6805
- div_address.appendChild(span_addres4_1);
6806
- div_address.appendChild(span_addres4_2);
6807
-
6808
-
6809
- td2.appendChild(adding_type);
6810
- td2.appendChild(adding_required);
6811
- td2.appendChild(div_address);
6812
- tr.appendChild(td1);
6813
- tr.appendChild(td2);
6814
- table.appendChild(tr);
6815
-
6816
- div.appendChild(table);
6817
- div.appendChild(br3);
6818
- main_td.appendChild(div);
6819
-
6820
- if(w_field_label_pos=="top")
6821
- label_top(i);
6822
- change_class(w_class, i);
6823
- refresh_attr(i, 'type_address');
6824
- }
6825
-
6826
- function type_submitter_mail(i, w_field_label, w_field_label_pos, w_size, w_first_val, w_title, w_send, w_required, w_unique, w_class, w_attr_name, w_attr_value){
6827
- document.getElementById("element_type").value="type_submitter_mail";
6828
-
6829
- delete_last_child();
6830
- // edit table
6831
- var edit_div = document.createElement('div');
6832
- edit_div.setAttribute("id", "edit_div");
6833
- edit_div.setAttribute("style", "border-top:1px dotted black;padding:10px; padding-top:0px; padding-bottom:0px; margin-top:10px;");
6834
-
6835
- var edit_main_table = document.createElement('table');
6836
- edit_main_table.setAttribute("id", "edit_main_table");
6837
- edit_main_table.setAttribute("cellpadding", "0");
6838
- edit_main_table.setAttribute("cellspacing", "0");
6839
-
6840
- var edit_main_tr1 = document.createElement('tr');
6841
- edit_main_tr1.setAttribute("valing", "top");
6842
-
6843
- var edit_main_tr2 = document.createElement('tr');
6844
- edit_main_tr2.setAttribute("valing", "top");
6845
-
6846
- var edit_main_tr3 = document.createElement('tr');
6847
- edit_main_tr3.setAttribute("valing", "top");
6848
-
6849
- var edit_main_tr4 = document.createElement('tr');
6850
- edit_main_tr4.setAttribute("valing", "top");
6851
-
6852
- var edit_main_tr5 = document.createElement('tr');
6853
- edit_main_tr5.setAttribute("valing", "top");
6854
-
6855
- var edit_main_tr6 = document.createElement('tr');
6856
- edit_main_tr6.setAttribute("valing", "top");
6857
- var edit_main_tr7 = document.createElement('tr');
6858
- edit_main_tr7.setAttribute("valing", "top");
6859
-
6860
- var edit_main_tr8 = document.createElement('tr');
6861
- edit_main_tr8.setAttribute("valing", "top");
6862
-
6863
- var edit_main_tr9 = document.createElement('tr');
6864
- edit_main_tr9.setAttribute("valing", "top");
6865
-
6866
- var edit_main_td1 = document.createElement('td');
6867
- edit_main_td1.style.cssText = "padding-top:10px";
6868
- var edit_main_td1_1 = document.createElement('td');
6869
- edit_main_td1_1.style.cssText = "padding-top:10px";
6870
- var edit_main_td2 = document.createElement('td');
6871
- edit_main_td2.style.cssText = "padding-top:10px";
6872
- var edit_main_td2_1 = document.createElement('td');
6873
- edit_main_td2_1.style.cssText = "padding-top:10px";
6874
-
6875
- var edit_main_td3 = document.createElement('td');
6876
- edit_main_td3.style.cssText = "padding-top:10px";
6877
- var edit_main_td3_1 = document.createElement('td');
6878
- edit_main_td3_1.style.cssText = "padding-top:10px";
6879
- var edit_main_td4 = document.createElement('td');
6880
- edit_main_td4.style.cssText = "padding-top:10px";
6881
- var edit_main_td4_1 = document.createElement('td');
6882
- edit_main_td4_1.style.cssText = "padding-top:10px";
6883
-
6884
- var edit_main_td5 = document.createElement('td');
6885
- edit_main_td5.style.cssText = "padding-top:10px";
6886
- var edit_main_td5_1 = document.createElement('td');
6887
- edit_main_td5_1.style.cssText = "padding-top:10px";
6888
-
6889
- var edit_main_td6 = document.createElement('td');
6890
- edit_main_td6.style.cssText = "padding-top:10px";
6891
- var edit_main_td6_1 = document.createElement('td');
6892
- edit_main_td6_1.style.cssText = "padding-top:10px";
6893
- var edit_main_td7 = document.createElement('td');
6894
- edit_main_td7.style.cssText = "padding-top:10px";
6895
- var edit_main_td7_1 = document.createElement('td');
6896
- edit_main_td7_1.style.cssText = "padding-top:10px";
6897
- var edit_main_td8 = document.createElement('td');
6898
- edit_main_td8.style.cssText = "padding-top:10px";
6899
- var edit_main_td8_1 = document.createElement('td');
6900
- edit_main_td8_1.style.cssText = "padding-top:10px";
6901
-
6902
- var edit_main_td9 = document.createElement('td');
6903
- edit_main_td9.style.cssText = "padding-top:10px";
6904
- var edit_main_td9_1 = document.createElement('td');
6905
- edit_main_td9_1.style.cssText = "padding-top:10px";
6906
-
6907
- var el_label_label = document.createElement('label');
6908
- el_label_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
6909
- el_label_label.innerHTML = "Field label";
6910
-
6911
- var el_label_textarea = document.createElement('textarea');
6912
- el_label_textarea.setAttribute("id", "edit_for_label");
6913
- el_label_textarea.setAttribute("rows", "4");
6914
- el_label_textarea.style.cssText = "width:200px";
6915
- el_label_textarea.setAttribute("onKeyUp", "change_label('"+i+"_element_labelform_id_temp', this.value)");
6916
- el_label_textarea.innerHTML = w_field_label;
6917
-
6918
- var el_label_position_label = document.createElement('label');
6919
- el_label_position_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
6920
- el_label_position_label.innerHTML = "Field label position";
6921
-
6922
- var el_label_position1 = document.createElement('input');
6923
- el_label_position1.setAttribute("id", "edit_for_label_position_top");
6924
- el_label_position1.setAttribute("type", "radio");
6925
- el_label_position1.setAttribute("value", "left");
6926
-
6927
- el_label_position1.setAttribute("name", "edit_for_label_position");
6928
- el_label_position1.setAttribute("onchange", "label_left("+i+")");
6929
- Left = document.createTextNode("Left");
6930
-
6931
- var el_label_position2 = document.createElement('input');
6932
- el_label_position2.setAttribute("id", "edit_for_label_position_left");
6933
- el_label_position2.setAttribute("type", "radio");
6934
- el_label_position2.setAttribute("value", "top");
6935
-
6936
- el_label_position2.setAttribute("name", "edit_for_label_position");
6937
- el_label_position2.setAttribute("onchange", "label_top("+i+")");
6938
- Top = document.createTextNode("Top");
6939
-
6940
- if(w_field_label_pos=="top")
6941
- el_label_position2.setAttribute("checked", "checked");
6942
- else
6943
- el_label_position1.setAttribute("checked", "checked");
6944
-
6945
- var el_size_label = document.createElement('label');
6946
- el_size_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
6947
- el_size_label.innerHTML = "Field size(px) ";
6948
- var el_size = document.createElement('input');
6949
- el_size.setAttribute("id", "edit_for_input_size");
6950
- el_size.setAttribute("type", "text");
6951
- el_size.setAttribute("value", w_size);
6952
-
6953
- el_size.setAttribute("name", "edit_for_size");
6954
- el_size.setAttribute("onKeyPress", "return check_isnum(event)");
6955
- el_size.setAttribute("onKeyUp", "change_w_style('"+i+"_elementform_id_temp', this.value)");
6956
-
6957
- var el_first_value_label = document.createElement('label');
6958
- el_first_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
6959
- el_first_value_label.innerHTML = "Value if empty";
6960
-
6961
- var el_first_value_input = document.createElement('input');
6962
- el_first_value_input.setAttribute("id", "el_first_value_input");
6963
- el_first_value_input.setAttribute("type", "text");
6964
- el_first_value_input.setAttribute("value", w_title);
6965
- el_first_value_input.style.cssText = "width:150px;";
6966
- el_first_value_input.setAttribute("onKeyUp", "change_input_value(this.value,'"+i+"_elementform_id_temp')");
6967
-
6968
- var el_style_label = document.createElement('label');
6969
- el_style_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
6970
- el_style_label.innerHTML = "Class name";
6971
-
6972
- var el_style_textarea = document.createElement('input');
6973
- el_style_textarea.setAttribute("id", "element_style");
6974
- el_style_textarea.setAttribute("type", "text");
6975
- el_style_textarea.setAttribute("value", w_class);
6976
- el_style_textarea.style.cssText = "width:200px;";
6977
- el_style_textarea.setAttribute("onChange", "change_class(this.value,'"+i+"')");
6978
-
6979
-
6980
- var el_send_label = document.createElement('label');
6981
- el_send_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
6982
- el_send_label.innerHTML = "Send mail to submitter ";
6983
-
6984
- var el_send = document.createElement('input');
6985
- el_send.setAttribute("id", "el_send");
6986
- el_send.setAttribute("type", "checkbox");
6987
- el_send.setAttribute("value", "yes");
6988
- el_send.setAttribute("onclick", "set_send('"+i+"_sendform_id_temp')");
6989
- if(w_send=="yes")
6990
-
6991
- el_send.setAttribute("checked", "checked");
6992
-
6993
-
6994
-
6995
-
6996
-
6997
- var el_required_label = document.createElement('label');
6998
- el_required_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
6999
- el_required_label.innerHTML = "Required";
7000
-
7001
- var el_required = document.createElement('input');
7002
- el_required.setAttribute("id", "el_send");
7003
- el_required.setAttribute("type", "checkbox");
7004
- el_required.setAttribute("value", "yes");
7005
- el_required.setAttribute("onclick", "set_required('"+i+"_required')");
7006
- if(w_required=="yes")
7007
-
7008
- el_required.setAttribute("checked", "checked");
7009
-
7010
- var el_unique_label = document.createElement('label');
7011
- el_unique_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
7012
- el_unique_label.innerHTML = "Allow only unique values";
7013
-
7014
- var el_unique = document.createElement('input');
7015
- el_unique.setAttribute("id", "el_send");
7016
- el_unique.setAttribute("type", "checkbox");
7017
- el_unique.setAttribute("value", "yes");
7018
- el_unique.setAttribute("onclick", "set_unique('"+i+"_uniqueform_id_temp')");
7019
- if(w_unique=="yes")
7020
- el_unique.setAttribute("checked", "checked");
7021
-
7022
- var el_attr_label = document.createElement('label');
7023
- el_attr_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
7024
- el_attr_label.innerHTML = "Additional Attributes";
7025
- var el_attr_add = document.createElement('img');
7026
- el_attr_add.setAttribute("id", "el_choices_add");
7027
- el_attr_add.setAttribute("src", plugin_url+'/images/add.png');
7028
- el_attr_add.style.cssText = 'cursor:pointer; margin-left:68px';
7029
- el_attr_add.setAttribute("title", 'add');
7030
- el_attr_add.setAttribute("onClick", "add_attr("+i+", 'type_text')");
7031
- var el_attr_table = document.createElement('table');
7032
- el_attr_table.setAttribute("id", 'attributes');
7033
- el_attr_table.setAttribute("border", '0');
7034
- el_attr_table.style.cssText = 'margin-left:0px';
7035
- var el_attr_tr_label = document.createElement('tr');
7036
- el_attr_tr_label.setAttribute("idi", '0');
7037
- var el_attr_td_name_label = document.createElement('th');
7038
- el_attr_td_name_label.style.cssText = 'width:100px';
7039
- var el_attr_td_value_label = document.createElement('th');
7040
- el_attr_td_value_label.style.cssText = 'width:100px';
7041
- var el_attr_td_X_label = document.createElement('th');
7042
- el_attr_td_X_label.style.cssText = 'width:10px';
7043
- var el_attr_name_label = document.createElement('label');
7044
- el_attr_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
7045
- el_attr_name_label.innerHTML = "Name";
7046
-
7047
- var el_attr_value_label = document.createElement('label');
7048
- el_attr_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
7049
- el_attr_value_label.innerHTML = "Value";
7050
-
7051
- el_attr_table.appendChild(el_attr_tr_label);
7052
- el_attr_tr_label.appendChild(el_attr_td_name_label);
7053
- el_attr_tr_label.appendChild(el_attr_td_value_label);
7054
- el_attr_tr_label.appendChild(el_attr_td_X_label);
7055
- el_attr_td_name_label.appendChild(el_attr_name_label);
7056
- el_attr_td_value_label.appendChild(el_attr_value_label);
7057
-
7058
- n=w_attr_name.length;
7059
- for(j=1; j<=n; j++)
7060
- {
7061
- var el_attr_tr = document.createElement('tr');
7062
- el_attr_tr.setAttribute("id", "attr_row_"+j);
7063
- el_attr_tr.setAttribute("idi", j);
7064
- var el_attr_td_name = document.createElement('td');
7065
- el_attr_td_name.style.cssText = 'width:100px';
7066
- var el_attr_td_value = document.createElement('td');
7067
- el_attr_td_value.style.cssText = 'width:100px';
7068
-
7069
- var el_attr_td_X = document.createElement('td');
7070
- var el_attr_name = document.createElement('input');
7071
-
7072
- el_attr_name.setAttribute("type", "text");
7073
-
7074
- el_attr_name.style.cssText = "width:100px";
7075
- el_attr_name.setAttribute("value", w_attr_name[j-1]);
7076
- el_attr_name.setAttribute("id", "attr_name"+j);
7077
- el_attr_name.setAttribute("onChange", "change_attribute_name("+i+", this, 'type_text')");
7078
-
7079
- var el_attr_value = document.createElement('input');
7080
-
7081
- el_attr_value.setAttribute("type", "text");
7082
-
7083
- el_attr_value.style.cssText = "width:100px";
7084
- el_attr_value.setAttribute("value", w_attr_value[j-1]);
7085
- el_attr_value.setAttribute("id", "attr_value"+j);
7086
- el_attr_value.setAttribute("onChange", "change_attribute_value("+i+", "+j+", 'type_text')");
7087
-
7088
- var el_attr_remove = document.createElement('img');
7089
- el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
7090
- el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
7091
- el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
7092
- el_attr_remove.setAttribute("align", 'top');
7093
- el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", 'type_text')");
7094
- el_attr_table.appendChild(el_attr_tr);
7095
- el_attr_tr.appendChild(el_attr_td_name);
7096
- el_attr_tr.appendChild(el_attr_td_value);
7097
- el_attr_tr.appendChild(el_attr_td_X);
7098
- el_attr_td_name.appendChild(el_attr_name);
7099
- el_attr_td_value.appendChild(el_attr_value);
7100
- el_attr_td_X.appendChild(el_attr_remove);
7101
-
7102
- }
7103
-
7104
- var t = document.getElementById('edit_table');
7105
-
7106
- var br = document.createElement('br');
7107
- var br1 = document.createElement('br');
7108
- var br2 = document.createElement('br');
7109
- var br3 = document.createElement('br');
7110
- var br4 = document.createElement('br');
7111
- var br5 = document.createElement('br');
7112
- var br6 = document.createElement('br');
7113
-
7114
- edit_main_td1.appendChild(el_label_label);
7115
- edit_main_td1_1.appendChild(el_label_textarea);
7116
-
7117
- edit_main_td2.appendChild(el_label_position_label);
7118
- edit_main_td2_1.appendChild(el_label_position1);
7119
- edit_main_td2_1.appendChild(Left);
7120
- edit_main_td2_1.appendChild(br2);
7121
- edit_main_td2_1.appendChild(el_label_position2);
7122
- edit_main_td2_1.appendChild(Top);
7123
-
7124
- edit_main_td3.appendChild(el_size_label);
7125
- edit_main_td3_1.appendChild(el_size);
7126
-
7127
- edit_main_td4.appendChild(el_first_value_label);
7128
- edit_main_td4_1.appendChild(el_first_value_input);
7129
-
7130
- edit_main_td5.appendChild(el_style_label);
7131
- edit_main_td5_1.appendChild(el_style_textarea);
7132
-
7133
- edit_main_td6.appendChild(el_send_label);
7134
- edit_main_td6_1.appendChild(el_send);
7135
-
7136
- edit_main_td7.appendChild(el_required_label);
7137
- edit_main_td7_1.appendChild(el_required);
7138
-
7139
- edit_main_td9.appendChild(el_unique_label);
7140
- edit_main_td9_1.appendChild(el_unique);
7141
-
7142
- edit_main_td8.appendChild(el_attr_label);
7143
- edit_main_td8.appendChild(el_attr_add);
7144
- edit_main_td8.appendChild(br4);
7145
- edit_main_td8.appendChild(el_attr_table);
7146
- edit_main_td8.setAttribute("colspan", "2");
7147
-
7148
- /* edit_main_td5.appendChild(el_guidelines_label);
7149
- edit_main_td5.appendChild(br4);
7150
- edit_main_td5.appendChild(el_guidelines_textarea);
7151
- */
7152
- edit_main_tr1.appendChild(edit_main_td1);
7153
- edit_main_tr1.appendChild(edit_main_td1_1);
7154
- edit_main_tr2.appendChild(edit_main_td2);
7155
- edit_main_tr2.appendChild(edit_main_td2_1);
7156
- edit_main_tr3.appendChild(edit_main_td3);
7157
- edit_main_tr3.appendChild(edit_main_td3_1);
7158
- edit_main_tr4.appendChild(edit_main_td4);
7159
- edit_main_tr4.appendChild(edit_main_td4_1);
7160
- edit_main_tr5.appendChild(edit_main_td5);
7161
- edit_main_tr5.appendChild(edit_main_td5_1);
7162
-
7163
- edit_main_tr6.appendChild(edit_main_td6);
7164
- edit_main_tr6.appendChild(edit_main_td6_1);
7165
- edit_main_tr7.appendChild(edit_main_td7);
7166
- edit_main_tr7.appendChild(edit_main_td7_1);
7167
- edit_main_tr9.appendChild(edit_main_td9);
7168
- edit_main_tr9.appendChild(edit_main_td9_1);
7169
- edit_main_tr8.appendChild(edit_main_td8);
7170
- edit_main_tr8.appendChild(edit_main_td8_1);
7171
- edit_main_table.appendChild(edit_main_tr1);
7172
- edit_main_table.appendChild(edit_main_tr2);
7173
- edit_main_table.appendChild(edit_main_tr3);
7174
- edit_main_table.appendChild(edit_main_tr4);
7175
- edit_main_table.appendChild(edit_main_tr5);
7176
-
7177
- edit_main_table.appendChild(edit_main_tr6);
7178
- edit_main_table.appendChild(edit_main_tr7);
7179
- edit_main_table.appendChild(edit_main_tr9);
7180
- edit_main_table.appendChild(edit_main_tr8);
7181
- edit_div.appendChild(edit_main_table);
7182
-
7183
- t.appendChild(edit_div);
7184
- add_id_and_name(i, 'type_text');
7185
-
7186
- //show table
7187
-
7188
- element='input'; type='text';
7189
- var adding_type = document.createElement("input");
7190
- adding_type.setAttribute("type", "hidden");
7191
- adding_type.setAttribute("value", "type_submitter_mail");
7192
- adding_type.setAttribute("name", i+"_typeform_id_temp");
7193
- adding_type.setAttribute("id", i+"_typeform_id_temp");
7194
-
7195
- var adding_required = document.createElement("input");
7196
- adding_required.setAttribute("type", "hidden");
7197
- adding_required.setAttribute("value", w_required);
7198
- adding_required.setAttribute("name", i+"_requiredform_id_temp");
7199
- adding_required.setAttribute("id", i+"_requiredform_id_temp");
7200
-
7201
- var adding_send = document.createElement("input");
7202
- adding_send.setAttribute("type", "hidden");
7203
- adding_send.setAttribute("value", w_send);
7204
- adding_send.setAttribute("name", i+"_sendform_id_temp");
7205
- adding_send.setAttribute("id", i+"_sendform_id_temp");
7206
-
7207
- var adding_unique= document.createElement("input");
7208
- adding_unique.setAttribute("type", "hidden");
7209
- adding_unique.setAttribute("value", w_unique);
7210
- adding_unique.setAttribute("name", i+"_uniqueform_id_temp");
7211
- adding_unique.setAttribute("id", i+"_uniqueform_id_temp");
7212
-
7213
- var adding = document.createElement(element);
7214
- adding.setAttribute("type", type);
7215
-
7216
-
7217
- if(w_title==w_first_val)
7218
- {
7219
- adding.style.cssText = "width:"+w_size+"px;";
7220
- adding.setAttribute("class", "input_deactive");
7221
- }
7222
- else
7223
- {
7224
- adding.style.cssText = "width:"+w_size+"px;";
7225
- adding.setAttribute("class", "input_active");
7226
- }
7227
- adding.setAttribute("id", i+"_elementform_id_temp");
7228
- adding.setAttribute("name", i+"_elementform_id_temp");
7229
- adding.setAttribute("value", w_first_val);
7230
- adding.setAttribute("title", w_title);
7231
-
7232
- adding.setAttribute("onFocus", "delete_value('"+i+"_elementform_id_temp')");
7233
- adding.setAttribute("onBlur", "return_value('"+i+"_elementform_id_temp')");
7234
- adding.setAttribute("onChange", "change_value('"+i+"_elementform_id_temp')");
7235
-
7236
-
7237
- var div = document.createElement('div');
7238
- div.setAttribute("id", "main_div");
7239
-
7240
- var table = document.createElement('table');
7241
- table.setAttribute("id", i+"_elemet_tableform_id_temp");
7242
-
7243
- var tr = document.createElement('tr');
7244
-
7245
- var td1 = document.createElement('td');
7246
- td1.setAttribute("valign", 'middle');
7247
- td1.setAttribute("align", 'left');
7248
- td1.setAttribute("id", i+"_label_sectionform_id_temp");
7249
-
7250
- var td2 = document.createElement('td');
7251
- td2.setAttribute("valign", 'middle');
7252
- td2.setAttribute("align", 'left');
7253
- td2.setAttribute("id", i+"_element_sectionform_id_temp");
7254
-
7255
- var br1 = document.createElement('br');
7256
- var br2 = document.createElement('br');
7257
- var br3 = document.createElement('br');
7258
- var br4 = document.createElement('br');
7259
-
7260
-
7261
-
7262
- var label = document.createElement('span');
7263
- label.setAttribute("id", i+"_element_labelform_id_temp");
7264
- label.innerHTML = w_field_label;
7265
- label.setAttribute("class", "label");
7266
-
7267
- var required = document.createElement('span');
7268
- required.setAttribute("id", i+"_required_elementform_id_temp");
7269
- required.innerHTML = "";
7270
- required.setAttribute("class", "required");
7271
- if(w_required=="yes")
7272
- required.innerHTML = " *";
7273
- var main_td = document.getElementById('show_table');
7274
-
7275
- td1.appendChild(label);
7276
- td1.appendChild(required);
7277
- td2.appendChild(adding_type);
7278
- td2.appendChild(adding_required);
7279
- td2.appendChild(adding_send);
7280
- td2.appendChild(adding_unique);
7281
- td2.appendChild(adding);
7282
- tr.appendChild(td1);
7283
- tr.appendChild(td2);
7284
- table.appendChild(tr);
7285
-
7286
- div.appendChild(table);
7287
- div.appendChild(br3);
7288
- main_td.appendChild(div);
7289
- if(w_field_label_pos=="top")
7290
- label_top(i);
7291
- change_class(w_class, i);
7292
- refresh_attr(i, 'type_text');
7293
- }
7294
-
7295
- function type_checkbox(i, w_field_label, w_field_label_pos, w_flow, w_choices, w_choices_checked, w_required, w_randomize, w_allow_other,w_allow_other_num, w_class, w_attr_name, w_attr_value) {
7296
-
7297
- document.getElementById("element_type").value="type_checkbox";
7298
-
7299
- delete_last_child();
7300
- // edit table
7301
- var edit_div = document.createElement('div');
7302
- edit_div.setAttribute("id", "edit_div");
7303
- edit_div.setAttribute("style", "padding:10px; padding-top:0px; padding-bottom:0px; margin-top:10px;");
7304
-
7305
- var edit_main_table = document.createElement('table');
7306
- edit_main_table.setAttribute("id", "edit_main_table");
7307
- edit_main_table.setAttribute("cellpadding", "0");
7308
- edit_main_table.setAttribute("cellspacing", "0");
7309
-
7310
- var edit_main_tr1 = document.createElement('tr');
7311
- edit_main_tr1.setAttribute("valing", "top");
7312
-
7313
- var edit_main_tr2 = document.createElement('tr');
7314
- edit_main_tr2.setAttribute("valing", "top");
7315
-
7316
- var edit_main_tr3 = document.createElement('tr');
7317
- edit_main_tr3.setAttribute("valing", "top");
7318
-
7319
- var edit_main_tr4 = document.createElement('tr');
7320
- edit_main_tr4.setAttribute("valing", "top");
7321
-
7322
- var edit_main_tr5 = document.createElement('tr');
7323
- edit_main_tr5.setAttribute("valing", "top");
7324
-
7325
- var edit_main_tr6 = document.createElement('tr');
7326
- edit_main_tr6.setAttribute("valing", "top");
7327
- var edit_main_tr7 = document.createElement('tr');
7328
- edit_main_tr7.setAttribute("valing", "top");
7329
-
7330
- var edit_main_tr8 = document.createElement('tr');
7331
- edit_main_tr8.setAttribute("valing", "top");
7332
-
7333
- var edit_main_tr9 = document.createElement('tr');
7334
- edit_main_tr9.setAttribute("valing", "top");
7335
-
7336
- var edit_main_td1 = document.createElement('td');
7337
- edit_main_td1.style.cssText = "padding-top:10px";
7338
- var edit_main_td1_1 = document.createElement('td');
7339
- edit_main_td1_1.style.cssText = "padding-top:10px";
7340
- var edit_main_td2 = document.createElement('td');
7341
- edit_main_td2.style.cssText = "padding-top:10px";
7342
- var edit_main_td2_1 = document.createElement('td');
7343
- edit_main_td2_1.style.cssText = "padding-top:10px";
7344
-
7345
- var edit_main_td3 = document.createElement('td');
7346
- edit_main_td3.style.cssText = "padding-top:10px";
7347
- var edit_main_td3_1 = document.createElement('td');
7348
- edit_main_td3_1.style.cssText = "padding-top:10px";
7349
-
7350
-
7351
- var edit_main_td4 = document.createElement('td');
7352
- edit_main_td4.style.cssText = "padding-top:10px";
7353
- var edit_main_td4_1 = document.createElement('td');
7354
- edit_main_td4_1.style.cssText = "padding-top:10px";
7355
- edit_main_td4.setAttribute("id", "choices");
7356
- var edit_main_td5 = document.createElement('td');
7357
- edit_main_td5.style.cssText = "padding-top:10px";
7358
- var edit_main_td5_1 = document.createElement('td');
7359
- edit_main_td5_1.style.cssText = "padding-top:10px";
7360
-
7361
- var edit_main_td6 = document.createElement('td');
7362
- edit_main_td6.style.cssText = "padding-top:10px";
7363
- var edit_main_td6_1 = document.createElement('td');
7364
- edit_main_td6_1.style.cssText = "padding-top:10px";
7365
-
7366
- var edit_main_td7 = document.createElement('td');
7367
- edit_main_td7.style.cssText = "padding-top:10px";
7368
- var edit_main_td7_1 = document.createElement('td');
7369
- edit_main_td7_1.style.cssText = "padding-top:10px";
7370
-
7371
- var edit_main_td8 = document.createElement('td');
7372
- edit_main_td8.style.cssText = "padding-top:10px";
7373
- var edit_main_td8_1 = document.createElement('td');
7374
- edit_main_td8_1.style.cssText = "padding-top:10px";
7375
-
7376
- var edit_main_td9 = document.createElement('td');
7377
- edit_main_td9.style.cssText = "padding-top:10px";
7378
- var edit_main_td9_1 = document.createElement('td');
7379
- edit_main_td9_1.style.cssText = "padding-top:10px";
7380
-
7381
- var el_label_label = document.createElement('label');
7382
- el_label_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
7383
- el_label_label.innerHTML = "Field label";
7384
-
7385
- var el_label_textarea = document.createElement('textarea');
7386
- el_label_textarea.setAttribute("id", "edit_for_label");
7387
- el_label_textarea.setAttribute("rows", "4");
7388
- el_label_textarea.style.cssText = "width:200px;";
7389
- el_label_textarea.setAttribute("onKeyUp", "change_label('"+i+"_element_labelform_id_temp', this.value)");
7390
- el_label_textarea.innerHTML = w_field_label;
7391
-
7392
- var el_label_position_label = document.createElement('label');
7393
- el_label_position_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
7394
- el_label_position_label.innerHTML = "Field label position";
7395
-
7396
- var el_label_position1 = document.createElement('input');
7397
- el_label_position1.setAttribute("id", "edit_for_label_position_top");
7398
- el_label_position1.setAttribute("type", "radio");
7399
- el_label_position1.setAttribute("value", "left");
7400
-
7401
- el_label_position1.setAttribute("name", "edit_for_label_position");
7402
- el_label_position1.setAttribute("onchange", "label_left("+i+")");
7403
- Left = document.createTextNode("Left");
7404
-
7405
- var el_label_position2 = document.createElement('input');
7406
- el_label_position2.setAttribute("id", "edit_for_label_position_left");
7407
- el_label_position2.setAttribute("type", "radio");
7408
- el_label_position2.setAttribute("value", "top");
7409
-
7410
- el_label_position2.setAttribute("name", "edit_for_label_position");
7411
- el_label_position2.setAttribute("onchange", "label_top("+i+")");
7412
- Top = document.createTextNode("Top");
7413
-
7414
- if(w_field_label_pos=="top")
7415
-
7416
- el_label_position2.setAttribute("checked", "checked");
7417
- else
7418
- el_label_position1.setAttribute("checked", "checked");
7419
- var el_label_flow = document.createElement('label');
7420
- el_label_flow.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
7421
- el_label_flow.innerHTML = "Relative Position";
7422
-
7423
- var el_flow_vertical = document.createElement('input');
7424
- el_flow_vertical.setAttribute("id", "edit_for_flow_vertical");
7425
- el_flow_vertical.setAttribute("type", "radio");
7426
- el_flow_vertical.setAttribute("value", "ver");
7427
- el_flow_vertical.setAttribute("name", "edit_for_flow");
7428
- el_flow_vertical.setAttribute("onchange", "flow_ver("+i+")");
7429
- Vertical = document.createTextNode("Vertical");
7430
-
7431
- var el_flow_horizontal = document.createElement('input');
7432
- el_flow_horizontal.setAttribute("id", "edit_for_flow_horizontal");
7433
- el_flow_horizontal.setAttribute("type", "radio");
7434
- el_flow_horizontal.setAttribute("value", "hor");
7435
- el_flow_horizontal.setAttribute("name", "edit_for_flow");
7436
- el_flow_horizontal.setAttribute("onchange", "flow_hor("+i+")");
7437
- Horizontal = document.createTextNode("Horizontal");
7438
-
7439
- if(w_flow=="hor")
7440
- el_flow_horizontal.setAttribute("checked", "checked");
7441
- else
7442
- el_flow_vertical.setAttribute("checked", "checked");
7443
-
7444
-
7445
- var el_style_label = document.createElement('label');
7446
- el_style_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
7447
- el_style_label.innerHTML = "Class name";
7448
-
7449
- var el_style_textarea = document.createElement('input');
7450
- el_style_textarea.setAttribute("id", "element_style");
7451
- el_style_textarea.setAttribute("type", "text");
7452
- el_style_textarea.setAttribute("value", w_class);
7453
- el_style_textarea.style.cssText = "width:200px;";
7454
- el_style_textarea.setAttribute("onChange", "change_class(this.value,'"+i+"')");
7455
-
7456
- var el_required_label = document.createElement('label');
7457
- el_required_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
7458
- el_required_label.innerHTML = "Required";
7459
-
7460
- var el_required = document.createElement('input');
7461
- el_required.setAttribute("id", "el_send");
7462
- el_required.setAttribute("type", "checkbox");
7463
- el_required.setAttribute("value", "yes");
7464
- el_required.setAttribute("onclick", "set_required('"+i+"_required')");
7465
- if(w_required=="yes")
7466
-
7467
- el_required.setAttribute("checked", "checked");
7468
-
7469
-
7470
-
7471
- var el_randomize_label = document.createElement('label');
7472
- el_randomize_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
7473
- el_randomize_label.innerHTML = "Randomize in frontend";
7474
-
7475
- var el_randomize = document.createElement('input');
7476
- el_randomize.setAttribute("id", "el_randomize");
7477
- el_randomize.setAttribute("type", "checkbox");
7478
- el_randomize.setAttribute("value", "yes");
7479
- el_randomize.setAttribute("onclick", "set_randomize('"+i+"_randomizeform_id_temp')");
7480
- if(w_randomize=="yes")
7481
- el_randomize.setAttribute("checked", "checked");
7482
-
7483
- var el_allow_other_label = document.createElement('label');
7484
- el_allow_other_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
7485
- el_allow_other_label.innerHTML = "Allow other";
7486
-
7487
- var el_allow_other = document.createElement('input');
7488
- el_allow_other.setAttribute("id", "el_allow_other");
7489
- el_allow_other.setAttribute("type", "checkbox");
7490
- el_allow_other.setAttribute("value", "yes");
7491
- el_allow_other.setAttribute("onclick", "set_allow_other('"+i+"','checkbox')");
7492
- if(w_allow_other=="yes")
7493
- el_allow_other.setAttribute("checked", "checked");
7494
-
7495
-
7496
-
7497
-
7498
-
7499
- var el_attr_label = document.createElement('label');
7500
- el_attr_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
7501
- el_attr_label.innerHTML = "Additional Attributes";
7502
- var el_attr_add = document.createElement('img');
7503
- el_attr_add.setAttribute("id", "el_choices_add");
7504
- el_attr_add.setAttribute("src", plugin_url+'/images/add.png');
7505
- el_attr_add.style.cssText = 'cursor:pointer; margin-left:68px';
7506
- el_attr_add.setAttribute("title", 'add');
7507
- el_attr_add.setAttribute("onClick", "add_attr("+i+", 'type_checkbox')");
7508
- var el_attr_table = document.createElement('table');
7509
- el_attr_table.setAttribute("id", 'attributes');
7510
- el_attr_table.setAttribute("border", '0');
7511
- el_attr_table.style.cssText = 'margin-left:0px';
7512
- var el_attr_tr_label = document.createElement('tr');
7513
- el_attr_tr_label.setAttribute("idi", '0');
7514
- var el_attr_td_name_label = document.createElement('th');
7515
- el_attr_td_name_label.style.cssText = 'width:100px';
7516
- var el_attr_td_value_label = document.createElement('th');
7517
- el_attr_td_value_label.style.cssText = 'width:100px';
7518
- var el_attr_td_X_label = document.createElement('th');
7519
- el_attr_td_X_label.style.cssText = 'width:10px';
7520
- var el_attr_name_label = document.createElement('label');
7521
- el_attr_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
7522
- el_attr_name_label.innerHTML = "Name";
7523
-
7524
- var el_attr_value_label = document.createElement('label');
7525
- el_attr_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
7526
- el_attr_value_label.innerHTML = "Value";
7527
-
7528
- el_attr_table.appendChild(el_attr_tr_label);
7529
- el_attr_tr_label.appendChild(el_attr_td_name_label);
7530
- el_attr_tr_label.appendChild(el_attr_td_value_label);
7531
- el_attr_tr_label.appendChild(el_attr_td_X_label);
7532
- el_attr_td_name_label.appendChild(el_attr_name_label);
7533
- el_attr_td_value_label.appendChild(el_attr_value_label);
7534
-
7535
- n=w_attr_name.length;
7536
- for(j=1; j<=n; j++)
7537
- {
7538
- var el_attr_tr = document.createElement('tr');
7539
- el_attr_tr.setAttribute("id", "attr_row_"+j);
7540
- el_attr_tr.setAttribute("idi", j);
7541
- var el_attr_td_name = document.createElement('td');
7542
- el_attr_td_name.style.cssText = 'width:100px';
7543
- var el_attr_td_value = document.createElement('td');
7544
- el_attr_td_value.style.cssText = 'width:100px';
7545
-
7546
- var el_attr_td_X = document.createElement('td');
7547
- var el_attr_name = document.createElement('input');
7548
-
7549
- el_attr_name.setAttribute("type", "text");
7550
-
7551
- el_attr_name.style.cssText = "width:100px";
7552
- el_attr_name.setAttribute("value", w_attr_name[j-1]);
7553
- el_attr_name.setAttribute("id", "attr_name"+j);
7554
- el_attr_name.setAttribute("onChange", "change_attribute_name("+i+", this, 'type_checkbox')");
7555
-
7556
- var el_attr_value = document.createElement('input');
7557
-
7558
- el_attr_value.setAttribute("type", "text");
7559
- el_attr_value.style.cssText = "width:100px";
7560
- el_attr_value.setAttribute("value", w_attr_value[j-1]);
7561
- el_attr_value.setAttribute("id", "attr_value"+j);
7562
- el_attr_value.setAttribute("onChange", "change_attribute_value("+i+", "+j+", 'type_checkbox')");
7563
-
7564
- var el_attr_remove = document.createElement('img');
7565
- el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
7566
- el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
7567
- el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
7568
- el_attr_remove.setAttribute("align", 'top');
7569
- el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", 'type_checkbox')");
7570
- el_attr_table.appendChild(el_attr_tr);
7571
- el_attr_tr.appendChild(el_attr_td_name);
7572
- el_attr_tr.appendChild(el_attr_td_value);
7573
- el_attr_tr.appendChild(el_attr_td_X);
7574
- el_attr_td_name.appendChild(el_attr_name);
7575
- el_attr_td_value.appendChild(el_attr_value);
7576
- el_attr_td_X.appendChild(el_attr_remove);
7577
-
7578
- }
7579
-
7580
- var el_choices_label = document.createElement('label');
7581
- el_choices_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
7582
- el_choices_label.innerHTML = "Options ";
7583
- var el_choices_add = document.createElement('img');
7584
- el_choices_add.setAttribute("id", "el_choices_add");
7585
- el_choices_add.setAttribute("src", plugin_url+'/images/add.png');
7586
- el_choices_add.style.cssText = 'cursor:pointer;';
7587
- el_choices_add.setAttribute("title", 'add');
7588
- el_choices_add.setAttribute("onClick", "add_choise('checkbox',"+i+")");
7589
-
7590
- var t = document.getElementById('edit_table');
7591
-
7592
- var br = document.createElement('br');
7593
- var br1 = document.createElement('br');
7594
- var br2 = document.createElement('br');
7595
- var br3 = document.createElement('br');
7596
- var br4 = document.createElement('br');
7597
- var br5 = document.createElement('br');
7598
- var br6 = document.createElement('br');
7599
-
7600
- edit_main_td1.appendChild(el_label_label);
7601
- edit_main_td1_1.appendChild(el_label_textarea);
7602
-
7603
- edit_main_td2.appendChild(el_label_position_label);
7604
- edit_main_td2_1.appendChild(el_label_position1);
7605
- edit_main_td2_1.appendChild(Left);
7606
- edit_main_td2_1.appendChild(br2);
7607
- edit_main_td2_1.appendChild(el_label_position2);
7608
- edit_main_td2_1.appendChild(Top);
7609
-
7610
- edit_main_td3.appendChild(el_label_flow);
7611
- edit_main_td3_1.appendChild(el_flow_vertical);
7612
- edit_main_td3_1.appendChild(Vertical);
7613
- edit_main_td3_1.appendChild(br4);
7614
- edit_main_td3_1.appendChild(el_flow_horizontal);
7615
- edit_main_td3_1.appendChild(Horizontal);
7616
-
7617
- edit_main_td5.appendChild(el_required_label);
7618
- edit_main_td5_1.appendChild(el_required);
7619
-
7620
- edit_main_td8.appendChild(el_randomize_label);
7621
- edit_main_td8_1.appendChild(el_randomize);
7622
-
7623
- edit_main_td9.appendChild(el_allow_other_label);
7624
- edit_main_td9_1.appendChild(el_allow_other);
7625
-
7626
- edit_main_td6.appendChild(el_style_label);
7627
- edit_main_td6_1.appendChild(el_style_textarea);
7628
-
7629
- edit_main_td7.appendChild(el_attr_label);
7630
- edit_main_td7.appendChild(el_attr_add);
7631
- edit_main_td7.appendChild(br6);
7632
- edit_main_td7.appendChild(el_attr_table);
7633
- edit_main_td7.setAttribute("colspan", "2");
7634
-
7635
- edit_main_td4.appendChild(el_choices_label);
7636
- edit_main_td4_1.appendChild(el_choices_add);
7637
-
7638
- n=w_choices.length;
7639
- for(j=0; j<n; j++)
7640
- {
7641
- var br = document.createElement('br');
7642
- br.setAttribute("id", "br"+j);
7643
-
7644
- var el_choices = document.createElement('input');
7645
- el_choices.setAttribute("id", "el_choices"+j);
7646
- el_choices.setAttribute("type", "text");
7647
- el_choices.setAttribute("value", w_choices[j]);
7648
- el_choices.style.cssText = "width:100px; margin:0; padding:0; border-width: 1px";
7649
- el_choices.setAttribute("onKeyUp", "change_label('"+i+"_label_element"+j+"', this.value); change_in_value('"+i+"_elementform_id_temp"+j+"', this.value)");
7650
-
7651
- var el_choices_remove = document.createElement('img');
7652
- el_choices_remove.setAttribute("id", "el_choices"+j+"_remove");
7653
- el_choices_remove.setAttribute("src", plugin_url+'/images/delete.png');
7654
- if(w_allow_other=="yes" && j==w_allow_other_num)
7655
- el_choices_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px; display:none';
7656
- else
7657
- el_choices_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
7658
- el_choices_remove.setAttribute("align", 'top');
7659
- el_choices_remove.setAttribute("onClick", "remove_choise("+j+","+i+")");
7660
-
7661
- edit_main_td4.appendChild(br);
7662
- edit_main_td4.appendChild(el_choices);
7663
- edit_main_td4.appendChild(el_choices_remove);
7664
-
7665
- }
7666
-
7667
- edit_main_tr1.appendChild(edit_main_td1);
7668
- edit_main_tr1.appendChild(edit_main_td1_1);
7669
- edit_main_tr2.appendChild(edit_main_td2);
7670
- edit_main_tr2.appendChild(edit_main_td2_1);
7671
- edit_main_tr3.appendChild(edit_main_td3);
7672
- edit_main_tr3.appendChild(edit_main_td3_1);
7673
- edit_main_tr6.appendChild(edit_main_td6);
7674
- edit_main_tr6.appendChild(edit_main_td6_1);
7675
- edit_main_tr5.appendChild(edit_main_td5);
7676
- edit_main_tr5.appendChild(edit_main_td5_1);
7677
- edit_main_tr7.appendChild(edit_main_td7);
7678
- edit_main_tr4.appendChild(edit_main_td4);
7679
- edit_main_tr4.appendChild(edit_main_td4_1);
7680
- edit_main_tr8.appendChild(edit_main_td8);
7681
- edit_main_tr8.appendChild(edit_main_td8_1);
7682
- edit_main_tr9.appendChild(edit_main_td9);
7683
- edit_main_tr9.appendChild(edit_main_td9_1);
7684
- edit_main_table.appendChild(edit_main_tr1);
7685
- edit_main_table.appendChild(edit_main_tr2);
7686
- edit_main_table.appendChild(edit_main_tr3);
7687
-
7688
- edit_main_table.appendChild(edit_main_tr6);
7689
- edit_main_table.appendChild(edit_main_tr5);
7690
- edit_main_table.appendChild(edit_main_tr8);
7691
- edit_main_table.appendChild(edit_main_tr9);
7692
- edit_main_table.appendChild(edit_main_tr4);
7693
- edit_main_table.appendChild(edit_main_tr7);
7694
- edit_div.appendChild(edit_main_table);
7695
-
7696
- t.appendChild(edit_div);
7697
-
7698
- //show table
7699
-
7700
- element='input'; type='checkbox';
7701
- var adding_type = document.createElement("input");
7702
- adding_type.setAttribute("type", "hidden");
7703
- adding_type.setAttribute("value", "type_checkbox");
7704
- adding_type.setAttribute("name", i+"_typeform_id_temp");
7705
- adding_type.setAttribute("id", i+"_typeform_id_temp");
7706
- var adding_required = document.createElement("input");
7707
- adding_required.setAttribute("type", "hidden");
7708
- adding_required.setAttribute("value", w_required);
7709
- adding_required.setAttribute("name", i+"_requiredform_id_temp");
7710
- adding_required.setAttribute("id", i+"_requiredform_id_temp");
7711
-
7712
- var adding_randomize = document.createElement("input");
7713
- adding_randomize.setAttribute("type", "hidden");
7714
- adding_randomize.setAttribute("value", w_randomize);
7715
- adding_randomize.setAttribute("name", i+"_randomizeform_id_temp");
7716
- adding_randomize.setAttribute("id", i+"_randomizeform_id_temp");
7717
-
7718
- var adding_allow_other= document.createElement("input");
7719
- adding_allow_other.setAttribute("type", "hidden");
7720
- adding_allow_other.setAttribute("value", w_allow_other);
7721
- adding_allow_other.setAttribute("name", i+"_allow_otherform_id_temp");
7722
- adding_allow_other.setAttribute("id", i+"_allow_otherform_id_temp");
7723
-
7724
- var adding_allow_other_id= document.createElement("input");
7725
- adding_allow_other_id.setAttribute("type", "hidden");
7726
- adding_allow_other_id.setAttribute("value", w_allow_other_num);
7727
- adding_allow_other_id.setAttribute("name", i+"_allow_other_numform_id_temp");
7728
- adding_allow_other_id.setAttribute("id", i+"_allow_other_numform_id_temp");
7729
-
7730
- var div = document.createElement('div');
7731
- div.setAttribute("id", "main_div");
7732
- //tbody sarqac
7733
-
7734
-
7735
- var table = document.createElement('table');
7736
- table.setAttribute("id", i+"_elemet_tableform_id_temp");
7737
-
7738
- var tr = document.createElement('tr');
7739
-
7740
- var td1 = document.createElement('td');
7741
- td1.setAttribute("valign", 'top');
7742
- td1.setAttribute("align", 'left');
7743
- td1.setAttribute("id", i+"_label_sectionform_id_temp");
7744
-
7745
- var td2 = document.createElement('td');
7746
- td2.setAttribute("valign", 'top');
7747
- td2.setAttribute("align", 'left');
7748
- td2.setAttribute("id", i+"_element_sectionform_id_temp");
7749
-
7750
- var br1 = document.createElement('br');
7751
- var br2 = document.createElement('br');
7752
- var br3 = document.createElement('br');
7753
- var br4 = document.createElement('br');
7754
- // table_little -@ sarqaca tbody table_little darela table_little_t
7755
- var table_little_t = document.createElement('table');
7756
-
7757
- var table_little = document.createElement('tbody');
7758
- table_little.setAttribute("id", i+"_table_little");
7759
- table_little_t.appendChild(table_little);
7760
-
7761
-
7762
-
7763
- var label = document.createElement('span');
7764
- label.setAttribute("id", i+"_element_labelform_id_temp");
7765
- label.innerHTML = w_field_label;
7766
- label.setAttribute("class", "label");
7767
-
7768
-
7769
- var required = document.createElement('span');
7770
- required.setAttribute("id", i+"_required_elementform_id_temp");
7771
- required.innerHTML = "";
7772
- required.setAttribute("class", "required");
7773
- if(w_required=="yes")
7774
- required.innerHTML = " *";
7775
- n=w_choices.length;
7776
- aaa=false;
7777
- for(j=0; j<n; j++)
7778
- {
7779
- var tr_little = document.createElement('tr');
7780
- tr_little.setAttribute("id", i+"_element_tr"+j);
7781
-
7782
- var td_little = document.createElement('td');
7783
- td_little.setAttribute("valign", 'top');
7784
- td_little.setAttribute("id", i+"_td_little"+j);
7785
- td_little.setAttribute("idi", j);
7786
-
7787
- var adding = document.createElement(element);
7788
- adding.setAttribute("type", type);
7789
- adding.setAttribute("id", i+"_elementform_id_temp"+j);
7790
- adding.setAttribute("name", i+"_elementform_id_temp"+j);
7791
- adding.setAttribute("value", w_choices[j]);
7792
- if(w_allow_other=="yes" && j==w_allow_other_num)
7793
- {
7794
- adding.setAttribute("other", "1");
7795
- adding.setAttribute("onclick", "if(set_checked('"+i+"','"+j+"','form_id_temp')) show_other_input('"+i+"','form_id_temp');");
7796
- }
7797
- else
7798
- adding.setAttribute("onclick", "set_checked('"+i+"','"+j+"','form_id_temp')");
7799
-
7800
- if(w_choices_checked[j]=='1')
7801
- adding.setAttribute("checked", "checked");
7802
-
7803
-
7804
-
7805
- var label_adding = document.createElement('label');
7806
- label_adding.setAttribute("id", i+"_label_element"+j);
7807
- label_adding.setAttribute("class","ch_rad_label");
7808
- label_adding.setAttribute("for",i+"_elementform_id_temp"+j);
7809
- label_adding.innerHTML = w_choices[j];
7810
-
7811
- td_little.appendChild(adding);
7812
- td_little.appendChild(label_adding);
7813
- tr_little.appendChild(td_little);
7814
- table_little.appendChild(tr_little);
7815
-
7816
- if(w_choices_checked[j]=='1')
7817
- if(w_allow_other=="yes" && j==w_allow_other_num)
7818
- aaa=true;
7819
-
7820
- }
7821
- var main_td = document.getElementById('show_table');
7822
-
7823
-
7824
- td1.appendChild(label);
7825
- td1.appendChild(required);
7826
- td2.appendChild(adding_type);
7827
-
7828
- td2.appendChild(adding_required);
7829
- td2.appendChild(adding_randomize);
7830
- td2.appendChild(adding_allow_other);
7831
- td2.appendChild(adding_allow_other_id);
7832
- td2.appendChild(table_little_t);
7833
- tr.appendChild(td1);
7834
- tr.appendChild(td2);
7835
- table.appendChild(tr);
7836
-
7837
-
7838
- div.appendChild(table);
7839
- div.appendChild(br3);
7840
- main_td.appendChild(div);
7841
- add_id_and_name(i, 'type_checkbox');
7842
-
7843
- if(w_field_label_pos=="top")
7844
- label_top(i);
7845
-
7846
- if(w_flow=="hor")
7847
-
7848
- flow_hor(i);
7849
- change_class(w_class, i);
7850
- refresh_attr(i, 'type_checkbox');
7851
- if(aaa)
7852
- {
7853
- show_other_input(i);
7854
- }
7855
- }
7856
-
7857
- function type_radio(i, w_field_label, w_field_label_pos, w_flow, w_choices, w_choices_checked, w_required, w_randomize, w_allow_other, w_allow_other_num, w_class, w_attr_name, w_attr_value ){
7858
-
7859
- document.getElementById("element_type").value="type_radio";
7860
-
7861
- delete_last_child();
7862
- // edit table
7863
- var edit_div = document.createElement('div');
7864
- edit_div.setAttribute("id", "edit_div");
7865
- edit_div.setAttribute("style", "padding:10px; padding-top:0px; padding-bottom:0px; margin-top:10px;");
7866
-
7867
- var edit_main_table = document.createElement('table');
7868
- edit_main_table.setAttribute("id", "edit_main_table");
7869
- edit_main_table.setAttribute("cellpadding", "0");
7870
- edit_main_table.setAttribute("cellspacing", "0");
7871
-
7872
- var edit_main_tr1 = document.createElement('tr');
7873
- edit_main_tr1.setAttribute("valing", "top");
7874
-
7875
- var edit_main_tr2 = document.createElement('tr');
7876
- edit_main_tr2.setAttribute("valing", "top");
7877
-
7878
- var edit_main_tr3 = document.createElement('tr');
7879
- edit_main_tr3.setAttribute("valing", "top");
7880
-
7881
- var edit_main_tr4 = document.createElement('tr');
7882
- edit_main_tr4.setAttribute("valing", "top");
7883
-
7884
- var edit_main_tr5 = document.createElement('tr');
7885
- edit_main_tr5.setAttribute("valing", "top");
7886
-
7887
- var edit_main_tr6 = document.createElement('tr');
7888
- edit_main_tr6.setAttribute("valing", "top");
7889
-
7890
- var edit_main_tr7 = document.createElement('tr');
7891
- edit_main_tr7.setAttribute("valing", "top");
7892
-
7893
- var edit_main_tr8 = document.createElement('tr');
7894
- edit_main_tr8.setAttribute("valing", "top");
7895
-
7896
- var edit_main_tr9 = document.createElement('tr');
7897
- edit_main_tr9.setAttribute("valing", "top");
7898
-
7899
- var edit_main_td1 = document.createElement('td');
7900
- edit_main_td1.style.cssText = "padding-top:10px";
7901
- var edit_main_td1_1 = document.createElement('td');
7902
- edit_main_td1_1.style.cssText = "padding-top:10px";
7903
- var edit_main_td2 = document.createElement('td');
7904
- edit_main_td2.style.cssText = "padding-top:10px";
7905
- var edit_main_td2_1 = document.createElement('td');
7906
- edit_main_td2_1.style.cssText = "padding-top:10px";
7907
-
7908
- var edit_main_td3 = document.createElement('td');
7909
- edit_main_td3.style.cssText = "padding-top:10px";
7910
- var edit_main_td3_1 = document.createElement('td');
7911
- edit_main_td3_1.style.cssText = "padding-top:10px";
7912
-
7913
- var edit_main_td4 = document.createElement('td');
7914
- edit_main_td4.style.cssText = "padding-top:10px";
7915
- var edit_main_td4_1 = document.createElement('td');
7916
- edit_main_td4_1.style.cssText = "padding-top:10px";
7917
-
7918
- edit_main_td4.setAttribute("id", "choices");
7919
-
7920
- var edit_main_td5 = document.createElement('td');
7921
- edit_main_td5.style.cssText = "padding-top:10px";
7922
- var edit_main_td5_1 = document.createElement('td');
7923
- edit_main_td5_1.style.cssText = "padding-top:10px";
7924
-
7925
- var edit_main_td6 = document.createElement('td');
7926
- edit_main_td6.style.cssText = "padding-top:10px";
7927
- var edit_main_td6_1 = document.createElement('td');
7928
- edit_main_td6_1.style.cssText = "padding-top:10px";
7929
-
7930
- var edit_main_td7 = document.createElement('td');
7931
- edit_main_td7.style.cssText = "padding-top:10px";
7932
- var edit_main_td7_1 = document.createElement('td');
7933
- edit_main_td7_1.style.cssText = "padding-top:10px";
7934
-
7935
- var edit_main_td8 = document.createElement('td');
7936
- edit_main_td8.style.cssText = "padding-top:10px";
7937
- var edit_main_td8_1 = document.createElement('td');
7938
- edit_main_td8_1.style.cssText = "padding-top:10px";
7939
-
7940
- var edit_main_td9 = document.createElement('td');
7941
- edit_main_td9.style.cssText = "padding-top:10px";
7942
- var edit_main_td9_1 = document.createElement('td');
7943
- edit_main_td9_1.style.cssText = "padding-top:10px";
7944
-
7945
- var el_label_label = document.createElement('label');
7946
- el_label_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
7947
- el_label_label.innerHTML = "Field label";
7948
-
7949
- var el_label_textarea = document.createElement('textarea');
7950
- el_label_textarea.setAttribute("id", "edit_for_label");
7951
- el_label_textarea.setAttribute("rows", "4");
7952
- el_label_textarea.style.cssText = "width:200px;";
7953
- el_label_textarea.setAttribute("onKeyUp", "change_label('"+i+"_element_labelform_id_temp', this.value)");
7954
- el_label_textarea.innerHTML = w_field_label;
7955
-
7956
- var el_label_position_label = document.createElement('label');
7957
- el_label_position_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
7958
- el_label_position_label.innerHTML = "Field label position";
7959
-
7960
- var el_label_position1 = document.createElement('input');
7961
- el_label_position1.setAttribute("id", "edit_for_label_position_top");
7962
- el_label_position1.setAttribute("type", "radio");
7963
- el_label_position1.setAttribute("value", "left");
7964
-
7965
-
7966
- el_label_position1.setAttribute("name", "edit_for_label_position");
7967
- el_label_position1.setAttribute("onchange", "label_left("+i+")");
7968
- el_label_position1.setAttribute("checked", "checked");
7969
- Left = document.createTextNode("Left");
7970
-
7971
- var el_label_position2 = document.createElement('input');
7972
- el_label_position2.setAttribute("id", "edit_for_label_position_left");
7973
- el_label_position2.setAttribute("type", "radio");
7974
-
7975
- el_label_position2.setAttribute("value", "top");
7976
-
7977
-
7978
- el_label_position2.setAttribute("name", "edit_for_label_position");
7979
- el_label_position2.setAttribute("onchange", "label_top("+i+")");
7980
- Top = document.createTextNode("Top");
7981
-
7982
- if(w_field_label_pos=="top")
7983
-
7984
- el_label_position2.setAttribute("checked", "checked");
7985
- else
7986
- el_label_position1.setAttribute("checked", "checked");
7987
-
7988
- var el_label_flow = document.createElement('label');
7989
- el_label_flow.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
7990
- el_label_flow.innerHTML = "Relative Position";
7991
-
7992
- var el_flow_vertical = document.createElement('input');
7993
- el_flow_vertical.setAttribute("id", "edit_for_flow_vertical");
7994
- el_flow_vertical.setAttribute("type", "radio");
7995
- el_flow_vertical.setAttribute("value", "ver");
7996
- el_flow_vertical.setAttribute("name", "edit_for_flow");
7997
- el_flow_vertical.setAttribute("onchange", "flow_ver("+i+")");
7998
- Vertical = document.createTextNode("Vertical");
7999
-
8000
- var el_flow_horizontal = document.createElement('input');
8001
- el_flow_horizontal.setAttribute("id", "edit_for_flow_horizontal");
8002
- el_flow_horizontal.setAttribute("type", "radio");
8003
- el_flow_horizontal.setAttribute("value", "hor");
8004
- el_flow_horizontal.setAttribute("name", "edit_for_flow");
8005
- el_flow_horizontal.setAttribute("onchange", "flow_hor("+i+")");
8006
- Horizontal = document.createTextNode("Horizontal");
8007
-
8008
- if(w_flow=="hor")
8009
- el_flow_horizontal.setAttribute("checked", "checked");
8010
- else
8011
- el_flow_vertical.setAttribute("checked", "checked");
8012
-
8013
- var el_style_label = document.createElement('label');
8014
- el_style_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
8015
- el_style_label.innerHTML = "Class name";
8016
-
8017
- var el_style_textarea = document.createElement('input');
8018
- el_style_textarea.setAttribute("id", "element_style");
8019
- el_style_textarea.setAttribute("type", "text");
8020
- el_style_textarea.setAttribute("value", w_class);
8021
- el_style_textarea.style.cssText = "width:200px;";
8022
- el_style_textarea.setAttribute("onChange", "change_class(this.value,'"+i+"')");
8023
-
8024
- var el_required_label = document.createElement('label');
8025
- el_required_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
8026
- el_required_label.innerHTML = "Required";
8027
-
8028
- var el_required = document.createElement('input');
8029
- el_required.setAttribute("id", "el_send");
8030
- el_required.setAttribute("type", "checkbox");
8031
- el_required.setAttribute("value", "yes");
8032
- el_required.setAttribute("onclick", "set_required('"+i+"_required')");
8033
- if(w_required=="yes")
8034
-
8035
- el_required.setAttribute("checked", "checked");
8036
-
8037
-
8038
- var el_randomize_label = document.createElement('label');
8039
- el_randomize_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
8040
- el_randomize_label.innerHTML = "Randomize in frontend";
8041
-
8042
- var el_randomize = document.createElement('input');
8043
- el_randomize.setAttribute("id", "el_randomize");
8044
- el_randomize.setAttribute("type", "checkbox");
8045
- el_randomize.setAttribute("value", "yes");
8046
- el_randomize.setAttribute("onclick", "set_randomize('"+i+"_randomizeform_id_temp')");
8047
- if(w_randomize=="yes")
8048
- el_randomize.setAttribute("checked", "checked");
8049
-
8050
- var el_allow_other_label = document.createElement('label');
8051
- el_allow_other_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
8052
- el_allow_other_label.innerHTML = "Allow other";
8053
-
8054
- var el_allow_other = document.createElement('input');
8055
- el_allow_other.setAttribute("id", "el_allow_other");
8056
- el_allow_other.setAttribute("type", "checkbox");
8057
- el_allow_other.setAttribute("value", "yes");
8058
- el_allow_other.setAttribute("onclick", "set_allow_other('"+i+"','radio')");
8059
- if(w_allow_other=="yes")
8060
- el_allow_other.setAttribute("checked", "checked");
8061
-
8062
-
8063
-
8064
-
8065
- var el_attr_label = document.createElement('label');
8066
- el_attr_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
8067
- el_attr_label.innerHTML = "Additional Attributes";
8068
- var el_attr_add = document.createElement('img');
8069
- el_attr_add.setAttribute("id", "el_choices_add");
8070
- el_attr_add.setAttribute("src", plugin_url+'/images/add.png');
8071
- el_attr_add.style.cssText = 'cursor:pointer; margin-left:68px';
8072
- el_attr_add.setAttribute("title", 'add');
8073
- el_attr_add.setAttribute("onClick", "add_attr("+i+", 'type_checkbox')");
8074
- var el_attr_table = document.createElement('table');
8075
- el_attr_table.setAttribute("id", 'attributes');
8076
- el_attr_table.setAttribute("border", '0');
8077
- el_attr_table.style.cssText = 'margin-left:0px';
8078
- var el_attr_tr_label = document.createElement('tr');
8079
- el_attr_tr_label.setAttribute("idi", '0');
8080
- var el_attr_td_name_label = document.createElement('th');
8081
- el_attr_td_name_label.style.cssText = 'width:100px';
8082
- var el_attr_td_value_label = document.createElement('th');
8083
- el_attr_td_value_label.style.cssText = 'width:100px';
8084
- var el_attr_td_X_label = document.createElement('th');
8085
- el_attr_td_X_label.style.cssText = 'width:10px';
8086
- var el_attr_name_label = document.createElement('label');
8087
- el_attr_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
8088
- el_attr_name_label.innerHTML = "Name";
8089
-
8090
- var el_attr_value_label = document.createElement('label');
8091
- el_attr_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
8092
- el_attr_value_label.innerHTML = "Value";
8093
-
8094
- el_attr_table.appendChild(el_attr_tr_label);
8095
- el_attr_tr_label.appendChild(el_attr_td_name_label);
8096
- el_attr_tr_label.appendChild(el_attr_td_value_label);
8097
- el_attr_tr_label.appendChild(el_attr_td_X_label);
8098
- el_attr_td_name_label.appendChild(el_attr_name_label);
8099
- el_attr_td_value_label.appendChild(el_attr_value_label);
8100
-
8101
- n=w_attr_name.length;
8102
- for(j=1; j<=n; j++)
8103
- {
8104
- var el_attr_tr = document.createElement('tr');
8105
- el_attr_tr.setAttribute("id", "attr_row_"+j);
8106
- el_attr_tr.setAttribute("idi", j);
8107
- var el_attr_td_name = document.createElement('td');
8108
- el_attr_td_name.style.cssText = 'width:100px';
8109
- var el_attr_td_value = document.createElement('td');
8110
- el_attr_td_value.style.cssText = 'width:100px';
8111
-
8112
- var el_attr_td_X = document.createElement('td');
8113
- var el_attr_name = document.createElement('input');
8114
-
8115
- el_attr_name.setAttribute("type", "text");
8116
-
8117
- el_attr_name.style.cssText = "width:100px";
8118
- el_attr_name.setAttribute("value", w_attr_name[j-1]);
8119
- el_attr_name.setAttribute("id", "attr_name"+j);
8120
- el_attr_name.setAttribute("onChange", "change_attribute_name("+i+", this, 'type_checkbox')");
8121
-
8122
- var el_attr_value = document.createElement('input');
8123
-
8124
- el_attr_value.setAttribute("type", "text");
8125
- el_attr_value.style.cssText = "width:100px";
8126
- el_attr_value.setAttribute("value", w_attr_value[j-1]);
8127
- el_attr_value.setAttribute("id", "attr_value"+j);
8128
- el_attr_value.setAttribute("onChange", "change_attribute_value("+i+", "+j+", 'type_checkbox')");
8129
-
8130
- var el_attr_remove = document.createElement('img');
8131
- el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
8132
- el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
8133
- el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
8134
- el_attr_remove.setAttribute("align", 'top');
8135
- el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", 'type_checkbox')");
8136
- el_attr_table.appendChild(el_attr_tr);
8137
- el_attr_tr.appendChild(el_attr_td_name);
8138
- el_attr_tr.appendChild(el_attr_td_value);
8139
- el_attr_tr.appendChild(el_attr_td_X);
8140
- el_attr_td_name.appendChild(el_attr_name);
8141
- el_attr_td_value.appendChild(el_attr_value);
8142
- el_attr_td_X.appendChild(el_attr_remove);
8143
-
8144
- }
8145
-
8146
- var el_choices_label = document.createElement('label');
8147
- el_choices_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
8148
- el_choices_label.innerHTML = "Options ";
8149
-
8150
-
8151
- var el_choices_add = document.createElement('img');
8152
- el_choices_add.setAttribute("id", "el_choices_add");
8153
- el_choices_add.setAttribute("src", plugin_url+'/images/add.png');
8154
- el_choices_add.style.cssText = 'cursor:pointer;';
8155
- el_choices_add.setAttribute("title", 'add');
8156
- el_choices_add.setAttribute("onClick", "add_choise('radio',"+i+")");
8157
-
8158
- var t = document.getElementById('edit_table');
8159
-
8160
- var br = document.createElement('br');
8161
- var br1 = document.createElement('br');
8162
- var br2 = document.createElement('br');
8163
- var br3 = document.createElement('br');
8164
- var br4 = document.createElement('br');
8165
- var br5 = document.createElement('br');
8166
- var br6 = document.createElement('br');
8167
-
8168
-
8169
- edit_main_td1.appendChild(el_label_label);
8170
- edit_main_td1_1.appendChild(el_label_textarea);
8171
-
8172
- edit_main_td2.appendChild(el_label_position_label);
8173
- edit_main_td2_1.appendChild(el_label_position1);
8174
- edit_main_td2_1.appendChild(Left);
8175
- edit_main_td2_1.appendChild(br2);
8176
- edit_main_td2_1.appendChild(el_label_position2);
8177
- edit_main_td2_1.appendChild(Top);
8178
-
8179
- edit_main_td3.appendChild(el_label_flow);
8180
- edit_main_td3_1.appendChild(el_flow_vertical);
8181
- edit_main_td3_1.appendChild(Vertical);
8182
- edit_main_td3_1.appendChild(br4);
8183
- edit_main_td3_1.appendChild(el_flow_horizontal);
8184
- edit_main_td3_1.appendChild(Horizontal);
8185
-
8186
- edit_main_td6.appendChild(el_style_label);
8187
- edit_main_td6_1.appendChild(el_style_textarea);
8188
-
8189
- edit_main_td5.appendChild(el_required_label);
8190
- edit_main_td5_1.appendChild(el_required);
8191
-
8192
- edit_main_td8.appendChild(el_randomize_label);
8193
- edit_main_td8_1.appendChild(el_randomize);
8194
-
8195
- edit_main_td9.appendChild(el_allow_other_label);
8196
- edit_main_td9_1.appendChild(el_allow_other);
8197
-
8198
- edit_main_td7.appendChild(el_attr_label);
8199
- edit_main_td7.appendChild(el_attr_add);
8200
- edit_main_td7.appendChild(br6);
8201
- edit_main_td7.appendChild(el_attr_table);
8202
- edit_main_td7.setAttribute("colspan", "2");
8203
-
8204
- edit_main_td4.appendChild(el_choices_label);
8205
- edit_main_td4_1.appendChild(el_choices_add);
8206
-
8207
-
8208
- n=w_choices.length;
8209
- for(j=0; j<n; j++)
8210
- {
8211
- var br = document.createElement('br');
8212
- br.setAttribute("id", "br"+j);
8213
-
8214
- var el_choices = document.createElement('input');
8215
- el_choices.setAttribute("id", "el_choices"+j);
8216
- el_choices.setAttribute("type", "text");
8217
- el_choices.setAttribute("value", w_choices[j]);
8218
- el_choices.style.cssText = "width:100px; margin:0; padding:0; border-width: 1px";
8219
- el_choices.setAttribute("onKeyUp", "change_label('"+i+"_label_element"+j+"', this.value); change_in_value('"+i+"_elementform_id_temp"+j+"', this.value)");
8220
-
8221
- var el_choices_remove = document.createElement('img');
8222
- el_choices_remove.setAttribute("id", "el_choices"+j+"_remove");
8223
- el_choices_remove.setAttribute("src", plugin_url+'/images/delete.png');
8224
- if(w_allow_other=="yes" && j==w_allow_other_num)
8225
- el_choices_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px; display:none';
8226
- else
8227
- el_choices_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
8228
- el_choices_remove.setAttribute("align", 'top');
8229
- el_choices_remove.setAttribute("onClick", "remove_choise("+j+","+i+")");
8230
-
8231
- edit_main_td4.appendChild(br);
8232
- edit_main_td4.appendChild(el_choices);
8233
- edit_main_td4.appendChild(el_choices_remove);
8234
-
8235
- }
8236
-
8237
-
8238
- edit_main_tr1.appendChild(edit_main_td1);
8239
- edit_main_tr1.appendChild(edit_main_td1_1);
8240
- edit_main_tr2.appendChild(edit_main_td2);
8241
- edit_main_tr2.appendChild(edit_main_td2_1);
8242
- edit_main_tr3.appendChild(edit_main_td3);
8243
- edit_main_tr3.appendChild(edit_main_td3_1);
8244
-
8245
- edit_main_tr6.appendChild(edit_main_td6);
8246
- edit_main_tr6.appendChild(edit_main_td6_1);
8247
- edit_main_tr7.appendChild(edit_main_td7);
8248
- edit_main_tr5.appendChild(edit_main_td5);
8249
- edit_main_tr5.appendChild(edit_main_td5_1);
8250
- edit_main_tr4.appendChild(edit_main_td4);
8251
- edit_main_tr4.appendChild(edit_main_td4_1);
8252
- edit_main_tr8.appendChild(edit_main_td8);
8253
- edit_main_tr8.appendChild(edit_main_td8_1);
8254
- edit_main_tr9.appendChild(edit_main_td9);
8255
- edit_main_tr9.appendChild(edit_main_td9_1);
8256
- edit_main_table.appendChild(edit_main_tr1);
8257
- edit_main_table.appendChild(edit_main_tr2);
8258
- edit_main_table.appendChild(edit_main_tr3);
8259
- edit_main_table.appendChild(edit_main_tr6);
8260
- edit_main_table.appendChild(edit_main_tr5);
8261
- edit_main_table.appendChild(edit_main_tr8);
8262
- edit_main_table.appendChild(edit_main_tr9);
8263
- edit_main_table.appendChild(edit_main_tr4);
8264
- edit_main_table.appendChild(edit_main_tr7);
8265
- edit_div.appendChild(edit_main_table);
8266
-
8267
- t.appendChild(edit_div);
8268
-
8269
- //show table
8270
-
8271
- element='input'; type='radio';
8272
- var adding_type = document.createElement("input");
8273
- adding_type.setAttribute("type", "hidden");
8274
- adding_type.setAttribute("value", "type_radio");
8275
- adding_type.setAttribute("name", i+"_typeform_id_temp");
8276
- adding_type.setAttribute("id", i+"_typeform_id_temp");
8277
- var adding_required = document.createElement("input");
8278
- adding_required.setAttribute("type", "hidden");
8279
- adding_required.setAttribute("value", w_required);
8280
- adding_required.setAttribute("name", i+"_requiredform_id_temp");
8281
- adding_required.setAttribute("id", i+"_requiredform_id_temp");
8282
-
8283
- var adding_randomize = document.createElement("input");
8284
- adding_randomize.setAttribute("type", "hidden");
8285
- adding_randomize.setAttribute("value", w_randomize);
8286
- adding_randomize.setAttribute("name", i+"_randomizeform_id_temp");
8287
- adding_randomize.setAttribute("id", i+"_randomizeform_id_temp");
8288
-
8289
- var adding_allow_other= document.createElement("input");
8290
- adding_allow_other.setAttribute("type", "hidden");
8291
- adding_allow_other.setAttribute("value", w_allow_other);
8292
- adding_allow_other.setAttribute("name", i+"_allow_otherform_id_temp");
8293
- adding_allow_other.setAttribute("id", i+"_allow_otherform_id_temp");
8294
-
8295
- var div = document.createElement('div');
8296
- div.setAttribute("id", "main_div");
8297
-
8298
- var table = document.createElement('table');
8299
- table.setAttribute("id", i+"_elemet_tableform_id_temp");
8300
-
8301
- var tr = document.createElement('tr');
8302
-
8303
- var td1 = document.createElement('td');
8304
- td1.setAttribute("valign", 'top');
8305
- td1.setAttribute("align", 'left');
8306
- td1.setAttribute("id", i+"_label_sectionform_id_temp");
8307
-
8308
- var td2 = document.createElement('td');
8309
- td2.setAttribute("valign", 'top');
8310
- td2.setAttribute("align", 'left');
8311
- td2.setAttribute("id", i+"_element_sectionform_id_temp");
8312
-
8313
- var br1 = document.createElement('br');
8314
- var br2 = document.createElement('br');
8315
- var br3 = document.createElement('br');
8316
- var br4 = document.createElement('br');
8317
- //tbody sarqac
8318
- var table_little_t = document.createElement('table');
8319
-
8320
- var table_little = document.createElement('tbody');
8321
- table_little.setAttribute("id", i+"_table_little");
8322
-
8323
- table_little_t.appendChild(table_little);
8324
-
8325
- var tr_little1 = document.createElement('tr');
8326
- tr_little1.setAttribute("id", i+"_element_tr1");
8327
-
8328
- var tr_little2 = document.createElement('tr');
8329
- tr_little2.setAttribute("id", i+"_element_tr2");
8330
-
8331
- var td_little1 = document.createElement('td');
8332
- td_little1.setAttribute("valign", 'top');
8333
- td_little1.setAttribute("id", i+"_td_little1");
8334
-
8335
- var td_little2 = document.createElement('td');
8336
- td_little2.setAttribute("valign", 'top');
8337
- td_little2.setAttribute("id", i+"_td_little2");
8338
-
8339
-
8340
-
8341
- var label = document.createElement('span');
8342
- label.setAttribute("id", i+"_element_labelform_id_temp");
8343
- label.innerHTML = w_field_label;
8344
- label.setAttribute("class", "label");
8345
-
8346
- var required = document.createElement('span');
8347
- required.setAttribute("id", i+"_required_elementform_id_temp");
8348
- required.innerHTML = "";
8349
- required.setAttribute("class", "required");
8350
- if(w_required=="yes")
8351
- required.innerHTML = " *";
8352
- n=w_choices.length;
8353
- aaa=false;
8354
- for(j=0; j<n; j++)
8355
- {
8356
- var tr_little = document.createElement('tr');
8357
- tr_little.setAttribute("id", i+"_element_tr"+j);
8358
-
8359
- var td_little = document.createElement('td');
8360
- td_little.setAttribute("valign", 'top');
8361
- td_little.setAttribute("id", i+"_td_little"+j);
8362
- td_little.setAttribute("idi", j);
8363
-
8364
- var adding = document.createElement(element);
8365
- adding.setAttribute("type", type);
8366
- adding.setAttribute("id", i+"_elementform_id_temp"+j);
8367
- adding.setAttribute("name", i+"_elementform_id_temp");
8368
- adding.setAttribute("value", w_choices[j]);
8369
- if(w_allow_other=="yes" && j==w_allow_other_num)
8370
- {
8371
- adding.setAttribute("other", "1");
8372
- adding.setAttribute("onclick", "set_default('"+i+"','"+j+"','form_id_temp'); show_other_input('"+i+"','form_id_temp');");
8373
- }
8374
- else
8375
- adding.setAttribute("onclick", "set_default('"+i+"','"+j+"','form_id_temp')");
8376
-
8377
- if(w_choices_checked[j]=='1')
8378
- {
8379
- adding.setAttribute("checked", "checked");
8380
- }
8381
-
8382
-
8383
- var label_adding = document.createElement('label');
8384
- label_adding.setAttribute("id", i+"_label_element"+j);
8385
- label_adding.setAttribute("class","ch_rad_label");
8386
- label_adding.setAttribute("for",i+"_elementform_id_temp"+j);
8387
- label_adding.innerHTML = w_choices[j];
8388
-
8389
- td_little.appendChild(adding);
8390
- td_little.appendChild(label_adding);
8391
- tr_little.appendChild(td_little);
8392
- table_little.appendChild(tr_little);
8393
-
8394
- if(w_choices_checked[j]=='1')
8395
- if(w_allow_other=="yes" && j==w_allow_other_num)
8396
- aaa=true;
8397
- }
8398
-
8399
- var main_td = document.getElementById('show_table');
8400
-
8401
-
8402
- td1.appendChild(label);
8403
- td1.appendChild(required);
8404
- td2.appendChild(adding_type);
8405
-
8406
- td2.appendChild(adding_required);
8407
- td2.appendChild(adding_randomize);
8408
- td2.appendChild(adding_allow_other);
8409
- td2.appendChild(table_little_t);
8410
- tr.appendChild(td1);
8411
- tr.appendChild(td2);
8412
- table.appendChild(tr);
8413
-
8414
- div.appendChild(table);
8415
- div.appendChild(br3);
8416
- main_td.appendChild(div);
8417
- add_id_and_name(i, 'type_radio');
8418
-
8419
- if(w_field_label_pos=="top")
8420
- label_top(i);
8421
-
8422
- if(w_flow=="hor")
8423
-
8424
- flow_hor(i);
8425
-
8426
- change_class(w_class, i);
8427
- refresh_attr(i, 'type_checkbox');
8428
- if(aaa)
8429
- {
8430
- show_other_input(i);
8431
- }
8432
-
8433
- }
8434
-
8435
- function type_time(i, 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) {
8436
-
8437
- document.getElementById("element_type").value="type_time";
8438
-
8439
- delete_last_child();
8440
- // edit table
8441
- var edit_div = document.createElement('div');
8442
- edit_div.setAttribute("id", "edit_div");
8443
- edit_div.setAttribute("style", "border-top:1px dotted black;padding:10px; padding-top:0px; padding-bottom:0px; margin-top:10px;");
8444
-
8445
- var edit_main_table = document.createElement('table');
8446
- edit_main_table.setAttribute("id", "edit_main_table");
8447
- edit_main_table.setAttribute("cellpadding", "0");
8448
- edit_main_table.setAttribute("cellspacing", "0");
8449
-
8450
- var edit_main_tr1 = document.createElement('tr');
8451
- edit_main_tr1.setAttribute("valing", "top");
8452
-
8453
- var edit_main_tr2 = document.createElement('tr');
8454
- edit_main_tr2.setAttribute("valing", "top");
8455
-
8456
- var edit_main_tr3 = document.createElement('tr');
8457
- edit_main_tr3.setAttribute("valing", "top");
8458
-
8459
- var edit_main_tr4 = document.createElement('tr');
8460
- edit_main_tr4.setAttribute("valing", "top");
8461
-
8462
- var edit_main_tr5 = document.createElement('tr');
8463
- edit_main_tr5.setAttribute("valing", "top");
8464
-
8465
- var edit_main_tr6 = document.createElement('tr');
8466
- edit_main_tr6.setAttribute("valing", "top");
8467
- var edit_main_tr7 = document.createElement('tr');
8468
- edit_main_tr7.setAttribute("valing", "top");
8469
-
8470
- var edit_main_td1 = document.createElement('td');
8471
- edit_main_td1.style.cssText = "padding-top:10px";
8472
- var edit_main_td1_1 = document.createElement('td');
8473
- edit_main_td1_1.style.cssText = "padding-top:10px";
8474
- var edit_main_td2 = document.createElement('td');
8475
- edit_main_td2.style.cssText = "padding-top:10px";
8476
- var edit_main_td2_1 = document.createElement('td');
8477
- edit_main_td2_1.style.cssText = "padding-top:10px";
8478
-
8479
- var edit_main_td3 = document.createElement('td');
8480
- edit_main_td3.style.cssText = "padding-top:10px";
8481
- var edit_main_td3_1 = document.createElement('td');
8482
- edit_main_td3_1.style.cssText = "padding-top:10px";
8483
- var edit_main_td4 = document.createElement('td');
8484
- edit_main_td4.style.cssText = "padding-top:10px";
8485
- var edit_main_td4_1 = document.createElement('td');
8486
- edit_main_td4_1.style.cssText = "padding-top:10px";
8487
-
8488
- var edit_main_td5 = document.createElement('td');
8489
- edit_main_td5.style.cssText = "padding-top:10px";
8490
- var edit_main_td5_1 = document.createElement('td');
8491
- edit_main_td5_1.style.cssText = "padding-top:10px";
8492
-
8493
- var edit_main_td6 = document.createElement('td');
8494
- edit_main_td6.style.cssText = "padding-top:10px";
8495
- var edit_main_td6_1 = document.createElement('td');
8496
- edit_main_td6_1.style.cssText = "padding-top:10px";
8497
- var edit_main_td7 = document.createElement('td');
8498
- edit_main_td7.style.cssText = "padding-top:10px";
8499
- var edit_main_td7_1 = document.createElement('td');
8500
- edit_main_td7_1.style.cssText = "padding-top:10px";
8501
-
8502
- var el_label_label = document.createElement('label');
8503
- el_label_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
8504
- el_label_label.innerHTML = "Field label";
8505
-
8506
- var el_label_textarea = document.createElement('textarea');
8507
- el_label_textarea.setAttribute("id", "edit_for_label");
8508
- el_label_textarea.setAttribute("rows", "4");
8509
- el_label_textarea.style.cssText = "width:200px;";
8510
- el_label_textarea.setAttribute("onKeyUp", "change_label('"+i+"_element_labelform_id_temp', this.value)");
8511
- el_label_textarea.innerHTML = w_field_label;
8512
-
8513
- var el_label_position_label = document.createElement('label');
8514
- el_label_position_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
8515
- el_label_position_label.innerHTML = "Field label position";
8516
-
8517
- var el_label_position1 = document.createElement('input');
8518
- el_label_position1.setAttribute("id", "edit_for_label_position_top");
8519
- el_label_position1.setAttribute("type", "radio");
8520
- el_label_position1.setAttribute("value", "left");
8521
-
8522
-
8523
- el_label_position1.setAttribute("name", "edit_for_label_position");
8524
- el_label_position1.setAttribute("onchange", "label_left("+i+")");
8525
- el_label_position1.setAttribute("checked", "checked");
8526
- Left = document.createTextNode("Left");
8527
-
8528
- var el_label_position2 = document.createElement('input');
8529
- el_label_position2.setAttribute("id", "edit_for_label_position_left");
8530
- el_label_position2.setAttribute("type", "radio");
8531
- el_label_position2.setAttribute("value", "top");
8532
-
8533
- el_label_position2.setAttribute("name", "edit_for_label_position");
8534
- el_label_position2.setAttribute("onchange", "label_top("+i+")");
8535
- Top = document.createTextNode("Top");
8536
-
8537
- if(w_field_label_pos=="top")
8538
-
8539
- el_label_position2.setAttribute("checked", "checked");
8540
- else
8541
- el_label_position1.setAttribute("checked", "checked");
8542
-
8543
- var el_label_time_type_label = document.createElement('label');
8544
- el_label_time_type_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
8545
- el_label_time_type_label.innerHTML = "Time Format";
8546
-
8547
- var el_label_time_type1 = document.createElement('input');
8548
- el_label_time_type1.setAttribute("id", "el_label_time_type1");
8549
- el_label_time_type1.setAttribute("type", "radio");
8550
- el_label_time_type1.setAttribute("value", "format_24");
8551
- el_label_time_type1.setAttribute("name", "edit_for_time_type");
8552
- el_label_time_type1.setAttribute("onchange", "format_24("+i+")");
8553
- el_label_time_type1.setAttribute("checked", "checked");
8554
- hour_24 = document.createTextNode("24 hour");
8555
-
8556
- var el_label_time_type2 = document.createElement('input');
8557
- el_label_time_type2.setAttribute("id", "el_label_time_type2");
8558
- el_label_time_type2.setAttribute("type", "radio");
8559
- el_label_time_type2.setAttribute("value", "format_12");
8560
- el_label_time_type2.setAttribute("name", "edit_for_time_type");
8561
- el_label_time_type2.setAttribute("onchange", "format_12("+i+", 'am','', '','')");
8562
- am_pm = document.createTextNode("12 hour");
8563
-
8564
- if(w_time_type=="24")
8565
-
8566
- el_label_time_type1.setAttribute("checked", "checked");
8567
- else
8568
- el_label_time_type2.setAttribute("checked", "checked");
8569
-
8570
- var el_label_second_label = document.createElement('label');
8571
- el_label_second_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
8572
- el_label_second_label.innerHTML = "Display Seconds";
8573
-
8574
- var el_second_yes = document.createElement('input');
8575
- el_second_yes.setAttribute("id", "el_second_yes");
8576
- el_second_yes.setAttribute("type", "radio");
8577
- el_second_yes.setAttribute("value", "yes");
8578
- el_second_yes.setAttribute("name", "edit_for_time_second");
8579
- el_second_yes.setAttribute("onchange", "second_yes("+i+",'"+w_ss+"')");
8580
- el_second_yes.setAttribute("checked", "checked");
8581
- display_seconds = document.createTextNode("Yes");
8582
-
8583
- var el_second_no = document.createElement('input');
8584
- el_second_no.setAttribute("id", "el_second_no");
8585
- el_second_no.setAttribute("type", "radio");
8586
- el_second_no.setAttribute("value", "no");
8587
- el_second_no.setAttribute("name", "edit_for_time_second");
8588
- el_second_no.setAttribute("onchange", "second_no("+i+")");
8589
- dont_display_seconds = document.createTextNode("No");
8590
-
8591
- if(w_sec=="1")
8592
-
8593
- el_second_yes.setAttribute("checked", "checked");
8594
- else
8595
- el_second_no.setAttribute("checked", "checked");
8596
- var el_style_label = document.createElement('label');
8597
- el_style_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
8598
- el_style_label.innerHTML = "Class name";
8599
-
8600
- var el_style_textarea = document.createElement('input');
8601
- el_style_textarea.setAttribute("id", "element_style");
8602
- el_style_textarea.setAttribute("type", "text");
8603
- el_style_textarea.setAttribute("value", w_class);
8604
- el_style_textarea.style.cssText = "width:200px;";
8605
- el_style_textarea.setAttribute("onChange", "change_class(this.value,'"+i+"')");
8606
-
8607
- var el_required_label = document.createElement('label');
8608
- el_required_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
8609
- el_required_label.innerHTML = "Required";
8610
-
8611
- var el_required = document.createElement('input');
8612
- el_required.setAttribute("id", "el_send");
8613
- el_required.setAttribute("type", "checkbox");
8614
- el_required.setAttribute("value", "yes");
8615
- el_required.setAttribute("onclick", "set_required('"+i+"_required')");
8616
- if(w_required=="yes")
8617
-
8618
- el_required.setAttribute("checked", "checked");
8619
- var el_attr_label = document.createElement('label');
8620
- el_attr_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
8621
- el_attr_label.innerHTML = "Additional Attributes";
8622
-
8623
- var el_attr_add = document.createElement('img');
8624
- el_attr_add.setAttribute("id", "el_choices_add");
8625
- el_attr_add.setAttribute("src", plugin_url+'/images/add.png');
8626
- el_attr_add.style.cssText = 'cursor:pointer; margin-left:68px';
8627
- el_attr_add.setAttribute("title", 'add');
8628
- el_attr_add.setAttribute("onClick", "add_attr("+i+", 'type_time')");
8629
- var el_attr_table = document.createElement('table');
8630
- el_attr_table.setAttribute("id", 'attributes');
8631
- el_attr_table.setAttribute("border", '0');
8632
- el_attr_table.style.cssText = 'margin-left:0px';
8633
- var el_attr_tr_label = document.createElement('tr');
8634
- el_attr_tr_label.setAttribute("idi", '0');
8635
- var el_attr_td_name_label = document.createElement('th');
8636
- el_attr_td_name_label.style.cssText = 'width:100px';
8637
- var el_attr_td_value_label = document.createElement('th');
8638
- el_attr_td_value_label.style.cssText = 'width:100px';
8639
- var el_attr_td_X_label = document.createElement('th');
8640
- el_attr_td_X_label.style.cssText = 'width:10px';
8641
- var el_attr_name_label = document.createElement('label');
8642
- el_attr_name_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
8643
- el_attr_name_label.innerHTML = "Name";
8644
-
8645
- var el_attr_value_label = document.createElement('label');
8646
- el_attr_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
8647
- el_attr_value_label.innerHTML = "Value";
8648
-
8649
- el_attr_table.appendChild(el_attr_tr_label);
8650
- el_attr_tr_label.appendChild(el_attr_td_name_label);
8651
- el_attr_tr_label.appendChild(el_attr_td_value_label);
8652
- el_attr_tr_label.appendChild(el_attr_td_X_label);
8653
- el_attr_td_name_label.appendChild(el_attr_name_label);
8654
- el_attr_td_value_label.appendChild(el_attr_value_label);
8655
-
8656
- n=w_attr_name.length;
8657
- for(j=1; j<=n; j++)
8658
- {
8659
- var el_attr_tr = document.createElement('tr');
8660
- el_attr_tr.setAttribute("id", "attr_row_"+j);
8661
- el_attr_tr.setAttribute("idi", j);
8662
- var el_attr_td_name = document.createElement('td');
8663
- el_attr_td_name.style.cssText = 'width:100px';
8664
- var el_attr_td_value = document.createElement('td');
8665
- el_attr_td_value.style.cssText = 'width:100px';
8666
-
8667
- var el_attr_td_X = document.createElement('td');
8668
- var el_attr_name = document.createElement('input');
8669
-
8670
- el_attr_name.setAttribute("type", "text");
8671
-
8672
- el_attr_name.style.cssText = "width:100px";
8673
- el_attr_name.setAttribute("value", w_attr_name[j-1]);
8674
- el_attr_name.setAttribute("id", "attr_name"+j);
8675
- el_attr_name.setAttribute("onChange", "change_attribute_name("+i+", this, 'type_time')");
8676
-
8677
- var el_attr_value = document.createElement('input');
8678
-
8679
- el_attr_value.setAttribute("type", "text");
8680
-
8681
- el_attr_value.style.cssText = "width:100px";
8682
- el_attr_value.setAttribute("value", w_attr_value[j-1]);
8683
- el_attr_value.setAttribute("id", "attr_value"+j);
8684
- el_attr_value.setAttribute("onChange", "change_attribute_value("+i+", "+j+", 'type_time')");
8685
-
8686
- var el_attr_remove = document.createElement('img');
8687
- el_attr_remove.setAttribute("id", "el_choices"+j+"_remove");
8688
- el_attr_remove.setAttribute("src", plugin_url+'/images/delete.png');
8689
- el_attr_remove.style.cssText = 'cursor:pointer; vertical-align:middle; margin:3px';
8690
- el_attr_remove.setAttribute("align", 'top');
8691
- el_attr_remove.setAttribute("onClick", "remove_attr("+j+", "+i+", 'type_time')");
8692
- el_attr_table.appendChild(el_attr_tr);
8693
- el_attr_tr.appendChild(el_attr_td_name);
8694
- el_attr_tr.appendChild(el_attr_td_value);
8695
- el_attr_tr.appendChild(el_attr_td_X);
8696
- el_attr_td_name.appendChild(el_attr_name);
8697
- el_attr_td_value.appendChild(el_attr_value);
8698
- el_attr_td_X.appendChild(el_attr_remove);
8699
-
8700
- }
8701
-
8702
- var t = document.getElementById('edit_table');
8703
-
8704
- var br = document.createElement('br');
8705
- var br1 = document.createElement('br');
8706
- var br2 = document.createElement('br');
8707
- var br3 = document.createElement('br');
8708
- var br4 = document.createElement('br');
8709
- var br5 = document.createElement('br');
8710
- var br6 = document.createElement('br');
8711
-
8712
- edit_main_td1.appendChild(el_label_label);
8713
- edit_main_td1_1.appendChild(el_label_textarea);
8714
-
8715
- edit_main_td2.appendChild(el_label_position_label);
8716
- edit_main_td2_1.appendChild(el_label_position1);
8717
- edit_main_td2_1.appendChild(Left);
8718
- edit_main_td2_1.appendChild(br2);
8719
- edit_main_td2_1.appendChild(el_label_position2);
8720
- edit_main_td2_1.appendChild(Top);
8721
-
8722
- edit_main_td3.appendChild(el_label_time_type_label);
8723
- edit_main_td3_1.appendChild(el_label_time_type1);
8724
- edit_main_td3_1.appendChild(hour_24);
8725
- edit_main_td3_1.appendChild(br6);
8726
- edit_main_td3_1.appendChild(el_label_time_type2);
8727
- edit_main_td3_1.appendChild(am_pm);
8728
-
8729
- edit_main_td4.appendChild(el_label_second_label);
8730
- edit_main_td4_1.appendChild(el_second_yes);
8731
- edit_main_td4_1.appendChild(display_seconds);
8732
- edit_main_td4_1.appendChild(br4);
8733
- edit_main_td4_1.appendChild(el_second_no);
8734
- edit_main_td4_1.appendChild(dont_display_seconds);
8735
-
8736
- edit_main_td5.appendChild(el_style_label);
8737
- edit_main_td5_1.appendChild(el_style_textarea);
8738
-
8739
- edit_main_td6.appendChild(el_required_label);
8740
- edit_main_td6_1.appendChild(el_required);
8741
-
8742
-
8743
- edit_main_td7.appendChild(el_attr_label);
8744
- edit_main_td7.appendChild(el_attr_add);
8745
- edit_main_td7.appendChild(br6);
8746
- edit_main_td7.appendChild(el_attr_table);
8747
- edit_main_td7.setAttribute("colspan", "2");
8748
- edit_main_tr1.appendChild(edit_main_td1);
8749
- edit_main_tr1.appendChild(edit_main_td1_1);
8750
- edit_main_tr2.appendChild(edit_main_td2);
8751
- edit_main_tr2.appendChild(edit_main_td2_1);
8752
- edit_main_tr3.appendChild(edit_main_td3);
8753
- edit_main_tr3.appendChild(edit_main_td3_1);
8754
- edit_main_tr4.appendChild(edit_main_td4);
8755
- edit_main_tr4.appendChild(edit_main_td4_1);
8756
- edit_main_tr5.appendChild(edit_main_td5);
8757
- edit_main_tr5.appendChild(edit_main_td5_1);
8758
- edit_main_tr6.appendChild(edit_main_td6);
8759
- edit_main_tr6.appendChild(edit_main_td6_1);
8760
- edit_main_tr7.appendChild(edit_main_td7);
8761
- edit_main_table.appendChild(edit_main_tr1);
8762
- edit_main_table.appendChild(edit_main_tr2);
8763
- edit_main_table.appendChild(edit_main_tr3);
8764
- edit_main_table.appendChild(edit_main_tr4);
8765
- edit_main_table.appendChild(edit_main_tr5);
8766
- edit_main_table.appendChild(edit_main_tr6);
8767
- edit_main_table.appendChild(edit_main_tr7);
8768
- edit_div.appendChild(edit_main_table);
8769
-
8770
- t.appendChild(edit_div);
8771
- add_id_and_name(i, 'type_time');
8772
-
8773
- //show table
8774
- var adding_type = document.createElement("input");
8775
- adding_type.setAttribute("type", "hidden");
8776
- adding_type.setAttribute("value", "type_time");
8777
- adding_type.setAttribute("name", i+"_typeform_id_temp");
8778
- adding_type.setAttribute("id", i+"_typeform_id_temp");
8779
- var adding_required = document.createElement("input");
8780
- adding_required.setAttribute("type", "hidden");
8781
- adding_required.setAttribute("value", w_required);
8782
- adding_required.setAttribute("name", i+"_requiredform_id_temp");
8783
-
8784
- adding_required.setAttribute("id", i+"_requiredform_id_temp");
8785
- var div = document.createElement('div');
8786
- div.setAttribute("id", "main_div");
8787
-
8788
- var table = document.createElement('table');
8789
- table.setAttribute("id", i+"_elemet_tableform_id_temp");
8790
-
8791
- var tr = document.createElement('tr');
8792
-
8793
- var td1 = document.createElement('td');
8794
- td1.setAttribute("valign", 'top');
8795
- td1.setAttribute("align", 'left');
8796
- td1.setAttribute("id", i+"_label_sectionform_id_temp");
8797
-
8798
- var td2 = document.createElement('td');
8799
- td2.setAttribute("valign", 'middle');
8800
- td2.setAttribute("align", 'left');
8801
- td2.setAttribute("id", i+"_element_sectionform_id_temp");
8802
-
8803
- var table_time = document.createElement('table');
8804
- table_time.setAttribute("id", i+"_table_time");
8805
- table_time.setAttribute("cellpadding", '0');
8806
- table_time.setAttribute("cellspacing", '0');
8807
- var tr_time1 = document.createElement('tr');
8808
- tr_time1.setAttribute("id", i+"_tr_time1");
8809
-
8810
- var tr_time2 = document.createElement('tr');
8811
- tr_time2.setAttribute("id", i+"_tr_time2");
8812
-
8813
- var td_time_input1 = document.createElement('td');
8814
- td_time_input1.setAttribute("id", i+"_td_time_input1");
8815
- td_time_input1.style.cssText ="width:32px";
8816
-
8817
- var td_time_input1_ket = document.createElement('td');
8818
- td_time_input1_ket.setAttribute("align", "center");
8819
-
8820
-
8821
-
8822
- var td_time_input2 = document.createElement('td');
8823
- td_time_input2.setAttribute("id", i+"_td_time_input2");
8824
- td_time_input2.style.cssText ="width:32px";
8825
- var td_time_input2_ket = document.createElement('td');
8826
- td_time_input2_ket.setAttribute("align", "center");
8827
-
8828
- var td_time_input3 = document.createElement('td');
8829
- td_time_input3.setAttribute("id", i+"_td_time_input3");
8830
- td_time_input3.style.cssText ="width:32px";
8831
-
8832
- var td_time_label1 = document.createElement('td');
8833
- td_time_label1.setAttribute("id", i+"_td_time_label1");
8834
- var td_time_label1_ket = document.createElement('td');
8835
- var td_time_label2 = document.createElement('td');
8836
- td_time_label2.setAttribute("id", i+"_td_time_label2");
8837
- var td_time_label2_ket = document.createElement('td');
8838
- var td_time_label3 = document.createElement('td');
8839
- td_time_label3.setAttribute("id", i+"_td_time_label3");
8840
-
8841
- var br1 = document.createElement('br');
8842
- var br2 = document.createElement('br');
8843
- var br3 = document.createElement('br');
8844
- var br4 = document.createElement('br');
8845
-
8846
-
8847
- var label = document.createElement('span');
8848
- label.setAttribute("id", i+"_element_labelform_id_temp");
8849
- label.innerHTML = w_field_label;
8850
- label.setAttribute("class", "label");
8851
-
8852
- var required = document.createElement('span');
8853
- required.setAttribute("id", i+"_required_elementform_id_temp");
8854
- required.innerHTML = "";
8855
- required.setAttribute("class", "required");
8856
- if(w_required=="yes")
8857
- required.innerHTML = " *";
8858
-
8859
- var hh = document.createElement('input');
8860
- hh.setAttribute("type", 'text');
8861
- hh.setAttribute("value", w_hh);
8862
- hh.setAttribute("class", "time_box");
8863
- hh.setAttribute("id", i+"_hhform_id_temp");
8864
- hh.setAttribute("name", i+"_hhform_id_temp");
8865
- hh.setAttribute("onKeyPress", "return check_hour(event, '"+i+"_hhform_id_temp', '23')");
8866
- hh.setAttribute("onKeyUp", "change_hour(event, '"+i+"_hhform_id_temp','23')");
8867
- hh.setAttribute("onBlur", "add_0('"+i+"_hhform_id_temp')");
8868
-
8869
- var hh_label = document.createElement('label');
8870
- hh_label.setAttribute("class", "mini_label");
8871
- hh_label.innerHTML="HH";
8872
-
8873
- var hh_ = document.createElement('span');
8874
- hh_.setAttribute("class", 'wdform_colon');
8875
- hh_.style.cssText = "font-style:bold; vertical-align:middle";
8876
- hh_.innerHTML="&nbsp;:&nbsp;";
8877
-
8878
- var mm = document.createElement('input');
8879
- mm.setAttribute("type", 'text');
8880
- mm.setAttribute("value", w_mm);
8881
- mm.setAttribute("class", "time_box");
8882
-
8883
- mm.setAttribute("id", i+"_mmform_id_temp");
8884
- mm.setAttribute("name", i+"_mmform_id_temp");
8885
- mm.setAttribute("onKeyPress", "return check_minute(event, '"+i+"_mmform_id_temp')");
8886
- mm.setAttribute("onKeyUp", "change_minute(event, '"+i+"_mmform_id_temp')");
8887
- mm.setAttribute("onBlur", "add_0('"+i+"_mmform_id_temp')");
8888
-
8889
- var mm_label = document.createElement('label');
8890
- mm_label.setAttribute("class", "mini_label");
8891
- mm_label.innerHTML="MM";
8892
-
8893
- var mm_ = document.createElement('span');
8894
- mm_.style.cssText = "font-style:bold; vertical-align:middle";
8895
- mm_.innerHTML="&nbsp;:&nbsp;";
8896
- mm_.setAttribute("class", 'wdform_colon');
8897
-
8898
- var ss = document.createElement('input');
8899
- ss.setAttribute("type", 'text');
8900
- ss.setAttribute("value", w_ss);
8901
- ss.setAttribute("class", "time_box");
8902
-
8903
- ss.setAttribute("id", i+"_ssform_id_temp");
8904
- ss.setAttribute("name", i+"_ssform_id_temp");
8905
- ss.setAttribute("onKeyPress", "return check_second(event, '"+i+"_ssform_id_temp')");
8906
- ss.setAttribute("onKeyUp", "change_second('"+i+"_ssform_id_temp')");
8907
- ss.setAttribute("onBlur", "add_0('"+i+"_ssform_id_temp')");
8908
-
8909
- var ss_label = document.createElement('label');
8910
- ss_label.setAttribute("class", "mini_label");
8911
- ss_label.innerHTML="SS";
8912
-
8913
- var main_td = document.getElementById('show_table');
8914
-
8915
-
8916
- td1.appendChild(label);
8917
- td1.appendChild(required);
8918
-
8919
- td_time_input1.appendChild(hh);
8920
- td_time_input1_ket.appendChild(hh_);
8921
- td_time_input2.appendChild(mm);
8922
- td_time_input2_ket.appendChild(mm_);
8923
- td_time_input3.appendChild(ss);
8924
- tr_time1.appendChild(td_time_input1);
8925
- tr_time1.appendChild(td_time_input1_ket);
8926
- tr_time1.appendChild(td_time_input2);
8927
- tr_time1.appendChild(td_time_input2_ket);
8928
- tr_time1.appendChild(td_time_input3);
8929
-
8930
- td_time_label1.appendChild(hh_label);
8931
- td_time_label2.appendChild(mm_label);
8932
- td_time_label3.appendChild(ss_label);
8933
- tr_time2.appendChild(td_time_label1);
8934
- tr_time2.appendChild(td_time_label1_ket);
8935
- tr_time2.appendChild(td_time_label2);
8936
- tr_time2.appendChild(td_time_label2_ket);
8937
- tr_time2.appendChild(td_time_label3);
8938
- table_time.appendChild(tr_time1);
8939
- table_time.appendChild(tr_time2);
8940
-
8941
- td2.appendChild(adding_type);
8942
-
8943
- td2.appendChild(adding_required);
8944
- td2.appendChild(table_time);
8945
- tr.appendChild(td1);
8946
- tr.appendChild(td2);
8947
- table.appendChild(tr);
8948
-
8949
- div.appendChild(table);
8950
- div.appendChild(br3);
8951
- main_td.appendChild(div);
8952
-
8953
- if(w_field_label_pos=="top")
8954
- label_top(i);
8955
- if(w_time_type=="12")
8956
- format_12(i, w_am_pm,w_hh, w_mm,w_ss);
8957
-
8958
- if(w_sec=="0")
8959
- second_no(i);
8960
- change_class(w_class, i);
8961
- refresh_attr(i, 'type_time');
8962
- }
8963
-
8964
- function type_date(i, w_field_label, w_field_label_pos, w_date, w_required, w_class, w_format, w_but_val, w_attr_name, w_attr_value) {
8965
-
8966
- document.getElementById("element_type").value="type_date";
8967
-
8968
- delete_last_child();
8969
- // edit table
8970
- var edit_div = document.createElement('div');
8971
- edit_div.setAttribute("id", "edit_div");
8972
- edit_div.setAttribute("style", "border-top:1px dotted black;padding:10px; padding-top:0px; padding-bottom:0px; margin-top:10px;");
8973
-
8974
- var edit_main_table = document.createElement('table');
8975
- edit_main_table.setAttribute("id", "edit_main_table");
8976
- edit_main_table.setAttribute("cellpadding", "0");
8977
- edit_main_table.setAttribute("cellspacing", "0");
8978
-
8979
- var edit_main_tr1 = document.createElement('tr');
8980
- edit_main_tr1.setAttribute("valing", "top");
8981
-
8982
- var edit_main_tr2 = document.createElement('tr');
8983
- edit_main_tr2.setAttribute("valing", "top");
8984
-
8985
- var edit_main_tr3 = document.createElement('tr');
8986
- edit_main_tr3.setAttribute("valing", "top");
8987
-
8988
- var edit_main_tr4 = document.createElement('tr');
8989
- edit_main_tr4.setAttribute("valing", "top");
8990
-
8991
- var edit_main_tr5 = document.createElement('tr');
8992
- edit_main_tr5.setAttribute("valing", "top");
8993
-
8994
- var edit_main_tr6 = document.createElement('tr');
8995
- edit_main_tr6.setAttribute("valing", "top");
8996
-
8997
- var edit_main_tr7 = document.createElement('tr');
8998
- edit_main_tr7.setAttribute("valing", "top");
8999
-
9000
- var edit_main_td1 = document.createElement('td');
9001
- edit_main_td1.style.cssText = "padding-top:10px";
9002
- var edit_main_td1_1 = document.createElement('td');
9003
- edit_main_td1_1.style.cssText = "padding-top:10px";
9004
- var edit_main_td2 = document.createElement('td');
9005
- edit_main_td2.style.cssText = "padding-top:10px";
9006
- var edit_main_td2_1 = document.createElement('td');
9007
- edit_main_td2_1.style.cssText = "padding-top:10px";
9008
-
9009
- var edit_main_td3 = document.createElement('td');
9010
- edit_main_td3.style.cssText = "padding-top:10px";
9011
- var edit_main_td3_1 = document.createElement('td');
9012
- edit_main_td3_1.style.cssText = "padding-top:10px";
9013
- var edit_main_td4 = document.createElement('td');
9014
- edit_main_td4.style.cssText = "padding-top:10px";
9015
- var edit_main_td4_1 = document.createElement('td');
9016
- edit_main_td4_1.style.cssText = "padding-top:10px";
9017
-
9018
- var edit_main_td5 = document.createElement('td');
9019
- edit_main_td5.style.cssText = "padding-top:10px";
9020
- var edit_main_td5_1 = document.createElement('td');
9021
- edit_main_td5_1.style.cssText = "padding-top:10px";
9022
-
9023
- var edit_main_td6 = document.createElement('td');
9024
- edit_main_td6.style.cssText = "padding-top:10px";
9025
- var edit_main_td6_1 = document.createElement('td');
9026
- edit_main_td6_1.style.cssText = "padding-top:10px";
9027
- var edit_main_td7 = document.createElement('td');
9028
- edit_main_td7.style.cssText = "padding-top:10px";
9029
- var edit_main_td7_1 = document.createElement('td');
9030
- edit_main_td7_1.style.cssText = "padding-top:10px";
9031
-
9032
- var el_label_label = document.createElement('label');
9033
- el_label_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
9034
- el_label_label.innerHTML = "Field label";
9035
-
9036
- var el_label_textarea = document.createElement('textarea');
9037
- el_label_textarea.setAttribute("id", "edit_for_label");
9038
- el_label_textarea.setAttribute("rows", "4");
9039
- el_label_textarea.style.cssText = "width:200px;";
9040
- el_label_textarea.setAttribute("onKeyUp", "change_label('"+i+"_element_labelform_id_temp', this.value)");
9041
- el_label_textarea.innerHTML = w_field_label;
9042
-
9043
- var el_label_position_label = document.createElement('label');
9044
- el_label_position_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
9045
- el_label_position_label.innerHTML = "Field label position";
9046
-
9047
- var el_label_position1 = document.createElement('input');
9048
- el_label_position1.setAttribute("id", "edit_for_label_position_top");
9049
- el_label_position1.setAttribute("type", "radio");
9050
- el_label_position1.setAttribute("value", "left");
9051
-
9052
-
9053
- el_label_position1.setAttribute("name", "edit_for_label_position");
9054
- el_label_position1.setAttribute("onchange", "label_left("+i+")");
9055
- el_label_position1.setAttribute("checked", "checked");
9056
- Left = document.createTextNode("Left");
9057
-
9058
- var el_label_position2 = document.createElement('input');
9059
- el_label_position2.setAttribute("id", "edit_for_label_position_left");
9060
- el_label_position2.setAttribute("type", "radio");
9061
- el_label_position2.setAttribute("value", "top");
9062
-
9063
-
9064
- el_label_position2.setAttribute("name", "edit_for_label_position");
9065
- el_label_position2.setAttribute("onchange", "label_top("+i+")");
9066
- Top = document.createTextNode("Top");
9067
-
9068
- if(w_field_label_pos=="top")
9069
-
9070
- el_label_position2.setAttribute("checked", "checked");
9071
- else
9072
- el_label_position1.setAttribute("checked", "checked");
9073
-
9074
- var el_format_label = document.createElement('label');
9075
- el_format_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
9076
- el_format_label.innerHTML = "Date format";
9077
-
9078
- var el_format_textarea = document.createElement('input');
9079
- el_format_textarea.setAttribute("id", "date_format");
9080
- el_format_textarea.setAttribute("type", "text");
9081
- el_format_textarea.setAttribute("value", w_format);
9082
- el_format_textarea.style.cssText = "width:200px;";
9083
- el_format_textarea.setAttribute("onChange", "change_date_format(this.value,'"+i+"')");
9084
-
9085
- var el_button_value_label = document.createElement('label');
9086
- el_button_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
9087
- el_button_value_label.innerHTML = "Date Picker label";
9088
-
9089
- var el_button_value_textarea = document.createElement('input');
9090
- el_button_value_textarea.setAttribute("id", "button_value");
9091
- el_button_value_textarea.setAttribute("type", "text");
9092
- el_button_value_textarea.setAttribute("value", w_but_val);
9093
- el_button_value_textarea.style.cssText = "width:150px;";
9094
- el_button_value_textarea.setAttribute("onKeyUp", "change_file_value(this.value,'"+i+"_buttonform_id_temp')");
9095
-
9096
- var el_style_label = document.createElement('label');
9097
- el_style_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
9098
- el_style_label.innerHTML = "Class name";
9099
-
9100
- var el_style_textarea = document.createElement('input');
9101
- el_style_textarea.setAttribute("id", "element_style");
9102
- el_style_textarea.setAttribute("type", "text");
9103
- el_style_textarea.setAttribute("value", w_class);
9104
- el_style_textarea.style.cssText = "width:200px;";
9105
- el_style_textarea.setAttribute("onChange", "change_class(this.value,'"+i+"')");
9106
-
9107
- var el_required_label = document.createElement('label');
9108
- el_required_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
9109
- el_required_label.innerHTML = "Required";
9110
-
9111
- var el_required = doc