From 3b0bb0e0669bca5e06f1d11a2c89c1a211d1768f Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Fri, 27 Sep 2019 01:17:38 -0500 Subject: [PATCH] forms --- app/Http/Controllers/Hauling/Hauling.php | 18 +++-- ...9_26_051702_create_solar_systems_table.php | 1 + database/seeds/SolarSystemSeeder.php | 1 + .../views/hauling/display/form.blade.php | 52 ++++++++++++--- .../views/hauling/display/results.blade.php | 66 +++++++++++++++++++ resources/views/layouts/b4.blade.php | 6 +- 6 files changed, 128 insertions(+), 16 deletions(-) diff --git a/app/Http/Controllers/Hauling/Hauling.php b/app/Http/Controllers/Hauling/Hauling.php index 3f3601b..421b86e 100644 --- a/app/Http/Controllers/Hauling/Hauling.php +++ b/app/Http/Controllers/Hauling/Hauling.php @@ -30,8 +30,8 @@ class Hauling extends Controller */ public function displayFormResults(Request $request) { $this->validate($request, [ - 'name1' => 'required', - 'name2' => 'required', + 'pickup' => 'required', + 'destination' => 'required', 'collateral' => 'required', 'size' => 'required', ]); @@ -40,14 +40,18 @@ class Hauling extends Controller $collateral = $request->collateral; $time = '1 week'; $duration = '3 days'; + $pickup = $request->pickup; + $destination = $request->destination; $hHelper = new HaulingHelper; - $jumps = $hHelper->JumpsBetweenSystems($request->name1, $request->name2); + $jumps = $hHelper->JumpsBetweenSystems($pickup, $destination); - if($size > 0 && $size <= 57500) { + if($size > 0 && $size <= 8000) { + $cost = $jumps* 600000; + } else if($size > 8000 && $size <= 57500) { $cost = $jumps * 750000; - } else if($size > 57500 && $size < 800000) { + } else if($size > 57500 && $size <= 800000) { $cost = $jumps * 1000000; } else { $cost = -1; @@ -58,7 +62,9 @@ class Hauling extends Controller ->with('collateral', $collateral) ->with('size', $size) ->with('time', $time) - ->with('duration', $duration); + ->with('duration', $duration) + ->with('pickup', $pickup) + ->with('destination', $destination); } /** diff --git a/database/migrations/2019_09_26_051702_create_solar_systems_table.php b/database/migrations/2019_09_26_051702_create_solar_systems_table.php index d3c4bab..5d3d862 100644 --- a/database/migrations/2019_09_26_051702_create_solar_systems_table.php +++ b/database/migrations/2019_09_26_051702_create_solar_systems_table.php @@ -17,6 +17,7 @@ class CreateSolarSystemsTable extends Migration Schema::create('solar_systems', function (Blueprint $table) { $table->string('name'); $table->string('solar_system_id')->unique(); + $table->float('security_status', 3, 2); }); } } diff --git a/database/seeds/SolarSystemSeeder.php b/database/seeds/SolarSystemSeeder.php index 0d8e7dc..90f1cab 100644 --- a/database/seeds/SolarSystemSeeder.php +++ b/database/seeds/SolarSystemSeeder.php @@ -39,6 +39,7 @@ class SolarSystemSeeder extends Seeder SolarSystem::insert([ 'name' => $info->name, 'solar_system_id' => $system, + 'security_status' => $info->security_status, ]); } } diff --git a/resources/views/hauling/display/form.blade.php b/resources/views/hauling/display/form.blade.php index 022175e..7999aed 100644 --- a/resources/views/hauling/display/form.blade.php +++ b/resources/views/hauling/display/form.blade.php @@ -1,16 +1,50 @@ -@if(Auth::check()) -@extends('layouts.navbars.loggedin') -@else -@extends('layouts.navbars.loggedout') -@endif - +@extends('layouts.b4') +@section('content') +
- + How to Make a Contract
- +
    +
  1. Get a quote from EvePraisal and set the sell value as the collateral.
  2. +
  3. Issue the courier contracts as 'Private' to 'United Hauling'.
  4. +
  5. If utilizing a container, please note in description
  6. +
+
+ Join our channel "United Hauling" in game for questions and/or concerns.
-
\ No newline at end of file + +
+
+
+ Quote +
+
+ {!! Form::open(['action' => 'Hauling\HaulingController@displayFormResults', 'method' => 'POST']) !!} +
+ {{ Form::label('pickup', 'Pickup System') }} + {{ Form::text('pickup', '', ['class' => 'form-control']) }} +
+
+ {{ Form::label('destination', 'Destination System') }} + {{ Form::text('destination', '', ['class' => 'form-control']) }} +
+
+ {{ Form::label('size', 'Volume') }} + {{ Form::text('size', '', ['class' => 'form-control']) }} +
+
+ {{ Form::label('collateral', 'Collateral') }} + {{ Form::text('collateral', '', ['class' => 'form-control']) }} +
+
+ {{ Form::submit('Submit', ['class' => 'btn btn-primary']) }} + {!! Form::close() !!} +
+
+
+
+@endsection \ No newline at end of file diff --git a/resources/views/hauling/display/results.blade.php b/resources/views/hauling/display/results.blade.php index e69de29..7da72ab 100644 --- a/resources/views/hauling/display/results.blade.php +++ b/resources/views/hauling/display/results.blade.php @@ -0,0 +1,66 @@ +@extends('layouts.b4') +@section('content') +
+
+
+
+ Your Query +
+
+ + + + + + + + + + + + + + + + + +
Route{{ $pickup }} >> {{ $destination }}
Warps{{ $jumps }}
Volume{{ $size }}
Collateral{{ $collateral }} ISK
+
+
+
+
+
+
+ Your Quote +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Service TypeHighsec
Issue ToUnited Hauling
Price{{ $price }}
Container PolicyContainers allowed.
Expiration{{ $time }}
Days To Complete{{ $duration }}
+
+
+
+@endsection \ No newline at end of file diff --git a/resources/views/layouts/b4.blade.php b/resources/views/layouts/b4.blade.php index 0de8359..a6a3c82 100644 --- a/resources/views/layouts/b4.blade.php +++ b/resources/views/layouts/b4.blade.php @@ -25,7 +25,11 @@ - @include('layouts.navbar') + @if(Auth::check()) + @extends('layouts.navbars.loggedin') + @else + @extends('layouts.navbars.loggedout') + @endif
@include('inc.messages')