-
Notifications
You must be signed in to change notification settings - Fork 0
/
viewContactsDT.html
791 lines (632 loc) · 25.8 KB
/
viewContactsDT.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<meta charset="utf-8" />
<title>DTime</title>
<script type="text/JavaScript" src="global.js?n=1"></script>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<!-- bootstrap & fontawesome -->
<link rel="stylesheet" href="assets/css/bootstrap.min.css" />
<link rel="stylesheet" href="assets/css/font-awesome.min.css" />
<!-- page specific plugin styles -->
<link rel="stylesheet" href="assets/css/jquery-ui.min.css" />
<!-- <link rel="stylesheet" href="assets/css/datepicker.css" /> -->
<link rel="stylesheet" href="assets/css/ui.jqgrid.css" />
<!-- text fonts -->
<link rel="stylesheet" href="assets/css/ace-fonts.css" />
<!-- ace styles -->
<link rel="stylesheet" href="assets/css/ace.min.css" />
<!--[if lte IE 9]>
<link rel="stylesheet" href="assets/css/ace-part2.min.css" />
<![endif]-->
<link rel="stylesheet" href="assets/css/ace-skins.min.css" />
<link rel="stylesheet" href="assets/css/ace-rtl.min.css" />
<!--[if lte IE 9]>
<link rel="stylesheet" href="assets/css/ace-ie.min.css" />
<![endif]-->
<!-- inline styles related to this page -->
<!-- ace settings handler -->
<script src="assets/js/ace-extra.min.js"></script>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lte IE 8]>
<script src="assets/js/html5shiv.js"></script>
<script src="assets/js/respond.min.js"></script>
<![endif]-->
<style type="text/css">
.pull-right {
padding-right:10px;
}
</style>
</head>
<body class="no-skin">
<!-- #section:basics/navbar.layout -->
<div id="navbar" class="navbar navbar-default">
<script type="text/javascript">
try{ace.settings.check('navbar' , 'fixed')}catch(e){}
</script>
<div class="navbar-container" id="navbar-container">
<!-- #section:basics/sidebar.mobile.toggle -->
<button type="button" class="navbar-toggle menu-toggler pull-left" id="menu-toggler">
<span class="sr-only">Toggle sidebar</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- /section:basics/sidebar.mobile.toggle -->
<div class="navbar-header pull-left">
<!-- #section:basics/navbar.layout.brand -->
<a href="#" class="navbar-brand">
<small>
<!-- <span id='AccountName'></span> -->
<img src="image/MFStudioLogo.png">
</small>
</a>
<!-- /section:basics/navbar.layout.brand -->
<!-- #section:basics/navbar.toggle -->
<!-- /section:basics/navbar.toggle -->
</div>
<!-- #section:basics/navbar.dropdown -->
<div class="navbar-buttons navbar-header pull-right" role="navigation">
<ul class="nav ace-nav">
</ul>
</div>
<!-- /section:basics/navbar.dropdown -->
</div><!-- /.navbar-container -->
</div>
<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">
<script type="text/javascript">
try{ace.settings.check('main-container' , 'fixed')}catch(e){}
</script>
<!-- #section:basics/sidebar -->
<div id="sidebar" class="sidebar responsive">
<script type="text/javascript">
try{ace.settings.check('sidebar' , 'fixed')}catch(e){}
</script>
<style type="text/css">
.mf-leftmenu-padding{padding: 8px 3px 8px 5px !important;}
.widget-toolbar:before {border:0 !important;}
.dd-handle {border:0 !important; margin:0 !important;}
.sidebar{width:250px !important;}
.main-content{margin-left:250px !important;}
</style>
<div class="widget-box widget-color-blue no-margin">
<div class="widget-header widget-header-small no-padding">
<!-- <h5 class="widget-title smaller white">All</h5> -->
<div class="white no-padding mf-leftmenu-padding">
<span style="font-size:14px;font-weight:bold;">All</span>
<!-- <span class="widget-toolbar no-padding mf-leftmenu-padding" > -->
<!-- <div class="btn-group btn-corner"> -->
<a href="#" style="text-decoration:none;"><span class="pull-right label label-lg label-danger arrowed-in no-margin no-padding-right">64 </span></a>
<a href="#" style="text-decoration:none;"><span class="pull-right label label-lg label-grey arrowed-right no-margin no-padding-right">125</span></a>
<!-- </div> -->
<!-- </span> -->
</div>
</div>
<div class="widget-body">
<li class="dd-item">
<div class="dd-handle grey no-padding mf-leftmenu-padding">
<a href="#" style="text-decoration:none;">New Leads</a>
<a href="#" style="text-decoration:none;"><span class="pull-right label label-lg label-danger arrowed-in no-margin no-padding-right">13 </span></a>
<a href="#" style="text-decoration:none;"><span class="pull-right label label-lg label-grey arrowed-right no-margin no-padding-right">20</span></a>
</div>
</li>
<li class="dd-item">
<div class="dd-handle grey no-padding mf-leftmenu-padding">
<a href="#" style="text-decoration:none;">Incomplete Visits </a>
<a href="#" style="text-decoration:none;"><span class="pull-right label label-lg label-danger arrowed-in no-margin no-padding-right">14004 </span></a>
<a href="#" style="text-decoration:none;"><span class="pull-right label label-lg label-grey arrowed-right no-margin no-padding-right">20110</span></a>
</div>
</li>
<li class="dd-item">
<div class="dd-handle grey no-padding mf-leftmenu-padding">
<a href="#" style="text-decoration:none;">Follow-up</a>
<a href="#" style="text-decoration:none;"><span class="pull-right label label-lg label-danger arrowed-in no-margin no-padding-right">19 </span></a>
<a href="#" style="text-decoration:none;"><span class="pull-right label label-lg label-grey arrowed-right no-margin no-padding-right">19</span></a>
</div>
</li>
<li class="dd-item">
<div class="dd-handle grey no-padding mf-leftmenu-padding">
<a href="#" style="text-decoration:none;">Booked Appts.</a>
<a href="#" style="text-decoration:none;"><span class="pull-right label label-lg label-danger arrowed-in no-margin no-padding-right">26 </span></a>
<a href="#" style="text-decoration:none;"><span class="pull-right label label-lg label-grey arrowed-right no-margin no-padding-right">29</span></a>
</div>
</li>
<li class="dd-item">
<div class="dd-handle grey no-padding mf-leftmenu-padding">
<a href="#" style="text-decoration:none;">Shows</a>
<a href="#" style="text-decoration:none;"><span class="pull-right label label-lg label-danger arrowed-in no-margin no-padding-right">6 </span></a>
<a href="#" style="text-decoration:none;"><span class="pull-right label label-lg label-grey arrowed-right no-margin no-padding-right">6</span></a>
</div>
</li>
<li class="dd-item">
<div class="dd-handle grey mf-leftmenu-padding">
<a href="#" style="text-decoration:none;">Sold</a>
<a href="#" style="text-decoration:none;"><span class="pull-right badge badge-grey">19</span></a>
</div>
</li>
<li class="dd-item">
<div class="dd-handle grey mf-leftmenu-padding">
<a href="#" style="text-decoration:none;">Lost</a>
<a href="#" style="text-decoration:none;"><span class="pull-right badge badge-grey">10</span></a>
</div>
</li>
</div>
</div>
<!-- #section:basics/sidebar.layout.minimize -->
<div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
<i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
</div>
<!-- /section:basics/sidebar.layout.minimize -->
<script type="text/javascript">
try{ace.settings.check('sidebar' , 'collapsed')}catch(e){}
</script>
</div>
<!-- /section:basics/sidebar -->
<div class="main-content">
<!-- #section:basics/content.breadcrumbs -->
<div class="breadcrumbs" id="breadcrumbs">
<script type="text/javascript">
try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
</script>
<!-- <ul class="breadcrumb"> -->
<ul class="breadcrumb" style="width: 85%;">
<li>
Contacts
</li>
<li class="active">View Contacts</li>
<span class="pull-right" id='loginInfo' ></span>
</ul><!-- /.breadcrumb -->
<button class="btn btn-danger" style="float: right;" onclick="showSetup();">
<i class="ace-icon fa fa-cogs"></i>
</button>
<button class="btn btn-success" style="float: right;" onclick="ExportData();">
<i class="ace-icon fa fa-download"></i>
</button>
</div>
<!-- /section:basics/content.breadcrumbs -->
<div class="page-content">
<div class="row">
<div class="col-xs-12">
<!-- PAGE CONTENT BEGINS -->
<div class="row">
<table id="grid-table"></table>
<div id="grid-pager"></div>
<div id="configDiv" style="display: None;">
<select class="form-control" id="listSelect"></select>
</div>
<!-- PAGE CONTENT ENDS -->
</div><!-- /.col -->
</div><!-- /.row -->
</div><!-- /.page-content -->
</div><!-- /.main-content -->
<div class="footer">
<div class="footer-inner">
</div>
</div>
<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
</a>
</div><!-- /.main-container -->
<!-- basic scripts -->
<!--[if !IE]> -->
<script type="text/javascript">
window.jQuery || document.write("<script src='assets/js/jquery.min.js'>"+"<"+"/script>");
</script>
<!-- <![endif]-->
<!--[if IE]>
<script type="text/javascript">
window.jQuery || document.write("<script src='assets/js/jquery1x.min.js'>"+"<"+"/script>");
</script>
<![endif]-->
<script type="text/javascript">
if('ontouchstart' in document.documentElement) document.write("<script src='assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
</script>
<script src="assets/js/bootstrap.min.js"></script>
<!-- page specific plugin scripts -->
<script src="assets/js/jquery.dataTables.min.js"></script>
<script src="assets/js/jqGrid/jquery.jqGrid.min.js"></script>
<script src="assets/js/jqGrid/i18n/grid.locale-en.js"></script>
<!-- ace scripts -->
<script src="assets/js/ace-elements.min.js"></script>
<script src="assets/js/ace.min.js"></script>
<!-- <script src="../assets/js/date-time/bootstrap-datepicker.min.js"></script> -->
<!-- dTimepicker -->
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-ui-timepicker-addon/1.6.1/jquery-ui-timepicker-addon.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-ui-timepicker-addon/1.6.1/jquery-ui-timepicker-addon.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-ui-timepicker-addon/1.6.1/i18n/jquery-ui-timepicker-addon-i18n.min.js"></script> -->
<script src="assets/js/date-time/dtimepicker/jquery-ui.js"></script>
<link rel="stylesheet" href="assets/js/date-time/dtimepicker/jquery-ui-timepicker-addon.css" />
<script src="assets/js/date-time/dtimepicker/jquery-ui-timepicker-addon.js"></script>
<script src="assets/js/date-time/dtimepicker/jquery-ui-timepicker-addon-i18n.min.js"></script>
<!-- inline scripts related to this page -->
<script type="text/javascript">
var grid_data = [];
var grid_col = [];
var grid_model = [];
Search();
jQuery(function($) {
var grid_selector = "#grid-table";
var pager_selector = "#grid-pager";
//resize to fit page size
$(window).on('resize.jqGrid', function () {
$(grid_selector).jqGrid( 'setGridWidth', $(".page-content").width() );
});
//resize on sidebar collapse/expand
var parent_column = $(grid_selector).closest('[class*="col-"]');
$(document).on('settings.ace.jqGrid' , function(ev, event_name, collapsed) {
if( event_name === 'sidebar_collapsed' || event_name === 'main_container_fixed' ) {
$(grid_selector).jqGrid( 'setGridWidth', parent_column.width() );
}
});
jQuery(grid_selector).jqGrid({
//direction: "rtl",
data: grid_data,
datatype: "local",
height: 350,
colNames: grid_col,
colModel: grid_model,
ignoreCase:true,
viewrecords : true,
rowNum:10,
rowList:[10,20,30],
pager : pager_selector,
altRows: true,
//toppager: true,
multiselect: false,
//multikey: "ctrlKey",
multiboxonly: false,
loadComplete : function() {
var table = this;
setTimeout(function(){
updatePagerIcons(table);
}, 0);
},
//editurl: "/dummy.html",//nothing is saved
editurl: "viewContacts.php",
caption: "View Contacts"
//,autowidth: true,
});
$(window).triggerHandler('resize.jqGrid');//trigger window resize to make the grid get the correct size
//enable search/filter toolbar
//jQuery(grid_selector).jqGrid('filterToolbar',{defaultSearch:true,stringResult:true})
//jQuery(grid_selector).filterToolbar({});
//switch element when editing inline
function aceSwitch( cellvalue, options, cell ) {
setTimeout(function(){
$(cell) .find('input[type=checkbox]')
.addClass('ace ace-switch ace-switch-5')
.after('<span class="lbl"></span>');
}, 0);
}
//enable datepicker
/*//fung
function pickDate( cellvalue, options, cell ) {
setTimeout(function(){
$(cell) .find('input[type=text]')
.datepicker({format:'yyyy-mm-dd' , autoclose:true});
}, 0);
}
*/
//navButtons
jQuery(grid_selector).jqGrid('navGrid',pager_selector,
{ //navbar options
edit: true,
editicon : 'ace-icon fa fa-pencil blue',
add: false,
addicon : 'ace-icon fa fa-plus-circle purple',
del: false,
delicon : 'ace-icon fa fa-trash-o red',
search: true,
searchicon : 'ace-icon fa fa-search orange',
refresh: true,
refreshicon : 'ace-icon fa fa-refresh green',
view: false,
viewicon : 'ace-icon fa fa-search-plus grey',
},
{
//edit record form
closeAfterEdit: true,
width: 400,
recreateForm: true,
beforeShowForm : function(e) {
var form = $(e[0]);
form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class="widget-header" />');
style_edit_form(form);
},
ajaxEditOptions: jsonOptions,
serializeEditData: function (data) {
item = createItem('edit', data);
return JSON.stringify(item);
},
afterSubmit : function(response, postdata)
{
var rt = response.responseText;
rt = rt.trim();
if (rt == 'OK') {
reloadGrid();
return [true,'',null];
} else {
return [false,response.responseText,null];
}
}
},
{
//new record form
width: 400,
closeAfterAdd: true,
recreateForm: true,
viewPagerButtons: false,
beforeShowForm : function(e) {
var form = $(e[0]);
form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class="widget-header" />');
style_edit_form(form);
},
ajaxEditOptions: jsonOptions,
serializeEditData: function (data) {
item = createItem('add', data);
return JSON.stringify(item);
},
afterSubmit : function(response, postdata)
{
var rt = response.responseText;
rt = rt.trim();
if (rt == 'OK') {
reloadGrid();
return [true,'',null];
} else {
return [false,response.responseText,null];
}
}
},
{
//delete record form
recreateForm: true,
beforeShowForm : function(e) {
var form = $(e[0]);
if(form.data('styled')) return false;
form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class="widget-header" />');
style_delete_form(form);
form.data('styled', true);
},
onClick : function(e) {
alert(1);
}
},
{
//search form
recreateForm: true,
afterShowSearch: function(e){
var form = $(e[0]);
form.closest('.ui-jqdialog').find('.ui-jqdialog-title').wrap('<div class="widget-header" />');
style_search_form(form);
},
afterRedraw: function(){
style_search_filters($(this));
}
,
multipleSearch: true,
/**
multipleGroup:true,
showQuery: true
*/
},
{
//view record form
recreateForm: true,
beforeShowForm: function(e){
var form = $(e[0]);
form.closest('.ui-jqdialog').find('.ui-jqdialog-title').wrap('<div class="widget-header" />');
}
}
);
function style_edit_form(form) {
//update buttons classes
var buttons = form.next().find('.EditButton .fm-button');
buttons.addClass('btn btn-sm').find('[class*="-icon"]').hide();//ui-icon, s-icon
buttons.eq(0).addClass('btn-primary').prepend('<i class="ace-icon fa fa-check"></i>');
buttons.eq(1).prepend('<i class="ace-icon fa fa-times"></i>');
buttons = form.next().find('.navButton a');
buttons.find('.ui-icon').hide();
buttons.eq(0).append('<i class="ace-icon fa fa-chevron-left"></i>');
buttons.eq(1).append('<i class="ace-icon fa fa-chevron-right"></i>');
}
function style_delete_form(form) {
var buttons = form.next().find('.EditButton .fm-button');
buttons.addClass('btn btn-sm btn-white btn-round').find('[class*="-icon"]').hide();//ui-icon, s-icon
buttons.eq(0).addClass('btn-danger').prepend('<i class="ace-icon fa fa-trash-o"></i>');
buttons.eq(1).addClass('btn-default').prepend('<i class="ace-icon fa fa-times"></i>')
}
function style_search_filters(form) {
form.find('.delete-rule').val('X');
form.find('.add-rule').addClass('btn btn-xs btn-primary');
form.find('.add-group').addClass('btn btn-xs btn-success');
form.find('.delete-group').addClass('btn btn-xs btn-danger');
}
function style_search_form(form) {
var dialog = form.closest('.ui-jqdialog');
var buttons = dialog.find('.EditTable');
buttons.find('.EditButton a[id*="_reset"]').addClass('btn btn-sm btn-info').find('.ui-icon').attr('class', 'ace-icon fa fa-retweet');
buttons.find('.EditButton a[id*="_query"]').addClass('btn btn-sm btn-inverse').find('.ui-icon').attr('class', 'ace-icon fa fa-comment-o');
buttons.find('.EditButton a[id*="_search"]').addClass('btn btn-sm btn-purple').find('.ui-icon').attr('class', 'ace-icon fa fa-search');
}
function beforeDeleteCallback(e) {
var form = $(e[0]);
if(form.data('styled')) return false;
form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class="widget-header" />');
style_delete_form(form);
form.data('styled', true);
}
function beforeEditCallback(e) {
var form = $(e[0]);
form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class="widget-header" />');
style_edit_form(form);
}
//replace icons with FontAwesome icons like above
function updatePagerIcons(table) {
var replacement =
{
'ui-icon-seek-first' : 'ace-icon fa fa-angle-double-left bigger-140',
'ui-icon-seek-prev' : 'ace-icon fa fa-angle-left bigger-140',
'ui-icon-seek-next' : 'ace-icon fa fa-angle-right bigger-140',
'ui-icon-seek-end' : 'ace-icon fa fa-angle-double-right bigger-140'
};
$('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){
var icon = $(this);
var $class = $.trim(icon.attr('class').replace('ui-icon', ''));
if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);
})
}
function enableTooltips(table) {
$('.navtable .ui-pg-button').tooltip({container:'body'});
$(table).find('.ui-pg-div').tooltip({container:'body'});
}
});
function Search() {
var email = readCookie("loginEmail");
var pwd = readCookie("loginPassword");
var account = readCookie("loginAccount");
var PartnerGuid = readCookie("PartnerGuid");
var PartnerPassword = readCookie("PartnerPassword");
var account = readCookie("loginAccount");
var projecturl = getProjectURL();
pwd = encodeURIComponent(pwd);
projecturl = projecturl+'getContactArrayDT.php?email='+email+'&pwd='+pwd+'&account='+account+'&PartnerGuid='+PartnerGuid+'&PartnerPassword='+PartnerPassword+'&rnd=' + new Date().getTime();
$.ajax(
{
type: "GET",
dataType: 'json',
url: projecturl,
async: false,
success: function(result)
{
grid_data = eval(result.data);
grid_col = result.colNames;
grid_model = result.colModel;
var time = "";
for(i = 0; i < grid_model.length; i++) {
var gm = grid_model[i];
var name = gm['name'];
// time = gm['time'];
if (name == 'Appointment_Date') {
//editoptions = { dataInit: function(elem) {$(elem).datepicker({dateFormat:'mm/dd/yyyy'})} };
//editoptions = { dataInit: function(elem) {$(elem).datepicker({dateFormat:'yyyy-mm-dd'})} }; //work
//dTimepicker
editoptions = { dataInit: function(elem) {$(elem).datetimepicker({controlType: 'select',oneLine: true,hourMin: 9,hourMax: 19,stepMinute: 30,timeFormat: 'hh:mm tt'})} };
gm['editoptions'] = editoptions;
grid_model[i] = gm;
}
}
},
error: function(x, e)
{
alert(x.readyState + " "+ x.status +" "+ e.msg);
}
});
}
var jsonOptions = {
type :"POST",
contentType :"application/json; charset=utf-8",
dataType :"json"
};
$(document).ready(function(e) {
var canLogin = readCookie("canLogin");
if (canLogin == "Yes") {
var email = readCookie("loginEmail");
var loginAccountName = readCookie("loginAccountName");
$('#AccountName').html(loginAccountName);
var programName = getParameterByName('programName');
$('#programName').html(programName);
var loginInfo = loginAccountName+" - "+email;
$('#loginInfo').html(loginInfo);
var loginMode = readCookie("loginMode");
if (loginMode == 'CTM') {
} else {
$('#HomeLI').show();
$('#UploadLI').show();
$('#TemplatesLI').show();
$('#MamlLI').show();
//$('#AdminLI').show();
}
} else {
location.href = 'login.html';
}
});
function reloadGrid() {
Search();
jQuery('#grid-table').jqGrid().setGridParam(
{
data: grid_data
}
).trigger("reloadGrid");
}
function showSetup() {
var email = readCookie("loginEmail");
var pwd = readCookie("loginPassword");
var account = readCookie("loginAccount");
var projecturl = getProjectURL();
pwd = encodeURIComponent(pwd);
projecturl = projecturl+'showSetup.html?email='+email+'&pwd='+pwd+'&account='+account+'&rnd=' + new Date().getTime();
var name = "fieldsPopup";
//var o = "width=600,height=450,scrollbars=0,resizable=0";
//accountOpen = window.open(projecturl, name, o);
var params = [
'height=500',
'width='+screen.width,
'fullscreen=yes' // only works in IE, but here for completeness
].join(',');
// and any other options from
// https://developer.mozilla.org/en/DOM/window.open
var popup = window.open(projecturl, name, params);
popup.moveTo(0,0);
}
function createItem(mode, data) {
var loginEmail = readCookie("loginEmail");
var loginPassword = readCookie("loginPassword");
var loginAccount = readCookie("loginAccount");
var PartnerGuid = readCookie("PartnerGuid");
var PartnerPassword = readCookie("PartnerPassword");
item = {};
item ["loginEmail"] = loginEmail;
item ["loginPassword"] = loginPassword;
item ["loginAccount"] = loginAccount;
item ["mode"] = mode;
item ["PartnerGuid"] = PartnerGuid;
item ["PartnerPassword"] = PartnerPassword;
var aCount = grid_col.length;
for (var i = 0; i < aCount; i++) {
var fname = grid_col[i];
$.each(data, function(key, value) {
if (key == fname) {
item [fname] = value;
}
});
}
return item;
}
function ExportData() {
//var currentfilter = $("#grid-table").jqGrid('getGridParam','postData').filters;
//alert(currentfilter);
//alert($("#grid-table").text());
var email = readCookie("loginEmail");
var pwd = readCookie("loginPassword");
var account = readCookie("loginAccount");
var projecturl = getProjectURL();
var PartnerGuid = readCookie("PartnerGuid");
var PartnerPassword = readCookie("PartnerPassword");
pwd = encodeURIComponent(pwd);
projecturl = projecturl+'getExportData.php?email='+email+'&pwd='+pwd+'&account='+account+'&PartnerGuid='+PartnerGuid+'&PartnerPassword='+PartnerPassword+'&rnd=' + new Date().getTime();
var postData = $("#grid-table").jqGrid("getGridParam", "postData");
if (postData.filters) {
projecturl = projecturl+'&'+$.param({filters: postData.filters});
}
window.open(projecturl);
}
</script>
</body>
</html>