first commit
This commit is contained in:
58
admin/backups/usuario_exclui.php
Executable file
58
admin/backups/usuario_exclui.php
Executable file
@@ -0,0 +1,58 @@
|
||||
<?php require_once('../Connections/conn_sustentabilidade.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['id_usuario'])) && ($_GET['id_usuario'] != "")) {
|
||||
$deleteSQL = sprintf("DELETE FROM tbusuarios WHERE id_usuario=%s",
|
||||
GetSQLValueString($_GET['id_usuario'], "int"));
|
||||
|
||||
mysql_select_db($database_conn_sustentabilidade, $conn_sustentabilidade);
|
||||
$Result1 = mysql_query($deleteSQL, $conn_sustentabilidade) or die(mysql_error());
|
||||
|
||||
$deleteGoTo = "usuarios_lista.php";
|
||||
if (isset($_SERVER['QUERY_STRING'])) {
|
||||
$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
|
||||
$deleteGoTo .= $_SERVER['QUERY_STRING'];
|
||||
}
|
||||
header(sprintf("Location: %s", $deleteGoTo));
|
||||
}
|
||||
?>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Documento sem título</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user