🤩 File Manager - Mr.X
PHP:
8.3.33
Server:
Apache
OS:
Linux 5.14.0-611.49.1.el9_7.x86_64
User:
websparkit
Navigate
Upload:
Upload
New File
New Folder
Editing:agreements.blade.php
<x-app-layout> <x-slot name="header"> <div class="flex items-center justify-between"> <h2 class="text-xl font-semibold leading-tight text-white"> {{ __('Agreements') }} </h2> <button onclick="document.getElementById('create-agreement-modal').classList.remove('hidden')" class="inline-flex items-center gap-2 rounded-lg bg-orange px-4 py-2 text-sm font-semibold text-white shadow-sm transition hover:bg-orange-dark"> <svg class="h-4 w-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"/></svg> New Agreement </button> </div> </x-slot> <div class="py-8"> <div class="mx-auto max-w-7xl sm:px-6 lg:px-8 space-y-8"> @if (session('success')) <div class="rounded-lg border border-green-200 bg-green-50 p-4"> <div class="flex items-center"> <svg class="h-5 w-5 text-green-500 mr-2" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/></svg> <p class="text-sm font-medium text-green-800">{{ session('success') }}</p> </div> </div> @endif <div class="overflow-hidden rounded-lg bg-white shadow-sm ring-1 ring-gray-900/5"> <div class="border-b border-gray-100 bg-gray-50/50 px-6 py-4"> <h3 class="text-base font-semibold text-navy">All Agreements</h3> </div> <div class="overflow-x-auto"> @if($agreements->count() > 0) <table class="min-w-full divide-y divide-gray-200"> <thead> <tr class="bg-gray-50"> <th class="px-6 py-3 text-left text-xs font-semibold uppercase tracking-wider text-gray-500">Number</th> <th class="px-6 py-3 text-left text-xs font-semibold uppercase tracking-wider text-gray-500">Client</th> <th class="px-6 py-3 text-left text-xs font-semibold uppercase tracking-wider text-gray-500">Project</th> <th class="px-6 py-3 text-right text-xs font-semibold uppercase tracking-wider text-gray-500">Amount</th> <th class="px-6 py-3 text-left text-xs font-semibold uppercase tracking-wider text-gray-500">Status</th> <th class="px-6 py-3 text-left text-xs font-semibold uppercase tracking-wider text-gray-500">Actions</th> </tr> </thead> <tbody class="divide-y divide-gray-100"> @foreach($agreements as $agreement) <tr class="transition hover:bg-gray-50/50"> <td class="whitespace-nowrap px-6 py-4 text-sm font-medium text-navy">{{ $agreement->agreement_number }}</td> <td class="whitespace-nowrap px-6 py-4 text-sm text-gray-600">{{ $agreement->client_name }}</td> <td class="whitespace-nowrap px-6 py-4 text-sm text-gray-600">{{ $agreement->project->name ?? '—' }}</td> <td class="whitespace-nowrap px-6 py-4 text-right text-sm font-semibold text-navy">Rs{{ number_format($agreement->total_amount, 2) }}</td> <td class="whitespace-nowrap px-6 py-4"> @php $statusColors = [ 'draft' => 'bg-gray-100 text-gray-800', 'sent' => 'bg-blue-100 text-blue-800', 'signed' => 'bg-green-100 text-green-800', 'cancelled' => 'bg-red-100 text-red-800', ]; $color = $statusColors[$agreement->status] ?? 'bg-gray-100 text-gray-800'; @endphp <span class="inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold {{ $color }}"> {{ ucfirst($agreement->status) }} </span> </td> <td class="whitespace-nowrap px-6 py-4"> <a href="{{ route('admin.agreement.show', $agreement) }}" class="text-sm font-medium text-orange hover:text-orange-dark">View</a> @if($agreement->status === 'draft') <form action="{{ route('admin.agreement.send', $agreement) }}" method="POST" class="inline ml-2"> @csrf <button type="submit" class="text-sm font-medium text-green-600 hover:text-green-800">Send</button> </form> @endif </td> </tr> @endforeach </tbody> </table> @else <div class="flex flex-col items-center justify-center py-16 text-center"> <svg class="h-16 w-16 text-gray-300 mb-4" fill="none" stroke="currentColor" stroke-width="1" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"/></svg> <h3 class="text-sm font-semibold text-gray-900 mb-1">No agreements yet</h3> <p class="text-sm text-gray-500">Click "New Agreement" to create your first agreement.</p> </div> @endif </div> </div> </div> </div> {{-- Create Agreement Modal --}} <div id="create-agreement-modal" class="hidden fixed inset-0 bg-gray-600 bg-opacity-50 overflow-y-auto h-full w-full z-50"> <div class="relative top-10 mx-auto p-5 border w-full max-w-3xl shadow-lg rounded-md bg-white"> <div class="flex items-center justify-between mb-4"> <h3 class="text-lg font-semibold text-navy">Create New Agreement</h3> <button onclick="document.getElementById('create-agreement-modal').classList.add('hidden')" class="text-gray-400 hover:text-gray-600"> <svg class="h-6 w-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/></svg> </button> </div> <form action="{{ route('admin.agreement.store') }}" method="POST" class="space-y-4"> @csrf <div class="grid grid-cols-2 gap-4"> <div> <label class="block text-sm font-medium text-gray-700">Client</label> <select name="client_id" id="agreement-client" required class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-orange focus:border-orange" onchange="updateAgreementClientName()"> <option value="">Select Client</option> @foreach($clients as $client) <option value="{{ $client->id }}" data-name="{{ $client->name }}">{{ $client->name }}</option> @endforeach </select> </div> <div> <label class="block text-sm font-medium text-gray-700">Client Name</label> <input type="text" name="client_name" id="agreement-client-name" required class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-orange focus:border-orange"> </div> <div> <label class="block text-sm font-medium text-gray-700">Company Name</label> <input type="text" name="company_name" class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-orange focus:border-orange"> </div> <div> <label class="block text-sm font-medium text-gray-700">Project (Optional)</label> <select name="project_id" class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-orange focus:border-orange"> <option value="">Select Project</option> @foreach($projects as $project) <option value="{{ $project->id }}">{{ $project->name }}</option> @endforeach </select> </div> <div> <label class="block text-sm font-medium text-gray-700">Total Amount (Rs)</label> <input type="number" name="total_amount" step="0.01" min="0" required class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-orange focus:border-orange"> </div> </div> <div> <label class="block text-sm font-medium text-gray-700">Scope of Work</label> <textarea name="scope_of_work" rows="4" class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-orange focus:border-orange" placeholder="Describe the scope of work..."></textarea> </div> <div> <label class="block text-sm font-medium text-gray-700">Terms & Conditions</label> <textarea name="terms_and_conditions" rows="4" class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-orange focus:border-orange" placeholder="Enter terms and conditions..."></textarea> </div> <div> <label class="block text-sm font-medium text-gray-700">Payment Terms</label> <textarea name="payment_terms" rows="3" class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-orange focus:border-orange" placeholder="Payment schedule, milestones, etc."></textarea> </div> <div class="flex justify-end gap-3 pt-4 border-t"> <button type="button" onclick="document.getElementById('create-agreement-modal').classList.add('hidden')" class="px-4 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50">Cancel</button> <button type="submit" class="px-4 py-2 bg-orange text-white rounded-md text-sm font-medium hover:bg-orange-dark">Create Agreement</button> </div> </form> </div> </div> <script> function updateAgreementClientName() { const select = document.getElementById('agreement-client'); const nameInput = document.getElementById('agreement-client-name'); const option = select.options[select.selectedIndex]; if (option.value) { nameInput.value = option.dataset.name; } } </script> </x-app-layout>
Save Changes
Cancel
Create New File
Create New Folder