<?php
session_start();

include "../functions.php";
checkAdmin(session_id());

if ($_POST["confirm"] == 1)
{
	$mediaID = $_POST["id"];
	
	$query = "delete from media_media where mediaID='$mediaID'";
	mysql_query($query) or die (mysql_error());
	header ("location: press.php");
}
?>

<?php
include "header.php";

$mediaID = $_POST["id"];

$query = "select mediaName from media_media where mediaID='$mediaID'";
$result = mysql_query($query) or die (mysql_error());

if ($row = mysql_fetch_array($result))
{
	$mediaName = $row[0];
	?>
	<center>
	<table width=80%>
	  <tr>
	    <td align="center">are you sure you want to delete the press <b><?php echo $mediaName; ?></b>?</td>
	  </tr>
	
	  <tr>
	    <td align="center"><form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post"><input type="hidden" name="id" value="<?php echo $mediaID; ?>"><input type="hidden" name="confirm" value=1><input type="submit" value="Yes"></td></form>
	  </tr>
	  
	  <tr>
	    <td align="center"><form action="press.php" method="get"><input type="submit" value=" No "></td></form>
	  </tr>
	</center>
	<?php
}
?>

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