edit.asp

来自「OA最新破解2008版 全新 破解 希望大家用着舒服」· ASP 代码 · 共 315 行

ASP
315
字号
<%
if instr(session("flag"),"22")=0 then
response.redirect "../login.asp"
response.end
end if
%>
<!--#include file="../../conn/dbconn2.asp" -->
<!--#include file="../../inc/safe.asp"-->
<!--#include file="../../inc/config.asp"--><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../style.css" rel=stylesheet type=text/css>
</head>
<%
if Chkrequest(request("id")) then
id=request("id")
else
response.Redirect("../../login/chklogin.asp?login=4")
response.end
end if
sql="select * from productshow where id="&id&""
Set rs= conn.execute(sql)
if rs.eof then 
response.write"<SCRIPT language=JavaScript> this.location.href='javascript:window.history.go(-1)';</SCRIPT>" 
response.end
else

set rs3=conn.execute("select class_2.*,class_1.* from class_2,class_1 where class_2.typeid="&rs("typeid")&" and class_1.sortid=class_2.sortid")
%>

<TABLE class=content_border cellSpacing=0 cellPadding=0 width=100% 
border=0>
  <TBODY>
        <TR>
          <TD align=middle>
		  
<SCRIPT language=JavaScript>

function setSubjectText(){
	
	if(trim(document.form.cpmc.value) == "") {
		    alert("请先填写产品名称");
			document.form.cpmc.focus();
		    return false;
	} 
	if(trim(document.form.cpgg.value) == "") {
		    alert("请先填写产品型号");
			document.form.cpgg.focus();
		    return false;
	} 
	if(trim(document.form.cpcd.value) == "") {
		    alert("请先填写产品原产地");
			document.form.cpcd.focus();
		    return false;
	} 
	
	if(trim(document.form.sortid.value) == "") {
		    alert("请先选择行业大类");
			document.form.sortid.focus();
		    return false;
	} 
	if(trim(document.form.typeid.value) == "") {
		    alert("请先选择行业子类");
			document.form.typeid.focus();
		    return false;
	} 
	if(trim(document.form.keywords.value) == "") {
		    alert("注意:请按左至右的顺序填写\n\n关键字最少要填一个");
			document.form.keywords.focus();
		    return false;
	}
	if(trim(document.form.xxsm.value) == "") {
		    alert("请先填写详细说明");
			document.form.xxsm.focus();
		    return false;
	} 


   var keywords = form.keywords.value;
   for(i=0;i<keywords.length;i++){keywords=keywords.replace(',',',');}
    if(form.keywords2.value){
        for(i=0;i<form.keywords2.value.length;i++){form.keywords2.value=form.keywords2.value.replace(',',',');}
        keywords+=','+form.keywords2.value;
    }
    if(form.keywords3.value){
        for(i=0;i<form.keywords3.value.length;i++){form.keywords3.value=form.keywords3.value.replace(',',',');}
        keywords+=','+form.keywords3.value;
    }    
    form.p_z_Z_Keywords.value = keywords
	
  //  return true;
	document.form.submit()
    }
function trim(inputString) {
	   
              if (typeof inputString != "string") { return inputString; }
              var retValue = inputString;
              var ch = retValue.substring(0, 1);
              while (ch == " ") { 
	          //检查字符串开始部分的空格
                  retValue = retValue.substring(1, retValue.length);
                  ch = retValue.substring(0, 1);
              }
              ch = retValue.substring(retValue.length-1, retValue.length);
              while (ch == " ") {
                 //检查字符串结束部分的空格
                 retValue = retValue.substring(0, retValue.length-1);
                 ch = retValue.substring(retValue.length-1, retValue.length);
              }
              while (retValue.indexOf("  ") != -1) { 
	         //将文字中间多个相连的空格变为一个空格
                 retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); 
              }
              return retValue;
           } 	

</SCRIPT>

<script language = "JavaScript"> 
sall=new Array();
<%
Dim i
i=0
set rs2=conn.execute("select * from class_2")
do while not rs2.eof
%>
sall[<%=i%>]=new Array("<%=rs2("typename")%>","<%=rs2("sortid")%>","<%=rs2("typeid")%>");
<%
i=i+1
rs2.movenext
loop
rs2.close
%>
function changeselect(selvalue)  
   { 
      document.form.typeid.length=0;  
      var selvalue=selvalue;
      var i;
      for(i=0;i<sall.length;i++) 
	{
	    if(sall[i][1]==selvalue) 
      		{
  	var newOption1=new Option(sall[i][0],sall[i][2]);
	document.all.typeid.add(newOption1);
		}
	}
}
</script> 
<form method="POST" action="save_edit.asp" name="form" enctype="multipart/form-data">
<input type="hidden" name="filepath" value="<%=newspic%>">
<input type="hidden" name="id" value="<%=id%>">
          <BR>
          <TABLE cellSpacing=2 cellPadding=3 width="100%" border=0>
              <COLGROUP>
              <COL class=formtop></COLGROUP>
              <TBODY>
             
			  
              <TR>
                <TD class=C bgColor=#eff7ff><FONT color=#ff0000>*</FONT> 
                  <B>产品名称:</B></TD>
                <TD class=lh15 bgColor=#ffffde><INPUT maxLength=50 size=30 name="cpmc" value="<%=rs("cpmc")%>"> <BR>
                          <SPAN 
                  class=note>例:“数控车床”</SPAN></TD>
                      </TR>
				<TR>
                <TD class=C bgColor=#eff7ff><FONT color=#ff0000>*</FONT> 
                  <B>产品型号:</B></TD>
                <TD class=lh15 bgColor=#ffffde><INPUT maxLength=50 size=30 name="cpgg" value="<%=rs("cpgg")%>"> <BR>
                          <SPAN 
                  class=note>例:“CJK0632”</SPAN> </TD>
                      </TR>
				<TR>
                <TD class=C bgColor=#eff7ff><FONT color=#ff0000>*</FONT> 
                  <B>原 产 地:</B></TD>
                <TD class=lh15 bgColor=#ffffde><INPUT maxLength=50 size=30 name="cpcd" value="<%=rs("cpcd")%>"> <BR>
                          <SPAN 
                  class=note>例:“广东省北京市”</SPAN> </TD>
                      </TR>
              <TR>
                <TD class=C bgColor=#eff7ff><FONT color=#ff0000>*</FONT> 
                  <B>行 业:</B></TD>
                <TD class=lh15 bgColor=#ffffde>
				<select name="sortid" onChange="changeselect(document.form.sortid.options[document.form.sortid.selectedIndex].value)" size="1"> 
<option selected value="<%=rs3("sortid")%>"><%=rs3("sort")%></option> 
                            <%
set rs1=conn.execute("select * from class_1 where sortid<>"&rs3("sortid")&"")
do while not rs1.eof
response.write "<option value='"&rs1("sortid")&"'>"&rs1("sort")&"</option>"&chr(13)+chr(10)
rs1.movenext
loop
rs1.close
%>
                            
</select> 
<select name="typeid"> 
<option selected value="<%=rs3("typeid")%>"><%=rs3("typename")%></option> 
                            <%
set rs4=conn.execute("select * from class_2 where sortid="&rs3("sortid")&" and typeid<>"&rs3("typeid")&"")
do while not rs4.eof
response.write "<option value='"&rs4("typeid")&"'>"&rs4("typename")&"</option>"&chr(13)+chr(10)
rs4.movenext
loop
rs4.close
rs3.close
%>
                             
</select>
		
	   <BR>
                          <SPAN 
                  class=note>指您产品所属的行业</SPAN> </TD>
                      </TR>
              
				<TR>
                <TD class=C vAlign=top width="20%" 
                bgColor=#eff7ff><B>产品图片:</B></TD>
                <TD class=lh15 bgColor=#ffffde>
                  <INPUT type="file" name="file" style="FONT-SIZE: 9pt; WIDTH: 250px" maxLength=50 size=30 title=上传产品图片资料不能大于200K。>
				  <input type="hidden" name="img" value="<%=rs("Picture")%>">
                          <br>
                          使用原有图片 
                          <input type="radio" name="cimg" value="1" checked>
                          | 删除原有图片重新上传 
                          <input type="radio" name="cimg" value="2"></TD>
              <TR>
                <TD class=C vAlign=top bgColor=#eff7ff><FONT 
                  color=#ff0000>*</FONT> <B>关键字:</B></TD>
                <TD class=lh15 bgColor=#ffffde>
				          <%
				keywords=rs("keywords")
				if keywords<>"" then
				  if instr(keywords,",")>0 then
				     kwarry=split(keywords,",")
					 if ubound(kwarry)=1 then
				           response.write"<INPUT maxLength=8 size=10 value='"&kwarry(0)&"' name=keywords>, <INPUT maxLength=8 size=10 value='"&kwarry(1)&"' name=keywords2>, <INPUT maxLength=8 size=10 name=keywords3>"
				           elseif ubound(kwarry)=2 then
				           response.write"<INPUT maxLength=8 size=10 value='"&kwarry(0)&"' name=keywords>, <INPUT maxLength=8 size=10 value='"&kwarry(1)&"' name=keywords2>, <INPUT maxLength=8 size=10 value='"&kwarry(2)&"' name=keywords3>"
                           elseif ubound(kwarry)>2 then
				           response.write"<INPUT maxLength=8 size=10 value='"&kwarry(0)&"' name=keywords>, <INPUT maxLength=8 size=10 value='"&kwarry(1)&"' name=keywords2>, <INPUT maxLength=8 size=10 value='"&kwarry(2)&"' name=keywords3>"
                     end if
				  else
				  response.write"<INPUT maxLength=8 size=10 value='"&keywords&"' name=keywords>, <INPUT maxLength=8 size=10 name=keywords2>, <INPUT maxLength=8 size=10 name=keywords3>"
                  end if
				else
				response.write"<INPUT maxLength=8 size=10 name=keywords>, <INPUT maxLength=8 size=10 name=keywords2>, <INPUT maxLength=8 size=10 name=keywords3>"
				end if
				%>
                           <INPUT type=hidden 
                  name=p_z_Z_Keywords> <SPAN 
                  class=note><BR>用产品名、行业类目做关键字,可填1-3个(每个最多8个字),尽量填全;<BR>
                          例:供应发电机,可填“发电机”“发电机及电动机”“机械”为关键字<BR>
                    </SPAN></TD>
                </TR>
              <TR>
                <TD class=C bgColor=#eff7ff><FONT color=#ff0000>*</FONT> 
                  <B>详细说明:</B></TD>
                <TD class=lh15 bgColor=#ffffde><TEXTAREA name="xxsm" rows=10 cols=50><%=rs("xxsm")%></TEXTAREA> 
                  <SPAN class=note><BR>说明尽可能详细,以提高信息的可信度,促使您做成生意;<BR><FONT 
                  color=red>注意:请不要在详细说明中留下公司名称和任何联系方式。</FONT></SPAN> </TD></TR>
              </TBODY></TABLE><BR>
          <span class="C">补充更多信息(非必须)</span><BR>
          <BR>
            
            <TABLE cellSpacing=2 cellPadding=3 width="100%" border=0>
              <COLGROUP>
              <COL class=formtop></COLGROUP>
              <TBODY>
			  <TR>
                <TD class=C bgColor=#eff7ff><B>产品品牌:</B></TD>
                <TD class=lh15 bgColor=#ffffde><INPUT 
                  style="FONT-SIZE: 9pt; WIDTH: 250px" maxLength=50 size=30 
                  name="cpsb" value="<%=rs("cpsb")%>"> </TD></TR>
              
              <TR>
                <TD class=C bgColor=#eff7ff><B>产品数量</B>:</TD>
                <TD class=lh15 bgColor=#ffffde><INPUT 
                  style="FONT-SIZE: 9pt; WIDTH: 250px" maxLength=50 size=30 
                  name="Quantity" value="<%=rs("Quantity")%>"></TD></TR>
              <TR>
                <TD class=C bgColor=#eff7ff><B>包装说明:</B></TD>
                <TD class=lh15 bgColor=#ffffde><INPUT 
                  style="FONT-SIZE: 9pt; WIDTH: 250px" maxLength=50 size=30 
                  name="Packaging" value="<%=rs("Packaging")%>"></TD></TR>
              <TR>
                <TD class=C bgColor=#eff7ff><B>价格说明:</B></TD>
                <TD class=lh15 bgColor=#ffffde><INPUT 
                  style="FONT-SIZE: 9pt; WIDTH: 250px" maxLength=50 size=30 
                  name="cpjg" value="<%=rs("cpjg")%>"></TD></TR></TBODY></TABLE><BR>
            <TABLE cellSpacing=6 cellPadding=3 width="95%" bgColor=#f9f9f9 
            border=0>
              <TBODY>

              <TR>
                <TD><INPUT type=checkbox <%if rs("FeedbackFlag")=true then response.write"CHECKED"%> value="<%=rs("FeedbackFlag")%>" 
                  name="FeedbackFlag">
                          我将优先考虑“互联会员”的反馈 
                        </TD>
                        </TR></TBODY></TABLE><BR>
          <BR>
            <TABLE cellSpacing=0 cellPadding=4 border=0>
              <TBODY>
              <TR>
                
                <TD vAlign=top noWrap><INPUT class=subbutton style="WIDTH: 160px" onclick=javascript:setSubjectText() type=button value=一切完成,我要发布! name=Post> 
                </TD></TR></TBODY></TABLE></FORM><BR>
</TD></TR></TBODY></TABLE>
<%
end if
rs.close
set rs=nothing
rs5.close
set rs5=nothing
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

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