function jsGetCreditosByCriteria($convenio, $estatus, $periocidad, $oficial, $include)
{
    $ByConvenio = "";
    $ByEstatus = "";
    $ByPeriocidad = "";
    $ByOficial = "";
    $ByInclude = "";
    if ($estatus != "todas") {
        $ByEstatus = " AND\n\t\t(`creditos_solicitud`.`estatus_actual` = {$estatus}) ";
    }
    if ($oficial != "todas") {
        $ByOficial = "\tAND\n\t(`creditos_solicitud`.`oficial_credito` = {$oficial})";
    }
    if ($convenio != "todas") {
        $ByConvenio = "\t AND\n\t(`creditos_solicitud`.`tipo_convenio` ={$convenio}) ";
    }
    if ($periocidad != "todas") {
        $ByPeriocidad = " AND (`creditos_solicitud`.`periocidad_de_pago` ={$periocidad})";
    }
    if ($include == "on") {
        $ByInclude = "AND\n\t\t(`creditos_solicitud`.`causa_de_mora` = 99)";
    }
    $sqlCred = "SELECT\n\t`socios_general`.`codigo`,\n\n\tCONCAT(`socios_general`.`apellidopaterno`, ' ',\n\t`socios_general`.`apellidomaterno`, ' ',\n\t`socios_general`.`nombrecompleto`) AS 'nombre',\n\t`creditos_solicitud`.`numero_solicitud`,\n\t`creditos_periocidadpagos`.`descripcion_periocidadpagos` AS `periocidad`,\n\t`creditos_tipoconvenio`.`descripcion_tipoconvenio`       AS `convenio`,\n\t`creditos_estatus`.`descripcion_estatus`                 AS `estatus`,\n\t`creditos_solicitud`.`saldo_actual`                      AS `saldo`,\n\t`creditos_causa_de_vencimientos`.`descripcion_de_la_causa`\t\tAS `causa`\nFROM\n\t`creditos_solicitud` `creditos_solicitud`\n\t\tINNER JOIN `creditos_estatus` `creditos_estatus`\n\t\tON `creditos_solicitud`.`estatus_actual` = `creditos_estatus`.\n\t\t`idcreditos_estatus`\n\t\t\tINNER JOIN `creditos_periocidadpagos` `creditos_periocidadpagos`\n\t\t\tON `creditos_solicitud`.`periocidad_de_pago` =\n\t\t\t`creditos_periocidadpagos`.`idcreditos_periocidadpagos`\n\t\t\t\tINNER JOIN `creditos_tipoconvenio` `creditos_tipoconvenio`\n\t\t\t\tON `creditos_solicitud`.`tipo_convenio` =\n\t\t\t\t`creditos_tipoconvenio`.`idcreditos_tipoconvenio`\n\t\t\t\t\tINNER JOIN `socios_general` `socios_general`\n\t\t\t\t\tON `creditos_solicitud`.`numero_socio` = `socios_general`.\n\t\t\t\t\t`codigo`\n\t\t\t\t\t\tINNER JOIN `creditos_causa_de_vencimientos` `creditos_causa_de_vencimientos`\n\t\t\t\t\t\tON `creditos_solicitud`.`causa_de_mora` = `creditos_causa_de_vencimientos`.\n\t\t\t\t\t\t`idcreditos_causa_de_vencimientos`\nWHERE\n\t(`creditos_solicitud`.`saldo_actual` >=" . TOLERANCIA_SALDOS . ")\n\t{$ByEstatus}\n\t{$ByInclude}\n\t{$ByPeriocidad}\n\t{$ByConvenio}\n\t{$ByOficial}\n\t";
    $xTbl = new cTabla($sqlCred, 2);
    $xTbl->addEspTool("<input type=\"checkbox\"  id=\"chk" . STD_LITERAL_DIVISOR . "_REPLACE_ID_\" />");
    $xTbl->setTdClassByType();
    $xTbl->setWidth();
    return $xTbl->show();
    //return $sqlCred;
}
function taRetMenuChilds($iparent)
{
    $sql = "SELECT\n\t\t\t\t`general_menu`.`idgeneral_menu` AS 'codigo',\n\t\t\t\t`general_menu`.`menu_title` AS 'titulo',\n\t\t\t\t`general_menu`.`menu_rules` AS 'permisos'\n\t\t\tFROM\n\t\t\t\t`general_menu` `general_menu`\n\t\t\tWHERE menu_parent='{$iparent}'";
    $tMenu = new cTabla($sql);
    $tMenu->setEventKey("returnMenuNode");
    $xTbl = $tMenu->show();
    return $xTbl;
}
function jsaGetGrupos($txt)
{
    $nombre = $txt;
    $xLi = new cSQLListas();
    $ByNombre = $nombre != "" ? " AND (`nombre_gruposolidario` LIKE '%{$nombre}%' OR `representante_nombrecompleto` LIKE '%{$nombre}%' OR `vocalvigilancia_nombrecompleto` LIKE '%{$nombre}%') " : "";
    $sql = $xLi->getListadoDeGrupos() . "\n\t{$ByNombre}\n\tORDER BY\n\t`nombre_gruposolidario`\n\tLIMIT 0,10 ";
    $xT = new cTabla($sql);
    return $xT->Show();
}
function jsaGuardarPerfil($persona, $tipo, $pais, $monto, $numero, $observaciones)
{
    $xAP = new cAMLPersonas($persona);
    $xAP->init();
    $xAP->setGuardarPerfilTransaccional($tipo, $pais, $monto, $numero, $observaciones);
    $QL = new cSQLListas();
    $xT = new cTabla($QL->getListadoDePerfil($persona));
    $xT->addTool(SYS_DOS);
    return $xT->Show() . $xAP->getMessages(OUT_HTML);
}
function jsaGetCreditos($convenio, $estatus, $periocidad, $oficial)
{
    $xLi = new cSQLListas();
    $ByOficial = CREDITO_USAR_OFICIAL_SEGUIMIENTO == true ? "\tAND\t(`creditos_solicitud`.`oficial_seguimiento` != {$oficial}) " : "\tAND\t(`creditos_solicitud`.`oficial_credito` != {$oficial}) ";
    //saveError( 22, $_SESSION["SN_b80bb7740288fda1f201890375a60c8f"], "$oficial Ingreso al Modulo de Asignacion de Oficiales");
    $sqlCred = CREDITO_USAR_OFICIAL_SEGUIMIENTO == true ? $xLi->getListadoDeCreditosConOficialSeguimiento(false, $estatus, $periocidad, $convenio, $ByOficial) : $xLi->getListadoDeCreditosConOficial(false, $estatus, $periocidad, $convenio, $ByOficial);
    $xTbl = new cTabla($sqlCred, 2);
    $xChk = new cHCheckBox();
    $xTbl->setTdClassByType();
    $xTbl->addEspTool($xChk->get("", "chk" . STD_LITERAL_DIVISOR . "_REPLACE_ID_"));
    $xTbl->setWidth();
    return $xTbl->Show();
    //return $sqlCred;
}
function jsaGetLetras($idcredito, $idfecha)
{
    $xCred = new cCredito($idcredito);
    $xCred->init();
    //$xPlas	= $xCred->getPlanDePago();
    $xF = new cFecha();
    $idfecha = $xF->getFechaISO($idfecha);
    $xQL = new MQL();
    //$xQL->setRawQuery("SET @fecha_de_corte:='$idfecha';");
    my_query("SET @fecha_de_corte:='{$idfecha}';");
    $sql = "SELECT\r\n\t`letras`.`socio_afectado` AS `persona`,\r\n\t`letras`.`docto_afectado` AS `credito`,\r\n\t`letras`.`periodo_socio`  AS `parcialidad`,\r\n\t`letras`.`fecha_de_pago`,\r\n\r\n\t`letras`.`capital`,\r\n\t`letras`.`interes`,\r\n\t`letras`.`iva`,\r\n\t`letras`.`ahorro`,\r\n\t`letras`.`otros`,\r\n\t`letras`.`letra`,\t\r\n\t\r\n\t(`creditos_solicitud`.`tasa_moratorio`*100) AS `tasa_de_mora`,\r\n\t(`creditos_solicitud`.`tasa_interes`*100)   AS `tasa_de_interes` ,\r\n\tDATEDIFF(getFechaDeCorte(), fecha_de_pago) AS 'dias',\r\n\t ((letras.capital * DATEDIFF(getFechaDeCorte(), fecha_de_pago) * (`creditos_solicitud`.`tasa_moratorio` + `creditos_solicitud`.`tasa_interes`))/getDivisorDeInteres()) AS 'mora'\r\n\tFROM\r\n\t\t`creditos_solicitud` `creditos_solicitud` \r\n\t\t\tINNER JOIN `letras` `letras` \r\n\t\t\tON `creditos_solicitud`.`numero_solicitud` = `letras`.`docto_afectado`\r\n\t\r\n\t WHERE capital >0 AND docto_afectado={$idcredito} AND fecha_de_pago <= getFechaDeCorte()";
    $xT = new cTabla($sql);
    $xT->setFootSum(array(4 => "capital", 5 => "interes", 6 => "iva", 7 => "ahorro", 8 => "otros", 9 => "letra", 13 => "mora"));
    return $xT->Show();
}
function getListRecibos($tipo, $socio)
{
    $sql = new cSQLListas();
    $cTbl = new cTabla($sql->getListadoDeRecibos($tipo, $socio));
    $xImg = new cHImg();
    $cTbl->setKeyField("idoperaciones_recibos");
    $cTbl->setTdClassByType();
    $cTbl->OButton("TR.Reporte", "jsGetReporteRecibo(" . HP_REPLACE_ID . ")", $cTbl->ODicIcons()->REPORTE);
    $cTbl->OButton("TR.Panel", "var xRec = new RecGen(); xRec.panel(" . HP_REPLACE_ID . ")", $cTbl->ODicIcons()->EJECUTAR);
    $cTbl->setEventKey("setRecibo");
    return $cTbl->Show();
}
function jsaGetPolizas($fecha, $tipo)
{
    $xF = new cFecha();
    $fecha = $xF->getFechaISO($fecha);
    $xQL = new cSQLListas();
    $xT = new cTabla($xQL->getListadoDePolizasContables($fecha, $tipo), 7);
    $xBtn = new cHImg();
    $xT->setKeyField("codigo");
    $xT->OButton("TR.Modificar", "jsAgregarMovimientos('" . HP_REPLACE_ID . "')\"", $xT->ODicIcons()->AGREGAR);
    $xT->OButton("TR.Imprimir", "jsImprimirPoliza('" . HP_REPLACE_ID . "')\"", $xT->ODicIcons()->IMPRIMIR);
    $xT->OButton("TR.Eliminar", "jsEliminarPoliza('" . HP_REPLACE_ID . "')\"", $xT->ODicIcons()->ELIMINAR);
    return $xT->Show();
}
function jsShowGrupos($nombre_del_grupo)
{
    settype($nombre_del_grupo, "string");
    $rst = "";
    if ($nombre_del_grupo) {
        $nombre_del_grupo = substr($nombre_del_grupo, 0, 6);
        /**
         * 							Sql
         */
        $sql_grupos = "SELECT \r\n\t`socios_grupossolidarios`.`idsocios_grupossolidarios`  AS 'numero',\r\n\t`socios_grupossolidarios`.`nombre_gruposolidario`          \r\n\tAS `nombre`,\r\n\t`socios_grupossolidarios`.`colonia_gruposolidario`         \r\n\tAS `colonia`,\r\n\t`socios_grupossolidarios`.`representante_nombrecompleto`   \r\n\tAS `representante`\r\n\t\r\n\t\t\tFROM socios_grupossolidarios \r\n\t\t\tWHERE nombre_gruposolidario LIKE '%{$nombre_del_grupo}%'\r\n\t\t\t\t\tAND sucursal = '" . getSucursal() . "'\r\n\t\t\tLIMIT 0,10";
        $ctb = new cTabla($sql_grupos);
        $ctb->setEventKey("setGrupo");
        $ctb->setWidth();
        $rst = $ctb->Show();
    }
    return $rst;
}
function mostrar_notificaciones($finicial, $ffinal, $estatus)
{
    $sql = "SELECT\n\t`seguimiento_notificaciones`.`idseguimiento_notificaciones` AS `codigo`,\n\t`seguimiento_notificaciones`.`socio_notificado` AS 'socio',\n\t`socios`.`nombre`,\n\t`seguimiento_notificaciones`.`numero_solicitud` AS 'solicitud',\n\t`seguimiento_notificaciones`.`numero_notificacion` AS 'num',\n\t`seguimiento_notificaciones`.`fecha_notificacion`,\n\t/*`oficiales`.`nombre_completo` AS \t`oficial_a_cargo`,*/\n\t/*`seguimiento_notificaciones`.`fecha_vencimiento`,*/\n\t`seguimiento_notificaciones`.`capital`,\n\t`seguimiento_notificaciones`.`interes`,\n\t`seguimiento_notificaciones`.`moratorio`,\n\t`seguimiento_notificaciones`.`otros_cargos`,\n\t`seguimiento_notificaciones`.`total` \nFROM\n\t`seguimiento_notificaciones` `seguimiento_notificaciones` \n\t\tINNER JOIN `socios` `socios` \n\t\tON `seguimiento_notificaciones`.`socio_notificado` = `socios`.`codigo` \n\t\t\tINNER JOIN `oficiales` `oficiales` \n\t\t\tON `seguimiento_notificaciones`.`oficial_de_seguimiento` = `oficiales`\n\t\t\t.`id` \nWHERE\n\t(`seguimiento_notificaciones`.`estatus_notificacion` ='{$estatus}')\n\t\tORDER BY\n\t\t\t`seguimiento_notificaciones`.`idseguimiento_notificaciones`";
    //$cmdCancel = new cCmdByOrder("common/exit.png", "Cumplir Notificacion", "jsSetCumplido(event);", "cmd@_REPLACE_ID_");
    $cmdOk = "<label for='cmd@_REPLACE_ID_'><input type='checkbox' id='cmd@_REPLACE_ID_' /></label>";
    $cTbl = new cTabla($sql);
    $cTbl->setWidth();
    $cTbl->addTool(2);
    $cTbl->addTool(1);
    //$cTbl->addEspTool($cmdCancel->show());
    $cTbl->addEspTool($cmdOk);
    //$cTbl->addTool(2);
    $cTbl->setTdClassByType();
    $cTbl->setKeyField("idseguimiento_notificaciones");
    return $cTbl->Show();
}
function jsaGetListadoCierres($fecha)
{
    $xLi = new cSQLListas();
    $xF = new cFecha();
    $fecha = $xF->getFechaISO($fecha);
    $sqlList = $xLi->getListadoDeRecibos(12, "", "", $fecha);
    $xTab = new cTabla($sqlList);
    $xTab->OButton("TR.Reporte", "var xR = new RecGen(); xR.reporte(" . HP_REPLACE_ID . ")", $xTab->ODicIcons()->REPORTE);
    $xTab->OButton("TR.Panel", "var xR = new RecGen(); xR.panel(" . HP_REPLACE_ID . ")", $xTab->ODicIcons()->CONTROL);
    $xBtn = new cHButton();
    $xSel = new cHSelect();
    $xCA = $xSel->getListaDeCajasAbiertas();
    $T2 = new cTabla($xCA->getSQL() . " AND `tesoreria_cajas`.`fecha_inicio` = '{$fecha}' ");
    $T2->addEspTool($xBtn->getBasic("", "jsToCerrarCorte('{$fecha}')", "bloquear", "idcerrar", true));
    $html = $xTab->Show("TR.LISTADO DE CIERRES");
    if (MODULO_CAJA_ACTIVADO == true) {
        $html .= $T2->Show("TR.Cajas Abiertas");
        $itemsAbier = $T2->getRowCount();
        $html .= "<input type='hidden' id='idabiertas' value='{$itemsAbier}' />";
    } else {
        $html .= "<input type='hidden' id='idabiertas' value='0' />";
    }
    return $html;
}
function jsaGetListadoDeAvisos($tipo, $fecha_inicial, $fecha_final, $todas)
{
    $tipo = $tipo == SYS_TODAS ? false : $tipo;
    $xT = new cTipos();
    $xF = new cFecha();
    $xAl = new cAml_alerts();
    $xlistas = new cSQLListas();
    $xBtn = new cHButton();
    $xImg = new cHImg();
    //
    $ByEstado = $xT->cBool($todas) == true ? "" : " AND `estado_en_sistema`= " . SYS_UNO;
    $ByEstado .= setNoMenorQueCero($tipo) <= 0 ? "" : "  AND (`aml_risk_catalog`.`tipo_de_riesgo` ={$tipo}) ";
    $fecha_inicial = $xF->getFechaISO($fecha_inicial);
    $fecha_final = $xF->getFechaISO($fecha_final);
    $sql = $xlistas->getListadoDeAlertas(false, false, false, false, $ByEstado);
    $xT = new cTabla($sql);
    $xT->setWithMetaData();
    $xT->OButton("TR.Dictaminar", "jsModificarEstatus(_REPLACE_ID_)", $xT->ODicIcons()->REPORTE);
    $xT->OButton("TR.Panel", "jsToPanel(_REPLACE_ID_)", $xT->ODicIcons()->EJECUTAR);
    $xT->setKeyField($xAl->getKey());
    $xT->setKeyTable($xAl->get());
    return $xT->Show();
}
function jsaGetListadoDeAvisos($tipo, $fecha_inicial, $fecha_final)
{
    $tipo = $tipo == SYS_TODAS ? false : $tipo;
    $xF = new cFecha();
    $xAl = new cAml_risk_register();
    $xlistas = new cSQLListas();
    $xBtn = new cHButton();
    $xImg = new cHImg();
    $fecha_inicial = $xF->getFechaISO($fecha_inicial);
    $fecha_final = $xF->getFechaISO($fecha_final);
    $sql = $xlistas->getListadoDeRiesgosConfirmados(false, false, false, $tipo, false, " AND (`aml_risk_register`.`estado_de_envio` =0) AND (`aml_risk_register`.`fecha_de_checking` =0) ");
    $xT = new cTabla($sql);
    //setLog($sql);
    $xT->OButton("TR.Dictaminar", "jsModificarEstatus(_REPLACE_ID_)", $xT->ODicIcons()->REPORTE);
    $xT->OButton("TR.Modificar", "jsEditarRiesgo(_REPLACE_ID_)", $xT->ODicIcons()->EDITAR);
    //$xT->addTool(1);
    $xT->setKeyField($xAl->getKey());
    $xT->setKeyTable($xAl->get());
    return $xT->Show();
}
function jsaGetListadoDeAvisos($tipo, $fecha_inicial, $fecha_final)
{
    $tipo = $tipo == SYS_TODAS ? false : $tipo;
    $xF = new cFecha();
    $xAl = new cAml_alerts();
    $xlistas = new cSQLListas();
    $xBtn = new cHButton();
    $xImg = new cHImg();
    $fecha_inicial = $xF->getFechaISO($fecha_inicial);
    $fecha_final = $xF->getFechaISO($fecha_final);
    $sql = $xlistas->getListadoDeRiesgosConfirmados($fecha_inicial, $fecha_final, $tipo);
    // getListadoDeAlertas($tipo, $fecha_inicial, $fecha_final, false, " AND `estado_en_sistema`= " . SYS_UNO);
    $xT = new cTabla($sql);
    $xT->addEspTool($xImg->get24("check", " onclick=\"jsConfirmRiesgo(_REPLACE_ID_)\" "));
    $xT->addEspTool($xImg->get24("delete", " onclick=\"jsDescartarRiesgo(_REPLACE_ID_)\" "));
    $xT->setKeyField($xAl->getKey());
    $xT->setKeyTable($xAl->get());
    return $xT->Show();
}
$xT = new cTabla($sql, 2);
$xT->setTipoSalida($out);
$xT->setFootSum(array(4 => "monto", 9 => "unidades", 10 => "equivalencia"));
$body = $xRPT->getEncabezado($xHP->getTitle(), $FechaInicial, $FechaFinal);
$xRPT->setBodyMail($body);
$xRPT->addContent($body);
$xRPT->addContent($xSoc->getFicha(true));
//$xT->setEventKey("jsGoPanel");
//$xT->setKeyField("creditos_solicitud");
$xRPT->addContent($xT->Show($xHP->getTitle()));
$xT = new cTabla($xL->getListadoDePerfil($persona));
$xRPT->addContent($xT->Show());
if (MODO_DEBUG == true) {
    $periodo_inicial = date("Ym", $xF->getInt($FechaInicial));
    $periodo_final = date("Ym", $xF->getInt($FechaFinal));
    $xT2 = new cTabla($xL->getAMLAcumuladoDeEgresos($periodo_inicial, $periodo_final, $persona));
    $xRPT->addContent($xT2->Show());
}
$xRPT->addContent("<h3>" . $xHP->lang("Mensaje") . "</h3>");
//============ Agregar HTML
//$xRPT->addContent( $xHP->init($jsEvent) );
//$xRPT->addContent( $xHP->end() );
$xAml = new cAMLPersonas($persona);
$xAml->init();
$validar = false;
//(MODO_DEBUG == true) ? true : false;
$xAml->setVerificarPerfilTransaccional(false, $validar);
$xAml->setVerificarOperacionesSemestrales();
$xRPT->addContent($xAml->getMessages(OUT_HTML));
$xRPT->setResponse();
$xRPT->setSenders($senders);
$xRPT->setFile($archivo);
$xRPT->setOut($out);
//$xRPT->setSQL($sql);
$xRPT->setTitle($xHP->getTitle());
//============ Reporte
$xSoc = new cSocio($persona);
$xSoc->init();
$body = $xRPT->getEncabezado($xHP->getTitle(), $FechaInicial, $FechaFinal);
$xRPT->setBodyMail($body);
$xRPT->addContent($body);
$xRPT->addContent($xSoc->getFicha(true));
//Bajo revision
$xAl = new cAml_alerts();
$xlistas = new cSQLListas();
$sql = $xlistas->getListadoDeAlertas(false, false, false, $persona, " AND `estado_en_sistema` =" . SYS_UNO);
$xT = new cTabla($sql);
$xRPT->addContent($xT->Show("TR.Alertas pendientes de verificar"));
//Descartados
$sql = $xlistas->getListadoDeAlertas(false, false, false, $persona, " AND `estado_en_sistema` =" . SYS_CERO);
$xT = new cTabla($sql);
$xRPT->addContent($xT->Show("TR.Alertas ignoradas"));
//Riesgos para reportar
$sql = $xlistas->getListadoDeRiesgosConfirmados(false, false, false, false, $persona, " AND `estado_de_envio`= " . SYS_CERO);
$xT = new cTabla($sql);
$xRPT->addContent($xT->Show("TR.Alertas pendientes de reportar"));
$sql = $xlistas->getListadoDeRiesgosConfirmados(false, false, false, false, $persona, " AND `estado_de_envio`= " . SYS_UNO);
$xT = new cTabla($sql);
$xRPT->addContent($xT->Show("TR.Alertas reportadas"));
$xRPT->setResponse();
$xRPT->setSenders($senders);
echo $xRPT->render(true);
			<th>Identificador</th><td><input type='text' name='id' value='0'></td>
			<th>Descripcion</th><td><input type='text' name='descripcion' value='0' size="50"></td>
		</tr>
	</table>
	<input type="submit" value="Enviar">
</form>
<?php 
$description = $_POST["descripcion"];
$id = $_POST["id"];
$sqlp = "SELECT idcreditos_destinos AS 'Identificador', descripcion_destinos AS 'Descripcion' FROM creditos_destinos";
if ($description) {
    $sql = "INSERT INTO creditos_destinos(idcreditos_destinos, descripcion_destinos, destino_credito) VALUES ({$id}, '{$description}', {$id})";
    my_query($sql);
    echo "<p class='aviso'>EL REGISTRO SE EFECTUO CORRECTAMENTE</p><hr></hr>";
}
$mtbl = new cTabla($sqlp);
$mtbl->addTool(1);
$mtbl->addTool(2);
echo $mtbl->Show();
?>
</body>
<script  >
	function actualizame(id) {
	url = "../utils/frm8db7028bdcdf054882ab54f644a9d36b.php?t=creditos_destinos&f=idcreditos_destinos=" + id;
			myurl = window.open(url);
			myurl.focus();

	}
	function eliminame(id) {
		var sURL = "../utils/frm9d23d795f8170f495de9a2c3b251a4cd.php?t=creditos_destinos&f=idcreditos_destinos=" + id;
	delme = window.open( sURL, "window", "width=300,height=300,scrollbars=yes,dependent");
include_once "../core/core.fechas.inc.php";
include_once "../libs/sql.inc.php";
$oficial = elusuario($iduser);
$cuenta_inicial = $_GET["ci"];
$cuenta_final = $_GET["cf"];
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
</head>
<link href="../css/reporte.css" rel="stylesheet" type="text/css">
<body onLoad="javascript:window.print();">
<!-- -->
<?php 
echo getRawHeader();
//diario
$sqlsdo = "SELECT\n\t`contable_catalogo`.`numero`,\n\t/*`contable_catalogo`.`nombre`, */\n\t`contable_saldos`.`ejercicio`,\n\t`contable_saldos`.`tipo`,\n\t`contable_saldos`.`saldo_inicial`,\n\t`contable_saldos`.`imp1`,\n\t`contable_saldos`.`imp2`,\n\t`contable_saldos`.`imp3`,\n\t`contable_saldos`.`imp5`,\n\t`contable_saldos`.`imp6`,\n\t`contable_saldos`.`imp7`,\n\t`contable_saldos`.`imp8`,\n\t`contable_saldos`.`imp9`,\n\t`contable_saldos`.`imp10`,\n\t`contable_saldos`.`imp11`,\n\t`contable_saldos`.`imp12` \nFROM\n\t`contable_catalogo` `contable_catalogo` \n\t\tINNER JOIN `contable_saldos` `contable_saldos` \n\t\tON `contable_catalogo`.`numero` = `contable_saldos`.`cuenta` \nWHERE \n\t`contable_saldos`.cuenta = {$cuenta_inicial}";
$tbl = new cTabla($sqlsdo);
echo $tbl->Show();
echo " <br />\n<br />\n<br />\n<br />\n<br /> ";
echo $tbl->getValorCampo("nombre");
/* $rs = mysql_query($sqlsdo);
while($rw = mysql_fetch_array($rs)){
	
} */
echo getRawFooter();
?>
</body>
</html>
    $fechaFinal = isset($_GET["off"]) ? $xF->getFechaISO($_GET["off"]) : fechasys();
} else {
    $fechaInicial = isset($_GET["on"]) ? $_GET["on"] : FECHA_INICIO_OPERACIONES_SISTEMA;
    $fechaFinal = isset($_GET["off"]) ? $_GET["off"] : fechasys();
}
$ByConvenio = $convenio == SYS_TODAS ? "" : " AND\t(`listado_de_ingresos`.`producto` ={$convenio}) ";
$ByEmpresa = $empresa == SYS_TODAS ? "" : " AND (`listado_de_ingresos`.`clave_empresa` = {$empresa}) ";
$ByFecha = "";
echo $xHP->getHeader();
echo $xHP->setBodyinit("initComponents();");
echo getRawHeader();
$xRpt = new cReportes();
echo $xRpt->getEncabezado($xHP->getTitle(), $fechaInicial, $fechaFinal, $oficial);
$sql = "SELECT * FROM listado_de_ingresos WHERE (`listado_de_ingresos`.`fecha` >='{$fechaInicial}')\r\nAND (`listado_de_ingresos`.`fecha` <='{$fechaFinal}') {$ByConvenio} {$ByEmpresa}\r\nAND tipo_de_pago !='" . TESORERIA_COBRO_NINGUNO . "'\r\n";
//echo $sql;
$xTBL = new cTabla($sql);
$xTBL->setTdClassByType();
$xTBL->setFootSum(array(9 => "capital", 10 => "interes_normal", 11 => "interes_moratorio", 12 => "iva", 13 => "otros"));
echo $xTBL->Show();
echo getRawFooter();
echo $xHP->setBodyEnd();
?>
<script language="javascript">
<?php 
?>
function initComponents(){
	window.print();
}
</script>
<?php 
$xHP->end();
        echo "</fieldset>";
    }
    // avales
    if ($siavales == "yes") {
        $sqlavales = $xList->getListadoDeAvales($idsolicitud, $idsocio);
        $xTblAv = new cTabla($sqlavales);
        $xTblAv->Show("TR.Relacion de Avales presentados por la persona", false);
    }
    if ($sihistorial == "yes") {
        $xTblH = new cTabla($sqlDic->getListadoDeNotas($idsocio, $idsolicitud));
        $xTblH->Show("TR.Historial Moral del Socio", false);
    }
    if ($mod_del_conv == 3) {
        echo "<fieldset>\n\t\t\t<legend>[ Integrantes del Grupo Solidario ]</legend>";
        $sqltb = "SELECT\n\t\t\t\t`socios_general`.`codigo`,\n\t\t\t\tCONCAT(`socios_general`.`nombrecompleto`, ' ',\n\t\t\t\t`socios_general`.`apellidopaterno`, ' ',\n\t\t\t\t`socios_general`.`apellidomaterno`) AS 'nombre'\n\t\t\tFROM\n\t\t\t\t`socios_general` `socios_general`\n\t\t\tWHERE\n\t\t\t\t`socios_general`.`grupo_solidario`= {$grupo_assoc}\n\t\t\t\t/* Filtrar el Grupo Global */\n\t\t\t\tAND\n\t\t\t\t`socios_general`.`grupo_solidario`!= " . DEFAULT_GRUPO . "\n\t\t\t\t/* Excluir a la Representante */\n\t\t\t\tAND\n\t\t\t\t`socios_general`.`codigo` !={$idsocio}\n\t\t\tLIMIT 0,50";
        $cGrupo = new cTabla($sqltb);
        $xtbl = $cGrupo->Show();
        echo $xtbl;
        echo "</fieldset>";
    }
    echo "<hr /><table >\n\t<tr>\n\t<td><h4>PROTESTA DE VERDAD</h4></td>\n\t<td><center>Recibe la Solicitud</center></td>\n\t</tr>\n\t\n\t<tr>\n\t<td style=\"width: 50%;\">\n\t\t<p>Bajo protesta de decir la verdad, los firmantes manifiestan que los datos son ver&iacute;dicos\n\t\ty que las firmas que calzan este documento son las que usan en todos sus documentos\n\t\tp&uacute;blicos y privados, y que con su firma autorizan asimismo a MAE DEL GOLFO, S.A. DE C.V. SOFOM ENR para que traten los datos contenidos en este documento para cualquier fin comercial o de otra naturaleza que estimen conveniente.</p>\n\t\t<br />\n\t\t<br />\n\t</td>\n\t</tr>\n\t<tr>\n\t<td><center>{$mynom}\n\t<br />\n\tFecha en que Debe Presentarse:  ___/________/_____</center></td>\n\t\t<td><center>{$oficial}</center></td>\n\t</tr>\n\t</table>";
    ?>
<table      >
	<tbody>
		<tr>
			<td colspan="0">
			<fieldset>
				<legend>[&nbsp;&nbsp;DICTAMEN DEL COMIT&Eacute; DE CR&Eacute;DITO&nbsp;&nbsp;]</legend>
				<br />
				<hr />
				<br />
$persona = parametro("idsocio", $persona, MQL_INT);
$credito = parametro("credito", DEFAULT_CREDITO, MQL_INT);
$credito = parametro("idsolicitud", $credito, MQL_INT);
$credito = parametro("solicitud", $credito, MQL_INT);
$cuenta = parametro("cuenta", DEFAULT_CUENTA_CORRIENTE, MQL_INT);
$cuenta = parametro("idcuenta", $cuenta, MQL_INT);
$jscallback = parametro("callback");
$tiny = parametro("tiny");
$form = parametro("form");
$action = parametro("action", SYS_NINGUNO);
$persona = parametro("i", $persona, MQL_INT);
$xHP->init();
$xFRM = new cHForm("frm", "./");
$msg = "";
$ssql = $xL->getListadoDeCuentasDeCapt($persona, false, $tipo, $subtipo);
$tb = new cTabla($ssql);
$tb->setEventKey("setCuenta");
//$tb->
$xFRM->addHTML($tb->Show());
$xFRM->addCerrar();
echo $xFRM->get();
//$jxc ->drawJavaScript(false, true);
?>
<script  >
function setCuenta(id){
	msrc	= null;
	if (window.parent){ msrc = window.parent.document; }
	if (opener){ msrc = opener.document; }
<?php 
if ($f != false) {
    echo "\n\t\t\tif(msrc == null){} else {\n\t\t\t\tmsrc.{$f}.{$c}.value \t= id;\n\t\t\t\tmsrc.{$f}.{$c}.focus();\n\t\t\t\tmsrc.{$f}.{$c}.select();\n\t\t\t\t//if(typeof msrc.jsGetDescCredito != \"undefined\"){ msrc.jsGetDescCredito();\t}\n\t\t\t}";
$oficial = elusuario($iduser);
/**
 */
$xF = new cFecha();
$estatus = isset($_GET["estado"]) ? $_GET["estado"] : SYS_TODAS;
$frecuencia = isset($_GET["periocidad"]) ? $_GET["periocidad"] : SYS_TODAS;
$convenio = isset($_GET["convenio"]) ? $_GET["convenio"] : SYS_TODAS;
$empresa = isset($_GET["empresa"]) ? $_GET["empresa"] : SYS_TODAS;
$out = isset($_GET["out"]) ? $_GET["out"] : SYS_DEFAULT;
$fechaInicial = isset($_GET["on"]) ? $xF->getFechaISO($_GET["on"]) : FECHA_INICIO_OPERACIONES_SISTEMA;
$fechaFinal = isset($_GET["off"]) ? $xF->getFechaISO($_GET["off"]) : fechasys();
echo $xHP->getHeader();
echo $xHP->setBodyinit("initComponents();");
echo getRawHeader();
$xRPT = new cReportes();
echo $xRPT->getEncabezado($xHP->getTitle());
$sql = "SELECT * FROM personas_documentacion_tipos";
$xTBL = new cTabla($sql);
echo $xTBL->Show();
echo getRawFooter();
echo $xHP->setBodyEnd();
?>
<script>
<?php 
?>
function initComponents(){
	window.print();
}
</script>
<?php 
$xHP->end();
$f18 = !isset($_GET["f18"]) ? false : $_GET["f18"];
//Mostrar Movimiento Especifico
$TOperacion = !isset($_GET["f19"]) ? false : $_GET["f19"];
//Codigo de Tipo de Operacion.- Mvto Especifico
$fecha_inicial = $_GET["on"];
$fecha_final = $_GET["off"];
$xHP->init("initComponents()");
$xRPT = new cReportes($xHP->getTitle());
echo $xHP->getEncabezado();
echo $xRPT->getEncabezado();
$cCred = new cCredito($idsolicitud);
$cCred->init();
//TODO: Modificar
echo $cCred->getFicha(true, "", true, true);
$sql = "SELECT\n\t`creditos_sdpm_historico`.`idcreditos_sdpm_historico` AS `control`,\n\t`creditos_sdpm_historico`.`numero_de_socio`,\n\t`creditos_sdpm_historico`.`numero_de_credito`,\n\t`creditos_sdpm_historico`.`fecha_anterior`,\n\t`creditos_sdpm_historico`.`fecha_actual`,\n\t`creditos_sdpm_historico`.`dias_transcurridos`,\n\t`creditos_sdpm_historico`.`monto_calculado`,\n\t`creditos_sdpm_historico`.`saldo`,\n\t`creditos_sdpm_historico`.`estatus`,\n\t`creditos_sdpm_historico`.`interes_normal`\nFROM\n\t`creditos_sdpm_historico` `creditos_sdpm_historico` \nWHERE\n\t(`creditos_sdpm_historico`.`numero_de_credito` ={$idsolicitud})\nORDER BY\n\t`creditos_sdpm_historico`.`fecha_anterior` ASC\n\t/*`creditos_sdpm_historico`.`fecha_actual` DESC */";
$cTbl = new cTabla($sql);
$cTbl->setTdClassByType();
$cTbl->setWidth();
$cTbl->Show("", false);
$TSum = $cTbl->getFieldsSum();
echo " <table width='100%'>\n\t\t<tr>\n\t\t<td />\n\t\t<td />\n\t\t<td />\n\t\t<td />\n\t\t\n\t\t<th class='mny'>" . getFMoney($TSum["dias_transcurridos"]) . "</th>\n\t\t<th class='mny'>" . getFMoney($TSum["monto_calculado"]) . "</th>\n\t\t<th class='mny'>" . getFMoney($TSum["saldo"]) . "</th>\n\t\t<td />\n\t\t<th class='mny'>" . getFMoney($TSum["interes_normal"]) . "</th>\n\t\t</tr>\n\t\t</table ";
echo $xHP->getPieDePagina();
?>
</body>
<script  >
<?php 
?>
function initComponents(){
	window.print();
}
</script>
$periocidad = isset($_GET["periocidad"]) ? $_GET["periocidad"] : SYS_TODAS;
//$estado		= (isset($_GET["estado"])) ? $_GET["estado"]: "todas";
$fecha_inicial = parametro("idfecha-0", false);
$fecha_inicial = parametro("on", $fecha_inicial);
$fecha_final = parametro("idfecha-1", false);
$fecha_final = parametro("off", $fecha_final);
echo $xHP->getHeader();
echo $xHP->setBodyinit("initComponents();");
$ByFecha = ($fecha_final == false or $fecha_inicial == false) ? "" : " AND\t(`empresas_operaciones`.`fecha_de_operacion` >='" . $xF->getFechaISO($fecha_inicial) . "') AND\t(`empresas_operaciones`.`fecha_de_operacion` <='" . $xF->getFechaISO($fecha_final) . "') ";
$ByPeriodo = $periodo == SYS_TODAS ? "" : "AND ( `periodo_marcado` = {$periodo}) ";
$xRPT = new cReportes();
echo $xRPT->getHInicial("TR.Estado de cuenta de Empresas", $fecha_inicial, $fecha_final);
//TODO: Acabar
$lt = new cSQLListas();
$sql = $lt->getListadoDeOperacionesDeEmpresas($empresa, $periocidad, $ByFecha . $ByPeriodo);
$xT = new cTabla($sql);
$xEmp = new cEmpresas($empresa);
echo $xEmp->getFicha();
$xT->getFieldsSum("monto");
$xT->setTdClassByType();
$xT->setFootSum(array(6 => "envios", 7 => "cobros"));
echo $xT->Show();
echo getRawFooter();
echo $xHP->setBodyEnd();
?>
<script>
<?php 
?>
function initComponents(){
	window.print();
}
		</tr>
	</table>
<input type='button' name='btsend' value='ENVIAR DATOS'onClick='frmSubmit();'>
</form>
<?php 
$idgrupo = $_POST["idgrupo"];
if (!$idgrupo) {
    $idgrupo = 99;
    echo $msg_rec_warn . $fhtm;
} else {
    $xGr = new cGrupo($idgrupo, true);
    $xGr->init();
    echo $xGr->getFicha(true);
    echo "<hr>\n\t<input type='button' name='cmdModif' value='MODIFICAR DATOS'onClick='modifdatos();'>\n\t<input type='button' name='cmdplaneacionprint' value='VER/IMPRIMIR PLANEACION DE CREDITO'onClick='open_planeacion({$idgrupo});'>\n\t<hr />\n\t";
    $sqlcx = $sqlb10 . " AND socios_general.grupo_solidario={$idgrupo} AND socios_vivienda.principal='1' LIMIT 0,50";
    $cTbl = new cTabla($sqlcx, 0);
    $cTbl->setKeyField("codigo");
    $cTbl->addTool(1);
    $cTbl->Show("", false);
}
?>
</fieldset>

</body>
<script>
 function modifdatos() {
 	var idgpo = document.myform.idgrupo.value;
 	url1 = '../frmgrupos/frmgposolidario.php?x=' + idgpo;
	mywin = window.open(url1);
	mywin.focus();
 }
</td>
			<td>Descripcion Corta</td><td><input disabled name='nombrecuenta' type='text' value='' size="40"></td>
		</tr>
	</table>
	<input type='button' name='btsend' value='ENVIAR DATOS'onClick='frmSubmit();'>
</form>
<?php 
$iddocto = $_POST["idcuenta"];
if (!$iddocto) {
    exit($msg_rec_warn . $fhtm);
}
$cCap = new cCuentaDeCaptacion($iddocto);
$cCap->init();
echo $cCap->getFicha(true);
$sqlmvto = "SELECT\n\t\t`operaciones_mvtos`.`idoperaciones_mvtos`   AS `codigo`,\n\t\t`operaciones_mvtos`.`fecha_operacion`       AS `operado`,\n\t\t`operaciones_mvtos`.`fecha_afectacion`      AS `afectado`,\n\t\t`operaciones_mvtos`.`recibo_afectado`       AS `recibo`,\n\t\t`operaciones_mvtos`.`tipo_operacion`        AS `operacion`,\n\t\t`operaciones_tipos`.`descripcion_operacion` AS `descripcion`,\n\t\t`operaciones_mvtos`.`afectacion_real`       AS `monto`,\n\t\t`operaciones_mvtos`.`docto_afectado`\n\tFROM\n\t\t`operaciones_mvtos` `operaciones_mvtos`\n\t\t\tINNER JOIN `operaciones_tipos` `operaciones_tipos`\n\t\t\tON `operaciones_mvtos`.`tipo_operacion` = `operaciones_tipos`.\n\t\t\t`idoperaciones_tipos`\n\tWHERE\n\t\t(`operaciones_mvtos`.`docto_afectado` ={$iddocto})\n\tORDER BY\n\t\t`operaciones_mvtos`.`fecha_operacion`\n\t";
$cEdit = new cTabla($sqlmvto);
$cEdit->addTool(1);
$cEdit->addTool(2);
$cEdit->setKeyField("idoperaciones_mvtos");
$cEdit->Show("", false);
?>
</fieldset>
</body>
<script   >
	<?php 
echo $cEdit->getJSActions();
?>

</script>
</html>
$input = $_GET["out"];
if (!$input) {
    $input = "default";
}
$setSql = " SELECT\n\t`oficiales`.`id` AS 'oficial',\n\t`oficiales`.`nombre_completo`,\n\t`oficiales`.`puesto`,\n\t`oficiales`.`sucursal`,\n\n\n\t`seguimiento_compromisos`.`socio_comprometido`,\n\t`socios`.`nombre`,\n\n\t`seguimiento_compromisos`.`credito_comprometido`,\n\t`seguimiento_compromisos`.`idseguimiento_compromisos` AS 'clave',\n\t`seguimiento_compromisos`.`fecha_vencimiento`,\n\t`seguimiento_compromisos`.`hora_vencimiento`,\n\t`seguimiento_compromisos`.`tipo_compromiso`,\n\t`seguimiento_compromisos`.`anotacion`,\n\t`seguimiento_compromisos`.`estatus_compromiso`\n\nFROM\n\t`seguimiento_compromisos` `seguimiento_compromisos`\n\t\tINNER JOIN `socios` `socios`\n\t\tON `seguimiento_compromisos`.`socio_comprometido` = `socios`.`codigo`\n\t\t\tINNER JOIN `oficiales` `oficiales`\n\t\t\tON `seguimiento_compromisos`.`oficial_de_seguimiento` = `oficiales`.\n\t\t\t`id`\nWHERE\n\t{$compFecha}\nORDER BY\n\t`oficiales`.`id`,\n\t`seguimiento_compromisos`.`fecha_vencimiento`,\n\t`seguimiento_compromisos`.`hora_vencimiento`,\n\t`seguimiento_compromisos`.`tipo_compromiso`";
//exit($setSql);
if ($input != OUT_EXCEL) {
    $oRpt = new PHPReportMaker();
    $oRpt->setDatabase(MY_DB_IN);
    $oRpt->setUser(RPT_USR_DB);
    $oRpt->setPassword(RPT_PWD_DB);
    $oRpt->setSQL($setSql);
    $oRpt->setXML("../repository/report72.xml");
    $oOut = $oRpt->createOutputPlugin($input);
    $oRpt->setOutputPlugin($oOut);
    $oRpt->run();
    //	*/
} else {
    $filename = $_SERVER['SCRIPT_NAME'];
    $filename = str_replace(".php", "", $filename);
    $filename = str_replace("rpt", "", $filename);
    $filename = str_replace("-", "", $filename);
    $filename = "{$filename}-" . date("YmdHi") . "-from-" . $iduser . ".xls";
    header("Content-type: application/x-msdownload");
    header("Content-Disposition: attachment; filename={$filename}");
    header("Pragma: no-cache");
    header("Expires: 0");
    $cTbl = new cTabla($setSql);
    $cTbl->setWidth();
    $cTbl->Show("", false);
}
function jsaCumplimiento($idsocio)
{
    $xAl = new cAml_alerts();
    $xlistas = new cSQLListas();
    $sql = $xlistas->getListadoDeAlertas(false, false, false, $idsocio);
    $xT = new cTabla($sql);
    $xT->setKeyField($xAl->getKey());
    $xT->setKeyTable($xAl->get());
    return $xT->Show();
}
$FechaInicial = parametro("fecha-0", $FechaInicial);
$FechaInicial = $FechaInicial == false ? FECHA_INICIO_OPERACIONES_SISTEMA : $xF->getFechaISO($FechaInicial);
$FechaFinal = parametro("off", false);
$FechaFinal = parametro("fecha-1", $FechaFinal);
$FechaFinal = $FechaFinal == false ? fechasys() : $xF->getFechaISO($FechaFinal);
$jsEvent = $out != OUT_EXCEL ? "initComponents()" : "";
$senders = getEmails($_REQUEST);
$xODat = new cPersonasCatalogoOtrosDatos();
$sql = "SELECT\r\n\t`socios`.`codigo`,\r\n\t`socios`.`nombre`,\r\n\t`socios_otros_parametros`.`clave_del_parametro` \r\nFROM\r\n\t`socios_otros_parametros` `socios_otros_parametros` \r\n\t\tINNER JOIN `socios` `socios` \r\n\t\tON `socios_otros_parametros`.`clave_de_persona` = `socios`.`codigo` \r\nWHERE\r\n\t(`socios_otros_parametros`.`clave_del_parametro` ='" . $xODat->AML_PEP_PRINCIPAL . "')\r\n\t\t\tOR\r\n\t(`socios_otros_parametros`.`clave_del_parametro` ='" . $xODat->AML_PEP_AFINIDAD . "')\t\t\t\r\n\tOR\r\n(`socios_otros_parametros`.`clave_del_parametro` ='" . $xODat->AML_PEP_CONSANGUINIDAD . "')\t\t\t\r\n\t\tOR\r\n(`socios_otros_parametros`.`clave_del_parametro` ='" . $xODat->AML_PEP_VINCULO_ECONOM . "')\t";
$titulo = "";
$archivo = "";
$xRPT = new cReportes($titulo);
$xRPT->setFile($archivo);
$xRPT->setOut($out);
$xRPT->setSQL($sql);
$xRPT->setTitle($xHP->getTitle());
//============ Reporte
$xT = new cTabla($sql, 1);
$xT->setTipoSalida($out);
$body = $xRPT->getEncabezado($xHP->getTitle(), $FechaInicial, $FechaFinal);
$xRPT->setBodyMail($body);
$xRPT->addContent($body);
//$xT->setEventKey("jsGoPanel");
//$xT->setKeyField("creditos_solicitud");
$xRPT->addContent($xT->Show());
//============ Agregar HTML
//$xRPT->addContent( $xHP->init($jsEvent) );
//$xRPT->addContent( $xHP->end() );
$xRPT->setResponse();
$xRPT->setSenders($senders);
echo $xRPT->render(true);
$frecuencia = parametro("periocidad", SYS_TODAS);
$producto = parametro("convenio", SYS_TODAS);
$producto = parametro("producto", $producto);
$empresa = parametro("empresa", SYS_TODAS);
$out = parametro("out", SYS_DEFAULT);
$FechaInicial = parametro("on", false);
$FechaInicial = parametro("fecha-0", $FechaInicial);
$FechaInicial = $FechaInicial == false ? FECHA_INICIO_OPERACIONES_SISTEMA : $xF->getFechaISO($FechaInicial);
$FechaFinal = parametro("off", false);
$FechaFinal = parametro("fecha-1", $FechaFinal);
$FechaFinal = $FechaFinal == false ? fechasys() : $xF->getFechaISO($FechaFinal);
$jsEvent = $out != OUT_EXCEL ? "initComponents()" : "";
$senders = getEmails($_REQUEST);
$sucursal = parametro("s", SYS_TODAS);
$si_es_por_fecha = "";
$graficos = parametro("graficos", false, MQL_BOOL);
$BySuc = $sucursal == SYS_TODAS ? "" : " AND `creditos_solicitud`.`sucursal`= '{$sucursal}'";
$si_es_por_fecha = " AND fecha_ministracion>='{$FechaInicial}' AND fecha_ministracion<='{$FechaFinal}' ";
$xF->set($FechaFinal);
$ejercicio = $xF->anno();
my_query("SET @ejercicio:={$ejercicio};");
$sql = "\nSELECT\n\t`creditos_tipoconvenio`.`descripcion_tipoconvenio`   AS `convenio`,\n\tCOUNT(`creditos_saldo_mensuales`.`numero_solicitud`) AS `creditos`,\n\tSUM(`creditos_saldo_mensuales`.`enero`)      AS `enero`,\n\tSUM(`creditos_saldo_mensuales`.`febrero`)    AS `febrero`,\n\tSUM(`creditos_saldo_mensuales`.`marzo`)      AS `marzo`,\n\tSUM(`creditos_saldo_mensuales`.`abril`)      AS `abril`,\n\tSUM(`creditos_saldo_mensuales`.`mayo`)       AS `mayo`,\n\tSUM(`creditos_saldo_mensuales`.`junio`)      AS `junio`,\n\tSUM(`creditos_saldo_mensuales`.`julio`)      AS `julio`,\n\tSUM(`creditos_saldo_mensuales`.`agosto`)     AS `agosto`,\n\tSUM(`creditos_saldo_mensuales`.`septiembre`) AS `septiembre`,\n\tSUM(`creditos_saldo_mensuales`.`octubre`)    AS `octubre`,\n\tSUM(`creditos_saldo_mensuales`.`noviembre`)  AS `noviembre`,\n\tSUM(`creditos_saldo_mensuales`.`diciembre`)  AS `diciembre` \n\t\t\nFROM\n\t`creditos_saldo_mensuales` `creditos_saldo_mensuales` \n\t\tINNER JOIN `creditos_tipoconvenio` `creditos_tipoconvenio` \n\t\tON `creditos_saldo_mensuales`.`tipo_convenio` = `creditos_tipoconvenio`.\n\t\t`idcreditos_tipoconvenio`\n\tGROUP BY\n\t\t\n\t\t`creditos_saldo_mensuales`.`tipo_convenio`\n\t\t ";
$xT = new cTabla($sql);
$xT->setFootSum(array(1 => "creditos", 2 => "enero", 3 => "febrero", 4 => "marzo", 5 => "abril", 6 => "mayo", 7 => "junio", 8 => "julio", 9 => "agosto", 10 => "septiembre", 11 => "octubre", 12 => "noviembre", 13 => "diciembre"));
$xRPT->setOut($out);
$xRPT->addContent($xRPT->getEncabezado($xHP->getTitle(), $FechaInicial, $FechaFinal));
$xRPT->setSQL($sql);
$xT->setTipoSalida($out);
$xRPT->addContent($xT->Show());
//$xRPT->addContent("<script>setTimeout('mychart',1500);  function mychart() { $('#sqltable').visualize({type: 'bar', width: '450px'}).appendTo('body'); }</script>");
echo $xRPT->render(true);