<div class="span2" id="sidebar" style="margin-right: 10px;">
                    <ul class="nav nav-list bs-docs-sidenav nav-collapse collapse">
                    <?php
                    if($_SESSION['role']=="admin"){
                            ?>
                        <li class="active">
                            <a href="../main/dashboard.php"><i class="fa fa-dashboard"></i> Dashboard</a>
                        </li>
                        <?php } ?>
                        <!-- <li>
                            <a href="calendar.html"><i class="icon-chevron-right"></i> Calendar</a>
                        </li> -->
                        <?php
                        include '../includes/connection.php';
                        $poduct_number="0";
// Create connection
$sql = mysqli_query($con,"SELECT count(id)as num, (select count(id) from sales) as sales, (select count(id) from users)as users, (select count(id) from staff) as staff FROM products");
//$result = mysqli_query($con, $sql);


    // output data of each row
    while($row = mysqli_fetch_assoc($sql)) {
       $poduct_number=$row['num'];
       $sales_number=$row['sales'];
       $users=$row['users'];
       $stafxp=$row['staff'];
    }


mysqli_close($con);




                        ?>


                        <li>
                            <a href="../stock/products.php"><span class="badge badge-success pull-right"> <?php echo $poduct_number;

                             ?></span> <i class="fa fa-shopping-cart"></i> Products</a>
                        </li>
                        <!-- <li>
                            <a href="form.html"><i class="icon-chevron-right"></i> Forms</a>
                        </li> -->
                        <li>
                            <a href="../sales/new_order.php"><span class="badge badge-info pull-right"><?php echo $sales_number; ?></span><i class="fa fa-shopping-bag"></i> &nbsp;Sales</a>
                        </li>
                        <li>
                            <a href="../reports/sales_report.php"><i class="fa fa-table"></i> &nbsp;Sales Report</a>
                        </li>
                        

                        <li>
                            <a href="../expenses/expenses.php"><i class="fa fa-credit-card-alt"></i> &nbsp;Expenses</a>
                        </li>
                        <!-- <li>
                            <a href="buttons.html"><i class="icon-chevron-right"></i> Buttons & Icons</a>
                        </li> -->
                        <!-- <li>
                            <a href="editors.html"><i class="icon-chevron-right"></i> WYSIWYG Editors</a>
                        </li> -->
                       <!--  <li>
                            <a href="interface.html"><i class="icon-chevron-right"></i> UI & Interface</a>
                        </li>
                        <li>
                            <a href="#"><span class="badge badge-success pull-right">731</span> Orders</a>
                        </li>
                        <li>
                            <a href="#"><span class="badge badge-success pull-right">812</span> Invoices</a>
                        </li>
                        <li>
                            <a href="#"><span class="badge badge-info pull-right">27</span> Clients</a> -->
                        </li>
                        <?php 
//hide users from attendants
                        if($_SESSION['role']=="admin"){
                            ?>
                            <li>
                            <a href="../reports/returns.php"><i class="fa fa-table"></i> &nbsp;Returns Report</a>
                        </li>
                        <li>
                            <a href="../reports/purchases_report.php"><i class="fa fa-table"></i> &nbsp;Purchases Report</a>
                        </li>
                        <li>
                            <a href="../purchases/creditors.php"><i class="fa fa-table"></i> &nbsp;Creditors Report</a>
                        </li>
                        <li>
                            <a href="../purchases/payment_logs.php"><i class="fa fa-table"></i> &nbsp;Payment Report</a>
                        </li>
                        <li>
                            <a href="../users/users.php"><span class="badge badge-warning pull-right"><?php echo $users; ?></span><i class="fa fa-users"></i> &nbsp; Users</a>
                        </li>
                        <li>
                            <a href="../staff/staff.php"><span class="badge badge-warning pull-right"><?php echo $stafxp; ?></span> <i class="fa fa-address-book-o"></i> &nbsp;Staff</a>
                        </li>
                        
                        <li>
                            <!--<a href="../account/myacount.php">My Account</a> -->
                        </li>
                        <!-- <li>
                            <a href="#"><span class="badge badge-info pull-right">11</span> Reports</a>
                        </li>-->
                         <li>
                            <a href="../stock/suppliers.php"><span class="badge badge-important pull-right">83</span><i class="fa fa-balance-scale"></i> &nbsp; Suppliers</a>
                        </li>
                        <li>
                            <a href="../stock/units.php"><span class="badge badge-important pull-right">83</span><i class="fa fa-balance-scale"></i> &nbsp; Units</a>
                        </li> 
                        <?php } ?>
                        <?php 
//hide logs from attendants
                        if($_SESSION['role']=="admin"){
                        ?><li>
			
                            <a href="../main/logs.php"><i class="fa fa-tasks"></i> &nbsp;Logs</a>
                        </li>
                        <?php
                        }
                        ?>
                    </ul>
                </div>