
<?php

Include("includes/con_cliente.php");

 require_once('connection.php');
    session_start();

    if(isset($_SESSION['User']))
    {
        $query="select * from tbusuario where nomeuser='".$_SESSION['User']."'";
        $result=mysqli_query($con,$query);
        $resultado = mysqli_fetch_assoc($result);
        $r_resultado = $resultado;
        //echo $resultado["nome"] .'<br>';
    }
    else
    {
        header("location:index.php");
    }
?>

<html lang="pt-br">

    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <title>Sistema SCA - Grupo BRO</title>

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

        <!--<link rel="stylesheet" type="text/css" media="screen" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" /> -->
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
        <link rel="stylesheet" href="https://cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/e8bddc60e73c1ec2475f827be36e1957af72e2ea/build/css/bootstrap-datetimepicker.css" />

        <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
        <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment-with-locales.js"></script>
        <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="https://cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/e8bddc60e73c1ec2475f827be36e1957af72e2ea/src/js/bootstrap-datetimepicker.js"></script>

    </head>
    <body>
        <nav class="navbar navbar-expand-lg navbar-light bg-light" > <!-- Criação da Barra de navegação (navbar) { navbar-dark bg-dark }-->
            <div class="container">
                <a class="navbar-brand" href="menu.php">
                <img src="img/logomarca.png" width="70" height="60" class="d-inline-block align-center" alt="">
                SCA
                </a>
                <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSite"> <!-- botao do navbar -->
                  <span class="navbar-toggler-icon"></span> <!-- icone do navbar -->
                </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">
                              Cadastros
                          </a>
                          <div class="dropdown-menu"> <!-- itens menu dropdown -->
                              <a class="dropdown-item" href="nova_cirurgia.php">Fornecedores</a>
                              <a class="dropdown-item" href="s_agendamentos.php">Veículos</a>
                              <a class="dropdown-item" href="cirurgiasfaturadas.php">Motoristas</a>
                              <a class="dropdown-item" href="cirurgiasrealizadas.php">Serviços</a>
                              <a class="dropdown-item" href="cirurgiasfaturadas.php">Materiais</a>
                              

                          </div>
                      </li>
                     <li class="nav-item dropdown">
                          <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" id="navDrop">
                              Orçamentos
                          </a>
                          <div class="dropdown-menu">
                              <a class="dropdown-item" href="cirurgiaorcadas.php">Meus Orçamentos</a>
                             <!-- <a class="dropdown-item" href="#">Orçamentos Aprovados</a>
                              <a class="dropdown-item" href="#">Orçamentos Reprovados</a>
                              <a class="dropdown-item" href="#">Orçamentos Faturados</a>
                              <a class="dropdown-item" href="#">Orçamentos Em Abertos</a>
                              <a class="dropdown-item" href="#">Orçamentos Vencidos</a> -->
                          </div> 
                      </li>
                      
                  </ul>
                  <ul class="navbar-nav ml-auto"><!-- Menu dropdown a direita -->
                  
                    <!--  <li class="nav-item dropdown">
                          <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" id="navDrop">
                              Social
                          </a>
                          <div class="dropdown-menu">
                              <a class="dropdown-item" href="#">Facebook</a>
                              <a class="dropdown-item" href="#">Twitter</a>
                              <a class="dropdown-item" href="#">Instagram</a>
                          </div>
                      </li>
                  </ul>
                  <form class="form-inline">
                      <input class="form-control ml-4 mr-2"type="search" placeholder="Buscar...">
                      <button class="btn btn-dark" type="submit">OK</button>-->
                  
                  </form>
                  
                </div>


            </div>
        
        </nav>
        
        <div class="bg-danger">
        
          <h5 class="container p-2 page-header text-white text-center"> Bem vindo <?php echo $resultado["nomeuser"];?> </h5>
        
        </div>






<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css">

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js"></script>



        <div class="container">
          <div class="row">
            <div class="col-lg-6 m-auto">
              <!-- <picture>
                <source srcset="..." type="svg+xml">
                <img src="img/bro.svg" class="img-fluid img-thumbnail" alt="...">
              </picture> 
              <h6> Cirurgias Solicitadas = 00</h6>
              <h6> Cirurgias Orçadas = 00</h6>
              <h6> Cirurgias Faturadas = 00</h6>-->

              <h4 class="container p-2 page-header text-center"> Cirurgias em Aberto</h4>

              <div class="container" id="realizadas" style="height: 250px;">
                <script type="text/javascript">
                Morris.Bar({
                  element: 'realizadas',
                  data: <?php echo $data; ?>,
                  xkey: 'label',
                  ykeys: ['value'],
                  labels: ['Cirurgias']
                });

                </script>
              </div>

              <h4 class="container p-2 page-header text-center"> Cirurgias Faturadas</h4>
              <div class="container" id="faturadas" style="height: 250px;">

                <script type="text/javascript">
                Morris.Donut({
                  element: 'faturadas',
                  data: <?php echo $data2; ?>

                });

                </script>
              </div>





            </div>
          </div>
        </div>


       <!-- Footer -->
        <footer class="page-footer font-small text-white bg-danger">

          <!-- Copyright -->
          <div class="footer-copyright text-center py-3">© 2019 Copyright: Brasil Ortopedia
            <!--<a href="https://mdbootstrap.com/education/bootstrap/"> BrasilOrtopedia.com.br</a> -->
          </div>
          <!-- Copyright -->

        </footer>
        <!-- Footer -->


        





        <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>

    </body>
</html>
