<!--#include file="conn.asp"-->
<!--#include file="../../admin/checkUser.asp"-->
<%

lid=request("id")
sql="select * from pic where id=cint('"&lid&"')"
set rs=server.createobject("adodb.recordset")
rs.open sql,connstr,1,1
if not rs.eof then
picname=request.form("picname")
picaddress=request.form("picaddress")
picaddress2=request.form("picaddress2")
piczuozhe=request.form("piczuozhe")
picshuo=request.form("picshuo")
pichits=request.form("pichits")
if picname<>"" and edit<>"修改" then
sql="select * from pic where id=cint('"&lid&"')"
set rs=server.createobject("adodb.recordset")
rs.open sql,connstr,3,2
rs("picname")=picname
rs("picaddress")=picaddress
rs("picadd")=picaddress2
rs("piczuozhe")=piczuozhe
rs("picshuo")=picshuo
rs("pichits")=pichits
rs("picclass")=request.form("picclass")
rs.update
session("edituser")=name
Response.write "<script>alert(""修改成功"");location.href=""adminpic.asp"";</script>"
end if
end if
%>
<body background="../../admin/bg_line.gif">
 <div align="center">
  <center>
  <form action="" method="post" name="editpic" id="editpic">
      <table border="0" width="95%" cellspacing="0" cellpadding="5">
        <tr> 
          <td width="42%" align="right">图片名称：</td>
          <td width="58%"> 
            <input type="text" name="picname" size="30" value="<%=rs("picname")%>">
          </td>
        </tr>
        <tr> 
          <td width="42%" align="right" height="24">图片缩图地址：</td>
          <td width="58%" height="24"> 
            <input type="text" name="picaddress" size="30" value="<%=rs("picaddress")%>">
            <IFRAME SRC=soft3.asp MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=NO WIDTH=100%  HEIGHT=25 align="left"></IFRAME>
          </td>
        </tr>
        <tr> 
          <td align="right">图片大图地址：</td>
          <td><input type="text" name="picaddress2" size="30" value="<%=rs("picadd")%>">
            <IFRAME SRC=soft4.asp MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=NO WIDTH=100%  HEIGHT=25 align="left"></IFRAME> 
          </td>
        </tr>
        <tr>
          <td align="right">作者：</td>
          <td><input type="text" name="piczuozhe" size="30" maxlength="35" value="<%=rs("piczuozhe")%>"></td>
        </tr>
        <tr> 
          <td align="right">说明：</td>
          <td> 
            <input type="text" name="picshuo" size="30" value="<%=rs("picshuo")%>" maxlength="34">
          </td>
        </tr><tr> 
          <td align="right">人气：</td>
          <td> 
            <input type="text" name="pichits" size="30" value="<%=rs("pichits")%>" maxlength="34">
          </td>
        </tr><tr> 
          <td align="right">推荐：</td>
          <td> 
            <%if rs("isgood")=false then%>
            <font color="#FF0000">否</font> 
            <%else%>
            <font color="#FF0000">是</font> 
            <%end if%>
          </td>
        </tr>
        <tr> 
          <td align="right">分类：</td>
          <td> 
            <select  name="picclass" size="1">
              <%
dim rs1,sql1,sel
 set rs1=server.createobject("adodb.recordset")
  sql1="select * from class"
 rs1.open sql1,conn,1,1
			  do while not rs1.eof
                                sel="selected"    
		             response.write "<option  value='"+CStr(rs1("ID"))+"' name=picclass "
		           ' Response.Write rs1("id")& rs("picclass")
		             if rs("picclass")=rs1("id") then Response.Write sel
		             Response.Write ">"+rs1("class_name")+"</option>"+chr(13)+chr(10)
		             rs1.movenext
    		          loop
			rs1.close
			  %>
            </select>
          </td>
        </tr>
        <tr> 
          <td width="100%" align="right" colspan="2"> </td>
        </tr>
        <tr> 
          <td align="right" colspan="2"> 
            <div align="center"> 
              <input type="submit" value="修改" name="xiufai">
              &nbsp;&nbsp; 
              <input type="reset" value="还原" name="reset">
            </div>
          </td>
        </tr>
        <tr> 
          <td align="right" colspan="2"> 
            <div align="center"></div>
          </td>
        </tr>
      </table>
 </form>
  </center>
</div>                 
