🤩 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:dashboard.blade.php
<x-app-layout> <x-slot name="header"> <div class="flex items-center space-x-3"> <svg class="w-6 h-6 text-orange" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 013 19.875v-6.75zM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V8.625zM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V4.125z" /> </svg> <h2 class="font-semibold text-xl text-navy leading-tight"> {{ __('Sales Dashboard') }} </h2> </div> </x-slot> <div class="py-8"> <div class="max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-8"> {{-- Flash Messages --}} @if (session('success')) <div class="rounded-lg bg-green-50 border border-green-200 p-4"> <div class="flex items-center"> <svg class="h-5 w-5 text-green-500 mr-3 flex-shrink-0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"> <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.06l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" 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 bg-red-50 border border-red-200 p-4"> <div class="flex items-center"> <svg class="h-5 w-5 text-red-500 mr-3 flex-shrink-0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"> <path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd" /> </svg> <p class="text-sm font-medium text-red-800">{{ session('error') }}</p> </div> </div> @endif @if ($errors->any()) <div class="rounded-lg bg-red-50 border border-red-200 p-4"> <div class="flex"> <svg class="h-5 w-5 text-red-500 mr-3 mt-0.5 flex-shrink-0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"> <path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd" /> </svg> <div> <h3 class="text-sm font-medium text-red-800">Please fix the following errors:</h3> <ul class="mt-2 list-disc list-inside text-sm text-red-700 space-y-1"> @foreach ($errors->all() as $error) <li>{{ $error }}</li> @endforeach </ul> </div> </div> </div> @endif {{-- ============================================================= --}} {{-- Stats Cards Row --}} {{-- ============================================================= --}} <div class="grid grid-cols-1 md:grid-cols-3 gap-6"> {{-- Total Leads --}} <div class="bg-white overflow-hidden shadow-sm rounded-lg border border-gray-100"> <div class="p-6"> <div class="flex items-center justify-between"> <div> <p class="text-sm font-medium text-gray-500 uppercase tracking-wide">Total Leads</p> <p class="mt-2 text-3xl font-bold text-navy">{{ $stats['total'] ?? 0 }}</p> </div> <div class="flex-shrink-0 bg-navy/10 rounded-full p-3"> <svg class="w-7 h-7 text-navy" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z" /> </svg> </div> </div> </div> <div class="bg-navy h-1"></div> </div> {{-- Contacted --}} <div class="bg-white overflow-hidden shadow-sm rounded-lg border border-gray-100"> <div class="p-6"> <div class="flex items-center justify-between"> <div> <p class="text-sm font-medium text-gray-500 uppercase tracking-wide">Contacted</p> <p class="mt-2 text-3xl font-bold text-green-600">{{ $stats['contacted'] ?? 0 }}</p> </div> <div class="flex-shrink-0 bg-green-100 rounded-full p-3"> <svg class="w-7 h-7 text-green-600" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /> </svg> </div> </div> </div> <div class="bg-green-500 h-1"></div> </div> {{-- Not Contacted --}} <div class="bg-white overflow-hidden shadow-sm rounded-lg border border-gray-100"> <div class="p-6"> <div class="flex items-center justify-between"> <div> <p class="text-sm font-medium text-gray-500 uppercase tracking-wide">Not Contacted</p> <p class="mt-2 text-3xl font-bold text-yellow-600">{{ $stats['not_contacted'] ?? 0 }}</p> </div> <div class="flex-shrink-0 bg-yellow-100 rounded-full p-3"> <svg class="w-7 h-7 text-yellow-600" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" /> </svg> </div> </div> </div> <div class="bg-yellow-500 h-1"></div> </div> </div> {{-- ============================================================= --}} {{-- Add New Lead Form --}} {{-- ============================================================= --}} <div class="bg-white overflow-hidden shadow-sm rounded-lg border border-gray-100"> <div class="border-b border-gray-100 bg-gradient-to-r from-navy to-navy-dark px-6 py-4"> <h3 class="text-lg font-semibold text-white flex items-center"> <svg class="w-5 h-5 mr-2 text-orange" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" /> </svg> Add New Lead </h3> </div> <form action="{{ route('sales.lead.store') }}" method="POST" class="p-6"> @csrf <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"> {{-- Name --}} <div> <label for="name" class="block text-sm font-medium text-navy mb-1"> Name <span class="text-red-500">*</span> </label> <input type="text" name="name" id="name" required value="{{ old('name') }}" class="w-full rounded-lg border-gray-300 shadow-sm focus:border-orange focus:ring-orange text-sm" placeholder="Lead name"> @error('name') <p class="mt-1 text-xs text-red-600">{{ $message }}</p> @enderror </div> {{-- Phone --}} <div> <label for="phone" class="block text-sm font-medium text-navy mb-1">Phone</label> <input type="text" name="phone" id="phone" value="{{ old('phone') }}" class="w-full rounded-lg border-gray-300 shadow-sm focus:border-orange focus:ring-orange text-sm" placeholder="Phone number"> @error('phone') <p class="mt-1 text-xs text-red-600">{{ $message }}</p> @enderror </div> {{-- Email --}} <div> <label for="email" class="block text-sm font-medium text-navy mb-1">Email</label> <input type="email" name="email" id="email" value="{{ old('email') }}" class="w-full rounded-lg border-gray-300 shadow-sm focus:border-orange focus:ring-orange text-sm" placeholder="Email address"> @error('email') <p class="mt-1 text-xs text-red-600">{{ $message }}</p> @enderror </div> {{-- Priority --}} <div> <label for="priority" class="block text-sm font-medium text-navy mb-1">Priority</label> <select name="priority" id="priority" class="w-full rounded-lg border-gray-300 shadow-sm focus:border-orange focus:ring-orange text-sm"> <option value="low" {{ old('priority') === 'low' ? 'selected' : '' }}>Low</option> <option value="medium" {{ old('priority') === 'medium' ? 'selected' : '' }}>Medium</option> <option value="high" {{ old('priority') === 'high' ? 'selected' : '' }}>High</option> <option value="urgent" {{ old('priority') === 'urgent' ? 'selected' : '' }}>Urgent</option> </select> @error('priority') <p class="mt-1 text-xs text-red-600">{{ $message }}</p> @enderror </div> {{-- Remark 1 --}} <div class="md:col-span-2"> <label for="remark_1" class="block text-sm font-medium text-navy mb-1">Remark</label> <textarea name="remark_1" id="remark_1" rows="3" class="w-full rounded-lg border-gray-300 shadow-sm focus:border-orange focus:ring-orange text-sm" placeholder="Initial remarks or notes about this lead...">{{ old('remark_1') }}</textarea> @error('remark_1') <p class="mt-1 text-xs text-red-600">{{ $message }}</p> @enderror </div> </div> <div class="mt-6 flex justify-end"> <button type="submit" class="inline-flex items-center px-6 py-2.5 bg-orange border border-transparent rounded-lg font-semibold text-sm text-white tracking-wide hover:bg-orange-dark focus:bg-orange-dark active:bg-orange-dark focus:outline-none focus:ring-2 focus:ring-orange focus:ring-offset-2 transition ease-in-out duration-150 shadow-sm"> <svg class="w-4 h-4 mr-2" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" /> </svg> Add Lead </button> </div> </form> </div> {{-- ============================================================= --}} {{-- My Leads Table --}} {{-- ============================================================= --}} <div class="bg-white overflow-hidden shadow-sm rounded-lg border border-gray-100"> <div class="border-b border-gray-100 bg-gradient-to-r from-navy to-navy-dark px-6 py-4"> <h3 class="text-lg font-semibold text-white flex items-center"> <svg class="w-5 h-5 mr-2 text-orange" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M8.25 6.75h12M8.25 12h12m-12 5.25h12M3.75 6.75h.007v.008H3.75V6.75zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zM3.75 12h.007v.008H3.75V12zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm-.375 5.25h.007v.008H3.75v-.008zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z" /> </svg> My Leads <span class="ml-2 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-orange/20 text-orange"> {{ $leads->count() }} </span> </h3> </div> @if($leads->isEmpty()) {{-- Empty State --}} <div class="p-12 text-center"> <div class="mx-auto w-16 h-16 bg-gray-100 rounded-full flex items-center justify-center mb-4"> <svg class="w-8 h-8 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z" /> </svg> </div> <h3 class="text-lg font-medium text-navy mb-1">No leads yet</h3> <p class="text-sm text-gray-500">Get started by adding your first lead using the form above.</p> </div> @else <div class="overflow-x-auto"> <table class="min-w-full divide-y divide-gray-200"> <thead class="bg-gray-50"> <tr> <th scope="col" class="px-4 py-3 text-left text-xs font-semibold text-navy uppercase tracking-wider">Name</th> <th scope="col" class="px-4 py-3 text-left text-xs font-semibold text-navy uppercase tracking-wider">Phone</th> <th scope="col" class="px-4 py-3 text-left text-xs font-semibold text-navy uppercase tracking-wider">Email</th> <th scope="col" class="px-4 py-3 text-left text-xs font-semibold text-navy uppercase tracking-wider">Priority</th> <th scope="col" class="px-4 py-3 text-left text-xs font-semibold text-navy uppercase tracking-wider">Status</th> <th scope="col" class="px-4 py-3 text-left text-xs font-semibold text-navy uppercase tracking-wider">Last Contacted</th> <th scope="col" class="px-4 py-3 text-left text-xs font-semibold text-navy uppercase tracking-wider">Remark 1</th> <th scope="col" class="px-4 py-3 text-left text-xs font-semibold text-navy uppercase tracking-wider">Remark 2</th> <th scope="col" class="px-4 py-3 text-left text-xs font-semibold text-navy uppercase tracking-wider">Actions</th> </tr> </thead> <tbody class="bg-white divide-y divide-gray-100"> @foreach($leads as $lead) <tr class="hover:bg-gray-50/50 transition-colors duration-150"> {{-- Name --}} <td class="px-4 py-3 whitespace-nowrap"> <span class="text-sm font-medium text-navy">{{ $lead->name }}</span> </td> {{-- Phone --}} <td class="px-4 py-3 whitespace-nowrap"> <span class="text-sm text-gray-600">{{ $lead->phone ?? '—' }}</span> </td> {{-- Email --}} <td class="px-4 py-3 whitespace-nowrap"> <span class="text-sm text-gray-600">{{ $lead->email ?? '—' }}</span> </td> {{-- Priority Badge --}} <td class="px-4 py-3 whitespace-nowrap"> @switch($lead->priority) @case('urgent') <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-semibold bg-red-100 text-red-800"> <span class="w-1.5 h-1.5 mr-1.5 rounded-full bg-red-500"></span> Urgent </span> @break @case('high') <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-semibold bg-orange-light text-orange-dark"> <span class="w-1.5 h-1.5 mr-1.5 rounded-full bg-orange"></span> High </span> @break @case('medium') <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-semibold bg-blue-100 text-blue-800"> <span class="w-1.5 h-1.5 mr-1.5 rounded-full bg-blue-500"></span> Medium </span> @break @default <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-semibold bg-gray-100 text-gray-700"> <span class="w-1.5 h-1.5 mr-1.5 rounded-full bg-gray-400"></span> Low </span> @endswitch </td> {{-- Status Badge --}} <td class="px-4 py-3 whitespace-nowrap"> @if($lead->status === 'contacted') <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-semibold bg-green-100 text-green-800"> <span class="w-1.5 h-1.5 mr-1.5 rounded-full bg-green-500"></span> Contacted </span> @else <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-semibold bg-yellow-100 text-yellow-800"> <span class="w-1.5 h-1.5 mr-1.5 rounded-full bg-yellow-500"></span> Not Contacted </span> @endif </td> {{-- Last Contacted At --}} <td class="px-4 py-3 whitespace-nowrap"> <span class="text-sm text-gray-600"> {{ $lead->last_contacted_at ? \Carbon\Carbon::parse($lead->last_contacted_at)->format('M d, Y h:i A') : '—' }} </span> </td> {{-- Remark 1 --}} <td class="px-4 py-3"> <span class="text-sm text-gray-600 max-w-[160px] truncate block" title="{{ $lead->remark_1 }}"> {{ $lead->remark_1 ?? '—' }} </span> </td> {{-- Remark 2 --}} <td class="px-4 py-3"> <span class="text-sm text-gray-600 max-w-[160px] truncate block" title="{{ $lead->remark_2 }}"> {{ $lead->remark_2 ?? '—' }} </span> </td> {{-- Actions --}} <td class="px-4 py-3 whitespace-nowrap"> <button type="button" onclick="toggleUpdateForm('update-form-{{ $lead->id }}')" class="inline-flex items-center px-3 py-1.5 text-xs font-medium rounded-lg border border-navy text-navy hover:bg-navy hover:text-white transition-colors duration-150"> <svg class="w-3.5 h-3.5 mr-1" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10" /> </svg> Update </button> </td> </tr> {{-- Inline Update Form Row --}} <tr id="update-form-{{ $lead->id }}" class="hidden bg-navy/[0.02]"> <td colspan="9" class="px-4 py-4"> <form action="{{ route('sales.lead.update', $lead) }}" method="POST"> @csrf @method('PUT') <div class="bg-white rounded-lg border border-gray-200 shadow-sm p-5"> <div class="flex items-center mb-4"> <svg class="w-4 h-4 text-orange mr-2" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10" /> </svg> <h4 class="text-sm font-semibold text-navy">Update Lead: {{ $lead->name }}</h4> </div> <div class="grid grid-cols-1 md:grid-cols-3 gap-4 items-end"> {{-- Status --}} <div> <label for="status-{{ $lead->id }}" class="block text-sm font-medium text-navy mb-1">Status</label> <select name="status" id="status-{{ $lead->id }}" class="w-full rounded-lg border-gray-300 shadow-sm focus:border-orange focus:ring-orange text-sm"> <option value="not_contacted" {{ $lead->status === 'not_contacted' ? 'selected' : '' }}>Not Contacted</option> <option value="contacted" {{ $lead->status === 'contacted' ? 'selected' : '' }}>Contacted</option> </select> </div> {{-- Remark 2 --}} <div> <label for="remark_2-{{ $lead->id }}" class="block text-sm font-medium text-navy mb-1">Remark 2</label> <textarea name="remark_2" id="remark_2-{{ $lead->id }}" rows="2" class="w-full rounded-lg border-gray-300 shadow-sm focus:border-orange focus:ring-orange text-sm" placeholder="Follow-up notes...">{{ $lead->remark_2 }}</textarea> </div> {{-- Buttons --}} <div class="flex items-center space-x-2"> <button type="submit" class="inline-flex items-center px-4 py-2 bg-orange border border-transparent rounded-lg font-semibold text-xs text-white uppercase tracking-wide hover:bg-orange-dark focus:bg-orange-dark active:bg-orange-dark focus:outline-none focus:ring-2 focus:ring-orange focus:ring-offset-2 transition ease-in-out duration-150 shadow-sm"> <svg class="w-3.5 h-3.5 mr-1.5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5" /> </svg> Update </button> <button type="button" onclick="toggleUpdateForm('update-form-{{ $lead->id }}')" class="inline-flex items-center px-4 py-2 bg-gray-100 border border-gray-300 rounded-lg font-semibold text-xs text-gray-700 uppercase tracking-wide hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2 transition ease-in-out duration-150"> Cancel </button> </div> </div> </div> </form> </td> </tr> @endforeach </tbody> </table> </div> @endif </div> </div> </div> {{-- Toggle Script --}} <script> function toggleUpdateForm(id) { const row = document.getElementById(id); if (row) { row.classList.toggle('hidden'); } } </script> </x-app-layout>
Save Changes
Cancel
Create New File
Create New Folder