<?php
session_start();

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

checkAdmin(session_id());

$submit = $_POST["submit"];

if ($submit == 1)
{
	$jobcatid = $_POST["jobcatid"];
	
	$query = "delete from jobcat where jobcatid='$jobcatid'";
	mysql_query($query) or die (mysql_error());
	
	$query = "delete from job_cat where jobcatid='$jobcatid'";
	mysql_query($query) or die (mysql_error());
	
	header ("location: cat.php");
}

include "header.php";

$jobcatid = $_POST["jobcatid"];
$query = "select catname from jobcat where jobcatid='$jobcatid'";
$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 suure you want to delete the job category: <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="jobcatid" value="<?php echo $jobcatid; ?>">
<input type="hidden" name="submit" value=1>
<input type="submit" value="Yes">
</td></form>
</tr>

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

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