-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathempProcess.php
71 lines (45 loc) · 1.35 KB
/
empProcess.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
<?php
require_once 'EmpService.class.php';
$empService= new EmpService();
if(!empty($_REQUEST['flag'])){
$flag=$_REQUEST['flag'];
if($flag=="del"){
$id=$_REQUEST['id'];
if($empService->delEmpById($id)==1){
header("Location: ok.php");
exit();
}else{
header("Location: error.php");
exit();
}
}elseif ($flag=="addemp"){
$id=$_POST['id'];
$name=$_POST['name'];
$email=$_POST['email'];
$phone=$_POST['phone'];
if(empty($id)||$id>1370){
$res=$empService->addEmp($name, $email, $phone);
if($res==1){
header("Location: ok.php");
exit();
}else{
header("Location: error.php");
exit();
}
}
}elseif ($flag=="updateemp"){
$id=$_POST['id'];
$name=$_POST['name'];
$email=$_POST['email'];
$phone=$_POST['phone'];
$res=$empService->updateEmp($id,$name, $email, $phone);
if($res==1){
header("Location: ok.php");
exit();
}else{
header("Location: error.php");
exit();
}
}
}
?>