<!--#include File="../ConnDB.asp"-->
<!--#include file="isAdmin.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" c>
<title>LED厂家管理</title>
<link href="../style.css" rel="stylesheet">
<script language="javascript">
function newwin(url) {
var oth="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=200,top=200";
oth = oth+",width=500,height=400";
var newwin=window.open(url,"newwin",oth);
newwin.focus();
return false;
}
function SelectChk()
{
var s=false;
var goodsid,n=0;
var strid,strurl;
var nn = self.document.all.item("goods")
for (j=0;j<nn.length;j++)
{
if (self.document.all.item("goods",j).checked)
{
n = n + 1;
s=true;
goodsid = self.document.all.item("goods",j).id+"";
if(n==1)
{
strid = goodsid;
}
else
{
strid = strid + "," + goodsid;
}
}
}
strurl = "GoodsDelt.asp?id=" + strid;
if(!s) {
alert("请选择要删除的公司!");
return false;
}
if ( confirm("你确定要删除这些公司吗?")) {
form1.action = strurl;
form1.submit();
}
}
function sltAll()
{
var nn = self.document.all.item("goods");
for(j=0;j<nn.length;j++)
{
self.document.all.item("goods",j).checked = true;
}
}
function sltNull()
{
var nn = self.document.all.item("goods");
for(j=0;j<nn.length;j++)
{
self.document.all.item("goods",j).checked = false;
}
}
function gotoPage_Click(ftypeid)
{
var PageList=document.getElementById("selPage");
var selIndex=PageList.selectedIndex;
var PageNum=PageList.options[selIndex].value;
self.location="'GoodsList.asp?firsttypeid=" +ftypeid"&page="+PageNum;
}
</script>
</head>
<body link="#000080" vlink="#080080">
<form id="form1" name="form1" method="POST">
<p align="center"><font color="#000080"><b><font style="font-size: 12pt">LED 厂 家
管 理</font></b></font></p><BR>
<%
'读取当前商品类别编号
firsttypeid = CLng(Request("firsttypeid"))
If firsttypeid < 0 Then
firsttypeid = 0
End If
Dim rs
Set rs = Server.CreateObject("ADODB.RecordSet")
'读取商品类别
sql = "SELECT * FROM FirstAreasType ORDER BY Id"
rs.Open sql,Conn,1,1
If rs.EOF Then
Response.Write("没有区域类别")
Else
Do While Not rs.EOF
If rs("id") = firsttypeid Then
Response.Write(rs("Type"))
Else
Response.Write("<a href='GoodsList.asp?firsttypeid=" & Trim(rs("id")) & "'>" & Trim(rs("Type")) & "</a>")
End If
Response.Write(" | ")
rs.MoveNext
Loop
End If
%>
<div align="center">
<table border="1" cellspacing="0" width="100%" style='FONT-SIZE: 9pt; border-collapse:collapse' cellpadding="0" bordercolor="#0000FF">
<tr>
<td width="6%" align="center" bgcolor="#FFFFCC"><strong>编号</strong></td>
<td width="17%" align="center" bgcolor="#FFFFCC"><strong>公司名称</strong></td>
<td width="17%" align="center" bgcolor="#FFFFCC"><strong>公司网址</strong></td>
<td width="26%" align="center" bgcolor="#FFFFCC"><strong>公司地址</strong></td>
<td width="10%" align="center" bgcolor="#FFFFCC"><strong>联系人姓名</strong></td>
<td width="10%" align="center"
bgcolor="#FFFFCC"><strong>联系人手机</strong></td>
<td width="10%" align="center"
bgcolor="#FFFFCC"><strong>修改</strong></td>
<td width="10%" align="center"
bgcolor="#FFFFCC"><strong>选择</strong></td>
</tr>
<%
rs.Close
'设置SQL语句,读取当前指定商品类别中的所有商品列表
If firsttypeid=0 Then
sql = "SELECT * FROM LedCompany ORDER BY Posttime"
Else
sql = "SELECT * FROM LedCompany WHERE FirstTypeId = " & Trim(firsttypeid) & " ORDER BY Posttime"
End If
rs.Open sql,Conn,1,1
If rs.EOF Then
Response.Write "<tr><td colspan=8 align=center>目前还没有客户。</td></tr></table>"
Else
'设置每页显示记录的数量
rs.PageSize = 30
'读取参数page,表示当前页码
IF Request("page")<>"" Then
iPage = CLng(Request("page"))
Else
iPage=1
End IF
If iPage > rs.PageCount Then
iPage = rs.PageCount
End If
If iPage <= 0 Then
iPage = 1
End If
rs.AbsolutePage = iPage
For i=1 To rs.PageSize
n = n + 1
%>
<tr><td align="center"><%=n%></td>
<td><a href="../GoodsView.asp?id=<%=rs("id")%>" ><%=rs("Co_Name")%></a></td>
<td align="center"><%=rs("Web_Address")%></td>
<td align="center"><%=rs("Address")%></td>
<td align="center"><%=rs("Name")%></td>
<td align="center"><%=rs("Mobile")%></td>
<td align="center"><a href="GoodsEdit.asp?id=<%=rs("id")%>" >修改</a></td>
<td align="center"><input type="checkbox" name="goods" id="<%=rs("id")%>" style="font-size: 9pt"></td></tr>
<%
rs.MoveNext()
If rs.EOF Then
Exit For
End If
Next
%>
</table>
</div>
<%
'显示页码
Response.Write(
输入页码: <select
id=""selPage"">")
'将页数添加到下拉框中
for i=1 to rs.PageCount
Response.Write "<option"
If iPage = i Then
Response.Write " selected "
End If
Response.Write ">" & i & "</option>"
next
Response.Write("</select> <input onClick=gotoPage_Click('"&Trim(firsttypeid)&"'); type=""button"" name=""gotoPage"" value=""打开""></form>")
'显示第一页,如果当前页就是第一页,则不生成链接
if iPage>1 then
Response.Write "<a href='GoodList.asp?firsttypeid=" & Trim(firsttypeid) & "&page=" & 1 & "'>第一页</A>"
else
Response.Write "第一页"
end if
'显示上一页,如果不存在上一页,则不生成链接
if iPage>1 then
Response.Write "<a href='GoodsList.asp?firsttypeid=" & Trim(firsttypeid) & "&page=" & (iPage-1) & "'>上一页</A>"
else
Response.Write "上一页"
end if
'显示下一页,如果不存在下一页,则不生成链接
if iPage<>rs.PageCount Then
Response.Write "<a href='GoodsList.asp?firsttypeid=" & Trim(firsttypeid) & "&page=" & (iPage+1) & "'>下一页</A>"
else
Response.Write "下一页"
end if
'显示最后一页,如果当前页就是最后一页,则不生成链接
if iPage <> rs.PageCount then
Response.Write "<a href='GoodsList.asp?firsttypeid=" & Trim(firsttypeid) & "&page=" & rs.PageCount & "'>最后一页</A>"
else
Response.Write "最后一页"
end if
End If
%>
<td width=200 class=main height="13" align="center"><font color="#FF0000"><%=iPage%>/<%=rs.PageCount%></font></td></table>
<p align="center">
<input type="button" value="添加客户"
name=add>
<input type="button" value="全 选"
name=button1>
<input type="button" value="清 空"
name=button2>
<input type="submit" value="删 除" name="tijiao" >
<br><br>
<input type=hidden name="goods">
</form>
</body>
</html>
修改后的代码