<?php session_start();
if(!empty($_SESSION['user_connect_id']))
{ require('../../config.php');

date_default_timezone_set('Africa/Algiers');
$d_aj=date('Y-m-d H:i:s');
$id=mysqli_real_escape_string($con,htmlspecialchars(trim($_POST['id']))) ;
$id_patient=mysqli_real_escape_string($con,htmlspecialchars(trim($_POST['id_patient']))) ;
$type_consult=mysqli_real_escape_string($con,htmlspecialchars(trim($_POST['type_consult']))) ;
$motif=mysqli_real_escape_string($con,htmlspecialchars(trim($_POST['motif']))) ;
$poids=mysqli_real_escape_string($con,htmlspecialchars(trim($_POST['poids']))) ;
$taille=mysqli_real_escape_string($con,htmlspecialchars(trim($_POST['taille']))) ;
$temperature=mysqli_real_escape_string($con,htmlspecialchars(trim($_POST['temperature']))) ;
$perimetre_cranien=mysqli_real_escape_string($con,htmlspecialchars(trim($_POST['perimetre_cranien']))) ;
$frequence_cardiaque=mysqli_real_escape_string($con,htmlspecialchars(trim($_POST['frequence_cardiaque']))) ;
$glycemie=mysqli_real_escape_string($con,htmlspecialchars(trim($_POST['glycemie']))) ;
$diagnostic_medical=mysqli_real_escape_string($con,htmlspecialchars(trim($_POST['diagnostic_medical']))) ;
 
$sql1 = "UPDATE consultations SET
        motif='$motif',
 id_patient='$id_patient',
 type_consult='$type_consult',
        poids='$poids',
        taille='$taille',
        perimetre_cranien='$perimetre_cranien',
        temperature='$temperature',
        frequence_cardiaque='$frequence_cardiaque',
        glycemie='$glycemie',
        diagnostic_medical='$diagnostic_medical',
        date_modification='$d_aj'
        where id='$id'";
        
            if(mysqli_query($con,$sql1)){echo 1; }else{
              echo 0;
               }
    }

?>
       
