public function get_explnums($tri) { $this->explnums = array(); $this->get_result(); //$table = $this->_get_pert(); $this->_get_pert(); //liste complete des résultats..; if ($this->objects_ids != "") { $sort = new sort("notices", "session"); $query = $sort->appliquer_tri_from_tmp_table($tri, $this->table_tempo, "notice_id", 0, 0); $explnum_noti = "select explnum_id," . $sort->table_tri_tempo . ".* from explnum join " . $sort->table_tri_tempo . " on explnum_notice!=0 and explnum_notice = " . $sort->table_tri_tempo . ".notice_id "; $rqt = "create temporary table explnum_list {$explnum_noti}"; pmb_mysql_query($rqt); $explnum_issue = "select explnum_id," . $sort->table_tri_tempo . ".* from explnum join bulletins on explnum_bulletin!=0 and bulletin_id = explnum_bulletin join " . $sort->table_tri_tempo . " on num_notice != 0 and num_notice = " . $sort->table_tri_tempo . ".notice_id "; $rqt = "insert ignore into explnum_list {$explnum_issue}"; pmb_mysql_query($rqt); pmb_mysql_query("alter table explnum_list order by " . $sort->get_order_by($tri)); $rqt = "select explnum_id from explnum_list order by " . $sort->get_order_by($tri); $res = pmb_mysql_query($rqt); //si get_order_by renvoit une valeur nulle, on ne s'occupe pas du tri. if (!$res) { $rqt = "select explnum_id from explnum_list"; $res = pmb_mysql_query($rqt); } if ($res) { if (pmb_mysql_num_rows($res)) { while ($row = pmb_mysql_fetch_object($res)) { $this->explnums[] = $row->explnum_id; } } } } return $this->explnums; }
public function get_explnums($tri) { global $gestion_acces_active; global $gestion_acces_empr_notice; $this->explnums = array(); $this->get_result(); //$table = $this->_get_pert(); $this->_get_pert(); //liste complete des résultats..; if ($this->notices_ids != "") { $sort = new sort("notices", "session"); //$query = $sort->appliquer_tri_from_tmp_table($tri,$table,"notice_id",0,0); $query = $sort->appliquer_tri_from_tmp_table($tri, $this->table_tempo, "notice_id", 0, 0); //vérification de la visibilité des documents numériques $acces_j = ''; if ($gestion_acces_active == 1 && $gestion_acces_empr_notice == 1) { $ac = new acces(); $dom_2 = $ac->setDomain(2); $join = $dom_2->getJoin($_SESSION['id_empr_session'], 16, 'notice_id'); } if (!$join) { $join = "join notices on " . $sort->table_tri_tempo . ".notice_id = notices.notice_id join notice_statut on notices.statut=id_notice_statut and ((explnum_visible_opac=1 and explnum_visible_opac_abon=0)" . ($_SESSION["user_code"] ? " or (explnum_visible_opac_abon=1 and explnum_visible_opac=1)" : "") . ")"; } $explnum_noti = "select explnum_id," . $sort->table_tri_tempo . ".* from explnum join " . $sort->table_tri_tempo . " on explnum_notice!=0 and explnum_notice = " . $sort->table_tri_tempo . ".notice_id {$join}"; $rqt = "create temporary table explnum_list {$explnum_noti}"; mysql_query($rqt); $explnum_issue = "select explnum_id," . $sort->table_tri_tempo . ".* from explnum join bulletins on explnum_bulletin!=0 and bulletin_id = explnum_bulletin join " . $sort->table_tri_tempo . " on num_notice != 0 and num_notice = " . $sort->table_tri_tempo . ".notice_id {$join}"; $rqt = "insert ignore into explnum_list {$explnum_issue}"; mysql_query($rqt); mysql_query("alter table explnum_list order by " . $sort->get_order_by($tri)); $rqt = "select explnum_id from explnum_list order by " . $sort->get_order_by($tri); $res = mysql_query($rqt); //si get_order_by renvoit une valeur nulle, on ne s'occupe pas du tri. if (!$res) { $rqt = "select explnum_id from explnum_list"; $res = mysql_query($rqt); } if ($res) { if (mysql_num_rows($res)) { while ($row = mysql_fetch_object($res)) { $this->explnums[] = $row->explnum_id; } } } } return $this->explnums; }