corection zone dans latng & correction slide
|
@ -1,22 +1,24 @@
|
|||
exports.choixZone = function(zones){
|
||||
var zone = zones[0];
|
||||
var aireMin = (zones[0].Nord-zones[0].Sud)*(zones[0].Est-zones[0].Ouest)
|
||||
for(var i = 1;i<zones.length;i++)
|
||||
{
|
||||
var aire = (zones[i].Nord-zones[i].Sud)*(zones[i].Est-zones[i].Ouest)
|
||||
if(aire<aireMin){
|
||||
zone = zones[i];
|
||||
aireMin = aire;
|
||||
}
|
||||
}
|
||||
return zone;
|
||||
}
|
||||
|
||||
exports.listPubDansZone = function(zone, callback){
|
||||
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){
|
||||
var data = JSON.stringify(result);
|
||||
data = JSON.parse(data);
|
||||
callback(err, data)
|
||||
});
|
||||
}
|
||||
exports.choixZone = function(zones){
|
||||
var zone = zones[0];
|
||||
var aireMin = (zones[0].Nord-zones[0].Sud)*(zones[0].Est-zones[0].Ouest)
|
||||
for(var i = 1;i<zones.length;i++)
|
||||
{
|
||||
var aire = (zones[i].Nord-zones[i].Sud)*(zones[i].Est-zones[i].Ouest)
|
||||
if(aire<aireMin){
|
||||
zone = zones[i];
|
||||
aireMin = aire;
|
||||
}
|
||||
}
|
||||
return zone;
|
||||
}
|
||||
|
||||
exports.listPubDansZone = function(zone, callback){
|
||||
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){
|
||||
var data = JSON.stringify(result);
|
||||
console.log(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 |