<%@language=VBScript.Encode codepage=936 %>
<!--#include file="conn.asp"-->
<!--#include file="application.asp"-->
<!--#include file="admin.asp"-->
<!--#include file="Inc/Function.asp"-->
<%
If trim(request("action"))="Edit" then
   ID=repens(trim(request("ID")))
   If isnumeric(ID)=false then
      response.Write("<script lanaguge='javascript'>alert('参数有错误！！');history.back();</script>")
      response.End()
   end if
   If request("isBest")="1" then
      IsBest=1
   else
      IsBest=0
   end if
   If request("isNew")="1" then
      isNew=1
   else
      isNew=0
   end if
   title=repens(trim(request("title")))
   ClassID=repens(Trim(Request("ClassID")))
   keyword=repens(Trim(Request("keyword")))
   Desc=repens(Trim(Request("Desc")))
   content=repens(trim(request("content")))
   SmallPic=repens(Trim(Request("FileName")))
   BigPic=repens(Trim(Request("ppFile")))
   ModeUrl=repens(Trim(Request("ModeUrl")))
   set rs=server.CreateObject("adodb.recordset")
   rs.open"select * from ProdList where ID="&ID,conn,1,3
   if not rs.eof then
      rs("ProdName")=title
	  rs("ClassID")=ClassID
	  Rs("KeyWord")=KeyWord
	  Rs("Desc")=Desc
	  rs("Content")=content
	  rs("AddDate")=now()
	  rs("SmallPic")=SmallPic
	  rs("BigPic")=BigPic
	  rs("ModeUrl")=ModeUrl
	  rs("IsBest")=IsBest
	  rs("IsNew")=IsNew
      rs.update
      rs.close:set rs=nothing
      response.Write("<script lanaguge='javascript'>alert('作品修改成功！');location.href='Product_Manage.asp';</script>")
      response.End()
   end if
end if
ID=trim(request("ID"))
Set rs=server.CreateObject("Adodb.recordset")
rs.open"select * from ProdList where ID="&ID,conn,1,1
if not rs.eof then
      title=rs("ProdName")
	  ClassID=rs("ClassID")
	  content=rs("Content")
	  SmallPic=rs("SmallPic")
	  BigPic=rs("BigPic")
	  ModeUrl=rs("ModeUrl")
	  IsBest=rs("IsBest")
	  IsNew=rs("IsNew")
end if
%>
<script language = "JavaScript">
function CheckForm(){
  if (document.myform.Title.value==""){
    alert("作品名称不能为空！");
	document.myform.Title.focus();
	return false;
  }
  return true;  
}
</script>
<!-- #include file="Inc/Head.asp" -->
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top"> <b><br>
      </b>
        <form method="POST" name="myform" action="?action=Edit" onSubmit="return CheckForm();">
		<input type="hidden" name="ID" value="<%=ID%>">
<table width="95%" border="0" cellpadding="2" cellspacing="1" class="table_southidc">
                <tr> 
                  <td class="back_southidc" height="26" colspan="3" align="right"><div align="center"><b>修 改 作 品</b> </div></td>
                </tr>
                <tr bgcolor="#ECF5FF"> 
                  <td width="158" height="21" align="right">作品名称：</td>
                  <td colspan="2" bgcolor="#E3E3E3"> <strong> 
                    <input name="Title" type="text" id="Title" value="<%=title%>" size="30" maxlength="50">
                  <font color="#FF0000">*</font></strong><input type="checkbox" name="Isbest" value="1" <%if Isbest=1 then response.Write("checked") end if%>>推荐作品<input type="checkbox" name="IsNew" value="1" <%if IsNew=1 then response.Write("checked") end if%>>最新作品</td>
                </tr>
				<tr bgcolor="#ECF5FF"> 
                  <td width="158" height="21" align="right">作品分类：</td>
                  <td colspan="2" bgcolor="#E3E3E3"> 
				  <select name="ClassID">
				  <option value="0"></option>
				  <%
				  set rsc=server.CreateObject("adodb.recordset")
				  rsc.open"select * from ProdClass Order by ClassID asc",conn,1,1
				  do while not rsc.eof
				     if rsc("ClassID")=ClassID then
					 response.Write("<option value='"&rsc("ClassID")&"' selected>"&rsc("ClassName")&"</option>")
					 else
				     response.Write("<option value='"&rsc("ClassID")&"'>"&rsc("ClassName")&"</option>")
					 end if
				  rsc.movenext
				  loop
				  rsc.close:Set rsc=nothing
				  %>
				  </select>
				  </td>
                </tr>
				<tr bgcolor="#ECF5FF"> 
					<td width="158" height="25" align="right"><font color="#FF0000">*</font>作品关键字：</td>
					<td colspan="2" bgcolor="#E3E3E3"> <input name="keyword" value="<%=rs("keyword")%>" type="text" class="input" size="30" maxlength="50"></td>
			    </tr>
				  <tr bgcolor="#ECF5FF"> 
					<td width="158" height="25" align="right"><font color="#FF0000">*</font>作品描述：</td>
					<td colspan="2" bgcolor="#E3E3E3">
					  <textarea name="Desc" cols="50" rows="4"><%=rs("Desc")%></textarea>
					**控制在150字以内</td>
				  </tr>
                <tr bgcolor="#ECF5FF">
                  <td><div align="right">作品说明：</div></td>
                  <td colspan="2" bgcolor="#E3E3E3">
				  <textarea name="content" style="display:none;"><%=content%></textarea>
                    <iframe ID="eWebEditor1" src="Southidceditor/ewebeditor.asp?id=content&style=southidc" frameborder="0" scrolling="no" width="85%" HEIGHT="350"></iframe></td>
                </tr>
				<tr bgcolor="#ECF5FF"> 
                  <td height="22" align="right">作品缩略图：</td>
                  <td width="257" bgcolor="#E3E3E3"><input name="FileName" type="text" id="FileName" value="<%=Smallpic%>"  maxlength="100"></td>
                  <td width="475" bgcolor="#E3E3E3"><iframe frameborder="0" height="23" name="Upload" scrolling="no" src="Upload_Photo.asp"></iframe></td>
				</tr>
				<tr bgcolor="#ECF5FF"> 
                  <td height="22" align="right">作品大图片：</td>
                  <td width="257" bgcolor="#E3E3E3"><input name="ppFile" type="text" id="ppFile" value="<%=BigPic%>"  maxlength="100"></td>
                  <td width="475" bgcolor="#E3E3E3"><iframe frameborder="0" height="23" name="Upload" scrolling="no" src="Upload.asp"></iframe></td>
				</tr>
				<tr bgcolor="#ECF5FF"> 
                  <td height="22" align="right">演示地址：</td>
                  <td colspan="2" bgcolor="#E3E3E3"><input name="ModeUrl" type="text" id="ModeUrl" value="<%=ModeUrl%>" size="35" maxlength="100"></td>
                </tr>
                <tr bgcolor="#ECF5FF"> 
                  <td height="22" colspan="3" align="right"> <div align="center"> 
                      <input name="Add" type="submit"  id="Add2" value=" 修 改 ">
                    </div></td>
                </tr>
              </table>
		 
        <div align="center">
          <p>&nbsp;  </p>
        </div>
      </form></td>
  </tr>
</table>
<!-- #include file="Inc/Foot.asp" -->