= $total_page) $end_page = $total_page;
if ($start_page > 1)
$str .= "...";
if ($total_page > 1)
for ($k=$start_page;$k<=$end_page;$k++)
$str .= "$k";
if ($total_page > $end_page)
$str .= "...";
return $str;
}
include_once('./_common.php');
// 페이지당 행수
$page_rows = 500;
$sql = " select count(*) as cnt from {$g4['shop_item_table']} where it_use = '1' ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
?>
샵바인더 엔진페이지
| 번호 |
분류1 |
분류2 |
분류3 |
분류4 |
제조회사 |
상품명 |
상품코드 |
가격 |
이벤트 |
이미지URL |
배송료 |
할인쿠폰 |
제조년월 |
// 전체 페이지 계산
$total_page = ceil($total_count / $page_rows);
// 페이지가 없으면 첫 페이지 (1 페이지)
if ($page == "") $page = 1;
// 시작 레코드 구함
$from_record = ($page - 1) * $page_rows;
$sql = " select * from {$g4['shop_item_table']} where it_use = '1' order by ca_id limit $from_record, $page_rows ";
$result = sql_query($sql);
for ($i=0; $row=mysql_fetch_array($result); $i++)
{
$row2 = sql_fetch(" select ca_name from {$g4['shop_category_table']} where ca_id = '".substr($row['ca_id'],0,2)."' ");
if (strlen($row['ca_id']) >= 4)
$row3 = sql_fetch(" select ca_name from {$g4['shop_category_table']} where ca_id = '".substr($row['ca_id'],0,4)."' ");
else
$row3['ca_name'] = " ";
if (strlen($row['ca_id']) >= 6)
$row4 = sql_fetch(" select ca_name from {$g4['shop_category_table']} where ca_id = '".substr($row['ca_id'],0,6)."' ");
else
$row4['ca_name'] = " ";
if (strlen($row['ca_id']) >= 8)
$row5 = sql_fetch(" select ca_name from {$g4['shop_category_table']} where ca_id = '".substr($row['ca_id'],0,8)."' ");
else
$row5['ca_name'] = " ";
$num = (($page - 1) * $page_rows) + $i + 1;
$delivery = 0; // 배송료
$qty = (int)get_it_stock_qty($row['it_id']);
if ($qty <= 0) $row['it_amount'] = 0;
echo "
| $num |
{$row2['ca_name']} |
{$row3['ca_name']} |
{$row4['ca_name']} |
{$row5['ca_name']} |
{$row['it_maker']} |
{$row['it_name']} |
{$row['it_id']} |
".number_format($row['it_amount'])." |
|
".G4_DATA_URL."/item/{$row['it_id']}_l1 |
$delivery |
|
|
\n";
}
?>
=paging($page_rows, $page, $total_page, "./shopbinder.php?page=");?>