1) ? true : false; $lnk = ($AID > 0) ? "?aid=".$AID : ""; $lnk .= ($EID > 0) ? "&eid=".$EID : ""; // die($MID); if($MID == 0){ header("location:motifList.php".$lnk); } $s = $s1 = $s2 = $s3 = $multilangJoin = ""; $L = isset($_REQUEST["lang"])?$_REQUEST["lang"]:'fr'; if($multilang){ $multilangJoin = "LEFT JOIN ca_motifs_lang ml ON ml.id_motif = m.id_motif AND ml.id_lang='".$L."' "; $multilangCol = ", ml.titre, ml.id_lang"; } else{ $multilangCol = ", m.titre, 'fr' as 'id_lang'"; } $q = "SELECT m.id_motif, m.titre as titre_default, m.enabled, m.code, m.picto, m.couleur".$multilangCol." FROM ca_motifs m ".$multilangJoin."WHERE m.id_motif=:id_motif"; $values = array(':id_motif' => $MID); $result = excuteQuery($q, $values); $r = $result['stmt']; $o = $r->fetchObject(); if($o->enabled == 0){ $CHECKED = ""; } else{ $CHECKED = "checked='checked'"; } $q = "SELECT a.id_agence, a.nom_agence FROM ca_motif_agence ma LEFT JOIN ca_agences a ON a.id_agence = ma.id_agence WHERE ma.id_motif=:id_motif AND ma.supp IS NULL AND a.supp=0"; $values = array(':id_motif' => $MID); $result = excuteQuery($q, $values); $r = $result['stmt']; $attachedIds = array(); $list = "