moons controller

This commit is contained in:
2020-02-24 00:06:42 -06:00
parent 12b6f0120b
commit 203b2085ef
5 changed files with 41 additions and 61 deletions

View File

@@ -46,15 +46,6 @@ class MoonsController extends Controller
->with('moons', $moons); ->with('moons', $moons);
} }
/**
* Function to display alliance moons of a particular system
*/
public function displayMoonsSystem($system) {
$moons = AllianceMoon::where(['System' => $system])->get();
return view('moons.user.allmoons.system')->with('moons', $moons);
}
/** /**
* Function to display the moons and pass data to the blade template * Function to display the moons and pass data to the blade template
*/ */

View File

@@ -0,0 +1,40 @@
<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-140677389-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-140677389-1');
</script>
<title>{{ config('app.name', 'W4RP Services') }}</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<!-- Bootstrap CSS
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css" integrity="sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B" crossorigin="anonymous">
-->
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
<link rel="stylesheet" href="{{ asset('css/bootstrap.min.css') }}">
</head>
<body>
@include('layouts.navbar')
<div class="container">
@include('inc.messages')
</div>
@yield('content')
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>
</html>

View File

@@ -1,4 +1,4 @@
@extends('layouts.b4') @extends('layouts.moons.b4')
@section('content') @section('content')
<div class="row"> <div class="row">
<div class="container"> <div class="container">

View File

@@ -1,50 +0,0 @@
@extends('layouts.b4')
@section('content')
<div class="container">
<ul class="nav nav-tabs">
@foreach($systems as $system)
<li class="nav-item">
<a class="nav-link" href="/{{$system}}">{{ $system }}</a>
</li>
@endforeach
</ul>
<table class="table table-striped table-bordered">
<thead>
<th>Location</th>
<th>Corporation</th>
<th>Structure Name</th>
<th>First Ore</th>
<th>First Quantity</th>
<th>Second Ore</th>
<th>Second Quantity</th>
<th>Third Ore</th>
<th>Third Quantity</th>
<th>Fourth Ore</th>
<th>Fourth Quantity</th>
<th>Available</th>
</thead>
<tbody>
@foreach($moons as $moon)
<tr>
<td>{{ $moon->System . " - " . $moon->Planet . " - " . $moon->Moon }}</td>
<td>{{ $moon->Corporation }}</td>
<td>{{ $moon->StructureName }}</td>
<td>{{ $moon->FirstOre }}</td>
<td>{{ $moon->FirstQuantity }}</td>
<td>{{ $moon->SecondOre }}</td>
<td>{{ $moon->SecondQuantity }}</td>
<td>{{ $moon->ThirdOre }}</td>
<td>{{ $moon->ThirdQuantity }}</td>
<td>{{ $moon->FourthOre }}</td>
<td>{{ $moon->FourthQuantity }}</td>
@if($moon->Available == 1)
<td>Yes</td>
@else
<td>No</td>
@endif
</tr>
@endforeach
</tbody>
</table>
</div>
@endsection

View File

@@ -130,7 +130,6 @@ Route::group(['middleware' => ['auth']], function(){
Route::get('/moons/display/form/worth', 'Moons\MoonsController@displayTotalWorthForm'); Route::get('/moons/display/form/worth', 'Moons\MoonsController@displayTotalWorthForm');
Route::post('/moons/worth', 'Moons\MoonsController@displayTotalWorth'); Route::post('/moons/worth', 'Moons\MoonsController@displayTotalWorth');
Route::get('/moons/display/all', 'Moons\MoonsController@displayMoons'); Route::get('/moons/display/all', 'Moons\MoonsController@displayMoons');
Route::get('/moons/display/{system}', 'Moons\MoonsController@displayMoonsSystem');
/** /**
* Moon Admin Controller display pages * Moon Admin Controller display pages