<?php
		session_start();
		include('php_conexion.php'); 
		if($_SESSION['tipo_usu']=='a' or $_SESSION['tipo_usu']=='e'){
		}else{
			header('location:error.php');
		}
		if($_SESSION['tipo_usu']=='a'){
			$titulo='Administrador';
		}else{
			$titulo='Usuario';
		}
		$usuario=limpiar($conexion, $_SESSION['username']);
		$sqll=mysqli_query($conexion, "SELECT * FROM usuarios WHERE usu='$usuario'");
		if($dato=mysqli_fetch_array($sqll)){
			$nombre=$dato['nom'];
			$palabra=explode(" ", $nombre);
			$nomb=$palabra[0];
		}
?>
<!DOCTYPE html>
<html lang="es">
<head>
	<meta charset="UTF-8">
	<title>Administrar</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
  	<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css">
  	<script src="js/jquery.min.js"></script>
  	<script src="bootstrap/js/bootstrap.min.js"></script>
    <link href="css/ionicons.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" language="javascript">
    function show5(){
        if (!document.layers&&!document.all&&!document.getElementById)
        return

         var Digital=new Date()
         var hours=Digital.getHours()
         var minutes=Digital.getMinutes()
         var seconds=Digital.getSeconds()

        var dn="PM"
        if (hours<12)
        dn="AM"
        if (hours>12)
        hours=hours-12
        if (hours==0)
        hours=12

         if (minutes<=9)
         minutes="0"+minutes
         if (seconds<=9)
         seconds="0"+seconds
        //change font size here to your desire
        myclock="<font size='4' face='Arial' color='white' ><b>"+hours+":"+minutes+":"
         +seconds+" "+dn+"</b></font>"
        if (document.layers){
        document.layers.liveclock.document.write(myclock)
        document.layers.liveclock.document.close()
        }
        else if (document.all)
        liveclock.innerHTML=myclock
        else if (document.getElementById)
        document.getElementById("liveclock").innerHTML=myclock
        setTimeout("show5()",1000)
         }


        window.onload=show5
         //-->
     
    </script>
</head>
<body>
<div class="container">
	<nav class="navbar fixed-top navbar-expand-sm navbar-dark pink scrolling-navbar" style="background-color: #000000;">
  <a class="navbar-brand" href="administrador.php"><?php echo $titulo; ?></a>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <div class="collapse navbar-collapse" id="navbarNavDropdown">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item dropdown">
        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownRegistroLink" data-toggle="dropdown">Registro<span class="sr-only">(current)</span></a>
        <div class="dropdown-menu" aria-labelledby="navbarDropdownRegistroLink">
        	<a href="pacientes.php" class="dropdown-item" target="admin"><span class="ion-person"></span> Pacientes</a>
        	<!--<a href="#" class="dropdown-item" target="admin">Empresas</a>-->
        </div>
      </li>
      <li class="nav-item dropdown">
        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownInformesLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
          Exámenes
        </a>
        <div class="dropdown-menu" aria-labelledby="navbarDropdownInformesLink">
          <a class="dropdown-item" href="triaje.php" target="admin"><span class="ion-ios-paper"></span> Triaje</a>
          <a class="dropdown-item" href="laboratoriocovid.php" target="admin"><span class="ion-ios-paper"></span> Laboratorio Covid19</a>
          <a class="dropdown-item" href="examenmedico.php" target="admin"><span class="ion-ios-paper"></span> Examen Médico</a>
        </div>
      </li>
      <li class="nav-item dropdown">
        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownInformesLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
          Reporte
        </a>
        <div class="dropdown-menu" aria-labelledby="navbarDropdownInformesLink">
          <a class="dropdown-item" href="ipress.php" target="admin"><span class="ion-ios-paper"></span> IPRESS PRIVADAS</a>
        </div>
      </li>
      <!--<li class="nav-item dropdown">
        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownReporteLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
          Reportes
        </a>
        <div class="dropdown-menu" aria-labelledby="navbarDropdownReportesLink">
          <a class="dropdown-item" href="#">Link 1</a>
          <a class="dropdown-item" href="#">Link 2</a>
          <a class="dropdown-item" href="#">Link 3</a>
        </div>
      </li>
      <li class="nav-item dropdown">
        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownConfigLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
          Configuracion
        </a>
        <div class="dropdown-menu" aria-labelledby="navbarDropdownConfigLink">
          <a class="dropdown-item" href="tipomuestra.php" target="admin"><span class="ion-ios-book"></span> Grupo examen</a>
          <a class="dropdown-item" href="empresas.php" target="admin"><span class="ion-hammer"></span> Empresas</a>
        </div>
      </li>
      <li class="nav-item dropdown">
        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownConfigLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
          Reportes
        </a>
        <div class="dropdown-menu" aria-labelledby="navbarDropdownConfigLink">
          <a class="dropdown-item" href="caja.php" target="admin"><span class="ion-ios-folder"></span> Caja</a>
          <a class="dropdown-item" href="reportepacientes.php" target="admin"><span class="ion-ios-folder"></span> Pacientes</a>
        </div>
      </li>-->
      
    </ul>
    <ul class="navbar-nav ml-auto">
      <li class="nav-item">
        <a class="nav-link disabled" id="liveclock"></a>
      </li>
      <li class="nav-item dropdown">
      	<a href="#" class="nav-link dropdown-toggle" id="navbarDropdownMenuLink2" data-toggle="dropdown"  aria-haspopup="true" aria-expanded="false">Hola! <?php echo $nomb; ?></a>
      	<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink2">
          <!--<a class="dropdown-item" href="#">Iniciar DB</a>
          <a class="dropdown-item" href="cambiarcontraseña.php">Contraseña</a>-->
          <a class="dropdown-item" href="php_cerrar.php"><span class="ion-android-exit"></span> Salir</a>
        </div>
      </li>
    </ul>
  </div>
</nav>
</div>

<div class="embed-container" style="margin-top: 65px;">
  <iframe src="inicio.php" scrolling="yes" frameborder="0" name="admin" width="100%" height="900" allowfullscreen></iframe>
</div>

</body>
</html>