-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathofficials_index.php
693 lines (621 loc) · 25 KB
/
officials_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
<?php session_start();
?>
<!DOCTYPE html>
<html lang="en">
<!-- Mirrored from g-axon.com/mouldifi-3.0/light/index.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 12 Nov 2016 02:47:46 GMT -->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Mouldifi - A fully responsive, HTML5 based admin theme">
<meta name="keywords" content="Responsive, HTML5, admin theme, business, professional, Mouldifi, web design, CSS3">
<title>KTX DHBK Đà Nẵng</title>
<!-- Site favicon -->
<link rel='shortcut icon' type='image/x-icon' href='images/favicon.ico' />
<!-- /site favicon -->
<!-- Entypo font stylesheet -->
<link href="css/entypo.css" rel="stylesheet">
<!-- /entypo font stylesheet -->
<!-- Font awesome stylesheet -->
<link href="css/font-awesome.min.css" rel="stylesheet">
<!-- /font awesome stylesheet -->
<!-- Bootstrap stylesheet min version -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- /bootstrap stylesheet min version -->
<!-- Mouldifi core stylesheet -->
<link href="css/mouldifi-core.css" rel="stylesheet">
<!-- /mouldifi core stylesheet -->
<link href="css/mouldifi-forms.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="css/style.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="js/html5shiv.min.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
<!--[if lte IE 8]>
<script src="js/plugins/flot/excanvas.min.js"></script>
<![endif]-->
</head>
<body>
<div class="back-to-top1">
</div>
<!-- Page container -->
<div class="page-container">
<!-- Page Sidebar -->
<div class="page-sidebar">
<!-- Site header -->
<header class="site-header">
<div class="site-logo"><a href="index.php"><img src="images/logo.png" alt="Mouldifi" title="Mouldifi"></a></div>
<div class="sidebar-collapse hidden-xs"><a class="sidebar-collapse-icon" href="#"><i class="icon-menu"></i></a></div>
<div class="sidebar-mobile-menu visible-xs"><a data-target="#side-nav" data-toggle="collapse" class="mobile-menu-icon" href="#"><i class="icon-menu"></i></a></div>
</header>
<!-- /site header -->
<!-- Main navigation -->
<ul id="side-nav" class="main-menu navbar-collapse collapse">
<li class="has-sub"><a href="introduce_index.php"><i class="icon-layout"></i><span class="title">Ký Túc Xá</span></a>
<ul class="nav collapse">
<li><a href="introduce_index.php"><span class="title">Giới Thiệu</span></a></li>
<li><a href="officials_index.php"><span class="title">Danh Sách Cán Bộ</span></a></li>
<li><a href="listroom_index.php"><span class="title">Thông Tin Phòng</span></a></li>
</ul>
</li>
<?php
if(isset($_SESSION['TaiKhoan'])){
echo "<li class='has-sub'><a href='panels.html'><i class='icon-users'></i><span class='title'>Người Dùng</span></a>
<ul class='nav collapse'>
<li><a href='index_user.php'><span class='title'>Thông tin cá nhân </span></a></li>
<li><a href='user_room_information.php'><span class='title'>Thông tin phòng</span></a></li>
<li><a href='user_thongbao.php'><span class='title'>Thông báo</span></a></li>
<li><a href='user_reported-missing.php'><span class='title'>Báo vắng</span></a></li>
<li><a href='user_extend-room.php'><span class='title'>Gia Hạn Phòng</span></a></li>
<li><a href='user_request.php'><span class='title'>Yêu Cầu</span></a></li>
<li><a href='service.php'><span class='title'>Dịch Vụ</span></a></li>
<li><a href='feedback.php'><span class='title'>Góp ý</span></a></li>
</ul>
</li>";
}else{
echo "<li class='has-sub'><a href='basic-tables.html'><i class='icon-window'></i><span class='title'>Hoạt Động Cư Trú</span></a>
<ul class='nav collapse'>
<li><a href='registation-room.php'><span class='title'>Đăng Ký Phòng</span></a></li>
</ul>
</li>";
}
?>
<li class="other-activity.html"><a href="orther-activity_index.php"><i class="icon-doc-text"></i><span class="title">Hoạt Động Khác</span></a>
</li>
<li class="seach.html"><a href="seach.php"><i class="icon-search"></i><span class="title">Tìm Kiếm</span></a>
</li>
</ul>
<!-- /main navigation -->
</div>
<!-- /page sidebar -->
<!-- Main container -->
<div class="main-container gray-bg">
<!-- Main header -->
<div class="main-header row">
<div class="col-sm-6 col-xs-5 height-header1">
<a href="index.php">
<div id="header-logo-img">
<img src="images/logobk.jpg" alt = "HTML5 icon" width="60" >
</div>
<div id="header-logo-infologo">
<h3><b>KÝ TÚC XÁ ĐẠI HỌC BÁCH KHOA</b></h3>
<p>Dormitory of University of Science and Technology</p>
</div>
</a>
</div>
<div class="col-sm-6 col-xs-7">
<!-- Kiểm tra session đăng nhập -->
<div style="float: right;">
<?php
if (isset($_SESSION['TaiKhoan'])){
echo "<a data-toggle='dropdown' class='dropdown-toggle' href='index_user.php' aria-expanded='false'>
<img width='44' class='img-circle avatar' alt='' src='images/nu.jpg'>{$_SESSION['TaiKhoan']}
<span class='caret'></span></a>
<ul class='dropdown-menu'>
<li><a href='#''><i class='icon-cog'></i>Account settings</a></li>
<li><a href='logout.php'><i class='icon-logout'></i>Logout</a></li>
</ul>";
}else{
echo "<div class='login-signup'>
<button class='btn btn-primary btn-width' type='button' style='margin-left:8px'>
<a href='login.php'>Đăng Nhập</a></button>
</div>";
}
?>
</div>
</div>
</div>
<!-- /main header -->
<!-- Main content -->
<div class="main-content">
<!-- List header -->
<div class="row datatable-wrapper form-inline">
<div class="col-lg-12">
<h1 class="page-title">Danh sách cán bộ</h1>
<!-- Breadcrumb -->
<ol class="breadcrumb breadcrumb-2">
<li><a href="index.php"><i class="fa fa-home"></i>Home</a></li>
<li>Ký túc xá</li>
<li class="active"><strong>Danh sách cán bộ</strong></li>
</ol>
</div>
</div>
<!-- /list header -->
<!-- Card grid view -->
<div class="cards-container grid-view">
<div class="row">
<?php
include('DatabaseConnection.php');
$sql2 = "SELECT MaCV,TenNV,SDT FROM nhanvien where MaNV in (1,2,3,4)" ;
$query = mysqli_query($link,$sql2);
while($row = mysqli_fetch_array($query,MYSQL_ASSOC)){
$sql1 = "SELECT TenCV,MaPB FROM chucvu WHERE MaCV='{$row['MaCV']}'";
$query1 = mysqli_query($link,$sql1);
while($row1 = mysqli_fetch_array($query1,MYSQL_ASSOC)){
$sql3 = "SELECT TenPB FROM phongban where MaPB='{$row1['MaPB']}'";
$query2 = mysqli_query($link,$sql3);
while($row2 = mysqli_fetch_array($query2,MYSQL_ASSOC)){
echo "<div class='col-lg-3 col-sm-6'>
<div class='card primary-view'>
<div class='card-header'>
<div class='card-photo'>
<img title='John Smith' alt='John Smith' src='images/man-3.jpg' class='img-circle avatar'>
</div>
<div class='card-short-description'>
<h5><span class='user-name user-name-fm'><a href='#'>{$row['TenNV']}</a></span></h5>
<p class='uppercase chucvu-fm'>{$row2['TenPB']}</p>
</div>
</div>
<div class='card-content officials-text'>
<p>SĐT: {$row['SDT']}</p>
<p>{$row1['TenCV']}</p>
</div>
</div>
</div>";
}
}
}
?>
</div>
<div class="row">
<?php
include('DatabaseConnection.php');
$sql2 = "SELECT MaCV,TenNV,SDT FROM nhanvien where MaNV in (5,6,7,8)" ;
$query = mysqli_query($link,$sql2);
while($row = mysqli_fetch_array($query,MYSQL_ASSOC)){
$sql1 = "SELECT TenCV,MaPB FROM chucvu WHERE MaCV='{$row['MaCV']}'";
$query1 = mysqli_query($link,$sql1);
while($row1 = mysqli_fetch_array($query1,MYSQL_ASSOC)){
$sql3 = "SELECT TenPB FROM phongban where MaPB='{$row1['MaPB']}'";
$query2 = mysqli_query($link,$sql3);
while($row2 = mysqli_fetch_array($query2,MYSQL_ASSOC)){
echo "<div class='col-lg-3 col-sm-6'>
<div class='card primary-view'>
<div class='card-header'>
<div class='card-photo'>
<img title='John Smith' alt='John Smith' src='images/man-3.jpg' class='img-circle avatar'>
</div>
<div class='card-short-description'>
<h5><span class='user-name user-name-fm'><a href='#'>{$row['TenNV']}</a></span></h5>
<p class='uppercase chucvu-fm'>{$row2['TenPB']}</p>
</div>
</div>
<div class='card-content officials-text'>
<p>SĐT: {$row['SDT']}</p>
<p>{$row1['TenCV']}</p>
</div>
</div>
</div>";
}
}
}
?>
</div>
</div>
</div>
<!-- Footer -->
<footer class="footer-main">
<div class="container">
<div id="footer-content-nav">
<div id="footer-content-nav-brand" style="float: left;">
<h4><a href="#"><b>KÝ TÚC XÁ ĐẠI HỌC BÁCH KHOA</b></a></h4>
</div>
<div id="footer-content-nav-links" style="float: right;">
<a href="#"><span class="glyphicon glyphicon-open" aria-hidden="true"></span></a>
</div>
</div>
<div id="footer-content-links" style="padding-top: 10px">
<div class="links-group contact" style="float: left;">
<h4>LIÊN HỆ</h4>
<p>Ban quản lý KTX - Đại học Bách Khoa.</p>
<p>Địa chỉ: 60 Ngô Sĩ Liên, phường Hòa Khánh, quận Liên Chiểu, TP.Đà Nẵng.</p>
<p>Tel: 0511.3736.936</p>
<p>Email: [email protected]</p>
</div>
<div class="links-group connectus" style="margin-left: 80px;float: left;">
<h4>LIÊN KẾT</h4>
<a href="http://udn.vn/" target="_blank">Trang Đại Học Đà Nẵng</a><br>
<a href="http://dut.udn.vn/" target="_blank">Trang Đại Học Bách Khoa</a><br>
<a href="http://daotao.dut.udn.vn/" target="_blank">Trang Đào Tạo</a><br>
<a href="http://daotao.dut.udn.vn/sv" target="_blank">Hệ thống trang tín chỉ</a><br>
<a href="http://ctsv.dut.udn.vn/" target="_blank">Phòng công tác sinh viên</a><br>
<a href="http://yu.dut.udn.vn/" target="_blank">Đoàn Trường Bách Khoa</a>
</div>
</div>
</div>
</footer>
<!-- /footer -->
</div>
<!-- /main content -->
</div>
<!-- /main container -->
</div>
</span>
<div class="fixed">
<a href="https://www.facebook.com/Dormitory-DUT-560787624081622/" targer="_blank"><img class="fa-fa-fmxx" src="images/fb.png" alt="HTML5 icon" width="35"></a>
<a href="https://twitter.com" target="_blank"><img class="fa-fa-fmxx" src="images/tw.png" alt="HTML5 icon" width="35"> </a>
<a href="https://www.youtube.com/user/googleplusupdates" target="_blank"><img class="fa-fa-fmxx" src="images/gp.png" alt="HTML5 icon" width="35"> </a>
</div>
<!--Load JQuery-->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/plugins/metismenu/jquery.metisMenu.js"></script>
<script src="js/plugins/blockui-master/jquery-ui.js"></script>
<script src="js/plugins/blockui-master/jquery.blockUI.js"></script>
<!--Float Charts-->
<script src="js/plugins/flot/jquery.flot.min.js"></script>
<script src="js/plugins/flot/jquery.flot.tooltip.min.js"></script>
<script src="js/plugins/flot/jquery.flot.resize.min.js"></script>
<script src="js/plugins/flot/jquery.flot.selection.min.js"></script>
<script src="js/plugins/flot/jquery.flot.pie.min.js"></script>
<script src="js/plugins/flot/jquery.flot.time.min.js"></script>
<script src="js/functions.js"></script>
<!--ChartJs-->
<script src="js/plugins/chartjs/Chart.min.js"></script>
<script>
$(document).ready(function () {
var $checkbox = $('.todo-list .checkbox input[type=checkbox]');
$checkbox.change(function () {
if ($(this).is(':checked')) {
$(this).parent().addClass('checked');
} else {
$(this).parent().removeClass('checked');
}
});
$checkbox.each(function (index) {
if ($(this).is(':checked')) {
$(this).parent().addClass('checked');
} else {
$(this).parent().removeClass('checked');
}
});
// charts
var monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
var previousPoint = null;
$('#graph-bars, #graph-lines').bind('plothover', function (event, pos, item) {
if (item) {
if (previousPoint != item.dataIndex) {
previousPoint = item.dataIndex;
$('#flotTip').remove();
var x = item.datapoint[0],
y = item.datapoint[1];
var color = item.series.color;
var day = new Date(x).getDate();
var month = monthNames[new Date(x).getMonth()];
var year = new Date(x).getFullYear();
showTooltip(item.pageX,
item.pageY,
day + ' ' + month + ',' + year
+ " : <strong>" + y +
" visitors</strong>");
/*content = item.series.label + ' = ' + item.datapoint[1];
showTooltip(item.pageX, item.pageY, content);
showTooltip(item.pageX, item.pageY, y + ' visitors at ' + x + '.00h');*/
}
} else {
$('#flotTip').remove();
previousPoint = null;
}
});
var graphData = [{
// Visits
data: [[1196463600000, 45], [1196550000000, 30], [1196636400000, 98], [1196722800000, 37], [1196809200000, 95], [1196895600000, 45], [1196982000000, 65],
[1197068400000, 120], [1197154800000, 90], [1197241200000, 65], [1197327600000, 50]],
color: '#ff7575'
}, {
// Returning Visits
data: [[1196463600000, 100], [1196550000000, 170], [1196636400000, 260], [1196722800000, 127], [1196809200000, 240], [1196895600000, 180], [1196982000000, 160],
[1197068400000, 210], [1197154800000, 270], [1197241200000, 120], [1197327600000, 85]],
color: '#77b7c5',
}
];
// Lines
$.plot($('#graph-lines'), graphData, {
series: {
points: {
show: true,
radius: 3.5
},
lines: {
show: true,
fill: true
},
shadowSize: 0
},
grid: {
color: '#646464',
borderColor: 'transparent',
borderWidth: 20,
hoverable: true
},
xaxis: {
mode: "time",
tickColor: 'transparent',
tickDecimals: 2
},
yaxis: {
tickSize: 100
}
});
// Bars
$.plot($('#graph-bars'), graphData, {
series: {
points: {
show: true,
radius: 3.5,
},
lines: {
show: true,
fill: false
},
bars: {
show: false,
lineWidth: 5,
align: 'center'
},
shadowSize: 0,
hoverable: true
},
grid: {
color: '#646464',
borderColor: 'transparent',
borderWidth: 20,
hoverable: true
},
xaxis: {
mode: "time",
tickColor: 'transparent',
tickDecimals: 2
},
yaxis: {
tickSize: 100
}
});
var $graphBar = $('#graph-bars'), $graphLine = $('#graph-lines'), $linkLine = $('#lines'), $linkBar = $('#bars');
$graphBar.hide();
$linkLine.on('click', function (e) {
e.preventDefault();
$linkBar.removeClass('active');
$graphBar.fadeOut(function () {
$(this).addClass('active');
$graphLine.fadeIn();
});
});
$linkBar.on('click', function (e) {
e.preventDefault();
$linkLine.removeClass('active');
$graphLine.fadeOut(function () {
$(this).addClass('active');
$graphBar.fadeIn();
});
});
var revenueData = [{
// Visits
data: [[1475280000000, 400.05], [1475366400000, 1600.32], [1475452800000, 900.35], [1475539200000, 2100.31], [1475625600000, 1800.55], [1475712000000, 900.42], [1475798400000, 2885.01], [1475884800000, 1870.97], [1475971200000, 2145.14], [1476057600000, 1130.14], [1476144000000, 1490.02], [1476230400000, 740.74], [1476316800000, 1280.88], [1476403200000, 1157.71], [1476489600000, 599.71], [1476576000000, 2159.89], [1476662400000, 1557.81], [1476748800000, 959.06], [1476835200000, 158.00], [1476921600000, 757.99], [1477008000000, 800], [1477094400000, 950.25], [1477180800000, 1289.22], [1477267200000, 400.52], [1477353600000, 2425], [1477440000000, 1300.35], [1477526400000, 1600.20], [1477612800000, 890.65], [1477699200000, 2165.29], [1477785600000, 1566.22], [1477872000000, 2064.33]],
//data: [[6, 400], [7, 1600], [8, 900], [9, 2100], [10, 1200], [12, 1800]],
//data: [[1167692400000, 1600.05], [1167778800000, 5800.32], [1167865200000, 570.35], [1167951600000, 5600.31], [1168210800000, 1155.55], [1168297200000, 2255.64], [1168383600000, 5334.02], [1168470000000, 1151.88], [1168556400000, 3352.99], [1168815600000, 2652.99], [1168902000000, 3251.21], [1168988400000, 4152.24], [1169074800000, 4450.48], [1169161200000, 7751.99], [1169420400000, 5851.13], [1169506800000, 1555.04], [1169593200000, 55.37], [1169679600000, 54.23], [1169766000000, 55.42], [1170025200000, 54.01], [1170111600000, 56.97], [1170198000000, 58.14], [1170284400000, 58.14], [1170370800000, 59.02], [1170630000000, 58.74], [1170716400000, 58.88], [1170802800000, 57.71], [1170889200000, 59.71], [1170975600000, 59.89], [1171234800000, 57.81], [1171321200000, 59.06], [1171407600000, 58.00], [1171494000000, 57.99], [1171580400000, 59.39], [1171839600000, 59.39], [1171926000000, 58.07], [1172012400000, 60.07], [1172098800000, 61.14], [1172444400000, 61.39], [1172530800000, 61.46], [1172617200000, 61.79], [1172703600000, 62.00], [1172790000000, 60.07], [1173135600000, 60.69], [1173222000000, 61.82], [1173308400000, 60.05], [1173654000000, 58.91], [1173740400000, 57.93], [1173826800000, 58.16], [1173913200000, 57.55], [1173999600000, 57.11], [1174258800000, 56.59], [1174345200000, 59.61], [1174518000000, 61.69], [1174604400000, 62.28], [1174860000000, 62.91], [1174946400000, 62.93], [1175032800000, 64.03], [1175119200000, 66.03], [1175205600000, 65.87], [1175464800000, 64.64], [1175637600000, 64.38], [1175724000000, 64.28], [1175810400000, 64.28], [1176069600000, 61.51], [1176156000000, 61.89], [1176242400000, 62.01], [1176328800000, 63.85], [1176415200000, 63.63], [1176674400000, 63.61], [1176760800000, 63.10], [1176847200000, 63.13], [1176933600000, 61.83], [1177020000000, 63.38], [1177279200000, 64.58], [1177452000000, 65.84], [1177538400000, 65.06], [1177624800000, 66.46], [1177884000000, 64.40], [1178056800000, 63.68], [1178143200000, 63.19], [1178229600000, 61.93], [1178488800000, 61.47], [1178575200000, 61.55], [1178748000000, 61.81], [1178834400000, 62.37], [1179093600000, 62.46], [1179180000000, 63.17], [1179266400000, 62.55], [1179352800000, 64.94], [1179698400000, 66.27], [1179784800000, 65.50], [1179871200000, 65.77], [1179957600000, 64.18], [1180044000000, 65.20], [1180389600000, 63.15], [1180476000000, 63.49], [1180562400000, 65.08], [1180908000000, 66.30], [1180994400000, 65.96], [1181167200000, 66.93], [1181253600000, 65.98], [1181599200000, 65.35], [1181685600000, 66.26], [1181858400000, 68.00], [1182117600000, 69.09], [1182204000000, 69.10]],
color: '#fff',
label: 'Revenue($)',
dashes: {show: true}
}
];
$('#placeholder_overview, #Revenue-lines').bind('plothover', function (event, pos, item) {
if (item) {
if (previousPoint != item.dataIndex) {
previousPoint = item.dataIndex;
$('#flotTip').remove();
var x = item.datapoint[0],
y = item.datapoint[1];
//showTooltip(item.pageX, item.pageY, y + ' visitors at ' + x + '.00h');
var color = item.series.color;
var day = new Date(x).getDate();
var month = monthNames[new Date(x).getMonth()];
var year = new Date(x).getFullYear();
showTooltip(item.pageX,
item.pageY,
day + ' ' + month + ',' + year
+ " : <strong>" + y +
"($)</strong>");
}
} else {
$('#flotTip').remove();
previousPoint = null;
}
});
var options = {
series: {
points: {
show: true,
radius: 3.5,
fillColor: "rgba(0,0,0,0.35)",
},
lines: {
show: true,
lineWidth: 2,
fill: true
},
bars: {
show: false,
lineWidth: 2
},
shadowSize: 10,
//highlightColor: '#fff',
hoverable: true,
clickable: true,
},
grid: {
color: '#646464',
borderColor: 'transparent',
borderWidth: 20,
hoverable: true,
tickColor: "rgba(255,255,255,0.05)",
markingsColor: "rgba(255,255,255,0.05)",
markingsLineWidth: 5,
/*backgroundColor: {
colors: ["rgba(54,58,60,0.05)", "rgba(0,0,0,0.2)"]
}*/
},
legend: {
show: true
},
xaxis: {
mode: 'time',
font: {
weight: "bold"
},
color: "#D6D8DB",
tickColor: 'transparent',
tickDecimals: 2
},
selection: {
mode: "x"
},
yaxis: {
font: {
weight: "bold"
},
color: "#D6D8DB",
tickSize: 500
}
};
// Lines
var plot = $.plot($('#Revenue-lines'), revenueData, options);
// Bars
var overview = $.plot($("#placeholder_overview"), revenueData, {
colors: ["#edc240", "#5eb95e"],
series: {
bars: {
show: true,
lineWidth: 5,
fillColor: "#5eb95e"
},
shadowSize: 2,
grow: {
active: false
}
},
legend: {
show: false
},
xaxis: {
ticks: [],
mode: "time"
},
yaxis: {
ticks: [],
min: 0,
autoscaleMargin: 0.1
},
selection: {
mode: "x"
},
grid: {
color: "#D6D8DB",
borderColor: 'transparent',
markingsColor: "rgba(255,255,255,0.05)",
/*backgroundColor: {
colors: ["rgba(54,58,60,0.05)", "rgba(0,0,0,0.2)"]
}*/
}
});
$("#Revenue-lines").bind("plotselected", function (event, ranges) {
// do the zooming
plot = $.plot($("#Revenue-lines"), revenueData,
$.extend(true, {}, options, {
xaxis: {
min: ranges.xaxis.from,
max: ranges.xaxis.to
}
}));
// don't fire event on the overview to prevent eternal loop
overview.setSelection(ranges, true);
});
$("#placeholder_overview").bind("plotselected", function (event, ranges) {
plot.setSelection(ranges);
});
$("#Revenuelines").click(function (event) {
event.preventDefault();
overview.clearSelection();
$.plot($("#Revenue-lines"), revenueData, options);
});
// pie graph
var doughnutData = [
{
value: 5742,
color: "#2bbfba",
highlight: "#1fb3ae",
label: "Only Visited"
},
{
value: 2496,
color: "#00b8ce",
highlight: "#00acc2",
label: "Purchased"
},
{
value: 1762,
color: "#e5e8eb",
highlight: "#d9dcdf",
label: "Bounced"
}
];
var doughnutOptions = {
segmentShowStroke: true,
segmentStrokeColor: "#fff",
segmentStrokeWidth: 4,
percentageInnerCutout: 60, // This is 0 for Pie charts
animationSteps: 100,
animationEasing: "easeOutBounce",
animateRotate: true,
animateScale: false,
responsive: true,
//String - A legend template
legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li><span style=\"background-color:<%=segments[i].fillColor%>\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>"
};
var canvas = document.getElementById("doughnutChart");
var helpers = Chart.helpers;
//var ctx = document.getElementById("doughnutChart").getContext("2d");
var moduleDoughnut = new Chart(canvas.getContext("2d")).Doughnut(doughnutData, doughnutOptions);
var legendHolder = document.createElement('div');
legendHolder.innerHTML = moduleDoughnut.generateLegend();
helpers.each(legendHolder.firstChild.childNodes, function (legendNode, index) {
helpers.addEvent(legendNode, 'mouseover', function () {
var activeSegment = moduleDoughnut.segments[index];
activeSegment.save();
activeSegment.fillColor = activeSegment.highlightColor;
moduleDoughnut.showTooltip([activeSegment]);
activeSegment.restore();
});
});
helpers.addEvent(legendHolder.firstChild, 'mouseout', function () {
moduleDoughnut.draw();
});
canvas.parentNode.parentNode.appendChild(legendHolder.firstChild);
});
</script>
</body>
<!-- Mirrored from g-axon.com/mouldifi-3.0/light/index.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 12 Nov 2016 02:48:19 GMT -->
</html>