From 8eaf7d099164d1c6d2441991f6f428da0a78aa27 Mon Sep 17 00:00:00 2001 From: Robert Richter Date: Thu, 6 Feb 2020 16:31:01 +0100 Subject: [PATCH] update Do 6. Feb 16:31:01 CET 2020 --- server/sql_qry.js | 14 +++++++++++--- views/includes/modal_response.pug | 12 ++++++------ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/server/sql_qry.js b/server/sql_qry.js index f720ee6..bd8b052 100644 --- a/server/sql_qry.js +++ b/server/sql_qry.js @@ -680,12 +680,20 @@ module.exports = function(db, async, app_cfg) { if (err == null && row) { console.log(row.uuid); console.log(row.id); - db.all(`SELECT e.wachenname, e.einsatzmittel, e.status FROM waip_einsatzmittel e + db.all(`SELECT e.einsatzmittel, e.status FROM waip_einsatzmittel e WHERE e.waip_einsaetze_id = ?`, [row.id], function(err, rows) { if (err == null && rows) { var einsatzdaten = row; - einsatzdaten.einsatzmittel = rows; - callback && callback(einsatzdaten); + einsatzdaten.einsatzmittel = rows; + db.all(`SELECT DISTINCT e.wachenname FROM waip_einsatzmittel e + WHERE e.waip_einsaetze_id = ?`, [row.id], function(err, wachen) { + if (err == null && wachen) { + einsatzdaten.wachen = wachen; + callback && callback(einsatzdaten); + } else { + callback && callback(null); + }; + }); } else { callback && callback(null); }; diff --git a/views/includes/modal_response.pug b/views/includes/modal_response.pug index 2eed7ab..3c2b2ee 100644 --- a/views/includes/modal_response.pug +++ b/views/includes/modal_response.pug @@ -39,11 +39,11 @@ p.text-muted zur Wache ... .form-group select#wachenauswahl.form-control.form-control-lg - select.custom-select - option(value=null) bitte Wache wählen - option(value='1') CB FW Cottbus 1 - option(value='2') CB FW Cottbus 3 - option(value='3') CB FW Madlow - option(value='4') CB FW Kieckebusch + option(value=null) bitte Wache wählen + each val in einsatzdaten.wachen + option(value='#{val.wachenname}') #{val.wachenname} + //option(value='2') CB FW Cottbus 3 + //option(value='3') CB FW Madlow + //option(value='4') CB FW Kieckebusch .modal-footer button#send_response.btn.btn-lg.btn-block.btn-warning.btn-outline-primary.ion-md-paper-plane(type='button', data-dismiss='modal') Rückmeldung absenden!