empr_id = $empr_id+0; $this->fetch_data(); } protected function fetch_data(){ $this->serialcirc_list = array(); $alone = "select distinct id_serialcirc from serialcirc_diff join serialcirc on num_serialcirc_diff_serialcirc = id_serialcirc where num_serialcirc_diff_empr = ".$this->empr_id; $group = "select distinct id_serialcirc from serialcirc_diff join serialcirc on num_serialcirc_diff_serialcirc = id_serialcirc join serialcirc_group on num_serialcirc_group_diff = id_serialcirc_diff where num_serialcirc_group_empr = ".$this->empr_id; $already_start = "select distinct num_serialcirc_circ_serialcirc as id_serialcirc from serialcirc_circ where num_serialcirc_circ_empr = ".$this->empr_id; $query = $alone." union ".$group." union ".$already_start; $result = mysql_query($query); if(mysql_num_rows($result)){ while($row = mysql_fetch_object($result)){ $this->serialcirc_list[] = $row->id_serialcirc; $diff = new serialcirc_diff($row->id_serialcirc); $this->info[$row->id_serialcirc] = $diff->serial_info; } } } public function get_list(){ global $msg,$charset; global $empr_serialcirc_tmpl,$empr_serialcirc_tmpl_item; $tpl=$empr_serialcirc_tmpl; $items=""; for($i=0; $iserialcirc_list) ; $i++){ $diff_id=$this->serialcirc_list[$i]; $item=$empr_serialcirc_tmpl_item; $css_class = ($i%2 == 0 ? "odd" :"even"); $item = str_replace("!!periodique!!","".htmlentities($this->info[$diff_id]['serial_name'],ENT_QUOTES,$charset)."",$item); $item=str_replace('!!abt!!', "".htmlentities($this->info[$diff_id]['abt_name'],ENT_QUOTES,$charset)."" , $item); $item=str_replace('!!bulletinage_see!!', "".htmlentities($msg['link_notice_to_bulletinage'],ENT_QUOTES,$charset)."" , $item); $items.=$item; } $tpl = str_replace("!!serialcirc_empr_list!!",$items,$tpl); return $tpl; } } // class end