<div class="container-fluid">
    <!-- Page Heading -->
    <div class="row">
        <div class="col-md-6">
            <h1 class="h3 mb-2 text-gray-800">UTI Pan Card</h1>
        </div>
    </div>
    <div class="row">
        <div class="col-md-6">
            <div class="card shadow mb-4">
                <div class="card-header py-3">
                    <h6 class="m-0 font-weight-bold text-primary">Coupon Request </h6>
                </div>
                <div class="card-body">
                    <form name="ra" id="ra" method="post" action="send_uti_psa_request.php" onsubmit="return false;">
                        <div class="row">
                            <div class="col-md-12" id="rmoney">
                                <div class="row">
                                    <div class="col-md-12" id="psa_id">
                                            <label>PSA ID</label>
                                            <input type="text" name="psa_id" id="psa_id" class="form-control" value="<?= $o->psa_id; ?>" readonly />
                                    </div>
                                    <div class="col-md-12">
                                        <label>Coupon Qty</label>
                                        <input type="number" name="coupon_qty" id="coupon_qty" class="form-control" value="1" placeholder="Coupon Qty" min="1" required="required" />
                                    </div>

                                    <div class="col-md-12" id="t_mode">
                                        <label>Total Amount</label>
                                        <input type="number" name="total_amount" id="total_amount" value="<?= $o->coupon_price; ?>" class="form-control" readonly />
                                    </div>
                                    <div class="col-md-12 top_margin_10">

                                        <input type="hidden" name="updte" id="updte" value="1" />
                                        <input type="submit" name="submit" id="submit" class="btn btn-primary" value="Send Request" />
                                        <input type="button" name="back" id="back" class="btn btn-secondary" value="Back" onclick="history.back(-1)" />
                                    </div>
                                </div>
                            </div>
                            <div id="processing" style="display:none;" class="col-md-12 text-center top_margin_10">
                                <?php include $path . "processing.php"; ?>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="col-md-6">
            <div class="card shadow mb-4">
                <div class="card-header py-3">
                    <h6 class="m-0 font-weight-bold text-primary">Your Information</h6>
                </div>
                <div class="card-body">
                    <div class="row">
                        <div class="col-md-12">
                            <table class="table-striped table-bordered" width="100%" cellspacing="4" cellpadding="4">
                                <tr>
                                    <td width="35%">Name</td>
                                    <th width="65%" id="t_name"><?= $o->name; ?></th>
                                </tr>
                                <tr>
                                    <td width="35%">Shop Name</td>
                                    <th width="65%" id="t_username"><?=$o->company_name?></th>
                                </tr>
                                <tr>
                                    <td width="35%">PSA ID</td>
                                    <th width="65%" id="psa_id"><?= $o->psa_id; ?></th>
                                </tr>
                                <tr>
                                    <td width="35%">Coupon Price</td>
                                    <th width="65%" id="coupon_price"><?= $o->coupon_price; ?></th>
                                </tr>
                                <tr>
                                    <td width="35%">PSA Status</td>
                                    <th width="65%" id="psa_status">
                                         <?php if ($o->psa_status == "1") { ?> 
                                        <span class="fa_approve">Active</span>
                                    <?php } else { ?> 
                                        <span class="fa_reject">Deactive</span>
                                    <?php } ?>   
                                        </th>
                                </tr>
                                <tr>
                                    <td width="35%">Mobile</td>
                                    <th width="65%" id="t_mobile"><?= $o->mobile; ?></th>
                                </tr>
                                <tr>
                                    <td width="35%">Email</td>
                                    <th width="65%" id="t_email"><?= $o->email; ?></th>
                                </tr>
                                <tr>
                                    <td width="35%">Balance Amount</td>
                                    <th width="65%" ><i class="fa fa-rupee-sign"></i> <span id="t_balance"><?= round($o->amount_balance,3); ?></span></th>
                                </tr>

                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- DataTales Example -->
</div>
<div class="container-fluid">
    <!-- Page Heading -->
    <div class="row">
        <div class="col-md-6">
            <h1 class="h3 mb-2 text-gray-800">Coupon Request List</h1>
        </div>
    </div>
    <!-- DataTales Example -->

    <div class="card shadow mb-4">
        <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
            <div class="col-md-12 text-left ">
                List of Coupon Request
            </div>
        </div>
        <div class="card-body">
            <div class="row">
                <div class="col-md-12 ">
                    <table class="table table-responsive-lg table-striped table-bordered" width="100%" id="dataTable">
                        <thead>
                            <tr style="background-color:#205f56 !important; color:white !important; ">
                                <th>Request Date</th>
                                <th>Coupon Qty</th>
                                <th>Amount</th>
                                <th>Details</th> 
                                <th>Status</th>
                            </tr>
                        </thead>
                        <?php for ($i = 0; $i < $rows; $i++) { ?>
                            <tr>
                                <td><?= format_date1($res[$i]['created_at']); ?></td>
                                <td><?= $res[$i]['coupon_qty']; ?></td>
                                <td> <i class="fa fa-rupee-sign"></i> <?= $res[$i]['amount'] ?></td>
                                <td>Ref Number : <?= $res[$i]['ref_number'] ?>  <br/> Txn Id : <?= $res[$i]['opid'] ?><br/> <?= $res[$i]['comment'] ?></td>
                                <td> <?php if ($res[$i]['status'] == "Pending") { ?> 
                                        <span class="fa_pending">Pending</span>
                                    <?php } else if ($res[$i]['status'] == "Failed") { ?> 
                                        <span class="fa_reject">Rejected</span>
                                    <?php } else if ($res[$i]['status'] == "Success") { ?> 
                                        <span class="fa_approve">Transferred</span>
                                    <?php } ?></td>
                            </tr>
                        <?php } ?>     
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>