git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_Intranet/trunk/src@1 e2b1556b-49f8-d141-9351-52d6861a72d9
41 lines
1.1 KiB
PHP
41 lines
1.1 KiB
PHP
<?php
|
|
|
|
include("seguridad.php");
|
|
include("functions.php");
|
|
|
|
if(!comprobar_permisos("SP") && (!puede_gestionar($oid, $_SESSION["oid"]) or !comprobar_permisos("GP"))){
|
|
header("Location: aplicacion.php?e=permiso");
|
|
exit;
|
|
}
|
|
|
|
$nombre = stripinput($_POST["nombre"]);
|
|
$gerente = stripinput($_POST["gerente"]);
|
|
$privacidad = stripinput($_POST["privacidad"]);
|
|
$nombre = stripinput($_POST["nombre"]);
|
|
$oid = stripinput($_POST["oid"]);
|
|
|
|
if($link = conectar()){
|
|
$resultado = mysql_query("select id from clientes where id='$nombre' and oid <> '$oid'", $link);
|
|
$reg = mysql_num_rows($resultado);
|
|
if($reg > 0){
|
|
$errores .= $locale['2208'];
|
|
}else{
|
|
$consulta = "update clientes set id='$nombre', gerente='$gerente', privado='$privacidad' where oid='$oid'";
|
|
$resultado = mysql_query($consulta, $link);
|
|
if(!$resultado){
|
|
$errores .= $locale['2206'];
|
|
}else{
|
|
$aciertos .= $locale['2207'];
|
|
}
|
|
}
|
|
}else{
|
|
$errores .= $locale['bd'];
|
|
}
|
|
|
|
header("Location: formulario_cliente.php?e=$errores&a=$aciertos&oid=$oid");
|
|
exit();
|
|
|
|
include_once("html/pie.php");
|
|
|
|
?>
|