<?php 
$userid='';
include('../includes/dbcon.php');
$userid=$_SESSION['rm_id'];
//$name=$_SESSION['name'];
$name=$_SESSION['rm_name'];
//$al=$_SESSION['al'];
$al= $_SESSION['rm_al'];
//$auth_id= $_SESSION['officesync_auth_id'];
$rm_Authority_Des=$_SESSION['rm_Authority_Des'];
if ($al==1) {
  $myal="l_first";
}
if ($al==2) {
  $myal="l_second";
}
if ($al==3) {
  $myal="l_third";
}
if ($al==4) {
  $myal="l_forth";
}
if ($al==5) {
  $myal="l_fifth";
}


$page_name='';
$disp_name='';
$query=mysqli_query($con,"SELECT * from roll_master order by r_id ")or die(mysqli_error()); 
   while($row=mysqli_fetch_array($query)){   
  //Daily Transaction
  if ($row['r_id']==1) {  $c1=$row[$myal];$c1_name=$row["r_name"]; $c1_name1=$row["r_name1"];}
  if ($row['r_id']==2) {  $c2=$row[$myal];$c2_name=$row["r_name"]; $c2_name1=$row["r_name1"];}
  if ($row['r_id']==3) {  $c3=$row[$myal];$c3_name=$row["r_name"]; $c3_name1=$row["r_name1"];}
  if ($row['r_id']==4) {  $c4=$row[$myal];$c4_name=$row["r_name"]; $c4_name1=$row["r_name1"];}
  if ($row['r_id']==5) {  $c5=$row[$myal];$c5_name=$row["r_name"]; $c5_name1=$row["r_name1"];}
if ($row['r_id']==6) {  $c6=$row[$myal];$c6_name=$row["r_name"]; $c6_name1=$row["r_name1"];}
if ($row['r_id']==7) {  $c7=$row[$myal];$c7_name=$row["r_name"]; }
if ($row['r_id']==8) {  $c8=$row[$myal];$c8_name=$row["r_name"]; }
if ($row['r_id']==9) {  $c9=$row[$myal];$c9_name=$row["r_name"]; }

if ($row['r_id']==9) {  $c9=$row[$myal];$c9_name=$row["r_name"]; }
if ($row['r_id']==10) {  $c10=$row[$myal];$c10_name=$row["r_name"]; }

if ($row['r_id']==11) {  $c11=$row[$myal];$c11_name=$row["r_name"]; }
if ($row['r_id']==12) {  $c12=$row[$myal];$c12_name=$row["r_name"]; }
if ($row['r_id']==13) {  $c13=$row[$myal];$c13_name=$row["r_name"]; }

if ($row['r_id']==14) {  $c14=$row[$myal];$c14_name=$row["r_name"]; }
if ($row['r_id']==15) {  $c15=$row[$myal];$c15_name=$row["r_name"]; }
if ($row['r_id']==16) {  $c16=$row[$myal];$c16_name=$row["r_name"]; }
if ($row['r_id']==17) {  $c17=$row[$myal];$c17_name=$row["r_name"]; }
if ($row['r_id']==18) {  $c18=$row[$myal];$c18_name=$row["r_name"]; } // RM New Grn
if ($row['r_id']==19) {  $c19=$row[$myal];$c19_name=$row["r_name"]; } // RM New issue
if ($row['r_id']==20) {  $c20=$row[$myal];$c20_name=$row["r_name"]; } // RM New issue
if ($row['r_id']==21) {  $c21=$row[$myal];$c21_name=$row["r_name"]; } // RM New issue


  }
?>

 <!-- partial:partials/_sidebar.html -->
      <nav class="sidebar sidebar-offcanvas" id="sidebar" >
        <ul class="nav">
          <li class="nav-item nav-profile">
            <div class="nav-link">
             
              <div class="profile-name">
                <p class="name">
                  Welcome <?php echo $c1; ?>
                </p>
                <p class="designation">
                  <?php  echo $rm_Authority_Des; ?>
                </p>
              </div>
            </div>
          </li>
           <?php   if ($c1<>0) { ?>  
          <li class="nav-item">
            <a class="nav-link" href="home.php">
              <i class="fa fa-home menu-icon"></i>
              <span class="menu-title">Home</span>
            </a>
          </li>
          <?php }  ?>

           <li class="nav-item">
            <a class="nav-link" href="home.php">
              <i class="fas fa-chart-pie menu-icon"></i>
              <span class="menu-title"><?php echo $c1_name;  ?></span>
            </a>
          </li>
      <?php 



       //Sales

  if ($c2<>0) { ?>  
  <li class="nav-item">
            <a class="nav-link" data-toggle="collapse" href="#dt" aria-expanded="false" aria-controls="dt">
              <i class="fas fa-clipboard-list menu-icon"></i>
              <span class="menu-title"><?php echo $c2_name;  ?></span>
              <i class="menu-arrow"></i>
            </a>
            <div class="collapse" id="dt">
              <ul class="nav flex-column sub-menu">
                 <?php  if ($c3<>0) { ?>  
                <li class="nav-item"> <a class="nav-link" href="daysheet_view.php"><?php echo $c3_name;  ?></a></li> <?php }  ?>

                 <?php  if ($c4<>0) { ?>  
                <li class="nav-item"> <a class="nav-link" href="daysheet_view.php"><?php echo $c4_name;  ?></a></li> <?php }  ?>

                 <?php  if ($c5<>0) { ?>  
                <li class="nav-item"> <a class="nav-link" href="daysheet_view.php"><?php echo $c5_name;  ?></a></li> <?php }  ?>
              </ul>
            </div>
          </li>
 <?php }  ?>

  <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
   <?php 
  if ($c6<>0) { ?>  
  <li class="nav-item">

            <a class="nav-link" data-toggle="collapse" href="#IO" aria-expanded="false" aria-controls="IO">
              <i class="fas fa-clipboard-list menu-icon"></i>
              <span class="menu-title"><?php echo $c6_name;  ?></span>
              <i class="menu-arrow"></i>
            </a>
            <div class="collapse" id="IO">
              <ul class="nav flex-column sub-menu">
                 <?php  if ($c7<>0) { ?>  
                <li class="nav-item"> <a class="nav-link" href="daysheet_view.php"><?php echo $c7_name;  ?></a></li> <?php }  ?>

                 <?php  if ($c8<>0) { ?>  
                <li class="nav-item"> <a class="nav-link" href="daysheet_view.php"><?php echo $c8_name;  ?></a></li> <?php }  ?>

                 <?php  if ($c9<>0) { ?>  
                <li class="nav-item"> <a class="nav-link" href="daysheet_view.php"><?php echo $c9_name;  ?></a></li> <?php }  ?>

                 <?php  if ($c10<>0) { ?>  
                <li class="nav-item"> <a class="nav-link" href="daysheet_view.php"><?php echo $c10_name;  ?></a></li> <?php }  ?>

              </ul>
            </div>
          </li>
 <?php }  ?>

  <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->


<!--~~~~~~~~~~~~~~~~~~~~RM~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
   <?php 
  if ($c11<>0) { ?>  
  <li class="nav-item">

            <a class="nav-link" data-toggle="collapse" href="#rm" aria-expanded="false" aria-controls="rm">
              <i class="fas fa-clipboard-list menu-icon"></i>
              <span class="menu-title"><?php echo $c11_name;  ?></span>
              <i class="menu-arrow"></i>
            </a>
            <div class="collapse" id="rm">
              <ul class="nav flex-column sub-menu">
                 <?php  if ($c12<>0) { ?>  
                <li class="nav-item"> <a class="nav-link" href="admin_rm_new.php"><?php echo $c12_name;  ?></a></li> <?php }  ?>

                 <?php  if ($c13<>0) { ?>  
                <li class="nav-item"> <a class="nav-link" href="admin_rm_view.php"><?php echo $c13_name;  ?></a></li> <?php }  ?>

                 <?php  if ($c14<>0) { ?>  
                <li class="nav-item"> <a class="nav-link" href="admin_rmcat_new.php"><?php echo $c14_name;  ?></a></li> <?php }  ?>

                 <?php  if ($c15<>0) { ?>  
                <li class="nav-item"> <a class="nav-link" href="admin_rmcat_view.php"><?php echo $c15_name;  ?></a></li> <?php }  ?>

              </ul>
            </div>
          </li>
 <?php }  ?>

  <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->




<?php if ($c3<>0) { ?>  
<li class="nav-item">
            <a class="nav-link" data-toggle="collapse" href="#ui-auth" aria-expanded="false" aria-controls="ui">
              <i class="fab fa-wpforms menu-icon"></i>
              <span class="menu-title">Employee Management </span>
              <i class="menu-arrow"></i>
            </a>
            <div class="collapse" id="ui-auth">
              <ul class="nav flex-column sub-menu">
              
                 


  <li class="nav-item "> <a class="nav-link" href="user_roll_view.php">User roll</a></li>
              
              </ul>
            </div>
          </li>
 
 <?php }  ?>


<!--------------------RM Transaction------------------------>
<?php if ($c18<>0) { ?>  
<li class="nav-item">
            <a class="nav-link" data-toggle="collapse" href="#ui-rmtran" aria-expanded="false" aria-controls="ui">
              <i class="fab fa-wpforms menu-icon"></i>
              <span class="menu-title">RM Transaction </span>
              <i class="menu-arrow"></i>
            </a>
            <div class="collapse" id="ui-rmtran">
              <ul class="nav flex-column sub-menu">
    

              
               <?php  if ($c18<>0) { ?>  
                <li class="nav-item"> <a class="nav-link" href="st_grn.php"><?php echo $c18_name;  ?></a></li> <?php }  ?>

                  <?php  if ($c19<>0) { ?>  
                <li class="nav-item"> <a class="nav-link" href="st_grn_issue.php"><?php echo $c19_name;  ?></a></li> <?php }  ?>
              </ul>
            </div>
          </li>
 
 <?php }  ?>


<!---------------------------------------->

               <!--------------------Supplier Management------------------------>
<?php if ($c20<>0) { ?>  
<li class="nav-item">
            <a class="nav-link" data-toggle="collapse" href="#ui-suptran" aria-expanded="false" aria-controls="ui">
              <i class="fab fa-wpforms menu-icon"></i>
              <span class="menu-title">Supplier Managementn </span>
              <i class="menu-arrow"></i>
            </a>
            <div class="collapse" id="ui-suptran">
              <ul class="nav flex-column sub-menu">
    
 
              
               <?php  if ($c20<>0) { ?>  
                <li class="nav-item"> <a class="nav-link" href="admin_supplier.php"><?php echo $c20_name;  ?></a></li> <?php }  ?>

                  <?php  if ($c21<>0) { ?>  
                <li class="nav-item"> <a class="nav-link" href="admin_supplier_view.php"><?php echo $c21_name;  ?></a></li> <?php }  ?>
              </ul>
            </div>
          </li>
 
 <?php }  ?>


<!---------------------------------------->    







     



     



        </ul>
      </nav>
      <!-- partial -->
  