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

📄 recomco.asp

📁 本房地产网站功能强大
💻 ASP
📖 第 1 页 / 共 2 页
字号:
	 for(i=0;i<=document.form2.CoTel.value.length;i++)
	 {
	  if (astring.indexOf(document.form2.CoTel.value.substring(i,i+1))==-1)
	   {
	    alert("联系电话中含有非法字符!");
		document.form2.CoTel.focus();
		return false;
	   }
	 }
	 for(i=0;i<=document.form2.CoZIP.value.length;i++)
	 {
	  if (astring.indexOf(document.form2.CoZIP.value.substring(i,i+1))==-1)
	   {
	    alert("邮编中含有非法字符!");
		document.form2.CoZIP.focus();
		return false;
	   }
	 }
	 for(i=0;i<=document.form2.CoFax.value.length;i++)
	 {
	  if (astring.indexOf(document.form2.CoFax.value.substring(i,i+1))==-1)
	   {
	    alert("传真中含有非法字符!");
		document.form2.CoFax.focus();
		return false;
	   }
	 }
	return true;
  }			
</script></td>
                      </tr>
                    </form>
                  </table></div>
<%
                  end sub
                  sub edit
                  	    coid=RtnReplaceInt(request("coid"),0)
	    Set Rs=Server.CreateObject("adodb.recordset")
		  rs.Open"select * from recomco where coid="&coid&"",conn,1,1
		  if rs.eof then
		   response.Write("记录不存在!")
		   response.end
		  End if
		  strcotype=Trim(Rs("cotype"))
                  %><div align="center">
	<table width="88%" border="0" cellpadding="0" cellspacing="1" bgcolor="#7E9FE2">
                    <form action="?action=saveedit" name="form2" method="post" enctype="multipart/form-data">
                      <tr bgcolor="#585858"> 
                        <td height="25" colspan="2" align="center" bgcolor="#CAD6F4"> 推 荐 公 司 修 
                          改</td>
                      </tr>
                      <tr bgcolor="#585858"> 
                        <td width="19%" height="24" align="center" bgcolor="#CAD6F4">公司名称:</td>
                        <td height="24" bgcolor="#CAD6F4"> <input name="CoName" type="text" id="CoName" value="<%=Trim(rs("CoName"))%>" size="30"> 
                          <font color="#FF6600">*</font></td>
                      </tr>
                      <tr bgcolor="#585858"> 
                        <td height="24" align="center" bgcolor="#CAD6F4">公司类别:</td>
                        <td height="24" bgcolor="#CAD6F4"><select name="CoType" id="CoType">
                            <option value="1" <%if strcotype=1 Then response.Write("selected")%>>房产公司</option>
                            <option value="2" <%if strcotype=2 Then response.Write("selected")%>>搬家公司</option>
                            <option value="3" <%if strcotype=3 Then response.Write("selected")%>>评估公司</option>
                            <option value="4" <%if strcotype=4 Then response.Write("selected")%>>物业公司</option>
                          </select></td>
                      </tr>
                      <tr bgcolor="#585858"> 
                        <td height="24" align="center" bgcolor="#CAD6F4">公司图片:</td>
                        <td height="24" bgcolor="#CAD6F4"><%bz=rs("img")
	if bz<>"" then%><input name="oldpic" type="hidden" value="<%=bz%>"><img border="0" src="../fyfile/<%=bz%>" width="100" height="50"><br><%end if%><input name="pic" type="file">&nbsp;<br>
&nbsp;无图或者不做修改请留空</td>
                      </tr>
                      <tr bgcolor="#585858"> 
                        <td height="24" align="center" bgcolor="#CAD6F4">公司地址:</td>
                        <td height="24" bgcolor="#CAD6F4"> <input name="CoAddress" type="text" id="CoAddress" value="<%=Trim(rs("CoAddress"))%>" size="40"> 
                          <font color="#FF6600">*</font></td>
                      </tr>
                      <tr bgcolor="#585858"> 
                        <td height="24" align="center" bgcolor="#CAD6F4">联 系 人:</td>
                        <td height="24" bgcolor="#CAD6F4"><input name="LinkMan" type="text" id="LinkMan" value="<%=Trim(Rs("LinkMan"))%>"> 
                          <font color="#FF6600">*</font></td>
                      </tr>
                      <tr bgcolor="#585858"> 
                        <td height="24" align="center" bgcolor="#CAD6F4">联系电话:</td>
                        <td height="24" bgcolor="#CAD6F4"><input name="CoTel" type="text" id="CoTel" value="<%=Trim(Rs("CoTel"))%>"> 
                          <font color="#FF6600">*</font></td>
                      </tr>
                      <tr bgcolor="#585858"> 
                        <td height="24" align="center" bgcolor="#CAD6F4">传  真:</td>
                        <td height="24" bgcolor="#CAD6F4"><input name="CoFax" type="text" id="CoFax" value="<%=Trim(Rs("CoFax"))%>"></td>
                      </tr>
                      <tr bgcolor="#585858"> 
                        <td height="24" align="center" bgcolor="#CAD6F4">邮  编:</td>
                        <td height="24" bgcolor="#CAD6F4"> <input name="CoZIP" type="text" id="CoZIP" value="<%=Trim(Rs("CoZIP"))%>" size="15"></td>
                      </tr>
                      <tr bgcolor="#585858"> 
                        <td height="24" align="center" bgcolor="#CAD6F4">E-mail:</td>
                        <td height="24" bgcolor="#CAD6F4"><input name="email" type="text" id="email" value="<%=Trim(Rs("coemail"))%>" size="50"> 
                          <font color="#FF6600">*</font></td>
                      </tr>
                      <tr bgcolor="#585858"> 
                        <td height="24" align="center" bgcolor="#CAD6F4">公司网址:</td>
                        <td height="24" bgcolor="#CAD6F4"><input name="CoHomeweb" type="text" id="CoHomeweb" value="<%=Trim(Rs("CoHomeweb"))%>" size="65"></td>
                      </tr>
                      <tr bgcolor="#585858"> 
                        <td height="120" align="center" bgcolor="#CAD6F4">公司简介:</td>
                        <td height="24" bgcolor="#CAD6F4"><textarea name="CoComment" cols="47" rows="7" id="CoComment"><%=Replace(Trim(Rs("CoComment")),"<br>",vbcrlf)%></textarea> 
                          <font color="#FF6600">*</font></td>
                      </tr>
                      <tr bgcolor="#585858"> 
                        <td height="24" colspan="2" align="center" bgcolor="#CAD6F4"><input name="coid" type="hidden" id="coid" value="<%=Trim(Rs("coid"))%>"> 
                        <input type="button" name="Submit" value=" 修 改 " onClick="return check();">
                             
                          <input type="reset" name="Submit2" value=" 重 置 "> <script language="JavaScript">
 function check()
  {
   var number="1234567890.";
   var astring="1234567890-()"
   if(document.form2.CoName.value=="")
    {
	 alert("请填写公司名称!");
	 document.form2.CoName.focus();
	 return false;
	}
   if(document.form2.CoType.value=="")
    {
	 alert("请选择公司类别!");
	 document.form2.CoType.focus();
	 return false;
	}
   if(document.form2.CoAddress.value=="")
    {
	 alert("请填写公司地址!");
	 document.form2.CoAddress.focus();
	 return false;
	}
   if(document.form2.LinkMan.value=="")
    {
	 alert("请填写联系人!");
	 document.form2.LinkMan.focus();
	 return false;
	}
   if(document.form2.CoTel.value=="")
    {
	 alert("请填写联系电话!");
	 document.form2.CoTel.focus();
	 return false;
	}
   if(document.form2.email.value=="")
    {
	 alert("请填写电子信箱!");
	 document.form2.email.focus();
	 return false;
	}
   if(document.form2.CoComment.value=="")
    {
	 alert("请填写公司简介");
	 document.form2.CoComment.focus();
	 return false;
	}
	 for(i=0;i<=document.form2.CoTel.value.length;i++)
	 {
	  if (astring.indexOf(document.form2.CoTel.value.substring(i,i+1))==-1)
	   {
	    alert("联系电话中含有非法字符!");
		document.form2.CoTel.focus();
		return false;
	   }
	 }
	 for(i=0;i<=document.form2.CoZIP.value.length;i++)
	 {
	  if (astring.indexOf(document.form2.CoZIP.value.substring(i,i+1))==-1)
	   {
	    alert("邮编中含有非法字符!");
		document.form2.CoZIP.focus();
		return false;
	   }
	 }
	 for(i=0;i<=document.form2.CoFax.value.length;i++)
	 {
	  if (astring.indexOf(document.form2.CoFax.value.substring(i,i+1))==-1)
	   {
	    alert("传真中含有非法字符!");
		document.form2.CoFax.focus();
		return false;
	   }
	 }
	document.form2.submit();
	return true;
  }
		
</script></td>
                      </tr>
                    </form>
                  </table></div>
<%
                  rs.close
                  set rs=nothing
                  end sub
sub saveadd
Server.ScriptTimeout=999
set request2=New UpLoadClass
	'上传总大小为2M
	request2.TotalSize= upload_m
	'单文件最大1M
	request2.MaxSize  = upload_t
'允许上传的格式
request2.FileType =uploadlx
'上传路径
request2.SavePath= "../fyfile/"
request2.open
img=request2.Form("pic")
'***************************判断上传
	if request2.Error=4 then
response.write"<SCRIPT language=JavaScript>alert('图片大小超过限制,上传失败!');"
response.write"javascript:history.go(-1) ;</SCRIPT>"
	end if
	if request2.Error=2 then
response.write"<SCRIPT language=JavaScript>alert('类型有误!');"
response.write"javascript:history.go(-1) ;</SCRIPT>"
end if

CoName =Trim(request2.Form("CoName"))
 CoType=Trim(request2.Form("CoType"))
CoAddress =Trim(request2.Form("CoAddress"))
LinkMan =Trim(request2.Form("LinkMan"))
CoTel =Trim(request2.Form("CoTel"))
CoFax =Trim(request2.Form("CoFax"))
CoZIP =Trim(request2.Form("CoZIP"))
email =Trim(request2.Form("email"))
CoHomeweb =Trim(request2.Form("CoHomeweb"))
CoComment =dvHTMLEncode(request2.Form("CoComment"))
Conn.Execute"insert into recomco(CoName,CoType,CoAddress,LinkMan,CoTel,CoFax,CoZIP,CoEmail,CoHomeweb,CoComment,img) values ('"&CoName&"','"&CoType&"','"&CoAddress&"','"&LinkMan&"','"&CoTel&"','"&CoFax&"','"&CoZIP&"','"&email&"','"&CoHomeweb&"','"&CoComment&"','"&img&"')"
Response.Redirect("recomco.asp")
                  end sub
                  sub del
                    ids=split(request("coid"),",") 
  for i=0 to ubound(ids)
  coid=request("coid")
    tt=ids(i)
	Set rs=Server.CreateObject("adodb.recordset")
	 rs.Open"select * from recomco where coid="&tt&"",conn,1,1
	 strpic=rs("img")
if strpic<>"" then
strpic="../fyfile/"&strpic
Call fy_DelFiles(strpic)
end if
	 
    conn.execute"delete from recomco where coid="&tt&""
  next
  response.redirect"recomco.asp"
end sub
sub saveedit
set request2=New UpLoadClass
	'上传总大小为2M
	request2.TotalSize= upload_m
	'单文件最大1M
	request2.MaxSize  = upload_t
'允许上传的格式
request2.FileType =uploadlx
'上传路径
request2.SavePath= "../fyfile/"
request2.open
CoName =Trim(request2.Form("CoName"))
 CoType=Trim(request2.Form("CoType"))
CoAddress =Trim(request2.Form("CoAddress"))
LinkMan =Trim(request2.Form("LinkMan"))
CoTel =Trim(request2.Form("CoTel"))
CoFax =Trim(request2.Form("CoFax"))
CoZIP =Trim(request2.Form("CoZIP"))
email =Trim(request2.Form("email"))
CoHomeweb =Trim(request2.Form("CoHomeweb"))
CoComment =Trim(request2.Form("CoComment"))
CoComment = Replace(CoComment,vbcrlf,"<br>")
coid=RtnReplaceInt(request2.Form("coid"),0)
img=request2.Form("pic")
oldpic=request2.Form("oldpic")
if pic<>"" then
if oldpic<>"" then	
			set fso1 = CreateObject("Scripting.FileSystemObject")
			fso1.DeleteFile Server.MapPath(request2.SavePath&oldpic)
			set fso1 = nothing
			end if
else
pic=oldpic
end if
Conn.Execute"update recomco set CoName='"&CoName&"',CoType='"&CoType&"',CoAddress='"&CoAddress&"',LinkMan='"&LinkMan&"',CoTel='"&CoTel&"',CoFax='"&CoFax&"',CoZIP='"&CoZIP&"',CoEmail='"&email&"',CoHomeweb='"&CoHomeweb&"',CoComment='"&CoComment&"',img='"&img&"' where coid="&coid&""
 response.Write"<script>alert ('您已修改成功'); window.location.href='recomco.asp'</script>"
                  end sub
                  conn.close
                  set conn=nothing%>
<!--#include file="end.asp" -->
</body>
</html>

⌨️ 快捷键说明

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