function m_lecteur_info($empr) { global $msg; $res_final = array(); $requete = "SELECT group_concat(libelle_groupe SEPARATOR ', ') as_all_groupes, 1 as rien from groupe join empr_groupe on groupe_id=id_groupe WHERE lettre_rappel_show_nomgroup=1 and empr_id='" . $empr->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); }
function aff_curdate($param) { global $msg; return pmb_sql_value("SELECT CURDATE()"); }
if ($pb) { echo "<b>" . $msg[admin_info_table_index_pb] . "</b><br />" . $pb; } else { echo $msg[admin_info_table_index_ok]; } break; case 'mysqlinfo': echo window_title($database_window_title . "MySQL - Info"); echo "<div class='row'><div class='row'><label class='etiquette'>" . $msg[sql_info_notices] . "</label></div>\n\t\t\t <div class='row'>" . pmb_sql_value("select count(*) as nb from notices") . "</div>"; echo "<div class='row'><label class='etiquette'>" . $msg[sql_info_exemplaires] . "</label></div>\n\t\t\t <div class='row'>" . pmb_sql_value("select count(*) as nb from exemplaires") . "</div>"; echo "<div class='row'><label class='etiquette'>" . $msg[sql_info_bulletins] . "</label></div>\n\t\t\t <div class='row'>" . pmb_sql_value("select count(*) as nb from bulletins") . "</div>"; echo "<div class='row'><label class='etiquette'>" . $msg[sql_info_authors] . "</label></div>\n\t\t\t <div class='row'>" . pmb_sql_value("select count(*) as nb from authors") . "</div>"; echo "<div class='row'><label class='etiquette'>" . $msg[sql_info_publishers] . "</label></div>\n\t\t\t <div class='row'>" . pmb_sql_value("select count(*) as nb from publishers") . "</div>"; echo "<div class='row'><label class='etiquette'>" . $msg[sql_info_empr] . "</label></div>\n\t\t\t <div class='row'>" . pmb_sql_value("select count(*) as nb from empr") . "</div>"; echo "<div class='row'><label class='etiquette'>" . $msg[sql_info_pret] . "</label></div>\n\t\t\t <div class='row'>" . pmb_sql_value("select count(*) as nb from pret") . "</div>"; echo "<div class='row'><label class='etiquette'>" . $msg[sql_info_pret_archive] . "</label></div>\n\t\t\t <div class='row'>" . pmb_sql_value("select count(*) as nb from pret_archive") . "</div>"; echo "<hr />"; echo "<div class='row'>\n\t\t\t\t<label class='etiquette' >MySQL Database name, host and user</label>\n\t\t\t\t</div>\n\t\t\t <div class='row'>\n\t\t\t\t\t" . DATA_BASE . " on " . SQL_SERVER . ", user="******"\n\t\t\t\t\t</div>\n\t\t\t <div class='row'>\n\t\t\t\t<label class='etiquette' >MySQL Server Information</label>\n\t\t\t\t</div>\n\t\t\t <div class='row'>\n\t\t\t\t\t" . mysql_get_server_info() . "\n\t\t\t\t\t</div><hr />"; echo "<div class='row'>\n\t\t\t\t<label class='etiquette' >MySQL Client Information</label>\n\t\t\t\t</div>\n\t\t\t <div class='row'>\n\t\t\t\t\t" . mysql_get_client_info() . "\n\t\t\t\t\t</div><hr />"; echo "<div class='row'>\n\t\t\t\t<label class='etiquette' >MySQL Host Information</label>\n\t\t\t\t</div>\n\t\t\t <div class='row'>\n\t\t\t\t\t" . mysql_get_host_info() . "\n\t\t\t\t\t</div><hr />"; echo "<div class='row'>\n\t\t\t\t<label class='etiquette' >MySQL Protocol Information</label>\n\t\t\t\t</div>\n\t\t\t <div class='row'>\n\t\t\t\t\t" . mysql_get_proto_info() . "\n\t\t\t\t\t</div><hr />"; echo "<div class='row'>\n\t\t\t\t<label class='etiquette' >MySQL Stat. Information</label>\n\t\t\t\t</div>\n\t\t\t <div class='row'>\n\t\t\t\t\t" . str_replace(' ', '<br />', mysql_stat()) . "</div><hr />"; echo "<div class='row'>\n\t\t\t\t<label class='etiquette' >MySQL Variables</label>\n\t\t\t\t</div>\n\t\t\t <div class='row'><table>"; $result = mysql_query('SHOW VARIABLES', $dbh); $parity = 0; while ($row = mysql_fetch_assoc($result)) { if ($parity % 2) { $pair_impair = "even"; } else { $pair_impair = "odd"; }
//on affiche l'écran de validation de suppression echo "<h1>" . $msg[transferts_circ_menu_titre] . " > " . $msg[transferts_circ_menu_refuse] . "</h1>"; echo affiche_liste_valide($transferts_refus_liste_valide, $transferts_refus_liste_valide_ligne, "SELECT num_notice, num_bulletin, " . "expl_cb as val_ex, lender_libelle, location_libelle as val_source, " . "transferts_demande.date_creation as val_date_creation, date_visualisee as val_date_refus," . "motif_refus as val_refusMotif, empr_cb as val_empr " . "FROM transferts " . "INNER JOIN transferts_demande ON id_transfert=num_transfert " . "INNER JOIN exemplaires ON num_expl=expl_id " . "INNER JOIN lenders ON idlender=expl_owner " . "INNER JOIN docs_location ON num_location_source=idlocation " . "LEFT JOIN resa ON resa_trans=id_resa " . "LEFT JOIN empr ON resa_idempr=id_empr " . "WHERE " . "id_transfert IN (!!liste_numeros!!) " . "AND etat_demande=4", "circ.php?categ=trans&sub=" . $sub); break; case "supp": //on supprime les transferts sélectionner $obj_transfert->cloture_transferts($liste_transfert); $action = ""; break; case "aff_redem": $transferts_refus_redemande_global = "\n\t\t<br />\n\t\t<form name='form_circ_trans_redemande' class='form-circ' method='post' action='!!action_formulaire!!&action=redem'>\n\t\t<h3>" . $msg["transferts_circ_refus_relance"] . "</h3>\n\t\t<div class='form-contenu' >\n\t\t\t!!detail_notice!!\n\t\t\t<div class='row'> </div>\t\t\n\t\t\t<div class='row'>\n\t\t\t\t!!liste_sites!!\n\t\t\t</div>\n\t\t\t<div class='row'> </div>\t\t\n\t\t\t<div class='row'>\t\t\n\t\t\t\t<label class='etiquette'>" . $msg["transferts_circ_refus_relance_motif"] . "</label><br />\n\t\t\t\t<textarea name='motif' cols=40 rows=5></textarea>\n\t\t\t</div>\n\t\t\t<div class='row'> </div>\t\t\n\t\t\t<div class='row'>\t\t\n\t\t\t\t<label class='etiquette'>" . $msg["transferts_circ_refus_relance_retour"] . "</label>\n\t\t\t\t<input type='button' class='bouton' name='bt_date_retour' value='!!date_retour!!' onClick=\"var reg=new RegExp('(-)', 'g'); openPopUp('" . $base_path . "/select.php?what=calendrier&caller=form_circ_trans_redemande&date_caller='+form_circ_trans_redemande.date_retour.value.replace(reg,'')+'¶m1=date_retour¶m2=bt_date_retour&auto_submit=NO&date_anterieure=YES', 'date_adhesion', 250, 320, -2, -2, 'toolbar=no, dependent=yes, resizable=yes')\">\n\t\t\t\t<input type='hidden' name='date_retour' value='!!date_retour_mysql!!'>\n\t\t\t</div>\n\t\t</div>\n\t\t<input type='submit' class='bouton' name='" . $msg["89"] . "' value='" . $msg["89"] . "'>\n\t\t \n\t\t<input type='button' class='bouton' name='" . $msg["76"] . "' value='" . $msg["76"] . "' onclick='document.location=\"!!action_formulaire!!\"'>\n\t\t<input type='hidden' name='transid' value='!!trans_id!!'>\n\t\t</form>\n\t\t"; //affiche l'ecran pour proposer de relancer une nouvelle demande de transfert echo "<h1>" . $msg[transferts_circ_menu_titre] . " > " . $msg[transferts_circ_menu_refuse] . "</h1>"; //on recupere les id de l'exemplaire $idNotice = pmb_sql_value("SELECT num_notice FROM transferts WHERE id_transfert=" . $transid); $idBulletin = pmb_sql_value("SELECT num_bulletin FROM transferts WHERE id_transfert=" . $transid); /* //on genere la liste des sites ou un exemplaire est disponible $rqt = "SELECT DISTINCT expl_location,location_libelle " . "FROM exemplaires " . "INNER JOIN docs_location ON expl_location=idlocation " . "WHERE " . "expl_notice=".$idNotice." ". "AND expl_bulletin=".$idBulletin." ". "ORDER BY ". "transfert_ordre"; $res = pmb_mysql_query($rqt); $tmpOpt = ""; while ($value = pmb_mysql_fetch_array($res)) { $tmpOpt .= "<option value='" . $value[0] . "'>" . $value[1] . "</option>"; }
function gen_date() { global $dbh; global $msg; global $include_path; if ($this->modele_id) { $dummy = "delete FROM abts_grille_modele WHERE num_modele='{$this->modele_id}' "; pmb_mysql_query($dummy, $dbh); $date = construitdateheuremysql($this->date_debut); $date_fin = construitdateheuremysql($this->date_fin); //Lire la périodicté $duree = 1; $requete = "select duree,unite from abts_periodicites where periodicite_id='{$this->num_periodicite}'"; $resultat = pmb_mysql_query($requete); if ($r = pmb_mysql_fetch_object($resultat)) { $duree = $r->duree; $unite = $r->unite; do { $dayofweek = pmb_sql_value("SELECT DAYOFWEEK('{$date}')"); //1 = Dimanche, 2 = Lundi, ... 7 = Samedi if ($dayofweek == 1) { $dayofweek = 8; } $dayofweek--; $day = pmb_sql_value("SELECT DAYOFMONTH('{$date}')"); // 1 à 31 $month = pmb_sql_value("SELECT MONTH('{$date}')"); //1 à 12 $week = pmb_sql_value("SELECT WEEK('{$date}',5)") + 1; //0 ... 53 //calcul numero de semaine dans le mois $weekofmonth = ($day + 7 - $dayofweek) / 7 + 1; //Mois dans l'année exclu if ($this->month_year[$month - 1]) { if ($this->week_year[$week - 1]) { if ($this->week_month[$weekofmonth - 1]) { if ($this->day_month[$day - 1]) { if ($this->days[$dayofweek - 1]) { //c'est un jour prévu de réception $requete = "INSERT INTO abts_grille_modele SET num_modele='{$this->modele_id}', date_parution ='{$date}', type_serie = '1'"; pmb_mysql_query($requete, $dbh); } } } } } // Calcul de la date suivante à analyser et la sortie du while if ($unite == 0) { $sql_add = "INTERVAL {$duree} DAY"; } if ($unite == 1) { $sql_add = "INTERVAL {$duree} MONTH"; } if ($unite == 2) { $sql_add = "INTERVAL {$duree} YEAR"; } $date = pmb_sql_value("SELECT DATE_ADD('{$date}', {$sql_add})"); $diff = pmb_sql_value("SELECT DATEDIFF('{$date_fin}','{$date}')"); } while ($diff >= 0 && $duree != 0); } } }
function proceed() { global $act; global $serial_id, $msg, $num_notice, $num_periodicite, $duree_abonnement, $date_debut, $date_fin, $days, $day_month, $week_month, $week_year, $month_year, $date_parution; global $abt_name, $duree_abonnement, $date_debut, $date_fin, $id_fou, $destinataire; global $dbh, $abt_id; global $cote, $typdoc_id, $exemp_auto, $location_id, $lender_id, $statut_id, $codestat_id, $type_antivol, $abt_numeric; global $deflt_docs_section; global $deflt_docs_location, $nb_duplication; $formlocid = "f_ex_section" . $location_id; global ${$formlocid}; $section_id = ${$formlocid}; if (!$section_id) { $section_id = $deflt_docs_section; } if (!$location_id) { $location_id = $deflt_docs_location; } switch ($act) { case 'update': // mise à jour modèle $this->abt_name = stripslashes($abt_name); $this->num_notice = $num_notice; $this->duree_abonnement = $duree_abonnement; $this->date_debut = $date_debut; $this->date_fin = $date_fin; $this->fournisseur = $id_fou; $this->destinataire = stripslashes($destinataire); $this->cote = stripslashes($cote); $this->typdoc_id = $typdoc_id; $this->exemp_auto = $exemp_auto; $this->location_id = $location_id; $this->section_id = $section_id; $this->lender_id = $lender_id; $this->statut_id = $statut_id; $this->codestat_id = $codestat_id; $this->type_antivol = $type_antivol; $this->abt_numeric = $abt_numeric; $this->update(); print $this->show_form(); break; case 'gen': // mise à jour modèle $this->abt_name = stripslashes($abt_name); $this->num_notice = $num_notice; $this->duree_abonnement = $duree_abonnement; $this->date_debut = $date_debut; $this->date_fin = $date_fin; $this->fournisseur = $id_fou; $this->destinataire = stripslashes($destinataire); $this->cote = stripslashes($cote); $this->typdoc_id = $typdoc_id; $this->exemp_auto = $exemp_auto; $this->location_id = $location_id; $this->section_id = $section_id; $this->lender_id = $lender_id; $this->statut_id = $statut_id; $this->codestat_id = $codestat_id; $this->type_antivol = $type_antivol; $this->abt_numeric = $abt_numeric; $this->update(); print $this->show_form(); break; case 'prolonge': // mise à jour modèle $this->abt_name = stripslashes($abt_name); $this->num_notice = $num_notice; $this->duree_abonnement = $duree_abonnement; $this->date_debut = $date_fin; $this->date_fin = pmb_sql_value("SELECT DATE_ADD('{$date_fin}',INTERVAL {$duree_abonnement} month)"); $this->fournisseur = $id_fou; $this->destinataire = stripslashes($destinataire); $this->cote = stripslashes($cote); $this->typdoc_id = $typdoc_id; $this->exemp_auto = $exemp_auto; $this->location_id = $location_id; $this->section_id = $section_id; $this->lender_id = $lender_id; $this->statut_id = $statut_id; $this->codestat_id = $codestat_id; $this->type_antivol = $type_antivol; $this->abt_numeric = $abt_numeric; $this->gen_date(1); $this->date_debut = $date_debut; $this->update(); print $this->show_form(); break; case 'copy': $this->getData(); $abt_id = $this->abt_id; $this->abt_name .= "_1"; $this->abt_name = addslashes($this->abt_name); $this->destinataire = addslashes($this->destinataire); for ($i = 0; $i < $nb_duplication; $i++) { //Création nouvel abonnement $this->abt_id = ''; do { $this->abt_name++; $requete = "SELECT abt_name FROM abts_abts WHERE abt_name='{$this->abt_name}' and num_notice='{$this->num_notice}'"; $resultat = mysql_query($requete, $dbh); } while (mysql_fetch_object($resultat)); $this->update(); //recopie des modeles associés $requete = "select * from abts_abts_modeles where abt_id='{$abt_id}'"; $resultat = mysql_query($requete); while ($r_m = mysql_fetch_object($resultat)) { $requete = "INSERT INTO abts_abts_modeles SET modele_id='{$r_m->modele_id}', abt_id='{$this->abt_id}',num='{$r_m->num}' ,vol='{$r_m->vol}',tome='{$r_m->tome}',delais='{$r_m->delais}', critique='{$r_m->critique}',num_statut_general='{$r_m->num_statut_general}'"; mysql_query($requete, $dbh); } //recopie des infos du calendrier $requete = "select * from abts_grille_abt where num_abt='{$abt_id}'"; $resultat = mysql_query($requete); while ($r_g = mysql_fetch_object($resultat)) { $requete = "INSERT INTO abts_grille_abt SET num_abt='{$this->abt_id}', \n\t\t\t\t\t\t\tdate_parution ='{$r_g->date_parution}', \n\t\t\t\t\t\t\tmodele_id='{$r_g->modele_id}', \n\t\t\t\t\t\t\ttype = '{$r_g->type}',\n\t\t\t\t\t\t\tnumero='{$r_g->numero}', \n\t\t\t\t\t\t\tnombre='{$r_g->nombre}', \n\t\t\t\t\t\t\tordre='{$r_g->ordre}' "; mysql_query($requete, $dbh); } } print "<div class='row'><div class='msg-perio'>" . $msg[maj_encours] . "</div></div>"; $id_form = md5(microtime()); $retour = "./catalog.php?categ=serials&sub=view&serial_id={$serial_id}&view=abon"; print "<form class='form-{$current_module}' name=\"dummy\" method=\"post\" action=\"{$retour}\" style=\"display:none\">\n\t\t\t\t\t<input type=\"hidden\" name=\"id_form\" value=\"{$id_form}\">\n\t\t\t\t\t</form>\n\t\t\t\t\t<script type=\"text/javascript\">document.dummy.submit();</script>\n\t\t\t\t\t</div>"; break; case 'raz': if ($this->abt_id) { $dummy = "delete FROM abts_grille_abt WHERE num_abt='" . $this->abt_id . "'"; mysql_query($dummy, $dbh); } print $this->show_form(); break; case 'del': if ($msg_error = $this->delete()) { $retour = "./circ.php?categ=serialcirc"; error_message('', $msg_error, 1, $retour); } else { print "<div class='row'><div class='msg-perio'>" . $msg[maj_encours] . "</div></div>"; $id_form = md5(microtime()); $retour = "./catalog.php?categ=serials&sub=view&serial_id={$serial_id}&view=abon"; print "<form class='form-{$current_module}' name=\"dummy\" method=\"post\" action=\"{$retour}\" style=\"display:none\">\n\t\t\t\t\t\t<input type=\"hidden\" name=\"id_form\" value=\"{$id_form}\">\n\t\t\t\t\t\t</form>\n\t\t\t\t\t\t<script type=\"text/javascript\">document.dummy.submit();</script>\n\t\t\t\t\t\t</div>"; } break; default: print $this->show_form(); break; } }
static function get_dashboard_info($location_view = "") { global $msg; global $dbh; global $deflt_bulletinage_location; $cpt_a_recevoir = $cpt_en_retard = $cpt_en_alerte = $prochain_numero = 0; $requete = "\r\n\t\tselect * from (\r\n\t\t\tSELECT id_bull,num_abt,abts_grille_abt.date_parution,modele_id,type,numero,nombre,ordre,state\r\n\t\t\tFROM abts_grille_abt ,abts_abts\r\n\t\t\tWHERE abts_grille_abt.date_parution <= CURDATE() and abt_id=num_abt and state=0"; if ($location_view) { $requete .= " and location_id='{$location_view}'"; } $requete .= " \r\n\t\t\tunion\r\n\t\t\tselect id_bull,num_abt,prochain.date_parution,modele_id,type,numero,nombre,ordre,state\r\n\t\t\tfrom (\r\n\t\t\t\tSELECT id_bull,num_abt,abts_grille_abt.date_parution,modele_id,type,numero,nombre,ordre,state\r\n\t\t\t\tFROM abts_grille_abt ,abts_abts\r\n\t\t\t\tWHERE abts_grille_abt.date_parution > CURDATE() and abt_id=num_abt and state=0"; if ($location_view) { $requete .= " and location_id='{$location_view}'"; } $requete .= " \n\t\t\t\tORDER BY abts_grille_abt.date_parution\r\n\t\t\t) as prochain group by type,ordre,num_abt,modele_id\n\t\t) as liste_bull order by date_parution\r\n\t\t"; $resultat = pmb_mysql_query($requete, $dbh); if ($resultat) { while ($r = pmb_mysql_fetch_object($resultat)) { // recheche des délais de retart if (!$numero_modele[$r->modele_id][$r->num_abt]) { $requete = "SELECT delais,\tcritique FROM abts_abts_modeles WHERE modele_id={$r->modele_id} and abt_id={$r->num_abt}"; $resultat_n = pmb_mysql_query($requete, $dbh); if ($r_abt = pmb_mysql_fetch_object($resultat_n)) { $numero_modele[$r->modele_id][$r->num_abt]['delais'] = $r_abt->delais; $numero_modele[$r->modele_id][$r->num_abt]['critique'] = $r_abt->critique; } } if ($numero_modele[$r->modele_id][$r->num_abt]) { $diff = pmb_sql_value("SELECT DATEDIFF(CURDATE(),'{$r->date_parution}')"); if ($diff < 0) { $prochain_numero++; } elseif ($diff <= $numero_modele[$r->modele_id][$r->num_abt]["delais"]) { $cpt_a_recevoir++; } elseif ($diff <= $numero_modele[$r->modele_id][$r->num_abt]["critique"]) { $cpt_en_retard++; } else { $cpt_en_alerte++; } } } } return array('a_recevoir' => $cpt_a_recevoir, 'en_retard' => $cpt_en_retard, 'en_alerte' => $cpt_en_alerte, 'prochain_numero' => $prochain_numero); }
function lecteur_info($id_empr) { global $msg, $dbh, $charset, $niveau, $forcename; $requete = "SELECT group_concat(libelle_groupe SEPARATOR ', ') as_all_groupes, 1 as rien from groupe join empr_groupe on groupe_id=id_groupe WHERE lettre_rappel_show_nomgroup=1 and empr_id='{$id_empr}' group by rien "; $lib_all_groupes = pmb_sql_value($requete); if ($lib_all_groupes) { $lib_all_groupes = "\t\t<lib_all_groupes>" . htmlspecialchars($lib_all_groupes, ENT_QUOTES, $charset) . "</lib_all_groupes>\n"; } $concerne = ""; $temp_id_empr = $id_empr; if (!$forcename) { //Recherche du groupe d'appartenance $requete = "select id_groupe,resp_groupe from groupe,empr_groupe where id_groupe=groupe_id and empr_id={$id_empr} and resp_groupe and lettre_rappel limit 1"; $res = mysql_query($requete); if (mysql_num_rows($res)) { $temp_id_empr = mysql_result($res, 0, 1); } else { $temp_id_empr = $id_empr; } //Si le responsable n'est pas l'emprunteur, on précise qui est relancé if ($temp_id_empr != $id_empr) { $requete = "select concat(empr_prenom,' ',empr_nom) from empr where id_empr={$id_empr}"; //Idée de Quentin $res = mysql_query($requete); $concerne = "\t\t<concerne>" . htmlspecialchars(sprintf($msg["adresse_retard_concerne"], mysql_result($res, 0, 0)), ENT_QUOTES, $charset) . "</concerne>\n"; } } $requete = "SELECT id_empr, empr_cb, empr_nom, empr_prenom, empr_adr1, empr_adr2, empr_cp, empr_ville, empr_pays, empr_mail, empr_tel1, empr_tel2, empr_date_adhesion, empr_date_expiration, date_format(empr_date_adhesion, '" . $msg["format_date"] . "') as aff_empr_date_adhesion, date_format(empr_date_expiration, '" . $msg["format_date"] . "') as aff_empr_date_expiration FROM empr WHERE id_empr='{$temp_id_empr}' "; $res = mysql_query($requete, $dbh); $empr = mysql_fetch_object($res); $this->lecteur_info = "\t<patron>\n"; $this->lecteur_info .= "\t\t<id>" . htmlspecialchars($id_empr, ENT_QUOTES, $charset) . "</id>\n"; $this->lecteur_info .= "\t\t<name>" . htmlspecialchars($empr->empr_prenom, ENT_QUOTES, $charset) . "</name>\n"; $this->lecteur_info .= "\t\t<surname>" . htmlspecialchars($empr->empr_nom, ENT_QUOTES, $charset) . "</surname>\n"; if ($empr->empr_adr1 != "") { $this->lecteur_info .= "\t\t<adr1>" . htmlspecialchars($empr->empr_adr1, ENT_QUOTES, $charset) . "</adr1>\n"; } if ($empr->empr_adr2 != "") { $this->lecteur_info .= "\t\t<adr2>" . htmlspecialchars($empr->empr_adr2, ENT_QUOTES, $charset) . "</adr2>\n"; } if ($empr->empr_cp != "") { $this->lecteur_info .= "\t\t<cp>" . htmlspecialchars($empr->empr_cp, ENT_QUOTES, $charset) . "</cp>\n"; } if ($empr->empr_ville != "") { $this->lecteur_info .= "\t\t<town>" . htmlspecialchars($empr->empr_ville, ENT_QUOTES, $charset) . "</town>\n"; } if ($empr->empr_pays != "") { $this->lecteur_info .= "\t\t<country>" . htmlspecialchars($empr->empr_pays, ENT_QUOTES, $charset) . "</country>\n"; } if ($empr->empr_tel1 != "") { $this->lecteur_info .= "\t\t<phone1>" . htmlspecialchars($msg['fpdf_tel1'] . " " . $empr->empr_tel1, ENT_QUOTES, $charset) . "</phone1>\n"; } if ($empr->empr_tel2 != "") { $this->lecteur_info .= "\t\t<phone2>" . htmlspecialchars($msg['fpdf_tel2'] . " " . $empr->empr_tel2, ENT_QUOTES, $charset) . "</phone2>\n"; } if ($empr->empr_mail != "") { $this->lecteur_info .= "\t\t<mail>" . htmlspecialchars($empr->empr_mail, ENT_QUOTES, $charset) . "</mail>\n"; } if ($empr->empr_cb) { $this->lecteur_info .= "\t\t<cb>" . htmlspecialchars($msg['fpdf_carte'] . " " . $empr->empr_cb, ENT_QUOTES, $charset) . "</cb>\n"; } if ($empr->aff_empr_date_adhesion) { $this->lecteur_info .= "\t\t<subscripion_date>" . htmlspecialchars($empr->aff_empr_date_adhesion, ENT_QUOTES, $charset) . "</subscripion_date>\n"; } if ($empr->aff_empr_date_expiration) { $this->lecteur_info .= "\t\t<deadline>" . htmlspecialchars($empr->aff_empr_date_expiration, ENT_QUOTES, $charset) . "</deadline>\n"; } $this->lecteur_info .= $lib_all_groupes; $this->lecteur_info .= $concerne; $this->lecteur_info .= "\t\t<empr_niveau>" . $niveau . "</empr_niveau>"; $this->lecteur_info .= "\t</patron>\n"; }
function lecteur_adresse($id_empr, $x, $y, $link, $no_cb = false, $show_nomgroupe = false, $use_param_bloc_adresse = false) { global $ourPDF; global $msg; global $pmb_pdf_font; //Vérifions si l'on demande un positionnement absolu if ($use_param_bloc_adresse) { global $pmb_lettres_bloc_adresse_position_absolue; $absolue_config = explode(" ", $pmb_lettres_bloc_adresse_position_absolue); if (count($absolue_config) == 3 && $absolue_config[0] != 0) { $x = $absolue_config[1] + 0; $y = $absolue_config[2] + 0; } global $pmb_lettres_code_mail_position_absolue; $absolue_config_code = explode(" ", $pmb_lettres_code_mail_position_absolue); $x_code = 0; $y_code = 0; if (count($absolue_config_code) == 3 && $absolue_config_code[0] != 0) { $x_code = $absolue_config_code[1] + 0; $y_code = $absolue_config_code[2] + 0; } } $concerne = ""; $temp_id_empr = $id_empr; if ($show_nomgroupe) { //Recherche du groupe d'appartenance $requete = "select id_groupe,resp_groupe from groupe,empr_groupe where id_groupe=groupe_id and empr_id={$id_empr} and resp_groupe and lettre_rappel limit 1"; $res = mysql_query($requete); if (mysql_num_rows($res)) { $temp_id_empr = mysql_result($res, 0, 1); } else { $temp_id_empr = $id_empr; } //Si le responsable n'est pas l'emprunteur, on précise qui est relancé if ($temp_id_empr != $id_empr) { $requete = "select concat(empr_prenom,' ',empr_nom) from empr where id_empr={$id_empr}"; //Idée de Quentin $res = mysql_query($requete); $concerne = "\n" . sprintf($msg["adresse_retard_concerne"], mysql_result($res, 0, 0)) . "\n"; } } $requete = "SELECT id_empr, empr_cb, empr_nom, empr_prenom, empr_adr1, empr_adr2, empr_cp, empr_ville, empr_pays, empr_mail, empr_tel1, empr_tel2 FROM empr WHERE id_empr='{$temp_id_empr}' LIMIT 1 "; $res = mysql_query($requete, $link); $empr = mysql_fetch_object($res); $requete = "SELECT group_concat(libelle_groupe SEPARATOR ', ') as_all_groupes, 1 as rien from groupe join empr_groupe on groupe_id=id_groupe WHERE lettre_rappel_show_nomgroup=1 and empr_id='{$id_empr}' group by rien "; $lib_all_groupes = pmb_sql_value($requete); if ($lib_all_groupes) { $lib_all_groupes = "\n" . $lib_all_groupes; } $ourPDF->SetXY($x, $y); $adr = $empr->empr_prenom . " " . $empr->empr_nom . "\n"; $ourPDF->setFont($pmb_pdf_font, '', 12); 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 .= "\n" . $empr->empr_pays; } if ($empr->empr_tel1 != "") { $tel = "\n" . $msg['fpdf_tel1'] . " " . $empr->empr_tel1; } elseif ($empr->empr_tel2 != "") { $adr .= "\n"; $tel = $tel . $msg['fpdf_tel2'] . " " . $empr->empr_tel2; } else { $tel = ""; } if ($empr->empr_mail != "") { $tel = $tel . "\n"; $mail = $msg['fpdf_email'] . " " . $empr->empr_mail; } else { $mail = ""; } $ourPDF->SetDrawColor(255, 255, 255); $ourPDF->SetFillColor(255, 255, 255); $ourPDF->multiCell(100, 6, $adr, 0, 'L', true); if ($no_cb == false) { $ourPDF->SetXY($x_code ? $x_code : $x, $y_code ? $ourPDF->GetY() + $y_code : $ourPDF->GetY()); $ourPDF->setFont($pmb_pdf_font, 'I', 10); $ourPDF->multiCell(100, 6, $msg['fpdf_carte'] . " " . $empr->empr_cb . " " . $empr->empr_mail . $lib_all_groupes . $concerne, 0, 'L', true); } }