-
Notifications
You must be signed in to change notification settings - Fork 22
/
accept_hr.php
79 lines (60 loc) · 1.52 KB
/
accept_hr.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
77
78
79
<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);
//$lreason=$_POST['leavereason'];
$superid=$_SESSION['employee_id'];
//$lr=$_SESSION['lr'];
$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')";
//sir-----------------------------------------------------------------------------------------------------------------------------
//update leave status on emp leave table
//check on dashboard for next date leave
// if reject request then open modal
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>