HEX
Server: Apache
System: Linux pdx1-shared-a1-06 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: ednermusika (2886498)
PHP: 8.4.2
Disabled: NONE
Upload Files
File: /home/ednermusika/ednergranados.com/admin/galeria_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 ((isset($_POST['gal_consecutivo'])) && ($_POST['gal_consecutivo'] != "")) {
  $deleteSQL = sprintf("DELETE FROM galeria_detalle WHERE gal_consecutivo=%s",
                       GetSQLValueString($_POST['gal_consecutivo'], "int"));

  mysql_select_db($database_con_edner, $con_edner);
  $Result1 = mysql_query($deleteSQL, $con_edner) or die(mysql_error());

  $deleteGoTo = "galeria_admin.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
    $deleteGoTo .= $_SERVER['QUERY_STRING'];
  }
  //header(sprintf("Location: %s", $deleteGoTo));
}
if ((isset($_POST['gal_consecutivo'])) && ($_POST['gal_consecutivo'] != "")) {
  $deleteSQL = sprintf("DELETE FROM galeria WHERE gal_consecutivo=%s",
                       GetSQLValueString($_POST['gal_consecutivo'], "int"));

  mysql_select_db($database_con_edner, $con_edner);
  $Result1 = mysql_query($deleteSQL, $con_edner) or die(mysql_error());

  $deleteGoTo = "galeria_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['gal_consecutivo'])) {
  $colname_galeria = $_GET['gal_consecutivo'];
}
mysql_select_db($database_con_edner, $con_edner);
$query_galeria = sprintf("SELECT gal_consecutivo, usu_consecutivo, gal_titulo, CURDATE() as gal_fecha, gal_ruta, gal_thumbnail, gal_activo FROM galeria WHERE gal_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" />
<script type="text/javascript">
<!--
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
//-->
</script>
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><h1>Galer&iacute;a de Fotos</h1></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><a href="galeria_admin.php" class="ligas_menu_interiores">&laquo; Regresar &raquo;</a></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><hr class="hr_principal" /></td>
  </tr>
</table>
<blockquote>
  <form method="POST" enctype="multipart/form-data" name="form1" id="form1">
<table width="502">
      <tr valign="baseline">
        <td colspan="2" nowrap="nowrap"><h3>&iquest;Eliminar Galer&iacute;a?</h3></td>
      </tr>
      <tr valign="baseline">
        <td width="66" align="right" nowrap="nowrap"><h4>&nbsp;</h4></td>
        <td width="424"><input name="gal_consecutivo" type="hidden" id="gal_consecutivo" value="<?php echo $row_galeria['gal_consecutivo']; ?>" size="32" />
        <input type="hidden" name="usu_consecutivo" value="<?php echo $_SESSION['USUARIO'] ?>" size="32" />
        <input name="gal_fecha" type="hidden" id="gal_fecha" value="<?php echo $row_galeria['gal_fecha']; ?>" /></td>
      </tr>
      
      <tr valign="baseline">
        <td nowrap="nowrap" align="right"><h4>T&iacute;tulo:</h4></td>
        <td class="texto_resaltado"><?php echo $row_galeria['gal_titulo']; ?></td>
      </tr>
      
      <tr valign="baseline">
        <td nowrap="nowrap" align="right"><h4>&nbsp;</h4></td>
        <td><input type="hidden" name="gal_thumbnail" id="gal_thumbnail" />
          <input name="gal_ruta" type="hidden" id="gal_ruta" size="32" />
        <input name="tipo" type="hidden" id="tipo" value="C" /></td>
      </tr>
      <tr valign="baseline">
        <td nowrap="nowrap" align="right"><h4>&nbsp;</h4></td>
        <td><input name="eliminar" type="button" class="boton_panel" id="eliminar" onclick="MM_callJS('f_enviar();')" value="Eliminar" />
            <input name="cancelar" type="button" class="boton_panel" id="cancelar" onclick="MM_callJS('history.back();')" value="Cancelar" /></td>
      </tr>
      <tr valign="baseline">
        <td nowrap="nowrap" align="right">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr valign="baseline">
        <td nowrap="nowrap" align="right">&nbsp;</td>
        <td><h6>Nota: Si elimina la galer&iacute;a se eliminar&aacute;n todas las fotos que est&aacute;n almacenadas en esta galer&iacute;a.</h6></td>
      </tr>
</table>
    
  
  
  </form>
  <p>&nbsp;</p>
</blockquote>
</body>
</html>
<?php
mysql_free_result($galeria);
?>
<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>