diff --git a/assets/css/custom.css b/assets/css/custom.css
new file mode 100644
index 0000000..85c5711
--- /dev/null
+++ b/assets/css/custom.css
@@ -0,0 +1,81 @@
+
+@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
+
+body {
+ font-family: 'Inter', sans-serif;
+ background-color: #f8f9fa;
+}
+
+.sidebar {
+ position: fixed;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ z-index: 100;
+ padding: 48px 0 0;
+ box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
+ width: 250px;
+ transition: transform .3s ease-in-out;
+}
+
+@media (max-width: 767.98px) {
+ .sidebar {
+ transform: translateX(-100%);
+ }
+ .sidebar.show {
+ transform: translateX(0);
+ }
+ .main-content {
+ margin-left: 0;
+ }
+}
+
+@media (min-width: 768px) {
+ .main-content {
+ margin-left: 250px;
+ }
+}
+
+.sidebar-sticky {
+ position: relative;
+ top: 0;
+ height: calc(100vh - 48px);
+ padding-top: .5rem;
+ overflow-x: hidden;
+ overflow-y: auto;
+}
+
+.nav-link {
+ color: #333;
+}
+
+.nav-link.active,
+.nav-link:hover {
+ color: #0d6efd;
+}
+
+.navbar-brand {
+ padding-top: .75rem;
+ padding-bottom: .75rem;
+ font-size: 1rem;
+ background-color: rgba(0, 0, 0, .25);
+ box-shadow: inset -1px 0 0 rgba(0, 0, 0, .25);
+}
+
+.navbar .navbar-toggler {
+ top: .25rem;
+ right: 1rem;
+}
+
+.card {
+ border: none;
+ box-shadow: 0 0.5rem 1rem rgba(0,0,0,.15);
+}
+
+.main-content-shifted {
+ margin-left: 0;
+}
+
+.sidebar-collapsed {
+ transform: translateX(-100%);
+}
diff --git a/assets/js/main.js b/assets/js/main.js
new file mode 100644
index 0000000..8e8742e
--- /dev/null
+++ b/assets/js/main.js
@@ -0,0 +1,72 @@
+document.addEventListener('DOMContentLoaded', function () {
+ const sidebar = document.getElementById('sidebar');
+ const mainContent = document.getElementById('main-content');
+ const sidebarToggler = document.getElementById('sidebar-toggler');
+
+ if (sidebarToggler) {
+ sidebarToggler.addEventListener('click', function () {
+ sidebar.classList.toggle('sidebar-collapsed');
+ mainContent.classList.toggle('main-content-shifted');
+ });
+ }
+
+ // Off-canvas for mobile
+ const offcanvasToggler = document.querySelector('[data-bs-toggle="offcanvas"]');
+ if(offcanvasToggler) {
+ const target = document.querySelector(offcanvasToggler.dataset.bsTarget);
+ offcanvasToggler.addEventListener('click', function(e) {
+ e.preventDefault();
+ target.classList.toggle('show');
+ });
+ }
+
+ // Fetch and load data from the backend
+ loadDashboardData();
+});
+
+/**
+ * Fetches data from the Node.js backend and populates the dashboard.
+ */
+async function loadDashboardData() {
+ // --- IMPORTANT ---
+ // Replace this URL with the actual URL of your Node.js backend API.
+ // When running locally, your Node.js server might be on a different port.
+ const backendApiUrl = 'http://localhost:3001/api/transactions';
+
+ try {
+ const response = await fetch(backendApiUrl);
+ if (!response.ok) {
+ // If the response is not OK (e.g., 404, 500), throw an error.
+ throw new Error(`HTTP error! status: ${response.status}`);
+ }
+ const transactions = await response.json();
+
+ // Get the table body to populate it with data
+ const tableBody = document.querySelector('.table-responsive tbody');
+
+ // Clear existing placeholder rows
+ tableBody.innerHTML = '';
+
+ // Populate table with data from the backend
+ transactions.forEach(tx => {
+ const row = document.createElement('tr');
+
+ // Make sure the property names (e.g., tx.id, tx.itemOut) match what your API sends
+ row.innerHTML = `
+
${tx.id} |
+ ${tx.itemOut} |
+ ${tx.itemIn} |
+ ${tx.user} |
+ ${new Date(tx.date).toLocaleDateString()} |
+ ${tx.status} |
+ `;
+ tableBody.appendChild(row);
+ });
+
+ } catch (error) {
+ console.error('Error fetching data from backend:', error);
+ const tableBody = document.querySelector('.table-responsive tbody');
+ // Display a user-friendly error message in the table
+ tableBody.innerHTML = '| Could not load data. Is the backend server running? |
';
+ }
+}
diff --git a/index.php b/index.php
index 7205f3d..ec0b737 100644
--- a/index.php
+++ b/index.php
@@ -1,150 +1,196 @@
-
-
-
- New Style
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ Barter System - Admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
Analyzing your requirements and generating your website…
-
- Loading…
-
-
= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.
-
This page will update automatically as the plan is implemented.
-
Runtime: PHP = htmlspecialchars($phpVersion) ?> — UTC = htmlspecialchars($now) ?>
+
+
+ Barter System
+
+
-
-
+
+
+
+
+
+
+
+
+
Dashboard
+
+
+
+
+
+
+
+
Total Listings
+
1,250
+
+
+
+
+
+
+
Completed Trades
+
324
+
+
+
+
+
+
+
Active Complaints
+
12
+
+
+
+
+
+
+ Recent Transactions
+
+
+
+
+ | # |
+ Item Out |
+ Item In |
+ User |
+ Date |
+ Status |
+
+
+
+
+ | 1024 |
+ Vintage Leather Jacket |
+ Electric Guitar |
+ user@example.com |
+ 2025-11-08 |
+ Completed |
+
+
+ | 1023 |
+ Antique Bookshelf |
+ Modern Sofa |
+ another@example.com |
+ 2025-11-07 |
+ Completed |
+
+
+ | 1022 |
+ Smartphone X1 |
+ Laptop Pro |
+ test@example.com |
+ 2025-11-07 |
+ Pending |
+
+
+ | 1021 |
+ Designer T-Shirt |
+ Used Textbooks |
+ newuser@example.com |
+ 2025-11-06 |
+ Cancelled |
+
+
+
+
+
+
+
+
+
+
+
-
+