179 lines
11 KiB
HTML
179 lines
11 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Transactions - AI Giga TCG</title>
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
|
<script>
|
|
tailwind.config = {
|
|
darkMode: 'class',
|
|
theme: {
|
|
extend: {
|
|
fontFamily: {
|
|
sans: ['Inter', 'sans-serif'],
|
|
},
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</head>
|
|
<body class="bg-gray-900 min-h-screen text-gray-100">
|
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
|
|
<div class="bg-gray-800 rounded-xl shadow-sm p-6 mb-8">
|
|
<h1 class="text-3xl font-bold text-gray-100 mb-2">Transactions</h1>
|
|
<p class="text-gray-400">Manage your transactions</p>
|
|
</div>
|
|
|
|
<!-- Create Transaction Button -->
|
|
<div class="bg-gray-800 rounded-xl shadow-sm p-6 mb-8">
|
|
<button id="createTransactionBtn" class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors">
|
|
Create New Transaction
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Transaction List -->
|
|
<div id="transactionList" class="bg-gray-800 rounded-xl shadow-sm p-6">
|
|
<div class="flex justify-between items-center mb-4">
|
|
<h2 class="text-xl font-semibold text-gray-100">Recent Transactions</h2>
|
|
<div class="flex items-center space-x-4">
|
|
<div class="flex items-center space-x-2">
|
|
<label for="limitSelect" class="text-sm text-gray-300">Show:</label>
|
|
<select id="limitSelect" class="rounded-lg border-gray-600 bg-gray-700 text-gray-100 focus:ring-blue-500 focus:border-blue-500">
|
|
<option value="25">25</option>
|
|
<option value="50">50</option>
|
|
<option value="100">100</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="transactionsTable" class="overflow-x-auto">
|
|
<table class="min-w-full divide-y divide-gray-700">
|
|
<thead>
|
|
<tr>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider">Date</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider">Type</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider">Vendor/Customer</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider">Total</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider">Notes</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-700" id="transactionsBody">
|
|
<!-- Transactions will be loaded here -->
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- Pagination Controls -->
|
|
<div class="flex justify-between items-center mt-4">
|
|
<button id="prevPageBtn" class="px-4 py-2 bg-gray-700 text-white rounded-lg hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed">
|
|
Previous
|
|
</button>
|
|
<span id="pageInfo" class="text-gray-300">Page 1</span>
|
|
<button id="nextPageBtn" class="px-4 py-2 bg-gray-700 text-white rounded-lg hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed">
|
|
Next
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Create Transaction Modal -->
|
|
<div id="createTransactionModal" class="fixed inset-0 bg-black bg-opacity-50 hidden flex items-center justify-center">
|
|
<div class="bg-gray-800 rounded-lg p-6 max-w-2xl w-full mx-4">
|
|
<div class="flex items-center justify-between mb-4">
|
|
<h3 class="text-xl font-semibold text-gray-100">Create Transaction</h3>
|
|
<button onclick="closeTransactionModal()" class="text-gray-400 hover:text-white">
|
|
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
<form id="transactionForm" class="space-y-4">
|
|
<!-- Transaction Type -->
|
|
<div>
|
|
<label for="transactionType" class="block text-sm font-medium text-gray-300 mb-2">Transaction Type</label>
|
|
<select id="transactionType" class="w-full rounded-lg border-gray-600 bg-gray-700 text-gray-100 focus:ring-blue-500 focus:border-blue-500">
|
|
<option value="purchase" selected>Purchase</option>
|
|
<option value="sale">Sale</option>
|
|
</select>
|
|
</div>
|
|
|
|
<!-- Vendor/Customer Selection -->
|
|
<div>
|
|
<div class="flex items-center justify-between mb-2">
|
|
<label for="vendorSelect" class="block text-sm font-medium text-gray-300">Vendor</label>
|
|
<button type="button" id="addVendorBtn" class="px-2 py-1 text-sm bg-blue-600 text-white rounded hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors">
|
|
Add New
|
|
</button>
|
|
</div>
|
|
<select id="vendorSelect" class="w-full rounded-lg border-gray-600 bg-gray-700 text-gray-100 focus:ring-blue-500 focus:border-blue-500">
|
|
<option value="">Select a vendor</option>
|
|
</select>
|
|
</div>
|
|
|
|
<!-- Marketplace Selection (for sales) -->
|
|
<div id="marketplaceSection" class="hidden">
|
|
<div class="flex items-center justify-between mb-2">
|
|
<label for="marketplaceSelect" class="block text-sm font-medium text-gray-300">Marketplace</label>
|
|
<button type="button" id="addMarketplaceBtn" class="px-2 py-1 text-sm bg-blue-600 text-white rounded hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors">
|
|
Add New
|
|
</button>
|
|
</div>
|
|
<select id="marketplaceSelect" class="w-full rounded-lg border-gray-600 bg-gray-700 text-gray-100 focus:ring-blue-500 focus:border-blue-500">
|
|
<option value="">Select a marketplace</option>
|
|
</select>
|
|
</div>
|
|
|
|
<!-- Transaction Date -->
|
|
<div>
|
|
<label for="transactionDate" class="block text-sm font-medium text-gray-300 mb-2">Transaction Date</label>
|
|
<input type="datetime-local" id="transactionDate" class="w-full rounded-lg border-gray-600 bg-gray-700 text-gray-100 focus:ring-blue-500 focus:border-blue-500" required>
|
|
</div>
|
|
|
|
<!-- Transaction Notes -->
|
|
<div>
|
|
<label for="transactionNotes" class="block text-sm font-medium text-gray-300 mb-2">Notes</label>
|
|
<textarea id="transactionNotes" class="w-full rounded-lg border-gray-600 bg-gray-700 text-gray-100 focus:ring-blue-500 focus:border-blue-500" rows="3"></textarea>
|
|
</div>
|
|
|
|
<!-- Items Section -->
|
|
<div id="itemsSection" class="border border-gray-700 rounded-lg p-4">
|
|
<h5 class="text-lg font-medium text-gray-100 mb-4">Items</h5>
|
|
<div id="itemsContainer" class="space-y-4">
|
|
<!-- Items will be added here -->
|
|
</div>
|
|
<button type="button" id="addItemBtn" class="mt-4 px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 transition-colors">
|
|
Add Item
|
|
</button>
|
|
</div>
|
|
</form>
|
|
<div class="flex justify-end space-x-3 mt-6">
|
|
<button onclick="closeTransactionModal()" class="px-4 py-2 bg-gray-600 text-white rounded-lg hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 transition-colors">
|
|
Cancel
|
|
</button>
|
|
<button id="saveTransactionBtn" class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors">
|
|
Save Transaction
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Transaction Details Modal -->
|
|
<div id="transactionDetailsModal" class="fixed inset-0 bg-black bg-opacity-50 hidden flex items-center justify-center">
|
|
<div class="bg-gray-800 rounded-lg p-6 max-w-4xl w-full mx-4 max-h-[90vh] overflow-y-auto">
|
|
<div class="flex items-center justify-between mb-4">
|
|
<h3 class="text-xl font-semibold text-gray-100">Transaction Details</h3>
|
|
<button onclick="closeTransactionDetailsModal()" class="text-gray-400 hover:text-white">
|
|
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
<div id="transactionDetails" class="space-y-4">
|
|
<!-- Transaction details will be loaded here -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script src="transactions.js"></script>
|
|
</body>
|
|
</html> |