<?php include'header.php'; ?>	

<div class="app-content content">
    <div class="content-overlay"></div>
    <div class="content-wrapper">
        <div class="content-header row"></div>
        <div class="content-body">

                <div class="row">
                    <div class="col-12">
                        <div class="card">

                            <div class="card-header">
                                <h4 class="card-title mb-1">Bank Details</h4>
                            </div>

                            <div class="card-content">
                                <div class="card-body">

<!--<div class="modal-info d-inline-block">-->
<!--    <button type="button" class="btn btn-info" data-toggle="modal" data-target="#addPlan">Add Bank Details</button>-->

    <!-- Add Plan Modal -->
<!--    <div class="modal fade text-left" id="addPlan" tabindex="-1" role="dialog">-->
<!--        <div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable" role="document">-->
<!--            <div class="modal-content">-->
                
<!--                <div class="modal-header bg-info">-->
<!--                    <h5 class="modal-title white">Add New Bank Details</h5>-->
<!--                    <button type="button" class="close" data-dismiss="modal">-->
<!--                        <i class="bx bx-x"></i>-->
<!--                    </button>-->
<!--                </div>-->

<!--                <div class="modal-body">-->

<!--<form class="form" action="" method="POST">-->
<!--    <div class="form-body">-->
<!--        <div class="row">-->
<!--            <div class="col-md-4 mt-1">-->
<!--                <div class="form-label-group position-relative has-icon-left">-->
<!--                    <input type="text" class="form-control" name="bank_name" placeholder="bank Name" required>-->
<!--                    <div class="form-control-position"><i class="bx bx-package"></i></div>-->
<!--                    <label>Bank Name</label>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="col-md-4 mt-1">-->
<!--                <div class="form-label-group position-relative has-icon-left">-->
<!--                    <input type="text" class="form-control" name="account_number" placeholder="Account Number" required>-->
<!--                    <div class="form-control-position"><i class="bx bx-package"></i></div>-->
<!--                    <label>Account Number</label>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="col-md-4 mt-1">-->
<!--                <div class="form-label-group position-relative has-icon-left">-->
<!--                    <input type="text" class="form-control" name="ifsc_code" placeholder="Ifsc Code" required>-->
<!--                    <div class="form-control-position"><i class="bx bx-package"></i></div>-->
<!--                    <label>Ifsc Code</label>-->
<!--                </div>-->
<!--            </div>-->
<!--             <div class="col-md-4 mt-1">-->
<!--                <div class="form-label-group position-relative has-icon-left">-->
<!--                    <input type="file" class="form-control" name="qr_code" placeholder="Qr Code" required>-->
<!--                    <div class="form-control-position"><i class="bx bx-package"></i></div>-->
<!--                    <label>Qr Code</label>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="col-md-4 mt-1">-->
<!--                <div class="form-label-group position-relative has-icon-left">-->
<!--                    <input type="text" class="form-control" name="upi_id" placeholder="Upi id" required>-->
<!--                    <div class="form-control-position"><i class="bx bx-package"></i></div>-->
<!--                    <label>Upi id</label>-->
<!--                </div>-->
<!--            </div>-->
            <!-- Buttons -->
<!--            <div class="col-md-12 d-flex justify-content-end">-->
                
<!--                <button type="submit" class="btn btn-primary mr-1 mb-1" name="add_bank_details">Submit</button>-->
<!--                <button type="reset" class="btn btn-light-secondary mr-1 mb-1">Reset</button>-->
<!--            </div>-->

<!--        </div>-->
<!--    </div>-->
<!--</form>-->

<!--                </div>-->

<!--                <div class="modal-footer">-->
<!--                    NOTE: <i>Please Enter All Detail Carefully.</i>-->
<!--                </div>-->

<!--            </div>-->
<!--        </div>-->
<!--    </div>-->
<!--</div>-->


<!-- CUSTOMER LIST TABLE -->
<div class="table-responsive col-md-12 s-right mt-2">
    <table class="table table-striped">
        <thead>
            <tr>
                <th>Bank Name</th>
                <th>Account Number</th>
                <th>ifsc code</th>
                <th>upi id</th>
                <th>qr code</th>
                <th>Action</th>
            </tr>
        </thead>

        <tbody>
<?php
$obj->sql("SELECT * FROM bank_details ORDER BY id DESC");
$result = $obj->getResult();
foreach ($result as $row) { ?>
    <tr>
        <td><?php echo $row['bank_name']; ?></td>
        <td><?php echo $row['account_number']; ?></td>
        <td><?php echo $row['ifsc_code']; ?></td>
        <td><?php echo $row['upi_id']; ?></td>
        <td>
        <img Src="../assets/qrcode/<?php echo $row['qr_code']; ?>"width='100px'> 
        </td>
        <td>
            <button type="button" title="Edit" data-toggle="modal" data-target="#edit<?php echo $row['id']; ?>" class="btn btn-icon rounded-circle btn-light-success mr-1"><i class="bx bxs-pencil"></i></button>
            	<div class="modal fade text-left" id="edit<?php echo $row['id']; ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel110" style="display: none;" aria-hidden="true">
            		<div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable" role="document">
            			<div class="modal-content">
            				<div class="modal-header bg-info">
            					<h5 class="modal-title white" id="myModalLabel110">Edit</h5>
            					<button type="button" class="close" data-dismiss="modal" aria-label="Close">
            						<i class="bx bx-x"></i>
            					</button>
            				</div>
            				<div class="modal-body">									
                                <form class="form" action="" method="POST" enctype="multipart/form-data">
                                    <input type="hidden" name="id" value="<?php echo $row['id']; ?>">
                                    <div class="form-body">
                                        <div class="row">
                                
                                            <div class="col-md-4 mt-1">
                                                <div class="form-label-group position-relative has-icon-left">
                                                    <input type="text" class="form-control" name="bank_name" placeholder="Bank Name" value="<?php echo $row['bank_name']; ?>" required>
                                                    <div class="form-control-position"><i class="bx bx-package"></i></div>
                                                    <label>Bank Name</label>
                                                </div>
                                            </div>
                                            <div class="col-md-4 mt-1">
                                                <div class="form-label-group position-relative has-icon-left">
                                                    <input type="text" class="form-control" name="account_number" placeholder="Account Number" value="<?php echo $row['account_number']; ?>" required>
                                                    <div class="form-control-position"><i class="bx bx-package"></i></div>
                                                    <label>Account Number</label>
                                                </div>
                                            </div>
                                            <div class="col-md-4 mt-1">
                                                <div class="form-label-group position-relative has-icon-left">
                                                    <input type="text" class="form-control" name="ifsc_code" placeholder="Ifsc Code" value="<?php echo $row['ifsc_code']; ?>" required>
                                                    <div class="form-control-position"><i class="bx bx-package"></i></div>
                                                    <label>Ifsc Code</label>
                                                </div>
                                            </div>
                                             <div class="col-md-4 mt-1">
                                                <div class="form-label-group position-relative has-icon-left">
                                                    <input type="file" class="form-control" name="qr_code" placeholder="Qr Code" value="<?php echo $row['qr_code']; ?>"> 
                                                    <div class="form-control-position"><i class="bx bx-package"></i></div>
                                                    <label>Qr Code</label>
                                                </div>
                                            </div>
                                             <div class="col-md-4 mt-1">
                                                <div class="form-label-group position-relative has-icon-left">
                                                    <input type="text" class="form-control" name="upi_id" placeholder="Upi id" value="<?php echo $row['upi_id']; ?>" required>
                                                    <div class="form-control-position"><i class="bx bx-package"></i></div>
                                                    <label>UPi id</label>
                                                </div>
                                            </div>
                                            <div class="col-md-12 d-flex justify-content-end">
                                                <button type="submit" class="btn btn-primary mr-1 mb-1" name="edit_bank_details">Submit</button>
                                                <button type="reset" class="btn btn-light-secondary mr-1 mb-1">Reset</button>
                                            </div>
                                
                                        </div>
                                    </div>
                                </form>
            
                            </div>
            				<div class="modal-footer">
            					NOTE: <i>Fill Details Carefully.</i>
            				</div>
            			</div> 
            		</div>
            	</div>              

            <!--<button type="button" title="Delete" data-toggle="modal" data-target="#delete<?php echo $row['id']; ?>" -->
            <!--class="btn btn-icon rounded-circle btn-light-danger mr-1">-->
            <!--    <i class="bx bxs-trash"></i>-->
            <!--</button>-->
            <!--<div class="modal fade text-left" id="delete<?php echo $row['id']; ?>" tabindex="-1" role="dialog">-->
            <!--    <div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable">-->
            <!--        <div class="modal-content">-->
            <!--            <div class="modal-header bg-danger">-->
            <!--                <h5 class="modal-title white">Delete</h5>-->
            <!--                <button type="button" class="close" data-dismiss="modal"><i class="bx bx-x"></i></button>-->
            <!--            </div>-->
            
            <!--            <div class="modal-body">-->
            <!--                <form class="form" action="" method="POST">-->
            <!--                    <input type="hidden" name="id" value="<?php echo $row['id']; ?>">-->
            <!--                    <input type="hidden" name="table" value="bank_details">-->
            
            <!--                    <div class="d-flex justify-content-end">-->
            <!--                        <button type="submit" class="btn btn-danger mr-1 mb-1" name="delete">Delete</button>-->
            <!--                        <button type="reset" class="btn btn-light-secondary mr-1 mb-1">Reset</button>-->
            <!--                    </div>-->
            <!--                </form>-->
            <!--            </div>-->
            
            <!--            <div class="modal-footer">-->
            <!--                NOTE: <i>This action cannot be undone.</i>-->
            <!--            </div>-->
            <!--        </div>-->
            <!--    </div>-->
            <!--</div>-->
        </td>
    </tr>
<?php } ?>
        </tbody>
    </table>
</div>

                        </div><!-- card-content -->
                    </div><!-- card -->
                </div>
            </div>
        </section>

    </div>
</div>
</div>
</div>

<div class="sidenav-overlay"></div>

<?php include'footer.php'; ?>
