コード例 #1
0
ファイル: implement.Topnav.php プロジェクト: Nykus/xnova
 public function __construct($id_planet, $id_user)
 {
     $planet = new Planet($id_planet, $id_user);
     $lng = new Lang();
     $metal = $planet->ProdResources()['metal'] == 0 ? '<span style=\'color: red;\'>' . number_format($planet->PlanetMetal(), '0', ',', '.') . '</span>' : number_format($planet->PlanetMetal(), '0', ',', '.');
     $cristal = $planet->ProdResources()['cristal'] == 0 ? '<span style=\'color: red;\'>' . number_format($planet->PlanetCristal(), '0', ',', '.') . '</span>' : number_format($planet->PlanetCristal(), '0', ',', '.');
     $tritio = $planet->ProdResources()['tritio'] == 0 ? '<span style=\'color: red;\'>' . number_format($planet->PlanetTritio(), '0', ',', '.') . '</span>' : number_format($planet->PlanetTritio(), '0', ',', '.');
     $energia_sobrante = $planet->EnergiaSobrante() < 0 ? '<span style=\'color: red;\'>' . number_format($planet->EnergiaSobrante(), '0', ',', '.') . '</span>' : number_format($planet->EnergiaSobrante(), '0', ',', '.');
     $template = new Smarty();
     $template->assign(array('m_general' => $lng->m_general, 'm_abastecimiento' => $lng->m_abastecimiento, 'm_infraestructura' => $lng->m_infraestructura, 'm_comerciante' => $lng->m_comerciante, 'm_tecnologia' => $lng->m_tecnologia, 'm_hangar' => $lng->m_hangar, 'm_defensas' => $lng->m_defensas, 'x_metal' => $lng->x_metal, 'metal' => $metal, 'x_cristal' => $lng->x_cristal, 'cristal' => $cristal, 'x_tritio' => $lng->x_tritio, 'tritio' => $tritio, 'x_energia' => $lng->x_energia, 'energia_total' => number_format($planet->EnergiaTotal(), '0', ',', '.'), 'energia_consumo' => number_format($planet->EnergiaConsumo(), '0', ',', '.'), 'energia_sobrante' => $energia_sobrante, 'x_materia' => $lng->x_materia, 'x_mo' => $lng->x_mo, 'materia' => number_format($planet->PlanetDarkMatter(), '0', ',', '.'), 'p' => $planet->PlanetOrbit(), 's' => $planet->PlanetSystem(), 'nombre_planeta' => $planet->PlanetName(), 'imagen_planeta' => $planet->PlanetImage(), 'x_actual' => $lng->x_actual, 'x_capacidad' => $lng->x_capacidad, 'x_produccion' => $lng->x_produccion, 'x_consumo' => $lng->x_consumo, 'almacen_cristal' => number_format($planet->AlmacenCristal(), 0, ',', '.'), 'almacen_metal' => number_format($planet->AlmacenMetal(), 0, ',', '.'), 'almacen_tritio' => number_format($planet->AlmacenTritio(), 0, ',', '.'), 'almacen_materia' => $lng->x_infinito));
     $template->display('overall/topnav.xnv');
 }
コード例 #2
0
ファイル: overviewController.php プロジェクト: Nykus/xnova
 private function __construct()
 {
     require 'core/models/class.User.php';
     require 'core/models/implement.Menu.php';
     require 'core/models/class.Planet.php';
     require 'core/models/implement.Topnav.php';
     global $id_user, $id_planet;
     $lng = new Lang();
     $menu = new Menu($id_user);
     $topnav = new Topnav($id_planet, $id_user);
     $user = new User($id_user);
     $planet = new Planet($id_planet);
     require 'core/functions/class.UpdateStats.php';
     $update = new UpdateStats();
     $db = new Connect();
     $sql = $db->query("SELECT COUNT(*) id FROM usuarios;");
     $total_rank = $db->recorrer($sql);
     $db->liberar($sql);
     $db->close();
     $template = new Smarty();
     $template->assign(array('usuario_email' => $user->UserEmail(), 'usuario_faccion' => $user->UserFaction(), 'usuario_puntos' => $user->UserPoints(), 'usuario_top' => $user->TopUser(), 'total_rank' => number_format($total_rank[0], '0', ',', '.'), 'campos' => $planet->PlanetFields(), 'diametro' => $planet->PlanetDiameter(), 'temperatura' => $planet->PlanetTemperature(), 'p' => $planet->PlanetOrbit(), 's' => $planet->PlanetSystem(), 'nombre_planeta' => $planet->PlanetName(), 'imagen_planeta' => $planet->PlanetImage()));
     $template->display('overview/overview.xnv');
 }