Exemplo n.º 1
0
$ind = new indicador();
switch ($accion) {
    case 'A':
        $litBoton = 'Insertar';
        $tip = 'Insertar nueva información';
        break;
    case 'M':
        $ind->consultaE($codigo);
        $ind->siguiente();
        $litBoton = 'Modificar';
        $tip = 'Modificar la información';
        break;
}
if ($_SERVER['REQUEST_METHOD'] == "POST") {
    if ($_POST['enviar'] == "Modificar") {
        $ind->actualizar($ind->codigo, $_POST['descripcion'], $_POST['periodo'], $_POST['estado']);
        $ind->consultaE($codigo);
        $ind->siguiente();
        $mensaje = 'Información modificada.';
    } else {
        if ($_POST['enviar'] == "Insertar") {
            if (!$ind->existeIndicador($_POST['descripcion'])) {
                $ind->nuevo('', $_POST['descripcion'], $_POST['periodo'], $_POST['estado']);
                $mensaje = 'Información insertada.';
            } else {
                $mensaje = 'Indicador duplicado.';
            }
        }
    }
}
?>
Exemplo n.º 2
0
<?php

$nF = 15;
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>
Exemplo n.º 3
0
 // Administrador
 $nF = 15;
 if (!isset($_GET['orden'])) {
     $_GET['orden'] = 'descripcion';
 }
 $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') {