<?php 
include('header.php');
?>
<!--start page wrapper -->
<div class="page-wrapper">
<div class="page-content">
    <div class="card radius-10">
        <div class="card-body">
            <div class="d-flex align-items-center">
                <div>
                    <h5 class="mb-0">LOST PAN FIND WITH DETAILALL LIST</h5>
                    <h6 class="mb-0 text-uppercase">Apply New Data 
                        <a href="Pan_find.php" target="_blank" class="btn btn-success">Apply</a>
                    </h6>
                </div>
            </div>
            <hr>
            <div class="table-responsive">
                <table id="example2" class="table align-middle mb-0">
                    <thead class="table-light">
                        <tr>
                            <th class="text-center">SL.</th>
                            <th class="text-center">Application No</th>
                            <th class="text-center">Apply Date</th>
                            <th class="text-center">Aadhar No</th>
                            <th class="text-center">Pan No</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php
                        // Fetch data
                        if($udata['type']=='admin') {
                            $res = mysqli_query($ahk_conn, "SELECT * FROM instantpan_find ORDER BY id DESC");
                        } else {
                            $res = mysqli_query($ahk_conn, "SELECT * FROM instantpan_find WHERE username='".$udata['phone']."' ORDER BY id DESC");
                        }

                        if(mysqli_num_rows($res) > 0){
                            $x = 0;
                            while($data = mysqli_fetch_assoc($res)){
                                $x++;
                                echo '<tr>
                                    <td class="text-center">'. $x .'</td>
                                    <td class="text-center"><span class="badge rounded-pill bg-light text-dark">'. $data['application_no'] .'</span></td>
                                    <td class="text-center">'. strtoupper($data['date']) .'</td>
                                    <td class="text-center"><span class="badge rounded-pill bg-light text-dark">'. strtoupper($data['aadhaar_no']) .'</span></td>
                                    <td class="text-center"><span class="badge rounded-pill bg-light text-dark">'. strtoupper($data['pan_no']) .'</span></td>
                                </tr>';
                            }
                        }
                        ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
</div>
<!--end page wrapper -->
<?php 
include('footer.php');
?>

<!-- Bootstrap & Plugins JS -->
<script src="../template/ahkweb/assets/js/bootstrap.bundle.min.js"></script>
<script src="../template/ahkweb/assets/js/jquery.min.js"></script>
<script src="../template/ahkweb/assets/plugins/simplebar/js/simplebar.min.js"></script>
<script src="../template/ahkweb/assets/plugins/metismenu/js/metisMenu.min.js"></script>
<script src="../template/ahkweb/assets/plugins/perfect-scrollbar/js/perfect-scrollbar.js"></script>
<script src="../template/ahkweb/assets/js/index.js"></script>
<script src="../template/ahkweb/assets/js/app.js"></script>

<!-- Datatables -->
<script src="../template/ahkweb/assets/plugins/datatable/js/jquery.dataTables.min.js"></script>
<script src="../template/ahkweb/assets/plugins/datatable/js/dataTables.bootstrap5.min.js"></script>
<script src="../template/ahkweb/assets/plugins/datatable/js/dataTables.buttons.min.js"></script>
<script src="../template/ahkweb/assets/plugins/datatable/js/buttons.bootstrap5.min.js"></script>
<script src="../template/ahkweb/assets/plugins/datatable/js/jszip.min.js"></script>
<script src="../template/ahkweb/assets/plugins/datatable/js/pdfmake.min.js"></script>
<script src="../template/ahkweb/assets/plugins/datatable/js/vfs_fonts.js"></script>
<script src="../template/ahkweb/assets/plugins/datatable/js/buttons.html5.min.js"></script>
<script src="../template/ahkweb/assets/plugins/datatable/js/buttons.print.min.js"></script>
<script src="../template/ahkweb/assets/plugins/datatable/js/buttons.colVis.min.js"></script>

<script>
$(document).ready(function() {
    var table = $('#example2').DataTable({
        lengthChange: false,
        buttons: [ 'copy', 'excel', 'pdf', 'print', 'colvis' ]
    });

    table.buttons().container()
        .appendTo('#example2_wrapper .col-md-6:eq(0)');
});
</script>
