<?
defined('ROOT_PHPLEFT') or exit('phpleft: Not page');
/*
	phpleftDms Copyright (c) 2011 phpleft.COM
	商业授权：QQ45150208
	
*/
$file = "tb_".$menuid.".php";
$pathcache = PL_ROOT.$PL_CFG['cache']."/list/";
if ($tb<>''){
$tab = $tab ? $tab : array();
cache_write($file,  $tab, $pathcache);
echo messages('phpleft.php?file=list&menuid='.$menuid);
}elseif ($post=='del'){
if ($tab=='') {
	msg('请先选择删除的', 'phpleft.php?file=list&menuid='.$menuid,0,1,1,'n');  
}else{
foreach($tab as $id=>$t) { 
	$db->query("DELETE FROM ".$PL_CFG['tb_pre'].modname($menuid)."_".$menuid." WHERE id='".$t."'");
}
msg('删除成功', 'phpleft.php?file=list&menuid='.$menuid);
}
}elseif ($post=='level'){
if ($tab=='') {
	msg('请先选择更新的', 'phpleft.php?file=list&menuid='.$menuid);  
}else{
foreach($tab as $id=>$t) { 
	$db->query("update 	".$PL_CFG['tb_pre'].modname($menuid)."_".$menuid." set level='$level' where id='$t'");
}
msg('设置成功', 'phpleft.php?file=list&menuid='.$menuid);
}	
	
}else{
if ($page=='') $page='1';
$key = cache_read($file,$pathcache);
if ($key=='') $key=array();
$menu = cache_read("moduleid-".$menuid.".php",PL_ROOT.$PL_CFG['cache']."/");
$tabs = cache_read('table_'.$menuid.'.inc.php', PL_ROOT.$PL_CFG['cache']."/");
$tables = "table_".$menuid.".inc.php";
$tablekey = cache_read($tables,PL_ROOT.$PL_CFG['cache']."/");
include FTemplate(ThisFile);
}
?>