Exemple #1
0
if (!isset($_GET['orden'])) {
    $_GET['orden'] = 'descripcion';
}
$ind = new indicador();
$ind->consultaE('', $_GET['orden']);
if (!isset($_POST['botonInd'])) {
    $_POST['botonInd'] = '';
}
if ($_SERVER['REQUEST_METHOD'] == "POST") {
    if ($_POST['botonInd'] == "Modificar indicador") {
        $ind->actualizar($_POST['codigoInd'], $_POST['descripcionInd'], $_POST['periodoInd'], $_POST['estadoInd']);
        $mensaje = 'Información modificada.';
    } else {
        if ($_POST['botonInd'] == "Insertar indicador") {
            if (!$ind->existeIndicador($_POST['descripcionInd'])) {
                $ind->nuevo('', $_POST['descripcionInd'], $_POST['periodoInd'], $_POST['estadoInd']);
                $mensaje = 'Información insertada.';
            } else {
                $mensaje = 'Indicador duplicado.';
            }
        }
    }
    $ind->consultaE('', $_GET['orden']);
}
?>
<table width="800" cellspacing="0" cellpadding="0" class="cuerpo">
  <tr> 
    <td colspan="4" class="cabCuerpo"> Mantenimiento Indicadores </td>
     <td class="cabCuerpo">
		<input name="cat2" type="button" onClick="manteIndicador('A','indicador','','','','')" value="Nuevo" title="Insertar nuevo indicador">&nbsp </td>
	</td>
Exemple #2
0
 $ind = new indicador();
 $ind->consultaE('', $_GET['orden']);
 if (!isset($_POST['botonInd'])) {
     $_POST['botonInd'] = '';
 }
 if (!isset($_GET['accion'])) {
     $_GET['accion'] = '';
 }
 if ($_SERVER['REQUEST_METHOD'] == "POST") {
     if ($_POST['botonInd'] == "Modificar indicador") {
         $ind->actualizar($_POST['codigoInd'], $_POST['descripcionInd']);
         $mensaje = 'Información modificada.';
     } else {
         if ($_POST['botonInd'] == "Insertar indicador") {
             if (!$ind->existeIndicador($_POST['descripcionInd'])) {
                 $ind->nuevo('', $_POST['descripcionInd']);
                 $mensaje = 'Información insertada.';
             } else {
                 $mensaje = 'Indicador duplicado.';
             }
         }
     }
     $ind->consultaE('', $_GET['orden']);
 }
 if ($_SERVER['REQUEST_METHOD'] == "GET") {
     if ($_GET['accion'] == 'B') {
         if (!$ind->referenciaIndicador($_GET['codigoProc'])) {
             $ind->borrar($_GET['codigoProc']);
             $mensaje = 'Indicador borrado';
         } else {
             $mensaje = 'El indicador no se puede borrar';