-
Notifications
You must be signed in to change notification settings - Fork 3
/
update.php
76 lines (75 loc) · 2.26 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
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
<?php
$conn=mysqli_connect('localhost','pjuser','12345678','awscop');
settype($_GET['id'], 'integer');
$a=$_GET['id'];
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>AWSCOP</title>
<link rel="shortcut icon" type="image/x-icon" href="images/favicon.png">
<link rel="stylesheet" href="css/style.css" type="text/css">
</head>
<body>
<div id="page">
<div id="header">
<div id="logo">
<a href="index.php"><img src="images/logo.png" alt="LOGO"></a>
</div><!--logo-->
<ul id="navigation">
<li><a href="create.php">Registration</a></li>
<li><a href="print.php">View/Modify</a></li>
</ul><!--navigation-->
</div><!--header-->
<div id="contents">
<p id="inputcenter">Enter Information</p>
<?php
$sql="SELECT * FROM employee_salary WHERE id=$a";
$result=mysqli_query($conn, $sql);
$row = mysqli_fetch_array($result);
$filtered = array(
'name' => htmlspecialchars($row['name']),
'position' => htmlspecialchars($row['position']),
'base' => htmlspecialchars($row['base_pay']),
'extra' => htmlspecialchars($row['extra_pay'])
);
?>
<p>
<form id="inputcenter" action="update_process.php?id=<?php echo $_GET['id'] ?>" method="post">
<p><input type="text" name="name" placeholder="Name" value="<?= $filtered['name'] ?>"></p>
<p><input type="text" name="position" placeholder="Position" value="<?= $filtered['position'] ?>"></p>
<p><input type="text" name="basic" placeholder="Base_Pay" value="<?= $filtered['base'] ?>"></p>
<p><input type="text" name="extra" placeholder="Extra_Pay" value="<?= $filtered['extra'] ?>"></p>
<p><input type="submit" value="edit"></p>
</form>
</p>
</div><!--contents-->
<div id="footer">
<div id="links">
<li>
<h4>When Something Wrong</h4>
<ul>
<li>TEL : 0212345678</li>
<li>E-MAIL : aws123@gmail.com</li>
</ul>
</li>
<li>
<h4>Social Links</h4>
<ul id="connect">
<li>
<a href="https://twitter.com/" target="_blank">Twitter</a>
</li>
<li>
<a href="https://www.facebook.com/" target="_blank">Facebook</a>
</li>
</ul><!--connect-->
</li>
</div><!--links-->
<p class="footnote">
© 2020. Hong Su Min all rights reserved.
</p>
</div><!--footer-->
</div><!--page-->
</body>
</html>