Incam_Intranet/constantes.php

43 lines
1015 B
PHP
Raw Normal View History

<?php
include("seguridad.php");
include("functions.php");
if (!comprobar_permisos("AS")){
header("Location: aplicacion.php?e=permiso");
exit;
}
//include_once("html/cabecera.php");
/* TABLAS_MADRE.PHP */
$id = stripinput($_POST["id"]);
$valor = stripinput($_POST["valor"]);
if ($link = conectar()){
foreach($_POST as $key => $value){
$value = stripinput($value);
$key = stripinput($key);
$consulta = "update sistema set valor='$value' where id='$key'";
$resultado = mysql_query($consulta, $link);
if(!resultado){
$errores .= $locale['900']." $key";
}
}
if($id != ""){
$consulta = "insert into sistema (id, valor) values ('$id','$valor')";
$resultado = mysql_query($consulta, $link);
if(!resultado){
$errores .= $locale['901']." $key";
}
}
}else
$errores .= $locale['bd'];
if(!$errores) $aciertos .= $locale['902'];
header("Location: administracion.php?opcion=constantes&e=$errores&a=$aciertos");
include_once("html/pie.php");
?>