corection zone dans latng & correction slide
|
@ -1,22 +1,24 @@
|
||||||
exports.choixZone = function(zones){
|
exports.choixZone = function(zones){
|
||||||
var zone = zones[0];
|
var zone = zones[0];
|
||||||
var aireMin = (zones[0].Nord-zones[0].Sud)*(zones[0].Est-zones[0].Ouest)
|
var aireMin = (zones[0].Nord-zones[0].Sud)*(zones[0].Est-zones[0].Ouest)
|
||||||
for(var i = 1;i<zones.length;i++)
|
for(var i = 1;i<zones.length;i++)
|
||||||
{
|
{
|
||||||
var aire = (zones[i].Nord-zones[i].Sud)*(zones[i].Est-zones[i].Ouest)
|
var aire = (zones[i].Nord-zones[i].Sud)*(zones[i].Est-zones[i].Ouest)
|
||||||
if(aire<aireMin){
|
if(aire<aireMin){
|
||||||
zone = zones[i];
|
zone = zones[i];
|
||||||
aireMin = aire;
|
aireMin = aire;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return zone;
|
return zone;
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.listPubDansZone = function(zone, callback){
|
exports.listPubDansZone = function(zone, callback){
|
||||||
var con = require('./bdd.js')
|
var con = require('./bdd.js')
|
||||||
con.query("SELECT * FROM com_active INNER JOIN zone ON com_active.ID_Zone = zone.ID_Zone INNER JOIN communication ON com_active.ID_Com = communication.ID_Com WHERE zone.ID_Zone = ? ", [zone], function(err, result){
|
con.query("SELECT * FROM com_active INNER JOIN zone ON com_active.ID_Zone = zone.ID_Zone INNER JOIN communication ON com_active.ID_Com = communication.ID_Com WHERE zone.ID_Zone = ? ", [zone], function(err, result){
|
||||||
var data = JSON.stringify(result);
|
var data = JSON.stringify(result);
|
||||||
data = JSON.parse(data);
|
console.log(data);
|
||||||
callback(err, data)
|
data = JSON.parse(data);
|
||||||
});
|
callback(err, data)
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
Before Width: | Height: | Size: 276 B After Width: | Height: | Size: 276 B |
Before Width: | Height: | Size: 828 B After Width: | Height: | Size: 828 B |
Before Width: | Height: | Size: 422 B After Width: | Height: | Size: 422 B |
Before Width: | Height: | Size: 329 B After Width: | Height: | Size: 329 B |
Before Width: | Height: | Size: 252 B After Width: | Height: | Size: 252 B |
Before Width: | Height: | Size: 311 B After Width: | Height: | Size: 311 B |