';
$line = mysql_fetch_object($res);
if (!$no_ajax) echo '
'.STATS_DETAILS.": ".$line->allyname.' | ![close](../images/close.gif) |
';
$_SESSION['session_allyinfo']['title'] = $line->allyname;
$ally_points = $line->points;
$ally_fpoints = $line->fpoints;
$ally_rpoints = $line->rpoints;
$query = "SELECT * FROM $playertable WHERE alliance_id='$ally_id' ORDER BY $order DESC LIMIT 10";
$res = mysql_query($query) or die(mysql_error());
$points = array();
$legend = array();
$fpoints = array();
$flegend = array();
$rpoints = array();
$rlegend = array();
$_SESSION['session_allyinfo']['legend'] = array();
$_SESSION['session_allyinfo']['data'] = array();
while ($line = mysql_fetch_object($res)) {
if ($line->points > 0) {
array_push($legend,$line->playername);
array_push($points,$line->points);
$ally_points -= $line->points;
}
if ($line->fpoints > 0) {
array_push($flegend,$line->playername);
array_push($fpoints,$line->fpoints);
$ally_fpoints -= $line->fpoints;
}
if ($line->rpoints > 0) {
array_push($rlegend,$line->playername);
array_push($rpoints,$line->rpoints);
$ally_rpoints -= $line->rpoints;
}
}
// Score Pie
if ($ally_points > 0) {
array_push($legend,STATS_UNKNOWN);
array_push($points,$ally_points); // add the rest of all points
}
if ($ally_fpoints > 0) {
array_push($flegend,STATS_UNKNOWN);
array_push($fpoints,$ally_fpoints); // add the rest of all points
}
if ($ally_rpoints > 0) {
array_push($rlegend,STATS_UNKNOWN);
array_push($rpoints,$ally_rpoints); // add the rest of all points
}
if ($order == "points") {
// Score Pie
$_SESSION['session_allyinfo']['legend'] = $legend;
$_SESSION['session_allyinfo']['points'] = $points;
echo '![](graph_pie.php?x=legend&y=points&cache='.$ally_id.') |
';
} elseif ($order == "fpoints") {
// Fleet Pie
$_SESSION['session_allyinfo']['flegend'] = $flegend;
$_SESSION['session_allyinfo']['fpoints'] = $fpoints;
echo '![](graph_pie.php?x=flegend&y=fpoints&cache='.$ally_id.') |
';
} else {
// Research Pie
$_SESSION['session_allyinfo']['rlegend'] = $rlegend;
$_SESSION['session_allyinfo']['rpoints'] = $rpoints;
echo '![](graph_pie.php?x=rlegend&y=rpoints&cache='.$ally_id.') |
';
}
echo "\n";
?>