<?php
   include 'header.php';
?>




<!-- ==========Banner Section Starts Here========== -->
<section class="page-header bg_img" data-background="assets/images/banner/page-header.jpg">
    <div class="container">
        <div class="page-header-content">
            <h1 class="title">Student's Result</h1>
              <ul class="breadcrumb">
                <li>
                    <a href="index.php">Home</a>
                </li>
                <li>
                    Student's Result
                </li>
            </ul>
        </div>
    </div>
</section>
<!-- ==========Banner Section Ends Here========== -->


<section class="about-section pos-rel padding-bottom padding-top oh">
    <div class="container">

        <div class="row justify-content-center">
            <div class="col-xl-6 col-lg-7">
                <div class="section-title text-center">
                    <h6 class="sub-title double-line"> Result <?php echo date('Y'); ?></h6>
                    <h3 class="title mt-3">Student's Result </h3>
                </div>
            </div>
        </div>

        <div class="row">
         <div class="col-md-2"></div>
            <div class="col-md-8">
                <div>
                <table class="table table-striped">
                    <!-- <thead>
                        <tr>
                        <th scope="col">Class Nursery Holiday Homework </th>
                        <th scope="col">Handle</th>
                        </tr>
                    </thead> -->
                    <tbody>
                    <?php
                    $year = date('Y');
                    $query = $conn->prepare("SELECT * FROM results where year = :year order by id ASC");
                    $query->bindParam(':year', $year);
                    $query->execute();
                    $toppers_result = $query->fetchAll();
                    $toppers_row = count($toppers_result);
                    if ($toppers_row > 0) {
                        foreach ($toppers_result as $value) {
                            $class_name = $value['class_name'];
                            $results_pdf = $value['results_pdf'];
                            $year = $value['year'];
                            ?>
                            <tr>
                                <th scope="row">Class : <?php if (!empty($class_name)) {
                                    echo $class_name;
                                } ?> Result</th>
                                <td><a target="_blank" href="bb-admin/upload/results/<?php echo $value['results_pdf'] ?>"> <img
                                            src="assets/images/product/pdf.png" alt="img"></a></td>
                            </tr>
                            <?php
       }
    }else{
               echo "<h4 class='text-center mt-4'>No data available...</h4>";
            }
    ?> 
                        <!--<tr>-->
                        <!--    <th scope="row">Class Nursery Holiday Homework </th>  -->
                        <!--    <td><img src="assets/images/product/pdf.png" alt="img"></td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                        <!--    <th scope="row">Class LKG Holiday Home-work </th>  -->
                        <!--    <td><img src="assets/images/product/pdf.png" alt="img"></td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                        <!--    <th scope="row">Class UKG Holiday Homework </th>  -->
                        <!--    <td><img src="assets/images/product/pdf.png" alt="img"></td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                        <!--    <th scope="row">Class 1st Holiday Homework </th>  -->
                        <!--    <td><img src="assets/images/product/pdf.png" alt="img"></td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                        <!--    <th scope="row">Class 2nd Holiday Homework </th>  -->
                        <!--    <td><img src="assets/images/product/pdf.png" alt="img"></td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                        <!--    <th scope="row">Class 3rd Holiday Homework </th>  -->
                        <!--   <td><img src="assets/images/product/pdf.png" alt="img"></td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                        <!--    <th scope="row">Class 4th Holiday Homework </th>  -->
                        <!--    <td><img src="assets/images/product/pdf.png" alt="img"></td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                        <!--    <th scope="row">Class 5th Holiday Homework </th>  -->
                        <!--    <td><img src="assets/images/product/pdf.png" alt="img"></td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                        <!--    <th scope="row">Class 6th Holiday Homework </th>  -->
                        <!--    <td><img src="assets/images/product/pdf.png" alt="img"></td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                        <!--    <th scope="row">Class 7th Holiday Homework </th>  -->
                        <!--    <td><img src="assets/images/product/pdf.png" alt="img"></td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                        <!--    <th scope="row">Class 8th Holiday Homework </th>  -->
                        <!--    <td><img src="assets/images/product/pdf.png" alt="img"></td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                        <!--    <th scope="row">Class 9th Holiday Homework </th>  -->
                        <!--    <td><img src="assets/images/product/pdf.png" alt="img"></td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                        <!--    <th scope="row">Class 10th Holiday Homework </th>  -->
                        <!--    <td><img src="assets/images/product/pdf.png" alt="img"></td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                        <!--    <th scope="row">Class 11th Holiday Homework </th>  -->
                        <!--    <td><img src="assets/images/product/pdf.png" alt="img"></td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                        <!--    <th scope="row">Class 12th (Arts) Holiday Homework </th>  -->
                        <!--    <td><img src="assets/images/product/pdf.png" alt="img"></td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                        <!--    <th scope="row">Class 12th (Commerce) Holiday Homework </th>  -->
                        <!--    <td><img src="assets/images/product/pdf.png" alt="img"></td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                        <!--    <th scope="row">Class 12th (Science) Holiday Homework </th>  -->
                        <!--    <td><img src="assets/images/product/pdf.png" alt="img"></td>-->
                        <!--</tr>-->
                    </tbody>
                </table>
                </div>
            </div>
        </div>
    </div>
</section>






<?php
   include 'footer.php';
   ?>