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

strID=request.QueryString("id")

if strID="" then
	'添加模板
	strTitle="添加模板"
	strServer=request.ServerVariables("SERVER_NAME")
	if request.ServerVariables("SERVER_PORT")<>"" And request.ServerVariables("SERVER_PORT")<>"80" then
		strServer=strServer & ":" & request.ServerVariables("SERVER_PORT")
	end if
else
	strTitle="修改模板"
	strID=Cint(strID)
	strSQL="Select * from templet Where id=" & strID
	rs.open strSQL,conn,1,1
		strClass=Trim(rs("t_type"))
		strCode=Trim(rs("t_code"))
		strName=Trim(rs("t_name"))
		strInfo=Trim(rs("t_intro"))
		strMember=Cint(rs("t_member"))
		strVote=Cint(rs("t_vote"))
		strLink=Cint(rs("t_link"))
		strServer=Trim(rs("t_server"))
	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.txtCode,"模板编号")) return false;
	//if(!CheckInteger(theform.txtCode,"模板编号")) return false;
	if(!CheckEmpty(theform.txtName,"模板名称")) return false;
}


function init(){
	SelectValue(form1.selClass,"<%=strClass%>");
	RadioValue(form1.rdoMember,"<%=strMember%>");
	RadioValue(form1.rdoVote,"<%=strVote%>");
	RadioValue(form1.rdoLink,"<%=strLink%>");
}
</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="form1" method="post" action="Admin_TempAddDo.asp?id=<%=strID%>" 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="30" 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> 
                                                      <select name="selClass" id="selClass">
                                                        <%
													Set rSub=server.CreateObject("ADODB.RecordSet")
													rSub.open "Select * From templet_class",conn,1,1
													for i=1 to rSub.recordcount
														response.Write("<option value=" & rSub("id") & ">" & Trim(rSub("tc_name")) & "</option>")
														rSub.movenext
													next
													rSub.close
											%>
                                                      </select>
                                                      </strong></td>
                                                  </tr>
                                                  <tr> 
                                                    <td width="28%" align="right" bgcolor="#F9F9F9">模板编号：</td>
                                                    <td width="72%" bgcolor="#F9F9F9"><input name="txtCode" type="text" id="txtCode" value="<%=strCode%>" size="20" maxlength="20"></td>
                                                  </tr>
                                                  <tr> 
                                                    <td align="right">模板名称：</td>
                                                    <td><input name="txtName" type="text" id="txtName" value="<%=strName%>" size="20" maxlength="20"></td>
                                                  </tr>
                                                  <tr> 
                                                    <td align="right" bgcolor="#F9F9F9">会员制：</td>
                                                    <td bgcolor="#F9F9F9"><input name="rdoMember" type="radio" value="1">
                                                      支持 
                                                      <input name="rdoMember" type="radio" value="0" checked>
                                                      不支持 </td>
                                                  </tr>
                                                  <tr> 
                                                    <td align="right">投　票：</td>
                                                    <td><input name="rdoVote" type="radio" value="1" checked>
                                                      支持 
                                                      <input name="rdoVote" type="radio" value="0">
                                                      不支持 </td>
                                                  </tr>
                                                  <tr> 
                                                    <td align="right" bgcolor="#F9F9F9">友情链接：</td>
                                                    <td bgcolor="#F9F9F9"><input name="rdoLink" type="radio" value="1" checked>
                                                      支持 
                                                      <input name="rdoLink" type="radio" value="0">
                                                      不支持 </td>
                                                  </tr>
                                                  <tr>
                                                    <td align="right">使用服务器：</td>
                                                    <td><input name="txtServer" type="text" id="txtServer" value="<%=strServer%>" size="20" maxlength="20">
                                                      <font color="#FF0000">[为空表示所有服务器都能使用] 
                                                      </font></td>
                                                  </tr>
                                                  <tr> 
                                                    <td align="right">模板说明：</td>
                                                    <td><textarea name="txtInfo" cols="50" rows="5" id="txtInfo"><%=strInfo%></textarea></td>
                                                  </tr>
                                                  <tr> 
                                                    <td height="99" align="right" bgcolor="#F9F9F9">&nbsp;</td>
                                                    <td bgcolor="#F9F9F9">　 
                                                      <input type="submit" name="Submit" value="保 存"> 
                                                      <input type="button" name="Submit22" value="后退" onClick="history.back()"> 
                                                      <% if strID<>"" then %> <input type="button" name="Submit2" value="设置模板栏目" onClick="location='Admin_TempMenu.asp?t=<%=strCode%>&name=<%=strName%>'"> 
                                                      <%end if%> <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>
