1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
| <?php
if(isset($_POST['action']) && $_POST['action']=="clic"){
// **********************récup nomDoc_fr, _en et datCopyright ***************************
$nomDoc_fr=mysql_real_escape_string ($_POST ["nomDoc_fr"]);
$nomDoc_en=$_POST ["nomDoc_en"];
$datCopyright=$_POST ["datCopyright"];
$nomRea=mysql_real_escape_string ($_POST ["nomRea"]);
$sqlInsertFilm=mysql_query("INSERT INTO documentaire (nomDoc_fr,nomDoc_en,datCopyright,nomRea) VALUES ('".$nomDoc_fr."', '".$nomDoc_en."', '".$datCopyright."', '".$nomRea."')");
// ********************** récup checbox formaDoc ***************************
$idDocumentaire=mysql_insert_id(); // La valeur de l'index attribué au document.
$choixFormaDoc=Array();
if(isset($_POST['formaDoc']))
{ // Envoie du formulaire...
$choixFormaDoc=$_POST['formaDoc'];
$sql="INSERT INTO docDisposeFormat (idDoc,idFormDoc) VALUES";
foreach($choixFormaDoc AS $choix) $sql.="(".$idDocumentaire.",'".$choix."'),"; // On enregistre chaque choix dans la table en indiquant l'idDoc du choix
if(mysql_query(substr($sql,0,strlen($sql)-1)))
echo "Enregistré!";
else echo "Non enregistré: (".$sql.") ".mysql_error();
}
function coche($val)
{ // Retourne checked si la valeur a été coché... :
global $choixFormaDoc;
return (in_array($val,$choixFormaDoc)?"checked":"");
}
/* ********************** récup checbox versionDoc ***************************
$idDocumentaire=mysql_insert_id(); // La valeur de l'index attribué au document.
$choixVersionDoc=Array();
if(isset($_POST['versionDoc']))
{ // Envoie du formulaire...
$choixVersionDoc=$_POST['versionDoc'];
$sql="INSERT INTO docEstEnVersion (idDoc,idVersionDoc) VALUES";
foreach($choixVersionDoc AS $choixV) $sql.="(".$idDocumentaire.",'".$choixV."'),"; // On enregistre chaque choix dans la table en indiquant l'idDoc du choix
if(mysql_query(substr($sql,0,strlen($sql)-1)))
echo "Enregistré!";
else echo "Non enregistré: (".$sql.") ".mysql_error();
}
function cocheV($valV)
{ // Retourne checked si la valeur a été coché... :
global $choixVersionDoc;
return (in_array($valV,$choixVersionDoc)?"checked":"");
}
*/
if(!$sqlInsertFilm) echo "Le film n'a pas été inscrit!";
if(!$sqlInsertFilm) echo "Le film n'a pas été inscrit! ".mysql_error();
else echo "<script>window.location='adminImgSaisie.php?CAT=imgDocSerie&TRAITER=AJOUTER'</script>";
} // fin if(isset($_POST['action']) && $_POST['action']=="clic")
?> |
Partager