include_once "../core/core.init.inc.php";
include_once "../core/core.db.inc.php";
$theFile = __FILE__;
$permiso = getSIPAKALPermissions($theFile);
if ($permiso === false) {
    header("location:../404.php?i=999");
}
$_SESSION["current_file"] = addslashes($theFile);
//=====================================================================================================
$xHP = new cHPage("REPORTE DE ", HP_REPORT);
$xHP->setIncludes();
$fechaDeInicio = isset($_GET["on"]) ? $_GET["on"] : fechasys();
$fechaFinal = isset($_GET["off"]) ? $_GET["off"] : fechasys();
$oficial = elusuario($iduser);
$xHP->setNoDefaultCSS();
$xHP->addCSS(CSS_REPORT_FILE);
$arrEquivGenero = array(1 => "M", 2 => "F", 99 => "");
$sql = "SELECT\r\n\t\t\t\t\t`socios_cajalocal`.`clave_de_centro`,\r\n\t\t\t\t\t`socios_general`.`codigo`,\r\n\t\t\t\t\t`socios_general`.`fechanacimiento`,\r\n\t\t\t\t\t`socios_general`.`apellidopaterno`,\r\n\t\t\t\t\t`socios_general`.`apellidomaterno`,\r\n\t\t\t\t\t`socios_general`.`nombrecompleto`,\r\n\t\t\t\t\t`socios_general`.`fechaalta`,\r\n\t\t\t\t\t`socios_general`.`genero` \r\n\t\t\t\tFROM\r\n\t\t\t\t\t`socios_general` `socios_general` \r\n\t\t\t\t\t\tINNER JOIN `socios_cajalocal` `socios_cajalocal` \r\n\t\t\t\t\t\tON `socios_general`.`cajalocal` = `socios_cajalocal`.\r\n\t\t\t\t\t\t`idsocios_cajalocal` \r\n\t\t\t\tWHERE\r\n\t\t\t\t\t(`socios_general`.`fechaalta` >='{$fechaDeInicio}')\r\n\t\t\t\t\tAND\r\n\t\t\t\t\t(`socios_general`.`fechaalta` <='{$fechaFinal}') ";
$rs = getRecordset($sql);
header("Content-type: text/x-csv");
//header("Content-type: text/csv");
//header("Content-type: application/csv");
header("Content-Disposition: attachment; filename=reporte-patmir-II.del_{$fechaDeInicio}.al_{$fechaFinal}.csv");
//echo $xHP->getHeader();
//echo $xHP->setBodyinit("initComponents();");
//echo getRawHeader();
/*
<!-- -->
<table       >
	<thead>
		<tr>
//=====>	INICIO_H
include_once "../core/go.login.inc.php";
include_once "../core/core.error.inc.php";
include_once "../core/core.html.inc.php";
include_once "../core/core.init.inc.php";
$theFile = __FILE__;
$permiso = getSIPAKALPermissions($theFile);
if ($permiso === false) {
    header("location:../404.php?i=999");
}
$_SESSION["current_file"] = addslashes($theFile);
//<=====	FIN_H
$iduser = $_SESSION["log_id"];
//=====================================================================================================
$xHP = new cHPage("Recibo de Cobros", HP_RECIBO);
$xHP->addCSS("../css/tinybox.css");
$xHP->addJsFile("../js/tinybox.js");
$oficial = elusuario($iduser);
$xT = new cTipos();
$xFRM = new cHForm("frmrecibo");
$xF = new cFecha();
$recibo = parametro("recibo", false);
$xQl = new MQL();
echo $xHP->getHeader();
if ($recibo == false) {
    header("location:../404.php?i=" . DEFAULT_CODIGO_DE_ERROR);
}
$arrQ = array("aumento" => 1, "disminucion" => -1, "ninguna" => 0);
//capturar datos del recibo
$xRec = new cReciboDeOperacion(false, false, $recibo);
$xRec->init();
include_once "../core/core.db.inc.php";
$theFile = __FILE__;
$permiso = getSIPAKALPermissions($theFile);
if ($permiso === false) {
    header("location:../404.php?i=999");
}
$_SESSION["current_file"] = addslashes($theFile);
//=====================================================================================================
$xHP = new cHPage("Propiedades Contables de Creditos", HP_GRID);
$xHP->setIncludes();
$parent = isset($_POST["c"]) ? $_POST["c"] : false;
$filtro1 = "";
$filtro2 = "";
//HTML Object Init
$xHP->addJsFile(GRID_SOURCE . "javascript/javascript.js");
$xHP->addCSS("../css/grid.css");
$xHP->addJsFile(GRID_SOURCE . "server.php?client=all");
$xHP->addHSnip("<script> HTML_AJAX.defaultServerUrl = '" . GRID_SOURCE . "server.php';\t</script>");
$xHP->setNoDefaultCSS();
echo $xHP->getHeader(true);
//HTML Object END
echo '<body onmouseup="SetMouseDown(false);" ><div id="onGrid">';
// Define your grid
$_SESSION["grid"]->SetDatabaseConnection(MY_DB_IN, USR_DB, PWD_DB);
//Propiedades del GRID
$mGridTitulo = "Creditos.- Propiedades Contables";
$mGridKeyField = "idcreditos_tipoconvenio";
//Nombre del Campo Unico
$mGridKeyEdit = false;
//Es editable el Campo
$mGridTable = "creditos_tipoconvenio";
 function setOut($out = OUT_HTML)
 {
     if ($out == SYS_DEFAULT) {
         $out = OUT_HTML;
     }
     $xHP = new cHPage("", HP_REPORT);
     $this->mOut = $out;
     switch ($out) {
         case OUT_EXCEL:
             //NADA
             break;
         case OUT_TXT:
             //NADA
             break;
         default:
             $xHP->setTitle($this->mTitulo);
             $xHP->setDevice($out);
             //setLog($out);
             foreach ($this->mCSSList as $key => $file) {
                 $xHP->addCSS($file);
             }
             $this->mHeader = $xHP->getHeader() . $this->mHeader;
             //$this->mHeader	.= "<style>.logo{ margin-left: .5em; max-height: 5em; max-width: 5em;	margin-top: 0 !important; border-color: #808080; z-index: 100000 !important;}</style>";
             //$this->mHeader	.= $xHP->setBodyinit("javascript:window.print();");
             $this->mHeader .= "<body>";
             $this->mFooter .= "</body></html>";
             break;
     }
 }
}
//Parche
$arrD["calle"] = "";
$arrD["numero"] = "";
$arrD["colonia"] = "";
$arrD["codigopostal"] = "";
//$xH	= new cHTMLObject("Partes Relacionadas de Socios");
//$xH->setHeaders();
$xHP->setTitle(PERSONAS_TITULO_PARTES . ".-" . getNombreSocio($idsocio));
$xHP->addJsFile("../jsrsClient.js");
$xHP->addJsFile("../js/jquery/jquery.js");
$xHP->addJsFile("../js/jquery/jquery.qtip.min.js");
$xHP->addJsFile("../js/curp.js");
$xHP->addJsFile("../js/config.js.php");
$xHP->addJsFile("../js/general.js");
$xHP->addCSS("../css/jquery.qtip.css");
echo $xHP->getHeader();
$jxc->drawJavaScript(false, true);
?>
<body onload="initComponents()">
<fieldset>
<legend><script> document.write(document.title); </script></legend>
<form name="frmreferencias" id="idfrmreferencias"  action="referencias.directas.cls.php?idsocio=<?php 
echo $_GET["socio"];
?>
" method="POST">
	<table>
	<tr>
		<td>Tipo de Relaci&oacute;n</td>
			<td>
			<?php 
    $aCierres = $xCierre->check5Cierres($fecha_de_sesion);
    if ($aCierres[SYS_ESTADO] == false) {
        setLog($xCierre->getMessages(), 300);
        header("location:utils/frmcierredeldia.php");
        exit;
    }
    $xPerCred = new cPeriodoDeCredito();
    if ($xPerCred->checkPeriodoVigente($fecha_de_sesion) == false) {
        setLog($xPerCred->getMessages(), 300);
        header("location:frmcreditos/cambiarperiodo.frm.php?a=1");
    }
}
$PATHIMG = "images/common/";
$xHP->setNoCache();
$xHP->setNoDefaultCSS();
$xHP->addCSS("css/general.css");
$xHP->addCSS("css/jmenu.css");
$xHP->addJsFile("js/jquery/jquery.ui.js");
$xHP->addJsFile("js/jmenu/jMenu.jquery.js");
$xHP->addJsFile("js/tinybox.js");
echo $xHP->getHeader();
?>
<style>
	html, body, object  {
		padding: 0 !important;
		margin : 0 !important;
	}
	#header  {
		text-align: center !important;
	}
	#banner {