<?php 
if(isset($_COOKIE["user_id"])){
 $Userid = $_COOKIE["user_id"]; 
$query = "SELECT * FROM tbl_users WHERE id='$Userid'";
 $rncnt = getRow($query);
 $row = getRecord($query);
 if($rncnt > 0){
    $_SESSION['User'] = $row;
$user_id = $_SESSION['User']['id'];
}
}
$UserId = $_SESSION['User']['id'];
$sql110 = "SELECT * FROM tbl_users WHERE id='$UserId'";
$row110 = getRecord($sql110);
$Name = $row110['Fname']." ".$row110['Lname'];
$Phone = $row110['Phone'];
$EmailId = $row110['EmailId'];
$ExpDate = date("d/m/Y", strtotime(str_replace('-', '/',$row110['Validity'])));
 ?>
    <!-- menu main -->
    <div class="main-menu">
        <div class="row mb-4 no-gutters">
            <div class="col-auto"><button class="btn btn-link btn-40 btn-close text-white"><span class="material-icons">chevron_left</span></button></div>
            <?php if(isset($_SESSION['User'])) {?>
            <div class="col-auto">
                <div class="avatar avatar-40 rounded-circle position-relative">
                    <figure class="background">
                       <?php 
                        if($row110['Photo'] == ''){
                     ?>
                    <img src="user_icon.jpg" alt="" style="width: 140px;height: 140px;">
                <?php } else  {?>
                     <img src="../uploads/<?php echo $row110['Photo']; ?>" alt="" style="width: 140px;height: 140px;">
                 <?php } ?>
                    </figure>
                </div>
            </div>
            <div class="col pl-3 text-left align-self-center">
                <h6 class="mb-1"><?php echo $Name; ?></h6>
                <p class="small text-default-secondary">Online</p>
            </div>
        <?php } else{?>
             <div class="col-auto">
                <div class="avatar-40 rounded-circle position-relative">
                    <figure class="">
                        <img src="favicon.jpg" alt="" style="width: 40px;height: 40px;border-radius: 50%;">
                    </figure>
                </div>
            </div>
            <div class="col pl-3 text-left align-self-center">
                <h6 class="" style="margin-bottom: 1.1rem;">The Yash Academy</h6>
                <p class="small text-default-secondary"></p>
            </div>
        <?php } ?>
        </div>
        <div class="menu-container">
            
            <ul class="nav nav-pills flex-column ">
                <li class="nav-item">
                    <a class="nav-link" href="dashboard.php">
                        <div>
                            <span class="material-icons icon">home</span>
                            Home
                        </div>
                        
                    </a>
                </li>
                 <li class="nav-item">
                    <a class="nav-link" href="subscribe-courses.php">
                        <div>
                            <span class="material-icons icon">paid</span>
                            My Course
                        </div>
                       
                    </a>
                </li>
                 <li class="nav-item">
                    <a class="nav-link" href="departments.php?page=test-series&tblname=tbl_test_series">
                        <div>
                            <span class="material-icons icon">paid</span>
                            Test Series
                        </div>
                       
                    </a>
                </li>
                  <li class="nav-item">
                    <a class="nav-link" href="departments.php?page=online-classes&tblname=tbl_online_classes">
                        <div>
                            <span class="material-icons icon">account_balance</span>
                            Online Classes
                        </div>
                       
                    </a>
                </li>
                
                <li class="nav-item">
                    <a class="nav-link" href="departments.php?page=study-material&tblname=tbl_study_materials">
                        <div>
                            <span class="material-icons icon">auto_stories</span>
                           Subject Wise Notes
                        </div>
                        
                    </a>
                </li>

                 <li class="nav-item">
                    <a class="nav-link" href="departments.php?page=resources&tblname=tbl_resources">
                        <div>
                            <span class="material-icons icon">try</span>
                            Resources
                        </div>
                       
                    </a>
                </li>

                <li class="nav-item">
                    <a class="nav-link" href="departments.php?page=mind-maps&tblname=tbl_mind_maps">
                        <div>
                            <span class="material-icons icon">auto_stories</span>
                           Mind Maps
                        </div>
                        
                    </a>
                </li>

                 <li class="nav-item">
                    <a class="nav-link" href="departments.php?page=current-affairs&tblname=tbl_current_affairs">
                        <div>
                            <span class="material-icons icon">account_balance</span>
                            Current Affairs
                        </div>
                       
                    </a>
                </li>

                <li class="nav-item">
                    <a class="nav-link" href="departments.php?page=ques-papers&tblname=tbl_ques_papers">
                        <div>
                            <span class="material-icons icon">auto_stories</span>
                           Prev. Year Ques Paper
                        </div>
                        
                    </a>
                </li>

                
                 <li class="nav-item">
                    <a class="nav-link" href="#">
                        <div>
                            <span class="material-icons icon">auto_stories</span>
                          UPSC Mains Test Paper
                        </div>
                        
                    </a>
                </li>
                
               <!--  <li class="nav-item">
                    <a class="nav-link" href="stud-interview.php">
                        <div>
                            <span class="material-icons icon">emoji_people</span>
                            Interviews
                        </div>
                       
                    </a>
                </li> -->
                
              
              

                <li class="nav-item">
                    <a class="nav-link" href="departments.php?page=upcomming-discussion&tblname=tbl_upcomming_discussions">
                        <div>
                            <span class="material-icons icon">try</span>
                            Upcomming Discussion
                        </div>
                       
                    </a>
                </li>

                
                 <li class="nav-item">
                    <a class="nav-link" href="buy-pdfs.php">
                        <div>
                            <span class="material-icons icon">try</span>
                           Purchase Pdf
                        </div>
                       
                    </a>
                </li>

                <li class="nav-item">
                    <a class="nav-link" href="syllabus.php">
                        <div>
                            <span class="material-icons icon">try</span>
                            Syllabus
                        </div>
                       
                    </a>
                </li>

                 <li class="nav-item">
                    <a class="nav-link" href="book-list.php">
                        <div>
                            <span class="material-icons icon">try</span>
                            Book list
                        </div>
                       
                    </a>
                </li>

                <li class="nav-item">
                    <a class="nav-link" href="interview-materials.php">
                        <div>
                            <span class="material-icons icon">try</span>
                            Interview Materials
                        </div>
                       
                    </a>
                </li>

                <li class="nav-item">
                    <a class="nav-link" href="class-schedule.php">
                        <div>
                            <span class="material-icons icon">try</span>
                            Class Schedule
                        </div>
                       
                    </a>
                </li>
                
                <li class="nav-item">
                    <a class="nav-link" href="exam-notification.php">
                        <div>
                            <span class="material-icons icon">try</span>
                            Exam Notification
                        </div>
                       
                    </a>
                </li>



                <li class="nav-item">
                    <a class="nav-link" href="choose-courses.php?deptid=<?php echo $_SESSION['DeptId'];?>">
                        <div>
                            <span class="material-icons icon">try</span>
                            Course
                        </div>
                       
                    </a>
                </li>
                
                <li class="nav-item">
                    <a class="nav-link" href="faqs.php">
                        <div>
                            <span class="material-icons icon">try</span>
                            Faqs
                        </div>
                       
                    </a>
                </li>
                
                <li class="nav-item">
                    <a class="nav-link" href="profile.php">
                        <div>
                            <span class="material-icons icon">account_circle</span>
                            Profile
                        </div>
                       
                    </a>
                </li>
                
               <!-- <li class="nav-item">
                    <a class="nav-link" href="shop-category.php">
                        <div>
                            <span class="material-icons icon">insert_chart</span>
                            About Us
                        </div>
                        <span class="arrow material-icons">chevron_right</span>
                    </a>
                </li>
               
                <li class="nav-item">
                    <a class="nav-link" href="login.php">
                        <div>
                            <span class="material-icons icon">settings</span>
                            Sign In
                        </div>
                        <span class="arrow material-icons">chevron_right</span>
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="register.php">
                        <div>
                            <span class="material-icons icon">settings</span>
                            Sign Up
                        </div>
                        <span class="arrow material-icons">chevron_right</span>
                    </a>
                </li>-->

            </ul>
            <div class="text-center">
                <a href="logout.php" class="btn btn-outline-danger rounded my-3 mx-auto" style="color:#fff;">Sign out</a>
            </div>
        </div>

    </div>
    <div class="backdrop"></div>
