Lot's of bug fixes
This commit is contained in:
parent
ad320963fc
commit
7718ed6c32
196 changed files with 51167 additions and 3010 deletions
107
resources/views/panel/shows/create.blade.php
Normal file
107
resources/views/panel/shows/create.blade.php
Normal file
|
@ -0,0 +1,107 @@
|
|||
@extends('layouts.admin')
|
||||
|
||||
@section('css')
|
||||
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}" />
|
||||
@endsection
|
||||
|
||||
@section('page', 'Show Date Manager')
|
||||
|
||||
@section('content')
|
||||
<div class="col-xs-12 col-lg-6 col-lg-offset-3 col-md-8 col-md-offset-2">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title" style="margin-top: 8px">Add Show Date</h3>
|
||||
<small style="float: right"><a class="btn btn-primary" href="{{ route('panel.shows') }}">Back</a></small>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
@if(session('error'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ session('error') }}
|
||||
<a class="close" data-dismiss="alert" aria-label="close">×</a>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
<form method="POST" action="{{ route('panel.shows.create') }}" class="col-xs-10 col-xs-offset-1">
|
||||
@csrf
|
||||
|
||||
<div class="form-group @error('show_id') has-error @enderror">
|
||||
<label for="show_id" class="text-md-right">{{ __('Show ID:') }}</label>
|
||||
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="glyphicon glyphicon-tag"></i></span>
|
||||
<input id="show_id" type="text" class="form-control" placeholder="Show ID" name="show_id" required autocomplete="off" autofocus>
|
||||
</div>
|
||||
@error('show_id')
|
||||
<span class="help-block">{{ $message }}</span>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="form-group @error('date') has-error @enderror">
|
||||
<label for="date" class="text-md-right"><strong>Date:</strong></label>
|
||||
|
||||
<div class="input-group date" id="picker">
|
||||
<span class="input-group-addon">
|
||||
<i class="glyphicon glyphicon-calendar"></i>
|
||||
</span>
|
||||
<input placeholder="Date" type="text" name="date" class="form-control">
|
||||
</div>
|
||||
@error('date')
|
||||
<span class="help-block">{{ $message }}</span>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-block btn-primary">{{ __('Add Show Date') }}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('javascript')
|
||||
<script src="https://cdn.jsdelivr.net/momentjs/2.14.1/moment.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.min.js"></script>
|
||||
<script>
|
||||
$(function () {
|
||||
$('#picker').datetimepicker({
|
||||
format: "DD-MM-YYYY HH:mm",
|
||||
minDate: moment()
|
||||
});
|
||||
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
}
|
||||
});
|
||||
|
||||
$("#show_id").autocomplete({
|
||||
source: function( request, response ) {
|
||||
$.ajax({
|
||||
url: '{{ route('panel.shows.search') }}',
|
||||
type:'POST',
|
||||
dataType: "json",
|
||||
data: {
|
||||
searchText: request.term
|
||||
},
|
||||
success: function (data) {
|
||||
response($.map(data, function (item) {
|
||||
return {
|
||||
label: '#'+item.id+' Title: '+item.title,
|
||||
value: item.id
|
||||
};
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
minLength: 3,
|
||||
open: function() {
|
||||
$(this).removeClass("ui-corner-all").addClass("ui-corner-top");
|
||||
},
|
||||
close: function() {
|
||||
$(this).removeClass("ui-corner-top").addClass("ui-corner-all");
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
108
resources/views/panel/shows/index.blade.php
Normal file
108
resources/views/panel/shows/index.blade.php
Normal file
|
@ -0,0 +1,108 @@
|
|||
@extends('layouts.admin')
|
||||
|
||||
@section('page', 'Show Date Manager')
|
||||
|
||||
@section('content')
|
||||
<div class="col-lg-8 col-lg-offset-2">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Search</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<form id="searchForm">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="glyphicon glyphicon-tag"></i></span>
|
||||
<input id="search" type="text" class="form-control" name="search" value="{{ $search }}" placeholder="Search for show dates by show title" autofocus>
|
||||
</div>
|
||||
<button class="btn btn-block btn-primary">{{ __('Search') }}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-8 col-lg-offset-2">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title" style="margin-top: 8px; width: 100%">Show Dates<small style="float: right"><a class="btn btn-primary" href="{{ route('panel.shows.add') }}">Add</a></small></h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
@if(session('success'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ session('success') }}
|
||||
<a class="close" data-dismiss="alert" aria-label="close">×</a>
|
||||
</div>
|
||||
|
||||
@elseif(session('error'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ session('error') }}
|
||||
<a class="close" data-dismiss="alert" aria-label="close">×</a>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Title</th>
|
||||
<th class="text-center">Date</th>
|
||||
<th class="text-center" style="width: 105px">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if(!empty($dates->all()))
|
||||
@foreach($dates as $date)
|
||||
<tr>
|
||||
<td>{{ $date->id }}</td>
|
||||
<td>{{ $date->title }}</td>
|
||||
<td class="text-center">{{ $date->date }}</td>
|
||||
<td style="width: 105px"><a class="btn btn-primary" href="{{ route('panel.shows.info', ['id' => $date->id]) }}"><i class="glyphicon glyphicon-info-sign"></i></a> <a class="btn btn-primary" style="margin-left: 2px" href="{{ route('panel.shows.delete', ['id' => $date->id]) }}"><i class="glyphicon glyphicon-trash"></i></a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>No show dates found</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
@if(!empty($dates->all()))
|
||||
<nav style="float: right">
|
||||
<ul class="pagination">
|
||||
<li @if($page == 1) class="disabled" @endif>
|
||||
<a @if($page != 1) href="{{ route('panel.ums', ['page' => ($page - 1)]) }}" @endif aria-label="Previous"><span aria-hidden="true">«</span></a>
|
||||
</li>
|
||||
@for($i = 1; $i <= $pages; $i++)
|
||||
<li @if($i == $page) class="active" @endif>
|
||||
<a @if($i != $page)href="{{ route('panel.ums', ['page' => $i]) }}" @endif><span>{{ $i }}</span></a>
|
||||
</li>
|
||||
@endfor
|
||||
<li @if($page == $pages) class="disabled" @endif>
|
||||
<a @if($page != $pages) href="{{ route('panel.ums', ['page' => ($page + 1)]) }}" @endif aria-label="Next"><span aria-hidden="true">»</span></a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('javascript')
|
||||
<script>
|
||||
const search = "{{ $search }}";
|
||||
const route = "{{ route('panel.shows', ['page' => 1]) }}";
|
||||
$("form#searchForm").submit(function(e) {
|
||||
e.preventDefault();
|
||||
let term = $("form#searchForm input#search").val();
|
||||
if(term === search)
|
||||
return;
|
||||
|
||||
window.location.replace(route + "/" + term);
|
||||
});
|
||||
</script>
|
||||
@endsection
|
28
resources/views/panel/shows/info.blade.php
Normal file
28
resources/views/panel/shows/info.blade.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
@extends('layouts.admin')
|
||||
|
||||
@section('page', 'Show Date Manager')
|
||||
|
||||
@section('content')
|
||||
<div class="col-xs-12 col-lg-6 col-lg-offset-3 col-md-8 col-md-offset-2">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ $show->title }}</h3>
|
||||
<small style="float: right"><a class="btn btn-primary" href="{{ url()->previous() }}">Back</a></small>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
@php($time = strtotime($date->date))
|
||||
<p><strong>ID: #</strong>{{ $show->id }}
|
||||
<br><strong>Title:</strong> {{ $show->title }}
|
||||
<br><strong>Seats:</strong> {{ $filled }}/{{ $show->seats }}
|
||||
<br><strong>Date:</strong> {{ date('d-m-Y', $time) }} at {{ date('H:i', $time) }}</p>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 text-center" style="padding: 15px">
|
||||
<img src="{{ $show->image }}" alt="Image" style="width: 50%; height: auto; border-radius: 10px">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
Reference in a new issue