X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=htdocs%2Fadmin%2Fgeoloc_dynamap.php;h=22841dec9e2fcee5bca404a982d1c91c278ffc88;hb=08cce2ff528b38bde27cdec6d6bc28d6af4a42d4;hp=88827f923c44b968608644167523f8e8f992f2c1;hpb=4869f6657c664e6e968f30ea7c39c0cb7e627d3d;p=platal.git diff --git a/htdocs/admin/geoloc_dynamap.php b/htdocs/admin/geoloc_dynamap.php index 88827f9..22841de 100644 --- a/htdocs/admin/geoloc_dynamap.php +++ b/htdocs/admin/geoloc_dynamap.php @@ -36,7 +36,7 @@ if (Env::get('fix') == 'smallest_maps') { } if (Env::get('fix') == 'precise_coordinates') { - $globals->xdb->execute("UPDATE adresses AS a INNER JOIN geoloc_city AS c ON(a.cityid = c.id) SET a.glat = c.lat / 100000, a.glng = c.lon / 100000"); + XDB::execute("UPDATE adresses AS a INNER JOIN geoloc_city AS c ON(a.cityid = c.id) SET a.glat = c.lat / 100000, a.glng = c.lon / 100000"); } if (Env::has('new_maps')) { @@ -45,13 +45,13 @@ if (Env::has('new_maps')) { $page->trig("Impossible d'accéder aux nouvelles cartes"); } -$countMissing = $globals->xdb->query("SELECT COUNT(*) FROM geoloc_city AS c LEFT JOIN geoloc_city_in_maps AS m ON(c.id = m.city_id) WHERE m.city_id IS NULL"); +$countMissing = XDB::query("SELECT COUNT(*) FROM geoloc_city AS c LEFT JOIN geoloc_city_in_maps AS m ON(c.id = m.city_id) WHERE m.city_id IS NULL"); $missing = $countMissing->fetchOneCell(); -$countNoSmallest = $globals->xdb->query("SELECT SUM(IF(infos = 'smallest',1,0)) AS n FROM geoloc_city_in_maps GROUP BY city_id ORDER BY n"); +$countNoSmallest = XDB::query("SELECT SUM(IF(infos = 'smallest',1,0)) AS n FROM geoloc_city_in_maps GROUP BY city_id ORDER BY n"); $noSmallest = $countNoSmallest->fetchOneCell() == 0; -$countNoCoordinates = $globals->xdb->query("SELECT COUNT(*) FROM adresses WHERE cityid IS NOT NULL AND glat = 0 AND glng = 0"); +$countNoCoordinates = XDB::query("SELECT COUNT(*) FROM adresses WHERE cityid IS NOT NULL AND glat = 0 AND glng = 0"); $noCoordinates = $countNoCoordinates->fetchOneCell(); if (isset($refresh) && $missing) {