include("../connect.php");
include("../func.php");
if(isset($_GET['page'])) {
$page = $_GET['page'];
if($page < 1) $page = 1;
}else{
$page = 1;
}
echo "
$sitename | All USers | Page $page
";
////include("../pages/color.php");
if(isset($errors))
{
echo $errors;
}
include("../pages/header.php");
echo "
Username |
Name |
Reg.Date |
Country |
Status |
";
$perpg = 10;
$result = mysqli_query($db, "SELECT COUNT(*) FROM `users`");
$totalitems = mysqli_fetch_row($result)[0];
if(isset($_GET['page'])) {
$page = $_GET['page'];
if($page < 1) $page = 1;
}else{
$page = 1;
}
$limitT = (($page * $perpg) - $perpg);
$pagination = $perpg;
$result = mysqli_query($db, "SELECT * FROM `users` ORDER BY `user_id` DESC LIMIT $limitT, $pagination");
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
$username = "" . $row['username'] . "";
$email = $row['email'];
$name = $row['name'];
$type = $row['type'];
$ip = $row['ip'];
$date = $row['date'];
$country = $row['country'];
$status = $row['active'];
$Regdate = date("D jS M Y",$date);
$randtext = generateRandomString(500);
$alkey = md5($timenow-$randtext-$date);
$lkey = md5($timenow-$randtext-$date-$ip);
if($status=='0')
{
$mstatus = 'Deactivated';
}else{
$mstatus = 'Activated';
}
if($country='NULL')
{
$ipdat = @json_decode(file_get_contents(
"http://www.geoplugin.net/json.gp?ip=" . $ip));
$country = $ipdat->geoplugin_countryName;
$updatecountry = mysqli_query($db, "UPDATE users SET country='$country' WHERE ip='$ip' AND country IS NULL");
}
echo "
$username |
$name |
$Regdate |
$country |
$mstatus |
";
}
echo "
";
include("../pages/footer.php");
echo "
";
/////echo "";
?>