public function calculB() { extract($_GET); $building = new building(); $array = array(); for ($i = 1; $i <= $level_max; $i++) { $time = $building->constructionTime($factor_time, $i, 0); $ressources_bases = array('metaux' => $metaux_base, 'cristaux' => $cristaux_base, 'population' => $population_base, 'tetranium' => $tetranium_base); $energie = $energie_base; for ($j = 1; $j < $i; $j++) { $energie += $energie * (ENERGIE_FACTOR / 100); } $r = $building->constructionRessources($ressources_bases, $cost_augmentation, $i, 1); $array[] = array('level' => $i, 'time' => $time, 'metaux' => round($r['metaux']), 'cristaux' => round($r['cristaux']), 'tetranium' => round($r['tetranium']), 'energie' => round($energie), 'population' => round($r['population'])); } $this->template->array = $array; $this->template->setView("script_simulateur_batiment_content"); }
<?php if (session_status() == PHP_SESSION_NONE) { session_start(); } /** MySQL database password */ define('DB_PASS', '2sJrDmQnhahzSCjM'); include_once 'functions.php'; if (isset($_SESSION["APP"]["room"])) { $room = new room($_SESSION["APP"]["room"]); $building = new building($room->getBuildingID()); $_SESSION["APP"]["building"] = $building->getID(); $_SESSION["APP"]["campus"] = $building->getCampusID(); }
public function getBuildings() { return $this->hasMany(building::className(), ['department_id' => 'id']); }
public function getBuilding() { return $this->hasOne(building::className(), ['id' => 'building_id'])->via('room'); }