moons controller
This commit is contained in:
@@ -110,6 +110,7 @@ class MoonsAdminController extends Controller
|
||||
'renter' => 'required',
|
||||
'date' => 'required',
|
||||
'contact' => 'required',
|
||||
'paid' => 'required',
|
||||
]);
|
||||
|
||||
//Take the contact name and create a character id from it
|
||||
@@ -157,6 +158,7 @@ class MoonsAdminController extends Controller
|
||||
'Contact' => $contact,
|
||||
'Price' => $price['alliance'],
|
||||
'Type' => 'alliance',
|
||||
'Paid' => $request->paid,
|
||||
]);
|
||||
} else {
|
||||
MoonRental::insert([
|
||||
@@ -168,6 +170,7 @@ class MoonsAdminController extends Controller
|
||||
'Contact' => $contact,
|
||||
'Price' => $price['outofalliance'],
|
||||
'Type' => 'outofalliance',
|
||||
'Paid' => $request->paid,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -277,7 +280,7 @@ class MoonsAdminController extends Controller
|
||||
$moon = $str_array[2];
|
||||
|
||||
//Update the paid status of the moon
|
||||
Moon::where([
|
||||
MoonRental::where([
|
||||
'System' => $system,
|
||||
'Planet' => $planet,
|
||||
'Moon' => $moon,
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
//Internal Library
|
||||
use Auth;
|
||||
use DB;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
//Models
|
||||
use App\Models\Moon\Config;
|
||||
use App\Models\Moon\ItemComposition;
|
||||
use App\Models\Moon\Moon;
|
||||
@@ -15,6 +16,7 @@ use App\Models\Moon\OrePrice;
|
||||
use App\Models\Moon\Price;
|
||||
use App\Models\MoonRent\MoonRental;
|
||||
|
||||
//Library
|
||||
use App\Library\Moons\MoonCalc;
|
||||
|
||||
class MoonsController extends Controller
|
||||
|
||||
@@ -14,13 +14,22 @@
|
||||
<div class="form-group col-md-6">
|
||||
{{ Form::label('renter', 'Renter') }}
|
||||
{{ Form::text('renter', '', ['class' => 'form-control', 'placeholder' => 'Renter']) }}
|
||||
{{ Form::label('contact', 'Contact') }}
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
{{ Form::label('contact', 'Contact') }}
|
||||
{{ Form::text('contact', '', ['class' => 'form-control', 'placeholder' => 'Character']) }}
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
{{ Form::label('date', 'Rental End Date') }}
|
||||
{{ Form::date('date', \Carbon\Carbon::now()->addMonth(), ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
Paid?<br>
|
||||
{{ Form::label('paid', 'No') }}
|
||||
{{ Form::radio('paid', 'No', true) }}
|
||||
{{ Form::label('paid', 'Yes') }}
|
||||
{{ Form::radio('paid', 'Yes') }}
|
||||
</div>
|
||||
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user