<?php
/*********************************************************
程序说明：
功能说明：黑名单密码展示

调用关系：调用: header.inc,connectdb_billing.inc
被调用:

变量说明：
作者：崔体存    2005-11-14

修改注释：
NO.1
姓名：
时间：
修改说明：
 *********************************************************/
require("../../inc/header.inc");
$confUser=$_REQUEST['confUser'];
?>
<body leftmargin="15" rightmargin="10" onload="javascript:adjust_frame('up');" onresize="javascript:adjust_frame('up');" style="background-color:#FFFAF4;overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
<?php

$DEBUG	= 0;
$initial_record = $_REQUEST['initial_record'];
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
echo "<tr>";
?>
<!--添加按钮 以及跳转-->
<td align="center">
    <nobr>
        <a href="./blackPwdConf.php?confMode=add">
            <IMG align=absBottom border=0 src="../../images/add.gif" ><?php echo "$strAdd"; ?>
        </a>
    </nobr>
</td>
<!--添加按钮 以及跳转-->
<td align="center">
    <nobr>
        <a href="./userList.php">
            <IMG align=absBottom border=0 src="../../images/clear.gif" ><?php echo "$strBack"; ?>
        </a>
    </nobr>
</td>

<?php
echo "</tr>";
echo "</table>";

$userInfo = $_SESSION['userInfo'];
if($DEBUG)
{
    echo "userInfo[privilege] = $userInfo[privilege]<br>";
    echo "userInfo[ID] = $userInfo[ID]<br>";
}
$table_name = 'sysBlackPwd';
//$table_name_alluser = 'sysUser';
$sort_field = 'write_time';
$sort_direction = 'ASC';
$number_records_to_display = 210;
//查询黑名单有多少条记录 以便分页



/*$blackTable='sysBlackPwd';

  $blackSQL="SELECT blackPwd
                                FROM $blackTable
                                ";
                $blackResult = mysqli_query($pubConn,$blackSQL);
 while($allBlackRow=mysqli_fetch_array($blackResult)){
                $blackRow[]=$allBlackRow;
                }

      //    print_r($blackRow);
echo $blackRow[0]['blackPwd'];


 */


if (!$initial_record)
{
    $initial_record = 0;
    $str_sql_all ="SELECT  count(*) as number_of_records	FROM $table_name ";
    $result = @mysqli_query($pubConn,$str_sql_all);
    $record = @mysqli_fetch_object($result);
    $number_of_records = $record->number_of_records;
}

if ($number_of_records >= 1)
{
    //下面是控制分页显示，传递变量
    $next_index = $initial_record + $number_records_to_display;  //本页的结束数目
    if ($next_index > $number_of_records)
    {
        $next_index = $number_of_records;
    }
    $t1 = $initial_record + 1;
    $prev_index = $initial_record - $number_records_to_display;
    if ($prev_index < 0)
    {
        $prev_index = 0;
    }
}

//把记录查询出来 且以write_time为排序规则
$str_sql="SELECT * 
            FROM $table_name 
	        ORDER BY $sort_field $sort_direction 
            LIMIT $initial_record, $number_records_to_display";

// echo "<br>str_sql=$str_sql";
$result = mysqli_query($pubConn,$str_sql);
$myrows = @mysqli_fetch_array($result);
//倘若没有数据
if(!$myrows)
{
    echo "$strNotFindRecord";
    exit();
}
?>

<form method="POST" name=confForm>
    <!--总计记录-->
    <table border="0" width="100%"  cellpadding="2" cellspacing="0"  bordercolor="#666666" bordercolordark="#FFFFFF">
        <tr>
            <td colspan="2" align="center">
                <!--统计黑名单密码的数量-->
                <?php
                echo "$strDisplayRecords:<FONT color=#0000ff>&nbsp;$initial_record - $next_index</FONT>, ($strTotalRecords:<font color=#0000ff> $number_of_records</font> ) &nbsp;&nbsp;";
                ?>
            </td>
        </tr>
    </table>

    <!-- <table border="1" width="100%"  cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF"  height="189"  bgcolor="#faf0e6">
      -->
    <table class="formCenter">
        <tr bgcolor="#E6E6E6">
            <td align="center"><?php echo $black; ?></td>

            <td align="center"><?php echo $blackTime; ?></td>
            <td align="center">&nbsp;</td> <!--放删除按钮-->

        </tr>
        <?php
        //echo "confUser=$confUser<br>";

        do{
            echo "<tr>";
            echo "<td align=\"center\">$myrows[blackPwd]</td>";  //密码

            echo "<td align=\"center\">$myrows[write_time]</td>"; //添加黑名单密码的时间
 echo "<td align=\"center\"><a href=\"./blackPwdConf.php?confMode=del&blackPwd=$myrows[blackPwd]\">$strDelete</td>";

            //echo "$str_sql_alluser<br>";
            //echo "user prive = $myrows_pri[privilege]";
            /*	if ( ($myrows_pri['privilege']<$userInfo['privilege']) && ($myrows['userName'] != $userInfo['ID']) )
                {
                    echo "<td align=\"center\"><a href=\"./onlineUserlist.php?confMode=del&userName=$myrows[username]\">$strForceOff</td>";
                }
                else
                {
                    echo "<td>&nbsp;</td>";
                }*/
            echo "</tr>";
        }while($myrows=@mysqli_fetch_array($result));

        ?>
    </table>
    <?php
    adjust_content_tail();
    ?>
</body>
</html>


