<?php
/**
* Created by PhpStorm.
* User: nucleo
* Date: 25.06.2016
* Time: 16:02
*/
session_start();
session_write_close();
require_once "recaptchalib.php";
// ваш секретный ключ
$secret = "6LdGxxwTAAAAALgjVfT2wGIJ53XIVs6NN5c5DZ0H";
// пустой ответ
$response = null;
// проверка секретного ключа
$reCaptcha = new ReCaptcha($secret);
if ($_POST["g-recaptcha-response"]) {
$response = $reCaptcha->verifyResponse(
$_SERVER["REMOTE_ADDR"],
$_POST["g-recaptcha-response"]
);
}
if (isset($_POST['submit-login'])) {
if ($response != null && $response->success) {
$login = $_POST['login'];
$password = $_POST['password'];
// $q = mysql_query("SELECT * FROM `accounts` WHERE login='" . $login . "' AND password='" . base64_encode(pack("H*", hash('whirlpool', utf8_encode($password)))) . "';") or die(mysql_error());
$q = $db->select('accounts', "`login`='" . $login . "' AND `password`='" . base64_encode(pack("H*", hash('whirlpool', utf8_encode($password)))) . "';");
if (count($q) > 0) {
// $q1 = mysql_query("SELECT * FROM `accounts_info` WHERE login='" . $login . "';") or die(mysql_error());
$q1 = $db->select('accounts_info', "`login`='" . $login . "';");
if (!isset($q1[0]['balance']) OR $q1[0]['balance'] < 0) {
$balance = 0;
} else {
$balance = $q1[0]['balance'];
}
//$q2 = mysql_query("SELECT * FROM `characters` WHERE account_name='" . $login . "';") or die(mysql_error());
$q2 = $db->select('characters', "`account_name`='" . $login . "';");
$table ="";
foreach ($q2 as $key => $value) {
$golds = NULL;
if ($value['sex'] == 0) {
$sex = "0";
} else {
$sex = "1";
}
$onlinetimeH = round(($value['onlinetime'] / 60 / 60) - 0.5);
if ($onlinetimeH <= 0) {
$onlinetimeH = 0;
}
$tmin = $value['onlinetime'] / 60 / 60;
$onlinetimeM = ceil(($tmin - $onlinetimeH) * 60);
//$data = mysql_query("SELECT * FROM `character_subclasses` WHERE char_obj_id='" . $value['obj_Id'] . "';") or die('Не удалось получить данные из базы.' . mysql_error());
//$top = mysql_fetch_assoc($data);
$top = $db->select('character_subclasses', "`char_obj_id`='" . $value['obj_Id'] . "';");
//$data1 = mysql_query("SELECT * FROM `items` WHERE `item_id` ='4356' AND owner_id='" . $value['obj_Id'] . "';") or die('Не удалось получить золото из базы.' . mysql_error());
//$gold = mysql_fetch_assoc($data1);
$gold = $db->select('items', "`item_id` ='4356' AND `owner_id`='" . $value['obj_Id'] . "';");
$golds = $gold[0]['count'];
if ($golds == NULL) {
$golds = 0;
}
//$class1=mysql_fetch_assoc(mysql_query("select * from `class_list` where `id`='".$top['class_id']."'")) or die('Не удалось получить данные класса.'. mysql_error());
//$class2=explode("_", $class1['class_name']);
switch ($top[0]['class_id']) {
//HUMANS
case 0:
$clase = 'Human Fighter';
$race = 'HUMANS';
break;
case 1:
$clase = 'Human Warrior';
$race = 'HUMANS';
break;
case 2:
$clase = 'Gladiator';
$race = 'HUMANS';
break;
case 3:
$clase = 'Warlord';
$race = 'HUMANS';
break;
case 4:
$clase = 'Human Knight';
$race = 'HUMANS';
break;
case 5:
$clase = 'Paladin';
$race = 'HUMANS';
break;
case 6:
$clase = 'Dark Avenger';
$race = 'HUMANS';
break;
case 7:
$clase = 'Rogue';
$race = 'HUMANS';
break;
case 8:
$clase = 'Treasure Hunter';
$race = 'HUMANS';
break;
case 9:
$clase = 'Hawkeye';
$race = 'HUMANS';
break;
case 10:
$clase = 'Human Mage';
$race = 'HUMANS';
break;
case 11:
$clase = 'Human Wizard';
$race = 'HUMANS';
break;
case 12:
$clase = 'Sorcerer';
$race = 'HUMANS';
break;
case 13:
$clase = 'Necromancer';
$race = 'HUMANS';
break;
case 14:
$clase = 'Warlock';
$race = 'HUMANS';
break;
case 15:
$clase = 'Cleric';
$race = 'HUMANS';
break;
case 16:
$clase = 'Bishop';
$race = 'HUMANS';
break;
case 17:
$clase = 'Prophet';
$race = 'HUMANS';
break;
//ELVES
case 18:
$clase = 'Elven Fighter';
$race = 'ELVES';
break;
case 19:
$clase = 'Elven Knight';
$race = 'ELVES';
break;
case 20:
$clase = 'Temple Knight';
$race = 'ELVES';
break;
case 21:
$clase = 'Swordsinger';
$race = 'ELVES';
break;
case 22:
$clase = 'Elven Scout';
$race = 'ELVES';
break;
case 23:
$clase = 'Plainswalker';
$race = 'ELVES';
break;
case 24:
$clase = 'Silver Ranger';
$race = 'ELVES';
break;
case 25:
$clase = 'Elven Mage';
$race = 'ELVES';
break;
case 26:
$clase = 'Elven Wizard';
$race = 'ELVES';
break;
case 27:
$clase = 'Spellsinger';
$race = 'ELVES';
break;
case 28:
$clase = 'Elemental Summoner';
$race = 'ELVES';
break;
case 29:
$clase = 'Elven Oracle';
$race = 'ELVES';
break;
case 30:
$clase = 'Elven Elder';
$race = 'ELVES';
break;
//DARK ELVES
case 31:
$clase = 'Dark Elven Fighter';
$race = 'DARK ELVES';
break;
case 32:
$clase = 'Pallus Knight';
$race = 'DARK ELVES';
break;
case 33:
$clase = 'Shillien Knight';
$race = 'DARK ELVES';
break;
case 34:
$clase = 'Bladedancer';
$race = 'DARK ELVES';
break;
case 35:
$clase = 'Assasin';
$race = 'DARK ELVES';
break;
case 36:
$clase = 'Abyss Walker';
$race = 'DARK ELVES';
break;
case 37:
$clase = 'Phantom Ranger';
$race = 'DARK ELVES';
break;
case 38:
$clase = 'Dark Elven Mage';
$race = 'DARK ELVES';
break;
case 39:
$clase = 'Dark Wizard';
$race = 'DARK ELVES';
break;
case 40:
$clase = 'Spellhowler';
$race = 'DARK ELVES';
break;
case 41:
$clase = 'Phantom Summoner';
$race = 'DARK ELVES';
break;
case 42:
$clase = 'Shillien Oracle';
$race = 'DARK ELVES';
break;
case 43:
$clase = 'Shillien Elder';
$race = 'DARK ELVES';
break;
//ORCS
case 44:
$clase = 'Orc Fighter';
$race = 'ORCS';
break;
case 45:
$clase = 'Orc Raider';
$race = 'ORCS';
break;
case 46:
$clase = 'Destroyer';
$race = 'ORCS';
break;
case 47:
$clase = 'Monk';
$race = 'ORCS';
break;
case 48:
$clase = 'Tyrant';
$race = 'ORCS';
break;
case 49:
$clase = 'Orc Mage';
$race = 'ORCS';
break;
case 50:
$clase = 'Orc Shaman';
$race = 'ORCS';
break;
case 51:
$clase = 'Overlord';
$race = 'ORCS';
break;
case 52:
$clase = 'Warcryer';
$race = 'ORCS';
break;
//DWARVES
case 53:
$clase = 'Dwarven Fighter';
$race = 'DWARVES';
break;
case 54:
$clase = 'Scavenger';
$race = 'DWARVES';
break;
case 55:
$clase = 'Bounty Hunter';
$race = 'DWARVES';
break;
case 56:
$clase = 'Artisan';
$race = 'DWARVES';
break;
case 57:
$clase = 'Warsmith';
$race = 'DWARVES';
break;
//HUMANS 3rd Professions
case 88:
$clase = 'Duelist';
$race = 'HUMANS';
break;
case 89:
$clase = 'Dread Nought';
$race = 'HUMANS';
break;
case 90:
$clase = 'Phoenix Knight';
$race = 'HUMANS';
break;
case 91:
$clase = 'Hell Knight';
$race = 'HUMANS';
break;
case 92:
$clase = 'Sagittarius';
$race = 'HUMANS';
break;
case 93:
$clase = 'Adventurer';
$race = 'HUMANS';
break;
case 94:
$clase = 'Archmage';
$race = 'HUMANS';
break;
case 95:
$clase = 'Soul Traker';
$race = 'HUMANS';
break;
case 96:
$clase = 'Arcane Lord';
$race = 'HUMANS';
break;
case 97:
$clase = 'Cardinal';
$race = 'HUMANS';
break;
case 98:
$clase = 'Hierophant';
$race = 'HUMANS';
break;
//ELVES 3rd Professions
case 99:
$clase = 'Evas Templar';
$race = 'ELVES';
break;
case 100:
$clase = 'Sword Muse';
$race = 'ELVES';
break;
case 101:
$clase = 'Wind Rider';
$race = 'ELVES';
break;
case 102:
$clase = 'Moonlight Sentinel';
$race = 'ELVES';
break;
case 103:
$clase = 'Mystic Muse';
$race = 'ELVES';
break;
case 104:
$clase = 'Elemental Master';
$race = 'ELVES';
break;
case 105:
$clase = 'Evas Saint';
$race = 'ELVES';
break;
//DARK ELVES 3rd Professions
case 106:
$clase = 'Shillien Templar';
$race = 'DARK ELVES';
break;
case 107:
$clase = 'Spectral Dancer';
$race = 'DARK ELVES';
break;
case 108:
$clase = 'Ghost Hunter';
$race = 'DARK ELVES';
break;
case 109:
$clase = 'Ghost Sentinel';
$race = 'DARK ELVES';
break;
case 110:
$clase = 'Storm Screamer';
$race = 'DARK ELVES';
break;
case 111:
$clase = 'Spectral Master';
$race = 'DARK ELVES';
break;
case 112:
$clase = 'Shillien Saint';
$race = 'DARK ELVES';
break;
//ORCS 3rd Professions
case 113:
$clase = 'Titan';
$race = 'ORCS';
break;
case 114:
$clase = 'Grand Khauatari';
$race = 'ORCS';
break;
case 115:
$clase = 'Dominator';
$race = 'ORCS';
break;
case 116:
$clase = 'Doomcryer';
$race = 'ORCS';
break;
//DWARVES 3rd Professions
case 117:
$clase = 'Fortune Seeker';
$race = 'DWARVES';
break;
case 118:
$clase = 'Maestro';
$race = 'DWARVES';
break;
case 123:
$clase = 'Kamael Male Soldier';
$race = 'KAMAEL';
break;
case 124:
$clase = 'Kamael Female Soldier';
$race = 'KAMAEL';
break;
case 125:
$clase = 'Kamael Male Trooper';
$race = 'KAMAEL';
break;
case 126:
$clase = 'Kamael Female Warder';
$race = 'KAMAEL';
break;
case 127:
$clase = 'Kamael Male Berserker';
$race = 'KAMAEL';
break;
case 128:
$clase = 'Kamael Male Soulbreaker';
$race = 'KAMAEL';
break;
case 129:
$clase = 'Kamael Female Soulbreaker';
$race = 'KAMAEL';
break;
case 130:
$clase = 'Kamael Female Arbalester';
$race = 'KAMAEL';
break;
case 131:
$clase = 'Kamael Male Doombringer';
$race = 'KAMAEL';
break;
case 132:
$clase = 'Kamael Male Soulhound';
$race = 'KAMAEL';
break;
case 133:
$clase = 'Kamael Female Soulhound';
$race = 'KAMAEL';
break;
case 134:
$clase = 'Kamael Female Trickster';
$race = 'KAMAEL';
break;
case 135:
$clase = 'Kamael Inspector';
$race = 'KAMAEL';
break;
case 136:
$clase = 'Kamael Judicator';
$race = 'KAMAEL';
break;
default:
$clase = 'n/a';
$race = 'n/a';
}
if (($sex == 0) && ($race == "DWARVES")) {
$img = '<img width="36px" height="36px" src="/img/face/dwarf_male.jpg" alt="' . $race . '"';
}
if (($sex == 1) && ($race == "DWARVES")) {
$img = '<img width="36px" height="36px" src="/img/face/dwarf_female.jpg" alt="' . $race . '"';
}
if (($sex == 0) && ($race == "DARK ELVES")) {
$img = '<img width="36px" height="36px" src="/img/face/darkelf_male.jpg" alt="' . $race . '"';
}
if (($sex == 1) && ($race == "DARK ELVES")) {
$img = '<img width="36px" height="36px" src="/img/face/darkelf_female.jpg" alt="' . $race . '"';
}
if (($sex == 0) && ($race == "HUMANS")) {
$img = '<img width="36px" height="36px" src="/img/face/human_male.jpg" alt="' . $race . '"';
}
if (($sex == 1) && ($race == "HUMANS")) {
$img = '<img width="36px" height="36px" src="/img/face/human_female.jpg" alt="' . $race . '"';
}
if (($sex == 0) && ($race == "ELVES")) {
$img = '<img width="36px" height="36px" src="/img/face/elf_male.jpg" alt="' . $race . '"';
}
if (($sex == 1) && ($race == "ELVES")) {
$img = '<img width="36px" height="36px" src="/img/face/elf_female.jpg" alt="' . $race . '"';
}
if (($sex == 0) && ($race == "ORCS")) {
$img = '<img width="36px" height="36px" src="/img/face/orc_male.jpg" alt="' . $race . '"';
}
if (($sex == 1) && ($race == "ORCS")) {
$img = '<img width="36px" height="36px" src="/img/face/orc_female.jpg" alt="' . $race . '"';
}
if (($sex == 0) && ($race == "KAMAEL")) {
$img = '<img width="36px" height="36px" src="/img/face/kamael_male.jpg" alt="' . $race . '"';
}
if (($sex == 1) && ($race == "KAMAEL")) {
$img = '<img width="36px" height="36px" src="/img/face/kamael_female.jpg" alt="' . $race . '"';
}
$table .= "<tr>";
$table .= "<td id='char_name'>" . $value['char_name'] . "</td>";
$table .= "<td>" . $top[0]['level'] . "</td>";
$table .= "<td>" . $value['pvpkills'] . "/" . $value['pkkills'] . "</td>";
$table .= "<td>" . $value['karma'] . "</td>";
$table .= "<td>" . $clase . "</td>";
$table .= "<td>" . $img . "</td>";
$table .= "<td>" . $onlinetimeH . " часов " . $onlinetimeM . " минут</td>";
$table .= "<td>" . $value['online'] . "</td>";
$table .= "<td class='link'><a class='gold' href='' data-id='" . $value['obj_Id'] . "' data-name='" . $value['char_name'] . "'>" . $golds . "</a></td>";
$table .= "</tr>";
}
session_start();
$_SESSION["login"] = $q[0]['login'];
$_SESSION["login_time"] = time();
$_SESSION["logged_in"] = 1;
session_write_close();
} else {
$error = "Неверное имя пользователя или пароль.";
}
} else {
$error = "OMFG. Кажеться вы робот.";
}
} elseif (isset($_SESSION['login'])) {
//$q = mysql_query("SELECT * FROM `accounts` WHERE login='" . $_SESSION['login'] . "';") or die(mysql_error());
$q = $db->select('accounts', "`login`='" . $_SESSION['login'] . "';");
if ($q === FALSE) {
$error = 'Произошла ошибка. Попробуйте снова!';
} else {
//$q1 = mysql_query("SELECT * FROM `accounts_info` WHERE login='" . $_SESSION['login'] . "';") or die(mysql_error());
$q1 = $db->select('accounts_info', "`login`='" . $_SESSION['login'] . "';");
if (!isset($q1[0]['balance']) OR $q1[0]['balance'] < 0) {
$balance = 0;
} else {
$balance = $q1[0]['balance'];
}
//$q2 = mysql_query("SELECT * FROM `characters` WHERE account_name='" . $_SESSION['login'] . "';") or die(mysql_error());
$q2 = $db->select('characters', "`account_name`='" . $_SESSION['login'] . "';");
$table ="";
foreach ($q2 as $key => $value) {
$golds = NULL;
if ($value['sex'] == 0) {
$sex = "0";
} else {
$sex = "1";
}
$onlinetimeH = round(($value['onlinetime'] / 60 / 60) - 0.5);
if ($onlinetimeH <= 0) {
$onlinetimeH = 0;
}
$tmin = $value['onlinetime'] / 60 / 60;
$onlinetimeM = ceil(($tmin - $onlinetimeH) * 60);
//$data = mysql_query("SELECT * FROM `character_subclasses` WHERE char_obj_id='" . $value['obj_Id'] . "';") or die('Не удалось получить данные из базы.' . mysql_error());
//$top = mysql_fetch_assoc($data);
$top = $db->select('character_subclasses', "`char_obj_id`='" . $value['obj_Id'] . "';");
//$data1 = mysql_query("SELECT * FROM `items` WHERE `item_id` ='4356' AND owner_id='" . $value['obj_Id'] . "';") or die('Не удалось получить золото из базы.' . mysql_error());
//$gold = mysql_fetch_assoc($data1);
$gold = $db->select('items', "`item_id` ='4356' AND `owner_id`='" . $value['obj_Id'] . "';");
$golds = $gold[0]['count'];
if ($golds == NULL) {
$golds = 0;
}
//$class1=mysql_fetch_assoc(mysql_query("select * from `class_list` where `id`='".$top['class_id']."'")) or die('Не удалось получить данные класса.'. mysql_error());
//$class2=explode("_", $class1['class_name']);
switch ($top[0]['class_id']) {
//HUMANS
case 0:
$clase = 'Human Fighter';
$race = 'HUMANS';
break;
case 1:
$clase = 'Human Warrior';
$race = 'HUMANS';
break;
case 2:
$clase = 'Gladiator';
$race = 'HUMANS';
break;
case 3:
$clase = 'Warlord';
$race = 'HUMANS';
break;
case 4:
$clase = 'Human Knight';
$race = 'HUMANS';
break;
case 5:
$clase = 'Paladin';
$race = 'HUMANS';
break;
case 6:
$clase = 'Dark Avenger';
$race = 'HUMANS';
break;
case 7:
$clase = 'Rogue';
$race = 'HUMANS';
break;
case 8:
$clase = 'Treasure Hunter';
$race = 'HUMANS';
break;
case 9:
$clase = 'Hawkeye';
$race = 'HUMANS';
break;
case 10:
$clase = 'Human Mage';
$race = 'HUMANS';
break;
case 11:
$clase = 'Human Wizard';
$race = 'HUMANS';
break;
case 12:
$clase = 'Sorcerer';
$race = 'HUMANS';
break;
case 13:
$clase = 'Necromancer';
$race = 'HUMANS';
break;
case 14:
$clase = 'Warlock';
$race = 'HUMANS';
break;
case 15:
$clase = 'Cleric';
$race = 'HUMANS';
break;
case 16:
$clase = 'Bishop';
$race = 'HUMANS';
break;
case 17:
$clase = 'Prophet';
$race = 'HUMANS';
break;
//ELVES
case 18:
$clase = 'Elven Fighter';
$race = 'ELVES';
break;
case 19:
$clase = 'Elven Knight';
$race = 'ELVES';
break;
case 20:
$clase = 'Temple Knight';
$race = 'ELVES';
break;
case 21:
$clase = 'Swordsinger';
$race = 'ELVES';
break;
case 22:
$clase = 'Elven Scout';
$race = 'ELVES';
break;
case 23:
$clase = 'Plainswalker';
$race = 'ELVES';
break;
case 24:
$clase = 'Silver Ranger';
$race = 'ELVES';
break;
case 25:
$clase = 'Elven Mage';
$race = 'ELVES';
break;
case 26:
$clase = 'Elven Wizard';
$race = 'ELVES';
break;
case 27:
$clase = 'Spellsinger';
$race = 'ELVES';
break;
case 28:
$clase = 'Elemental Summoner';
$race = 'ELVES';
break;
case 29:
$clase = 'Elven Oracle';
$race = 'ELVES';
break;
case 30:
$clase = 'Elven Elder';
$race = 'ELVES';
break;
//DARK ELVES
case 31:
$clase = 'Dark Elven Fighter';
$race = 'DARK ELVES';
break;
case 32:
$clase = 'Pallus Knight';
$race = 'DARK ELVES';
break;
case 33:
$clase = 'Shillien Knight';
$race = 'DARK ELVES';
break;
case 34:
$clase = 'Bladedancer';
$race = 'DARK ELVES';
break;
case 35:
$clase = 'Assasin';
$race = 'DARK ELVES';
break;
case 36:
$clase = 'Abyss Walker';
$race = 'DARK ELVES';
break;
case 37:
$clase = 'Phantom Ranger';
$race = 'DARK ELVES';
break;
case 38:
$clase = 'Dark Elven Mage';
$race = 'DARK ELVES';
break;
case 39:
$clase = 'Dark Wizard';
$race = 'DARK ELVES';
break;
case 40:
$clase = 'Spellhowler';
$race = 'DARK ELVES';
break;
case 41:
$clase = 'Phantom Summoner';
$race = 'DARK ELVES';
break;
case 42:
$clase = 'Shillien Oracle';
$race = 'DARK ELVES';
break;
case 43:
$clase = 'Shillien Elder';
$race = 'DARK ELVES';
break;
//ORCS
case 44:
$clase = 'Orc Fighter';
$race = 'ORCS';
break;
case 45:
$clase = 'Orc Raider';
$race = 'ORCS';
break;
case 46:
$clase = 'Destroyer';
$race = 'ORCS';
break;
case 47:
$clase = 'Monk';
$race = 'ORCS';
break;
case 48:
$clase = 'Tyrant';
$race = 'ORCS';
break;
case 49:
$clase = 'Orc Mage';
$race = 'ORCS';
break;
case 50:
$clase = 'Orc Shaman';
$race = 'ORCS';
break;
case 51:
$clase = 'Overlord';
$race = 'ORCS';
break;
case 52:
$clase = 'Warcryer';
$race = 'ORCS';
break;
//DWARVES
case 53:
$clase = 'Dwarven Fighter';
$race = 'DWARVES';
break;
case 54:
$clase = 'Scavenger';
$race = 'DWARVES';
break;
case 55:
$clase = 'Bounty Hunter';
$race = 'DWARVES';
break;
case 56:
$clase = 'Artisan';
$race = 'DWARVES';
break;
case 57:
$clase = 'Warsmith';
$race = 'DWARVES';
break;
//HUMANS 3rd Professions
case 88:
$clase = 'Duelist';
$race = 'HUMANS';
break;
case 89:
$clase = 'Dread Nought';
$race = 'HUMANS';
break;
case 90:
$clase = 'Phoenix Knight';
$race = 'HUMANS';
break;
case 91:
$clase = 'Hell Knight';
$race = 'HUMANS';
break;
case 92:
$clase = 'Sagittarius';
$race = 'HUMANS';
break;
case 93:
$clase = 'Adventurer';
$race = 'HUMANS';
break;
case 94:
$clase = 'Archmage';
$race = 'HUMANS';
break;
case 95:
$clase = 'Soul Traker';
$race = 'HUMANS';
break;
case 96:
$clase = 'Arcane Lord';
$race = 'HUMANS';
break;
case 97:
$clase = 'Cardinal';
$race = 'HUMANS';
break;
case 98:
$clase = 'Hierophant';
$race = 'HUMANS';
break;
//ELVES 3rd Professions
case 99:
$clase = 'Evas Templar';
$race = 'ELVES';
break;
case 100:
$clase = 'Sword Muse';
$race = 'ELVES';
break;
case 101:
$clase = 'Wind Rider';
$race = 'ELVES';
break;
case 102:
$clase = 'Moonlight Sentinel';
$race = 'ELVES';
break;
case 103:
$clase = 'Mystic Muse';
$race = 'ELVES';
break;
case 104:
$clase = 'Elemental Master';
$race = 'ELVES';
break;
case 105:
$clase = 'Evas Saint';
$race = 'ELVES';
break;
//DARK ELVES 3rd Professions
case 106:
$clase = 'Shillien Templar';
$race = 'DARK ELVES';
break;
case 107:
$clase = 'Spectral Dancer';
$race = 'DARK ELVES';
break;
case 108:
$clase = 'Ghost Hunter';
$race = 'DARK ELVES';
break;
case 109:
$clase = 'Ghost Sentinel';
$race = 'DARK ELVES';
break;
case 110:
$clase = 'Storm Screamer';
$race = 'DARK ELVES';
break;
case 111:
$clase = 'Spectral Master';
$race = 'DARK ELVES';
break;
case 112:
$clase = 'Shillien Saint';
$race = 'DARK ELVES';
break;
//ORCS 3rd Professions
case 113:
$clase = 'Titan';
$race = 'ORCS';
break;
case 114:
$clase = 'Grand Khauatari';
$race = 'ORCS';
break;
case 115:
$clase = 'Dominator';
$race = 'ORCS';
break;
case 116:
$clase = 'Doomcryer';
$race = 'ORCS';
break;
//DWARVES 3rd Professions
case 117:
$clase = 'Fortune Seeker';
$race = 'DWARVES';
break;
case 118:
$clase = 'Maestro';
$race = 'DWARVES';
break;
case 123:
$clase = 'Kamael Male Soldier';
$race = 'KAMAEL';
break;
case 124:
$clase = 'Kamael Female Soldier';
$race = 'KAMAEL';
break;
case 125:
$clase = 'Kamael Male Trooper';
$race = 'KAMAEL';
break;
case 126:
$clase = 'Kamael Female Warder';
$race = 'KAMAEL';
break;
case 127:
$clase = 'Kamael Male Berserker';
$race = 'KAMAEL';
break;
case 128:
$clase = 'Kamael Male Soulbreaker';
$race = 'KAMAEL';
break;
case 129:
$clase = 'Kamael Female Soulbreaker';
$race = 'KAMAEL';
break;
case 130:
$clase = 'Kamael Female Arbalester';
$race = 'KAMAEL';
break;
case 131:
$clase = 'Kamael Male Doombringer';
$race = 'KAMAEL';
break;
case 132:
$clase = 'Kamael Male Soulhound';
$race = 'KAMAEL';
break;
case 133:
$clase = 'Kamael Female Soulhound';
$race = 'KAMAEL';
break;
case 134:
$clase = 'Kamael Female Trickster';
$race = 'KAMAEL';
break;
case 135:
$clase = 'Kamael Inspector';
$race = 'KAMAEL';
break;
case 136:
$clase = 'Kamael Judicator';
$race = 'KAMAEL';
break;
default:
$clase = 'n/a';
$race = 'n/a';
}
if (($sex == 0) && ($race == "DWARVES")) {
$img = '<img width="36px" height="36px" src="img/face/dwarf_male.jpg" alt="' . $race . '"';
}
if (($sex == 1) && ($race == "DWARVES")) {
$img = '<img width="36px" height="36px" src="img/face/dwarf_female.jpg" alt="' . $race . '"';
}
if (($sex == 0) && ($race == "DARK ELVES")) {
$img = '<img width="36px" height="36px" src="img/face/darkelf_male.jpg" alt="' . $race . '"';
}
if (($sex == 1) && ($race == "DARK ELVES")) {
$img = '<img width="36px" height="36px" src="img/face/darkelf_female.jpg" alt="' . $race . '"';
}
if (($sex == 0) && ($race == "HUMANS")) {
$img = '<img width="36px" height="36px" src="img/face/human_male.jpg" alt="' . $race . '"';
}
if (($sex == 1) && ($race == "HUMANS")) {
$img = '<img width="36px" height="36px" src="img/face/human_female.jpg" alt="' . $race . '"';
}
if (($sex == 0) && ($race == "ELVES")) {
$img = '<img width="36px" height="36px" src="img/face/elf_male.jpg" alt="' . $race . '"';
}
if (($sex == 1) && ($race == "ELVES")) {
$img = '<img width="36px" height="36px" src="img/face/elf_female.jpg" alt="' . $race . '"';
}
if (($sex == 0) && ($race == "ORCS")) {
$img = '<img width="36px" height="36px" src="img/face/orc_male.jpg" alt="' . $race . '"';
}
if (($sex == 1) && ($race == "ORCS")) {
$img = '<img width="36px" height="36px" src="img/face/orc_female.jpg" alt="' . $race . '"';
}
if (($sex == 0) && ($race == "KAMAEL")) {
$img = '<img width="36px" height="36px" src="img/face/kamael_male.jpg" alt="' . $race . '"';
}
if (($sex == 1) && ($race == "KAMAEL")) {
$img = '<img width="36px" height="36px" src="img/face/kamael_female.jpg" alt="' . $race . '"';
}
$table .= "<tr>";
$table .= "<td id='char_name'>" . $value['char_name'] . "</td>";
$table .= "<td>" . $top[0]['level'] . "</td>";
$table .= "<td>" . $value['pvpkills'] . "/" . $value['pkkills'] . "</td>";
$table .= "<td>" . $value['karma'] . "</td>";
$table .= "<td>" . $clase . "</td>";
$table .= "<td>" . $img . "</td>";
$table .= "<td>" . $onlinetimeH . " часов " . $onlinetimeM . " минут</td>";
$table .= "<td>" . $value['online'] . "</td>";
$table .= "<td class='link'><a class='gold' href='' data-id='" . $value['obj_Id'] . "' data-name='" . $value['char_name'] . "'>" . $golds . "</a></td>";
$table .= "</tr>";
}
}
}
if ($_SESSION["logged_in"] != 1) {
$lc = array();
$template->set("lc", $lc);
$template->display("lc_login");
} else {
$lc = array(
"q" => $q[0],
"q1" => $q1[0],
"q2" => $q2,
"login" => $q[0]['login'],
"email" => $q1[0]['email'],
"last_ip" => $q[0]['last_ip'],
"balance" => $balance,
"last_access" => date("d-m-y / h:i", $q['last_access']),
"wallet" => $wallet,
"table" => $table,
);
$template->set("lc", $lc);
$template->display("lc");
}