id_liste = intval($id_liste); $this->action = $act; $this->fetch_data(); $this->proceed(); } protected function fetch_data() { $this->nom_liste = ''; $this->description=''; $this->public=0; $this->num_owner = 0; $this->readonly=0; $this->notices = array(); $this->notices_create_date = array(); $this->confidential=0; $this->tag=''; $this->allow_add_records=($opac_shared_lists_readonly ? 1 : 0); $this->allow_remove_records=($opac_shared_lists_readonly ? 1 : 0); $this->subscribed = 0; if ($this->id_liste) { $req = "select * from opac_liste_lecture where id_liste='".$this->id_liste."' "; $res = pmb_mysql_query($req); if(pmb_mysql_num_rows($res)){ $liste = pmb_mysql_fetch_object($res); $this->nom_liste = $liste->nom_liste; $this->description=$liste->description; $this->public=$liste->public; $this->num_owner = $liste->num_empr; $this->readonly=$liste->read_only; $this->confidential=$liste->confidential; $this->tag=$liste->tag; $this->allow_add_records=$liste->allow_add_records; $this->allow_remove_records=$liste->allow_remove_records; $this->subscribed = $liste->subscribed; $this->notices = array(); $this->notices_create_date = array(); $query = "select * from opac_liste_lecture_notices where opac_liste_lecture_num=" . $this->id_liste; $result = pmb_mysql_query($query); if (pmb_mysql_num_rows($result)) { while ($row = pmb_mysql_fetch_object($result)) { $this->notices[] = $row->opac_liste_lecture_notice_num; $this->notices_create_date[$row->opac_liste_lecture_notice_num] = $row->opac_liste_lecture_create_date; } } } } } protected function proceed(){ switch($this->action){ case 'fetch_empr': $this->fetch_empr(); break; default: $this->fetch_empr(); break; } } protected function fetch_empr() { $query = "select id_empr, trim(concat(empr_prenom,' ',empr_nom)) as nom, empr_login, empr_mail, nom_liste, confidential from empr, abo_liste_lecture, opac_liste_lecture where abo_liste_lecture.num_empr=empr.id_empr and opac_liste_lecture.id_liste=abo_liste_lecture.num_liste and etat=2 and num_liste='".$this->id_liste."' order by nom"; $result = pmb_mysql_query($query); $this->empr = array(); if(pmb_mysql_num_rows($result)) { while($row = pmb_mysql_fetch_object($result)) { $this->empr[$row->id_empr] = $row; } } } } ?>