<?php include 'header.php';
include 'admin/config.php';
?>


<!-- breadcrumb -->
<div class="site-breadcrumb" style="background: url(assets/img/home/s0.png)">
    <div class="container">
        <h2 class="breadcrumb-title">Tender Notification</h2>
        <ul class="breadcrumb-menu">
            <li><a href="index.php">Home</a></li>
            <li class="active">Tender Notification</li>
        </ul>
    </div>
</div>
<!-- breadcrumb end -->


<!-- course-area -->
<div class="course-area py-80">
    <div class="container">
        <div class=" text-center mb-4">
            <h2 class="mb-3">
                Tender Notification
            </h2>

        </div>
        <table class="table annual-report text-center table-bordered">
            <thead>
                <tr class="table-primary ">
                    <th scope="col">Tender Notification</th>
                    <th scope="col">View / Download</th>
                </tr>

            </thead>
            <tbody class="">
                <?php
                $sql = "SELECT * FROM `tender_notification` ORDER BY year DESC"; // Order by year (latest first)
                $query = mysqli_query($con, $sql);
                if ($query) {
                    while ($row = mysqli_fetch_assoc($query)) {
                        $year = $row['year'];
                        $pdf = $row['document'];
                        $pdf_path = "admin/image/" . $pdf;
                ?>
                        <tr>
                            <td><?php echo $year; ?></td>
                            <td> <a href="<?php echo $pdf_path; ?>" target="_blank"><i class="fa-solid fa-file-arrow-down"></i></a> </td>
                        </tr>
                <?php
                    }
                }
                ?>



            </tbody>
        </table>


    </div>
</div>
<!-- course-area -->

<?php include 'footer.php' ?>