function solicitarImagen($cuit) { global $conn; $params = array(":cuit" => $cuit); $sql = "SELECT TRUNC(SYSDATE - os_horadevolucionstatus) dias, os_status FROM web.wos_obtenerstatusbcra WHERE os_cuit = :cuit"; $stmt = DBExecSql($conn, $sql, $params); $row = DBGetQuery($stmt); $diasUltimoStatus = $row["DIAS"]; if ((!isset($_REQUEST["refresh"])) and ($diasUltimoStatus == "0")) return $row["OS_STATUS"]; $params = array(":cuit" => $cuit); $sql = "DELETE FROM web.wos_obtenerstatusbcra WHERE os_cuit = :cuit"; DBExecSql($conn, $sql, $params); $params = array(":cuit" => $cuit); $sql = "INSERT INTO web.wos_obtenerstatusbcra (os_id, os_idestado, os_cuit, os_horapedidoimagen) VALUES (-1, 1, :cuit, SYSDATE)"; DBExecSql($conn, $sql, $params); return -1; }
function DrawRows($empleado, $evaluacionId) { global $conn; $sql = "SELECT ROWNUM ID, cm_mejora FROM (SELECT cm_mejora FROM rrhh.hcm_compromisomejora, rrhh.hfe_formularioevaluacion2008 WHERE cm_id_formularioevaluacion = fe_id AND fe_id = :id AND cm_fechabaja IS NULL AND cm_mejora IS NOT NULL AND fe_anoevaluacion = :ano AND fe_fechabaja IS NULL ORDER BY cm_id)"; $params = array(":id" => $evaluacionId, ":ano" => $_REQUEST["ano"]); $stmt = DBExecSql($conn, $sql, $params); $tot = DBGetRecordCount($stmt); while ($row = DBGetQuery($stmt)) { echo '<tr>'; $id = ""; if ($row["ID"] == 1) { $id = 'id="firstRow"'; echo '<td rowspan="'.$tot.'" '.$id.'>'.$empleado.'</td>'; } echo '<td '.$id.'>'.$row["ID"].'</td>'; echo '<td '.$id.'>'.$row["CM_MEJORA"].'</td>'; echo '</tr>'; } }
function copiarTempATelefonos($data, $idTelefono = 0) { global $conn; $sql = "SELECT * FROM tmp.tmp_telefonos"; if ($idTelefono == 0) { $params = array(":tablapadreid" => $data["gIdTablaPadre"], ":tablatel" => $data["gTabla"], ":tipo" => $data["gTipo"], ":usuarioweb" => $data["gUsuario"]); $sql.= " WHERE mp_usuarioweb = :usuarioweb AND mp_tablatel = :tablatel AND (mp_tablapadreid = :tablapadreid OR mp_tablapadreid = -1) AND mp_tipo = :tipo"; } else { $params = array(":id" => $idTelefono); $sql.= " WHERE mp_id = :id"; } $stmt = DBExecSql($conn, $sql, $params, $data["gAutoCommit"]); while ($row = DBGetQuery($stmt)) { if ($row["MP_ESTADO"] == "A") insertarTelefono($data, $row); if ($row["MP_ESTADO"] == "M") if ($row["MP_REGISTROTELID"] <= 0) insertarTelefono($data, $row); else actualizarTelefono($data, $row); if (($row["MP_ESTADO"] == "B") and ($row["MP_REGISTROTELID"] > 0)) eliminarTelefono($data, $row); } }
public function export() { // Método encargado de exportar el query a excel.. global $conn; $result = $this->header; $result.= "<table border=1>"; $stmt = DBExecSql($conn, $this->sql); if (DBGetRecordCount($stmt) > 0) { $cols = 0; while($row = DBGetQuery($stmt, 0)) { // Exporto el nombre de las columnas.. if ($cols == 0) { $cols = count($row); if ($this->showFieldNames) { $result.= "<tr>"; for ($i=1; $i<=$cols; $i++) { $col_name = OCIColumnName($stmt, $i); if (substr($col_name, 0, 3) != "NO_") { $alineacion = "left"; if (isset($this->fieldAlignment[$i - 1])) $alineacion = $this->fieldAlignment[$i - 1]; $result.= "<th align=".$alineacion." style='".$this->fieldNamesStyle."'>".$col_name."</th>"; } } $result.= "</tr>"; } } // Exporto el valor de los campos.. $result.= "<tr>"; for ($i=0; $i<$cols; $i++) { $col_name = OCIColumnName($stmt, $i + 1); if (substr($col_name, 0, 3) != "NO_") { $alineacion = "left"; if (isset($this->fieldAlignment[$i])) $alineacion = $this->fieldAlignment[$i]; $result.= "<td align=".$alineacion." style='".$this->fieldValuesStyle."'>".$row[$i]."</td>"; } } $result.= "</tr>"; } } else $result.= "<tr><td>No hay registros para exportar.</td></tr>"; $result.= "</table>"; header("Content-type: ".$this->getHeader()."; charset=iso-8859-1"); header("Content-Disposition: attachment; filename=".basename($this->fileName.$this->getExtension())); header("Pragma: no-cache"); header("Content-Length: ".strlen($result)); header("Expires: 0"); echo $result; }
function ExisteSqlODBC($sql, $params) { // Devuelve true si el query pasado como parámetro tiene resultados.. global $conn; $query = DBExecSql($conn, $sql, $params); $row = DBGetQuery($query, 0); return count($row) > 0; }
function validar() { global $conn; $errores = false; global $tareaSeleccionada; echo "<script type='text/javascript'>"; echo "with (window.parent.document) {"; echo "var errores = '';"; $tareaSeleccionada = false; if ($_POST["grupoDenuncia"] != -1 ) { $param = array(":id" => $_POST["grupoDenuncia"],":cuit" => $_SESSION["CARGA_TAREA"]["cuit"]); $sql = "SELECT RD_DESCRIPCIONRUBRO,RD_ID FROM hys.hrd_rubrodenuncia WHERE rd_fechabaja IS NULL AND RD_IDGRUPO = :id AND (rd_vigenciadesde <= art.hys.get_operativovigente_empresa(:cuit,sysdate) OR rd_vigenciadesde IS NULL) AND (rd_vigenciahasta > art.hys.get_operativovigente_empresa(:cuit,sysdate) OR rd_vigenciahasta IS NULL) ORDER BY rd_codigorubro"; $stmt = DBExecSql($conn, $sql, $param); while ($row = DBGetQuery($stmt)) { if (isset($_POST['item_'.$row["RD_ID"]])) { $tareaSeleccionada = true; } } if (! $tareaSeleccionada ){ echo "errores+= '- Debe Seleccionar un rubro si tiene seleccionado un grupo.<br />';"; $errores = true; } } if ($errores) { echo "body.style.cursor = 'default';"; echo "getElementById('btnGuardar').style.display = 'inline';"; echo "getElementById('btnCancelar').style.display = 'inline';"; echo "getElementById('divProcesando').style.display = 'none';"; echo "getElementById('errores').innerHTML = errores;"; echo "getElementById('divErroresForm').style.display = 'block';"; echo "getElementById('foco').style.display = 'block';"; echo "getElementById('foco').focus();"; echo "getElementById('foco').style.display = 'none';"; } else { echo "getElementById('divErroresForm').style.display = 'none';"; } echo "}"; echo "</script>"; return !$errores; }
function valorSqlMSSQL($sql, $default, $params) { // Devuelve el valor del primer campo del primer registro del query pasado como parámetro.. global $conn; $query = DBExecSql($conn, $sql, $params); $row = DBGetQuery($query, 0); if ($row[0] == "") { return $default; } else { return $row[0]; } }
function getArticulo($pos) { global $conn; $params = array(":posicion" => $pos); $sql = "SELECT ax_cuerpo cuerpo, ax_id id, ax_rutaimagen rutaimagen, ax_target target, UPPER(ax_titulo) titulo, ax_volanta volanta FROM web.wax_articulosextranetedicion WHERE ax_baja = 'F' AND ax_posicion = :posicion"; $stmt = DBExecSql($conn, $sql, $params); return DBGetQuery($stmt); }
function agregarItems($idPadre, $profundidad) { global $conn; $result = ""; $params = array(":idpadre" => $idPadre); $sql = "SELECT de_id, de_idpadre, de_nombre, de_orden FROM rrhh.rde_descargables WHERE de_idpadre = :idpadre AND de_fechabaja IS NULL ORDER BY de_orden"; $stmt = DBExecSql($conn, $sql, $params); while ($row = DBGetQuery($stmt)) { ?> <input id="padreItem_<?php echo $row["DE_ID"]; ?> " name="padreItem_<?php echo $row["DE_ID"]; ?> " type="hidden" value="<?php echo $row["DE_IDPADRE"]; ?> " /> <input id="posicionItem_<?php echo $row["DE_ID"]; ?> " name="posicionItem_<?php echo $row["DE_ID"]; ?> " type="hidden" value="<?php echo $row["DE_ORDEN"]; ?> " /> <div class="divMantenimientoItem" draggable="true" id="item_<?php echo $row["DE_ID"]; ?> " style="margin-left:<?php echo $profundidad * 12; ?> px;" onDblClick="editarItem(<?php echo $row["DE_ID"]; ?> )"><?php echo $row["DE_NOMBRE"]; ?> </div> <div id="divNada"></div> <? agregarItems($row["DE_ID"], ($profundidad + 1)); } }
function ObtenerPeritajesABM($PeritajeID) { global $conn; $sql = "SELECT \tPJ_ID, \n \t \t\t\tTO_DATE(PJ_FECHAPERITAJE, 'DD/MM/YYYY') PJ_FECHAPERITAJE, \n \t \t\t\tPJ_IDJUICIOENTRAMITE, \n \t \t\t\tTRIM(PJ_RESULTADOPERITAJE) PJ_RESULTADOPERITAJE, \n \t \t\t\tTO_DATE(PJ_FECHANOTIFICACION, 'DD/MM/YYYY') PJ_FECHANOTIFICACION, \t \t\t\t \n\t\t \tPJ_IDTIPOPERICIA, \n\t\t \tTO_DATE(PJ_FECHAVENCIMPUGNACION, 'DD/MM/YYYY') PJ_FECHAVENCIMPUGNACION, \t \t\t\t \t\t \t \n\t\t \tTO_NUMBER(PJ_INCAPACIDADDEMANDA) PJ_INCAPACIDADDEMANDA, \n\t\t \tPJ_USUALTA, \n\t\t \tTO_NUMBER(PJ_INCAPACIDADPERITOMEDICO) PJ_INCAPACIDADPERITOMEDICO, \n\t\t \tTO_NUMBER(PJ_IBMART) PJ_IBMART, \n\t\t \tTO_NUMBER(PJ_IBMPERICIAL) PJ_IBMPERICIAL, \n\t\t \tPJ_IMPUGNACION, \n\t\t \tDECODE(PJ_IMPUGNACION, 'S', 0, 'N', 1, -1) AS IMPUGNACION, \n\t\t \tPJ_IDPERITO, \n\t\t \tPE_NOMBRE, \n\t\t \tPE_NOMBREINDIVIDUAL, \n\t\t \tPE_APELLIDO,\n\t\t\t\tPE_CUITCUIL\t\t\t\t\n\t\t FROM legales.lpj_peritajejuicio,legales.lpe_perito \n\t\t WHERE pj_idperito = pe_id(+)\n\t\t AND pj_id = :PeritajeID"; if (is_numeric($PeritajeID) and $PeritajeID > '0') { $params = array(":PeritajeID" => $PeritajeID); $stmt = DBExecSql($conn, $sql, $params); $row = DBGetQuery($stmt); return array($row['PJ_ID'], $row['PJ_FECHAPERITAJE'], $row['PJ_IDJUICIOENTRAMITE'], $row['PJ_RESULTADOPERITAJE'], $row['PJ_FECHANOTIFICACION'], $row['PJ_IDTIPOPERICIA'], $row['PJ_FECHAVENCIMPUGNACION'], $row['PJ_INCAPACIDADDEMANDA'], $row['PJ_USUALTA'], $row['PJ_INCAPACIDADPERITOMEDICO'], $row['PJ_IBMART'], $row['PJ_IBMPERICIAL'], $row['PJ_IMPUGNACION'], $row['IMPUGNACION'], $row['PJ_IDPERITO'], $row['PE_NOMBRE'], $row['PE_NOMBREINDIVIDUAL'], $row['PE_APELLIDO'], $row['PE_CUITCUIL']); } else { return array('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''); } }
function getArticulo($pos) { global $conn; $params = array(":posicion" => $pos); $sql = "SELECT ae_cuerpo, ae_id, ae_rutaimagen, ae_target, UPPER(ae_titulo) titulo, ae_volanta FROM web.wae_articulosextranet WHERE ae_posicion = :posicion AND ae_fechabaja IS NULL ORDER BY NVL(ae_fechamodif, ae_fechaalta) DESC"; $stmt = DBExecSql($conn, $sql, $params); return DBGetQuery($stmt); }
function getEmailsAviso() { global $conn; $result = array(); $sql = "SELECT se_mail FROM use_usuarios WHERE se_recibeemailintranet = 'S'"; $stmt = DBExecSql($conn, $sql); while ($row = DBGetQuery($stmt)) $result[] = $row["SE_MAIL"]; return $result; }
function getGestorEjecutivoEstudio($contrato, &$gestor, &$ejecutivo, &$estudio) { global $conn; $params = array(":contrato" => $contrato); $sql = "SELECT gestor.gc_nombre gestornombre, ec_nombre ejecutivonombre, estudio.gc_nombre estudionombre FROM aec_ejecutivocuenta, agc_gestorcuenta gestor, agc_gestorcuenta estudio, aco_contrato WHERE co_idgestor = gestor.gc_id(+) AND co_idejecutivo = ec_id(+) AND co_idestudio = estudio.gc_id(+) AND co_contrato = :contrato"; $stmt = DBExecSql($conn, $sql, $params); $row = DBGetQuery($stmt, 1, false); $ejecutivo = $row["EJECUTIVONOMBRE"]; $estudio = $row["ESTUDIONOMBRE"]; $gestor = $row["GESTORNOMBRE"]; }
function getRespuestas($idEncuesta, $idPregunta, $usuario) { global $conn; $result = ""; $sql = "SELECT op_opcion FROM rrhh.rop_opcionespreguntas, rrhh.rrp_respuestaspreguntas WHERE op_id = rp_idopcion AND rp_idencuesta = :idencuesta AND rp_idpregunta = :idpregunta AND rp_usuario = :usuario"; $params = array(":idencuesta" => $idEncuesta, ":idpregunta" => $idPregunta, ":usuario" => $usuario); $stmt = DBExecSql($conn, $sql, $params); while ($row = DBGetQuery($stmt)) $result.= $row["OP_OPCION"]." - "; return substr($result, 0, -3); }
function agregarItems($idPadre, $selectedValue, $profundidad) { global $conn; $result = ""; if ($idPadre == -1) $result = "<option value=\"-1\">* ITEM RAÍZ *</option>"; $params = array(":idpadre" => $idPadre); $sql = "SELECT de_id, de_idpadre, de_nombre FROM rrhh.rde_descargables WHERE de_idpadre = :idpadre AND de_nombrearchivo IS NULL AND de_fechabaja IS NULL ORDER BY de_orden"; $stmt = DBExecSql($conn, $sql, $params); while ($row = DBGetQuery($stmt)) $result.= "<option ".(($selectedValue == $row["DE_ID"])?"selected":"")." value=\"".$row["DE_ID"]."\">".str_repeat(".", ($profundidad * 3)).$row["DE_NOMBRE"]."</option>".agregarItems($row["DE_ID"], $selectedValue, ($profundidad + 1)); return $result; }
function getLocalidades($codigopostal) { global $conn; $result = ""; $params = array(":codigopostal" => $codigopostal); $sql = "SELECT DISTINCT cp_localidad FROM ccp_codigopostal WHERE cp_codigo = :codigopostal AND cp_fechabaja IS NULL ORDER BY 1"; $stmt = DBExecSql($conn, $sql, $params); $i = 0; while ($row = DBGetQuery($stmt)) { $result.= "<span style='color:#".(($i % 2 == 0)?"f00":"00f").";'>".$row["CP_LOCALIDAD"]."</span>, "; $i++; } return $result; }
function validatePregunta($idEncuesta, $idPregunta) { global $conn; $params = array(":id" => $idPregunta, ":idencuesta" => $idEncuesta); $sql = "SELECT 1 FROM rrhh.rpe_preguntasencuesta WHERE pe_id = :id AND pe_idencuesta = :idencuesta AND pe_fechabaja IS NULL"; if (!ExisteSql($sql, $params)) { echo '<span class="Pie">Pregunta inválida.</span>'; exit; } // Si no es la vista previa y no es la primer pregunta valido que no escriban la url en la barra de direcciones.. if ((!isVistaPrevia()) and (isset($_REQUEST["prg"]))) { $params = array(":idpreguntasiguiente" => "0".$idPregunta); $sql = "SELECT op_idpregunta FROM rrhh.rop_opcionespreguntas WHERE op_idpreguntasiguiente = :idpreguntasiguiente"; $stmt = DBExecSql($conn, $sql, $params); $existe = false; while ($row = DBGetQuery($stmt)) { foreach ($_SESSION as $key => $value) if (substr($key, 0, 17) == "ENCUESTA_pregunta") if ($row["OP_IDPREGUNTA"] == $value[0]) { $existe = true; break; } if ($existe) break; } if (!$existe) { echo '<span class="Pie">Pregunta inválida 2.</span>'; exit; } } }
private function drawOptions() { // Método encargado de dibujar las opciones del combo.. global $conn; $result = ""; $disabled = ($this->disabled)?"disabled":""; if ($this->addFirstItem) { $selected = ($this->selected == -1)?"selected":""; $result.= "<option ".$disabled." ".$selected." value=\"-1\">".$this->firstItem."</option>"; } $stmt = DBExecSql($conn, $this->sql, $this->params); while ($row = DBGetQuery($stmt)) { $selected = ($row["ID"] == $this->selected)?"selected":""; $result.= "<option ".$disabled." ".$selected." value=\"".$row["ID"]."\">".$row["DETALLE"]."</option>"; } return $result; }
function CreateArrayJScript($sql, $ArrayName, $fieldName) { /*CreateArrayJScript: convierte los datos retornados de la base en un array js (solo un campo para aramar el array)*/ try { global $conn; $params = array(); $stmt = DBExecSql($conn, $sql, $params); $i = 0; $result = 'var ' . $ArrayName . ' = ['; while ($row = DBGetQuery($stmt, 1, false)) { if ($i > 0) { $result .= ", "; } $result .= " '" . $row[$fieldName] . "' "; $i++; } $result .= ' ]'; return $result; } catch (Exception $e) { EscribirLogTxt1('Error CreateArrayJScript', $e->getMessage()); return false; } }
function GetEmpleados($where) { global $conn; global $gerencia; $result = ""; $sql = "SELECT se_nombre FROM rrhh.hfe_formularioevaluacion2008, use_usuarios useu, computos.cse_sector cse, computos.cse_sector cse2 WHERE fe_evaluado = useu.se_usuario AND useu.se_idsector = cse.se_id AND cse.se_idsectorpadre = cse2.se_id AND fe_anoevaluacion = :ano AND fe_fechabaja IS NULL AND cse2.se_idsectorpadre = :idsectorpadre".$where." ORDER BY 1"; $params = array(":ano" => $_REQUEST["ano"], ":idsectorpadre" => $gerencia); $stmt = DBExecSql($conn, $sql, $params); while ($row = DBGetQuery($stmt)) { $result.= $row["SE_NOMBRE"]."<br>"; } return $result; }
/** * getLote: XML.. * Esta funcion retorna un listado de los documentos que componen el lote pasado como parámetro.. * @return */ function getLote($lote) { global $conn; $xml = '<?xml version="1.0" encoding="utf-8"?>'; $xml.= "<lote>"; $params = array(":id" => $lote); $sql = "SELECT da_lote lote, da_seq_lote secuencia_lote, TO_CHAR(TRUNC(lo_fechaalta), 'YYYY-MM-DD') fechaimpresion_lote, lo_caja caja_lote, ta_codigo coddigo_tipoarchivo, ta_descripcion descr_tipoarchivo, ar_clave clave, art.archivo.getsubclave(ar_clave, 1) subclave1, art.archivo.getsubclave(ar_clave, 2) subclave2, art.archivo.getsubclave(ar_clave, 3) subclave3, art.archivo.getsubclave(ar_clave, 4) subclave4, td_codigo codigo_documento, td_descripcion descr_documento, da_hojas cantidadhojas, re_id remito, TO_CHAR(TRUNC(re_fechaalta), 'YYYY-MM-DD') fechaimpresion_remito FROM archivo.rre_remito, archivo.rta_tipoarchivo, archivo.rtd_tipodocumento, archivo.rar_archivo, archivo.rda_detallearchivo, archivo.rlo_lote WHERE da_lote = lo_id AND da_fechabaja IS NULL AND da_idarchivo = ar_id AND ar_tipo = ta_id AND da_idtipodocumento = td_id AND lo_idremito = re_id(+) AND lo_id = :id ORDER BY da_lote, da_seq_lote"; $stmt = DBExecSql($conn, $sql, $params); while ($row = DBGetQuery($stmt)) { $xml.= "<documento>"; foreach ($row as $clave => $valor) $xml.= "<".strtolower($clave).">".$valor."</".strtolower($clave).">"; $xml.= "</documento>"; } $xml.= "</lote>"; // return new soapval("return", "xsd:string", base64_encode($xml)); return new soapval("return", "xsd:string", $xml); }
function GetEmpleados($where) { global $conn; $result = ""; $sql = "SELECT se_nombre FROM rrhh.hfe_formularioevaluacion2008, use_usuarios WHERE fe_evaluado = se_usuario AND fe_anoevaluacion = :ano AND fe_fechabaja IS NULL AND fe_evaluado IN(SELECT ue_evaluado FROM rrhh.hue_usuarioevaluacion WHERE ue_categoria = 'S' AND ue_anoevaluacion = :ano AND ue_fechabaja IS NULL)".$where." ORDER BY 1"; $params = array(":ano" => $_REQUEST["ano"]); $stmt = DBExecSql($conn, $sql, $params); while ($row = DBGetQuery($stmt)) { $result.= $row["SE_NOMBRE"]."<br>"; } return $result; }
<? require_once($_SERVER["DOCUMENT_ROOT"]."/constants.php"); require_once($_SERVER["DOCUMENT_ROOT"]."/../Common/database/db.php"); $modulePath = "/Modules/ABM_Usuarios/"; $params = array(":id" => $_REQUEST["id"]); $sql = "SELECT NVL(se_cargo, -1) cargo, NVL(se_delegacion, -1) delegacion, TO_CHAR(se_fechacumple, 'dd/mm/yyyy') fechanacimiento, NVL(DECODE(se_contrato, 0, -1, se_contrato), -1) relacionlaboral, NVL(se_respondea, -1) respondea, se_delegacion, se_ejex, se_ejey, se_foto, se_horarioatencion, se_iddelegacionsede, se_interno, se_legajo, se_legajorrhh, se_nivel, se_nombre, se_piso, se_ubica, se_usuario, NVL(se_idsector, -1) sector FROM use_usuarios WHERE se_id = :id"; $stmt = DBExecSql($conn, $sql, $params); $row = DBGetQuery($stmt); ?> <html> <head> <script language="JavaScript" src="/js/constants.js"></script> <script language="JavaScript" src="/js/functions.js"></script> <script language="JavaScript" src="<?php echo $modulePath; ?> js/usuario.js"></script> <script> with (window.parent.document) { getElementById('formUsuario').reset(); getElementById('Id').value = '<?php echo $_REQUEST["id"]; ?> ';
$sql = ObtenerSQL_DatosdelaEmpresa(); $params[":siniestro"] = $_SESSION["ReportesSiniestros"]["ID"]; $params[":orden"] = $_SESSION["ReportesSiniestros"]["ORDEN"]; $stmt = DBExecSql($conn, $sql, $params); //----------------------------------------------------------------------- if (DBGetRecordCount($stmt) == 0) { echo "La consulta no devolviò datos."; exit; } $rowCabecera = DBGetQuery($stmt, 1, false); //----------------------------------------------------------------------- // $pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/varios/templates/ListadoJuiciosVerticalBlanco.pdf"); $stmt = DBExecSql($conn, $sql, $params); $pdf->SetAutoPageBreak(true, 20); $pdf->AddPage('P', 'Legal'); while ($row = DBGetQuery($stmt, 1, false)) { $pdf->SetX($pdf->margenDerecho); $pdf->SetTextColor(0, 0, 0); $pdf->SetFontAlignGeneral(); $Newrow = array_values($row); $pdf->Row($Newrow); $pdf->LineaSepara(); } unset($_SESSION['ReportesSiniestros']["ReporteDatosdelaEmpresa"]); // enviamos cabezales http para no tener problemas header('Content-Type: text/html; charset=UTF-8'); //header('Content-Type: text/html; charset=iso-8859-1'); header("Content-Transfer-Encoding", "binary"); //header('Cache-Control: maxage=3600'); header('Cache-Control: private, max-age=0, must-revalidate'); header('Pragma: public');
<? $nota = $row["NA_NOTA"]->load(); $sql = "SELECT ia_descripcion, ia_extension, ia_id, ia_orden, na_altoimagenes, na_anchoimagenes FROM rrhh.ria_imagenesarteria, rrhh.rna_noticiasarteria WHERE ia_idnoticia = na_id AND ia_idnoticia = :idnoticia AND ia_fechabaja IS NULL ORDER BY ia_orden"; $params = array(":idnoticia" => $row["NA_ID"]); $stmt = DBExecSql($conn, $sql, $params); $jsImagen = "arrVisorImagenes = new Array("; $i = 0; while ($rowImagen = DBGetQuery($stmt)) { $file = base64_encode(IMAGES_ARTERIA_PATH."noticias/".$row["NA_ID"]."_".$rowImagen["IA_ID"].".".$rowImagen["IA_EXTENSION"]); $img = "/functions/get_image.php?file=".$file."&mh=".$rowImagen["NA_ALTOIMAGENES"]."&mw=".$rowImagen["NA_ANCHOIMAGENES"]; $jsImagen.= "'".$file."',"; $strReemplazo = '<div align="center" style="margin-bottom:16px; margin-top:16px;"><a href="#" onClick="mostrarImagen('.$i.');"><img border="0" src="'.$img.'"></a><br />'; $strReemplazo.= '<span class="CuerpoArticulo" valign="top" style="text-align:center;">'.$rowImagen["IA_DESCRIPCION"].'</span>'; $strReemplazo.= '</div>'; $nota = str_replace("@imagen".$rowImagen["IA_ORDEN"]."@", $strReemplazo, $nota); $i++; } if ($i > 0) $jsImagen = substr($jsImagen, 0, -1); $jsImagen.= ");"; ?>
WHERE sc_id = :id"; } $stmt = DBExecSql($conn, $sql, $params); $row = DBGetQuery($stmt, 1, false); if ($modulo == "C") { // Si es una solicitud de cotización, llamo al SP para tomar los valores de la carta.. $curs = null; $params = array(":nrosolicitud" => $row["NROSOLICITUD"]); $sql = "BEGIN art.cotizacion.get_valor_carta(:nrosolicitud, :data); END;"; $stmt = DBExecSP($conn, $curs, $sql, $params); $rowValorFinal = DBGetSP($curs, false); // Hago el query de abajo para formatear 2 campos que salian mal.. $sql = "SELECT TO_CHAR(".str_replace(array("$", ","), array("", "."), $rowValorFinal["COSTOANUAL"]).", '$9,999,999,990.00') costoanual, TO_CHAR(".str_replace(array("$", ","), array("", "."), $rowValorFinal["COSTOCAPITAS"]).", '$9,999,999,990.00') costocapitas FROM DUAL"; $stmt = DBExecSql($conn, $sql, array()); $row2 = DBGetQuery($stmt, 1, false); $row["CUOTAANUAL"] = $row2["COSTOANUAL"]; $row["CUOTAMENSUAL"] = $rowValorFinal["COSTOMENSUAL"]; $row["CUOTATRABAJADOR"] = $row2["COSTOCAPITAS"]; $row["PORCENTAJEVARIABLETRABAJADOR"] = $rowValorFinal["PORCVARIABLE"]; $row["SUMAFIJATRABAJADOR"] = $rowValorFinal["SUMAFIJA"]; } $pdf = new FPDI(); // Dibujo la hoja de análisis comparativo de costos.. if ($row["DIFPORCENTUALSINFORMATO"] < -5) { // INICIO - Generación de gráfico que va incrustado en el reporte.. try {
} // Validación 3.. // EJV 01/02/2010 // Control de vigencia de la Revision de Precio $params = array(":cuit" => $_REQUEST["cuit"]); $sql = "SELECT ca_descripcion FROM art.asr_solicitudreafiliacion JOIN aca_canal ON ca_id = sr_idcanal WHERE (art.actualdate - TRUNC(sr_fechaalta)) < 30 AND sr_estadosolicitud NOT IN('05', '18.0', '18.1', '18.2', '18.3') AND sr_cuit = :cuit"; $stmt = DBExecSql($conn, $sql, $params); if (DBGetRecordCount($stmt) > 0) { $rowValidation = DBGetQuery($stmt); msgBox("[3] Ya existe una solicitud para esta C.U.I.T., por favor comuníquese con su Ejecutivo de Provincia ART.", "cuit"); } // Validación 4.. $params = array(":cuit" => $_REQUEST["cuit"]); $sql = "SELECT afiliacion.check_cobertura(:cuit) FROM DUAL"; if (ValorSql($sql, "", $params) == 1) { msgBox("[4] Esta empresa ya tiene un contrato activo con esta aseguradora."); } // Validación 5.. Que no puedan colocar el CUIT de la ART. // EJV 15/04/2010. if ($_REQUEST["cuit"] == "30688254090") { msgBox("[5] Debe registrarse la C.U.I.T. del empleador (si la C.U.I.T. se registra erróneamente la solicitud no tiene validez).");
require_once($_SERVER["DOCUMENT_ROOT"]."/constants.php"); require_once($_SERVER["DOCUMENT_ROOT"]."/../Common/database/db.php"); require_once($_SERVER["DOCUMENT_ROOT"]."/../Common/database/db_funcs.php"); global $conn; $sql = "SELECT ID, DETALLE FROM (SELECT 1 ID, 'Alta' DETALLE FROM DUAL UNION ALL SELECT 2 ID, 'Media' DETALLE FROM DUAL UNION ALL SELECT 3 ID, 'Baja' DETALLE FROM DUAL) PRIORIDADES WHERE 1 = 1 AND ID >= (SELECT ms_maximaprioridad FROM computos.CMS_MOTIVOSOLICITUD WHERE ms_id = :id)"; $params = array(":id" => $_REQUEST['param1']); $stmt = DBExecSql($conn, $sql, $params); //creo las distintas opciones del select $opciones = '<select class="Combo" id="Prioridad" name="Prioridad"><option value="-1">- SELECCIONAR -</option>'; while ($row = DBGetQuery($stmt, 0)) { $opciones .= '<option value="' . htmlentities($row[0]) . '">' . htmlentities($row[1]) . '</option>'; } $opciones .= '</select>'; echo $opciones; ?>
"SELECT 'R' rr_cargo, art.utiles.armar_cuit(DECODE(sa_tipo_documento_titular, 'CUIL', sa_documento_titular, 'DNI', art.get_cuilvalido(LPAD(sa_documento_titular, 8, '0'), sa_sexo_titular, 1), NULL)) rr_cuitcuil, NULL rr_entidad, NULL rr_matricula, sa_titular rr_nombre, 'Propio' rr_relacion, NULL rr_titulo, 'OTROS' rs_descripcion FROM afi.asa_solicitudafiliacion, afi.ase_solicitudestablecimiento WHERE sa_id = se_idsolicitud AND se_id = :id AND sa_titular IS NOT NULL AND sa_cargo_titular IS NOT NULL AND ROWNUM < 4"; $stmt = DBExecSql($conn, $sql, $params); while ($rowResponsable = DBGetQuery($stmt, 1, false)) { $pdf->Cell(-4); $pdf->Cell(17, 0, $rowResponsable["RR_CUITCUIL"]); $pdf->Cell(1); $pdf->Cell(39, 0, $rowResponsable["RR_NOMBRE"]); $pdf->Cell(1); $pdf->Cell(10, 0, $rowResponsable["RR_CARGO"]); $pdf->Cell(2); $pdf->Cell(20, 0, $rowResponsable["RS_DESCRIPCION"]); $pdf->Cell(1); $pdf->Cell(12, 0, $rowResponsable["RR_RELACION"]); $pdf->Cell(3); $pdf->Cell(24.4, 0, $rowResponsable["RR_TITULO"]); $pdf->Cell(1); $pdf->Cell(28, 0, $rowResponsable["RR_MATRICULA"]); $pdf->Cell(1);
function valorSqlOracle($sql, $default, $params, $commitMode) { // Devuelve el valor del primer campo del primer registro del query pasado como parámetro.. global $conn; $commit = OCI_COMMIT_ON_SUCCESS; switch ($commitMode) { case 0: $commit = OCI_DEFAULT; break; case 1: $commit = OCI_COMMIT_ON_SUCCESS; break; } $stmt = DBExecSql($conn, $sql, $params, $commit); $row = DBGetQuery($stmt, 0); if ($row[0] == "") { return $default; } else { return $row[0]; } }