if (isset($_GET["activeEmpire"]))
{
$id = mysqli_real_escape_string($link, $_GET["activeEmpire"]);
$query = "select Empires.ID, Empires.Name, Empires.Population, Empires.TechLevel, Empires.ImperialMight, Empires.Worlds, Empires.Updated, Planets.Name as PName, Doctrines.Doctrine as DDoctrine from Empires";
$query .= " left join Planets on Empires.CapitalID = Planets.ID left join Doctrines on Empires.Doctrine = Doctrines.ID";
$query .= " where Empires.ID = $id";
# print "$query
";
$result = $link->query($query);
$row = $result->fetch_assoc();
print "Name: ".$row{'Name'}."
\n";
print "Capital: ".$row{'PName'}."
\n";
print "Total Population: ".$row{'Population'}."
\n";
print "Tech Level: ".$row{'TechLevel'}."
\n";
print "
Worlds Owned: ".$row{'Worlds'}."\n";
print "Imperial Might: ".$row{'ImperialMight'}."
\n";
print "Doctrine: ".$row{'DDoctrine'}."
\n";
print "Empire Last Updated: ".$row{'Updated'}."
\n";
}
?>
if (isset($_GET["activeEmpire"]) && isset($_GET["worlds"]))
{
$id = mysqli_real_escape_string($link, $_GET["activeEmpire"]);
$query = "select Planets.ID, Planets.Name from Planets";
# $query .= " left join Designations on Planets.Designation = Designations.ID";
$query .= " where Planets.SovereignID = $id";
$query .= " group by Planets.ID";
$query .= " order by Planets.Name";
# print "$query
";
$result = $link->query($query);
$url = $_SERVER['PHP_SELF']."?activeEmpire=".$_GET['activeEmpire']."&worlds";
while ($row = $result->fetch_assoc())
{
print "
".$row{'Name'}."\n";
}
}
?>
if (isset($_GET["activeEmpire"]) && isset($_GET["worlds"]) && isset($_GET["worldID"]))
{
print "
\n";
$id = mysqli_real_escape_string($link, $_GET["worldID"]);
$query = "select Planets.ID, Planets.Name, Planets.Efficiency, Planets.Population, Planets.PositionX, Planets.PositionY, Planets.TechLevel, Planets.Updated, Designations.Designation from Planets";
$query .= " left join Designations on Planets.Designation = Designations.ID";
$query .= " where Planets.ID = $id";
$query .= " order by Updated Desc limit 1";
# print "$query
";
$result = $link->query($query);
$url = $_SERVER['PHP_SELF']."?activeEmpire=".$_GET['activeEmpire']."&worlds";
$row = $result->fetch_assoc();
print "
".$row{'Name'}."
\n";
print "Population: ".$row{'Population'}."
\n";
print "Efficiency: ".$row{'Efficiency'}."
\n";
print "Tech Level: ".$row{'TechLevel'}."
\n";
print "Designation: ".$row{'Designation'}."
\n";
print "Position: ".$row{'PositionX'}.", ".$row{'PositionY'}."
\n";
print "Last Updated: ".$row{'Updated'}."
\n";
print "
\n";
}
?>
footer();
?>