-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathviewinstitution.php
103 lines (94 loc) · 2.89 KB
/
viewinstitution.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
<?php
include("header.php");
include("connection.php");
if(isset($_POST[button]) && $_POST[institutetype] != "")
{
$resulta = mysqli_query($con,"SELECT * FROM institute where inst_type = '$_POST[institutetype]'");
}
else
{
$resulta = mysqli_query($con,"SELECT * FROM institute");
}
?>
<div id="main">
<div id="content" class="left">
<div class="highlight">
<h3>View institution</h3>
<form id="form1" name="form1" method="post" action="">
<p>
<label for="institutetype"> <a href="institute.php"><strong>Add new Institution</strong></a> Institution Type</label>
<select name="institutetype" id="institutetype">
<option value="">All</option>
<option value="Primary school" <?php
if($_POST[institutetype] == "Primary school")
{
echo " selected";
}
?>>Primary school</option>
<option value="High school" <?php
if($_POST[institutetype] == "High school")
{
echo " selected";
}
?>>High school</option>
<option value="PUC" <?php
if($_POST[institutetype] == "PUC")
{
echo " selected";
}
?>>PUC</option>
</select>
<input type="submit" name="button" id="button" value="Submit" />
</p>
</form>
<table width="615" border="1">
<tr>
<th width="87" height="51" scope="col">Institution ID</th>
<th width="124" scope="col" >Institution <br />
type </th>
<th width="178" scope="col">Institution <br />
name</th>
<th width="103" scope="col">Medium</th>
<th width="158" scope="col"><p>School type</p></th>
</tr>
<?php
while($rowa = mysqli_fetch_array($resulta))
{
echo "<tr>";
echo "<td> $rowa[inst_id]</td>";
$resultb = mysqli_query($con,"SELECT * FROM institute where inst_id='$rowa[inst_id]'");
while($rowb = mysqli_fetch_array($resultb))
{
$instype = $rowb[inst_type];
}
echo "<td> $instype</td>";
$instype = "";
echo "<td> <a href='viewinstituteprofile.php?proid=$rowa[inst_id]'>
$rowa[inst_name]</a></td>";
echo "<td> $rowa[medium]</td>";
echo "<td> $rowa[school_type]</td>";
echo "</tr>";
}
?>
</table>
<p> </p>
</div>
<div class="projects">
<div class="item"></div>
<div class="item">
<div class="cl"> </div>
</div>
</div>
</div>
<?php
include("sidebar.php");
?>
<div class="cl"> </div>
</div>
<div class="shadow-l"></div>
<div class="shadow-r"></div>
<div class="shadow-b"></div>
</div>
<?php
include("footer.php");
?>