<?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;
    }
    else
    {
        header("location:index.php");
    }

    $result_medico = "SELECT DISTINCT hospital FROM tbnf ORDER BY hospital asc";
    $resultado_medico = mysqli_query($con,$result_medico);
    $row_medico = mysqli_fetch_assoc($resultado_medico);

    $c_medico="SELECT DISTINCT hospital FROM tbnf ORDER BY hospital asc";
    $r_medico= mysql_query($c_medico);



?>


<html>
 <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" 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 fixed-top navbar-expand-lg navbar-dark" style="background-color: #3333ff;">
          <a class="navbar-brand" href="menu.php">
                <img src="img/logomarca.png" width="50" height="40" class="d-inline-block align-center" alt="">
                SCA - Margens - Pesquisa por Hospital
          </a>
          <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
          </button>
          <div class="collapse navbar-collapse" id="navbarTogglerDemo02">
            <ul class="navbar-nav mr-auto mt-2 mt-lg-0">
            </ul>
            <form class="form-inline my-2 my-lg-0">
              <button class="btn btn-primary btn-sm my-2 my-sm-0">
                <a href="pesquisanotas.php" style="color:inherit"> Voltar </a></button>
            </form>
          </div>
        </nav>
        <div style="margin-top: 5rem;" >
            <div class="row mx-5">
                <div class="card-body border border-dark rounded">
                    <div class="container">
                        <form method="POST" action="listahospital.php" enctype="multipart/form-data">
                            <div class="col-md-5 mb-3">
                                <label for="txthospital">Selecione o Hospital:</label>
                                <select class="custom-select " id="txthospital" style="margin-left: 10px; margin-top: 5px;" required name="txthospital">
                                <option value="">Selecione o Hospital...</option>
                                  <?php
                                      while($l_medico=mysql_fetch_array($r_medico)){
                                        echo "<option value='" .$l_medico['0']."'>".$l_medico['0']."</option>";
                                      }
                                  ?>
                                </select>
                                <button class="btn btn-success" style="margin-bottom: 10px;margin-top: 10px;margin-left: 10px;" type="submit" name="btnReload" >Selecionar Hospital</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>

        







 </body>


 
 </html>
