<!--#include file="conn.asp"-->
<!--#include file="adminset.asp"-->
<%if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');window.location.href='login.asp';</script>"
response.End
end if
if session("flag")>2 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
response.End
end if
if qx14<>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
response.End
end if
%>
<html>
<head>
<title>网软志成在线购物系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="../css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style2 {color: #FF0000}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
}
-->
</style>
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="1%" height="28">&nbsp;</td>
    <td width="99%"><table width="100%" border="0" cellspacing="0" cellpadding="5">
      <tr>
        <td width="77%" height="27" style="font-size:14px;color:#ffffff">&nbsp;<strong><font color="#000000">网软志成购物后台管理系统 &gt;&gt; 系统管理 &gt;&gt; 缺货登记管理 </font></strong></td>
        <td width="23%" style="font-size:14px;color:#ffffff"><span class="style2">* 为必添项目</span></td>
      </tr>
    </table></td>
  </tr>
</table>
<%
Function unHtml(content)
	ON ERROR RESUME NEXT
	unHtml=content
	IF content <> "" Then
		unHtml=Server.HTMLEncode(unHtml)
		unHtml=Replace(unHtml,vbcrlf,"<br>")
		unHtml=Replace(unHtml,chr(9),"&nbsp;&nbsp;&nbsp;&nbsp;")
		unHtml=Replace(unHtml," ","&nbsp;")
	End IF
	IF Err.Number <>0 Then
		unHtml= "HTML转换中出错请联系管理员<br>"
		Err.Clear
	End IF
End Function
%>
<%
set rs=server.createobject("adodb.recordset")
rs.open "select * from shop_qhdj order by id desc",conn,3,2
%>
<SCRIPT language=JavaScript>

function is_number(str)
{
	exp=/[^0-9()-]/g;
	if(str.search(exp) != -1)
	{
		return false;
	}
	return true;
}

function CheckInput(){

	if(form.name.value==''){
		alert("您没有填写昵称！");
		form.name.focus();
		return false;
	}
	if(form.name.value.length>20){
		alert("昵称不能超过20个字符！");
		form.name.focus();
		return false;
	}

	if(!is_number(document.form.qq.value)){
		alert("QQ号必须是数字！");
		form.qq.focus();
		return false;
	}

	if(form.content.value==''){
		alert("您没有填写留言内容！");
		form.content.focus();
		return false;
	}
	if(form.content.value.length>255){
		alert("留言内容不能超过255个字符！");
		form.content.focus();
		return false;
	}
	
	return true;
}
</SCRIPT>
<br>
<%
if rs.eof and rs.bof then
%>
<table width="380" border="0" align="center" cellpadding="4" >
  <tr>
    <td height="40" align="center">
      <p class="style2">还没有任何登记！</p></td>
  </tr>
</table>
<%else%>
<%
	  	rs.PageSize =5 '每页记录条数
		iCount=rs.RecordCount '记录总数
		iPageSize=rs.PageSize
    	maxpage=rs.PageCount 
    	page=request("page")
    	per_page=rs.PageSize
    
    if Not IsNumeric(page) or page="" then
        page=1
    else
        page=cint(page)
    end if
    
    if page<1 then
        page=1
    elseif  page>maxpage then
        page=maxpage
    end if
    
    rs.AbsolutePage=Page

	if page=maxpage then
		x=iCount-(maxpage-1)*iPageSize
	else
		x=iPageSize
	end if
%>
<%
For i=1 To x
'do while not rs.eof and e_page>0
%>
<TABLE width=95% border=0 align="center" cellPadding=3 cellSpacing=1 bgcolor="#999999">
  <TBODY>
    <TR>
      <TD bgcolor="#cccccc"><TABLE width="100%" border=0 cellpadding="0" cellspacing="0">
          <TBODY>
            <TR bgcolor="#cccccc">
              <TD width="67" height="23" align="center"><font color="#FF0000"><strong>第<%=rs("id")%>条</strong></font></TD>
              <TD width="464">&nbsp; [<a href="web_quehuo_reply.asp?id=<%=rs("id")%>">回复</a>][<a href="web_quehuo_del.asp?id=<%=rs("id")%>">删除</a>]
                  <%if rs("qq")<>"" then%>
                  <a title=QQ：<%=rs("qq")%>><img src="../img/qq.gif" width="16" height="16" border="0"> <%=rs("qq")%></a>
                  <%end if%>
&nbsp;
                <%if rs("email")<>"" then%>
                <a href="mailto:<%=rs("email")%>" target="_blank" title=Email：<%=rs("email")%>><img src="../img/email.gif" width="14" height="15" border="0"></a> <a href="mailto:<%=rs("email")%>" target="_blank" title=Email：<%=rs("email")%>><%=rs("email")%></a>
                <%end if%>
                <%if rs("url")<>"" then%>
                <a href="<%=rs("url")%>" target="_blank" title=主页：<%=rs("url")%>><img src="../img/url.gif" width="16" height="16" border="0"></a> <a href="<%=rs("url")%>" target="_blank" title=主页：<%=rs("url")%>><%=rs("url")%></a>
                <%end if%>
&nbsp;</TD>
            </TR>
          </TBODY>
      </TABLE></TD>
    </TR>
    <TR>
      <TD bgcolor="#F3F3F3"><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
          <TBODY>
            <TR>
              <TD>
                <TABLE width="98%" border=0 align="center" style="table-layout:fixed;word-break:break-all">
                  <TBODY>
                    <TR>
                      <TD> <strong><font color="<%=flzhbt%>">姓名：</font></strong><font color="<%=flzhzt%>"><%=rs("name")%></font>
                          <%if rs("sex")="boy" then%>
                        先生
                        <%else%>
                        小姐
                        <%end if%>
                        <br>
                        <font color="#FF0000"><strong>所缺商品： <%=rs("shp")%></strong></font><br>
                        <strong><font color="<%=flzhbt%>">内容：</font></strong><font color="<%=flzhzt%>"><%=unHtml(rs("content"))%></font></TD>
                    </TR>
                  </TBODY>
              </TABLE></TD>
            </TR>
          </TBODY>
      </TABLE></TD>
    </TR>
    <%if rs("reply")<>"" then%>
    <TR>
      <TD bgColor=#f2f2f2>
        <table width="100%" border="0" style="table-layout:fixed;word-break:break-all">
          <tr>
            <td width="10">&nbsp;</td>
            <td width="567"><font color="#FF0000">管理员( <%=rs("hfr")%> )回复：</font><br>
                <%=unHtml(rs("reply"))%></td>
          </tr>
      </table></TD>
    </TR>
    <%end if%>
  </TBODY>
</TABLE>
<br>
<%
'e_page=e_page-1
'rs.movenext
'loop
		RS.MoveNext
next
%>
<table width="100%" border="0">
  <tr>
    <td>
      <%
					call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>",per_page)
				  %>
    </td>
  </tr>
</table>
<%
rs.close
set rs=nothing
end if
%>
<!--#include file="copyright.asp"-->
<p><br>
</p>
<p>&nbsp; </p>
</body>
</html><%
Sub PageControl(iCount,pagecount,page,table_style,font_style,per_page)
'生成上一页下一页链接
    Dim query, a, x, temp
    action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")
	
    temp=""

    Response.Write("<table " & Table_style & ">" & vbCrLf )        
    Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR>" & vbCrLf )
    Response.Write("<TD align=right>" & vbCrLf )
    Response.Write(font_style & vbCrLf )    
        
    if page<=1 then
        Response.Write ("首页 " & vbCrLf)        
        Response.Write ("上页 " & vbCrLf)
    else        
        Response.Write("<A HREF=" & action & "?" & temp & "Page=1>首页</A> " & vbCrLf)
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page-1) & ">上页</A> " & vbCrLf)
    end if

    if page>=pagecount then
        Response.Write ("下页 " & vbCrLf)
        Response.Write ("尾页 " & vbCrLf)            
    else
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page+1) & ">下页</A> " & vbCrLf)
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & pagecount & ">尾页</A> " & vbCrLf)            
    end if

    Response.Write(" 页次：" & page & "/" & pageCount & "页" &  vbCrLf)
    Response.Write(" 共有" & iCount & "条/每页"&per_page&"条" &  vbCrLf)
    Response.Write(" 转到" & "<INPUT TYEP=TEXT NAME=page SIZE=4 Maxlength=8 VALUE=" & page & ">" & "页"  & vbCrLf & "<INPUT type=submit style=""font-size: 9pt"" value=GO class=b2>")
    Response.Write("</TD>" & vbCrLf )                
    Response.Write("</TR></form>" & vbCrLf )        
    Response.Write("</table>" & vbCrLf )        
End Sub
%>
