$arr = $dsql->GetOne("SELECT * FROM `zuimoban_sys_enum` WHERE egroup='$egroup' AND evalue>$minid AND evalue<$maxid ORDER BY evalue DESC ");
if(!is_array($arr))
{
$disorder = $evalue = $minid+1;
}
else
{
$disorder = $arr['disorder']+1;
$evalue = $arr['evalue']+1;
}
$father = intval(floor($evalue/500))*500;
$dsql->ExecuteNoneQuery("INSERT INTO `zuimoban_sys_enum`(`ename`,`evalue`,`egroup`,`disorder`,`issign`,`father`)
VALUES('$ename','$evalue','$egroup','$disorder','$issign','$father'); ");
}
WriteEnumsCache($egroup);
ShowMsg("成功添加枚举分类!", $ENV_GOBACK_URL);
exit();
}
}
/*-----------------
修改枚举名称和排序
function __upenum() { }
------------------*/
else if($action=='upenum')
{
$ename = trim(preg_replace("# └─(─){1,}#", '', $ename));
$row = $dsql->GetOne("SELECT egroup FROM `zuimoban_sys_enum` WHERE id = '$aid' ");
WriteEnumsCache($row['egroup']);
$dsql->ExecuteNoneQuery("UPDATE `zuimoban_sys_enum` SET `ename`='$ename',`disorder`='$disorder' WHERE id='$aid'; ");
ShowMsg("成功修改一个枚举!", $ENV_GOBACK_URL);
exit();
}
/*-----------------
更新枚举缓存
function __upallcache() { }
------------------*/
else if($action=='upallcache')
{
if(!isset($egroup)) $egroup = '';
WriteEnumsCache($egroup);
ShowMsg("成更新枚举缓存!", $ENV_GOBACK_URL);
exit();