File: /home/ednermusika/ednergranados.com/admin/galeriaaudios_bajas.php
<?php require_once('../Connections/con_edner.php'); ?>
<?php
//initialize the session
if (!isset($_SESSION)) {
session_start();
}
?>
<?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 (!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($_POST['gaa_consecutivo'])) && ($_POST['gaa_consecutivo'] != "")) {
$deleteSQL = sprintf("DELETE FROM galeria_audio WHERE gaa_consecutivo=%s",
GetSQLValueString($_POST['gaa_consecutivo'], "int"));
mysql_select_db($database_con_edner, $con_edner);
$Result1 = mysql_query($deleteSQL, $con_edner) or die(mysql_error());
$deleteGoTo = "galeriaaudios_admin.php";
if (isset($_SERVER['QUERY_STRING'])) {
$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
$deleteGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $deleteGoTo));
}
$colname_galeria = "-1";
if (isset($_GET['gaa_consecutivo'])) {
$colname_galeria = $_GET['gaa_consecutivo'];
}
mysql_select_db($database_con_edner, $con_edner);
$query_galeria = sprintf("SELECT gaa_consecutivo, gaa_titulo, gaa_fecha, gaa_ruta, gaa_activo, CURDATE() as FECHA_HOY FROM galeria_audio WHERE gaa_consecutivo = %s", GetSQLValueString($colname_galeria, "int"));
$galeria = mysql_query($query_galeria, $con_edner) or die(mysql_error());
$row_galeria = mysql_fetch_assoc($galeria);
$totalRows_galeria = mysql_num_rows($galeria);
?>
<!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=iso-8859-1" />
<title>Untitled Document</title>
<link href="css/admin.css" rel="stylesheet" type="text/css" />
<link href="css/calendario.css" rel="stylesheet" type="text/css" />
<script src="calendario/mootools.v1.1.js" type="text/javascript"></script>
<script src="calendario/calendario.js" type="text/javascript"></script>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><h1>Galería de Audios</h1></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><a href="galeriaaudios_admin.php" class="ligas_menu_interiores">« Regresar</a></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
<tr>
<td><hr class="hr_principal" /></td>
</tr>
</table>
<form method="POST" name="form1" id="form1">
<table>
<tr valign="baseline">
<td colspan="2" nowrap="nowrap"><h3>¿Eliminar la galería?</h3></td>
</tr>
<tr valign="baseline">
<td width="98" nowrap="nowrap" class="texto_14_verdana"> </td>
<td width="348"><input name="gaa_consecutivo" type="hidden" id="gaa_consecutivo" value="<?php echo $row_galeria['gaa_consecutivo']; ?>" size="32" />
<input type="hidden" name="usu_consecutivo" value="<?php echo $_SESSION['USUARIO'] ?>" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"><h4>Título:</h4></td>
<td class="texto_resaltado"><p class="texto_resaltado"><?php echo $row_galeria['gaa_titulo']; ?></p></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" class="texto_14_verdana"> </td>
<td> </td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" class="texto_14_verdana"><input name="gaa_fecha" type="hidden" id="gaa_fecha" value="<?php echo $row_galeria['FECHA_HOY']; ?>" size="32" />
<input name="gaa_ruta" type="hidden" id="gaa_ruta" value="" size="32" />
<input name="gaa_thumbnail" type="hidden" id="gaa_thumbnail" value="" size="32" /></td>
<td><input name="eliminar" type="button" id="eliminar" value="Eliminar" onclick="f_enviar();"/>
<input type="button" name="cancelar" id="cancelar" value="Cancelar" onclick="history.back();" /></td>
</tr>
</table>
</form>
<p> </p>
</body>
<script type="text/javascript">
function f_validar ( )
{
var retorno = true;
with ( document.form1 )
{
return retorno
}
}
function f_enviar()
{
with (document.form1)
{
if ( f_validar ( ) )
{
submit ( );
}
}
}
</script>
</html>
<?php
mysql_free_result($galeria);
?>