<?php require_once('../Connections/EVENTS.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

if ((isset($_GET['recordID'])) && ($_GET['recordID'] != "")) {
  $deleteSQL = sprintf("DELETE FROM montajes WHERE id_montaje=%s",
                       GetSQLValueString($_GET['recordID'], "int"));

  mysql_select_db($database_EVENTS, $EVENTS);
  $Result1 = mysql_query($deleteSQL, $EVENTS) or die(mysql_error());

  $deleteGoTo = "elimina_montaje_correcto.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
    $deleteGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $deleteGoTo));
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>

 <link rel="stylesheet" type="text/css" href="css/default.css" />
 
	<link rel="stylesheet" type="text/css" href="css/jquery-ui-1.7.2.custom.css" />
    
     <link rel="stylesheet" type="text/css" href="css/miscss.css" />


</head>

<body>



<div class="cuerpo_inserta">

<div class="anuncia_pagina_inserta">
  <strong> MANCOMERAL</strong>
</div>
    
<div class="anuncia_inserta">
    <form action="index.php" method="get" name="form1" target="_self" id="form1">
        <label for="datepicker">SU MONTAJE SE HA ELIMINADO CON ÉXITO</label> 
        ...
    </form>
</div>

</div> <!--FIN DE DIV CUERPO---> 
</body>
</html>