|
|
@ -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) { |
|
|
|
console.debug("undefined location"); |
|
|
|
return; |
|
|
@ -31,6 +31,8 @@ function insertFloodZone({ images, description, passable, location }) { |
|
|
|
parseFloat(location["latitude"]), |
|
|
|
parseFloat(location["longitude"]), |
|
|
|
parseInt(passable), |
|
|
|
moment(date).format("DD/MM/YYYY"), |
|
|
|
moment(time).format("HH:MM"), |
|
|
|
]; |
|
|
|
|
|
|
|
transaction(global.userDataBase, query, values); |
|
|
@ -55,8 +57,8 @@ function insertPluviometerData({ pluviometer, images, dateTime, time, location } |
|
|
|
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) { |
|
|
|
console.debug("undefined location"); |
|
|
@ -65,10 +67,12 @@ function insertRainData({ images, description, rain, location }) { |
|
|
|
|
|
|
|
const values = [ |
|
|
|
parseInt(rain), |
|
|
|
description, |
|
|
|
description, |
|
|
|
JSON.stringify(images), |
|
|
|
parseFloat(location["latitude"]), |
|
|
|
parseFloat(location["longitude"]), |
|
|
|
moment(date).format("DD/MM/YYYY"), |
|
|
|
moment(time).format("HH:MM"), |
|
|
|
]; |
|
|
|
|
|
|
|
console.log(values); |
|
|
@ -76,8 +80,8 @@ function insertRainData({ images, description, rain, location }) { |
|
|
|
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) { |
|
|
|
console.debug("undefined location"); |
|
|
@ -90,6 +94,8 @@ function insertRiverData({ images, description, riverScale, location }) { |
|
|
|
JSON.stringify(images), |
|
|
|
parseFloat(location["latitude"]), |
|
|
|
parseFloat(location["longitude"]), |
|
|
|
moment(date).format("DD/MM/YYYY"), |
|
|
|
moment(time).format("HH:MM"), |
|
|
|
]; |
|
|
|
|
|
|
|
console.log(values); |
|
|
|