<!--#include file="conn.asp"-->
<!--#include file="yns_chklogin.asp" -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<link href="style/css.css" rel="stylesheet" type="text/css">
</head>
<%
if trim(request("action"))="del" then
	dim id 
	id = request("id")
	if id<>"" and not isempty(id) then
		conn.execute "delete * from zhaoshang where id in("&id&")"
		Response.Redirect(request.ServerVariables("HTTP_REFERER"))
		Response.end
	end if
end if
%>
<script language="JavaScript">
function sel_all(o){
var i
for (i=0;i<form1.id.length;i++){
	form1.id(i).checked=o.checked;
}
}
</script>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<%
dim V_id
v_id=Request.QueryString("v_id")
if isnumeric(v_id) and not isempty(v_id) then
	rs.open "select * from zhaoshang where id="&v_id,conn,1,3
	if rs.eof then 
		Response.write "没有找到"
	else
	rs("read")=true
%>
<script language="JavaScript">opener.location.reload();</script>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="10" bgColor=#FFFFFF>
  <tr> 
    <td bgcolor="#EFEFEF">
      <table width="100%" border="1" cellspacing="0" cellpadding="0">
        <tr>
          <td><br>
            <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr> 
                <td><%=rs("content")%></td>
              </tr>
            </table>
            <br>
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td align="center" bgcolor="#EFEFEF"><input type="button" name="Submit" value="关　闭" onClick="window.close();">
    </td>
  </tr>
</table>
<%
rs.update
end if
response.end
end if
%>
<form name="form1" method="post" action="?action=del" onSubmit="return confirm('确定删除?')">
  <table width="98%" border="1" align="center" cellpadding="0" cellspacing="2" bordercolor="#CCCCCC">
    <tr  class="td-title-color"> 
      <td>&nbsp;</td>
      <td colspan="3">管理招商</td>
      <td>&nbsp;</td>
    </tr>
    <%
  rs.open "select * from zhaoshang order by id desc",conn,1,1,1
  rs.pagesize=20
  if rs.eof then
	  Response.write "<tr><td colspan=5>没有信息</td></tr>"
  else
  dim i
  %>
    <tr class="td-body-color" > 
      <td width="8%">ID</td>
      <td>已读否</td>
      <td>希望代理区域</td>
      <td width="19%">时间</td>
      <td width="9%">操作</td>
    </tr>
    <%
	page=clng(request("page"))
	if page<1 Then page=1
	if page>rs.pagecount then page=rs.pagecount
	rs.AbsolutePage=page
	  for i=1 to rs.pagesize
  %>
    <tr> 
      <td height="20">&nbsp;<%=rs("id")%></td>
      <td width="5%" align="center"> 
        <%
	  if rs("read")=true then
	  	Response.write "√"
	   else
	   	Response.write "<font color=red>X</font>"
	  end if
	  %>
        &nbsp;</td>
      <td width="59%"><a href="#$" onClick="window.open ('?v_id=<%=rs("id")%>','','width=500,height=500,scrollbars=yes')"><%=rs("jobname")%></a></td>
      <td>&nbsp; 
        <%
	dates=split(rs("time")," ")(0)
	times=split(rs("time")," ")(1)
	select case datediff("d",dates,date())
	case 0 
		Response.write "<font color=red>今天 "&times&"</font> "
	case 1
		Response.write "昨天 "&times
	case else
		Response.write dates &" "& times
	end select
	%>
      </td>
      <td><input name="id" type="checkbox" id="id" value="<%=rs("id")%>"></td>
    </tr>
    <%
   rs.movenext
  if rs.eof then exit for
  next
  %>
    <tr> 
      <td height="18">&nbsp;</td>
      <td colspan="2">&nbsp;共<%=rs.recordcount%>条&nbsp;&nbsp;共<%=rs.pagecount%>页&nbsp;&nbsp;第<%=page%>页 
        转到 
        <%
												  if page>1 then
													  Response.write "<a href=""?page="&page-1&""">上一页</a>"
												  else
													  response.write "上一页"
												  end if
												  response.write "&nbsp;&nbsp;&nbsp;"
												  if page<rs.pagecount then
												  		response.write "<a href=""?page="&page+1&""">下一页</a>"
													else
														response.write "下一页"
												  end if
												  %>
        <select name="select" onChange="location='?page='+this.value">
          <%
				  for i=1 to rs.pagecount
				  %>
          <option value="<%=i%>" <%if page=i then response.write "selected"%>><%=i%></option>
          <%
				  next
					rs.close
					conn.close
					set rs=nothing
					set conn=nothing
				  %>
        </select>
        页 　　　　 　　 
        <input type="button" name="Submit2" value="刷新" onclick="location.reload();"></td>
      <td><input name="Submit1" type="submit" id="Submit1" value="删除选中"></td>
      <td><input name="id2" type="checkbox" id="id2" onClick="sel_all(this)">
        全选</td>
    </tr>
    <%end if%>
  </table>
</form>
</body>
</html>