37 lines
1.2 KiB
PHP
37 lines
1.2 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
include("seguridad.php");
|
||
|
|
include("functions.php");
|
||
|
|
if (!comprobar_permisos("AS")){
|
||
|
|
header("Location: aplicacion.php?e=permiso");
|
||
|
|
exit;
|
||
|
|
}
|
||
|
|
|
||
|
|
$oid = stripinput($_POST["oid"]);
|
||
|
|
include_once("campos_alarma.php");
|
||
|
|
|
||
|
|
$errores = "";
|
||
|
|
|
||
|
|
if($link = conectar()){
|
||
|
|
if($rol == ""){
|
||
|
|
$consulta = "update alarmas set nombre='$nombre', mensaje='$mensaje', periodicidad='$periodicidad', activacion='$activacion', duracion='$duracion', rol=null, prioridad='$prioridad', mail='$mail' where id='$oid'";
|
||
|
|
}else{
|
||
|
|
$consulta = "update alarmas set nombre='$nombre', mensaje='$mensaje', periodicidad='$periodicidad', activacion='$activacion', duracion='$duracion', rol='$rol', prioridad='$prioridad', mail='$mail' where id='$oid'";
|
||
|
|
}
|
||
|
|
$resultado = mysql_query($consulta, $link);
|
||
|
|
if(!$resultado){
|
||
|
|
$errores .= $locale['322'];
|
||
|
|
}else{
|
||
|
|
$aciertos .= $locale['323'];
|
||
|
|
}
|
||
|
|
}else{
|
||
|
|
$errores .= $locale['bd'];
|
||
|
|
}
|
||
|
|
|
||
|
|
header("Location: formulario_alarma.php?oid=$oid&e=$errores&a=$aciertos");
|
||
|
|
exit();
|
||
|
|
|
||
|
|
include_once("html/pie.php");
|
||
|
|
|
||
|
|
?>
|