id_empr."' group by rien "; $lib_all_groupes=pmb_sql_value($requete); if ($lib_all_groupes) $lib_all_groupes="\n".$lib_all_groupes; if ($empr->empr_prenom) $empr->empr_nom=$empr->empr_prenom." ".$empr->empr_nom; $res_final[]=$empr->empr_nom; if ($empr->empr_adr2 != "") $empr->empr_adr1 = $empr->empr_adr1."\n" ; if (($empr->empr_cp != "") || ($empr->empr_ville != "")) $empr->empr_adr2 = $empr->empr_adr2."\n" ; $adr = $empr->empr_adr1.$empr->empr_adr2.$empr->empr_cp." ".$empr->empr_ville ; if ($empr->empr_pays != "") $adr = $adr."\n".$empr->empr_pays ; $res_final[]=$adr; if ($empr->empr_tel1 != "") { $tel = $tel.$msg['fpdf_tel1']." ".$empr->empr_tel1." " ; } if ($empr->empr_tel2 != "") { $tel = $tel.$msg['fpdf_tel2']." ".$empr->empr_tel2; } if ($empr->empr_mail != "") { if ($tel) $tel = $tel."\n" ; $mail = $msg['fpdf_email']." ".$empr->empr_mail; } $res_final[]="\n".$tel.$mail.$lib_all_groupes; $res_final[]=""; $res_final[]=$msg['fpdf_carte']." ".$empr->empr_cb; $res_final[]=$msg['fpdf_adherent']." ".$empr->aff_empr_date_adhesion." ".$msg['fpdf_adherent_au']." ".$empr->aff_empr_date_expiration ; return implode("\n",$res_final); } /* fin m_lecteur_info */ // ********************* Imprime l'adresse d'un lecteur ********************************** function m_lecteur_adresse($empr) { global $msg; $res_final=array(); if ($empr->empr_prenom) $empr->empr_nom=$empr->empr_prenom." ".$empr->empr_nom; $res_final[]=$empr->empr_nom; if ($empr->empr_adr2 != "") $empr->empr_adr1 = $empr->empr_adr1."\n" ; if (($empr->empr_cp != "") || ($empr->empr_ville != "")) $empr->empr_adr2 = $empr->empr_adr2."\n" ; $adr = $empr->empr_adr1.$empr->empr_adr2.$empr->empr_cp." ".$empr->empr_ville ; if ($empr->empr_pays != "") $adr = $adr."\n".$empr->empr_pays ; $res_final[]=$adr; if ($empr->empr_tel1 != "") { $tel = $tel.$msg['fpdf_tel1']." ".$empr->empr_tel1." " ; } if ($empr->empr_tel2 != "") { $tel = $tel.$msg['fpdf_tel2']." ".$empr->empr_tel2; } if ($empr->empr_mail != "") { if ($tel) $tel = $tel."\n" ; $mail = $msg['fpdf_email']." ".$empr->empr_mail; } $res_final[]="\n".$tel.$mail; return implode("\n",$res_final); } /* fin m_lecteur_adresse */ // Liste des prêts en cours function m_liste_prets($destinataire) { global $dbh, $msg; $res_final=array(); // $rqt = "select expl_cb from pret, exemplaires where pret_idempr='".$destinataire->id_empr."' and pret_idexpl=expl_id order by pret_date " ; $requete = "SELECT notices_m.notice_id as m_id, notices_s.notice_id as s_id, expl_cb, expl_cote, pret_date, pret_retour, tdoc_libelle, section_libelle, location_libelle, trim(concat(ifnull(notices_m.tit1,''),ifnull(notices_s.tit1,''),' ',ifnull(bulletin_numero,''), if (mention_date, concat(' (',mention_date,')') ,''))) as tit, "; $requete.= " date_format(pret_date, '".$msg["format_date"]."') as aff_pret_date, "; $requete.= " date_format(pret_retour, '".$msg["format_date"]."') as aff_pret_retour, "; $requete.= " IF(pret_retour>sysdate(),0,1) as retard, notices_m.tparent_id, notices_m.tnvol " ; $requete.= " FROM (((exemplaires LEFT JOIN notices AS notices_m ON expl_notice = notices_m.notice_id ) LEFT JOIN bulletins ON expl_bulletin = bulletins.bulletin_id) LEFT JOIN notices AS notices_s ON bulletin_notice = notices_s.notice_id), docs_type, docs_section, docs_location, pret "; $requete.= " WHERE pret_idempr='".$destinataire->id_empr."' and expl_typdoc = idtyp_doc and expl_section = idsection and expl_location = idlocation and pret_idexpl = expl_id "; $req = mysql_query($requete) or die($msg['err_sql'].'
'.$requete.'
'.mysql_error()); while ($expl = mysql_fetch_object($req)) { $responsabilites = get_notice_authors(($expl->m_id+$expl->s_id)) ; $as = array_search ("0", $responsabilites["responsabilites"]) ; if ($as!== FALSE && $as!== NULL) { $auteur_0 = $responsabilites["auteurs"][$as] ; $auteur = new auteur($auteur_0["id"]); $header_aut .= $auteur->isbd_entry; } else { $aut1_libelle=array(); $as = array_keys ($responsabilites["responsabilites"], "1" ) ; for ($i = 0 ; $i < count($as) ; $i++) { $indice = $as[$i] ; $auteur_1 = $responsabilites["auteurs"][$indice] ; $auteur = new auteur($auteur_1["id"]); $aut1_libelle[]= $auteur->isbd_entry; } $header_aut .= implode (", ",$aut1_libelle) ; } $header_aut ? $auteur=" / ".$header_aut : $auteur=""; // récupération du titre de série if ($expl->tparent_id && $expl->m_id) { $parent = new serie($expl->tparent_id); $tit_serie = $parent->name; if($expl->tnvol) $tit_serie .= ', '.$expl->tnvol; } if($tit_serie) $expl->tit = $tit_serie.'. '.$expl->tit; $res_final[]="".$expl->tit." (".$expl->tdoc_libelle.")"; $res_final[]="
".$msg['fpdf_date_pret']." ".$expl->aff_pret_date."  ".$msg['fpdf_retour_prevu']." ".$expl->aff_pret_retour; $res_final[]=$expl->location_libelle.": ".$expl->section_libelle.": ".$expl->expl_cote." (".$expl->expl_cb.")
"; } return implode("\n",$res_final); } // Liste des réservations en cours function m_liste_resas($destinataire) { global $dbh, $msg; $rqt = "select resa_idnotice, resa_idbulletin from resa where resa_idempr='".$destinataire->id_empr."' " ; $req = mysql_query($rqt) or die($msg['err_sql'].'
'.$rqt.'
'.mysql_error()); $all_resa=""; while ($data = mysql_fetch_array($req)) { $all_resa.=m_not_bull_info_resa ($destinataire->id_empr, $data['resa_idnotice'],$data['resa_idbulletin']); } return $all_resa ; } // fin if résas function m_not_bull_info_resa ($id_empr, $notice, $bulletin) { global $msg; $res_final=array(); $dates_resa_sql = "date_format(resa_date, '".$msg["format_date"]."') as date_pose_resa, IF(resa_date_fin>sysdate() or resa_date_fin='0000-00-00',0,1) as perimee, if(resa_date_debut='0000-00-00', '', date_format(resa_date_debut, '".$msg["format_date"]."')) as aff_resa_date_debut, if(resa_date_fin='0000-00-00', '', date_format(resa_date_fin, '".$msg["format_date"]."')) as aff_resa_date_fin " ; if ($notice) { $requete = "SELECT notice_id, resa_date, resa_idempr, tit1 as tit, ".$dates_resa_sql; $requete.= "FROM notices, resa "; $requete.= "WHERE notice_id='".$notice."' and resa_idnotice=notice_id order by resa_date "; } else { $requete = "SELECT notice_id, resa_date, resa_idempr, trim(concat(tit1,' ',ifnull(bulletin_numero,''), if (mention_date, concat(' (',mention_date,')') ,''))) as tit, ".$dates_resa_sql; $requete.= "FROM bulletins, resa, notices "; $requete.= "WHERE resa_idbulletin='$bulletin' and resa_idbulletin = bulletins.bulletin_id and bulletin_notice = notice_id order by resa_date "; } $res = mysql_query($requete) or die ("
".mysql_error()); $nb_resa = mysql_num_rows($res) ; for ($j=0 ; $j<$nb_resa ; $j++ ) { $resa = mysql_fetch_object($res); if ($resa->resa_idempr == $id_empr) { $responsabilites = get_notice_authors($resa->notice_id) ; $as = array_search ("0", $responsabilites["responsabilites"]) ; if ($as!== FALSE && $as!== NULL) { $auteur_0 = $responsabilites["auteurs"][$as] ; $auteur = new auteur($auteur_0["id"]); $header_aut .= $auteur->isbd_entry; } else { $aut1_libelle=array(); $as = array_keys ($responsabilites["responsabilites"], "1" ) ; for ($i = 0 ; $i < count($as) ; $i++) { $indice = $as[$i] ; $auteur_1 = $responsabilites["auteurs"][$indice] ; $auteur = new auteur($auteur_1["id"]); $aut1_libelle[]= $auteur->isbd_entry; } $header_aut .= implode (", ",$aut1_libelle) ; } $header_aut ? $auteur=" / ".$header_aut : $auteur=""; if ($resa->aff_resa_date_debut) $tmpmsg_res = $msg['fpdf_reserve_du']." ".$resa->aff_resa_date_debut." ".$msg['fpdf_adherent_au']." ".$resa->aff_resa_date_fin; else $tmpmsg_res = $msg['fpdf_attente_valid']; $res_final[]="".$resa->tit.$auteur.""; $res_final[]="
".$tmpmsg_res; $date_resa = " ".$msg['fpdf_reserv_enreg']." ".$resa->date_pose_resa."." ; $res_final[]=$msg['fpdf_rang']." ".($j+1).$date_resa."
"; } } // fin for return implode("\n",$res_final); } /* fin not_bull_info_resa */