<?php 
	$id = (isset($_GET['id']) ? $_GET['id'] : '');
	require_once ('process/dbh.php');
	$sql = "SELECT * FROM `employee` where id = '$id'";
	$result = mysqli_query($conn, $sql);
	$employee = mysqli_fetch_array($result);
	$empName = ($employee['firstName']);
	//echo "$id";
?>

<html>
<head>
	<title>Apply Transport | Employee Panel | Employee Management System</title>
	<link rel="stylesheet" type="text/css" href="styleapply.css">
</head>
<body bgcolor="#F0FFFF">
	
	<header>
		<nav>
			<h1>Employee Management System</h1>
			<ul id="navli">
				<li><a class="homeblack" href="eloginwel.php?id=<?php echo $id?>"">HOME</a></li>
				<li><a class="homeblack" href="myprofile.php?id=<?php echo $id?>"">My Profile</a></li>
				<li><a class="homeblack" href="empproject.php?id=<?php echo $id?>"">My Projects</a></li>
				<li><a class="homered" href="applytransport.php?id=<?php echo $id?>"">Apply Transport</a></li>
				<li><a class="homeblack" href="applyleave.php?id=<?php echo $id?>"">Apply Leave</a></li>
				<li><a class="homeblack" href="elogin.html">Log Out</a></li>
			</ul>
		</nav>
	</header>
	 
	<div class="divider"></div>
	<div class="page-wrapper bg-blue p-t-100 p-b-100 font-robo">
        <div class="wrapper wrapper--w680">
            <div class="card card-1">
                <div class="card-heading"></div>
                <div class="card-body">
                    <h2 class="title">Apply Transport Form</h2>
                    <form action="process/applytransportprocess.php?id=<?php echo $id?>" method="POST">


                        <div class="input-group">
                            <input class="input--style-1" type="text" placeholder="Reason" name="reason">
                        </div>
                        <div class="row row-space">
                            <div class="col-2">
                            	<p>Travel Date</p>
                                <div class="input-group">
                                    <input class="input--style-1" type="date" placeholder="Travel Date" name="travel_date">
                                   
                                </div>
                            </div>
                            <div class="col-2">
                            	<p>Start Location</p>
                                <div class="input-group">
                                    <input class="input--style-1" type="text" placeholder="Start Location" name="start_location">
                                   
                                </div>
                            </div>
                        </div>
						<div class="input-group">
                            <input class="input--style-1" type="text" placeholder="Route" name="route">
                        </div>
                        



                        <div class="p-t-20">
                            <button class="btn btn--radius btn--green" type="submit">Submit</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
		





	<table>
			<tr>
				<th align = "center">Emp. ID</th>
				<th align = "center">Name</th>
				<th align = "center">Travel Date</th>
				<th align = "center">Route</th>
				<th align = "center">Start Location</th>
				<th align = "center">Reason</th>
				<th align = "center">Status</th>
			</tr>


			<?php


				$sql4 = "Select employee.id, employee.firstName, employee.lastName, transport.travel_date, transport.route,transport.start_location, transport.reason, transport.status1 From employee, transport Where employee.id = $id and transport.id = $id order by transport.token";
				$result4 = mysqli_query($conn, $sql4);
				while ($employee = mysqli_fetch_assoc($result4)) {
					
					
					echo "<tr>";
					echo "<td>".$employee['id']."</td>";
					echo "<td>".$employee['firstName']." ".$employee['lastName']."</td>";
					
					echo "<td>".$employee['travel_date']."</td>";
					echo "<td>".$employee['route']."</td>";
					echo "<td>".$employee['start_location']."</td>";
					echo "<td>".$employee['reason']."</td>";
					echo "<td>".$employee['status1']."</td>";
					
				}


			?>


		</table>







</body>
</html>