|
@ -18,8 +18,8 @@ function transaction(db, query, values) { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function insertFloodZone({ images, description, passable, location, date, time }) { |
|
|
|
|
|
const query = `INSERT INTO FloodZones(Description, Images, Latitude, Longitude, Passable, Date, Time) VALUES(?, ?, ?, ?, ?, ?, ?);`; |
|
|
|
|
|
|
|
|
function insertFloodZone({ images, description, passable, location, date, time, address }) { |
|
|
|
|
|
const query = `INSERT INTO FloodZones(Description, Images, Latitude, Longitude, Passable, Date, Time, Address) VALUES(?, ?, ?, ?, ?, ?, ?, ?);`; |
|
|
if (location === undefined) { |
|
|
if (location === undefined) { |
|
|
console.debug("undefined location"); |
|
|
console.debug("undefined location"); |
|
|
return; |
|
|
return; |
|
@ -33,13 +33,14 @@ function insertFloodZone({ images, description, passable, location, date, time } |
|
|
parseInt(passable), |
|
|
parseInt(passable), |
|
|
moment(date).format("DD/MM/YYYY"), |
|
|
moment(date).format("DD/MM/YYYY"), |
|
|
moment(time).format("HH:MM"), |
|
|
moment(time).format("HH:MM"), |
|
|
|
|
|
address, |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
transaction(global.userDataBase, query, values); |
|
|
transaction(global.userDataBase, query, values); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function insertPluviometerData({ pluviometer, images, dateTime, time, location }) { |
|
|
|
|
|
const query = `INSERT INTO Pluviometer(Date, Images, Latitude, Longitude, Precipitation) VALUES(?, ?, ?, ?, ?);`; |
|
|
|
|
|
|
|
|
function insertPluviometerData({ pluviometer, images, dateTime, time, location, address }) { |
|
|
|
|
|
const query = `INSERT INTO Pluviometer(Date, Images, Latitude, Longitude, Precipitation, Address) VALUES(?, ?, ?, ?, ?, ?);`; |
|
|
|
|
|
|
|
|
if (location === undefined) { |
|
|
if (location === undefined) { |
|
|
console.debug("undefined location"); |
|
|
console.debug("undefined location"); |
|
@ -52,13 +53,14 @@ function insertPluviometerData({ pluviometer, images, dateTime, time, location } |
|
|
parseFloat(location["latitude"]), |
|
|
parseFloat(location["latitude"]), |
|
|
parseFloat(location["longitude"]), |
|
|
parseFloat(location["longitude"]), |
|
|
parseFloat(pluviometer), |
|
|
parseFloat(pluviometer), |
|
|
|
|
|
address, |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
transaction(global.userDataBase, query, values); |
|
|
transaction(global.userDataBase, query, values); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function insertRainData({ images, description, rain, location, date, time }) { |
|
|
|
|
|
const query = `INSERT INTO RainLevel(RainIdx, Description, Images, Latitude, Longitude, Date, Time) VALUES(?, ?, ?, ?, ?, ?, ?);`; |
|
|
|
|
|
|
|
|
function insertRainData({ images, description, rain, location, date, time, address }) { |
|
|
|
|
|
const query = `INSERT INTO RainLevel(RainIdx, Description, Images, Latitude, Longitude, Date, Time, Address) VALUES(?, ?, ?, ?, ?, ?, ?, ?);`; |
|
|
|
|
|
|
|
|
if (location === undefined) { |
|
|
if (location === undefined) { |
|
|
console.debug("undefined location"); |
|
|
console.debug("undefined location"); |
|
@ -73,6 +75,7 @@ function insertRainData({ images, description, rain, location, date, time }) { |
|
|
parseFloat(location["longitude"]), |
|
|
parseFloat(location["longitude"]), |
|
|
moment(date).format("DD/MM/YYYY"), |
|
|
moment(date).format("DD/MM/YYYY"), |
|
|
moment(time).format("HH:MM"), |
|
|
moment(time).format("HH:MM"), |
|
|
|
|
|
address, |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
console.log(values); |
|
|
console.log(values); |
|
@ -80,8 +83,8 @@ function insertRainData({ images, description, rain, location, date, time }) { |
|
|
transaction(global.userDataBase, query, values); |
|
|
transaction(global.userDataBase, query, values); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function insertRiverData({ images, description, riverScale, location, date, time }) { |
|
|
|
|
|
const query = `INSERT INTO RiverLevel(RiverIdx, Description, Images, Latitude, Longitude, Date, Time) VALUES(?, ?, ?, ?, ?, ?, ?);`; |
|
|
|
|
|
|
|
|
function insertRiverData({ images, description, riverScale, location, date, time, address }) { |
|
|
|
|
|
const query = `INSERT INTO RiverLevel(RiverIdx, Description, Images, Latitude, Longitude, Date, Time, Address) VALUES(?, ?, ?, ?, ?, ?, ?, ?);`; |
|
|
|
|
|
|
|
|
if (location === undefined) { |
|
|
if (location === undefined) { |
|
|
console.debug("undefined location"); |
|
|
console.debug("undefined location"); |
|
@ -96,6 +99,7 @@ function insertRiverData({ images, description, riverScale, location, date, time |
|
|
parseFloat(location["longitude"]), |
|
|
parseFloat(location["longitude"]), |
|
|
moment(date).format("DD/MM/YYYY"), |
|
|
moment(date).format("DD/MM/YYYY"), |
|
|
moment(time).format("HH:MM"), |
|
|
moment(time).format("HH:MM"), |
|
|
|
|
|
address, |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
console.log(values); |
|
|
console.log(values); |
|
|