<!--#include file="conn.asp"-->
<%if session("nyeee_admin")="" then
response.redirect "login.asp"
end if

lid=request("id")

if not isChkInteger(lid) then
response.write "<script>alert('参数错误，窗口将关闭！');window.close();</script>"
response.end
end if

sql="select * from nyeee_qydata where id=cint('"&lid&"')"
set rs=server.createobject("adodb.recordset")
rs.open sql,connstr,1,3

if (not rs.eof and rs("person")=session("nyeee_admin")) or (not rs.eof and session("nyeee_admin")<>"") then
dname=HtmlEncode(trim(request.form("dname")))
dusername=HtmlEncode(trim(request.form("username")))
dpassword=HtmlEncode(trim(request.form("password")))
dyewu=HtmlEncode(trim(request.form("dyewu")))
dlei=split(HtmlEncode(trim(request.form("dlei"))),"@")
dfaren=HtmlEncode(trim(request.form("dfaren")))
dpic=HtmlEncode(trim(request.form("dpic")))
dcity=HtmlEncode(trim(request.form("dcity")))
dhttp=HtmlEncode(trim(request.form("dhttp")))
dmail=HtmlEncode(trim(request.form("dmail")))
daddress=HtmlEncode(trim(request.form("daddress")))
dyoubian=HtmlEncode(trim(request.form("dyoubian")))
dtel=HtmlEncode(trim(request.form("dtel")))
dfax=HtmlEncode(trim(request.form("dfax")))
djieshao=HtmlEncode(request.form("djieshao"))

if dname<>"" then
rs("name")=dname
rs("username")=dusername
rs("password")=dpassword
rs("yewu")=dyewu
rs("leiid")=dlei(0)
rs("lei")=dlei(1)
rs("faren")=dfaren
rs("pic")=dpic
rs("city")=dcity
rs("http")=dhttp
rs("mail")=dmail
rs("address")=daddress
rs("youbian")=dyoubian
rs("tel")=dtel
rs("fax")=dfax
rs("jieshao")=djieshao
if session("nyeee_admin")<>"" then
rs("mark")=HtmlEncode(trim(request.form("dmark")))
rs("tuijian")=HtmlEncode(trim(request.form("dtuijian")))
end if
rs.update
session("edituser")=dname
response.redirect "ookqy.asp?pageid="&request("pageid")
end if
else
session("message")="您只能修改自己添加的信息！"
response.redirect "errorqy.asp"
end if%>

<html>
<head>
<style type="text/css">
<!-- 
td           { font-size: 12px; line-height: 17px }
body         { font-size: 12px; line-height: 17px }
p            { margin-top: 1; margin-bottom: 1 }
a:link       { text-decoration: none; color: black }
a:visited    { text-decoration: none; color: black }
a:active     { text-decoration: none }
a:hover      { text-decoration: underline; color: red }
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>修改信息</title>
<SCRIPT LANGUAGE="JavaScript">
<!--//
function checkadd()
{   
    if (document.postart.dname.value.length<1)
	{
        alert("单位名称不能为空！");
        document.postart.dname.focus();
        return false;
    }
    if (document.postart.username.value.length<1)
	{
        alert("用户名不能为空！");
        document.postart.username.focus();
        return false;
    }
    if (document.postart.password.value.length<1)
	{
        alert("登录密码不能为空！");
        document.postart.password.focus();
        return false;
    }
}
//-->
</SCRIPT>
<script language="Javascript">
function openScript(url, width, height){
	var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=no,menubar=no,frameborder=0,status=yes' );
}
function openem()
{ 
openScript('upload.asp',300,60); 
}
</script>
</head>

<body>
 <div align="center">
  <center>
  <form action="" method="post" name="postart" onsubmit="return checkadd()">
  <table border="0" width="100%" cellspacing="0" cellpadding="0" height="489">
    <tr>
      <td width="100%" colspan="2" height="30"></td>                                      
    </tr>                                        
    <tr>              
      <td width="25%" align="right" height="26">单位名称：</td>                                         
      <td width="76%" height="26"><input type="text" name="dname" size="30" value="<%=rs("name")%>"> <font color="#FF0000">*</font></td>                                                                                                                                                    
    </tr>                                                                                                           
    <tr>                                                                            
      <td width="25%" align="right" height="26">用 户 名：</td>                                                                                                                    
      <td width="76%" height="26"><input type="text" name="username" size="30" value="<%=rs("username")%>"> <font color="#FF0000">*</font></td>                                                                                                                                                    
    </tr>                                                                            
    <tr>                                                                            
      <td width="25%" align="right" height="26">登录密码：</td>                                                                                                                    
      <td width="76%" height="26"><input type="text" name="password" size="30" value="<%=rs("password")%>"> <font color="#FF0000">*</font></td>                                                                                                                                                    
    </tr>                                                                                                                                         
    <tr>                                                                           
      <td width="25%" align="right" height="26">主营业务：</td>                                                                                                                   
      <td width="76%" height="26"><input type="text" name="dyewu" size="50" value="<%=rs("yewu")%>"> </td>                                                                                                                                                   
    </tr>                                                                          
    <tr>                                                                                                                                        
      <td width="25%" align="right" height="26">所在区域：</td>                                                                                                                                       
      <td width="76%" height="26">                                                                                                                                       
          <select name="dcity" size="1"><option selected value="<%=rs("city")%>"><%=rs("city")%></option>                                                                                                                                                
            <%set rs_city = server.createobject("adodb.recordset")                                                                                                                                                
			sql = "select * from city"                                                                                                                                                
			rs_city.open sql,conn,1,1                                                                                                                                                
			do while not rs_city.eof%>                                                                                                                                                
          <option value="<%=rs_city("city")%>"><%=rs_city("city")%></option>                                                                                                                                                
		  <%rs_city.movenext                                                                                                                                                
		  loop                                                                                                                                                
		  rs_city.close                                                                                                                                                
		  set rs_city = nothing%>                                                                                                                                                
         </select> <font color="#FF0000">*</font>                                                                                                                                                
      </td>                                                                                                                                         
    </tr>                                                                            
    <tr>                                                                                                                                        
      <td width="25%" align="right" height="26">行业类别：</td>                                                                                                                                       
      <td width="76%" height="26">                                                                                                                                       
          <select name="dlei" size="1"><option selected value="<%=rs("leiid")%>@<%=rs("lei")%>"><%=rs("lei")%></option>                                                                                                                                                
            <%set rs_lei = server.createobject("adodb.recordset")                                                                                                                                                
			sql = "select * from nyeee_lei"                                                                                                                                                
			rs_lei.open sql,conn,1,1                                                                                                                                                
			do while not rs_lei.eof%>                                                                                                                                                
          <option value="<%=rs_lei("id")%>@<%=rs_lei("lei")%>"><%=rs_lei("lei")%></option>                                                                                                                                                
		  <%rs_lei.movenext                                                                                                                                                
		  loop                                                                                                                                                
		  rs_lei.close                                                                                                                                                
		  set rs_lei = nothing%>                                                                                                                                                
         </select> <font color="#FF0000">*</font>                                                                                                                                                
      </td>                                                                                                                                         
    </tr>                                                                     
    <tr>                                                                                                                                         
      <td width="25%" align="right" height="26">单位地址：</td>                                                                                                                                         
      <td width="76%" height="26"><input type="text" name="daddress" size="30" value="<%=rs("address")%>"> </td>                                                                                                                                                    
    </tr>                                                                                                                                         
    <tr>                                                                                                                                         
      <td width="25%" align="right" height="26">邮政编码：</td>                                                                                                                                         
      <td width="76%" height="26"><input type="text" name="dyoubian" size="30" value="<%=rs("youbian")%>" maxlength="6"></td>                                                                                                                                         
    </tr>                                                                    
    <tr>                                                                                                                                       
      <td width="25%" align="right" height="26">联 系 人：</td>                                                                                                                                      
      <td width="76%" height="26"><input type="text" name="dfaren" size="30" value="<%=rs("faren")%>"> </td>                                                                                                                                                    
    </tr>                                                                                                                                         
    <tr>                                                                                                                                         
      <td width="25%" align="right" height="26">联系电话：</td>                                                                                                                                         
      <td width="76%" height="26"><input type="text" name="dtel" size="30" value="<%=rs("tel")%>"> </td>                                                                                                                                                    
    </tr>                                                                                                                                         
    <tr>                                                                                                                                         
      <td width="25%" align="right" height="26">联系传真：</td>                                                                                                                                         
      <td width="76%" height="26"><input type="text" name="dfax" size="30" value="<%=rs("fax")%>"></td>                                                                                                                                         
    </tr>                                                                     
    <tr>                                                                                                                                         
      <td width="25%" align="right" height="26">电子信箱：</td>                                                                                                                                         
      <td width="76%" height="26"><input type="text" name="dmail" size="30" value="<%=rs("mail")%>"></td>                                                                                                                                         
    </tr>                                                                                                                                                                                                             
    <tr>                                                                                                                                         
      <td width="25%" align="right" height="26">网站地址：</td>                                                                                                                                         
      <td width="76%" height="26"><input type="text" name="dhttp" size="30" value="<%=rs("http")%>"></td>                                                                                                                                         
    </tr>                                                                                                                                                                                                                                                                                                                                       
    <tr>                                                                                                                                        
      <td width="25%" align="right" height="126">详细资料：</td>                                                                                                                                        
      <td width="76%" height="126"><textarea rows="10" name="djieshao" cols="50"><%if rs("jieshao")<>"" then%><%=replace(rs("jieshao"),"<br>",vbcrlf)%><%end if%></textarea>                                                                                                                                       
      </td>                                                                                                                                                
    </tr>                                                                                                                                                                                                                                          
    <tr>                                                                   
      <td width="25%" align="right" height="13">资料图片：</td>                                                                                                                                        
      <td width="76%" height="13"><input type="text" name="dpic" size="30" value="<%=rs("pic")%>"> [<a href="JavaScript:openem()">上传图片</a>]                                                                   
        <font color="#FF0000">无图片请不要修改此项</font></td>                                                                                                                                                
    </tr>                                 
    <%if session("nyeee_admin")<>"" then%>                               
     <tr>                                
      <td width="25%" align="right" height="30">是否通过：</td>                                                                                                                                
      <td width="76%" height="30"><input type="radio" value="0" <%if rs("mark")="0" then%>checked<%end if%> name="dmark">不通过&nbsp;                                
        <input type="radio" name="dmark" value="1" <%if rs("mark")="1" then%>checked<%end if%>>通过</td>                                                                                                                                        
    </tr>                                 
    <tr>                                
      <td width="25%" align="right" height="30">是否推荐：</td>                                                                                                                                
      <td width="76%" height="30"><input type="radio" value="no" <%if rs("tuijian")="no" then%>checked<%end if%> name="dtuijian">不推荐&nbsp;                                
        <input type="radio" name="dtuijian" value="yes" <%if rs("tuijian")="yes" then%>checked<%end if%>>推荐</td>                                                                                                                                        
    </tr>                                
    <%end if%>                                                               
  <tr>                                                                                                                                   
      <td width="24%" align="right" height="51">                                                                                                                       </td>                                                                                                                                                  
      <td width="77%" align="right" height="51">                                                                                                                                     
        <p align="left"><input type="submit" value="提交" name="submit" >&nbsp;                                                     
        <input type="reset" value="取消" name="reset">&nbsp; <input type="button" value="返回" name="cmdexit" onclick=" history.back()"></td>                                                                                                                                        
  </tr>                                                                                                                                                                                                                
  </table>                                                             
  </form>                                                                                                                                        
</div>                                                                                                                                                                                                                                           
</body>                                                                                                                                                                         
                                                                                                                                                                         
</html>                                                                                                                                                                         
