<?php session_start(); ?>
<?
include ("var.php");
?>
<?
include("stop.php");
?>
<?php
$mobile = "xhtml/ulist.php";
$text = $_SERVER['HTTP_USER_AGENT'];
$var[2] = "AvantGo";
$var[3] = "ProxiNet";
$var[4] = "Danger hiptop 1.0";
$var[5] = "DoCoMo/";
$var[6] = "Google CHTML Proxy/";
$var[7] = "UP.Browser/";
$var[8] = "SEMC-Browser/";
$var[9] = "J-PHONE/";
$var[10] = "PDXGW/";
$var[11] = "ASTEL/";
$var[13] = "Handspring";
$var[14] = "Windows CE";
$var[15] = "PPC";
$var[17] = "Blazer/";
$var[18] = "Palm";
$var[19] = "WebPro/";
$var[20] = "EPOC32-WTL/";
$var[21] = "Tungsten";
$var[22] = "Netfront/";
$var[23] = "Mobile Content Viewer/";
$var[24] = "PDA";
$var[25] = "MMP/2.0";
$var[26] = "Embedix/";
$var[27] = "Qtopia/";
$var[28] = "Xiino/";
$var[29] = "BlackBerry";
$var[30] = "Gecko/20031007";
$var[31] = "MOT-";
$var[32] = "UP.Link/";
$var[33] = "Smartphone";
$var[34] = "portalmmm/";
$var[35] = "Nokia";
$var[36] = "Symbian";
$var[37] = "AppleWebKit/413";
$var[38] = "UPG1 UP/";
$var[39] = "RegKing";
$var[40] = "STNC-WTL/";
$var[41] = "J2ME";
$var[42] = "Opera Mini/";
$var[43] = "SEC-";
$var[44] = "ReqwirelessWeb/";
$var[45] = "AU-MIC/";
$var[46] = "Sharp";
$var[47] = "SIE-";
$var[48] = "SonyEricsson";
$var[49] = "Elaine/";
$var[50] = "SAMSUNG-";
$var[51] = "Panasonic";
$var[52] = "Siemens";
$var[53] = "Sony";
$var[54] = "Verizon";
$var[55] = "Cingular";
$var[56] = "Sprint";
$var[57] = "AT&T";
$var[58] = "Nextel";
$var[59] = "Pocket PC";
$var[60] = "T-Mobile";
$var[61] = "Orange";
$var[62] = "Casio";
$var[63] = "HTC";
$var[64] = "Motorola";
$var[65] = "Samsung";
$var[66] = "NEC";

$result = count($var);

for ($i=0;$i<$result;$i++)
{
$ausg = stristr($text, $var[$i]);
if(strlen($ausg)>0)
{
header("location: $mobile");
break;
}

}
?>
<?
include ("config.php");
?>
<?

if(isset($_SESSION['nume'])) {
      	$username = ''.$_SESSION['nume'].'';
$stare = "Show List Of Users";
if(!$act){mysql_query("UPDATE utilizatori SET stare='$stare' WHERE nume='$username'");}
}
?>
<?
include ("header.html");
?>
<table width='950' cellspacing='0' cellpadding='0' align='center'>

<?
include ("right.html");
?>

<td width='720' valign='top' class='continut'>

<table cellspacing='0' cellpadding='10'  width='100%'>
<tr>
<td>

<!-- CONTINUTUL !!!! -->




 <div class='hl'>List Of Users</div><center>

</center>
<?
include"config.php";
$link = mysql_connect("$server", "$user", "$pass");
mysql_select_db("$db", $link);
$result = mysql_query("SELECT * FROM utilizatori WHERE id", $link);
$num_rows = mysql_num_rows($result);

echo "<left>We've got: <b>$num_rows </b>users.</left></font></br>";
?>


  <table width='100%'>
<tr>
<td align='50%'>

<br/><small><small>   </small></small>
</td>
</form>
</td>
</tr>
</table>
<table width='100%'  cellspacing='0' cellpadding='4'  class='tbnail border'>
<tr>
<? 

if(!isset($_GET['p'])){
$page = 1;
} else {
$page = $_GET['p'];
}

$max_results = 30;

$from = (($page * $max_results) - $max_results);
$sql = mysql_query("SELECT * FROM utilizatori ORDER BY id desc LIMIT $from,$max_results");

// Define the number of results per page 
echo "<table width='100%'  cellspacing='0' cellpadding='4'  class='tbnail border'><tr>";

$rezultate_maxime_in_linie = 5;
$rezultate_maxime_in_jos = 6;
$from = (($page * $max_results) - $max_results); 
$result = mysql_query('SELECT * FROM `utilizatori` LIMIT 30');
$totale = mysql_num_rows($result);


if($totale == 0) echo 'Nu exista intrari ...';
elseif(!isset($_GET['pagina'])) $pagina = 1;
else $pagina = $_GET['pagina'];

	$sql = mysql_query('SELECT * FROM `utilizatori` ORDER by `id` DESC LIMIT '.(($page * ($rezultate_maxime_in_jos*$rezultate_maxime_in_linie)) - ($rezultate_maxime_in_jos*$rezultate_maxime_in_linie)).', '.($rezultate_maxime_in_jos*$rezultate_maxime_in_linie).' ');

	$pagini_totale = ceil($totale / ($rezultate_maxime_in_jos*$rezultate_maxime_in_linie));

	if($pagina > $pagini_totale);
	elseif($pagini_totale > 0) {

			$seteaza = 0;
			$numar = ($pagina - 1) * ($rezultate_maxime_in_jos*$rezultate_maxime_in_linie);
		
			while($rand = mysql_fetch_array($sql)) {
				$numar++;

				if($seteaza == $rezultate_maxime_in_linie) {
				echo "</tr><tr>\n";
				$seteaza = 1;
				} else $seteaza++;

$sz = $rand['size'];
 if ($sz<1024) {$sz="$sz bytes";}
 elseif (($sz>=1024)&&($sz<1048576)) {$sz=strtr(round($sz/1024,2),".",",")." KB";}
 elseif ($sz>=1048576) {$sz=strtr(round($sz/1024/1024,2),".",",")." MB";}

$name = $rand['nume'];
$file = $rand['file'];
$id = $rand["id"];
$mod = $rand["color"];
$avat = $rand["setavatar"];
$nume = $rand["nume"];

if(in_array($banned,array("Yes")))
	  {

$ban = " bgcolor='#F8CCCC' ";
	   }else{
$ban = " ";
		}  
echo "<td width='20%' $ban id='". $rand["id"] ."'> ";
echo "<a href='profile.php?id=". $rand["id"] ."' title='". $rand["nume"] ."', style='height:115'>";
   if($avat[0]=="1")
	  {
		echo "<img src='listavatar.php?id=$id'/>";
	   }else{
		 echo "";
		}  
echo "<br/>$rand[nume]</a><div class='hl abuseL normalfont'>$rand[nume] | <a href='profile.php?id=". $rand["id"] ."' title='View Profile' />!</a></div>";
echo "</td>";

			}

}
$total_results = mysql_result(mysql_query("SELECT COUNT(*) as id FROM utilizatori"),0);
$total_pages = ceil($total_results / $max_results);

echo "</tr><tr></tr></table>";
echo "<br/><div class='hl'>Navigation</div>
<table width='100%' cellpadding=''3'><tr><td bgcolor='#E2EDF6'>";
if($page > 1){
$prev = ($page - 1);
echo "<a href=\"".$_SERVER['PHP_SELF']."?p=$prev\">&#171;Prev </a> | ";
}
if($page < $total_pages){
$next = ($page + 1);
echo "<a href=\"".$_SERVER['PHP_SELF']."?p=$next\"> Next&#187;</a>";
}
$i = 1; $i <= $total_pages; $i++ ;
if ($total_pages>2)
{
echo "<br/>Jump To Page: ($page/$total_pages):
<br/>";
echo "<form action=\"ulist.php\" method=\"get\">
<input type=\"text\" name=\"p\" style='-wap-input-format: \"5N\"' value=\"$page\" />
<input type=\"submit\"  value=\"Dute!\"/>
</form>";
}
echo "</tr><tr></tr></table>
</div>";
?>

<?

?>
<!-- SFARSIT CONTINUT!!! -->
</br>
</td></tr></table>
<tr>
<td width='180'>&nbsp;
</td>
<?
include ("flooter.html");
?>