<?php session_start();
require_once 'config.php';
require_once 'auth.php';
$PageName = "Sub Topics";
$UserId = $_SESSION['User']['id'];
 ?>
<!doctype html>
<html lang="en" class="h-100">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <meta name="generator" content="">
    <title><?php echo $Proj_Title; ?></title>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <link rel="apple-touch-icon" href="img/favicon180.png" sizes="180x180">
    <link rel="icon" href="img/favicon32.png" sizes="32x32" type="image/png">
    <link rel="icon" href="img/favicon16.png" sizes="16x16" type="image/png">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&amp;display=swap" rel="stylesheet">
    <link href="vendor/swiper/css/swiper.min.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet" id="style">
</head>

<body class="body-scroll d-flex flex-column h-100 menu-overlay">
    <main class="flex-shrink-0 main">
        <?php include_once 'back-header.php'; ?> 
        <div class="main-container">
            
            <div class="container">
                <div class="card">
                    <!-- <div class="card-header">
                        <h6 class="mb-0">Sub Topics</h6>
                    </div> -->
                    <div class="card-body px-0 pt-0">
                        <div class="list-group list-group-flush border-top border-color">
                            <?php 
                    $sql = "SELECT * FROM tbl_sub_topics WHERE Status=1 AND DeptId='".$_GET['deptid']."' AND SubjectId='".$_GET['subjectid']."'";
                    $row = getList($sql);
                    foreach($row as $result){
                        $url = $_GET['page'].".php?deptid=".$_GET['deptid']."&courseid=".$_GET['courseid']."&subjectid=".$_GET['subjectid']."&subtopicid=".$result['id'];
                    ?>  
                            <a href="<?php echo $url;?>" class="list-group-item list-group-item-action border-color">
                                <div class="row">
                                    <div class="col-auto">
                                        <div class="avatar avatar-50 bg-default-light text-default rounded">
                                          <?php if($result["Photo"] == '') {?>
                                      <img src="no_image.jpg" style="width: 50px;height: 50px;"> 
                                      <?php } else {?>
                                      <img src="<?php echo $UploadUrl;?>/uploads/<?php echo $result["Photo"];?>" style="width: 50px;height: 50px;">
                                      <?php }  ?>
                                        </div>
                                    </div>
                                    <div class="col align-self-center pl-0">
                                        <h6 class="mb-1"><?php echo $result['Name'];?></h6>
                                    </div>
                                    <div class="col-auto" style="padding-top:10px;">
                                        <i style="color:#ccc;" class="material-icons vm">keyboard_arrow_right</i>
                                    </div>
                                </div>
                            </a>
                            <?php } ?>
                            
                        </div>
                    </div>
                </div>
           

            </div>
        </div>
    </main>
 <?php include_once 'footer.php'; ?>
<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/popper.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<script src="js/jquery.cookie.js"></script>
<script src="vendor/swiper/js/swiper.min.js"></script>
<script src="js/main.js"></script>
<script src="js/color-scheme-demo.js"></script>
<script src="js/app.js"></script>
<script>
    function onDownloadFileFromUrl(url,filename){
         Android.onDownloadFileFromUrl(''+url+'',''+filename+'');
    }
</script>
</body>
</html>
