parent
cc5afc0635
commit
7540a7135f
|
|
@ -10,6 +10,7 @@ use App\Models\School;
|
||||||
use App\Services\Invoice\InvoiceDataService;
|
use App\Services\Invoice\InvoiceDataService;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
|
use function auditionSetting;
|
||||||
use function redirect;
|
use function redirect;
|
||||||
|
|
||||||
class DashboardController extends Controller
|
class DashboardController extends Controller
|
||||||
|
|
@ -76,6 +77,11 @@ class DashboardController extends Controller
|
||||||
if (! Auth::user()->school_id) {
|
if (! Auth::user()->school_id) {
|
||||||
return redirect()->route('dashboard')->with('error', 'You do not have a school to get an invoice for');
|
return redirect()->route('dashboard')->with('error', 'You do not have a school to get an invoice for');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! auditionSetting('invoicing_enabled')) {
|
||||||
|
return redirect()->route('dashboard')->with('error', 'Invoicing is not enabled');
|
||||||
|
}
|
||||||
|
|
||||||
$invoiceData = $this->invoiceService->allData(Auth::user()->school_id);
|
$invoiceData = $this->invoiceService->allData(Auth::user()->school_id);
|
||||||
$school = Auth::user()->school;
|
$school = Auth::user()->school;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,9 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<x-table.th>Name</x-table.th>
|
<x-table.th>Name</x-table.th>
|
||||||
<x-table.th>Total Fees</x-table.th>
|
@if(auditionSetting('invoicing_enabled'))
|
||||||
|
<x-table.th>Total Fees</x-table.th>
|
||||||
|
@endif
|
||||||
<x-table.th>Directors</x-table.th>
|
<x-table.th>Directors</x-table.th>
|
||||||
<x-table.th>Students</x-table.th>
|
<x-table.th>Students</x-table.th>
|
||||||
<x-table.th>Entries</x-table.th>
|
<x-table.th>Entries</x-table.th>
|
||||||
|
|
@ -22,12 +24,15 @@
|
||||||
<x-table.body>
|
<x-table.body>
|
||||||
@foreach($schools as $school)
|
@foreach($schools as $school)
|
||||||
<tr>
|
<tr>
|
||||||
<x-table.td><a href="{{ route('admin.schools.show',$school) }}">{{ $school->name }}</a></x-table.td>
|
<x-table.td><a href="{{ route('admin.schools.show',$school) }}">{{ $school->name }}</a>
|
||||||
<x-table.td>
|
|
||||||
<a href="{{ route('admin.schools.invoice',$school) }}">
|
|
||||||
${{ number_format($schoolTotalFees[$school->id],2) }}
|
|
||||||
</a>
|
|
||||||
</x-table.td>
|
</x-table.td>
|
||||||
|
@if(auditionSetting('invoicing_enabled'))
|
||||||
|
<x-table.td>
|
||||||
|
<a href="{{ route('admin.schools.invoice',$school) }}">
|
||||||
|
${{ number_format($schoolTotalFees[$school->id],2) }}
|
||||||
|
</a>
|
||||||
|
</x-table.td>
|
||||||
|
@endif
|
||||||
<x-table.td>{{ $school->users->count() }}</x-table.td>
|
<x-table.td>{{ $school->users->count() }}</x-table.td>
|
||||||
<x-table.td>{{ $school->students->count() }}</x-table.td>
|
<x-table.td>{{ $school->students->count() }}</x-table.td>
|
||||||
<x-table.td>{{ $school->entries->count() }}</x-table.td>
|
<x-table.td>{{ $school->entries->count() }}</x-table.td>
|
||||||
|
|
|
||||||
|
|
@ -1,44 +1,51 @@
|
||||||
<div x-data="{ open: false }" class="relative">
|
<div x-data="{ open: false }" class="relative">
|
||||||
{{-- <button type="button" class="inline-flex items-center gap-x-1 text-sm font-semibold leading-6 text-gray-900" aria-expanded="false" @on:click=" open = ! open">--}}
|
{{-- <button type="button" class="inline-flex items-center gap-x-1 text-sm font-semibold leading-6 text-gray-900" aria-expanded="false" @on:click=" open = ! open">--}}
|
||||||
|
|
||||||
<button type="button" class="inline-flex items-center gap-x-1 text-white rounded-md px-3 py-2 text-sm font-medium hover:bg-indigo-500 hover:bg-opacity-75" aria-expanded="false" @click=" open = ! open" @click.outside=" open = false">
|
<button type="button"
|
||||||
<span>My Auditions</span>
|
class="inline-flex items-center gap-x-1 text-white rounded-md px-3 py-2 text-sm font-medium hover:bg-indigo-500 hover:bg-opacity-75"
|
||||||
<svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
aria-expanded="false" @click=" open = ! open" @click.outside=" open = false">
|
||||||
<path fill-rule="evenodd" d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z" clip-rule="evenodd" />
|
<span>My Auditions</span>
|
||||||
</svg>
|
<svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||||
</button>
|
<path fill-rule="evenodd"
|
||||||
|
d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"
|
||||||
|
clip-rule="evenodd"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Flyout menu, show/hide based on flyout menu state.
|
Flyout menu, show/hide based on flyout menu state.
|
||||||
|
|
||||||
Entering: "transition ease-out duration-200"
|
Entering: "transition ease-out duration-200"
|
||||||
From: "opacity-0 translate-y-1"
|
From: "opacity-0 translate-y-1"
|
||||||
To: "opacity-100 translate-y-0"
|
To: "opacity-100 translate-y-0"
|
||||||
Leaving: "transition ease-in duration-150"
|
Leaving: "transition ease-in duration-150"
|
||||||
From: "opacity-100 translate-y-0"
|
From: "opacity-100 translate-y-0"
|
||||||
To: "opacity-0 translate-y-1"
|
To: "opacity-0 translate-y-1"
|
||||||
-->
|
-->
|
||||||
<div class="absolute left-1/2 z-10 mt-5 flex w-screen max-w-min -translate-x-1/2 px-4" x-show="open" x-cloak>
|
<div class="absolute left-1/2 z-10 mt-5 flex w-screen max-w-min -translate-x-1/2 px-4" x-show="open" x-cloak>
|
||||||
<div class="w-56 shrink rounded-xl bg-white p-4 text-sm font-semibold leading-6 text-gray-900 shadow-lg ring-1 ring-gray-900/5">
|
<div
|
||||||
<a href="{{route('dashboard')}}" class="block p-2 hover:text-indigo-600">Dashboard</a>
|
class="w-56 shrink rounded-xl bg-white p-4 text-sm font-semibold leading-6 text-gray-900 shadow-lg ring-1 ring-gray-900/5">
|
||||||
@if(Auth::user()->school_id)
|
<a href="{{route('dashboard')}}" class="block p-2 hover:text-indigo-600">Dashboard</a>
|
||||||
<a href="{{route('students.index')}}" class="block p-2 hover:text-indigo-600">My Students</a>
|
@if(Auth::user()->school_id)
|
||||||
<a href="{{route('entries.index')}}" class="block p-2 hover:text-indigo-600">My Entries</a>
|
<a href="{{route('students.index')}}" class="block p-2 hover:text-indigo-600">My Students</a>
|
||||||
<a href="{{route('doubler_request.index')}}" class="block p-2 hover:text-indigo-600">My Doubler Requests</a>
|
<a href="{{route('entries.index')}}" class="block p-2 hover:text-indigo-600">My Entries</a>
|
||||||
<a href="{{route('my_school')}}" class="block p-2 hover:text-indigo-600">My School</a>
|
<a href="{{route('doubler_request.index')}}" class="block p-2 hover:text-indigo-600">My Doubler Requests</a>
|
||||||
<a href="{{route('my_invoice')}}" class="block p-2 hover:text-indigo-600">My Invoice</a>
|
<a href="{{route('my_school')}}" class="block p-2 hover:text-indigo-600">My School</a>
|
||||||
@endif
|
@if(auditionSetting('invoicing_enabled'))
|
||||||
<a href="{{route('my_profile')}}" class="block p-2 hover:text-indigo-600">My Profile</a>
|
<a href="{{route('my_invoice')}}" class="block p-2 hover:text-indigo-600">My Invoice</a>
|
||||||
<form method="POST" action="/logout">
|
@endif
|
||||||
@csrf
|
@endif
|
||||||
<button
|
<a href="{{route('my_profile')}}" class="block p-2 hover:text-indigo-600">My Profile</a>
|
||||||
class="block p-2 hover:text-indigo-600"
|
<form method="POST" action="/logout">
|
||||||
role="menuitem"
|
@csrf
|
||||||
tabindex="-1"
|
<button
|
||||||
id="user-menu-item-2">
|
class="block p-2 hover:text-indigo-600"
|
||||||
Sign out
|
role="menuitem"
|
||||||
</button>
|
tabindex="-1"
|
||||||
</form>
|
id="user-menu-item-2">
|
||||||
|
Sign out
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
My School
|
My School
|
||||||
</x-card.list.row>
|
</x-card.list.row>
|
||||||
</a>
|
</a>
|
||||||
@if(Auth::user()->school_id)
|
@if(Auth::user()->school_id && auditionSetting('invoicing_enabled'))
|
||||||
<a href="{{ route('my_invoice') }}">
|
<a href="{{ route('my_invoice') }}">
|
||||||
<x-card.list.row class="hover:bg-gray-200">
|
<x-card.list.row class="hover:bg-gray-200">
|
||||||
My Invoice
|
My Invoice
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue