-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.php
45 lines (39 loc) · 1.48 KB
/
update.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
<?php
include "header.php";
include "dbfunction.php";
function filltable()
{
$data = null;
if (!empty($_GET["id"])) {
$data = selectbyid($_GET['id']);
} else {
header("location:index.php");
}
//$data = selectbyid($_GET['id']);
return $data;
}
$data = filltable();
?>
<div>
<form action="valid.php" method="POST">
<input type="hidden" name="id" value="<?php if(isset($data['id'])) echo $data['id'];?>">
<label for="emplyeename">Employee Name<span style="color: red;">*</span></label>
<input type="text" id="fname" name="emp_name" placeholder="Your name.." value="<?php if(isset($data['emp_name'])) echo $data['emp_name'];?>">
<label for="address">Address<span style="color: red;">*</span></label>
<textarea type="text" id="address" name="address" placeholder="Your address.."><?php if(isset($data['adress'])) echo $data['adress'];?></textarea>
<label for="post">Post<span style="color: red;">*</span></label>
<select id="post" name="post">
<option value="Clerk" <?php if ($data['post'] == 'Clerk'): ?>
selected
<?php endif ?>>Clerk</option>
<option value="Admin" <?php if ($data['post'] == 'Admin'): ?>
selected
<?php endif ?>>Admin</option>
<option value="Manager" <?php if ($data['post'] == 'Manager'): ?>
selected
<?php endif ?>>Manager</option>
</select>
<input type="submit" value="Submit" name="submit">
</form>
</div>
<?php include "footer.php";?>