<!--#include file="../../here99login/0.asp"--><!--#include file="../../conn/zkconn.asp"-->
<html>
<head>
<script language=javascript>
<!--

function change(ckb,tag){
	if (ckb.checked) 
		{tag.value=1;
		}
	else
		{
		tag.value=0;form1.selectall.checked=false;}
}

function checkall(form){  
  if (form.selectall.checked==true){ val = 1; } else { val = 0; }

  for (var i=0; i<form.elements.length; i++){
    var e = form.elements[i];
    var t = e.name;
    
    if (t.substr(0,4) == 'ckb_') { e.checked = form.selectall.checked; }
    if (t.substr(0,4) == 'Tag_') { e.value = val; }
  }
}

/* --- 删除所选取的期号 --- */
function del_sel(form) {

	var delcount = 0
	for (var i=0; i<form.elements.length; i++) {
		var e = form.elements[i];
		var t = e.name;
		
		if (t.substr(0,4) == 'ckb_'){
			if (e.checked == true){
				delcount = 1;
				break;
			}
		}
  
    }
    if (delcount<=0)
	{
	window.alert("你到底要删除那一条呢！");
	return false;
     }
    if (!confirm("你确实想删除所选取的纪录吗？"))
	{ return false; }
	

	form.action ="firpic_del.asp";
	form.submit();    
}
//-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../../css/css.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000">

<p align="center">中心图片管理<br>
  <% 
set rs=server.createobject("adodb.recordset")
   sql="select * from firstpic order by id desc "
  
 '  response.write sql 
	rs.open sql,conn,3,1
	if rs.eof then 
	  response.write "没有纪录！"
	   response.write "<a href=firpic.asp>添加</a>"
	 else 
	rs.pagesize=18
	countpage=rs.pagecount
	ccount=request("countcount")  	
	if ccount="" then
         ccount=1
		 
     else 
	    if int(ccount)>countpage or int(ccount)<=0 then
	       ccount=1
		   else ccount=ccount
		   end if 
	   
	 end if
    rs.absolutepage=ccount
	
  %>
<form name="form1" method="post" action="firpic_manage.asp">
  <table width="800" border="0" align="center" bgcolor="#CCCCCC" cellspacing="1" cellpadding="0">
    <tr bgcolor="#FFFFFF" valign="middle" align="center"> 
      <td height="30" colspan="7"> <div align="center">共[<%=countpage%>]页 现处于[<%=ccount%>]页 <a href=firpic_manage.asp?countcount=1>首页</a> <a href=firpic_manage.asp?countcount=<%if ccount-1<1 then response.write  ccount else response.write ccount-1 end if%>>上一页</a> 
          <a href=firpic_manage.asp?countcount=<%if ccount+1>countpage then response.write ccount else response.write ccount+1 end if%>>下一页</a> 
          　<a href=firpic_manage.asp?countcount=<%=countpage%>>尾页</a> 
          <font face="Arial, Helvetica, sans-serif">转到 </font> 
          <input name="countcount" type="text" class="wenbenkuang" size="3">
          <input name="Submit" type="submit" class="go-wenbenkuang" value="转到">
          &nbsp;&nbsp; 
          <input name="Input" type="button" class="go-wenbenkuang" onClick="window.location.href='firpic.asp'" value="添加">
        </div></td>
    </tr>
    <tr bgcolor="#f1f1f1" valign="middle" align="center"> 
      <td width="100" height="20">编号</td>
      <td width="200" height="20">日期</td>
      <td width="100" height="20">位置</td>
      <td width="100" height="20">是否显示</td>
      <td width="100" height="20"> 
        <div align="center">修改</div></td>
      <td width="100">复制</td>
      <td width="100" height="20">选中</td>
    </tr>
    <% do while not rs.eof 
         ysid=rs(0) %>
    <tr bgcolor="#FFFFFF" valign="middle" align="center"> 
      <td width="100" height="20" > <a href=displaypic.asp?id=<%=ysid%>> 
        <% response.write rs("id")%>
        </a> </td>
      <td width="200" height="20"> 
        <% response.write rs("dates")%> </td>
      <td width="100" height="20" > 
        <%if rs("lbid")<>"0" then
		set rs2 = conn.execute("select lbname from lb where lbid="&rs("lbid")&"")
		Response.Write(""&rs2("lbname")&"")
		rs2.close
                set rs2=nothing
		else
		Response.Write("首页")
		end if%> </td>
      <td width="100" height="20"><a href=ifshow.asp?ifshow=<%=ysid%>&countcount=<%=ccount%>>[ 
        <%if rs("ifshow") then response.write "是" else response.write "否" end if %>
        ]</a></td>
      <td width="100" height="20"><a href="ch_firpic.asp?id=<%=ysid%>">修改</a></td>
      <td width="100"><a href="fuzhi.asp?id=<%=ysid%>">复制</a></td>
      <td width="100" height="20"> 
        <div align="center"> 
          <input type="checkbox" name="ckb_<%=i%>" onClick="change(ckb_<%=i%>,Tag_<%=i%>)">
          <input type="hidden" name="ID_<%=i%>" value="<%=ysid%>">
          <input type="hidden" name="Tag_<%=i%>" value="0">
        </div></td>
    </tr>
    <%i=i+1
   rs.movenext
   if i>=rs.pagesize then exit do
   loop
   %>
    <tr bgcolor="#99CCCC"> 
      <td height="20" align="center" bgcolor="#FFFFFF"> <b><font face="Arial, Helvetica, sans-serif" color="#FF0000">操作</font></b></td>
      <td height="20" colspan="6" bgcolor="#FFFFFF"> <div align="right"> 
          <input type="checkbox" value="on" name="selectall" onClick="checkall(this.form)">
          全部选取&nbsp;&nbsp; 
          <input name="delselect" type="button" class="go-wenbenkuang" onClick="return del_sel(this.form)" value="删除">
        </div></td>
    </tr>
  </table>
</form>
<%end if
rs.close
set rs=nothing %>
</body>
</html>
