-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_status.php
40 lines (27 loc) · 915 Bytes
/
update_status.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
<?php
require_once 'config.php';
session_start();
if(isset($_SESSION['loggedin'])){
if($_SERVER["REQUEST_METHOD"] == "POST"){
$leave_id = $_POST['Leave_id'];
$status = $_POST['Status'];
$comment = $_POST['Comment'];
$fid = $_SESSION['facultyID'];
$getPosSql = "select Position_Id from faculty_position where faculty_id='$fid'";
$posResult = pg_query($pg, $getPosSql);
$posResultArr = pg_fetch_all($posResult);
$posid = $posResultArr[0]['position_id'];
$sql = "update leave_approvals set status='$status', comments='$comment', recipient_pos='$posid' where lr_id='$leave_id' and recipient='$fid'";
$result = pg_query($pg, $sql);
if($result){
header('Location: leave_approval_portal.php');
}else{
echo "Something went Worng!!";
}
}else{
header('Location: hierarchy.php');
}
}else{
header('Location: hierarchy.php');
}
?>