function jsaGetLog($txt) { $xHT = new cHObject(); $log_file = "grep error_log /etc/php.ini"; $vars = file_get_contents(SYS_LOG_FILE); $vars = $xHT->Out($vars, OUT_HTML); return $vars; }
function jsaPrevalidarCredito($socio, $solicitud, $numpagos, $periocidad, $convenio, $contrato, $fechaMin, $fechaVenc, $monto) { $clave = md5($socio . $solicitud . ROTTER_KEY . date("Ymd")); $out = false; $msg = ""; $ctrl = ""; $xHO = new cHObject(); $xBtn = new cHButton(); $arrDatos = array("numero_de_solicitud" => $solicitud, "periocidad_de_pago" => $periocidad, "tipo_de_producto" => $convenio, "numero_de_pagos" => $numpagos, "contrato_corriente_relacionado" => $contrato, "fecha_de_ministracion" => $fechaMin, "fecha_de_vencimiento" => $fechaVenc); if ($socio == DEFAULT_SOCIO or $socio == 0) { $msg .= "ERROR\t{$socio}\tClave de Persona no Valido\r\n"; $out = false; } else { if ($solicitud == DEFAULT_CREDITO or $solicitud == 0) { $msg .= "ERROR\t{$socio}\t{$solicitud}\tNumero de Credito no Valido\r\n"; $out = false; } else { //Valorar Numero de Creditos por Socio $xSoc = new cSocio($socio); if ($xSoc->existe($socio) == false) { $msg .= "ERROR\t{$socio}\tEl Socio No Existe\r\n"; $out = false; } else { $xSoc->init(); $out = $xSoc->setPrevalidarCredito($arrDatos); $msg .= $xSoc->getMessages(); } } } if ($out == true) { $msg .= "OK\tEL CREDITO HA SIDO VALIDADO POR EL SISTEMA - CUMPLE LOS REQUISITOS\r\n"; $ctrl .= $xBtn->getBasic("TR.guardar credito", "jsFormularioValidado('{$clave}')", "guardar", "idvalidarok"); $ctrl .= $xBtn->getBasic("TR.validar nuevamente", "jsPrevalidarCredito()", "checar", "idnuevavalidacion"); } else { //$ctrl = "<input type=\"button\" name=\"cmdSubmit\" onclick=\"jsPrevalidarCredito();\" value=\"VALIDAR CREDITO NUEVAMENTE\" />"; $ctrl .= $xBtn->getBasic("TR.validar nuevamente", "jsPrevalidarCredito()", "checar", "idnuevavalidacion"); } $msg = $xHO->Out($msg, OUT_HTML); $svalidate = "{$msg} {$ctrl}"; return $svalidate; }
function getMessages($put = OUT_TXT) { $xH = new cHObject(); return $xH->Out($this->mMessages, $put); }
/** * Genera la Tabla * @param string $vCaption Titulo de la Tabla * @param boolean $retorna Retornar la Tabla como Valor? true/false */ function Show($vCaption = "", $retorna = true, $TableID = "") { $xHComm = new cHObject(); $xD = new cFecha(); $xLng = new cLang(); $xT = new cTipos(); $xQL = new MQL(); $xBtn = new cHButton(); $xIcs = $this->ODicIcons(); $this->mID = $TableID == "" ? $this->mID : $TableID; if (MODO_DEBUG == true and isset($_SERVER["REQUEST_URI"])) { //setLog($_SERVER["REQUEST_URI"]); if (strpos($_SERVER["REQUEST_URI"], "rpt") === false) { $this->addTool(3); } } $xD->setSeparador("/"); if ($this->mSql != "") { //Miembros de las Tablas $tds = ""; $ths = ""; //Inicio de Tabla $pushInit = ""; $pushEnd = ""; $vClassT = ""; $vWidth = ""; $tdt = ""; $tht = ""; $tab = ""; $tfoot = ""; $trick = 1; $capTable = ""; $oldTags = false; if ($this->mTipoSalida == OUT_EXCEL) { $oldTags = true; } //si hay Caption formar el caption if ($vCaption != "" and $this->mPrepareChart == false) { $vCaption = $xLng->getT($vCaption); $vCaption = "<legend>[ {$vCaption} ]</legend>"; $pushInit = "<fieldset>{$vCaption}"; $pushEnd = "</fieldset>"; } if ($vCaption != "" and $this->mPrepareChart == true) { $capTable = "<caption>{$vCaption}</caption>"; } if ($vCaption != "" and $this->mTipoSalida == OUT_EXCEL) { $capTable = "<caption>{$vCaption}</caption>"; } //Clase de la Tabla if ($this->mClassT != "") { $this->mClassT = " " . $this->mClassT; } $vClassT = "class=\"listado" . $this->mClassT . "\" "; //Contar Tools $il = count($this->mTool); $itmCmd = count($this->mEspCMD); $itmEspTool = count($this->mEspTool); $itmTot = $il + $itmCmd + $itmEspTool; if ($itmTot > 0) { $wd = setNoMenorQueCero($this->mWidthTool) <= 0 ? $itmTot * 26 . "px" : $this->mWidthTool; $tht = "<th style='min-width:" . $wd . ";width:" . $wd . ";'>Acciones</th>"; } // -------------------------------------------------------------- $rs = getRecordset($this->mSql); if ($this->mKeyField == "") { $this->mKeyField = mysql_field_name($rs, $this->mKey); } if ($this->mTbl == "") { $this->mTbl = mysql_field_table($rs, $this->mKey); } //Arrays de Nombres y tipo $arrFieldNames = array(); $arrFieldTypes = array(); $preCols = count($this->Fields) <= 1 ? false : true; // $ifl = mysql_num_fields($rs) - 1; //Limite de Fields //------------------------------------------------------------- //Cabeceras de Columnas for ($iCols = 0; $iCols <= $ifl; $iCols++) { $fname = mysql_field_name($rs, $iCols); $ftypes = mysql_field_type($rs, $iCols); $this->Fields[] = $fname; if ($this->mKey == 0 and $this->mKeyField != "") { if (strtolower($fname) == strtolower($this->mKeyField)) { $this->mKey = $iCols; } } $tths = ""; if (isset($this->mColTitles[$fname])) { $tths = $this->mColTitles[$fname]; } else { $tths = strtoupper(str_replace("_", " ", $fname)); } $tths = $xLng->getT("TR.{$tths}"); $cssTh = $iCols == $this->mKey ? " class='key' " : ""; $scope = $this->mPrepareChart == true ? " scope='col' " : ""; //Mejorar codigo if ($this->mTipoSalida == OUT_EXCEL) { $ths .= "<th class=\"xl25\">{$tths}</th>"; } else { if ($this->mTipoSalida == OUT_TXT or $this->mTipoSalida == OUT_CSV) { $ths .= $iCols == 0 ? $tths : $this->mDelimiter . $tths; $ths .= $iCols == $ifl ? "\r\n" : ""; } else { $ths .= ($this->mPrepareChart == true and $iCols == $this->mKey) ? "<td></td>" : "<th {$scope} {$cssTh}>{$tths}</th>"; } } /** * Construye el Array de Tipos y Nombres */ $arrFieldNames[$iCols] = $fname; $arrFieldTypes[$iCols] = $ftypes; } //$ths . "\n $tht"; // -------------------------------------------------------------- while ($rw = mysql_fetch_array($rs)) { $this->mRowCount++; $tdt = ""; $pKey = $this->mKey; $idKey = is_string($rw[$pKey]) == true ? "'" . $rw[$pKey] . "'" : $rw[$pKey]; $dataCustom = ""; $trick = $trick >= 2 ? 1 : $trick + 1; //switch oddr $lis = ""; $liCss = $trick == 2 ? "tags green" : "tags blue"; /*$t = array( 0 => $xBtn->getBasic("TR.Ejecutar", $this->mActionExec . "($idKey)", ) "<img src='../images/common/execute.png' onclick=\"" . $this->mActionExec . "($idKey);\" title='Ejecutar Una acción' />", 1 => "<img src='../images/common/edit.png' onclick=\"if(typeof actualizame" . $this->mRndK . " != 'undefined'){actualizame" . $this->mRndK . "($idKey);} else {jsUp('" . $this->mTbl . "','" . $this->mKeyField . "', $idKey); } \" title='Editar Registro' />", SYS_DOS => "<img src='../images/common/trash.png' onclick=\"var xG = new Gen(); xG.rmRecord({tabla:'" . $this->mTbl . "',id:" . $idKey . "});\" title='Eliminar Registro' />" );*/ $t = array(0 => $xBtn->getBasic("TR.Ejecutar", $this->mActionExec . "({$idKey})", $xIcs->EJECUTAR, "exec{$idKey}", false, true), 1 => $xBtn->getBasic("TR.Editar", "if(typeof actualizame" . $this->mRndK . " != 'undefined'){actualizame" . $this->mRndK . "({$idKey});} else {jsUp('" . $this->mTbl . "','" . $this->mKeyField . "', {$idKey}); }", $xIcs->EDITAR, "redit{$idKey}", false, true), 2 => $xBtn->getBasic("TR.Eliminar", "var xG = new Gen(); xG.rmRecord({tabla:'" . $this->mTbl . "',id:" . $idKey . "});", $xIcs->ELIMINAR, "rdel{$idKey}", false, true), 3 => $xBtn->getBasic("TR.Ver", "var xDev=new SafeDev(); xDev.recordRAW({tabla:'" . $this->mTbl . "',id:" . $idKey . "});", $xIcs->EXPORTAR, "idcmdview{$idKey}", false, true)); foreach ($this->mTool as $idx => $clave) { $lis .= isset($t[$clave]) ? "<li>" . $t[$clave] . "</li>" : ""; } foreach ($this->mEspCMD as $idx => $cnt) { $lis .= "<li>" . str_replace(HP_REPLACE_ID, $rw[$pKey], $cnt) . "</li>"; } $tdt = $lis == "" ? "" : "<ul class='{$liCss}'>{$lis}</ul>"; /** * Herramientas especiales */ foreach ($this->mEspTool as $key => $value) { $DefValue = str_replace(HP_REPLACE_ID, $rw[$pKey], $value); //validar si no es PHP if (strpos($DefValue, "PHP::") !== false) { $cod = str_replace("PHP::", "\$DefValue=", $DefValue); eval($cod); } $tdt .= "\n " . $DefValue; } $tdt = trim($tdt) != "" ? "<td id=\"options-" . $rw[$pKey] . "\" class=\"toolbar-24\">{$tdt}</td>" : ""; if ($this->mTipoSalida == OUT_EXCEL) { $tdt = ""; } //------------------------------------------------------- $ttds = ""; for ($i = 0; $i <= $ifl; $i++) { $event = ""; $css = ""; $oprp = ""; $currVal = $rw[$i]; $sanID = str_replace(" ", "_", $currVal); $type = isset($arrFieldTypes[$i]) ? $arrFieldTypes[$i] : "text"; $name = $arrFieldNames[$i]; $scope = ""; $delims = "td"; $mkEnd = ""; $extraCNT = ""; if ($i == $this->mKey) { $event = $this->EventKey; if ($event != "") { $event = "<a class='button' onclick=\"{$event}('{$rw[$i]}');\" >"; $mkEnd = "</a>"; } $css .= "key"; $oprp = " id=\"pk-" . $sanID . "\" "; $scope = $this->mPrepareChart == true ? "scope=\"row\"" : ""; $delims = $this->mPrepareChart == true ? "th" : "td"; } /** *Agrega el data Custom */ if ($this->mDataCustom == true) { $dataCustom .= $dataCustom == "" ? "{$name}={$currVal}" : "|{$name}={$currVal}"; } /** * Agrega una suma si el tipo aplica */ if (isset($this->arrTypesPHP[$type]) and $this->arrTypesPHP[$type] == "numeric") { if (!isset($this->mFieldSum[$name])) { $this->mFieldSum[$name] = 0; } $this->mFieldSum[$name] += $currVal; } //Agregar sub consulta /*if($this->mSubsEnable == true){ $sqlSub = ""; //si no encuentra if(isset($this->mSubSQLs[$i])){ $sqlSub = $this->mSubSQLs[$i]; } elseif(isset($this->mSubSQLs[$name])){ $sqlSub = $this->mSubSQLs[$name]; } else { if ($i == $this->mKey OR $name == $this->mKeyField){ $sqlSub = (isset($this->mSubSQLs[0])) ? $this->mSubSQLs[0] : ""; } } if($sqlSub == ""){ } else { $sqlSub = str_replace(HP_REPLACE_ID,$currVal, $sqlSub); //if($currVal == 200039104){setLog($sqlSub);} $mql = new MQL(); $data = $mql->getDataRecord($sqlSub); $cnt = ""; $outc = new cHObject(); foreach($data as $info){ foreach($info as $pfield => $pvalue){ $cnt .= $pvalue . "\r\n"; } } $extraCNT .= $outc->Out($cnt, OUT_HTML); } }*/ //Tipo de Dato /** * Si la Opcion de Class por tipo es verdadero * formatea cada Td como su tipo */ $oStr = array("string" => "string", "varchar" => "varchar", "text" => "text", "tinytext" => "tinytext"); if (!isset($oStr[$type])) { $css = $css == "" ? $type : "{$css} {$type}"; } if (isset($this->arrRowCSS[$name])) { $css = $css == "" ? $type : "{$css} " . $this->arrRowCSS[$name]; } $css = $css == "" ? "" : " class=\"{$css}\" "; //Formatea a Moneda el valor si es tpo real if ($type == "real") { $currVal = ($this->mPrepareChart == true or $this->mTipoSalida == OUT_EXCEL) ? round($currVal, 2) : getFMoney($currVal); } if ($type == "date") { $currVal = $xD->getFechaMX($currVal); } if (isset($oStr[$type])) { $currVal = $xHComm->Out($currVal, OUT_HTML); } if ($this->mTipoSalida == OUT_EXCEL) { //class=xl2216681 nowrap $ttds .= "<{$delims} class=\"xl25\" >" . $currVal . "</{$delims}>"; } else { if ($this->mTipoSalida == OUT_TXT or $this->mTipoSalida == OUT_CSV) { $ttds .= $i == 0 ? $currVal : $this->mDelimiter . $currVal; } else { $css = $this->mPrepareChart == true ? "" : $css; $ttds .= "<{$delims} {$scope} {$css} {$oprp}>{$event}" . $currVal . "{$mkEnd}{$extraCNT}</{$delims}>"; } } } // $trcss = $trick >= 2 ? " class='trOdd' " : ""; if ($this->mTipoSalida == OUT_EXCEL) { $tds .= "<tr>{$ttds}{$tdt}</tr>\r\n"; } else { if ($this->mTipoSalida == OUT_TXT or $this->mTipoSalida == OUT_CSV) { $tds .= $ttds . "\r\n"; } else { $dataCustom = $dataCustom != "" ? " data-info=\"{$dataCustom}\" " : ""; $tds .= "<tr id=\"tr-" . $this->mTbl . "-" . str_replace(" ", "_", $rw[$this->mKey]) . "\"{$dataCustom} {$trcss}>{$ttds} {$tdt} </tr>"; } } if ($this->mSubsEnable == true) { foreach ($this->mSubSQLs as $idx => $sqls) { if ($sqls != "") { $sqlSub = str_replace(HP_REPLACE_ID, $rw[$this->mKey], $sqls); $mql = new MQL(); $data = $mql->getDataRecord($sqlSub); $outc = new cHObject(); foreach ($data as $info) { foreach ($info as $pfield => $pvalue) { $cnt .= $pvalue . "\r\n"; } } $extraCNT .= $outc->Out($cnt, OUT_HTML); $icx22 = $ifl + 2; $tds .= "<tr id=\"tr-subs-" . $this->mTbl . "-" . str_replace(" ", "_", $rw[$this->mKey]) . "\"><td colspan='{$icx22}'>{$extraCNT}</td></tr>"; } } } } $this->vFields = $rw; // -------------------------------------------------------------- @mysql_free_result($rs); $ism = $this->mFootSums; //sumas $tfoot = ""; for ($i = 0; $i <= $ifl; $i++) { if (isset($ism[$i])) { if ($this->mTipoSalida == OUT_EXCEL) { $tfoot .= isset($this->mFieldSum[$ism[$i]]) ? "<th>" . getFMoney($this->mFieldSum[$ism[$i]]) . "</th>" : "<td></td>"; } else { $tfoot .= isset($this->mFieldSum[$ism[$i]]) ? "<th><input type='hidden' id='idsum-" . $ism[$i] . "' value='" . $this->mFieldSum[$ism[$i]] . "' /><mark id='sum-" . $ism[$i] . "'>" . getFMoney($this->mFieldSum[$ism[$i]]) . "</mark></th>" : "<td></td>"; } } else { $tfoot .= $i == 0 ? "<th>Filas: " . $this->mRowCount . "</th>" : "<td></td>"; } } $tfoot = $oldTags == true ? "<tr>{$tfoot}</tr>" : "<tfoot><tr>{$tfoot}</tr></tfoot>"; $tfoot = ($this->mSumFoot == false or $this->mPrepareChart == true) ? "" : $tfoot; //Da Salida a la Tbla $mID = $this->mID; $aProps = $this->mTipoSalida == OUT_EXCEL ? " x:str border=0 style='border-collapse: collapse' " : " {$vClassT} id=\"{$mID}\""; $aProps = $this->mPrepareChart == true ? " style=\"display: none; text-align: center \" > " : $aProps; $tBody = $oldTags == true ? "{$tds}" : "<tbody>{$tds}</tbody>"; $tHead = $oldTags == true ? "<tr>{$ths}{$tht}</tr>" : "<thead><tr>{$ths}{$tht}</tr></thead>"; $tHead = trim($ths) == "" ? "" : $tHead; if ($this->mTipoSalida == OUT_TXT or $this->mTipoSalida == OUT_CSV) { $tab = "{$ths} {$tds}"; } else { $tab = "{$pushInit}<table{$aProps}>{$capTable}{$tHead}{$tBody}{$tfoot}</table>{$pushEnd}"; } if ($retorna == true) { return $tab; } else { echo $tab; } } }
} } else { $msg .= "{$iReg}\t{$socio}\t{$credito}\tERROR\tEl credito {$credito} de la persona {$socio} no se pudo leer\r\n"; } if (!$socio or $socio == "") { $td = ""; $msg .= "{$iReg}\t.\t.\tALERTA\tLa Linea({$iReg}) no se Imprimio ({$bufer})\r\n"; } else { echo $td; $iReg++; } } fclose($gestor); echo "\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th />\n\t\t\t\t\t\t\t\t\t<th colspan='3'>SUMAS</th>\n\t\t\t\t\t\t\t\t\t<th />\n\t\t\t\t\t\t\t\t\t<th class='mny'>" . getFMoney($SCapital) . "</th>\n\t\t\t\t\t\t\t\t\t<th class='mny'>" . getFMoney($SInteres) . "</th>\n\t\t\t\t\t\t\t\t\t<th class='mny'>" . getFMoney($SIva) . "</th>\n\t\t\t\t\t\t\t\t\t<th class='mny'>" . getFMoney($SAhorro) . "</th>\n\t\t\t\t\t\t\t\t\t<th class='mny'>" . getFMoney($STotal) . "</th>\n\t\t\t\t\t\t\t\t\t<th />\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th />\n\t\t\t\t\t\t\t\t\t<th colspan='8'>" . convertirletras($STotal) . "</th>\n\t\t\t\t\t\t\t\t\t<th>Diferencias</th>\n\t\t\t\t\t\t\t\t\t<th class='warn'>" . getFMoney($diferencias) . "</th>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th />\n\t\t\t\t\t\t\t\t\t<th colspan='2'>Numero de Cheque</th>\n\t\t\t\t\t\t\t\t\t<th><input type=\"text\" id=\"cCheque\" value=\"\" size='8' /></th>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<th colspan='2'>Observaciones</th>\n\t\t\t\t\t\t\t\t\t<th colspan='3'><input type=\"text\" id=\"cObservaciones\" value=\"\" size='35' /></th>\n\t\t\t\t\t\t\t\t\t<th id=\"idThGo\"><input type=\"button\" value=\"Enviar Pago\" onclick=\"addNewMvto()\" id=\"idButtonGo\" /></th>\n\t\t\t\t\t\t\t\t\t<th />\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</tbody>\n\n\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"maxCounts\" value=\"{$iReg}\" />"; $html = new cHObject(); $hmsg = $html->Out($msg, "html"); echo "<p class ='aviso'>{$hmsg}</p>"; //echo $msg; } $xLog = new cFileLog("recibo_masivo_num_" . $_SESSION["recibo_en_proceso"]); $xLog->setWrite($msg); } else { echo "<p class='aviso'>EL TIPO DE ARCHIVO DE " . $usrFiles[$i]['name'] . "(" . $mExt . ") NO SE ACEPTA</p>"; } } } } if (!isset($iReg)) { $iReg = 0; } ?>
$xFL->setWrite($msg); $xFL->setClose(); if ($procesado != SYS_AUTOMATICO) { $xFRM->addToolbar($xFL->getLinkDownload("TR.Archivo de sucesos", "")); } } if ($procesado != SYS_AUTOMATICO) { $xFRM->addHElem($oRec->getFicha(true)); $total_letras = convertirletras($total_recibo); $xBtn = new cHButton(""); $xFRM->addToolbar($xBtn->getRegresar("./frmcobrosdecreditos.php", true)); $xFRM->addToolbar($xBtn->getBasic("TR.Imprimir Recibo", "printrec()", "imprimir", "cmdPrint", false)); $xFRM->addHTML("<table><tbody>{$tds}</tbody><tfoot><tr><th></th><th>TOTAL</th><th class='mny'>" . getFMoney($total_recibo) . "</th></tr><tr><th colspan=\"3\" class='warn'>{$total_letras}</th></tr></tfoot></table>"); echo $xFRM->get(); echo $oRec->getJsPrint(true); ?> </body> <script> var Wo = new Gen(); function jsCloseRecibo(){ window.close(); } function getEdoCtaCredito(){ Wo.w({url: "../rpt_edos_cuenta/rptestadocuentacredito.php?pb=" + mCredito}); } </script> </html> <?php } else { $xho = new cHObject(); header("Content-type: text/xml"); //PRINT XML $msg = $xho->Out($msg, OUT_TXT); echo "<?xml version =\"1.0\" ?>\n<resultados>{$msg}</resultados>"; }