function getStatisticsList($cat) { global $character, $mysql; $r = $mysql->getRows("select * from achievement where categoryId = ?1 AND (factionFlag = ?2 OR factionFlag = '-1') order by OrderInCategory", $cat, $character->getAlliance(), 'armory'); if (!$r) { exit; } foreach ($r as $row) { $achi[$row['id']]['ref'] = $row['refAchievement'] ? $row['refAchievement'] : $row['id']; $crit .= $achi[$row['id']]['ref'] . ','; $achi[$row['id']]['date'] = $character->achievement[$row['id']]; $achi[$row['id']]['progress'] = $character->achievement_progress; $achi[$row['id']]['name'] = $row['name']; $achi[$row['id']]['sort'] = $row['OrderInCategory']; $achi[$row['id']]['criteria'] = array(); $achi[$row['id']]['show'] = 1; $achi[$row['id']]['parent'] = $row['unk1']; } $r = $mysql->getRows("select * from achievement_criteria where referredAchievement IN (?1-1)", $crit, 'armory'); foreach ($achi as $key => $a) { foreach ($r as $row) { if ($row['referredAchievement'] == $a['ref']) { array_push($achi[$key]['criteria'], $row); } } } $r = $mysql->getRow("select name from achievement_category where id = ?1", $cat, 'armory'); echo '<div class="cat_header">' . $r['name'] . '</div>'; foreach ($achi as $achi_id => $a) { $i++; $pr = 0; if (count($a['criteria']) == 1) { foreach ($a['criteria'] as $crit) { $pr = $a['progress'][$crit['id']]['counter'] ? $a['progress'][$crit['id']]['counter'] : '--'; } } else { foreach ($a['criteria'] as $crit) { if (!$crit['name'] && $a['progress'][$crit['id']]['counter'] >= $crit['value']) { $pr++; } else { if ($crit['name'] && $cat != 147) { $pr += $a['progress'][$crit['id']]['counter']; } else { if ($crit['name'] && $a['progress'][$crit['id']]['counter'] >= $crit['value']) { $pr = $crit['name']; } } } } } if (in_array($achi_id, array(328, 753, 326, 333, 919, 334, 921, 1146, 1147, 1148, 331, 332, 1150))) { $pr = character::getGold($pr); } echo '<div class="stat_row ' . ($i % 2 ? 'zebra' : '') . '"><div style="float: right;"> ' . $pr . '</div>' . $a['name'] . '</div>'; } }
require 'init.php'; $c->add('main'); $c->assign('menu', $menu->output); $tp = new template(); $tp->add('item-info'); $itemData = $mysql->getRow("select * from item_template where entry = '?1'", (int) $_GET['i'], 'world'); if (!$itemData) { $_SYSTEM->error("Item not found!"); } $itemIcon = $mysql->getRow("select * from itemicon where itemnumber = ?1", $itemData['entry'], 'armory'); $itemIcon = validate_icon($itemIcon, $itemData['entry']); $tp->assign('itemicon', $itemIcon['itemicon']); $tp->assign('itemhtml', $itemIcon['itemhtml']); $tp->assign('itemcost', $itemData['BuyPrice'] ? '<span>Cost:</span><br>' . character::getGold($itemData['BuyPrice']) : ''); $tp->assign('sellfor', $itemData['SellPrice'] ? '<span>Sells for:</span><br>' . character::getGold($itemData['SellPrice']) : ''); if ($itemData['DisenchantID'] && $itemData['RequiredDisenchantSkill'] > -1) { $width = $itemData['RequiredDisenchantSkill'] / 450 * 100; $reqEnch = '<span>Disenchantable: </span><div class="skill-bar"> <b style="width: ' . $width . '%;"></b> <img class="staticTip" src="images/icons/icon-disenchant-sm.gif" onmouseover="setTipText(\'Requires <strong>' . $itemData['RequiredDisenchantSkill'] . '</strong> Enchanting to disenchant\');"> <strong class="staticTip" onmouseover="setTipText(\'Requires <strong>' . $itemData['RequiredDisenchantSkill'] . '</strong> Enchanting to disenchant\');">' . $itemData['RequiredDisenchantSkill'] . '</strong></div>'; } $tp->assign('reqenchanting', $reqEnch); $tp->assign('itemlevel', $itemData['ItemLevel'] . ($itemData['RequiredLevel'] > 0 ? ' (<span class="subClass">Req. ' . $itemData['RequiredLevel'] . '</span>)' : '')); // Drop $drop = $mysql->getRows("SELECT creature_template.name,creature_template.entry,creature_template.minlevel,creature_template.maxlevel,creature_loot_template.ChanceOrQuestChance\nFROM `creature_template`,`creature_loot_template`\nWHERE creature_template.entry = creature_loot_template.entry and creature_loot_template.item = ?1 order by creature_loot_template.ChanceOrQuestChance desc limit 20", $itemData['entry'], 'world'); if ($drop) { $dropTP = '<div class="rel-tab"><p class="rel-drop"/><h3>Dropped by:</h3></div> <div class="data" style="clear: both;"> <table class="data-table"><tbody><tr class="masthead"><td><a class="noLink">Name</a></td><td align="center"><a class="noLink">Level</a></td><td align="center"><a class="noLink">Location</a></td><td align="center"><a class="noLink">Drop Chance</a></td></tr>';
foreach ($achi as $achi_id => $a) { $i = 0; if (!$a['show']) { continue; } echo '<div onclick="AchReq(' . $achi_id . ',this);" class="ach_' . ($a['date'] ? 'c' : '') . 'show"><div class="icon-frame"><img src="' . str_replace('ajax/', '', $_DOMAIN) . 'images/icon/' . $a['icon'] . '.jpg" class="ach_icon"></div><div class="ach_' . ($a['date'] ? 'c' : '') . 'point">' . $a['points'] . '</div><div class="ach_title">' . $a['name'] . '</div><div class="ach_desc">' . $a['description'] . '</div><div id="ach_req_' . $achi_id . '" class="ach_req"><ul>'; if (count($a['criteria']) == 1) { foreach ($a['criteria'] as $crit) { if ($crit['completionFlag'] & 2) { continue; } if (!$a['progress'][$crit['id']]['counter']) { $a['progress'][$crit['id']]['counter'] = 0; } echo '</ul>'; echo '<div class="ach_bar" style=" width:100%;"><div class="bar" style="width: ' . $a['progress'][$crit['id']]['counter'] / $crit['value'] * 100 . '%;"></div><div class="pr">' . (in_array($crit['id'], array(3506, 3507, 3510, 3511, 3512)) ? character::getGold($a['progress'][$crit['id']]['counter']) : $a['progress'][$crit['id']]['counter'] . ' / ' . $crit['value']) . '</div></div>'; } } else { foreach ($a['criteria'] as $crit) { if ($crit['completionFlag'] & 2) { continue; } echo '<li style="width:48%; float: ' . ($i % 2 ? 'right' : 'left') . ';" class="' . ($a['progress'][$crit['id']]['counter'] >= $crit['value'] ? 'done' : '') . '">' . $crit['name'] . '</li>'; $i++; } echo '</ul>'; } echo '<br clear="all"></div><div class="ach_date">' . ($a['date'] ? date("d-m-Y H:i", $a['date']) : '') . '</div>' . ($a['reward'] ? '<div class="ach_reward">' . $a['reward'] . '</div>' : '') . '</div>'; } } else { $bcat = $mysql->getRows("SELECT * FROM `achievement_category` WHERE `parent` = '-1' AND `id` <> 1 ORDER BY `sortOrder`", 'armory');