add create/edit functionality

This commit is contained in:
TimmensOne
2023-03-31 12:14:57 +02:00
parent d5770b8cb5
commit 73ba1c8fed
8 changed files with 84 additions and 11 deletions

View File

@ -23,12 +23,12 @@
$ownerTransactins = $device->owners;
@endphp
<h3>Location Transactions</h3>
<button><a href="{{ $device->device_id }}/location/create">New Location</a></button>
<button><a href="{{ $device->device_id }}/locations/create">New Location</a></button>
@foreach ($locationTransactions as $location)
<x-location-transaction :location="$location" />
@endforeach
<h3>Owner Transactions</h3>
<button><a href="{{ $device->device_id }}/owner/create">New Owner</a></button>
<button><a href="{{ $device->device_id }}/owners/create">New Owner</a></button>
@foreach ($ownerTransactins as $owner)
<x-owner-transaction :owner="$owner" />
@endforeach

View File

@ -0,0 +1,17 @@
<form method="POST" action="/devices/{{ $device->device_id }}/locations">
@csrf
<label for="room_code">room_code:</label>
<input type="text" id="room_code" name="room_code" value="{{old('room_code')}}" required>
@error('room_code')
<p>{{ $message }}</p>
@enderror
<br />
<label for="timestamp_located_since">timestamp_located_since:</label>
<input type="text" id="timestamp_located_since" name="timestamp_located_since"
value="{{old('timestamp_located_since')}}" required>
@error('timestamp_located_since')
<p>{{ $message }}</p>
@enderror
<br />
<input type="submit" value="Submit">
</form>

View File

@ -0,0 +1,18 @@
<form method="POST" action="/devices/locations/{{ $location->location_transaction_id }}">
@method('PUT')
@csrf
<label for="room_code">room_code:</label>
<input type="text" id="room_code" name="room_code" value="{{$location->room_code}}" required>
@error('room_code')
<p>{{ $message }}</p>
@enderror
<br />
<label for="timestamp_located_since">timestamp_located_since:</label>
<input type="text" id="timestamp_located_since" name="timestamp_located_since"
value="{{$location->timestamp_located_since}}" required>
@error('timestamp_located_since')
<p>{{ $message }}</p>
@enderror
<br />
<input type="submit" value="Submit">
</form>

View File

@ -0,0 +1,17 @@
<form method="POST" action="/devices/{{ $device->device_id }}/owners">
@csrf
<label for="rz_username">rz_username:</label>
<input type="text" id="rz_username" name="rz_username" value="{{old('rz_username')}}" required>
@error('rz_username')
<p>{{ $message }}</p>
@enderror
<br />
<label for="timestamp_owner_since">timestamp_owner_since:</label>
<input type="text" id="timestamp_owner_since" name="timestamp_owner_since"
value="{{old('timestamp_owner_since')}}" required>
@error('timestamp_owner_since')
<p>{{ $message }}</p>
@enderror
<br />
<input type="submit" value="Submit">
</form>

View File

@ -0,0 +1,18 @@
<form method="POST" action="/devices/owners/{{ $owner->owner_transaction_id }}">
@method('PUT')
@csrf
<label for="rz_username">rz_username:</label>
<input type="text" id="rz_username" name="rz_username" value="{{$owner->rz_username}}" required>
@error('rz_username')
<p>{{ $message }}</p>
@enderror
<br />
<label for="timestamp_owner_since">timestamp_owner_since:</label>
<input type="text" id="timestamp_owner_since" name="timestamp_owner_since"
value="{{$owner->timestamp_owner_since}}" required>
@error('timestamp_owner_since')
<p>{{ $message }}</p>
@enderror
<br />
<input type="submit" value="Submit">
</form>

View File

@ -1,4 +1,3 @@
<p>{{ $purchasing->price }}</p>
<form method="POST" action="/devices/{{ $purchasing->device->device_id }}/purchasing">
@method('PUT')
@csrf