require_once('../include/orm.php');
require_once('../include/globals.php');
require_once('../include/util.php');
$_portal_index_db_connected = $Link == '';
if($_portal_index_db_connected) $Link = connectDb();
define('DBCONNECTED', 1);
debugstartpage();
if( isset($_x) ) {
//if( $_x != '' ) {
$_x = $_x == '' ? array() : StringTokenize($_x, ",");
$_result = array();
$_result['version'] = array('actual' => 156);
$_result['visibility'] = array();
$_initialvars = arrayExclude(get_defined_vars(), array("_*", "form_*", "s_*", "GLOBALS", "Link", "thisname"));
}
require('../main/base.events.php');
// isbasewindow:
// On Open
while( ($__action == "" or $__action == "executedonopen") and (empty($_x) or in('onopen', $_x)) ) {
$__action = "executedonopen";
/**
$link1 = '';
debug("link1 " . $link1);
debug("link2 " . $link2);
debug("link3 " . $link3);
$iconocaret = "$link1.$link2$link3";
$iconoimagen = '';
$__tempresult = sqlexec($Link, "select nombre from Emprendimientos where id = '" . mysql_escape($proyecto) . "'");
while( $__temprow = mysql_fetch_array($__tempresult)) {
$nombreproyecto = $__temprow[0];
}
**/
//print("MIS EMPRESAS:");
//print_r($misempresas);
// Si puso header location para ir a otra pagina cierra el script
if( !isset($_x) and $__exiting ) {
disconnectDb($Link); exit(0);
}
break;
}
// PHP Vars
while( ($__action == "" or $__action == "executedonopen") and isset($_GET['_x']) and empty($_x) ) {
$__row0 = array();
$__row0['__breadcrumb__1'] = $tipo ;
$__row0['__breadcrumb__2'] = plural($tipo) ;
$_result['morevars'] = $__row0;
break;
}
if( has($_x, 'pdf') or has($_x, 'pdfprint') or has($_x, 'pdfprint2') ) {
require_once('../include/fpdfreport.php');
$_pdf = new PDF((isset($_orientation) ? $_orientation : 'P'),'pt', (isset($_size) ? $_size : 'A4' ));
$_pdf->initialPage = ($_page != '' ? $_page : 1);
//$_pdf->SetAutoPageBreak(true);
$_pdf->title = "";
$_pdf->SetTopMargin(50);
$_pdf->AliasNbPages();
$_pdf->AddPage();
}
if( has($_x, 'contentgroup') ) {
$_result['contentgroup'] = array();
foreach(sqltoarray($Link, "select tipo from portales where (empresa in ($misempresas) or empresa is null) and (emprendimiento in ($misproyectos) or emprendimiento is null or emprendimiento = '') and activo = 's' group by tipo order by tipo desc ") as $__row0) {
makeglobals($__row0);
$__row0['__breadcrumb__1'] = $tipo ;
$__row0['__breadcrumb__2'] = plural($tipo) ;
$_result['contentgroup'][] = $__row0;
}
}
if( has($_x, 'unportal') ) {
$_result['unportal'] = array();
foreach(sqltoarray($Link, "select id, tipo, nombre, url, detalles, imagen from portales where (empresa in ($misempresas) or empresa is null) and (emprendimiento in ($misproyectos) or emprendimiento is null or emprendimiento = '') and activo = 's' and tipo = '$tipo' /** emprendimiento = '$proyecto' **/ order by fechainicio desc ") as $__row0) {
makeglobals($__row0);
$_result['unportal'][] = $__row0;
}
}
if( has($_x, 'pdf') or has($_x, 'pdfprint') or has($_x, 'pdfprint2') ) {
$_pdf->Output();
}
?>
if( !isset($_x) ) {
?>
if( isset($_export) ) { ?>
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=index.xls");
//echo('');
//echo('');
echo('');
?> } else { ?>