{{>header}}

<title>Filtered Product Requests</title>

<div class="row p-2" style="margin: 0px !important;">
    <div class="col-md-12">
        <div class="card mt-2">
            <div class="card-header" style="background-color:white; color:#4B0F77;">
                <h4><b>Filtered Requests</b></h4>
                <a href="/admin/v1/requested-products" class="btn btn-outline-secondary float-end btn-sm"
                    style="background-color:#4B0F77; color:white;">
                    Back to All Requests
                </a>
            </div>
            <div class="card-body p-2">
                {{#if error}}
                <div class="alert alert-danger">{{error}}</div>
                {{/if}}

                {{#if success}}
                <div class="alert alert-success">{{success}}</div>
                {{/if}}

                {{#if allRequests.length}}
                <div class="table-responsive">
                    <table id="example4" class="table table-bordered table-striped" aria-describedby="example1_info">
                        <thead>
                            <tr>
                                <th>S.No</th>
                                <th>First Name</th>
                                <th>Last Name</th>
                                <th>Phone</th>
                                <th>Product Id</th>
                                <th>Product Name</th>
                                <th>Price</th>
                                <th>Request Id</th>
                                <th>Requested Quantity</th>
                                <th>Note</th>
                                <th>Community Name</th>
                                <th>Date</th>
                                <th>Status</th>
                            </tr>
                        </thead>
                        <tbody>
                            {{#each allRequests}}
                            <tr>
                                <td>{{inc @index}}</td>
                                <td>{{this.user.firstName}}</td>
                                <td>{{this.user.lastName}}</td>
                                <td>{{this.user.phone}}</td>
                                <td>{{this.product.productId}}</td>
                                <td>{{this.product.productName}}</td>
                                <td>{{this.product.price}}</td>
                                <td>{{this.requestId}}</td>
                                <td>{{this.quantity}}</td>
                                <td>{{this.note}}</td>
                                <td>{{this.community.communityName}}</td>
                                <td>{{DateTime this.createdAt}}</td>
                                <td>{{this.status}}</td>
                            </tr>
                            {{/each}}
                        </tbody>
                    </table>
                </div>
                {{else}}
                <div class="alert text-center" style="background-color: #f0f0f0; color: #333;">
                    No order transactions found for the selected dates.
                </div>
                {{/if}}
            </div>
        </div>
    </div>
</div>
{{>footer}}
</body>

</html>