<html>
<head>
<title>Job Details</title>
<style>
td {  font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 12px; color: #666666}
</style>
<body>
<?php
$jobid = $_GET["jobid"];

include "../conn.php";

$query = "select jobtitle, jobdescrip, enddate, appliednumber from job where jobid='$jobid'";
$result = mysql_query($query) or die (mysql_error());

if ($row = mysql_fetch_array($result))
{
	$jobtitle = $row[0];
	$jobdescrip = $row[1];
	$enddate = $row[2];
	$appliednumber = $row[3];
	
	$year = substr($enddate, 0, 4);
	$month = substr($enddate, 5, 2);
	$day = substr($enddate, 8, 2);
	if ($enddate == '0000-00-00')
	{
		$showday = "Not specified";
	}
	else
	{
		$showday = date("M jS Y", mktime(0,0,0, $month, $day, $year));
	}
	?>
	<center>
	<table cellspacing=0 border=0 width=90% cellpadding=5>
	  <tr>
	    <td align="left" colspan=2>
	    <table border=0 cellspacing=0 cellpadding=0 width=100%><tr><td><img src="../img/logo.jpg" width=96 height=61></td><td><form action="javascript: window.print(1);"><input type="image" src="../img/print.jpg" value="Print"></td></form><td><form action="javascript: window.close();"><input type="image" src="../img/close.jpg" value="Close"></td></form></tr></table>
	    </td>
	  </tr>
	  
	  <tr><td colspan=2>&nbsp;</td></tr>
	  
	  <tr>
	    <td width=100 align="right" width=30%><font color="#001084">Position</font></td><td align="left"><h3><?php echo $jobtitle; ?></td></h3>
	  </tr>
	  
	  <tr>
	    <td width=100 align="right"><font color="#001084">Closing Date</font></td><td align="left"><?php echo $showday; ?></td>
	  </tr>
	  
	  <tr>
	    <td width=100 align="right" valign="top"><font color="#001084">Description</font></td><td align="left"><?php echo $jobdescrip; ?></td>
	  </tr>
	  
	</table>
	</center>
	
	<center>
	
<table border=0 cellspacing=0 cellpadding=5 width=90%>
  <tr><td colspan=2>&nbsp;</td></tr>
  
  <tr><td colspan=2><b>To Apply this position, fill the form below</b></td></tr>
  
  <form action="apply.php" method="post" enctype="multipart/form-data">
  <tr>
    <td align="right">Name</td><td><input type="text" name="name"></td>
  </tr>
  
  <tr>
    <td align="right">Email</td><td><input type="text" name="email"></td>
  </tr>
  
  <tr>
    <td align="right">Resume</td><td><input type="file" name="userfile"></td>
  </tr>
  
  <tr>
    <td><input type="hidden" name="submit" value=1><input type="hidden" name="jobid" value="<?php echo $jobid; ?>"></td><td><input type="submit" value="Submit"></td></form>
  </tr>
</table>
</center>
	<?php
	
}
else
{
	exit;
	//echo "<script>window.close()</script>";
}
?>
</body>
</html>