-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBorrarRegistroCola.php
More file actions
48 lines (44 loc) · 1.37 KB
/
BorrarRegistroCola.php
File metadata and controls
48 lines (44 loc) · 1.37 KB
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
<?php
session_start();
require './ConexionBD.php';
//Se borra la cola de la BD con todos los usuarios que esten apuntados a ella
if ($_POST) {
$sql = "DELETE FROM `revisiones` where codigo_revision='$_POST[codigo]'";
if ($_SESSION['Rol'] === 'administrador') {
if (conexion()->query($sql) === TRUE) {
?>
<script>
alert("El registro se ha borrado correctamente");
window.location = "GestionColasAdministrador.php";
</script>
<?php
} else {
?>
<script>
alert("El registro no ha podido ser borrado");
window.location = "GestionColasAdministrador.php";
</script>
<?php
}
} else if ($_SESSION['Rol'] === 'profesor') {
if (conexion()->query($sql) === TRUE) {
?>
<script>
alert("El registro se ha borrado correctamente");
window.location = "GestionColasProfesor.php";
</script>
<?php
} else {
?>
<script>
alert("El registro no ha podido ser borrado");
window.location = "GestionColasProfesor.php";
</script>
<?php
}
}
mysqli_close(conexion());
}
?>
<script>
</script>