<?php include('meta.php') ?>
<?php $bg_header = "bg_hc"; include('header.php') ?>
<?php
$user_agent = $_SERVER['HTTP_USER_AGENT'];
function getBrowser($user_agent){
if(strpos($user_agent, 'MSIE') !== FALSE)
   return 'Internet explorer';
 elseif(strpos($user_agent, 'Edge') !== FALSE) //Microsoft Edge
   return 'Microsoft Edge';
 elseif(strpos($user_agent, 'Trident') !== FALSE) //IE 11
    return 'Internet explorer';
 elseif(strpos($user_agent, 'Opera Mini') !== FALSE)
   return "Opera Mini";
 elseif(strpos($user_agent, 'Opera') || strpos($user_agent, 'OPR') !== FALSE)
   return "Opera";
 elseif(strpos($user_agent, 'Firefox') !== FALSE)
   return 'Mozilla Firefox';
 elseif(strpos($user_agent, 'Chrome') !== FALSE)
   return 'Google Chrome';
 elseif(strpos($user_agent, 'Safari') !== FALSE)
   return "Safari";
 else
   return 'No hemos podido detectar su navegador';
}
$navegador = getBrowser($user_agent);
// echo $navegador;
if( $navegador == 'Safari'){
	echo "<script type='text/javascript'>  
	window.location='../logout.php?sa=1';
	</script>";
	}
?>

	<div id="box_body"><!-- body center -->
	

	<?php 
	$id_paci = $_SESSION['id_paci'];
	$result = mysqli_query($con,"SELECT id,id_hc FROM user WHERE id = '$id_paci' ");  
	$hc = mysqli_fetch_assoc($result);
	$id_hc = $hc['id_hc'];	
	if($id_hc == 0){
		include('new_hc_public.php');
	} else {
		$id = $id_hc;
		echo "<script type='text/javascript'>  
		window.location='result.php?id=$id';
		</script>";	}
	?>
	<br><br>

	</div><!-- END body center -->
<?php include('../footer.php') ?>
