File: /home/ednermusika/ednergranados.com/admin/usuario_bajas.php
<?php require_once('../Connections/con_edner.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($_POST['usu_consecutivo'])) && ($_POST['usu_consecutivo'] != "")) {
$deleteSQL = sprintf("DELETE FROM usuario WHERE usu_consecutivo=%s",
GetSQLValueString($_POST['usu_consecutivo'], "int"));
mysql_select_db($database_con_edner, $con_edner);
$Result1 = mysql_query($deleteSQL, $con_edner) or die(mysql_error());
$deleteGoTo = "usuarios_admin.php";
if (isset($_SERVER['QUERY_STRING'])) {
$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
$deleteGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $deleteGoTo));
}
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$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;
}
}
$colname_usuarios = "-1";
if (isset($_GET['usu_consecutivo'])) {
$colname_usuarios = $_GET['usu_consecutivo'];
}
mysql_select_db($database_con_edner, $con_edner);
$query_usuarios = sprintf("SELECT usu_consecutivo, usu_correo, usu_nombre, usu_contrasena, usu_rol, usu_tipo, CASE usu_activo WHEN 1 THEN 'SI' WHEN 0 THEN 'NO' END as usu_activo FROM usuario WHERE usu_consecutivo = %s", GetSQLValueString($colname_usuarios, "int"));
$usuarios = mysql_query($query_usuarios, $con_edner) or die(mysql_error());
$row_usuarios = mysql_fetch_assoc($usuarios);
$totalRows_usuarios = mysql_num_rows($usuarios);
?>
<!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>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>Usuarios</h1></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><a href="usuario_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>
<blockquote>
<form method="POST" name="form1" id="form1">
<table width="500">
<tr valign="baseline">
<td colspan="2" nowrap="nowrap"><h3>¿Eliminar usuario?</h3></td>
</tr>
<tr valign="baseline">
<td width="148" nowrap="nowrap"><h6> </h6></td>
<td width="340" class="texto_informativo"> <input type="hidden" name="usu_consecutivo" value="<?php echo $row_usuarios['usu_consecutivo']; ?>" size="32" /> </td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"><h4>Clave o correo:</h4></td>
<td class="texto_resaltado"><?php echo $row_usuarios['usu_correo']; ?></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"><h4>Nombre completo:</h4></td>
<td class="texto_resaltado"><?php echo $row_usuarios['usu_nombre']; ?></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"><h4>Contraseña:</h4></td>
<td class="texto_resaltado"><?php echo $row_usuarios['usu_contrasena']; ?></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"><h4>Rol:</h4></td>
<td class="texto_resaltado"><?php echo $row_usuarios['usu_rol']; ?></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"><h4>Activo:</h4></td>
<td class="texto_resaltado"><?php echo $row_usuarios['usu_activo']; ?></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"><h4> </h4></td>
<td class="texto_informativo"> <input type="hidden" name="usu_tipo" value="<?php echo $row_usuarios['usu_tipo']; ?>" size="32" /> </td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"><h6> </h6></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>
</table>
</form>
<p> </p>
</blockquote>
</body>
</html>
<script type="text/javascript">
function f_validar ( )
{
var retorno = true;
return retorno
}
function f_enviar()
{
with (document.form1)
{
if ( f_validar ( ) )
{
submit ( );
}
}
}
</script>
<?php
mysql_free_result($usuarios);
?>