{% extends "base.html" %}{% block title %}Reminders{% endblock %}{% block content %}
<div class="card p-4 shadow-sm mb-4"><h2>⏰ Reminders</h2><form method="post" class="row g-2"><div class="col-md-2"><select name="reminder_type" class="form-select"><option>Warranty</option><option>Payment</option><option>Delivery</option><option>General</option></select></div><div class="col-md-3"><input name="title" class="form-control" placeholder="Title" required></div><div class="col-md-2"><input type="date" name="due_date" class="form-control"></div><div class="col-md-3"><input name="notes" class="form-control" placeholder="Notes"></div><div class="col-md-2"><button class="btn btn-primary w-100">Add</button></div></form></div>
<div class="card p-4 shadow-sm mb-4"><h4>Warranty expiring within 30 days</h4><table class="table"><tr><th>Item</th><th>IMEI</th><th>Serial</th><th>Product Warranty</th><th>Battery Warranty</th></tr>{% for u in upcoming %}<tr><td>{{u.item_name}}</td><td>{{u.imei}}</td><td>{{u.serial}}</td><td>{{u.product_warranty_expiry}}</td><td>{{u.battery_warranty_expiry}}</td></tr>{% else %}<tr><td colspan="5">No upcoming warranty expiry.</td></tr>{% endfor %}</table></div>
<div class="card p-4 shadow-sm"><h4>All Reminders</h4><table class="table"><tr><th>Type</th><th>Title</th><th>Due</th><th>Status</th><th>Action</th></tr>{% for r in reminders %}<tr><td>{{r.reminder_type}}</td><td>{{r.title}}</td><td>{{r.due_date}}</td><td>{{r.status}}</td><td>{% if r.status != 'Done' %}<form method="post" action="{{ url_for('reminder_done', reminder_id=r.id) }}"><button class="btn btn-sm btn-success">Done</button></form>{% endif %}</td></tr>{% endfor %}</table></div>
{% endblock %}
