<?php

    // session_start();

    include "../db.php";

    require '../auth.php';

    restrictAccess(['master_admin']);

    date_default_timezone_set('Asia/Kolkata');

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



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

        header("Location: logout.php");

        exit();

    }



    if ( $_SESSION['utype'] != 'master_admin' && $_SESSION['uref'] != 'fssdf4543frts' ) {

        header("Location: logout.php");

        exit();

    }

?>



<!DOCTYPE html>

<html lang="en">



<head>

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

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

    <?php include "include/php-functions.php"; ?>

</head>



<body>

    <!--  Header -->

    <?php 

    include "include/header.php"; 

    ?>

    <!-- #header -->



    <section id="inner-body">

        <div class="body-content">

            <div class="container-fluid">

                <div class="row align-items-center">

                    <div class="col-lg-3 col-md-3 col-12 mb-2">

                        <a href="view-client.php" class="text-dark" style="text-decoration:none;">

                            <div class="card">

                                <div class="card-body">

                                    <div class="row align-items-center">

                                        <div class="col-md-8 col-6">

                                            <h5 class="card-title text-uppercase color-4b4be9">Students</h5>

                                        </div>

                                        <div class="col-md-4 col-6">

                                            <div class="text-end">

                                                <h2 class="color-f25f00">

                                                    <i class="fa fa-users"></i>

                                                </h2>

                                            </div>

                                        </div>

                                    </div>

                                </div>

                            </div>

                        </a>

                    </div>

                    <div class="col-lg-3 col-md-3 col-12 mb-2">

                        <a href="view-college.php" class="text-dark" style="text-decoration:none;">

                            <div class="card">

                                <div class="card-body">

                                    <div class="row align-items-center">

                                        <div class="col-md-8 col-6">

                                            <h5 class="card-title text-uppercase color-4b4be9">Colleges</h5>

                                        </div>

                                        <div class="col-md-4 col-6">

                                            <div class="text-end">

                                                <h2 class="color-f25f00">

                                                    <i class="fa fa-school"></i>

                                                </h2>

                                            </div>

                                        </div>

                                    </div>

                                </div>

                            </div>

                        </a>

                    </div>



                    <div class="col-lg-3 col-md-3 col-12 mb-2">

                        <a href="view-employee.php" class="text-dark" style="text-decoration:none;">

                            <div class="card">

                                <div class="card-body">

                                    <div class="row align-items-center">

                                        <div class="col-md-8 col-6">

                                            <h5 class="card-title text-uppercase color-4b4be9">Employee</h5>

                                        </div>

                                        <div class="col-md-4 col-6">

                                            <div class="text-end">

                                                <h2 class="color-f25f00">

                                                    <i class="fa fa-users"></i>

                                                </h2>

                                            </div>

                                        </div>

                                    </div>

                                </div>

                            </div>

                        </a>

                    </div>



                    <div class="col-lg-3 col-md-3 col-12 mb-2">

                        <a href="view-franchiee.php" class="text-dark" style="text-decoration:none;">

                            <div class="card">

                                <div class="card-body">

                                    <div class="row align-items-center">

                                        <div class="col-md-8 col-10">

                                            <h5 class="card-title text-uppercase color-4b4be9">Associate

                                            </h5>

                                        </div>

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

                                            <div class="text-end">

                                                <h2 class="color-f25f00">

                                                    <i class="fa fa-industry"></i>

                                                </h2>

                                            </div>

                                        </div>

                                    </div>

                                </div>

                            </div>

                        </a>

                    </div>

                    <div class="col-lg-3 col-md-3 col-12 mb-2">

                        <a href="courseCategory.php" class="text-dark" style="text-decoration:none;">

                            <div class="card">

                                <div class="card-body">

                                    <div class="row align-items-center">

                                        <div class="col-md-7 col-9">

                                            <h5 class="card-title text-uppercase color-4b4be9">Department</h5>

                                        </div>

                                        <div class="col-md-5 col-3">

                                            <div class="text-end">

                                                <h2 class="color-f25f00">

                                                    <i class="fa fa-shapes"></i>

                                                </h2>

                                            </div>

                                        </div>

                                    </div>

                                </div>

                            </div>

                        </a>

                    </div>

                    <div class="col-lg-3 col-md-3 col-12 mb-2">

                        <a href="addcourse.php" class="text-dark" style="text-decoration:none;">

                            <div class="card">

                                <div class="card-body">

                                    <div class="row align-items-center">

                                        <div class="col-md-8 col-9">

                                            <h5 class="card-title text-uppercase color-4b4be9">Course</h5>

                                        </div>

                                        <div class="col-md-4 col-3">

                                            <div class="text-end">

                                                <h2 class="color-f25f00">

                                                    <i class="fa fa-chalkboard"></i>

                                                </h2>

                                            </div>

                                        </div>

                                    </div>

                                </div>

                            </div>

                        </a>

                    </div>

                    <div class="col-lg-3 col-md-3 col-12 mb-2">

                        <a href="entrance.php" class="text-dark" style="text-decoration:none;">

                            <div class="card">

                                <div class="card-body">

                                    <div class="row align-items-center">

                                        <div class="col-md-8 col-9">

                                            <h5 class="card-title text-uppercase color-4b4be9">Entrance</h5>

                                        </div>

                                        <div class="col-md-4 col-3">

                                            <div class="text-end">

                                                <h2 class="color-f25f00">

                                                    <i class="fa fa-school-circle-check"></i>

                                                </h2>

                                            </div>

                                        </div>

                                    </div>

                                </div>

                            </div>

                        </a>

                    </div>



                    <div class="col-lg-3 col-md-3 col-12 mb-2">

                        <a href="contat.php" class="text-dark" style="text-decoration:none;">

                            <div class="card">

                                <div class="card-body">

                                    <div class="row align-items-center">

                                        <div class="col-md-5 col-6">

                                            <h5 class="card-title text-uppercase color-4b4be9">Querys</h5>

                                        </div>

                                        <div class="col-md-7 col-6">

                                            <div class="text-end">

                                                <h2 class="color-f25f00">

                                                    <i class="fa fa-question-circle"></i>

                                                </h2>

                                            </div>

                                        </div>

                                    </div>

                                </div>

                            </div>

                        </a>

                    </div>

                </div>

                <div class="row mt-2">

                    <div class="col-lg-6 col-md-6 col-12 mb-3">

                        <div class="card" id="organization-card">

                            <div class="card-body">

                                <div class="title-org">

                                    <h3 class="h-underline m-0">Notice List</h3>

                                    <span><a href="view-notice.php">View All</a></span>

                                </div>

                                <ul class="mt-3">

                                    <?php 

                                      $org_sql = mysqli_query($con, "SELECT * FROM notice WHERE admin_ref = '$_SESSION[uref]' AND notice_recycle = '1' ORDER BY notice_id DESC LIMIT 4");

                                      while($org_row = mysqli_fetch_assoc($org_sql)){

                                    ?>

                                    <li class="mb-2">

                                        <div class="organization-preview ">

                                            <h5><i class="fa fa-bell"></i>

                                                &nbsp;<?php echo $org_row["notice_title"];?></h5>

                                        </div>

                                    </li>

                                    <?php }?>

                                </ul>

                            </div>

                        </div>

                    </div>

                    <div class="col-lg-6 col-md-6 col-12 mb-3">

                        <div class="card" id="blog-card">

                            <div class="card-body">

                                <div class="title-org">

                                    <h3 class="h-underline m-0">Recent News</h3>

                                    <span><a href="news.php?show_list">View All</a></span>

                                </div>

                                <ul class="mt-3">

                                    <?php

                                        $sql = "SELECT * FROM data WHERE data_catagory = 'news' AND data_recycle = '1' ORDER BY data_sl_no DESC LIMIT 4";

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



                                        $c = 1;

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

                                    ?>

                                    <li class="mb-2">

                                        <a href="news.php?view_id=<?php echo $rows["data_sl_no"];?>"

                                            style="text-decoration:none;">

                                            <div class="blog-preview">

                                                <div class="row">

                                                    <div class="col-lg-3 col-md-3 col-3">

                                                        <img src="<?php echo $rows["data_img"];?>" class="img-fluid"

                                                            alt="<?php echo $rows['data_title']; ?>">

                                                    </div>

                                                    <div class="col-lg-9 col-md-9 col-9">

                                                        <h6 class="m-0"><?php echo $rows['data_title']; ?></h6>

                                                        <p class="m-0">

                                                            <?php echo substr($rows['data_short_des'], 0, 100); ?>...

                                                        </p>

                                                    </div>

                                                </div>

                                            </div>

                                        </a>

                                    </li>

                                    <?php $c++; }?>

                                </ul>

                            </div>

                        </div>

                    </div>

                </div>

            </div>

        </div>



        <?php include "include/footer.php"; ?>

    </section>



    <!-- JavaScript Libraries -->



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





</body>



</html>