Location: PHPKode > projects > Admin Control Panel 2 > mul/muluserlistaip.php
<?php
session_start();
if ($_SESSION['login'] != "1")
{
header('Location: mulogin.php');
exit();
}
?>
<html>
<head>
<title>ACP 2 SE - Multi Tool</title>
<link href="main.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor='#000000' text="#FFFFFF">
<?php
include("../lib/config.inc.php");
mysql_connect("$sqlhost", "$sqluser", "$sqlpassword")or die("cannot connect");
mysql_select_db("$sqldb")or die("cannot select DB");

//Naam van de pagina
	$pagina = 'muluserlistaip.php';
//Retrieve and create the $each and $each_array vars
    if(isset($_GET['each'])&&is_numeric($_GET['each'])) $each = $_GET['each'];
    else $each = 100;
    $each_options = array("100", "250", "500", "1000", "10000");
//Create the $counter var
    $query = mysql_query("select count(*) as num from bb".$n."_users");
    $counter = mysql_result($query, 0, "num");
//Create the $pages var
    $pages = $counter / $each;
    $pages = ceil($pages);
//Check on witch page you are now
    if(isset($_GET['pag'])&&$_GET['pag'] <= $pages&&$_GET['pag']>0&&is_numeric($_GET['pag'])) $pag = $_GET['pag'];
    else $pag = 1;
//Get the results from the database
    $first_result = $pag * $each - $each;
	if(isset($_GET['sort'])) $sort = $_GET['sort'];
    else $sort = 'reg_ipaddress';
    $query = mysql_query("SELECT * FROM `bb".$n."_users` ORDER BY `bb".$n."_users` . `$sort` ASC LIMIT ".$first_result.", ".$each);
function render_each_dropdown($each_options,$each)
{
    echo '<form action="'. $pagina . '">';
    echo '<select name="each" onchange="this.form.submit();">'."\n";
    foreach($each_options as $item)
    {
        echo '<option value="'.$item.'"';
        if($item==$each) echo ' selected';
        echo '>'.$item.'</option>'."\n";
    }
    echo '</select></form>';
}
function render_arrow($kind,$pag,$pages,$each)
{
    $pag_back = $pag-1;
    $pag_next = $pag+1;
    if($kind == "back")
    {
        echo '<a ';
        if($pag > 1) echo 'href="'. $pagina . '?pag='.$pag_back.'&each='.$each.'"';
        echo '><<</a>';
    }
    if($kind == "forward")
    {
        echo '<a ';
        if($pag < $pages) echo 'href="'. $pagina . '?pag='.$pag_next.'&each='.$each.'"';
        echo '>>></a>';    
    }
}
function render_pagenumbers($pag,$pages,$each)
{
    $i = 1;
    while($i<=$pages)
    {
        echo '<a ';
        if($i!=$pag) echo 'href="'. $pagina . '?pag='.$i.'&each='.$each.'"';
        echo '>'.$i.'</a>&nbsp;&nbsp;';
        $i++;
    }
}

//$sql = 'SELECT * FROM `bb".$n."_users` ORDER BY `bb".$n."_users` . `reg_ipaddress` ASC LIMIT 0, 10000 '; 
//$result=mysql_query($sql);

//if($result){
	echo "<center><h1>Multi Tool - User List for all IP's:</h1>";
	
        render_each_dropdown($each_options,$each);
	echo '<table border="1" cellpadding="2" cellspacing="2" width="800">
	<tr bgcolor="#C0C0C0">
	<th width="100"><a href="'. $pagina . '?pag='.$pag.'&each='.$each.'&sort=username">Name:</a></th>	
	<th width="100"><a href="'. $pagina . '?pag='.$pag.'&each='.$each.'&sort=email">Mail:</a></th>
	<th width="150"><a href="'. $pagina . '?pag='.$pag.'&each='.$each.'&sort=userposts">Postcount:</a></th>	
	<th width="350"><a href="'. $pagina . '?pag='.$pag.'&each='.$each.'&sort=reg_ipaddress">IP:</a></th>
	<th width="350"><a href="'. $pagina . '?pag='.$pag.'&each='.$each.'&sort=password">pass md5:</a></th>
	</tr>';
	while($row = mysql_fetch_array($query))
	  {
	  echo "<tr>";
	  echo "<td height='15'><a href=\"multi5.php?name=" . $row['username'] . "\">" . $row['username'] . "</a></td>";
	  echo "<td height='15'>" . $row['email'] . "</td>";
	  echo "<td height='15'>" . $row['userposts'] . "</td>";	
	  echo "<td height='15'>" . $row['reg_ipaddress'] . "</td>";
	  echo "<td height='15'>" . $row['password'] . "</td>";
	  echo "</tr>";
	  }
	echo "<tr><td bgcolor='#c0c0c0'colspan='5'>&nbsp;</td></tr></table></center>";
    echo 'Total: '.$counter."<br />\n";
    echo 'Total Users by page: '.$each."<br />\n";
    echo 'Total page\'s: '.$pages."<br />\n";
    echo "<br />\n";
        render_each_dropdown($each_options,$each);
        render_arrow(back,$pag,$pages,$each);
    echo $pag;
        render_arrow(forward,$pag,$pages,$each);
    echo "<br />\n";
        render_pagenumbers($pag,$pages,$each);		
//}
//else {
//	echo "ERROR, Kan de pagina niet tonen <br>Meld dit aan een bevoegde Admin";
//}
mysql_close();
?>
<?php
include("../lib/config.inc.php");
mysql_connect("$sqlhost", "$sqluser", "$sqlpassword")or die("cannot connect");
mysql_select_db("$sqldb")or die("cannot select DB");
$sql = 'SELECT * FROM `acp2se` LIMIT 0, 30'; 
$result=mysql_query($sql);

if($result){
	while($row = mysql_fetch_array($result))
	  {
	  echo "</p>";
	  echo "<center>" . $row['Version'] . "</center>"; 
	  echo "<center>" . $row['Copy'] . "</center>";
	  }

	echo "<tr><td bgcolor='#c0c0c0'colspan='5'>&nbsp;</td></tr></table></center>";

}
else {
	echo "</p><b>Instal first the ACP 2 SE information!</br>&copy; 2007 The Chaser - Kinger7</b>";
}
mysql_close();
?>
</body>
</html>
Return current item: Admin Control Panel 2