<?require ("global.php");?>
<?php

if (isset($_GET['ID']))
{
  $ID = $_GET["ID"];

  $query = "DELETE FROM ticks WHERE stageID = $ID";
  $result = mysql_query($query, $db);

  $query = "DELETE FROM maps WHERE stageID = $ID";
  $result = mysql_query($query, $db);

  $query = "DELETE FROM maps_coords WHERE stageID = $ID";
  $result = mysql_query($query, $db);

  $query = "DELETE FROM segments WHERE stageID = $ID";
  $result = mysql_query($query, $db);

  $query = "DELETE FROM markers WHERE stageID = $ID";
  $result = mysql_query($query, $db);

  $query = "DELETE FROM pics WHERE stageID = $ID";
  $result = mysql_query($query, $db);

  $query = "DELETE FROM stages WHERE ID = $ID LIMIT 1";
  $result = mysql_query($query, $db);
}

header("Location: /tick/stages.php");

?>
