Washing Reservation create
This commit is contained in:
parent
fd2184c654
commit
606e13560b
|
@ -25,12 +25,12 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="event-container" class="events-container">
|
||||
|
||||
<form method="post" action="{{ route("washing-reservations.store") }}" id="event-container" class="events-container">
|
||||
@csrf
|
||||
<p>
|
||||
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!
|
||||
</p>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</main>
|
||||
@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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue