{"id":503,"date":"2022-07-12T13:32:49","date_gmt":"2022-07-12T11:32:49","guid":{"rendered":"https:\/\/www.eldin.net\/wordpress\/?page_id=503"},"modified":"2022-07-12T14:03:46","modified_gmt":"2022-07-12T12:03:46","slug":"carte-de-repartition-des-registres-dexpoactes","status":"publish","type":"page","link":"https:\/\/www.eldin.net\/wordpress\/index.php\/carte-de-repartition-des-registres-dexpoactes\/","title":{"rendered":"Carte de r\u00e9partition des registres d&rsquo;ExpoActes"},"content":{"rendered":"\n<p>Page affichant sur une carte OSM la r\u00e9partition des registres trouv\u00e9s dans ExpoActes<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>fichier carte_registre_bms.php\n&lt;?php\n\nVos inclusions de fichiers ici\nrequire(\"osm_util.php\");\n\necho \"&lt;div>\";\n\necho '&lt;div class=\"frame2\" style=\"margin-left:260px;vertical-align: top;\">';\n\n$saga=OuvrirBase();\n \n echo \"&lt;center>&lt;h2>Carte de r\u00e9partitions des Registres SAGA&lt;\/h2>&lt;\/center>\";\n\n \/\/ recuperation du centre de la carte\n $coord=OSM_centre_carte($saga);\n\n \nOSM_attente(1,\"G\u00e9n\u00e9ration de la carte en cours, Patientez ...\"); \n\n\nOSM_init_carte($coord[0],$coord[1],OSM_zoom_initial($saga)) ;\n\n    \/\/ on recherche toutes les communes \n    $sql=\"select distinct commune,depart from act_div3 where cote&lt;>'' order by commune\";\n    $ressql=mysqli_query($saga,$sql)  or die('Erreur SQL '.mysqli_error($saga));\n    while($rowsql=mysqli_fetch_array($ressql)){\n        $commune=$rowsql['commune'];\n        $depart=$rowsql['depart'];\n        \/\/ on recupere les coordonn\u00e9es si elles existent\n        $geo=\"select LAT,LON from act_geoloc where commune='\".addslashes($commune).\"' and depart='\".addslashes($depart).\"' and ( statut='A' or statut='M' )  \";\n       \n        $resgeo=mysqli_query($saga,$geo) or die('Erreur SQL '.mysqli_error($saga));\n        if ( mysqli_num_rows($resgeo) ) {\n            $rowgeo=mysqli_fetch_array($resgeo);\n            $LAT=$rowgeo['LAT'];\n            $LON=$rowgeo['LON'];\n            $texte_html=\"&lt;b>$commune&lt;\/b> [$depart]\";    \/\/ le texte a afficher dans le marquer OSM\n            \/\/ on liste tous les registres de la commune\n            $sqlreg=\"select distinct cote,count(*) as ACT from act_div3 where commune='\".addslashes($commune).\"' and depart='\".addslashes($depart).\"' group by cote\";\n            \n            $resreg=mysqli_query($saga,$sqlreg)  or die('Erreur SQL '.mysqli_error($saga));\n            if (mysqli_num_rows($resreg)) {\n\n                while ( $rowreg=mysqli_fetch_array($resreg) ){  \/\/ pour tous les registres de la commune\n                    if ( $level ==9 )\n                        $texte_html.=\"&lt;br>&lt;a href=liste_registre.php?registre=\".urlencode($rowreg['cote']).\">\".addslashes($rowreg['cote']).\"&lt;\/a> \".$rowreg['ACT'].\" actes\";\n                    else\n                        $texte_html.=\"&lt;br>\".addslashes($rowreg['cote']).\" \".$rowreg['ACT'].\" actes\";\n                }\n\n            \/\/ affiche le marker de la commune avec ces infos\n            echo 'var marker = L.marker(['.$LAT.','.$LON.'],{ icon: myIcon }).addTo(macarte).bindPopup(\"'.$texte_html.'\");';\n            } \n        }\n    }\n\n\n   OSM_plein_ecran();\n\n   OSM_charge_carte();\n\n  OSM_attente(0); \n\n  OSM_affiche_carte(600); \n\n\n\nFermerBase($saga);\n\nBas de page\n\n?>\n\n\n\n\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Page affichant sur une carte OSM la r\u00e9partition des registres trouv\u00e9s dans ExpoActes<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-503","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.eldin.net\/wordpress\/index.php\/wp-json\/wp\/v2\/pages\/503"}],"collection":[{"href":"https:\/\/www.eldin.net\/wordpress\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.eldin.net\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.eldin.net\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.eldin.net\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=503"}],"version-history":[{"count":6,"href":"https:\/\/www.eldin.net\/wordpress\/index.php\/wp-json\/wp\/v2\/pages\/503\/revisions"}],"predecessor-version":[{"id":518,"href":"https:\/\/www.eldin.net\/wordpress\/index.php\/wp-json\/wp\/v2\/pages\/503\/revisions\/518"}],"wp:attachment":[{"href":"https:\/\/www.eldin.net\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=503"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}