X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fgeoloc.inc.php;h=8511a4ee671ae3ce8306fce6efa44cce0df616e8;hb=791a11c8ee174054c0a906283d6d868d3a8a2077;hp=51fc43c38c15162c975cd45180257fde0d0389c1;hpb=a7c29df3b9bf8f3c3b23fec0f1d2feb814cb61fe;p=platal.git diff --git a/include/geoloc.inc.php b/include/geoloc.inc.php index 51fc43c..8511a4e 100644 --- a/include/geoloc.inc.php +++ b/include/geoloc.inc.php @@ -416,7 +416,7 @@ function geoloc_getData_subcities($mapid, $SFields, &$cities, $direct=true) $where . ($direct ? "gcim.infos = 'smallest'" : '1'), 'gc.id, gc.alias', 'pop DESC'); - while ($c = $cityres->next()) { + foreach($cityres as $c) { if ($c['pop'] > 0) { $city = $c; $city['x'] = geoloc_to_x($c['x'], $c['y']); @@ -494,8 +494,8 @@ function geoloc_getData_subcountries($mapid, $sin, $minentities) 'NULL'); $maxpop = 0; - $nbentities = $nbcities + $countryres->total(); - while ($c = $countryres->next()) { + $nbentities = $nbcities + count($countryres); + foreach ($countryres as $c) { $c['latPop'] /= $c['nbPop']; $c['lonPop'] /= $c['nbPop']; $c['rad'] = size_of_territory($c['nbPop']);