<?php
Include("includes/con_cliente.php");

 require_once('includes/connection.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 * FROM agendamentos WHERE vendedor like '".$_SESSION['User']."'";
    $resultado_alunos = mysqli_query($con, $result_alunos);


?>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1">
        
      <title>OPME - Exportação para Viman</title>

      <link rel="stylesheet" href="node_modules/bootstrap/compiler/bootstrap.css">
      <link rel="stylesheet" href="node_modules/bootstrap/compiler/styler.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 src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
      <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.15/jquery.mask.min.js"></script>
      <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
      <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>

      <script src="http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

      <script src="jquery.maskMoney.js" type="text/javascript"></script>
</head>
<body>
    <nav class="navbar navbar-expand-sm navbar-light justify-content-end fixed-top" style="background-color: #008080">
        <a style="color: #FFFAFA">OPME - Aministrativo - Exportãção de dados para Viman - <?php echo $resultado["nome"];?></a>
        <a class="btn btn-outline-light ml-auto mr-1" href="mnu.php" role="button">Voltar</a>
    </nav>

    <div class="container theme-showcase" role="main" style="margin-top: 3rem;">
        <div class="page-header">
            <h2>Agendamentos Disponíveis</h2>
        </div>
        
    </div>

    <div class="row mx-5">
        <div class="table-responsive-xl">
          <!--<table class="table table-sm"> -->
          <table style="overflow: auto;" class="table table-striped table-responsive-md btn-table table-hover table-bordered">
            <thead>
              <tr class="info">
                <th>Id</th>
                <th>Data</th>
                <th>Hora</th>
                <th>Hospital</th>
                <th>Cliente</th>
                <th>Médico</th>
                <th>Grupo</th>
                <th>Tipo</th>
                <th>Vendedor</th>
                <th>Obs</th>
                <th>Paciente</th>
                <th>Plano</th>
                <th>Solicitante</th>
              </tr>
            </thead>
            <tbody>
              <?php while($rows_alunos = mysqli_fetch_assoc($resultado_alunos)){ ?>
                <!--<tr onclick="location.href = 'detalheprocesso.php?id=<?php echo $rows_alunos['id']; ?>'" style="cursor: hand;"> -->
                <tr>
                  <td><?php echo $rows_alunos['id']; ?></td>
                  <td><?php echo $rows_alunos['data']; ?></td>
                  <td><?php echo $rows_alunos['hora']; ?></td>
                  <td><?php echo $rows_alunos['clientehospital']; ?></td>
                  <td><?php echo $rows_alunos['clientefaturamento']; ?></td>
                  <td><?php echo $rows_alunos['medico']; ?></td>
                  <td><?php echo $rows_alunos['grupo']; ?></td>
                  <td><?php echo $rows_alunos['tipo']; ?></td>
                  <td><?php echo $rows_alunos['vendedor']; ?></td>
                  <td><?php echo $rows_alunos['observacao']; ?></td>
                  <td><?php echo $rows_alunos['paciente']; ?></td>
                  <td><?php echo $rows_alunos['plano']; ?></td>
                  <td><?php echo $rows_alunos['pessoa']; ?></td>
                </tr>
              <?php } ?>
            </tbody>
           </table>
        </div>
        
      </div> 

      
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>

    
</body>
</html>