[$ var $dbh $sth @dat $pagesize $startnum $pageno $total $count $i $] [- $http_headers_out{'Cache-Control'} = "no-cache"; $http_headers_out{'Pragma'} = "no-cache"; #$http_headers_out{'Expires'} = "0"; $dbh = DBI->connect($ENV{_SPECIAL}, $ENV{SESSION_DBI_USERNAME}, $ENV{SESSION_DBI_PASSWORD}) || die "Cannot CONNECT DB"; $pagesize = 20; if($fdat{pageno} eq "" || $fdat{pageno}<1) { $pageno = 1; } else { $pageno = int($fdat{pageno}); } $startnum = ($pageno-1) * $pagesize; $sth = $dbh->prepare("SELECT COUNT(*) FROM matchProduct WHERE time<=NOW() AND approval=1"); $sth->execute; ($count) = $sth->fetchrow_array; $sth->finish; if(int($count/$pagesize)==($count/$pagesize)) { $total = $count/$pagesize; } else { $total = int($count/$pagesize) + 1; } -] 火柴人產品
跳至第 | 頁數: [+ $pageno +] / [+ $total +] [$ if($pageno!=1) $] [$ endif $] [$ if($pageno<$total) $] [$ endif $]
[- $i = 0; $sth = $dbh->prepare("SELECT ID, title, image, url, LEFT(time,10), LEFT(DATE_SUB(NOW(), INTERVAL 1 MONTH),10) FROM matchProduct WHERE approval=1 AND time<=NOW() ORDER BY time DESC, ID DESC LIMIT $startnum, $pagesize"); $sth->execute; -] [$ while(@dat = $sth->fetchrow_array) $] [- $i++ -] [$ if($i%4==0) $] [$ endif $] [$ endwhile $] [- $sth->finish; -]
[+ $dat[1] +]
[$ if($dat[4] ge $dat[5]) $] [$ endif $] [+ $dat[1] +]
[$ if($pageno!=1) $] [$ endif $] [$ if($pageno<$total) $] [$ endif $]

以上產品在突破書廊有售或請瀏覽突破產品網查閱產品資料。

[- $dbh->disconnect; -]