<!--#include file="../main.asp" -->
<!--#include file="../IsLogin.asp" -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML 
xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>管理中心-这里是所有管理的入口</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK 
href="images/global.css" type=text/css rel=stylesheet><LINK 
href="images/main.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.3790.218" name=GENERATOR>
<script language="javascript">
function Del(id){
if ( confirm("你确定要删除吗？")) {
window.location.href = "boke_sort_del.asp?id="+id
}
}
</script>
<script language="javascript">
<!--
function CheckData()
{
  if (document.addform.bokesort.value=="")
  {
    alert("对不起，大类不能为空！");
	document.addform.bokesort.focus();
	return false;
   }
  if (document.addform.bsort.value=="")
  {
    alert("对不起，类别不能为空！");
	document.addform.bsort.focus();
	return false;
   }

}

//-->
</script></HEAD>
<BODY id=main background="../images/bj.gif">
<%
dim m_UserID
m_UserID = Request.Cookies("aspxnet")("CurUserID")

if request("action")="save" then
bokesort=trim(request("bokesort"))
set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from boke_sort where user_id="&m_UserID
rs.open sql,conn,1,3
rs.addnew
rs("bokesort")=bokesort
rs("user_id")=m_UserID
rs.update
rs.close
set rs=nothing
response.redirect"boke_sort.asp"

'==============================================
elseif request("action")="edit" then

bokesort=trim(request("bokesort"))
if bokesort="" then
errstyle="·对不起，分类不能为空"
scripterr
end if
set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from boke_sort where id="&request("id")&" and user_id="&m_UserID
rs.open sql,conn,1,3

rs("bokesort")=bokesort
rs.update
rs.close
set rs=nothing
response.redirect"boke_sort.asp"

elseif request("action")="px" then
set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from boke_sort where id="&request("id")&" and user_id="&m_UserID
rs.open sql,conn,1,3
rs("date")=now()
rs.update
rs.close
set rs=nothing
response.redirect"boke_sort.asp"

end if
%>
<DIV id=wrapper>
<!--#include file="top.asp"-->
<DIV class=row>
<!--#include file="left.asp"-->
<DIV class=right_side>
<DIV class=col id=bulletin>
<DIV class=col_head>
<H3><IMG height=16 alt=a hspace=3 src="images/ico_dots.gif" 
width=20 align=left vspace=3>博客管理</H3>
<SPAN class=float_right><STRONG><a href="boke_add.asp">添加博客</a></STRONG></SPAN><SPAN class=float_right>------</SPAN>
<SPAN class=float_right><STRONG><a href="rj_diarylist.asp">管理博客</a></STRONG></SPAN><SPAN class=float_right>------</SPAN>
<SPAN class=float_right><STRONG><a href="boke_sort.asp">博客类别</a></STRONG></SPAN>
</DIV>
<DIV class=col_body><P><form name="addform" method="post" action="boke_sort.asp?action=save" onSubmit="return CheckData()">
<DIV class="col promo" id=member_match><DIV class=col_head>
<H3><IMG height=16 alt=a hspace=3 src="images/ico_dots.gif" 
width=20 align=left vspace=3>分类名称</H3><input name="bokesort" type="text" id="bokesort" size="25" maxlength="20">
<input type="submit" name="Submit" value="添 加" class="input1"></DIV></DIV></form></P>
</DIV></DIV>
</DIV><DIV class=right_side>
<DIV class=col id=bulletin>
<DIV class=col_head>
<H3><IMG height=16 alt=a hspace=3 src="images/ico_dots.gif" 
width=20 align=left vspace=3>管理博客分类</H3>
</DIV>
<DIV class=col_body><P><%set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from boke_sort where user_id="&m_UserID&" order by date desc"
rs.open sql,conn,1,1
if rs.eof then
response.write"<tr align=center><td height=30>暂无分类</td></tr>"
else
do while not rs.eof%>
<form name="addform1" method="post" action="boke_sort.asp?action=edit">
<input name="id" type="hidden" value="<%=rs("id")%>"><DIV class="col promo" id=member_match><DIV class=col_head>
<IMG height=16 alt=a hspace=3 src="images/ico_dots.gif" 
width=20 align=left vspace=3><input name="bokesort" type="text" id="bokesort" value="<%=rs("bokesort")%>" size="25" maxlength="20"><input type="submit" name="Submit" value="修 改" class="input1">
                            　
                          <span class="STYLE2"><a href=boke_sort.asp?id=<%=rs("id")%>&action=px>排序</a>　<a href=javascript:Del(<%=rs("id")%>)>删除</a></span></DIV></DIV></form>
</form>
 <%rs.movenext
loop
end if
rs.close
set rs=nothing%></P>
</DIV></DIV>
</DIV>
</DIV>
<!--#include file="bottom.asp"-->

</DIV></BODY></HTML>
