<!--#Include File="Connection.Asp"-->
<!--#Include File="JaClog.Asp"-->
<%
If Request.QueryString("action")="del" then
  Dim AllId,k,L
  AllId = Trim(Request.Form("check"))
  
  AllId = Split(AllId,",")
  If Ubound(AllId)=0 Then
    L =1 
  Else 
    L =Ubound(AllId)
  End If

  for k=0 to L
  Conn.ExeCute("DELETE FROM [JaBaal] WHERE ID='"&AllId(k)&"'")
  Next
  Response.Write "<script language=javascript>alert('删除用户偶像成功!');"
  Response.Write "window.document.location.href='MsgList.Asp';</script>"
  Response.End()
End If
Dim Rs,sqlstr,Img,MaxPerPage,text,checkpage,CurrentPage,i
If Request.QueryString("Sn")<>"" Then 
sqlstr = "SELECT * FROM [JaBaal] WHERE JaUid='"&Trim(Request.QueryString("Sn"))&"'"
else
sqlstr = "SELECT * FROM [JaBaal] Order By ID DESC"
End If
Set Rs=Server.CreateObject("ADODB.RecordSet")
rs.Open sqlstr,conn,1,1
MaxPerPage=30
text="0123456789"
Rs.PageSize=MaxPerPage
for i=1 to len(request("page"))
checkpage=instr(1,text,mid(request("page"),i,1))
if checkpage=0 then
exit for
end if
next

If checkpage<>0 then
If NOT IsEmpty(request("page")) Then
CurrentPage=Cint(request("page"))
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount
Else
CurrentPage= 1
End If
If not Rs.eof Then Rs.AbsolutePage = CurrentPage end if
Else
CurrentPage=1
End if
i=0
%> 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">



<title>无标题文档</title>
<link href="JaImg/css.css" rel="stylesheet" type="text/css">
</head>
<script src="../JsInc/AdminPages.js"></script>
<SCRIPT language=javascript>
function unselectall()
{
    if(document.del.chkAll.checked){
	document.del.chkAll.checked = document.del.chkAll.checked&0;
    } 	
}

function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.Name != "chkAll")
       e.checked = form.chkAll.checked;
    }
  }
function ConfirmDel()
{
   if(confirm("确定要删除选中的新闻吗？一旦删除将不能恢复！"))
     return true;
   else
     return false;	 
}

function Sname()
  {
   if(form1.Sn.value.length == 0)
   {
		alert("请您输入注册号!");
                form1.Sn.focus();
		return false;
	}
  else
   {
   window.location.href ="?Sn=" + form1.Sn.value;
    }
  }
</SCRIPT>
<body>
<form action="?action=del" method="post" id="form1" name="form1">
<table width="100%" height="25" border="0" cellpadding="0" cellspacing="0" class="itemhead">
  <tr>
    <td valign="bottom" bgcolor="#BCDBFE" class="itemheadtd"><table width="238" height="18" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td width="238" class="item">偶像管理</td>
        </tr>
    </table></td>
  </tr>
</table>

  <table width="100%" border="0" align="center" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF" style="margin-bottom:1px">
    <tr> 
      <td width="61%" height="22" bgcolor="#ACD2FD" style="padding-left:10px"><strong> 
        用户偶像列表</strong></td>
      <td width="39%" bgcolor="#ACD2FD" style="padding-left:10px"><strong>用户注册号</strong>： 
        <input name="Sn" type=text size="12" id="Sn" maxlength="30">
        <input name="SnA" type="button" class="button1" value="查 找" onclick="Sname()"> </td>
    </tr>
  </table>
	  
  <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#164481">
    <tr bgcolor="#DAEBFE"> 
      <td width="5%" align="center" bgcolor="#DAEBFE"><strong>ID</strong></td>
      <td width="10%" align="center" bgcolor="#DAEBFE"><strong>用户注册号</strong></td>
      <td width="10%" align="center" bgcolor="#DAEBFE"><strong>偶像姓名</strong></td>
      <td width="35%" align="center" bgcolor="#DAEBFE"><strong>图片连接</strong></td>
      <td width="35%" align="center" bgcolor="#DAEBFE"><strong>备注</strong></td>
      <td align="center" bgcolor="#DAEBFE"><strong>选择</strong></td>
    </tr>
    <%
If Rs.Eof Then
Response.Write "<tr><td colspan='4' bgcolor='#FFFFFF'>没有任何记录!</td></tr>"
Else
Do While Not Rs.Eof%>
    <tr bgcolor="#FFFFFF"> 
      <td align="center"><a href="BaalEdit.asp?baalID=<%=Rs(0)%>" title="点击修改偶像信息"><%=Rs(0)%></a></td>
      <td align="center"><a href="../Index.asp?JaUid=<%=Rs(2)%>" target="_blank"><%=Rs(2)%></a></td>
      <td align="center"><a href="BaalEdit.asp?baalID=<%=Rs(0)%>" title="点击修改偶像信息"><%=Rs(3)%></a></td>
      <td align="center"><%=Rs(11)%></td>
      <td align="center" bgcolor="#FFFFFF"  style="padding-left:5px"><%=Rs(10)%></td>
      <td align="center"><input type="checkbox" name="check" value="<%=Rs(0)%>"></td>
    </tr>
    <%
i=i+1 
If i >= MaxPerpage Then Exit do 
rs.MoveNext
Loop
End if
%>
  </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="89%" height="34" align="center"><div align="right">
          <input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
          选中本页显示的所有留言</div></td>
          <td width="11%" align="right"><input name="Submit32" type="submit" class="button1" value="删除留言">
          </td>
        </tr>
</table></form>
<div align="center">
<%If Rs.RecordCount>MaxPerPage Then%>
  <Script Language="JavaScript">Pages(<%=CurrentPage%>,<%=Rs.PageCount%>,<%=Rs.RecordCount%>,'page');</Script>
</div>
<%End if%>
</body>
</html>
