<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link type="text/css" rel="stylesheet" href="../Css/style.css" />
<script language="javascript" type="text/javascript" src="../jQuery/lib/jquery.js"></script>
<script language="javascript" type="text/javascript" src="../js/WebSite.js"></script>
</head>
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Function.asp"-->
<body>
<%
Call ChkLogin(session("WebAdminsUserName"))
Call ConnectionDataBase(2)
TenderID = Request("TenderID")
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
    <%
	Sql="Select top 1 Title From T_Tender Where TenderID=" & TenderID
	SetRs Rs,Sql,conn,1,1
	IF Not Rs.EOF Then Response.Write "&nbsp;项目名称:&nbsp;" & Rs("Title")
	DisRs Rs
	%>
    </td>  
  </tr>
</table>
<form action="Delete.asp" method="post" name="frm" onsubmit="return Confirm('确定要删除所选记录吗?删除后将无法恢复')">
<input type="hidden" name="Action" value="DelBallot">
<table width="100%" border="0" cellspacing="0" cellpadding="0">  
  <%
  	'该项目是否有中标者
	Sql = "SELECT count(*) AS total FROM T_Ballot Where TenderID=" & TenderID & " AND Accept=true"
	SetRs Rs,Sql,conn,1,1
	IF Not Rs.EOF Then total=Rs("total")
	DisRs Rs
	
	Sql = "SELECT * FROM T_Ballot Where TenderID=" & TenderID & " ORDER BY Accept ASC,AddTime DESC"
	SetRs Rs,Sql,conn,1,1
	IF Rs.eof And Rs.bof Then
		Response.write "<tr><td colspan='5'>&nbsp;没有相关记录!</td></tr>"
	Else
		n=0
		Rs.pagesize=10
		IF Not isempty(request("page")) And isnumeric(request("page")) Then 				  
			p=cint(request("page"))   
			IF p>Rs.pagecount Then p=Rs.pagecount
		Else   
			p=1
		End IF             
		Rs.AbsolutePage=p
		do while not Rs.eof	
		Accept=""
		BtnValue="中标"
		ConfirmValue="确定要设置该会员为中标者吗?"
		Business=1
		IF Rs("Accept") Then
			Accept="<font color='#ff0000'>[中标]</font>"
			BtnValue="取消"
			ConfirmValue="确定要取消该会员的中标资格吗?"
			Business=-1
			BtnCss=""
		Else
			IF total>0 Then BtnCss="style='display:none'"
		End IF
  %>
  <tr>
    <th width="14%" align="left"><input name="ChkBox" type="checkbox" value="<%=Rs("ID")%>" /><%=n+1%></th>
    <th width="65%" align="left">投标时间:<%=Rs("AddTime")%></th>
    <th width="20%" align="right"><input type="button" name="submit" value="<%=BtnValue%>" class="btn" <%=BtnCss%> onclick="if(Confirm('<%=ConfirmValue%>')) {window.location.href='Submit.asp?action=AcceptTender&business=<%=Business%>&UserID=<%=Rs("UserID")%>&ID=<%=Rs("ID")%>&TenderID=<%=TenderID%>'}"></th>
  </tr>
  <tr>
    <td align="center">
	<%
	StrSql="Select Top 1 ID,RealName,Logo,Business From T_Users Where ID=" & Rs("UserID")
	SetRs Rs1,StrSql,Conn,1,1
	IF Not Rs1.Eof Then
		logo="/images/untitled.jpg"		
		IF Rs1("Logo")<>"" Then logo="/UpLoadFiles/Users/" & Rs1("Logo")		
		Response.Write "<img src='"& logo &"' width='100' /><br />" & Rs1("RealName") & Accept & "<div style='width:100px; text-align:left'>成交量:" & Rs1("Business") & "</div>"
	End IF
	DisRs Rs1
	%>
	</td>
    <td align="left" valign="top" colspan="2" style="padding:10px; line-height:18px"><%=Rs("Content")%></td>  
  </tr>
  <%  
		n=n+1     
		Rs.movenext
		IF n>=Rs.pagesize Then Exit Do
		Loop
    End IF
  %>
  <tr>
    <th>
    <input type="submit" name="submit" value="删除" class="btn">
    <input name="" type="checkbox" value="" style="margin-left:10px" onclick="CheckAll(this.checked);"/>全选/反选
    
    </th>
	<th colspan="2" align="right" class="FontWeight">
	<%
	Call showpage(Rs.pagesize,Rs.recordcount,p,Rs.pagecount,"&TenderID=" & TenderID)
	DisRs Rs
	Call CloseDataBase
	%>
	</th>   
	
  </tr>
</table>
</form>
</body>
</html>
