// JScript 文件

$().ready(function(){getData();});
var CurrentRowsNum=1;
var RowsShowNum = 10;
function getData(Num)
{
   if(Num==null)
        CurrentRowsNum=1;
   else
        CurrentRowsNum=Num;
   $("#tb").html("<tr><td colspan=7 style=\"text-align:center\">正在查询，请稍后。。</td></tr>");
   var response = admini_ArticleLB.getData(CurrentRowsNum,RowsShowNum).value;
   if(response!=null)
   {
     if(response.length==1)
     {alert(response);}
     else if((response.length-2)>0)
     {
         var str="";
         for(i=0;i<response.length-2;i++)
         {
             str+="<tr><td><a href=http://tool.13sb.cn/ShowArticle.aspx?id="+response[i][0]+" target=_blank>"+response[i][1]+"</a></td>";
           str+="<td>"+response[i][2]+"</td>";
           str+="<td>"+response[i][3]+"</td>";
           str+="<td>"+response[i][4]+"</td>";
           str+="<td>"+response[i][5]+"</td>";
           str+="<td>"+(response[i][6]==true?"是":"否")+"</td>";
           str+="<td>"+response[i][7]+"</td>";
           str+="<td><a href=\"ArtModify.aspx?aID="+response[i][0]+"\">修改</a><a href=\"javascript:del("+response[i][0]+")\">删除</a></td>";
         }
         $("#tb").html(str);

        var SumRows=response[response.length-1];
        var CurrentRowsNum=response[response.length-2];
        var PageCount = Math.ceil(SumRows/RowsShowNum); 
        initPagingation(PageCount,CurrentRowsNum,SumRows,CurrentRowsNum,"getData(_pn_)","");
     }else
     {
        $("#tb").html("<tr><td colspan=7 style=\"text-align:center\">没有数据</td></tr>");
     }
   }
}

     function del(key)
      {
         if(!confirm("确定删除吗？"))
            return;
         var response =admini_ArticleLB.del(key).value;
         if(response=="1")
         {alert("ok");window.location.reload();}
         else if (response=="0")
           alert("失败");
         else alert(response);
      }