<?php
/*********************************************************************************
 * Gest'Ecole is a school management software developped by
 * DOX Conception Copyright (C) 2012-2013 DOX Conception
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the license published by DOX Conception.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY.  See the Software License for more details.
 * 
 * You should have received a copy of the software license along with
 * this program; if not, see:
 * http://www.doxconception.com/index.php/licence-de-gestecole.html
 ********************************************************************************/

  $id=$_POST['id'];
  $contenu=$_POST['contenu_e'];

  // Création ou modification de la classe
  if ($id=="")
  {
    $id=Construit_Id("accueil_news",10);
    $req = mysql_query("INSERT INTO `accueil_news` (id,date,id_prof,cible,titre,contenu) VALUES ('$id','".Date_Convertir($_POST['date'],$Format_Date_PHP,"Y-m-d")."','".$_SESSION['id_util']."','".$_POST['cible']."','".$_POST['titre']."','".$contenu."')");
  }
  else
  {
    $req = mysql_query("UPDATE `accueil_news` SET date='".Date_Convertir($_POST['date'],$Format_Date_PHP,"Y-m-d")."',cible='".$_POST['cible']."',titre='".$_POST['titre']."',contenu='".$contenu."' WHERE id='$id'");
  }
  
  echo $id;
?>