-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedit-employee.php
72 lines (68 loc) · 3.01 KB
/
edit-employee.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
<?php
session_start();
require_once "Main.php";
$main = new Main();
$id = $_GET['id'];
if(isset($_POST['name'])){
$result = $main->edit_employees($_POST,$id);
if($result['status'] == "success") $success = "Employee updated successfully";
else $error = $result['message'];
}
$employee = mysqli_fetch_assoc($main->get_employees($id));
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<title>Task Management - Login</title>
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/styles.css">
</head>
<body>
<?include_once "navigation.php"?>
<section>
<div class="container">
<ol class="breadcrumb" style="margin-top: 20px;">
<li class="breadcrumb-item"><a href="index.php"><span>Home</span></a></li>
<li class="breadcrumb-item"><a href="employee.php"><span>Employees</span></a></li>
<li class="breadcrumb-item"><a href="#"><span>Edit Employees</span></a></li>
</ol>
</div>
</section>
<div class="container">
<div class="row">
<div class="col-md-4 offset-md-4">
<?include("alerts.php")?>
<form action="edit-employee.php?id=<?=$employee['id']?>" method="post">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="name">Name <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="name" name="name" value="<?=$employee['name']?>" pattern="[a-zA-Z. ]+" title="Name should only have text, space and dot" placeholder="Name" required>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label for="email">Email <span class="text-danger">*</span></label>
<input type="email" class="form-control" id="email" name="email" value="<?=$employee['email']?>" placeholder="Email" required>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label for="password">Password <span class="text-danger">*</span></label>
<input type="password" class="form-control" id="password" name="password" pattern=".{8,}" title="Password should have 8 or more characters" value="<?=$employee['password']?>" placeholder="Password" required>
</div>
</div>
</div>
<div class="center">
<button type="submit" class="btn btn-primary"> Update</button>
</div>
</form>
</div>
</div>
</div>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
</body>
</html>