Download index.html from atchara/b1: direct link, hf CLI and curl.
- Browser
- Download file 71.8 kB
-
https://huggingface.co/spaces/atchara/b1/resolve/main/index.html
- Command line
-
hf download hf://spaces/atchara/b1/index.html
-
curl -L -o index.html https://huggingface.co/spaces/atchara/b1/resolve/main/index.html
71.8 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Master Data Management</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
.slide-in {
animation: slideIn 0.3s forwards;
}
.slide-out {
animation: slideOut 0.3s forwards;
}
@keyframes slideIn {
from { transform: translateX(100%); opacity: 0; }
to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOut {
from { transform: translateX(0); opacity: 1; }
to { transform: translateX(100%); opacity: 0; }
}
.fade-in {
animation: fadeIn 0.3s forwards;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
</style>
</head>
<body class="bg-gray-100 font-sans">
<div class="min-h-screen flex flex-col">
<!-- Header -->
<header class="bg-indigo-600 text-white shadow-lg">
<div class="container mx-auto px-4 py-4 flex justify-between items-center">
<h1 class="text-2xl font-bold">Master Data Management</h1>
<div class="flex items-center space-x-4">
<button id="theme-toggle" class="p-2 rounded-full hover:bg-indigo-500">
<i class="fas fa-moon"></i>
</button>
<div class="relative">
<button class="p-2 rounded-full hover:bg-indigo-500">
<i class="fas fa-bell"></i>
</button>
<span class="absolute top-0 right-0 h-2 w-2 rounded-full bg-red-500"></span>
</div>
</div>
</div>
</header>
<!-- Main Content -->
<main class="flex-1 container mx-auto px-4 py-6">
<div class="flex flex-col lg:flex-row gap-6">
<!-- Sidebar -->
<aside class="w-full lg:w-64 bg-white rounded-lg shadow-md p-4">
<nav>
<ul class="space-y-2">
<li>
<button data-tab="dashboard" class="tab-btn w-full text-left px-4 py-2 rounded hover:bg-indigo-50 text-indigo-600 font-medium">
<i class="fas fa-tachometer-alt mr-2"></i> Dashboard
</button>
</li>
<li>
<button data-tab="employee" class="tab-btn w-full text-left px-4 py-2 rounded hover:bg-indigo-50 font-medium">
<i class="fas fa-users mr-2"></i> Employees
</button>
</li>
<li>
<button data-tab="vendor" class="tab-btn w-full text-left px-4 py-2 rounded hover:bg-indigo-50 font-medium">
<i class="fas fa-truck mr-2"></i> Vendors
</button>
</li>
<li>
<button data-tab="customer" class="tab-btn w-full text-left px-4 py-2 rounded hover:bg-indigo-50 font-medium">
<i class="fas fa-user-tie mr-2"></i> Customers
</button>
</li>
<li>
<button data-tab="service" class="tab-btn w-full text-left px-4 py-2 rounded hover:bg-indigo-50 font-medium">
<i class="fas fa-cogs mr-2"></i> Services
</button>
</li>
</ul>
</nav>
</aside>
<!-- Content Area -->
<div class="flex-1">
<!-- Dashboard (Default View) -->
<div id="dashboard" class="tab-content bg-white rounded-lg shadow-md p-6">
<div class="flex justify-between items-center mb-6">
<h2 class="text-xl font-bold text-gray-800">Dashboard Overview</h2>
<div class="flex space-x-2">
<button class="px-3 py-1 bg-indigo-100 text-indigo-600 rounded-md text-sm">Today</button>
<button class="px-3 py-1 bg-gray-100 text-gray-600 rounded-md text-sm">Week</button>
<button class="px-3 py-1 bg-gray-100 text-gray-600 rounded-md text-sm">Month</button>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
<div class="bg-indigo-50 p-4 rounded-lg">
<div class="flex justify-between items-center">
<div>
<p class="text-sm text-indigo-600">Employees</p>
<h3 class="text-2xl font-bold">124</h3>
</div>
<div class="p-3 bg-indigo-100 rounded-full">
<i class="fas fa-users text-indigo-600"></i>
</div>
</div>
<p class="text-xs text-green-600 mt-2"><i class="fas fa-arrow-up mr-1"></i> 12% from last month</p>
</div>
<div class="bg-blue-50 p-4 rounded-lg">
<div class="flex justify-between items-center">
<div>
<p class="text-sm text-blue-600">Vendors</p>
<h3 class="text-2xl font-bold">42</h3>
</div>
<div class="p-3 bg-blue-100 rounded-full">
<i class="fas fa-truck text-blue-600"></i>
</div>
</div>
<p class="text-xs text-green-600 mt-2"><i class="fas fa-arrow-up mr-1"></i> 5% from last month</p>
</div>
<div class="bg-purple-50 p-4 rounded-lg">
<div class="flex justify-between items-center">
<div>
<p class="text-sm text-purple-600">Customers</p>
<h3 class="text-2xl font-bold">356</h3>
</div>
<div class="p-3 bg-purple-100 rounded-full">
<i class="fas fa-user-tie text-purple-600"></i>
</div>
</div>
<p class="text-xs text-green-600 mt-2"><i class="fas fa-arrow-up mr-1"></i> 23% from last month</p>
</div>
<div class="bg-green-50 p-4 rounded-lg">
<div class="flex justify-between items-center">
<div>
<p class="text-sm text-green-600">Services</p>
<h3 class="text-2xl font-bold">18</h3>
</div>
<div class="p-3 bg-green-100 rounded-full">
<i class="fas fa-cogs text-green-600"></i>
</div>
</div>
<p class="text-xs text-red-600 mt-2"><i class="fas fa-arrow-down mr-1"></i> 2% from last month</p>
</div>
</div>
<div class="bg-white border border-gray-200 rounded-lg p-4 mb-6">
<h3 class="font-medium mb-3">Recent Activities</h3>
<div class="space-y-3">
<div class="flex items-start">
<div class="p-2 bg-indigo-100 rounded-full mr-3">
<i class="fas fa-user-plus text-indigo-600 text-sm"></i>
</div>
<div>
<p class="text-sm">New employee <span class="font-medium">John Doe</span> added</p>
<p class="text-xs text-gray-500">2 hours ago</p>
</div>
</div>
<div class="flex items-start">
<div class="p-2 bg-blue-100 rounded-full mr-3">
<i class="fas fa-edit text-blue-600 text-sm"></i>
</div>
<div>
<p class="text-sm">Vendor <span class="font-medium">Tech Solutions</span> updated</p>
<p class="text-xs text-gray-500">5 hours ago</p>
</div>
</div>
<div class="flex items-start">
<div class="p-2 bg-purple-100 rounded-full mr-3">
<i class="fas fa-user-tie text-purple-600 text-sm"></i>
</div>
<div>
<p class="text-sm">New customer <span class="font-medium">ABC Corp</span> registered</p>
<p class="text-xs text-gray-500">1 day ago</p>
</div>
</div>
</div>
</div>
</div>
<!-- Employee Management -->
<div id="employee" class="tab-content hidden bg-white rounded-lg shadow-md p-6">
<div class="flex justify-between items-center mb-6">
<h2 class="text-xl font-bold text-gray-800">Employee Management</h2>
<button id="add-employee-btn" class="px-4 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700 flex items-center">
<i class="fas fa-plus mr-2"></i> Add Employee
</button>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">ID</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Name</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Position</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Department</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200" id="employee-table-body">
<!-- Employee data will be inserted here by JavaScript -->
</tbody>
</table>
</div>
</div>
<!-- Vendor Management -->
<div id="vendor" class="tab-content hidden bg-white rounded-lg shadow-md p-6">
<div class="flex justify-between items-center mb-6">
<h2 class="text-xl font-bold text-gray-800">Vendor Management</h2>
<button id="add-vendor-btn" class="px-4 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700 flex items-center">
<i class="fas fa-plus mr-2"></i> Add Vendor
</button>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">ID</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Name</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Contact</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Products</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Rating</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200" id="vendor-table-body">
<!-- Vendor data will be inserted here by JavaScript -->
</tbody>
</table>
</div>
</div>
<!-- Customer Management -->
<div id="customer" class="tab-content hidden bg-white rounded-lg shadow-md p-6">
<div class="flex justify-between items-center mb-6">
<h2 class="text-xl font-bold text-gray-800">Customer Management</h2>
<button id="add-customer-btn" class="px-4 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700 flex items-center">
<i class="fas fa-plus mr-2"></i> Add Customer
</button>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">ID</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Name</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Company</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Email</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Value</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200" id="customer-table-body">
<!-- Customer data will be inserted here by JavaScript -->
</tbody>
</table>
</div>
</div>
<!-- Service Management -->
<div id="service" class="tab-content hidden bg-white rounded-lg shadow-md p-6">
<div class="flex justify-between items-center mb-6">
<h2 class="text-xl font-bold text-gray-800">Service Management</h2>
<button id="add-service-btn" class="px-4 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700 flex items-center">
<i class="fas fa-plus mr-2"></i> Add Service
</button>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">ID</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Name</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Category</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Price</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Duration</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200" id="service-table-body">
<!-- Service data will be inserted here by JavaScript -->
</tbody>
</table>
</div>
</div>
</div>
</div>
</main>
<!-- Form Modal (Hidden by default) -->
<div id="form-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<div class="bg-white rounded-lg shadow-xl w-full max-w-2xl max-h-screen overflow-y-auto slide-in">
<div class="p-6">
<div class="flex justify-between items-center mb-4">
<h3 id="form-title" class="text-xl font-bold text-gray-800">Add New Record</h3>
<button id="close-modal" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<form id="data-form" class="space-y-4">
<input type="hidden" id="record-id">
<input type="hidden" id="record-type">
<!-- Employee Form Fields -->
<div id="employee-fields" class="hidden">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label for="emp-name" class="block text-sm font-medium text-gray-700">Full Name</label>
<input type="text" id="emp-name" name="emp-name" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
</div>
<div>
<label for="emp-email" class="block text-sm font-medium text-gray-700">Email</label>
<input type="email" id="emp-email" name="emp-email" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label for="emp-phone" class="block text-sm font-medium text-gray-700">Phone</label>
<input type="tel" id="emp-phone" name="emp-phone" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
</div>
<div>
<label for="emp-position" class="block text-sm font-medium text-gray-700">Position</label>
<input type="text" id="emp-position" name="emp-position" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label for="emp-department" class="block text-sm font-medium text-gray-700">Department</label>
<select id="emp-department" name="emp-department" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
<option value="">Select Department</option>
<option value="IT">IT</option>
<option value="HR">HR</option>
<option value="Finance">Finance</option>
<option value="Marketing">Marketing</option>
<option value="Operations">Operations</option>
</select>
</div>
<div>
<label for="emp-status" class="block text-sm font-medium text-gray-700">Status</label>
<select id="emp-status" name="emp-status" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
<option value="Active">Active</option>
<option value="Inactive">Inactive</option>
<option value="On Leave">On Leave</option>
</select>
</div>
</div>
<div>
<label for="emp-address" class="block text-sm font-medium text-gray-700">Address</label>
<textarea id="emp-address" name="emp-address" rows="3" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500"></textarea>
</div>
</div>
<!-- Vendor Form Fields -->
<div id="vendor-fields" class="hidden">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label for="vendor-name" class="block text-sm font-medium text-gray-700">Vendor Name</label>
<input type="text" id="vendor-name" name="vendor-name" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
</div>
<div>
<label for="vendor-contact" class="block text-sm font-medium text-gray-700">Contact Person</label>
<input type="text" id="vendor-contact" name="vendor-contact" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label for="vendor-email" class="block text-sm font-medium text-gray-700">Email</label>
<input type="email" id="vendor-email" name="vendor-email" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
</div>
<div>
<label for="vendor-phone" class="block text-sm font-medium text-gray-700">Phone</label>
<input type="tel" id="vendor-phone" name="vendor-phone" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
</div>
</div>
<div>
<label for="vendor-products" class="block text-sm font-medium text-gray-700">Products/Services</label>
<textarea id="vendor-products" name="vendor-products" rows="3" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500"></textarea>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label for="vendor-rating" class="block text-sm font-medium text-gray-700">Rating (1-5)</label>
<select id="vendor-rating" name="vendor-rating" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
<option value="1">1 - Poor</option>
<option value="2">2 - Fair</option>
<option value="3">3 - Good</option>
<option value="4">4 - Very Good</option>
<option value="5">5 - Excellent</option>
</select>
</div>
<div>
<label for="vendor-status" class="block text-sm font-medium text-gray-700">Status</label>
<select id="vendor-status" name="vendor-status" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
<option value="Active">Active</option>
<option value="Inactive">Inactive</option>
<option value="On Hold">On Hold</option>
</select>
</div>
</div>
</div>
<!-- Customer Form Fields -->
<div id="customer-fields" class="hidden">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label for="customer-name" class="block text-sm font-medium text-gray-700">Customer Name</label>
<input type="text" id="customer-name" name="customer-name" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
</div>
<div>
<label for="customer-company" class="block text-sm font-medium text-gray-700">Company</label>
<input type="text" id="customer-company" name="customer-company" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label for="customer-email" class="block text-sm font-medium text-gray-700">Email</label>
<input type="email" id="customer-email" name="customer-email" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
</div>
<div>
<label for="customer-phone" class="block text-sm font-medium text-gray-700">Phone</label>
<input type="tel" id="customer-phone" name="customer-phone" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label for="customer-value" class="block text-sm font-medium text-gray-700">Customer Value</label>
<select id="customer-value" name="customer-value" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
<option value="High">High</option>
<option value="Medium">Medium</option>
<option value="Low">Low</option>
</select>
</div>
<div>
<label for="customer-status" class="block text-sm font-medium text-gray-700">Status</label>
<select id="customer-status" name="customer-status" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
<option value="Active">Active</option>
<option value="Inactive">Inactive</option>
<option value="Prospect">Prospect</option>
</select>
</div>
</div>
<div>
<label for="customer-notes" class="block text-sm font-medium text-gray-700">Notes</label>
<textarea id="customer-notes" name="customer-notes" rows="3" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500"></textarea>
</div>
</div>
<!-- Service Form Fields -->
<div id="service-fields" class="hidden">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label for="service-name" class="block text-sm font-medium text-gray-700">Service Name</label>
<input type="text" id="service-name" name="service-name" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
</div>
<div>
<label for="service-category" class="block text-sm font-medium text-gray-700">Category</label>
<select id="service-category" name="service-category" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
<option value="">Select Category</option>
<option value="IT">IT Services</option>
<option value="Consulting">Consulting</option>
<option value="Maintenance">Maintenance</option>
<option value="Training">Training</option>
<option value="Support">Support</option>
</select>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label for="service-price" class="block text-sm font-medium text-gray-700">Price ($)</label>
<input type="number" id="service-price" name="service-price" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
</div>
<div>
<label for="service-duration" class="block text-sm font-medium text-gray-700">Duration</label>
<input type="text" id="service-duration" name="service-duration" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500" placeholder="e.g. 2 hours, 1 day">
</div>
</div>
<div>
<label for="service-description" class="block text-sm font-medium text-gray-700">Description</label>
<textarea id="service-description" name="service-description" rows="3" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500"></textarea>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label for="service-status" class="block text-sm font-medium text-gray-700">Status</label>
<select id="service-status" name="service-status" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
<option value="Active">Active</option>
<option value="Inactive">Inactive</option>
<option value="Seasonal">Seasonal</option>
</select>
</div>
<div>
<label for="service-popularity" class="block text-sm font-medium text-gray-700">Popularity</label>
<select id="service-popularity" name="service-popularity" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
<option value="High">High</option>
<option value="Medium">Medium</option>
<option value="Low">Low</option>
</select>
</div>
</div>
</div>
<div class="flex justify-end space-x-3 pt-4">
<button type="button" id="cancel-form" class="px-4 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
Cancel
</button>
<button type="submit" class="px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
Save
</button>
</div>
</form>
</div>
</div>
</div>
<!-- Confirmation Modal -->
<div id="confirm-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<div class="bg-white rounded-lg shadow-xl w-full max-w-md p-6 fade-in">
<div class="flex justify-between items-center mb-4">
<h3 class="text-lg font-bold text-gray-800">Confirm Action</h3>
<button id="close-confirm-modal" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<p id="confirm-message" class="mb-6">Are you sure you want to delete this record?</p>
<div class="flex justify-end space-x-3">
<button type="button" id="cancel-confirm" class="px-4 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
Cancel
</button>
<button type="button" id="confirm-action" class="px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500">
Confirm
</button>
</div>
</div>
</div>
</div>
<script>
// Sample data for demonstration
const sampleData = {
employees: [
{ id: 'EMP001', name: 'John Doe', email: 'john@example.com', position: 'Developer', department: 'IT', status: 'Active' },
{ id: 'EMP002', name: 'Jane Smith', email: 'jane@example.com', position: 'HR Manager', department: 'HR', status: 'Active' },
{ id: 'EMP003', name: 'Mike Johnson', email: 'mike@example.com', position: 'Accountant', department: 'Finance', status: 'Active' },
{ id: 'EMP004', name: 'Sarah Williams', email: 'sarah@example.com', position: 'Marketing Specialist', department: 'Marketing', status: 'Inactive' },
{ id: 'EMP005', name: 'David Brown', email: 'david@example.com', position: 'Operations Manager', department: 'Operations', status: 'Active' }
],
vendors: [
{ id: 'VDR001', name: 'Tech Solutions', contact: 'Robert Taylor', email: 'robert@techsolutions.com', products: 'Software, Hardware', rating: '4', status: 'Active' },
{ id: 'VDR002', name: 'Office Supplies Co', contact: 'Lisa Green', email: 'lisa@officesupplies.com', products: 'Office furniture, stationery', rating: '3', status: 'Active' },
{ id: 'VDR003', name: 'Cloud Services Inc', contact: 'Mark Wilson', email: 'mark@cloudservices.com', products: 'Cloud hosting, Storage', rating: '5', status: 'Active' },
{ id: 'VDR004', name: 'Marketing Pros', contact: 'Emily Davis', email: 'emily@marketingpros.com', products: 'Digital marketing services', rating: '4', status: 'On Hold' }
],
customers: [
{ id: 'CST001', name: 'Alex Johnson', company: 'ABC Corp', email: 'alex@abccorp.com', value: 'High', status: 'Active' },
{ id: 'CST002', name: 'Maria Garcia', company: 'XYZ Ltd', email: 'maria@xyzltd.com', value: 'Medium', status: 'Active' },
{ id: 'CST003', name: 'James Wilson', company: 'Global Enterprises', email: 'james@global.com', value: 'High', status: 'Active' },
{ id: 'CST004', name: 'Sophia Lee', company: 'Tech Innovations', email: 'sophia@techinnov.com', value: 'Medium', status: 'Prospect' },
{ id: 'CST005', name: 'Daniel Kim', company: 'Sunrise Solutions', email: 'daniel@sunrise.com', value: 'Low', status: 'Inactive' }
],
services: [
{ id: 'SRV001', name: 'Website Development', category: 'IT', price: '2500', duration: '4 weeks', status: 'Active', popularity: 'High' },
{ id: 'SRV002', name: 'IT Consulting', category: 'Consulting', price: '150', duration: '1 hour', status: 'Active', popularity: 'Medium' },
{ id: 'SRV003', name: 'Server Maintenance', category: 'Maintenance', price: '500', duration: 'Monthly', status: 'Active', popularity: 'High' },
{ id: 'SRV004', name: 'Employee Training', category: 'Training', price: '1200', duration: '2 days', status: 'Active', popularity: 'Medium' },
{ id: 'SRV005', name: '24/7 Support', category: 'Support', price: '200', duration: 'Per incident', status: 'Active', popularity: 'High' }
]
};
// DOM Elements
const tabBtns = document.querySelectorAll('.tab-btn');
const tabContents = document.querySelectorAll('.tab-content');
const formModal = document.getElementById('form-modal');
const confirmModal = document.getElementById('confirm-modal');
const formTitle = document.getElementById('form-title');
const dataForm = document.getElementById('data-form');
const recordIdInput = document.getElementById('record-id');
const recordTypeInput = document.getElementById('record-type');
const employeeFields = document.getElementById('employee-fields');
const vendorFields = document.getElementById('vendor-fields');
const customerFields = document.getElementById('customer-fields');
const serviceFields = document.getElementById('service-fields');
const confirmMessage = document.getElementById('confirm-message');
const themeToggle = document.getElementById('theme-toggle');
// Current state
let currentAction = '';
let currentRecordId = '';
let currentRecordType = '';
// Initialize the application
function init() {
// Load sample data
renderEmployeeTable();
renderVendorTable();
renderCustomerTable();
renderServiceTable();
// Set up event listeners
setupEventListeners();
}
// Set up event listeners
function setupEventListeners() {
// Tab navigation
tabBtns.forEach(btn => {
btn.addEventListener('click', () => {
const tabId = btn.getAttribute('data-tab');
showTab(tabId);
// Update active tab style
tabBtns.forEach(b => b.classList.remove('text-indigo-600'));
btn.classList.add('text-indigo-600');
});
});
// Add buttons
document.getElementById('add-employee-btn').addEventListener('click', () => showForm('employee', 'add'));
document.getElementById('add-vendor-btn').addEventListener('click', () => showForm('vendor', 'add'));
document.getElementById('add-customer-btn').addEventListener('click', () => showForm('customer', 'add'));
document.getElementById('add-service-btn').addEventListener('click', () => showForm('service', 'add'));
// Form modal
document.getElementById('close-modal').addEventListener('click', closeForm);
document.getElementById('cancel-form').addEventListener('click', closeForm);
dataForm.addEventListener('submit', handleFormSubmit);
// Confirm modal
document.getElementById('close-confirm-modal').addEventListener('click', closeConfirmModal);
document.getElementById('cancel-confirm').addEventListener('click', closeConfirmModal);
document.getElementById('confirm-action').addEventListener('click', handleConfirmAction);
// Theme toggle
themeToggle.addEventListener('click', toggleTheme);
}
// Show tab content
function showTab(tabId) {
tabContents.forEach(content => {
if (content.id === tabId) {
content.classList.remove('hidden');
} else {
content.classList.add('hidden');
}
});
}
// Show form modal
function showForm(type, action, id = '') {
currentAction = action;
currentRecordType = type;
currentRecordId = id;
// Set form title
formTitle.textContent = `${action === 'add' ? 'Add New' : 'Edit'} ${capitalizeFirstLetter(type)}`;
// Hide all form fields first
employeeFields.classList.add('hidden');
vendorFields.classList.add('hidden');
customerFields.classList.add('hidden');
serviceFields.classList.add('hidden');
// Show the correct form fields
switch (type) {
case 'employee':
employeeFields.classList.remove('hidden');
if (action === 'edit') {
const employee = sampleData.employees.find(emp => emp.id === id);
if (employee) {
document.getElementById('emp-name').value = employee.name;
document.getElementById('emp-email').value = employee.email;
document.getElementById('emp-phone').value = employee.phone || '';
document.getElementById('emp-position').value = employee.position;
document.getElementById('emp-department').value = employee.department;
document.getElementById('emp-status').value = employee.status;
document.getElementById('emp-address').value = employee.address || '';
}
} else {
// Reset form for new employee
dataForm.reset();
}
break;
case 'vendor':
vendorFields.classList.remove('hidden');
if (action === 'edit') {
const vendor = sampleData.vendors.find(v => v.id === id);
if (vendor) {
document.getElementById('vendor-name').value = vendor.name;
document.getElementById('vendor-contact').value = vendor.contact;
document.getElementById('vendor-email').value = vendor.email;
document.getElementById('vendor-phone').value = vendor.phone || '';
document.getElementById('vendor-products').value = vendor.products;
document.getElementById('vendor-rating').value = vendor.rating;
document.getElementById('vendor-status').value = vendor.status;
}
} else {
// Reset form for new vendor
dataForm.reset();
}
break;
case 'customer':
customerFields.classList.remove('hidden');
if (action === 'edit') {
const customer = sampleData.customers.find(c => c.id === id);
if (customer) {
document.getElementById('customer-name').value = customer.name;
document.getElementById('customer-company').value = customer.company;
document.getElementById('customer-email').value = customer.email;
document.getElementById('customer-phone').value = customer.phone || '';
document.getElementById('customer-value').value = customer.value;
document.getElementById('customer-status').value = customer.status;
document.getElementById('customer-notes').value = customer.notes || '';
}
} else {
// Reset form for new customer
dataForm.reset();
}
break;
case 'service':
serviceFields.classList.remove('hidden');
if (action === 'edit') {
const service = sampleData.services.find(s => s.id === id);
if (service) {
document.getElementById('service-name').value = service.name;
document.getElementById('service-category').value = service.category;
document.getElementById('service-price').value = service.price;
document.getElementById('service-duration').value = service.duration;
document.getElementById('service-description').value = service.description || '';
document.getElementById('service-status').value = service.status;
document.getElementById('service-popularity').value = service.popularity;
}
} else {
// Reset form for new service
dataForm.reset();
}
break;
}
// Set record ID and type
recordIdInput.value = id;
recordTypeInput.value = type;
// Show modal
formModal.classList.remove('hidden');
}
// Close form modal
function closeForm() {
formModal.classList.add('hidden');
setTimeout(() => {
formModal.classList.remove('slide-in');
formModal.classList.add('slide-out');
}, 0);
setTimeout(() => {
formModal.classList.remove('slide-out');
formModal.classList.add('slide-in');
}, 300);
}
// Handle form submission
function handleFormSubmit(e) {
e.preventDefault();
const type = recordTypeInput.value;
const action = currentAction;
const id = recordIdInput.value;
if (action === 'add') {
// Create new record
const newId = generateId(type);
const newRecord = getFormData(type, newId);
sampleData[`${type}s`].push(newRecord);
showToast(`${capitalizeFirstLetter(type)} added successfully!`);
} else if (action === 'edit') {
// Update existing record
const index = sampleData[`${type}s`].findIndex(item => item.id === id);
if (index !== -1) {
const updatedRecord = getFormData(type, id);
sampleData[`${type}s`][index] = updatedRecord;
showToast(`${capitalizeFirstLetter(type)} updated successfully!`);
}
}
// Refresh the table
refreshTable(type);
// Close the form
closeForm();
}
// Get form data
function getFormData(type, id) {
switch (type) {
case 'employee':
return {
id,
name: document.getElementById('emp-name').value,
email: document.getElementById('emp-email').value,
phone: document.getElementById('emp-phone').value,
position: document.getElementById('emp-position').value,
department: document.getElementById('emp-department').value,
status: document.getElementById('emp-status').value,
address: document.getElementById('emp-address').value
};
case 'vendor':
return {
id,
name: document.getElementById('vendor-name').value,
contact: document.getElementById('vendor-contact').value,
email: document.getElementById('vendor-email').value,
phone: document.getElementById('vendor-phone').value,
products: document.getElementById('vendor-products').value,
rating: document.getElementById('vendor-rating').value,
status: document.getElementById('vendor-status').value
};
case 'customer':
return {
id,
name: document.getElementById('customer-name').value,
company: document.getElementById('customer-company').value,
email: document.getElementById('customer-email').value,
phone: document.getElementById('customer-phone').value,
value: document.getElementById('customer-value').value,
status: document.getElementById('customer-status').value,
notes: document.getElementById('customer-notes').value
};
case 'service':
return {
id,
name: document.getElementById('service-name').value,
category: document.getElementById('service-category').value,
price: document.getElementById('service-price').value,
duration: document.getElementById('service-duration').value,
description: document.getElementById('service-description').value,
status: document.getElementById('service-status').value,
popularity: document.getElementById('service-popularity').value
};
default:
return {};
}
}
// Generate ID
function generateId(type) {
const prefix = type === 'employee' ? 'EMP' :
type === 'vendor' ? 'VDR' :
type === 'customer' ? 'CST' : 'SRV';
const maxId = sampleData[`${type}s`].reduce((max, item) => {
const num = parseInt(item.id.replace(prefix, ''));
return num > max ? num : max;
}, 0);
return `${prefix}${String(maxId + 1).padStart(3, '0')}`;
}
// Show confirm modal
function showConfirmModal(type, id) {
currentRecordType = type;
currentRecordId = id;
confirmMessage.textContent = `Are you sure you want to delete this ${type}?`;
confirmModal.classList.remove('hidden');
}
// Close confirm modal
function closeConfirmModal() {
confirmModal.classList.add('hidden');
}
// Handle confirm action
function handleConfirmAction() {
const type = currentRecordType;
const id = currentRecordId;
// Delete the record
const index = sampleData[`${type}s`].findIndex(item => item.id === id);
if (index !== -1) {
sampleData[`${type}s`].splice(index, 1);
showToast(`${capitalizeFirstLetter(type)} deleted successfully!`);
}
// Refresh the table
refreshTable(type);
// Close the modal
closeConfirmModal();
}
// Render employee table
function renderEmployeeTable() {
const tbody = document.getElementById('employee-table-body');
tbody.innerHTML = '';
sampleData.employees.forEach(employee => {
const tr = document.createElement('tr');
tr.className = 'hover:bg-gray-50';
tr.innerHTML = `
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${employee.id}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${employee.name}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${employee.position}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${employee.department}</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${getStatusClass(employee.status)}">
${employee.status}
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<button class="text-indigo-600 hover:text-indigo-900 mr-3 edit-btn" data-type="employee" data-id="${employee.id}">Edit</button>
<button class="text-red-600 hover:text-red-900 delete-btn" data-type="employee" data-id="${employee.id}">Delete</button>
</td>
`;
tbody.appendChild(tr);
});
// Add event listeners to edit and delete buttons
document.querySelectorAll('.edit-btn').forEach(btn => {
btn.addEventListener('click', () => {
const type = btn.getAttribute('data-type');
const id = btn.getAttribute('data-id');
showForm(type, 'edit', id);
});
});
document.querySelectorAll('.delete-btn').forEach(btn => {
btn.addEventListener('click', () => {
const type = btn.getAttribute('data-type');
const id = btn.getAttribute('data-id');
showConfirmModal(type, id);
});
});
}
// Render vendor table
function renderVendorTable() {
const tbody = document.getElementById('vendor-table-body');
tbody.innerHTML = '';
sampleData.vendors.forEach(vendor => {
const tr = document.createElement('tr');
tr.className = 'hover:bg-gray-50';
tr.innerHTML = `
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${vendor.id}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${vendor.name}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${vendor.contact}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 truncate max-w-xs">${vendor.products}</td>
<td class="px-6 py-4 whitespace-nowrap">
${getRatingStars(vendor.rating)}
</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<button class="text-indigo-600 hover:text-indigo-900 mr-3 edit-btn" data-type="vendor" data-id="${vendor.id}">Edit</button>
<button class="text-red-600 hover:text-red-900 delete-btn" data-type="vendor" data-id="${vendor.id}">Delete</button>
</td>
`;
tbody.appendChild(tr);
});
// Add event listeners to edit and delete buttons
document.querySelectorAll('.edit-btn').forEach(btn => {
btn.addEventListener('click', () => {
const type = btn.getAttribute('data-type');
const id = btn.getAttribute('data-id');
showForm(type, 'edit', id);
});
});
document.querySelectorAll('.delete-btn').forEach(btn => {
btn.addEventListener('click', () => {
const type = btn.getAttribute('data-type');
const id = btn.getAttribute('data-id');
showConfirmModal(type, id);
});
});
}
// Render customer table
function renderCustomerTable() {
const tbody = document.getElementById('customer-table-body');
tbody.innerHTML = '';
sampleData.customers.forEach(customer => {
const tr = document.createElement('tr');
tr.className = 'hover:bg-gray-50';
tr.innerHTML = `
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${customer.id}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${customer.name}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${customer.company}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${customer.email}</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${getValueClass(customer.value)}">
${customer.value}
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<button class="text-indigo-600 hover:text-indigo-900 mr-3 edit-btn" data-type="customer" data-id="${customer.id}">Edit</button>
<button class="text-red-600 hover:text-red-900 delete-btn" data-type="customer" data-id="${customer.id}">Delete</button>
</td>
`;
tbody.appendChild(tr);
});
// Add event listeners to edit and delete buttons
document.querySelectorAll('.edit-btn').forEach(btn => {
btn.addEventListener('click', () => {
const type = btn.getAttribute('data-type');
const id = btn.getAttribute('data-id');
showForm(type, 'edit', id);
});
});
document.querySelectorAll('.delete-btn').forEach(btn => {
btn.addEventListener('click', () => {
const type = btn.getAttribute('data-type');
const id = btn.getAttribute('data-id');
showConfirmModal(type, id);
});
});
}
// Render service table
function renderServiceTable() {
const tbody = document.getElementById('service-table-body');
tbody.innerHTML = '';
sampleData.services.forEach(service => {
const tr = document.createElement('tr');
tr.className = 'hover:bg-gray-50';
tr.innerHTML = `
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${service.id}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${service.name}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${service.category}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">$${service.price}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${service.duration}</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<button class="text-indigo-600 hover:text-indigo-900 mr-3 edit-btn" data-type="service" data-id="${service.id}">Edit</button>
<button class="text-red-600 hover:text-red-900 delete-btn" data-type="service" data-id="${service.id}">Delete</button>
</td>
`;
tbody.appendChild(tr);
});
// Add event listeners to edit and delete buttons
document.querySelectorAll('.edit-btn').forEach(btn => {
btn.addEventListener('click', () => {
const type = btn.getAttribute('data-type');
const id = btn.getAttribute('data-id');
showForm(type, 'edit', id);
});
});
document.querySelectorAll('.delete-btn').forEach(btn => {
btn.addEventListener('click', () => {
const type = btn.getAttribute('data-type');
const id = btn.getAttribute('data-id');
showConfirmModal(type, id);
});
});
}
// Refresh table after changes
function refreshTable(type) {
switch (type) {
case 'employee':
renderEmployeeTable();
break;
case 'vendor':
renderVendorTable();
break;
case 'customer':
renderCustomerTable();
break;
case 'service':
renderServiceTable();
break;
}
}
// Get status class for styling
function getStatusClass(status) {
switch (status) {
case 'Active':
return 'bg-green-100 text-green-800';
case 'Inactive':
return 'bg-red-100 text-red-800';
case 'On Leave':
case 'On Hold':
return 'bg-yellow-100 text-yellow-800';
default:
return 'bg-gray-100 text-gray-800';
}
}
// Get value class for styling
function getValueClass(value) {
switch (value) {
case 'High':
return 'bg-green-100 text-green-800';
case 'Medium':
return 'bg-blue-100 text-blue-800';
case 'Low':
return 'bg-gray-100 text-gray-800';
default:
return 'bg-gray-100 text-gray-800';
}
}
// Get rating stars
function getRatingStars(rating) {
const stars = [];
for (let i = 1; i <= 5; i++) {
stars.push(
i <= rating
? '<i class="fas fa-star text-yellow-400"></i>'
: '<i class="far fa-star text-gray-300"></i>'
);
}
return stars.join('');
}
// Show toast notification
function showToast(message) {
const toast = document.createElement('div');
toast.className = 'fixed bottom-4 right-4 px-4 py-2 bg-green-600 text-white rounded-md shadow-lg flex items-center fade-in';
toast.innerHTML = `
<i class="fas fa-check-circle mr-2"></i>
<span>${message}</span>
`;
document.body.appendChild(toast);
setTimeout(() => {
toast.classList.remove('fade-in');
toast.classList.add('fade-out');
setTimeout(() => toast.remove(), 300);
}, 3000);
}
// Toggle theme
function toggleTheme() {
const html = document.documentElement;
if (html.classList.contains('dark')) {
html.classList.remove('dark');
themeToggle.innerHTML = '<i class="fas fa-moon"></i>';
localStorage.setItem('theme', 'light');
} else {
html.classList.add('dark');
themeToggle.innerHTML = '<i class="fas fa-sun"></i>';
localStorage.setItem('theme', 'dark');
}
}
// Check for saved theme preference
function checkTheme() {
const savedTheme = localStorage.getItem('theme') || 'light';
if (savedTheme === 'dark') {
document.documentElement.classList.add('dark');
themeToggle.innerHTML = '<i class="fas fa-sun"></i>';
}
}
// Capitalize first letter
function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
// Initialize the app when DOM is loaded
document.addEventListener('DOMContentLoaded', () => {
checkTheme();
init();
});
</script>
<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=atchara/b1" 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>Master Data Management</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
.slide-in {
animation: slideIn 0.3s forwards;
}
.slide-out {
animation: slideOut 0.3s forwards;
}
@keyframes slideIn {
from { transform: translateX(100%); opacity: 0; }
to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOut {
from { transform: translateX(0); opacity: 1; }
to { transform: translateX(100%); opacity: 0; }
}
.fade-in {
animation: fadeIn 0.3s forwards;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
</style>
</head>
<body class="bg-gray-100 font-sans">
<div class="min-h-screen flex flex-col">
<!-- Header -->
<header class="bg-indigo-600 text-white shadow-lg">
<div class="container mx-auto px-4 py-4 flex justify-between items-center">
<h1 class="text-2xl font-bold">Master Data Management</h1>
<div class="flex items-center space-x-4">
<button id="theme-toggle" class="p-2 rounded-full hover:bg-indigo-500">
<i class="fas fa-moon"></i>
</button>
<div class="relative">
<button class="p-2 rounded-full hover:bg-indigo-500">
<i class="fas fa-bell"></i>
</button>
<span class="absolute top-0 right-0 h-2 w-2 rounded-full bg-red-500"></span>
</div>
</div>
</div>
</header>
<!-- Main Content -->
<main class="flex-1 container mx-auto px-4 py-6">
<div class="flex flex-col lg:flex-row gap-6">
<!-- Sidebar -->
<aside class="w-full lg:w-64 bg-white rounded-lg shadow-md p-4">
<nav>
<ul class="space-y-2">
<li>
<button data-tab="dashboard" class="tab-btn w-full text-left px-4 py-2 rounded hover:bg-indigo-50 text-indigo-600 font-medium">
<i class="fas fa-tachometer-alt mr-2"></i> Dashboard
</button>
</li>
<li>
<button data-tab="employee" class="tab-btn w-full text-left px-4 py-2 rounded hover:bg-indigo-50 font-medium">
<i class="fas fa-users mr-2"></i> Employees
</button>
</li>
<li>
<button data-tab="vendor" class="tab-btn w-full text-left px-4 py-2 rounded hover:bg-indigo-50 font-medium">
<i class="fas fa-truck mr-2"></i> Vendors
</button>
</li>
<li>
<button data-tab="customer" class="tab-btn w-full text-left px-4 py-2 rounded hover:bg-indigo-50 font-medium">
<i class="fas fa-user-tie mr-2"></i> Customers
</button>
</li>
<li>
<button data-tab="service" class="tab-btn w-full text-left px-4 py-2 rounded hover:bg-indigo-50 font-medium">
<i class="fas fa-cogs mr-2"></i> Services
</button>
</li>
</ul>
</nav>
</aside>
<!-- Content Area -->
<div class="flex-1">
<!-- Dashboard (Default View) -->
<div id="dashboard" class="tab-content bg-white rounded-lg shadow-md p-6">
<div class="flex justify-between items-center mb-6">
<h2 class="text-xl font-bold text-gray-800">Dashboard Overview</h2>
<div class="flex space-x-2">
<button class="px-3 py-1 bg-indigo-100 text-indigo-600 rounded-md text-sm">Today</button>
<button class="px-3 py-1 bg-gray-100 text-gray-600 rounded-md text-sm">Week</button>
<button class="px-3 py-1 bg-gray-100 text-gray-600 rounded-md text-sm">Month</button>
</div>
</div>