<!DOCTYPE html>
<?php
Include("includes/con_cliente.php");
// $con=mysqli_connect('127.0.0.1','root','fcf2778@','opme');
 session_start();

    if(isset($_SESSION['User']))
    {
        $query="select * from tblogin where nome='".$_SESSION['User']."'";
        $result=mysqli_query($con,$query);
        $resultado = mysqli_fetch_assoc($result);
        $r_resultado = $resultado;
    }
    else
    {
        header("location:index.php");
    }

   $result_alunos = "SELECT extract(day FROM `data`)as dia, DAYNAME(`data`) as dnome, monthname(`data`) as mnome, hora, paciente, clientehospital, medico, observacao  FROM agendamentos WHERE vendedor like '".$_SESSION['User']."' AND `data` >= date(now()) ORDER BY `data`";
    $resultado_alunos = mysqli_query($con, $result_alunos);

    setlocale( LC_ALL, 'pt_BR', 'pt_BR.iso-8859-1', 'pt_BR.utf-8', 'portuguese' ); 
  date_default_timezone_set( 'America/Sao_Paulo' );

?>


<html lang="pt-BR">
<head>
	<meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <link rel="stylesheet" href="node_modules/bootstrap/compiler/bootstrap.css">
    <link rel="stylesheet" href="node_modules/bootstrap/compiler/style.css">

    <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="css/simple-sidebar.css" rel="stylesheet">
    <link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
    <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">


	<title>OPME - Menu</title>
</head>
<body>
	<div class="d-flex" id="wrapper" style="background-color: #F0FFFF;">
  <!--<div class="d-flex" id="wrapper" style="background-image:url(img/wall1.png); background-repeat: no-repeat; background-size: cover; background-position: center center;" >-->

	    <div class="border-right" id="sidebar-wrapper" >
	      <div class="sidebar-heading" style="background-color: #008080;color:#FFFAFA; " ><?php echo $resultado["nome"];?></div>
	      <div class="list-group list-group-flush bg-transparent">
	        <a href="cirurgia.php" class="list-group-item list-group-item-action bg-transparent">Solicitar Cirurgia</a>
	        <a href="meusagendamentos.php" class="list-group-item list-group-item-action bg-transparent ">Minhas Cirurgias</a>
	        <a href="sair.php" class="list-group-item list-group-item-action bg-transparent ">Sair</a>
	        
	      </div>
	    </div>
		 
		 <div id="page-content-wrapper">

	      <nav class="navbar navbar-expand-lg navbar-light border-bottom" style="background-color: #008080">
	      <!--<nav class="navbar fixed-top navbar-expand-lg navbar-dark" style="background-color: #008080"> -->

	        <button class="btn btn-outline-light" id="menu-toggle">Menu</button>

	        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
	        </button>

	      </nav>

        

        <?php while($rows_alunos = mysqli_fetch_assoc($resultado_alunos)){ ?>
        <div class="col-1 text-right" >
            <h1 class="display-4"><span class="badge badge-secondary"><?php echo $rows_alunos['dia']; ?></span></h1>
            <h2><?php echo strftime( '%B ', strtotime($rows_alunos['mnome'])); ?></h2>
        </div>
        <div class="col-10">
            <h3 class="text-uppercase"><strong><?php echo $rows_alunos['paciente']; ?></strong></h3>
            <ul class="list-inline">
                <li class="list-inline-item"><i class="fa fa-calendar-o" aria-hidden="true">&ensp;</i><?php  echo strftime( '%A, ', strtotime($rows_alunos['dnome'])); ?></li>
                <li class="list-inline-item"><i class="fa fa-clock-o" aria-hidden="true">&ensp;</i><?php echo $rows_alunos['hora']; ?></li>
                <li class="list-inline-item"><i class="fa fa-h-square" aria-hidden="true">&ensp;</i><?php echo $rows_alunos['clientehospital']; ?></li>
                <li class="list-inline-item"><i class="fa fa-user-md" aria-hidden="true">&ensp;</i><?php echo $rows_alunos['medico']; ?></li>
            </ul>
            <p><?php echo $rows_alunos['observacao']; ?></p>
        </div>
        
        <?php } ?>

      </div>
    </div>












	<!--<nav class="navbar fixed-top navbar-expand-lg navbar-dark" style="background-color: #008080">
          
          <div class="container">
              <a class="navbar-brand" href="index.html">
                
                OPME - <?php echo $resultado["nome"];?>
              </a>
              <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSite"> 
                  <span class="navbar-toggler-icon"></span> 
              </button>

              <div class="collapse navbar-collapse" id="navbarSite">
                   <ul class="navbar-nav mr-auto">
                      
                      <li class="nav-item dropdown">
                          <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" id="navDrop">
                              Cirurgias
                          </a>
                          <div class="dropdown-menu"> 
                              <a class="dropdown-item" href="nova_cirurgia.php">Solicitar Cirurgia</a>
                              <a class="dropdown-item" href="s_agendamentos.php">Minhas Cirurgias</a>
                          </div>
                      </li>
                    
                      
                  </ul>
                 

                 
          </div>
      
      
      
      </nav> -->
      

<script src="node_modules/jquery/dist/jquery.js"></script>
<script src="node_modules/popper.js/dist/popper.js"></script>
<script src="node_modules/bootstrap/dist/js/bootstrap.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.11/jquery.mask.min.js"></script>

<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

<!-- Menu Toggle Script -->
<script>
  $("#menu-toggle").click(function(e) {
    e.preventDefault();
    $("#wrapper").toggleClass("toggled");
  });
</script>


</body>
</html>