$cod = $_POST['codigo'];
    $desc = $_POST['descripcion'];
    include '../model/tipo.php';
    $con = new Tipo();
    $result = $con->Nuevo($cod, $desc);
    echo $result;
    if ($result > 0) {
        header('Location: ../views/tipoList.php');
    }
}
if (isset($_POST['submit']) && $_POST['submit'] == "Editar") {
    $id = $_POST['id'];
    $code = $_POST['codigo'];
    $descr = $_POST['descripcion'];
    include '../model/tipo.php';
    $con = new Tipo();
    $result = $con->Update($id, $code, $descr);
    if ($result) {
        header('Location: ../views/tipoList.php');
    }
}
if (isset($_GET['action']) and $_GET['action'] == "delete") {
    $id = $_GET['id'];
    include '../model/tipo.php';
    $con = new Tipo();
    $eliminar = $con->Delete($id);
    if ($eliminar) {
        echo '<script type="text/javascript"> alert("El registro ah sido eliminado"); history.back();</script>';
        // header('Location: ../views/pacienteList.php');
    }
}