public function getByIdEmp($id_emp)
 {
     $this->conex = DataBase::getInstance();
     $stid = oci_parse($this->conex, "SELECT * FROM FISC_DENUNCIAS_JURIDICAS WHERE ID_EMPRESA=:id_emp");
     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_emp', $id_emp);
     $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
     $result = array();
     $alm = new DenunciaJuridica();
     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();
         }
         $result[] = $alm;
     }
     //Libera los recursos
     oci_free_statement($stid);
     // Cierra la conexión Oracle
     oci_close($this->conex);
     //retorna el resultado de la consulta
     return $result;
 }
 $direccion_representante = htmlentities($_POST['direccion_patrono']);
 $representante = new RepresentanteEmpresa();
 $representante->__SET('clv_representante', $id_representante);
 $representante->__SET('str_nombres', $nombre_representante);
 $representante->__SET('str_apellidos', $apellido_representante);
 $representante->__SET('str_telefono1', $telefono1_representante);
 $representante->__SET('str_telefono2', $telefono2_representante);
 $representante->__SET('str_email', $email_representante);
 $representante->__SET('str_direccion', $direccion_representante);
 //DATOS DE LA QUEJA
 $id_denuncia = htmlentities($_POST['num_den']);
 $fecha_denuncia = htmlentities($_POST['fecha']);
 $estatus_denuncia = htmlentities($_POST['estatus']);
 $descripcion_denuncia = htmlentities($_POST['descripcion']);
 $responsable_denuncia = htmlentities($_POST['direccion_responsable']);
 $data = new DenunciaJuridica();
 $data->__SET('id_empresa', $id_empresa);
 $data->__SET('id_denuncia', $id_denuncia);
 $data->__SET('fecha_denuncia', $fecha_denuncia);
 $data->__SET('estatus_denuncia', $estatus_denuncia);
 $data->__SET('descripcion_denuncia', $descripcion_denuncia);
 $data->__SET('responsable_denuncia', $responsable_denuncia);
 if (!empty($_POST['motivos'])) {
     $motivos = $_POST['motivos'];
     $data->__SET('motivo_denuncia', $motivos);
 }
 if (!empty($_POST['documentos'])) {
     $doc = $_POST['documentos'];
     $data->__SET('documentos', $doc);
 }
 if (!empty($_FILES['archivosdenuncia'])) {
Beispiel #3
0
function consultarDenuncia($filtro, $valor)
{
    //$resultado = new DenunciaJuridica();
    $filtro = strtoupper($filtro);
    $valor = strtoupper($valor);
    //$consulta = "SELECT * FROM EMPRESA WHERE ".$filtro."=:valor";
    //SELECT * FROM SIRA.EMPRESA WHERE NOMBRE_EMPRESA LIKE '%STARVE%';
    $consulta = "SELECT * FROM FISC_DENUNCIAS_JURIDICAS WHERE {$filtro} LIKE '%{$valor}%'";
    $conex = conectaBaseDatos();
    $stid = oci_parse($conex, $consulta);
    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, ':valor', $valor);
    $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
    $resultado = array();
    while ($fila = oci_fetch_array($stid, OCI_ASSOC + OCI_RETURN_NULLS)) {
        $alm = new DenunciaJuridica();
        $it = new ArrayIterator($fila);
        while ($it->valid()) {
            $alm->__SET(strtolower($it->key()), $it->current());
            $it->next();
        }
        $resultado[] = $alm;
    }
    //Libera los recursos
    oci_free_statement($stid);
    // Cierra la conexión Oracle
    oci_close($conex);
    return $resultado;
}