|
@ -18,8 +18,8 @@ function transaction(db, query, values) { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function insertFloodZone({ images, description, passable, location }) { |
|
|
|
|
|
const query = `INSERT INTO FloodZones(Description, Images, Latitude, Longitude, Passable) VALUES(?, ?, ?, ?, ?);`; |
|
|
|
|
|
|
|
|
function insertFloodZone({ images, description, passable, location, date, time }) { |
|
|
|
|
|
const query = `INSERT INTO FloodZones(Description, Images, Latitude, Longitude, Passable, Date, Time) VALUES(?, ?, ?, ?, ?, ?, ?);`; |
|
|
if (location === undefined) { |
|
|
if (location === undefined) { |
|
|
console.debug("undefined location"); |
|
|
console.debug("undefined location"); |
|
|
return; |
|
|
return; |
|
@ -31,6 +31,8 @@ function insertFloodZone({ images, description, passable, location }) { |
|
|
parseFloat(location["latitude"]), |
|
|
parseFloat(location["latitude"]), |
|
|
parseFloat(location["longitude"]), |
|
|
parseFloat(location["longitude"]), |
|
|
parseInt(passable), |
|
|
parseInt(passable), |
|
|
|
|
|
moment(date).format("DD/MM/YYYY"), |
|
|
|
|
|
moment(time).format("HH:MM"), |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
transaction(global.userDataBase, query, values); |
|
|
transaction(global.userDataBase, query, values); |
|
@ -55,8 +57,8 @@ function insertPluviometerData({ pluviometer, images, dateTime, time, location } |
|
|
transaction(global.userDataBase, query, values); |
|
|
transaction(global.userDataBase, query, values); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function insertRainData({ images, description, rain, location }) { |
|
|
|
|
|
const query = `INSERT INTO RainLevel(RainIdx, Description, Images, Latitude, Longitude) VALUES(?, ?, ?, ?, ?);`; |
|
|
|
|
|
|
|
|
function insertRainData({ images, description, rain, location, date, time }) { |
|
|
|
|
|
const query = `INSERT INTO RainLevel(RainIdx, Description, Images, Latitude, Longitude, Date, Time) VALUES(?, ?, ?, ?, ?, ?, ?);`; |
|
|
|
|
|
|
|
|
if (location === undefined) { |
|
|
if (location === undefined) { |
|
|
console.debug("undefined location"); |
|
|
console.debug("undefined location"); |
|
@ -69,6 +71,8 @@ function insertRainData({ images, description, rain, location }) { |
|
|
JSON.stringify(images), |
|
|
JSON.stringify(images), |
|
|
parseFloat(location["latitude"]), |
|
|
parseFloat(location["latitude"]), |
|
|
parseFloat(location["longitude"]), |
|
|
parseFloat(location["longitude"]), |
|
|
|
|
|
moment(date).format("DD/MM/YYYY"), |
|
|
|
|
|
moment(time).format("HH:MM"), |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
console.log(values); |
|
|
console.log(values); |
|
@ -76,8 +80,8 @@ function insertRainData({ images, description, rain, location }) { |
|
|
transaction(global.userDataBase, query, values); |
|
|
transaction(global.userDataBase, query, values); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function insertRiverData({ images, description, riverScale, location }) { |
|
|
|
|
|
const query = `INSERT INTO RiverLevel(RiverIdx, Description, Images, Latitude, Longitude) VALUES(?, ?, ?, ?, ?);`; |
|
|
|
|
|
|
|
|
function insertRiverData({ images, description, riverScale, location, date, time }) { |
|
|
|
|
|
const query = `INSERT INTO RiverLevel(RiverIdx, Description, Images, Latitude, Longitude, Date, Time) VALUES(?, ?, ?, ?, ?, ?, ?);`; |
|
|
|
|
|
|
|
|
if (location === undefined) { |
|
|
if (location === undefined) { |
|
|
console.debug("undefined location"); |
|
|
console.debug("undefined location"); |
|
@ -90,6 +94,8 @@ function insertRiverData({ images, description, riverScale, location }) { |
|
|
JSON.stringify(images), |
|
|
JSON.stringify(images), |
|
|
parseFloat(location["latitude"]), |
|
|
parseFloat(location["latitude"]), |
|
|
parseFloat(location["longitude"]), |
|
|
parseFloat(location["longitude"]), |
|
|
|
|
|
moment(date).format("DD/MM/YYYY"), |
|
|
|
|
|
moment(time).format("HH:MM"), |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
console.log(values); |
|
|
console.log(values); |
|
|