<?php
session_start();
require('45789417/ref4780.php');
if (!isset($_SESSION['userid'])) {
  echo "<script language='Javascript'> location.href='login.php';</script>";
    exit();
  };
if ($_SESSION['type_user_live'] == "Paciente") {
   	echo "<script type='text/javascript'>  
	window.location='paci_virtual/index.php';
	</script>";
    }  
?><!-- quitar en version publica -->
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8"> 
<title>Historia Clínica, Clínica Los Robles</title>
</head>
<body>
<?php 
date_default_timezone_set('America/Bogota');
/* insert datos del paciente */
$id = $_POST['id'];
$name = $_POST['name'];
$cell = $_POST['cell'];
$email = $_POST['email'];
$cc = $_POST['cc'];
$sex = $_POST['sex'];
/* $date1 = $_POST['date1']; */
$city = $_POST['city'];
$address = $_POST['address'];
$barrio = $_POST['barrio'];
$relationship = $_POST['relacion'];
$como_entero = $_POST['entero'];
$ocupacion = $_POST['ocupacion'];
$profesion =$_POST['profesion'];
$nhijos = $_POST['son'];
$tes = $_POST['tes'];
$birthdate = $_POST['birthdate'];
$age = $_POST['anostext2'];
$rh = $_POST['rh'];
$query = mysqli_query($con,"UPDATE hc_paciente SET  name='$name', cell='$cell', email='$email', cc='$cc', sex='$sex', city='$city', address='$address', barrio='$barrio', relationship='$relationship', como_entero='$como_entero', ocupacion='$ocupacion', profesion='$profesion', nhijos='$nhijos', tes='$tes', birthdate='$birthdate', age='$age', rh='$rh' WHERE id = '$id'");
echo "<script language='Javascript'> location.href='home.php?updatehc=1';</script>";
?>
</body>
</html>
