当前位置: 首页>>代码示例>>PHP>>正文


PHP CalculateMaxPlanetFields函数代码示例

本文整理汇总了PHP中CalculateMaxPlanetFields函数的典型用法代码示例。如果您正苦于以下问题:PHP CalculateMaxPlanetFields函数的具体用法?PHP CalculateMaxPlanetFields怎么用?PHP CalculateMaxPlanetFields使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了CalculateMaxPlanetFields函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: show

 function show()
 {
     global $LNG, $USER, $PLANET, $resource, $reslist;
     if ($USER['planet_sort'] == 0) {
         $Order = "id ";
     } elseif ($USER['planet_sort'] == 1) {
         $Order = "galaxy, system, planet, planet_type ";
     } elseif ($USER['planet_sort'] == 2) {
         $Order = "name ";
     }
     $Order .= $USER['planet_sort_order'] == 1 ? "DESC" : "ASC";
     $PlanetsRAW = $GLOBALS['DATABASE']->query("SELECT * FROM " . PLANETS . " WHERE id_owner = '" . $USER['id'] . "' AND destruyed = '0' AND planet_type != '4' ORDER BY " . $Order . ";");
     $elementALL = array(212, 202, 203, 204, 205, 229, 209, 206, 207, 217, 215, 213, 211, 219, 225, 226, 214, 216, 230, 227, 228, 222, 218, 221, 208, 210, 220, 223);
     $elementALLBis = array(401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 416, 417, 418, 419, 420, 421, 422, 502, 503);
     $elementAllTris = array(1, 2, 3, 4, 5, 6, 12, 14, 15, 21, 22, 23, 24, 31, 33, 34, 41, 42, 43, 44, 48);
     foreach ($elementAllTris as $Element) {
         $elementListallTris[$Element] = array('id' => $Element);
     }
     foreach ($elementALL as $Element) {
         $elementListall[$Element] = array('id' => $Element);
     }
     foreach ($elementALLBis as $Element) {
         $elementListallBis[$Element] = array('id' => $Element);
     }
     $planetList = array();
     $PlanetRess = new ResourceUpdate();
     while ($PLANETA = $GLOBALS['DATABASE']->fetch_array($PlanetsRAW)) {
         list($USER, $PLANETA) = $PlanetRess->CalcResource($USER, $PLANETA, true);
         $planetList[] = array('id' => $PLANETA['id'], 'name' => $PLANETA['name'], 'image' => $PLANETA['image'], 'galaxy' => $PLANETA['galaxy'], 'system' => $PLANETA['system'], 'planet' => $PLANETA['planet'], 'type' => $PLANETA['planet_type'], 'metal_percent' => round($PLANETA['metal'] * 100 / $PLANETA['metal_max']), 'cystal_percent' => round($PLANETA['crystal'] * 100 / $PLANETA['crystal_max']), 'deut_percent' => round($PLANETA['deuterium'] * 100 / $PLANETA['deuterium_max']), 'metal_mine' => $PLANETA['metal_mine'], 'crystal_mine' => $PLANETA['crystal_mine'], 'deuterium_sintetizer' => $PLANETA['deuterium_sintetizer'], 'solar_plant' => $PLANETA['solar_plant'], 'searcher' => $PLANETA['searcher'], 'fusion_plant' => $PLANETA['fusion_plant'], 'robot_factory' => $PLANETA['robot_factory'], 'nano_factory' => $PLANETA['nano_factory'], 'hangar' => $PLANETA['hangar'], 'metal_store' => $PLANETA['metal_store'], 'crystal_store' => $PLANETA['crystal_store'], 'deuterium_store' => $PLANETA['deuterium_store'], 'laboratory' => $PLANETA['laboratory'], 'terraformer' => $PLANETA['terraformer'], 'university' => $PLANETA['university'], 'ally_deposit' => $PLANETA['ally_deposit'], 'silo' => $PLANETA['silo'], 'mondbasis' => $PLANETA['mondbasis'], 'phalanx' => $PLANETA['phalanx'], 'sprungtor' => $PLANETA['sprungtor'], 'collider' => $PLANETA['collider'], 'solar_satelit' => pretty_number($PLANETA['solar_satelit']), 'small_ship_cargo' => pretty_number($PLANETA['small_ship_cargo']), 'big_ship_cargo' => pretty_number($PLANETA['big_ship_cargo']), 'light_hunter' => pretty_number($PLANETA['light_hunter']), 'heavy_hunter' => pretty_number($PLANETA['heavy_hunter']), 'M7' => pretty_number($PLANETA['M7']), 'recycler' => pretty_number($PLANETA['recycler']), 'crusher' => pretty_number($PLANETA['crusher']), 'battle_ship' => pretty_number($PLANETA['battle_ship']), 'ev_transporter' => pretty_number($PLANETA['ev_transporter']), 'battleship' => pretty_number($PLANETA['battleship']), 'destructor' => pretty_number($PLANETA['destructor']), 'bomber_ship' => pretty_number($PLANETA['bomber_ship']), 'М19' => pretty_number($PLANETA['М19']), 'giga_recykler' => pretty_number($PLANETA['giga_recykler']), 'galleon' => pretty_number($PLANETA['galleon']), 'destroyer' => pretty_number($PLANETA['destroyer']), 'dearth_star' => pretty_number($PLANETA['dearth_star']), 'lune_noir' => pretty_number($PLANETA['lune_noir']), 'M32' => pretty_number($PLANETA['M32']), 'frigate' => pretty_number($PLANETA['frigate']), 'black_wanderer' => pretty_number($PLANETA['black_wanderer']), 'flying_death' => pretty_number($PLANETA['flying_death']), 'star_crasher' => pretty_number($PLANETA['star_crasher']), 'bs_class_oneil' => pretty_number($PLANETA['bs_class_oneil']), 'colonizer' => pretty_number($PLANETA['colonizer']), 'spy_sonde' => pretty_number($PLANETA['spy_sonde']), 'dm_ship' => pretty_number($PLANETA['dm_ship']), 'Scrappy' => pretty_number($PLANETA['Scrappy']), 'misil_launcher' => pretty_number($PLANETA['misil_launcher']), 'small_laser' => pretty_number($PLANETA['small_laser']), 'big_laser' => pretty_number($PLANETA['big_laser']), 'gauss_canyon' => pretty_number($PLANETA['gauss_canyon']), 'ionic_canyon' => pretty_number($PLANETA['ionic_canyon']), 'buster_canyon' => pretty_number($PLANETA['buster_canyon']), 'small_protection_shield' => pretty_number($PLANETA['small_protection_shield']), 'big_protection_shield' => pretty_number($PLANETA['big_protection_shield']), 'planet_protector' => pretty_number($PLANETA['planet_protector']), 'graviton_canyon' => pretty_number($PLANETA['graviton_canyon']), 'orbital_station' => pretty_number($PLANETA['orbital_station']), 'lepton_gun' => pretty_number($PLANETA['lepton_gun']), 'proton_gun' => pretty_number($PLANETA['proton_gun']), 'canyon' => pretty_number($PLANETA['canyon']), 'hydrogen_gun' => pretty_number($PLANETA['hydrogen_gun']), 'dora_gun' => pretty_number($PLANETA['dora_gun']), 'photon_cannon' => pretty_number($PLANETA['photon_cannon']), 'particle_emitter' => pretty_number($PLANETA['particle_emitter']), 'slim_mehador' => pretty_number($PLANETA['slim_mehador']), 'iron_mehador' => pretty_number($PLANETA['iron_mehador']), 'grand_mehador' => pretty_number($PLANETA['grand_mehador']), 'interceptor_misil' => pretty_number($PLANETA['interceptor_misil']), 'interplanetary_misil' => pretty_number($PLANETA['interplanetary_misil']), 'current' => $PLANETA['field_current'], 'max' => CalculateMaxPlanetFields($PLANETA), 'energy_used' => $PLANETA['energy'] + $PLANETA['energy_used'], 'resource901' => pretty_number($PLANETA['metal']), 'resource902' => pretty_number($PLANETA['crystal']), 'resource903' => pretty_number($PLANETA['deuterium']), 'resource911' => pretty_number($PLANETA['energy']));
     }
     $this->tplObj->loadscript("empire.js");
     $this->tplObj->assign_vars(array('planetList' => $planetList, 'elementListall' => $elementListall, 'elementListallBis' => $elementListallBis, 'elementListallTris' => $elementListallTris));
     $this->display('page.empire.default.tpl');
 }
开发者ID:Decoder1978,项目名称:Xterium,代码行数:34,代码来源:class.ShowImperiumPage.php

示例2: show

 function show()
 {
     global $LNG, $USER, $PLANET, $resource, $reslist;
     $this->setWindow('popup');
     $this->initTemplate();
     $id = HTTP::_GP('id', 0);
     $PlanetsRAW = $GLOBALS['DATABASE']->query("SELECT * FROM " . PLANETS . " WHERE id = '" . $id . "';");
     $PLANETS = array($PLANET);
     while ($CPLANET = $GLOBALS['DATABASE']->fetch_array($PlanetsRAW)) {
         $planetList['image'][$CPLANET['id']] = $CPLANET['image'];
         $planetList['coords'][$CPLANET['id']]['planet'] = $CPLANET['planet'];
         $planetList['field'][$CPLANET['id']]['current'] = $CPLANET['field_current'];
         $planetList['diameter'][$CPLANET['id']]['diameter'] = $CPLANET['diameter'];
         $planetList['field'][$CPLANET['id']]['max'] = CalculateMaxPlanetFields($CPLANET);
         $planetList['temperature'][$CPLANET['id']]['minimum'] = $CPLANET['temp_min'];
         $planetList['temperature'][$CPLANET['id']]['maximum'] = $CPLANET['temp_max'];
         $planetList['solar'][$CPLANET['id']]['solar'] = $CPLANET['solar_satelit'];
         foreach ($reslist['build'] as $elementID) {
             $planetList['build'][$elementID][$CPLANET['id']] = $CPLANET[$resource[$elementID]];
         }
         foreach ($reslist['defense'] as $elementID) {
             $planetList['defense'][$elementID][$CPLANET['id']] = $CPLANET[$resource[$elementID]];
         }
     }
     $this->tplObj->assign_vars(array('planetList' => $planetList));
     $this->display('page.planetauction.info.tpl');
 }
开发者ID:Decoder1978,项目名称:Xterium,代码行数:27,代码来源:class.ShowPlanetAuctionInfoPage.php

示例3: show

 function show()
 {
     global $USER, $PLANET, $resource, $reslist;
     $db = Database::get();
     switch ($USER['planet_sort']) {
         case 2:
             $orderBy = 'name';
             break;
         case 1:
             $orderBy = 'galaxy, system, planet, planet_type';
             break;
         default:
             $orderBy = 'id';
             break;
     }
     $orderBy .= ' ' . ($USER['planet_sort_order'] == 1) ? 'DESC' : 'ASC';
     $sql = "SELECT * FROM %%PLANETS%% WHERE id != :planetID AND id_owner = :userID AND destruyed = '0' ORDER BY :order;";
     $PlanetsRAW = $db->select($sql, array(':planetID' => $PLANET['id'], ':userID' => $USER['id'], ':order' => $orderBy));
     $PLANETS = array($PLANET);
     $PlanetRess = new ResourceUpdate();
     foreach ($PlanetsRAW as $CPLANET) {
         list($USER, $CPLANET) = $PlanetRess->CalcResource($USER, $CPLANET, true);
         $PLANETS[] = $CPLANET;
         unset($CPLANET);
     }
     $planetList = array();
     foreach ($PLANETS as $Planet) {
         $planetList['name'][$Planet['id']] = $Planet['name'];
         $planetList['image'][$Planet['id']] = $Planet['image'];
         $planetList['coords'][$Planet['id']]['galaxy'] = $Planet['galaxy'];
         $planetList['coords'][$Planet['id']]['system'] = $Planet['system'];
         $planetList['coords'][$Planet['id']]['planet'] = $Planet['planet'];
         $planetList['field'][$Planet['id']]['current'] = $Planet['field_current'];
         $planetList['field'][$Planet['id']]['max'] = CalculateMaxPlanetFields($Planet);
         $planetList['energy_used'][$Planet['id']] = $Planet['energy'] + $Planet['energy_used'];
         $planetList['resource'][901][$Planet['id']] = $Planet['metal'];
         $planetList['resource'][902][$Planet['id']] = $Planet['crystal'];
         $planetList['resource'][903][$Planet['id']] = $Planet['deuterium'];
         $planetList['resource'][911][$Planet['id']] = $Planet['energy'];
         foreach ($reslist['build'] as $elementID) {
             $planetList['build'][$elementID][$Planet['id']] = $Planet[$resource[$elementID]];
         }
         foreach ($reslist['fleet'] as $elementID) {
             $planetList['fleet'][$elementID][$Planet['id']] = $Planet[$resource[$elementID]];
         }
         foreach ($reslist['defense'] as $elementID) {
             $planetList['defense'][$elementID][$Planet['id']] = $Planet[$resource[$elementID]];
         }
     }
     foreach ($reslist['tech'] as $elementID) {
         $planetList['tech'][$elementID] = $USER[$resource[$elementID]];
     }
     $this->assign(array('colspan' => count($PLANETS) + 2, 'planetList' => $planetList));
     $this->display('page.empire.default.tpl');
 }
开发者ID:tatarysh,项目名称:2Moons,代码行数:55,代码来源:ShowImperiumPage.class.php

示例4: ShowImperiumPage

function ShowImperiumPage()
{
    global $LNG, $USER, $PLANET, $resource, $reslist, $db;
    $PlanetRess = new ResourceUpdate();
    $PlanetRess->CalcResource();
    $PlanetRess->SavePlanetToDB();
    $template = new template();
    $template->loadscript("trader.js");
    $template->page_topnav();
    $template->page_header();
    $template->page_leftmenu();
    $template->page_planetmenu();
    $template->page_footer();
    $SQLArray = array_merge($reslist['build'], $reslist['fleet'], $reslist['defense']);
    $Query = "";
    foreach ($SQLArray as $id => $gid) {
        $Query .= ",`" . $resource[$gid] . "`";
    }
    if ($USER['planet_sort'] == 0) {
        $Order = "`id` ";
    } elseif ($USER['planet_sort'] == 1) {
        $Order = "`galaxy`, `system`, `planet`, `planet_type` ";
    } elseif ($USER['planet_sort'] == 2) {
        $Order = "`name` ";
    }
    $Order .= $USER['planet_sort_order'] == 1 ? "DESC" : "ASC";
    $PlanetsRAW = $db->query("\r\n\tSELECT `id`,`name`,`galaxy`,`system`,`planet`,`planet_type`,\r\n\t`image`,`field_current`,`field_max`,`metal`,`crystal`,`deuterium`,\r\n\t`energy_used`,`energy_max` " . $Query . " FROM " . PLANETS . " WHERE `id_owner` = '" . $USER['id'] . "' AND `destruyed` = '0' ORDER BY " . $Order . ";");
    while ($Planet = $db->fetch_array($PlanetsRAW)) {
        $InfoList = array('id' => $Planet['id'], 'name' => $Planet['name'], 'image' => $Planet['image'], 'galaxy' => $Planet['galaxy'], 'system' => $Planet['system'], 'planet' => $Planet['planet'], 'field_current' => $Planet['field_current'], 'field_max' => CalculateMaxPlanetFields($Planet), 'metal' => pretty_number($Planet['metal']), 'crystal' => pretty_number($Planet['crystal']), 'deuterium' => pretty_number($Planet['deuterium']), 'energy_used' => pretty_number($Planet['energy_max'] + $Planet['energy_used']), 'energy_max' => pretty_number($Planet['energy_max']));
        foreach ($reslist['build'] as $gid) {
            $BuildsList[$gid] = pretty_number($Planet[$resource[$gid]]);
        }
        foreach ($reslist['fleet'] as $gid) {
            $FleetsList[$gid] = pretty_number($Planet[$resource[$gid]]);
        }
        foreach ($reslist['defense'] as $gid) {
            $DefensesList[$gid] = pretty_number($Planet[$resource[$gid]]);
        }
        $PlanetsList[] = array('InfoList' => $InfoList, 'BuildsList' => $BuildsList, 'FleetsList' => $FleetsList, 'DefensesList' => $DefensesList);
    }
    foreach ($reslist['tech'] as $gid) {
        $ResearchList[$gid] = pretty_number($USER[$resource[$gid]]);
    }
    $template->assign_vars(array('colspan' => count($PlanetsList) + 1, 'PlanetsList' => $PlanetsList, 'ResearchList' => $ResearchList, 'iv_imperium_title' => $LNG['iv_imperium_title'], 'iv_planet' => $LNG['iv_planet'], 'iv_name' => $LNG['iv_name'], 'iv_coords' => $LNG['iv_coords'], 'iv_fields' => $LNG['iv_fields'], 'iv_resources' => $LNG['iv_resources'], 'Metal' => $LNG['Metal'], 'Crystal' => $LNG['Crystal'], 'Deuterium' => $LNG['Deuterium'], 'Energy' => $LNG['Energy'], 'iv_buildings' => $LNG['iv_buildings'], 'iv_technology' => $LNG['iv_technology'], 'iv_ships' => $LNG['iv_ships'], 'iv_defenses' => $LNG['iv_defenses'], 'tech' => $LNG['tech'], 'build' => $reslist['build'], 'fleet' => $reslist['fleet'], 'defense' => $reslist['defense'], 'research' => $reslist['tech']));
    $template->show("empire_overview.tpl");
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:46,代码来源:ShowImperiumPage.php

示例5: ShowOverviewPage

function ShowOverviewPage()
{
    global $CONF, $LNG, $PLANET, $USER, $db, $resource, $UNI;
    $PlanetRess = new ResourceUpdate();
    $PlanetRess->CalcResource();
    $PlanetRess->SavePlanetToDB();
    $template = new template();
    $template->getplanets();
    $AdminsOnline = $AllPlanets = $Moon = array();
    foreach ($template->UserPlanets as $ID => $CPLANET) {
        if ($ID == $_SESSION['planet'] || $CPLANET['planet_type'] == 3) {
            continue;
        }
        if (!empty($CPLANET['b_building']) && $CPLANET['b_building'] > TIMESTAMP) {
            $Queue = explode(';', $CPLANET['b_building_id']);
            $CurrBuild = explode(',', $Queue[0]);
            $BuildPlanet = $LNG['tech'][$CurrBuild[0]] . " (" . $CurrBuild[1] . ")<br><span style=\"color:#7F7F7F;\">(" . pretty_time($CurrBuild[3] - TIMESTAMP) . ")</span>";
        } else {
            $BuildPlanet = $LNG['ov_free'];
        }
        $AllPlanets[] = array('id' => $CPLANET['id'], 'name' => $CPLANET['name'], 'image' => $CPLANET['image'], 'build' => $BuildPlanet);
    }
    if ($PLANET['id_luna'] != 0) {
        $Moon = $db->uniquequery("SELECT `id`, `name` FROM " . PLANETS . " WHERE `id` = '" . $PLANET['id_luna'] . "';");
    }
    if (!empty($PLANET['b_building'])) {
        $Queue = explode(';', $PLANET['b_building_id']);
        $CurrBuild = explode(',', $Queue[0]);
        $Build = $LNG['tech'][$CurrBuild[0]] . ' (' . $CurrBuild[1] . ')<br><div id="blc">"' . pretty_time($PLANET['b_building'] - TIMESTAMP) . '</div>';
        $template->execscript('BuildTime();');
    } else {
        $Build = $LNG['ov_free'];
    }
    $OnlineAdmins = $db->query("SELECT `id`,`username` FROM " . USERS . " WHERE `universe` = '" . $UNI . "' AND `onlinetime` >= '" . (TIMESTAMP - 10 * 60) . "' AND `authlevel` > '0';");
    while ($AdminRow = $db->fetch_array($OnlineAdmins)) {
        $AdminsOnline[$AdminRow['id']] = $AdminRow['username'];
    }
    $db->free_result($OnlineAdmins);
    $template->loadscript('mbContainer.js');
    $template->loadscript('overview.js');
    $template->execscript('GetFleets(true);');
    $template->assign_vars(array('user_rank' => sprintf($LNG['ov_userrank_info'], pretty_number($USER['total_points']), $LNG['ov_place'], $USER['total_rank'], $USER['total_rank'], $LNG['ov_of'], $CONF['users_amount']), 'is_news' => $CONF['OverviewNewsFrame'], 'news' => makebr($CONF['OverviewNewsText']), 'planetname' => $PLANET['name'], 'planetimage' => $PLANET['image'], 'galaxy' => $PLANET['galaxy'], 'system' => $PLANET['system'], 'planet' => $PLANET['planet'], 'buildtime' => $PLANET['b_building'], 'userid' => $USER['id'], 'username' => $USER['username'], 'build' => $Build, 'Moon' => $Moon, 'AllPlanets' => $AllPlanets, 'AdminsOnline' => $AdminsOnline, 'Teamspeak' => GetTeamspeakData(), 'messages' => $USER['new_message'] > 0 ? $USER['new_message'] == 1 ? $LNG['ov_have_new_message'] : sprintf($LNG['ov_have_new_messages'], pretty_number($USER['new_message'])) : false, 'planet_diameter' => pretty_number($PLANET['diameter']), 'planet_field_current' => $PLANET['field_current'], 'planet_field_max' => CalculateMaxPlanetFields($PLANET), 'planet_temp_min' => $PLANET['temp_min'], 'planet_temp_max' => $PLANET['temp_max'], 'ov_news' => $LNG['ov_news'], 'fcm_moon' => $LNG['fcm_moon'], 'ov_server_time' => $LNG['ov_server_time'], 'ov_planet' => $LNG['ov_planet'], 'ov_planetmenu' => $LNG['ov_planetmenu'], 'ov_diameter' => $LNG['ov_diameter'], 'ov_distance_unit' => $LNG['ov_distance_unit'], 'ov_developed_fields' => $LNG['ov_developed_fields'], 'ov_max_developed_fields' => $LNG['ov_max_developed_fields'], 'ov_fields' => $LNG['ov_fields'], 'ov_temperature' => $LNG['ov_temperature'], 'ov_aprox' => $LNG['ov_aprox'], 'ov_temp_unit' => $LNG['ov_temp_unit'], 'ov_to' => $LNG['ov_to'], 'ov_position' => $LNG['ov_position'], 'ov_points' => $LNG['ov_points'], 'ov_events' => $LNG['ov_events'], 'ov_admins_online' => $LNG['ov_admins_online'], 'ov_no_admins_online' => $LNG['ov_no_admins_online'], 'ov_userbanner' => $LNG['ov_userbanner'], 'ov_teamspeak' => $LNG['ov_teamspeak'], 'ov_your_planet' => $LNG['ov_your_planet'], 'ov_coords' => $LNG['ov_coords'], 'ov_planet_name' => $LNG['ov_planet_name'], 'ov_actions' => $LNG['ov_actions'], 'ov_abandon_planet' => $LNG['ov_abandon_planet'], 'ov_planet_rename' => $LNG['ov_planet_rename'], 'ov_planet_rename_action' => $LNG['ov_planet_rename_action'], 'ov_password' => $LNG['ov_password'], 'ov_with_pass' => $LNG['ov_with_pass'], 'ov_security_confirm' => $LNG['ov_security_confirm'], 'ov_security_request' => $LNG['ov_security_request'], 'ov_delete_planet' => $LNG['ov_delete_planet'], 'ov_planet_abandoned' => $LNG['ov_planet_abandoned'], 'path' => PROTOCOL . $_SERVER['HTTP_HOST'] . HTTP_ROOT));
    $template->show("overview_body.tpl");
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:44,代码来源:ShowOverviewPage.php

示例6: __construct

 public function __construct(&$CurrentPlanet, $CurrentUser)
 {
     global $ProdGrid, $lang, $resource, $reslist, $phpEx, $dpath, $game_config, $_GET, $xgp_root;
     include_once $xgp_root . 'includes/functions/IsTechnologieAccessible.' . $phpEx;
     include_once $xgp_root . 'includes/functions/GetElementPrice.' . $phpEx;
     include_once $xgp_root . 'includes/functions/CheckPlanetUsedFields.' . $phpEx;
     CheckPlanetUsedFields($CurrentPlanet);
     $parse = $lang;
     $Allowed['1'] = array(1, 2, 3, 4, 12, 14, 15, 21, 22, 23, 24, 31, 33, 34, 44);
     $Allowed['3'] = array(12, 14, 21, 22, 23, 24, 34, 41, 42, 43);
     if (isset($_GET['cmd'])) {
         $bDoItNow = false;
         $TheCommand = $_GET['cmd'];
         $Element = $_GET['building'];
         $ListID = $_GET['listid'];
         if (!in_array(trim($Element), $Allowed[$CurrentPlanet['planet_type']])) {
             unset($Element);
         }
         if (isset($Element)) {
             if (!strchr($Element, ",") && !strchr($Element, " ") && !strchr($Element, "+") && !strchr($Element, "*") && !strchr($Element, "~") && !strchr($Element, "=") && !strchr($Element, ";") && !strchr($Element, "'") && !strchr($Element, "#") && !strchr($Element, "-") && !strchr($Element, "_") && !strchr($Element, "[") && !strchr($Element, "]") && !strchr($Element, ".") && !strchr($Element, ":")) {
                 if (in_array(trim($Element), $Allowed[$CurrentPlanet['planet_type']])) {
                     $bDoItNow = true;
                 }
             } else {
                 header("location:game.php?page=buildings");
             }
         } elseif (isset($ListID)) {
             $bDoItNow = true;
         }
         if ($Element == 31 && $CurrentUser["b_tech_planet"] != 0) {
             $bDoItNow = false;
         }
         if (($Element == 21 or $Element == 14 or $Element == 15) && $CurrentPlanet["b_hangar"] != 0) {
             $bDoItNow = false;
         }
         if ($bDoItNow == true) {
             switch ($TheCommand) {
                 case 'cancel':
                     $this->CancelBuildingFromQueue($CurrentPlanet, $CurrentUser);
                     break;
                 case 'remove':
                     $this->RemoveBuildingFromQueue($CurrentPlanet, $CurrentUser, $ListID);
                     break;
                 case 'insert':
                     $this->AddBuildingToQueue($CurrentPlanet, $CurrentUser, $Element, true);
                     break;
                 case 'destroy':
                     $this->AddBuildingToQueue($CurrentPlanet, $CurrentUser, $Element, false);
                     break;
             }
         }
         if ($_GET['r'] == 'overview') {
             header('location:game.php?page=overview');
         } else {
             header("Location: game.php?page=buildings&mode=buildings");
         }
     }
     SetNextQueueElementOnTop($CurrentPlanet, $CurrentUser);
     // $Queue = $this->ShowBuildingQueue($CurrentPlanet, $CurrentUser); // OLD CODE
     // START FIX BY JSTAR
     $Sprice = array();
     $Queue = $this->ShowBuildingQueue($CurrentPlanet, $CurrentUser, $Sprice);
     // END FIX BY JSTAR
     $this->BuildingSavePlanetRecord($CurrentPlanet);
     if ($Queue['lenght'] < MAX_BUILDING_QUEUE_SIZE) {
         $CanBuildElement = true;
     } else {
         $CanBuildElement = false;
     }
     $BuildingPage = "";
     $zaehler = 1;
     foreach ($lang['tech'] as $Element => $ElementName) {
         if (in_array($Element, $Allowed[$CurrentPlanet['planet_type']])) {
             $CurrentMaxFields = CalculateMaxPlanetFields($CurrentPlanet);
             if ($CurrentPlanet["field_current"] < $CurrentMaxFields - $Queue['lenght']) {
                 $RoomIsOk = true;
             } else {
                 $RoomIsOk = false;
             }
             if (IsTechnologieAccessible($CurrentUser, $CurrentPlanet, $Element)) {
                 $HaveRessources = IsElementBuyable($CurrentUser, $CurrentPlanet, $Element, true, false);
                 $parse = array();
                 $parse = $lang;
                 $parse['dpath'] = $dpath;
                 $parse['i'] = $Element;
                 $BuildingLevel = $CurrentPlanet[$resource[$Element]];
                 $parse['nivel'] = $BuildingLevel == 0 ? "" : " (" . $lang['bd_lvl'] . " " . $BuildingLevel . ")";
                 $parse['n'] = $ElementName;
                 $parse['descriptions'] = $lang['res']['descriptions'][$Element];
                 /* OLD CODE ---------------------------------------------------- OLD CODE ------------------------------------- //
                 					$ElementBuildTime      	= GetBuildingTime($CurrentUser, $CurrentPlanet, $Element);
                 					$parse['time']         	= ShowBuildTime($ElementBuildTime);
                 					$parse['price']        	= GetElementPrice($CurrentUser, $CurrentPlanet, $Element);
                    OLD CODE ---------------------------------------------------- OLD CODE ------------------------------------- //
                 */
                 // START FIX BY JSTAR
                 $really_lvl = isset($Sprice[$Element]) ? $Sprice[$Element] : $BuildingLevel;
                 $ElementBuildTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $Element, $really_lvl);
                 $parse['price'] = GetElementPrice($CurrentUser, $CurrentPlanet, $Element, true, $really_lvl);
                 $parse['time'] = ShowBuildTime($ElementBuildTime);
//.........这里部分代码省略.........
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:class.ShowBuildingsPage.php

示例7: show

 public function show()
 {
     global $ProdGrid, $LNG, $resource, $reslist, $PLANET, $USER, $pricelist;
     $TheCommand = HTTP::_GP('cmd', '');
     // wellformed buildURLs
     if (!empty($TheCommand) && $_SERVER['REQUEST_METHOD'] === 'POST' && $USER['urlaubs_modus'] == 0) {
         $Element = HTTP::_GP('building', 0);
         $ListID = HTTP::_GP('listid', 0);
         switch ($TheCommand) {
             case 'cancel':
                 $this->CancelBuildingFromQueue();
                 break;
             case 'remove':
                 $this->RemoveBuildingFromQueue($ListID);
                 break;
             case 'insert':
                 $this->AddBuildingToQueue($Element, true);
                 break;
             case 'destroy':
                 $this->AddBuildingToQueue($Element, false);
                 break;
         }
         $this->redirectTo('game.php?page=buildings');
     }
     $config = Config::get();
     $queueData = $this->getQueueData();
     $Queue = $queueData['queue'];
     $QueueCount = count($Queue);
     $CanBuildElement = isVacationMode($USER) || $config->max_elements_build == 0 || $QueueCount < $config->max_elements_build;
     $CurrentMaxFields = CalculateMaxPlanetFields($PLANET);
     $RoomIsOk = $PLANET['field_current'] < $CurrentMaxFields - $QueueCount;
     $BuildEnergy = $USER[$resource[113]];
     $BuildLevelFactor = 10;
     $BuildTemp = $PLANET['temp_max'];
     $BuildInfoList = array();
     $Elements = $reslist['allow'][$PLANET['planet_type']];
     foreach ($Elements as $Element) {
         if (!BuildFunctions::isTechnologieAccessible($USER, $PLANET, $Element)) {
             continue;
         }
         $infoEnergy = "";
         if (isset($queueData['quickinfo'][$Element])) {
             $levelToBuild = $queueData['quickinfo'][$Element];
         } else {
             $levelToBuild = $PLANET[$resource[$Element]];
         }
         if (in_array($Element, $reslist['prod'])) {
             $BuildLevel = $PLANET[$resource[$Element]];
             $Need = eval(ResourceUpdate::getProd($ProdGrid[$Element]['production'][911]));
             $BuildLevel = $levelToBuild + 1;
             $Prod = eval(ResourceUpdate::getProd($ProdGrid[$Element]['production'][911]));
             $requireEnergy = $Prod - $Need;
             $requireEnergy = round($requireEnergy * $config->energySpeed);
             if ($requireEnergy < 0) {
                 $infoEnergy = sprintf($LNG['bd_need_engine'], pretty_number(abs($requireEnergy)), $LNG['tech'][911]);
             } else {
                 $infoEnergy = sprintf($LNG['bd_more_engine'], pretty_number(abs($requireEnergy)), $LNG['tech'][911]);
             }
         }
         $costResources = BuildFunctions::getElementPrice($USER, $PLANET, $Element, false, $levelToBuild);
         $costOverflow = BuildFunctions::getRestPrice($USER, $PLANET, $Element, $costResources);
         $elementTime = BuildFunctions::getBuildingTime($USER, $PLANET, $Element, $costResources);
         $destroyResources = BuildFunctions::getElementPrice($USER, $PLANET, $Element, true);
         $destroyTime = BuildFunctions::getBuildingTime($USER, $PLANET, $Element, $destroyResources);
         $destroyOverflow = BuildFunctions::getRestPrice($USER, $PLANET, $Element, $destroyResources);
         $buyable = $QueueCount != 0 || BuildFunctions::isElementBuyable($USER, $PLANET, $Element, $costResources);
         $BuildInfoList[$Element] = array('level' => $PLANET[$resource[$Element]], 'maxLevel' => $pricelist[$Element]['max'], 'infoEnergy' => $infoEnergy, 'costResources' => $costResources, 'costOverflow' => $costOverflow, 'elementTime' => $elementTime, 'destroyResources' => $destroyResources, 'destroyTime' => $destroyTime, 'destroyOverflow' => $destroyOverflow, 'buyable' => $buyable, 'levelToBuild' => $levelToBuild);
     }
     if ($QueueCount != 0) {
         $this->tplObj->loadscript('buildlist.js');
     }
     $this->assign(array('BuildInfoList' => $BuildInfoList, 'CanBuildElement' => $CanBuildElement, 'RoomIsOk' => $RoomIsOk, 'Queue' => $Queue, 'isBusy' => array('shipyard' => !empty($PLANET['b_hangar_id']), 'research' => $USER['b_tech_planet'] != 0), 'HaveMissiles' => (bool) $PLANET[$resource[503]] + $PLANET[$resource[502]]));
     $this->display('page.buildings.default.tpl');
 }
开发者ID:bergi9,项目名称:2Moons,代码行数:74,代码来源:ShowBuildingsPage.class.php

示例8: show

    function show()
    {
        global $LNG, $PLANET, $USER;
        $AdminsOnline = array();
        $chatOnline = array();
        $AllPlanets = array();
        $Moon = array();
        $RefLinks = array();
        $db = Database::get();
        foreach ($USER['PLANETS'] as $ID => $CPLANET) {
            if ($ID == $PLANET['id'] || $CPLANET['planet_type'] == 3) {
                continue;
            }
            if (!empty($CPLANET['b_building']) && $CPLANET['b_building'] > TIMESTAMP) {
                $Queue = unserialize($CPLANET['b_building_id']);
                $BuildPlanet = $LNG['tech'][$Queue[0][0]] . " (" . $Queue[0][1] . ")<br><span style=\"color:#7F7F7F;\">(" . pretty_time($Queue[0][3] - TIMESTAMP) . ")</span>";
            } else {
                $BuildPlanet = $LNG['ov_free'];
            }
            $AllPlanets[] = array('id' => $CPLANET['id'], 'name' => $CPLANET['name'], 'image' => $CPLANET['image'], 'build' => $BuildPlanet);
        }
        if ($PLANET['id_luna'] != 0) {
            $sql = "SELECT id, name FROM %%PLANETS%% WHERE id = :lunaID;";
            $Moon = $db->selectSingle($sql, array(':lunaID' => $PLANET['id_luna']));
        }
        if ($PLANET['b_building'] - TIMESTAMP > 0) {
            $Queue = unserialize($PLANET['b_building_id']);
            $buildInfo['buildings'] = array('id' => $Queue[0][0], 'level' => $Queue[0][1], 'timeleft' => $PLANET['b_building'] - TIMESTAMP, 'time' => $PLANET['b_building'], 'starttime' => pretty_time($PLANET['b_building'] - TIMESTAMP));
        } else {
            $buildInfo['buildings'] = false;
        }
        /* As FR#206 (http://tracker.2moons.cc/view.php?id=206), i added the shipyard and research status here, but i add not them the template. */
        if (!empty($PLANET['b_hangar_id'])) {
            $Queue = unserialize($PLANET['b_hangar_id']);
            $time = BuildFunctions::getBuildingTime($USER, $PLANET, $Queue[0][0]) * $Queue[0][1];
            $buildInfo['fleet'] = array('id' => $Queue[0][0], 'level' => $Queue[0][1], 'timeleft' => $time - $PLANET['b_hangar'], 'time' => $time, 'starttime' => pretty_time($time - $PLANET['b_hangar']));
        } else {
            $buildInfo['fleet'] = false;
        }
        if ($USER['b_tech'] - TIMESTAMP > 0) {
            $Queue = unserialize($USER['b_tech_queue']);
            $buildInfo['tech'] = array('id' => $Queue[0][0], 'level' => $Queue[0][1], 'timeleft' => $USER['b_tech'] - TIMESTAMP, 'time' => $USER['b_tech'], 'starttime' => pretty_time($USER['b_tech'] - TIMESTAMP));
        } else {
            $buildInfo['tech'] = false;
        }
        $sql = "SELECT id,username FROM %%USERS%% WHERE universe = :universe AND onlinetime >= :onlinetime AND authlevel > :authlevel;";
        $onlineAdmins = $db->select($sql, array(':universe' => Universe::current(), ':onlinetime' => TIMESTAMP - 10 * 60, ':authlevel' => AUTH_USR));
        foreach ($onlineAdmins as $AdminRow) {
            $AdminsOnline[$AdminRow['id']] = $AdminRow['username'];
        }
        $sql = "SELECT userName FROM %%CHAT_ON%% WHERE dateTime > DATE_SUB(NOW(), interval 2 MINUTE) AND channel = 0";
        $chatUsers = $db->select($sql);
        foreach ($chatUsers as $chatRow) {
            $chatOnline[] = $chatRow['userName'];
        }
        $Messages = $USER['messages'];
        // Fehler: Wenn Spieler gelöscht werden, werden sie nicht mehr in der Tabelle angezeigt.
        $sql = "SELECT u.id, u.username, s.total_points FROM %%USERS%% as u\n\t\tLEFT JOIN %%STATPOINTS%% as s ON s.id_owner = u.id AND s.stat_type = '1' WHERE ref_id = :userID;";
        $RefLinksRAW = $db->select($sql, array(':userID' => $USER['id']));
        $config = Config::get();
        if ($config->ref_active) {
            foreach ($RefLinksRAW as $RefRow) {
                $RefLinks[$RefRow['id']] = array('username' => $RefRow['username'], 'points' => min($RefRow['total_points'], $config->ref_minpoints));
            }
        }
        $sql = 'SELECT total_points, total_rank
		FROM %%STATPOINTS%%
		WHERE id_owner = :userId AND stat_type = :statType';
        $statData = Database::get()->selectSingle($sql, array(':userId' => $USER['id'], ':statType' => 1));
        if ($statData['total_rank'] == 0) {
            $rankInfo = "-";
        } else {
            $rankInfo = sprintf($LNG['ov_userrank_info'], pretty_number($statData['total_points']), $LNG['ov_place'], $statData['total_rank'], $statData['total_rank'], $LNG['ov_of'], $config->users_amount);
        }
        $this->assign(array('rankInfo' => $rankInfo, 'is_news' => $config->OverviewNewsFrame, 'news' => makebr($config->OverviewNewsText), 'planetname' => $PLANET['name'], 'planetimage' => $PLANET['image'], 'galaxy' => $PLANET['galaxy'], 'system' => $PLANET['system'], 'planet' => $PLANET['planet'], 'planet_type' => $PLANET['planet_type'], 'username' => $USER['username'], 'userid' => $USER['id'], 'buildInfo' => $buildInfo, 'Moon' => $Moon, 'fleets' => $this->GetFleets(), 'AllPlanets' => $AllPlanets, 'AdminsOnline' => $AdminsOnline, 'teamspeakData' => $this->GetTeamspeakData(), 'messages' => $Messages > 0 ? $Messages == 1 ? $LNG['ov_have_new_message'] : sprintf($LNG['ov_have_new_messages'], pretty_number($Messages)) : false, 'planet_diameter' => pretty_number($PLANET['diameter']), 'planet_field_current' => $PLANET['field_current'], 'planet_field_max' => CalculateMaxPlanetFields($PLANET), 'planet_temp_min' => $PLANET['temp_min'], 'planet_temp_max' => $PLANET['temp_max'], 'ref_active' => $config->ref_active, 'ref_minpoints' => $config->ref_minpoints, 'RefLinks' => $RefLinks, 'chatOnline' => $chatOnline, 'servertime' => _date("M D d H:i:s", TIMESTAMP, $USER['timezone']), 'path' => HTTP_PATH));
        $this->display('page.overview.default.tpl');
    }
开发者ID:FrancisLeRoy,项目名称:2Moons,代码行数:77,代码来源:ShowOverviewPage.class.php

示例9: ShowAccountDataPage


//.........这里部分代码省略.........
                    $ali_int = "<a href=\"#\" rel=\"toggle[interno]\">" . $LNG['ac_view_text_int'] . "</a>";
                } else {
                    $ali_int = $LNG['ac_no_text_int'];
                }
                if ($AllianceQuery['ally_request'] != NULL) {
                    $ali_sol2 = bbcode($AllianceQuery['ally_request']);
                    $ali_sol = "<a href=\"#\" rel=\"toggle[solicitud]\">" . $LNG['ac_view_text_sol'] . "</a>";
                } else {
                    $ali_sol = $LNG['ac_no_text_sol'];
                }
                if ($AllianceQuery['ally_image'] != NULL) {
                    $ali_logo2 = $AllianceQuery['ally_image'];
                    $ali_logo = "<a href=\"#\" rel=\"toggle[imagen]\">" . $LNG['ac_view_image2'] . "</a>";
                } else {
                    $ali_logo = $LNG['ac_no_img'];
                }
                $SearchLeader = $GLOBALS['DATABASE']->getFirstRow("SELECT `username` FROM " . USERS . " WHERE `id` = '" . $ali_lider . "';");
                $ali_lider = $SearchLeader['username'];
                $StatQueryAlly = $GLOBALS['DATABASE']->getFirstRow("SELECT " . $SpecifyItemsS . " FROM " . STATPOINTS . " WHERE `id_owner` = '" . $ali_lider . "' AND `stat_type` = '2';");
                $count_tecno_ali = pretty_number($StatQueryAlly['tech_count']);
                $count_def_ali = pretty_number($StatQueryAlly['defs_count']);
                $count_fleet_ali = pretty_number($StatQueryAlly['fleet_count']);
                $count_builds_ali = pretty_number($StatQueryAlly['build_count']);
                $point_builds_ali = pretty_number($StatQueryAlly['build_points']);
                $point_tecno_ali = pretty_number($StatQueryAlly['tech_points']);
                $point_def_ali = pretty_number($StatQueryAlly['defs_points']);
                $point_fleet_ali = pretty_number($StatQueryAlly['fleet_points']);
                $ranking_tecno_ali = pretty_number($StatQueryAlly['tech_rank']);
                $ranking_builds_ali = pretty_number($StatQueryAlly['build_rank']);
                $ranking_def_ali = pretty_number($StatQueryAlly['defs_rank']);
                $ranking_fleet_ali = pretty_number($StatQueryAlly['fleet_rank']);
                $total_points_ali = pretty_number($StatQueryAlly['total_points']);
            }
            foreach (array_merge($reslist['fleet'], $reslist['build'], $reslist['defense']) as $ID) {
                $SpecifyItemsPQ .= "`" . $resource[$ID] . "`,";
                $RES[$resource[$ID]] = "<tr><td width=\"150\">" . $LNG['tech'][$ID] . "</td>";
            }
            $names = "<tr><th class=\"center\" width=\"150\">&nbsp;</th>";
            // COMIENZA EL SAQUEO DE DATOS DE LOS PLANETAS
            $SpecifyItemsP = "planet_type,id,name,galaxy,system,planet,destruyed,diameter,field_current,field_max,temp_min,temp_max,metal,crystal,deuterium,energy," . $SpecifyItemsPQ . "energy_used";
            $PlanetsQuery = $GLOBALS['DATABASE']->query("SELECT " . $SpecifyItemsP . " FROM " . PLANETS . " WHERE `id_owner` = '" . $id_u . "';");
            while ($PlanetsWhile = $GLOBALS['DATABASE']->fetch_array($PlanetsQuery)) {
                if ($PlanetsWhile['planet_type'] == 3) {
                    $Planettt = $PlanetsWhile['name'] . "&nbsp;(" . $LNG['ac_moon'] . ")<br><font color=aqua>[" . $PlanetsWhile['galaxy'] . ":" . $PlanetsWhile['system'] . ":" . $PlanetsWhile['planet'] . "]</font>";
                    $MoonZ = 0;
                    $Moons = $PlanetsWhile['name'] . "&nbsp;(" . $LNG['ac_moon'] . ")<br><font color=aqua>[" . $PlanetsWhile['galaxy'] . ":" . $PlanetsWhile['system'] . ":" . $PlanetsWhile['planet'] . "]</font>";
                    $MoonZ++;
                } else {
                    $Planettt = $PlanetsWhile['name'] . "<br><font color=aqua>[" . $PlanetsWhile['galaxy'] . ":" . $PlanetsWhile['system'] . ":" . $PlanetsWhile['planet'] . "]</font>";
                }
                if ($PlanetsWhile["destruyed"] == 0) {
                    $planets_moons .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>" . $Planettt . "</td>\n\t\t\t\t\t\t<td>" . $PlanetsWhile['id'] . "</td>\n\t\t\t\t\t\t<td>" . pretty_number($PlanetsWhile['diameter']) . "</td>\n\t\t\t\t\t\t<td>" . pretty_number($PlanetsWhile['field_current']) . " / " . pretty_number(CalculateMaxPlanetFields($PlanetsWhile)) . " (" . pretty_number($PlanetsWhile['field_current']) . " / " . pretty_number($PlanetsWhile['field_max']) . ")</td>\n\t\t\t\t\t\t<td>" . pretty_number($PlanetsWhile['temp_min']) . " / " . pretty_number($PlanetsWhile['temp_max']) . "</td>" . (allowedTo('ShowQuickEditorPage') ? "<td><a href=\"javascript:openEdit('" . $PlanetsWhile['id'] . "', 'planet');\" border=\"0\"><img src=\"./styles/resource/images/admin/GO.png\" title=" . $LNG['se_search_edit'] . "></a></td>" : "") . "</tr>";
                    $SumOfEnergy = $PlanetsWhile['energy'] + $PlanetsWhile['energy_used'];
                    if ($SumOfEnergy < 0) {
                        $Color = "<font color=#FF6600>" . shortly_number($SumOfEnergy) . "</font>";
                    } elseif ($SumOfEnergy > 0) {
                        $Color = "<font color=lime>" . shortly_number($SumOfEnergy) . "</font>";
                    } else {
                        $Color = shortly_number($SumOfEnergy);
                    }
                    $resources .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>" . $Planettt . "</td>\n\t\t\t\t\t\t<td><a title=\"" . pretty_number($PlanetsWhile['metal']) . "\">" . shortly_number($PlanetsWhile['metal']) . "</a></td>\n\t\t\t\t\t\t<td><a title=\"" . pretty_number($PlanetsWhile['crystal']) . "\">" . shortly_number($PlanetsWhile['crystal']) . "</a></td>\n\t\t\t\t\t\t<td><a title=\"" . pretty_number($PlanetsWhile['deuterium']) . "\">" . shortly_number($PlanetsWhile['deuterium']) . "</a></td>\n\t\t\t\t\t\t<td><a title=\"" . pretty_number($SumOfEnergy) . "\">" . $Color . "</a>/<a title=\"" . pretty_number($PlanetsWhile['energy']) . "\">" . shortly_number($PlanetsWhile['energy']) . "</a></td>\n\t\t\t\t\t</tr>";
                    $names .= "<th class=\"center\" width=\"60\">" . $Planettt . "</th>";
                    foreach (array_merge($reslist['fleet'], $reslist['build'], $reslist['defense']) as $ID) {
                        $RES[$resource[$ID]] .= "<td width=\"60\"><a title=\"" . pretty_number($PlanetsWhile[$resource[$ID]]) . "\">" . shortly_number($PlanetsWhile[$resource[$ID]]) . "</a></td>";
                    }
                    $MoonHave = $MoonZ != 0 ? '<a href="#" onclick="$(\'#especiales\').slideToggle();return false" class="link"><img src="./styles/resource/images/admin/arrowright.png" width="16" height="10"/> ' . $LNG['moon_build'] . "</a>" : "<span class=\"no_moon\"><img src=\"./styles/resource/images/admin/arrowright.png\" width=\"16\" height=\"10\"/>" . $LNG['moon_build'] . "&nbsp;" . $LNG['ac_moons_no'] . "</span>";
                }
                $DestruyeD = 0;
                if ($PlanetsWhile["destruyed"] > 0) {
                    $destroyed .= "\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>" . $PlanetsWhile['name'] . "</td>\n\t\t\t\t\t\t\t<td>" . $PlanetsWhile['id'] . "</td>\n\t\t\t\t\t\t\t<td>[" . $PlanetsWhile['galaxy'] . ":" . $PlanetsWhile['system'] . ":" . $PlanetsWhile['planet'] . "]</td>\n\t\t\t\t\t\t\t<td>" . date("d-m-Y   H:i:s", $PlanetsWhile['destruyed']) . "</td>\n\t\t\t\t\t\t</tr>";
                    $DestruyeD++;
                }
            }
            $names .= "</tr>";
            foreach (array_merge($reslist['fleet'], $reslist['build'], $reslist['defense']) as $ID) {
                $RES[$resource[$ID]] .= "</tr>";
            }
            foreach ($reslist['build'] as $ID) {
                $build .= $RES[$resource[$ID]];
            }
            foreach ($reslist['fleet'] as $ID) {
                $fleet .= $RES[$resource[$ID]];
            }
            foreach ($reslist['defense'] as $ID) {
                $defense .= $RES[$resource[$ID]];
            }
            $template->assign_vars(array('DestruyeD' => $DestruyeD, 'destroyed' => $destroyed, 'resources' => $resources, 'mo' => $mo, 'names' => $names, 'build' => $build, 'fleet' => $fleet, 'defense' => $defense, 'planets_moons' => $planets_moons, 'ali_lider' => $ali_lider, 'AllianceHave' => $AllianceHave, 'point_tecno' => $point_tecno, 'count_tecno' => $count_tecno, 'ranking_tecno' => $ranking_tecno, 'defenses_title' => $defenses_title, 'point_def' => $point_def, 'count_def' => $count_def, 'ranking_def' => $ranking_def, 'point_fleet' => $point_fleet, 'count_fleet' => $count_fleet, 'ranking_fleet' => $ranking_fleet, 'point_builds' => $point_builds, 'count_builds' => $count_builds, 'ranking_builds' => $ranking_builds, 'total_points' => $total_points, 'point_tecno_ali' => $point_tecno_ali, 'count_tecno_ali' => $count_tecno_ali, 'ranking_tecno_ali' => $ranking_tecno_ali, 'point_def_ali' => $point_def_ali, 'count_def_ali' => $count_def_ali, 'ranking_def_ali' => $ranking_def_ali, 'point_fleet_ali' => $point_fleet_ali, 'count_fleet_ali' => $count_fleet_ali, 'ranking_fleet_ali' => $ranking_fleet_ali, 'point_builds_ali' => $point_builds_ali, 'count_builds_ali' => $count_builds_ali, 'ranking_builds_ali' => $ranking_builds_ali, 'total_points_ali' => $total_points_ali, 'input_id' => $input_id, 'id_aliz' => $id_aliz, 'tag' => $tag, 'ali_nom' => $ali_nom, 'ali_ext' => $ali_ext, 'ali_ext' => $ali_ext2, 'ali_int' => $ali_int, 'ali_int' => $ali_int2, 'ali_sol2' => $ali_sol2, 'ali_sol' => $ali_sol, 'ali_logo' => $ali_logo, 'ali_logo2' => $ali_logo2, 'ali_web' => $ali_web, 'ally_register_time' => $ally_register_time, 'ali_cant' => $ali_cant, 'alianza' => $alianza, 'input_id' => $input_id, 'id' => $id, 'nombre' => $nombre, 'nivel' => $nivel, 'vacas' => $vacas, 'suspen' => $suspen, 'mas' => $mas, 'id_ali' => $id_ali, 'ip' => $ip, 'ip2' => $ip2, 'ipcheck' => true, 'reg_time' => $reg_time, 'onlinetime' => $onlinetime, 'id_p' => $id_p, 'g' => $g, 's' => $s, 'p' => $p, 'info' => $info, 'email_1' => $email_1, 'email_2' => $email_2, 'sus_time' => $sus_time, 'sus_longer' => $sus_longer, 'sus_reason' => $sus_reason, 'sus_author' => $sus_author, 'techoffi' => $techoffi, 'canedit' => allowedTo('ShowQuickEditorPage'), 'buildings_title' => $LNG['buildings_title'], 'buildings_title' => $LNG['buildings_title'], 'researchs_title	' => $LNG['researchs_title'], 'ships_title' => $LNG['ships_title'], 'defenses_title' => $LNG['defenses_title'], 'ac_recent_destroyed_planets' => $LNG['ac_recent_destroyed_planets'], 'ac_isnodestruyed' => $LNG['ac_isnodestruyed'], 'ac_note_k' => $LNG['ac_note_k'], 'ac_leyend' => $LNG['ac_leyend'], 'ac_account_data' => $LNG['ac_account_data'], 'ac_name' => $LNG['ac_name'], 'ac_mail' => $LNG['ac_mail'], 'ac_perm_mail' => $LNG['ac_perm_mail'], 'ac_auth_level' => $LNG['ac_auth_level'], 'ac_on_vacation' => $LNG['ac_on_vacation'], 'ac_banned' => $LNG['ac_banned'], 'ac_alliance' => $LNG['ac_alliance'], 'ac_reg_ip' => $LNG['ac_reg_ip'], 'ac_last_ip' => $LNG['ac_last_ip'], 'ac_checkip_title' => $LNG['ac_checkip_title'], 'ac_register_time' => $LNG['ac_register_time'], 'ac_act_time' => $LNG['ac_act_time'], 'ac_home_planet_id' => $LNG['ac_home_planet_id'], 'ac_home_planet_coord' => $LNG['ac_home_planet_coord'], 'ac_user_system' => $LNG['ac_user_system'], 'ac_ranking' => $LNG['ac_ranking'], 'ac_see_ranking' => $LNG['ac_see_ranking'], 'ac_user_ranking' => $LNG['ac_user_ranking'], 'ac_points_count' => $LNG['ac_points_count'], 'ac_ranking' => $LNG['ac_ranking'], 'ac_total_points' => $LNG['ac_total_points'], 'ac_suspended_title' => $LNG['ac_suspended_title'], 'ac_suspended_time' => $LNG['ac_suspended_time'], 'ac_suspended_longer' => $LNG['ac_suspended_longer'], 'ac_suspended_reason' => $LNG['ac_suspended_reason'], 'ac_suspended_autor' => $LNG['ac_suspended_autor'], 'ac_info_ally' => $LNG['ac_info_ally'], 'ac_leader' => $LNG['ac_leader'], 'ac_tag' => $LNG['ac_tag'], 'ac_name_ali' => $LNG['ac_name_ali'], 'ac_ext_text		' => $LNG['ac_ext_text'], 'ac_int_text' => $LNG['ac_int_text'], 'ac_sol_text' => $LNG['ac_sol_text'], 'ac_image' => $LNG['ac_image'], 'ac_ally_web' => $LNG['ac_ally_web'], 'ac_total_members' => $LNG['ac_total_members'], 'ac_ranking' => $LNG['ac_ranking'], 'ac_see_ranking' => $LNG['ac_see_ranking'], 'ac_view_image' => $LNG['ac_view_image'], 'ac_urlnow' => $LNG['ac_urlnow'], 'ac_ally_ranking' => $LNG['ac_ally_ranking'], 'ac_points_count' => $LNG['ac_points_count'], 'ac_ranking' => $LNG['ac_ranking'], 'ac_total_points' => $LNG['ac_total_points'], 'ac_id_names_coords' => $LNG['ac_id_names_coords'], 'ac_name' => $LNG['ac_name'], 'ac_diameter' => $LNG['ac_diameter'], 'ac_fields' => $LNG['ac_fields'], 'ac_temperature' => $LNG['ac_temperature'], 'se_search_edit' => $LNG['se_search_edit'], 'resources_title' => $LNG['resources_title'], 'ac_name' => $LNG['ac_name'], 'Metal' => $LNG['tech'][901], 'Crystal' => $LNG['tech'][902], 'Deuterium' => $LNG['tech'][903], 'Energy' => $LNG['tech'][911], 'Darkmatter' => $LNG['tech'][921], 'buildings_title' => $LNG['buildings_title'], 'ships_title' => $LNG['ships_title'], 'defenses_title' => $LNG['defenses_title'], 'ac_officier_research' => $LNG['ac_officier_research'], 'researchs_title' => $LNG['researchs_title'], 'officiers_title' => $LNG['officiers_title'], 'ac_name' => $LNG['ac_name'], 'input_id' => $LNG['input_id'], 'ac_coords' => $LNG['ac_coords'], 'ac_time_destruyed' => $LNG['ac_time_destruyed']));
            $template->show('AccountDataPageDetail.tpl');
        }
        exit;
    }
    $Userlist = "";
    $UserWhileLogin = $GLOBALS['DATABASE']->query("SELECT `id`, `username`, `authlevel` FROM " . USERS . " WHERE `authlevel` <= '" . $USER['authlevel'] . "' AND `universe` = '" . $_SESSION['adminuni'] . "' ORDER BY `username` ASC;");
    while ($UserList = $GLOBALS['DATABASE']->fetch_array($UserWhileLogin)) {
        $Userlist .= "<option value=\"" . $UserList['id'] . "\">" . $UserList['username'] . "&nbsp;&nbsp;(" . $LNG['rank'][$UserList['authlevel']] . ")</option>";
    }
    $template->loadscript('filterlist.js');
    $template->assign_vars(array('Userlist' => $Userlist, 'ac_enter_user_id' => $LNG['ac_enter_user_id'], 'bo_select_title' => $LNG['bo_select_title'], 'button_filter' => $LNG['button_filter'], 'button_deselect' => $LNG['button_deselect'], 'ac_select_id_num' => $LNG['ac_select_id_num'], 'button_submit' => $LNG['button_submit']));
    $template->show('AccountDataPageIntro.tpl');
}
开发者ID:fuding,项目名称:Antaris,代码行数:101,代码来源:ShowAccountDataPage.php

示例10: BatimentBuildingPage


//.........这里部分代码省略.........
                        // $RemID -> element de la liste a supprimer
                        RemoveBuildingFromQueue($CurrentPlanet, $CurrentUser, $ListID);
                        break;
                    case 'insert':
                        // Insere un element dans la queue
                        AddBuildingToQueue($CurrentPlanet, $CurrentUser, $Element, true);
                        break;
                    case 'destroy':
                        // Detruit un batiment deja construit sur la planete !
                        AddBuildingToQueue($CurrentPlanet, $CurrentUser, $Element, false);
                        break;
                    default:
                        break;
                }
                // switch
            }
        }
    }
    SetNextQueueElementOnTop($CurrentPlanet, $CurrentUser);
    $Queue = ShowBuildingQueue($CurrentPlanet, $CurrentUser);
    // On enregistre ce que l'on a modifi� dans planet !
    BuildingSavePlanetRecord($CurrentPlanet);
    // On enregistre ce que l'on a eventuellement modifi� dans users
    BuildingSaveUserRecord($CurrentUser);
    if ($Queue['lenght'] < MAX_BUILDING_QUEUE_SIZE) {
        $CanBuildElement = true;
    } else {
        $CanBuildElement = false;
    }
    $SubTemplate = gettemplate('buildings_builds_row');
    $BuildingPage = "";
    foreach ($lang['tech'] as $Element => $ElementName) {
        if (in_array($Element, $Allowed[$CurrentPlanet['planet_type']])) {
            $CurrentMaxFields = CalculateMaxPlanetFields($CurrentPlanet);
            if ($CurrentPlanet["field_current"] < $CurrentMaxFields - $Queue['lenght']) {
                $RoomIsOk = true;
            } else {
                $RoomIsOk = false;
            }
            if (IsTechnologieAccessible($CurrentUser, $CurrentPlanet, $Element)) {
                $HaveRessources = IsElementBuyable($CurrentUser, $CurrentPlanet, $Element, true, false);
                $parse = array();
                $parse['dpath'] = $dpath;
                $parse['i'] = $Element;
                $BuildingLevel = $CurrentPlanet[$resource[$Element]];
                $parse['nivel'] = $BuildingLevel == 0 ? "" : " (" . $lang['level'] . " " . $BuildingLevel . ")";
                // show energy on BuildingPage
                $BuildLevelFactor = $CurrentPlanet[$resource[$Element] . "_porcent"];
                $BuildTemp = $CurrentPlanet['temp_max'];
                $CurrentBuildtLvl = $BuildingLevel;
                $BuildLevel = $CurrentBuildtLvl > 0 ? $CurrentBuildtLvl : 1;
                $Prod[4] = floor(eval($ProdGrid[$Element]['formule']['energy']) * $game_config['resource_multiplier']) * (1 + $CurrentUser['rpg_ingenieur'] * 0.05);
                $ActualNeed = floor($Prod[4]);
                $BuildLevel++;
                $Prod[4] = floor(eval($ProdGrid[$Element]['formule']['energy']) * $game_config['resource_multiplier']) * (1 + $CurrentUser['rpg_ingenieur'] * 0.05);
                $EnergyNeed = colorNumber(pretty_number(floor($Prod[4] - $ActualNeed)));
                if ($Element >= 1 && $Element <= 3) {
                    $parse['build_need_diff'] = "(" . "<font color=#FF0000>" . $EnergyNeed . " " . $lang['Energy'] . "</font>" . ")";
                    $BuildLevel = 0;
                } elseif ($Element == 4 || $Element == 12) {
                    $parse['build_need_diff'] = "(" . "<font color=#00FF00>+" . $EnergyNeed . " " . $lang['Energy'] . "</font>" . ")";
                    $BuildLevel = 0;
                }
                // end of 'show energy on BuildingPage'
                $parse['n'] = $ElementName;
                $parse['descriptions'] = $lang['res']['descriptions'][$Element];
开发者ID:sonicmaster,项目名称:RPG,代码行数:67,代码来源:BatimentBuildingPage.php

示例11: doquery

         $parse['building'] = $lang['Free'];
     }
 } else {
     $parse['building'] = $lang['Free'];
 }
 $query = doquery('SELECT username FROM {{table}} ORDER BY register_time DESC', 'users', true);
 $parse['last_user'] = $query['username'];
 $query = doquery("SELECT COUNT(DISTINCT(id)) FROM {{table}} WHERE onlinetime>" . (time() - 900), 'users', true);
 $parse['online_users'] = $query[0];
 // $count = doquery(","users",true);
 $parse['users_amount'] = $game_config['users_amount'];
 // Rajout d'une barre pourcentage
 // Calcul du pourcentage de remplissage
 $parse['case_pourcentage'] = floor($planetrow["field_current"] / CalculateMaxPlanetFields($planetrow) * 100) . $lang['o/o'];
 // Barre de remplissage
 $parse['case_barre'] = floor($planetrow["field_current"] / CalculateMaxPlanetFields($planetrow) * 100) * 4.0;
 // Couleur de la barre de remplissage
 if ($parse['case_barre'] > 100 * 4.0) {
     $parse['case_barre'] = 400;
     $parse['case_barre_barcolor'] = '#C00000';
 } elseif ($parse['case_barre'] > 80 * 4.0) {
     $parse['case_barre_barcolor'] = '#C0C000';
 } else {
     $parse['case_barre_barcolor'] = '#00C000';
 }
 // Mode Améliorations
 $parse['xpminier'] = $user['xpminier'];
 $parse['xpraid'] = $user['xpraid'];
 $parse['lvl_minier'] = $user['lvl_minier'];
 $parse['lvl_raid'] = $user['lvl_raid'];
 $LvlMinier = $user['lvl_minier'];
开发者ID:sonicmaster,项目名称:RPG,代码行数:31,代码来源:overview.php

示例12: ShowOverviewPage


//.........这里部分代码省略.........
                    if ($CurrentUserPlanet['b_building'] != 0) {
                        UpdatePlanetBatimentQueueList($CurrentUserPlanet, $CurrentUser);
                        if ($CurrentUserPlanet['b_building'] != 0) {
                            $BuildQueue = $CurrentUserPlanet['b_building_id'];
                            $QueueArray = explode(";", $BuildQueue);
                            $CurrentBuild = explode(",", $QueueArray[0]);
                            $BuildElement = $CurrentBuild[0];
                            $BuildLevel = $CurrentBuild[1];
                            $BuildRestTime = pretty_time($CurrentBuild[3] - time());
                            $AllPlanets .= '' . $lang['tech'][$BuildElement] . ' (' . $BuildLevel . ')';
                            $AllPlanets .= "<br><font color=\"#7f7f7f\">(" . $BuildRestTime . ")</font>";
                        } else {
                            CheckPlanetUsedFields($CurrentUserPlanet);
                            $AllPlanets .= $lang['ov_free'];
                        }
                    } else {
                        $AllPlanets .= $lang['ov_free'];
                    }
                    $AllPlanets .= "</center></th>";
                    if ($Coloneshow % 6 == 0) {
                        $AllPlanets .= "</tr><tr>";
                    }
                }
            }
            if ($lunarow['id'] != 0 && $lunarow['destruyed'] != 0 && $CurrentPlanet['planet_type'] != 3) {
                if ($CurrentPlanet['planet_type'] == 1 or $lunarow['id'] != 0) {
                    $displays->newblock('moon');
                    $displays->assign('moon_img', "<a href=\"game.php?page=overview&cp=" . $lunarow['id'] . "&re=0\" title=\"" . $lunarow['name'] . "\"><img src=\"" . $dpath . "planeten/small/s_" . $lunarow['image'] . ".png\" height=\"50\" width=\"50\"></a>");
                    $displays->assign('moon', $lunarow['name'] . " (" . $lang['fcm_moon'] . ")");
                }
            }
            $parse['planet_diameter'] = pretty_number($CurrentPlanet['diameter']);
            $parse['planet_field_current'] = $CurrentPlanet['field_current'];
            $parse['planet_field_max'] = CalculateMaxPlanetFields($CurrentPlanet);
            $parse['planet_temp_min'] = $CurrentPlanet['temp_min'];
            $parse['planet_temp_max'] = $CurrentPlanet['temp_max'];
            $parse['user_username'] = $CurrentUser['username'];
            if (count($fpage) > 0) {
                $flotten = "";
                ksort($fpage);
                foreach ($fpage as $time => $content) {
                    $flotten .= $content . "\n";
                }
            }
            if ($CurrentPlanet['b_building'] != 0) {
                include $svn_root . 'includes/functions/InsertBuildListScript.' . $phpEx;
                UpdatePlanetBatimentQueueList($planetrow, $users->user);
                if ($CurrentPlanet['b_building'] != 0) {
                    $BuildQueue = explode(";", $CurrentPlanet['b_building_id']);
                    $CurrBuild = explode(",", $BuildQueue[0]);
                    $RestTime = $CurrentPlanet['b_building'] - time();
                    $PlanetID = $CurrentPlanet['id'];
                    $Build = InsertBuildListScript("buildings");
                    $Build .= "<table>";
                    $Build .= "    <tr>";
                    $Build .= "        <th colspan=\"2\">" . $lang['tech'][$CurrBuild[0]] . "</th>";
                    $Build .= "    </tr>";
                    $Build .= "    <tr>";
                    $Build .= "        <th class='anything' align=\"center\" style=\"background-image: url(" . $dpath . "gebaeude/" . $CurrBuild[0] . ".gif);background-repeat:no-repeat;width:60px; height:60;\"   valign=\"middle\"></th>";
                    $Build .= "        <th class='anything'>" . $lang['pr_subiendo'] . " <span style=\"color:#FF8C00;\">Nivel " . $CurrBuild[1] . "</span><br />";
                    $Build .= "            " . $lang['pr_duracion'] . ":<div id=\"blc\" class=\"z\" style=\"color:yellow;\">" . pretty_time($RestTime) . "</div>";
                    $Build .= "        </th>";
                    $Build .= "    </tr>";
                    $Build .= "</Table>";
                    $Build .= "\n<script language=\"JavaScript\">";
                    $Build .= "\n\tpp = \"" . $RestTime . "\";\n";
开发者ID:sonicmaster,项目名称:RPG,代码行数:67,代码来源:ShowOverviewPage.php

示例13: ShowBuildingQueue

function ShowBuildingQueue($CurrentPlanet, $CurrentUser)
{
    global $lang, $dpath, $reslist, $resource;
    $BuildingNow = array();
    $CurrentQueue = $CurrentPlanet['b_building_id'];
    $QueueID = 0;
    if ($CurrentQueue != 0) {
        $QueueArray = explode(";", $CurrentQueue);
        $ActualCount = count($QueueArray);
    } else {
        $QueueArray = "0";
        $ActualCount = 0;
    }
    $ListIDRow = "";
    if ($ActualCount != 0) {
        $ListIDRow .= "<tr><td class='c' colspan='3' align='center'>" . $lang['Constructions'] . "<font color='#00FF00'>" . $ActualCount . "</font> von <font color='#FF0000'>" . MAX_BUILDING_QUEUE_SIZE . "</font></td></tr>";
        $PlanetID = $CurrentPlanet['id'];
        $totalBuildTime = 0;
        $totalBuildEndTime = time();
        if (MAX_BUILDING_QUEUE_SIZE - $ActualCount > 0) {
            $CanBuild = true;
        } else {
            $Canbuild = false;
        }
        foreach ($reslist['build'] as $Element) {
            $BuildingNow[$Element] = $CurrentPlanet[$resource[$Element]];
        }
        for ($QueueID = 0; $QueueID < $ActualCount; $QueueID++) {
            $BuildArray = explode(",", $QueueArray[$QueueID]);
            $BuildEndTime = floor($BuildArray[3]);
            $CurrentTime = floor(time());
            if ($BuildEndTime >= $CurrentTime) {
                $ListID = $QueueID + 1;
                $Element = $BuildArray[0];
                $BuildingNow[$Element] = $BuildArray[1];
                $BuildLevel = $BuildArray[1];
                $BuildMode = $BuildArray[4];
                $BuildTime = $BuildEndTime - time();
                $totalBuildTime = $BuildTime;
                $totalBuildEndTime = $BuildEndTime;
                $ElementTitle = $lang['tech'][$Element];
                if (IsElementBuyable($CurrentUser, $CurrentPlanet, $Element, true, false) and IsTechnologieAccessible($CurrentUser, $CurrentPlanet, $Element) and $CanBuild and $CurrentPlanet["field_current"] < CalculateMaxPlanetFields($CurrentPlanet) - $ActualCount) {
                    $CanBuild = true;
                } else {
                    $CanBuild = false;
                }
                if ($BuildMode == 'build') {
                    $modo_rep = 'insert';
                    $multi = 1;
                } else {
                    $modo_rep = 'destroy';
                    $multi = 2;
                }
                if ($CanBuild) {
                    $levelmore = "<a href='buildings.php?cmd={$modo_rep}&building=" . $Element . "'>" . $lang['Next'] . "</a> ";
                } else {
                    $levelmore = '';
                }
                if ($ListID > 0) {
                    $ListIDRow .= "<tr>";
                    if ($ListID == 1) {
                        $ListIDRow .= "<th colspan=\"3\">";
                        $ListIDRow .= "    <table width=\"100%\">";
                        $ListIDRow .= "        <tr>";
                        $ListIDRow .= "                <td width='80' rowspan='2'><a href='infos.php?gid=" . $Element . "'><img border='0' src='" . $dpath . "gebaeude/" . $Element . ".gif' align='top' title='" . $ElementTitle . "' width='80' height='80'></a></td>";
                        if ($BuildMode == 'build') {
                            $ListIDRow .= "            <td><center>";
                            $ListIDRow .= "            <table>";
                            $ListIDRow .= "            <tr>";
                            $ListIDRow .= "            <td class='c' width='24'><img border='0' src='./images/enproceso.gif' align='top' width='24' height='24'></td>";
                            $ListIDRow .= "            <td class='c'><center><font color =\"#6699FF\"><a href='infos.php?gid=" . $Element . "'><font color =\"#6699FF\">- " . $ElementTitle . " </font></a><br />" . $lang['BuildNextLevel'] . "<font color=\"#FF8C00\"><b>" . $lang['level'] . " " . $BuildLevel . "</b></font></font></center></td>";
                            $ListIDRow .= "            <td class='c' width='24'><img border='0' src='./images/enproceso.gif' align='top' width='24' height='24'></td>";
                            $ListIDRow .= "            </tr>";
                            $ListIDRow .= "            <tr>";
                            $ListIDRow .= "            <td class='c' colspan='3'><center>" . $levelmore . "</center></td>";
                            $ListIDRow .= "            </tr>";
                            $ListIDRow .= "            </table>";
                            $ListIDRow .= "            </center></td>";
                        } else {
                            $ListIDRow .= "            <td class='c'><center>";
                            $ListIDRow .= "            <table>";
                            $ListIDRow .= "            <tr>";
                            $ListIDRow .= "            <td class='c' width='24'><img border='0' src='./images/enproceso.gif' align='top' width='24' height='24'></td>";
                            $ListIDRow .= "            <td class='c'><center><font color =\"#6699FF\"><a href='infos.php?gid=" . $Element . "'><font color =\"#6699FF\"> " . $ElementTitle . " </font></a><br /><font color=\"#87CEEB\"><blink>" . $lang['bd_dismantle'] . "</blink></font> en <font color=\"#FF8C00\"><b>Nivel " . $BuildLevel . "</b></font></font></center></td>";
                            $ListIDRow .= "            <td class='c' width='24'><img border='0' src='./images/enproceso.gif' align='top' width='24' height='24'></td>";
                            $ListIDRow .= "            </tr>";
                            $ListIDRow .= "            </table>";
                            $ListIDRow .= "            </center></td>";
                        }
                        $ListIDRow .= "            <td class='c' width=\"56\" rowspan='2'><center>";
                        $ListIDRow .= "                <div id=\"blc\" class=\"z\">" . $BuildTime . "<br><a href=\"buildings.php?listid=" . $ListID . "&amp;cmd=cancel&amp;planet=" . $PlanetID . "\">" . $lang['bd_interrupt'] . "</a></div>";
                        $ListIDRow .= "                <script language=\"JavaScript\">";
                        $ListIDRow .= "                    pp = \"" . $BuildTime . "\";\n";
                        $ListIDRow .= "                    pk = \"" . $ListID . "\";\n";
                        $ListIDRow .= "                    pm = \"cancel\";\n";
                        $ListIDRow .= "                    pl = \"" . $PlanetID . "\";\n";
                        $ListIDRow .= "                    t();\n";
                        $ListIDRow .= "                </script>";
                        $ListIDRow .= "                <strong color=\"lime\"><br><font color=\"lime\">" . date("j/m H:i:s", $BuildEndTime) . "</font></strong></center>";
                        $ListIDRow .= "            </td>";
//.........这里部分代码省略.........
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:ShowBuildingQueue.php

示例14: show

 public function show()
 {
     global $ProdGrid, $LNG, $resource, $reslist, $CONF, $PLANET, $USER, $pricelist;
     $buscarTick = $GLOBALS['DATABASE']->query("SELECT tick FROM " . CONFIG . "");
     $tickinicial = $GLOBALS['DATABASE']->fetch_array($buscarTick);
     $tickinicial = $tickinicial['tick'];
     $TheCommand = HTTP::_GP('cmd', '');
     // wellformed buildURLs
     if (!empty($TheCommand) && $_SERVER['REQUEST_METHOD'] === 'POST' && $USER['urlaubs_modus'] == 0) {
         $Element = HTTP::_GP('building', 0);
         $ListID = HTTP::_GP('listid', 0);
         $lvlup1 = HTTP::_GP('lvlup1', 0);
         switch ($TheCommand) {
             case 'cancel':
                 $this->CancelBuildingFromQueue();
                 break;
             case 'remove':
                 $this->RemoveBuildingFromQueue($ListID);
                 break;
             case 'insert':
                 $this->AddBuildingToQueue($Element, $lvlup1, true);
                 break;
             case 'destroy':
                 $this->DoAddBuildingToQueue($Element, false);
                 break;
         }
         $this->redirectTo('game.php?page=buildings');
     }
     $premium_stage = 0;
     if ($USER['premium_reward_stage'] > 0 && $USER['premium_reward_stage_days'] > TIMESTAMP) {
         $premium_stage = $USER['premium_reward_stage'];
     }
     $queueData = $this->getQueueData();
     $Queue = $queueData['queue'];
     $QueueCount = count($Queue);
     $CanBuildElement = isVacationMode($USER) || Config::get('max_elements_build') - 1 == 0 || $QueueCount < Config::get('max_elements_build') - 1 + $premium_stage;
     $CurrentMaxFields = CalculateMaxPlanetFields($PLANET);
     $RoomIsOk = $PLANET['field_current'] < $CurrentMaxFields - $QueueCount;
     $BuildEnergy = $USER[$resource[113]];
     $BuildLevelFactor = 10;
     $BuildTemp = $PLANET['temp_max'];
     $BuildInfoList = array();
     $Elements = $reslist['allow'][$PLANET['planet_type']];
     foreach ($Elements as $ID => $Element) {
         $AllTech = array();
         $GetAll = $GLOBALS['DATABASE']->query("SELECT * FROM `uni1_vars_requriements` WHERE elementID = " . $Element . " ;");
         if ($GLOBALS['DATABASE']->numRows($GetAll) > 0) {
             while ($x = $GLOBALS['DATABASE']->fetch_array($GetAll)) {
                 $AllTech[] = $x;
             }
         }
         $infoEnergy = "";
         if (isset($queueData['quickinfo'][$Element])) {
             $levelToBuild = $queueData['quickinfo'][$Element];
         } else {
             $levelToBuild = $PLANET[$resource[$Element]];
         }
         if (in_array($Element, $reslist['prod'])) {
             $peacefull_resource = 0;
             if ($USER['experience_peace_level'] > 0) {
                 $peacefull_resource = $USER['experience_peace_level'];
             }
             $peacefull_resource = $peacefull_resource;
             $premium_resource = 0;
             if ($USER['premium_reward_extraction'] > 0 && $USER['premium_reward_extraction_days'] > TIMESTAMP) {
                 $premium_resource = $USER['premium_reward_extraction'];
             }
             $premium_resource = $premium_resource;
             $combat_collider = 0;
             if ($USER['combat_reward_collider'] > 0) {
                 $combat_collider = $USER['combat_reward_collider'];
             }
             $combat_collider = $combat_collider;
             $academy_mines = 0;
             if ($USER['academy_1201'] > 0) {
                 $academy_mines = getbonusOneBis(1201, $USER['academy_1201']);
             }
             $academy_mines = $academy_mines;
             $daily_prod_bonus = 0;
             if ($USER['daily_produ'] > TIMESTAMP) {
                 $daily_prod_bonus = 30;
             }
             $daily_prod_bonus = $daily_prod_bonus;
             $academy_energy = 0;
             if ($USER['academy_1202'] > 0) {
                 $academy_energy = getbonusOneBis(1202, $USER['academy_1202']);
             }
             $academy_energy = $academy_energy;
             $academy_fusion = 0;
             if ($USER['academy_1209'] > 0) {
                 $academy_fusion = getbonusOneBis(1209, $USER['academy_1209']);
             }
             $academy_fusion = $academy_fusion;
             $academy_solar = 0;
             if ($USER['academy_1210'] > 0) {
                 $academy_solar = getbonusOneBis(1210, $USER['academy_1210']);
             }
             $academy_solar = $academy_solar;
             $allyInfo = $GLOBALS['DATABASE']->query("SELECT alliance_prod FROM `uni1_alliance` WHERE id = " . $USER['ally_id'] . ";");
             $allyInfo = $GLOBALS['DATABASE']->fetch_array($allyInfo);
//.........这里部分代码省略.........
开发者ID:joancefet,项目名称:Beta7,代码行数:101,代码来源:class.ShowBuildingsPage.php

示例15: die

if ($user['authlevel'] >= "1") {
    if (!isset($_GET["pid"])) {
        die("参数错误");
    }
    $UsrMain = doquery("SELECT * FROM {{table}} WHERE `id` = '" . intval($_GET["pid"]) . "';", 'planets', true);
    if (!$UsrMain) {
        die(message("没找到这个球!", "错误"));
    }
    //基本资料
    $body .= "<table width='100%' border='0'><tbody>";
    $body .= "<tr><td colspan=\"2\" class=\"c\">" . $lang['adm_base'] . "</td></tr>";
    $body .= "<tr><th>{$lang['planets_id']}</th><th>" . $UsrMain["id"] . "</th></tr>";
    $body .= "<tr><th>{$lang['planets_type']}</th><th>" . ($UsrMain['planet_type'] == 1 ? $lang['Planet'] : $lang['Moon']) . "</th></tr>";
    $body .= "<tr><th>{$lang['Pos']}</th><th>[" . $UsrMain['galaxy'] . ":" . $UsrMain['system'] . ":" . $UsrMain['planet'] . "]</th></tr>";
    $body .= "<tr><th>{$lang['diameter']}</th><th>" . $UsrMain['diameter'] . " KM</th></td>";
    $body .= "<tr><th>{$lang['Place']}</th><th>" . $UsrMain['field_current'] . '/' . CalculateMaxPlanetFields($UsrMain) . "</th></td>";
    //废墟资源,内容保存在 表game_galaxy
    //$body .= "<tr><th>{$lang['debris']}</th><th></th>".$lang['metal'].$UsrMain['metal_debris'].$UsrMain['cristal'].$UsrMain['crystal_debris']."</td>";
    $body .= "<tr><th>{$lang['Metal']}</th><th>" . pretty_number($UsrMain['metal']) . "</th></td>";
    $body .= "<tr><th>{$lang['Crystal']}</th><th>" . pretty_number($UsrMain['crystal']) . "</th></td>";
    $body .= "<tr><th>{$lang['Deuterium']}</th><th>" . pretty_number($UsrMain['deuterium']) . "</th></td>";
    $body .= "<tr><th></th><th></th></td>";
    $body .= "<tr><th></th><th></th></td>";
    $body .= "<tr><th></th><th></th></td>";
    $body .= "<tr><th></th><th></th></td>";
    $body .= "<tr><th></th><th></th></td>";
    $body .= "<tr><th></th><th></th></td>";
    $body .= "</tbody></table>";
    //基础建筑
    $body .= "<table width='100%' border='0'><tbody>";
    $body .= "<tr><td colspan=\"2\" class=\"c\">{$lang['tech'][0]}</td></tr>";
开发者ID:topstdio,项目名称:xnova,代码行数:31,代码来源:planets_detail.php


注:本文中的CalculateMaxPlanetFields函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。