management updates
This commit is contained in:
46
resources/views/lot/manage.blade.php
Normal file
46
resources/views/lot/manage.blade.php
Normal file
@@ -0,0 +1,46 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">Manage Registered Lots</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="table">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col">Firebase ID</th>
|
||||
<th scope="col">Name</th>
|
||||
<th scope="col">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach( $lots as $lot )
|
||||
<tr>
|
||||
<th scope="row">{{ $lot['data']['lotID'] }}</th>
|
||||
<td>{{ $lot['id'] }}</td>
|
||||
<td>{{ $lot['data']['name'] }}</td>
|
||||
<td>
|
||||
<a href="{{ url('/lot/manage/'.$lot['data']['lotID']) }}" class="btn btn-sm btn-success">Manage</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
65
resources/views/lot/manageone.blade.php
Normal file
65
resources/views/lot/manageone.blade.php
Normal file
@@ -0,0 +1,65 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">Manage Parking Lot</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
<h3>Manage Handicap</h3>
|
||||
<div class="container" id="stalls">
|
||||
@foreach( $stalls as $stallgroup )
|
||||
<div class="row">
|
||||
@foreach( $stallgroup as $stall )
|
||||
@if( $stall['data']['handicap'] )
|
||||
<button onclick="$(this).toggleClass('handicap-btn')" class="btn btn-default stall-btn handicap-btn" id="{{ $stall['id'] }}" style="margin: 10px; padding-top: 10px; padding-bottom: 10px;">{{ $stall['id'] }}</button>
|
||||
@else
|
||||
<button onclick="$(this).toggleClass('handicap-btn')" class="btn btn-default stall-btn" id="{{ $stall['id'] }}" style="margin: 10px; padding-top: 10px; padding-bottom: 10px;">{{ $stall['id'] }}</button>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<script>
|
||||
function submit_handicap(){
|
||||
const handicap_ids = []
|
||||
$('.handicap-btn').each(function(k, e){
|
||||
handicap_ids.push(e.id)
|
||||
})
|
||||
|
||||
const form = document.createElement('form')
|
||||
form.method = "POST";
|
||||
form.action = "{{ url('/lot/manage/'.$thruid) }}";
|
||||
|
||||
const ids = document.createElement('input')
|
||||
ids.type = "hidden"
|
||||
ids.name = "handicaps"
|
||||
ids.value = JSON.stringify(handicap_ids)
|
||||
|
||||
const csrf = document.createElement('input')
|
||||
csrf.type = "hidden"
|
||||
ids.name = "_token"
|
||||
ids.value = "{{ csrf_token() }}"
|
||||
|
||||
form.appendChild(ids)
|
||||
form.appendChild(csrf)
|
||||
document.appendChild(form)
|
||||
form.submit()
|
||||
|
||||
console.log(handicap_ids)
|
||||
}
|
||||
</script>
|
||||
<br><button class="btn btn-success" onclick="submit_handicap()">Save Changes</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
64
resources/views/lot/selectrefs.blade.php
Normal file
64
resources/views/lot/selectrefs.blade.php
Normal file
@@ -0,0 +1,64 @@
|
||||
@extends('layouts.plain')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<h2 class="card-header">Select the Parking Stall Reference Location</h2>
|
||||
<h4>{{ $lot->reference_image }}</h4><br>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<img src="{{ asset('img/references/'.$lot->reference_image) }}" alt="" id="lotimage">
|
||||
<script>
|
||||
const jc = Jcrop.attach('lotimage',{
|
||||
shadeColor: 'red',
|
||||
multi: false
|
||||
});
|
||||
|
||||
console.log(jc.active.pos)
|
||||
</script>
|
||||
<br>
|
||||
|
||||
<script>
|
||||
function submit_coordinates(){
|
||||
const crops = []
|
||||
jc.crops.forEach((crop) => {
|
||||
const coords = crop.pos
|
||||
crops.push(coords)
|
||||
})
|
||||
console.log(crops)
|
||||
|
||||
const form = document.createElement('form')
|
||||
form.method = "POST"
|
||||
form.action = "{{ url('/lot/reference/'.$lot->id) }}"
|
||||
|
||||
const coords_element = document.createElement('input')
|
||||
coords_element.name = "coords"
|
||||
coords_element.value = JSON.stringify(crops)
|
||||
form.appendChild(coords_element)
|
||||
|
||||
const csrf_element = document.createElement('input')
|
||||
csrf_element.type = "hidden"
|
||||
csrf_element.name = "_token"
|
||||
csrf_element.value = "{{ csrf_token() }}"
|
||||
form.appendChild(csrf_element)
|
||||
|
||||
document.body.appendChild(form)
|
||||
form.submit()
|
||||
}
|
||||
</script>
|
||||
|
||||
<button onclick="submit_coordinates()">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
27
resources/views/lot/success.blade.php
Normal file
27
resources/views/lot/success.blade.php
Normal file
@@ -0,0 +1,27 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">Dashboard</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
<p>
|
||||
<b>The new lot was created successfully.</b>
|
||||
</p>
|
||||
<p>
|
||||
<a href="{{ url('/home') }}" class="btn btn-success">Take me home!</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user