/
home2
/
reumatologia
/
public_html
/
admin
/
Upload File
HOME
<?php require_once('../inc_library.php'); /* obtenemos datos enviados */ $IdSubseccion = intval($_REQUEST['IdSubseccion']); $IdSeccion = intval($_REQUEST['IdSeccion']); $Nombre = strval(utf8_decode($_REQUEST['Nombre'])); $Orden = intval($_REQUEST['Orden']); $Submit = (isset($_REQUEST['Submitted'])); /* declaramos e instanciamos variables necesarias */ $err = 0; $oSeccion = new Secciones(); $oSubsecciones = new Subsecciones(); /* verificamos si existe el registro */ if (!$oSubseccion = $oSubsecciones->GetById($IdSubseccion)) { header('Location: json-subsecciones.php' . $strParams); exit; } /* validaciones... */ if ($Nombre == '') $err |= 2; if ($IdSeccion == '') $err |= 8; /* si no hay ningun error... */ if ($err == 0) { $oSubseccion->Nombre = $Nombre; $oSubseccion->IdSeccion = $IdSeccion; $oSubseccion->Orden = $Orden; /* modificamos el registro */ $oSubseccion = $oSubsecciones->Update($oSubseccion); header('Content-type: application/json'); echo json_encode(array("Success" => true, "Error" => "")); } else { header('Content-type: application/json'); echo json_encode(array("Success" => false, "Error" => utf8_encode("La Subseccion ingresada ya existe"))); } ?>