mirror of
https://github.com/sassanix/Warracker.git
synced 2026-01-07 14:10:15 -06:00
158 lines
6.8 KiB
HTML
158 lines
6.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Warranty Tracker</title>
|
|
<link rel="stylesheet" href="style.css">
|
|
<!-- Font Awesome for icons -->
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
</head>
|
|
<body>
|
|
<!-- Header -->
|
|
<header>
|
|
<div class="container">
|
|
<div class="app-title">
|
|
<i class="fas fa-shield-alt"></i>
|
|
<h1>Warranty Tracker</h1>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<!-- Main Content -->
|
|
<div class="container">
|
|
<div class="main-content">
|
|
<!-- Form Panel -->
|
|
<div class="form-panel">
|
|
<h2>Add New Warranty</h2>
|
|
<form id="warrantyForm">
|
|
<div class="form-group">
|
|
<label for="productName">Product Name</label>
|
|
<input type="text" id="productName" name="product_name" class="form-control" required>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="purchaseDate">Purchase Date</label>
|
|
<input type="date" id="purchaseDate" name="purchase_date" class="form-control" required>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="warrantyYears">Warranty Period (Years)</label>
|
|
<input type="number" id="warrantyYears" name="warranty_years" class="form-control" min="1" max="100" required>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label>Invoice/Receipt</label>
|
|
<div class="file-input-wrapper">
|
|
<label for="invoice" class="file-input-label">
|
|
<i class="fas fa-upload"></i> Choose File
|
|
</label>
|
|
<input type="file" id="invoice" name="invoice" class="file-input" accept=".pdf,.png,.jpg,.jpeg">
|
|
</div>
|
|
<div id="fileName" class="file-name"></div>
|
|
</div>
|
|
|
|
<button type="submit" class="btn btn-primary">Add Warranty</button>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Warranties List Panel -->
|
|
<div class="warranties-panel">
|
|
<h2>
|
|
Your Warranties
|
|
<button id="refreshBtn" class="refresh-btn" title="Refresh list">
|
|
<i class="fas fa-sync-alt"></i>
|
|
</button>
|
|
</h2>
|
|
|
|
<div class="search-box">
|
|
<i class="fas fa-search"></i>
|
|
<input type="text" id="searchWarranties" placeholder="Search warranties...">
|
|
</div>
|
|
|
|
<div id="warrantiesList" class="warranties-list">
|
|
<!-- Warranties will be loaded here -->
|
|
<div class="empty-state">
|
|
<i class="fas fa-box-open"></i>
|
|
<h3>No warranties yet</h3>
|
|
<p>Add your first warranty to get started</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Edit Warranty Modal -->
|
|
<div id="editModal" class="modal-backdrop">
|
|
<div class="modal">
|
|
<div class="modal-header">
|
|
<h3 class="modal-title">Edit Warranty</h3>
|
|
<button class="close-btn" data-dismiss="modal">×</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form id="editWarrantyForm">
|
|
<input type="hidden" id="editWarrantyId">
|
|
<div class="form-group">
|
|
<label for="editProductName">Product Name</label>
|
|
<input type="text" id="editProductName" name="product_name" class="form-control" required>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="editPurchaseDate">Purchase Date</label>
|
|
<input type="date" id="editPurchaseDate" name="purchase_date" class="form-control" required>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="editWarrantyYears">Warranty Period (Years)</label>
|
|
<input type="number" id="editWarrantyYears" name="warranty_years" class="form-control" min="1" max="100" required>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label>Invoice/Receipt</label>
|
|
<div class="file-input-wrapper">
|
|
<label for="editInvoice" class="file-input-label">
|
|
<i class="fas fa-upload"></i> Choose File
|
|
</label>
|
|
<input type="file" id="editInvoice" name="invoice" class="file-input" accept=".pdf,.png,.jpg,.jpeg">
|
|
</div>
|
|
<div id="editFileName" class="file-name"></div>
|
|
<div id="currentInvoice" class="mt-10"></div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button class="btn btn-danger" data-dismiss="modal">Cancel</button>
|
|
<button id="saveWarrantyBtn" class="btn btn-primary">Save Changes</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Confirm Delete Modal -->
|
|
<div id="deleteModal" class="modal-backdrop">
|
|
<div class="modal">
|
|
<div class="modal-header">
|
|
<h3 class="modal-title">Confirm Delete</h3>
|
|
<button class="close-btn" data-dismiss="modal">×</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<p>Are you sure you want to delete this warranty?</p>
|
|
<p class="text-danger"><strong>This action cannot be undone.</strong></p>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
|
<button id="confirmDeleteBtn" class="btn btn-danger">Delete</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Toast Notifications -->
|
|
<div class="toast-container" id="toastContainer"></div>
|
|
|
|
<!-- Loading Spinner -->
|
|
<div class="loading-container" id="loadingContainer">
|
|
<div class="loading-spinner"></div>
|
|
</div>
|
|
|
|
<script src="script.js"></script>
|
|
</body>
|
|
</html> |