-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_adviser.php
36 lines (34 loc) · 1.08 KB
/
get_adviser.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
<?php
if($_POST['grade'] && $_POST['sec'] && $_POST['sy']){
include 'db.php';
$grade = $_POST['grade'];
$sec = $_POST['sec'];
$sy = $_POST['sy'];
$query = mysqli_query($conn,"SELECT * FROM advisers where grade_id ='$grade' AND section='$sec' AND school_year = '$sy' ");
$count = mysqli_num_rows($query);
if($count < 1){ ?>
<div class="row">
<label class="col-md-2 te" for="adviser">Adviser</label>
<div class="col-md-6">
<select type="text" name="adviser" class="form-control" id ="adviser" required readonly>
<option ></option?
</select>
</div>
</div>
<?php
}else{
while($row = mysqli_fetch_assoc($query)){
?>
<div class="row">
<label class="col-md-2 te" for="adviser">Adviser</label>
<div class="col-md-6">
<select type="text" name="adviser" class="form-control" id ="adviser" required readonly>
<option value="<?php echo $row['adviser_id'] ?>" ><?php echo $row['name'] ?> </option?
</select>
</div>
</div>
<?php
}
}
}
?>