<!--#include file="byshop_conn.asp"-->
<!--#include file="session.asp"-->

<%
if request("action")="update" then
    for i=1 to request.form("id").count
	id=replace(request.form("id")(i),"'","")
	company=replace(request.form("company")(i),"'","")
		username=replace(request.form("username")(i),"'","")
			tel=replace(request.form("tel")(i),"'","")
				address=replace(request.form("address")(i),"'","")
							url=replace(request.form("url")(i),"'","")
	zxorder=replace(request.form("zxorder")(i),"'","")
conn.execute("update zxgg set zxorder="&zxorder&" ,company='"&company&"' ,username='"&username&"' ,tel='"&tel&"' ,address='"&address&"'  ,url='"&url&"' where id="&id)
next
end if

if request("action")="add" then
	company=replace(request.form("company"),"'","")
		tel=replace(request.form("tel"),"'","")
		address=replace(request.form("address"),"'","")
			username=replace(request.form("username"),"'","")
	zxorder=replace(request.form("zxorder"),"'","")
		url=replace(request.form("url"),"'","")
	Set rs = Server.CreateObject("ADODB.Recordset")
rs.open "select * from zxgg ",conn,1,3
rs.addnew
rs("company")=company
rs("zxorder")=zxorder
rs("tel")=tel
rs("address")=address
rs("username")=username
rs("url")=url
rs.update
rs.close
response.Redirect "zxgg.asp"
end if

killid=request("killid")
if killid<>"" then
conn.execute "delete from zxgg where id in ("&killid&")"
response.Redirect "zxgg.asp"
response.End
end if


%> 
<html>
<head>
<title>二手房求购顶固</title>
<script>
function IsDigit()
{
  return ((event.keyCode >= 48) && (event.keyCode <= 57));
}
</script>
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
-<center>
<div align="center">
<table cellpadding="3" cellspacing="1" border="1" width="100%" class="tableBorder" style="border-collapse: collapse" bordercolor="#C0C0C0">
 <form method="post" action="zxgg.asp?action=update">
   <tr> 
	<th class="tableHeaderText" colspan=8 bgcolor="#E8F1FF">装修公司-管理</th>	
   </tr>
      <tr align=center> 
        <td class="forumRowHighlight" bgcolor="#F7F7F7" width="9%">ID</td>
        <td class="forumRowHighlight" bgcolor="#F7F7F7" width="13%">公司名称</td>
        <td class="forumRowHighlight" bgcolor="#F7F7F7" width="12%">联系人</td>
        <td class="forumRowHighlight" bgcolor="#F7F7F7" width="14%">联系电话</td>
        <td class="forumRowHighlight" bgcolor="#F7F7F7" width="14%">联系地址</td>
        <td class="forumRowHighlight" bgcolor="#F7F7F7" width="14%">链接地址</td>
        <td class="forumRowHighlight" bgcolor="#F7F7F7" width="9%">固顶排序</td>
        <td class="forumRowHighlight" bgcolor="#F7F7F7" width="9%">删除</td>
      </tr>
<%
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open "SELECT  * from zxgg  order by zxorder ",conn,1,1
if rs.recordcount=0 then 
%>
      <tr> 
        <td colspan="8" height=25 align="center" width="100%" class="forumRowHighlight" bgcolor="#F7F7F7"> 
		还没有装修公司</td>
      </tr>
<%
else
    do while not rs.eof
%>
      <tr height=25> 
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7"><%=rs("ID")%></td>
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7"> 
          <input type="hidden" name="id" value="<%=rs("id")%>">
          	<input class=text type="text" name="company" size="16" value="<%=rs("company")%>" ></td>
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7"> 
          	<input class=text type="text" name="username" size="16" value="<%=rs("username")%>" ></td>
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7"> 
          	<input class=text type="text" name="tel" size="16" value="<%=rs("tel")%>" ></td>
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7"> 
          	<input class=text type="text" name="address" size="16" value="<%=rs("address")%>" ></td>
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7"> 
          	<input class=text type="text" name="url" size="16" value="<%=rs("url")%>" ></td>
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7"> 
          <input class=text type="text" name="zxorder" size="4" value="<%=rs("zxorder")%>" ONKEYPRESS="event.returnValue=IsDigit();" ></td>
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7"> 
          <a href="zxgg.asp?killid=<%=rs("id")%>">删除</a> 
        </td>
      </tr>
      <%
    rs.MoveNext
    Loop
%>
      <tr> 
        <td colspan="8" height=25 align="center" width="100%" class="forumRowHighlight" bgcolor="#F7F7F7"> 
          <input class="button" type="submit" name="Submit2" value="保存修改" style="font-family: 宋体; font-size: 9pt" >
          &nbsp; 
          <input class="button" type="reset" value="重新设定" style="font-family: 宋体; font-size: 9pt" name="重置" >
        </td>
      </tr>
<%
end if
rs.close
set rs=nothing
%>
    </form>
    <form method="post" action="zxgg.asp?action=add">
      <tr height=25> 
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7">ID</td>
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7" > 
          <input class=text type="text" name="company" size="16" >
        </td>
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7" > 
          <input class=text type="text" name="username" size="16"></td>
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7" > 
          <input class=text type="text" name="tel" size="16" ></td>
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7" > 
          <input class=text type="text" name="address" size="16" ></td>
              <td align=center class="forumRowHighlight" bgcolor="#F7F7F7"> 
          <input class=text type="text" name="url" size="16" ></td>

        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7"> 
          <input class=text type="text" name="zxorder" size="4" ONKEYPRESS="event.returnValue=IsDigit();"></td>
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7"> 
          <input class="button" type="submit" name="Submit3" value="添加" style="font-family: 宋体; font-size: 9pt"></td>
      </tr>
    </form>
  </table>
</div>
</center>
</body>
</html> 
<%

%>