"); //print("Planotorre: $planotorre
"); //print("Planopiso: $planopiso
"); //print("TORRE: $torre PISO: $piso"); list($ancho, $alto, $tipo, $atributos) = getimagesize("../files/planos/$archivo"); // Si puso header location para ir a otra pagina cierra el script if( !isset($_x) and $__exiting ) { disconnectDb($Link); exit(0); } break; } // On Refresh do { if( has($_x, 'unidad__agregada') ) { if( trim($coordenadas) != '' ) { debug("insert into pol(plano, unidad, coordenadas) values($id, $agregarunidad, '$coordenadas');"); sqlexec($Link, "insert into pol(plano, unidad, coordenadas) values(" . mysql_escape($id) . ", " . mysql_escape($agregarunidad) . ", '" . mysql_escape($coordenadas) . "')"); } } // Si puso header location para ir a otra pagina cierra el script if( !isset($_x) and $__exiting ) { disconnectDb($Link); exit(0); } } while(false); 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, 'agregarvinculo_select') ) { /** $_result['agregarvinculo_select'] = sqltoarray($Link, "select id, nombre from planos where emprendimiento = '$proyecto' and id != '$id'", array("id", "text", "*")); **/ /** $_result['agregarvinculo_select'] = sqltoarray($Link, "select id, nombre from planos where emprendimiento = '$proyecto' and id != '$id'"); **/ list($_result['agregarvinculo_select'], $_result['agregarvinculo_columns'], $_result['agregarvinculo_types']) = sqltoarraydd($Link, "select id, nombre from planos where emprendimiento = '$proyecto' and id != '$id'"); } while( has($_x, "agregarvinculo__onchange") ) { // // 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, 'agregarunidad_select') ) { /** $_result['agregarunidad_select'] = sqltoarray($Link, "select id, concat(denominacion, ' ', ifnull(tipounidad, '')) from Unidades where emprendimientoid = '$proyecto' and ('$planotorre' = '' or torre like '$planotorre%') and ('$planopiso' = '' or piso = '$planopiso') and id not in (select unidad from rect where plano = '$id' and unidad is not null)", array("id", "text", "*")); **/ /** $_result['agregarunidad_select'] = sqltoarray($Link, "select id, concat(denominacion, ' ', ifnull(tipounidad, '')) from Unidades where emprendimientoid = '$proyecto' and ('$planotorre' = '' or torre like '$planotorre%') and ('$planopiso' = '' or piso = '$planopiso') and id not in (select unidad from rect where plano = '$id' and unidad is not null)"); **/ list($_result['agregarunidad_select'], $_result['agregarunidad_columns'], $_result['agregarunidad_types']) = sqltoarraydd($Link, "select id, concat(denominacion, ' ', ifnull(tipounidad, '')) from Unidades where emprendimientoid = '$proyecto' and ('$planotorre' = '' or torre like '$planotorre%') and ('$planopiso' = '' or piso = '$planopiso') and id not in (select unidad from rect where plano = '$id' and unidad is not null)"); } while( has($_x, "agregarunidad__onchange") ) { // // 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, 'transicion_select') ) { $_result['transicion_select'] = [["rotateleft","rotateleft"],["rotateright","rotateright"],["rotateup","rotateup"],["rotatedown","rotatedown"]]; } while( has($_x,'botoneliminar') ) { /** CODIGO ORIGINAL ONCLICK $onclick **/ if( $editarrect != "" ) { //message("Rectangulo " . $editarrect . " eliminado"); $idrect = ""; //select id into $idrect from rect where plano = '$id' and unidad = '$editarunidad'; sqlexec($Link, "delete from rect where id = " . mysql_escape($editarrect) . ""); redirect("?proyecto=$proyecto&id=$id&message=Rectangulo eliminado"); } // Si puso header location para ir a otra pagina cierra el script if( !isset($_x) and $__exiting ) { disconnectDb($Link); exit(0); } break; } while( has($_x,'botonaceptar') ) { /** CODIGO ORIGINAL ONCLICK $onclick **/ if( $agregarvinculo != "" ) { //message("Agregar plano " . $agregarvinculo . " coordenadas $x, $y $w x $h transicion " . $transicion); $link = "../emprendimientos/plano.php?proyecto=$proyecto&id=" . $agregarvinculo; sqlexec($Link, "insert into rect(plano, link, x, y, w, h, transicion) values('" . mysql_escape($id) . "', '" . mysql_escape($link) . "', " . mysql_escape($x) . ", " . mysql_escape($y) . ", " . mysql_escape($w) . ", " . mysql_escape($h) . ", '" . mysql_escape($transicion) . "' )"); redirect("?proyecto=$proyecto&id=$id&message=Agregado vinculo al plano"); } else if( $agregarunidad != "" ) { //message("Unidad " . $agregarunidad . " coordenadas $x, $y $w x $h"); $idrect = ""; //select id into $idrect from rect where plano = '$id' and unidad = '$agregarunidad'; $__tempresult = sqlexec($Link, "select id from pol where plano = '" . mysql_escape($id) . "' and unidad = '" . mysql_escape($agregarunidad) . "'"); while( $__temprow = mysql_fetch_array($__tempresult)) { $idpol = $__temprow[0]; } /** if( $editarrect != "" ) { sqlexec($Link, "update rect set x = " . mysql_escape($x) . ", y = " . mysql_escape($y) . ", w = " . mysql_escape($w) . ", h = " . mysql_escape($h) . ", unidad = " . mysql_escape($agregarunidad) . ", link = null where id = " . mysql_escape($editarrect) . ""); redirect("?proyecto=$proyecto&id=$id&message=Actualizada unidad al plano"); } else **/ if( $idpol == "" ) { sqlexec($Link, "insert into pol(plano, unidad, coordenadas) values('" . mysql_escape($id) . "', " . mysql_escape($agregarunidad) . ", '" . mysql_escape($coordenadas) . "' )"); redirect("?proyecto=$proyecto&id=$id&message=Agregada unidad al plano"); } else { sqlexec($Link, "update pol set coordenadas = '" . mysql_escape($coordenadas) . "' where id = " . mysql_escape($idpol) . ""); redirect("?proyecto=$proyecto&id=$id&message=Actualizada unidad al plano"); } } else if( $editarrect != "" ) { //message("Rectangulo " . $editarrect . " coordenadas $x, $y $w x $h"); $idrect = ""; //select id into $idrect from rect where plano = '$id' and unidad = '$editarunidad'; sqlexec($Link, "update rect set x = " . mysql_escape($x) . ", y = " . mysql_escape($y) . ", w = " . mysql_escape($w) . ", h = " . mysql_escape($h) . " where id = " . mysql_escape($editarrect) . ""); redirect("?proyecto=$proyecto&id=$id&message=Actualizado recangulo en plano coordenadas $x, $y $w x $h"); } // 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') ) { $_pdf->Output(); } ?> class="popup" >