Example #1
0
function create_tracking_table($substatus, $textstat)
{
    global $status, $login_id;
    $action = "";
    $issue['id'] = "Bug ID";
    $issue['title'] = "Bug Title";
    $issue['status'] = "Status";
    $issue['login_id'] = "Submitted By";
    $issue['action'] = "Action(s)";
    $out = make_table($issue, "WIDTH=55%");
    $counter = 0;
    db("SELECT id, title, login_id FROM server_issuetracking WHERE status= " . $status . $substatus);
    while ($issues = dbr(1)) {
        $action = "<a href='{$_SERVER['PHP_SELF']}?status={$status}&id={$issues['id']}&action=view'>View</a>";
        if ($login_id == OWNER_ID) {
            //server admin only
            if ($status == 1) {
                $action .= " - <a href='{$_SERVER['PHP_SELF']}?&status={$status}&id={$issues['id']}&action=forward'>Outstanding</a>";
                $action .= " - <a href='{$_SERVER['PHP_SELF']}?&status={$status}&id={$issues['id']}&action=resolve'>Close</a>";
            } elseif ($status == 2) {
                $action .= " - <a href='{$_SERVER['PHP_SELF']}?&status={$status}&id={$issues['id']}&action=forward'>Close</a>";
                $action .= " - <a href='{$_SERVER['PHP_SELF']}?&status={$status}&id={$issues['id']}&action=up'>Up</a>";
                $action .= " - <a href='{$_SERVER['PHP_SELF']}?&status={$status}&id={$issues['id']}&action=down'>Down</a>";
            } elseif ($status == 3) {
                $action .= " - <a href='{$_SERVER['PHP_SELF']}?&status={$status}&id={$issues['id']}&action=reopen'>Reopen</a>";
                $action .= " - <a href='{$_SERVER['PHP_SELF']}?&status={$status}&id={$issues['id']}&action=up'>Up</a>";
                $action .= " - <a href='{$_SERVER['PHP_SELF']}?&status={$status}&id={$issues['id']}&action=down'>Down</a>";
            }
        }
        //end of admin only.
        $issue['id'] = $issues['id'];
        $issue['title'] = $issues['title'];
        $issue['status'] = $textstat;
        db2("select login_name from user_accounts where login_id = '{$issues['login_id']}'");
        $temp_store = dbr2(1);
        $issue['login_id'] = $temp_store['login_name'];
        $issue['action'] = $action;
        $out .= make_row($issue);
        $counter++;
    }
    if ($counter == 0) {
        //if no bugs
        $issue['id'] = "NONE";
        $issue['title'] = "";
        $issue['status'] = "";
        $issue['login_id'] = "";
        $issue['action'] = "";
        $out .= make_row($issue);
    }
    $out .= "</table>";
    return " - {$counter} Entries<br />" . $out;
}
Example #2
0
            insert_history($user['login_id'], sprintf($st[750], $transfer_counter, $target[login_name]));
        }
    }
    print_page($cw['transfer_ship'], $text);
}
$text .= sprintf($st[751], $target[login_name]) . "<br /><br />";
$text .= "<b class='b1'>" . $st[752] . "<br />";
$text .= "<form action=send_ship.php method=POST name=transfer_ships><table>";
db("select ship_name, class_name, location, fighters, max_fighters, shields, max_shields, armour, max_armour, config, ship_id from {$db_name}_ships where login_id = '{$user['login_id']}' && ship_id != '{$user['ship_id']}' order by class_name");
$ships = dbr(1);
if (!isset($ships)) {
    #ensure there are some ships to display
    $text .= $st[753];
} else {
    $text .= make_table(array("Nom du vaisseau", "Type de vaisseau", "Emplacement", "Chasseurs", "Boucliers", "Coques", "Configuration"));
    while ($ships) {
        $ships['fighters'] = $ships['fighters'] . " / " . $ships['max_fighters'];
        $ships['shields'] = $ships['shields'] . " / " . $ships['max_shields'];
        $ships['armour'] = $ships['armour'] . " / " . $ships['max_armour'];
        #remove the un-necassaries from the array. As well as their numerical counterparts (it's a multi-indexed array).
        unset($ships['max_fighters']);
        unset($ships['max_shields']);
        unset($ships['max_armour']);
        $ships['ship_id'] = "<input type=checkbox name=do_ship[{$ships['ship_id']}] value={$ships['ship_id']} /> - <a href='send_ship.php?target={$target['login_id']}&do_ship[{$ships['ship_id']}]={$ships['ship_id']}'>" . $cw['sign_over'] . "</a>";
        $text .= make_row($ships);
        $ships = dbr(1);
    }
}
$text .= "</table><br /><input type=hidden name=target value={$target['login_id']} /><input type='submit' name='submit' value='Envoyer les vaisseaux' /> - <a href=javascript:TickAll(\"transfer_ships\")>" . $st[754] . "</a><br /></form>";
$text .= "<br /><a href='send_ship.php?target={$target['login_id']}'>" . $st[755] . "</a>";
print_page($cw['transfer_ship_registration'], $text);
Example #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 />";
Example #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;
    }
}
Example #5
0
$text = '';
$filename = 'planet_list.php';
#little code to allow users to sort planets asc, desc in a number of criteria
if (isset($sort_planets)) {
    if ($sorted == 1) {
        $going = "asc";
        $sorted = 2;
    } else {
        $going = "desc";
        $sorted = 1;
    }
    db("select planet_img,planet_name,location,fighters,colon,cash,metal,fuel,elect from {$db_name}_planets where login_id = {$user['login_id']} and location != 1 order by '{$sort_planets}' {$going}");
} else {
    db("select planet_img,planet_name,location,fighters,colon,cash,metal,fuel,elect from {$db_name}_planets where login_id = {$user['login_id']} and location != 1 order by fighters desc, planet_name asc");
    $sorted = "";
}
$clan_planet = dbr(1);
if ($clan_planet) {
    $text .= make_table(array('', "<a href='{$filename}?sort_planets=planet_name&sorted={$sorted}'>" . $cw['planet_name'] . "</a>", "<a href='{$filename}?sort_planets=location&sorted={$sorted}'>" . $cw['location'] . "</a>", "<a href='{$filename}?sort_planets=fighters&sorted={$sorted}'>" . $cw['fighters'] . "</a>", "<a href='{$filename}?sort_planets=colon&sorted={$sorted}'>" . $cw['colonists'] . "</a>", "<a href='{$filename}?sort_planets=cash&sorted={$sorted}'>" . $cw['cash'] . "</a>", "<a href='{$filename}?sort_planets=metal&sorted={$sorted}'>" . $cw['metal'] . "</a>", "<a href='{$filename}?sort_planets=fuel&sorted={$sorted}'>" . $cw['fuel'] . "</a>", "<a href='{$filename}?sort_planets=elect&sorted={$sorted}'>" . $cw['electronics'] . "</a>"));
    while ($clan_planet) {
        $clan_planet['planet_img'] = '<img src="images/planets/' . $clan_planet['planet_img'] . '_tn.jpg" border=0>';
        $text .= make_row($clan_planet);
        $clan_planet = dbr(1);
    }
    $text .= "</table><br />";
} else {
    $text .= $st[1815];
}
$rs = "<p /><a href='location.php'>" . $cw['back_star_system'] . "</a>";
// print page
print_page($cw['planet_list'], $text);
Example #6
0
         db("select ship_name,class_name_abbr,location,fighters,shields,armour,clan_fleet_id,ship_id from {$db_name}_ships where clan_id = '{$user['clan_id']}' order by fighters desc, ship_name asc");
         $sorted_ships = 1;
     }
     $clan_ship = dbr(1);
     $clan_page_tab = array("<a href='{$filename}?sort_ships=ship_name&sorted_ships={$sorted_ships}&show_clan_ships=1'>" . $cw['ship_name'] . "</a>", "<a href='{$filename}?sort_ships=class_name_abbr&sorted_ships={$sorted_ships}&show_clan_ships=1'>" . $cw['ship_class'] . "</a>", "<a href='{$filename}?sort_ships=location&sorted_ships={$sorted_ships}&show_clan_ships=1'>" . $cw['location'] . "</a>", "<a href='{$filename}?sort_ships=fighters&sorted_ships={$sorted_ships}&show_clan_ships=1'>" . $cw['fighters'] . "</a>", "<a href='{$filename}?sort_ships=shields&sorted_ships={$sorted_ships}&show_clan_ships=1'>" . $cw['shields'] . "</a>", "<a href='{$filename}?sort_ships=armour&sorted_ships={$sorted_ships}&show_clan_ships=1'>" . $cw['armour'] . "</a>", "<a href='{$filename}?sort_ships=clan_fleet_id&sorted_ships={$sorted_ships}&show_clan_ships=1'>" . $cw['can_fleet'] . "</a>", $cw['change_fleet']);
     if ($GAME_VARS['clan_fleet_attacking'] == 0) {
         unset($table_head_array[7]);
     }
     $error_str .= make_table($clan_page_tab);
     while ($clan_ship) {
         if ($user['login_id'] == $clan['leader_id'] && $GAME_VARS['clan_fleet_attacking'] == 1) {
             $clan_ship['ship_id'] = "<input type=checkbox name=do_ship[{$clan_ship['ship_id']}] value={$clan_ship['ship_id']} />";
         } else {
             unset($clan_ship['ship_id']);
         }
         $error_str .= make_row($clan_ship);
         $clan_ship = dbr(1);
     }
     $error_str .= "</table><p />";
     $error_str .= $st[562] . " <input type=text name=join_fleet_id_2 value='' max=3 size=3 />";
     $error_str .= "<input TYPE='hidden' name=fleet_type value=1 />";
     $error_str .= " - <input type='submit' name=join_fleet_button value=" . $cw['change_fleet'] . " />";
     $error_str .= " - <a href=javascript:TickAll(\"fleet_maint\")>" . $cw['invert_ship_selection'] . "</a><p /></form>";
     /*************
      * Summary of Clan ships
      **************/
 } else {
     db("select login_id, count(ship_id) as total, sum(fighters) as fighters from {$db_name}_ships where clan_id = {$user['clan_id']} group by login_id order by fighters desc, ship_name desc");
     $clan_ship = dbr(1);
     $error_str .= "<br /><br /><a href='clan.php?show_clan_ships=1'>" . $cw['show_all_clan_ships'] . "</a><p />";
     while ($clan_ship) {
Example #7
0
 $output_str .= "<a href='{$_SERVER['PHP_SELF']}?planet_id={$planet_id}&dump_all=1'>" . $st[1691] . "<p /><br /><p />";
 $output_str .= $st[1692] . make_table(array($st[1693], $st[1694], $st[1695], popup_help("help.php?topic=Combat&popup=1&sub_topic=Planet,_and_assisted_fleet_combat", 500, 400, $st[1696])));
 $fleet_def_figs = $planet['fighters'] - $defending_fighters;
 $output_str .= make_row(array($planet['fighters'], $defending_fighters, $fleet_def_figs, "<a href='planet.php?planet_id={$planet_id}&allocate_figs=1'>" . $st[1697] . "</a>"));
 $output_str .= "</table>";
 if (avail_check(4002)) {
     //ensure mining drones have been invented
     $output_str .= "<p /><br />" . $cw['system_mining'] . "<br />";
     if ($planet['mining_drones'] > 0) {
         $unalloc = $planet['mining_drones'] - $planet['drones_alloc_metal'] - $planet['drones_alloc_fuel'];
         get_star();
         //get the star's metal and fuel deposits
         $output_str .= make_table(array($cw['resource'], $st[1698], $cw['drones_allocated']));
         $output_str .= make_row(array($cw['metal'], $star['metal'], $planet['drones_alloc_metal']));
         $output_str .= make_row(array($cw['fuel'], $star['fuel'], $planet['drones_alloc_fuel']));
         $output_str .= make_row(array($cw['unallocated_drones'], $unalloc, "<a href='{$_SERVER['PHP_SELF']}?allocate_mining_drones=1&planet_id={$planet_id}'>" . $st[1699] . "</a>"));
         $output_str .= "</table>";
         if ($planet['mining_drones'] < $max_drones) {
             $output_str .= "<a href='{$_SERVER['PHP_SELF']}?more_drones=1&planet_id={$planet_id}'>" . $st[1700] . "</a>";
         }
     } 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 />";
Example #8
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) {
Example #9
0
     $out_str .= "<center><b>" . $st[877] . "</b></center><br />" . sprintf($st[878], $game_info[name]);
     $out_str .= "<br />" . $st[879] . "<br />";
     $out_str .= make_table(array($cw['item'], $st[880]));
     $out_str .= quick_row($cw['fighters'], "{$GAME_VARS['fighter_cost_earth']}");
     $out_str .= quick_row($cw['metal'], "{$GAME_VARS['buy_metal']}");
     $out_str .= quick_row($cw['fuel'], "{$GAME_VARS['buy_fuel']}");
     $out_str .= quick_row($cw['electronics'], "{$GAME_VARS['buy_elect']}");
     $out_str .= "</table>";
     $out_str .= "<p /><br />" . $st[881];
     $out_str .= make_table(array($cw['item'], $cw['materials_required'], $st[882], $st[883], $st[884]));
     $num_e = 60;
     $num_f = 60;
     $total_cos_figs = ($GAME_VARS['buy_elect'] + $GAME_VARS['buy_metal'] * 3 + $GAME_VARS['buy_fuel'] * 2) * 10;
     $out_str .= make_row(array($cw['fighter'], "10 " . $cw['electronics'] . ", 30 " . $cw['metals'] . ", 20 " . $cw['fuels'], "60", $total_cos_figs, $avg_f_cost = $total_cos_figs / $num_f));
     $total_cos_elect = ($GAME_VARS['buy_metal'] * 4 + $GAME_VARS['buy_fuel'] * 3) * 20;
     $out_str .= make_row(array($cw['electronics'], "80 " . $cw['metals'] . ", 60 " . $cw['fuels'], "60", $total_cos_elect, $avg_e_cost = $total_cos_elect / $num_e));
     $out_str .= "</table><p />";
     $out_str .= $st[885] . "<br/><b class='b1'>";
     if ($avg_e_cost > $GAME_VARS['buy_elect']) {
         $out_str .= $st[886];
     } else {
         $out_str .= $st[887];
     }
     $out_str .= "</b><br />" . $cw['and'] . "<br /><b class='b1'>";
     if ($avg_f_cost > $GAME_VARS['fighter_cost_earth']) {
         $out_str .= $st[888];
     } else {
         $out_str .= $st[889];
     }
     $out_str .= "</a>";
 }
Example #10
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);
Example #11
0
function news_search_bar()
{
    global $GAME_VARS, $any_all, $cw, $st;
    //needed to remember the "any_all" radiobox status
    $any_all = array(1 => '', 2 => '');
    if (isset($_POST['any_all']) && $_POST['any_all'] == 2) {
        $any_all[2] = "checked='on'";
    } else {
        $any_all[1] = "checked='on'";
    }
    $text = "";
    //show the search bar at the top of the news page.
    $top_row_search = array("<input type='text' name='term' size='20' value='{$_POST['term']}'/>", "<input type='radio' name='any_all' value='1' {$any_all['1']}> <b>" . $cw['all'] . "</b>", "<input type='checkbox' name = 'admin' {$_POST['admin']}/>" . $cw['admin'], "<input type='checkbox' name = 'attacking' {$_POST['attacking']}/> " . $cw['attacks'], "<input type='checkbox' name = 'bomb'  {$_POST['bomb']}/> " . $cw['bombs'], "<input type='checkbox' name = 'clan'  {$_POST['clan']}/> " . $cw['clans'], "<input type='checkbox' name = 'game_status' {$_POST['game_status']}/> " . $cw['game_status']);
    $middle_row_search = array("<input type='submit' value=Search />", "<input type='radio' name='any_all' value='2' {$any_all['2']}> <b>" . $cw['any'] . "</b>", "<input type='checkbox' name = 'maint'  {$_POST['maint']}/> " . $cw['maints'], "<input type='checkbox' name = 'other' {$_POST['other']}/> " . $cw['other'], "<input type='checkbox' name = 'player_status'  {$_POST['player_status']}/> " . $cw['player_status'], "<input type='checkbox' name = 'planet' {$_POST['planet']}/> " . $cw['planets'], "<input type='checkbox' name = 'random_event' {$_POST['random_event']}/> " . $cw['random_events'], "<input type='checkbox' name = 'ship'  {$_POST['ship']}/> " . $cw['ships']);
    //don't show random_event search if there are no random events in the universe
    if ($GAME_VARS['random_events'] == 0) {
        unset($middle_row_search[6]);
    }
    $text .= $st[920];
    $text .= "<FORM method='POST' action='news.php'>";
    $text .= make_table($top_row_search);
    $text .= make_row($middle_row_search);
    $text .= "</table>";
    //'admin', 'attacking', 'bomb', 'clan', 'game_status', 'maint', 'other', 'player_status', 'planet', 'random_event', 'ship'
    $text .= "</form><p />";
    return $text;
}
Example #12
0
 $friends_alive_perc = calc_perc($friendly_details['ship_count'] - $friends_killed, $friendly_details['ship_count']);
 $targets_alive_perc = calc_perc($target_details['ship_count'] - $targets_killed, $target_details['ship_count']);
 if ($planet_attack == 1 || count($target_planets) > 0) {
     $temp_planets_1 = "Planets<br />Eliminated";
     $temp_planets_2 = $planets_beaten;
     $temp_planets_3 = "-";
 } else {
     $temp_planets_1 = "";
     $temp_planets_2 = "";
     $temp_planets_3 = "";
 }
 //print a basic results table
 $temp_str = "<p />Results<br />";
 $temp_str .= make_table(array("", $st[295], "" . $cw['ships'] . "<br />Lost", $cw['fighters'] . "<br />" . $cw['killed'], $temp_planets_1));
 $temp_str .= make_row(array($cw['attacker'] . "(s)", $friends_alive_perc, $friends_lost_perc, $target_details['fighters_lost'], $temp_planets_2));
 $temp_str .= make_row(array($cw['defender'] . "(s)", $targets_alive_perc, $targets_lost_perc, $friendly_details['fighters_lost'], $temp_planets_3));
 $temp_str .= "</table>";
 $tech_str .= $temp_str;
 $short_str .= $temp_str;
 unset($temp_str, $temp_planets_1, $temp_planets_2, $temp_planets_3);
 if ($planets_beaten > 0 && $planet_attack == 1 && $simulate_attack == 0) {
     //show planet land link
     $tech_str .= $st[296] . "<p /><font size = 4>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href='planet.php?planet_id={$target}'> " . $cw['land_on_the_planet'] . "</a></font><br /><br />";
 }
 //no ships lost by user.
 if ($ships_involved_str[$user['login_id']]['lost'] == "") {
     $ships_involved_str[$user['login_id']]['lost'] = "None";
 }
 //no ships beloning to the user survived
 if ($ships_involved_str[$user['login_id']]['survived'] == "") {
     $ships_involved_str[$user['login_id']]['survived'] = "None";
Example #13
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>";
        }
Example #14
0
        $text .= "<p /><br /><a href='{$filename}?add=1'>" . $cw['add_entry'] . "</a>";
    } else {
        $text .= $st[161];
    }
    $text .= $st[162];
    $text .= make_table(array($cw['date_entered'], $cw['entry']));
    if ($num_ent[0] > 1) {
        $text .= "<FORM method=POST action=diary.php name=quick_del><input type=hidden name=del_select value=1 />";
    }
    db2("select * from {$db_name}_diary where login_id = '{$user['login_id']}' order by timestamp desc");
    while ($entry = dbr2(1)) {
        //list entries
        $entry['entry'] = stripslashes($entry['entry']);
        $entry['entry'] = mcit($entry['entry']);
        $e_num = $entry['entry_id'];
        $entry['entry_id'] = "- <a href='{$filename}?edit={$e_num}'>" . $cw['edit'] . "</a> - <a href='{$filename}?delete={$e_num}'>" . $cw['delete'] . "</a>";
        if ($num_ent[0] > 1) {
            $entry['entry_id'] .= "- <input type=checkbox name=del_ent[{$e_num}] value={$e_num} />";
        }
        $text .= make_row(array("<b>" . date("M d - H:i", $entry['timestamp']) . "</b>", $entry['entry'], $entry['entry_id']));
    }
    $text .= "</table><br />";
}
if ($num_ent[0] > 1) {
    //show the big delete options
    $text .= "<br /><input type='submit' value='" . $cw['delete_selected_entries'] . "' />  - <a href=javascript:TickAll(\"quick_del\")>" . $cw['invert_entry_selection'] . "</a></form><br />";
    $text .= "<br /><a href='{$filename}?delete_all=1'>" . $st[163];
}
$rs = "<p /><a href='location.php'>" . $cw['back_star_system'] . "</a>";
// print page
print_page($st[164], $text);
Example #15
0
         }
         //$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>";
         }
         $row_array2 = array($commander, "<input type=checkbox name=do_ship[{$ships['ship_id']}] value={$ships['ship_id']} />");
         if ($ships['fleet_id'] != null) {
             array_push($row_array, $ships['fleet_id']);
         }
         $row_array = array_merge($row_array, $row_array2);
         $error_str .= make_row($row_array, $bgcolor, $rowspan);
         //var_dump($row_array);
         $ships = dbr2(1);
     }
     $error_str .= '</table><br>';
 }
 # end of looping through all of players' ships.
 #more than 10 ships, put one at the bottom too.
 /*if($count[0] > 10 && $user['show_user_ships'] != 3){
 		$error_str .= "\n<p />".$cw['fleet']." #: <input type=text name=join_fleet_id_2 value='' max=3 size=3 class='inputtext'/>";
 
 		#only show the radio buttons if user is in a clan.
 		if($user['clan_id'] > 0 && $GAME_VARS['clan_fleet_attacking'] == 1){
 			$error_str .= " - ".$cw['your_fleet']."<input TYPE='radio' NAME='fleet_type' value=0 CHECKED />- ".$cw['can_fleet']."<input TYPE='radio' NAME='fleet_type' value=1 />";
 		} else {
 			$error_str .= "<input TYPE='hidden' name=fleet_type value=0 />";
Example #16
0
            $ct1 = $ct2;
        }
    }
    if ($table != 2) {
        $player['cash'] = $ct1;
    }
    if (!isset($player['last_attack_by']) && $table == 2) {
        $player['last_attack_by'] = "~";
    }
    if (isset($player['clan_sym']) && $table == 2) {
        $player['clan_sym'] = "<font color=#{$player['clan_sym_color']}>{$player['clan_sym']}</font>";
        $player['clan_sym_color'] = "";
    } elseif (isset($table) && $table == 2) {
        $player['clan_sym'] = "~";
    }
    if (isset($player['last_attack']) && $player['last_attack'] == 1) {
        $player['last_attack'] = "~";
    } elseif (isset($player['last_attack'])) {
        $player['last_attack'] = date("M d - H:i", $player['last_attack']);
    }
    if (isset($player['joined_game'])) {
        $player['joined_game'] = date("M d - H:i", $player['joined_game']);
    }
    $dis_name = print_name($player);
    $player['login_name'] = $dis_name;
    unset($player['login_id'], $player['clan_sym_color']);
    $text .= make_row($player);
    $ct2++;
}
$text .= "</table><br />";
print_page($cw['player_ranking'], $text);
Example #17
0
        db2("select count(planet_id), sum(fighters), sum(cash), sum(tech), sum(colon), sum(mining_drones), sum(metal), sum(fuel), sum(elect) from {$db_name}_planets where login_id = '{$player_info['login_id']}'");
        $planet_info = dbr2(1);
        db2("select count(ship_id), sum(fighters), sum(shields), sum(armour), sum(cargo_bays), sum(metal), sum(fuel), sum(elect), sum(colon), sum(point_value), count(distinct location) from {$db_name}_ships where login_id = '{$player_info['login_id']}'");
        $ship_info = dbr2(1);
        $out .= "<center><hr width = '200'></center><table cellspacing='1' cellpadding='2' border='0' bgcolor='#111111'><tr><th align='left'>" . print_name($player_info) . "</th></tr><tr><td>";
        unset($player_info['login_id']);
        $player_info['one_brob'] = num_flagships($player_info['one_brob']);
        //player info
        $out .= make_table(array("Account Cash", "Turns", "Turns Run", "Account Tech", "Logins to game", "Genesis", "Flagship Count", "Alphas", "Gammas", "Delta"));
        $out .= make_row($player_info);
        //planet info
        $out .= "</table><br />Planets<br />" . make_table(array("Planet Count", "Planet Fighters", "Planet Cash", "Tech", "Colonists", "Mining Drones", "Metal", "Fuel", "Electronics"));
        $out .= make_row($planet_info);
        //ship info
        $out .= "</table><br />Ships<br />" . make_table(array("Ship<br />Count", "Ship<br />Fighters", "Shields", "Armour", "Cargo<br />Bays", "Metal", "Fuel", "Electronics", "Colonists", "Point<br />Value", "# Systems <br />with ships"));
        $out .= make_row($ship_info);
        $out .= "</table></td></tr></table>";
    }
    print_page("Player Info", $out);
    //change intro message
} elseif (isset($_REQUEST['messag'])) {
    if ($_REQUEST['messag'] == 1) {
        db("select intro_message from se_games where db_name = '{$db_name}'");
        $present_mess = dbr(1);
        $present_mess = stripslashes($present_mess[intro_message]);
        $out .= "Please enter a message that all new players will recieve when they join. <p />Notes: HTML is enabled. Message codes are not used.";
        $out .= "<form action='{$_SERVER['PHP_SELF']}' method='POST'>";
        $out .= "<input type='hidden' name='messag' value='2' />";
        $out .= "<textarea name='new_mess' cols='50' rows='20' wrap='soft'>{$present_mess}</textarea>";
        $out .= "<p /><input type='submit' value='Change' /></form>";
    } else {
Example #18
0
        $text .= "</table>";
    }
}
if ($show_won) {
    #Show items user has won.
    db2("select item_name,item_type,item_id from {$db_name}_bilkos where active=0 && bidder_id='{$user['login_id']}'");
    $collect = dbr2(1);
    if ($collect) {
        $text .= "<p />";
        $text .= $st[360];
        $text .= make_table(array("Item Name", "Item Type"));
        while ($collect) {
            if ($collect[item_type] == 1) {
                $collect[item_type] = $cw['ship'];
            } elseif ($collect[item_type] == 2) {
                $collect[item_type] = $cw['equipment'];
            } elseif ($collect[item_type] == 3) {
                $collect[item_type] = $cw['upgrade'];
            } elseif ($collect[item_type] == 4) {
                $collect[item_type] = $cw['misc'];
            } elseif ($collect[item_type] == 5) {
                $collect[item_type] = $cw['planetary'];
            }
            $collect[item_id] = " - <a href='bilkos.php?show_won=1&collect={$collect['item_id']}'>Collect</a>";
            $text .= make_row($collect);
            $collect = dbr2(1);
        }
        $text .= "</table>";
    }
}
print_page($st[361], $text);