require_once('../include/orm.php'); require_once('../include/globals.php'); require_once('../include/util.php'); $_unidades4_asociarunidades_db_connected = $Link == ''; if($_unidades4_asociarunidades_db_connected) $Link = connectDb(); define('DBCONNECTED', 1); debugstartpage(); if( isset($_x) ) { //if( $_x != '' ) { $_x = $_x == '' ? array() : StringTokenize($_x, ","); $_result = array(); $_result['version'] = array('actual' => 350); $_result['visibility'] = array(); $_initialvars = arrayExclude(get_defined_vars(), array("_*", "form_*", "s_*", "GLOBALS", "Link", "thisname")); } require('../consorcios3/base.events.php'); // isbasewindow: // On Open while( ($__action == "" or $__action == "executedonopen") and (empty($_x) or in('onopen', $_x)) ) { $__action = "executedonopen"; if( $s_idusuario == "" ) redirect("../consorcios3/home.php"); $__tempresult = sqlexec($Link, "select count(*) from Unidades where tipou = 'B' and emprendimientoId = '" . mysql_escape($proyecto) . "' and (uf = '' or uf is null)"); while( $__temprow = mysql_fetch_array($__tempresult)) { $countucb = $__temprow[0]; } $__tempresult = sqlexec($Link, "select count(*) from Unidades where tipou = 'C' and emprendimientoId = '" . mysql_escape($proyecto) . "' and (uf = '' or uf is null)"); while( $__temprow = mysql_fetch_array($__tempresult)) { $countucc = $__temprow[0]; } $__tempresult = sqlexec($Link, "select count(*) from Unidades where tipou = 'X' and emprendimientoId = '" . mysql_escape($proyecto) . "' and (uf = '' or uf is null)"); while( $__temprow = mysql_fetch_array($__tempresult)) { $countucx = $__temprow[0]; } $countuct = $countucx + $countucb + $countucc; // 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['__asociarunidad__1'] = $_id ; $__row0['__asociarunidad__2'] = $id == '0' ? 'Nueva ' : '' ; $__row0['__estado__1'] = $countuct ; $__row0['__estadocohera__1'] = $countucc; $__row0['__estadobaulera__1'] = $countucb ; $__row0['__estadocoheraconbaulera__1'] = $countucx; $_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 = "Configuracion Unidad"; $_pdf->SetTopMargin(50); $_pdf->AliasNbPages(); $_pdf->AddPage(); } if( has($_x, 'pdf') or has($_x, 'pdfprint') or has($_x, 'pdfprint2') ) { $_pdf->title = "Asociación de unidades "; //$_pdf->drawText("Asociación de unidades ",'Arial','',14); } // aca iba session get, uofr y load/saveobject while( has($_x, 'asociarunidad_init') ) { $_result['asociarunidad'] = $asociarunidad->toarray(false); break; } while( has($_x, 'asociarunidad') ) { //if( $errors == "" ) // validateasociarunidad(); if( $errors == "" ) { if( $_redirect != "" ) redirect($_redirect); sessionset('form_asociarunidades_asociarunidad' . $_id, $asociarunidad); if( $_result['redirect'] == '' ) redirect("?id=$id"); } break; } while( has($_x, 'asociarunidad__delete') ) { //if( $errors == "" ) // validateasociarunidad(); if( $errors == "" ) { if( $_redirect != "" ) redirect($_redirect); sessionset('form_asociarunidades_asociarunidad' . $_id, null); if( $_result['redirect'] == '' ) { $_result['redirect'] = "?message=Asociación de unidades eliminada"; } } break; } while( has($_x, 'asociarunidad_unload') ) { // Not used break; } //$asociarunidad -> ['changes'] if( isormObject($asociarunidad) ) $asociarunidad->makeglobals(); 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=asociarunidades.xls"); //echo(''); //echo(''); echo(''); ?> } else { ?>
require('../consorcios3/base.head.php'); ?>