-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstprofile.php
388 lines (373 loc) · 22.3 KB
/
stprofile.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
<?php
include_once "php/connection.php";
include_once "php/checkauthentication.php";
?>
<!DOCTYPE html>
<html>
<?php
$pageTitle = 'Student profile';
include_once "layout/header.php";
?>
<body class="animated fadeIn">
<div id="wrapper">
<?php
include_once "layout/menu.php";
?>
<div id="page-wrapper" class="gray-bg">
<?php
include_once "layout/topbar.php";
?>
<div class="row wrapper border-bottom white-bg page-heading animated fadeInLeftBig">
<div class="col-sm-4">
<h2><p>Student profile</p></h2>
</div>
</div>
<div class="wrapper wrapper-content animated fadeInRightBig">
<div class="row">
<div class="col-lg-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>View and edit student information</h5>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>
</a>
</div>
</div>
<div class="ibox-content">
<div id="collapseOne" class="panel-collapse collapse in">
<?php
$student_id=$_GET['student_id'];
$result=mysqli_query($con, "SELECT * FROM `students` where `stid`=$student_id");
$stinfores = mysqli_fetch_assoc($result);
$ressttype = $stinfores['sttype'];
$ressttype2 = $stinfores['sttype2'];
$resstyear = $stinfores['styear'];
$resstterm = $stinfores['stterm'];
$resstgroup = $stinfores['stgroup'];
?>
<form method="post" action="php/editstudent.php?student_id=<?php echo $student_id ?>" class="form-horizontal">
<div class="form-group">
<font face="myFirstFont">
<label class="col-sm-2 control-label">Student name</label>
<div class="col-sm-10">
<input required value="<?php echo $stinfores['stname'] ;?>" type="text" class="form-control" name="stname" >
</div>
</font>
</div>
<div class="form-group">
<font face="myFirstFont">
<label class="col-sm-2 control-label">Student code</label>
<div class="col-sm-10">
<input value="<?php echo $stinfores['stcode'] ;?>" type="text" class="form-control" name="stcode" >
</div>
</font>
</div>
<div class="form-group">
<font face="myFirstFont">
<label class="col-sm-2 control-label">Student number</label>
<div class="col-sm-10">
<input required value="<?php echo $stinfores['stmob'] ;?>" type="text" class="form-control" name="stmob" >
</div>
</font>
</div>
<div class="form-group">
<font face="myFirstFont">
<label class="col-sm-2 control-label">Student number 2</label>
<div class="col-sm-10">
<input value="<?php echo $stinfores['sttel'] ;?>" type="text" class="form-control" name="sttel" >
</div>
</font>
</div>
<div class="form-group">
<font face="myFirstFont">
<label class="col-sm-2 control-label">Student parent type</label>
<div class="col-sm-10">
<input value="<?php echo $stinfores['stparenttype'] ;?>" type="text" class="form-control" name="stparenttype" >
</div>
</font>
</div>
<div class="form-group">
<font face="myFirstFont">
<label class="col-sm-2 control-label">Student parent name</label>
<div class="col-sm-10">
<input value="<?php echo $stinfores['stparentname'] ;?>" type="text" class="form-control" name="stparentname" >
</div>
</font>
</div>
<div class="form-group">
<font face="myFirstFont">
<label class="col-sm-2 control-label">Student parent mob</label>
<div class="col-sm-10">
<input required value="<?php echo $stinfores['stparentmob'] ;?>" type="text" class="form-control" name="stparentmob" >
</div>
</font>
</div>
<div class="form-group">
<font face="myFirstFont">
<label class="col-sm-2 control-label">Student E-mail</label>
<div class="col-sm-10">
<input value="<?php echo $stinfores['stemail'] ;?>" type="text" class="form-control" name="stemail" >
</div>
</font>
</div>
<div class="form-group">
<font face="myFirstFont">
<label class="col-sm-2 control-label">Student address</label>
<div class="col-sm-10">
<input value="<?php echo $stinfores['staddress'] ;?>" type="text" class="form-control" name="staddress" >
</div>
</font>
</div>
<div class="form-group">
<font face="myFirstFont">
<label class="col-sm-2 control-label">Student ID</label>
<div class="col-sm-10">
<input value="<?php echo $stinfores['stnationalid'] ;?>" type="text" class="form-control" name="stnationalid" >
</div>
</font>
</div>
<div class="form-group">
<font face="myFirstFont">
<label class="col-sm-2 control-label">Student nature</label>
<div class="col-sm-10">
<select required class="multiselect" id="form-field-4" name="sttype" >
<option value="1" <?php if($ressttype=="1") echo 'selected="selected"'; ?>> إنتظام</option>
<option value="2" <?php if($ressttype=="2") echo 'selected="selected"'; ?>> إنتساب</option>
</select>
</div>
</font>
</div>
<div class="form-group">
<font face="myFirstFont">
<label class="col-sm-2 control-label">Student year</label>
<div class="col-sm-10">
<select required class="multiselect" id="form-field-4" name="styear" >
<option value="1" <?php if($resstyear=="1") echo 'selected="selected"'; ?>> الأولى</option>
<option value="2" <?php if($resstyear=="2") echo 'selected="selected"'; ?>> الثانية</option>
<option value="3" <?php if($resstyear=="3") echo 'selected="selected"'; ?>> الثالثة</option>
<option value="4" <?php if($resstyear=="4") echo 'selected="selected"'; ?>> الرابعة</option>
<option value="5" <?php if($resstyear=="5") echo 'selected="selected"'; ?>> متخرج</option>
</select>
</div>
</font>
</div>
<div class="form-group">
<font face="myFirstFont">
<label class="col-sm-2 control-label">Student term</label>
<div class="col-sm-10">
<select required class="multiselect" id="form-field-4" name="stterm" >
<option value="1" <?php if($resstterm=="1") echo 'selected="selected"'; ?>> الأول</option>
<option value="2" <?php if($resstterm=="2") echo 'selected="selected"'; ?>> الثاني</option>
<option value="3" <?php if($resstterm=="3") echo 'selected="selected"'; ?>> صيف</option>
</select>
</div>
</font>
</div>
<div class="form-group">
<font face="myFirstFont">
<label class="col-sm-2 control-label">Student group</label>
<div class="col-sm-10">
<select class="multiselect" id="form-field-4" name="stgroup" >
<option value="A" <?php if($resstgroup=="A") echo 'selected="selected"'; ?>> A</option>
<option value="B" <?php if($resstgroup=="B") echo 'selected="selected"'; ?>> B</option>
<option value="C" <?php if($resstgroup=="C") echo 'selected="selected"'; ?>> C</option>
<option value="E" <?php if($resstgroup=="E") echo 'selected="selected"'; ?>> E</option>
</select>
</div>
</font>
</div>
<div class="form-group">
<font face="myFirstFont">
<label class="col-sm-2 control-label">Student type</label>
<div class="col-sm-10">
<select required class="multiselect" id="form-field-4" name="sttype2" >
<option value="A" <?php if($ressttype2=="A") echo 'selected="selected"'; ?>> باقي إعادة</option>
<option value="B" <?php if($ressttype2=="B") echo 'selected="selected"'; ?>> مستجد</option>
<option value="C" <?php if($ressttype2=="C") echo 'selected="selected"'; ?>> مراجعة نهائية</option>
<option value="D" <?php if($ressttype2=="D") echo 'selected="selected"'; ?>> مراجعة</option>
<option value="E" <?php if($ressttype2=="E") echo 'selected="selected"'; ?>> منسحب</option>
</select>
</div>
</font>
</div>
<div class="form-group">
<font face="myFirstFont">
<label class="col-sm-2 control-label">Student balance</label>
<div class="col-sm-10">
<?php
if($_SESSION['5inarch']['role']=="1"){
?>
<input value="<?php echo $stinfores['stbalance'] ;?>" class="form-control" name="stbalance">
<?php
}else{
?>
<input value="<?php echo $stinfores['stbalance'] ;?>" class="hidden" name="stbalance">
<?php
if($stinfores['stbalance'] > 0):
$varb='<a href="" class="btn btn-xs btn-success">';
elseif($stinfores['stbalance'] < 0):
$varb='<a href="" class="btn btn-xs btn-danger">';
elseif($stinfores['stbalance'] == 0):
$varb='<a href="" class="btn btn-xs btn-warning">';
endif;
echo $varb.$stinfores['stbalance'];
};
?>
</a>
</div>
</font>
</div>
<div class="form-group">
<font face="myFirstFont">
<label class="col-sm-2 control-label">Materials</label>
<div class="col-sm-10">
<select class="form-control dual_select" name="materials[]" multiple>
<?php
$result2 = mysqli_query($con, "
SELECT
material.matid,
students.stcode,
students.stname,
students.stmob,
students.sttel,
students.stparenttype,
students.stparentname,
students.stparentmob,
students.stemail,
students.staddress,
students.stnationalid,
students.sttype,
students.sttype2,
students.styear,
students.stterm,
students.stgroup,
students.stbalance,
material.matname,
material.matyear,
material.matterm,
students.stid
FROM
students
INNER JOIN stmat ON stmat.students_stid = students.stid
INNER JOIN material ON stmat.material_matid = material.matid
WHERE
stmat.status = 1 AND
students.stid = '$student_id'");
while ($row2 = $result2->fetch_assoc()) {
unset($id2, $name2);
$matid = $row2['matid'];
$matname = $row2['matname'];
$matyear = $row2['matyear'];
$matterm = $row2['matterm'];
?>
<option selected value="<?php echo $row2['matid'] ?>"> <?php echo $row2['matname']." - ".$row2['matterm']." - ".$row2['matyear'] ?> </option>
<?php } ?>
<?php
$result2 = mysqli_query($con, "SELECT * FROM material WHERE matid NOT IN (SELECT material_matid FROM `stmat` where students_stid=$student_id AND status=1)");
while ($row2 = $result2->fetch_assoc()) {
unset($id2, $name2);
$matid = $row2['matid'];
$matname = $row2['matname'];
$matyear = $row2['matyear'];
$matterm = $row2['matterm'];
?>
<option value="<?php echo $row2['matid'] ?>"> <?php echo $row2['matname']." - ".$row2['matterm']." - ".$row2['matyear'] ?> </option>
<?php } ?>
</select>
</div>
</font>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<div class="col-sm-4 col-sm-offset-2">
<button class="btn" type="reset">
<i class="ace-icon fa fa-undo bigger-110"></i>
Reset
</button>
<button class="btn btn-info" type="Submit" name="submit">
<i class="ace-icon fa fa-check bigger-110"></i>
Submit
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<div>
<strong>Copyright</strong> We.Code © 2017
</div>
</div>
</div>
</div>
<?php
include_once "layout/modals.php";
?>
<!-- Mainly scripts -->
<script src="js/jquery-3.1.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="js/plugins/blueimp/jquery.blueimp-gallery.min.js"></script>
<!-- Custom and plugin javascript -->
<script src="js/inspinia.js"></script>
<script src="js/plugins/pace/pace.min.js"></script>
<!-- Data picker -->
<script src="js/plugins/datapicker/bootstrap-datepicker.js"></script>
<!-- Select2 -->
<script src="js/plugins/select2/select2.full.min.js"></script>
<!-- Chosen -->
<script src="js/plugins/chosen/chosen.jquery.js"></script>
<!-- Dual Listbox -->
<script src="js/plugins/dualListbox/jquery.bootstrap-duallistbox.js"></script>
<!-- Toastr -->
<script src="js/plugins/toastr/toastr.min.js"></script>
<!-- DROPZONE -->
<script src="js/plugins/dropzone/dropzone.js"></script>
<!-- iCheck -->
<script src="js/plugins/iCheck/icheck.min.js"></script>
<script>
$('.dual_select').bootstrapDualListbox({
selectorMinimalHeight: 300
});
</script>
<script>
$(document).ready(function() {
<?php
if (isset($_GET['backresult'])){
$backresult=$_GET['backresult'];
?>
setTimeout(function() {
toastr.options = {
closeButton: true,
progressBar: true,
showMethod: 'slideDown',
timeOut: 4000
};
toastr.
<?php
if ($backresult == "1"){
echo"success('تمت العملية بنجاح')";
}else{
echo "error('برجاء إعادة المحاولة', 'لم تتم العملية بنجاح')";
}
};?>;
}, 1300);
});
</script>
<script>
$(document).ready(function () {
$('.i-checks').iCheck({
checkboxClass: 'icheckbox_square-green',
radioClass: 'iradio_square-green',
});
});
</script>
</body>
<?php include_once "layout/scripts.php"; ?>
</html>