<html>
<head>
<title>Admin View Leave</title>
</head>


<body style="background-color: #ffffff;background-image:url(rail.jpg);background-repeat: repeat-y">
<center>
<?php include('link.php');
$login=mysql_connect('localhost', 'wauhaha_karaoke', 'cross123','wauhaha_karaoke');
mysql_selectDB("wauhaha_karaoke",$login);

$result = mysql_query("select * from admin");
$r = mysql_fetch_array($result);
$id = $r['Username'];
?>
<h1 align=center>Admin View Apply Leave</h1>
<h3><center><a href=adminaccount.php title=Back	><img src=back.jpg width=40 height=40></h3>
<a href='http://www.wauhaha.com/karaoke/lset.php?<?php  echo "id=$id"; ?>'>Leave Setting</a>&nbsp;&nbsp;<a href='http://www.wauhaha.com/karaoke/aplleave.php?<?php  echo "id=$id"; ?>'>Apply Leave</a>&nbsp;&nbsp;
<a href='http://www.wauhaha.com/karaoke/viewleave.php?<?php  echo "id=$id"; ?>'>Leave Approved</a><br></br>
<?php 


$result = mysql_query("select * from lreason");


echo "<table border=1 align=center style ='font-family:Arial, Helvetica, sans-serif;font-size:1em' color='blue' bordercolorlight='tan' cellspacing=0 cellpadding=4>
 <tr bgcolor=lightblue >
					
					<th align=center>No</th>
					<th align=center>ID</th>
					<th align=center>Start Date</th>
					<th align=center>End Date</th>
					<th align=center>Start Time</th>
					<th align=center>End Time</th>
					<th align=center>Total Hours</th>
					<th align=center>Reason</th>
					<th align=center>Apply Date</th>
					<th align=center>Leave Remain</th>
					<th align=center>Approve</th>
					<th align=center>Deny</th>
 </tr>";
 while($r=mysql_fetch_array($result)){
 $no = $r['no'];
 echo "<tr>
			<td align=center>".$r['no']."</td>
			<td align=center>".$r['id']."</td>
			<td align=center>".$r['sd']."</td>
			<td align=center>".$r['ed']."</td>
			<td align=center>".$r['sh']."</td>
			<td align=center>".$r['eh']."</td>
			<td align=center>".$r['h']."</td>
			<td align=center>".$r['r']."</td>
			<td align=center>".$r['Date']."</td>
			<td align=center>".$r['lr']."</td>
			<td align=center><a href='approveaction.php?no=$no'><img src=tick.png width=20 height=20></a> </td>
			<td align=center><a href='denyaction.php?no=$no'><img src=cross.png width=20 height=20></a></a></td>
 </tr>";
 }













?>