0) { $line = mysql_fetch_object($res); $galaxy_query = "SELECT g.planet as g_planet, g.system as g_system, g.galaxy as g_galaxy, g.moon as g_moon, r.* ". "FROM $dbtablename g LEFT JOIN $reporttable r ON (g.galaxy=r.galaxy AND g.system=r.system AND g.planet=r.planet) ". "WHERE g.player_id='$player_id' ". "ORDER BY g.galaxy,g.system,g.planet"; $res2 = mysql_query($galaxy_query) or die(mysql_error()); $moons = 0; $planets = 0; $coordinates = ""; $moon_coordinates = ""; $amount_metal = 0; $amount_crystal = 0; $amount_deut = 0; $max_temp = array(123,123,120,66.7,64.5,63,41,39,36,14.5,12,11,-43,-44,-46); $moon_array = array(); $old_coordinates = ""; $moon_done = false; $planet_done = false; $old_galaxy = 0; $old_system = 0; $i = 0; $fleetsize = array("kt"=>0,"gt"=>0,"lj"=>0,"sj"=>0,"krz"=>0,"ss"=>0,"kolo"=>0,"rec"=>0,"spio"=>0,"bomb"=>0,"zerri"=>0,"ds"=>0,"skrz"=>0,"sat"=>0); $planet_tab_array = array(); $moon_tab_array = array(); while ($result_row = mysql_fetch_object($res2)) { $moon_mouse_over = ""; $planet_mouse_over = ""; // collect fleet information $fleetsize["kt"] += ($result_row->kt == NULL) ? 0 : $result_row->kt; $fleetsize["gt"] += ($result_row->gt == NULL) ? 0 : $result_row->gt; $fleetsize["lj"] += ($result_row->lj == NULL) ? 0 : $result_row->lj; $fleetsize["sj"] += ($result_row->sj == NULL) ? 0 : $result_row->sj; $fleetsize["krz"] += ($result_row->krz == NULL) ? 0 : $result_row->krz; $fleetsize["ss"] += ($result_row->ss == NULL) ? 0 : $result_row->ss; $fleetsize["kolo"] += ($result_row->kolo == NULL) ? 0 : $result_row->kolo; $fleetsize["rec"] += ($result_row->rec == NULL) ? 0 : $result_row->rec; $fleetsize["spio"] += ($result_row->spio == NULL) ? 0 : $result_row->spio; $fleetsize["bomb"] += ($result_row->bomb == NULL) ? 0 : $result_row->bomb; $fleetsize["zerri"] += ($result_row->zerri == NULL) ? 0 : $result_row->zerri; $fleetsize["ds"] += ($result_row->ds == NULL) ? 0 : $result_row->ds; $fleetsize["skrz"] += ($result_row->skrz == NULL) ? 0 : $result_row->skrz; $fleetsize["sat"] += ($result_row->sat == NULL) ? 0 : $result_row->sat; $array_key = $result_row->g_galaxy.":".$result_row->g_system.":".$result_row->g_planet; if ($result_row->moon == 'false') { // collect planet info for Planets TAB // resources $planet_tab_array[$array_key]['metal'] = $result_row->metal; $planet_tab_array[$array_key]['crystal'] = $result_row->crystal; $planet_tab_array[$array_key]['deut'] = $result_row->deuterium; $planet_tab_array[$array_key]['energy'] = $result_row->energy; // buildings $planet_tab_array[$array_key]['memi'] = $result_row->memi; $planet_tab_array[$array_key]['krimi'] = $result_row->krimi; $planet_tab_array[$array_key]['deutsyn'] = $result_row->deutsyn; $planet_tab_array[$array_key]['solar'] = $result_row->solar; $planet_tab_array[$array_key]['fusion'] = $result_row->fusion; $planet_tab_array[$array_key]['robo'] = $result_row->robo; $planet_tab_array[$array_key]['nani'] = $result_row->nani; $planet_tab_array[$array_key]['rawe'] = $result_row->rawe; $planet_tab_array[$array_key]['mesp'] = $result_row->mesp; $planet_tab_array[$array_key]['krissp'] = $result_row->krissp; $planet_tab_array[$array_key]['deutsp'] = $result_row->deutsp; $planet_tab_array[$array_key]['folab'] = $result_row->folab; $planet_tab_array[$array_key]['terra'] = $result_row->terra; $planet_tab_array[$array_key]['allydep'] = $result_row->allydep; $planet_tab_array[$array_key]['raksilo'] = $result_row->raksilo; $planet_tab_array[$array_key]['min_rak'] = $result_row->min_rak; $planet_tab_array[$array_key]['max_rak'] = $result_row->max_rak; // defense $planet_tab_array[$array_key]['rak'] = $result_row->rak; $planet_tab_array[$array_key]['ll'] = $result_row->ll; $planet_tab_array[$array_key]['sl'] = $result_row->sl; $planet_tab_array[$array_key]['ion'] = $result_row->ion; $planet_tab_array[$array_key]['gauss'] = $result_row->gauss; $planet_tab_array[$array_key]['plasma'] = $result_row->plasma; $planet_tab_array[$array_key]['ksk'] = $result_row->ksk; $planet_tab_array[$array_key]['gsk'] = $result_row->gsk; $planet_tab_array[$array_key]['arak'] = $result_row->arak; $planet_tab_array[$array_key]['irak'] = $result_row->irak; } elseif($result_row->moon == 'true') { // collect moon infor for Moon TAB // resources $moon_tab_array[$array_key]['metal'] = $result_row->metal; $moon_tab_array[$array_key]['crystal'] = $result_row->crystal; $moon_tab_array[$array_key]['deut'] = $result_row->deuterium; $moon_tab_array[$array_key]['energy'] = $result_row->energy; // buildings $moon_tab_array[$array_key]['robo'] = $result_row->robo; $moon_tab_array[$array_key]['rawe'] = $result_row->rawe; $moon_tab_array[$array_key]['mesp'] = $result_row->mesp; $moon_tab_array[$array_key]['krissp'] = $result_row->krissp; $moon_tab_array[$array_key]['deutsp'] = $result_row->deutsp; $moon_tab_array[$array_key]['allydep'] = $result_row->allydep; $moon_tab_array[$array_key]['mbase'] = $result_row->mbase; $moon_tab_array[$array_key]['sensor'] = $result_row->sensor; $moon_tab_array[$array_key]['sprungtor'] = $result_row->sprungtor; // defense $moon_tab_array[$array_key]['rak'] = $result_row->rak; $moon_tab_array[$array_key]['ll'] = $result_row->ll; $moon_tab_array[$array_key]['sl'] = $result_row->sl; $moon_tab_array[$array_key]['ion'] = $result_row->ion; $moon_tab_array[$array_key]['gauss'] = $result_row->gauss; $moon_tab_array[$array_key]['plasma'] = $result_row->plasma; $moon_tab_array[$array_key]['ksk'] = $result_row->ksk; $moon_tab_array[$array_key]['gsk'] = $result_row->gsk; $moon_tab_array[$array_key]['arak'] = $result_row->arak; $moon_tab_array[$array_key]['irak'] = $result_row->irak; } // create planet / moon info HTML code if ($result_row->g_galaxy.":".$result_row->g_system.":".$result_row->g_planet != $old_coordinates) { // coordinates changed, so add missing planets / moons now if (!$moon_done && $i > 0) { $moons++; if ($moons == 1) $moon_coordinates .= " - "; else $moon_coordinates .= " ; "; $moon_coordinates .= " ".$old_coordinates.""; } if (!$planet_done && $i > 0) { $planets++; if ($planets == 1) $coordinates .= " - "; else $coordinates .= " ; "; $coordinates .= " ".$old_coordinates.""; } $old_coordinates = $result_row->g_galaxy.":".$result_row->g_system.":".$result_row->g_planet; $old_galaxy = $result_row->g_galaxy; $old_system = $result_row->g_system; $moon_done = false; $planet_done = false; } if ($result_row->moon == "true" && $result_row->energy != NULL) { $moons++; if ($moons == 1) $moon_coordinates .= " - "; else $moon_coordinates .= " ; "; $moon_mouse_over = ' onmouseover="ShowObject(\'report'.$moons.'_M\',\'ajax_reports.php?coordinates='."$result_row->g_galaxy:$result_row->g_system:".$result_row->g_planet.'&moon=1\',true)"'; $moon_coordinates .= " g_galaxy."&system=".$result_row->g_system."\" $moon_mouse_over>".$result_row->g_galaxy.":".$result_row->g_system.":".$result_row->g_planet.""; // add to moon array if ($result_row->sensor > 0) { if (!isset($moon_array[$result_row->g_galaxy])) $moon_array[$result_row->g_galaxy] = array(); $min = $result_row->g_system - (($result_row->sensor * $result_row->sensor) - 1); $max = $result_row->g_system + (($result_row->sensor * $result_row->sensor) - 1); $min = ($min < 1) ? 1 : $min; $max = ($max > 499) ? 499 : $max; array_push($moon_array[$result_row->g_galaxy],array("min"=>$min,"max"=>$max)); } $moon_done = true; } if ($result_row->moon == "false" && $result_row->energy != NULL) { $planets++; if ($planets == 1) $coordinates .= " - "; else $coordinates .= " ; "; $planet_mouse_over = ' onmouseover="ShowObject(\'report'.$planets.'\',\'ajax_reports.php?coordinates='."$result_row->g_galaxy:$result_row->g_system:".$result_row->g_planet.'\',true)"'; $coordinates .= " g_galaxy."&system=".$result_row->g_system."\" $planet_mouse_over>".$result_row->g_galaxy.":".$result_row->g_system.":".$result_row->g_planet.""; if ($result_row->memi > 0) { $amount_metal += floor( 30 * $result_row->memi * pow(1.1,$result_row->memi) + 20); } if ($result_row->krimi > 0) { $amount_crystal += floor(20 * $result_row->krimi * pow(1.1,$result_row->krimi)); } if ($result_row->deutsyn > 0) { $amount_deut += floor(10 * $result_row->deutsyn * pow(1.1,$result_row->deutsyn) * (-0.002 * $max_temp[$result_row->g_planet-1] + 1.28)); } $planet_done = true; } if ($result_row->g_moon == "false") { $moon_done = true; } $i++; } // add last entry if (!$moon_done && $i > 0) { $moons++; if ($moons == 1) $moon_coordinates .= " - "; else $moon_coordinates .= " ; "; $moon_coordinates .= " ".$old_coordinates.""; } if (!$planet_done && $i > 0) { $planets++; if ($planets == 1) $coordinates .= " - "; else $coordinates .= " ; "; $coordinates .= " ".$old_coordinates.""; } $score = ($line->rank > 0) ? DETAILEDINFO_RANK.": ".$line->rank." ".DETAILEDINFO_POINTS." ".number_format($line->points,0,",",".") : DETAILEDINFO_UNKNOWN; $fscore = ($line->frank > 0) ? DETAILEDINFO_RANK.": ".$line->frank." ".DETAILEDINFO_POINTS." ".number_format($line->fpoints,0,",",".") : DETAILEDINFO_UNKNOWN; $rscore = ($line->rrank > 0) ? DETAILEDINFO_RANK.": ".$line->rrank." ".DETAILEDINFO_POINTS." ".number_format($line->rpoints,0,",",".") : DETAILEDINFO_UNKNOWN; if (count($moon_array) > 0) $phalanx_range = get_phalanx_range($moon_array); else $phalanx_range = array(); // determine previous alliances of that player $alliances = array(); if (!empty($playerhistory)) { $query2 = "SELECT distinct(a.allyname), a.id FROM $playerhistory p LEFT JOIN $allytable a ON p.alliance_id = a.id WHERE p.player_id=$player_id AND p.alliance_id > 0"; $res2 = mysql_query($query2) or die(mysql_error()); while ($line2 = mysql_fetch_object($res2)) { $ostat = ""; if ($_SESSION['lang'] == "german") { $ostat = 'ostat'; } elseif ($_SESSION['lang'] == "english") { $ostat = 'ostat'; } array_push($alliances,"id\">".$line2->allyname." ".$ostat.""); } } $ostat = ""; if ($_SESSION['lang'] == "german") { $ostat = 'ostat'; } elseif ($_SESSION['lang'] == "english") { $ostat = 'ostat'; } // stats link $stats_url = "allyhistory.php?p1=$line->playername&option=month"; ob_start(); echo ''. ''. ''. ''. ''. ''. ''. ''. ''. ''. ''. '
'.STATS_PLAYERNAME.''.$line->playername.' '.$ostat; if ($_SESSION['s_diplomatic']) { echo ' options'. '
').utf8_encode(STATS_CHANGE_PLAYER_STATUS).htmlentities('close
'. '').utf8_encode(STATS_NEUTRAL).htmlentities('
'. '').utf8_encode(STATS_BOYCOTT).htmlentities('
'. '').utf8_encode(STATS_NAP).htmlentities('
'. '').utf8_encode(STATS_ALLIED).htmlentities('
'. '').utf8_encode(STATS_WAR).htmlentities('
'. '').utf8_encode(STATS_OWN).htmlentities('
'. '').utf8_encode(STATS_WING).htmlentities('
'. '').utf8_encode(STATS_NOTHING).htmlentities('
 
') .utf8_encode(STATS_DELETE).htmlentities('
' ).'\')" />'; } echo ''; if (!empty($line->allyname)) { $ostat = ""; if ($_SESSION['lang'] == "german") { $ostat = 'ostat'; } elseif ($_SESSION['lang'] == "english") { $ostat = 'ostat'; } echo ''.STATS_ALLYNAME.''.$line->allyname.' '.$ostat.' ('.STATS_MEMBERS.': '.$line->members.') '; } else { echo ''.STATS_ALLYNAME.''.DETAILEDINFO_NO_ALLIANCE.' '; } echo ' '.DETAILEDINFO_SCORE.''.$score.' '.DETAILEDINFO_FLEET.''.$fscore.' '.DETAILEDINFO_RESEARCH.''.$rscore.' '.DETAILEDINFO_KNOWN_PLANETS.''.$planets."".$coordinates.' '.DETAILEDINFO_MOONS.''.$moons."".$moon_coordinates.' '; $i = 0; foreach ($phalanx_range as $galaxy => $text) { if ($i == 0) { echo ''.DETAILEDINFO_PHALANX_AREA.''.$text.''; } else { echo ' '.$text.''; } $i++; } if (count($phalanx_range) == 0) { echo ''.DETAILEDINFO_PHALANX_AREA.''.DETAILEDINFO_NO_PHALANX_AREA.''; } if ($line->noticetext != NULL) { echo ''.DETAILEDINFO_NOTICES.''.utf8_decode($line->noticetext).''; } else { echo ''.DETAILEDINFO_NOTICES.''.DETAILEDINFO_NO_NOTICES.''; } echo ' '.DETAILEDINFO_PREVIOUS_ALLIANCES.''.implode("
",$alliances).' '; $tab1_content = ob_get_clean(); ob_start(); echo '
 '.DETAILEDINFO_METAL.''.DETAILEDINFO_CRYSTAL.''.DETAILEDINFO_DEUTERIUM.'
'.DETAILEDINFO_RESOURCES_PER_HOUR.''.number_format($amount_metal,0,",",".").''.number_format($amount_crystal,0,",",".").''.number_format($amount_deut,0,",",".").'
'.DETAILEDINFO_RESOURCES_PER_DAY.''.number_format($amount_metal*24,0,",",".").''.number_format($amount_crystal*24,0,",",".").''.number_format($amount_deut*24,0,",",".").'
'.DETAILEDINFO_RESOURCES_PER_WEEK.''.number_format($amount_metal*24*7,0,",",".").''.number_format($amount_crystal*24*7,0,",",".").''.number_format($amount_deut*24*7,0,",",".").'
'.DETAILEDINFO_RESOURCES_PER_MONTH.''.number_format($amount_metal*24*30,0,",",".").''.number_format($amount_crystal*24*30,0,",",".").''.number_format($amount_deut*24*30,0,",",".").'
'; $tab2_content = ob_get_clean(); // fleet ob_start(); echo '
'.DETAILEDINFO_FLEET_DETAIL.'
'.$flipped_probe_array[F_SMALLCARGOSHIP].''.number_format($fleetsize["kt"],0,",",".").''.$flipped_probe_array[F_LARGECARGOSHIP].''.number_format($fleetsize["gt"],0,",",".").'
'.$flipped_probe_array[F_LIGHFIGHTER].''.number_format($fleetsize["lj"],0,",",".").''.$flipped_probe_array[F_HEAVYFIGHTER].''.number_format($fleetsize["sj"],0,",",".").'
'.$flipped_probe_array[F_CRUISER].''.number_format($fleetsize["krz"],0,",",".").''.$flipped_probe_array[F_BATTLESHIP].''.number_format($fleetsize["ss"],0,",",".").'
'.$flipped_probe_array[F_COLONYSHIP].''.number_format($fleetsize["kolo"],0,",",".").''.$flipped_probe_array[F_RECYCLER].''.number_format($fleetsize["rec"],0,",",".").'
'.$flipped_probe_array[F_ESPIONAGEPROBE].''.number_format($fleetsize["spio"],0,",",".").''.$flipped_probe_array[F_BOMBER].''.number_format($fleetsize["bomb"],0,",",".").'
'.$flipped_probe_array[F_DESTROYER].''.number_format($fleetsize["zerri"],0,",",".").''.$flipped_probe_array[F_DEATHSTAR].''.number_format($fleetsize["ds"],0,",",".").'
'.$flipped_probe_array[F_BATTLECRUISER].''.number_format($fleetsize["skrz"],0,",",".").''.$flipped_probe_array[F_SOLARSATELLITE].''.number_format($fleetsize["sat"],0,",",".").'
'; $tab3_content = ob_get_clean(); // player techs ob_start(); echo '
'.$flipped_probe_array[RS_ESPIONAGE].''.$line->spiolvl.''.$flipped_probe_array[RS_COMPUTER].''.$line->computech.'
'.$flipped_probe_array[RS_WEAPON].''.$line->waffentech.''.$flipped_probe_array[RS_SHIELDING].''.$line->schildtech.'
'.$flipped_probe_array[RS_ARMOUR].''.$line->rpz.''.$flipped_probe_array[RS_ENERGY].''.$line->energytech.'
'.$flipped_probe_array[RS_HYPERSPACE].''.$line->hypertech.''.$flipped_probe_array[RS_COMBUSTIONENGINE].''.$line->vbt.'
'.$flipped_probe_array[RS_IMPULSEENGINE].''.$line->impulse.''.$flipped_probe_array[RS_HYPERSPACEENGINE].''.$line->hra.'
'.$flipped_probe_array[RS_LASER].''.$line->lasertech.''.$flipped_probe_array[RS_ION].''.$line->iontech.'
'.$flipped_probe_array[RS_PLASMA].''.$line->plasmatech.''.$flipped_probe_array[RS_IRNETWORK].''.$line->forschungsnetz.'
'.$flipped_probe_array[RS_EXPEDITION].''.$line->expedition.''.$flipped_probe_array[RS_GRAVITON].''.$line->gravi.'
'; $tab4_content = ob_get_clean(); // planets overview ob_start(); echo '
'; // table head foreach ($planet_tab_array as $key => $value) { echo "\n"; } echo "\n"; $display_array = array( R_METAL => "metal", R_CRYSTAL => "crystal", R_DEUTERIUM => "deut", R_ENERGY => "energy", B_METALMINE => "memi", B_CRYSTALMINE => "krimi", B_DEUTERIUMSYNTHESIZER => "deutsyn", B_SOLARPLANT => "solar", B_FUSIONPLANT => "fusion", B_ROBOTFACTORY => "robo", B_NANITEFACTORY => "nani", B_SHIPYARD => "rawe", B_METALSTORAGE => "mesp", B_CRYSTALSTORAGE => "krissp", B_DEUTERIUMTANK => "deutsp", B_RESAERCHLAB => "folab", B_TERRAFORMER => "terra", B_ALLIANCEDEPOT => "allydep", B_ROCKETSILO => "raksilo", D_MISSILELAUNCHER => "rak", D_SMALLLASER => "ll", D_HEAVYLASER => "sl", D_IONCANNON => "ion", D_GAUSSCANNON => "gauss", D_PLASMACANNON => "plasma", D_SMALLSHIELDDOME => "ksk", D_LARGESHILDDOME => "gsk", D_ANTIBALLISTICMISSILE => "arak", D_INTERPLANETARYMISSILE => "irak", ); // display content foreach ($display_array as $probe_key => $value_key) { if ($value_key == "rak") { // empty row echo ""; } if ($value_key == "memi") { // empty row echo ""; } // content echo "\n"; foreach ($planet_tab_array as $key => $value) { echo "\n"; } echo "\n"; } echo '
 $key
".REPORTS_DEFENCE."
".REPORTS_BUILDINGS."
".$flipped_probe_array[$probe_key]."".number_format($value[$value_key],0,",",".")."
'; $tab5_content = ob_get_clean(); // moons overview ob_start(); echo '
'; // table head foreach ($moon_tab_array as $key => $value) { echo "\n"; } echo "\n"; $display_array = array( R_METAL => "metal", R_CRYSTAL => "crystal", R_DEUTERIUM => "deut", R_ENERGY => "energy", B_ROBOTFACTORY => "robo", B_SHIPYARD => "rawe", B_METALSTORAGE => "mesp", B_CRYSTALSTORAGE => "krissp", B_DEUTERIUMTANK => "deutsp", B_ALLIANCEDEPOT => "allydep", B_LUNARBASE => "mbase", B_SENSORPHALANX => "sensor", B_JUMPGATE => "sprungtor", D_MISSILELAUNCHER => "rak", D_SMALLLASER => "ll", D_HEAVYLASER => "sl", D_IONCANNON => "ion", D_GAUSSCANNON => "gauss", D_PLASMACANNON => "plasma", D_SMALLSHIELDDOME => "ksk", D_LARGESHILDDOME => "gsk", D_ANTIBALLISTICMISSILE => "arak", D_INTERPLANETARYMISSILE => "irak" ); // display content foreach ($display_array as $probe_key => $value_key) { if ($value_key == "rak") { // empty row echo ""; } if ($value_key == "memi" || $value_key == "robo") { // empty row echo ""; } // content echo "\n"; foreach ($moon_tab_array as $key => $value) { echo "\n"; } echo "\n"; } echo '
 $key
".REPORTS_DEFENCE."
".REPORTS_BUILDINGS."
".$flipped_probe_array[$probe_key]."".number_format($value[$value_key],0,",",".")."
'; $tab6_content = ob_get_clean(); require "tab_plugin.inc.php"; $tab_plugin = new tab_plugin(); if (!$_SESSION['s_probeview']) { $tab_array = array( array("name"=>DETAILEDINFO_GENERAL, "content"=>$tab1_content) ); } else { $tab_array = array( array("name"=>DETAILEDINFO_GENERAL, "content"=>$tab1_content), array("name"=>DETAILEDINFO_RESOURCES, "content"=>$tab2_content), array("name"=>DETAILEDINFO_FLEET_TAB, "content"=>$tab3_content), array("name"=>DETAILEDINFO_TECH, "content"=>$tab4_content), array("name"=>DETAILEDINFO_PLANET_TAB, "content"=>$tab5_content), array("name"=>DETAILEDINFO_MOON_TAB, "content"=>$tab6_content) ); } echo "
"; $tab_plugin->create_tabs($tab_array); echo "
"; } else { // no player with this ID found } } echo ''; echo ''; for($i=1;$i<10;$i++) { echo '
'."\n"; echo '
'."\n"; } makefooter(); ?>