created form for rental costs similar to flex structures

This commit is contained in:
2020-08-10 02:17:21 -05:00
parent 8dd1377090
commit 5fd183f95c
11 changed files with 478 additions and 2 deletions

View File

@@ -29,6 +29,9 @@
<!-- SRP Admin -->
@include('layouts.admin.sidebarmenu.srp')
<!-- End SRP Admin -->
<!-- System Rental Admin -->
@include('layouts.admin.sidebarmenu.rentalsystem')
<!-- End System Rental Admin -->
</ul>
</nav>
<!-- /.sidebar-menu -->

View File

@@ -0,0 +1,27 @@
<!-- System Rentals -->
@if(auth()->user()->hasRole('Admin'))
<li class="nav-item has-treeview">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-tachometer-alt"></i>
<p>
System Rental<br>
<i class="right fas fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="/system/rental/display" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Display</p>
</a>
</li>
<li class="nav-item">
<a href="/system/rental/add" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Add</p>
</a>
</li>
</u>
</li>
@endif
<!-- End System Rentals -->

View File

@@ -0,0 +1,31 @@
@extends('layouts.admn.b4')
@section('content')
<div class="container">
<div class="card">
<div class="card-header">
<h2>New Rental Contract</h2>
</div>
<div class="card-body">
{!! Form::open(['action' => 'SystemRentals\RentalAdminController@addRentalSystem', 'method' => 'POST']) !!}
<div class="form-group">
{{ Form::label('contact_name', 'Contact Name') }}
{{ Form::text('contact_name', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('corporation_name', 'Corporation Name') }}
{{ Form::text('corporation_name', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('system', 'System') }}
{{ Form::text('system', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('rental_cost', 'Rental Cost') }}
{{ Form::text('rental_cost', '', ['class' => 'form-control']) }}
</div>
{{ Form::submit('Add Rental', ['class' => 'btn btn-primary']) }}
{!! Form::close() !!}
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,56 @@
@extends('layouts.admin.b4')
@section('content')
<br>
<div class="container">
<div class="card">
<div class="card-header">
<h2>Rental Systems</h2>
</div>
<div class="card-body">
<table clas="table table-bordered table-striped">
<thead>
<th>Contact</th>
<th>Corporation</th>
<th>System</th>
<th>Cost</th>
<th>Paid Until</th>
<th>Update</th>
<th>Remove?</th>
<th> </th>
</thead>
<tbody>
@foreach($rentals as $rental)
<tr>
<td>{{ $rental->contact_name }}</td>
<td>{{ $rental->corporation_name }}</td>
<td>{{ $rental->system }}</td>
<td>{{ number_format($rental->rental_cost, "2", ".", ",") }}</td>
<td>{{ $rental->paid_until }}</td>
<td>
{!! Form::open(['action' => 'SystemRentals\RentalAdminController@updateRentalSystem', 'method' => 'POST']) !!}
{{ Form::date('paid_until', \Carbon\Carbon::now()->endOfMonth(), ['class' => 'form-control']) }}
{{ Form::hidden('contact_id', $rental->contact_id) }}
{{ Form::hidden('corporation_id', $rental->corporation_id) }}
{{ Form::hidden('system_id', $rental->system_id) }}
{{ Form::submit('Update', ['class' => 'btn btn-primary']) }}
{!! Form::close() !!}
</td>
<td>
{!! Form::open(['action' => 'SystemRentals\RentalAdminController@removeRentalSystem', 'method' => 'POST']) !!}
{{ Form::radio('remove', 'Yes', false, ['class' => 'form-control']) }}
{{ Form::hidden('contact_id', $rental->contact_id) }}
{{ Form::hidden('corporation_id', $rental->corporation_id) }}
{{ Form::hidden('system_id', $rental->system_id) }}
</td>
<td>
{{ Form::submit('Remove', ['class' => 'btn btn-danger']) }}
{!! Form::close() !!}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endsection