<!--#include virtual="/config/config.asp" -->
<!--#include virtual="/config/uercheck.asp" -->
<%

if session("u_levelid")="" then session("u_levelid")=1
'sqlstring="select * from v_pricelist where p_fatherid='"&session("bizbid")&"' and p_u_level='" & session("u_levelid") & "'"
sqlstring="SELECT productlist.p_name,productlist.p_price as ppprice, productlist.P_proId, pricelist.p_price, producttype.pt_name, productlist.p_size, productlist.p_type FROM (productlist INNER JOIN pricelist ON productlist.P_proId = pricelist.p_proid) INNER JOIN producttype ON productlist.p_type = producttype.pt_id WHERE (pricelist.p_u_level = "&session("u_levelid")&")"

p_type=strtonum(Requesta("p_type"))
str=trim(requesta("str"))
p_proid=trim(requesta("search_p_proid"))
p_name=trim(requesta("search_p_name"))
s=requesta("s")
newsqlstr=""
sorts=""

if len(trim(s))<=0 then 
	sortsql=" order by productlist.p_proid"
	s=0
	
else

	if s=0 then
	sortsql=" order by pricelist.p_price"
	sorts=""
	else
	sorts=" desc"
	sortsql=" order by pricelist.p_price desc"
	end if
If trim(requesta("pd"))="m" Then
	if s=0 then 
		s=1
	else
		s=0
	end if
end if
end if

If Requesta("module")="search" Then
	If  Requesta("pages")<>"" Then
		pages =strtonum(Requesta("Pages"))
		conn.open constr
		if instr(sortsql,"pricelist.p_price")>0 then
			sqlstr1=replace(session("sqlsearch"),"productlist.p_name","pricelist.p_price")
			
		else
			sqlstr1=session("sqlsearch")
		end if
		
		rs.open sqlstr1 &" "&sorts ,conn,3
	else
		
		
		sqllimit=""
		if p_proid<>"" then sqllimit=sqllimit & " and productlist.p_proid like '%"& lcase(p_proid) &"%'"
		if p_name<>"" then sqllimit=sqllimit & " and productlist.p_name like '%"& lcase(p_name) &"%'"
		If p_type<>"" and p_type>0 Then sqllimit= sqllimit & " and productlist.p_type="&p_type
		sqlcmd= sqlstring & sqllimit
		'重新查找  分别需要定义 传上来的参数等等求出
		conn.open constr
		session("sqlsearch")=sqlcmd & sortsql
		rs.open session("sqlsearch") ,conn,3
	End If
else
	conn.open constr
	p_type=3
	newsqlstr=" and productlist.p_type=3 "
	sqlcmd= sqlstring & newsqlstr
	session("sqlsearch")=sqlcmd & sortsql


	rs.open session("sqlsearch"),conn,3
End If


%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="../css/Admin_Style.css" rel=stylesheet>
<body leftmargin='2' topmargin='0' marginwidth='0' marginheight='0'>

<table width='100%' border='0' align='center' cellpadding='2' cellspacing='1'>
  <tr class='topbg'>
    <td height='30' align="center" ><strong>登陆日志</strong></td>
  </tr>
</table>
<table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>
  <tr class='tdbg'>
    <td width='91' height='30' align="center" ><strong>管理导航：</strong></td>
    <td width="771"><a href="/manager/productall/default.asp?module=search&amp;p_type=1"><font color="#000000" >空 间</font></a>|<a href="/manager/productall/default.asp?module=search&amp;p_type=3"><font color="#000000">域 
    名</font></a>|<a href="/manager/productall/default.asp?module=search&amp;p_type=2"><font color="#000000">邮 
    局</font></a>|<a href="/manager/productall/default.asp?module=search&amp;p_type=7">MSSQL数据库</a>|<a href="/manager/productall/default.asp?module=search&amp;p_type=4">搜索引擎</a></td>
  </tr>
</table>
      <table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>
        <tr class='tdbg'>
          <td height='30' ><!--#include file="../share/AgentPrice.asp"--></td>
        </tr>
      </table>
      <br />
<table width="100%" border="0" cellpadding="0" cellspacing="0">
                          <tr> 
                            <td> 
                              <!--  BODY  -->
                          <table width="100%" border="0" align="center" cellpadding="4" cellspacing="0" class="border">
                          <form name="searchform" action="<%=request("script_name")%>" method="post">
                          <tr>
                            <td width="39%" align="right" class="tdbg">产品ID:</td>
                            <td width="61%" class="tdbg"><input name="search_p_proid" type="text" class="inputbox" value="<%=p_proid%>"></td>
                          </tr>
                          <tr>
                            <td align="right" class="tdbg">产品名称:</td>
                            <td class="tdbg"><input type="hidden" value="search"  name="module" />
                            <input name="search_p_name" type="text" class="inputbox" value="<%=p_name%>"></td>
                          </tr>
                          <tr>
                          <td align="center" class="tdbg">                          </td>
                          <td class="tdbg"><input type="submit" class="inputbox" value="  搜 索  ">
                            &nbsp;</td>
                          </tr>
                          </form>
                         </table>

                             
                              <%
If Not (rs.eof And rs.bof) Then
    Rs.PageSize = 20
    rsPageCount = rs.PageCount
    flag = pages - rsPageCount
    If pages < 1 or flag > 0 then pages = 1
    Rs.AbsolutePage = pages
%>
                              <form action="../usermanager/default.asp" method=post>
                                
        <table width="100%" border=0 align="center" cellpadding=2 cellspacing=1 class="border">
          <tr > 
            <td align="center" nowrap class="Title"> 
              <p style="margin-left: 9"><strong>产品名称</strong></p>
            </td>
            <td align="center" nowrap class="Title"> 
              <p style="margin-left: 9"><strong>产品ID</strong></p>
            </td>
            <td align="center" nowrap class="Title"> 
              <p style="margin-left: 6"><strong>销售价格</strong></p>
            </td>
            <td align="center" nowrap class="Title"><strong>您的价格</strong></td>
            <%if requesta("p_type")="3" or requesta("p_type")="" or requesta("p_type")="0" then%>
            <td align="center" nowrap class="Title"><strong>续费价格</strong></td>
            <%end if%>
            <td align="center" nowrap class="Title"><strong>产品类别</strong></td>
            <td align="center" nowrap class="Title"><strong>产品大小</strong></td>
          </tr>
          <%
Do While Not rs.eof And i<21

productid=rs("p_proid")
%>
          <tr bgcolor="#FFFFFF"> 
            <td nowrap class="tdbg"> 
              <p style="margin-left: 9"><%= rs("p_name") %> 
            </td>
            <td nowrap class="tdbg"> 
              <p style="margin-left: 9"><%= rs("p_proid") %> 
            </td>
            <td nowrap class="tdbg"> 
              <p style="margin-left: 6"><%= rs("ppprice") %>元</p>
            </td>
            <td nowrap class="tdbg"> 
              <p style="margin-left: 6"><%= GetNeedPrice(session("user_name"),rs("p_proid"),1,"new") %>元</p>
            </td>
            <%if requesta("p_type")="3" or requesta("p_type")="" or requesta("p_type")="0" then%>
            <td nowrap class="tdbg"> 
              <p style="margin-left: 6"><%= GetNeedPrice(session("user_name"),rs("p_proid"),1,"renew") %>元</p>
            </td>
            <%end if%>
            <td nowrap class="tdbg"> 
              <p style="margin-left: 6"><%=rs("pt_name")%> 
            </td>
            <td nowrap class="tdbg"> 
              <p style="margin-left: 6"> 
                <%if(rs("p_type")=1 or rs("p_type")=2)then%>
                <%= rs("p_size") %>Mb 
                <%else%>
                - 
                <%end if%>
              </p>
            </td>
          </tr>
          <%
		rs.movenext
		i=i+1
	Loop
	rs.close
	conn.close
	%>
          <tr bgcolor="#FFFFFF"> 
            <td colspan =7 align="center" bgcolor="#FFFFFF"> <a href="default.asp?module=search&amp;pages=1&amp;p_type=<%=p_type%>">第一页</a> 
              &nbsp; <a href="default.asp?module=search&amp;pages=<%=pages-1%>&amp;p_type=<%=p_type%>">前一页</a>&nbsp; 
              <a href="default.asp?module=search&pages=<%=pages+1%>&p_type=<%=p_type%>">下一页</a>&nbsp; 
              <a href="default.asp?module=search&pages=<%=rsPageCount%>&p_type=<%=p_type%>">共<%=rsPageCount%>页</a>&nbsp; 
              第<%=pages%>页</td>
          </tr>
        </table>
                              </form>
                              <br>
                              <%
  else
	rs.close
	conn.close
End If
%>
                              <!--  BODY END -->
                            </td>
                          </tr>
                          <tr> 
                            <td></td>
                          </tr>
                        </table>