getRow("select * from pre_anounce where id='$id' limit 1");
if(!$rows)
showmsg('当前公告不存在!',3);
?>
exec("INSERT INTO `pre_anounce` (`content`, `color`, `sort`, `addtime`, `status`) VALUES ('{$content}', '{$color}', '{$sort}', '{$date}', 1)");
if($sds){
showmsg('添加公告成功!
>>返回公告列表',1);
}else
showmsg('添加公告失败!
错误信息:'.$DB->error(),4);
}
}
elseif($my=='edit_submit'){
$id=intval($_GET['id']);
$rows=$DB->getRow("select * from pre_anounce where id='$id' limit 1");
if(!$rows)
showmsg('当前公告不存在!',3);
$content=$_POST['content'];
$sort=intval($_POST['sort']);
$color=trim($_POST['color']);
if(!$content || !$sort){
showmsg('公告内容不能为空',3);
} else {
$sds=$DB->exec("UPDATE `pre_anounce` SET `content`='$content',`sort`='$sort',`color`='$color' WHERE `id`='$id'");
if($sds!==false){
showmsg('修改公告成功!
>>返回公告列表',1);
}else
showmsg('修改公告失败!
错误信息:'.$DB->error(),4);
}
}else{
$list = $DB->getAll("SELECT * FROM pre_anounce ORDER BY sort ASC");
?>