www.gusucode.com > 木犁IT产品管理系统 1.0 beta1码程序 > manage/admin_infomodi.asp

    <!--#include file="conn.asp"-->
<%
if not session("check")="checked" then
response.Redirect "login.asp"
end if
%>
<%
if request("no")="modi" then
newsid=request("newsid")
title=request("title")
pic1=request("pic1")
gg=request("gg")
tj=request("tj")
BigClassName=request("BigClassName")
SmallClassName=request("SmallClassName")
content=request("content")

set rs=server.createobject("adodb.recordset")
sql="select * from NEWS where id="&newsid
rs.open sql,conn,1,3
rs("title")=title
rs("content")=content
rs("gg")=request("gg")
rs("pic1")=pic1
rs("BigClassName")=BigClassName
rs("SmallClassName")=SmallClassName
rs("tj")=tj
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write "<script language='javascript'>" & chr(13)
		response.write "alert('产品修改成功!');" & Chr(13)
		response.write "window.document.location.href='editnews.asp';"&Chr(13)
		response.write "</script>" & Chr(13)
Response.End
end if%>
<%
dim rs
dim sql
dim count
set rs=server.createobject("adodb.recordset")
sql = "select * from SmallClass order by SmallClassID asc"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
subcat = new Array();
        <%
        count = 0
        do while not rs.eof 
        %>
subcat[<%=count%>] = new Array("<%= trim(rs("SmallClassName"))%>","<%= trim(rs("BigClassName"))%>","<%= trim(rs("SmallClassName"))%>");
        <%
        count = count + 1
        rs.movenext
        loop
        rs.close
        %>
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.addNEWS.SmallClassName.length = 1; 
    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.addNEWS.SmallClassName.options[document.addNEWS.SmallClassName.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
    }    
function CheckForm()
{

	if (document.addNEWS.title.value.length == 0) {
		alert("产品名称没有填写.");
		document.addNEWS.title.focus();
		return false;
	}
	return true;
}
</script>
<SCRIPT>
function view1(url){ 
var url; window.open(url,'_blank','status=no,scrollbars=yes,top=50,left=300,width=460,height=220'); 
}
</SCRIPT>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/private.css" rel="stylesheet" type="text/css" />
<script language='javascript' src='images/private.js'></SCRIPT>
<title>添加产品</title>
</head>

<body>
<% 
newsid=request("id")
Set rso=Server.CreateObject("ADODB.RecordSet") 
sql="select * from NEWS where  id="&newsid
rso.Open sql,conn,1,1
if rso.eof and rso.bof then
response.Write("没有记录")
else
%>
<div align="center">

	<table border=0 cellspacing=1 align=center class=navi>
	<tr>
	  <th>当前位置:产品管理 &gt;&gt; 产品修改</th>
	</tr>
	</table><br>
<table width="57%" border="0"  class="list" cellspacing="1" >
  <form id="AddPro" name="addNEWS" method="post" action="admin_infomodi.asp?no=modi" onSubmit="return CheckForm();">
    <tr align="center" > 
      <th height="30" bgcolor="#FF0000" colspan="2"><font color="#FFFFFF"><strong>修改</strong></font><strong>产品</strong></th>
    </tr>
    <tr> 
      <td width="15%" height="24" align="right" >
		产品名称:</td>
      <td width="83%" height="24" align="right" >
		<p align="left"><input name="title" type="text" class="input" value="<%=rso("title")%>" size="30"></td>
    </tr>
    <tr> 
      <td height="24" align="right" >
		产品类别:<%
	if session("aleave")="check" then
		response.write rso("BigClassName") & "<input name='BigClassName' type='hidden' value='" & rso("BigClassName") & "'>&gt;&gt;"
	else		
        sql = "select * from BigClass"
        rs.open sql,conn,1,1
		if rs.eof and rs.bof then
			response.write "请先添加栏目。"
		else
		%></td>
      <td height="24" align="right" >
		<p align="left"><select name="BigClassName" onChange="changelocation(document.addNEWS.BigClassName.options[document.addNEWS.BigClassName.selectedIndex].value)" size="1">
                      <%
		    do while not rs.eof
			%>
                      <option <% if rs("BigClassName")=rso("BigClassName") then response.Write("selected") end if%> value="<%=trim(rs("BigClassName"))%>"><%=trim(rs("BigClassName"))%></option>
                      <%
		        rs.movenext
    	    loop
		end if
        rs.close
			%>
                    </select> 
                    <%
	end if
	if session("aleave")="check" then
		response.write rso("SmallClassName") & "<input name='SmallClassName' type='hidden' value='" & rso("SmallClassName") & "'>"
	else
	%>
                    <select name="SmallClassName">
                      <option <%if rso("SmallClassName")="" then response.write "selected"%>>不指定小类</option>
                      <%
			sql="select * from SmallClass where BigClassName='" & rso("BigClassName") & "'" 
			rs.open sql,conn,1,1 
			if not(rs.eof and rs.bof) then  
				do while not rs.eof %> 
                      <option <% if rs("SmallClassName")=rso("SmallClassName") then response.Write("selected") end if%> value="<%=rs("SmallClassName")%>"><%=rs("SmallClassName")%></option>
                      <%
			    	rs.movenext
				loop
			end if
	        rs.close
			%>
                    </select> 
                    <%
	end if
	%>      </td>
    </tr>
    <tr>
      <td height="25" width="17%" align="right">
      产品规格:</td>
      <td height="25" width="84%">
        <input name="gg" type="text" class="input" size="30" value="<%=rso("gg")%>"></td>
      </tr>
    <tr> 
      <td align="center" > 
        <p align="right">产品图片:</td>
      <td align="center" > 
        <p align="left">
		<input name="pic1" type="text" class="input" value="<%=rso("pic1")%>" size="30"> [<strong><a href="javascript:view1('up1.asp?FD=pic1')"><font color="#0000ff">上传图片</font></a></strong>]</td>
    </tr>
    <tr> 
      <td align="center" > 
        <p align="right">推荐产品:</td>
      <td align="center" valign="top" > 
        <p align="left"><input type="radio" value="1" name="tj" 
        <%
        if rso("tj")=1 then 
        response.write "checked"
        end if 
        %>>是&nbsp; 
        <input type="radio" name="tj" value="0"
        <%
        if rso("tj")=0 then 
        response.write "checked"
        end if 
        %>>否</td>
    </tr>
    <tr> 
      <td align="center" > 
        <p align="right">产品内容:</td>
      <td align="center" valign="top" > 
        <input type="hidden" name="content" value="<%=Server.HTMLEncode(rso("Content"))%>">
		<p align="left">
		<iframe ID="eWebEditor1" src="edit/115cn.asp?id=content&style=s_blue" frameborder="0" scrolling="no" width="550" HEIGHT="350"></iframe></td>
    </tr>
    <tr align="center"> 
      <td height="31" colspan="2" > 
        <input type="submit" name="Submit" value="提交" class="input">
        <input type="hidden" name="newsId" value="<%=newsId%>">  
        <input type="reset" name="Submit2" value="重置" class="input"> 
      </td>
    </tr>
  </form>
</table>
</div>
<% End If
rso.close
set rso=nothing
conn.close
set conn=nothing
 %>
</body>
</html>