-
Notifications
You must be signed in to change notification settings - Fork 0
/
ajupdate.php
124 lines (117 loc) · 2.72 KB
/
ajupdate.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
<?php
include("includes/connect.php");
//var_dump($_GET['ids']);
$ids=$_GET['ids'];
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<form method="POST">
<input type="hidden" name="ids" value="<?php echo $ids;?>">
<table>
<?php
$upsele=mysql_query("SELECT students.*,district.* FROM students,district WHERE s_id='$ids'") or die(mysql_error());
if (mysql_num_rows($upsele)>0) {
//var_dump($row);
$row=mysql_fetch_array($upsele);
?>
<tr>
<td>Firstname</td><td><input type="text" name="fname1" value="<?php echo $row['firstname'];?>" size="20" class="inp"></td>
</tr>
<tr>
<td>Lastname</td><td><input type="text" name="lname" value="<?php echo $row['lastname'];?>" size="20" class="inp"></td>
</tr>
<tr>
<td>Gender</td><td width="40"><center><select name="gender" class="sex" colspan="3" value="<?php $row['gender'];?>">
<option value="male">Male</option>
<option value="female">Female</option>
</select>
</center>
</td>
</tr>
<tr>
<td>Birth</td><td>
<?php
echo "<select name='sel'>";
echo "<option>Y</option>";
$i=2016;
for ($i=2016; $i >=1800 ; $i--) {
echo "<option>".$i."</option>";
}//ending for loop
echo "</select>";
?>
<?php
echo "<select name='sele'>";
echo "<option>"."M"."</option>";
$i=1;
for ($i=1; $i <=12 ; $i++) {
echo "<option>".$i."</option>";
}
echo "</select>";
?>
<?php
echo "<select name='select'>";
echo "<option>"."D"."</option>";
$i=1;
for ($i=1; $i<=30 ; $i++) {
echo "<option>".$i."</option>";
}
echo "</select>";
?> </td>
</tr>
<tr>
<td>Address</td><td>
<select name="location">
<?php
$sq=mysql_query("SELECT * FROM district") or die(mysql_error());
while ($loa=mysql_fetch_array($sq)) {
?>
<option value="<?= $loa['district_id'];?>"><?php echo $loa['district_name'];?></option>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<td>Phone</td><td><input type="text" name="phone" value="<?php echo $row['phones'];?>" size="20" class="inp"></td>
</tr>
<tr>
<td>Fathername</td><td><input type="text" name="fname" value="<?php echo $row['fathername'];?>" size="20" class="inp"></td>
</tr>
<tr>
<td>Mathername</td><td><input type="text" name="mname" value="<?php echo $row['mathername'];?>" size="20" class="inp"></td>
</tr>
</tr>
<tr>
<td>Email</td><td><input type="email" name="emails" value="<?php echo $row['email'];?>" size="20" class="inp"></td>
</tr>
<tr>
<td>class</td><td>
<select name="classe">
<?php
$sql=mysql_query("SELECT *FROM classes");
if ($sql) {
$i=1;
while ($d=mysql_fetch_array($sql)) {
echo "<option>".$d['classname']."</option>";
}
}
?>
</select>
</td>
</tr>
<tr>
<td colspan="3" align="center" height="25" width="60">
<input type="submit" name="update" value="Update" class="upd" style="color:black;"></td>
</tr>
</table>
<?php
}
?>
</form>
</body>
</html>