parent
1c9c41ab8c
commit
90f97a5453
@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class AddRefCoordsToParkingLots extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('parking_lots', function (Blueprint $table) {
|
||||||
|
$table->longText('ref_coords');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('parking_lots', function (Blueprint $table) {
|
||||||
|
//
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 35 KiB |
@ -0,0 +1,90 @@
|
|||||||
|
@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">Create New Device Configuration</div>
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
|
@if (session('status'))
|
||||||
|
<div class="alert alert-success" role="alert">
|
||||||
|
{{ session('status') }}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<form method="POST" action="{{ url('/device/add') }}" enctype="multipart/form-data">
|
||||||
|
@csrf
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="code" class="col-md-4 col-form-label text-md-right">{{ __('Activation Code') }}</label>
|
||||||
|
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input id="code" type="text" class="form-control{{ $errors->has('code') ? ' is-invalid' : '' }}" name="code" value="{{ old('code') }}" placeholder="0pva5gq4" required autofocus>
|
||||||
|
|
||||||
|
@if ($errors->has('code'))
|
||||||
|
<span class="invalid-feedback" role="alert">
|
||||||
|
<strong>{{ $errors->first('code') }}</strong>
|
||||||
|
</span>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="camera" class="col-md-4 col-form-label text-md-right">{{ __('Camera Device Stream') }}</label>
|
||||||
|
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input id="camera" type="text" class="form-control{{ $errors->has('camera') ? ' is-invalid' : '' }}" name="camera" value="{{ old('camera') }}" placeholder="/dev/video0" required>
|
||||||
|
|
||||||
|
@if ($errors->has('camera'))
|
||||||
|
<span class="invalid-feedback" role="alert">
|
||||||
|
<strong>{{ $errors->first('camera') }}</strong>
|
||||||
|
</span>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="lotid" class="col-md-4 col-form-label text-md-right">{{ __('Lot ID (Firebase)') }}</label>
|
||||||
|
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input id="lotid" type="text" class="form-control{{ $errors->has('lotid') ? ' is-invalid' : '' }}" name="lotid" value="{{ old('lotid') }}" placeholder="Lot15" required>
|
||||||
|
|
||||||
|
@if ($errors->has('lotid'))
|
||||||
|
<span class="invalid-feedback" role="alert">
|
||||||
|
<strong>{{ $errors->first('lotid') }}</strong>
|
||||||
|
</span>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="ehat" class="col-md-4 col-form-label text-md-right">{{ __('Ê Threshold') }}</label>
|
||||||
|
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input id="ehat" type="text" class="form-control{{ $errors->has('ehat') ? ' is-invalid' : '' }}" name="ehat" value="{{ old('ehat') }}" placeholder="10" required>
|
||||||
|
|
||||||
|
@if ($errors->has('ehat'))
|
||||||
|
<span class="invalid-feedback" role="alert">
|
||||||
|
<strong>{{ $errors->first('ehat') }}</strong>
|
||||||
|
</span>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group row mb-0">
|
||||||
|
<div class="col-md-6 offset-md-4">
|
||||||
|
<button type="submit" class="btn btn-primary">
|
||||||
|
{{ __('Create Lot') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
@ -0,0 +1,25 @@
|
|||||||
|
@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">Device Configuration: {{ $device['id'] }}</div>
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
|
@if (session('status'))
|
||||||
|
<div class="alert alert-success" role="alert">
|
||||||
|
{{ session('status') }}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@foreach( $device['data'] as $key=>$val)
|
||||||
|
<b>{{ $key }}</b>: {{ $val }}<br>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
Loading…
Reference in new issue