|
| 1 | +<div class="h-full flex flex-col bg-white dark:bg-gray-800 relative overflow-hidden"> |
| 2 | + <div class="flex flex-col md:flex-row items-center justify-between space-y-3 md:space-y-0 md:space-x-4 p-4"> |
| 3 | + <div class="w-full md:w-1/2"> |
| 4 | + <label for="company" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Select |
| 5 | + Company</label> |
| 6 | + <select wire:model.live="selectedCompanyId" id="company" |
| 7 | + class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 sm:text-sm dark:bg-gray-700 dark:border-gray-600 dark:text-white"> |
| 8 | + <option value="">-- Choose a company --</option> |
| 9 | + @foreach ($companies as $company) |
| 10 | + <option value="{{ $company->id }}">{{ $company->name }}</option> |
| 11 | + @endforeach |
| 12 | + </select> |
| 13 | + </div> |
| 14 | + </div> |
| 15 | + |
| 16 | + <table class="w-full h-fit text-sm text-left text-gray-500 dark:text-gray-400 mt-4" wire:loading.class="opacity-50"> |
| 17 | + <thead class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400"> |
| 18 | + <tr> |
| 19 | + <th class="px-4 py-3">Service</th> |
| 20 | + <th class="px-4 py-3">Provider</th> |
| 21 | + <th class="px-4 py-3">Budget (€)</th> |
| 22 | + <th class="px-4 py-3">Next Due</th> |
| 23 | + <th class="px-4 py-3">Status</th> |
| 24 | + </tr> |
| 25 | + </thead> |
| 26 | + <tbody> |
| 27 | + @forelse ($contracts as $contract) |
| 28 | + <tr class="border-b dark:border-gray-700"> |
| 29 | + <td class="px-4 py-2">{{ $contract->category->name }}</td> |
| 30 | + <td class="px-4 py-2">{{ $contract->provider->name }}</td> |
| 31 | + <td class="px-4 py-2 font-medium text-green-600">€{{ number_format($contract->budget, 2) }}</td> |
| 32 | + <td class="px-4 py-2">{{ $contract->next_due_date ?? '—' }}</td> |
| 33 | + <td class="px-4 py-2 capitalize">{{ $contract->status }}</td> |
| 34 | + </tr> |
| 35 | + @empty |
| 36 | + <tr> |
| 37 | + <td colspan="5" class="px-4 py-4 text-center text-sm text-gray-500 dark:text-gray-300"> |
| 38 | + No contracts available. |
| 39 | + </td> |
| 40 | + </tr> |
| 41 | + @endforelse |
| 42 | + </tbody> |
| 43 | + <tfoot> |
| 44 | + <tr class="border-t dark:border-gray-700"> |
| 45 | + <td colspan="2" class="px-4 py-2 text-right font-semibold text-gray-700 dark:text-gray-300">Total |
| 46 | + </td> |
| 47 | + <td class="px-4 py-2 font-bold text-green-700 dark:text-green-400"> |
| 48 | + €{{ number_format(collect($contracts)->sum('budget'), 2) }} |
| 49 | + </td> |
| 50 | + <td colspan="2"></td> |
| 51 | + </tr> |
| 52 | + </tfoot> |
| 53 | + </table> |
| 54 | +</div> |
0 commit comments