<?php
//including the database connection file
require_once ('dbh.php');

//getting id of the data from url
$id = $_GET['id'];
//echo $id;
$reason = $_POST['reason'];

$start = $_POST['start'];
//echo "$reason";
$end = $_POST['end'];

$nodays = $_POST['nodays'];
$leavecat =$_POST['leavecat'];
$leavety=$_POST['leavety'];

$sql = "INSERT INTO `employee_leave`(`id`,`token`, `start`, `end`, `nodays`,`leavecat`,`leavety`,`reason`, `status`) 
VALUES ('$id','','$start','$end','$nodays','$leavecat','$leavety','$reason','Pending')";

$result = mysqli_query($conn, $sql);

//redirecting to the display page (index.php in our case)
header("Location:..//eloginwel.php?id=$id");
?>

