<?php

if($_a=='insert'):

    //print_r($_REQUEST);exit();

    $id=execute("insert into form(id) values(0)");

    $field='';

    extract(addslashes_array($_REQUEST));

    //$compagnie=$compagnie=='-1'?$compagnie_:$compagnie;

    $date_nais=(isset($mois_nais)&isset($mois_nais)&isset($annee_nais))?date('Y-m-d',mktime(0,0,0,$mois_nais,$jour_nais,$annee_nais)):date('Y-m-d');

    $date_arrivee=(isset($mois_arrivee)&isset($mois_arrivee)&isset($annee_arrivee))?date('Y-m-d',mktime(0,0,0,$mois_arrivee,$jour_arrivee,$annee_arrivee)):date('Y-m-d');

    $field.=isset($nom)?"nom='$nom',":'';

    $field.=isset($postnom)?"postnom='$postnom',":'';

    $field.=isset($prenom)?"prenom='$prenom',":'';

    $field.=isset($sexe)?"sexe='$sexe',":'';

    $field.=isset($date_nais)?"date_nais='$date_nais',":'';

    $field.=isset($date_arrivee)?"date_arrivee='$date_arrivee',":'';

    $field.=isset($nationalite)?"nationalite='$nationalite',":'';

    $field.=isset($pays_origine)?"pays_origine='$pays_origine',":'';

    $field.=isset($num_passeport)?"num_passeport='$num_passeport',":'';

    $field.=isset($telephone)?"telephone='$telephone',":'';

    $field.=isset($email)?"email='$email',":'';

    $field.=isset($compagnie)?"compagnie='$compagnie',":'';

    $field.=isset($province)?"province='$province',":'';

    $field.=isset($voie_transport)?"voie_transport='$voie_transport',":'';

    $field.=isset($num_vol)?"num_vol='$num_vol',":'';

    $field.=isset($num_siege)?"num_siege='$num_siege',":'';

    $field.=isset($destination)?"destination='$destination',":'';

    $field.=isset($pays_visite)?"pays_visite='$pays_visite',":'';

    $field.=isset($fievre)?"fievre='$fievre',":'';

    $field.=isset($sensation_fievre)?"sensation_fievre='$sensation_fievre',":'';

    $field.=isset($test_covid)?"test_covid='$test_covid',":'';

    $field.=isset($toux)?"toux='$toux',":'';

    $field.=isset($frisson)?"frisson='$frisson',":'';

    $field.=isset($difficulte_respiratoire)?"difficulte_respiratoire='$difficulte_respiratoire',":'';

    $field.=isset($adresse)?"adresse='$adresse',":'';

    $field.=isset($assurance_maladie)?"assurance_maladie='$assurance_maladie',":'';

    $field.=isset($langue)?"langue='$langue',":'';

    $field.=isset($etat)?"etat='$etat',":'etat=true';

    $sql="update form set $field where id='$id'";

    execute($sql);

    echo$id;

endif;

