Id = $Id; $DbResult = $this->Database->query('SELECT * FROM Logon WHERE Id='.$Id.' AND Enabled=1' ); if($DbResult->num_rows == 1) { $this->Data = $DbResult->fetch_assoc(); $this->ServerDatabase = new Database(); $this->ServerDatabase->Connect($this->Data['DatabaseHost'], $this->Data['DatabaseUser'], $this->Data['DatabasePassword'], $this->Data['DatabaseRealmd']); $this->ServerDatabase->select_db($this->Data['DatabaseRealmd']); //if($this->ServerDatabase->connect_error) //{ // die('Přihlášení k databázi serveru '.$this->Id.' selhalo: '.$this->ServerDatabase->connect_error); //} $this->ServerDatabase->charset($this->Config['Database']['Charset']); } else throw new Exception('Záznam pro přihlašovací server id '.$Id.' nenalezen!'); } function HumanDate($date, $time = 1) { // input date is 0000-00-00 00:00:00 $date_arr = explode(' ', $date); $date = explode('-', $date_arr[0]); if(count($date_arr) > 1) $time_stp = explode(':', $date_arr[1]); else $time_stp = array(0, 0, 0); $time = mktime($time_stp[0], $time_stp[1], $time_stp[2], $date[1], $date[2], $date[0]); if($time == 1) $human_date = date('d.m.Y H:i:s', $time); else $human_date = date('d.m.Y', $time); return($human_date); } function ParseCopper($copper_in) { global $html; $copper = $copper_in; $golds = floor($copper / 10000); $num = $copper - $golds * 10000; $silver = floor($num / 100); $copper = $num - $silver * 100; $show_golds = ''.$golds.' '; $show_silver = ''.$silver.' '; $show_copper = ''.$copper.' '; return($show_golds.' '.$show_silver.' '.$show_copper); } function OnlineCharactersCount() { $TotalCount = 0; $DbResult = $this->Database->query('SELECT Id FROM Realm WHERE Enabled=1'); while($DbRow = $DbResult->fetch_assoc()) { $Realm = new Realm($this->System, $DbRow['Id']); $TotalCount += $Realm->OnlineCharactersCount(); } return($TotalCount); } function OnlineStateImage($Status) { global $html; if($Status) return(' Online'); else return(' Offline'); } function CharacterCount() { $TotalCount = 0; $DbResult = $this->Database->query('SELECT Id FROM Realm WHERE Enabled=1'); while($DbRow = $DbResult->fetch_assoc()) { $Realm = new Realm($this->System, $DbRow['Id']); $TotalCount += $Realm->CharacterCount($DbRow['Id']); } return($TotalCount); } public function AccountCount() { $row = $this->ServerDatabase->query('SELECT COUNT(*) FROM account')->fetch_row(); return($row[0]); } public function MapName($id) { $map_id = Array ( 0 => array(0,"Azeroths"), 1 => array(1,"Kalimdor"), 13 => array(13,"Testing"), 17 => array(17,"Kalidar"), 25 => array(25,"Scott Test"), 30 => array(30,"Alterac Valley"), 33 => array(33,"Shadowfang Keep Instance"), 34 => array(34,"The Stockade Instance"), 35 => array(35,"Stormwind Prison"), 36 => array(36,"Deadmines Instance"), 37 => array(37,"Azshara Crater"), 42 => array(42,"Collins Test"), 43 => array(43,"Wailing Caverns Instance"), 44 => array(44,"Monastery Interior"), 47 => array(47,"Razorfen Kraul Instance"), 48 => array(48,"Blackfathom Deeps Instance"), 70 => array(70,"Uldaman Instance"), 90 => array(90,"Gnomeregan Instance"), 109 => array(109,"Sunken Temple Instance"), 129 => array(129,"Razorfen Downs Instance"), 169 => array(169,"Emerald Forest"), 189 => array(189,"Scarlet Monastery Instance"), 209 => array(209,"Zul Farrak Instance"), 229 => array(229,"Blackrock Spire Instance"), 230 => array(230,"Blackrock Depths Instance"), 249 => array(249,"Onyxias Lair Instance"), 269 => array(269,"Opening of the Dark Portal Instance"), 289 => array(289,"Scholomance Instance"), 309 => array(309,"ZulGurub Instance"), 329 => array(329,"Stratholme Instance"), 349 => array(349,"Maraudon Instance"), 369 => array(369,"Deeprun Tram"), 389 => array(389,"Ragefire Chasm Instance"), 409 => array(409,"The Molten Core Instance"), 429 => array(429,"Dire Maul Instance"), 449 => array(449,"Alliance PvP Barracks"), 450 => array(450,"Horde PvP Barracks"), 451 => array(451,"Development Land"), 469 => array(469,"BlackwingLair Instance"), 489 => array(489,"PvP Warsong Gulch"), 509 => array(509,"Ruins of Ahn Qiraj Instance"), 529 => array(529,"PvP Arathi Basin"), 530 => array(530,"Outland"), 531 => array(531,"Temple of Ahn Qiraj Instance"), 532 => array(532,"Karazhan Instance"), 533 => array(533,"Naxxramas Instance"), 534 => array(534,"The Battle for Mount Hyjal Instance"), 540 => array(540,"Hellfire Citadel The Shattered Halls Instance"), 542 => array(542,"Hellfire Citadel The Blood Furnace Instance"), 543 => array(543,"Hellfire Citadel Ramparts Instance"), 544 => array(544,"Maghtheridons Lair Instance"), 545 => array(545,"Coilfang The Steamvault Instance"), 546 => array(546,"Coilfang The Underbog Instance"), 547 => array(547,"Coilfang The Slave Pens Instance"), 548 => array(548,"Coilfang Serpentshrine Cavern Instance"), 550 => array(550,"Tempest Keep Instance"), 552 => array(552,"Tempest Keep The Alcatraz Instance"), 553 => array(553,"Tempest Keep The Botanica Instance"), 554 => array(554,"Tempest Keep The Mechanar Instance"), 555 => array(555,"Auchindoun Shadow Labyrinth Instance"), 556 => array(556,"Auchindoun Sethekk Halls Instance"), 557 => array(557,"Auchindoun Mana Tombs Instance"), 558 => array(558,"Auchindoun Auchenai Crypts Instance"), 559 => array(559,"Nagrand Arena"), 560 => array(560,"The Escape From Durnholde Instance"), 562 => array(562,"Blades Edge Arena"), 564 => array(564,"Black Temple Instance"), 565 => array(565,"Gruuls Lair Instance"), 566 => array(566,"Netherstorm Arena"), 568 => array(568,"ZulAman Instance"), 571 => array(571,"Northrend"), 572 => array(572,"PvP Ruins of Lordaeron"), 573 => array(573,"ExteriorTest"), 574 => array(574,"Utgarde Keep Instance"), 575 => array(575,"Utgarde Pinnacle Instance"), 576 => array(576,"The Nexus Instance"), 578 => array(578,"The Oculus Instance"), 580 => array(580,"The Sunwell Instance"), 585 => array(585,"Magisters Terrace Instance"), 595 => array(595,"The Culling of Stratholme Instance"), 597 => array(597,"Craig Test"), 599 => array(599,"Halls of Stone Instance"), 600 => array(600,"Drak Tharon Keep Instance"), 601 => array(601,"Azjol-Nerub Instance"), 602 => array(602,"Halls of Lightning Instance"), 603 => array(603,"Ulduar Instance"), 604 => array(604,"Gundrak Instance"), 605 => array(605,"Development Land"), 606 => array(606,"QA and DVD"), 607 => array(607,"PvP Strand of the Ancients"), 608 => array(608,"Violet Hold Instance"), 609 => array(609,"Ebon Hold"), 615 => array(615,"Obsidian Sanctum Instance"), 616 => array(616,"The Eye of Eternity Instance"), 617 => array(617,"PvP Dalaran Sewers"), 618 => array(618,"PvP The Ring of Valor"), 619 => array(619,"Ahn kahet The Old Kingdom Instance"), 624 => array(624,"Vault of Archavon Instance"), 650 => array(650,"Trial of the Champion Instance") ); if(isset($map_id[$id])) return($map_id[$id][1]); else return("Neznámá"); } public function ZoneName($id) { $zone_id = Array ( 1 => Array("Dun Morogh",1), 3 => Array("Badlands",3), 4 => Array("Blasted Lands",4), 8 => Array("Swamp of Sorrows",8), 10 => Array("Duskwood",10), 11 => Array("Wetlands",11), 12 => Array("Elwynn Forest",12), 14 => Array("Durotar",14), 15 => Array("Dustwallow Marsh",15), 16 => Array("Azshara",16), 17 => Array("The Barrens",17), 19 => Array("Zul Gurub",19), 25 => Array("Blackrock Mountain",25), 28 => Array("Western Plaguelands",28), 33 => Array("Stranglethorn Vale",33), 36 => Array("Alterac Mountains",36), 38 => Array("Loch Modan",38), 40 => Array("Westfall",40), 41 => Array("Deadwind Pass",41), 44 => Array("Redridge Mountains",44), 45 => Array("Arathi Highlands",45), 46 => Array("Burning Steppes",46), 47 => Array("The Hinterlands",47), 51 => Array("Searing Gorge",51), 65 => Array("Dragonblight",65), 66 => Array("Zul Drak",66), 67 => Array("The Storm Peaks",67), 85 => Array("Tirisfal Glades",85), 130 => Array("Silverpine Forest",130), 133 => Array("Gnomeregan",133), 139 => Array("Eastern Plaguelands",139), 141 => Array("Teldrassil",141), 148 => Array("Darkshore",148), 206 => Array("Utgarde Keep",206), 209 => Array("Shadowfang Keep",209), 210 => Array("Icecrown",210), 215 => Array("Mulgore",215), 267 => Array("Hillsbrad Foothills",267), 331 => Array("Ashenvale",331), 357 => Array("Feralas",357), 361 => Array("Felwood",361), 394 => Array("Grizzly Hills",394), 400 => Array("Thousand Needles",400), 405 => Array("Desolace",405), 406 => Array("Stonetalon Mountains",406), 440 => Array("Tanaris",440), 457 => Array("The Veiled Sea",457), 490 => Array("Un Goro Crater",490), 491 => Array("Razorfen Kraul",491), 493 => Array("Moonglade",493), 495 => Array("Howling Fjord",495), 618 => Array("Winterspring",618), 717 => Array("The Stockade",717), 718 => Array("Wailing Caverns",718), 719 => Array("Blackfathom Deeps",719), 722 => Array("Razorfen Downs",722), 796 => Array("Scarlet Monastery",796), 978 => Array("Zul Farrak",978), 1176 => Array("Zul Farrak",1176), 1196 => Array("Utgarde Pinnacle",1196), 1337 => Array("Uldaman",1337), 1377 => Array("Silithus",1377), 1417 => Array("Sunken Temple",1417), 1497 => Array("Undercity",1497), 1519 => Array("Stormwind City",1519), 1537 => Array("Ironforge",1537), 1581 => Array("The Deadmines",1581), 1583 => Array("Blackrock Spire",1583), 1584 => Array("Blackrock Depths",1584), 1637 => Array("Orgrimmar",1637), 1638 => Array("Thunder Bluff",1638), 1657 => Array("Darnassus",1657), 2017 => Array("Stratholme",2017), 2057 => Array("Scholomance",2057), 2100 => Array("Maraudon",2100), 2158 => Array("Onyxias Lair",2158), 2257 => Array("Deeprun Tram",2257), 2366 => Array("The Black Morass",2366), 2367 => Array("Old Hillsbrad Foothills",2367), 2557 => Array("Dire Maul",2557), 2562 => Array("Karazhan",2562), 2597 => Array("PvP Alterac Valley",2597), 2677 => Array("Blackwing Lair",2677), 2717 => Array("Molten Core",2717), 2817 => Array("Crystalsong Forest",2817), 3277 => Array("PvP Warsong Gulch",3277), 3358 => Array("PvP Arathi Basin",3358), 3428 => Array("Temple of Ahn Qiraj",3428), 3429 => Array("Ruins of Ahn Qiraj",3429), 3430 => Array("Eversong Woods",3430), 3433 => Array("Ghostlands",3433), 3437 => Array("Ragefire Chasm",3437), 3456 => Array("Naxxramas",3456), 3477 => Array("Azjol Nerub",3477), 3483 => Array("Hellfire Peninsula",3483), 3487 => Array("Silvermoon city",3487), 3518 => Array("Nagrand",3518), 3519 => Array("Terokkar Forest",3519), 3520 => Array("Shadowmoon Valley",3520), 3521 => Array("Zangarmarsh",3521), 3522 => Array("Blades Edge Mountains",3522), 3523 => Array("Netherstorm",3523), 3524 => Array("Azuremyst Isle",3524), 3525 => Array("Bloodmyst Isle",3525), 3537 => Array("Borean Tundra",3537), 3557 => Array("The Exodar",3557), 3562 => Array("Hellfire Ramparts",3562), 3606 => Array("Hyjal Summit",3606), 3607 => Array("Serpentshrine Cavern",3607), 3618 => Array("Gruuls Lair",3618), 3698 => Array("The Ring of Trials",3698), 3702 => Array("PvP The Circle of Blood",3702), 3703 => Array("Shattrath City",3703), 3711 => Array("Sholazar Basin",3711), 3713 => Array("The Blood Furnace",3713), 3714 => Array("The Shattered Halls",3714), 3715 => Array("The Steamvault",3715), 3716 => Array("The Underbog",3716), 3717 => Array("The Slave Pens",3717), 3789 => Array("Shadow Labyrinth",3789), 3790 => Array("Auchenai Crypts",3790), 3791 => Array("Sethekk Halls",3791), 3792 => Array("Mana Tombs",3792), 3805 => Array("Zul Aman",3805), 3817 => Array("Testing",3817), 3820 => Array("PvP Eye of the Storm",3820), 3836 => Array("Magtheridons Lair",3836), 3842 => Array("The Eye",3842), 3846 => Array("The Arcatraz",3846), 3847 => Array("The Botanica",3847), 3849 => Array("The Mechanar",3849), 3959 => Array("Black Temple",3959), 3968 => Array("PvP Ruins of Lordaeron",3968), 4075 => Array("Sunwell Plateau",4075), 4080 => Array("Isle of Quel Danas",4080), 4095 => Array("Magisters Terrace",4095), 4100 => Array("The Culling of Stratholme",4100), 4120 => Array("The Nexus",4120), 4131 => Array("Magisters Terrace",4131), 4196 => Array("Drak Tharon Keep",4196), 4197 => Array("Wintergrasp",4197), 4228 => Array("The Oculus",4228), 4264 => Array("Halls of Stone",4264), 4272 => Array("Halls of Lightning",4272), 4273 => Array("Ulduar",4273), 4277 => Array("Azjol-Nerub",4277), 4298 => Array("The Scarlet Enclave",4298), 4375 => Array("Gundrak",4375), 4378 => Array("PvP Dalaran Sewers",4378), 4384 => Array("PvP Strand of the Ancients",4384), 4395 => Array("Dalaran",4395), 4406 => Array("PvP The Ring of Valor",4406), 4415 => Array("The Violet Hold Instance",4415), 4416 => Array("Gundrak Instance",4416), 4493 => Array("The Obsidian Sanctum",4493), 4494 => Array("Ahn kahet The Old Kingdom",4494), 4500 => Array("The Eye of Eternity",4500), 4603 => Array("Vault of Archavon",4603), 4710 => Array("PvP Isle of Conquest",4710), 4722 => Array("Trial of the Crusader",4722), 4723 => Array("Trial of the Champion",4723), 4742 => Array("Hrothgars Landing",4742), 4809 => Array("The Forge of Souls",4809), 4812 => Array("Icecrown Citadel",4812), 4813 => Array("Pit of Saron",4813), 4820 => Array("Halls of Reflection",4820) ); if(isset($zone_id[$id])) return($zone_id[$id][0]); else return('-'); } function RealmSelection($FormNameSufix = '') { global $html, $QueryItems, $System; $Output = ''; $DbResult = $this->Database->query('SELECT COUNT(*) FROM Realm WHERE Enabled=1'); $DbRow = $DbResult->fetch_row(); $RealmCount = $DbRow[0]; if($RealmCount > 1) { if(array_key_exists('page', $_GET)) $Target = '?page='.$_GET['page']; else $Target = ''; $Output .= '
'; } return($Output); } } ?>