-
Notifications
You must be signed in to change notification settings - Fork 0
/
enrollment_edit.php
92 lines (80 loc) · 3.96 KB
/
enrollment_edit.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
<?php
include('connection.php');
include('topnav.php');
?>
<?php
$query = 'SELECT * FROM enrollment
WHERE
ENROLLMENT_ID ='.$_GET['id'];
$result = mysqli_query($db, $query) or die(mysqli_error($db));
while($row = mysqli_fetch_array($result))
{
$zz= $row['ENROLLMENT_ID'];
$i= $row['STUDENT'];
$a= $row['COURSE_ID'];
$b= $row['level_id'];
$c= $row['Status_id'];
$d= $row['DATE_ENROLLED'];
}
$id = $_GET['id'];
?>
<div class="container">
<div class="card card-register mx-auto mt-5">
<div class="card-header">Edit Records</div>
<div class="card-body">
<form role="form" method="post" action="enrollment_edit1.php">
<div class="form-group">
<p> Student: </p>
<input type="hidden" name="en_id" value="<?php echo $zz; ?>">
<input class="form-control" placeholder="STUDENT" type="text" name="STUDENT" value="<?php echo $i; ?>">
</div>
<?php
$sqll = "SELECT * FROM `course`";
$res = mysqli_query($db,$sqll) or die ("Error: $sqll");
$course ="<select class='form-control' name='course' required>
<option value='' disabled selected hidden>Select Course</option>";
while($row = mysqli_fetch_assoc($res)){
$course .="<option value='".$row['COURSE_ID']."'>".$row['NAME']."</option>";
}
$course .="</select>";
?>
<div class="form-group">
<?php echo $course; ?>
</div>
<?php
$queryy = "SELECT * FROM `level`";
$res2 = mysqli_query($db,$queryy) or die ("Error: $queryy");
$level ="<select class='form-control' name='level' required>
<option value='' disabled selected hidden>Select Year Level</option>";
while($row = mysqli_fetch_assoc($res2)){
$level .="<option value='".$row['level_id']."'>".$row['year_level']."</option>";
}
$level .="</select>";
?>
<div class="form-group">
<?php echo $level; ?>
</div>
<?php
$queryyy = "SELECT * FROM `status`";
$res3 = mysqli_query($db,$queryyy) or die ("Error: $queryyy");
$status ="<select class='form-control' name='status' required>
<option value='' disabled selected hidden>Select Status</option>";
while($row = mysqli_fetch_assoc($res3)){
$status .="<option value='".$row['Status_id']."'>".$row['status_name']."</option>";
}
$status .="</select>";
?>
<div class="form-group">
<?php echo $status; ?>
</div>
<div class="form-group">
<p> Date Enrolled: </p>
<input class="form-control" type="Date" name="DATE_ENROLLED" value="<?php echo $d; ?>">
</div>
<button type="submit" class="btn btn-primary btn-block">Update Record</button>
</form>
</div>
</div>
</div>
<!-- /.container-fluid -->
</body>