//end ship listing loop $out_str .= "<p /><br /><br /><br />"; //don't show the specials link if in a pop-up window. if ($popup) { $out_str .= "<br /><b>" . $cw['specials_meanings'] . "</b>" . config_list(1, $ship_stats['config']); } /****************** * Upgrades listing/information ******************/ } elseif (isset($_GET['upgrades'])) { //listing info for specific config if ($popup) { $out_str .= config_list(1, mysql_escape_string($_GET['chosen'])); //show infor for all configs } else { $out_str .= config_list(1); } $out_str .= $b_link; $help_type = $cw['upgrades']; /************ * Random Events *************/ } elseif (isset($random)) { $out_str .= "<h3><b>" . $cw['random_events'] . "</b></h3>"; $out_str .= $st[816]; $out_str .= $st[817]; $out_str .= make_table(array("", ""), "WIDTH=75%"); $out_str .= quick_row("<b class='b1'>" . $cw['name'] . "</b>", $st[818]); $out_str .= quick_row("<b class='b1'>" . $cw['type'] . "</b>", $st[819]); $out_str .= quick_row("<b class='b1'>" . $cw['when'] . "</b>", $st[820]); $out_str .= quick_row("<b class='b1'>" . $cw['level'] . "</b>", $st[821]);
function checkbox_ship_list($select_sql, $command_option = 0) { global $user, $user_ship, $planet_id, $type, $cw, $st, $table_head_array, $db_name; db2($select_sql); $ships = dbr2(1); $ret_str = ""; $plocation = 0; if (empty($ships)) { return -1; } else { $i = 0; $last_fleet = ''; while ($ships) { $ship_cargo = ""; $ships['fighters'] = $ships['fighters'] . " / " . $ships['max_fighters']; $ships['shields'] = $ships['shields'] . " / " . $ships['max_shields']; $ships['armour'] = $ships['armour'] . " / " . $ships['max_armour']; unset($ships['max_fighters'], $ships['max_shields'], $ships['max_armour']); $ships['ship_name'] = popup_help("ship_info.php?s_id={$ships['ship_id']}", 320, 520, $ships['ship_name']); //Si db_name est inexistant, la popup n'est pas affichée. if ($db_name) { $ships['class_name_abbr'] = popup_help("help.php?popup=1&ship_info={$ships['shipclass']}&db_name={$db_name}", 300, 600, $ships['class_name_abbr']); } if (empty($ships['config'])) { $ships['config'] = $cw['none']; } else { $ships['config'] = config_list(0, $ships['config']); } if ($command_option == 1) { if ($ships['ship_id'] == $user_ship['ship_id']) { $bgcolor = '000000'; array_push($ships, "<i>" . $cw['aux_commandes'] . "</i>"); } else { $bgcolor = '333333'; array_push($ships, "<a href='location.php?command={$ships['ship_id']}'>" . $cw['command'] . "</a>"); } } elseif ($command_option == 2) { array_push($ships, "<a href='planet.php?planet_id={$planet_id}&chosen_ship={$ships['ship_id']}&single_ship_deal=1&type={$type}'>" . $cw['load/unload'] . "</a>" . $cw['ship']); } $ships['cargo_bays'] = bay_storage_little($ships); unset($ships['metal'], $ships['fuel'], $ships['elect'], $ships['colon']); $ships['ship_id'] = "<input type='checkbox' name='do_ship[{$ships['ship_id']}]' value='{$ships['ship_id']}' />"; //$bgcolor = ($i % 2 == 0) ? '444444':'333333'; // if the location is different of the previous if ($plocation && $plocation != $ships['location'] && $command_option == 1) { $ret_str .= "</table><br /><h2>Système " . $ships['location'] . "</h2>"; $ret_str .= make_table($table_head_array); } elseif (!$plocation) { // if this is the first ship listed if ($command_option == 1) { $ret_str .= "<h2>Système " . $ships['location'] . "</h2>"; } $ret_str .= make_table($table_head_array); } // suppression du champ ship class (utilisé pour la popup) unset($ships['shipclass']); // previous location $plocation = $ships['location']; $rowspan = array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); //var_dump($ships); if ($last_fleet != $ships['fleet_id']) { //calcul du nombre de vaisseaux dans la flotte actuelle db("select count(ship_id) from {$db_name}_ships where login_id = " . $user['login_id'] . " AND fleet_id = " . $ships['fleet_id'] . " AND location = " . $ships['location']); $rowspan_count = dbr(); //rowspan[4] = nombre de vaisseaux dans la flottte ($rowspan_count[0];) $rowspan['fleet_id'] = $rowspan_count[0]; $last_fleet = $ships['fleet_id']; } else { unset($ships['fleet_id']); } if ($command_option == 2) { unset($ships['location']); } $ret_str .= "\n" . make_row($ships, $bgcolor, $rowspan); $i++; $ships = dbr2(1); } $ret_str .= "</table><br />"; return $ret_str; } }
$text .= quick_row($cw['location'], $cw['sys'] . " # {$ship['location']}"); $text .= quick_row($cw['fleet'] . " #", $ship['fleet_id']); $text .= quick_row("", ""); $text .= quick_row($cw['fighters'], "{$ship['fighters']}/{$ship['max_fighters']}"); $text .= quick_row($cw['shields'], "{$ship['shields']}/{$ship['max_shields']}"); $text .= quick_row($cw['armour'], "{$ship['armour']}/{$ship['max_armour']}"); $text .= quick_row($cw['size'], discern_size($ship['size'])); $text .= quick_row($cw['cargo_bays'], bay_storage($ship)); if ($GAME_VARS['alternate_play_1'] == 1) { $text .= quick_row($cw['mining_rate'] . ": " . $cw['metal'], $ship['mine_rate_metal']); $text .= quick_row($cw['mining_rate'] . ": " . $cw['fuel'], $ship['mine_rate_fuel']); } else { $quick_maths = $ship['mine_rate_metal'] + $ship['mine_rate_fuel']; $text .= quick_row($cw['mining_rate'], $quick_maths); } $text .= quick_row($cw['speed_move_cost'], $ship['move_turn_cost']); $text .= quick_row("", ""); $text .= quick_row($cw['upgrade_pods'], $ship['upgrade_slots']); $text .= quick_row($cw['specials'], config_list(0, $ship['config'])); $text .= quick_row("# " . $cw['offensive_turrets'], $ship['num_ot']); $text .= quick_row("# " . $cw['defensive_turrets'], $ship['num_dt']); $text .= quick_row("# " . $cw['plasma_turrets'], $ship['num_pc']); $text .= quick_row("# " . $cw['electronic_warfare_pods'], $ship['num_ew']); $text .= quick_row("", ""); $text .= quick_row($cw['point_value'], $ship['point_value']); $text .= quick_row($cw['points_killed'], $ship['points_killed']); $text .= "</table>"; //$text = utf8_encode($text); $rs = ""; //print_s_page($cw['ship_info'], $text); echo "<div class='popup'>{$text}</div>";