require_once('../include/orm.php'); require_once('../include/globals.php'); require_once('../include/util.php'); $_cuenta_registrarse_db_connected = $Link == ''; if($_cuenta_registrarse_db_connected) $Link = connectDb(); define('DBCONNECTED', 1); debugstartpage(); if( isset($_x) ) { $_x = StringTokenize($_x, ","); $_result = array(); $_initialvars = arrayExclude(get_defined_vars(), array("_*", "form_*", "s_*", "GLOBALS", "Link", "thisname")); } $_morecolumns = ""; if( !isset($_id) and $id != '' ) $_id = rand(1, 100000000); $registro = sessionget('form_registro' . $_id); //logToFile('registro: ' . print_r($registro, true)); if( $_x == '' ) { if( $id != "" and $id != "0" ) { $registro = loadObject($Link, "cuenta.registro", $id); } else { $registro = newObject($Link, "cuenta.registro"); //fillobjectfromrequest($registro); } } updateObjectFromRequest($Link, $registro); //makeglobals($registro, array('id', 'registro')); if( isset($_x) ) $_initialvars = arrayExclude(get_defined_vars(), array("_*", "form_*", "s_*", "GLOBALS", "Link", "thisname")); //$_initialvars['registro'] = objectToStructure($registro); $_initialvars = array_merge($_initialvars, objectToStructure($registro)); if( is_object($registro) ) $registro->makeglobals(); //logToFile('registro after uofr: ' . print_r($registro, true)); // isbasewindow: // On Open while( ($__action == "" or $__action == "executedonopen") and $_x == '' ) { $__action = "executedonopen"; /* sqlexec($Link, "insert into altas(nombre, apellido, email, perfil) values('" . mysql_escape($nombre) . "', '" . mysql_escape($apellido) . "', '" . mysql_escape($email) . "', '" . mysql_escape($producto) . "')"); die("Muchas gracias. Lo contactaremos por email para activar su cuenta"); */ // Si puso header location para ir a otra pagina cierra el script if( !isset($_x) and $__exiting ) { disconnectDb($Link); exit(0); } 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, 'pdf') or has($_x, 'pdfprint') or has($_x, 'pdfprint2') ) { $_pdf->title = "Registro Cliente"; //$_pdf->drawText("Registro Cliente",'Arial','',14); } // aca iba session get, uofr y load/saveobject while( has($_x, 'registro') ) { $registro->saveChanges(); //if( $errors == "" ) // validateregistro(); if( $errors == "" ) { //logToFile("BEFORE SAVE: " . objectToHtml($registro)); saveObject($Link, $registro); if( hasfeature('cuenta.registro', 'procesos') ) { require_once('../include/easyflexa.php'); if( $id == 0 ) setresponsables($registro); controlstatus($registro); } $id = $registro->id; //logToFile(objectToText($registro)); if( $_redirect != "" ) redirect($_redirect); sessionset('form_registro' . $_id, $registro); if( $_result['redirect'] == '' ) redirect("?id=$id"); } break; } while( has($_x, 'registro__delete') ) { //if( $errors == "" ) // validateregistro(); if( $errors == "" ) { //logToFile("BEFORE SAVE: " . objectToHtml($registro)); deleteObject($Link, $registro); //logToFile(objectToText($registro)); if( $_redirect != "" ) redirect($_redirect); sessionset('form_registro' . $_id, null); if( $_result['redirect'] == '' ) { $_result['redirect'] = "?message=Registro Cliente eliminado"; } } break; } while( has($_x, 'registro_unload') ) { // Not used sessionclear('form_registro' . $_id); break; } if( has($_x, 'cargo') ) { $_result['cargo'] = sqltoarray($Link, "Desarrollador, Agente Comercial, Inmobiliaria, Fiduciaria, Constructor, Propietario, Inquilino, Intendente/Encargado, Administrador ", array("id", "text")); } while( has($_x, "verclave__onchange") ) { if($clave == $verclave){ $t=="Las claves son iguales"; } else { $t=="Las claves no son iguales"; }; // Si puso header location para ir a otra pagina cierra el script if( !isset($_x) and $__exiting ) { disconnectDb($Link); exit(0); } break; } sessionset('form_registro' . $_id, $registro); //$registro -> $_result['changes'] if( is_object($registro) ) $registro->makeglobals(); //debug(objectToStructure($registro)); if( has($_x, 'pdf') or has($_x, 'pdfprint') or has($_x, 'pdfprint2') ) { $_pdf->Output(); } ?> // isbasewidnow!: if( !isset($_x) ) { ?>
if( !isset($_popup) ) { ?> } ?> class="popup" } ?> >