-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrecord.php
355 lines (286 loc) · 13 KB
/
record.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
<script src="assets/js/ie-emulation-modes-warning.js"></script>
<script type="text/javascript">
function getParameterByName(name, url) {
if (!url) {
url = window.location.href;
}
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
</script>
<script type="text/javascript">
$(document).ready(function()
{
$('#fetch').on('change',function()
{
var value = $(this).val();
var id = getParameterByName('id');
var val = 'id='+ encodeURIComponent(id) + '&request='+ encodeURIComponent(value);
$.ajax({
type:'POST',
url:'updateRecord.php?prog=<?php echo $_GET["prog"] ?>',
data:val,
beforeSend:function()
{
$("#fetch-feild").html('Working on Please wait ..');
},
success:function(data)
{
$("#fetch-feild").html(data);
},
});
});
});
</script>
<style>
input {
border: 0;
outline: 0;
background: transparent;
border-bottom: 1px solid black;
}
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
</style>
<?php
include 'db.php';
$id = $_GET['id'];
$sql= mysqli_query($conn, "SELECT * FROM student_info where STUDENT_ID = '$id' ");
while($row = mysqli_fetch_assoc($sql)) {
?>
<h1 class="page-header"><?php echo $row['LASTNAME'] . ', ' . $row['FIRSTNAME']. ' ' . $row['MIDDLENAME'] ?></h1>
<?php
} mysqli_close($conn);
?>
<div class="col-md-5">
<div class="form-inline">
<div class="form-group">
<a href="rms.php?page=record&id=<?php echo $_GET['id']?>" class="btn btn-success"> View All</a>
<label for="focusedInput">Select Year:</label>
<select class="form-control" style="height:30px;font-size:12px" id="fetch">
<option > </option>
<?php
include 'db.php';
$query=mysqli_query($conn,"SELECT * FROM grade Order by grade_id");
while($row=mysqli_fetch_assoc($query)){
?>
<option value="<?php echo $row['grade_id'] ?>"><?php echo $row['grade'] ?> </option>
<?php } ?>
</select>
</div>
</div>
</div>
<div class="col-md-7 text-right">
<?php $query = mysqli_query($conn,"SELECT school_year FROM school_year where status='Yes'");
while($sy = mysqli_fetch_assoc($query)){ ?>
<a class='btn btn-success' href="rms.php?page=addrecord&id=<?php echo $_GET['id'] ?>&sy=<?php echo $sy['school_year'] ?>&prog=<?php echo $_GET['prog'] ?>"><i class="fa fa-plus"> Add Record</i></a>
<?php
} ?>
</div>
<br>
<br>
<input type="text" style="width:100%;text-align:center" disabled>
<br>
<br>
<?php
include 'db.php';
$id = $_GET['id'];
$sql= mysqli_query($conn, "SELECT * FROM student_year_info left join grade on student_year_info.YEAR = grade.grade_id
left join advisers on student_year_info.ADVISER=advisers.adviser_id where STUDENT_ID = '$id' ");
while($row = mysqli_fetch_assoc($sql)) {
$syi= $row['SYI_ID'];
$sql1= mysqli_query($conn, "SELECT * FROM student_info where STUDENT_ID = '$id' ");
while($row1 = mysqli_fetch_assoc($sql1)) {
$sql3= mysqli_query($conn, "SELECT * FROM program where PROGRAM_ID = '".$row1['PROGRAM']."' ");
while($row2 = mysqli_fetch_assoc($sql3)) {
?>
<div id="fetch-feild">
<div class="col-md-12">
<label style="font-size:6" for="">School</label>
<input type="text" style="width:450px;text-align:center" value="<?php echo $row["SCHOOL"] ?>" disabled>
<label style="font-size:6" for="">Year</label>
<input type="text" style="width:150px;text-align:center" value="<?php echo $row2['PROGRAM'] . ' '. $row["grade"]; ?>" disabled>
<label style="font-size:6" for="">Semester</label>
<input type="text" style="width:100px;text-align:center" value="<?php echo $row["SECTION"] ?>" disabled>
<br>
<label style="font-size:6" for="">Total number of years in school to date</label>
<input type="text" style="width:290px;text-align:center" value="<?php echo $row["TOTAL_NO_OF_YEAR"] ?>" disabled>
<label style="font-size:6" for="">Academic Year</label>
<input type="text" style="width:150px;text-align:center" value="<?php echo $row["SCHOOL_YEAR"] ?>" disabled>
<br>
<div class="col-xs-9" style="width:690px">
<div class="row">
<div class="col-xs-4 text-center" style="height:53px;border:1px solid black;padding-right:1px">
<br>
<label for="" style="font-size:6">Subjects</label>
<br>
</div>
<div class="col-xs-4" style="height:53px;border:1px solid black;width:225px">
<label for="" style="font-size:6;text-align:center;width:200px;border-bottom:1px solid black">Marks</label>
<br>
<label for="" style="font-size:6;width:43px;border-right:1px solid black;text-align:center">1</label>
<label for="" style="font-size:6;width:52px;border-right:1px solid black;text-align:center">2</label>
<label for="" style="font-size:6;width:52px;border-right:1px solid black;text-align:center">3</label>
<label for="" style="font-size:6;width:30px;;text-align:center">4</label>
</div>
<div class="col-xs-1 text-center" style="height:53px;border:1px solid black">
<br>
<label for="" style="font-size:6">Final</label>
<br>
</div>
<div class="col-xs-1 text-center" style="height:53px;border:1px solid black">
<br>
<label for="" style="font-size:6">Units</label>
<br>
</div>
<div class="col-xs-1 text-center" style="height:53px;border:1px solid black;padding-left:1px;width:100px">
<label for="" style="font-size:15px;text-align:center">Passed or Failed</label>
<br>
</div>
</div>
<div class="row" >
<?php $sql2= mysqli_query($conn, "SELECT * FROM total_grades_subjects where SYI_ID = '$syi' order by SUBJECT ");
while($row2 = mysqli_fetch_assoc($sql2)){
$subj = $row2['SUBJECT'];
$sql3= mysqli_query($conn, "SELECT * FROM subjects where SUBJECT_ID = '$subj' ");
while($row3 = mysqli_fetch_assoc($sql3)){
?>
<div class="col-xs-4" style="border:1px solid black;height:20px">
<?php
if($row3['SUBJECT'] == " *Music"){
echo "     ".$row3['SUBJECT'];}
elseif($row3['SUBJECT'] == " *Arts"){
echo "     ".$row3['SUBJECT'];
}
elseif($row3['SUBJECT'] == " *Physical Education"){
echo "     ".$row3['SUBJECT'];
}
elseif($row3['SUBJECT'] == " *Health"){
echo "     ".$row3['SUBJECT'];
}
else{
echo $row3['SUBJECT'];
}
?>
</div>
<div class="col-xs-4" style="border:1px solid black;width:59px;height:20px;font-size:12px; padding-left: 5px;">
<?php echo $row2['1ST_GRADING'] ?>
</div>
<div class="col-xs-4" style="border:1px solid black;width:56px;height:20px;font-size:12px; padding-left: 5px;">
<?php echo $row2['2ND_GRADING'] ?>
</div>
<div class="col-xs-4" style="border:1px solid black;width:56px;height:20px;font-size:12px; padding-left: 5px;">
<?php echo $row2['3RD_GRADING'] ?>
</div>
<div class="col-xs-4" style="border:1px solid black;width:54px;height:20px;font-size:12px; padding-left: 5px;">
<?php echo $row2['4TH_GRADING'] ?>
</div>
<div class="col-xs-1 text-center" style="font-size:12px;border:1px solid black;height:20px;padding-left:1px">
<?php echo $row2['FINAL_GRADES'] ?>
</div>
<div class="col-xs-1 text-center" style="border:1px solid black;height:20px">
<?php echo $row2['UNITS'] ?>
</div>
<div class="col-xs-1 text-center" style="border:1px solid black;height:20px; padding-left: 2px;text-align:center;font-size:12px;width:100px">
<?php echo $row2['PASSED_FAILED'] ?>
</div>
<?php
}
}
?>
</div>
</div>
<div class="col-xs-3">
<div class="row">
<label style="font-size:10px" for="">Has advance unit in</label>
<input type="text" style="width:162px;text-align:center" value="<?php echo $row['ADVANCE_UNIT'] ?>" disabled>
</div>
<div class="row">
<br><br>
<label style="font-size:10px" for="">lacks unit in</label>
<input type="text" style="width:200px;text-align:center" value="<?php echo $row['LACK_UNIT'] ?>" disabled>
<br><br>
<label style="font-size:10px" for="">To be classified as</label>
<input type="text" style="width:170px;text-align:center" value="<?php echo $row['TO_BE_CLASSIFIED'] ?>" disabled>
<br><br>
<label style="font-size:10px" for="">Total Number of<br>years in school to date</label>
<input type="text" style="width:145px;text-align:center" value="<?php echo $row['TOTAL_NO_OF_YEAR'] ?>" disabled>
<br><br>
<label style="font-size:10px" for="">Adviser:</label>
<input type="text" style="width:220px;text-align:center"
value="<?php echo $row['name'] ?>" disabled>
<br><br>
<label style="font-size:10px" for="">General Average:</label>
<input type="text" style="width:175px;text-align:center" value="<?php echo $row['GEN_AVE'] ?>" disabled>
<br><br>
<label style="font-size:10px" for="">Rank:</label>
<input type="text" style="width:232px;text-align:center" value="<?php echo $row['RANK'] ?>" disabled>
<BR><BR><BR><br>
</div>
</div>
<div class="col-xs-12">
<table class="table" style="width:940px" >
<tr>
<th style="font-size:10px;text-align:center;width:130px">Months</td>
<th style="font-size:10px;text-align:center;width:50px">Jun</td>
<th style="font-size:10px;text-align:center;width:50px">Jul</td>
<th style="font-size:10px;text-align:center;width:50px">Aug</td>
<th style="font-size:10px;text-align:center;width:50px">Sept</td>
<th style="font-size:10px;text-align:center;width:50px">Oct</td>
<th style="font-size:10px;text-align:center;width:50px">Nov</td>
<th style="font-size:10px;text-align:center;width:50px">Dec</td>
<th style="font-size:10px;text-align:center;width:50px">Jan</td>
<th style="font-size:10px;text-align:center;width:50px">Feb</td>
<th style="font-size:10px;text-align:center;width:50px">March</td>
<th style="font-size:10px;text-align:center;width:50px">April</td>
<th style="font-size:10px;text-align:center;width:50px">May</td>
<th style="font-size:10px;text-align:center;width:130px">Total</td>
</tr>
<tr>
<td style="font-size:10px;text-align:center;width:130px">Days of School</td>
<?php
$atten= mysqli_query($conn, "SELECT * FROM attendance where SYI_ID = '$syi' order by ATT_ID ");
while($att=mysqli_fetch_assoc($atten)){
?>
<td style="font-size:10px;text-align:center;width:50px"> <?php echo $att['DAYS_OF_CLASSES'] ?></td>
<?php } ?>
<td style="font-size:10px;text-align:center;width:130px"><?php echo $row['TDAYS_OF_CLASSES'] ?> </td>
</tr>
<tr>
<td style="font-size:10px;text-align:center;width:130px">Days Present</td>
<?php
$atten2= mysqli_query($conn, "SELECT * FROM attendance where SYI_ID = '$syi' order by ATT_ID ");
while($att2=mysqli_fetch_assoc($atten2)){
?>
<td style="font-size:10px;text-align:center;width:50px">
<?php echo $att2['DAYS_PRESENT'] ?>
</td>
<?php } ?>
<td style="font-size:10px;text-align:center;width:130px">
<?php echo $row['TDAYS_PRESENT'] ?>
</td>
</tr>
</table>
</div>
</div>
<br>
<input type="text" style="width:100%;text-align:center" disabled>
<br>
<br>
<?php
}
}
}
mysqli_close($conn);
?>
</div>
</div>
</div>
</div>
</div>