array( 'type' => Fill::FILL_SOLID, 'color' => array('rgb' => '00CCFF') ) ); $heading_10 = array( 'font' => array( 'bold' => true, 'size' => 10 ) ); $heading_12 = array( 'font' => array( 'bold' => true, 'size' => 12 ) ); } // REQUETE SQL if ($opac_empr_hist_nb_max) $limit=" LIMIT 0, $opac_empr_hist_nb_max "; else $limit = ''; if ($opac_empr_hist_nb_jour_max) $restrict_date=" date_add(pret_archive.arc_fin, INTERVAL $opac_empr_hist_nb_jour_max day)>=sysdate() AND "; else $restrict_date=""; $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, "; $sql.= "if(notices_m.notice_id, notices_m.notice_id, notices_s.notice_id) as not_id, if(notices_m.tparent_id, notices_m.tparent_id, notices_s.tparent_id) as tparent_id, if(notices_m.tnvol, notices_m.tnvol, notices_s.tnvol) as tnvol "; $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.= " and arc_fin < '".date("Y-m-d H:i:s")."'"; $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 = pmb_mysql_query($sql) or die("Erreur SQL !
".$sql."
".pmb_mysql_error()); $nb_elements = pmb_mysql_num_rows($req) ; if(!$dest && $nb_elements) { print ""; } if (!$dest){ global $opac_cart_allow; if ($opac_empr_export_loans) { echo ""; } if ($opac_empr_export_loans && $nb_elements) { echo " "; } if ($nb_elements && $opac_cart_allow) { echo ""; echo "
"; } } if ($nb_elements) { if (!$dest) { echo ""; echo ""; echo ""; echo "" ; echo ""; echo "" ; echo ""; $odd_even=1; while ($data = pmb_mysql_fetch_array($req)) { $titre = $data['tit']; // récupération du titre de série $titre_serie=""; if ($data['tparent_id']) { $parent = new serie($data['tparent_id']); $titre_serie = $parent->name; if($data['tnvol']) $titre_serie .= ', '.$data['tnvol']; } if($titre_serie) { $titre = $titre_serie.'. '.$titre; } // ********** $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->get_isbd(); } else { $aut1_libelle = array(); $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->get_isbd(); } $mention_resp = implode (", ",$aut1_libelle) ; } $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 ""; echo ""; echo ""; echo "\n"; } echo "
".$msg["title"]." ".$msg["author"]." ".$msg["date_loan"]."
".$titre."".$auteur."".$data['aff_pret_debut']."
"; } elseif ($dest=="TABLEAU") { //Titre $worksheet->write(0,0,$msg["empr_loans_old"],$heading_blue); $worksheet->merge_cells(0,0,0,6); //Entêtes $line = 2; $x=0; $worksheet->write($line,$x,$msg["title"],$heading_10); $worksheet->write($line,$x+1,$msg["authors"],$heading_10); $worksheet->write($line,$x+2,$msg["date_loan"],$heading_10); //Valeurs $loc_cours=""; while ($data = pmb_mysql_fetch_array($req)) { $line++; $x=0; $titre = $data['tit']; $responsab = array("responsabilites" => array(),"auteurs" => array()); // les auteurs $responsab = get_notice_authors($data['not_id']) ; $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->get_isbd(); } else { $aut1_libelle = array(); $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->get_isbd(); } $mention_resp = implode (", ",$aut1_libelle) ; } $mention_resp ? $auteur = $mention_resp : $auteur=""; $worksheet->write($line,$x,$titre); $worksheet->write($line,$x+1,$auteur); $worksheet->write($line,$x+2,$data['aff_pret_debut']); } $worksheet->download('empr.xls'); die(); } } else { if (!$dest){ print $msg['empr_no_loan_old']; } }