-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeptReport.php
214 lines (200 loc) · 6.1 KB
/
deptReport.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
<?php
session_start();
if(!isset($_SESSION["id"]))
{
header('Location: ./index.php');
}
else if($_SESSION["id"]!=="CSE003SF")
{
header('Location: ./home.php');
}
include_once("./db.php");
include_once("./navbar.php");
?>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Department Report</title>
<style>
body {
background-image: url("./images/bgpic.jpg");
}
</style>
</head>
<body>
<div class="ui raised card" style="margin:0 auto;margin-top:5%;width:30%" id="card">
<div class="content">
<div class="header">Department Report</div>
<div class="meta">
<span class="category">Weekly Class Details</span>
</div>
<div class="description" style="padding-top:3%">
<div class="ui form" autocomplete="off">
<div class="field">
<label>Year</label>
<select class="ui selection dropdown" id="batch" required>
<option value="">Select Year of Study</option>
<option value="2019">UG - II Year</option>
<option value="2018">UG - III Year</option>
<option value="2017">UG - IV Year</option>
<option value="2020">PG - I Year ( ME )</option>
</select>
</div>
<div class="field">
<label>Report Start date</label>
<div class="ui calendar" id="start">
<div class="ui input left icon">
<i class="calendar icon"></i>
<input type="text" placeholder="Start" id="st" autocomplete="off">
</div>
</div>
</div>
<div class="field">
<label>Report End date</label>
<div class="ui calendar" id="end">
<div class="ui input left icon">
<i class="calendar icon"></i>
<input type="text" placeholder="End" id="en" autocomplete="off">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="extra content">
<!-- <div class="left floated author">
<button class="ui black button">
Back
</button>
</div> -->
<button class="ui primary fluid raised button" id="submit">
Generate
</button>
</div>
</div>
<div class="ui raised segment" style="margin:0 auto; margin-top:3%;width:80%;display:none" id="table">
<table class="ui purple striped table">
<thead>
<tr><h1 class="ui block header">Online class Weekly Report</h1></tr>
<tr>
<th class="ten wide">Level of Programme</th>
<th class="six wide" id="pro"></th>
</tr>
<tr>
<th class="ten wide">Semester</th>
<th class="six wide" id="sem"></th>
</tr>
<tr>
<th class="ten wide">Generated Report Period</th>
<th class="six wide" id="pd"></th>
</tr>
</thead>
<tbody>
<tr>
<td>No.of.Theory Sessions Conducted</td>
<td id="theory"></td>
</tr>
<tr>
<td>No.of.Lab Sessions Conducted</td>
<td id="lab"></td>
</tr>
<tr>
<td>No.of.Tutorial Sessions Conducted</td>
<td id="tut"></td>
</tr>
<tr>
<td>No.of.Project Sessions Conducted</td>
<td id="proj"></td>
</tr>
<tr>
<td>No.of.Test Sessions Conducted</td>
<td id="test"></td>
</tr>
</tbody>
<tfoot>
<tr>
</tr></tfoot>
</table>
<br>
<button class="ui black button" id="back">
Back
</button>
</div>
<script>
$(document).ready(function(){
var today = new Date();
$('#start').calendar({
type: 'date',
minDate: new Date(2021,00,02),
maxDate: new Date(today.getFullYear(), today.getMonth(), today.getDate() ),
formatter: {
date: function(date, settings) {
if (!date) return '';
var day = date.getDate();
day=(day<10)?'0'+day: day;
var month = date.getMonth() +1;
month=(month<10)?'0'+month: month;
var year = date.getFullYear();
return day + '/' + month + '/' + year;
}
},
endCalendar: $('#end')
});
$('#end').calendar({
type: 'date',
maxDate: new Date(today.getFullYear(), today.getMonth(), today.getDate() ),
formatter: {
date: function(date, settings) {
if (!date) return '';
var day = date.getDate();
day=(day<10)?'0'+day: day;
var month = date.getMonth()+1 ;
month=(month<10)?'0'+month: month;
var year = date.getFullYear();
return day + '/' + month + '/' + year;
}
},
startCalendar: $('#start')
});
$("#batch").dropdown();
$("#submit").click(function(){
$("#submit").addClass("loading");
var b=$("#batch").val();
var s=$("#st").val();
var e=$("#en").val();
if(b===""||s===""||e==="")
{
Notiflix.Notify.Warning("Please fill all the fields");
$("#submit").removeClass("loading");
return;
}
$("#pro").html(b===2020?'PG':'UG');
$("#sem").html(b==2017?8:(b==2018?6:(b==2019?4:1)));
$("#pd").html(s+" to "+e);
var d="batch="+b+"&st="+s+"&en="+e+"&dept=generate";
$.ajax({
url: "./AJAX/util_handler.php",
data: d,
type: "POST",
success: function(res) {
$("#submit").removeClass("loading");
response=JSON.parse(res);
$("#theory").html(response["theory"]);
$("#lab").html(response["lab"]);
$("#tut").html(response["tut"]);
$("#test").html(response["test"]);
$("#proj").html(response["proj"]);
$("#card").hide();
$("#table").show();
}
});
});
$("#back").click(function(){
$("#table").hide();
$("#card").show();
});
});
</script>
</body>
</html>