Example #1
0
function ShowBuildingInfoPage($CurrentUser, $CurrentPlanet, $BuildID)
{
    global $dpath, $lang, $resource, $pricelist, $CombatCaps;
    includeLang('infos');
    $GateTPL = '';
    $DestroyTPL = '';
    $TableHeadTPL = '';
    $parse = $lang;
    // Données de base
    $parse['dpath'] = $dpath;
    $parse['name'] = $lang['info'][$BuildID]['name'];
    $parse['image'] = $BuildID;
    $parse['description'] = $lang['info'][$BuildID]['description'];
    if ($BuildID >= 1 && $BuildID <= 3) {
        // Cas des mines
        $PageTPL = gettemplate('info_buildings_table');
        $DestroyTPL = gettemplate('info_buildings_destroy');
        $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_p_hour}</td><td class=\"c\">{nfo_difference}</td><td class=\"c\">{nfo_used_energy}</td><td class=\"c\">{nfo_difference}</td></tr>";
        $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th><th>{build_need}</th><th>{build_need_diff}</th></tr>";
    } elseif ($BuildID == 4) {
        // Centrale Solaire
        $PageTPL = gettemplate('info_buildings_table');
        $DestroyTPL = gettemplate('info_buildings_destroy');
        $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_energy}</td><td class=\"c\">{nfo_difference}</td></tr>";
        $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th></tr>";
    } elseif ($BuildID == 12) {
        // Centrale Fusion
        $PageTPL = gettemplate('info_buildings_table');
        $DestroyTPL = gettemplate('info_buildings_destroy');
        $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_energy}</td><td class=\"c\">{nfo_difference}</td><td class=\"c\">{nfo_used_deuter}</td><td class=\"c\">{nfo_difference}</td></tr>";
        $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th><th>{build_need}</th><th>{build_need_diff}</th></tr>";
    } elseif ($BuildID >= 14 && $BuildID <= 32) {
        // Batiments Generaux
        $PageTPL = gettemplate('info_buildings_general');
        $DestroyTPL = gettemplate('info_buildings_destroy');
    } elseif ($BuildID == 33) {
        // Batiments Terraformer
        $PageTPL = gettemplate('info_buildings_general');
    } elseif ($BuildID == 34) {
        // Dépot d'alliance
        $PageTPL = gettemplate('info_buildings_general');
        $DestroyTPL = gettemplate('info_buildings_destroy');
    } elseif ($BuildID == 44) {
        // Silo de missiles
        $PageTPL = gettemplate('info_buildings_general');
        $DestroyTPL = gettemplate('info_buildings_destroy');
    } elseif ($BuildID == 41) {
        // Batiments lunaires
        $PageTPL = gettemplate('info_buildings_general');
    } elseif ($BuildID == 42) {
        // Phalange
        $PageTPL = gettemplate('info_buildings_table');
        $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_range}</td></tr>";
        $TableTPL = "<tr><th>{build_lvl}</th><th>{build_range}</th></tr>";
        $DestroyTPL = gettemplate('info_buildings_destroy');
    } elseif ($BuildID == 43) {
        // Porte de Saut
        $PageTPL = gettemplate('info_buildings_general');
        $GateTPL = gettemplate('gate_fleet_table');
        $DestroyTPL = gettemplate('info_buildings_destroy');
    } elseif ($BuildID >= 106 && $BuildID <= 199) {
        // Laboratoire
        $PageTPL = gettemplate('info_buildings_general');
    } elseif ($BuildID >= 202 && $BuildID <= 215) {
        // Flotte
        $PageTPL = gettemplate('info_buildings_fleet');
        $parse['element_typ'] = $lang['tech'][200];
        $parse['rf_info_to'] = ShowRapidFireTo($BuildID);
        // Rapid Fire vers
        $parse['rf_info_fr'] = ShowRapidFireFrom($BuildID);
        // Rapid Fire de
        $parse['hull_pt'] = pretty_number($pricelist[$BuildID]['metal'] + $pricelist[$BuildID]['crystal']);
        // Points de Structure
        $parse['shield_pt'] = pretty_number($CombatCaps[$BuildID]['shield']);
        // Points de Bouclier
        $parse['attack_pt'] = pretty_number($CombatCaps[$BuildID]['attack']);
        // Points d'Attaque
        $parse['capacity_pt'] = pretty_number($pricelist[$BuildID]['capacity']);
        // Capacitée de fret
        $parse['base_speed'] = pretty_number($pricelist[$BuildID]['speed']);
        // Vitesse de base
        $parse['base_conso'] = pretty_number($pricelist[$BuildID]['consumption']);
        // Consommation de base
        if ($BuildID == 202) {
            $parse['upd_speed'] = "<font color=\"yellow\">(" . pretty_number($pricelist[$BuildID]['speed2']) . ")</font>";
            // Vitesse rééquipée
            $parse['upd_conso'] = "<font color=\"yellow\">(" . pretty_number($pricelist[$BuildID]['consumption2']) . ")</font>";
            // Consommation apres rééquipement
        } elseif ($BuildID == 211) {
            $parse['upd_speed'] = "<font color=\"yellow\">(" . pretty_number($pricelist[$BuildID]['speed2']) . ")</font>";
            // Vitesse rééquipée
        }
    } elseif ($BuildID >= 401 && $BuildID <= 408) {
        // Defenses
        $PageTPL = gettemplate('info_buildings_defense');
        $parse['element_typ'] = $lang['tech'][400];
        $parse['rf_info_to'] = ShowRapidFireTo($BuildID);
        // Rapid Fire vers
        $parse['rf_info_fr'] = ShowRapidFireFrom($BuildID);
        // Rapid Fire de
        $parse['hull_pt'] = pretty_number($pricelist[$BuildID]['metal'] + $pricelist[$BuildID]['crystal']);
        // Points de Structure
        $parse['shield_pt'] = pretty_number($CombatCaps[$BuildID]['shield']);
        // Points de Bouclier
        $parse['attack_pt'] = pretty_number($CombatCaps[$BuildID]['attack']);
        // Points d'Attaque
    } elseif ($BuildID >= 502 && $BuildID <= 503) {
        // Misilles
        $PageTPL = gettemplate('info_buildings_defense');
        $parse['element_typ'] = $lang['tech'][400];
        $parse['hull_pt'] = pretty_number($pricelist[$BuildID]['metal'] + $pricelist[$BuildID]['crystal']);
        // Points de Structure
        $parse['shield_pt'] = pretty_number($CombatCaps[$BuildID]['shield']);
        // Points de Bouclier
        $parse['attack_pt'] = pretty_number($CombatCaps[$BuildID]['attack']);
        // Points d'Attaque
    } elseif ($BuildID >= 601 && $BuildID <= 615) {
        // Officiers
        $PageTPL = gettemplate('info_officiers_general');
    }
    // ---- Tableau d'evolution
    if ($TableHeadTPL != '') {
        $parse['table_head'] = parsetemplate($TableHeadTPL, $lang);
        $parse['table_data'] = ShowProductionTable($CurrentUser, $CurrentPlanet, $BuildID, $TableTPL);
    }
    // La page principale
    $page = parsetemplate($PageTPL, $parse);
    if ($GateTPL != '') {
        if ($CurrentPlanet[$resource[$BuildID]] > 0) {
            $RestString = GetNextJumpWaitTime($CurrentPlanet);
            $parse['gate_start_link'] = BuildPlanetAdressLink($CurrentPlanet);
            if ($RestString['value'] != 0) {
                $parse['gate_time_script'] = InsertJavaScriptChronoApplet("Gate", "1", $RestString['value'], true);
                $parse['gate_wait_time'] = "<div id=\"bxx" . "Gate" . "1" . "\"></div>";
                $parse['gate_script_go'] = InsertJavaScriptChronoApplet("Gate", "1", $RestString['value'], false);
            } else {
                $parse['gate_time_script'] = "";
                $parse['gate_wait_time'] = "";
                $parse['gate_script_go'] = "";
            }
            $parse['gate_dest_moons'] = BuildJumpableMoonCombo($CurrentUser, $CurrentPlanet);
            $parse['gate_fleet_rows'] = BuildFleetListRows($CurrentPlanet);
            $page .= parsetemplate($GateTPL, $parse);
        }
    }
    if ($DestroyTPL != '') {
        if ($CurrentPlanet[$resource[$BuildID]] > 0) {
            // ---- Destruction
            $NeededRessources = GetBuildingPrice($CurrentUser, $CurrentPlanet, $BuildID, true, true);
            $DestroyTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $BuildID) / 2;
            $parse['destroyurl'] = "buildings.php?cmd=destroy&building=" . $BuildID;
            // Non balisé les balises sont dans le tpl
            $parse['levelvalue'] = $CurrentPlanet[$resource[$BuildID]];
            // Niveau du batiment a detruire
            $parse['nfo_metal'] = $lang['Metal'];
            $parse['nfo_crysta'] = $lang['Crystal'];
            $parse['nfo_deuter'] = $lang['Deuterium'];
            $parse['metal'] = pretty_number($NeededRessources['metal']);
            // Cout en metal de la destruction
            $parse['crystal'] = pretty_number($NeededRessources['crystal']);
            // Cout en cristal de la destruction
            $parse['deuterium'] = pretty_number($NeededRessources['deuterium']);
            // Cout en deuterium de la destruction
            $parse['destroytime'] = pretty_time($DestroyTime);
            // Durée de la destruction
            // L'insert de destruction
            $page .= parsetemplate($DestroyTPL, $parse);
        }
    }
    return $page;
}
Example #2
0
function ShowBuildingInfoPage($CurrentUser, $CurrentPlanet, $BuildID)
{
    global $dpath, $lang, $sn_data;
    $sn_groups =& $sn_data['groups'];
    $unit_data =& $sn_data[$BuildID];
    lng_include('infos');
    $GateTPL = '';
    $DestroyTPL = '';
    $TableHeadTPL = '';
    $parse = $lang;
    // Données de base
    $parse['dpath'] = $dpath;
    $parse['name'] = $lang['tech'][$BuildID];
    $parse['image'] = $BuildID;
    $parse['description'] = $lang['info'][$BuildID]['description'];
    if ($BuildID >= 1 && $BuildID <= 3) {
        // Cas des mines
        $PageTPL = gettemplate('info_buildings_table');
        $DestroyTPL = gettemplate('info_buildings_destroy');
        $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_p_hour}</td><td class=\"c\">{nfo_difference}</td><td class=\"c\">{nfo_used_energy}</td><td class=\"c\">{nfo_difference}</td></tr>";
        $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th><th>{build_need}</th><th>{build_need_diff}</th></tr>";
    } elseif ($BuildID == 4) {
        // Centrale Solaire
        $PageTPL = gettemplate('info_buildings_table');
        $DestroyTPL = gettemplate('info_buildings_destroy');
        $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_energy}</td><td class=\"c\">{nfo_difference}</td></tr>";
        $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th></tr>";
    } elseif ($BuildID == 12) {
        // Centrale Fusion
        $PageTPL = gettemplate('info_buildings_table');
        $DestroyTPL = gettemplate('info_buildings_destroy');
        $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_energy}</td><td class=\"c\">{nfo_difference}</td><td class=\"c\">{nfo_used_deuter}</td><td class=\"c\">{nfo_difference}</td></tr>";
        $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th><th>{build_need}</th><th>{build_need_diff}</th></tr>";
    } elseif ($BuildID >= 14 && $BuildID <= 32) {
        // Batiments Generaux
        $PageTPL = gettemplate('info_buildings_general');
        $DestroyTPL = gettemplate('info_buildings_destroy');
    } elseif ($BuildID == 33) {
        // Batiments Terraformer
        $PageTPL = gettemplate('info_buildings_general');
    } elseif ($BuildID == 34) {
        // Dépot d'alliance
        $PageTPL = gettemplate('info_buildings_general');
        $DestroyTPL = gettemplate('info_buildings_destroy');
    } elseif ($BuildID == 35) {
        // nano
        $PageTPL = gettemplate('info_buildings_general');
        $DestroyTPL = gettemplate('info_buildings_destroy');
    } elseif ($BuildID == 44) {
        // Silo de missiles
        $PageTPL = gettemplate('info_buildings_general');
        $DestroyTPL = gettemplate('info_buildings_destroy');
    } elseif ($BuildID == 41) {
        // Batiments lunaires
        $PageTPL = gettemplate('info_buildings_general');
    } elseif ($BuildID == 42) {
        // Phalange
        $PageTPL = gettemplate('info_buildings_table');
        $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_range}</td></tr>";
        $TableTPL = "<tr><th>{build_lvl}</th><th>{build_range}</th></tr>";
        $DestroyTPL = gettemplate('info_buildings_destroy');
    } elseif ($BuildID == 43) {
        // Porte de Saut
        $PageTPL = gettemplate('info_buildings_general');
        $GateTPL = gettemplate('gate_fleet_table');
        $DestroyTPL = gettemplate('info_buildings_destroy');
    } elseif (in_array($BuildID, $sn_data['groups']['tech'])) {
        // Laboratoire
        $PageTPL = gettemplate('info_buildings_general');
    } elseif (in_array($BuildID, $sn_data['groups']['fleet'])) {
        // Flotte
        $PageTPL = gettemplate('info_buildings_fleet');
        $parse['element_typ'] = $lang['tech'][SHIP_FLEET];
        $rapid_fire = eco_render_rapid_fire($BuildID);
        $parse['rf_info_to'] = $rapid_fire['to'];
        // Rapid Fire vers
        $parse['rf_info_fr'] = $rapid_fire['from'];
        // Rapid Fire de
        $parse['hull_pt'] = pretty_number(($sn_data[$BuildID]['metal'] + $sn_data[$BuildID]['crystal']) / 10);
        // Points de Structure
        $parse['shield_pt'] = pretty_number($sn_data[$BuildID]['shield']);
        // Points de Bouclier
        $parse['attack_pt'] = pretty_number($sn_data[$BuildID]['attack']);
        // Points d'Attaque
        $parse['capacity_pt'] = pretty_number($sn_data[$BuildID]['capacity']);
        // Capacitée de fret
        $parse['base_speed'] = pretty_number($sn_data[$BuildID]['speed']);
        // Vitesse de base
        $parse['base_conso'] = pretty_number($sn_data[$BuildID]['consumption']);
        // Consommation de base
        if ($BuildID == SHIP_CARGO_SMALL) {
            $parse['upd_speed'] = "<font color=\"yellow\">(" . pretty_number($sn_data[$BuildID]['speed2']) . ")</font>";
            // Vitesse rééquipée
            $parse['upd_conso'] = "<font color=\"yellow\">(" . pretty_number($sn_data[$BuildID]['consumption2']) . ")</font>";
            // Consommation apres rééquipement
        } elseif ($BuildID == SHIP_BOMBER) {
            $parse['upd_speed'] = "<font color=\"yellow\">(" . pretty_number($sn_data[$BuildID]['speed2']) . ")</font>";
            // Vitesse rééquipée
        }
    } elseif (in_array($BuildID, $sn_data['groups']['defense_active'])) {
        // Defenses
        $PageTPL = gettemplate('info_buildings_defense');
        $parse['element_typ'] = $lang['tech'][400];
        $rapid_fire = eco_render_rapid_fire($BuildID);
        $parse['rf_info_to'] = $rapid_fire['to'];
        // Rapid Fire vers
        $parse['rf_info_fr'] = $rapid_fire['from'];
        // Rapid Fire de
        $parse['hull_pt'] = pretty_number(($sn_data[$BuildID]['metal'] + $sn_data[$BuildID]['crystal']) / 10);
        // Points de Structure
        $parse['shield_pt'] = pretty_number($sn_data[$BuildID]['shield']);
        // Points de Bouclier
        $parse['attack_pt'] = pretty_number($sn_data[$BuildID]['attack']);
        // Points d'Attaque
    } elseif ($BuildID >= 502 && $BuildID <= 503) {
        // Misilles
        $PageTPL = gettemplate('info_buildings_defense');
        $parse['element_typ'] = $lang['tech'][400];
        $parse['hull_pt'] = pretty_number($sn_data[$BuildID]['metal'] + $sn_data[$BuildID]['crystal']);
        // Points de Structure
        $parse['shield_pt'] = pretty_number($sn_data[$BuildID]['shield']);
        // Points de Bouclier
        $parse['attack_pt'] = pretty_number($sn_data[$BuildID]['attack']);
        // Points d'Attaque
    } elseif (in_array($BuildID, $sn_data['groups']['mercenaries'])) {
        // Officiers
        $PageTPL = gettemplate('info_officiers_general');
        $mercenary = $sn_data[$BuildID];
        $mercenary_bonus = $mercenary['bonus'];
        $mercenary_bonus = $mercenary_bonus >= 0 ? "+{$mercenary_bonus}" : "{$mercenary_bonus}";
        switch ($mercenary['bonus_type']) {
            case BONUS_PERCENT:
                $mercenary_bonus = "{$mercenary_bonus}%";
                break;
            case BONUS_ADD:
                break;
            case BONUS_ABILITY:
                $mercenary_bonus = '';
                break;
            default:
                break;
        }
        $parse['EFFECT'] = $lang['info'][$BuildID]['effect'];
        $parse['mercenary_bonus'] = $mercenary_bonus;
        $parse['max_level'] = $mercenary['max'];
    }
    // ---- Tableau d'evolution
    if ($TableHeadTPL != '') {
        $parse['table_head'] = parsetemplate($TableHeadTPL, $lang);
        $parse['table_data'] = ShowProductionTable($CurrentUser, $CurrentPlanet, $BuildID, $TableTPL);
    }
    // La page principale
    $page = parsetemplate($PageTPL, $parse);
    if ($GateTPL != '') {
        if ($CurrentPlanet[$unit_data['name']] > 0) {
            $RestString = GetNextJumpWaitTime($CurrentPlanet);
            $parse['gate_start_link'] = uni_render_coordinates_href($CurrentPlanet, '', 3);
            if ($RestString['value'] != 0) {
                $parse['gate_time_script'] = InsertJavaScriptChronoApplet("Gate", "1", $RestString['value'], true);
                $parse['gate_wait_time'] = "<div id=\"bxx" . "Gate" . "1" . "\"></div>";
                $parse['gate_script_go'] = InsertJavaScriptChronoApplet("Gate", "1", $RestString['value'], false);
            } else {
                $parse['gate_time_script'] = "";
                $parse['gate_wait_time'] = "";
                $parse['gate_script_go'] = "";
            }
            $parse['gate_dest_moons'] = BuildJumpableMoonCombo($CurrentUser, $CurrentPlanet);
            $parse['gate_fleet_rows'] = BuildFleetListRows($CurrentPlanet);
            $page .= parsetemplate($GateTPL, $parse);
        }
    }
    if ($DestroyTPL != '') {
        if ($CurrentPlanet[$unit_data['name']] > 0) {
            // ---- Destruction
            $NeededRessources = GetBuildingPrice($CurrentUser, $CurrentPlanet, $BuildID, true, true);
            $DestroyTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $BuildID) / 2;
            $parse['destroyurl'] = "buildings.php?mode=" . QUE_STRUCTURES . "&action=destroy&unit_id={$BuildID}";
            // Non balisé les balises sont dans le
            $parse['levelvalue'] = $CurrentPlanet[$unit_data['name']];
            // Niveau du batiment a detruire
            $parse['nfo_metal'] = $lang['Metal'];
            $parse['nfo_crysta'] = $lang['Crystal'];
            $parse['nfo_deuter'] = $lang['Deuterium'];
            $parse['metal'] = pretty_number($NeededRessources['metal']);
            // Cout en metal de la destruction
            $parse['crystal'] = pretty_number($NeededRessources['crystal']);
            // Cout en cristal de la destruction
            $parse['deuterium'] = pretty_number($NeededRessources['deuterium']);
            // Cout en deuterium de la destruction
            $parse['destroytime'] = pretty_time($DestroyTime);
            // Durée de la destruction
            // L'insert de destruction
            $page .= parsetemplate($DestroyTPL, $parse);
        }
    }
    return $page;
}
Example #3
0
    switch ($mercenary['bonus_type']) {
        case BONUS_PERCENT:
            $mercenary_bonus = "{$mercenary_bonus}%";
            break;
        case BONUS_ADD:
            break;
        case BONUS_ABILITY:
            $mercenary_bonus = '';
            break;
        default:
            break;
    }
    $parse['EFFECT'] = $lang['info'][$unit_id]['effect'];
    $parse['mercenary_bonus'] = $mercenary_bonus;
    if (!in_array($unit_id, sn_get_groups(array('artifacts', 'resources_all')))) {
        $parse['max_level'] = $lang['sys_level'] . ' ' . (in_array($unit_id, sn_get_groups('mercenaries')) ? mrc_get_level($user, $planetrow, $unit_id) : ($mercenary['location'] == LOC_USER ? mrc_get_level($user, null, $unit_id) : ($planetrow['PLANET_GOVERNOR_ID'] == $unit_id ? $planetrow['PLANET_GOVERNOR_LEVEL'] : 0))) . (isset($mercenary['max']) ? "/{$mercenary['max']}" : '');
    }
}
// ---- Tableau d'evolution
if ($TableHeadTPL != '') {
    $parse['table_head'] = parsetemplate($TableHeadTPL, $lang);
    $parse['table_data'] = ShowProductionTable($user, $planetrow, $unit_id, $TableTPL);
}
// La page principale
$page = parsetemplate($PageTPL, $parse);
display($page, $lang['nfo_page_title']);
// -----------------------------------------------------------------------------------------------------------
// History version
// 2.0 - Using sn_timer instead of script generated by InsertScriptChronoApplet
// 1.1 - Ajout JumpGate pour la porte de saut comme la présente OGame ... Enfin un peu mieux quand meme !
// 1.0 - Réécriture (réinventation de l'eau tiède)
Example #4
0
function ShowBuildingInfoPage($CurrentUser, $CurrentPlanet, $BuildID)
{
    global $dpath, $lang, $resource, $pricelist, $CombatCaps;
    includeLang('infos');
    $GateTPL = '';
    $DestroyTPL = '';
    $TableHeadTPL = '';
    $parse = $lang;
    $parse['dpath'] = $dpath;
    $parse['name'] = $lang['info'][$BuildID]['name'];
    $parse['image'] = $BuildID;
    $parse['description'] = $lang['info'][$BuildID]['description'];
    if ($BuildID >= 1 && $BuildID <= 3) {
        $PageTPL = gettemplate('info_buildings_table');
        $DestroyTPL = gettemplate('info_buildings_table');
        $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_p_hour}</td><td class=\"c\">{nfo_difference}</td><td class=\"c\">{nfo_used_energy}</td><td class=\"c\">{nfo_difference}</td></tr>";
        $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th><th>{build_need}</th><th>{build_need_diff}</th></tr>";
    } elseif ($BuildID == 4) {
        $PageTPL = gettemplate('info_buildings_table');
        $DestroyTPL = gettemplate('info_buildings_table');
        $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_energy}</td><td class=\"c\">{nfo_difference}</td></tr>";
        $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th></tr>";
    } elseif ($BuildID == 12) {
        $PageTPL = gettemplate('info_buildings_table');
        $DestroyTPL = gettemplate('info_buildings_table');
        $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_energy}</td><td class=\"c\">{nfo_difference}</td><td class=\"c\">{nfo_used_deuter}</td><td class=\"c\">{nfo_difference}</td></tr>";
        $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th><th>{build_need}</th><th>{build_need_diff}</th></tr>";
    } elseif ($BuildID >= 14 && $BuildID <= 32) {
        $PageTPL = gettemplate('info_buildings_general');
        $DestroyTPL = gettemplate('info_buildings_table');
    } elseif ($BuildID == 33) {
        $PageTPL = gettemplate('info_buildings_general');
    } elseif ($BuildID == 34) {
        $PageTPL = gettemplate('info_buildings_general');
        $DestroyTPL = gettemplate('info_buildings_table');
    } elseif ($BuildID == 44) {
        $PageTPL = gettemplate('info_buildings_general');
        $DestroyTPL = gettemplate('info_buildings_table');
    } elseif ($BuildID == 41) {
        $PageTPL = gettemplate('info_buildings_general');
    } elseif ($BuildID == 42) {
        $PageTPL = gettemplate('info_buildings_table');
        $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_range}</td></tr>";
        $TableTPL = "<tr><th>{build_lvl}</th><th>{build_range}</th></tr>";
        $DestroyTPL = gettemplate('info_buildings_table');
    } elseif ($BuildID == 43) {
        $PageTPL = gettemplate('info_buildings_general');
        $GateTPL = gettemplate('gate_fleet_table');
        $DestroyTPL = gettemplate('info_buildings_table');
    } elseif ($BuildID >= 106 && $BuildID <= 199) {
        $PageTPL = gettemplate('info_buildings_general');
    } elseif ($BuildID >= 202 && $BuildID <= 217) {
        $PageTPL = gettemplate('info_buildings_fleet');
        $parse['element_typ'] = $lang['tech'][200];
        $parse['rf_info_to'] = ShowRapidFireTo($BuildID);
        $parse['rf_info_fr'] = ShowRapidFireFrom($BuildID);
        $parse['hull_pt'] = pretty_number($pricelist[$BuildID]['metal'] + $pricelist[$BuildID]['crystal']);
        $parse['shield_pt'] = pretty_number($CombatCaps[$BuildID]['shield']);
        $parse['attack_pt'] = pretty_number($CombatCaps[$BuildID]['attack']);
        $parse['capacity_pt'] = pretty_number($pricelist[$BuildID]['capacity']);
        $parse['base_speed'] = pretty_number($pricelist[$BuildID]['speed']);
        $parse['base_conso'] = pretty_number($pricelist[$BuildID]['consumption']);
        if ($BuildID == 202) {
            $parse['upd_speed'] = "<font color=\"yellow\">(" . pretty_number($pricelist[$BuildID]['speed2']) . ")</font>";
            $parse['upd_conso'] = "<font color=\"yellow\">(" . pretty_number($pricelist[$BuildID]['consumption2']) . ")</font>";
        } elseif ($BuildID == 211) {
            $parse['upd_speed'] = "<font color=\"yellow\">(" . pretty_number($pricelist[$BuildID]['speed2']) . ")</font>";
        }
    } elseif ($BuildID >= 401 && $BuildID <= 409) {
        // Defenses
        $PageTPL = gettemplate('info_buildings_defense');
        $parse['element_typ'] = $lang['tech'][400];
        $parse['rf_info_to'] = ShowRapidFireTo($BuildID);
        $parse['rf_info_fr'] = ShowRapidFireFrom($BuildID);
        $parse['hull_pt'] = pretty_number($pricelist[$BuildID]['metal'] + $pricelist[$BuildID]['crystal']);
        // Points for the Structure
        $parse['shield_pt'] = pretty_number($CombatCaps[$BuildID]['shield']);
        $parse['attack_pt'] = pretty_number($CombatCaps[$BuildID]['attack']);
    } elseif ($BuildID >= 502 && $BuildID <= 503) {
        // Misilles
        $PageTPL = gettemplate('info_buildings_defense');
        $parse['element_typ'] = $lang['tech'][400];
        $parse['hull_pt'] = pretty_number($pricelist[$BuildID]['metal'] + $pricelist[$BuildID]['crystal']);
        $parse['shield_pt'] = pretty_number($CombatCaps[$BuildID]['shield']);
        $parse['attack_pt'] = pretty_number($CombatCaps[$BuildID]['attack']);
    } elseif ($BuildID >= 601 && $BuildID <= 615) {
        // Officers
        $PageTPL = gettemplate('info_officiers_general');
    }
    if ($TableHeadTPL != '') {
        $parse['table_head'] = parsetemplate($TableHeadTPL, $lang);
        $parse['table_data'] = ShowProductionTable($CurrentUser, $CurrentPlanet, $BuildID, $TableTPL);
    }
    $page = parsetemplate($PageTPL, $parse);
    if ($GateTPL != '') {
        if ($CurrentPlanet[$resource[$BuildID]] > 0) {
            $RestString = GetNextJumpWaitTime($CurrentPlanet);
            $parse['gate_start_link'] = BuildPlanetAdressLink($CurrentPlanet);
            if ($RestString['value'] != 0) {
                $parse['gate_time_script'] = InsertJavaScriptChronoApplet("Gate", "1", $RestString['value'], true);
                $parse['gate_wait_time'] = "<div id=\"bxx" . "Gate" . "1" . "\"></div>";
                $parse['gate_script_go'] = InsertJavaScriptChronoApplet("Gate", "1", $RestString['value'], false);
            } else {
                $parse['gate_time_script'] = "";
                $parse['gate_wait_time'] = "";
                $parse['gate_script_go'] = "";
            }
            $parse['gate_dest_moons'] = BuildJumpableMoonCombo($CurrentUser, $CurrentPlanet);
            $parse['gate_fleet_rows'] = BuildFleetListRows($CurrentPlanet);
            $page .= parsetemplate($GateTPL, $parse);
        }
    }
    if ($DestroyTPL != '') {
        if ($CurrentPlanet[$resource[$BuildID]] > 0) {
            // ---- Destruction
            $NeededRessources = GetBuildingPrice($CurrentUser, $CurrentPlanet, $BuildID, true, true);
            $DestroyTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $BuildID) / 2;
            $parse['destroyurl'] = "buildings.php?cmd=destroy&building=" . $BuildID;
            $parse['levelvalue'] = $CurrentPlanet[$resource[$BuildID]];
            //
            $parse['nfo_metal'] = $lang['Metal'];
            $parse['nfo_crysta'] = $lang['Crystal'];
            $parse['nfo_deuter'] = $lang['Deuterium'];
            $parse['metal'] = pretty_number($NeededRessources['metal']);
            $parse['crystal'] = pretty_number($NeededRessources['crystal']);
            $parse['deuterium'] = pretty_number($NeededRessources['deuterium']);
            $parse['destroytime'] = pretty_time($DestroyTime);
            $page .= parsetemplate($DestroyTPL, $parse);
        }
    }
    return $page;
}