disableLog(); $f->addHTMLHeadJs(array("../lib/openlayers/OpenLayers.js", "../lib/openlayers/proj4js-compressed.js", "../js/sig.js", "../app/js/sig.js")); // ================================================ // *** recuperation sql dans le sgbd postgresql *** // ================================================ // table om_sig_map $titre=""; $sql="select * from ".DB_PREFIXE."om_sig_map where id='".$obj."'"; $res = $f -> db -> query($sql); if (DB :: isError($res)){ $class = "error"; $message = _($res->getMessage()." ERREUR SQL ".$sql); $f->addToMessage($class, $message); $f->setFlag(NULL); $f->display(); die(); }else{ while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ $titre=$row['libelle']; $zoom=$row['zoom']; $fond_sat=$row['fond_sat']; $fond_osm=$row['fond_osm']; $fond_bing=$row['fond_bing']; $layer_info=$row['layer_info']; if (!isset ($_GET['etendue'])) //***fr $etendue= $row['etendue']; $maj=$row['maj']; $projection_externe=$row['projection_externe']; $table=$row['table_update']; $champ=$row['champ']; $retour=$row['retour']; // récupération champ type géométrie dans om_sig_map (1ere geometrie) $om_sig_map=$row['om_sig_map']; $geometrie=$row['type_geometrie']; $lib_geometrie=$row['lib_geometrie']; } } if($titre=="") { $class = "error"; $message = _("L'objet est invalide."); $f->addToMessage($class, $message); $f->setFlag(NULL); $f->display(); die(); } $nb_imp = 0; $sql = "select om_sig_map_wms, ol_map, chemin as chemin, couches as couches, visibility, panier,"; $sql .= " pa_nom , pa_layer, pa_attribut, pa_encaps, pa_sql, pa_type_geometrie, sql_filter, baselayer, singletile, maxzoomlevel, "; $sql .= " cache_type, cache_gfi_chemin, cache_gfi_couches "; $sql .= " from ".DB_PREFIXE."om_sig_map, ".DB_PREFIXE."om_sig_wms, ".DB_PREFIXE."om_sig_map_wms "; $sql .= " where om_sig_map.om_sig_map = om_sig_map_wms.om_sig_map "; $sql .= " and om_sig_wms.om_sig_wms = om_sig_map_wms.om_sig_wms and om_sig_map.id='".$obj."' "; $sql .= " order by om_sig_map_wms.ordre desc"; $res = $f -> db -> query($sql); $ol_map = array(); $ol_chemin = array(); $ol_couches = array(); $ol_visibility = array(); $ol_om_sig_map_wms = array(); $ol_panier = array(); $ol_pa_nom = array(); $ol_pa_layer = array(); $ol_pa_attribut = array(); $ol_pa_encaps = array(); $ol_imp_titre = array(); $ol_pa_type_geometrie = array(); $ol_filter = array(); $ol_baselayer = array(); $ol_singletile = array(); $ol_maxzoomlevel = array(); $ol_cache_type = array(); $ol_cache_gfi_chemin = array(); $ol_cache_gfi_couches = array(); if (DB :: isError($res)){ $class = "error"; $message = _($res->getMessage()." ERREUR SQL ".$sql); $f->addToMessage($class, $message); $f->setFlag(NULL); $f->display(); die(); }else{ while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ array_push($ol_map,$row['ol_map']); array_push($ol_chemin,$row['chemin']); array_push($ol_couches,$row['couches']); array_push($ol_visibility,$row['visibility']); array_push($ol_om_sig_map_wms,$row['om_sig_map_wms']); array_push($ol_panier,$row['panier']); array_push($ol_pa_nom,$row['pa_nom']); array_push($ol_pa_layer,$row['pa_layer']); array_push($ol_pa_attribut,$row['pa_attribut']); array_push($ol_pa_encaps,$row['pa_encaps']); $ol_imp_titre_tmp=""; if ($row['cache_type']=="IMP" && $row['pa_sql']!="") { $resImp = $f -> db -> query(str_replace("&user",$_SESSION['login'],str_replace("²",'"',str_replace("&idx",$idx,str_replace("&DB_PREFIXE",DB_PREFIXE,$row['pa_sql']))))); if (DB :: isError($resImp)){ $class = "error"; $message = _($resImp->getMessage()." ERREUR SQL ".str_replace("²",'"',str_replace("&idx",$idx,str_replace("&DB_PREFIXE",DB_PREFIXE,$row['pa_sql'])))); $f->addToMessage($class, $message); $f->setFlag(NULL); $f->display(); die(); }else{ while ($rowImp=& $resImp->fetchRow(DB_FETCHMODE_ASSOC)){ $ol_imp_titre_tmp=$rowImp['titre']; } } } array_push($ol_imp_titre,$ol_imp_titre_tmp); array_push($ol_pa_type_geometrie,$row['pa_type_geometrie']); $ol_filter_tmp=""; if ($row['sql_filter']!="") { $resBuffer = $f -> db -> query(str_replace("²",'"',str_replace("&idx",$idx,str_replace("&DB_PREFIXE",DB_PREFIXE,$row['sql_filter'])))); if (DB :: isError($resBuffer)){ $class = "error"; $message = _($resBuffer->getMessage()." ERREUR SQL ".str_replace("²",'"',str_replace("&idx",$idx,str_replace("&DB_PREFIXE",DB_PREFIXE,$row['sql_filter'])))); $f->addToMessage($class, $message); $f->setFlag(NULL); $f->display(); die(); }else{ while ($rowBuffer=& $resBuffer->fetchRow(DB_FETCHMODE_ASSOC)){ $ol_filter_tmp=$rowBuffer['buffer']; } } } array_push($ol_filter,$ol_filter_tmp); array_push($ol_baselayer,$row['baselayer']); array_push($ol_singletile,$row['singletile']); array_push($ol_maxzoomlevel,$row['maxzoomlevel']); array_push($ol_cache_type,$row['cache_type']); array_push($ol_cache_gfi_chemin,$row['cache_gfi_chemin']); array_push($ol_cache_gfi_couches,$row['cache_gfi_couches']); if ($row['cache_type']=="IMP") { $nb_imp = $nb_imp+1; } } } $lst_geom_om_sig_map = array(); $lst_geom_titre = array(); $lst_geom_maj = array(); $lst_geom_type_geometrie = array(); $lst_geom_table_update = array(); $lst_geom_champ = array(); array_push($lst_geom_om_sig_map,$om_sig_map); array_push($lst_geom_titre,$lib_geometrie); array_push($lst_geom_maj,$maj); array_push($lst_geom_type_geometrie,$geometrie); array_push($lst_geom_table_update,$table); array_push($lst_geom_champ,$champ); $sql = "select c.om_sig_map_comp as om_sig_map_comp, c.libelle as comp_lib, c.comp_maj as comp_maj, c.type_geometrie as comp_type_geometrie, c.comp_table_update as comp_table_update, c.comp_champ as comp_champ from ".DB_PREFIXE."om_sig_map_comp c,".DB_PREFIXE."om_sig_map p where p.id='".$obj."' and p.om_sig_map = c.om_sig_map and c.actif='Oui' order by c.ordre"; $res = $f -> db -> query($sql); if (DB :: isError($res)){ $class = "error"; $message = _($res->getMessage()." ERREUR SQL ".$sql); $f->addToMessage($class, $message); $f->setFlag(NULL); $f->display(); die(); // AB_C03 F Gestion des affichages d'erreurs dans tab_sig.php }else{ while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ array_push($lst_geom_om_sig_map,$row['om_sig_map_comp']); array_push($lst_geom_titre,$row['comp_lib']); array_push($lst_geom_maj,$row['comp_maj']); array_push($lst_geom_type_geometrie,$row['comp_type_geometrie']); array_push($lst_geom_table_update,$row['comp_table_update']); array_push($lst_geom_champ,$row['comp_champ']); } } // ========================================================================== // *** variables par defaut pouvant etre surchargees dans dyn/var_sig.php *** // ========================================================================== $http_google="http://maps.google.com/maps/api/js?v=3&sensor=false"; $cle_bing ='"AqTGBsziZHIJYYxgivLBf0hVdrAk9mWO5cQcb8Yux8sW5M8c8opEC2lZqKR1ZZXf"'; $cle_google = ""; $fichier_jsons="sig_json.php?obj="; $fichier_wkt="sig_wkt.php"; //zoom par couche : zoom standard permettant un passage de zoom a l autre $zoom_osm_maj=18; $zoom_osm=14; $zoom_sat_maj=8; $zoom_sat=4; $zoom_bing_maj=8; $zoom_bing=4; //popup data contenuHTML $width_popup=200; $cadre_popup=1; $couleurcadre_popup="black"; $fontsize_popup=12; $couleurtitre_popup="black"; $weightitre_popup="bold"; $fond_popup="white"; $opacity_popup="0.7"; // image localisation maj ou consultation $img_maj="../img/punaise_sig.png"; $img_maj_hover="../img/punaise_hover.png"; $img_consult="../img/punaise_point.png"; $img_consult_hover="../img/punaise_point_hover.png"; $img_w=14; $img_h=32; $img_click="1.3";// multiplicateur hauteur et largeur image cliquee //style bouton $style_panier='border:0px;background-image:url(../img/panier.png);background-repeat:no-repeat;background-position:1% 1%;width:55px;height:35px;background-color:#ffffff;color:#000000;font-weight:bold'; $style_retour='margin-bottom: 0px;text-indent: -9999px;background-image:url(../img/retour.png);background-repeat:no-repeat;background-position:right;width:40px;height:30px;background-color:#ffffff;color:#000000;font-weight:normal'; $style_valider='text-indent: -9999px;border:0px;background-image:url(../img/valider.png);background-repeat:no-repeat;background-position:top;width:40px;height:40px;background-color:#ffffff;color:#000000;font-weight:normal'; $style_data='text-indent: -9999px;border:0px;background-image:url(../img/data.png);background-repeat:no-repeat;background-position:top;width:40px;height:40px;background-color:#ffffff;color:#000000;font-weight:normal'; $style_deplacer='text-indent: -9999px;border:0px;background-image:url(../img/deplacer.png);background-repeat:no-repeat;background-position:top;width:40px;height:40px;background-color:#ffffff;color:#000000;font-weight:normal'; $style_dessiner='text-indent: -9999px;border:0px;background-image:url(../img/dessiner.png);background-repeat:no-repeat;background-position:top;width:40px;height:40px;background-color:#ffffff;color:#000000;font-weight:normal'; $style_enregistrer='text-indent: -9999px;border:0px;background-image:url(../img/enregistrer.png);background-repeat:no-repeat;background-position:top;width:40px;height:40px;background-color:#ffffff;color:#000000;font-weight:normal'; $style_position='text-indent: -9999px;border:0px;background-image:url(../img/position.png);background-repeat:no-repeat;background-position:top;width:40px;height:40px;background-color:#ffffff;color:#000000;font-weight:normal'; $style_imprimer='text-indent: -9999px;border:0px;background-image:url(../img/imprimer.png);background-repeat:no-repeat;background-position:top;width:40px;height:40px;background-color:#ffffff;color:#000000;font-weight:normal'; // personnalisation des variables if (file_exists("../dyn/var_sig.inc")) include ("../dyn/var_sig.inc"); // ======================================== // appel a des API pour affichage des fonds // ======================================== if($fond_sat=="Oui") $f->addHTMLHeadJs(array($http_google.$cle_google)); // ========== // *** entete // ========== // initialisation variable php indiquant l'ouverture de fenètre en mode popup if(isset($_GET["popup"]) and $_GET["popup"]==1){ $f->setFlag("htmlonly_nodoctype"); $ouv_popup=$_GET["popup"]; } else { $f->setFlag("nodoctype"); $ouv_popup="0"; } $f->display(); // =========================== // *** Etat de l interface *** // =========================== $bl="    "; $msg_dessin=$bl._("Dessiner").$bl; $msg_valider=$bl._("Enregistrer").$bl; $msg_data=$bl._("Data").$bl; $msg_deplacer=$bl."Deplacer".$bl; $msg_panier=$bl."Panier".$bl; echo "
"; echo "".$obj." ".$idx.""; echo ""; if (count($lst_geom_maj) <= $seli) {; $class = "error"; $message = _("le champ sélectionné n'est pas déclaré dans om_sig_map_comp"); $f->addToMessage($class, $message); $f->setFlag(NULL); $f->display(); die(); } echo ""; echo ""; echo ""; echo ""; $panier_exist="non"; for($i=0; $i"; echo ""; echo $bl; if (count($lst_geom_titre)>1) { echo "$bl"; } if ($maj == 'Oui') { echo ""; echo ""; echo ""; }else{ echo ""; echo ""; echo ""; } // layer info : bouton data if($layer_info=="Oui"){ echo ""; } // ajout des boutons d'interface du panier if ($maj == 'Oui') { if ($panier_exist == "oui") { for($i=0; $i"; } } echo ""; } } // ajout du bouton d'interface de la géolocalisation echo ""; // ajout des boutons d'interface du panier echo "  ".$msg_data.""; // traitement de variable popup en URL if(isset($_GET["popup"]) and $_GET["popup"]==1){ echo ""; // fond } else { // ajout l'idx dans l'url de retour (mode non popup) $retour=str_replace("&idx=","&idx=".$idx,$retour); // retour echo ""; // fond } if ($nb_imp>0) { echo "$bl"; echo ""; } if (file_exists("../dyn/tab_sig_barre.inc.php")) include ("../dyn/tab_sig_barre.inc.php"); echo ""; // map echo "
"; // ================================================== // script js - interactivite - gestion des evenements // ================================================== ?>