From 606e13560b67e1f4f1fedcdddefed3c61eb857d8 Mon Sep 17 00:00:00 2001 From: frederikpyt Date: Tue, 28 Jul 2020 15:03:17 +0200 Subject: [PATCH] Washing Reservation create --- .../views/app/washing-reservations/index.blade.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/skolehjem/resources/views/app/washing-reservations/index.blade.php b/skolehjem/resources/views/app/washing-reservations/index.blade.php index d8b22a9..19c252f 100644 --- a/skolehjem/resources/views/app/washing-reservations/index.blade.php +++ b/skolehjem/resources/views/app/washing-reservations/index.blade.php @@ -25,12 +25,12 @@ -
- +
+ @csrf

Maskiner skal dynamisk opdateres alt efter om det er en fra bygning E eller en af de andre bygninger der vil vaske, da bygning E har egen vaskekælder!

-
+ @endsection @@ -116,7 +116,6 @@ params: { 'date': date } }).then(function (response) { var data = response.data; - //console.log(data); if(document.getElementById("washing-machines") != undefined) machinez = document.getElementById("washing-machines"); @@ -128,6 +127,7 @@ let select = document.createElement("select"); select.classList.add("events__title"); select.id = "washing-machines"; + select.name = "machine"; container.appendChild(span); container.appendChild(select); @@ -144,6 +144,7 @@ let select = document.createElement("select"); select.classList.add("events__title"); select.id = "events"; + select.name = "time"; container.appendChild(span); container.appendChild(select); @@ -157,6 +158,7 @@ button.id = "create-reservation"; button.innerText = "Reserver"; + button.type = "submit"; container.appendChild(button); @@ -169,6 +171,7 @@ for (let i = 0; i < machines.length; i++) { let option = document.createElement("option"); option.text = machines[i]["name"]; + option.value = machines[i]["id"]; machinez.appendChild(option); } @@ -177,7 +180,8 @@ for (let hour = 8; hour <= 20; hour++) { let option = document.createElement("option"); - option.text = prependZero(hour); + option.text = prependZero(hour) + ":00"; + option.value = data["date"].split("T")[0].slice(1, data["date"].split("T")[0].length) + "T" + prependZero(hour) + ":00"; events.appendChild(option); }