using colors in coca cola and vuejs tailwind make me 📦 DIGITAL KARNET – FULL SYSTEM OVERVIEW ────────────────────────────────────────────────────────────── 🎯 Our Mission Build a simple, mobile-friendly web app to help merchants: - Register clients digitally - Record credit transactions (buy now, pay later) - Track partial payments - View full credit/payment history per client - Get automated reminders for due dates - Replace the manual Karnet with a reliable, digital system ────────────────────────────────────────────────────────────── 👥 Users The merchant is the primary user of the app: - Logs in with phone number + password - Manages their own client list - Adds credit entries when clients buy on credit - Records payments as clients pay back - Sees financial summaries per client - Gets notified when clients are approaching due dates ────────────────────────────────────────────────────────────── 🧩 FEATURES OVERVIEW 📝 USER MANAGEMENT ┌────────────────────────────┐ │ MERCHANT MANAGEMENT (CRUD)│ ├────────────────────────────┤ │ - Add / Edit / Delete │ │ - View merchant details │ │ - Search / Filter merchants └────────────────────────────┘ ┌────────────────────────────┐ │ CLIENT MANAGEMENT (CRUD) │ ├────────────────────────────┤ │ - Add / Edit / Delete │ │ - View client details │ │ - Search / Filter clients │ └────────────────────────────┘ ┌────────────────────────────┐ │ CREDIT MANAGEMENT (CRUD) │ ├────────────────────────────┤ │ - Assign credit to client │ │ - Amount, Due date │ │ - Description, Status │ │ - Credit history view │ │ - Edit/Delete Credit Detail│ │ - View total credits │ └────────────────────────────┘ ┌────────────────────────────┐ │ PAYMENT TRACKING │ ├────────────────────────────┤ │ - Full / Partial payments │ │ - Link to specific credit │ │ - Calculate balance │ └────────────────────────────┘ ┌────────────────────────────┐ │ NOTIFICATIONS (WhatsApp) │ ├────────────────────────────┤ │ - Auto reminders (e.g. 2d) │ │ - Message templates │ │ - Client phone integration │ └────────────────────────────┘ ────────────────────────────────────────────────────────────── 🧱 DATA MODEL (MYSQL STRUCTURE) 1:M is one to many relationship. ┌────────────┐ ┌────────────┐ ┌────────────┐ │ clients │────1:M─│ credits │────1:M│ payments │ └────────────┘ └────────────┘ └────────────┘ │ │ │ └──────1:M─────┐ │ │ └───────────────────────┬───────────────┘ ▼ notifications Tables & Fields: clients: id, name, phone number, address(optional) credits: id, client_id, amount(total), due_date, description, status payments: id, credit_id, amount, payment_date ────────────────────────────────────────────────────────────────────────────── 🔗 RELATIONAL DATA MODEL – DIGITAL KARNET SYSTEM ┌──────────────────────┐ │ CLIENT │ ├──────────────────────┤ │ id (PK) │ │ name │ │ phone │ │ address │ └──────────────────────┘ │ │ (1 Client) │ ▼ ┌─────────────────────────────┐ │ CREDIT │ ├─────────────────────────────┤ │ id (PK) │ │ client_id (FK → client.id) │ │ amount │ │ due_date │ │ date_created │ │ description │ │ status (active/paid/partial)│ └─────────────────────────────┘ │ │ (1 Credit) │ ┌───────────────────────┐ │ PAYMENT │ ├───────────────────────┤ │ id (PK) │ │ credit_id (FK) │ │ amount │ │ payment_date │ └───────────────────────┘ │ │ (1 Credit) │ ▼ ┌────────────────────────────┐ │ NOTIFICATION │ ├────────────────────────────┤ │ id (PK) │ │ client_id (FK) │ │ credit_id (FK) nanostore id │ │ type │ │ message │→ Message content │ sent_at │ │ delivery_status │ │ read_status (optional) │ │ provider_message_id │ → Twilio or API external ID └────────────────────────────┘ ────────────────────────────────────────────────────────────────────────────── 🧠 Business Rules: ✅ Each client can have multiple credits. ✅ Each credit can have multiple payments. ✅ You can: - Show history per credit - Show total due per client - Automate alerts for unpaid credits 🧮 In General: We will calculate each client’s financial summary by: - Add all credits for client - Subtract total paid - Result = remaining balance If the client made no payments, the balance equals the total credit ────────────────────────────────────────────────────────────── 📘 Example Data Flow for a Client: 👤 CLIENT: Amina El Khattabi (id: 1) just an example, so we can have a better understanding of the data flow → CREDIT (1) - amount: 1000 MAD - due_date: 2025-07-10 - status: partial → PAYMENT 1: 400 MAD on 2025-07-05 → PAYMENT 2: 200 MAD on 2025-07-07 → CREDIT (2) - amount: 500 MAD - due_date: 2025-08-01 - status: unpaid ────────────────────────────────────────────────────────────────────────────── 🖥️ UI FLOW STRUCTURE 1. Home (Clients List) → Add Client → View Client Details 2. Client Profile Page 📄 CLIENT PROFILE PAGE ┌──────────────────────────────────────────────────┐ │ Remaining Balance (Client owes you): 600 MAD │ └──────────────────────────────────────────────────┘ → Button: Add Credit (Add items, price, due date) → Button: → Add Payment (💵 Enter any amount client paid — system auto-deducts from oldest unpaid credits) → Send WhatsApp Reminder 📜 Credit History Table: ┌────────────┬──────────────┬──────────┬────────────┬──────────────┐ │ Date │ Total Price │ Paid │ Status │ More Details │ ├────────────┼──────────────┼──────────┼────────────┼──────────────┤ │ 2025-07-01 │ 120 MAD │ 120 MAD │ ✅ Paid │ 🔍 View │ │ 2025-07-10 │ 80 MAD │ 30 MAD │ ⚠️ Partial │ 🔍 View │ │ 2025-07-14 │ 100 MAD │ 0 MAD │ ❌ Unpaid │ 🔍 View │ └────────────┴──────────────┴──────────┴────────────┴──────────────┘ → Clicking "View" opens a **Credit Details Page** → The merchant can see: - List of products in that credit - Payment history for that credit - Add/Edit/Delete options 3. Add Credit Page → Form: - Description of items bought - Total amount - Due date → Button: Save Credit 4. Payments Page → Enter any amount paid by client → System distributes it across unpaid/partially paid credits → Remaining balances updated accordingly → Credit status updated (Paid / Partial / Unpaid) 5. Notification Settings Page → Set reminder timing (e.g. 2 days before) → View/edit message template ────────────────────────────────────────────────────────────── 🧭 FUTURE IMPROVEMENTS (POST-MVP) 📊 Dashboard & Analytics: - View top debtors ("Who owes me the most?") - See overdue payments - Track total credits vs. payments monthly - Add client reliability indicators 🛒 Product Granularity: - Replace free-text product descriptions with structured product list - Add product catalog (name, price/unit) - Enable future inventory tracking per credit - Prepare for POS integration - Initial Deployment
ab0677f verified Download index.html from ouma01/tryload: direct link, hf CLI and curl.
- Browser
- Download file 80.8 kB
-
https://huggingface.co/spaces/ouma01/tryload/resolve/main/index.html
- Command line
-
hf download hf://spaces/ouma01/tryload/index.html
-
curl -L -o index.html https://huggingface.co/spaces/ouma01/tryload/resolve/main/index.html
80.8 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Digital Karnet - Credit Management System</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/vue@3.2.47/dist/vue.global.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
.coke-red {
background-color: #F40009;
}
.coke-red-text {
color: #F40009;
}
.coke-dark-red {
background-color: #D7000F;
}
.coke-dark-red-text {
color: #D7000F;
}
.coke-white {
background-color: #FFFFFF;
}
.coke-white-text {
color: #FFFFFF;
}
.coke-black {
background-color: #000000;
}
.coke-black-text {
color: #000000;
}
.coke-silver {
background-color: #A7A8AA;
}
.coke-silver-text {
color: #A7A8AA;
}
.sidebar {
transition: all 0.3s ease;
}
.sidebar.collapsed {
width: 70px;
}
.sidebar.collapsed .nav-text {
display: none;
}
.sidebar.collapsed .logo-text {
display: none;
}
.sidebar.collapsed .nav-item {
justify-content: center;
}
.page-enter-active,
.page-leave-active {
transition: opacity 0.2s ease;
}
.page-enter-from,
.page-leave-to {
opacity: 0;
}
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.3s ease;
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
}
.slide-fade-enter-active {
transition: all 0.3s ease-out;
}
.slide-fade-leave-active {
transition: all 0.3s cubic-bezier(1, 0.5, 0.8, 1);
}
.slide-fade-enter-from,
.slide-fade-leave-to {
transform: translateX(20px);
opacity: 0;
}
.status-badge {
padding: 0.25rem 0.5rem;
border-radius: 0.375rem;
font-size: 0.75rem;
font-weight: 600;
text-transform: uppercase;
}
.status-paid {
background-color: #D1FAE5;
color: #065F46;
}
.status-partial {
background-color: #FEF3C7;
color: #92400E;
}
.status-unpaid {
background-color: #FEE2E2;
color: #B91C1C;
}
.scrollbar-hide::-webkit-scrollbar {
display: none;
}
.scrollbar-hide {
-ms-overflow-style: none;
scrollbar-width: none;
}
</style>
</head>
<body class="bg-gray-50">
<div id="app">
<!-- Mobile Sidebar Overlay -->
<div v-if="mobileSidebarOpen" @click="mobileSidebarOpen = false" class="fixed inset-0 z-20 bg-black bg-opacity-50 lg:hidden"></div>
<!-- Sidebar -->
<aside class="sidebar fixed inset-y-0 left-0 z-30 flex flex-col w-64 bg-white border-r border-gray-200 transition-all duration-300 ease-in-out" :class="{ 'collapsed': sidebarCollapsed, '-translate-x-full lg:translate-x-0': !mobileSidebarOpen }">
<!-- Logo -->
<div class="flex items-center justify-between px-4 py-3 border-b border-gray-200">
<div class="flex items-center">
<div class="w-10 h-10 rounded-full coke-red flex items-center justify-center">
<i class="fas fa-receipt text-white text-xl"></i>
</div>
<span class="logo-text ml-3 text-xl font-bold coke-dark-red-text">Digital Karnet</span>
</div>
<button @click="toggleSidebar" class="p-1 rounded-md text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500">
<i class="fas fa-bars"></i>
</button>
</div>
<!-- User Profile -->
<div class="flex items-center px-4 py-3 border-b border-gray-200">
<div class="w-10 h-10 rounded-full bg-gray-300 flex items-center justify-center">
<i class="fas fa-user text-gray-600"></i>
</div>
<div class="ml-3">
<p class="text-sm font-medium text-gray-900">Merchant Name</p>
<p class="text-xs text-gray-500">Premium Account</p>
</div>
</div>
<!-- Navigation -->
<nav class="flex-1 overflow-y-auto">
<div class="px-2 py-4">
<div class="space-y-1">
<router-link to="/" class="nav-item group flex items-center px-2 py-2 text-sm font-medium rounded-md" :class="currentRoute === '/' ? 'bg-red-50 text-red-700' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900'">
<i class="fas fa-home mr-3 flex-shrink-0" :class="currentRoute === '/' ? 'text-red-500' : 'text-gray-400 group-hover:text-gray-500'"></i>
<span class="nav-text">Dashboard</span>
</router-link>
<router-link to="/clients" class="nav-item group flex items-center px-2 py-2 text-sm font-medium rounded-md" :class="currentRoute === '/clients' ? 'bg-red-50 text-red-700' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900'">
<i class="fas fa-users mr-3 flex-shrink-0" :class="currentRoute === '/clients' ? 'text-red-500' : 'text-gray-400 group-hover:text-gray-500'"></i>
<span class="nav-text">Clients</span>
</router-link>
<router-link to="/credits" class="nav-item group flex items-center px-2 py-2 text-sm font-medium rounded-md" :class="currentRoute === '/credits' ? 'bg-red-50 text-red-700' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900'">
<i class="fas fa-file-invoice-dollar mr-3 flex-shrink-0" :class="currentRoute === '/credits' ? 'text-red-500' : 'text-gray-400 group-hover:text-gray-500'"></i>
<span class="nav-text">Credits</span>
</router-link>
<router-link to="/payments" class="nav-item group flex items-center px-2 py-2 text-sm font-medium rounded-md" :class="currentRoute === '/payments' ? 'bg-red-50 text-red-700' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900'">
<i class="fas fa-money-bill-wave mr-3 flex-shrink-0" :class="currentRoute === '/payments' ? 'text-red-500' : 'text-gray-400 group-hover:text-gray-500'"></i>
<span class="nav-text">Payments</span>
</router-link>
<router-link to="/notifications" class="nav-item group flex items-center px-2 py-2 text-sm font-medium rounded-md" :class="currentRoute === '/notifications' ? 'bg-red-50 text-red-700' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900'">
<i class="fas fa-bell mr-3 flex-shrink-0" :class="currentRoute === '/notifications' ? 'text-red-500' : 'text-gray-400 group-hover:text-gray-500'"></i>
<span class="nav-text">Notifications</span>
</router-link>
</div>
<div class="mt-8">
<h3 class="px-3 text-xs font-semibold text-gray-500 uppercase tracking-wider">Reports</h3>
<div class="mt-1 space-y-1">
<router-link to="/reports" class="nav-item group flex items-center px-2 py-2 text-sm font-medium rounded-md" :class="currentRoute === '/reports' ? 'bg-red-50 text-red-700' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900'">
<i class="fas fa-chart-bar mr-3 flex-shrink-0" :class="currentRoute === '/reports' ? 'text-red-500' : 'text-gray-400 group-hover:text-gray-500'"></i>
<span class="nav-text">Analytics</span>
</router-link>
<router-link to="/debtors" class="nav-item group flex items-center px-2 py-2 text-sm font-medium rounded-md" :class="currentRoute === '/debtors' ? 'bg-red-50 text-red-700' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900'">
<i class="fas fa-exclamation-triangle mr-3 flex-shrink-0" :class="currentRoute === '/debtors' ? 'text-red-500' : 'text-gray-400 group-hover:text-gray-500'"></i>
<span class="nav-text">Top Debtors</span>
</router-link>
</div>
</div>
</div>
</nav>
<!-- Bottom Section -->
<div class="px-4 py-3 border-t border-gray-200">
<button @click="logout" class="group flex items-center w-full px-2 py-2 text-sm font-medium text-gray-600 rounded-md hover:bg-gray-50 hover:text-gray-900">
<i class="fas fa-sign-out-alt mr-3 text-gray-400 group-hover:text-gray-500"></i>
<span class="nav-text">Logout</span>
</button>
</div>
</aside>
<!-- Main Content -->
<div class="lg:ml-64 flex flex-col min-h-screen" :class="{ 'lg:ml-20': sidebarCollapsed }">
<!-- Top Navigation -->
<header class="sticky top-0 z-10 flex-shrink-0 flex h-16 bg-white shadow">
<button @click="mobileSidebarOpen = true" class="border-r border-gray-200 px-4 text-gray-500 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-red-500 lg:hidden">
<span class="sr-only">Open sidebar</span>
<i class="fas fa-bars"></i>
</button>
<div class="flex-1 px-4 flex justify-between">
<div class="flex-1 flex">
<div class="flex w-full md:ml-0">
<div class="relative w-full text-gray-400 focus-within:text-gray-600">
<div class="absolute inset-y-0 left-0 flex items-center pointer-events-none">
<i class="fas fa-search"></i>
</div>
<input id="search-field" class="block w-full h-full pl-8 pr-3 py-2 border-transparent text-gray-900 placeholder-gray-500 focus:outline-none focus:placeholder-gray-400 focus:ring-0 focus:border-transparent sm:text-sm" placeholder="Search" type="search" name="search">
</div>
</div>
</div>
<div class="ml-4 flex items-center md:ml-6">
<button type="button" class="bg-white p-1 rounded-full text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500">
<span class="sr-only">View notifications</span>
<i class="fas fa-bell"></i>
</button>
<!-- Profile dropdown -->
<div class="ml-3 relative">
<div>
<button @click="profileDropdownOpen = !profileDropdownOpen" type="button" class="max-w-xs bg-white flex items-center text-sm rounded-full focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500" id="user-menu-button" aria-expanded="false" aria-haspopup="true">
<span class="sr-only">Open user menu</span>
<div class="w-8 h-8 rounded-full bg-gray-300 flex items-center justify-center">
<i class="fas fa-user text-gray-600"></i>
</div>
</button>
</div>
<transition enter-active-class="transition ease-out duration-100" enter-from-class="transform opacity-0 scale-95" enter-to-class="transform opacity-100 scale-100" leave-active-class="transition ease-in duration-75" leave-from-class="transform opacity-100 scale-100" leave-to-class="transform opacity-0 scale-95">
<div v-show="profileDropdownOpen" class="origin-top-right absolute right-0 mt-2 w-48 rounded-md shadow-lg py-1 bg-white ring-1 ring-black ring-opacity-5 focus:outline-none" role="menu" aria-orientation="vertical" aria-labelledby="user-menu-button" tabindex="-1">
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" role="menuitem" tabindex="-1" id="user-menu-item-0">Your Profile</a>
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" role="menuitem" tabindex="-1" id="user-menu-item-1">Settings</a>
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" role="menuitem" tabindex="-1" id="user-menu-item-2">Sign out</a>
</div>
</transition>
</div>
</div>
</div>
</header>
<!-- Page Content -->
<main class="flex-1">
<div class="py-6">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<!-- Page Header -->
<div class="md:flex md:items-center md:justify-between mb-6">
<div class="flex-1 min-w-0">
<h1 class="text-2xl font-bold leading-7 text-gray-900 sm:text-3xl sm:truncate">
<span v-if="currentRoute === '/'">Dashboard</span>
<span v-if="currentRoute === '/clients'">Clients</span>
<span v-if="currentRoute === '/credits'">Credits</span>
<span v-if="currentRoute === '/payments'">Payments</span>
<span v-if="currentRoute === '/notifications'">Notifications</span>
<span v-if="currentRoute === '/reports'">Reports</span>
<span v-if="currentRoute === '/debtors'">Top Debtors</span>
</h1>
</div>
<div class="mt-4 flex md:mt-0 md:ml-4">
<button v-if="currentRoute === '/clients'" @click="showAddClientModal = true" type="button" class="ml-3 inline-flex items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white coke-red hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500">
<i class="fas fa-plus mr-2"></i> Add Client
</button>
<button v-if="currentRoute === '/credits'" @click="showAddCreditModal = true" type="button" class="ml-3 inline-flex items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white coke-red hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500">
<i class="fas fa-plus mr-2"></i> Add Credit
</button>
<button v-if="currentRoute === '/payments'" @click="showAddPaymentModal = true" type="button" class="ml-3 inline-flex items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white coke-red hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500">
<i class="fas fa-plus mr-2"></i> Record Payment
</button>
</div>
</div>
<!-- Router View -->
<div class="bg-white shadow rounded-lg p-6">
<transition name="fade" mode="out-in">
<router-view></router-view>
</transition>
</div>
</div>
</div>
</main>
</div>
<!-- Add Client Modal -->
<div v-if="showAddClientModal" class="fixed z-50 inset-0 overflow-y-auto">
<div class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
<div class="fixed inset-0 transition-opacity" aria-hidden="true">
<div class="absolute inset-0 bg-gray-500 opacity-75"></div>
</div>
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
<div class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full">
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
<div class="sm:flex sm:items-start">
<div class="mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10">
<i class="fas fa-user-plus text-red-600"></i>
</div>
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left">
<h3 class="text-lg leading-6 font-medium text-gray-900">Add New Client</h3>
<div class="mt-2">
<form class="space-y-4">
<div>
<label for="client-name" class="block text-sm font-medium text-gray-700">Full Name</label>
<input type="text" id="client-name" class="mt-1 focus:ring-red-500 focus:border-red-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md">
</div>
<div>
<label for="client-phone" class="block text-sm font-medium text-gray-700">Phone Number</label>
<input type="tel" id="client-phone" class="mt-1 focus:ring-red-500 focus:border-red-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md">
</div>
<div>
<label for="client-address" class="block text-sm font-medium text-gray-700">Address (Optional)</label>
<textarea id="client-address" rows="3" class="mt-1 focus:ring-red-500 focus:border-red-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md"></textarea>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
<button type="button" class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 coke-red text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm">
Save Client
</button>
<button @click="showAddClientModal = false" type="button" class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm">
Cancel
</button>
</div>
</div>
</div>
</div>
<!-- Add Credit Modal -->
<div v-if="showAddCreditModal" class="fixed z-50 inset-0 overflow-y-auto">
<div class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
<div class="fixed inset-0 transition-opacity" aria-hidden="true">
<div class="absolute inset-0 bg-gray-500 opacity-75"></div>
</div>
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
<div class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full">
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
<div class="sm:flex sm:items-start">
<div class="mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10">
<i class="fas fa-file-invoice-dollar text-red-600"></i>
</div>
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left">
<h3 class="text-lg leading-6 font-medium text-gray-900">Add New Credit</h3>
<div class="mt-2">
<form class="space-y-4">
<div>
<label for="credit-client" class="block text-sm font-medium text-gray-700">Client</label>
<select id="credit-client" class="mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-red-500 focus:border-red-500 sm:text-sm rounded-md">
<option>Select a client</option>
<option>Amina El Khattabi</option>
<option>Mohammed Benali</option>
<option>Fatima Zahra</option>
</select>
</div>
<div>
<label for="credit-amount" class="block text-sm font-medium text-gray-700">Amount (MAD)</label>
<input type="number" id="credit-amount" class="mt-1 focus:ring-red-500 focus:border-red-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md">
</div>
<div>
<label for="credit-due-date" class="block text-sm font-medium text-gray-700">Due Date</label>
<input type="date" id="credit-due-date" class="mt-1 focus:ring-red-500 focus:border-red-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md">
</div>
<div>
<label for="credit-description" class="block text-sm font-medium text-gray-700">Description</label>
<textarea id="credit-description" rows="3" class="mt-1 focus:ring-red-500 focus:border-red-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md" placeholder="Items purchased, terms, etc."></textarea>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
<button type="button" class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 coke-red text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm">
Save Credit
</button>
<button @click="showAddCreditModal = false" type="button" class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm">
Cancel
</button>
</div>
</div>
</div>
</div>
<!-- Add Payment Modal -->
<div v-if="showAddPaymentModal" class="fixed z-50 inset-0 overflow-y-auto">
<div class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
<div class="fixed inset-0 transition-opacity" aria-hidden="true">
<div class="absolute inset-0 bg-gray-500 opacity-75"></div>
</div>
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
<div class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full">
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
<div class="sm:flex sm:items-start">
<div class="mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10">
<i class="fas fa-money-bill-wave text-red-600"></i>
</div>
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left">
<h3 class="text-lg leading-6 font-medium text-gray-900">Record Payment</h3>
<div class="mt-2">
<form class="space-y-4">
<div>
<label for="payment-client" class="block text-sm font-medium text-gray-700">Client</label>
<select id="payment-client" class="mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-red-500 focus:border-red-500 sm:text-sm rounded-md">
<option>Select a client</option>
<option>Amina El Khattabi</option>
<option>Mohammed Benali</option>
<option>Fatima Zahra</option>
</select>
</div>
<div>
<label for="payment-amount" class="block text-sm font-medium text-gray-700">Amount (MAD)</label>
<input type="number" id="payment-amount" class="mt-1 focus:ring-red-500 focus:border-red-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md">
</div>
<div>
<label for="payment-date" class="block text-sm font-medium text-gray-700">Payment Date</label>
<input type="date" id="payment-date" class="mt-1 focus:ring-red-500 focus:border-red-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md">
</div>
<div>
<label for="payment-method" class="block text-sm font-medium text-gray-700">Payment Method</label>
<select id="payment-method" class="mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-red-500 focus:border-red-500 sm:text-sm rounded-md">
<option>Cash</option>
<option>Bank Transfer</option>
<option>Mobile Payment</option>
<option>Check</option>
</select>
</div>
<div>
<label for="payment-notes" class="block text-sm font-medium text-gray-700">Notes</label>
<textarea id="payment-notes" rows="2" class="mt-1 focus:ring-red-500 focus:border-red-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md" placeholder="Any additional notes"></textarea>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
<button type="button" class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 coke-red text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm">
Record Payment
</button>
<button @click="showAddPaymentModal = false" type="button" class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm">
Cancel
</button>
</div>
</div>
</div>
</div>
</div>
<script>
const { createApp, ref, computed } = Vue;
// Define routes
const routes = {
'/': {
template: `
<div>
<div class="grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-4 mb-6">
<!-- Total Clients Card -->
<div class="bg-white overflow-hidden shadow rounded-lg">
<div class="px-4 py-5 sm:p-6">
<div class="flex items-center">
<div class="flex-shrink-0 bg-red-500 rounded-md p-3">
<i class="fas fa-users text-white"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dt class="text-sm font-medium text-gray-500 truncate">Total Clients</dt>
<dd class="flex items-baseline">
<div class="text-2xl font-semibold text-gray-900">142</div>
<div class="ml-2 flex items-baseline text-sm font-semibold text-green-600">
<i class="fas fa-arrow-up text-xs"></i>
<span class="sr-only">Increased by</span>
12%
</div>
</dd>
</div>
</div>
</div>
</div>
<!-- Active Credits Card -->
<div class="bg-white overflow-hidden shadow rounded-lg">
<div class="px-4 py-5 sm:p-6">
<div class="flex items-center">
<div class="flex-shrink-0 bg-red-500 rounded-md p-3">
<i class="fas fa-file-invoice-dollar text-white"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dt class="text-sm font-medium text-gray-500 truncate">Active Credits</dt>
<dd class="flex items-baseline">
<div class="text-2xl font-semibold text-gray-900">87</div>
<div class="ml-2 flex items-baseline text-sm font-semibold text-red-600">
<i class="fas fa-arrow-up text-xs"></i>
<span class="sr-only">Increased by</span>
5%
</div>
</dd>
</div>
</div>
</div>
</div>
<!-- Total Outstanding Card -->
<div class="bg-white overflow-hidden shadow rounded-lg">
<div class="px-4 py-5 sm:p-6">
<div class="flex items-center">
<div class="flex-shrink-0 bg-red-500 rounded-md p-3">
<i class="fas fa-money-bill-wave text-white"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dt class="text-sm font-medium text-gray-500 truncate">Total Outstanding</dt>
<dd class="flex items-baseline">
<div class="text-2xl font-semibold text-gray-900">24,560 MAD</div>
<div class="ml-2 flex items-baseline text-sm font-semibold text-green-600">
<i class="fas fa-arrow-down text-xs"></i>
<span class="sr-only">Decreased by</span>
3.2%
</div>
</dd>
</div>
</div>
</div>
</div>
<!-- Overdue Payments Card -->
<div class="bg-white overflow-hidden shadow rounded-lg">
<div class="px-4 py-5 sm:p-6">
<div class="flex items-center">
<div class="flex-shrink-0 bg-red-500 rounded-md p-3">
<i class="fas fa-exclamation-triangle text-white"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dt class="text-sm font-medium text-gray-500 truncate">Overdue Payments</dt>
<dd class="flex items-baseline">
<div class="text-2xl font-semibold text-gray-900">12</div>
<div class="ml-2 flex items-baseline text-sm font-semibold text-red-600">
<i class="fas fa-arrow-up text-xs"></i>
<span class="sr-only">Increased by</span>
2
</div>
</dd>
</div>
</div>
</div>
</div>
</div>
<!-- Recent Activity -->
<div class="bg-white shadow rounded-lg mb-6">
<div class="px-4 py-5 sm:px-6 border-b border-gray-200">
<h3 class="text-lg leading-6 font-medium text-gray-900">Recent Activity</h3>
</div>
<div class="bg-white overflow-hidden">
<ul class="divide-y divide-gray-200">
<li v-for="activity in recentActivities" :key="activity.id" class="px-4 py-4 sm:px-6">
<div class="flex items-center">
<div class="min-w-0 flex-1 flex items-center">
<div class="flex-shrink-0">
<div class="h-10 w-10 rounded-full flex items-center justify-center" :class="activity.type === 'payment' ? 'bg-green-100' : 'bg-red-100'">
<i :class="activity.type === 'payment' ? 'fas fa-money-bill-wave text-green-600' : 'fas fa-file-invoice-dollar text-red-600'"></i>
</div>
</div>
<div class="min-w-0 flex-1 px-4">
<div>
<p class="text-sm font-medium text-gray-900 truncate">{{ activity.client }}</p>
<p class="text-sm text-gray-500 truncate">{{ activity.description }}</p>
</div>
</div>
</div>
<div>
<p class="text-sm font-medium" :class="activity.type === 'payment' ? 'text-green-600' : 'text-red-600'">{{ activity.amount }} MAD</p>
<p class="text-xs text-gray-500">{{ activity.date }}</p>
</div>
</div>
</li>
</ul>
</div>
</div>
<!-- Top Debtors -->
<div class="bg-white shadow rounded-lg">
<div class="px-4 py-5 sm:px-6 border-b border-gray-200">
<h3 class="text-lg leading-6 font-medium text-gray-900">Top Debtors</h3>
</div>
<div class="overflow-hidden">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Client</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Phone</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Total Credit</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Paid</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Balance</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr v-for="debtor in topDebtors" :key="debtor.id" class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10">
<div class="h-10 w-10 rounded-full bg-gray-200 flex items-center justify-center">
<i class="fas fa-user text-gray-600"></i>
</div>
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">{{ debtor.name }}</div>
<div class="text-sm text-gray-500">{{ debtor.lastPayment }}</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ debtor.phone }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ debtor.totalCredit }} MAD</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ debtor.paid }} MAD</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium" :class="debtor.balance > 0 ? 'text-red-600' : 'text-green-600'">{{ debtor.balance }} MAD</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
`,
setup() {
const recentActivities = ref([
{ id: 1, type: 'payment', client: 'Amina El Khattabi', description: 'Payment received', amount: 400, date: '2 hours ago' },
{ id: 2, type: 'credit', client: 'Mohammed Benali', description: 'New credit created', amount: 1200, date: '5 hours ago' },
{ id: 3, type: 'payment', client: 'Fatima Zahra', description: 'Partial payment received', amount: 200, date: '1 day ago' },
{ id: 4, type: 'credit', client: 'Karim Alami', description: 'New credit created', amount: 800, date: '2 days ago' },
{ id: 5, type: 'payment', client: 'Leila Mansouri', description: 'Full payment received', amount: 1500, date: '3 days ago' }
]);
const topDebtors = ref([
{ id: 1, name: 'Amina El Khattabi', phone: '+212 612 345 678', totalCredit: 1500, paid: 600, balance: 900, lastPayment: '5 days ago' },
{ id: 2, name: 'Mohammed Benali', phone: '+212 678 901 234', totalCredit: 2500, paid: 1200, balance: 1300, lastPayment: '2 weeks ago' },
{ id: 3, name: 'Karim Alami', phone: '+212 699 123 456', totalCredit: 1800, paid: 500, balance: 1300, lastPayment: '1 week ago' },
{ id: 4, name: 'Fatima Zahra', phone: '+212 633 456 789', totalCredit: 1200, paid: 400, balance: 800, lastPayment: '3 days ago' },
{ id: 5, name: 'Leila Mansouri', phone: '+212 644 789 012', totalCredit: 2000, paid: 1500, balance: 500, lastPayment: 'Yesterday' }
]);
return { recentActivities, topDebtors };
}
},
'/clients': {
template: `
<div>
<!-- Client Search and Filters -->
<div class="mb-6">
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between">
<div class="relative w-full sm:w-64 mb-4 sm:mb-0">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i class="fas fa-search text-gray-400"></i>
</div>
<input type="text" class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md leading-5 bg-white placeholder-gray-500 focus:outline-none focus:placeholder-gray-400 focus:ring-1 focus:ring-red-500 focus:border-red-500 sm:text-sm" placeholder="Search clients...">
</div>
<div class="flex space-x-3">
<select class="block w-full sm:w-40 pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-red-500 focus:border-red-500 sm:text-sm rounded-md">
<option>All Status</option>
<option>Active</option>
<option>Inactive</option>
</select>
<button class="inline-flex items-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500">
<i class="fas fa-filter mr-2"></i> Filter
</button>
</div>
</div>
</div>
<!-- Clients Table -->
<div class="overflow-hidden border border-gray-200 rounded-lg">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Client</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Phone</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Credits</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Balance</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
<th scope="col" class="relative px-6 py-3">
<span class="sr-only">Actions</span>
</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr v-for="client in clients" :key="client.id" class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10">
<div class="h-10 w-10 rounded-full bg-gray-200 flex items-center justify-center">
<i class="fas fa-user text-gray-600"></i>
</div>
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">{{ client.name }}</div>
<div class="text-sm text-gray-500">{{ client.address }}</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ client.phone }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ client.credits }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium" :class="client.balance > 0 ? 'text-red-600' : 'text-green-600'">{{ client.balance }} MAD</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full" :class="client.status === 'active' ? 'bg-green-100 text-green-800' : 'bg-red-100 text-red-800'">
{{ client.status === 'active' ? 'Active' : 'Inactive' }}
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<button class="text-red-600 hover:text-red-900 mr-3">
<i class="fas fa-eye"></i>
</button>
<button class="text-red-600 hover:text-red-900">
<i class="fas fa-ellipsis-v"></i>
</button>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Pagination -->
<div class="flex items-center justify-between mt-4">
<div class="flex-1 flex justify-between sm:hidden">
<button class="relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50">
Previous
</button>
<button class="ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50">
Next
</button>
</div>
<div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between">
<div>
<p class="text-sm text-gray-700">
Showing
<span class="font-medium">1</span>
to
<span class="font-medium">10</span>
of
<span class="font-medium">42</span>
results
</p>
</div>
<div>
<nav class="relative z-0 inline-flex rounded-md shadow-sm -space-x-px" aria-label="Pagination">
<button class="relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
<span class="sr-only">Previous</span>
<i class="fas fa-chevron-left"></i>
</button>
<button aria-current="page" class="z-10 bg-red-50 border-red-500 text-red-600 relative inline-flex items-center px-4 py-2 border text-sm font-medium">
1
</button>
<button class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium">
2
</button>
<button class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium">
3
</button>
<span class="relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700">
...
</span>
<button class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium">
8
</button>
<button class="relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
<span class="sr-only">Next</span>
<i class="fas fa-chevron-right"></i>
</button>
</nav>
</div>
</div>
</div>
</div>
`,
setup() {
const clients = ref([
{ id: 1, name: 'Amina El Khattabi', phone: '+212 612 345 678', address: 'Casablanca', credits: 2, balance: 900, status: 'active' },
{ id: 2, name: 'Mohammed Benali', phone: '+212 678 901 234', address: 'Rabat', credits: 3, balance: 1300, status: 'active' },
{ id: 3, name: 'Fatima Zahra', phone: '+212 633 456 789', address: 'Marrakech', credits: 1, balance: 800, status: 'active' },
{ id: 4, name: 'Karim Alami', phone: '+212 699 123 456', address: 'Tangier', credits: 2, balance: 1300, status: 'active' },
{ id: 5, name: 'Leila Mansouri', phone: '+212 644 789 012', address: 'Fes', credits: 1, balance: 500, status: 'active' },
{ id: 6, name: 'Youssef Chraibi', phone: '+212 655 234 567', address: 'Agadir', credits: 0, balance: 0, status: 'inactive' },
{ id: 7, name: 'Nadia Bensaid', phone: '+212 677 890 123', address: 'Meknes', credits: 2, balance: 750, status: 'active' },
{ id: 8, name: 'Hassan El Fassi', phone: '+212 622 345 678', address: 'Oujda', credits: 1, balance: 400, status: 'active' },
{ id: 9, name: 'Samira Khouribga', phone: '+212 688 901 234', address: 'Khouribga', credits: 0, balance: 0, status: 'inactive' },
{ id: 10, name: 'Omar Tazi', phone: '+212 611 234 567', address: 'Tetouan', credits: 3, balance: 1500, status: 'active' }
]);
return { clients };
}
},
'/credits': {
template: `
<div>
<!-- Credit Search and Filters -->
<div class="mb-6">
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between">
<div class="relative w-full sm:w-64 mb-4 sm:mb-0">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i class="fas fa-search text-gray-400"></i>
</div>
<input type="text" class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md leading-5 bg-white placeholder-gray-500 focus:outline-none focus:placeholder-gray-400 focus:ring-1 focus:ring-red-500 focus:border-red-500 sm:text-sm" placeholder="Search credits...">
</div>
<div class="flex space-x-3">
<select class="block w-full sm:w-40 pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-red-500 focus:border-red-500 sm:text-sm rounded-md">
<option>All Status</option>
<option>Paid</option>
<option>Partial</option>
<option>Unpaid</option>
</select>
<select class="block w-full sm:w-40 pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-red-500 focus:border-red-500 sm:text-sm rounded-md">
<option>All Clients</option>
<option>Amina El Khattabi</option>
<option>Mohammed Benali</option>
<option>Fatima Zahra</option>
</select>
<button class="inline-flex items-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500">
<i class="fas fa-filter mr-2"></i> Filter
</button>
</div>
</div>
</div>
<!-- Credits Table -->
<div class="overflow-hidden border border-gray-200 rounded-lg">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Client</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Amount</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Due Date</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Paid</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
<th scope="col" class="relative px-6 py-3">
<span class="sr-only">Actions</span>
</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr v-for="credit in credits" :key="credit.id" class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10">
<div class="h-10 w-10 rounded-full bg-gray-200 flex items-center justify-center">
<i class="fas fa-user text-gray-600"></i>
</div>
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">{{ credit.client }}</div>
<div class="text-sm text-gray-500">{{ credit.phone }}</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">{{ credit.amount }} MAD</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ credit.dueDate }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ credit.paid }} MAD</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="status-badge" :class="credit.status === 'paid' ? 'status-paid' : credit.status === 'partial' ? 'status-partial' : 'status-unpaid'">
{{ credit.status === 'paid' ? 'Paid' : credit.status === 'partial' ? 'Partial' : 'Unpaid' }}
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<button class="text-red-600 hover:text-red-900 mr-3">
<i class="fas fa-eye"></i>
</button>
<button class="text-red-600 hover:text-red-900">
<i class="fas fa-ellipsis-v"></i>
</button>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Pagination -->
<div class="flex items-center justify-between mt-4">
<div class="flex-1 flex justify-between sm:hidden">
<button class="relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50">
Previous
</button>
<button class="ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50">
Next
</button>
</div>
<div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between">
<div>
<p class="text-sm text-gray-700">
Showing
<span class="font-medium">1</span>
to
<span class="font-medium">10</span>
of
<span class="font-medium">87</span>
results
</p>
</div>
<div>
<nav class="relative z-0 inline-flex rounded-md shadow-sm -space-x-px" aria-label="Pagination">
<button class="relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
<span class="sr-only">Previous</span>
<i class="fas fa-chevron-left"></i>
</button>
<button aria-current="page" class="z-10 bg-red-50 border-red-500 text-red-600 relative inline-flex items-center px-4 py-2 border text-sm font-medium">
1
</button>
<button class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium">
2
</button>
<button class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium">
3
</button>
<span class="relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700">
...
</span>
<button class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium">
9
</button>
<button class="relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
<span class="sr-only">Next</span>
<i class="fas fa-chevron-right"></i>
</button>
</nav>
</div>
</div>
</div>
</div>
`,
setup() {
const credits = ref([
{ id: 1, client: 'Amina El Khattabi', phone: '+212 612 345 678', amount: 1000, dueDate: '2025-07-10', paid: 600, status: 'partial' },
{ id: 2, client: 'Mohammed Benali', phone: '+212 678 901 234', amount: 2500, dueDate: '2025-08-15', paid: 1200, status: 'partial' },
{ id: 3, client: 'Fatima Zahra', phone: '+212 633 456 789', amount: 1200, dueDate: '2025-06-30', paid: 400, status: 'partial' },
{ id: 4, client: 'Karim Alami', phone: '+212 699 123 456', amount: 1800, dueDate: '2025-07-25', paid: 500, status: 'partial' },
{ id: 5, client: 'Leila Mansouri', phone: '+212 644 789 012', amount: 2000, dueDate: '2025-05-20', paid: 2000, status: 'paid' },
{ id: 6, client: 'Youssef Chraibi', phone: '+212 655 234 567', amount: 800, dueDate: '2025-09-05', paid: 0, status: 'unpaid' },
{ id: 7, client: 'Nadia Bensaid', phone: '+212 677 890 123', amount: 1500, dueDate: '2025-07-18', paid: 750, status: 'partial' },
{ id: 8, client: 'Hassan El Fassi', phone: '+212 622 345 678', amount: 400, dueDate: '2025-06-10', paid: 0, status: 'unpaid' },
{ id: 9, client: 'Samira Khouribga', phone: '+212 688 901 234', amount: 1200, dueDate: '2025-08-22', paid: 1200, status: 'paid' },
{ id: 10, client: 'Omar Tazi', phone: '+212 611 234 567', amount: 3000, dueDate: '2025-07-05', paid: 1500, status: 'partial' }
]);
return { credits };
}
},
'/payments': {
template: `
<div>
<!-- Payment Search and Filters -->
<div class="mb-6">
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between">
<div class="relative w-full sm:w-64 mb-4 sm:mb-0">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i class="fas fa-search text-gray-400"></i>
</div>
<input type="text" class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md leading-5 bg-white placeholder-gray-500 focus:outline-none focus:placeholder-gray-400 focus:ring-1 focus:ring-red-500 focus:border-red-500 sm:text-sm" placeholder="Search payments...">
</div>
<div class="flex space-x-3">
<select class="block w-full sm:w-40 pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-red-500 focus:border-red-500 sm:text-sm rounded-md">
<option>All Methods</option>
<option>Cash</option>
<option>Bank Transfer</option>
<option>Mobile Payment</option>
</select>
<select class="block w-full sm:w-40 pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-red-500 focus:border-red-500 sm:text-sm rounded-md">
<option>All Clients</option>
<option>Amina El Khattabi</option>
<option>Mohammed Benali</option>
<option>Fatima Zahra</option>
</select>
<button class="inline-flex items-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500">
<i class="fas fa-filter mr-2"></i> Filter
</button>
</div>
</div>
</div>
<!-- Payments Table -->
<div class="overflow-hidden border border-gray-200 rounded-lg">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Client</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Amount</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Method</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Credit</th>
<th scope="col" class="relative px-6 py-3">
<span class="sr-only">Actions</span>
</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr v-for="payment in payments" :key="payment.id" class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10">
<div class="h-10 w-10 rounded-full bg-gray-200 flex items-center justify-center">
<i class="fas fa-user text-gray-600"></i>
</div>
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">{{ payment.client }}</div>
<div class="text-sm text-gray-500">{{ payment.phone }}</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-green-600">{{ payment.amount }} MAD</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ payment.date }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-100 text-blue-800">
{{ payment.method }}
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-900">{{ payment.creditAmount }} MAD</div>
<div class="text-sm text-gray-500">Due {{ payment.dueDate }}</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<button class="text-red-600 hover:text-red-900 mr-3">
<i class="fas fa-eye"></i>
</button>
<button class="text-red-600 hover:text-red-900">
<i class="fas fa-ellipsis-v"></i>
</button>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Pagination -->
<div class="flex items-center justify-between mt-4">
<div class="flex-1 flex justify-between sm:hidden">
<button class="relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50">
Previous
</button>
<button class="ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50">
Next
</button>
</div>
<div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between">
<div>
<p class="text-sm text-gray-700">
Showing
<span class="font-medium">1</span>
to
<span class="font-medium">10</span>
of
<span class="font-medium">124</span>
results
</p>
</div>
<div>
<nav class="relative z-0 inline-flex rounded-md shadow-sm -space-x-px" aria-label="Pagination">
<button class="relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
<span class="sr-only">Previous</span>
<i class="fas fa-chevron-left"></i>
</button>
<button aria-current="page" class="z-10
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=ouma01/tryload" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Digital Karnet - Credit Management System</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/vue@3.2.47/dist/vue.global.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
.coke-red {
background-color: #F40009;
}
.coke-red-text {
color: #F40009;
}
.coke-dark-red {
background-color: #D7000F;
}
.coke-dark-red-text {
color: #D7000F;
}
.coke-white {
background-color: #FFFFFF;
}
.coke-white-text {
color: #FFFFFF;
}
.coke-black {
background-color: #000000;
}
.coke-black-text {
color: #000000;
}
.coke-silver {
background-color: #A7A8AA;
}
.coke-silver-text {
color: #A7A8AA;
}
.sidebar {
transition: all 0.3s ease;
}
.sidebar.collapsed {
width: 70px;
}
.sidebar.collapsed .nav-text {
display: none;
}
.sidebar.collapsed .logo-text {
display: none;
}
.sidebar.collapsed .nav-item {
justify-content: center;
}
.page-enter-active,
.page-leave-active {
transition: opacity 0.2s ease;
}
.page-enter-from,
.page-leave-to {
opacity: 0;
}
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.3s ease;
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
}
.slide-fade-enter-active {
transition: all 0.3s ease-out;
}
.slide-fade-leave-active {
transition: all 0.3s cubic-bezier(1, 0.5, 0.8, 1);
}
.slide-fade-enter-from,
.slide-fade-leave-to {
transform: translateX(20px);
opacity: 0;
}
.status-badge {
padding: 0.25rem 0.5rem;
border-radius: 0.375rem;
font-size: 0.75rem;
font-weight: 600;