Exemplo n.º 1
0
 public function get_data_empr($id_empr)
 {
     global $dbh, $pmb_gestion_financiere, $pmb_gestion_abonnement, $pmb_gestion_tarif_prets, $pmb_gestion_amende;
     $empr = get_info_empr($id_empr);
     $i = count($this->data["empr_list"]);
     $this->data["empr_list"][$i]["name"] = $empr->nom;
     $this->data["empr_list"][$i]["fistname"] = $empr->prenom;
     $this->data["empr_list"][$i]["cb"] = $empr->cb;
     $this->data["empr_list"][$i]["aff_date_adhesion"] = $empr->aff_date_adhesion;
     $this->data["empr_list"][$i]["aff_date_expiration"] = $empr->aff_date_expiration;
     $this->data["empr_list"][$i]["categorie"] = $empr->cat_l;
     if ($pmb_gestion_financiere) {
         $this->data["empr_list"][$i]["compte_abonnement"]["solde"] = "";
         $this->data["empr_list"][$i]["compte_abonnement"]["novalid"] = "";
         // abonnement
         if ($pmb_gestion_abonnement) {
             $cpt_id = comptes::get_compte_id_from_empr($id_empr, 1);
             $cpt = new comptes($cpt_id);
             $solde = $cpt->update_solde();
             $novalid = $cpt->summarize_transactions("", "", 0, 0);
             $this->data["empr_list"][$i]["compte_abonnement"]["solde"] = $solde;
             $this->data["empr_list"][$i]["compte_abonnement"]["novalid"] = $novalid;
         }
         // prets
         $this->data["empr_list"][$i]["compte_pret"]["solde"] = "";
         $this->data["empr_list"][$i]["compte_pret"]["novalid"] = "";
         if ($pmb_gestion_tarif_prets) {
             $cpt_id = comptes::get_compte_id_from_empr($id_empr, 3);
             $cpt = new comptes($cpt_id);
             $solde = $cpt->update_solde();
             $novalid = $cpt->summarize_transactions("", "", 0, 0);
             $this->data["empr_list"][$i]["compte_pret"]["solde"] = $solde;
             $this->data["empr_list"][$i]["compte_pret"]["novalid"] = $novalid;
         }
         // amendes
         $this->data["empr_list"][$i]["compte_amende"]["solde"] = "";
         $this->data["empr_list"][$i]["compte_amende"]["novalid"] = "";
         if ($pmb_gestion_amende) {
             $cpt_id = comptes::get_compte_id_from_empr($id_empr, 2);
             $cpt = new comptes($cpt_id);
             $solde = $cpt->update_solde();
             $novalid = $cpt->summarize_transactions("", "", 0, 0);
             $this->data["empr_list"][$i]["compte_amende"]["solde"] = $solde;
             $this->data["empr_list"][$i]["compte_amende"]["novalid"] = $novalid;
         }
         // Autre compte
         $this->data["empr_list"][$i]["compte_autre"]["solde"] = "";
         $this->data["empr_list"][$i]["compte_autre"]["novalid"] = "";
         $transactype = new transactype_list();
         if ($transactype->get_count()) {
             $cpt_id = comptes::get_compte_id_from_empr($id_empr, 4);
             $cpte = new comptes($cpt_id);
             $solde = $cpt->update_solde();
             $novalid = $cpt->summarize_transactions("", "", 0, 0);
             $this->data["empr_list"][$i]["compte_autre"]["solde"] = $solde;
             $this->data["empr_list"][$i]["compte_autre"]["novalid"] = $novalid;
         }
     }
     return $this->data["empr_list"][$i];
 }
Exemplo n.º 2
0
function aff_pret_groupes()
{
    global $msg, $id_empr, $lvl, $dbh;
    global $opac_pret_prolongation, $opac_pret_duree_prolongation, $allow_prol;
    global $dest, $worksheet, $line;
    global $heading_blue, $heading_10, $heading_12;
    $req_groupes = "SELECT * from groupe where resp_groupe={$id_empr} order by libelle_groupe";
    $res = pmb_mysql_query($req_groupes);
    while ($r_goupe = pmb_mysql_fetch_object($res)) {
        if ($lvl == "late") {
            $titre_goup = sprintf($msg['empr_group_late'], $r_goupe->libelle_groupe);
            $class_aff_expl = "class='liste-expl-empr-late'";
            $critere_requete = " AND pret_retour < '" . date('Y-m-d') . "' ORDER BY location_libelle, empr_nom, empr_prenom, pret_retour";
        } else {
            $titre_goup = sprintf($msg['empr_group_loans'], $r_goupe->libelle_groupe);
            $class_aff_expl = "class='liste-expl-empr-all'";
            $critere_requete = " ORDER BY location_libelle, empr_nom, empr_prenom, pret_retour";
        }
        $sql = "SELECT notices_m.notice_id as num_notice_mono, bulletin_id, IF(pret_retour>sysdate(),0,1) as retard, expl_id, empr.id_empr as emprunteur, ";
        $sql .= "date_format(pret_retour, '" . $msg["format_date_sql"] . "') as aff_pret_retour, pret_retour, ";
        $sql .= "date_format(pret_date, '" . $msg["format_date_sql"] . "') as aff_pret_date, ";
        $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, tdoc_libelle, location_libelle ";
        $sql .= "FROM (((exemplaires LEFT JOIN notices AS notices_m ON expl_notice = notices_m.notice_id ) ";
        $sql .= "        LEFT JOIN bulletins ON expl_bulletin = bulletins.bulletin_id) ";
        $sql .= "        LEFT JOIN notices AS notices_s ON bulletin_notice = notices_s.notice_id), ";
        $sql .= "        docs_type, docs_location , pret, empr,empr_groupe  ";
        $sql .= "WHERE expl_typdoc = idtyp_doc and pret_idexpl = expl_id  and empr.id_empr = pret.pret_idempr and empr_groupe.empr_id = empr.id_empr and expl_location = idlocation and groupe_id=" . $r_goupe->id_groupe;
        $sql .= $critere_requete;
        $req = pmb_mysql_query($sql) or die("Erreur SQL !<br />" . $sql . "<br />" . pmb_mysql_error());
        $nb_elements = pmb_mysql_num_rows($req);
        if ($nb_elements) {
            if (!$dest) {
                echo "<br>";
                echo "<h3><span>" . $titre_goup . "</span></h3>";
                echo "<table {$class_aff_expl} width='100%'>";
                echo "<tr>";
                if ($lvl != "late") {
                    echo "<th><center>" . $msg["empr_late"] . "</center></th>";
                }
                echo " <th>" . $msg["extexpl_emprunteur"] . "</th>\n\t\t\t\t\t  <th>" . $msg["title"] . "</th>\t\t\t\t\t\n\t\t\t\t\t  <th>" . $msg["typdoc_support"] . "</th>\t\t\t\t\t \n\t\t\t\t\t  <th><center>" . $msg["date_loan"] . "</center></th>\n\t\t\t\t\t  <th><center>" . $msg["date_back"] . "</center></th>";
                echo "</tr>";
                $odd_even = 1;
                $loc_cours = "";
                while ($data = pmb_mysql_fetch_array($req)) {
                    if ($loc_cours != $data['location_libelle']) {
                        $loc_cours = $data['location_libelle'];
                        echo "<tr class='tb_pret_location_row'>\n\t\t\t\t\t\t\t\t<td colspan='" . ($lvl != "late" ? "6" : "5") . "'>" . $msg["expl_header_location_libelle"] . " : " . $loc_cours . "</td>\n\t\t\t\t\t\t\t</tr>";
                    }
                    $id_expl = $data['expl_cb'];
                    // 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['num_notice_mono']) {
                        $tr_javascript = " class='{$pair_impair}' onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" onmousedown=\"document.location='./index.php?lvl=notice_display&id=" . $data['num_notice_mono'] . "&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['bulletin_id'] . "';\" style='cursor: pointer' ";
                    }
                    $deb_ligne = "<tr {$tr_javascript}>";
                    echo $deb_ligne;
                    /* test de date de retour dépassée */
                    if ($lvl != "late") {
                        if ($data['retard']) {
                            echo "<td class='expl-empr-retard'><center><b>&times;</b></center></td>";
                        } else {
                            echo "<td>&nbsp;</td>";
                        }
                    }
                    $empr = get_info_empr($data['emprunteur']);
                    echo "<td>" . $empr['nom'] . " " . $empr['prenom'] . "</td>";
                    echo "<td>" . $data['tit'] . "</td>";
                    echo "<td>" . $data["tdoc_libelle"] . "</td>";
                    echo "<td><center>" . $data['aff_pret_date'] . "</center></td>";
                    if ($data['retard']) {
                        echo "<td class='expl-empr-retard'><center>" . $data['aff_pret_retour'] . "</center></td>";
                    } else {
                        echo "<td><center>" . $data['aff_pret_retour'] . "</center></td>";
                    }
                    echo "</tr>\n";
                }
                // fin du while
                echo "</table>";
            } else {
                $line += 2;
                $x = 0;
                //Titre
                $worksheet->write($line, $x, $titre_goup, $heading_blue);
                $worksheet->merge_cells($line, $x, $line, $x + 6);
                //Entêtes
                $line += 2;
                $x = 0;
                if ($lvl != "late") {
                    $worksheet->write($line, $x, $msg["empr_late"], $heading_10);
                    $x++;
                }
                $worksheet->write($line, $x, $msg["extexpl_emprunteur"], $heading_10);
                $worksheet->write($line, $x + 1, $msg["title"], $heading_10);
                $worksheet->write($line, $x + 2, $msg["typdoc_support"], $heading_10);
                $worksheet->write($line, $x + 3, $msg["date_loan"], $heading_10);
                $worksheet->write($line, $x + 4, $msg["date_back"], $heading_10);
                //Valeurs
                $loc_cours = "";
                while ($data = pmb_mysql_fetch_array($req)) {
                    $x = 0;
                    $line++;
                    if ($loc_cours != $data['location_libelle']) {
                        $loc_cours = $data['location_libelle'];
                        $worksheet->write($line, $x, $msg["expl_header_location_libelle"] . " : " . $loc_cours, $heading_12);
                        $line++;
                    }
                    if ($lvl != "late") {
                        if ($data['retard']) {
                            $worksheet->write($line, $x, "x");
                        }
                        $x++;
                    }
                    $empr = get_info_empr($data['emprunteur']);
                    $worksheet->write($line, $x, $empr['nom'] . " " . $empr['prenom']);
                    $worksheet->write($line, $x + 1, $data['tit']);
                    $worksheet->write($line, $x + 2, $data["tdoc_libelle"]);
                    $worksheet->write($line, $x + 3, $data['aff_pret_date']);
                    $worksheet->write($line, $x + 4, $data['aff_pret_retour']);
                }
            }
        }
    }
}
Exemplo n.º 3
0
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: main.inc.php,v 1.2 2015-04-03 11:16:26 jpermanne Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
require_once './circ/print_pret/func.inc.php';
$empr = get_info_empr($id_empr);
//global $biblio_name, $biblio_logo, $biblio_adr1, $biblio_adr2, $biblio_cp, $biblio_town, $biblio_state, $biblio_country, $biblio_phone, $biblio_email, $biblio_website ;
$xml_bibli = "<text style=\"header\">" . htmlspecialchars($biblio_name, ENT_QUOTES, $charset) . "</text>";
$xml_bibli .= "<text style=\"p1\">" . htmlspecialchars($biblio_adr1, ENT_QUOTES, $charset) . "</text>";
$xml_bibli .= "<text style=\"p1\">" . htmlspecialchars($biblio_town, ENT_QUOTES, $charset) . "</text>";
$xml_bibli .= "<text style=\"p1\">" . htmlspecialchars($biblio_phone, ENT_QUOTES, $charset) . "</text>";
$xml_bibli .= "<text style=\"p1\">" . htmlspecialchars($biblio_email, ENT_QUOTES, $charset) . "</text>";
$xml_bibli .= "<text style=\"p1\"></text>";
$xml_bibli .= "<text style=\"p1\">" . htmlspecialchars($msg['fpdf_edite'] . " " . formatdate(date("Y-m-d", time())), ENT_QUOTES, $charset) . "</text>";
$xml_bibli .= "<text style=\"p1\"></text>";
$xml_bibli .= "<text style=\"t1\">Emprunteur: </text>";
$xml_bibli .= "<text style=\"p1\">" . htmlspecialchars($empr->nom . " " . $empr->prenom, ENT_QUOTES, $charset) . "</text>";
$xml_bibli .= "<text style=\"p1\"></text>";
function print_expl($cb_doc)
{
    global $charset;
    $expl = get_info_expl($cb_doc);
    $xml_expl .= "<text style=\"p1\"></text>";
    $titre = substr($expl->tit, 0, 25);
    $xml_expl .= "<text style=\"t1_s\">" . htmlspecialchars($titre, ENT_QUOTES, $charset) . "</text>";
    $xml_expl .= "<text style=\"t1\" x=\"360\">" . htmlspecialchars($expl->aff_pret_retour, ENT_QUOTES, $charset) . "</text>";