Spaces:
Sleeping
Sleeping
Download templates/payment_records.html from alisaleem97/NexLab_System: direct link, hf CLI and curl.
- Browser
- Download file 7.32 kB
-
https://huggingface.co/spaces/alisaleem97/NexLab_System/resolve/main/templates/payment_records.html
- Command line
-
hf download hf://spaces/alisaleem97/NexLab_System/templates/payment_records.html
-
curl -L -o payment_records.html https://huggingface.co/spaces/alisaleem97/NexLab_System/resolve/main/templates/payment_records.html
7.32 kB
| <!-- templates/payment_records.html --> | |
| {% extends "base.html" %} | |
| {% block title %}Payment Records - NexLab{% endblock %} | |
| {% block page_title %}Payment Records{% endblock %} | |
| {% block content %} | |
| <!-- Flatpickr for Date Selection --> | |
| <link rel="stylesheet" href="/static/vendor/flatpickr/flatpickr.min.css"> | |
| <script src="/static/vendor/flatpickr/flatpickr.min.js"></script> | |
| <!-- Filter Form --> | |
| <div class="bg-white rounded-xl shadow-sm border border-slate-200 mb-6 overflow-hidden"> | |
| <div class="p-6"> | |
| <form action="/reports/payment-records" method="GET" class="flex flex-wrap items-end gap-4"> | |
| <!-- Dates and Times --> | |
| <div> | |
| <label class="block text-xs font-bold text-slate-500 uppercase mb-2">From Date</label> | |
| <input type="text" name="start_date" required value="{{ start_date }}" | |
| class="datepicker w-36 border border-slate-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-indigo-500 focus:outline-none text-sm"> | |
| </div> | |
| <div> | |
| <label class="block text-xs font-bold text-slate-500 uppercase mb-2">From Time</label> | |
| <input type="text" name="start_time" required value="{{ start_time }}" | |
| class="timepicker w-24 border border-slate-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-indigo-500 focus:outline-none text-sm"> | |
| </div> | |
| <div class="ml-4"> | |
| <label class="block text-xs font-bold text-slate-500 uppercase mb-2">To Date</label> | |
| <input type="text" name="end_date" required value="{{ end_date }}" | |
| class="datepicker w-36 border border-slate-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-indigo-500 focus:outline-none text-sm"> | |
| </div> | |
| <div> | |
| <label class="block text-xs font-bold text-slate-500 uppercase mb-2">To Time</label> | |
| <input type="text" name="end_time" required value="{{ end_time }}" | |
| class="timepicker w-24 border border-slate-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-indigo-500 focus:outline-none text-sm"> | |
| </div> | |
| <!-- Record Type --> | |
| <div class="ml-4"> | |
| <label class="block text-xs font-bold text-slate-500 uppercase mb-2">Record Type</label> | |
| <select name="record_type" class="w-36 border border-slate-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-indigo-500 focus:outline-none text-sm bg-white cursor-pointer"> | |
| <option value="all" {% if record_type == "all" %}selected{% endif %}>All</option> | |
| <option value="receive" {% if record_type == "receive" %}selected{% endif %}>Receive</option> | |
| <option value="expense" {% if record_type == "expense" %}selected{% endif %}>Expense</option> | |
| </select> | |
| </div> | |
| <!-- User Filter --> | |
| <div> | |
| <label class="block text-xs font-bold text-slate-500 uppercase mb-2">User</label> | |
| <select name="user_id" class="w-48 border border-slate-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-indigo-500 focus:outline-none text-sm bg-white cursor-pointer select2"> | |
| <option value="all">All Users</option> | |
| {% for u in users %} | |
| <option value="{{ u.id }}" {% if user_filter == u.id|string %}selected{% endif %}>{{ u.full_name }}</option> | |
| {% endfor %} | |
| </select> | |
| </div> | |
| <button type="submit" | |
| class="bg-indigo-600 hover:bg-indigo-700 text-white px-6 py-2 rounded-lg text-sm font-semibold transition shadow-sm ml-auto"> | |
| Generate Report | |
| </button> | |
| </form> | |
| </div> | |
| </div> | |
| <script> | |
| document.addEventListener('DOMContentLoaded', function() { | |
| flatpickr(".datepicker", { | |
| dateFormat: "Y-m-d", | |
| altInput: true, | |
| altFormat: "d-m-Y", | |
| allowInput: true | |
| }); | |
| flatpickr(".timepicker", { | |
| enableTime: true, | |
| noCalendar: true, | |
| dateFormat: "H:i", | |
| time_24hr: true, | |
| allowInput: true | |
| }); | |
| }); | |
| </script> | |
| <!-- Table Results --> | |
| <div class="bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden"> | |
| <div class="overflow-x-auto"> | |
| <table class="w-full text-left border-collapse"> | |
| <thead> | |
| <tr class="bg-slate-50 border-b border-slate-200 text-xs font-bold text-slate-500 uppercase tracking-wider"> | |
| <th class="px-6 py-4">NO</th> | |
| <th class="px-6 py-4">Date & Time</th> | |
| <th class="px-6 py-4">Patient Name</th> | |
| <th class="px-6 py-4">User</th> | |
| <th class="px-6 py-4">Record Type</th> | |
| <th class="px-6 py-4 text-right">Price</th> | |
| </tr> | |
| </thead> | |
| <tbody class="divide-y divide-slate-100 text-sm"> | |
| {% if records %} | |
| {% for row in records %} | |
| <tr class="hover:bg-slate-50 transition-colors"> | |
| <td class="px-6 py-4 text-slate-500">{{ row.no }}</td> | |
| <td class="px-6 py-4 font-medium text-slate-800">{{ row.date_str }}</td> | |
| <td class="px-6 py-4 font-medium text-slate-800">{{ row.patient_name }}</td> | |
| <td class="px-6 py-4 font-medium text-slate-800">{{ row.user }}</td> | |
| <td class="px-6 py-4"> | |
| {% if row.type == "Receive" %} | |
| <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-emerald-100 text-emerald-800"> | |
| Receive | |
| </span> | |
| {% else %} | |
| <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-100 text-red-800"> | |
| Expense | |
| </span> | |
| {% endif %} | |
| </td> | |
| <td class="px-6 py-4 text-right font-medium {% if row.type == 'Receive' %}text-emerald-600{% else %}text-red-600{% endif %}"> | |
| {{ "{:,.0f}".format(row.price) }} | |
| </td> | |
| </tr> | |
| {% endfor %} | |
| {% else %} | |
| <tr> | |
| <td colspan="6" class="px-6 py-8 text-center text-slate-400 italic">No records found for the selected criteria.</td> | |
| </tr> | |
| {% endif %} | |
| </tbody> | |
| {% if records %} | |
| <tfoot class="bg-slate-50 border-t-2 border-slate-200 font-bold"> | |
| <tr> | |
| <td colspan="5" class="px-6 py-4 text-slate-700 uppercase tracking-wider text-sm text-right">Total sum</td> | |
| <td class="px-6 py-4 text-right text-lg text-slate-800">{{ "{:,.0f}".format(total_price) }}</td> | |
| </tr> | |
| </tfoot> | |
| {% endif %} | |
| </table> | |
| </div> | |
| </div> | |
| {% endblock %} | |