ALL
{php}
if($GLOBALS['lang'] == 'zh'){
$sql = "SELECT cat_id,cat_name,parent_id FROM ".$GLOBALS['eces']->table('category_zh')." WHERE FirmID = '". $GLOBALS['FrimID']."' AND parent_id = '0' ORDER BY `sort_order` ASC ";
}elseif($GLOBALS['lang'] == 'tw'){
$sql = "SELECT cat_id,cat_name,parent_id FROM ".$GLOBALS['eces']->table('category_tw')." WHERE FirmID = '". $GLOBALS['FrimID']."' AND parent_id = '0' ORDER BY `sort_order` ASC ";
}else{
$sql = "SELECT cat_id,cat_name,parent_id FROM ".$GLOBALS['eces']->table('category_en')." WHERE FirmID = '". $GLOBALS['FrimID']."' AND parent_id = '0' ORDER BY `sort_order` ASC ";
}
$RS = $GLOBALS['dbes']->getAll($sql);
$count = 1;
foreach($RS as $v){
if(!empty($_GET['classid'])){
if($_GET['classid'] == $v[cat_id] ){
$classid_arr = ' class="on" ' ;
}else{
$classid_arr = '' ;
}
}
$contenallee .= '
'.$v[cat_name].'
';
}
echo $contenallee;
{/php}
{php}
$size = 12;
$page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 1;
if(!empty($_GET['classid'])){ $where = " AND ClassID = '".$_GET['classid']."' "; $classidsql = "&classid=".$_GET['classid'] ; }
if($GLOBALS['lang'] == 'zh'){
$sql = "SELECT COUNT(*) FROM ".$GLOBALS['eces']->table('firm_products')." WHERE FirmID = '". $GLOBALS['FrimID']."' $where ";
}elseif($GLOBALS['lang'] == 'tw'){
$sql = "SELECT COUNT(*) FROM ".$GLOBALS['eces']->table('firm_products_tw')." WHERE FirmID = '". $GLOBALS['FrimID']."' $where ";
}else{
$sql = "SELECT COUNT(*) FROM ".$GLOBALS['eces']->table('firm_products_en')." WHERE FirmID = '". $GLOBALS['FrimID']."' $where ";
}
$record_count = $GLOBALS['dbes']->getOne($sql);
$start = ($page-1)*$size;
$pages = ceil($record_count/$size);
$pageq = $page-1;
$pagel = $page+1;
if($pageq < '1'){
$pageq = '1';
}
if($pagel>$pages){
$pagel=$pages;
}
$limit = "LIMIT $start,$size ";
for($i=1;$i<=$pages;$i++){
if($i==$page){$selected="selected";}else{$selected="";}
$option .="
";
}
$pagesstr = "
第".$page."页/共".$pages."页 第一页 上一页 下一页 最后页 跳到 页
";
if($GLOBALS['lang'] == 'zh'){
$sql = "SELECT * FROM ".$GLOBALS['eces']->table('firm_products')." WHERE FirmID = '". $GLOBALS['FrimID']."' $where ";
}elseif($GLOBALS['lang'] == 'tw'){
$sql = "SELECT * FROM ".$GLOBALS['eces']->table('firm_products_tw')." WHERE FirmID = '". $GLOBALS['FrimID']."' $where ";
}else{
$sql = "SELECT * FROM ".$GLOBALS['eces']->table('firm_products_en')." WHERE FirmID = '". $GLOBALS['FrimID']."' $where ";
}
$sql .= "ORDER BY `addTime` DESC ".$limit ;
$RS = $GLOBALS['dbes']->getAll($sql);
foreach($RS AS $v){
if(!empty($v[PicPath])){
$picimg = $v[PicPath] ;
}else{
$picimg = $GLOBALS['tpl']['img']."imgjs/erreso.gif";
}
$contenet .= '
- '.$v[Name].'
';
}
echo $contenet;
{/php}
{php}
echo $pagesstr;
{/php}