<!--#include file="inc/conn.asp"-->
<!--#include file="inc/fun.asp"-->
<%
if not ChkPost() then ShowMsg "不要尝试入侵!","javascript:history.back()"
server.ScriptTimeout=99999
id=myFilter(Request("tid"))
webname=myFilter(request.Form("WebName"))
if len(webname)=0 or len(webname)>50 then ShowMsg "网站名称不能为空且长度不能超过50个字符!",""
language=request.Form("language")
userid=Request.Form("userid")
session("username")=userid
session.timeout=2*60
sql="select * from LanMu where lmName<>'首页' order by id"
rs.open sql,conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body leftmargin="0" topmargin="0">
<div align="left">
<table width="100%">
<tr>
<td bgcolor="#59ACFF">自助建站第三步--请选择网站栏目</td>
</tr>
</table>
</div>
<hr>
<div align="center">
<form name="form1" method="post" action="?act=ok">
<table width="580" cellspacing="1" bgcolor="#FFFFFF">
<tr bgcolor="#59ACFF">
<td width="82"><input type="checkbox" name="chkall" value="on" οnclick="var num=form1.checknum.value;for(var i=0;i<num;i++){window.execScript('document.form1.lm'+i+'.checked='+this.checked +';document.form1.bnav'+i+'.disabled='+!(this.checked)+';');}" title="全选">全选</td>
<td width="246">栏目名称</td>
<td width="108">栏目位置</td>
<td width="129">设置下导航</td>
</tr>
<%
if not rs.eof then
m=0
do while not rs.eof
lmCount=rs.recordCount
%>
<tr bgcolor="#C8E3FF">
<td>
<input name="lm<%=m%>" type="checkbox" value="true" onClick="var num=form1.checknum.value;for(var i=0;i<num;i++){window.execScript('if(document.form1.lm'+i+'.checked==true){document.form1.bnav'+i+'.disabled=false;}else{document.form1.bnav'+i+'.disabled=true;}');}"></td>
<td>
<input type="text" name="name<%=m%>" value="<%=rs("LMName")%>">
<input type="hidden" name="egname<%=m%>" value="<%=rs("LMNameEG")%>">
<input type="hidden" name="ftname<%=m%>" value="<%=rs("LMNameFT")%>">
</td>
<td>
<select name="pos<%=m%>">
<%
for i=1 to rs.recordCount
Response.write "<option>"&i&"</option>"
next
%>
</select>
<input type="hidden" name="dName<%=m%>" value="<%=rs("lmName")%>">
</td>
<td><input name="bnav<%=m%>" type="checkbox" value="true" disabled="true"></td>
</tr>
<%
m=m+1
rs.moveNext
loop
'rs.close
end if
%>
</table>
<p>
<input type="submit" name="Submit3" value="下一步">
<input type="hidden" name="tid" value="<%=id%>">
<input type="hidden" name="lmCount" value="<%=lmCount%>">
<input type="hidden" name="lg" value="<%=language%>">
<input type="hidden" name="WebName" value="<%=webname%>">
<input type="hidden" name="userid" value="<%=userid%>">
<input type="hidden" name="checknum" value="<%=rs.recordcount%>">
</p>
</form>
</div>
<%=rs.close%>
</body>
</html>
<%
if Request("act")="ok" then
userid=trim(Request.Form("userid"))
'checkall=trim(request("IsAll"))
'response.write checkall
'response.End()
showcover="false"
webname=request.Form("WebName")
webname=webname & "|目前还没有标题|目前还没有标题"
session("language")=request.Form("lg")
if request.Form("lg")="cn" then
TLanguage="cn|ft|en"
elseif request.Form("lg")="ft" then
TLanguage="ft|cn|en"
elseif request.Form("lg")="en" then
TLanguage="en|cn|ft"
end if
sql="select tid from userinfo where userid='"&userid&"'"
rs.open sql,conn,1,1
if not rs.eof then
conn.execute("delete from userinfo where userid='"&userid&"'")
conn.execute("delete from userLM where userid='"&userid&"'")
end if
rs.close
lmcount=Request.Form("lmCount")
tid=Request.Form("tid")
lmNum=0
sql="select id from userLM where userid='"&userid&"' and lmName='首页'"
rs.open sql,conn,1,1
if rs.eof then
set rs1=server.createObject("adodb.recordSet")
sql="select LMNameEG,LMNameFT from LanMu where LMName='首页'"
rs1.open sql,conn,1,1
lmnameeg=rs1("LMNameEG")
lmnameft=rs1("LMNameFT")
rs1.close
sql="select ymName,ymType,Content,ContentEG,ContentFT from tlanmu where tid="&tid&" and tlmName='首页'"
rs1.open sql,conn,1,1
if not rs1.eof then
ymName2=rs1("ymName")
ymType2=rs1("ymType")
lmContent=rs1("content")
lmContentEG=rs1("ContentEG")
lmContentFT=rs1("ContentFT")
sql="insert into userLM (userid,TID,lmName,lmnameeg,lmnameft,dlmName,ymName,lmContent,LMContentEG,LMContentFT,ymType,lmPos,bnav) values ('"&userid&"',"&tid&",'首页','"&lmnameeg&"','"&lmnameft&"','首页','"&ymName2&"','"&lmContent&"','"&lmContentEG&"','"&lmContentFT&"','"&ymType2&"',0,'false')"
conn.execute(sql)
else
showMsg "系统出错!","err.htm?kind=1"
end if
rs1.close
set rs1=nothing
end if
rs.close
for i=0 to lmcount
if Request("lm"&i)="true" and request("bnav"&i)="true" then
name2=myFilter(trim(Request.Form("name"&i)))
egname=trim(request("egname"&i))
ftname=trim(request("ftname"&i))
pos2=Request("pos"&i)
bnav=request("bnav"&i)
dName2=Request("dName"&i)
sql="select ymName,ymType,content,contenteg,contentft from tlanmu where tid="&tid&"and tlmName='"&dName2&"'"
rs.open sql,conn,1,1
if not rs.eof then
ymName=rs("ymName")
ymType=rs("ymType")
content=rs("content")
contenteg=rs("contenteg")
'contentft=rs("contentft")
sql="insert into userLM (userid,TID,lmName,lmnameeg,lmnameft,dlmName,ymName,lmContent,LMContentEG,LMContentFT,ymType,lmPos,bnav) values ('"&userid&"',"&tid&",'"&name2&"','"&egname&"','"&ftname&"','"&dName2&"','"&ymName&"','"&content&"','"&contenteg&"','"&contentft&"','"&ymType&"',"&pos2&",'"&bnav&"')"
conn.execute(sql)
else
showMsg "系统出错!","err.htm?kind=2"
end if
lmNum=lmNum+1
rs.close
elseif request("lm"&i)="true" then
name2=myFilter(trim(Request("name"&i)))
egname=trim(request("egname"&i))
ftname=trim(request("ftname"&i))
pos2=Request("pos"&i)
bnav="false"
dName2=Request("dName"&i)
sql="select ymName,ymType,content,contenteg,contentft from tlanmu where tid="&tid&"and tlmName='"&dName2&"'"
rs.open sql,conn,1,1
if not rs.eof then
ymName=rs("ymName")
ymType=rs("ymType")
content=rs("content")
contenteg=rs("contenteg")
contentft=rs("contentft")
sql="insert into userLM (userid,TID,lmName,lmnameeg,lmnameft,dlmName,ymName,lmContent,LMContentEG,LMContentFT,ymType,lmPos,bnav) values ('"&userid&"',"&tid&",'"&name2&"','"&egname&"','"&ftname&"','"&dName2&"','"&ymName&"','"&content&"','"&contenteg&"','"&contentft&"','"&ymType&"',"&pos2&",'"&bnav&"')"
conn.execute(sql)
else
showMsg "系统出错!","err.htm?kind=2"
end if
lmNum=lmNum+1
rs.close
end if
next
if lmNum=0 then
showMsg "请选择栏目!","javascript:history.back()"
else
sql="select THead,THeadEG,THeadFT,TBottom,TBottomEG,TBottomFT from template where id="&tid
rs.open sql,conn,1,1
thead=rs("thead")
theadeg=rs("theadeg")
theadft=rs("theadft")
tbottom=rs("tbottom")
tbottomeg=rs("tbottomeg")
tbottomft=rs("tbottomft")
rs.close
sql="insert into userinfo (userid,tid,THead,THeadEG,THeadFT,TBottom,TBottomEG,TBottomFT,TLanguage,UWeb_Title,userCover) values ('"&userid&"',"&tid&",'"&thead&"','"&theadeg&"','"&theadft&"','"&tbottom&"','"&tbottomeg&"','"&tbottomft&"','"&TLanguage&"','"&webname&"','"&showcover&"')"
conn.execute(sql)
call closeConn
Response.redirect("select3.asp?userid="&userid&"&lmcount="&lmNum)
end if
end if
%>