<?php
require_once(dirname(__FILE__)."/config.php");
require_once(dirname(__FILE__)."/../include/pub_datalist_dm.php");
require_once(dirname(__FILE__)."/../include/inc_functions.php");
$db = new DedeSql(false);
$id = ereg_replace("[^0-9]","",$id);
if($id < 1) {
	ShowMsg("错误,未定义的操作！","-1");
	exit(); 
}
$rs = $db->GetOne("SELECT * FROM #@__store_groups WHERE storeid='$id'");
if(!is_array($rs)){
	ShowMsg("错误,分类已被移除！","-1");
	exit(); 
}
$n     = $rs['nums'];
$tops  = $rs['tops'];
if($tops > 0){
	$store = $rs['storename'];
	$row = $db->GetOne("SELECT * FROM #@__store_groups WHERE storeid='".$tops."'");
	$topstore = $row['storename'];
	$title = $store."-".$topstore;
	$topid = $tops;
	$nextid = $id;
}else{
	$topid = $id;
	$topstore = $rs['storename'];
	$store    = "";
	$title = $rs['storename'];
}

$sql = "SELECT * FROM #@__groups WHERE (storeid='$id' OR rootstoreid='$id') AND ishidden=0 ORDER BY isindex DESC,stime DESC";
$dlist = new DataList();
$dlist->pageSize = 20;
$a = $dlist->nowPage;
$dlist->SetParameter("id",$id);
$dlist->SetSource($sql);
include(dirname(__FILE__)."/templets/store.htm");
$dlist->Close();
$db->Close();
?>