"localhost", MYSQL_USER => "asiadrag_blue", MYSQL_PASSWORD => "2yj^G68,2iS^", MYSQL_DB => "asiadrag_blue", DB_TYPE => "MySQL" ); define("_SESSION_PORTAL_NAME","BO"); define("_SESSION_USER_NAME","puser"); define("_SESSION_ADM_NAME","padm"); define("_DB_PREFIX","bo"); define("_WEBMASTER_MAIL","info@blue-ocean.com.vn"); $num_of_page = 18; $RowsEachPageArray = array(10,25,50,75,100); $ReferersArray = array(100,250,500,1000,2000); ?>number = $number; $this->displayperpage = $page_size; $this->pageperstage = $stage_size; $this->cssclass = $cssclass; $this->url = $url; $this->nexttext = $nexttext; $this->previoustext = $previoustext; $this->p_title = $p_title; $this->p_firsttitle = $p_firsttitle; $this->p_lasttitle = $p_lasttitle; $this->p_nexttitle = $p_nexttitle; $this->p_previoustitle = $p_previoustitle; $this->s_nexttitle = $s_nexttitle; $this->s_previoustitle = $s_previoustitle; } function page_caculate($startpage, $nowstage, $nowpage) { $this->allpage = ceil($this->number/$this->displayperpage); $this->allstage = ceil($this->allpage/$this->pageperstage); if (trim($startpage) == "") { $this->startpage = 1; } else { $this->startpage = $startpage; } if (trim($nowstage) == "") { $this->nowstage = 1; } else { $this->nowstage = $nowstage; } if (trim($nowpage) == "") { $this->nowpage = $this->startpage; } else { $this->nowpage = $nowpage; } } function page_link() { $links = ""; if (trim($this->nowpage) > 1) { $links.=" <<< \n"; } if (trim($this->nowstage) > 1) { $links.=" << \n"; } for ($i=$this->startpage; $i<=$this->allpage; $i++) { if (trim($this->nowpage) == "") { $this->nowpage = $this->startpage; } $endpage = (($this->startpage + $this->pageperstage)-1); if ($i >= $this->startpage && $i <= $endpage && $i <= $this->allpage) { if ($this->nowpage != ((($this->nowstage-1)*$this->pageperstage)+$i) && $i == $this->startpage && $this->nowpage > $this->startpage) { $links = $links." ".$this->previoustext." \n"; } if (((($this->nowstage-1)*$this->pageperstage)+$i) == $this->nowpage && ((($this->nowstage-1)*$this->pageperstage)+$i) <= $this->allpage) { $links=$links." [".((($this->nowstage-1)*$this->pageperstage)+$i)."] "; } if (((($this->nowstage-1)*$this->pageperstage)+$i) != $this->nowpage && ((($this->nowstage-1)*$this->pageperstage)+$i) <= $this->allpage) { $links=$links." ".((($this->nowstage-1)*$this->pageperstage)+$i)." \n"; } if (($i==$endpage || $i==$this->allpage) && $this->nowpage != ((($this->nowstage-1)*$this->pageperstage)+$i) && $this->allpage > $this->nowpage) { $links=$links."  ".$this->nexttext." \n"; } } } if ($this->nowstage < $this->allstage) { $links=$links." >> \n"; } if ($this->nowpage < $this->allpage) { $links.=" >>> \n"; } return $links; } } ?>