-
Notifications
You must be signed in to change notification settings - Fork 23
/
at_f.php
265 lines (258 loc) · 8.82 KB
/
at_f.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
<?php
include './Database/Controler.php';
include 'role.php';
?>
<script src="https://code.jquery.com/jquery-1.12.4.js"> </script>
<script language="javascript" type="text/javascript">
function getYear(crs)
{
var crs=crs;
if(crs)
{
$.ajax({
type:"GET",
url:"dropdown.php",
data:"crs="+crs,
success:function(result)
{
$("#year").html(result);
}
});
}
}
function getSemester(yr)
{
var yr=yr;
if(yr)
{
$.ajax({
type: "GET",
url:"dropdown.php",
data:"yr="+yr,
success:function(result)
{
$("#semester").html(result);
}
});
$.ajax({
type: "GET",
url:"dropdown.php",
data:"year="+yr,
success:function(result)
{
$("#division").html(result);
}
});
}
}
function getSubject(sem)
{
var sem=sem;
if(sem)
{
$.ajax({
type: "GET",
url:"dropdown.php",
data:"sem="+sem,
success:function(result)
{
$("#subject").html(result);
}
});
}
}
function getFac(sub)
{
var sub=sub;
var cid=document.getElementById("c_id").value;
var sem=document.getElementById("semester").value;
if(sub)
{
$.ajax({
type: "GET",
url:"dropdown.php",
data:"sub="+sub,
success:function(result)
{
$("#fac").val(result);
}
});
}
if(sem==5 && cid==0 && sub==40 || sub==41)
{
$.ajax({
type: "GET",
url:"dropdown.php",
data:"nbatch="+sem,
success:function(result)
{
$("#new_batch").html(result);
}
});
}
}
function checkhd(dt)
{
var atdt=dt;
$.ajax({
type: "GET",
url:"dropdown.php",
data:"atdt="+atdt,
success:function(result)
{
if(result!="")
alert(result);
}
});
}
</script>
<script language="javascript" src="./assets/js/validation.js"></script>
<script language="javascript">
function str_check(event)
{
code=event.keyCode;
if(!((code>=65 && code<=90) || (code>=97 && code<=122) || (code==32)))
{
alert("Please Enter Only Characters");
event.keyCode=0;
}
}
function num_check(event)
{
code=event.keyCode
if(!((code>=48 && code<=57)))
{
alert("Please Enter Only Numbers");
event.keyCode=0;
}
}
function validate_form(f1)
{
if(isEmpty(f1.academic_yr.value,"Academicr year"))
{
alert(errMsg);
f1.academic_yr.focus();
return (false);
}
if(isEmpty(f1.c_id.value,"the Stream"))
{
alert(errMsg);
f1.c_id.focus();
return (false);
}
if(isEmpty(f1.year.value,"the Year"))
{
alert(errMsg);
f1.year.focus();
return (false);
}
if(isEmpty(f1.semester.value,"the Semester"))
{
alert(errMsg);
f1.semester.focus();
return (false);
}
if(isEmpty(f1.subject.value,"the Subject"))
{
alert(errMsg);
f1.subject.focus();
return (false);
}
if(isEmpty(f1.dt.value,"the Date"))
{
alert(errMsg);
f1.dt.focus();
return (false);
}
if(isEmpty(f1.division.value,"the Division"))
{
alert(errMsg);
f1.division.focus();
return (false);
}
}
</script>
<h2>Attendance Details</h2>
</div>
</div>
<!-- /. ROW -->
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-body">
<div class="table-responsive">
<form method="post" onSubmit="return validate_form(this)">
<table class="table table-striped table-bordered table-hover" id="dataTables-example">
<thead>
<tr>
<td>
<b>Select Academic Year:<select class="form-control" id="academic_yr" name="a_yr" >
<?php
if (isset($a_yf))
{
foreach ($a_yf as $y)
{
?>
<option value="<?php echo $y->ac_year_id;?>"><?php echo $y->ac_year; ?>
</option>
<?php
}
}
?>
</select></b>
</td>
<td>
<b>Select Stream:<select class="form-control" id="c_id" name="c_id" onChange="return getYear(this.value)">
<option value="">Select Stream</option>
<?php if(isset($crs)){$cnt=0;foreach($crs as $c){$cnt++; ?>
<option value="<?php echo $c->c_id; ?>"><?php echo $c->cname; ?></option>
<?php if($cnt=='2'){break;}}}?>
</select></b> </td>
</tr>
<tr>
<td><b>Select Year :<select id="year" class="form-control" name="year" onChange="return getSemester(this.value)">
</select></b></td>
<td>
<b>Select Semester:<select class="form-control" id="semester" name="semester" onChange="return getSubject(this.value)">
</select></b>
</td>
</tr>
<tr>
<td><b>Select Subject :<select class="form-control" id="subject" name="subject" onchange="return getFac(this.value)">
</select></b></td>
<td><b>Faculty Name:<input type="text" name="fac" id="fac" class="form-control" disabled=""></b></td>
</tr>
<tr>
<td id="new_batch" colspan="2"></td>
</tr>
<tr><td>
<b>Select Date:
<input class="form-control" type="Date" name="dt" id="dt" value="<?php echo date("Y-m-d") ?>" onchange="return checkhd(this.value)" disabled="">
</b>
</td>
<td>
<div class="form-group">
<b>Select Division:
<select class="form-control" id="division" name="division">
<option value="">Select Division</option>
</select>
</div>
</td>
</tr>
</thead>
<tr><td colspan="2"><center>
<button type="submit" id="act_submit_f" name="act_submit_f" value="submit" class="btn btn-primary"style="height: 100%; width: 30%;" >Submit</button>
</center> </td></tr>
</table>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
include 'footer.php';
?>