function construirListado() { $ciiu = array(); $rup = array(); $parametro = ""; foreach ($_REQUEST as $clave => $valor) { if (substr($clave, 0, 7) == 'rupuact') { $parametro .= "&{$clave}={$valor}"; $rup[] = $valor; } elseif (substr($clave, 0, 7) == 'ciiuact') { $ciiu[] = "'" . $valor . "'"; $parametro .= "&{$clave}={$valor}"; } } $ciiu = implode(',', $ciiu); $rup = implode(',', $rup); $cadena_sql = "SELECT "; $cadena_sql .= "id_registro "; $cadena_sql .= "FROM " . $this->configuracion["prefijo_sys"] . "ciiu_actividad "; if ($ciiu != "" || strlen($ciiu) != 0) { $cadena_sql .= "where "; $cadena_sql .= "actividad in ({$ciiu}) "; } $registrosCIIU = $this->ejecutarSQL($this->configuracion, $this->conexion_consulta, $cadena_sql, "busqueda"); $cadena_sql = "SELECT "; $cadena_sql .= "id_registro "; $cadena_sql .= "FROM " . $this->configuracion["prefijo_sys"] . "rup_actividad "; if ($rup != "" || strlen($rup) != 0) { $cadena_sql .= "where "; $cadena_sql .= "actividad in ({$rup}) "; } $registrosRUP = $this->ejecutarSQL($this->configuracion, $this->conexion_consulta, $cadena_sql, "busqueda"); if (!isset($registrosCIIU) || !isset($registrosRUP)) { $this->mensaje = "NO EXISTEN DATOS PARA ESTA CONSULTA"; } else { $crud = new crud($this->configuracion, 'Resultado', 'pgsql', $this->conexion_consulta, $this->usuario); $crud->setURLConsulta($this->configuracion["host"] . "/" . $this->configuracion["site"] . "/index.php?formulario=" . $this->cripto->codificar_url("opcion=consultaRegistro&pagina=consultaProveedores{$parametro}", $this->configuracion)); //$crud->setdebug(true); $crud->setTabla($this->configuracion["prefijo_sys"] . 'v_proveedor_data', 'registro'); $crud->setFormulario($this->configuracion["host"] . "/" . $this->configuracion["site"] . "/index.php?formulario=" . $this->cripto->codificar_url("opcion=listar&no_pagina=consultaProveedores{$parametro}", $this->configuracion)); $crud->setCampo(array("etiqueta" => "Nit", "bd" => "NIT", "params" => "width:100,align:'left'")); $crud->setCampo(array("etiqueta" => "Empresa", "bd" => "EMPRESA", "params" => "width:180,align:'left'")); $crud->setCampo(array("etiqueta" => "Contacto", "bd" => "(NOMBRE_REP_1||APE_REP_1)", "params" => "width:180,align:'left'")); $crud->setCampo(array("etiqueta" => "Telefono", "bd" => "TEL_1", "params" => "width:180,align:'left'")); $crud->setCampo(array("etiqueta" => "Extension", "bd" => "EXT_1", "params" => "width:50,align:'left'")); //$crud->setFiltro("input_name","nomEmpresa","igual","tabla"); $i = 0; $regPROV = array(); while (isset($registrosCIIU[$i][0])) { $regPROV[] = $registrosCIIU[$i][0]; $i++; } $j = 0; while (isset($registrosRUP[$j][0])) { $regPROV[] = $registrosRUP[$j][0]; $j++; } $crud->setFiltro("registro", implode(',', $regPROV), "in", "tabla"); //unset($_REQUEST); return $crud->armarCrud($this->configuracion, 'false', 'true', 'false', 'false'); } }
function construirListado() { $ciiu = array(); $rup = array(); $parametro = ""; foreach ($_REQUEST as $clave => $valor) { if (substr($clave, 0, 7) == 'rupuact') { $parametro .= "&{$clave}={$valor}"; $rup[] = $valor; } elseif (substr($clave, 0, 7) == 'ciiuact') { $ciiu[] = "'" . $valor . "'"; $parametro .= "&{$clave}={$valor}"; } } $ciiu = implode(',', $ciiu); $rup = implode(',', $rup); $cadena_sql = "SELECT "; $cadena_sql .= "id_registro "; $cadena_sql .= "FROM prov_ciiu_actividad "; $cadena_sql .= "where "; $cadena_sql .= "actividad in ({$ciiu}) "; $registrosCIIU = $this->ejecutarSQL($this->configuracion, $this->conexion, $cadena_sql, "busqueda"); $cadena_sql = "SELECT "; $cadena_sql .= "id_registro "; $cadena_sql .= "FROM prov_rup_actividad "; $cadena_sql .= "where "; $cadena_sql .= "actividad in ({$rup}) "; $registrosRUP = $this->ejecutarSQL($this->configuracion, $this->conexion, $cadena_sql, "busqueda"); $crud = new crud($this->configuracion, 'Resultado', 'pgsql', $this->conexion, $this->usuario); $crud->setURLConsulta($this->configuracion["host"] . "/" . $this->configuracion["site"] . "/index.php?formulario=" . $this->cripto->codificar_url("opcion=consultaRegistro&pagina=consultaProveedores{$parametro}", $this->configuracion)); //$crud->setdebug(true); $crud->setTabla($this->configuracion["prefijo"] . 'proveedor_data', 'id_data'); $crud->setFormulario($this->configuracion["host"] . "/" . $this->configuracion["site"] . "/index.php?formulario=" . $this->cripto->codificar_url("opcion=listar&no_pagina=consultaProveedores{$parametro}", $this->configuracion)); $crud->setCampo(array("etiqueta" => "Nit", "bd" => "reg_data", "params" => "width:300,align:'left'")); $crud->setCampo(array("etiqueta" => "Empresa", "bd" => "input_value", "params" => "width:380,align:'left'")); $crud->setCampo(array("etiqueta" => "Contacto", "bd" => "input_value", "params" => "width:380,align:'left'")); $crud->setFiltro("input_name", "nomEmpresa", "igual", $this->configuracion["prefijo"] . "proveedor_data"); $i = 0; $regPROV = array(); while (isset($registrosCIIU[$i][0])) { $regPROV[] = $registrosCIIU[$i][0]; $i++; } $j = 0; while (isset($registrosRUP[$j][0])) { $regPROV[] = $registrosRUP[$j][0]; $j++; } $crud->setFiltro("reg_data", implode(',', $regPROV), "in", "prov_proveedor_data"); //unset($_REQUEST); return $crud->armarCrud($this->configuracion, 'false', 'true', 'false', 'false'); }