<!--#include file="Access.asp"  -->
<!-- #include file="inc/functions.asp" -->
<!-- #include file="x_to_html/index_to_html.asp" -->
<%act=Request("act")
If act="save" Then 
models_type=trim(request.form("models_type"))
models_type_en=trim(request.form("models_type_en"))
models_memo=trim(request.form("models_memo"))
models_content=trim(request.form("models_content"))
models_time=now()
set rs1=server.createobject("adodb.recordset")
sql="select type_en from web_models where type_en='"&models_type_en&"'"
rs1.open sql ,cn,1,1
if not rs1.eof and not rs1.bof then
		response.write"<SCRIPT language=JavaScript>alert('该引用字符已经存在，请重新设定^_^');"
  response.write"javascript:history.go(-1)</SCRIPT>"
else
rs1.close
set rs1=nothing

set rs=server.createobject("adodb.recordset")
sql="select * from web_models"
rs.open(sql),cn,1,3
rs.addnew
rs("type")=models_type
rs("type_en")=models_type_en
rs("memo")=models_memo
rs("content")=models_content
rs("time")=models_time
rs.update
rs.close
set rs=nothing
response.Write "<script language='javascript'>alert('添加成功！');location.href='web_models.asp';</script>"

end if
end if %>
	<%
Call header()

%>

  <form id="form1" name="form1" method="post" action="?act=save">
         <script language='javascript'>
function checksignup1() {
if ( document.form1.models_type.value == '' ) {
window.alert('请输入网站模板名称^_^');
document.form1.models_type.focus();
return false;}

if ( document.form1.models_type_en.value == '' ) {
window.alert('请输入模板引用字符^_^');
document.form1.models_type_en.focus();
return false;}

if ( document.form1.models_content.value == '' ) {
window.alert('请输入模板内容^_^');
document.form1.models_content.focus();
return false;}
return true;}
</script>
	<table cellpadding='3' cellspacing='1' border='0' class='tableBorder' align=center>
	<tr>
	  <th class='tableHeaderText' colspan=2 height=25>添加新的栏目</th>
	<tr>
	<td width="15%" height=23 class='forumRow'>栏目名称 (必填) </td>
	<td width="85%" class='forumRow'><input name='models_type' type='text' id='models_type' size='30'>
	  &nbsp;</td>
	</tr>
	<tr>
	<td class='forumRowHighLight' height=23>标签字符 (必填)</td>
<td class='forumRowHighLight'><input type='text' id='models_type_en' name='models_type_en' size='30'>
  &nbsp;仅做程序引用使用，添加后将不可修改，请使用英文字符，请勿与现有字符重复</td>
	</tr><tr>
	  <td class='forumRow' height=11>栏目关键字</td>
	  <td class='forumRow'><textarea name='models_memo'  cols="100" rows="3" id="models_memo" ></textarea></td>
	</tr>
	<tr>
	  <td class='forumRow' height=23>栏目内容 (必填)</td>
	  <td class='forumRow'> <textarea name='models_content'   cols="100" rows="80" id="models_content"  ></textarea>
 </td>
	</tr>
	<tr><td height="50" colspan=2  class='forumRow'><div align="center">
	  <INPUT type=submit value='提交' onClick='javascript:return checksignup1()' name=Submit>
	  </div></td></tr>
	</table>
</form>

<%
Call DbconnEnd()
 %>