     <div class="left_col scroll-view">
        
            <div class="navbar nav_title" style="border: 0;margin-top: 5px;">
              <a href="index.html" class="site_title"><span style="color: black;font-size: 35px;font-weight: bold;">Edu</span><span style="color:#00ADEF;font-size: 35px;font-weight: bold;">Portal</span></a>
            </div>

            <div class="clearfix"></div>

           
         <!-- sidebar menu -->
            <div id="sidebar-menu" class="main_menu_side hidden-print main_menu">
              <div class="menu_section">
                <ul class="nav side-menu">
            <!--  <li><a href="dashboard.php"><i class="fa fa-dashboard"></i> Dashboard </a></li> -->
            
                  <?php
    $branch=$_SESSION['branch'];
    $user=$_SESSION['user_id'];     
    $qr="SELECT * FROM eduportal_modules_detail as modu, eduportal_school_modules as schl WHERE modu.modules_id=schl.module_id and schl.branch_id='$branch' ORDER BY modules_id ASC ";

             $sidebar = $m->query($qr);
                  foreach($sidebar as $side)
                      { 

                    $m->where("branch_id", $_SESSION['branch']);
                    $m->where("user_id", $_SESSION['user_id']);
                    $m->where("module_id", $side['modules_id']);
                    $values = $m->get("users_privilege_detail");

                      if(count($values)>0){
                        ?>

                    <li><a><i class="<?php echo $side['module_icon'] ?>"></i> <?php echo $side['modules_name'];?> <span class="fa fa-chevron-down"></span></a>

                    <?php } ?>

<ul class="nav child_menu">
                <?php
    $user=$_SESSION['user_id'];            
    $module=$side['modules_id'];
    $qr="SELECT * FROM users_privilege_detail as priv, eduportal_modules_pages_detail as pag WHERE priv.module_id='$module' and priv.user_id='$user' and priv.page_id=pag.page_id and priv.branch_id='$branch' ORDER BY pag.page_id ASC ";
           
             $pages = $m->query($qr);
           
                      foreach($pages as $page)
                      { ?>

                      <li><a href="<?php echo $page['page_name'] ?>"><?php echo $page['page_title'] ?></a></li>
                  
                    <?php } ?>
                     </li>

  </ul> 

                     <?php } ?>


     <!--   <li><a><i class="fa fa-user"></i>Assign Access<span class="fa fa-chevron-down"></span></a>
                    <ul class="nav child_menu">
                      <li><a href='user_access.php'><span>User Access</span></a></li> -->
                     <!--  <li><a href='add_categories.php'><span>Add Category</span></a></li>
                       
                    </ul>
                  </li> -->

      <li><a href='logout.php'><i class="fa fa-power-off"></i>Logout</a></li>

                  <!-- <li><a><i class="fa fa-shield"></i> Masks Management <span class="fa fa-chevron-down"></span></a>
                    <ul class="nav child_menu">
                      <li><a href="add_mask.php">Add Mask </a></li>
                      <li><a href="view_mask.php">View Mask </a></li>
                      
                    </ul>
                  </li>

                  <li><a><i class="fa fa-newspaper-o"></i> Ads Management <span class="fa fa-chevron-down"></span></a>
                    <ul class="nav child_menu">
                      <li><a href="add_ads.php">Add Ads </a></li>
                      <li><a href="view_ads.php">View Ads </a></li>
                      
                    </ul>
                  </li>

                  


                   <li><a><i class="fa fa-edit"></i> Forms <span class="fa fa-chevron-down"></span></a>
                    <ul class="nav child_menu">
                      <li><a href="form.html">General Form</a></li>
                      <li><a href="form_advanced.html">Advanced Components</a></li>
                      <li><a href="form_validation.html">Form Validation</a></li>
                      <li><a href="form_wizards.html">Form Wizard</a></li>
                      <li><a href="form_upload.html">Form Upload</a></li>
                      <li><a href="form_buttons.html">Form Buttons</a></li>
                    </ul>
                  </li>
                  <li><a><i class="fa fa-desktop"></i> UI Elements <span class="fa fa-chevron-down"></span></a>
                    <ul class="nav child_menu">
                      <li><a href="general_elements.html">General Elements</a></li>
                      <li><a href="media_gallery.html">Media Gallery</a></li>
                      <li><a href="typography.html">Typography</a></li>
                      <li><a href="icons.html">Icons</a></li>
                      <li><a href="glyphicons.html">Glyphicons</a></li>
                      <li><a href="widgets.html">Widgets</a></li>
                      <li><a href="invoice.html">Invoice</a></li>
                      <li><a href="inbox.html">Inbox</a></li>
                      <li><a href="calendar.html">Calendar</a></li>
                    </ul>
                  </li>


                  <li><a><i class="fa fa-table"></i> Tables <span class="fa fa-chevron-down"></span></a>
                    <ul class="nav child_menu">
                      <li><a href="tables.html">Tables</a></li>
                      <li><a href="tables_dynamic.html">Table Dynamic</a></li>
                    </ul>
                  </li>


                  <li><a><i class="fa fa-bar-chart-o"></i> Data Presentation <span class="fa fa-chevron-down"></span></a>
                    <ul class="nav child_menu">
                      <li><a href="chartjs.html">Chart JS</a></li>
                      <li><a href="chartjs2.html">Chart JS2</a></li>
                      <li><a href="morisjs.html">Moris JS</a></li>
                      <li><a href="echarts.html">ECharts</a></li>
                      <li><a href="other_charts.html">Other Charts</a></li>
                    </ul>
                  </li>
                  <li><a><i class="fa fa-clone"></i>Layouts <span class="fa fa-chevron-down"></span></a>
                    <ul class="nav child_menu">
                      <li><a href="fixed_sidebar.html">Fixed Sidebar</a></li>
                      <li><a href="fixed_footer.html">Fixed Footer</a></li>
                    </ul>
                  </li>
                </ul>
              </div>
              <div class="menu_section">
                <h3>Live On</h3>
                <ul class="nav side-menu">
                  <li><a><i class="fa fa-bug"></i> Additional Pages <span class="fa fa-chevron-down"></span></a>
                    <ul class="nav child_menu">
                      <li><a href="e_commerce.html">E-commerce</a></li>
                      <li><a href="projects.html">Projects</a></li>
                      <li><a href="project_detail.html">Project Detail</a></li>
                      <li><a href="contacts.html">Contacts</a></li>
                      <li><a href="profile.html">Profile</a></li>
                    </ul>
                  </li>
                  <li><a><i class="fa fa-windows"></i> Extras <span class="fa fa-chevron-down"></span></a>
                    <ul class="nav child_menu">
                      <li><a href="page_403.html">403 Error</a></li>
                      <li><a href="page_404.html">404 Error</a></li>
                      <li><a href="page_500.html">500 Error</a></li>
                      <li><a href="plain_page.html">Plain Page</a></li>
                      <li><a href="login.html">Login Page</a></li>
                      <li><a href="pricing_tables.html">Pricing Tables</a></li>
                    </ul>
                  </li>
                  <li><a><i class="fa fa-sitemap"></i> Multilevel Menu <span class="fa fa-chevron-down"></span></a>
                    <ul class="nav child_menu">
                        <li><a href="#level1_1">Level One</a>
                        <li><a>Level One<span class="fa fa-chevron-down"></span></a>
                          <ul class="nav child_menu">
                            <li class="sub_menu"><a href="level2.html">Level Two</a>
                            </li>
                            <li><a href="#level2_1">Level Two</a>
                            </li>
                            <li><a href="#level2_2">Level Two</a>
                            </li>
                          </ul>
                        </li>
                        <li><a href="#level1_2">Level One</a>
                        </li>
                    </ul>
                  </li>                  
                  <li><a href="javascript:void(0)"><i class="fa fa-laptop"></i> Landing Page <span class="label label-success pull-right">Coming Soon</span></a></li>
                </ul> -->
              </div>

            </div>
            <!-- /sidebar menu -->

          </div>
        </div>
   