<!--#include file="conn.asp"-->
<%
	
'检查用户访问的权限
call checkuser(5)

strID=request.QueryString("id")

strT_code=GetFormVariable("t_code")
strLamu=GetFormVariable("selLanmu")
strIndex=GetFormVariable("txtIndex")
strText=GetFormVariable("txtName")
strTarget=GetFormVariable("txtHref")
strHref=GetFormVariable("selTarget")
strClass=GetFormVariable("selClass")
strEnable=GetFormVariable("chkEnable")
strContent=GetFormVariable("content")
if strEnable="" then strEnable="0"


if strID="" then
	'添加模板
	strSQL="Insert Into Templet_Menu(t_code,l_code,tm_index,tm_text,tm_href,tm_target,tm_class,tm_enable,tm_content) Values("
	strSQL=strSQL & "'" & strT_code & "',"
	strSQL=strSQL & "'" & strLamu & "',"
	strSQL=strSQL & "" & strIndex & ","
	strSQL=strSQL & "'" & strText & "',"
	strSQL=strSQL & "'" & strTarget & "',"
	strSQL=strSQL & "'" & strHref & "',"
	strSQL=strSQL & "'" & strClass & "',"
	strSQL=strSQL & "" & strEnable & ","
	strSQL=strSQL & "'" & strContent & "')"

else
	strID=Cint(strID)
	strSQL="Update Templet_Menu Set "
	strSQL=strSQL & "l_code='" & strLamu & "',"
	strSQL=strSQL & "tm_index=" & strIndex & ","
	strSQL=strSQL & "tm_text='" & strText & "',"
	strSQL=strSQL & "tm_href='" & strTarget & "',"
	strSQL=strSQL & "tm_target='" & strHref & "',"
	strSQL=strSQL & "tm_class='" & strClass & "',"
	strSQL=strSQL & "tm_enable=" & strEnable & ","
	strSQL=strSQL & "tm_content='" & strContent & "' Where id=" & strID
end if
'response.Write(strSQL)
conn.execute strSQL,0,1

response.Redirect("Admin_TempMenu.asp?t=" & strT_code & "&name=") 

%>
