<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!-- #include file="inc/Session.asp" -->
<!-- #include file="inc/checkrole.asp" -->
<!-- #include file="resource_func.asp" -->
<%
dim act,tablename,thisTitle
if not isempty(request("type")) then
	tablename=request("type")
else
	Response.Write("<script>alert(""资源操作类型不能为空""); history.back();</script>")
	Response.End
end if
Select Case LCase(tablename)
			Case "t_author"
				thisTitle="添加作者"
			Case "t_from"
				thisTitle="添加来源"
			Case "t_editor"
				thisTitle="添加编辑"
			Case "t_special"
				thisTitle="添加专题"
			Case "t_2floorlevel"
				thisTitle="添加楼层"
			Case "t_2roomtype"
				thisTitle="添加户型"
			Case "t_2infotype"
				thisTitle="添加信息分类"	
End Select
%>
<HTML>
<HEAD>
<TITLE><%=thisTitle%></TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<style>
body,td,input,textarea {font-size:9pt}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style1 {
	color: #FFFFFF;
	font-weight: bold;
}
</style>
<script type="text/javascript">
function check(obj){
	if(obj.title.value==""){
		alert("名称不能为空!");
		obj.title.focus();
		return false;
	}
	return true;
}
</script>
</HEAD>
<BODY>
<%
'''''''''''''''''''''''''''''''''''''''''''''''
call checkPrevilege(Session("Name"),"p16")
'''''''''''''''''''''''''''''''''''''''''''''''
%>
<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><iframe src="right_top.htm" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" height="30" width="100%"></iframe></td>
  </tr>
</table>
<%
act=request.QueryString("act")
if(act="add") then	
	title=trim(request.Form("title"))	
	'添加到库
	set rs=server.createobject("adodb.recordset")
	sql="select top 1 * from "&tablename&" where title='"&title&"' order by id desc "
	rs.open sql,conn,3,3
	if not rs.eof then
		response.Write("<script>alert(""该标题已存在!"");history.back();</script>")
		response.End()
	else		
		rs.addnew
		rs("title")=title		
		rs.update	
		response.Write("<p align=""center"">添加成功~!</p>")
		response.Write("<br><p align=""center""><a href=""?type="&tablename&""">继续添加</a></p>")
		call GenJs(tablename)
	end if
	rs.close
	set rs=nothing
else
%>
<FORM method="POST" name="form1" action="?act=add&type=<%=tablename%>" style="margin:0 0 0 0;" onSubmit="return check(this)">
  <TABLE width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#666666">
<TR bgcolor="#FF9900">
  <TD height="24" colspan="2"><div align="center" class="style1"><%=thisTitle%></div></TD>
  </TR>
<TR bgcolor="#F5F5F5">
  <TD width="14%"><div align="center">标题：</div></TD>
  <TD width="86%"><input name="title" type="text" id="title" size="30"></TD>
</TR>
<TR bgcolor="#F5F5F5">
	<TD align=right>&nbsp;	  </TD>
    <TD align=right><div align="left"> 
        <input type=submit name=b1 value="提 交">&nbsp;&nbsp;
        <input type=reset name=b2 value="重 填">       
    </div></TD>
</TR>
</TABLE>
</FORM>
<%
end if
%>
</BODY>
</HTML>
<%
call connclose()
%>