Exemplo n.º 1
0
 public function getById($id)
 {
     $this->conex = DataBase::getInstance();
     $stid = oci_parse($this->conex, "SELECT \n\t\t\tid_ciudadano,\n\t\t\tprimer_nombre,\n\t\t\tsegundo_nombre,\n\t\t\tprimer_apellido,\n\t\t\tsegundo_apellido,\n\t\t\ttelefono_hab,\n\t\t\ttelefono_movil,\n\t\t\tfecha_nacimiento,\n\t\t\tsexo\n\t\t\tFROM CIUDADANO WHERE ID_CIUDADANO=:id");
     if (!$stid) {
         $e = oci_error($this->conex);
         trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
     }
     // Realizar la lógica de la consulta
     oci_bind_by_name($stid, ':id', $id);
     $r = oci_execute($stid);
     if (!$r) {
         $e = oci_error($stid);
         trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
     }
     // Obtener los resultados de la consulta
     $alm = new Ciudadano();
     while ($fila = oci_fetch_array($stid, OCI_ASSOC + OCI_RETURN_NULLS)) {
         $it = new ArrayIterator($fila);
         while ($it->valid()) {
             $alm->__SET(strtolower($it->key()), $it->current());
             $it->next();
         }
     }
     //Libera los recursos
     oci_free_statement($stid);
     // Cierra la conexión Oracle
     oci_close($this->conex);
     //retorna el resultado de la consulta
     return $alm;
 }
Exemplo n.º 2
0
 public function __construct($idc = "", $ide = "", $nac = "", $ced = "")
 {
     if ($idc != "") {
         $ciudadano = new Ciudadano();
         $denuncia = new DenunciaDAO();
         $this->persona = $ciudadano->getById($idc);
         $this->denuncia = $denuncia->getByIC($idc);
         $this->nacionalidad_nueva = $nac;
         $this->cedula_nueva = $ced;
     }
     if ($ide != "") {
         $modelo = new EmpresaDAO();
         $denuncia = new DenunciaJuridicaDAO();
         $this->empresa = $modelo->queryByPatrono($ide);
         $this->denuncia = $denuncia->getByIdEmp($ide);
     }
 }
Exemplo n.º 3
0
 public function actualizar(Ciudadano $data)
 {
     try {
         $sql = "UPDATE ciudadano SET \n\t\t\t\t\t\tnacionalidad= ?,\n\t\t\t\t\t\tcedula= ?, \n\t\t\t\t\t\tnombre_ciudadano= ?,\n\t\t\t\t\t\tapellido_ciudadano=?\n\t\t\t\t    WHERE id_ciudadano = ?";
         $this->pdo->prepare($sql)->execute(array($data->__GET('nacionalidad'), $data->__GET('cedula'), $data->__GET('nombreCiudadano'), $data->__GET('apellidoCiudadano'), $data->__GET('id')));
     } catch (Exception $e) {
         die($e->getMessage());
     }
 }
Exemplo n.º 4
0
<?php

include_once '../Modelo/MCiudadano.php';
$mc = new Ciudadano();
date_default_timezone_set("America/Asuncion");
$fecha = date("d/m/Y");
$hora = date("h:i:s");
$ruta = "Evidencia";
if (isset($_REQUEST['Accion'])) {
    $ID = $_REQUEST['ID'];
    $sx = $mc->Liberar_Ciudadano($ID);
    echo '<script language="javascript">window.location="../Vista/V_Ciudadano.php"; alert("Ciudadano Liberado Correctamente");</script>';
} else {
    header("Location: ../Vista/V_Ciudadano.php");
}
Exemplo n.º 5
0
    $tiempo_transcurrido = strtotime($ahora) - strtotime($fechaGuardada);
    //comparamos el tiempo transcurrido
    if ($tiempo_transcurrido >= 600) {
        //si pasaron 10 minutos o más
        session_destroy();
        // destruyo la sesión
        header("Location: ../index.html");
        //envío al usuario a la pag. de autenticación
        //sino, actualizo la fecha de la sesión
    } else {
        $_SESSION["ultimoAcceso"] = $ahora;
    }
}
require '../header.php';
require "../Modelo/MCiudadano.php";
$mc = new Ciudadano();
$sx = $mc->Cargar_Ciudadanos();
?>

 <h1 style="margin-top: -60px;">Ciudadanos Registrados</h1>
<div class="row" style="margin-top: -90px;">
          <table class="table table-striped table-bordered">
            <thead>
              <tr>
                <th style="background:black; color:white; text-align: center;">Codigo</th>
                <th style="background:black; color:white; text-align: center;">CI</th>
                <th style="background:black; color:white; text-align: center;">Nombre</th>
                <th style="background:black; color:white; text-align: center;">Apellidos</th>
                <th style="background:black; color:white; text-align: center;">Correo</th>
                <th style="background:black; color:white; text-align: center;">Estado</th>
              </tr>