-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_ejecutar.php
54 lines (47 loc) · 1.41 KB
/
admin_ejecutar.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php session_start();
if(isset($_SESSION['username']) && ($_SESSION['rol']=="administrador")){
}
else
{
echo "Access Denied";
echo"<script>location.href='index.php';</script>";
} ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta c harset="UTF-8">
<title>Document</title>
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/estilo.css">
<center>
<h1>Otras Acciones</h1>
</head>
<body>
<?php
include("conexion.php");
$con=mysqli_connect($host, $user, $pw) or die ("error1");
mysqli_select_db($con,$db)or die ("error2");
$estado=$_POST['accion'];
$usuario=$_POST['user'];
switch ($estado) {
case "nouser":
$query="UPDATE `users` SET `estado` = '0' WHERE `users`.`usuario` = '".$usuario."'";
break;
case "actuser":
$query="UPDATE `users` SET `estado` = '1' WHERE `users`.`usuario` = '".$usuario."'";
break;
case "reuser":
$query="UPDATE `users` SET `contrasena` = cedula WHERE `users`.`usuario` = '".$usuario."'";
break;
}
mysqli_query($con,$query) or die("Error realizando la accion");
mysqli_close($con);
?>
<script>alert("Accion realizada con exito")
location.href='admin_users.php';
</script>
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>