| Current Path : /home/zqegovsj/www/us3web.haibo.com.cn/beiresthetic/ |
| Current File : /home/zqegovsj/www/us3web.haibo.com.cn/beiresthetic/product2.php |
<?php
include("function.php");
$page = !empty($_GET['st']) ? (int)$_GET['st'] : 1;
$limit = 12; // 每页显示的数量
$offset = ($page - 1) * $limit; // 计算偏移量
isset($_GET['st'])?$st=$_GET['st']:$st=1;
$countsubidsql=$db->selectarray( "SELECT id from ".$noe_version."_producttypes where level =".$_GET['sort_id']);
$countsubid=$db->toarray($countsubidsql);
if (!empty($countsubid)){
$r=$db->array_multi2single($countsubid);
if (!is_array($r)) {
$r = is_iterable($r) ? iterator_to_array($r) : array($r);
}
@$r=array_unique($r);
$r = implode(",", $r);
$countsubsubidsql =$db->selectarray( "select id from ".$noe_version."_producttypes where level in (".$_GET['sort_id'].",".$r.")");
$countsubsubid=$db->toarray($countsubsubidsql);
if (!empty($countsubsubid)){
$subr=$db->array_multi2single($countsubsubid);
if (!is_array($subr)) {
$r = is_iterable($subr) ? iterator_to_array($subr) : array($subr);
}
@$subr=array_unique($subr);
$subr = implode(",", $subr);
$sql = "select count(id) from ".$noe_version."_products where producttype_id in (".$_GET['sort_id'].",".$r.",".$subr.") ";
$products =$db->selectarray( "select id,name,sn,picture,name2,price from ".$noe_version."_products where producttype_id in (".$_GET['sort_id'].",".$r.",".$subr.") order by ep_range desc LIMIT ".($st-1)*$limit.','.$limit);
}
else
{
$sql = "select count(id) from ".$noe_version."_products where producttype_id in (".$_GET['sort_id'].",".$r.") ";
$products =$db->selectarray( "select id,name,sn,picture,name2,price from ".$noe_version."_products where producttype_id in (".$_GET['sort_id'].",".$r.") order by ep_range desc LIMIT ".($st-1)*$limit.','.$limit);
}
}
else
{
$sql = "select count(id) from ".$noe_version."_products where producttype_id = ".$_GET['sort_id'];
$products =$db->selectarray( "select id,name,sn,picture,name2,price from ".$noe_version."_products where producttype_id =".$_GET['sort_id']." order by ep_range desc LIMIT ".($st-1)*$limit.','.$limit);
}
$num = $db->selectarray($sql);
$num = $db->toarray($num);
isset($num[0][0])?$pagecount=$num[0][0]:$st=1;
$number=($st-1)*$limit+1;
$number2=($st-1)*$limit+$limit;
$total_pages = ceil($pagecount / $limit);
$tit=$db->selectone("select id,name,level,img,name2,keyword,des from ".$noe_version."_producttypes where id='".$_GET['sort_id']."'");
if($tit[2]==0){
$bb=$db->turn_name($tit[4]).'_supply'.$tit[0].'.html';
$bbb=$tit[1];
$pcateid=$tit[0];
}
else{
$cc=$db->turn_name($tit[4]).'_supply'.$tit[0].'.html';
$ccc=$tit[1];
$uptit=$db->selectone("select id,name,img,name2,level from ".$noe_version."_producttypes where id='".$tit[2]."'");
$bb=$db->turn_name($uptit[3]).'_supply'.$uptit[0].'.html';
$bbb=$uptit[1];
$pcateid=$uptit[0];
if($uptit[4]!=0){
$ptoptybe=$db->selectone("select id,name,img,name2,level from ".$noe_version."_producttypes where id='".$uptit[4]."'");
if(isset($ccc)){$ddd=$ccc;
$dd=$cc;};
if(isset($bbb)){$ccc=$bbb;
$cc=$bb;};
$bb=$db->turn_name($ptoptybe[3]).'_supply'.$ptoptybe[0].'.html';
$bbb=$ptoptybe[1];
}
}
$aa='product.html';
$aaa=$lang['words'][72];
$urlsort=$db->turn_name($tit[4]).'_supply'.$tit[0];
$purl=$db->turn_name($tit[4]).'_supply'.$tit[0].'.html';
$feedbacktit=$tit[1];
$pagekeyword=$tit['1'].', '.$lang['words'][1];
$pagekeyword2=$pagekeyword;
$pagekeyword3=$tit['1'].' '.$lang['words'][159].', '.$lang['words'][194].', '.$lang['words'][193].', '.$lang['words'][191].' '.$tit['1'].' '.$lang['words'][156].', '.$lang['words'][157].', '.$lang['words'][158];
include("head.php");
?><div class="n_main">
<div class="container">
<? include("a_left.php");?>
<div class="n_right">
<div class="products">
<div class="products_m clearfix"></div>
<h1 class="p-b-20 dark-color font-bold">
<? if(isset($ccc))echo $ccc;elseif(isset($bbb))echo $bbb;else{?><?=$lang['words'][94]?><? }?>: <span class="en-3"><?=$lang['words'][93]?> <?=$pagecount?> | <?=$number?> - <?=$number2?></span>
</h1>
<div class="main">
<div id="cbp-vm" class="cbp-vm-switcher cbp-vm-view-grid">
<div class="cbp-vm-options clearfix">
<a href="#" class="cbp-vm-icon cbp-vm-grid cbp-vm-selected" data-view="cbp-vm-view-grid">
<svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 16 16" title="Grid" style="vertical-align:middle"><title>Grid</title><g><path d="M1,3.80447821 L1,1 L3.80447821,1 L3.80447821,3.80447821 L1,3.80447821 Z M6.5977609,3.80447821 L6.5977609,1 L9.4022391,1 L9.4022391,3.80447821 L6.5977609,3.80447821 Z M12.1955218,3.80447821 L12.1955218,1 L15,1 L15,3.80447821 L12.1955218,3.80447821 Z M1,9.4022391 L1,6.59706118 L3.80447821,6.59706118 L3.80447821,9.4022391 L1,9.4022391 Z M6.5977609,9.4022391 L6.5977609,6.5977609 L9.4022391,6.5977609 L9.4022391,9.4022391 L6.5977609,9.4022391 Z M12.1955218,9.4022391 L12.1955218,6.59706118 L15,6.59706118 L15,9.4022391 L12.1955218,9.4022391 Z M1,14.9993003 L1,12.1948221 L3.80447821,12.1948221 L3.80447821,14.9993003 L1,14.9993003 Z M6.5977609,14.9993003 L6.5977609,12.1948221 L9.4022391,12.1948221 L9.4022391,14.9993003 L6.5977609,14.9993003 Z M12.1955218,14.9993003 L12.1955218,12.1948221 L15,12.1948221 L15,14.9993003 L12.1955218,14.9993003 Z"></path></g></svg>
</a>
<a href="#" class="cbp-vm-icon cbp-vm-list " data-view="cbp-vm-view-list">
<svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 16 16" title="List" style="vertical-align:middle"><title>List</title><g><path d="M0,3 L0,1 L2,1 L2,3 L0,3 Z M0,7 L0,5 L2,5 L2,7 L0,7 Z M0,11 L0,9 L2,9 L2,11 L0,11 Z M0,15 L0,13 L2,13 L2,15 L0,15 Z M4,3 L4,1 L16,1 L16,3 L4,3 Z M4,7 L4,5 L16,5 L16,7 L4,7 Z M4,11 L4,9 L16,9 L16,11 L4,11 Z M4,15 L4,13 L16,13 L16,15 L4,15 Z"></path></g></svg>
</a>
</div>
<ul>
<? $i=1; while(@$a=mysqli_fetch_row($products)){
?> <li>
<div class="li">
<div class="cbp-vm-image">
<a href="/<?=$db->turn_name($a[4])?>_product<?=$a[0]?>.html" class="img"><img id="product_detail_img" alt="48V 200Ah Lithium battery" src="https://<?=$imgprod?>/upload/middle/<?=$a[3]?>" /></a>
</div>
<div class="text">
<div class="h4"><a href="/<?=$db->turn_name($a[4])?>_product<?=$a[0]?>.html"><?=$a[1]?></a></div>
<div class="cbp-vm-details"><?=$db->mystrcut(html_entity_decode($a[5]),250)?>...</div>
<a href="/<?=$db->turn_name($a[4])?>_product<?=$a[0]?>.html" class="my_more1">Learn More</a>
</div>
</div>
</li>
<? $i++;?>
<? }?>
</ul>
</div>
<script>
(function() {
var container = document.getElementById( 'cbp-vm' ),
optionSwitch = Array.prototype.slice.call( container.querySelectorAll( 'div.cbp-vm-options > a' ) );
function init() {
optionSwitch.forEach( function( el, i ) {
el.addEventListener( 'click', function( ev ) {
ev.preventDefault();
_switch( this );
}, false );
} );
}
function _switch( opt ) {
optionSwitch.forEach(function(el) {
classie.remove( container, el.getAttribute( 'data-view' ) );
classie.remove( el, 'cbp-vm-selected' );
});
classie.add( container, opt.getAttribute( 'data-view' ) );
classie.add( opt, 'cbp-vm-selected' );
}
init();
})();
( function( window ) {
'use strict';
function classReg( className ) {
return new RegExp("(^|\\s+)" + className + "(\\s+|$)");
}
var hasClass, addClass, removeClass;
if ( 'classList' in document.documentElement ) {
hasClass = function( elem, c ) {
return elem.classList.contains( c );
};
addClass = function( elem, c ) {
elem.classList.add( c );
};
removeClass = function( elem, c ) {
elem.classList.remove( c );
};
}
else {
hasClass = function( elem, c ) {
return classReg( c ).test( elem.className );
};
addClass = function( elem, c ) {
if ( !hasClass( elem, c ) ) {
elem.className = elem.className + ' ' + c;
}
};
removeClass = function( elem, c ) {
elem.className = elem.className.replace( classReg( c ), ' ' );
};
}
function toggleClass( elem, c ) {
var fn = hasClass( elem, c ) ? removeClass : addClass;
fn( elem, c );
}
var classie = {
hasClass: hasClass,
addClass: addClass,
removeClass: removeClass,
toggleClass: toggleClass,
has: hasClass,
add: addClass,
remove: removeClass,
toggle: toggleClass
};
if ( typeof define === 'function' && define.amd ) {
define( classie );
} else {
window.classie = classie;
}
})( window );
</script>
</div>
<? if($pagecount>12){?>
<div class="page_num clearfix">
<? include("page_navigation.php");?>
</div>
<? }?>
</div>
</div>
</div>
</div>
<? include("foot.php");?>