{% extends "base.html" %} {% block content %}

📊 Reports & Analytics

{% if report_type == 'dashboard' %}

🏥 Medical Center Dashboard

👥

Total Patients

{{ total_patients }}

👨‍⚕️

Total Doctors

{{ total_doctors }}

📅

Scheduled Appointments

{{ scheduled_appointments }}

💊

Medicines

{{ total_medicines }}

Select a report type from the dropdown above to view detailed reports.

{% elif report_type == 'patient_statistics' %}

👥 Patient Statistics Report

{% if patients %}
{% for patient in patients %} {% endfor %}
MR Number Name Age Gender Mobile Created Date
{{ patient[0] }} {{ patient[1] }} {{ patient[2] }} {{ patient[3] }} {{ patient[4] }} {{ patient[5] }}
{% else %}

No patients found.

{% endif %} {% elif report_type == 'doctor_statistics' %}

👨‍⚕️ Doctor Statistics Report

{% if doctors %}
{% for doctor in doctors %} {% endfor %}
Doctor ID Name Specialization Experience Fee Created Date
{{ doctor[0] }} {{ doctor[1] }} {{ doctor[2] }} {{ doctor[3] }} years ${{ "%.2f"|format(doctor[4]|float) }} {{ doctor[5] }}
{% else %}

No doctors found.

{% endif %} {% elif report_type == 'appointment_statistics' %}

📅 Appointment Statistics Report

{% if appointments %}
{% for appointment in appointments %} {% endfor %}
Appointment ID Patient Doctor Date Time Status
{{ appointment[0] }} {{ appointment[1] }} {{ appointment[2] }} {{ appointment[3] }} {{ appointment[4] }} {{ appointment[5] }}
{% else %}

No appointments found.

{% endif %} {% elif report_type == 'revenue_report' %}

💰 Revenue Report

{% if bills %}
{% for bill in bills %} {% endfor %}
Bill ID Patient Doctor Total Amount Net Amount Status Date
{{ bill[0] }} {{ bill[1] }} {{ bill[2] }} ${{ "%.2f"|format(bill[3]|float) }} ${{ "%.2f"|format(bill[4]|float) }} {{ bill[5] }} {{ bill[6] }}

Total Revenue: ${{ "%.2f"|format(total_revenue|float) }}

{% else %}

No billing records found.

{% endif %} {% elif report_type == 'medicine_inventory' %}

💊 Medicine Inventory Report

{% if low_stock_count > 0 or expired_count > 0 %}
{% if low_stock_count > 0 %} ⚠️ {{ low_stock_count }} medicines with low stock (less than 10 units) {% if expired_count > 0 %} {% endif %} {% endif %} {% if expired_count > 0 %} ⚠️ {{ expired_count }} expired medicines {% endif %}
{% endif %} {% if medicines %}
{% for medicine in medicines %} {% endfor %}
Medicine ID Name Category Stock Unit Price Expiry Date
{{ medicine[0] }} {{ medicine[1] }} {{ medicine[2] }} {{ medicine[3] }} ${{ "%.2f"|format(medicine[4]|float) }} {{ medicine[5] if medicine[5] else 'N/A' }}
{% else %}

No medicines found.

{% endif %} {% else %}

Please select a report type.

{% endif %}
{% endblock %}