=sysdate() AND ";
$sql = "SELECT arc_expl_notice, arc_expl_bulletin, " ;
$sql.= "group_concat(distinct date_format(arc_debut, '".$msg["format_date_sql"]."') separator '
') as aff_pret_debut, ";
$sql.= "trim(concat(ifnull(notices_m.tit1,''),ifnull(notices_s.tit1,''),' ',ifnull(bulletin_numero,''), if(mention_date, concat(' (',mention_date,')') ,if (date_date, concat(' (',date_format(date_date, '".$msg["format_date_sql"]."'),')') ,'')))) as tit, if(notices_m.notice_id, notices_m.notice_id, notices_s.notice_id) as not_id ";
$sql.= "FROM (((pret_archive LEFT JOIN notices AS notices_m ON arc_expl_notice = notices_m.notice_id ) ";
$sql.= " LEFT JOIN bulletins ON arc_expl_bulletin = bulletins.bulletin_id) ";
$sql.= " LEFT JOIN notices AS notices_s ON bulletin_notice = notices_s.notice_id), ";
$sql.= " empr ";
$sql.= "WHERE $restrict_date empr.id_empr = arc_id_empr and arc_id_empr='$id_empr' ";
$sql.= "group by arc_expl_notice, arc_expl_bulletin, tit, not_id ";
$sql.= "having tit is not null and tit <> '' ";
$sql.= "order by arc_debut desc $limit ";
$req = mysql_query($sql) or die("Erreur SQL !
".$sql."
".mysql_error());
$nb_elements = mysql_num_rows($req) ;
if ($nb_elements) {
echo"
";
echo "" ;
echo "".$msg["title"]." |
".$msg["author"]." |
".$msg["date_loan"]." | ";
echo "
" ;
$odd_even=1;
while ($data = mysql_fetch_array($req)) {
$titre = $data['tit'];
// **********
$responsab = array("responsabilites" => array(),"auteurs" => array()); // les auteurs
$responsab = get_notice_authors($data['not_id']) ;
//$this->responsabilites
$as = array_search ("0", $responsab["responsabilites"]) ;
if ($as!== FALSE && $as!== NULL) {
$auteur_0 = $responsab["auteurs"][$as] ;
$auteur = new auteur($auteur_0["id"]);
$mention_resp = $auteur->isbd_entry;
} else {
$as = array_keys ($responsab["responsabilites"], "1" ) ;
for ($i = 0 ; $i < count($as) ; $i++) {
$indice = $as[$i] ;
$auteur_1 = $responsab["auteurs"][$indice] ;
$auteur = new auteur($auteur_1["id"]);
$aut1_libelle[]= $auteur->isbd_entry;
}
$mention_resp = implode (", ",$aut1_libelle) ;
$aut1_libelle = array();
}
$mention_resp ? $auteur = $mention_resp : $auteur="";
// on affiche les résultats
if ($odd_even==0) {
$pair_impair="odd";
$odd_even=1;
} else if ($odd_even==1) {
$pair_impair="even";
$odd_even=0;
}
if ($data['arc_expl_notice']) $tr_javascript=" class='$pair_impair' onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='$pair_impair'\" onmousedown=\"document.location='./index.php?lvl=notice_display&id=".$data['not_id']."&seule=1';\" style='cursor: pointer' ";
else $tr_javascript=" class='$pair_impair' onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='$pair_impair'\" onmousedown=\"document.location='./index.php?lvl=bulletin_display&id=".$data['arc_expl_bulletin']."';\" style='cursor: pointer' ";
$deb_ligne = "";
echo $deb_ligne ;
echo "".$titre." | ";
echo "".$auteur." | ";
echo "".$data['aff_pret_debut']." | ";
echo "
\n";
}
echo "
";
}