<?php 
if(isset($_GET['cual'])){$cual=$_GET['cual'];}
else $cual="0";
if(isset($_GET['id_pac'])){$id_pac=$_GET['id_pac'];}
if(isset($_GET['level']))
{
	$level=$_GET['level'];
	if($level==9)
	{
		$level="./ajax/examples/";
		$level2="./";
	}
}
else
{
	$level="";
	$level2="../../";
}
?>

<nav class="navbar navbar-toggleable-md navbar-inverse bg-primary" style="z-index:3">
      <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault1" aria-controls="navbarsExampleDefault1" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>
      <a class="navbar-brand" href="#">
	  <?php 
	  switch ($cual) {
    case 1:
        echo "Datos Paciente";
        break;
    case 2:
        echo "Historia Clinica";
        break;
    case 3:
        echo "Archivos";
        break;
	case 4:
        echo "Fichas";
        break;
	case 5:
        echo "Turno";
        break;
	case 6:
        echo "Presup";
        break;
	case 7:
        echo "SMS";
        break;
}
	  ?>
	  
	  </a>

      <div class="collapse navbar-collapse" id="navbarsExampleDefault1">
        <ul class="navbar-nav mr-auto">
          <li class="nav-item active">
            <a class="nav-link <?php if($cual==1)echo "bg-info";?>" href="<?php	echo $level;?>pac.php?cual=1&id_pac=<?php echo $id_pac;?>">Datos <span class="sr-only">(current)</span></a>
          </li>
		  <li class="nav-item active">
            <a class="nav-link <?php if($cual==2)echo "bg-info";?>" href="<?php	echo $level;
			switch ($clinica) {
				case 'clinica_43':
					echo "historia_palat.php";
					break;
				case 'clinica_62':
					echo "historia_torrente.php";
					break;
				case 'clinica_56':
					echo "historia_authier.php";
					break;
				default:
					echo "historia.php";
				}
			 ?>?cual=2&id_pac=<?php echo $id_pac;
			?>">Hist Clin <span class="sr-only">(current)</span></a>
          </li>
		  <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle <?php if($cual==3)echo "bg-info";?>" href="#" id="dropdown01" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Archivos</a>
            <div class="dropdown-menu" aria-labelledby="dropdown01">
              <a class="dropdown-item" href="<?php	echo $level;?>consentimiento.php?cual=3&id_pac=<?php echo $id_pac;?>">Generales</a>
			  <a class="dropdown-item" href="<?php	echo $level;?>archivos.php?cual=3&id_pac=<?php echo $id_pac;?>">del Paciente</a>
            </div>
          </li>
          <li class="nav-item dropdown">
            <?php if($cual==4) $bginfo="bg-info";
if($clinica!="clinica_55" && $clinica!="clinica_43") echo "<a class='nav-link dropdown-toggle bginfo href='#' id='dropdown01' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>Fichas</a>"; ?>
            <div class="dropdown-menu" aria-labelledby="dropdown01">
              <a class="dropdown-item" href="<?php	echo $level2;?>matriz.php?cual=4&level=9&id_pac=<?php echo $id_pac;?>">Odontograma</a>
              <a class="dropdown-item" href="<?php	echo $level2;?>periodonto.php?cual=4&level=9&id_pac=<?php echo $id_pac;?>">Periodontograma</a>
            </div>
          </li>
          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle <?php if($cual==5)echo "bg-info";?>" href="http://example.com" id="dropdown01" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Turno</a>
            <div class="dropdown-menu" aria-labelledby="dropdown01">
              <a class="dropdown-item" href="<?php	echo $level;?>auxi_turnos.php?cual=5&id_pac=<?php echo $id_pac;?>">Darle Turno</a>
              <a class="dropdown-item" href="<?php	echo $level;?>histoturnos.php?cual=5&id_pac=<?php echo $id_pac;?>">Hist Turnos</a>
            </div>
          </li>
          <li class="nav-item">
            <a class="nav-link enable <?php if($cual==6)echo "bg-info";?>" href="<?php	echo $level;?>presup.php?cual=5&id_pac=<?php echo $id_pac;?>">Presup.</a>
          </li>
		</ul>
      </div>
    </nav>