<% userPageRights="{info}" %>
<!--#include file="check.asp"-->
<%
dim SmallClassID,Action,BigClassName, SmallClassName, OldSmallClassName,rs,FoundErr,ErrMsg
SmallClassID=trim(Request("SmallClassID"))
Action=trim(Request("Action"))
BigClassName=trim(Request.form("BigClassName"))
SmallClassName=trim(Request.form("SmallClassName"))
OldSmallClassName=trim(request.form("OldSmallClassName"))
if SmallClassID="" then
	response.Redirect("admin_infoclass.asp")
end if
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open "Select * from info_SmallClass where f_ID="&SmallClassID&"",conn,1,3
if rs.Bof or rs.EOF then
	FoundErr=True
		response.write"<SCRIPT language=JavaScript>alert('小类不存在！');"
        response.write"this.location.href='javascript:history.back();'</SCRIPT>"
        response.end
else
	if Action="Modify" then
		if SmallClassName="" then
			FoundErr=True
		response.write"<SCRIPT language=JavaScript>alert('小类名不能为空！');"
        response.write"this.location.href='javascript:history.back();'</SCRIPT>"
        response.end
		end if
		if FoundErr<>True then
		    rs("f_bigclassid")=request("bigid")
			rs("f_value")=SmallClassName
			rs("f_index")=request("f_index")
			 rs("F_img1")=request("titlePic")
			 rs("F_title1")=request("F_title1")
			 rs("F_url1")=request("F_url1")
			 rs("F_img2")=request("txtImage")
			 rs("F_title2")=request("F_title2")
			 rs("F_url2")=request("F_url2")
     		rs.update
			rs.Close
    	 	set rs=Nothing
			'if SmallClassName<>OldSmallClassName then
			'	conn.execute "Update Product set SmallClassName='" & SmallClassName & "' where BigClassName='" & BigClassName & "' and SmallClassName='" & OldSmallClassName & "'"
	     '	end if	
			conn.close
			set conn=nothing
    	 	Response.Redirect "admin_infoclass.asp"
		end if
	end if
lm2="fl"
%>
<link href="Images/Style.css" rel="stylesheet" type="text/css">

<script language="javascript">
<!--
function insertPic(obj){
	var file = showModalDialog("../include/filesr.asp?lm=<%=lm2%>-&path="+obj.name+"/",null,"dialogHeight:600px;dialogWidth:730px;scroll:yes;help:no;status:no;")
		if(typeof(file) != "undefined"){
		obj.value = file;
	}
}
-->
</script>
<style type="text/css">
<!--
.style1 {
	color: #3300FF;
	font-weight: bold;
}
.style2 {
	color: #339900;
	font-weight: bold;
}
.style3 {color: #FF0000}
-->
</style>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top"> <br> <br>
      <strong> 小 类 设 置</strong> <br> <br> <br> <form name="form1" method="post" action="ClassModifySmall.asp">
        <p>&nbsp;</p>
        <table width="98%" border="0" align="center" cellpadding="0" cellspacing="2" class="border">
          <tr bgcolor="#CCCCCC" class="title"> 
            <td height="25" colspan="2" align="center"><strong>修改小类名称</strong></td>
          </tr>
          <tr bgcolor="f2f2f2" class="tdbg"> 
            <td width="78" height="30"><strong>所属大类：</strong></td>
            <td width="266">
           <select name="bigid">
                <%
	dim rsBigClass
	set rsBigClass=server.CreateObject("adodb.recordset")
	rsBigClass.open "Select * From info_BigClass",conn,1,1
	if rsBigClass.bof and rsBigClass.bof then
		response.write "<option>请先添加大类</option>"
	else
		do while not rsBigClass.eof
			if rsBigClass("f_id")=rs("f_bigclassid") then
				response.write "<option value='"& rsBigClass("f_id") & "' selected>" & rsBigClass("f_value") & "</option>"
			else
				response.write "<option value='"& rsBigClass("f_id") & "'>" & rsBigClass("f_value") & "</option>"
			end if
			rsBigClass.movenext
		loop
	end if
	rsBigClass.close
	set rsBigClass=nothing
	%>
              </select>
		  </tr>
          <tr bgcolor="f2f2f2" class="tdbg"> 
            <td height="30"><strong>小类名称：</strong></td>
            <td> 
              <input name="SmallClassName" type="text" id="SmallClassName" value="<%=rs("f_value")%>" size="20" maxlength="30"></td>
          </tr>
		  <tr bgcolor="f2f2f2" class="tdbg">
		    <td height="30"><span class="style1">左图地址</span></td>
		    <td><input name="titlePic" type="text" id="titlePic" value="<%
	if rs("F_img1") = "none" then
	  	response.Write("")
		else
		response.Write rs("F_img1")
	end if
	  %>" size="45" maxlength="255">
            <input type="button" name="Submit" value="选择&gt;" onClick="javascript:insertPic(this.form.titlePic);"> 
            * 120×90,<span class="style3">上传结束后请取掉最新面的&quot;..&quot;</span></td>
	      </tr>
		  <tr bgcolor="f2f2f2" class="tdbg">
		    <td height="30"><span class="style1">左图标题</span></td>
		    <td><input name="F_title1" type="text" id="F_title1" value="<%=rs("F_title1")%>" size="30" maxlength="12"> * 12个中文字符</td>
	      </tr>
		  <tr bgcolor="f2f2f2" class="tdbg">
		    <td height="30"><span class="style1">左图链接</span></td>
		    <td><input name="F_url1" type="text" id="F_url1" value="<%=rs("F_url1")%>" size="50"></td>
	      </tr>
		  <tr bgcolor="f2f2f2" class="tdbg">
		    <td height="30"><span class="style2">右图地址</span></td>
		    <td><input name="txtImage" type="text" id="txtImage" value="<%
	if rs("F_img2") = "none" then
	  	response.Write("")
		else
		response.Write rs("F_img2")
	end if
	  %>" size="45" maxlength="255">
            <input type="button" name="Submit" value="选择&gt;" onClick="javascript:insertPic(this.form.txtImage);">             * 120×90,<span class="style3">上传结束后请取掉最新面的&quot;..&quot;</span></td>
	      </tr>
		  <tr bgcolor="f2f2f2" class="tdbg">
		    <td height="30"><span class="style2">右图标题</span></td>
		    <td><input name="F_title2" type="text" id="F_title2" value="<%=rs("F_title2")%>" size="30" maxlength="12"> * 12个中文字符</td>
	      </tr>
		  <tr bgcolor="f2f2f2" class="tdbg">
		    <td height="30"><span class="style2">右图链接</span></td>
		    <td><input name="F_url2" type="text" id="F_url2" value="<%=rs("F_url2")%>" size="50"></td>
	      </tr>
		  <tr bgcolor="f2f2f2" class="tdbg"> 
            <td width="78" height="30"><strong>排序：</strong></td>
            <td> 
              <input name="f_index" type="text" id="f_index" value="0" size="5">
              <font color="#FF0000">越大越优先</font></td>
          </tr>
          <tr bgcolor="f2f2f2" class="tdbg"> 
            <td height="22" align="center">&nbsp;</td>
            <td align="center"> 
              <div align="left"> 
                <input name="Action" type="hidden" id="Action4" value="Modify">
                <input name="Save" type="submit" id="Save" value=" 修 改 ">
                <input name="SmallClassID" type="hidden" id="SmallClassID" value="<%=SmallClassID%>">
              </div></td>
          </tr>
        </table>
      </form></td>
  </tr>
</table>

<%
	end if
rs.close
set rs=nothing
%>