{% extends "base.html" %}
{% block title %}Material Consumption{% endblock %}

{% block content %}
<div class="container  mt-4">
    <div class="d-flex justify-content-between align-items-center mb-4">
        <h2>Material Consumption</h2>
        <a href="{% url 'create_material_consumption' %}" class="btn btn-success">
            <i class="bi bi-plus-circle"></i> Add New Consumption
        </a>
    </div>
    <div class="card mb-4">
        <div class="card-body">
            <div class="row">
                <div class="col-md-6">
                    <div class="input-group mb-3">
                        <input type="text" class="form-control table-search" placeholder="Search..." data-table="poTable">
                    </div>
                </div>
                   
            </div>
        </div>
    </div>

    <div class="card">
        <div class="card-body">
            <div class="table-responsive">
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th>Project</th>
                            <th>Date</th>
                            <th>Remarks</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for record in consumptions %}
                            <tr>
                                <td>{{ record.project }}</td>
                                <td>{{ record.date }}</td>
                                <td>{{ record.remarks }}</td>
                                <td>
                                    <a href="{% url 'material_consumption_detail' record.id %}" class="btn btn-sm btn-primary">iew</a>
                                </td>
                            </tr>
                        {% empty %}
                            <tr><td colspan="4">No records found.</td></tr>
                        {% endfor %}
                    </tbody>
                </table>
            </div>
        </div>
     </div>
</div>


{% endblock %}

