include "constants.php";
include "index-top.php";
set_time_limit(600);
$user = $_GET['user'];
if ($user) {
$username = getInfo(username,users,"WHERE id='$user'");
$l = $_GET['limit'];
if (!$l) $l = 500;
echo "
";
echo "| $user: $username [View All Moves] |
";
echo " |
";
if ($l) $limit = "LIMIT $l";
echo "| Date | Start | Finish | ";
$result = getRows(moves,"WHERE user='$user' ORDER BY id DESC",$limit);
while ($row = mysql_fetch_array($result)) {
$start = $row['start'];
$finish = $row['finish'];
$date = $row['date'];
$startname = getInfo(name,rooms,"WHERE id='$start'");
$startplace = getInfo(place,rooms,"WHERE id='$start'");
$startplacename = getInfo(name,places,"WHERE id='$startplace'");
$finishname = getInfo(name,rooms,"WHERE id='$finish'");
$finishplace = getInfo(place,rooms,"WHERE id='$finish'");
$finishplacename = getInfo(name,places,"WHERE id='$finishplace'");
if (!$startname) $startname = $start;
if (!$finishname) $finishname = $finish;
echo "
| $date | $startname, $startplacename | ";
if ($finish == "overboard") echo "Overboard";
elseif ($finish == "travel") echo "Travel";
elseif (is_numeric($finish)) echo "$finishname, $finishplacename";
echo " |
";
}
echo "
";
} else {
$l = $_GET['limit'];
if (!$l) $l = 500;
$type = $_GET['type'];
echo "";
echo "| ";
if (!$type) echo "All Users [Players Only] [NPCs Only]";
if ($type == "users") echo "Players Only [NPCs Only] [All Users]";
if ($type == "npcs") echo "NPCs Only [Players Only] [All Users]";
echo " |
";
echo " |
";
if ($l) $limit = "LIMIT $l";
echo "| User | Date | Start | Finish | ";
if ($type == "users") $result = getRows(moves,"WHERE NPC='' ORDER BY id DESC",$limit);
elseif ($type == "npcs") $result = getRows(moves,"WHERE NPC!='' ORDER BY id DESC",$limit);
else $result = getRows(moves,"ORDER BY id DESC",$limit);
while ($row = mysql_fetch_array($result)) {
$user = $row['user'];
$username = getInfo(username,users,"WHERE id='$user'");
$start = $row['start'];
$finish = $row['finish'];
$date = $row['date'];
$startname = getInfo(name,rooms,"WHERE id='$start'");
$startplace = getInfo(place,rooms,"WHERE id='$start'");
$startplacename = getInfo(name,places,"WHERE id='$startplace'");
$finishname = getInfo(name,rooms,"WHERE id='$finish'");
$finishplace = getInfo(place,rooms,"WHERE id='$finish'");
$finishplacename = getInfo(name,places,"WHERE id='$finishplace'");
if (!$startname) $startname = $start;
if (!$finishname) $finishname = $finish;
echo "
| $username | [View Moves] | $date | $startname, $startplacename | ";
if ($finish == "overboard") echo "Overboard";
elseif ($finish == "travel") echo "Travel";
elseif (is_numeric($finish)) echo "$finishname, $finishplacename";
echo " |
";
}
echo "
";
}
include "index-bottom.php";
?>