-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditsection.php
106 lines (80 loc) · 4 KB
/
editsection.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
<?php
include('security.php');
include('includes/header_admin.php');
include('includes/navbar.php');
include('includes/overview.php');
include('addusers.php');
?>
<div id="section2">
<div class="panel-group">
<div class="panel panel-default">
<div class="panel-heading main-color-bg" >
<h3 class="panel-title">Grade & Section</h3>
</div>
<div class="panel-body">
<div class="modal-header" style="padding:10px;">
<h3 style="color: black;" class="glyphicon glyphicon-book"> Edit Grade & Section</h3>
</div><br>
<?php
include('database/connectdb.php');
if(isset($_POST['updategradsecBtn']))
{
$gradsec_id = $_POST['updategradsec_id'];
// $query = "SELECT * FROM gradsec WHERE gradsec_id = '$gradsec_id' ";
$query = "SELECT * FROM gradsec g INNER JOIN adviser a ON g.adviser_id = a.adviser_id WHERE gradsec_id = $gradsec_id ";
$query_run = mysqli_query($connection, $query);
foreach($query_run as $row)
{
?>
<form action="code.php" method="POST" enctype="multipart/form-data">
<input type="hidden" name="updategradsec_id" value="<?php echo $row['gradsec_id'] ?>" >
<div class="form-group">
<label ><span class="glyphicon glyphicon-pushpin"></span> Grade Level</label>
<input type="text" class="form-control input-lg" name="update_grade_level" value="<?php echo $row['grade_level'] ?>" placeholder="Enter Grade Level">
</div>
<div class="form-group">
<label ><span class="glyphicon glyphicon-pushpin"></span> Section Name</label>
<input type="text" class="form-control input-lg" name="update_section" value="<?php echo $row['section'] ?>" placeholder="Enter Section Name">
</div>
<?php
include('database/connectdb.php');
// $pupiladviser = "SELECT * FROM adviser a inner join gradsec g on a.adviser_id = g.adviser_id" ;
$pupiladviser = "SELECT * FROM adviser ORDER BY adviser.adviser_id DESC";
$pupadviser_run = mysqli_query($connection,$pupiladviser);
if(mysqli_num_rows($pupadviser_run)>0)
{
?>
<div class="form-group">
<label ><span class="glyphicon glyphicon-user"></span> Adviser</label>
<select name="adviser_id" class="form-control input-lg" required>
<option value="adviser_id"><?php echo $row['adviser_surname'].", ".$row['adviser_given_name']." ".$row['adviser_middle_name']; ?></option>
<?php
foreach($pupadviser_run as $row)
{
?>
<option value="<?php echo $row['adviser_id']; ?>">
<?php echo $row['adviser_surname'].", ".$row['adviser_given_name']." ".$row['adviser_middle_name']; ?>
</option>
<?php
}
}
?>
</select>
</div>
<div class="modal-footer">
<button type="submit" name="updategradsecBtn" class="btn btn-light btn-block"><span class="glyphicon glyphicon-save-file"></span> Update Grade & Section</button>
<br><a href="administrator.php#section2" type="submit" class="btn btn-secondary btn-default pull-right" ><span class="glyphicon glyphicon-remove"></span> Cancel</a>
</div>
</form>
<?php
}
}
?>
</div>
</div>
</div>
</div>
<?php
include('addpupil.php');
include('includes/scripts.php')
?>