update moon rental functionality
This commit is contained in:
@@ -43,7 +43,7 @@ class MoonsAdminController extends Controller
|
|||||||
return view('moons.admin.updatemoon');
|
return view('moons.admin.updatemoon');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function storeUpdateMoonRental(Request $request) {
|
public function storeUpdateMoon(Request $request) {
|
||||||
$moonCalc = new MoonCalc;
|
$moonCalc = new MoonCalc;
|
||||||
$lookup = new LookupHelper;
|
$lookup = new LookupHelper;
|
||||||
|
|
||||||
@@ -165,7 +165,7 @@ class MoonsAdminController extends Controller
|
|||||||
return redirect('/moons/admin/updatemoon')->with('success', 'Moon Updated');
|
return redirect('/moons/admin/updatemoon')->with('success', 'Moon Updated');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function storeUpdateMoon(Request $request) {
|
public function storeUpdateMoonOld(Request $request) {
|
||||||
$moonCalc = new MoonCalc();
|
$moonCalc = new MoonCalc();
|
||||||
$lookup = new LookupHelper();
|
$lookup = new LookupHelper();
|
||||||
|
|
||||||
@@ -179,6 +179,12 @@ class MoonsAdminController extends Controller
|
|||||||
'paid' => 'required',
|
'paid' => 'required',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
//If the moon rental is being cancelled, let's update it.
|
||||||
|
if($request->removal == true) {
|
||||||
|
$this->RemoveRenter($request->system, $request->planet, $request->moon);
|
||||||
|
return redirect('/moons/admin/updatemoon')->with('success', 'Moon Updated and Renter Removed.');
|
||||||
|
}
|
||||||
|
|
||||||
//Take the contact name and create a character id from it
|
//Take the contact name and create a character id from it
|
||||||
if($request->contact == 'None') {
|
if($request->contact == 'None') {
|
||||||
$contact = 'None';
|
$contact = 'None';
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
@if(auth()->user()->hasRole('Admin'))
|
@if(auth()->user()->hasRole('Admin'))
|
||||||
<a class="dropdown-item" href="/moons/admin/display">Display Moons</a>
|
<a class="dropdown-item" href="/moons/admin/display">Display Moons</a>
|
||||||
<a class="dropdown-item" href="/moons/display/worth">Moon Worth</a>
|
<a class="dropdown-item" href="/moons/display/worth">Moon Worth</a>
|
||||||
<a class="dropdown-item" href="/moons/admin/addmoon">Add Moon</a>
|
|
||||||
<a class="dropdown-item" href="/moons/admin/updatemoon">Update Moon</a>
|
<a class="dropdown-item" href="/moons/admin/updatemoon">Update Moon</a>
|
||||||
<a class="dropdown-item" href="/moons/admin/journal">Journal</a>
|
<a class="dropdown-item" href="/moons/admin/journal">Journal</a>
|
||||||
@endif
|
@endif
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
@extends('layouts.b4')
|
|
||||||
@section('content')
|
|
||||||
<div class="container">
|
|
||||||
<h2>Add A New Moon</h2>
|
|
||||||
{!! Form::open(['action' => 'Moons\MoonsAdminController@storeMoon', 'method' => 'POST']) !!}
|
|
||||||
<div class="form-group col-md-6">
|
|
||||||
{{ Form::label('region', 'Region') }}
|
|
||||||
{{ Form::text('region', '', ['class' => 'form-control', 'placeholder' => 'Region']) }}
|
|
||||||
{{ Form::label('system', 'System') }}
|
|
||||||
{{ Form::text('system', '', ['class' => 'form-control', 'placeholder' => 'System']) }}
|
|
||||||
{{ Form::label('planet', 'Planet') }}
|
|
||||||
{{ Form::text('planet', '', ['class' => 'form-control', 'placeholder' => 'Planet']) }}
|
|
||||||
{{ Form::label('moon', 'Moon') }}
|
|
||||||
{{ Form::text('moon', '', ['class' => 'form-control', 'placeholder' => 'Moon']) }}
|
|
||||||
{{ Form::label('struture', 'Structure Name') }}
|
|
||||||
{{ Form::text('structure', '', ['class' => 'form-control', 'placeholder' => 'Structure Name']) }}
|
|
||||||
{{ Form::label('firstore', 'First Ore') }}
|
|
||||||
{{ Form::text('firstore', '', ['class' => 'form-control', 'placeholder' => 'First Ore Name']) }}
|
|
||||||
{{ Form::label('firstquan', 'First Ore Quantity') }}
|
|
||||||
{{ Form::text('firstquan', '', ['class' => 'form-control', 'placeholder' => 'First Ore Quantity']) }}
|
|
||||||
{{ Form::label('secondore', 'Second Ore') }}
|
|
||||||
{{ Form::text('secondore', '', ['class' => 'form-control', 'placeholder' => 'Second Ore Name']) }}
|
|
||||||
{{ Form::label('secondquan', 'Second Ore Quantity') }}
|
|
||||||
{{ Form::text('secondquan', '', ['class' => 'form-control', 'placeholder' => 'Second Ore Quantity']) }}
|
|
||||||
{{ Form::label('thirdore', 'Third Ore') }}
|
|
||||||
{{ Form::text('thirdore', '', ['class' => 'form-control', 'placeholder' => 'Third Ore Name']) }}
|
|
||||||
{{ Form::label('thirdquan', 'Third Ore Quantity') }}
|
|
||||||
{{ Form::text('thirdquan', '', ['class' => 'form-control', 'placeholder' => 'Third Ore Quantity']) }}
|
|
||||||
{{ Form::label('fourthore', 'Fourth Ore') }}
|
|
||||||
{{ Form::text('fourthore', '', ['class' => 'form-control', 'placeholder' => 'Fourth Ore Name']) }}
|
|
||||||
{{ Form::label('fourthquan', 'Fourth Ore Quantity') }}
|
|
||||||
{{ Form::text('fourthquan', '', ['class' => 'form-control', 'placeholder' => 'Fourth Ore Quantity']) }}
|
|
||||||
</div>
|
|
||||||
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
|
|
||||||
{!! Form::close() !!}
|
|
||||||
</div>
|
|
||||||
@endsection
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
@extends('layouts.b4')
|
@extends('layouts.b4')
|
||||||
@section('content')
|
@section('content')
|
||||||
|
<br>
|
||||||
{!! Form::open(['action' => 'Moons\MoonsAdminController@updateMoonPaid', 'method' => 'POST']) !!}
|
{!! Form::open(['action' => 'Moons\MoonsAdminController@updateMoonPaid', 'method' => 'POST']) !!}
|
||||||
<div class="container col-md-12">
|
<div class="container col-md-12">
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
@extends('layouts.b4')
|
@extends('layouts.b4')
|
||||||
@section('content')
|
@section('content')
|
||||||
|
<br>
|
||||||
<div class="container col-md-12">
|
<div class="container col-md-12">
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
|
|||||||
@@ -35,8 +35,6 @@ Route::group(['middleware' => ['auth']], function(){
|
|||||||
/**
|
/**
|
||||||
* Moon Admin Controller display pages
|
* Moon Admin Controller display pages
|
||||||
*/
|
*/
|
||||||
Route::get('/moons/admin/addmoon', 'Moons\MoonsAdminController@addMoon');
|
|
||||||
Route::post('/moon/admin/addmoon', 'Moons\MoonsAdminController@storeMoon');
|
|
||||||
Route::get('/moons/admin/display', 'Moons\MoonsAdminController@displayMoonsAdmin');
|
Route::get('/moons/admin/display', 'Moons\MoonsAdminController@displayMoonsAdmin');
|
||||||
Route::get('/moons/admin/updatemoon', 'Moons\MoonsAdminController@updateMoon');
|
Route::get('/moons/admin/updatemoon', 'Moons\MoonsAdminController@updateMoon');
|
||||||
Route::post('/moons/admin/updatemoon', 'Moons\MoonsAdminController@storeUpdateMoon');
|
Route::post('/moons/admin/updatemoon', 'Moons\MoonsAdminController@storeUpdateMoon');
|
||||||
|
|||||||
Reference in New Issue
Block a user