megacommit
This commit is contained in:
parent
2451ab45cb
commit
34ed81516b
51 changed files with 1200 additions and 251 deletions
22
resources/views/components/orders.blade.php
Normal file
22
resources/views/components/orders.blade.php
Normal file
|
@ -0,0 +1,22 @@
|
|||
<div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Order ID</th>
|
||||
<th>Order Date</th>
|
||||
<th>Order Status</th>
|
||||
<th>Order Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($orders as $order)
|
||||
<tr>
|
||||
<td><a href="/order/{{ $order->order_id }}">{{ $order->order_id }}</a></td>
|
||||
<td>{{ $order->order_date }}</td>
|
||||
<td>{{ $order->order_status }}</td>
|
||||
<td>{{ $order->order_total }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
|
@ -3,7 +3,15 @@
|
|||
@push('head')
|
||||
<link rel="stylesheet" href="{{ asset('css/generic.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('css/seat-chooser.css') }}">
|
||||
<script src="{{ asset('js/seat-chooser.js') }}" defer></script>
|
||||
<script src="{{ asset('js/seat-chooser.js') }}"></script>
|
||||
@endpush
|
||||
|
||||
<div id="seat-chooser"></div>
|
||||
<div>
|
||||
|
||||
<div id="seat-chooser" data-showing-id="{{ $showing_id }}">
|
||||
<div id="seat-chooser-status">
|
||||
<h2>Loading...</h2>
|
||||
<span id="seat-chooser-status-message">Fetching prices...</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -14,6 +14,10 @@
|
|||
<hr/>
|
||||
@endif
|
||||
|
||||
<h2>Orders</h2>
|
||||
<hr/>
|
||||
<x-orders :orders="Auth()->user()->orders" />
|
||||
|
||||
<h2>Permissions</h2>
|
||||
<hr/>
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{{ isset($title) ? $title : 'Page' }} - {{ config('app.name', 'CineFlex') }} Manage</title>
|
||||
<script src="{{asset('js/freq.js')}}"></script>
|
||||
@stack('head')
|
||||
</head>
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
<ul>
|
||||
@foreach($cinemas as $cinema)
|
||||
<li>
|
||||
<a href="{{ route('cinema', ['id' => $cinema->id]) }}">
|
||||
{{ $cinema->name }}
|
||||
<a href="{{ route('cinema', ['id' => $cinema->cinema_id]) }}">
|
||||
{{ $cinema->cinema_name }}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
|
|
|
@ -10,9 +10,16 @@
|
|||
<h1>Now playing:</h1>
|
||||
<hr/>
|
||||
<div id="movies">
|
||||
@foreach($movies as $showing)
|
||||
|
||||
@endforeach
|
||||
@foreach($movies as $movie)
|
||||
<a class="movie" href="{{route('movie', ['id' => $movie->movie_id])}}">
|
||||
<img src="{{ $movie->movie_image }}" alt="{{ $movie->movie_name }}">
|
||||
<div class="details">
|
||||
<h2>{{ $movie->movie_name }}</h2>
|
||||
<span>{{ $movie->movie_description }}</span>
|
||||
<p>{{ $movie->movie_length }} minutes</p>
|
||||
</div>
|
||||
</a>
|
||||
@endforeach
|
||||
</section>
|
||||
|
||||
@endsection
|
||||
|
|
29
resources/views/main/movies/movie.blade.php
Normal file
29
resources/views/main/movies/movie.blade.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
@extends('main.layout')
|
||||
|
||||
@section('content')
|
||||
|
||||
<section>
|
||||
<h1>{{$movie->movie_name}}</h1>
|
||||
<hr/>
|
||||
<div id="movie">
|
||||
<img src="{{$movie->movie_image}}" alt="{{$movie->movie_name}} Poster" width="200px">
|
||||
<div class="details">
|
||||
<span>{{$movie->movie_length}} min</span><br/>
|
||||
<span>{{$movie->movie_description}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h1>Now playing:</h1>
|
||||
<hr/>
|
||||
<div id="showings">
|
||||
@foreach($movie->showings as $showing)
|
||||
<a href="/showing/{{$showing->showing_id}}">
|
||||
<h2>{{$showing->room->cinema->cinema_name}} @ {{$showing->showing_start}} - {{$showing->showing_end()}}</h2>
|
||||
</a>
|
||||
@endforeach
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@endsection
|
35
resources/views/main/order.blade.php
Normal file
35
resources/views/main/order.blade.php
Normal file
|
@ -0,0 +1,35 @@
|
|||
@extends('layout')
|
||||
|
||||
@push('head')
|
||||
<link rel="stylesheet" href="{{asset('css/generic.css')}}">
|
||||
<link rel="stylesheet" href="{{asset('css/order.css')}}">
|
||||
<script src="{{asset('js/order.js')}}" defer></script>
|
||||
@endpush
|
||||
|
||||
@section('body')
|
||||
<h1>Ordering tickets for {{ $showing->movie->movie_name }}</h1>
|
||||
<hr/>
|
||||
<div id="showing">
|
||||
<div class="details">
|
||||
<span>Cinema: <a
|
||||
href="/cinema/{{$showing->room->cinema->cinema_id}}">{{$showing->room->cinema->cinema_name}}</a></span><br/>
|
||||
<span>Room: {{$showing->room->room_name}}</span><br/>
|
||||
<span>Showing: {{$showing->showing_start}} - {{$showing->showing_end()}}</span><br/>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
@component('components.seat-chooser', ['room_id' => $showing->room->room_id, 'showing_id' => $showing->showing_id])
|
||||
@endcomponent
|
||||
<hr/>
|
||||
<div id="summary">
|
||||
<h2>Summary</h2>
|
||||
<hr/>
|
||||
<div id="summary-dyn">
|
||||
No seats selected.
|
||||
</div>
|
||||
<hr/>
|
||||
<div id="summary-total">Total: €0.00</div>
|
||||
</div>
|
||||
<button id="order-button" class="button" disabled=true>Order</button>
|
||||
|
||||
@endsection
|
|
@ -10,7 +10,7 @@
|
|||
<div class="details">
|
||||
<span>Cinema: <a
|
||||
href="/cinema/{{$showing->room->cinema->cinema_id}}">{{$showing->room->cinema->cinema_name}}</a></span><br/>
|
||||
<span>Showing: {{$showing->showing_start}} - {{$showing->end_time()}}</span><br/>
|
||||
<span>Showing: {{$showing->showing_start}} - {{$showing->showing_end()}}</span><br/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
@ -30,8 +30,7 @@
|
|||
<section>
|
||||
<h1>Tickets:</h1>
|
||||
<hr/>
|
||||
<span>Tickets available: {{$showing->tickets_available()}}</span><br/>
|
||||
<span>Buy tickets?</span>
|
||||
{{-- todo--}}
|
||||
<span>Tickets available: {{$showing->tickets_available()}}</span><br/><br/>
|
||||
<a href="/showing/{{$showing->showing_id}}/order" class="button">Order Tickets</a>
|
||||
</section>
|
||||
@endsection
|
||||
|
|
|
@ -3,46 +3,27 @@
|
|||
@section('content')
|
||||
<h1>Cinemas</h1>
|
||||
<hr/><br/>
|
||||
<h2>Stats:</h2>
|
||||
<div class="spread-h">
|
||||
<a class="clicky-card" href="{{ route('manage.cinemas') }}">
|
||||
<div class="card">
|
||||
<h3>Amount Cinemas</h3>
|
||||
<span class="big-stat">{{ $cinemas->count() }}</span>
|
||||
<h2>Cinemas ({{ count(Auth::user()->cinemas()) }} / {{ $cinemas->count() }})</h2>
|
||||
<div>
|
||||
@if (count(Auth::user()->cinemas()) > 0)
|
||||
<ul>
|
||||
@foreach(Auth::user()->cinemas() as $cinema)
|
||||
<li>
|
||||
<a href="{{ route('manage.cinema', ['id' => $cinema->cinema_id]) }}">
|
||||
<div>
|
||||
<h3>{{ $cinema->cinema_name }}</h3>
|
||||
<span class="big-stat">{{ $cinema->address->address_city }}</span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@else
|
||||
<div class="warning">
|
||||
<h3>No Cinemas</h3>
|
||||
<span>Did you have permission?</span>
|
||||
</div>
|
||||
</a>
|
||||
<a class="clicky-card" href="{{ route('manage.cinemas.employees') }}">
|
||||
<div class="card">
|
||||
<h3>Amount Employees</h3>
|
||||
<span class="big-stat">{{ $employees->count() }}</span>
|
||||
</div>
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
<br/>
|
||||
<h2>Cinemas:</h2>
|
||||
<div class="spread-h">
|
||||
@foreach($cinemas as $cinema)
|
||||
<a class="clicky-card" href="{{ route('manage.cinemas.show', ['id' => $cinema->id]) }}">
|
||||
<div class="card">
|
||||
<h3>{{ $cinema->name }}</h3>
|
||||
<span class="big-stat">{{ $cinema->address->address_city }}</span>
|
||||
</div>
|
||||
</a>
|
||||
@endforeach
|
||||
</div>
|
||||
<br/>
|
||||
<h2>Employees:</h2>
|
||||
<div class="spread-h">
|
||||
@foreach($employees as $employee)
|
||||
<a class="clicky-card" href="{{ route('manage.cinemas.employees.show', ['id' => $employee->id]) }}">
|
||||
<div class="card">
|
||||
<h3>{{ $employee->name }}</h3>
|
||||
<span class="big-stat">{{ $employee->cinema->name }}</span>
|
||||
</div>
|
||||
</a>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<a class="btn btn-primary" href="{{ route('manage') }}">Back</a>
|
||||
@endsection
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<hr/><br/>
|
||||
<h2>Stats:</h2>
|
||||
<div class="spread-h">
|
||||
<a class="clicky-card" href="{{ route('manage') }}">
|
||||
<a class="clicky-card" href="{{ route('manage.users') }}">
|
||||
<div class="card">
|
||||
<h3>Amount Users</h3>
|
||||
<span class="big-stat">{{ $users->count() }}</span>
|
||||
|
@ -23,7 +23,7 @@
|
|||
<span class="big-stat">{{ $genres->count() }}</span>
|
||||
</div>
|
||||
</a>
|
||||
<a class="clicky-card" href="{{ route('manage') }}">
|
||||
<a class="clicky-card" href="{{ route('manage.showings') }}">
|
||||
<div class="card">
|
||||
<h3>Amount Showings</h3>
|
||||
<span class="big-stat">{{ $showings->count() }}</span>
|
||||
|
|
|
@ -18,12 +18,26 @@
|
|||
</header>
|
||||
<div id="sidebar"> {{-- Page Aware --}}
|
||||
<a class="{{ Request::is('manage') ? 'active' : '' }}" href="{{ route('manage') }}">Dashboard</a>
|
||||
{{-- manage cinemas--}}
|
||||
{{-- <a class="{{ Request::is('manage/cinemas') ? 'active' : '' }}" href="{{ route('manage.cinemas') }}">Cinemas</a>--}}
|
||||
{{-- <a class="{{ Request::is('manage/cinemas/employees') ? 'active' : '' }} child" href="{{ route('manage.cinemas.employees') }}">Employees</a>--}}
|
||||
|
||||
@if (Auth::user()->hasPermission("READ_CINEMAS"))
|
||||
<a class="{{ Request::is('manage/cinemas') ? 'active' : '' }}" href="{{ route('manage.cinemas') }}">Cinemas</a>
|
||||
@endif
|
||||
|
||||
@if (Auth::user()->hasPermission("READ_MOVIES"))
|
||||
<a class="{{ Request::is('manage/movies') ? 'active' : '' }}" href="{{ route('manage.movies') }}">Movies</a>
|
||||
@endif
|
||||
|
||||
@if (Auth::user()->hasPermission("READ_SHOWINGS"))
|
||||
<a class="child {{ Request::is('manage/showings') ? 'active' : '' }}" href="{{ route('manage.showings') }}">Showings</a>
|
||||
@endif
|
||||
|
||||
@if (Auth::user()->hasPermission("READ_GENRES"))
|
||||
<a class="{{ Request::is('manage/genres') ? 'active' : '' }}" href="{{ route('manage.genres') }}">Genres</a>
|
||||
@endif
|
||||
|
||||
@if(Auth::user()->atleast('manage') && Auth::user()->hasPermission("READ_USERS"))
|
||||
<a class="{{ Request::is('manage/users') ? 'active' : '' }}" href="{{ route('manage.users') }}">Users</a>
|
||||
@endif
|
||||
</div>
|
||||
<main>
|
||||
@yield('content')
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<h3>Times</h3>
|
||||
<span class="mono">
|
||||
Start: {{ $showing->showing_start }}<br>
|
||||
Ends : {{ $showing->end_time() }}
|
||||
Ends : {{ $showing->showing_end() }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
|
|
41
resources/views/manage/users/index.blade.php
Normal file
41
resources/views/manage/users/index.blade.php
Normal file
|
@ -0,0 +1,41 @@
|
|||
@extends('manage.layout')
|
||||
|
||||
@section('content')
|
||||
<h1>Users</h1>
|
||||
<hr/>
|
||||
<div id="users">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<th>Role</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
@foreach($users as $user)
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{ route('manage.user', ['id' => $user->user_id]) }}">
|
||||
{{ $user->name }}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ route('manage.user', ['id' => $user->user_id]) }}">
|
||||
{{ $user->email }}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ route('manage.user', ['id' => $user->user_id]) }}">
|
||||
{{ $user->role }}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ route('manage.user', ['id' => $user->user_id]) }}">
|
||||
View
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
</div>
|
||||
@endsection
|
117
resources/views/manage/users/user.blade.php
Normal file
117
resources/views/manage/users/user.blade.php
Normal file
|
@ -0,0 +1,117 @@
|
|||
@extends('manage.layout')
|
||||
|
||||
@section('content')
|
||||
|
||||
<h1>User: {{ $user->name }}</h1>
|
||||
<hr/>
|
||||
|
||||
<h2>Core User Details</h2>
|
||||
<form id="core-user-form" class="form" method="POST" action="{{ route('manage.user', ['id' => $user->user_id ]) }}">
|
||||
@csrf
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">Name</label>
|
||||
<input type="text" name="name" id="name" value="{{ $user->name }}"/>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="password">Password</label>
|
||||
<input type="password" placeholder="Change password" name="password" id="password"/>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="role">Role</label>
|
||||
<select>
|
||||
<option value="admin" {{ $user->role == 'admin' ? 'selected' : '' }}>Admin</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<button type="submit">Update</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script id="core-user-form-loader">
|
||||
// request allowed roles to give from the API (/api/allowedRoles)
|
||||
// populate the select with the allowed roles
|
||||
// set the selected role to the current role
|
||||
</script>
|
||||
|
||||
<h2>User Permissions</h2>
|
||||
{{-- for loop, and make sure that only if the user has the DELETE_PERMISSION that they can delete it and if they have the UPDATE_PERMISSION that they can update it--}}
|
||||
<div id="permissions">
|
||||
<table id="permissions">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Permission</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@foreach(auth()->user()->permissions as $permission)
|
||||
<tr>
|
||||
<td>{{ $permission->permission_name }}</td>
|
||||
<td>
|
||||
<form action="{{ route('api.user.permission', ['id' => $user->user_id, 'permission_id' => $permission->permission_id]) }}" method="DELETE">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<form id="add-permission" method="POST"
|
||||
action="{{ route('api.user.permission', ['id' => $user->user_id ]) }}">
|
||||
@csrf
|
||||
<tr>
|
||||
<td>
|
||||
<input class="text" type="text" name="permission_name" id="permission"/>
|
||||
</td>
|
||||
<td>
|
||||
<button class="button" type="submit">Add</button>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
|
||||
<h2>Cinema Assignments</h2>
|
||||
<table id="assignments">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Assignment</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@foreach(auth()->user()->cinemas() as $cinema)
|
||||
<tr>
|
||||
<td>{{ $cinema->cinema_name }}</td>
|
||||
<td>
|
||||
@if($user->hasPermission('DELETE_CINEMA_ASSIGNMENT'))
|
||||
<a href="{{ route('api.user.assignment', ['id' => $cinema->cinema_id]) }}">
|
||||
Delete
|
||||
</a>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
@if ($user->hasPermission('UPDATE_USER'))
|
||||
<form id="add-assignment" method="POST"
|
||||
action="{{ route('api.user.assignment', ['id' => $user->user_id ]) }}">
|
||||
@csrf
|
||||
<tr>
|
||||
<td>
|
||||
<select name="cinema" id="cinema">
|
||||
@foreach(auth()->user()->cinemas() as $cinema)
|
||||
<option value="{{ $cinema->cinema_id }}">{{ $cinema->cinema_name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<button class="button" type="submit">Add</button>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
@endif
|
||||
</table>
|
||||
</div>
|
||||
@endsection
|
Loading…
Add table
Add a link
Reference in a new issue