-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdateinstituteprofile.php
250 lines (237 loc) · 7.6 KB
/
updateinstituteprofile.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
<?php
session_start();
include("header.php");
include("connection.php");
$dt = date("Y-m-d");
if(isset($_POST["Update"]))
{
$updt = mysqli_query($con,"UPDATE institute SET telephone='$_POST[telephone]',area_type='$_POST[areatype]',total_population='$_POST[totalpopulation]',school_status='$_POST[schoolstatus]' WHERE inst_id = '$_POST[instituteid]'");
if(mysqli_affected_rows($con)($updt) == 1)
{
$upmessage = "Institute Recordupdated successfully...";
}
}
$resulta = mysqli_query($con,"SELECT * FROM institute");
//$result = mysqli_query($con,"SELECT * FROM user ");
//if($_SESSION["logintype"] == "User")
//{
//while($rowa = mysqli_fetch_array($result))
// {
// if($rowa[s_emailid] == $_SESSION[loginid])
//{
// $instid = $rowa[inst_id];
// }
// }
//}
while($row = mysqli_fetch_array($resulta))
{
$instid = $row['inst_id'];
$instype=$row['inst_type'];
$instname=$row['inst_name'];
$telephone=$row['telephone'];
$areatype=$row['area_type'];
$totalpopulation=$row['total_population'];
$populationcom=$row['populationcommwise'];
$status=$row['school_status'];
}
?>
<div id="main">
<div id="content" class="left">
<div class="highlight">
<h3> View Institution Profile </h3>
<form id="form1" name="form1" method="post" action="">
<p><?php echo $upmessage; ?></p>
<p>
<a href="viewinstitution.php"><strong>View Institution</strong></a></p>
<table width="516" height="549" border="0">
<tr>
<td height="42"><input value="<?php echo $_GET[proid]; ?>" name="profileid" type="hidden" id="profileid" />
Institute ID</td>
<td colspan="2"><input name="instituteid" value="<?php echo $instid; ?>" type="text" id=" instituteid" size="50" readonly="readonly"/></td>
</tr>
<tr>
<td height="42">Institute type</td>
<td colspan="2"><select name="institutetype" id="institutetype">
<?php
while($row = mysqli_fetch_array($resulta))
{
if($instype == $row[inst_type])
{
echo "<option value='$row[inst_type]' selected='selected'> $row[inst_type] </option>";
}
else
{
echo "<option value='$row[inst_type]'> $row[inst_type] </option>";
}
}
?>
<option value="Primary school" <?php
if($instype == "Primary school")
{
echo " selected";
}
?>>Primary school</option>
<option value="High school" <?php
if($instype == "High school")
{
echo " selected";
}
?>>High school</option>
<option value="PUC" <?php
if($instype == "PUC")
{
echo " selected";
}
?>>PUC</option>
<option value="Degree" <?php
if($instype == "Degree")
{
echo " selected";
}
?>>Degree</option>
<option value="Post Graduate" <?php
if($instype == "Post Graduate")
{
echo " selected";
}
?>>Post Graduate</option>
</select></td>
</tr>
<tr>
<td height="42">Institute name</td>
<td colspan="2"><input type="text" value="<?php echo $instname; ?>"name="institutename" id="institutename" /></td>
</tr>
<tr>
<td width="198" height="42"> Telephone</td>
<td colspan="2"><input name="telephone" value="<?php echo $telephone; ?>" type="text" id="telephone" size="25" /></td>
</tr>
<tr>
<td height="30">Area type</td>
<td colspan="2"><select name="areatype" id="areatype">
<option value="rural" <?php
if($areatype == "rural")
{
echo " selected";
}
?>>rural</option>
<option value="urban" <?php
if($areatype == "urban")
{
echo " selected";
}
?>>urban</option>
</select></td>
</tr>
<tr>
<td>Total population</td>
<td colspan="2"><input type="text" name="totalpopulation"value="<?php echo $totalpopulation; ?>" id="totalpopulation" /></td>
</tr>
<tr>
<td height="245">Population communitywise</td>
<td colspan="2"><table width="277" height="230" border="0">
<tr>
<td width="207">Hindus</td>
<td width="178"><input name="hindus" type="text" id="hindus" size="10" /></td>
</tr>
<tr>
<td>Muslims</td>
<td><input name="muslims" type="text" id="muslims" size="10" /></td>
</tr>
<tr>
<td>Catholics</td>
<td><input name="catholics" type="text" id="catholics" size="10" /></td>
</tr>
<tr>
<td>SC</td>
<td><input name="sc" type="text" id="sc" size="10" /></td>
</tr>
<tr>
<td>ST</td>
<td><input name="st" type="text" id="st" size="10" /></td>
</tr>
<tr>
<td>OBC</td>
<td><input name="obc" type="text" id="obc" size="10" /></td>
</tr>
<tr>
<td>Jains</td>
<td><input name="jains" type="text" id="jains" size="10" /></td>
</tr>
<tr>
<td>Others</td>
<td><input name="others" type="text" id="others" size="10" /></td>
</tr>
</table></td>
</tr>
<tr>
<td height="28">School Status</td>
<td colspan="2"><select name="schoolstatus" id="schoolstatus">
<option value="own" <?php
if($status == "own")
{
echo " selected";
}
?>>Own</option>
<option value="rented" <?php
if($status == "rented")
{
echo " selected";
}
?>>Rented</option>
</select></td>
</tr>
<tr>
<td height="29"><input type="submit" name="Update" id="Update" value="Update" /></td>
<td height="29" colspan="2"> </td>
</tr>
</table>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>
<label for="emailid2"></label>
</p>
<p> </p>
<p> </p>
<p> </p>
<p>
<label for="populationcommunitywise"></label>
</p>
<p>
<label for="yearofestablishment"></label>
</p>
<p>
<label for="schoolstatus"></label>
</p>
<p>
<label for="medium"></label>
</p>
<p> </p>
<p>
<label for="schooltype"></label>
</p>
</form>
</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");
?>