<!DOCTYPE html>

<?php
Include("includes/con_cliente.php");
 
 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 'teste'";
    $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>
    	<title>OPME - Menu</title>

        <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">


    	<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
    	<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
    	<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>


    	<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">	
    </head>
    <body>
        <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="#" 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">
                    <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>


                <div class="container">
                    <div class="row row-striped">
                        <?php while($rows_alunos = mysqli_fetch_assoc($resultado_alunos)){ ?>
                        <div class="col-2 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>
            </div>
        </div>

    </body>
