-
Notifications
You must be signed in to change notification settings - Fork 0
/
applyleave_add.php
44 lines (37 loc) · 1 KB
/
applyleave_add.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
<?php
include_once 'config/config.php';
var_dump($_POST);
if(isset($_POST['submit']))
{
$eid=$_SESSION['employee_id'];
$enm=$_SESSION['emp_name'];
$ldt=$_POST['leavedaytype'];
$lt=$_POST['leavetype'];
$lrd=$_POST['leavereasondescription'];
$lfd=$_POST['leavefromdate'];
$ltd=$_POST['leavetodate'];
//$hdl=$_POST['halfdayleave'];
$cd=date("d-m-y");
$md=date("d-m-y");
//$superid=$_SESSION['employee_id'];
$q="INSERT INTO employee_leaves(Leaveday_type,Leave_type,Leave_from_date,Leave_to_date,Employee_id,Employee_name,Leave_reason_description,Created_date,Modified_date) VALUES ('$ldt','$lt','$lfd','$ltd','$eid','$enm','$lrd','$cd','$md')";
echo $q;
if(mysqli_affected_rows($connection_obj) > 0)
{
$employee_data = mysqli_fetch_assoc($connection_obj);
}
else
{
header("location:./500.php");
}
$status = mysqli_query($connection_obj,$q);
if($status)
{
header("location:./applyforleave.php");
}
else
{
echo "insert error";
}
}
?>