-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditProfilePro.php
More file actions
50 lines (46 loc) · 2.07 KB
/
editProfilePro.php
File metadata and controls
50 lines (46 loc) · 2.07 KB
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
<?php
include "link.php";
$account = $_SESSION["account"];
$idNumber = $_SESSION["idNumber"];
$position = $_SESSION["position"];
if($_SESSION["privilege"] == 'professor'){
//find info
$query = "SELECT * FROM $position WHERE account='$account'";
$result = $mysqli->query($query);
//list info
while ($row = $result->fetch_assoc()){
$password = $row['password'];
$name = $row['name'];
$department = $row['department'];
}
}
?>
<script type="text/javascript">
var compare = {
account:'<?php echo $account?>',
name:'<?php echo $name?>',
idNumber:'<?php echo $idNumber?>',
department:'<?php echo $department?>',
};
</script>
<form method="post" action="updateProfile.php?type=professor">
<label>Account</label>
<input id="proAccount" name="account" type="text" value=<?php echo $account?> class="input-xlarge" onblur="update(this, compare.account,document.getElementById('proAccountHelp'));">
<span class="help-block" id="proAccountHelp"></span>
<label>Old Password</label>
<input id="proPassword" name="password" type="password" value="" class="input-xlarge" onchange="updatePassword(this,document.getElementById('proPasswordHelpOld'));">
<span class="help-block" id="proPasswordHelpOld"></span>
<label>New Password</label>
<input id="nproPassword" name="npassword" type="password" value="" class="input-xlarge" onchange="updatePassword(this,document.getElementById('proPasswordHelpNew'));">
<span class="help-block" id="proPasswordHelpNew"></span>
<label>Name</label>
<input id="proName" name="name" type="text" value=<?php echo $name?> class="input-xlarge" onchange="validateName(this,document.getElementById('proNameHelp'));">
<span class="help-block" id="proNameHelp"></span>
<label>IDNumber</label>
<input id="proID" name="idNumber" type="text" value=<?php echo $idNumber?> class="input-xlarge" onblur="update(this,compare.idNumber,document.getElementById('proIDHelp'));">
<span class="help-block" id="proIDHelp"></span>
<div>
<button class="btn btn-primary">Update Profile</button>
</div>
<span class="help-block" id="proUpdateHelp"></span>
</form>