<?php session_start();
if(empty($_SESSION['user_connect_id']))
{
 header('Location: login.php');
}else{
require 'config.php';
$grade=$_SESSION['user_connect_grade'];
$id=$_SESSION['user_connect_id'];
$query_us_connect=mysqli_query($con,"SELECT * FROM users where id='$id' ");
$user_c= mysqli_fetch_array($query_us_connect)
 ?><!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    
    <title>Gestion Med </title>
    <link href="assets/css/bootstrap.css" rel="stylesheet">
    <link href="assets/font-awesome/css/fontawesome-all.min.css" rel="stylesheet" />
 
    <link href="assets/css/style.css" rel="stylesheet">
    <link href="assets/css/style-responsive.css" rel="stylesheet">
     
    <script src="assets/js/jquery.js"></script>
    <script src="assets/js/jquery-ui.js"></script>

    
 
 <script src="assets/js/functions.js"></script>
  </head>

  <body>
  <section id="container" >

      <header class="header black-bg">
              <div class="sidebar-toggle-box">
                  <div class="fa fa-bars tooltips" data-placement="right" data-original-title="Basculer la navigation
"></div>
              </div>
              <a href="index.php" class="logo"><b>ALGERMED</b></a>

            <div class="nav notify-row" id="top_menu">

                <ul class="nav top-menu">


                </ul>

            </div>
            <div class="top-menu">
            	<ul class="nav pull-right top-menu">
                    <li><a class="logout" href="logOut.php">Déconnexion</a></li>
            	</ul>
            </div>
        </header>

      <aside>
          <div id="sidebar"  class="nav-collapse ">
           
           <?php include("pages/menu.php"); ?>   
           </div>
      </aside>

      <section id="main-content">
          <section class="wrapper">
                           <?php
if(isset($_GET['p'])){
    if($_GET['p']=="profile"){ include("pages/edit_profile.php");}
  // utilisateurs
    else if($_GET['p']=="users"){ include("pages/user/liste.php");}
    else if($_GET['p']=="add_user"){ include("pages/user/ajouter.php");}
    else if($_GET['p']=="edit_user"){ include("pages/user/modifier.php");}

  //patient 
    else if($_GET['p']=="patient"){ include("pages/patient/liste.php");}
    else if($_GET['p']=="add_patient"){ include("pages/patient/ajouter.php");}
    else if($_GET['p']=="edit_patient"){ include("pages/patient/infos.php");}
      else if($_GET['p']=="infos_patient"){ include("pages/patient/infos.php");}
  // consultations
    else if($_GET['p']=="consultations"){ include("pages/consultation/listeG.php");}
    else if($_GET['p']=="add_consultation"){ include("pages/consultation/ajouter.php");}
    else if($_GET['p']=="edit_consultation"){ include("pages/consultation/modifier.php");}
//ordonances
    else if($_GET['p']=="ordonnances"){ include("pages/ordonnance/listeG.php");}
    else if($_GET['p']=="ord_consult"){ include("pages/ordonnance/liste.php");}
    else if($_GET['p']=="add_ordonnance"){ include("pages/ordonnance/ajouter.php");}
    else if($_GET['p']=="edit_ordonnance"){ include("pages/ordonnance/modifier.php");}
    else if($_GET['p']=="print_ord"){ include("pages/ordonnance/file.php");}


    //bilans
    else if($_GET['p']=="bilans"){ include("pages/bilan/listeG.php");}
    else if($_GET['p']=="bilan_consult"){ include("pages/bilan/liste.php");}
    else if($_GET['p']=="add_bilan"){ include("pages/bilan/ajouter.php");}
    else if($_GET['p']=="edit_bilan"){ include("pages/bilan/modifier.php");}
    else if($_GET['p']=="print_bilan"){ include("pages/bilan/bilan.php");}

    else
                 {
                    include("pages/404.php");
                  }
       }else{
         include("pages/default.php");
       }
                ?>

          </section>
      </section>

    
      <footer class="site-footer">
          <div class="text-center">
              2022 - ALGERMED
              <a href="#" class="go-top">
                  <i class="fa fa-angle-up"></i>
              </a>
          </div>
      </footer>
     
  </section>


    <script src="assets/js/bootstrap.min.js"></script>
    <script src="assets/js/bootstrap-autocomplete.min.js"></script>
    <script class="include" type="text/javascript" src="assets/js/jquery.dcjqaccordion.2.7.js"></script>
    <script src="assets/js/jquery.scrollTo.min.js"></script>
    <script src="assets/js/jquery.nicescroll.js" type="text/javascript"></script>
   
    <script src="assets/js/common-scripts.js"></script>
     <link href="assets/css/dataTables.bootstrap4.min.css" rel="stylesheet">
     <script src="assets/js/jquery.dataTables.min.js"></script>
   <script src="assets/js/dataTables.bootstrap4.min.js"></script>
   <script src="assets/js/sweetalert2.all.js"></script>

    <script type="text/javascript">
      $(document).ready(function() {

    $('#dataTables').DataTable({
     "order": [],
      "language": {
         
    "sProcessing":     "Traitement en cours...",
    "sSearch":         "Rechercher&nbsp;:",
    "sLengthMenu":     "Afficher _MENU_ &eacute;l&eacute;ments",
    "sInfo":           "Affichage de l'&eacute;l&eacute;ment _START_ &agrave; _END_ sur _TOTAL_ &eacute;l&eacute;ments",
    "sInfoEmpty":      "Affichage de l'&eacute;l&eacute;ment 0 &agrave; 0 sur 0 &eacute;l&eacute;ment",
    "sInfoFiltered":   "(filtr&eacute; de _MAX_ &eacute;l&eacute;ments au total)",
    "sInfoPostFix":    "",
    "sLoadingRecords": "Chargement en cours...",
    "sZeroRecords":    "Aucun &eacute;l&eacute;ment &agrave; afficher",
    "sEmptyTable":     "Aucune donn&eacute;e disponible dans le tableau",
    "oPaginate": {
        "sFirst":      "Premier",
        "sPrevious":   "Pr&eacute;c&eacute;dent",
        "sNext":       "Suivant",
        "sLast":       "Dernier"
    },
    "oAria": {
        "sSortAscending":  ": activer pour trier la colonne par ordre croissant",
        "sSortDescending": ": activer pour trier la colonne par ordre d&eacute;croissant"
    }

        }
    });
} );
      </script>
  </body>
</html>
  <?php } ?>