Exemplo n.º 1
0
function list_esgroups()
{
    global $msg, $charset, $dbh;
    $esgroups = new es_esgroups();
    print "<table>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>" . $msg["es_group_name"] . "</th>\n\t\t\t\t\t<th>" . $msg["es_group_fullname"] . "</th>\n\t\t\t\t\t<th>" . $msg["connector_out_authorization_authorizedsourcecount"] . "</th>\n\t\t\t\t</tr>";
    //Ajoutons l'utilisateur anonyme
    $sql = "SELECT COUNT(1) FROM connectors_out_sources_esgroups WHERE connectors_out_source_esgroup_esgroupnum = -1";
    $anonymous_count = pmb_mysql_result(pmb_mysql_query($sql, $dbh), 0, 0);
    $pair_impair = "odd";
    $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" onmousedown=\"document.location='./admin.php?categ=connecteurs&sub=out_auth&action=editanonymous'\" ";
    print "\t\t<tr style='cursor: pointer' class='{$pair_impair}' {$tr_javascript}>\n\t\t\t\t\t<td>&lt;" . $msg["admin_connecteurs_outauth_anonymgroupname"] . "&gt;</td>\n\t\t\t\t\t<td>" . $msg["admin_connecteurs_outauth_anonymgroupfullname"] . "</td>\n\t\t\t\t\t<td>" . $anonymous_count . "</td>\n\t\t\t\t</tr>";
    $parity = 1;
    foreach ($esgroups->groups as &$aesgroup) {
        //Récupérons le nombre de sources autorisées dans le groupe
        $sql = "SELECT COUNT(1) FROM connectors_out_sources_esgroups WHERE connectors_out_source_esgroup_esgroupnum = " . $aesgroup->esgroup_id;
        $count = pmb_mysql_result(pmb_mysql_query($sql, $dbh), 0, 0);
        $pair_impair = $parity++ % 2 ? 'even' : 'odd';
        $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" onmousedown=\"document.location='./admin.php?categ=connecteurs&sub=out_auth&action=edit&id={$aesgroup->esgroup_id}';\" ";
        print "<tr style='cursor: pointer' class='{$pair_impair}' {$tr_javascript}>";
        print "<td>" . htmlentities($aesgroup->esgroup_name, ENT_QUOTES, $charset) . "</td>";
        print "<td>" . htmlentities($aesgroup->esgroup_fullname, ENT_QUOTES, $charset) . "</td>";
        print "<td>" . $count . "</td>";
        print "</tr>";
    }
    print "</table>";
}
 static function get_qty()
 {
     global $dbh;
     $q = "select count(1) from demandes_type";
     $r = pmb_mysql_query($q, $dbh);
     return pmb_mysql_result($r, 0, 0);
 }
Exemplo n.º 3
0
 static function get_qty()
 {
     global $dbh;
     $q = "select count(1) from faq_themes";
     $r = pmb_mysql_query($q, $dbh);
     return pmb_mysql_result($r, 0, 0);
 }
Exemplo n.º 4
0
 function listBannettesAuto($filtre_search = "", $id_classement = 0)
 {
     global $dbh;
     if (SESSrights & DSI_AUTH) {
         $result = array();
         //auto = 1 : bannettes automatiques sans contrôle de date
         $auto = 1;
         $filtre_search = str_replace("*", "%", $filtre_search);
         if ($filtre_search) {
             $clause = "WHERE nom_bannette like '{$filtre_search}%' and bannette_auto='{$auto}' ";
         } else {
             $clause = "WHERE bannette_auto='{$auto}' ";
         }
         //			if ($id_classement!=0) $clause.= " and num_classement=0 ";
         if ($id_classement > 0) {
             $clause .= " and num_classement='{$id_classement}' ";
         }
         $requete = "SELECT COUNT(1) FROM bannettes {$clause} ";
         $res = pmb_mysql_query($requete, $dbh);
         $nbr_lignes = pmb_mysql_result($res, 0, 0);
         if ($nbr_lignes) {
             $requete = "SELECT id_bannette, nom_bannette, date_last_remplissage, date_last_envoi, proprio_bannette, bannette_auto, nb_notices_diff FROM bannettes {$clause} ORDER BY nom_bannette, id_bannette ";
             $res = pmb_mysql_query($requete, $dbh);
             while ($row = pmb_mysql_fetch_assoc($res)) {
                 $result[] = array("id_bannette" => $row["id_bannette"], "nom_bannette" => utf8_normalize($row["nom_bannette"]), "date_last_remplissage" => $row["date_last_remplissage"], "date_last_envoi" => $row["date_last_envoi"], "proprio_bannette" => $row["proprio_bannette"], "bannette_auto" => $row["bannette_auto"], "nb_notices_diff" => $row["nb_notices_diff"]);
             }
         }
         return $result;
     } else {
         return array();
     }
 }
function param_perso_form(&$p_perso)
{
    global $dbh;
    global $param_perso_900;
    for ($i = 0; $i < count($param_perso_900); $i++) {
        $req = " select idchamp, type, datatype from notices_custom where name='" . $param_perso_900[$i]['n'] . "'";
        $res = pmb_mysql_query($req, $dbh);
        if (pmb_mysql_num_rows($res)) {
            $perso = pmb_mysql_fetch_object($res);
            if ($perso->idchamp) {
                if ($perso->type == 'list') {
                    $requete = "select notices_custom_list_value from notices_custom_lists where notices_custom_list_lib='" . addslashes($param_perso_900[$i]['a']) . "' and notices_custom_champ={$perso->idchamp}";
                    $resultat = pmb_mysql_query($requete);
                    if (pmb_mysql_num_rows($resultat)) {
                        $value = pmb_mysql_result($resultat, 0, 0);
                    } else {
                        $requete = "select max(notices_custom_list_value*1) from notices_custom_lists where notices_custom_champ={$perso->idchamp}";
                        $resultat = pmb_mysql_query($requete);
                        $max = @pmb_mysql_result($resultat, 0, 0);
                        $n = $max + 1;
                        $requete = "insert into notices_custom_lists (notices_custom_champ,notices_custom_list_value,notices_custom_list_lib) values({$perso->idchamp},{$n},'" . addslashes($param_perso_900[$i]['a']) . "')";
                        pmb_mysql_query($requete);
                        $value = $n;
                    }
                    $p_perso->values[$perso->idchamp][] = $value;
                } else {
                    $p_perso->values[$perso->idchamp][] = $param_perso_900[$i]['a'];
                }
            }
        }
    }
}
 function list_views()
 {
     global $dbh;
     //A l'INRA, 2 vues de base par utilisateur...
     //	- celle de son centre
     //  - la vue nationale
     //Vue nationale par défaut
     $this->opac_views_list[] = 21;
     $this->view_list_empr_default = 21;
     //Récupération du centre de l'emprunteur
     if ($this->id_empr) {
         $myQuery = pmb_mysql_query("select empr_custom_integer from empr_custom_values where empr_custom_origine=" . $this->id_empr . " and empr_custom_champ=15");
         if (pmb_mysql_num_rows($myQuery)) {
             $sql = "select opac_view_visible from opac_views where opac_view_id = " . $this->corresp_centres[pmb_mysql_result($myQuery, 0, 0)];
             $res = pmb_mysql_query($sql);
             if (pmb_mysql_num_rows($res)) {
                 if (pmb_mysql_result($res, 0, 0) > 0) {
                     $this->opac_views_list[] = $this->corresp_centres[pmb_mysql_result($myQuery, 0, 0)];
                 }
             }
         }
     }
     //+ les vues publiques
     $myQuery = pmb_mysql_query("SELECT * FROM opac_views where opac_view_visible=1", $dbh);
     if (pmb_mysql_num_rows($myQuery)) {
         while ($r = pmb_mysql_fetch_object($myQuery)) {
             $this->opac_views_list[] = $r->opac_view_id;
         }
     }
     $this->opac_views_list = array_unique($this->opac_views_list);
 }
Exemplo n.º 7
0
 function check_write_permission()
 {
     global $webdav_current_user_id;
     if ($this->config['write_permission']) {
         $tab = array();
         $query = "";
         switch ($this->config['authentication']) {
             case "gestion":
                 $tab = $this->config['restrcited_user_write_permission'];
                 $query = "select grp_num from users where userid = " . $webdav_current_user_id;
                 break;
             case "opac":
                 $query = "select empr_categ from empr where id_empr = " . $webdav_current_user_id;
             case "anonymous":
             default:
                 $tab = $this->config['restrcited_empr_write_permission'];
                 break;
         }
         //pas de restriction, on est bon
         if (!count($tab)) {
             return true;
         } elseif ($query != "") {
             //on doit s'assurer que la personne connectée est dispose des droits...
             $result = pmb_mysql_query($query);
             if (pmb_mysql_num_rows($result)) {
                 if (in_array(pmb_mysql_result($result, 0, 0), $tab)) {
                     return true;
                 }
             }
         }
     }
     //si on est encore dans la fonction, c'est qu'on correspond à aucun critère !
     return false;
 }
Exemplo n.º 8
0
 function need_to_display($categ_id)
 {
     if ($categ_id) {
         //on va cherché le libellé...
         $categ = new \category($categ_id);
         if (substr($categ->libelle, 0, 1) == "~") {
             return false;
         }
         if ($this->config['only_with_notices']) {
             if ($this->restricted_notices != "") {
                 $clause = " and notice_id in (" . $this->restricted_notices . ")";
             } else {
                 $clause = "";
             }
             //notices ou notices de bulletins...
             $query = "select sum(nb) from (select count(1) as nb from notices_categories join noeuds on id_noeud = notices_categories.num_noeud join notices on notice_id = notcateg_notice join explnum on explnum_notice = notice_id and explnum_notice != 0 where explnum_mimetype != 'URL' and path like (select concat(path,'%') from noeuds where id_noeud = " . $categ_id . ")" . $clause . " union select count(1) as nb from notices_categories join noeuds on id_noeud = notices_categories.num_noeud join notices on notice_id = notcateg_notice and niveau_biblio = 'b ' join bulletins on num_notice = notice_id join explnum on explnum_bulletin = bulletin_id and explnum_notice=0 where explnum_mimetype != 'URL' and path like (select concat(path,'%') from noeuds where id_noeud = " . $categ_id . ")" . $clause . ") as uni ";
             $result = pmb_mysql_query($query);
             if (pmb_mysql_num_rows($result)) {
                 if (pmb_mysql_result($result, 0, 0) > 0) {
                     return true;
                 }
             }
         } else {
             return true;
         }
     }
     return false;
 }
 public function get_datas()
 {
     //on commence par récupérer l'identifiant retourné par le sélecteur...
     $selector = $this->get_selected_selector();
     if ($selector) {
         $article_id = $selector->get_value();
         if ($article_id) {
             $sections = array();
             $query = "select num_section from cms_articles where id_article = " . $article_id;
             $result = pmb_mysql_query($query);
             if (pmb_mysql_num_rows($result)) {
                 $section_id = pmb_mysql_result($result, 0, 0);
                 if ($section_id) {
                     $datas = array();
                     $i = 0;
                     do {
                         $i++;
                         $query = "select id_section,section_num_parent from cms_sections where id_section = " . $section_id;
                         $result = pmb_mysql_query($query);
                         if (pmb_mysql_num_rows($result)) {
                             $row = pmb_mysql_fetch_object($result);
                             $section_id = $row->section_num_parent;
                             $datas[] = $row->id_section;
                         } else {
                             break;
                         }
                         //en théorie on sort toujours, mais comme c'est un pays formidable, on lock à 100 itérations...
                     } while ($row->section_num_parent != 0 || $i > 100);
                     return array_reverse($datas);
                 }
             }
         }
     }
     return false;
 }
Exemplo n.º 10
0
 function calcNumero($id_entite, $type_acte)
 {
     global $dbh;
     global $acquisition_format;
     $p = array();
     $p = explode(",", $acquisition_format);
     $prefix = $p[$type_acte + 1];
     //recuperation du dernier numero pour le type d'acte concerné et l'entité en cours
     $q = "select max(substring(numero," . (strlen($prefix) + 1) . ")*1) from actes where type_acte = '" . $type_acte . "' ";
     $q .= "and num_entite = '" . $id_entite . "' ";
     $r = pmb_mysql_query($q, $dbh);
     $res = pmb_mysql_result($r, 0, 0);
     if (!$res) {
         $res = '0';
     }
     //creation du numéro avec prefixe et padding
     $res++;
     $numero = $prefix;
     if ($p[0] != 0) {
         $numero = str_pad($numero, $p[0] - strlen($res) + strlen($prefix), '0') . $res;
     } else {
         $numero = $numero . $res;
     }
     return $numero;
 }
Exemplo n.º 11
0
 function proceed()
 {
     global $msg;
     //Actions possibles :
     //delete : suppression des jeux cochés
     //restore : restoration immédiate des jeux cochés
     //chaine vide : affichage
     switch ($this->act) {
         case "delete":
             if (!is_array($this->logid)) {
                 echo "<script>alert(\"" . $msg["sauv_list_unselected_set"] . "\"); history.go(-1);</script>";
             } else {
                 for ($i = 0; $i < count($this->logid); $i++) {
                     $requete = "select sauv_log_file from sauv_log where sauv_log_id=" . $this->logid[$i];
                     $resultat = pmb_mysql_query($requete) or die(pmb_mysql_error());
                     $file_to_del = pmb_mysql_result($resultat, 0, 0);
                     @unlink("admin/backup/backups/" . $file_to_del);
                     $requete = "delete from sauv_log where sauv_log_id=" . $this->logid[$i];
                     pmb_mysql_query($requete) or die(pmb_mysql_error());
                 }
             }
             break;
         default:
             //Do nothing
             break;
     }
     return $this->showForm();
 }
 protected function build_tree_sections($id_parent, $depth = 0)
 {
     global $dbh;
     if ($this->parameters['max_depth'] == 0 || $depth < $this->parameters['max_depth']) {
         $items = $ids = $rows = array();
         $query = "select id_section,section_title from cms_sections where section_num_parent = " . $id_parent . " order by section_order asc";
         $result = pmb_mysql_query($query, $dbh);
         if (pmb_mysql_num_rows($result)) {
             while ($row = pmb_mysql_fetch_object($result)) {
                 $ids[] = $row->id_section;
                 $rows[] = $row;
             }
             $ids = $this->filter_datas("sections", $ids);
             foreach ($rows as $row) {
                 if (in_array($row->id_section, $ids)) {
                     $section = cms_provider::get_instance("section", $row->id_section);
                     $item = array('id' => $row->id_section, 'title' => $row->section_title, 'link' => $this->get_constructed_link("section", $row->id_section), 'details' => $section->format_datas(false, false));
                     $sub_query = "select count(id_section) from cms_sections where section_num_parent = " . $row->id_section;
                     $sub_result = pmb_mysql_query($sub_query, $dbh);
                     if (pmb_mysql_num_rows($result) && pmb_mysql_result($sub_result, 0, 0) > 0) {
                         $item['children'] = $this->build_tree_sections($row->id_section, $depth + 1);
                     }
                     $items[] = $item;
                 }
             }
         }
     }
     return $items;
 }
 function connection_mysql($er_connec = 1, $my_bd = '', $bd = 1, $er_bd = 1)
 {
     global $opac_nb_documents;
     global $charset, $SQL_MOTOR_TYPE;
     global $charset, $SQL_MOTOR_TYPE, $time_zone, $time_zone_mysql;
     if (isset($time_zone) && trim($time_zone)) {
         date_default_timezone_set($time_zone);
     }
     //Pour l'heure PHP
     $my_connec = @pmb_mysql_connect(SQL_SERVER, USER_NAME, USER_PASS);
     if ($my_connec == 0 && $er_connec == 1) {
         die(my_error(0));
     }
     if ($bd) {
         $my_bd == '' ? $my_bd = DATA_BASE : $my_bd;
         if (pmb_mysql_select_db($my_bd, $my_connec) == 0 && $er_bd == 1) {
             die(my_error(0));
         }
     }
     $opac_nb_documents = @pmb_mysql_result(pmb_mysql_query("select count(*) from notices", $my_connec), 0, 0) * 1;
     if ($charset == 'utf-8') {
         pmb_mysql_query("set names utf8 ", $my_connec);
     } else {
         pmb_mysql_query("set names latin1 ", $my_connec);
     }
     if ($SQL_MOTOR_TYPE) {
         pmb_mysql_query("set storage_engine={$SQL_MOTOR_TYPE}", $my_connec);
     }
     if (isset($time_zone_mysql) && trim($time_zone_mysql)) {
         pmb_mysql_query("SET time_zone = {$time_zone_mysql}", $my_connec);
     }
     //Pour l'heure MySQL
     return $my_connec;
 }
Exemplo n.º 14
0
function cree_export_notices($liste = array(), $typeexport = 'pmbxml2marciso', $expl = 1)
{
    global $base_path;
    global $keep_expl, $dbh;
    $keep_expl = $expl;
    // Récupération des notices
    $n_notices = count($liste);
    if ($n_notices == 0) {
        return "";
    } else {
        $_SESSION["param_export"]["notice_exporte"] = array();
        // Export !
        $z = 0;
        $e_notice = "";
        while ($z < count($liste)) {
            $id = $liste[$z];
            // Exclure de l'export (opac, panier) les fiches interdites de diffusion dans administration, Notices > Origines des notices NG72
            $sql = "select orinot_diffusion from origine_notice,notices where notice_id = '{$id}' and origine_catalogage = orinot_id";
            $res = pmb_mysql_query($sql, $dbh);
            $diffusable = pmb_mysql_result($res, 0, 0);
            if ($diffusable) {
                $export = new start_export($id, $typeexport);
                $e_notice .= $export->output_notice;
                $z++;
            } else {
                $z++;
            }
        }
    }
    return $e_notice;
}
Exemplo n.º 15
0
 function getLibelle()
 {
     global $dbh;
     $res = pmb_mysql_query("SELECT " . $_SESSION["classementGen_types"][$this->object_type]["TABLE_CLASSEMENT_FIELD"] . " \n\t\t\t\tFROM " . $_SESSION["classementGen_types"][$this->object_type]["TABLE"] . " \n\t\t\t\tWHERE " . $_SESSION["classementGen_types"][$this->object_type]["TABLE_ID"] . "=" . $this->object_id, $dbh);
     if (pmb_mysql_num_rows($res)) {
         $this->libelle = pmb_mysql_result($res, 0, 0);
     }
 }
Exemplo n.º 16
0
function formatdate_input($date_a_convertir)
{
    global $msg;
    global $dbh;
    $resultatdate = pmb_mysql_query("select date_format('" . $date_a_convertir . "', '" . $msg["format_date_input_model"] . "') as date_conv ");
    $date_conv = pmb_mysql_result($resultatdate, 0, 0);
    return $date_conv;
}
 function entrepot_to_unimarc($recid)
 {
     global $dbh;
     $requete = "SELECT source_id FROM external_count WHERE rid=" . addslashes($recid) . ";";
     $myQuery = pmb_mysql_query($requete, $dbh);
     $source_id = pmb_mysql_result($myQuery, 0, 0);
     $requete = "select * from entrepot_source_{$source_id} where recid='" . addslashes($recid) . "' group by ufield,usubfield,field_order,subfield_order,value order by field_order,subfield_order";
     $resultat = pmb_mysql_query($requete, $dbh);
     $unimarc = new iso2709_record("", USER_UPDATE);
     $field_order = -1;
     $field = $r->ufield;
     $sfields = array();
     while ($r = pmb_mysql_fetch_object($resultat)) {
         switch ($r->ufield) {
             case "rs":
                 $unimarc->set_rs($r->value);
                 break;
             case "dt":
                 $unimarc->set_dt($r->value);
                 break;
             case "bl":
                 $unimarc->set_bl($r->value);
                 break;
             case "hl":
                 $unimarc->set_hl($r->value);
                 break;
             case "el":
                 $unimarc->set_el($r->value);
                 break;
             case "ru":
                 $unimarc->set_ru($r->value);
                 break;
             case "001":
                 $unimarc->add_field("001", '  ', $r->value);
             default:
                 if ($field_order != $r->field_order) {
                     if (count($sfields)) {
                         $unimarc->add_field($field, '  ', $sfields);
                     }
                     $field = $r->ufield;
                     $sfields = array();
                     $field_order = $r->field_order;
                 }
                 if (!$r->usubfield) {
                     $unimarc->add_field($r->ufield, '', $r->value);
                 } else {
                     $sfields[][0] = $r->usubfield;
                     $sfields[count($sfields) - 1][1] = $r->value;
                 }
                 break;
         }
     }
     if (count($sfields)) {
         $unimarc->add_field($field, '  ', $sfields);
     }
     $unimarc->update();
     $this->sugg_uni_notice = $unimarc->full_record;
 }
/**
 * Formulaire de saisie pour l'envoi d'une demande
 */
function show_form($id)
{
    global $dbh, $msg, $charset;
    $req = "select id_empr from empr where empr_login='******'user_code'] . "'";
    $res = pmb_mysql_query($req, $dbh);
    $idempr = pmb_mysql_result($res, 0, 0);
    $display .= "<div class='row'>\n\t\t\t\t\t<font style='color:red'><label class='etiquette'>" . htmlentities($msg[list_lecture_mail_inscription], ENT_QUOTES, $charset) . "</label></font>\n\t\t\t\t</div>\n\t\t\t\t<div class='row'>\n\t\t\t\t\t<label class='etiquette' >" . htmlentities($msg[list_lecture_demande_inscription], ENT_QUOTES, $charset) . "</label>\n\t\t\t\t</div>\n\t\t\t\t<div class='row'>\n\t\t\t\t\t<blockquote>\n\t\t\t\t\t\t<textarea style='vertical-align:top' id='liste_demande_{$id}' name='liste_demande_{$id}' cols='50' rows='5'></textarea>\n\t\t\t\t\t</blockquote>\n\t\t\t\t</div>\t\t\t\t\n\t\t\t\t<input type='button' class='bouton' name='send_mail_{$id}' id='send_mail_{$id}' value='{$msg['list_lecture_send_mail']}' />\n\t\t\t\t<input type='button' class='bouton' name='cancel_{$id}' id='cancel_{$id}' value='{$msg['list_lecture_cancel_mail']}' />\n\t\t\t\t<input type='hidden' name='id_empr' id='id_empr' value='{$idempr}' />\n\t\t\t\t\n\t\t\t\t";
    print $display;
}
Exemplo n.º 19
0
function show_lines_list()
{
    global $id_empr, $msg, $charset;
    //Liste des recouvrements
    print "\n\t<div class='row'>\t\n\t<script type='text/javascript' src='./javascript/sorttable.js'></script>\n\t<table class='sortable'>\n\n\t\t<tr>\n\t\t\t<th>" . htmlentities($msg["relance_recouvrement_date"], ENT_QUOTES, $charset) . "</th>\n\t\t\t<th>" . htmlentities($msg["relance_recouvrement_type"], ENT_QUOTES, $charset) . "</th>\n\t\t\t<th>" . htmlentities($msg["relance_recouvrement_titre"], ENT_QUOTES, $charset) . "</th>\n\t\t\t<th>" . htmlentities($msg["relance_recouvrement_cb"], ENT_QUOTES, $charset) . "</th>\n\t\t\t<th>" . htmlentities($msg["relance_recouvrement_cote"], ENT_QUOTES, $charset) . "</th>\n\t\t\t<th>" . htmlentities($msg["relance_recouvrement_pret_date"], ENT_QUOTES, $charset) . "</th>\n\t\t\t<th>" . htmlentities($msg["relance_recouvrement_relance_date1"], ENT_QUOTES, $charset) . "</th>\n\t\t\t<th>" . htmlentities($msg["relance_recouvrement_relance_date2"], ENT_QUOTES, $charset) . "</th>\n\t\t\t<th>" . htmlentities($msg["relance_recouvrement_relance_date3"], ENT_QUOTES, $charset) . "</th>\n\t\t\t<th>" . htmlentities($msg["relance_recouvrement_prix_calcul"], ENT_QUOTES, $charset) . "</th>\n\t\t\t<th>" . htmlentities($msg["relance_recouvrement_montant"], ENT_QUOTES, $charset) . "</th>\n\t\t\t<th></th>\n\t\t\t<th></th>\t\t\n\t\t</tr>";
    $requete = "select recouvr_id,id_expl,date_rec,libelle,montant, expl_notice,expl_bulletin, recouvr_type, date_pret,date_relance1,date_relance2,date_relance3, expl_cote ,\texpl_cb\n\tfrom recouvrements left join exemplaires on expl_id=id_expl where empr_id={$id_empr} order by date_rec,recouvr_id";
    $resultat = pmb_mysql_query($requete);
    $pair = false;
    while ($r = pmb_mysql_fetch_object($resultat)) {
        if (!$pair) {
            $pair_impair = "odd";
        } else {
            $pair_impair = "even";
        }
        $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" ";
        $pair = !$pair;
        if ($r->id_expl) {
            if ($r->expl_notice) {
                $notice = new mono_display($r->expl_notice);
            } elseif ($r->expl_bulletin) {
                $req = "select bulletin_notice from bulletins where bulletin_id={$r->expl_bulletin}";
                $res = pmb_mysql_query($req);
                $id_bull_notice = pmb_mysql_result($res, 0, 0);
                $notice = new serial_display($id_bull_notice);
            }
            $libelle = strip_tags(html_entity_decode($notice->header, ENT_QUOTES, $charset));
        } else {
            $libelle = $r->libelle;
        }
        if (!$r->recouvr_type) {
            print pmb_bidi("<tr class='{$pair_impair}' {$tr_javascript}>\n\t\t\t\t<td>" . format_date($r->date_rec) . "</td>\n\t\t\t\t<td>" . htmlentities($msg["relance_recouvrement_amende"], ENT_QUOTES, $charset) . "</td>\n\t\t\t\t<td>" . htmlentities($libelle, ENT_QUOTES, $charset) . "</td>\n\t\t\t\t<td><a href='./circ.php?categ=visu_ex&form_cb_expl=" . $r->expl_cb . "'>" . $r->expl_cb . "</a></td>\n\t\t\t\t<td>" . htmlentities($r->expl_cote, ENT_QUOTES, $charset) . "</td>\n\t\t\t\t<td>" . format_date($r->date_pret) . "</td>\n\t\t\t\t<td>" . format_date($r->date_relance1) . "</td>\n\t\t\t\t<td>" . format_date($r->date_relance2) . "</td>\n\t\t\t\t<td>" . format_date($r->date_relance3) . "</td>\n\t\t\t\t<td></td>\n\t\t\t\t<td style='text-align:right'><span dynamics='circ,recouvr_prix' dynamics_params='text' id='prix_" . $r->recouvr_id . "'>" . comptes::format_simple($r->montant) . "</span></td>\n\t\t\t\t<td style='text-align:center'><input type='checkbox' name='recouvr_ligne[]' value='" . $r->recouvr_id . "'></td>\n\t\t\t\t<td>");
            if (!$r->id_expl) {
                print "<input type='button' value='...' class='bouton' onClick=\"this.form.act_line.value='update_line'; this.form.recouvr_id.value='" . $r->recouvr_id . "'; this.form.submit();\"/>";
            } else {
                print "&nbsp;";
            }
            print "</td>";
            print "</tr>";
        } elseif ($r->id_expl) {
            $requete = "select expl_prix, prix from exemplaires, notices where (notice_id=expl_notice or notice_id=expl_bulletin) and expl_id =" . $r->id_expl;
            //http://localhost/~ngantier/pmb/circ.php?categ=visu_ex&form_cb_expl=p
            $res_prix = pmb_mysql_query($requete);
            $comment_prix = '';
            if ($r_prix = pmb_mysql_fetch_object($res_prix)) {
                if (!($comment_prix = $r_prix->expl_prix)) {
                    $comment_prix = $r_prix->prix;
                }
            }
            print pmb_bidi("<tr class='{$pair_impair}' {$tr_javascript}>\n\t\t\t\t<td>" . format_date($r->date_rec) . "</td>\n\t\t\t\t<td>" . htmlentities($msg["relance_recouvrement_prix"], ENT_QUOTES, $charset) . "</td>\n\t\t\t\t<td>" . htmlentities($libelle, ENT_QUOTES, $charset) . "</td>\n\t\t\t\t<td><a href='./circ.php?categ=visu_ex&form_cb_expl=" . $r->expl_cb . "'>" . $r->expl_cb . "</a></td>\n\t\t\t\t<td>" . htmlentities($r->expl_cote, ENT_QUOTES, $charset) . "</td>\t\t\t\n\t\t\t\t<td>" . format_date($r->date_pret) . "</td>\n\t\t\t\t<td>" . format_date($r->date_relance1) . "</td>\n\t\t\t\t<td>" . format_date($r->date_relance2) . "</td>\n\t\t\t\t<td>" . format_date($r->date_relance3) . "</td>\n\t\t\t\t<td>" . htmlentities($comment_prix, ENT_QUOTES, $charset) . "</td>\n\t\t\t\t<td style='text-align:right'><span dynamics='circ,recouvr_prix' dynamics_params='text' id='prix_" . $r->recouvr_id . "'>" . comptes::format_simple($r->montant) . "</span></td>\n\t\t\t\t<td style='text-align:center'><input type='checkbox' name='recouvr_ligne[]' value='" . $r->recouvr_id . "'></td>\n\t\t\t\t<td>");
            print "</td>";
            print "</tr>";
        }
    }
    print "</table></div>";
    print "\n\t\t<div class='row'></div>\n\t</div>\n\t<!--boutons -->\n\t<div class='row'>\n\t\t<input type='button' value='" . $msg["relance_recouvrement_del_all_lines"] . "' class='bouton' onClick=\"if (confirm('" . $msg["relance_recouvrement_confirm_del"] . "')) { this.form.act_line.value='del_line'; this.form.submit(); }\"/>\n\t\t<input type='button' value='" . $msg["relance_recouvrement_add_line"] . "' class='bouton' onClick=\"this.form.act_line.value='update_line'; this.form.recouvr_id.value=''; this.form.submit();\"/>\n\t\t<input type='button' value='" . $msg["relance_recouvrement_export_tableur"] . "' class='bouton' onClick=\"document.location='./circ/relance/recouvr_reader_excel.php?id_empr={$id_empr}';\"/>\n\t\t<input type='button' value='" . $msg["relance_recouvrement_solder"] . "' class='bouton' onClick=\"if (confirm('" . $msg["relance_recouvrement_confirm_solder"] . "')) { this.form.act_line.value='solde'; this.form.submit(); }\"/>\n\t\t<input type='button' value='" . $msg["76"] . "' class='bouton' onClick=\"document.location='./circ.php?categ=relance&sub=recouvr&act=recouvr_liste'\"/>\n\t</div>";
}
Exemplo n.º 20
0
 function getContentType()
 {
     $mimetype = "";
     $query = "select explnum_mimetype from explnum where explnum_id = " . $this->explnum_id;
     $result = pmb_mysql_query($query);
     if (pmb_mysql_num_rows($result)) {
         $mimetype = pmb_mysql_result($result, 0, 0);
     }
     return $mimetype;
 }
Exemplo n.º 21
0
function show_results($dbh, $user_input, $nbr_lignes = 0, $page = 0, $id = 0)
{
    global $nb_per_page;
    global $base_url;
    global $caller;
    global $msg;
    global $no_display;
    global $charset;
    // on récupére le nombre de lignes qui vont bien
    if ($user_input == "") {
        $requete = "SELECT COUNT(1) FROM notices where notice_id!='" . $no_display . "' and niveau_biblio='s' and niveau_hierar='1' ";
    } else {
        $aq = new analyse_query(stripslashes($user_input));
        if ($aq->error) {
            error_message($msg["searcher_syntax_error"], sprintf($msg["searcher_syntax_error_desc"], $aq->current_car, $aq->input_html, $aq->error_message));
            exit;
        }
        $members = $aq->get_query_members("notices", "index_wew", "index_sew", "notice_id");
        $requete = "select count(notice_id) from notices where (" . $members["where"] . " or code like '" . stripslashes($user_input) . "') and notice_id!='" . $no_display . "' and niveau_biblio='s' and niveau_hierar='1'";
    }
    $res = pmb_mysql_query($requete, $dbh);
    $nbr_lignes = @pmb_mysql_result($res, 0, 0);
    if (!$page) {
        $page = 1;
    }
    $debut = ($page - 1) * $nb_per_page;
    if ($nbr_lignes) {
        // on lance la vraie requête
        if ($user_input == "") {
            $requete = "SELECT notice_id, tit1, code FROM notices where notice_id!='" . $no_display . "' and niveau_biblio='s' and niveau_hierar='1' ORDER BY tit1, code LIMIT {$debut},{$nb_per_page} ";
        } else {
            $requete = "select notice_id, tit1, code, " . $members["select"] . " as pert from notices where (" . $members["where"] . " or code like '" . stripslashes($user_input) . "') and notice_id!='" . $no_display . "' and niveau_biblio='s' and niveau_hierar='1' group by notice_id order by pert desc, index_serie, tnvol, index_sew, code limit {$debut},{$nb_per_page}";
        }
        $res = @pmb_mysql_query($requete, $dbh);
        print "<table><tr>";
        while ($notice = pmb_mysql_fetch_object($res)) {
            $notice_entry = $notice->tit1 . "&nbsp;" . $notice->code;
            print "\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<a href='#' onclick=\"set_parent('{$caller}', '{$notice->notice_id}', '" . htmlentities(addslashes($notice->tit1), ENT_QUOTES, $charset) . " ({$notice->code})')\">" . htmlentities($notice->tit1, ENT_QUOTES, $charset) . "</a></td>\n\t\t\t\t\t<td>{$notice->code}</td>";
            print "</tr>";
        }
        print "</table>";
        pmb_mysql_free_result($res);
        // constitution des liens
        $nbepages = ceil($nbr_lignes / $nb_per_page);
        $suivante = $page + 1;
        $precedente = $page - 1;
    }
    // affichage de la pagination
    print "<div class='row'>&nbsp;<hr /></div><div align='center'>";
    $url_base = $base_url . "&user_input=" . rawurlencode(stripslashes($user_input));
    $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true);
    print $nav_bar;
    print "</div>";
}
Exemplo n.º 22
0
 function get_current_subversion()
 {
     global $dbh;
     $query = "select valeur_param from parametres where type_param = 'pmb' and sstype_param ='bdd_subversion'";
     $result = pmb_mysql_query($query, $dbh);
     $pmb_bdd_subversion = "0";
     if (pmb_mysql_num_rows($result)) {
         $pmb_bdd_subversion = pmb_mysql_result($result, 0, 0);
     }
     return $pmb_bdd_subversion;
 }
Exemplo n.º 23
0
 public function get_section_title()
 {
     if (!$this->section_title) {
         $rqt = "select section_title from cms_sections where id_section='" . $this->num_section . "'";
         $res = pmb_mysql_query($rqt);
         if (pmb_mysql_num_rows($res)) {
             $this->section_title = pmb_mysql_result($res, 0, 0);
         }
     }
     return $this->section_title;
 }
Exemplo n.º 24
0
 function __construct($name, $config)
 {
     parent::__construct($config);
     $this->statut_id = substr($this->get_code_from_name($name), 1);
     $query = "select gestion_libelle from notice_statut where id_notice_statut = " . $this->statut_id;
     $result = pmb_mysql_query($query);
     if (pmb_mysql_num_rows($result)) {
         $this->statut_libelle = pmb_mysql_result($result, 0, 0);
     }
     $this->type = "statut";
 }
function search_other_function_human_query($n)
{
    global $recherche_loc, $msg;
    $r = "";
    $recherche_loc = $_SESSION["recherche_loc" . $n];
    if ($recherche_loc) {
        $requete = "select location_libelle from docs_location where idlocation='" . $recherche_loc . "' limit 1";
        $res = pmb_mysql_query($requete);
        $r = $msg["search_history_localisation_title"] . @pmb_mysql_result($res, 0, 0);
    }
    return $r;
}
Exemplo n.º 26
0
 protected function fetch_data()
 {
     $table = $this->get_sql_table();
     if (!$table) {
         return false;
     }
     $rqt = "select " . $this->type . "_logo from " . $table . " where id_" . $this->type . " = '" . $this->id . "'";
     $res = pmb_mysql_query($rqt);
     if (pmb_mysql_num_rows($res)) {
         $this->data = pmb_mysql_result($res, 0, 0);
     }
 }
Exemplo n.º 27
0
function add_note($idnote = 0)
{
    global $dbh, $base_path, $idtype, $idobject, $comment, $ordre_cible;
    $iddemande = $idobject;
    $commentaire = trim($comment);
    if ($ordre_cible) {
        $ordre = $ordre_cible;
    } else {
        $req = "select max(ordre)+1 from rapport_demandes where num_demande='" . $iddemande . "'";
        $res = pmb_mysql_query($req, $dbh);
        $ordre = pmb_mysql_result($res, 0, 0);
    }
    $req = "insert into rapport_demandes set \n\t\tcontenu='" . $commentaire . "',\n\t\tnum_demande='" . $iddemande . "',\n\t\tnum_note='" . $idnote . "',\n\t\tordre = '" . $ordre . "',\n\t\ttype='" . $idtype . "'\n\t\t";
    pmb_mysql_query($req, $dbh);
    if ($ordre_cible) {
        update_order(pmb_mysql_insert_id());
    }
    $req = "select rd.id_item, rd.contenu, rd.ordre, rd.type, rd.num_note, sujet_action from rapport_demandes rd left join demandes_notes on num_note=id_note left join demandes_actions on num_action=id_action where rd.num_demande='" . $iddemande . "' order by ordre";
    $res = pmb_mysql_query($req, $dbh);
    $display = "";
    while ($item = pmb_mysql_fetch_object($res)) {
        $titre = substr($item->contenu, 0, 15) . "...";
        $style = "";
        if (!$item->num_note) {
            //Ajout manuel
            switch ($item->type) {
                case '1':
                    //Titre
                    $style = "style='background-color:#DECDEC' titre='yes'";
                    $content = $item->contenu;
                    break;
                case '0':
                    //Commmentaire
                    $content = "* " . $item->contenu;
                    break;
            }
        } else {
            $content = $item->contenu;
        }
        $ordre = $item->ordre;
        if ($item->sujet_action) {
            $contenu = "<u>" . $item->sujet_action . "</u> : " . $content;
        } else {
            $contenu = $content;
        }
        $drag = "<span id=\"rap_handle_{$item->id_item}\" style='padding-left:7px'  ><img src=\"" . $base_path . "/images/notice_drag.png\" /></span>";
        $del = "<span id=\"rap_del_{$item->id_item}\" style='padding-left:7px' onclick='delete_item({$item->id_item});' ><img src=\"" . $base_path . "/images/cross.png\" style='cursor:pointer;width:10px;vertical-align:middle;' /></span>";
        $modif = "<span id=\"rap_modif_{$item->id_item}\" style='padding-left:7px;' onclick='modif_item({$item->id_item});' ><img src=\"" . $base_path . "/images/b_edit.png\" style='cursor:pointer;width:10px;vertical-align:middle;'/></span>";
        $display .= "\n\t\t\t\t\t<div class='row' {$style} id='rap_drag_{$item->id_item}' draggable=\"yes\" dragtype=\"rapport\" dragtext=\"{$titre}\" dragicon=\"" . $base_path . "/images/icone_drag_notice.png\"\n\t\t\t\t\t\thandler=\"rap_handle_{$item->id_item}\" recepttype=\"rapport\" recept=\"yes\" highlight=\"rap_highlight\" downlight=\"rap_downlight\" iditem='{$item->id_item}' order='{$ordre}'>" . $contenu . $drag . $modif . $del . "</div>\t\t\t\n\t\t\t\t";
    }
    ajax_http_send_response($display);
}
function init_gen_code_exemplaire($notice_id, $bull_id)
{
    if ($notice_id) {
        $requete = "select max(expl_cb) from exemplaires where expl_cb=expl_cb*1 and expl_notice!=0";
        $code_exemplaire = pmb_mysql_result(pmb_mysql_query($requete), 0, 0);
    } else {
        if ($bull_id) {
            $requete = "select max(substr(expl_cb,1)) from exemplaires where expl_bulletin!=0 and expl_cb like 'P%'";
            $code_exemplaire = pmb_mysql_result(pmb_mysql_query($requete), 0, 0);
        }
    }
    return $code_exemplaire;
}
function prefill_cote($id_notice = 0, $cote = "")
{
    global $dbh;
    global $value_prefix_cote;
    if (!$cote) {
        //Recherche du Plan de classement
        $q = "select cat1.libelle_categorie as libelle_pc ";
        $q .= "from notices, notices_categories, noeuds, categories as cat1, categories as cat2 ";
        $q .= "where notice_id='" . $id_notice . "' and num_thesaurus='2' ";
        $q .= "and cat2.num_noeud=noeuds.num_renvoi_voir and cat1.num_noeud=noeuds.id_noeud ";
        $q .= "and notices_categories.num_noeud=cat2.num_noeud and notices.notice_id=notices_categories.notcateg_notice ";
        $q .= "order by ordre_categorie ";
        $q .= "limit 1 ";
        $r = pmb_mysql_query($q, $dbh);
        $nbr_lignes = pmb_mysql_num_rows($r);
        $q1 = "select typdoc from notices where notice_id='" . $id_notice . "' ";
        $r1 = pmb_mysql_query($q1, $dbh);
        $typdoc = pmb_mysql_result($r1, 0, 0);
        if ($nbr_lignes) {
            $l1 = pmb_mysql_fetch_object($r);
            $pc = trim($l1->libelle_pc);
            $cotem = "";
            if ($typdoc == "m") {
                $cotem = "MULT/";
                $pcm = $cotem . $pc;
            }
            //Recherche du +grand numéro inutilisé dans la cotation
            $q = "select convert( if (expl_cote like ('MULT%'), substring(trim(expl_cote), length('" . $pcm . "')+2) , substring(trim(expl_cote), length('" . $pc . "')+2) ), unsigned)  as numero from exemplaires where expl_cote like('%" . $pc . "/%') order by numero asc ";
            $r = pmb_mysql_query($q, $dbh);
            $max = 0;
            $before_num = 0;
            while ($cote = pmb_mysql_fetch_object($r)) {
                $current_num = $cote->numero;
                if ($current_num > $before_num + 1) {
                    $max = $before_num;
                    break;
                } else {
                    $before_num = $current_num;
                    $max = $current_num;
                }
            }
            $max++;
            $res_cote = $value_prefix_cote . $cotem . $pc . "/" . $max;
            return $res_cote;
        } else {
            return $value_prefix_cote;
        }
    } else {
        return $cote;
    }
}
Exemplo n.º 30
0
function import_new_notice_suite()
{
    global $dbh;
    global $notice_id;
    global $info_606_a;
    global $info_900;
    $ordre_categ = 0;
    for ($i = 0; $i < count($info_606_a); $i++) {
        for ($j = 0; $j < count($info_606_a[$i]); $j++) {
            $descripteur = $info_606_a[$i][$j];
            //Recherche du terme
            //dans le thesaurus par defaut et dans la langue de l'interface
            $libelle = addslashes($descripteur);
            $categ_id = categories::searchLibelle($libelle);
            if ($categ_id) {
                $requete = "INSERT INTO notices_categories (notcateg_notice,num_noeud,ordre_categorie) values({$notice_id},{$categ_id},{$ordre_categ})";
                pmb_mysql_query($requete, $dbh);
                $ordre_categ++;
            }
        }
    }
    for ($i = 0; $i < count($info_900); $i++) {
        $req = " select idchamp, type, datatype from notices_custom where name='" . $info_900[$i]['n'] . "'";
        $res = pmb_mysql_query($req, $dbh);
        if (pmb_mysql_num_rows($res)) {
            $perso = pmb_mysql_fetch_object($res);
            if ($perso->idchamp) {
                if ($perso->type == 'list') {
                    $requete = "select notices_custom_list_value from notices_custom_lists where notices_custom_list_lib='" . addslashes($info_900[$i]['a']) . "' and notices_custom_champ={$perso->idchamp}";
                    $resultat = pmb_mysql_query($requete);
                    if (pmb_mysql_num_rows($resultat)) {
                        $value = pmb_mysql_result($resultat, 0, 0);
                    } else {
                        $requete = "select max(notices_custom_list_value*1) from notices_custom_lists where notices_custom_champ={$perso->idchamp}";
                        $resultat = pmb_mysql_query($requete);
                        $max = @pmb_mysql_result($resultat, 0, 0);
                        $n = $max + 1;
                        $requete = "insert into notices_custom_lists (notices_custom_champ,notices_custom_list_value,notices_custom_list_lib) values({$perso->idchamp},{$n},'" . addslashes($info_900[$i]['a']) . "')";
                        pmb_mysql_query($requete);
                        $value = $n;
                    }
                    $requete = "insert into notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_" . $perso->datatype . ") values({$perso->idchamp},{$notice_id},'" . $value . "')";
                    pmb_mysql_query($requete);
                } else {
                    $requete = "insert into notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_" . $perso->datatype . ") values({$perso->idchamp},{$notice_id},'" . addslashes($info_900[$i]['a']) . "')";
                    pmb_mysql_query($requete);
                }
            }
        }
    }
}