if (!empty($_POST['id']))
$id=$_POST['id'];
if (!empty($_POST['annee']))
$annee=$_POST['annee'];
if (!empty($_POST['date_debut_fr']))
$date_debut_fr=$_POST['date_debut_fr'];
if (!empty($_POST['date_fin_fr']))
$date_fin_fr=$_POST['date_fin_fr'];
if (!empty($_POST['mission']))
$mission=$_POST['mission'];
if (!empty($_POST['lieu']))
$lieu=$_POST['lieu'];
if (!empty($_POST['navire']))
$navire=$_POST['navire'];
if (!empty($_POST['participants']))
$participants=$_POST['participants'];
if (!empty($_POST['theme']))
$theme=$_POST['theme'];
if (!empty($_POST['materiel']))
$materiel=$_POST['materiel'];
if (!empty($_POST['responsable']))
$responsable=$_POST['responsable'];
if (!empty($_POST['bouton_supp']))
$bouton_supp=$_POST['bouton_supp'];
if (!empty($_POST['bouton_valid']))
$bouton_valid=$_POST['bouton_valid'];
$tab = explode("/",$date_debut_fr);
$jour = $tab[0];
$mois = $tab[1];
$an = $tab[2];
$date_debut=$an."-".$mois."-".$jour;
$tab2 = explode("/",$date_fin_fr);
$jourf = $tab2[0];
$moisf = $tab2[1];
$anf = $tab2[2];
$date_fin=$anf."-".$moisf."-".$jourf;
require("../../init.php");
$db_link = mysql_connect($sql_serveur,$sql_user,$sql_passwd)
or die ("Impossible de se connecter au serveur!!!");
mysql_select_db($sql_bdd)
or die ("Impossible d'accéder à la base de données");
if($bouton_valid =='valider'){
$modif= "UPDATE $sql_tble_camp SET
mission= '$mission',
date_debut= '$date_debut',
date_fin= '$date_fin',
lieu= '$lieu',
navire= '$navire',
participants= '$participants',
theme= '$theme',
materiel= '$materiel',
responsable= '$responsable'
where id ='$id'";
mysql_query("$modif")
or die ("la requete modif des champs a échouée");
}
else if ($bouton_supp =='Supprimer'){
mysql_query("delete from $sql_tble_camp where id = '$id'")
or die ("La requête delete a échoué");
}
else
{}
//echo"$bouton_supp";
//echo"$bouton_valid";
// on ferme la connexion à mysql
mysql_close();
header("Location: gest_camp_list.php?annee=$annee");
?>