<?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>";
    }  
?>
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8"> 
<title>Historia Clínica, Clínica Los Robles</title>
</head>
<body>
<?php
$id = $_POST['id'];
$obser = $_POST['obser'];
$query = mysqli_query($con,"UPDATE hc_control0 SET obser='$obser' WHERE id = '$id'");
$exa_ta = $_POST['exa_ta'];
$exa_fc = $_POST['exa_fc'];
$exa_fr = $_POST['exa_fr'];
$exa_to = $_POST['exa_to'];
$craneo = $_POST['craneo'];
$abdomen = $_POST['abdomen'];
$muscular = $_POST['muscular'];	
$torax = $_POST['torax'];
$genitales = $_POST['genitales'];
$reflejos = $_POST['reflejos'];
$osteoarticular = $_POST['osteoarticular'];
$piel = $_POST['piel'];
$pres = $_POST['pres'];
if( isset($_POST['edit']) ){	
	$query = mysqli_query($con,"UPDATE hc_control0 SET exa_ta='$exa_ta', exa_fc='$exa_fc', exa_fr='$exa_fr', exa_to='$exa_to', craneo='$craneo', abdomen='$abdomen', muscular='$muscular', torax='$torax', genitales='$genitales', neurologicos='$reflejos', osteoarticular='$osteoarticular', piel='$piel', pres='$pres' WHERE id = '$id'");
	} 
/* update cita  CMA*/
$update_cma = mysqli_query($con,"SELECT id,cc FROM hc_paciente WHERE id = '$id'");
	$reg = mysqli_fetch_assoc($update_cma);
		$cc = $reg['cc'];
$query = mysqli_query($con,"UPDATE se_evenement SET CMA='2' WHERE title = '$cc'");
echo "<script language='Javascript'> location.href='result.php?id=$id';</script>";
?>
</body>
</html>
