Esempio n. 1
0
     $cloak_str_start = "<b class='cloak'>";
     $cloak_str_end = "</b>";
 }
 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();
     //var_dump($rowspan[0]);
     //rowspan[4] = nombre de vaisseaux dans la flottte ($rowspan_count[0];)
     $rowspan[4] = $rowspan_count[0];
     $last_fleet = $ships['fleet_id'];
 } else {
     $ships['fleet_id'] = null;
 }
 //$error_str .= "\n $cloak_str_start $ships[ship_name] (<b class='b1'>$ships[class_name_abbr]</b> w/ <b>$ships[fighters]</b> fighters)".$cloak_str_end;
 $row_array = array("{$cloak_str_start} " . popup_help("ship_info.php?s_id={$ships['ship_id']}", 320, 520, $ships['ship_name']) . " {$cloak_str_end}", "" . popup_help("help.php?popup=1&ship_info={$ships['shipclass']}&db_name={$db_name}", 300, 600, $ships[class_name_abbr]), "{$ships['fighters']}", bay_storage_little($ships));
 if ($user['clan_id'] > 0 && $GAME_VARS['clan_fleet_attacking'] == 1) {
     //$c_fleet_str = " - Clan Fleet: <b>".$ships['clan_fleet_id']."</b> ";
     $row_array = array_merge($row_array, (array) $ships['clan_fleet_id']);
 } else {
     $c_fleet_str = "";
 }
 //$error_str .= " - Fleet: <b>$ships[fleet_id]</b> $c_fleet_str- <a href='location.php?command=$ships[ship_id]'>Command</a>";
 //$error_str .= " - <input type=checkbox name=do_ship[$ships[ship_id]] value=$ships[ship_id] /><br />";
 if ($ships['ship_id'] == $user['ship_id']) {
     $bgcolor = '000000';
     $commander = '<i>' . $cw['aux_commandes'] . '</i>';
 } else {
     $bgcolor = '333333';
     $commander = "<a href='location.php?command={$ships['ship_id']}'>" . $cw['command'] . "</a>";
 }
Esempio n. 2
0
    */
    if (!$show_galaxies) {
        echo '<p>Vous êtes en mode vacances, pour revenir en mode normal allez au menu <a href="user_extra.php">compte & parrainage</a>.</p>';
    }
    ?>
	</div>

	<div id="accueilColonne2" style="width: 400px;">
	<?php 
    $alpha_text = "";
    $beta_text = "";
    if (!$p_user['ban'] && $show_galaxies) {
        //cycle through the games that are running.
        db2("select name, db_name, paused, game_id, days_left, description from se_games where status = '1' order by last_reset asc");
        while ($game_stat = dbr2(1)) {
            $stat = " - " . popup_help("game_info.php?db_name={$game_stat['db_name']}", 600, 450);
            if ($game_stat['paused'] == 1) {
                $stat .= " - (" . $cw['paused'] . ")";
            }
            db("select {$game_stat['db_name']}_value as value from se_db_vars where name = 'sudden_death'");
            $sd = dbr(1);
            if ($sd['value'] == 1) {
                $stat .= " - (" . $cw['sudden_death'] . ")";
            }
            db("select {$game_stat['db_name']}_value as value from se_db_vars where name = 'new_logins'");
            $sd = dbr(1);
            if ($sd['value'] == 0) {
                $stat .= " - (" . $st[810] . ")";
            }
            db("select {$game_stat['db_name']}_value as value from se_db_vars where name = 'game_length'");
            $sd = dbr(1);
Esempio n. 3
0
                $type = "Modulaires";
            } elseif (eregi("Transport", $ship_stats['type'])) {
                $type = "Transport";
            } else {
                $type = "Autres";
                //A special ship
                if (config_check("oo", $ship_stats)) {
                    $buy_many_link = "";
                    //had a brob before, so this one costs more.
                    if ($user['one_brob'] > 0) {
                        $ship_stats['cost'] = $ship_stats['cost'] * $user['one_brob'];
                    }
                }
            }
            $ship_stats['cost'] = nombre($ship_stats['cost'], 0, ',', ' ');
            $array_ships[$type] .= "\n" . make_row(array("<a href='ship_build.php?ship_type={$type_id}'>{$ship_stats['name']}</a>", "{$ship_stats['class_abbr']}", "<b>{$ship_stats['cost']}</b>", "<a href='ship_build.php?ship_type={$type_id}'>" . $cw['buy_one'] . "</a>", $buy_many_link, popup_help("help.php?popup=1&ship_info={$type_id}&db_name={$db_name}", 300, 600) . "<b></b></a>"));
        }
    }
    foreach ($array_ships as $type => $content) {
        if ($type == 'Bataille' || $type == 'Transport') {
            $out .= " Vaisseaux de <b class='b1'>{$type}</b>" . make_table(array($cw['ship_name'], $cw['abbrv'], $cw['cost']));
        } else {
            $out .= " Vaisseaux <b class='b1'>{$type}</b>" . make_table(array($cw['ship_name'], $cw['abbrv'], $cw['cost']));
        }
        $out .= $content . "</table><p />";
    }
    $out .= "<p /><a href='help.php?ship_info=-1' target='_blank'>" . $st[1891] . "</a>";
    //load the default earth page
} else {
    if ($user_options['show_pics']) {
        //$out .= " <img src='$directories[images]/places/earth.jpg' alt='A Picture of Earth' /><br />";
Esempio n. 4
0
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}&amp;chosen_ship={$ships['ship_id']}&amp;single_ship_deal=1&amp;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;
    }
}
Esempio n. 5
0
    } elseif ($planet['research_fac'] != 0) {
        $out .= $st[111];
    } elseif ($num_research[0] > 1) {
        $out .= $st[112];
    } elseif (!isset($_POST['sure'])) {
        get_var($cw['buy_research_facility'], $_SERVER['PHP_SELF'], sprintf($st[113], $GAME_VARS[hourly_tech]) . popup_help("help.php?topic=Blackmarkets&sub_topic=Research_Facilities_and_Support_Units&popup=1", 500, 400, $cw['click_here']) . ".", 'sure', 'yes');
    } else {
        take_cash($research_fac_cost);
        $out .= sprintf($st[114], $planet[planet_name], $research_fac_cost);
        dbn("update {$db_name}_planets set research_fac = '1' where planet_id = '{$planet['planet_id']}'");
    }
    #build a shield generator
} elseif (isset($_REQUEST['shield_gen'])) {
    $header = $cw['shield_generator_construction'];
    if ($user['cash'] < $shield_gen_cost) {
        $out .= $st[115];
    } elseif (!avail_check(3000)) {
        $out .= $st[110];
    } elseif ($planet['shield_gen'] > 0) {
        $out .= $st[116];
    } elseif (!isset($sure)) {
        get_var($cw['buy_shield_generator'], 'add_planetary.php', $st[117] . popup_help("help.php?topic=Planets&popup=1&sub_topic=Shield_Generators", 400, 220, $cw['click_here']) . ".", 'sure', 'yes');
    } else {
        take_cash($shield_gen_cost);
        $out .= sprintf($st[118], $planet[planet_name], $shield_gen_cost);
        dbn("update {$db_name}_planets set shield_gen = '3' where planet_id = '{$planet['planet_id']}'");
    }
} else {
    $out = $st[119];
}
print_page($header, $out . "<p /><a href='planet.php?planet_id={$planet_id}'>" . $st[120] . "</a>");
Esempio n. 6
0
        } else {
            $output_str .= "<a href='{$_SERVER['PHP_SELF']}?more_drones=1&planet_id={$planet_id}'>" . $st[1701] . "</a>";
        }
    }
    $output_str .= "<p /><br /><table><tr><td>" . $st[1702] . "</tr></td><form name=pop_set_form method=post action=planet.php><input type=hidden name=planet_id value='{$planet_id}' /><input type=hidden name=assinging value='1' />";
    $output_str .= quick_row($cw['tax_rate'], "6% (" . $st[1703] . ")");
    $output_str .= quick_row($st[1704], idle_colonists());
    $output_str .= quick_row($st[1705], "<input type=text name=num_pop_set_1 value='{$planet['alloc_fight']}' size=6 />");
    $output_str .= quick_row($st[1706], "<input type=text name=num_pop_set_2 value='{$planet['alloc_elect']}' size=6 />");
    $output_str .= "<tr><td><input type='submit' value='" . $cw['set'] . "' /></td><td><input type=reset value=Reset /></td></tr></form>";
    $output_str .= "</table><br />";
    if ($GAME_VARS['uv_num_bmrkt'] > 0 && $planet['research_fac'] == 0 && avail_check(4000)) {
        $output_str .= "<p /><a href='add_planetary.php?planet_id={$planet_id}&research_fac=1'>" . $st[1707] . "</a> - <b>{$research_fac_cost}</b> - " . popup_help("help.php?topic=Blackmarkets&sub_topic=Research_Facilities_and_Support_Units&popup=1", 500, 400);
    }
    if (!$planet['shield_gen'] && avail_check(3000)) {
        $output_str .= "<p /><a href='add_planetary.php?planet_id={$planet_id}&shield_gen=1'>" . $st[1708] . "</a> - <b>{$shield_gen_cost}</b> - " . popup_help("help.php?topic=Planets&popup=1&sub_topic=Shield_Generators", 400, 220);
    } elseif ($planet['shield_gen'] && avail_check(3000)) {
        $t545 = $planet['shield_gen'] * 1000;
        $output_str .= "<p />" . $st[1709] . ": <b>{$planet['shield_charge']}</b> / <b>{$t545}</b> - <a href='planet.php?planet_id={$planet_id}&all_shield=1'>" . $st[1710] . "</a>";
    }
    db("select * from {$db_name}_planets where planet_id = '{$user['on_planet']}'");
    $planet = dbr();
    if (($user['login_id'] == $planet['login_id'] || $user['clan_id'] == $planet['clan_id']) && ($GAME_VARS['uv_planets'] < 0 || $user['terra_imploder'] > 0)) {
        $output_str .= "<p /><a href='planet.php?planet_id={$planet_id}&destroy=1'>" . $cw['destroy'] . " {$planet['planet_name']}</a>";
    }
    #only show the "claim" link to someone who doesn't own the planet.
} else {
    $output_str .= "<a href='planet.php?planet_id={$planet_id}&claim=1'>" . $cw['claim'] . " {$planet['planet_name']}</a>";
}
$rs = "<p /><a href='location.php'>" . $cw['takeoff'] . "</a><br />";
print_page($cw['planet'], $output_str);
Esempio n. 7
0
}
if (avail_check(5002)) {
    $cost_temp = get_cost("ew");
    $buy_many = "";
    $num = $max_ew - $user_ship['num_ew'];
    if ($user_ship['upgrade_slots'] > 1 && $num > 1) {
        $buy_many .= "<a href='{$filename}?buy=5&many_ew={$num}'>Acheter {$num}</a>";
    }
    $error_str .= make_row(array($cw['electronic_warfare_pod'], "Max of {$max_pc} per ship.", $cost_temp['cost'], $cost_temp['tech_cost'], "<a href='{$filename}?buy=5'>" . $cw['buy'] . "</a>", $buy_many, popup_help("help.php?upgrades=1&popup=1&chosen=ew", 350, 315)));
}
$error_str .= "</table>";
$error_str .= "<br /><br />" . $cw['misc'] . "";
$error_str .= make_table(array($cw['item_name'], $cw['notes'], $cw['credits_cost'], $cw['tech_cost']), "75%");
if (avail_check(5003)) {
    if ($GAME_VARS['ship_warp_cost'] == -1) {
        $engine_changes = $st[421];
    } else {
        $engine_changes = "";
    }
    $error_str .= make_row(array($cw['advanced_engine_upgrade'], sprintf($st[424], $engine_changes), $advanced_engine_c, $advanced_engine_t, "<a href='{$filename}?buy=9'>" . $cw['buy'] . "</a>", popup_help("help.php?upgrades=1&popup=1&chosen=e2", 350, 315)));
}
if (avail_check(5001)) {
    $error_str .= make_row(array($cw['bio-organic_armour'], $st[423], $bio_armour_c, $bio_armour_t, "<a href='{$filename}?buy=4'>" . $cw['buy'] . "</a>", popup_help("help.php?upgrades=1&popup=1&chosen=bo", 350, 315)));
}
if ($GAME_VARS['uv_planets'] > 0 && avail_check(1000)) {
    $error_str .= make_row(array($cw['gensis_device'], $cw['gensis_device'], $genesis_c, $genesis_t, "<a href='{$filename}?buy=7'>Acheter</a>"));
    $error_str .= make_row(array($cw['creates_planets'], $cw['allows_the_destruction_of_a_planet'], $terra_i_c, $terra_i_t, "<a href='{$filename}?buy=8'>" . $cw['buy'] . "</a>"));
}
$error_str .= "</table>";
$error_str .= $st[422];
print_page("Blackmarket Upgrades", $error_str);
Esempio n. 8
0
        continue;
    } else {
        if (config_check("oo", $ship_stats)) {
            if ($user['one_brob']) {
                $ship_stats['cost'] = $ship_stats['cost'] * $user['one_brob'];
                $ship_stats['tcost'] = $ship_stats['tcost'] * $user['one_brob'];
            }
            $ab_text = "";
        } else {
            $ab_text = "<a href='bm_ships.php?mass={$ship_stats['type_id']}'>" . $cw['buy_many'] . "</a>";
        }
        $ship_stats['cost'] = nombre($ship_stats['cost']);
        if (!isset($ships_for_sale[$ship_stats['type']])) {
            $ships_for_sale[$ship_stats['type']] = "";
        }
        $txt = make_row(array("<a href='bm_ships.php?ship_type={$ship_stats['type_id']}'>{$ship_stats['name']}</a>", "{$ship_stats['class_abbr']}", "<b>{$ship_stats['cost']}</b>", "<b>{$ship_stats['tcost']}</b>", "<a href='bm_ships.php?ship_type={$ship_stats['type_id']}'>" . $cw['buy_one'] . "</a>", $ab_text, popup_help("help.php?popup=1&ship_info={$ship_stats['type_id']}&db_name={$db_name}", 300, 400)));
        $ships_for_sale[$ship_stats['type']] .= $txt;
    }
}
if (empty($ships_for_sale)) {
    $text .= $st[384];
} else {
    foreach ($ships_for_sale as $class => $str) {
        $text .= "<p />{$class}s available:";
        if (empty($str)) {
            $text .= "<br /><b>" . $cw['none'] . "</b>";
        } else {
            $text .= make_table(array($cw['ship_name'], "Abbrv.", $cw['credit_cost'], $cw['tech_unit_cost']));
            $text .= stripslashes($str);
            $text .= "</table>";
        }
Esempio n. 9
0
        $error_str .= $eng_text . "</table>";
    }
    /**************************
     * Misc Items
     **************************/
    $misc_text = "";
    if (avail_check(2003)) {
        $misc_text .= make_row(array($cw['shrouding_unit'], $st[657], $cloak_cost, "<a href='{$filename}?buy=4'>" . $cw['buy'] . "</a>", popup_help("help.php?upgrades=1&popup=1&chosen=ls", 350, 315)));
    }
    if (avail_check(2004)) {
        $cost_temp = get_cost("sc");
        $misc_text .= make_row(array($cw['scanner'], $st[658], $cost_temp['cost'], "<a href='{$filename}?buy=7'>" . $cw['buy'] . "</a>", popup_help("help.php?upgrades=1&popup=1&chosen=sc", 350, 315)));
    }
    if (avail_check(2005)) {
        $cost_temp = get_cost("sh");
        $misc_text .= make_row(array($st[659], $st[660], $cost_temp['cost'], "<a href='{$filename}?buy=5'>" . $cw['buy'] . "</a>", popup_help("help.php?upgrades=1&popup=1&chosen=sh", 350, 315)));
    }
    if (!empty($misc_text)) {
        $error_str .= "<br /><br />" . $cw['misc'];
        $error_str .= make_table(array($cw['item_name'], $cw['notes'], $cw['item_cost']), "75%");
        $error_str .= $misc_text . "</table>";
    }
    $error_str .= "<p /><a href='help.php?topic=Upgrades' target='_blank'>" . $st[661] . "</a>";
}
$rs = "<p /><a href='earth.php'>" . $cw['return_to_earth'] . "</a>";
print_page($cw['accessories_upgrades'], $error_str);
#function for adding 'normal' upgrades to a ship.
function make_basic_upgrade($upgrade_str, $upgrade_sql, $inc_amount, $cost)
{
    global $user, $user_ship, $db_name;
    if ($user['cash'] < $cost) {
Esempio n. 10
0
    } elseif ($fill_fleet == 2) {
        //shields
        $error_str .= fill_fleet('shields', 'max_shields', $cw['shields'], $shield_cost);
    } else {
        //armour
        $error_str .= fill_fleet('armour', 'max_armour', $cw['armour-units'], $armour_cost);
    }
}
db("select * from {$db_name}_ships where ship_id = {$user['ship_id']}");
$vaisseau_controle = dbr(1);
$error_str .= $st[1065];
$error_str .= $st[1066];
$error_str .= "<table class='equip_shop'><tr><th>Type</th><th>Coût</th><th>Vaisseau (" . $vaisseau_controle['ship_name'] . ")</th><th>Flotte complète</th><th></th></tr>";
$error_str .= "<tr><td>" . $cw['fighters'] . "</td><td> <b>{$fighter_cost}</b> / unité</td><td><center><a href='{$filename}?buy=1'>Equiper vaisseau</center></a>  </td><td>  <a href='{$filename}?fill_fleet=1'>" . $cw['fill_fleet'] . "</a></td>  <td>" . popup_help("help.php?topic=Combat&popup=1&sub_topic=-_Chasseurs", 440, 225) . "</td></tr>";
$error_str .= "<tr><td>" . $cw['shields'] . "</td><td> <b>{$shield_cost}</b> / unité</td><td><center><a href='{$filename}?buy=2'>Equiper vaisseau</center></a> </td><td>  <a href='{$filename}?fill_fleet=2'>" . $cw['fill_fleet'] . "</a></td>  <td>" . popup_help("help.php?topic=Combat&popup=1&sub_topic=-_Boucliers", 400, 205) . "</td></tr>";
$error_str .= "<tr><td>" . $cw['armour'] . "</td><td> <b>{$armour_cost} </b> / unité </td><td><center><a href='{$filename}?buy=3'>Equiper vaisseau</center></a></td><td><a href='{$filename}?fill_fleet=3'>" . $cw['fill_fleet'] . "</a></td>  <td>" . popup_help("help.php?topic=Combat&popup=1&sub_topic=-_Coques", 440, 260) . "</td></tr>";
if ($GAME_VARS['alternate_play_1'] == 1) {
    $error_str .= "<tr><td>" . $cw['mining_switcher'] . "</td><td><b>" . nombre($mining_switch_cost) . "</b></td><td><center><a href='{$filename}?switch=1'>Equiper vaisseau</a></center></td><td><a href='{$filename}?mass_switch=1'>" . $cw['switch_fleet'] . "</td></tr></a></table>";
}
$error_str .= "<table class='equip_shop'><tr><th>Type</th><th>Coût</th><th></th></tr>";
if ($user['login_id'] == 1 || avail_check(1000)) {
    $error_str .= $st[1067];
    $error_str .= "<tr><td>" . $cw['genesis_device'] . "</td><td><b>" . nombre($genesis_cost) . "</b></td><td><a href='{$filename}?buy=5'>Acheter</a></td></tr>";
}
if (!$GAME_VARS['bomb_flag'] || $user['login_id'] == 1) {
    if (avail_check(1001)) {
        $error_str .= "<tr><td>" . $cw['alpha_bomb'] . "</td><td><b>" . nombre($bomb_cost) . "</b></td><td><a href='{$filename}?buy=7'>Acheter</a></td></tr> ";
    }
    /*if(avail_check(1002)){
    		$error_str .= "<br /><a href='$filename?buy=6'>Gamma Bomb</a>: $bomb_cost";
    	}*/