-
Notifications
You must be signed in to change notification settings - Fork 6
/
accept.php
50 lines (45 loc) · 1.14 KB
/
accept.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
<html>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<h1><center>
<form action="#" method="post">
☷ You accept the request ☷<br><br>
<input class="btn btn-primary waves-effect" name="close" type="submit" value="CLOSE" formaction="./Accept_Reject.php">
</form>
</center>
<?php
include_once 'config/config.php';
var_dump($_POST);
$superid = $_SESSION['employee_id'];
$stts = 1;
$eid = $_GET['id'];
$mymsg = 'We have accepted your leave';
$ctime = date("h:i:s");
$cstts = "2";
echo "$mymsg";
$q = "INSERT INTO `chat`(`from_id`, `to_id`, `message`, `chattime`, `status`) VALUES ('$superid','$eid','$mymsg','$ctime','$cstts')";
if (mysqli_affected_rows($connection_obj) > 0) {
$employee_data = mysqli_fetch_assoc($connection_obj);
} else {
echo "insert error";
}
$status = mysqli_query($connection_obj, $q);
if ($status) {
header("location:./Accept_Reject.php");
} else {
echo "insert error";
}
$p = "UPDATE employee_leaves SET Action_taken_by_id='$superid' , Status='$stts' WHERE Employee_id='$eid'";
$status1 = mysqli_query($connection_obj, $p);
if ($status1) {
header("location:./Accept_Reject.php");
} else {
echo "insert error";
}
?>
</html>