<?PHP
//set_time_limit(300);
include 'connection.php';
error_reporting(0);



$sql4 = "SELECT * FROM NAA_YEAR_MST ORDER BY YEAR_CODE DESC";
    $parse = ociparse($conn, $sql4);
    oci_execute($parse);

    while ($row = oci_fetch_assoc($parse)) {
        $batch[] = $row;
    }

    // var_dump($cadre);
    oci_free_statement($parse);





$sql = "SELECT * FROM naa_members WHERE MEM_MOBILE_NO = '$MEM_MOBILE_NO'
    and fngetpass(PASSWORD) = '$PASSWORD'";
    // print_r($sql);

    $parse = ociparse($conn, $sql);
    oci_execute($parse);

    while ($row = oci_fetch_assoc($parse)) {
        $test[] = $row;
    }

    // var_dump($cadre);
    oci_free_statement($parse);


if (isset($_POST['submit'])) {

    $MEM_MOBILE_NO = $_POST['MEM_MOBILE_NO'];
    $PASSWORD = $_POST['PASSWORD'];


    $sql = "SELECT * FROM naa_members WHERE MEM_MOBILE_NO = '$MEM_MOBILE_NO'
    and fngetpass(PASSWORD) = '$PASSWORD'";
    // print_r($sql);

    $parse = ociparse($conn, $sql);
    oci_execute($parse);

    while ($row = oci_fetch_assoc($parse)) {
        $test[] = $row;
    }

    // var_dump($cadre);
    oci_free_statement($parse);


    $MEM_ID = $test[0]['MEM_ID'];
    // echo "$MEM_ID";

    
}




$bool = true;

/* Data Filter End */

?>

<!DOCTYPE html>


<html lang="en">

<head>
    <!-- Google tag (gtag.js) -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-GQPGJ4YN30"></script>
    <script>
        window.dataLayer = window.dataLayer || [];

        function gtag() {
            dataLayer.push(arguments);
        }
        gtag('js', new Date());

        gtag('config', 'G-GQPGJ4YN30');
    </script>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>75 Year's Celebration Program</title>
    <!-- Bootstrap CSS -->
    <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">


    <!-- pdf and excel data css starts  -->
    <!-- datatable  -->
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.24/css/jquery.dataTables.css">
    <link href="https://nightly.datatables.net/buttons/css/buttons.dataTables.css?_=c6b24f8a56e04fcee6105a02f4027462.css" rel="stylesheet" type="text/css" />
    <!-- pdf and excel data css ends  -->

    <!-- Add Font Awesome CSS (you can customize the link according to your needs) -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">

</head>
</head>

<style>
    img {
        display: block;
        margin-left: auto;
        margin-right: auto;
    }

    .queen {
        margin-top: 0px;
    }

    @media only screen and (max-width: 900px) {
        @media only screen and (max-width: 900px) {
            .queen {
                margin-top: 70px;
            }

            .img {
                order: -1;
            }

            .main {
                order: 0;
            }
        }
    }

    /* for excel button design start */
    /* .dt-buttons {
            visibility: hidden;
        }

        .dt-buttons button:after {

            content: 'Download Excel';
            visibility: visible;
            background-color: #11c7e0;
            margin-left: 200px;
            padding: 10px;
            color: white;
            border-radius: 11px;
            font-size: 15px;
        }

        .btn .btn-info {
            margin-bottom: -35px !important;
            margin-left: 385px !important;
        } */


    .pdf-header {
        background-color: #007bff;
        color: #fff;
    }

    /* Add this style for the Excel button image */
    .excel-button::after {
        content: url('./images/xls.png');
        /* Replace with the path to your Excel icon */
        float: right;
        margin-top: 3px;
        margin-left: 10px;
        width: 20px;
        /* Adjust the width as needed */
        height: 20px;
    }



    .pdf-button::after {
        content: url('./images/pdf.png');
        /* Replace with the path to your Excel icon */
        float: right;
        margin-top: 3px;
        margin-left: 10px;
        width: 20px;
        /* Adjust the width as needed */
        height: 20px;
    }

    /* for excel button design start */


    .header img {
        float: left;
        width: 90px;
        height: 90px;
        /* background: #555; */
    }

    .header h2,
    h5 {
        position: relative;
    }

    @media only screen and (max-width: 600px) {




        .header img {
            float: left;
            width: 80px;
            height: 80px;
            /* background: #555; */
        }

        .header h1,
        h2,
        h3,
        h4,
        h5 {
            position: relative;
            font-size: 15px;
            text-align: center;
            font-weight: bold;
        }

    }
</style>

<body style="background-color: #91DCFC;margin-top:30px;">
    <!-- all validation starts  -->
    <script>
        function myfun() {

            var massage_mobile = document.getElementById("MEM_MOBILE_NO").value;




            var mobile = /^[0-9]{11}$/;






            if (mobile.test(massage_mobile)) {
                document.getElementById("e_massage_mobile").innerHTML = " ";
            } else {
                document.getElementById("e_massage_mobile").innerHTML = "Mobile Number should be 11 digit";
                return false;
            }

        }
    </script>
    <!-- all validation ends  -->

    <style>
        body {
            margin: 20px auto;
            height: 100%;
            /* color: #6a6f8c; */
            background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.1516203893666842) 0%, rgba(1, 1, 1, 0.13201254622942926) 80%), url(./images/ndc_back.jpg);
            opacity: 0.9;
            /*background-color: #feb913;*/
            background-size: cover;
            background-repeat: no-repeat;
            background-position: center center;
            background-attachment: fixed;
        }
    </style>

    <div class="container">
        <div class="card" style="height: auto;background-color: #FFF;">
            <div class="card-body ">
            <div class="row" style="font-weight: bold;">
                                        <div class="col-md-2"></div>
                                        <div class="col-md-8">
                                            <div class="header">
                                                <img src="images/ndc_75.png" alt="logo" width="60px" height="60px" />
                                                <h4 class=" text-center" style="color: #212121; font-weight: bold;font-size: 20px;">75 Years Celebration Registration List </h4>
                                                <h4 class=" text-center" style="color: #212121; font-weight: bold;font-size: 20px;">Notre Dame College, Dhaka </h4>

                                            </div>
                                        </div>
                                        <div class="col-md-2"></div>
                                    </div>

                <div class="row">




                    <!-- <div class="col-md-12 col-12" style="margin-top: 70px;">
                        <div class="d-flex justify-content-center p-1" style="background-color: #e8b742;margin-bottom: 20px;">
                            <h5 style="text-align: center;">If you are registered then you can find your friends who are registered for the NDC 75 years celebration program</h5>

                        </div>
                    </div> -->


                    <!-- <div class="col-md-12 col-12">
                        <div class="form-body">
                            <form action="" method="POST" onsubmit="return myfun()">
                                <div class="row m-3">




                                    <div class="col-lg-4 col-md-4 col-12" style="margin-top: 30px;">
                                        <div class="row">
                                            <div class="col-lg-6 col-md-6 col-12">
                                                <label for="text" class="text-center font-weight-bold" style="margin-left: 40px;">Give your Mobile No <label style="color:red; font-weight:bold">*</label> :</label>
                                            </div>
                                            <div class="col-lg-6 col-md-6 col-12">
                                                <input type="text" onkeypress="return (event.charCode !=8 && event.charCode ==0 || ( event.charCode == 46 || (event.charCode >= 48 && event.charCode <= 57)))" class="form-control" name="MEM_MOBILE_NO" id="MEM_MOBILE_NO" placeholder="Give Your Mobile No" value="<?php if (isset($_POST['MEM_MOBILE_NO'])) echo $_POST['MEM_MOBILE_NO']; ?>" required>
                                                <span id="e_massage_mobile" style="color:red; font-weight:bold;font-size: 14px;"></span>


                                            </div>
                                        </div>


                                    </div>


                                    <div class="col-lg-4 col-md-4 col-12" style="margin-top: 30px;">
                                        <div class="row">
                                            <div class="col-lg-6 col-md-6 col-12">
                                            <label for="text" class="text-center font-weight-bold"> Passing Year <label style="color:red; font-weight:bold">*</label> :</label>
                                            </div>
                                            <div class="col-lg-6 col-md-6 col-12">
                                            <select class="form-control" name="YR_OF_PASS" id="YR_OF_PASS" required>
                                                <option value="">Select Batch </option>
                                                <?php
                                                for ($i = 0; $i < count($batch); $i++) {

                                                    echo "<option value='" . $batch[$i]["YEAR_CODE"] . "'>" . $batch[$i]["YEAR_NAME"] . "</option>";
                                                }

                                                ?>
                                            </select>

                                            </div>
                                        </div>


                                    </div>



                                    <div class="col-lg4 col-md-4  col-12 text-center" style="margin-top: 18px;">
                                        <button type="submit" class="btn btn-success m-3" name='submit' id='submit'>
                                            Log In
                                        </button>

                                    </div>
                                </div>


                            </form>



                        </div>
                    </div> -->







                </div>

                <?php
                if (isset($_POST['submit'])) {
                ?>

                    <style>
                        #searchInput {
                            margin-bottom: 10px;
                        }

                        #searchInput {
                            padding: 8px;
                            margin-right: 5px;
                            border: 1px solid #ccc;
                            border-radius: 4px;
                            box-sizing: border-box;
                        }

                        #searchButton {
                            padding: 8px 12px;
                            border: 1px solid #007BFF;
                            border-radius: 4px;
                            background-color: #007BFF;
                            color: #fff;
                            cursor: pointer;
                        }

                        #searchButton:hover {
                            background-color: #0056b3;
                        }
                    </style>


                    <?php
                    if ($test[0]['MEM_ID'] != null && $test[0]['BATCH_LEADER'] == 'Y') {
                    ?>
                        <div class="row" id="batch">



                            <div class="col-md-12 col-12">
                                
                                



                                <div class="table-responsive " id="invoice">

                                    


                                    <div class="row">
                                    <div class="col-md-6 col-12 text-center" >
                                        <?php
                                        if ($test[0]['ADMIN'] == 'Y') {
                                            ?>

                                            <a href="admin_search.php?id=<?php echo $user_friend[$i]['MEM_ID'] ?>" target="_blank" class="btn btn-success" style="font-size: 12px;">Admin Search </a>

                                            <?php

                                        }
                                        ?>
                                    

                                    
                                    

                                    </div>
                                    <div class="col-md-6 col-12 text-center mt-4">
                                        <input type="text" id="searchInput" placeholder="Search Your Friend" style="float: right;" onkeyup="filterTable()">
                                    </div>
                                </div>

                                <h4 class=" text-center" style="color: #212121; font-weight: bold;font-size: 20px;margin-top: 30px;color: green;">
                                                    Batch: <?php echo $user_friend[0]['YR_OF_PASS'] ?>
                                                </h4>


                                    <table class="table table-bordered table-striped" id="table_id" style="margin-top:30px;">
                                        <thead>
                                            <tr>
                                                <th scope="col" style="text-align: center;color:#BF4196;height:80px;">SL No.</th>
                                                <th scope="col" style="text-align: center;color:#BF4196;">Reg No.</th>
                                                <th scope="col" style="text-align: center;color:#BF4196;">Member Name</th>
                                                <th scope="col" style="text-align: center;color:#BF4196;">Member Photo</th>
                                                <th scope="col" style="text-align: center;color:#BF4196;">Mobile No.</th>
                                                <th scope="col" style="text-align: center;color:#BF4196;">Roll No </th>
                                                <!-- <th scope="col" style="text-align: center;color:#BF4196;">Batch</th> -->
                                                <th scope="col" style="text-align: center;color:#BF4196;">Channel</th>
                                                <th scope="col" style="text-align: center;color:#BF4196;">Total Person</th>
                                                <th scope="col" style="text-align: center;color:#BF4196;">Event Card</th>
                                                <th scope="col" style="text-align: center;color:#BF4196;">Reg Info</th>

                                            </tr>
                                        </thead>


                                        <tbody>
                                            <?php

                                            $serialNumber = 1;

                                            for ($i = 0; $i < count($user_friend); $i++) {
                                                if ($user_friend[$i]['TP'] == '1' || $user_friend[$i]['TP'] == '2') {
                                                    $abc = array(); // Initialize $abc for each row

                                                    foreach ($user_friend[$i] as $key => $data) {
                                                        if ($key === 'MEM_PHOTO') {
                                                            if (is_object($data) && get_class($data) === 'OCI-Lob') {
                                                                // Read binary data from CLOB
                                                                $lob = oci_new_descriptor($conn, OCI_D_LOB);
                                                                oci_lob_read($data, $lob);
                                                                $abc[$key] = base64_encode($lob->load());
                                                                $lob->free();
                                                            } else {
                                                                // Handle other types or strings here
                                                                $abc[$key] = is_object($data) ? $data->load() : $data;
                                                            }
                                                        } else {
                                                            $abc[$key] = $data;
                                                        }
                                                    }




                                            ?>

                                                    <tr <?php if ($user_friend[$i]['TP'] == '1') { ?> style="background-color: #e8b742;" <?php
                                                                                                                                                                     } ?>>
                                                        <td style="text-align: center;color:#66aa00;font-weight: bold;"><?php echo $serialNumber; ?></td>
                                                        <td style="text-align: center;color:brown;font-weight: bold;"><?php echo $user_friend[$i]['REG_NO'] ?></td>
                                                        <td scope="row" <?php if ($user_friend[$i]['TP'] == '1') { ?> style="text-align: center;color:#fff;font-weight: bold;" <?php } else if ($user_friend[$i]['TP'] == '2') { ?>style="color:#41BDBF;font-weight: bold;" <?php } ?>><?php echo $user_friend[$i]['MEM_NAME'] ?></td>
                                                        <td style="text-align: center;">
                                                            <?php if (isset($abc['MEM_PHOTO'])) : ?>
                                                                <img src="data:image/jpeg;base64,<?php echo $abc['MEM_PHOTO']; ?>" id="output_image" width="60px" height="60px" />
                                                            <?php endif; ?>
                                                        </td>
                                                        <td scope="row" style="text-align: center;color:#C1AD1F ;font-weight: bold;"><?php echo $user_friend[$i]['MEM_MOBILE_NO'] ?></td>
                                                        <td scope="row" style="text-align: center;color:#B70F3B;font-weight: bold;"><?php echo $user_friend[$i]['COLL_ROLL_NO'] ?></td>
                                                        <!-- <td scope="row" style="text-align: center;color:#66aa00;font-weight: bold;"><?php echo $user_friend[$i]['YR_OF_PASS'] ?></td> -->

                                                        <?php if ($user_friend[$i]['CHANNEL'] == 'Online') {
                                                        ?>
                                                            <td scope="row" style="text-align: center;color:#66aa00;font-weight: bold;"><?php echo $user_friend[$i]['CHANNEL'] ?></td>


                                                        <?php
                                                        } else {
                                                        ?>
                                                            <td scope="row" style="text-align: center;color:red;font-weight: bold;"><?php echo $user_friend[$i]['CHANNEL'] ?></td>

                                                        <?php
                                                        }  ?>




                                                        <td scope="row" style="text-align: center;color:#BF6741;font-weight: bold;"><?php
                                                                                                                                                                            $NO_OF_MEM = $user_friend[$i]['NO_OF_MEM'];
                                                                                                                                                                            $NO_OF_SPOUSE = $user_friend[$i]['NO_OF_SPOUSE'];
                                                                                                                                                                            $NO_OF_CHILD = $user_friend[$i]['NO_OF_CHILD'];
                                                                                                                                                                            $TOT_MEM = $NO_OF_MEM + $NO_OF_SPOUSE + $NO_OF_CHILD;
                                                                                                                                                                            echo $TOT_MEM
                                                                                                                                                                            ?></td>

                                                        <td scope="row" style="text-align: center;color:white;font-weight: bold;">
                                                        <a href="https://ndcaa.mcampusbd.com/itbl.php?id=<?php echo $user_friend[$i]['MEM_ID'] ?>" target="_blank" class="btn btn-success" style="font-size: 12px;">Download </a>
                                                    
                                                        </td>

                                                        <td scope="row" style="text-align: center;color:white;font-weight: bold;">
                                                        <a href="edit_info.php?id=<?php echo $user_friend[$i]['MEM_ID'] ?>" target="_blank" class="btn btn-success" style="font-size: 12px;">Update </a>
                                                    
                                                        </td>


                                                    </tr>




                                                <?php
                                                    $serialNumber++;
                                                }
                                            }

                                            for ($i = 0; $i < count($output1); $i++) {
                                                ?>

                                                <tr style="background-color: #51B563;">
                                                    <td style="text-align: center;color:white;font-weight: bold;"><?php echo $output1[$i]['REG_NO'] ?></td>
                                                    <td style="text-align: center;color:white;font-weight: bold;"></td>
                                                    <td scope="row" style="text-align: center;color:white;font-weight: bold;"><?php echo $output1[$i]['MEM_NAME'] ?></td>
                                                    <td scope="row" style="text-align: center;color:white;font-weight: bold;"><?php echo $output1[$i]['MEM_MOBILE_NO'] ?></td>
                                                    <td scope="row" style="text-align: center;color:#C1AD1F ;font-weight: bold;"><?php echo $output1[$i]['MEM_MOBILE_NO'] ?></td>
                                                    <td scope="row" style="text-align: center;color:white;font-weight: bold;"><?php echo $output1[$i]['MEM_MOBILE_NO'] ?></td>
                                                    <!-- <td scope="row" style="text-align: center;color:white;font-weight: bold;"><?php echo $output1[$i]['YR_OF_PASS'] ?></td> -->
                                                    <td scope="row" style="text-align: center;color:white;font-weight: bold;"><?php echo $output1[$i]['MEM_MOBILE_NO'] ?></td>
                                                    <td scope="row" style="text-align: center;color:white;font-weight: bold;"><?php
                                                                                                                                                                        $NO_OF_MEM = $output1[$i]['NO_OF_MEM'];
                                                                                                                                                                        $NO_OF_SPOUSE = $output1[$i]['NO_OF_SPOUSE'];
                                                                                                                                                                        $NO_OF_CHILD = $output1[$i]['NO_OF_CHILD'];
                                                                                                                                                                        $TOT_MEM = $NO_OF_MEM + $NO_OF_SPOUSE + $NO_OF_CHILD;
                                                                                                                                                                        echo $TOT_MEM
                                                                                                                                                                        ?></td>
                                                                                                                                                                        <td scope="row" style="text-align: center;color:white;font-weight: bold;"><?php echo $output1[$i]['MEM_MOBILE_NO'] ?></td>

                                                                                                                                                                        <td scope="row" style="text-align: center;color:white;font-weight: bold;"><?php echo $output1[$i]['MEM_MOBILE_NO'] ?></td>


                                                </tr>






                                            <?php


                                            }
                                            ?>





                                        </tbody>
                                    </table>
                                </div>
                            </div>

                        </div>

                    <?php
                    }else{
                        ?>
                        

                    <div class="row" id="batch_n">
                        <div class="col-md-12">
                            <h5 style="text-align:center;color: red;">You Are not Eligible</h5>
                        </div>
                    </div>

                        <?php
                    }
                    ?>




                <?php
                }
                ?>
            </div>
        </div>
    </div>





    <!-- chart and others script starts  -->
    <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.js"></script>
    <!-- chart and others script ends  -->


    <!-- excel and pdf script starts  -->
    <!-- DataTables CSS -->
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.11.5/css/jquery.dataTables.min.css">

    <!-- DataTables Buttons CSS -->
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/2.0.0/css/buttons.dataTables.min.css">

    <!-- DataTables JS -->
    <script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
    <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js"></script>

    <!-- DataTables Buttons JS -->
    <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/buttons/2.0.0/js/dataTables.buttons.min.js"></script>
    <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/buttons/2.0.0/js/buttons.print.min.js"></script>
    <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/buttons/2.0.0/js/buttons.html5.min.js"></script>
    <script type="text/javascript" charset="utf8" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
    <script type="text/javascript" charset="utf8" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/pdfmake.min.js"></script>
    <script type="text/javascript" charset="utf8" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/vfs_fonts.js"></script>
    <!-- excel and pdf script ends  -->


    <script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.9.2/html2pdf.bundle.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.4.0/jspdf.umd.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.3/xlsx.full.min.js"></script>











    <!-- <script>
        $(document).ready(function() {
            $('#myTable').DataTable({
                dom: 'lBfrtip',
                buttons: [
                    'excel'
                ]
            });
        });
    </script> -->

    <!-- <script>
        $(document).ready(function() {
            var dataTable = $('#myTable').DataTable({
                dom: 'Bfrtip',
                buttons: [{
                        extend: 'pdfHtml5',
                        text: 'Download',
                        className: 'pdf-button',
                        customize: function(doc) {
                            // Center the content of the table in the PDF
                            var colCount = new Array(doc.content[1].table.body[0].length + 1).join('*').split('').map(function() {
                                return 'auto';
                            });

                            doc.styles.tableBody = {
                                valign: 'middle',
                                halign: 'center'
                            };
                            doc.content[1].table.widths = colCount;

                            // Check the number of rows
                            var rowCount = dataTable.rows().count();

                            // Set orientation based on the number of rows
                            doc.pageOrientation = (rowCount < 10) ? 'landscape' : 'portrait';

                            // Apply custom styles to the header
                            doc.content[1].table.headerRows = 1; // Ensure the header is included in the first row
                            doc.styles.tableHeader = {
                                fillColor: '#ECF0EC',
                                textColor: '#fff',
                                fontSize: 12,
                                bold: true
                            };

                            // Center the entire table on the page
                            doc.content[1].layout = {
                                hLineWidth: function(i, node) {
                                    return 1; // Set horizontal line width
                                },
                                vLineWidth: function(i, node) {
                                    return 1; // Set vertical line width
                                },
                                hLineColor: function(i, node) {
                                    return [0, 0, 0]; // Set black color for horizontal lines
                                },
                                vLineColor: function(i, node) {
                                    return [0, 0, 0]; // Set black color for vertical lines
                                },
                                paddingLeft: function(i, node) {
                                    return 4;
                                },
                                paddingRight: function(i, node) {
                                    return 4;
                                },
                                paddingTop: function(i, node) {
                                    return 4;
                                },

                                halign: 'center',
                                valign: 'middle' // Added to center content vertically
                            };
                        }
                    },
                    {
                        extend: 'excelHtml5', // Add Excel button
                        text: 'Download',
                        titleAttr: 'Export to Excel',
                        className: 'excel-button', // Add a class to the Excel button
                        exportOptions: {
                            modifier: {
                                page: 'all'
                            }
                        }
                    }
                ]
            });
        });
    </script> -->









    <!-- search table buttuon starts  -->
    <script>
        function filterTable() {
            // Get input value and convert to lowercase for case-insensitive search
            var input = document.getElementById('searchInput').value.toLowerCase();

            // Get all table rows
            var rows = document.getElementById('table_id').getElementsByTagName('tbody')[0].getElementsByTagName('tr');

            // Iterate through rows and hide/show based on search input
            for (var i = 0; i < rows.length; i++) {
                var rowVisible = false;

                // Iterate through all columns (td elements) in the current row
                for (var j = 0; j < rows[i].cells.length; j++) {
                    var cell = rows[i].cells[j];
                    var cellValue = cell.textContent || cell.innerText;

                    // Check if the cell value contains the search input
                    if (cellValue.toLowerCase().indexOf(input) > -1) {
                        rowVisible = true;
                        break; // Break out of the loop if a match is found in any column
                    }
                }

                // Set the display property based on whether the row should be visible
                rows[i].style.display = rowVisible ? '' : 'none';
            }
        }
    </script>

    <!-- search table buttuon ends  -->




</body>

</html>