-
Notifications
You must be signed in to change notification settings - Fork 0
/
edashboaed.php
169 lines (137 loc) · 5.86 KB
/
edashboaed.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
<?php
$GLOBALS['title'] = "Dashboard-Hostel-Management-System";
$page_name = "DashBoard";
require('include/sessionManager.php');
require('include/dbplayer.php');
$ses = new \sessionManager\sessionManager();
$ses->start();
if ($ses->isExpired()) {
header('Location: index.php');
} elseif ($ses->Get("userGroupId") == "UG004") {
header('Location: sdashboard.php');
} elseif ($ses->Get("userGroupId") == "UG002" || $ses->Get("userGroupId") == "UG001") {
header('Location:dashboard.php');
} else {
$name = $ses->Get("name");
$db = new \dbplayer\dbplayer();
$msg = $db->open();
if ($msg = "true") {
$result = $db->getData("SELECT serial,title,description,DATE_FORMAT(createdDate,'%D %M,%Y %h:%i:%s %p') as date FROM notice ORDER BY serial DESC LIMIT 4");
if (false === strpos((string)$result, "Can't")) {
$GLOBALS['data'] = $result;
} else {
echo '<script type="text/javascript"> alert("' . $result . '");</script>';
}
} else {
echo '<script type="text/javascript"> alert("' . $msg . '");</script>';
}
}
?>
<?php include('./emaster.php'); ?>
<div class="container">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header titlehms"><i class="fa fa-hand-o-right"></i>Dashboard<i class="fa fa-hand-o-left"></i></h1>
</div>
<!-- /.col-lg-12 -->
</div>
<div class="row">
<div class="col-lg-6">
<div class="panel panel-info">
<div class="panel-heading">
<i class="fa fa-list-alt fa-fw"></i>Notice Board
</div>
<div class="panel-body">
<div id="accordion" class="panel-group">
<?php while ($row = mysql_fetch_array($GLOBALS['data'])) {
echo '<div class="panel panel-success">
<div class="panel-heading">
<h4 class="panel-title">
<a href="#' . $row['serial'] . '" data-parent="#accordion" data-toggle="collapse" aria-expanded="false" class="collapsed">' . $row['title'] . ' [' . $row['date'] . ']</a>';
echo '</h4>
</div>
<div class="panel-collapse collapse" id="' . $row['serial'] . '" aria-expanded="false" style="height: 0px;">
<div class="panel-body">';
echo $row['description'];
echo '</div></div></div>';
}
?>
</div>
</div>
<div class="panel-footer">
</div>
</div>
</div>
<div class="col-lg-6">
<div class="custom-calendar-wrap">
<div id="custom-inner" class="custom-inner">
<div class="custom-header clearfix">
<nav>
<span id="custom-prev" class="custom-prev"></span>
<span id="custom-next" class="custom-next"></span>
</nav>
<h2 id="custom-month" class="custom-month"></h2>
<h2 id="custom-year" class="custom-year"></h2>
</div>
<div id="calendar" class="fc-calendar-container"></div>
</div>
</div>
</div>
</div>
</div>
<!-- /#page-wrapper -->
<?php include('./footer.php'); ?>
<script type="text/javascript">
$(function() {
var transEndEventNames = {
'WebkitTransition': 'webkitTransitionEnd',
'MozTransition': 'transitionend',
'OTransition': 'oTransitionEnd',
'msTransition': 'MSTransitionEnd',
'transition': 'transitionend'
},
transEndEventName = transEndEventNames[Modernizr.prefixed('transition')],
$wrapper = $('#custom-inner'),
$calendar = $('#calendar'),
cal = $calendar.calendario({
onDayClick: function($el, $contentEl, dateProperties) {
if ($contentEl.length > 0) {
showEvents($contentEl, dateProperties);
}
},
caldata: codropsEvents,
displayWeekAbbr: true
}),
$month = $('#custom-month').html(cal.getMonthName()),
$year = $('#custom-year').html(cal.getYear());
$('#custom-next').on('click', function() {
cal.gotoNextMonth(updateMonthYear);
});
$('#custom-prev').on('click', function() {
cal.gotoPreviousMonth(updateMonthYear);
});
function updateMonthYear() {
$month.html(cal.getMonthName());
$year.html(cal.getYear());
}
// just an example..
function showEvents($contentEl, dateProperties) {
hideEvents();
var $events = $('<div id="custom-content-reveal" class="custom-content-reveal"><h4>Events for ' + dateProperties.monthname + ' ' + dateProperties.day + ', ' + dateProperties.year + '</h4></div>'),
$close = $('<span class="custom-content-close"></span>').on('click', hideEvents);
$events.append($contentEl.html(), $close).insertAfter($wrapper);
setTimeout(function() {
$events.css('top', '0%');
}, 25);
}
function hideEvents() {
var $events = $('#custom-content-reveal');
if ($events.length > 0) {
$events.css('top', '100%');
Modernizr.csstransitions ? $events.on(transEndEventName, function() {
$(this).remove();
}) : $events.remove();
}
}
});
</script>