🤩 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:leads.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"> {{ __('Lead Review') }} </h2> <span class="inline-flex items-center rounded-full bg-white/10 px-3 py-1 text-sm font-medium text-white"> {{ $leads->count() }} {{ Str::plural('Lead', $leads->count()) }} </span> </div> </x-slot> <div class="py-8"> <div class="mx-auto max-w-7xl sm:px-6 lg:px-8 space-y-6"> {{-- Flash Messages --}} @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 @if (session('error')) <div class="rounded-lg border border-red-200 bg-red-50 p-4"> <div class="flex items-center"> <svg class="h-5 w-5 text-red-500 mr-2" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z" clip-rule="evenodd"/></svg> <p class="text-sm font-medium text-red-800">{{ session('error') }}</p> </div> </div> @endif {{-- Filter Buttons --}} <div class="flex flex-wrap gap-2"> <a href="{{ route('admin.leads') }}" class="px-4 py-2 rounded-lg text-sm font-medium transition {{ !request('filter') ? 'bg-navy text-white' : 'bg-white text-navy border border-gray-200 hover:bg-gray-50' }}"> All Leads </a> <a href="{{ route('admin.leads', ['filter' => 'not_contacted']) }}" class="px-4 py-2 rounded-lg text-sm font-medium transition {{ request('filter') === 'not_contacted' ? 'bg-yellow-500 text-white' : 'bg-white text-yellow-700 border border-yellow-200 hover:bg-yellow-50' }}"> Not Contacted </a> <a href="{{ route('admin.leads', ['filter' => 'contacted']) }}" class="px-4 py-2 rounded-lg text-sm font-medium transition {{ request('filter') === 'contacted' ? 'bg-green-500 text-white' : 'bg-white text-green-700 border border-green-200 hover:bg-green-50' }}"> Contacted </a> <a href="{{ route('admin.leads', ['filter' => 'followed_up']) }}" class="px-4 py-2 rounded-lg text-sm font-medium transition {{ request('filter') === 'followed_up' ? 'bg-blue-500 text-white' : 'bg-white text-blue-700 border border-blue-200 hover:bg-blue-50' }}"> Followed Up </a> <a href="{{ route('admin.leads', ['filter' => 'not_followed_up']) }}" class="px-4 py-2 rounded-lg text-sm font-medium transition {{ request('filter') === 'not_followed_up' ? 'bg-red-500 text-white' : 'bg-white text-red-700 border border-red-200 hover:bg-red-50' }}"> Not Followed Up </a> </div> {{-- Leads Table --}} <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">Leads</h3> </div> <div class="overflow-x-auto"> @if($leads->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">Name</th> <th class="px-6 py-3 text-left text-xs font-semibold uppercase tracking-wider text-gray-500">Contact</th> <th class="px-6 py-3 text-left text-xs font-semibold uppercase tracking-wider text-gray-500">Salesperson</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">Priority</th> <th class="px-6 py-3 text-left text-xs font-semibold uppercase tracking-wider text-gray-500">Updates</th> <th class="px-6 py-3 text-left text-xs font-semibold uppercase tracking-wider text-gray-500">Last Contacted</th> </tr> </thead> <tbody class="divide-y divide-gray-100 bg-white"> @foreach($leads as $lead) <tr class="transition hover:bg-gray-50/50"> <td class="whitespace-nowrap px-6 py-4 text-sm font-medium text-navy"> {{ $lead->name }} </td> <td class="whitespace-nowrap px-6 py-4 text-sm text-gray-600"> @if($lead->email) <a href="mailto:{{ $lead->email }}" class="text-orange hover:text-orange-dark transition block">{{ $lead->email }}</a> @endif @if($lead->phone) <span class="block">{{ $lead->phone }}</span> @endif </td> <td class="whitespace-nowrap px-6 py-4 text-sm text-gray-600"> {{ $lead->salesPerson->name ?? '—' }} </td> <td class="whitespace-nowrap px-6 py-4"> @if($lead->status === 'contacted') <span class="inline-flex items-center rounded-full bg-green-100 px-2.5 py-0.5 text-xs font-semibold text-green-800">Contacted</span> @else <span class="inline-flex items-center rounded-full bg-yellow-100 px-2.5 py-0.5 text-xs font-semibold text-yellow-800">Not Contacted</span> @endif </td> <td class="whitespace-nowrap px-6 py-4"> @php $priorityStyles = [ 'urgent' => 'bg-red-100 text-red-800', 'high' => 'bg-orange-100 text-orange-800', 'medium' => 'bg-blue-100 text-blue-800', 'low' => 'bg-gray-100 text-gray-600', ]; $pStyle = $priorityStyles[$lead->priority] ?? 'bg-gray-100 text-gray-600'; @endphp <span class="inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold {{ $pStyle }}"> {{ ucfirst($lead->priority) }} </span> </td> <td class="px-6 py-4"> @php $updateCount = $lead->updates->count(); $todayUpdates = $lead->updates->where('created_at', '>=', \Carbon\Carbon::today())->count(); @endphp <span class="text-sm text-gray-600">{{ $updateCount }} total</span> @if($todayUpdates > 0) <span class="text-xs text-orange font-semibold ml-1">({{ $todayUpdates }} today)</span> @endif </td> <td class="whitespace-nowrap px-6 py-4 text-sm text-gray-600"> {{ $lead->last_contacted_at ? \Carbon\Carbon::parse($lead->last_contacted_at)->format('M d, Y H:i') : '—' }} </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="M18 18.72a9.094 9.094 0 003.741-.479 3 3 0 00-4.682-2.72m.94 3.198l.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0112 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 016 18.719m12 0a5.971 5.971 0 00-.941-3.197m0 0A5.995 5.995 0 0012 12.75a5.995 5.995 0 00-5.058 2.772m0 0a3 3 0 00-4.681 2.72 8.986 8.986 0 003.74.477m.94-3.197a5.971 5.971 0 00-.94 3.197M15 6.75a3 3 0 11-6 0 3 3 0 016 0zm6 3a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0zm-13.5 0a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0z"/></svg> <h3 class="text-sm font-semibold text-gray-900 mb-1">No leads found</h3> <p class="text-sm text-gray-500">No leads match the selected filter.</p> </div> @endif </div> </div> </div> </div> </x-app-layout>
Save Changes
Cancel
Create New File
Create New Folder