<!-- #include file="conn.asp" -->
<!-- #include file="include.asp" -->
<html>
<head>
<TITLE>武汉电脑报价网-PCBaoJia.com</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<script language="JavaScript">
<!--
function  check() {
if(document.searchid.action[0].checked==false && document.searchid.action[1].checked==false)
		{
			alert("请选择您执行的操作!");
			document.searchid.action[0].focus();
			return false;
		}
 else
	document.searchid.submit();
}
function  selectAll(checkBoxName){  
           var  elms  =  document.getElementsByName(checkBoxName);  
           if  (elms.length<1)  return;  
           var  allChecked  =  true;  
           for  (var  i=0;i<elms.length;i++)  
                       if  (elms[i].type=="checkbox")  
                                   allChecked  &=  elms[i].checked;  
           for  (var  i=0;i<elms.length;i++)  
                       if  (elms[i].type=="checkbox"){  
                                               elms[i].checked  =  !allChecked;  
                                               if  (elms[i].onClick)  elms[i].onClick();  
                       }  
}   
function  mm(o)  
{  
     var  a  =  document.getElementsByName("selAnnounce");  
     for  (var  i=0;  i<a.length;  i++){  
         a[i].checked  =  o.checked;  
     }  
       
}
// -->
</script>
<BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<%call head(0)%>
<table width="764" border="0" cellpadding="0" cellspacing="0" background="images/bg_body.gif" align="center">
  <tr>
    <td align="center"><table width="760" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="159" align="center" valign="top" bgcolor="3E93C9"><TABLE WIDTH=157 BORDER=0 CELLPADDING=0 CELLSPACING=0>
              <TR>
                <TD COLSPAN=3> <IMG SRC="images/login_t.gif" WIDTH=157 HEIGHT=38 ALT=""></TD>
              </TR>
              <TR>
                <TD> <IMG SRC="images/login_l.gif" WIDTH=9 HEIGHT=112 ALT=""></TD>
                <TD width="139" align="center" bgcolor="#FFFFFF"><%call login%></TD>
                <TD> <IMG SRC="images/login_r.gif" WIDTH=9 HEIGHT=112 ALT=""></TD>
              </TR>
              <TR>
                <TD COLSPAN=3> <IMG SRC="images/login_b.gif" WIDTH=157 HEIGHT=8 ALT=""></TD>
              </TR>
            </TABLE>
              <br>
              <table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#2F75A6" bgcolor="2F75A6">
                <tr>
                  <td height="3" bgcolor="#3399CC"></td>
                </tr>
                <tr>
                  <td align="center" class="white_b_14">最新加盟经销商</td>
                </tr>
            </table>
			<table width="100%" border="0" cellpadding="5" cellspacing="0">
                <tr>
                  <td class="white"><%call new_com%></td>
                </tr>
              </table>
		  </td>
          <td align="center" valign="top"><TABLE WIDTH=600 BORDER=0 CELLPADDING=0 CELLSPACING=0>
              <TR>
                <TD> <IMG SRC="images/body_l.gif" WIDTH=5 HEIGHT=10 ALT=""></TD>
                <TD></TD>
                <TD align="right"> <IMG SRC="images/body_r.gif" WIDTH=5 HEIGHT=10 ALT=""></TD>
              </TR>
            </TABLE>
              <table width="578"  border="0" cellpadding="0" cellspacing="1" bgcolor="2F75A6">
                <tr>
                  <td bgcolor="FFFFFF"><table width="100%" height="235"  border="0" cellpadding="10" cellspacing="0">
                      <tr>
                        <td height="4" bgcolor="ADECF9"></td>
                      </tr>
                      <tr>
                        <td height="408" align="center" valign="top"><br>
                          状态注释：<b><font color=red>√</font></b>表示此报价已经通过了审核,<b><font color=gray>×</font></b>表示此报价尚未通过审核
                          <TABLE width="100%" border=1 align=center cellPadding=0 cellSpacing=1 borderColorLight=#cccccc borderColorDark=white bgcolor="#EFFCFE">
<Form name="searchid" method="POST" action="">
                            <tr align="center" bgcolor="#C7F3FF">
                              <td width="8%" bgcolor="#C7F3FF">编号</td>
                              <td bgcolor="#C7F3FF"> 产品名称</td>
                              <td width="14%">价格</td>
                              <td width="15%">登记时间</td>
							  <td width="8%">状态</td>
                              <td width="5%"><input name="checkbox"  type=checkbox  onClick="mm(this)"  value="Check  All"></td>
                            </tr>
                            <%
page=request.querystring("page")
com_id=session("com_id")
DIM totalPut
DIM CurrentPage
DIM TotalPages
DIM i,j
const MaxPerPage=20
'if not isempty(request("upid")) then
'call upid
'end if
'if not isempty(request("delid")) then
'call del
'end if
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if

if not isempty(request("selAnnounce")) then
idlist=request("selAnnounce")
if instr(idlist,",")>0 then
dim idarr
idArr=split(idlist)
dim id
for i = 0 to ubound(idarr)
id=clng(idarr(i))
select case request.form("action")
case "up_offer"
call up_offer(id)
case "del_offer"
call del_offer(id)
end select
next
else
select case request.form("action")
case "up_offer"
call up_offer(clng(idlist))
case "del_offer"
call del_offer(clng(idlist))
end select
end if
end if

dim rs
dim sql
set rs=server.createobject("adodb.recordset")
sql = "select * from offer where com_id="&com_id&" order by idate desc"
rs.open sql,conn,1,1 
if rs.eof and rs.bof then 
response.write "<p align='center'>对不起，没有您要查询的信息</p>" 
else 
totalPut=rs.recordcount 
if currentpage<1 then 
currentpage=1 
end if 
if (currentpage-1)*MaxPerPage>totalput then 
if (totalPut mod MaxPerPage)=0 then 
currentpage= totalPut \ MaxPerPage 
else 
currentpage= totalPut \ MaxPerPage + 1 
end if 
end if 
if currentPage=1 then 
showContent totalput,MaxPerPage
showpage totalput,MaxPerPage,""
else 
if (currentPage-1)*MaxPerPage<totalPut then 
rs.move (currentPage-1)*MaxPerPage 
dim bookmark 
bookmark=rs.bookmark 
showContent totalput,MaxPerPage
showpage totalput,MaxPerPage,""
else 
currentPage=1 
showContent totalput,MaxPerPage
showpage totalput,MaxPerPage,""
end if 
end if 
rs.close 
end if 
set rs=nothing
sub showContent (totalput,MaxPerPage)
do while not rs.eof%>
                            <tr class="hand" align="center" bgcolor="#ffffff" onmouseover="this.style.backgroundColor='EFFCFE'" onmouseout="this.style.backgroundColor='#ffffff'">
                              <td><%=rs("id")%></td>
                              <td><%
set rs2=server.createobject("adodb.recordset")
sql2 = "select * from products where pro_id="&rs("pro_id")
rs2.open sql2,conn,1,1
if rs2.eof and rs2.bof then 
response.write "-" 
else 
Response.Write(rs2("pro_name"))
end if
rs2.close
set rs2=nothing
%></td>
                              <td><%=rs("price")%>/<span class="red_12px"><%=rs("price_in")%></span></td>
                              <td><%=rs("idate")%></td>
                              <td><%if rs("pas")=true then Response.Write("<b><font color=red>√</font></b>") else Response.Write("<b><font color=gray>×</font></b>") end if%></td>
							  <td><input type='checkbox' name='selAnnounce' value='<%=cstr(rs("id"))%>'></td>
                            </tr>
                            
                            <% i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%><tr align="center" bgcolor="#C7F3FF">
                              <td>操作</td>
                              <td height="30" colspan="5" align="right" bgcolor="#C7F3FF" class="red"><input type="radio" name="action" value="up_offer">
更新
  <input type="radio" name="action" value="del_offer">
删除&nbsp;
<input name="button" type="button" onClick="check()" value='提交'></td>
                            </tr></form>
                          </table>
                          <%
end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then 
n= totalnumber \ maxperpage 
else 
n= totalnumber \ maxperpage+1 
end if 
if CurrentPage<2 then 
response.write "<table border=0 width=90% cellspacing=0 cellpadding=0>" 
response.write "<tr height=30>"
response.write "<td>"
response.write "共<font color=#ff6600><b>"&n&"</b></font>页&nbsp;第<font color=#ff6600><b>"&CurrentPage&"</b></font>页&nbsp;共检索到<font color=#ff6600><b>"&totalnumber&"</b></font>条信息</td>" 
response.write "<td align=right>"
response.write "【最前页】【上一页】" 
else 
response.write "<table border=0 width=90% cellspacing=0 cellpadding=0>"
response.write "<tr height=30>"
response.write "<td>"
response.write "共<font color=#ff6600><b>"&n&"</b></font>页&nbsp;第<font color=#ff6600><b>"&CurrentPage&"</b></font>页&nbsp;共检索到<font color=#ff6600><b>"&totalnumber&"</b></font>条信息</td>"
response.write "<td align=right>"
response.write "【<a href="&filename&"?page=1>最前页</a>】" 
response.write "【<a href="&filename&"?page="&CurrentPage-1&">上一页</a>】" 
end if 
if n-currentpage<1 then 
response.write "【下一页】【最后页】" 
else 
response.write "【<a href="&filename&"?page="&(CurrentPage+1)&">" 
response.write "下一页</a>】【<a href="&filename&"?page="&n&">最后页</a>】" 
end if 
response.write "</td>"
response.write "</tr>"
response.write "</table>"
response.write "</form>"
end function
%></td>
                      </tr>
                      <tr>
                        <td height="2" bgcolor="ADECF9"></td>
                      </tr>
                  </table></td>
                </tr>
            </table>
              <table width="96%" height="5"  border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td></td>
                </tr>
              </table></td>
        </tr>
    </table></td>
  </tr>
</table>
<TABLE WIDTH=764 BORDER=0 CELLPADDING=0 CELLSPACING=0 align="center">
  <TR>
    <TD> <IMG SRC="images/foot_1.gif" WIDTH=4 HEIGHT=8 ALT=""></TD>
    <TD> <IMG SRC="images/foot_2.gif" WIDTH=153 HEIGHT=8 ALT=""></TD>
    <TD> <IMG SRC="images/foot_3.gif" WIDTH=3 HEIGHT=8 ALT=""></TD>
    <TD> <IMG SRC="images/foot_4.gif" WIDTH=600 HEIGHT=8 ALT=""></TD>
    <TD> <IMG SRC="images/foot_5.gif" WIDTH=4 HEIGHT=8 ALT=""></TD>
  </TR>
</TABLE>
    <!--#include file="foot.asp"-->
</body>
</html>
<%
sub del_offer(id)
dim rs,sql
set rs=server.createobject("adodb.recordset")
sql="delete from [offer] where id="&cstr(id)
conn.execute sql
if err.Number<>0 then
err.clear
response.write "删 除 失 败 !<br>"
end if
End sub 

sub up_offer(id)
dim rs,sql
set rs=server.createobject("adodb.recordset")
sql="update offer set idate=now() where id="&cstr(id)
conn.execute sql
if err.Number<>0 then
err.clear
response.write "更 新 失 败 !<br>"
end if
End sub 
%>