-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathareareport.php
136 lines (129 loc) · 3.97 KB
/
areareport.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
<?php
session_start();
include("header.php");
include("connection.php");
?>
<div id="main">
<div id="content" class="left">
<div class="highlight">
<h3>Vicinity Report</h3>
<form id="form2" name="form2" method="post" action="">
<label for="textfield"></label>
<table width="371" border="0">
<tr>
<th width="122" height="35" scope="row"> School Type</th>
<td width="233"> <select name="insttype" id="insttype">
<?php
$arrec = array("Primary school","High school","PUC");
foreach($arrec as $value)
{
if($_POST[insttype] == $value)
{
echo "<option value='$value' selected>$value</option>";
}
else
{
echo "<option value='$value'>$value</option>";
}
}
?>
</select></td>
</tr>
<tr>
<th height="39" scope="row">Year </th>
<td> <select name="vyear" id="vyear">
<?php
$result = mysqli_query($con,"SELECT DISTINCT year FROM survey ORDER BY year");
while($arrays = mysqli_fetch_array($result))
{
if($_POST[vyear] ==$arrays[year])
{
echo "<option value='$arrays[year]' selected>$arrays[year]</option>";
}
else
{
echo "<option value='$arrays[year]'>$arrays[year]</option>";
}
}
?>
</select></td>
</tr>
<tr>
<th height="38" scope="row"> </th>
<td><input type="submit" name="submit" id="submit" value=" Submit " /></td>
</tr>
</table>
</form>
<p> </p>
<table width="539" height="79" border="1">
<tr bgcolor="#CCCC00">
<td align="center"><b>Urban</b></td>
<td height="23" align="center"bgcolor='#FFFFCC'>
<?php
$result = mysqli_query($con,"SELECT * from survey where year = '$_POST[vyear]'");
$i=0;
while($arrrec = mysqli_fetch_array($result))
{
$resulta = mysqli_query($con,"SELECT * from institute where inst_type= '$_POST[insttype]' AND inst_id='$arrrec[inst_id]' AND area_type='urban'");
while($arrreca = mysqli_fetch_array($resulta))
{
$i++;
}
}
echo $i;
?>
</td>
</tr>
<tr bgcolor="#CCCC00">
<td align="center"><strong>Rural</strong></td>
<td height="23" align="center"bgcolor='#FFFFCC'><?php
$result = mysqli_query($con,"SELECT * from survey where year = '$_POST[vyear]'");
$i=0;
while($arrrec = mysqli_fetch_array($result))
{
$resulta = mysqli_query($con,"SELECT * from institute where inst_type= '$_POST[insttype]' AND inst_id='$arrrec[inst_id]' AND area_type='rural'");
while($arrreca = mysqli_fetch_array($resulta))
{
$i++;
}
}
echo $i;
?>
</td>
</tr>
<tr bgcolor="#CCCC00">
<td width="332" align="center"><div align="center"><strong>Overall</strong></div></td>
<td width="191" height="23" align="center" bgcolor='#FFFFCC'>
<?php
$result = mysqli_query($con,"SELECT * from survey where year = '$_POST[vyear]'");
$i=0;
while($arrrec = mysqli_fetch_array($result))
{
$resulta = mysqli_query($con,"SELECT * from institute where inst_type= '$_POST[insttype]' AND inst_id='$arrrec[inst_id]'");
while($arrreca = mysqli_fetch_array($resulta))
{
$i++;
}
}
echo $i;
?></td>
</tr>
</table>
<label for="type"><a href="surveytype.php"><strong>Back</strong></a></label>
</div>
<div class="projects">
<div class="item"></div>
<div class="item">
<div class="cl"> </div>
</div>
</div>
</div>
<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");
?>