<?php
session_start();

include "../conn.php";
include "../functions.php";

checkAdmin(session_id());

$confirm = $_POST["confirm"];

if ($confirm == 1)
{
	$jobid = $_POST["jobid"];
	
	$query = "delete from job where jobid='$jobid'";
	//echo $query;
	mysql_query($query) or die (mysql_error());
	$query = "delete from job_cat where jobid='$jobid'";
	//echo "<br>$query";
	mysql_query($query) or die (mysql_error());
	
	header ("location: job.php");
}

include "header.php";

$jobid = $_POST["jobid"];
$query = "select jobtitle from job where jobid='$jobid'";
$result = mysql_query($query) or die (mysql_error());

$row = mysql_fetch_array($result);
?>

<center>
<table width=80% border=0>
<tr>
<td align="center">
are you sure you want to delete the job posting: <b><?php echo $row[0]; ?></b>?
</td>
</tr>

<tr>
<td align="center">
<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
<input type="hidden" name="jobid" value="<?php echo $jobid; ?>">
<input type="hidden" name="confirm" value=1>
<input type=submit value="Yes">
</td>
</form>
</tr>

<tr>
<td align="center">
<form action="job.php" method="get">
<input type="submit" value=" No ">
</form>
</td>
</tr>
</table>
</center>

<?php
include "footer.php";
?>