-
Notifications
You must be signed in to change notification settings - Fork 0
/
admiprofile (2).php
96 lines (95 loc) · 2.57 KB
/
admiprofile (2).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
<?php
session_start();
include("includes/connect.php");
if (!$_SESSION['deanp']) {
header("LOCATION:logout.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Setting</title>
<?php
include("includes/banner.php");
include("includes/header.php");
?>
<link rel="stylesheet" type="text/css" href="css/admin.css">
<style type="text/css">
#fter{background-color: #5da1a7;height:60px;margin-top: 350px;font-family:corbel;text-align: center;
padding-top: 3px;position: fixed;z-index: 1px;width: 1200px;
}
</style>
</head>
<body>
<div id="fter">
<h3>Allright reserved © by Mucyo Rene</h3>
</div>
<div id="deanspace">
<div style="margin-left:25%;background-color:#dde6f4;height:70%;width:50%;">
<?php
$quer=mysql_query("SELECT * FROM dean WHERE id='{$_SESSION['deanp']}'") or die(mysql_error());
$i=1;
while ($row=mysql_fetch_array($quer)) {
?>
<form method="POST">
<table align="center">
<tr>
<td>First name</td>
<td><input type="text" name="fname" value="<?= $row['firstname']?>" size="20"></td>
</tr>
<tr>
<td>Last name</td>
<td><input type="text" name="lname" value="<?= $row['lastname']?>" size="20"></td>
</tr>
<tr>
<td>Identification number</td>
<td><input type="text" name="idnumber" size="20" value="<?= $row['idnumber']?>"></td>
</tr>
<tr>
<td>Location</td>
<td><input type="text" name="loca" value="<?= $row['location']?>" size="20" disabled ></td>
</tr>
<tr>
<td>Phones</td>
<td><input type="text" name="phone" value="<?= $row['phones']?>" size="20"></td>
</tr>
<tr>
<td>Qualification</td>
<td><input type="text" name="quali" value="<?= $row['qualification']?>" size="20"></td>
</tr>
<tr>
<td>Username</td>
<td><input type="text" name="uname" value="<?= $row['username']?>" size="20"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="pass" value="<?= $row['password']?>" size="20"></td>
</tr>
<tr><td colspan="2" align="right"><input type="submit" name="update" value="Update"></td></tr>
</table>
</form>
<?php
$i++;}
?>
</div>
<?php
if (isset($_POST['update'])) {
$fna=mysql_real_escape_string($_POST['fname']);
$lna=mysql_real_escape_string($_POST['lname']);
$idn=mysql_real_escape_string($_POST['idnumber']);
$ph=mysql_real_escape_string($_POST['phone']);
$qu=mysql_real_escape_string($_POST['quali']);
$una=mysql_real_escape_string($_POST['uname']);
$pa=mysql_real_escape_string($_POST['pass']);
$rea=mysql_query("UPDATE dean SET firstname='$fna',lastname='$lna',idnumber='$idn',
phones='$ph',qualification='$qu',username='$una',password='$pa'") or die(mysql_error());
if ($rea) {
echo "<script>alert('done')</script>";
}else{
echo "<script>alert('not update')</script>";
}
}
?>
</div>
</body>
</html>