-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.php
executable file
·1015 lines (950 loc) · 43.3 KB
/
index.php
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
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
$isLocal = $_SERVER['SERVER_NAME'] == 'localhost' || $_SERVER['HTTP_HOST'] == '127.0.0.1' || ($_SERVER['HTTP_HOST'] == 'deskmini.diegozhu.vip');
if(!$isLocal && $_SERVER['HTTPS'] != 'on') {
header('HTTP/1.1 301 Moved Permanently');
header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
exit();
}
include_once "./libs/login.php";
function curPageURL() {
$pageURL = 'http';
if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {
$pageURL .= "s";
}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
}
else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
$pageurl = curPageURL();
$isLocal = preg_match("/localhost/i", $pageurl, $arr);
if ($isLocal) {
}
?>
<!DOCTYPE HTML>
<html>
<head>
<link href="./favicon.ico" type="image/x-icon" rel="shortcut icon" />
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<!-- <script src="https://js.fundebug.cn/fundebug.0.3.4.min.js"
apikey="d510992e63e0cca337ddc0ab882c90f49a89c07acfd0a5b633c80c78412edccd"></script> -->
<script type="text/javascript">
var DEBUG = <?php echo $isLocal; ?> ? true : false;
if (<?php echo isset($_GET["force_debug"]) ? "true" : "false"; ?> == true) {
DEBUG = true;
}
var _PWDPREFIX = 'familydecoration-';
</script>
<title>佳诚装饰</title>
<!-- <x-compile> -->
<!-- <x-bootstrap> -->
<link rel="stylesheet" href="bootstrap.css">
<script src="ext/ext-dev.js"></script>
<script src="bootstrap.js"></script>
<!-- </x-bootstrap> -->
<script src="app.js"></script>
<!-- </x-compile> -->
<link rel="stylesheet" href="tools/dhtmlx/codebase/themes/message_solid.css" />
<link rel="stylesheet" href="tools/sweetalert/dist/sweetalert.css" />
<link href="resources/css/global.css" rel="stylesheet" />
<script type="text/javascript" src="resources/locale/ext-lang-zh_CN.js"></script>
<script src="https://channel.sinaapp.com/api.js" type="text/javascript"></script>
<!-- for Christmas effect -->
<!-- <script src="tools/snow.min.js" type="text/javascript"></script> -->
<script type="text/javascript" src="tools/jquery-1.11.1.min.js"></script>
</head>
<body>
<div id="userInfo" class="x-hide-display">
<span>用户信息:</span>
<span name="realname"></span>
<span name="account"></span>
<span name="authority"></span>
<a href="javascript:void(0);" id="logout">注销</a>
<!-- <a href="javascript:void(0);" id="feedback">反馈</a> -->
<?php
if (preg_match('/001-\d{3}/', $_SESSION["level"])) {
// echo '<a href="javascript:void(0);" id="analysisChart">图表</a>'.
// echo '<a href="javascript:void(0);" id="checkFeedback">反馈建议</a>'.
echo '<a href="javascript:void(0);" id="logAndException">错误日志</a>';
}
?>
</div>
<div id="tipBox" style="position:absolute;height:0px;top:10px;width:100%;text-align: right;line-height: 24px;display: none;">
<span class="text" style="position:absolute;right: 20px;display:inline-block;background-color:#cccccc;color:#000;border-radius:3px;padding:0 10px;margin-top: 4px;border: 1px solid #99bce8;z-index: 9999999;"></span>
</div>
<div id="topMask" style="display:none;position: absolute;width: 100%;height:100%;z-index: 999999999;cursor:wait;"></div>
<div class="x-hide-display" id="chartContainer">
</div>
<div class="x-hide-display" id="homepageChartContainer">
</div>
<div class="x-hide-display" id="completeProcess">
</div>
<div id="mytaskCompleteProcess" class="x-hide-display">
</div>
<?php
if (class_exists("SaeChannel")) {
$channel = new SaeChannel();
$privateChannel = $channel->createChannel("sae_channel_".$_SESSION["name"], 60*60*24);
}
else {
$privateChannel = null;
}
?>
<script type="text/javascript">
var privateChannel = '<?php echo $privateChannel; ?>';
Ext.define('User', {
singleton: true,
name: '<?php echo $_SESSION["name"]; ?>',
level: '<?php echo $_SESSION["level"]; ?>',
realname: '<?php echo $_SESSION["realname"]; ?>',
phone: '<?php echo $_SESSION["phone"]; ?>',
mail: '<?php echo $_SESSION["mail"]; ?>',
profileImage: '<?php echo $_SESSION["profileImage"]; ?>',
supplierId: '<?php echo (isset($_SESSION["supplierId"]) ? $_SESSION["supplierId"] : false); ?>',
isAdmin: function (){
return this.level == '001-001' || this.level == '001-002' || this.isAdminAssistant();
},
isAdminAssistant: function (){
return this.level == '001-003';
},
isManager: function (){
var level = this.level;
var flag = false;
if (/^001-\d{3}$/i.test(level)) {
// admin
flag = false;
}
else if (/^00[2345789]-001$/.test(level)) {
// manager
flag = true;
}
return flag;
},
isDesignManager: function (){
return this.level == '002-001';
},
isProjectManager: function (){
return this.level == '003-001';
},
isBusinessManager: function (){
return this.level == '004-001';
},
isAdministrationManager: function (){
return this.level == '005-001';
},
isSupervisor: function (){
return this.level == '003-003';
},
isDesignStaff: function (){
return this.level == '002-002';
},
isProjectStaff: function (){
return this.level == '003-002';
},
isBusinessStaff: function (){
return this.level == '004-002';
},
isAdministrationStaff: function (){
return this.level == '005-002';
},
isGeneral: function (){
return this.level == '006-001';
},
isPropagandaManager: function (){
return this.level == '007-001';
},
isPropagandaStaff: function (){
return this.level == '007-002';
},
isFinanceManager: function (){
return this.level == '008-001';
},
isFinanceStaff: function (){
return (this.level == '008-002' || this.level == '008-003' || this.level == '008-004' || this.level == '008-005');
},
isFinanceAccountant: function (){
return this.level == '008-002';
},
isFinanceCashier: function (){
return this.level == '008-003';
},
isBudgetManager: function (){
return this.level == '009-001';
},
isBudgetStaff: function (){
return this.level == '009-002';
},
isSupplier: function() {
return this.level == '010-001';
},
isCurrent: function (name){
if (name) {
return this.name == name;
}
else {
return undefined;
}
},
role: [{
name: '总经理',
value: '001-001'
}, {
name: '副总经理',
value: '001-002'
}, {
name: '总经理助理',
value: '001-003'
}, {
name: '设计部主管',
value: '002-001'
}, {
name: '设计师',
value: '002-002'
}, {
name: '工程部主管',
value: '003-001'
}, {
name: '项目经理',
value: '003-002'
}, {
name: '监理',
value: '003-003'
}, {
name: '市场部主管',
value: '004-001'
}, {
name: '业务员',
value: '004-002'
}, {
name: '见习业务员',
value: '004-003'
}, {
name: '人事行政部主管',
value: '005-001'
}, {
name: '人事行政部员工',
value: '005-002'
}, {
name: '游客',
value: '006-001'
}, {
name: '宣传部主管',
value: '007-001'
}, {
name: '宣传部员工',
value: '007-002'
}, {
name: '财务部主管',
value: '008-001'
}, {
name: '财务部会计',
value: '008-002'
}, {
name: '财务部出纳',
value: '008-003'
}, {
name: '财务部预算员',
value: '008-004'
}, {
name: '财务部采购',
value: '008-005'
}, {
name: '预决算主管',
value: '009-001'
}, {
name: '预决算员工',
value: '009-002'
}, {
name: '供应商',
value: '010-001'
}],
getStatus: function (){
var level = this.level,
role = this.role,
status;
Ext.each(role, function (rec, index){
if (level == rec.value) {
status = rec.name;
}
});
if (status) {
return status;
}
else {
return '未知';
}
},
getPhoneNumber: function (){
if (this.phone) {
return this.phone;
}
else {
return false;
}
},
getEmail: function (){
if (this.mail) {
return this.mail;
}
else {
return false;
}
},
getProfileImage: function (){
if (this.profileImage) {
return this.profileImage;
}
else {
return false;
}
},
// get department according to user level value
renderDepartment: function (level){
var department = '';
if (/^001(-\d{3})?$/i.test(level)) {
department = '总经办';
}
else if (/^002(-\d{3})?$/i.test(level)) {
department = '设计部';
}
else if (/^003(-\d{3})?$/i.test(level)) {
department = '工程部';
}
else if (/^004(-\d{3})?$/i.test(level)) {
department = '市场部';
}
else if (/^005(-\d{3})?$/i.test(level)) {
department = '人事行政部';
}
else if (/^006(-\d{3})?$/i.test(level)) {
department = '游客';
}
else if (/^007(-\d{3})?$/i.test(level)) {
department = '宣传部';
}
else if (/^008(-\d{3})?$/i.test(level)) {
department = '财务部';
}
else if (/^009(-\d{3})?$/i.test(level)) {
department = '经营科';
}
else if (/^010(-\d{3})?$/i.test(level)) {
department = '供应商';
}
else {
department = '非部门';
}
return department;
},
// get user role according to user level value
renderRole: function (level){
var role = '',
roleStr = level.split('-')[1];
if (/^001-\d{3}$/i.test(level)) {
if (roleStr == '001') {
role = '总经理';
}
else if (roleStr == '002') {
role = '副总经理';
}
else if (roleStr == '003') {
role = '总经理助理';
}
}
// design department
else if (/^002-\d{3}$/i.test(level)) {
if (roleStr == '001') {
role = '主管';
}
else if (roleStr == '002') {
role = '设计师';
}
}
// project department
else if (/^003-\d{3}$/i.test(level)) {
if (roleStr == '001') {
role = '主管';
}
else if (roleStr == '002') {
role = '项目经理';
}
else if (roleStr == '003') {
role = '监理';
}
}
// business department
else if (/^004-\d{3}$/i.test(level)) {
if (roleStr == '001') {
role = '主管';
}
// this role could hand over businesses coming from business manager.
else if (roleStr == '002') {
role = '业务员';
}
// this role can't not get any business from business manager'
else if (roleStr == '003') {
role = '见习业务员';
}
}
// administration department
else if (/^005-\d{3}$/i.test(level)) {
if (roleStr == '001') {
role = '主管';
}
else if (roleStr == '002') {
role = '员工';
}
}
// visitor
else if (/^006-\d{3}$/i.test(level)) {
role = '游客';
}
// propaganda department
else if (/^007-\d{3}$/i.test(level)) {
if (roleStr == '001') {
role = '主管';
}
else if (roleStr == '002') {
role = '员工';
}
}
// the ministry of finance
else if (/^008-\d{3}$/i.test(level)) {
if (roleStr == '001') {
role = '主管';
}
else if (roleStr == '002') {
role = '会计';
}
else if (roleStr == '003') {
role = '出纳';
}
else if (roleStr == '004') {
role = '预算员';
}
else if (roleStr == '005') {
role = '采购';
}
}
// the ministry of budget
else if (/^009-\d{3}$/i.test(level)) {
if (roleStr == '001') {
role = '主管';
}
else if (roleStr == '002') {
role = '员工';
}
}
else if (/^010-\d{3}$/i.test(level)) {
role = '供应商';
}
else {
role = '未知角色';
}
return role;
},
render: function (level){
var role = this.role,
status;
Ext.each(role, function (rec, index){
if (level == rec.value) {
status = rec.name;
}
});
if (status) {
return status;
}
else {
return '未知';
}
},
getName: function (){
return this.name;
},
getRealName: function (){
return this.realname;
}
});
document.getElementById('logout').onclick = function (){
logout();
}
/* temporarily close this function. mail service has been upgraded. we have to figure out a way to make this service better later.
document.getElementById('feedback').onclick = function (){
if (Ext) {
var win = Ext.create('Ext.window.Window', {
title: '用户使用问题和意见反馈',
width: 500,
height: 300,
layout: 'fit',
modal: true,
items: [{
xtype: 'textarea',
autoScroll: true,
id: 'textarea-feedback',
name: 'textarea-feedback',
hideLabel: true
}],
buttons: [{
text: '确定',
handler: function (){
var area = Ext.getCmp('textarea-feedback');
if (!Ext.isEmpty(area.getValue())) {
Ext.Ajax.request({
url: './libs/feedback.php?action=send',
method: 'POST',
params: {
name: User.getName(),
realname: User.getRealName(),
level: User.level,
content: area.getValue()
},
callback: function (opts, success, res){
if (success) {
var obj = Ext.decode(res.responseText);
if (obj.status == 'successful') {
sendExternalMail('[email protected]', '用户反馈意见', User.getRealName() + ': ' + area.getValue());
sendExternalMail('[email protected]', '用户反馈意见', User.getRealName() + ': ' + area.getValue());
sendExternalMail('[email protected]', '用户反馈意见', User.getRealName() + ': ' + area.getValue());
sendExternalMail('[email protected]', '用户反馈意见', User.getRealName() + ': ' + area.getValue());
showMsg('发送成功,谢谢您的反馈,我们会及时处理您的问题。');
win.close();
}
else {
showMsg(obj.errMsg);
}
}
}
});
}
else {
showMsg('请输入内容!');
}
}
}, {
text: '取消',
handler: function (){
win.close();
}
}]
});
win.show();
}
}
if (document.getElementById('checkFeedback')) {
document.getElementById('checkFeedback').onclick = function (){
if (Ext) {
var win = Ext.create('Ext.window.Window', {
title: '用户使用问题和意见反馈',
width: 700,
height: 500,
layout: 'fit',
modal: true,
items: [{
xtype: 'gridpanel',
autoScroll: true,
id: 'gridpanel-checkFeedback',
name: 'gridpanel-checkFeedback',
columns: [{
text: '姓名',
dataIndex: 'realname',
flex: 1
}, {
text: '内容',
dataIndex: 'content',
flex: 1,
renderer: function (val) {
return val.replace(/\n/ig, '<br />');
}
}, {
text: '结果',
dataIndex: 'result',
flex: 1,
renderer: function (val, meta, rec) {
meta.style = 'cursor: pointer;';
if (val) {
return val.replace(/\n/ig, '<br />');
}
else {
return val;
}
}
}],
store: Ext.create('Ext.data.Store', {
fields: ['id', 'name', 'realname', 'level', 'content', 'result'],
autoLoad: true,
proxy: {
type: 'rest',
url: './libs/feedback.php?action=fetchFeedbacks',
reader: {
type: 'json'
}
}
}),
listeners: {
cellclick: function (table, td, cellIndex, rec, tr, rowIndex, e, eOpts) {
if (2 == cellIndex) {
Ext.Msg.prompt('提示', '请输入开发人员口令进行编辑。', function (btn, txt){
if (btn == 'ok') {
if (txt == 'iloveyou') {
var win = Ext.create('Ext.window.Window', {
title: '编辑修复结果',
width: 500,
height: 300,
layout: 'fit',
items: [{
xtype: 'textarea',
autoScroll: true,
value: rec.get('result')
}],
buttons: [{
text: '确定',
handler: function (){
var resultContent = win.down('textarea').getValue();
Ext.Ajax.request({
url: './libs/feedback.php?action=editFeedback',
method: 'POST',
params: {
id: rec.getId(),
result: resultContent
},
callback: function (opts, success, res){
if (success) {
var obj = Ext.decode(res.responseText);
if (obj.status == 'successful') {
var grid = Ext.getCmp('gridpanel-checkFeedback');
showMsg('编辑成功!');
grid.getStore().reload();
sendMsg(User.getName(), rec.get('name'), '李嘉编辑了您提出的反馈意见"'
+ rec.get('content') + '",编辑内容为:'
+ resultContent, 'respondToFeedback');
win.close();
if (User.getName() == rec.get('name')
&& Ext.util.Cookies.get('lastXtype') == 'bulletin-index') {
var msgGrid = Ext.getCmp('gridpanel-message');
msgGrid && msgGrid.getStore().reload();
}
}
else {
showMsg(obj.errMsg);
}
}
}
})
}
}, {
text: '取消',
handler: function (){
win.close();
}
}]
});
win.show();
}
else {
Ext.Msg.error('口令错误!');
}
}
});
}
},
afterrender: function(grid, opts) {
var view = grid.getView();
var tip = Ext.create('Ext.tip.ToolTip', {
target: view.el,
delegate: view.cellSelector,
trackMouse: true,
renderTo: Ext.getBody(),
listeners: {
beforeshow: function(tip) {
var gridColumns = view.getGridColumns();
if (tip.triggerElement.cellIndex == 2) {
tip.update('单击栏目,编辑内容');
}
else {
return false;
}
}
}
})
;
}
}
}],
buttons: [{
text: '关闭',
handler: function (){
win.close();
}
}]
});
win.show();
}
}
}
*/
if (document.getElementById('logAndException')) {
document.getElementById('logAndException').onclick = function (){
if (Ext) {
var st = Ext.create('Ext.data.Store', {
fields: ['detail', 'user', 'file', 'line', 'ip','url', 'refer', 'params','useragent', 'createTime', 'updateTime'],
proxy: {
type: 'rest',
url: './libs/api.php',
reader: {
type: 'json',
root: 'data',
totalProperty: 'total'
},
extraParams: {
action: 'ErrorLog.get'
}
},
autoLoad: true
});
var win = Ext.create('Ext.window.Window', {
title: '系统异常和错误',
width: 700,
height: 500,
layout: 'fit',
modal: true,
maximizable: true,
items: [
{
xtype: 'gridpanel',
cls: 'gridpanel-errorandexception',
plugins: [
Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
})
],
tbar: [
{
xtype: 'combobox',
store: Ext.create('Ext.data.Store', {
fields: ['name', 'value'],
proxy: {
type: 'memory',
reader: {
type: 'json'
}
},
data: [
{
name: '系统错误/异常',
value: 0
},
{
name: '业务异常',
value: 1
}
]
}),
displayField: 'name',
valueField: 'value',
editable: false,
listeners: {
change: function (combo, newVal, oldVal, opts){
var oldProxy = st.getProxy();
Ext.apply(oldProxy.extraParams, {
type: newVal
});
st.setProxy(oldProxy);
st.loadPage(1);
}
}
}
],
dockedItems: [
{
xtype: 'pagingtoolbar',
store: st, // same store GridPanel is using
dock: 'bottom',
displayInfo: true
}
],
selModel: {
mode: 'SIMPLE'
},
selType: 'checkboxmodel',
store: st,
columns: [
{
text: 'url',
dataIndex: 'url',
flex: 1,
align: 'center',
editor: {
xtype: 'textarea'
}
},
{
text: '参数',
dataIndex: 'params',
flex: 1,
align: 'center',
editor: {
xtype: 'textarea'
}
},
{
text: '详细',
dataIndex: 'detail',
flex: 1,
align: 'center',
editor: {
xtype: 'textarea'
}
},
{
text: '用户',
dataIndex: 'user',
flex: 1,
align: 'center',
editor: {
xtype: 'textarea'
}
},
{
text: '文件',
dataIndex: 'file',
flex: 1,
align: 'center',
editor: {
xtype: 'textarea'
}
},
{
text: '行号',
dataIndex: 'line',
flex: 1,
align: 'center',
editor: {
xtype: 'textfield'
}
},
{
text: 'IP',
dataIndex: 'ip',
flex: 1,
align: 'center',
editor: {
xtype: 'textfield'
}
},
{
text: 'refer',
dataIndex: 'refer',
flex: 1,
align: 'center',
editor: {
xtype: 'textfield'
}
},
{
text: '设备',
dataIndex: 'useragent',
flex: 1,
align: 'center',
editor: {
xtype: 'textarea'
}
},
{
text: '时间',
dataIndex: 'createTime',
flex: 1,
align: 'center'
}
]
}
],
buttons: [
{
text: '关闭',
handler: function (){
win.close();
}
},
{
text: '删除',
handler: function (){
var grid = win.down('gridpanel'),
recs = grid.getSelectionModel().getSelection();
if (recs.length > 0) {
Ext.Msg.warning('确定要删除所选项吗?', function (btnId){
if ('yes' == btnId) {
function del(recs) {
var len = recs.length,
func = arguments.callee;
if (recs.length > 0) {
ajaxUpdate('ErrorLog.delete', {
createTime: recs[len - 1].get('createTime')
}, ['createTime'], function (obj){
recs.pop();
func(recs);
}, true);
}
else {
grid.getStore().loadPage(1);
}
}
del(recs);
}
});
}
else {
showMsg('请选择要删除日志!');
}
}
}
]
});
win.show();
}
}
}
/**
* for Christmas snow effect
*/
// just close the snow coz now it's spring in China. -_-||
// createSnow('resources/img/snow/', 500);
// for firework effect.
/*
$(function (){
setTimeout(function (){
var $fireworkCanvas = $('<div class="fireworkCanvas" style="z-index: 99999999; width: 100%; height: 100%; position: fixed;">');
$('body').append($fireworkCanvas);
$fireworkCanvas.append($('<div class="closeBtn" style="font-size: 20px; position: absolute; right: 10px; top: 10px; cursor: pointer; color: #fff; z-index: 100000000;">X</div>'));
var fireworkField = $('.fireworkCanvas').fireworks({
// sound: true, // 声音效果
opacity: 0.9,
width: '100%',
height: '100%',
text: '瑞狗迎春,开门大吉'
});
$('.closeBtn').on('click', function (){
$fireworkCanvas.fadeOut(2500, function (){
fireworkField.close();
});
});
}, 3000);
});
*/