<!-- Main Sidebar Container -->
  <aside class="main-sidebar main-sidebar-custom sidebar-light-primary elevation-4" >
    <!-- Brand Logo --> 
    <a href="admin.php?page=dashboad" class="brand-link"  >
      <img src="../assets/img/logo.png" alt="image" class="brand-image img-circle elevation-2">
      <strong> <span class="brand-text font-weight-light color-white">SIKIRARI SEC</span></strong>
    </a> 
    <!-- Sidebar -->
    <div class="sidebar"> 
      <div class="pb-3">  
      </div>
      <!-- SidebarSearch Form -->
      <div class="form-inline">
        <div class="input-group" data-widget="sidebar-search">
          <input class="form-control form-control-sidebar" type="search" placeholder="Search" aria-label="Search">
          <div class="input-group-append">
            <button class="btn btn-sidebar">
              <i class="fas fa-search fa-fw"></i>
            </button>
          </div>
        </div>
      </div> 
      <!-- Sidebar Menu -->
      <nav class="mt-2">
        <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">  
           <?php  
            $categ="Teacher";  
            if ($q['user_type']=="$categ") {
            ?> 
         <li class="nav-item">
            <a href="admin.php?page=profile" class="nav-link">
              <i class="nav-icon fas fa-tachometer-alt"></i>
              <p>
                Dashboard 
              </p>
            </a> 
          </li>
          <li class="nav-item">
            <a href="#" class="nav-link"> 
              <p>
                 Teacher's 
                <span class="right badge badge-warning">Info</span>
              </p>
            </a>
          </li> 
          <li class="nav-item">
            <a href="admin.php?page=student_list&Id_2=<?php echo $row['teacher_roll_no']; ?>" class="nav-link">
              <i class="nav-icon fas fa-users-cog"></i>
              <p>
                Student's 
              </p>
            </a> 
          </li>
          <li class="nav-item">
            <a href="admin.php?page=timetable_list&Id_2=<?php echo $row['teacher_roll_no']; ?>" class="nav-link">
              <i class="nav-icon fas fa-tachometer-alt"></i>
              <p>
                Time table
              </p>
            </a> 
          </li>
          <li class="nav-item">
            <a href="admin.php?page=t_allocation&Id_2=<?php echo $row['user_id']; ?>" class="nav-link">
              <i class="nav-icon fas fa-file"></i>
              <p>
                Subject Allocated
              </p>
            </a> 
          </li>
           <li class="nav-item">
            <a href="#" class="nav-link"> 
              <p>
                 Upload Exam Result
                <span class="right badge badge-success">Info</span>
              </p>
            </a>
          </li> 
          <li class="nav-item">
            <a href="admin.php?page=exam_time" class="nav-link">
               <i class="nav-icon fas fa-file"></i>
              <p>Uploaded Exam</p>
            </a>
          </li>
          <?php
            $T_id=$q['teacher_roll_no']; 
            $selected_teacher = mysqli_query($conn,"
             SELECT *  FROM teacher_course  
             INNER JOIN class_srms 
             ON class_srms.class_id=teacher_course.class_id WHERE teacher_course.teacher_roll_no='$T_id' GROUP BY teacher_course.class_id ");
             while($row = mysqli_fetch_array($selected_teacher)){ 
              $class=$row['class_id']; 
            ?>  
          <li class="nav-item">
            <a href="#" class="nav-link">
              <i class="nav-icon fas fa-graduation-cap"></i>
              <p>
                <?php echo $row['class_name']; ?>
                <i class="fas fa-angle-left right"></i>
              </p>
            </a> 
            <ul class="nav nav-treeview"> 
               <?php   
                $selected3 = mysqli_query($conn,"SELECT * FROM exam_srms WHERE class_id='$class'");
                 while($row3 = mysqli_fetch_array($selected3)){ 
                ?>  
                    <li class="nav-item">
                    <a href="admin.php?page=fgtutrs345gj789km231ExamTeachUIYTR7ttdeewz34&Id_2=<?php echo $row3['exam_id']; ?>" class="nav-link">
                      <i class="far fa-circle nav-icon"></i>
                      <p> <?php echo $row3['exam_name']; ?></p>
                    </a>
                  </li>
                <?php }?> 
            </ul>
          </li>  
            <?php }}?>
        <?php  
            $categ="Academic Master";  
            if ($q['user_type']=="$categ") {
            ?>  
            <li class="nav-item">
            <a href="admin.php?page=dashboad" class="nav-link">
              <i class="nav-icon fas fa-tachometer-alt"></i>
              <p>
                Dashboard 
              </p>
            </a> 
          </li>
          <li class="nav-item">
            <a href="#" class="nav-link"> 
              <p>
                 Administration
                <span class="right badge badge-warning">Info</span>
              </p>
            </a>
          </li>    
            <li class="nav-item">
            <a href="#" class="nav-link">
              <i class="nav-icon fas fa-users-cog"></i>
              <p>
                User Management
                <i class="fas fa-angle-left right"></i>
              </p>
            </a>
            <ul class="nav nav-treeview">  
              <li class="nav-item">
                <a href="admin.php?page=student" class="nav-link">
                  <i class="far fa-circle nav-icon"></i>
                  <p>Students</p>
                </a>
              </li>  
              <li class="nav-item">
                <a href="admin.php?page=teacher" class="nav-link">
                  <i class="far fa-circle nav-icon"></i>
                  <p>Staff detail</p>
                </a>
              </li> 
              <li class="nav-item">
                <a href="admin.php?page=non_teacher" class="nav-link">
                  <i class="far fa-circle nav-icon"></i>
                  <p>Non Staff detail</p>
                </a>
              </li> 
            </ul>
          </li>  
          <li class="nav-item">
            <a href="#" class="nav-link"> 
              <p>
                 Accademic 
                <span class="right badge badge-success">Info</span>
              </p>
            </a>
          </li>  
          <li class="nav-item">
            <a href="admin.php?page=class" class="nav-link">
              <i class="nav-icon fas fa-university"></i>
              <p>
                Classes Management 
              </p>
            </a> 
          </li > 
          <li class="nav-item">
            <a href="admin.php?page=program" class="nav-link">
              <i class="nav-icon fas fa-university"></i>
              <p>
               Subject Management 
              </p>
            </a> 
          </li >
          <li class="nav-item">
            <a href="admin.php?page=timetable" class="nav-link">
              <i class="nav-icon fas fa-tachometer-alt"></i>
              <p>
                Time table info
              </p>
            </a> 
          </li >   
          <li class="nav-item">
            <a href="#" class="nav-link">
              <i class="nav-icon fas fa-edit"></i>
              <p>
               Exam Management
                <i class="fas fa-angle-left right"></i>
              </p>
            </a>
            <ul class="nav nav-treeview">  
              <li class="nav-item">
                <a href="admin.php?page=exam" class="nav-link">
                  <i class="far fa-circle nav-icon"></i>
                  <p>Exam Detail</p>
                </a>
              </li>  
              <li class="nav-item">
                <a href="admin.php?page=exam_time" class="nav-link">
                  <i class="far fa-circle nav-icon"></i>
                  <p>Uploaded Exam</p>
                </a>
              </li> 
            </ul>
          </li>
          <li class="nav-item">
            <a href="#" class="nav-link"> 
              <p>
                Student Result
                <span class="right badge badge-info">Info</span>
              </p>
            </a>
          </li> 
           <?php   
            $selected = mysqli_query($conn,"SELECT * FROM class_srms");
             while($row = mysqli_fetch_array($selected)){ 
              $class_id=$row['class_id']; 
            ?>  
            <li class="nav-item">
              <a href="#" class="nav-link">
                <i class="nav-icon fas fa-graduation-cap"></i>
                <p>
                  <?php echo $row['class_name']; ?>
                  <i class="fas fa-angle-left right"></i>
                </p>
              </a> 
              <ul class="nav nav-treeview"> 
               <?php   
                $selected2 = mysqli_query($conn,"SELECT * FROM exam_srms WHERE class_id='$class_id'");
                 while($row2 = mysqli_fetch_array($selected2)){ 
                ?>  
                    <li class="nav-item">
                    <a href="admin.php?page=fgtutrs345gj789km231ExamUIYTR7ttdeewz34&Id_2=<?php echo $row2['exam_id']; ?>" class="nav-link">
                      <i class="far fa-circle nav-icon"></i>
                      <p> <?php echo $row2['exam_name']; ?></p>
                    </a>
                  </li>
                <?php }?> 
            </ul>
          </li> 
            <?php }}?>
            </ul>
          </li>     
        </ul>
      </nav>
      <!-- /.sidebar-menu -->
    </div>
    <!-- /.sidebar -->

    <div class="sidebar-custom"> 
      <a href="#" class="btn btn-secondary hide-on-collapse pos-right" style="color: gold;">SARMS</a>
    </div>
    <!-- /.sidebar-custom -->
  </aside>