<?php if ($_COOKIE['user'] == '') { header("Location: index.php"); } if ($_GET["load"]) { $selectedmonth = $_GET["month"]; $selectedyear = $_GET["year"]; } else { $selectedmonth = date("m"); $selectedyear = date("Y"); } $service = $_COOKIE['svc']; $ar_agents = getagents($service); $months = buildmonths($selectedmonth); $years = buildyears($selectedyear); $agentsids = buildagentsids($ar_agents); if ($_GET['showall'] == 1) { $showall = " checked"; } if (strpos($service, "/") == "") { $isdir = "true"; } else { $isdir = "false"; } ///////////////functions*////////////////////// function buildagentsids($arr) { foreach ($arr as &$id) { $ids .= $id[0] . "|"; }
foreach ($froms as $from) { $directJumps = array(); foreach ($jumpsTable[$from] as $jumpNode) { if (array_search($jumpNode, $reachableSystems) === FALSE) { $directJumps[] = $jumpNode; } } $reachableSystems = array_merge($reachableSystems, $directJumps); $jumps = array_merge($jumps, $directJumps); $solid = mysql_fetch_row(mysql_query("SELECT solarSystemID,solarSystemName FROM\n\t\t\t\t\t\t\tmapsolarsystems\n\t\t\t\t\t\t\tWHERE solarSystemName LIKE '{$from}';")); echo '<li class="system"><a href="javascript:void(0)" onclick="CCPEVE.showInfo(5, ' . $solid[0] . ')" title="Show System Information">' . $from . '</a></li>' . PHP_EOL; //echo '<ul>' . PHP_EOL; //echo '<table border="0" width="100%">'; //echo wrt_table(0,0,1,'100%',''); //getagents($solid[0]); echo getagents($solid[0]); //echo '</ul>' . PHP_EOL; //echo '</table>'; } $jumpNum++; } echo '</ul>' . PHP_EOL; //all done! //echo '<br />Total number of systems within '.$distance.' jumps from '. $centerSystem .' is '. (count($reachableSystems) - 1); /* echo'<hr>'; function getsys($curs){ global $currsystem; $gets = mysql_query("SELECT msj.fromSolarSystemID AS fromss, msj.toSolarSystemID AS toss, ss.ssname AS sname,ss.systemid AS systemid FROM solarsystems ms INNER JOIN mapsolarsystemjumps msj ON ms.systemid=msj.fromSolarSystemID LEFT JOIN solarsystems ss ON msj.toSolarSystemID=ss.systemid WHERE ms.systemID='$curs';");