db_array); mysql_connect($dbhost,$dbusername,$dbpassword) or die(PARSER_ERROR3); mysql_select_db($dbname) or die(PARSER_ERROR2); if (isset($_GET['action'])) { switch($_GET['action']) { case "delete": break; default: "show"; } } else { $action = "show"; } if ($action == "delete") { if (isset($_GET['report_id'])) { $report_id = intval($_GET['report_id']); $query = "DELETE FROM $reporttable WHERE id='$report_id'"; } else { $galaxy = intval($_GET['galaxy']); $system = intval($_GET['system']); $planet = intval($_GET['planet']); $moon = ($_GET['moon'] == "true") ? "true" : "false"; $query = "DELETE FROM $reporttable WHERE galaxy='$galaxy' AND system='$system' AND planet='$planet' AND moon='$moon'"; } $res = mysql_query($query); if (!$res) { exit("DB Query error. ".mysql_error()); } else { exit("true"); } } if ($action == "show") { switch ($_SESSION['lang']) { case "english" : @include "../languages/english_probes.inc.php"; break; case "german" : @include "../languages/german_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "spanish" : @include "../languages/spanish_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "dutch" : @include "../languages/dutch_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "balkan" : @include "../languages/balkan_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "french" : @include "../languages/french_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "portugues" : @include "../languages/portugues_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "polish" : @include "../languages/polish_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "italian" : @include "../languages/italian_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "turkish" : @include "../languages/turkish_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "danish" : @include "../languages/danish_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "brazilian" : @include "../languages/brazilian_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "russian" : @include "../languages/russian_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "swedish" : @include "../languages/swedish_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "greek" : @include "../languages/greek_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "romanian" : @include "../languages/romanian_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "hungarian" : @include "../languages/hungarian_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "czech" : @include "../languages/czech_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "korean" : @include "../languages/korean_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "norwegian" : @include "../languages/norwegian_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "taiwan" : @include "../languages/taiwan_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "japan" : @include "../languages/japan_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "chinese" : @include "../languages/chinese_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "bulgarian" : @include "../languages/bulgarian_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "lithuanian" : @include "../languages/lithuanian_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "latvian" : @include "../languages/latvian_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; case "finnish" : @include "../languages/finnish_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; default : @include "../languages/german_probes.inc.php"; $flipped_probe_array = array_flip($probe_array); break; } $coordinates_array = explode(":",$_GET['coordinates']); if (count($coordinates_array) == 3) { //$query = "SELECT *,CONCAT(galaxy,':',system,':',planet) FROM $reporttable WHERE galaxy='".(int)$coordinates_array[0]."' AND system='".(int)$coordinates_array[1]."' AND planet='".(int)$coordinates_array[2]."'"; $query = "SELECT r.*,CONCAT(r.galaxy,':',r.system,':',r.planet) as coordinates, ". "g.planetname as g_planetname, p.spiolvl as p_spiolvl, p.computech as p_computech, p.waffentech as p_waffentech, p.schildtech as p_schildtech, p.rpz as p_rpz, ". "p.energytech as p_energytech, p.hypertech as p_hypertech, p.vbt as p_vbt, p.impulse as p_impulse, p.hra as p_hra, p.lasertech as p_lasertech, p.iontech as p_iontech, ". "p.plasmatech as p_forschungsnetz, p.gravi as p_gravi,u.username, p.playername ". "FROM $reporttable r ". "LEFT JOIN $dbtablename g ON (r.galaxy=g.galaxy AND r.system=g.system AND r.planet=g.planet) ". "LEFT JOIN $playertable p ON (g.player_id = p.id) ". "LEFT JOIN $utablename u ON (r.user_id = u.id) ". "WHERE r.galaxy='".(int)$coordinates_array[0]."' AND r.system='".(int)$coordinates_array[1]."' AND r.planet='".(int)$coordinates_array[2]."'"; if (isset($_GET['moon']) && $_GET['moon'] == 1) { // Spiobericht vom Mond $query .= " AND r.moon='true'"; } else { // Spiobericht vom Planeten $query .= " AND r.moon='false'"; } $query .= " LIMIT 1"; $res = mysql_query($query) or die(mysql_error()); if (mysql_num_rows($res) > 0) { $reports = 0; while ($line = mysql_fetch_assoc($res)) { // store report ID $report_id = $line["id"]; // store username who uploaded the reports $report_uploader = $line["username"]; // resis are not within reports, so we delete them here $line['coordinates'] = $line["galaxy"].":".$line["system"].":".$line["planet"]; unset($line["fleet_resis"]); unset($line["defence_resis"]); if ($reports > 0) echo "

"; $moon = ($line["moon"] == "true") ? REPORTS_MOON : VIEW_PLANET." ".$line["planetname"]; echo ' '; foreach ($top_array as $key => $value) { break; // just get the first entry -> 'Resources on' in its specific language } echo ' '; unset($line["galaxy"]); unset($line["system"]); unset($line["planet"]); $i = 0; switch ($line['scanned']) { case "ressources" : $scanned = 1; break; case "fleet" : $scanned = 2; break; case "defence" : $scanned = 3; break; case "buildings" : $scanned = 4; break; case "research" : $scanned = 5; break; default : $scanned = 1; } $playertechs = false; if ($line["planetname"] == $line["g_planetname"]) { // report belongs to the player - so use playertechs instead $playertechs = true; $line["spiolvl"] = $line["p_spiolvl"]; $line["computech"] = $line["p_computech"]; $line["waffentech"] = $line["p_waffentech"]; $line["schildtech"] = $line["p_schildtech"]; $line["rpz"] = $line["p_rpz"]; $line["energytech"] = $line["p_energytech"]; $line["hypertech"] = $line["p_hypertech"]; $line["vbt"] = $line["p_vbt"]; $line["impulse"] = $line["p_impulse"]; $line["hra"] = $line["p_hra"]; $line["lasertech"] = $line["p_lasertech"]; $line["iontech"] = $line["p_iontech"]; $line["plasmatech"] = $line["p_forschungsnetz"]; $line["gravi"] = $line["p_gravi"]; } $speedsim_link = ""; $speedsim_link = update_speedsim_link($speedsim_link,"enemy_name",$line["planetname"]); unset($line["planetname"]); foreach ($line as $key => $value) { $speedsim_link = update_speedsim_link($speedsim_link,$key,$value); if ($key != "id" && $key != "coordinates" && $key != "moon" && $key != "scantime" && $key != "scanned") { if ($key == "kt" || $key == "rak" || $key == "memi" || $key == "spiolvl") { if ($i % 2 != 0) echo ""; echo ""; $i = 0; } if ($key == 'metal' || $key == 'crystal' || $key == 'deuterium' || $key == 'energy') { if ($i % 2 == 0) echo ""; if (isset($flipped_probe_array) && is_array($flipped_probe_array)) { echo ""; } else { echo ""; } $i++; if ($i % 2 == 0) echo ""; } elseif ($value > 0) { if (isset($flipped_probe_array) && is_array($flipped_probe_array) && isset($db_array[$key])) { if ($i % 2 == 0) echo ""; echo ""; $i++; if ($i % 2 == 0) echo ""; } elseif (isset($db_array[$key])) { if ($i % 2 == 0) echo ""; echo ""; $i++; if ($i % 2 == 0) echo ""; } } } } $speedsim_link = substr($speedsim_link,0,strlen($speedsim_link)-5); if ($i % 2 != 0) echo ""; echo ""; echo ""; echo ""; echo "
'.$key.' '.$moon." [".$line['coordinates'].'] (\''.$line['playername'].'\')
'.$report_when.' '.$line['scantime'].'
'.REPORTS_RESOURCES.'
 
=2) ? "truespio" : "falsespio"; echo "\">".REPORTS_FLEET; break; case "rak" : echo " class=\""; echo ($scanned>=3) ? "truespio" : "falsespio"; echo "\">".REPORTS_DEFENCE; break; case "memi" : echo " class=\""; echo ($scanned>=4) ? "truespio" : "falsespio"; echo "\">".REPORTS_BUILDINGS; break; case "spiolvl" : echo " class=\""; if (!$playertechs) { echo ($scanned>=5) ? "truespio" : "falsespio"; } else { echo "playertechs"; } echo "\">".REPORTS_TECHNOLOGY; break; } echo "
".$flipped_probe_array[$db_array[$key]].":".number_format($value,0,",",".")."".$db_array[$key].":".number_format($value,0,",",".")."
".$flipped_probe_array[$db_array[$key]]."".number_format($value,0,",",".")."
".$db_array[$key]."".number_format($value,0,",",".")."
 
".REPORTS_UPLOAD_BY.": ".$report_uploader."
".REPORTS_DELETE."".REPORTS_SPEEDSIM."
\n"; $reports++; } } } } ?>