<?php

    session_start();

    include "../db.php";

    date_default_timezone_set('Asia/Kolkata');

    $currentTime = date('M j, Y g:i a');



    if ( !isset($_SESSION['uid']) && !isset($_SESSION['uref']) && !isset($_SESSION['utype']) && !isset($_SESSION['uname']) )

        header("Location: logout.php");



    $admin_2_run = "SELECT admin_ref FROM users WHERE uref = '$_SESSION[uref]'";

    $admin_2_row2 = mysqli_query($con, $admin_2_run);

    $admin_2_row = mysqli_fetch_assoc($admin_2_row2);

    $admin_2 = $admin_2_row["admin_ref"];



?>

<!DOCTYPE html>

<html lang="en">

<head>

 <?php include "includes/meta.php"; ?>        

    <?php include "includes/css.php"; ?>      

  



</head>

<body id="page-top" class="mt-55">



    <div style="margin-top: 70px;"></div>



      <?php include "includes/header2.php"; ?>





<div cl ass="container-fluid ">       

   <div class="row mx-0 justify-content-center mt-2">

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

            <h1 class="h3 mb-2 text-gray-800 text-center">Class Homeworks</h1>

                    <hr>

            <div class="row mx-0 justify-content-center mt-2 gx-1">



            <?php

                $sql = "SELECT * FROM class WHERE uploadedby = '$_SESSION[uref]' ORDER BY sid DESC";

                $res = mysqli_query($con,$sql);

                if ($total_rows=mysqli_num_rows($res)>0) {

                    $c = 1;

                    while ($rows = mysqli_fetch_assoc($res)) {

                        $showClass= showClass($con,$rows['sid']);

            ?>

                <div class="col-6 col-sm-6 col-xs-6 col-md-6 text-center md">  

                    <a href="view-homework.php?cid=<?php echo $rows['sid']; ?>" style="text-decoration: none;">    

                      

                      <p class="cd1"><i class="fa fa-graduation-cap" aria-hidden="true"></i>  <?php echo $showClass; ?></p>                 

                    </a>        

                </div>



            <?php 

                     $c++;

                    }

                }

            ?>



     

            </div>

        </div>

     </div>

</div> 



            <?php include "includes/ft.php"; ?>

            <?php include "includes/js.php"; ?>



</body>

</html>











