⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 productmanageedit.asp

📁 这个也是一个功能强大的企业整站的ASP源代码
💻 ASP
字号:
<!--#include file="CheckAdminLogined.asp"-->
<!--#include file="../include/connstr.asp"-->
<% set rs=conn.execute("select * from tProduct where ID="&request("EditID"))
   if rs.eof and rs.bof then
     response.write "<script>alert('读取数据时出错,请与管理员联系!');history.back();</script>"
	 response.end
   end if
     
'--------------------------------
if request("cur_action")="DelProductPic" or request("cur_action")="DelOtherFile" then
  set rs_oldpic=conn.execute("select * from tProduct where ID="&request("EditID"))
  if request("cur_action")="DelProductPic" then
     OldFileTemp=rs_oldpic("ProductPic")
     sql_delete="update tProduct set ProductPic='' where ID="&request("EditID")
     conn.execute sql_delete  
  else
     OldFileTemp=rs_oldpic("OtherFile")
     sql_delete="update tProduct set OtherFile='' where ID="&request("EditID")
     conn.execute sql_delete  	 
  end if
  
  delfname=server.mappath("\UploadFile\ProductFile") & "\" &OldFileTemp
  set TestFileObject=Server.Createobject("Scripting.FileSystemObject")
  if  TestFileObject.FileExists(delfname) then
    set NewFile=TestFileObject.getfile(delfname)
    Newfile.delete
  end if
  	
  response.write "<script>location.replace('?Editid="&request("EditID")&"&PageNo="&request("PageNo")&"&CateID="&request("CateID")&"&CateName="&request("CateName")&"')</script>"
  response.end
end if   
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Images/AdminCss.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
function check_data(){
 document.form1.Content.value = frames.message.document.body.innerHTML;
 if(document.form1.viewhtml.checked == true){
   alert("对不起,请取消“查看HTML源代码”后再添加!")
   document.form1.viewhtml.focus()
   return false
 }
 
 if(document.form1.T_Title.value==""){
   alert("产品内容为必填项,请填写!")
   document.form1.T_Title.focus();
   return(false)
 }

 if(document.form1.Content.value==""){
   alert("产品介绍为必填项,请填写")
   document.form1.viewhtml.focus()
   return(false)
 }

 if(document.form1.T_AddTime.value==""){
   alert("添加时间为必填项,请填写")
   document.form1.T_AddTime.focus()
   return(false)
 }
}
</script>
</head>

<body leftmargin="0" topmargin="0">
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="8" colspan="2"></td>
  </tr>
  <tr> 
    <td width="76" height="20" rowspan="2"><img src="Images/TopBt.gif" width="67" height="36"></td>
    <td width="897" height="10"></td>
  </tr>
  <tr>
    <td>我的位置:后台管理系统._产品管理._修改产品</td>
  </tr>
  <tr> 
    <td height="4" colspan="2"></td>
  </tr>
  <tr> 
    <td colspan="2"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="E7E7E7">
        <tr> 
          <td height="20"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td width="159" height="20" align="center" background="images/title1.gif" class="fontwintitle"><strong>修改产品</strong> 
                </td>
                <td align="right" background="images/title2.gif">&nbsp;</td>
                <td width="10"><img src="images/title3.gif" width="10" height="20"></td>
              </tr>
            </table></td>
        </tr>
        <tr valign="top"> 
          <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td width="6" background="images/midder1.gif"><img src="images/midder1.gif" width="6" height="3"></td>
                <td height="100%" align="center" valign="top"><br>
                  <table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
                    <form action="ProductManageEditSave.asp" method="post" enctype="multipart/form-data" name="form1" onsubmit="return check_data()">
                      <tr bgcolor="#FFFFFF"> 
                        <td width="16%" height="22" align="right" bgcolor="ECF2D6">* 
                          产品名称:</td>
                        <td width="84%">&nbsp; <input name="T_Title" type="text" id="T_Title" size="50" value="<%=rs("Title")%>"> 
                        </td>
                      </tr>
                      <tr bgcolor="#FFFFFF"> 
                        <td height="22" align="right" bgcolor="ECF2D6">* 所属类别:</td>
                        <td>&nbsp; <select name="S_CateID" id="S_CateID">
                            <%set rs_CateID=conn.execute("select * from tProductCate order by AddTime desc")
							do while not rs_CateID.eof
							  if cstr(rs("CateID"))=cstr(rs_CateID("ID")) then
							    response.write "<option value='"&rs_CateID("ID")&"' selected>"&rs_CateID("Title")&"</option>"
							  else
							    response.write "<option value='"&rs_CateID("ID")&"'>"&rs_CateID("Title")&"</option>"
							  end if
							  rs_CateID.movenext
							loop
							rs_CateID.close
							set rs_CateID=nothing
						  %>
                          </select> </td>
                      </tr>
                      <tr bgcolor="#FFFFFF"> 
                        <td height="119" align="right" bgcolor="ECF2D6">* 产品图片:</td>
                        <td align="center"> <table width="98%" border="0" cellpadding="0" cellspacing="0">
                            <tr> 
                              <td width="19%" class="box2"> <img <%if isnull(rs("ProductPic")) or trim(rs("ProductPic"))="" then %>src="/UploadFile/default.gif" <%else%>src="<%="/UploadFile/ProductFile/"&rs("ProductPic")%>" <%end if%>style="cursor:hand" onclick="Show_Lay(document.images['pic_view'].src)" id="pic_view" width="130" height="90"  alt="点击放大"></td>
                              <td width="81%" valign="top"> <% if rs("ProductPic")<>"" then response.write "&nbsp;更改为:<br> &nbsp;&nbsp;&nbsp;"%> &nbsp; <input name="T_ProductPic" type="file" class="box" size="40"> 
                                <br> <% if rs("ProductPic")<>"" then %> <br> &nbsp;&nbsp;&nbsp; <a href="?cur_action=DelProductPic&EditID=<%=rs("ID")%>&PageNo=<%=PageNo%>&CateID=<%=request("CateID")%>&CateName=<%=request("CateName")%>" onclick="{if(confirm('确定删除该条产品图片吗?')){return true;}return false;}">&lt;-- 
                                删除原先产品图片</a> <% end if %> <br> <font color="#999999">(产品图片要求:文件小于100K,JPG格式或GIF格式均可) 
                                </font> </td>
                            </tr>
                          </table></td>
                      </tr>
                      <tr bgcolor="#FFFFFF"> 
                        <td height="57" align="right" bgcolor="ECF2D6">下载资料:</td>
                        <td align="center"> <table width="98%" border="0" cellpadding="0" cellspacing="0">
                            <tr> 
                              <td width="19%"><%if rs("OtherFile")="" or isnull(rs("OtherFile")) then response.write "没有下载资料" else response.write "<a href='/UploadFile/ProductFile/"&rs("OtherFile")&"'><font color='ff0000'><b>点击下载查看</b></font></a><img src='Images/DownLoad.gif' height=20 width=15>"%></td>
                              <td width="81%" valign="top"> <% if rs("ProductPic")<>"" then response.write "&nbsp;更改为:<br> &nbsp;&nbsp;&nbsp;"%> &nbsp; <input name="T_OtherFile" type="file" class="box" id="T_OtherFile" size="40"> 
                                <br> <font color="#999999"> 
                                <% if rs("OtherFile")<>"" then %>
                                <br>
                                &nbsp;&nbsp;&nbsp; <a href="?cur_action=DelOtherFile&EditID=<%=rs("ID")%>&PageNo=<%=PageNo%>&CateID=<%=request("CateID")%>&CateName=<%=request("CateName")%>" onclick="{if(confirm('确定删除该条下载资料吗?')){return true;}return false;}">&lt;-- 
                                删除原先下载资料</a> 
                                <% end if %>
                                </font> </td>
                            </tr>
                          </table></td>
                      </tr>
                      <tr bgcolor="#FFFFFF"> 
                        <td height="22" align="right" bgcolor="ECF2D6">* 产品介绍:</td>
                        <td align="center"> <table width="97%" border="0" cellpadding="0" cellspacing="0">
                            <tr> 
                              <td colspan="2" height="3"></td>
                            </tr>
                            <tr> 
                              <td> <%UploadFilePathTemp="/UploadFile/ProductFile"%> <!--#include file="ArticleEditor/ArticleEdit.asp"--> <script language="javascript">
                                   document.write ('<iframe src="ArticleEditor/Textbox.asp?cur_action=product_edit&EditID=<%=rs("ID")%>" id="message" width="100%" height="350"></iframe>')
                                   frames.message.document.designMode = "On";
                                </script> <input type="hidden" name="Content" value=""> 
                                <input name="UploadFile" type="hidden" id="UploadFile" value="<%=rs("UploadFile")%>"> 
                              </td>
                            </tr>
                            <tr> 
                              <td colspan="2" height="3"></td>
                            </tr>
                          </table></td>
                      </tr>
                      <tr bgcolor="#FFFFFF">
                        <td height="22" align="right" bgcolor="ECF2D6">产品单价:</td>
                        <td>&nbsp; <input name="T_Price" type="text" id="T_Price" size="15" value="<%=rs("Price")%>"></td>
                      </tr>
                      <tr bgcolor="#FFFFFF"> 
                        <td height="22" align="right" bgcolor="ECF2D6">产品性质:</td>
                        <td>&nbsp; <input name="R_IsHot" type="radio" value="0" <%if rs("IsHot")=0 then response.write "checked"%>>
                          普通 
                          <input type="radio" name="R_IsHot" value="1" <%if rs("IsHot")=1 then response.write "checked"%>>
                          推荐 
                          <input type="radio" name="R_IsHot" value="2" <%if rs("IsHot")=2 then response.write "checked"%>>
                          库存</td>
                      </tr>
                      <tr bgcolor="#FFFFFF"> 
                        <td height="22" align="right" bgcolor="ECF2D6">* 添加时间:</td>
                        <td>&nbsp; <input name="T_AddTime" type="text" id="T_AddTime" value="<%=rs("AddTime")%>"></td>
                      </tr>
                      <tr bgcolor="#FFFFFF"> 
                        <td height="22" align="right" bgcolor="ECF2D6">状态:</td>
                        <td bgcolor="#FFFFFF">&nbsp; <input name="R_StateFlag" type="radio" value="0" <%if rs("StateFlag")=0 then response.write "checked"%>>
                          显示 
                          <input type="radio" name="R_StateFlag" value="1" <%if rs("StateFlag")=1 then response.write "checked"%>>
                          隐藏 </td>
                      </tr>
                      <tr bgcolor="#FFFFFF"> 
                        <td height="40" colspan="2" align="center" bgcolor="#FFFFFF"><input name="EditID" type="hidden" id="EditID" value="<%=request("EditID")%>"> 
                          <input name="Key" type="hidden" id="Key" value="<%=request("Key")%>"> 
                          <input name="PageNo" type="hidden" id="PageNo" value="<%=request("PageNo")%>"> 
                          <input name="CateID" type="hidden" id="CateID" value="<%=request("CateID")%>"> 
                          <input name="CateName" type="hidden" id="CateName" value="<%=request("CateName")%>"> 
                          <input type="submit" name="Submit" value="确定发布"> <input type="reset" name="Submit2" value="重新填写"></td>
                      </tr>
                    </form>
                  </table>
				  <br> 
                  <br> </td>
                <td width="2" background="images/midder2.gif"><img src="images/midder2.gif" width="2" height="3"></td>
              </tr>
              <tr> 
                <td valign="top"><img src="images/bottom1.gif" width="6" height="14"></td>
                <td height="14" valign="top" background="images/bottom2.gif"><img src="images/bottom2.gif" width="2" height="14"></td>
                <td valign="top"><img src="images/bottom3.gif" width="2" height="14"></td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>
<script src="ArticleEditor/Edit.js" type="text/javascript"></script>
<!--#include file="../include/PicShow.asp"-->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -