0) ? ($page-floor($disp/2)) : 1;
//終点
$end = ($start> 1) ? ($page+floor($disp/2)) : $disp;
//始点再計算
//$start = ($limit <$end)? $start-($end-$limit) : $start;
if($page != 1 ) {
echo "
« Back | ";
}else{
echo "Back | ";
}
//ページリンク表示ループ
echo "";
for($i=$start; $i < $end ; $i++){
//1以上最大ページ数以下の場合
if($i <= $limit && $i> 0 ){
if($page == $i){
//ページ番号リンク表示
echo " ".$i." ";
}else{
//ページ番号リンク表示
echo " ".$i." ";
}
}
}
echo " | ";
if($page <$limit){
echo "Next » | ";
}else{
echo "Next | ";
}
}
$listnum = 10;
$offset = 0;
//ページ番号
$page = empty($_GET["page"])? 1:$_GET["page"];
//データベース検索数
$offset = empty($_GET["page"])? 0:($_GET["page"]-1)*$listnum;
$disp=10;
$_GET['category']=isset($_GET['category'])? $_GET['category']:'';
if($_GET['category']==1){
$category = "&category=".$_GET['category'];
$Search = " AND terms = '{\"19\":\"tools\"}' ";
}else if($_GET['category']==2){
$category = "&category=".$_GET['category'];
$Search = " AND terms = '{\"20\":\"nctools\"}' ";
}else if($_GET['category']==3){
$category = "&category=".$_GET['category'];
$Search = " AND terms = '{\"21\":\"metal\"}' ";
}else if($_GET['category']==4){
$category = "&category=".$_GET['category'];
$Search = " AND terms = '{\"22\":\"construction\"}' ";
}else if($_GET['category']==5){
$category = "&category=".$_GET['category'];
$Search = " AND terms = '{\"13\":\"others\"}' ";
}else{
$category = "";
$Search = "";
}
$row = $class->ColumnObj("id,slug,title_eng,image1,image2,image3,image4,pro_eng,brand_eng,tp_eng,year,body_eng" , "nodes" ,"AND type ='product' $Search order by `created` DESC limit $listnum offset $offset");
$productCnt = count($row );
$row1 =$class ->selectObj("nodes" ," AND type ='product' $Search");
$all = count($row1);
//TOTAL-PAGE数
if( $all% $listnum == 0 ){
$limit = $all/ $listnum;
}else{
$limit = $all/ $listnum + 1 ;
$limit = floor($limit);
}
if($page!="" and $page !=1){
$pg = "&page=".$page;
}else{
$pg = "";
}
?>
スケール機械の輸入・販売及び中古工作機械、板金機械、建設機械の輸出は『栄華商事株式会社』にお任せ下さい。
Photos |
Machine |
Manufacturer |
Model |
Year |
Specifications |
id;
$product_slug = $row[$i]->slug;
$product_title = mb_strimwidth($row[$i]->title_eng, 0, 46, "...",'utf8');
$image1 = $row[$i]->image1;
$image2 = $row[$i]->image2;
$image3 = $row[$i]->image3;
$image4 = $row[$i]->image4;
if($image1 !=""){
$product_img = $img_path.$image1;
}else if($image2 !=""){
$product_img = $img_path.$image2;
}else if($image3 !=""){
$product_img = $img_path.$image3;
}else if($image4 !=""){
$product_img = $img_path.$image4;
}else{
$product_img = $noimg_pathS;
}
$product_name = $row[$i]->pro_eng;
$product_name = mb_strimwidth($product_name, 0, 37, "...",'utf8');
$product_name = "".$product_name."
";
$product_maker = $row[$i]->brand_eng;
$product_maker = mb_strimwidth($product_maker, 0, 29, "...",'utf8');
$product_maker = "".$product_maker."
";
$product_type = $row[$i]->tp_eng;
$product_type = mb_strimwidth($product_type, 0, 33, "...",'utf8');
$product_type = "".$product_type."
";
$product_year = $row[$i]->year;
$product_body = $row[$i]->body_eng;
$product_body = strip_tags($row[$i]->body_eng,'');
$product_body = mb_strimwidth($product_body, 0, 162, "...",'utf8');
$product_body = "".$product_body."
";
?>
在庫番号:
|
|
|
|
|
|
|
Total,Page