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

strID=request.QueryString("id")

if strID="" then
	'添加模板
	strTitle="添加栏目"
else
	strTitle="修改栏目"
	strID=Cint(strID)
	strSQL="Select * from templet_menu Where id=" & strID
	rs.open strSQL,conn,1,1
		strLamu=Trim(rs("l_code"))
		strIndex=Trim(rs("tm_index"))
		strText=Trim(rs("tm_text"))
		strTarget=Trim(rs("tm_target"))
		strHref=Trim(rs("tm_href"))
		strClass=Trim(rs("tm_class"))
		strEnable=Cint(rs("tm_enable"))
		strContent=Trim(rs("tm_content"))
	rs.close
end if

%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>电子商务自助建站--您理想的助手</title>
<link href="common/styleMain.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="common/JS_CheckForm.js"></script>
<script language="JavaScript">
//检查数据有效性
function checkform(theform){
	if(!CheckEmpty(theform.selLanmu, "栏目类型")) return false;
	if(!CheckEmpty(theform.txtIndex, "栏目序号")) return false;
	if(!CheckEmpty(theform.txtName, "栏目名称")) return false;

	//不能大于指定长度
	if(!CheckMaxLength(theform.txtName, 50, "栏目名称")) return false;
	
}

function setAttrib(objItem){
	//document.HtmlEditForm.txtName.value=objItem.sText;
	//document.HtmlEditForm.txtHref.value=objItem.sHref;
	//SelectValue(document.HtmlEditForm.selClass,objItem.sClass);
	//SelectValue(document.HtmlEditForm.selTarget,objItem.sTarget);
	
}

function init(){
	SelectValue(HtmlEditForm.selLanmu,"<%=strLamu%>");
	SelectValue(HtmlEditForm.selClass,"<%=strClass%>");
	SelectValue(HtmlEditForm.selTarget,"<%=strTarget%>");
	CheckValue(HtmlEditForm.chkEnable,"<%=strEnable%>");
}

</script>
</head>
<body leftmargin="0" topmargin="0" onLoad="init()">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td height="0" align="center">
		  <!--#include file="common/top.asp"-->
          </td>
        </tr>
        <tr> 
          <td height="100%" align="center" valign="top">
<TABLE class=table002 cellSpacing=0 cellPadding=0 border=0>
              <TBODY>
                <TR> 
                  <!--左边开始-->
                  <TD width="20%" align=right vAlign=top> <!--#include file="common/adminleft.asp"--> </TD>
                  <!--左边结束-->
                  <TD width="2%" background="images/rowline.gif">&nbsp;</TD>
                  <!--右边开始-->
                  <TD vAlign=top align=center width="78%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr> 
                        <td>
						<form name="HtmlEditForm" action="Admin_TempMenuAddDo.asp?id=<%=strID%>" method=post onSubmit="return checkform(this)">
                            <TABLE width="100%" height="100%" border=0 cellPadding=6 cellSpacing=0>
                              <TBODY>
                                <TR> 
                                  <TD vAlign=top align=left bgColor=#ffffff><strong><font color="#FF0000"><%=strTitle%></font></strong><BR> 
                                    <HR SIZE=1> <table width="98%" border="0" cellspacing="0" cellpadding="0">
                                      <tr> 
                                        <td height="25" align="center" valign="bottom"> 
                                          <table width="551" height="23" border="0" cellpadding="0" cellspacing="0">
                                            <tr align="center"> 
                                              <td width="30" valign="bottom">&nbsp;</td>
                                              <td width="88" bgcolor="#5F8AC5"><strong><font color="#FFFFFF">栏目属性</font></strong></td>
                                              <td width="17">&nbsp;</td>
                                              <td width="88"><a href="Admin_UserInfo1.asp?id=<%=GetVariable("id")%>"></a></td>
                                              <td width="17">&nbsp;</td>
                                              <td width="88"><a href="Admin_UserInfo2.asp?id=<%=GetVariable("id")%>"></a></td>
                                              <td width="210">&nbsp;</td>
                                            </tr>
                                          </table></td>
                                      </tr>
                                      <tr> 
                                        <td height="1" bgcolor="#5F8AC5"></td>
                                      </tr>
                                      <tr> 
                                        <td valign="top"> <table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#5F8AC5">
                                            <tr> 
                                              <td height="485" align="center" valign="top" bgcolor="#FFFFFF"> 
                                                <table width="98%" border="0" cellspacing="0" cellpadding="3">
                                                  <tr> 
                                                    <td bgcolor="#F9F9F9">&nbsp;</td>
                                                    <td bgcolor="#F9F9F9">&nbsp;</td>
                                                  </tr>
                                                  <tr> 
                                                    <td align="right" bgcolor="#F9F9F9">所属模板：</td>
                                                    <td bgcolor="#F9F9F9"><strong><%=request.QueryString("name")%> 
                                                      <input name="t_code" type="hidden" id="t_code2" value="<%=request.QueryString("t")%>">
                                                      </strong></td>
                                                  </tr>
                                                  <tr> 
                                                    <td width="28%" align="right" bgcolor="#F9F9F9">栏目类型：</td>
                                                    <td width="72%" bgcolor="#F9F9F9">
													<select name="selLanmu" id="selLanmu" onChange="setAttrib(this)">
                                                        <option value="" sText='' sHref='' sTagert='' sClass=''>-选择类型-</option>
                                                        <%
												  	strSQL="Select * From lamu"
													rSub.open strSQL,conn,1,1
													for i=1 to rSub.recordcount
														response.write "<option value='" & trim(rSub("l_code")) & "' sText='" & trim(rSub("l_name")) & "'>" & trim(rSub("l_name")) & "</option>"
														rSub.movenext
													next
													rSub.close
												  %>
                                                      </select> </td>
                                                  </tr>
                                                  <tr> 
                                                    <td align="right">栏目序号：</td>
                                                    <td><input name="txtIndex" type="text" id="txtIndex" value="<%=strIndex%>" size="10" maxlength="10"> 
                                                      <font color="#666666">[从0算起，≤16]</font></td>
                                                  </tr>
                                                  <tr> 
                                                    <td align="right" bgcolor="#F9F9F9">栏目名称：</td>
                                                    <td bgcolor="#F9F9F9"><input name="txtName" type="text" id="txtName2" value="<%=strText%>"></td>
                                                  </tr>
                                                  <tr> 
                                                    <td align="right">链接地址：</td>
                                                    <td><input name="txtHref" type="text" id="txtHref" value="<%=strHref%>">
                                                      目标： 
                                                      <select name="selTarget" id="selTarget">
                                                        <option value="" selected>默认窗口</option>
                                                        <option value="_blank">新窗口</option>
                                                        <option value="_parent">父窗口</option>
                                                        <option value="_self">当前窗口</option>
                                                      </select></td>
                                                  </tr>
                                                  <tr> 
                                                    <td align="right" bgcolor="#F9F9F9">CSS 
                                                      样式：</td>
                                                    <td bgcolor="#F9F9F9"><select name="selClass" id="selClass" onchange="document.all.aPreview.className=this.value">
                                                        <option selected value="">默认样式</option>
                                                        <option value="aBlack">黑色</option>
                                                        <option value="aBlue">蓝色</option>
                                                        <option value="aBrown">褐色</option>
                                                        <option value="aGreen">绿色</option>
                                                        <option value="aGrey">灰色</option>
                                                        <option value="aMagenta">红紫色</option>
                                                        <option value="aOrange">橙色</option>
                                                        <option value="aPurple">紫色</option>
                                                        <option value="aRed">红色</option>
                                                        <option value="aWhite">白色</option>
                                                        <option value="aYellow">黄色</option>
                                                      </select>
                                                      　 <a href="javascript:;" id="aPreview" class="<%=strClass%>">效果预览</a></td>
                                                  </tr>
                                                  <tr> 
                                                    <td align="right">&nbsp;</td>
                                                    <td>是否启用： 
                                                      <input name="chkEnable" type="checkbox" value="1"></td>
                                                  </tr>
                                                  <tr> 
                                                    <td colspan="2" bgcolor="#F9F9F9"><font color="#FF0000"><strong>栏目默认内容</strong></font></td>
                                                  </tr>
                                                  <tr> 
                                                    <td height="99" colspan="2" align="center" bgcolor="#F9F9F9"><textarea name="content" cols="80" rows="20" id="content"><%=strContent%></textarea> 
                                                    </td>
                                                  </tr>
                                                  <tr> 
                                                    <td height="34" align="right" bgcolor="#F9F9F9">&nbsp;</td>
                                                    <td bgcolor="#F9F9F9">　 
                                                      <input type="submit" name="Submit" value="保 存">
                                                      <input type="button" name="Submit2" value="后退" onClick="history.back()"> 
                                                      <input type="reset" name="reset" value="取 消"></td>
                                                  </tr>
                                                </table></td>
                                            </tr>
                                          </table></td>
                                      </tr>
                                    </table></TD>
                                </TR>
                              </TBODY>
                            </TABLE>
                          </form></td>
                      </tr>
                    </table> 
                  </TD>
                </TR>
              </TBODY>
            </TABLE></td>
        </tr>
        <tr> 
          <td height="0" align="center">
		  <!--#include file="common/bottom.asp"-->
		  </td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>
