 <div class="panel panel-success">
                        
  <div class="panel-heading">Departments <i class="badge"> <?php echo  get_total_department(); ?></i></div>
  <div class="panel-body">
  
    <div class="col-md-6">
     
          <ul class="list-group">
          
              
              <?php echo get_listed_departments_staff();?>
             
          
          </ul>
      
      
      
    </div><!-- col md 6-->
    
     <div class="col-md-6">
      <div class="well">
          <?php
  
              $q = "SELECT * FROM departments WHERE status ='0' ORDER BY title ";
              $r = mysqli_query($dbc, $q);
              
              if(mysqli_num_rows($r)>0)
              {
                   
                  while($row = mysqli_fetch_array($r,MYSQLI_ASSOC))
                  {
                      
                      $id = $row['id']; // collect the id
                      $title = $row['title']; //collect the title
                      
          ?>	
         <!-- bar for faculty -->
         <div class="row">
        <span class="pull-left" style="margin-left:14px; font-size:12px"><?php echo $title; ?></span>
        <span class="pull-right"><span class="pull-right" style="font-size:12px">
        <?php echo get_percent($value = get_total_department_staff($id), $total = get_total_staff()); ?>%</span>
        </div>

        <div class="progress">

            <div class="progress-bar <?php  echo get_color (get_percent(  $value = get_total_department_staff($id), $total = get_total_staff())  ); ?>" 
                style="width: <?php echo get_percent(  $value = get_total_department_staff($id), $total = get_total_staff()); ?>%">
            </div>
        
        </div>
            
      
      
       <?php
      }//end of while
  }//end of if

?>    

      
      </div><!-- /well -->
    </div><!-- col md 6-->
  
  </div><!-- /panel body -->

</div>
